From 2a56f1cec9becef94300549467b3c3160ab27ed8 Mon Sep 17 00:00:00 2001 From: Jeremy Simon Date: Mon, 26 Jan 2004 20:01:36 +0000 Subject: [PATCH] Add SVQ3 specific flags to qtdemux and ffmpeg Original commit message from CVS: 2004-01-26 Jeremy Simon * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps), (gst_ffmpeg_caps_to_extradata), (gst_ffmpeg_caps_to_pixfmt): * gst/qtdemux/qtdemux.c: (plugin_init), (qtdemux_parse_trak), (qtdemux_video_caps): * gst/qtdemux/qtdemux.h: Add SVQ3 specific flags to qtdemux and ffmpeg --- common | 2 +- ext/ffmpeg/gstffmpegcodecmap.c | 47 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/common b/common index c81ad07..0bcde34 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit c81ad072c76522175cbddead96d6f3c448068d67 +Subproject commit 0bcde342015b96d9a6ba3b9d9102e2a543399d96 diff --git a/ext/ffmpeg/gstffmpegcodecmap.c b/ext/ffmpeg/gstffmpegcodecmap.c index 7631733..22af45f 100644 --- a/ext/ffmpeg/gstffmpegcodecmap.c +++ b/ext/ffmpeg/gstffmpegcodecmap.c @@ -193,7 +193,11 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id, case CODEC_ID_SVQ3: caps = GST_FF_VID_CAPS_NEW ("video/x-svq", - "svqversion", G_TYPE_INT, 3, + "svqversion", G_TYPE_INT, 3, + "halfpel_flag", GST_TYPE_INT_RANGE, G_MININT, G_MAXINT, + "thirdpel_flag", GST_TYPE_INT_RANGE, G_MININT, G_MAXINT, + "low_delay", GST_TYPE_INT_RANGE, G_MININT, G_MAXINT, + "unknown_svq3_flag", GST_TYPE_INT_RANGE, G_MININT, G_MAXINT, NULL); break; @@ -663,6 +667,45 @@ gst_ffmpeg_caps_to_extradata (const GstCaps *caps, g_warning ("Unknown wma version %d\n", wmaversion); break; } + + return; + } + + if (!strcmp(mimetype, "video/x-svq")) { + gint version = 0; + + if (!gst_structure_get_int (structure, "svqversion", &version)) { + g_warning ("invalid caps for video/x-svq"); + return; + } + + if (version == 3) { + gint halfpel_flag, thirdpel_flag, low_delay, unknown_svq3_flag; + guint16 flags; + + if (!gst_structure_get_int (structure, "halfpel_flag", &halfpel_flag) || + !gst_structure_get_int (structure, "thirdpel_flag", &thirdpel_flag) || + !gst_structure_get_int (structure, "low_delay", &low_delay) || + !gst_structure_get_int (structure, "unknown_svq3_flag", &unknown_svq3_flag)) { + g_warning ("invalid caps for video/x-svq"); + return; + } + + context->extradata = (guint8 *) g_malloc0 (0x64); + g_stpcpy (context->extradata, "SVQ3"); + flags = 1 << 3; + flags |= low_delay; + flags = flags << 2; + flags |= unknown_svq3_flag; + flags = flags << 6; + flags |= halfpel_flag; + flags = flags << 1; + flags |= thirdpel_flag; + flags = flags << 3; + + memcpy (context->extradata + 0x62, &flags, 2); + context->extradata_size = 0x64; + } } } @@ -789,6 +832,8 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps *caps, } } } + + gst_ffmpeg_caps_to_extradata (caps, context); } /* Convert a GstCaps and a FFMPEG codec Type to a -- 2.7.4