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,6 +886,21 @@ 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;
gst_structure_get_fraction (structure, "framerate", &fps_n, &fps_d);
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);
res = g_list_append (res, buf);
//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");
@ -912,7 +927,8 @@ gst_ogg_mux_get_headers (GstOggPad * pad)
GST_LOG_OBJECT (thepad, "streamheader is not fixed list");
}
} else {
GST_LOG_OBJECT (thepad, "caps done have streamheader");
GST_LOG_OBJECT (thepad, "caps don't have streamheader");
}
}
gst_caps_unref (caps);
} else {