Add SVQ3 specific flags to qtdemux and ffmpeg

Original commit message from CVS:
2004-01-26  Jeremy Simon  <jesimon@libertysurf.fr>
* 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
This commit is contained in:
Jeremy Simon 2004-01-26 20:01:35 +00:00
parent ea159699b8
commit 98fc4bf118
3 changed files with 65 additions and 3 deletions

View file

@ -1,3 +1,12 @@
2004-01-26 Jeremy Simon <jesimon@libertysurf.fr>
* 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
2004-01-26 Benjamin Otte <in7y118@public.uni-hamburg.de>
* gst-libs/gst/audio/audio.h:

View file

@ -152,7 +152,7 @@ static void qtdemux_parse(GstQTDemux *qtdemux, GNode *node, void *buffer, int le
static QtNodeType *qtdemux_type_get(guint32 fourcc);
static void qtdemux_node_dump(GstQTDemux *qtdemux, GNode *node);
static void qtdemux_parse_tree(GstQTDemux *qtdemux);
static GstCaps *qtdemux_video_caps(GstQTDemux *qtdemux, guint32 fourcc);
static GstCaps *qtdemux_video_caps(GstQTDemux *qtdemux, guint32 fourcc, const guint8 *stsd_data);
static GstCaps *qtdemux_audio_caps(GstQTDemux *qtdemux, guint32 fourcc);
static GType gst_qtdemux_get_type (void)
@ -248,6 +248,9 @@ plugin_init (GstPlugin *plugin)
if (!gst_library_load ("gstbytestream"))
return FALSE;
if (!gst_library_load ("gstgetbits"))
return FALSE;
return gst_element_register (plugin, "qtdemux",
GST_RANK_PRIMARY, GST_TYPE_QTDEMUX);
}
@ -1278,7 +1281,7 @@ static void qtdemux_parse_trak(GstQTDemux *qtdemux, GNode *trak)
g_print("frame count: %u\n", QTDEMUX_GUINT16_GET(stsd->data+offset+48));
stream->caps = qtdemux_video_caps(qtdemux,
QTDEMUX_FOURCC_GET(stsd->data+offset+4));
QTDEMUX_FOURCC_GET(stsd->data+offset+4), stsd->data);
g_print("caps %s\n",gst_caps_to_string(stream->caps));
}else if(stream->subtype == FOURCC_soun){
int version;
@ -1481,7 +1484,7 @@ done2:
}
static GstCaps *qtdemux_video_caps(GstQTDemux *qtdemux, guint32 fourcc)
static GstCaps *qtdemux_video_caps(GstQTDemux *qtdemux, guint32 fourcc, const guint8 *stsd_data)
{
switch(fourcc){
case GST_MAKE_FOURCC('j','p','e','g'):
@ -1494,6 +1497,55 @@ static GstCaps *qtdemux_video_caps(GstQTDemux *qtdemux, guint32 fourcc)
/* Motion-JPEG (format B) */
return gst_caps_from_string ("image/jpeg");
case GST_MAKE_FOURCC('S','V','Q','3'):
if (stsd_data != NULL) {
gst_getbits_t gb;
gint halfpel_flag;
gint thirdpel_flag;
gint unknown_svq3_flag;
gint low_delay;
gint size;
size = QTDEMUX_GUINT32_GET(stsd_data + 16);
gst_getbits_init (&gb, NULL, NULL);
gst_getbits_newbuf (&gb, (unsigned char *)stsd_data + 98 + 16 + 4 , (size - 102 + 16));
/* Infos ripped from ffmpeg see libavcodec/svq3.c */
/* 'frame size code' and optional 'width, height' */
if (gst_getbitsn (&gb, 3) == 7) {
gst_getbitsn (&gb, 12);
gst_getbitsn (&gb, 12);
}
halfpel_flag = gst_get1bit (&gb);
thirdpel_flag = gst_get1bit (&gb);
/* unknown fields */
gst_get1bit (&gb);
gst_get1bit (&gb);
gst_get1bit (&gb);
gst_get1bit (&gb);
low_delay = gst_get1bit (&gb);
/* unknown field */
gst_get1bit (&gb);
while (gst_get1bit (&gb)) {
gst_getbitsn (&gb, 8);
}
unknown_svq3_flag = gst_get1bit (&gb);
return gst_caps_new_simple ("video/x-svq",
"svqversion", G_TYPE_INT, 3,
"halfpel_flag", G_TYPE_INT, halfpel_flag,
"thirdpel_flag", G_TYPE_INT, thirdpel_flag,
"low_delay", G_TYPE_INT, low_delay,
"unknown_svq3_flag", G_TYPE_INT, unknown_svq3_flag,
NULL);
}
return gst_caps_from_string ("video/x-svq, "
"svqversion = (int) 3");
case GST_MAKE_FOURCC('s','v','q','i'):

View file

@ -23,6 +23,7 @@
#include <gst/gst.h>
#include <gst/bytestream/bytestream.h>
#include <gst/getbits/getbits.h>
#ifdef __cplusplus
extern "C" {