Revert last two changes and do it my way. :)

Original commit message from CVS:
Revert last two changes and do it my way.  :)
This commit is contained in:
David Schleef 2003-06-19 19:36:26 +00:00
parent fc881ebfed
commit 52340ac706

View file

@ -154,7 +154,7 @@ static void qtdemux_parse(GstQTDemux *qtdemux, GNode *node, void *buffer, int le
static QtNodeType *qtdemux_type_get(guint32 fourcc); static QtNodeType *qtdemux_type_get(guint32 fourcc);
static void qtdemux_node_dump(GstQTDemux *qtdemux, GNode *node); static void qtdemux_node_dump(GstQTDemux *qtdemux, GNode *node);
static void qtdemux_parse_tree(GstQTDemux *qtdemux); static void qtdemux_parse_tree(GstQTDemux *qtdemux);
static GstCaps *qtdemux_video_caps(GstQTDemux *qtdemux, guint32 fourcc, gint width, gint height); static GstCaps *qtdemux_video_caps(GstQTDemux *qtdemux, guint32 fourcc);
static GstCaps *qtdemux_audio_caps(GstQTDemux *qtdemux, guint32 fourcc); static GstCaps *qtdemux_audio_caps(GstQTDemux *qtdemux, guint32 fourcc);
static GType gst_qtdemux_get_type (void) static GType gst_qtdemux_get_type (void)
@ -555,13 +555,9 @@ void gst_qtdemux_add_stream(GstQTDemux *qtdemux, QtDemuxStream *stream)
GST_PAD_TEMPLATE_GET (src_video_templ), g_strdup_printf ("video_%02d", GST_PAD_TEMPLATE_GET (src_video_templ), g_strdup_printf ("video_%02d",
qtdemux->n_video_streams)); qtdemux->n_video_streams));
if(stream->caps){ if(stream->caps){
if(gst_caps_has_property(stream->caps,"width")){
gst_caps_set(stream->caps,"width",GST_PROPS_INT(stream->width)); gst_caps_set(stream->caps,"width",GST_PROPS_INT(stream->width));
}
if(gst_caps_has_property(stream->caps,"height")){
gst_caps_set(stream->caps,"height",GST_PROPS_INT(stream->height)); gst_caps_set(stream->caps,"height",GST_PROPS_INT(stream->height));
} }
}
qtdemux->n_video_streams++; qtdemux->n_video_streams++;
}else{ }else{
stream->pad = gst_pad_new_from_template ( stream->pad = gst_pad_new_from_template (
@ -1305,9 +1301,7 @@ static void qtdemux_parse_trak(GstQTDemux *qtdemux, GNode *trak)
g_print("frame count: %u\n", QTDEMUX_GUINT16_GET(stsd->data+offset+48)); g_print("frame count: %u\n", QTDEMUX_GUINT16_GET(stsd->data+offset+48));
stream->caps = qtdemux_video_caps(qtdemux, stream->caps = qtdemux_video_caps(qtdemux,
QTDEMUX_FOURCC_GET(stsd->data+offset+4), QTDEMUX_FOURCC_GET(stsd->data+offset+4));
QTDEMUX_GUINT16_GET(stsd->data+offset+32),
QTDEMUX_GUINT16_GET(stsd->data+offset+34));
g_print("caps %s\n",gst_caps_to_string(stream->caps)); g_print("caps %s\n",gst_caps_to_string(stream->caps));
}else if(stream->subtype == FOURCC_soun){ }else if(stream->subtype == FOURCC_soun){
int version; int version;
@ -1504,66 +1498,49 @@ done2:
gst_qtdemux_add_stream(qtdemux,stream); gst_qtdemux_add_stream(qtdemux,stream);
} }
#ifdef G_HAVE_ISO_VARARGS
#define GST_QT_CAPS_NEW(name, mime, ...) \ static GstCaps *qtdemux_video_caps(GstQTDemux *qtdemux, guint32 fourcc)
GST_CAPS_NEW (name, mime, \
"width", GST_PROPS_INT (width), \
"height", GST_PROPS_INT (height), \
__VA_ARGS__)
#elif defined(G_HAVE_GNUC_VARARGS)
#define GST_QT_CAPS_NEW(name, mime, props...) \
GST_CAPS_NEW (name, mime, \
"width", GST_PROPS_INT (width), \
"height", GST_PROPS_INT (height), \
props)
#endif
static GstCaps *qtdemux_video_caps(GstQTDemux *qtdemux, guint32 fourcc,
gint width, gint height)
{ {
switch(fourcc){ switch(fourcc){
case GST_MAKE_FOURCC('j','p','e','g'): case GST_MAKE_FOURCC('j','p','e','g'):
/* JPEG */ /* JPEG */
return GST_CAPS_NEW("jpeg_caps","video/jpeg",NULL);
case GST_MAKE_FOURCC('m','j','p','a'): case GST_MAKE_FOURCC('m','j','p','a'):
/* Motion-JPEG (format A) */ /* Motion-JPEG (format A) */
return GST_CAPS_NEW("mjpa_caps","video/jpeg",NULL);
case GST_MAKE_FOURCC('m','j','p','b'): case GST_MAKE_FOURCC('m','j','p','b'):
/* Motion-JPEG (format B) */ /* Motion-JPEG (format B) */
return GST_QT_CAPS_NEW("jpeg_caps","video/jpeg",NULL); return GST_CAPS_NEW("mjpa_caps","video/jpeg",NULL);
case GST_MAKE_FOURCC('S','V','Q','3'): case GST_MAKE_FOURCC('S','V','Q','3'):
return GST_QT_CAPS_NEW("SVQ3_caps","video/x-svq", return GST_CAPS_NEW("SVQ3_caps","video/x-svq",
"svqversion", GST_PROPS_INT(3),NULL); "svqversion", GST_PROPS_INT(3),NULL);
case GST_MAKE_FOURCC('s','v','q','i'): case GST_MAKE_FOURCC('s','v','q','i'):
case GST_MAKE_FOURCC('S','V','Q','1'): case GST_MAKE_FOURCC('S','V','Q','1'):
return GST_QT_CAPS_NEW("SVQ1_caps","video/x-svq", return GST_CAPS_NEW("SVQ1_caps","video/x-svq",
"svqversion", GST_PROPS_INT(1),NULL); "svqversion", GST_PROPS_INT(1),NULL);
case GST_MAKE_FOURCC('r','a','w',' '): case GST_MAKE_FOURCC('r','a','w',' '):
/* uncompressed RGB */ /* uncompressed RGB */
return GST_QT_CAPS_NEW("raw__caps","video/raw", return GST_CAPS_NEW("raw__caps","video/raw",
"format",GST_PROPS_FOURCC(GST_MAKE_FOURCC('R','G','B',' '))); "format",GST_PROPS_FOURCC(GST_MAKE_FOURCC('R','G','B',' ')));
case GST_MAKE_FOURCC('Y','u','v','2'): case GST_MAKE_FOURCC('Y','u','v','2'):
/* uncompressed YUV2 */ /* uncompressed YUV2 */
return GST_QT_CAPS_NEW("Yuv2_caps","video/raw", return GST_CAPS_NEW("Yuv2_caps","video/raw",
"format",GST_PROPS_FOURCC(GST_MAKE_FOURCC('Y','U','V','2'))); "format",GST_PROPS_FOURCC(GST_MAKE_FOURCC('Y','U','V','2')));
case GST_MAKE_FOURCC('m','p','e','g'): case GST_MAKE_FOURCC('m','p','e','g'):
/* MPEG */ /* MPEG */
return GST_QT_CAPS_NEW("mpeg_caps","video/mpeg",NULL); return GST_CAPS_NEW("mpeg_caps","video/mpeg",NULL);
case GST_MAKE_FOURCC('g','i','f',' '): case GST_MAKE_FOURCC('g','i','f',' '):
return GST_QT_CAPS_NEW("gif__caps","image/gif",NULL); return GST_CAPS_NEW("gif__caps","image/gif",NULL);
case GST_MAKE_FOURCC('h','2','6','3'): case GST_MAKE_FOURCC('h','2','6','3'):
/* H.263 */ /* H.263 */
/* ffmpeg uses the height/width props, don't know why */ /* ffmpeg uses the height/width props, don't know why */
return GST_QT_CAPS_NEW("h263_caps","video/h263", NULL); return GST_CAPS_NEW("h263_caps","video/h263",NULL);
case GST_MAKE_FOURCC('m','p','4','v'): case GST_MAKE_FOURCC('m','p','4','v'):
/* MPEG-4 */ /* MPEG-4 */
return GST_QT_CAPS_NEW("mp4v_caps", "video/mpeg", return GST_CAPS_NEW("mp4v_caps", "video/mpeg",
"mpegversion", GST_PROPS_INT(4), "mpegversion",GST_PROPS_INT(4));
"systemstream", GST_PROPS_BOOLEAN(FALSE), NULL);
case GST_MAKE_FOURCC('3','I','V','1'): case GST_MAKE_FOURCC('3','I','V','1'):
return GST_QT_CAPS_NEW("3IV1_caps", "video/3ivx",NULL); return GST_CAPS_NEW("3IV1_caps", "video/3ivx",NULL);
case GST_MAKE_FOURCC('r','p','z','a'): case GST_MAKE_FOURCC('r','p','z','a'):
case GST_MAKE_FOURCC('c','v','i','d'): case GST_MAKE_FOURCC('c','v','i','d'):
/* Cinepak */ /* Cinepak */