ensonic gst-plugins-good: gst-plugins-good/ gst-plugins-good/gst/avi/

[email protected] Tue, 16 Dec 2008 03:57:15 -0800 (PST)
Newsgroups gmane.comp.video.gstreamer.cvs
Message-ID <[email protected]>
CVS Root:       /cvs/gstreamer
Module:         gst-plugins-good
Changes by:     ensonic
Date:           Tue Dec 16 2008  11:57:15 UTC

Log message:
	* gst/avi/gstavimux.c:
	* gst/avi/gstavimux.h:
	  Totally remove the internal taglists and fully use tagsetter.

Modified files:
    .               : ChangeLog
    gst/avi         : gstavimux.c gstavimux.h

Links:
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/ChangeLog.diff?r1=1.3865&r2=1.3866
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/avi/gstavimux.c.diff?r1=1.110&r2=1.111
http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-good/gst/avi/gstavimux.h.diff?r1=1.19&r2=1.20

====Begin Diffs====
Index: ChangeLog
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-good/ChangeLog,v
retrieving revision 1.3865
retrieving revision 1.3866
diff -u -d -r1.3865 -r1.3866
--- ChangeLog	15 Dec 2008 15:59:51 -0000	1.3865
+++ ChangeLog	16 Dec 2008 11:56:59 -0000	1.3866
@@ -1,3 +1,9 @@
+2008-12-16  Stefan Kost  <[email protected]>
+
+	* gst/avi/gstavimux.c:
+	* gst/avi/gstavimux.h:
+	  Totally remove the internal taglists and fully use tagsetter.
 2008-12-15  Stefan Kost  <[email protected]>
 
 	* gst/avi/gstavimux.c:
Index: gstavimux.c
RCS file: /cvs/gstreamer/gst-plugins-good/gst/avi/gstavimux.c,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -d -r1.110 -r1.111
--- gstavimux.c	15 Dec 2008 15:59:53 -0000	1.110
+++ gstavimux.c	16 Dec 2008 11:57:00 -0000	1.111
@@ -383,15 +383,6 @@
   avimux->avi_hdr.max_bps = 10000000;
   avimux->codec_data_size = 0;
-  if (avimux->tags) {
-    gst_tag_list_free (avimux->tags);
-    avimux->tags = NULL;
-  }
-  if (avimux->tags_snap) {
-    gst_tag_list_free (avimux->tags_snap);
-    avimux->tags_snap = NULL;
-
   g_free (avimux->idx);
   avimux->idx = NULL;
@@ -958,8 +949,7 @@
 static GstBuffer *
 gst_avi_mux_riff_get_avi_header (GstAviMux * avimux)
 {
-  GstTagList *tags;
-  const GstTagList *iface_tags;
+  const GstTagList *tags;
   GstBuffer *buffer;
   guint8 *buffdata;
   guint size = 0;
@@ -972,24 +962,13 @@
   GST_DEBUG_OBJECT (avimux, "creating avi header, data_size %u, idx_size %u",
       avimux->data_size, avimux->idx_size);
-  /* need to take snapshot of tags now */
-  iface_tags = gst_tag_setter_get_tag_list (GST_TAG_SETTER (avimux));
-  if ((iface_tags || avimux->tags) && !avimux->tags_snap) {
-    /* gst_tag_list_merge() will handle NULL for either or both lists fine */
-    tags = gst_tag_list_merge (iface_tags, avimux->tags,
-        gst_tag_setter_get_tag_merge_mode (GST_TAG_SETTER (avimux)));
-    gst_tag_list_add (tags, GST_TAG_MERGE_REPLACE, GST_TAG_ENCODER,
-        PACKAGE_STRING " AVI muxer", NULL);
-  } else {
-    tags = avimux->tags_snap;
-  avimux->tags_snap = tags;
+  tags = gst_tag_setter_get_tag_list (GST_TAG_SETTER (avimux));
+  if (tags) {
     /* that should be the strlen of all tags + header sizes
      * not all of tags end up in a avi, still this is a good estimate
      */
-    gchar *str = gst_structure_to_string (avimux->tags_snap);
-    size += strlen (str) + 8 * gst_structure_n_fields (avimux->tags_snap);
+    gchar *str = gst_structure_to_string (tags);
+    size += strlen (str) + 8 * gst_structure_n_fields (tags);
     g_free (str);
   }
@@ -1689,10 +1668,11 @@
   switch (GST_EVENT_TYPE (event)) {
     case GST_EVENT_TAG:{
       GstTagList *list;
+      GstTagSetter *setter = GST_TAG_SETTER (avimux);
+      const GstTagMergeMode mode = gst_tag_setter_get_tag_merge_mode (setter);
       gst_event_parse_tag (event, &list);
-      avimux->tags = gst_tag_list_merge (avimux->tags, list,
-          gst_tag_setter_get_tag_merge_mode (GST_TAG_SETTER (avimux)));
+      gst_tag_setter_merge_tags (setter, list, mode);
       break;
     }
     default:
Index: gstavimux.h
RCS file: /cvs/gstreamer/gst-plugins-good/gst/avi/gstavimux.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- gstavimux.h	29 Jun 2008 19:52:51 -0000	1.19
+++ gstavimux.h	16 Dec 2008 11:57:01 -0000	1.20
@@ -148,10 +148,6 @@
   gboolean write_header;
   gboolean restart;
-  /* tags */
-  GstTagList *tags_snap;
   /* information about the AVI index ('idx') */
   gst_riff_index_entry *idx;
   gint idx_index, idx_count;

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/