ext/ogg/: Add/remove KW-DIRAC header here, since it is ogg-specific.

Original commit message from CVS:
* ext/ogg/gstoggdemux.c:
* ext/ogg/gstoggmux.c:
Add/remove KW-DIRAC header here, since it is ogg-specific.
This commit is contained in:
David Schleef 2006-11-04 07:25:58 +00:00
parent 977b68d779
commit e10b075e5d
3 changed files with 44 additions and 18 deletions

View file

@ -1,3 +1,9 @@
2006-11-03 David Schleef <ds@schleef.org>
* ext/ogg/gstoggdemux.c:
* ext/ogg/gstoggmux.c:
Add/remove KW-DIRAC header here, since it is ogg-specific.
2006-11-03 Michael Smith <msmith@fluendo.com>
* gst/typefind/gsttypefindfunctions.c: (mpeg4_video_type_find):

View file

@ -1092,6 +1092,10 @@ gst_ogg_pad_submit_packet (GstOggPad * pad, ogg_packet * packet)
}
}
if (granule != -1 && memcmp (packet->packet, "KW-DIRAC", 8) == 0) {
return GST_FLOW_OK;
}
/* no start time known, stream to internal plugin to
* get time. always stream to the skeleton decoder */
if (pad->start_time == GST_CLOCK_TIME_NONE || pad->is_skeleton) {

View file

@ -886,33 +886,49 @@ gst_ogg_mux_get_headers (GstOggPad * pad)
const GValue *streamheader;
structure = gst_caps_get_structure (caps, 0);
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;
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;
GST_LOG_OBJECT (thepad, "got fixed list");
gst_structure_get_fraction (structure, "framerate", &fps_n, &fps_d);
for (i = 0; i < bufarr->len; i++) {
GValue *bufval = &g_array_index (bufarr, GValue, i);
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);
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, buf);
GST_LOG_OBJECT (thepad, "adding item %d to header list", i);
//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_buffer_ref (buf);
res = g_list_append (res, buf);
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_buffer_ref (buf);
res = g_list_append (res, buf);
}
}
} else {
GST_LOG_OBJECT (thepad, "streamheader is not fixed list");
}
} else {
GST_LOG_OBJECT (thepad, "streamheader is not fixed list");
GST_LOG_OBJECT (thepad, "caps don't have streamheader");
}
} else {
GST_LOG_OBJECT (thepad, "caps done have streamheader");
}
gst_caps_unref (caps);
} else {