diff options
author | David Schleef <ds@schleef.org> | 2008-04-22 06:18:04 +0000 |
---|---|---|
committer | David Schleef <ds@schleef.org> | 2008-04-22 06:18:04 +0000 |
commit | 809f8542cfc74bf1e5d202251a637a63a1436267 (patch) | |
tree | 892fff8f56028deaed854d64af124773e0e6b555 | |
parent | ac9e02c1d9181a7f7bd96954bb919621f0341c3c (diff) |
ext/ogg/gstoggmux.c: Update Ogg/Dirac muxing. Removes the weird "KW-DIRAC" bos packet. Should conform to what we cu...
Original commit message from CVS:
* ext/ogg/gstoggmux.c:
Update Ogg/Dirac muxing. Removes the weird "KW-DIRAC" bos
packet. Should conform to what we currently think is the
final Ogg/Dirac muxing spec.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | ext/ogg/gstoggmux.c | 56 |
2 files changed, 29 insertions, 34 deletions
@@ -1,5 +1,12 @@ 2008-04-21 David Schleef <ds@schleef.org> + * ext/ogg/gstoggmux.c: + Update Ogg/Dirac muxing. Removes the weird "KW-DIRAC" bos + packet. Should conform to what we currently think is the + final Ogg/Dirac muxing spec. + +2008-04-21 David Schleef <ds@schleef.org> + * sys/xvimage/xvimagesink.c: Fix typo that causes the overlay keying color to bright green on a 16-bit display. Dark grey good. Bright green bad. diff --git a/ext/ogg/gstoggmux.c b/ext/ogg/gstoggmux.c index 2c7649d8..3a4341e3 100644 --- a/ext/ogg/gstoggmux.c +++ b/ext/ogg/gstoggmux.c @@ -818,49 +818,37 @@ gst_ogg_mux_get_headers (GstOggPad * pad) const GValue *streamheader; structure = gst_caps_get_structure (caps, 0); - if (strcmp (gst_structure_get_name (structure), "video/x-dirac") == 0) { - GstBuffer *buf = gst_buffer_new_and_alloc (16); - int fps_n = 12; - int fps_d = 1; + streamheader = gst_structure_get_value (structure, "streamheader"); + if (streamheader != NULL) { + GST_LOG_OBJECT (thepad, "got header"); + if (G_VALUE_TYPE (streamheader) == GST_TYPE_ARRAY) { + GArray *bufarr = g_value_peek_pointer (streamheader); + gint i; - gst_structure_get_fraction (structure, "framerate", &fps_n, &fps_d); + GST_LOG_OBJECT (thepad, "got fixed list"); - memcpy (GST_BUFFER_DATA (buf), "KW-DIRAC", 8); - GST_WRITE_UINT32_BE (GST_BUFFER_DATA (buf) + 8, fps_n); - GST_WRITE_UINT32_BE (GST_BUFFER_DATA (buf) + 12, fps_d); + for (i = 0; i < bufarr->len; i++) { + GValue *bufval = &g_array_index (bufarr, GValue, i); - res = g_list_append (res, buf); + GST_LOG_OBJECT (thepad, "item %d", i); + if (G_VALUE_TYPE (bufval) == GST_TYPE_BUFFER) { + GstBuffer *buf = g_value_peek_pointer (bufval); - //res = g_list_append (res, gst_buffer_ref(pad->buffer)); - } else { - streamheader = gst_structure_get_value (structure, "streamheader"); - if (streamheader != NULL) { - GST_LOG_OBJECT (thepad, "got header"); - if (G_VALUE_TYPE (streamheader) == GST_TYPE_ARRAY) { - GArray *bufarr = g_value_peek_pointer (streamheader); - gint i; - - GST_LOG_OBJECT (thepad, "got fixed list"); - - for (i = 0; i < bufarr->len; i++) { - GValue *bufval = &g_array_index (bufarr, GValue, i); - - GST_LOG_OBJECT (thepad, "item %d", i); - if (G_VALUE_TYPE (bufval) == GST_TYPE_BUFFER) { - GstBuffer *buf = g_value_peek_pointer (bufval); + GST_LOG_OBJECT (thepad, "adding item %d to header list", i); - GST_LOG_OBJECT (thepad, "adding item %d to header list", i); - - gst_buffer_ref (buf); - res = g_list_append (res, buf); - } + gst_buffer_ref (buf); + res = g_list_append (res, buf); } - } else { - GST_LOG_OBJECT (thepad, "streamheader is not fixed list"); } } else { - GST_LOG_OBJECT (thepad, "caps don't have streamheader"); + GST_LOG_OBJECT (thepad, "streamheader is not fixed list"); } + } else if (gst_structure_has_name (structure, "video/x-dirac")) { + res = g_list_append (res, pad->buffer); + pad->buffer = pad->next_buffer; + pad->next_buffer = NULL; + } else { + GST_LOG_OBJECT (thepad, "caps don't have streamheader"); } gst_caps_unref (caps); } else { |