From: <tp...@ke...> - 2006-06-28 11:20:17
|
CVS Root: /cvs/gstreamer Module: gst-plugins-ugly Changes by: tpm Date: Wed Jun 28 2006 11:20:15 UTC Log message: * gst/asfdemux/gstasfdemux.c: (gst_asf_demux_setup_pad), (gst_asf_demux_add_audio_stream), (gst_asf_demux_add_video_stream), (gst_asf_demux_push_buffer): * gst/asfdemux/gstasfdemux.h: Handle unknown codec IDs/fourccs properly (#345879); send tag events after newsegment event; fix use of GST_FOURCC_FORMAT macro. Modified files: . : ChangeLog gst/asfdemux : gstasfdemux.c gstasfdemux.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-ugly/ChangeLog.diff?r1=1.2055&r2=1.2056 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-ugly/gst/asfdemux/gstasfdemux.c.diff?r1=1.100&r2=1.101 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-ugly/gst/asfdemux/gstasfdemux.h.diff?r1=1.20&r2=1.21 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-ugly/ChangeLog,v retrieving revision 1.2055 retrieving revision 1.2056 diff -u -d -r1.2055 -r1.2056 --- ChangeLog 23 Jun 2006 16:29:41 -0000 1.2055 +++ ChangeLog 28 Jun 2006 11:20:03 -0000 1.2056 @@ -1,3 +1,13 @@ +2006-06-28 Tim-Philipp Müller <tim at centricular dot net> + + * gst/asfdemux/gstasfdemux.c: (gst_asf_demux_setup_pad), + (gst_asf_demux_add_audio_stream), (gst_asf_demux_add_video_stream), + (gst_asf_demux_push_buffer): + * gst/asfdemux/gstasfdemux.h: + Handle unknown codec IDs/fourccs properly (#345879); send tag + events after newsegment event; fix use of GST_FOURCC_FORMAT + macro. 2006-06-23 Jan Schmidt <th...@ma...> * ext/a52dec/gsta52dec.c: (plugin_init): Index: gstasfdemux.c RCS file: /cvs/gstreamer/gst-plugins-ugly/gst/asfdemux/gstasfdemux.c,v retrieving revision 1.100 retrieving revision 1.101 diff -u -d -r1.100 -r1.101 --- gstasfdemux.c 10 May 2006 14:40:03 -0000 1.100 +++ gstasfdemux.c 28 Jun 2006 11:20:03 -0000 1.101 @@ -809,7 +809,7 @@ static void gst_asf_demux_setup_pad (GstASFDemux * demux, GstPad * src_pad, - GstCaps * caps, guint16 id, gboolean is_video) + GstCaps * caps, guint16 id, gboolean is_video, GstTagList * tags) { asf_stream_context *stream; @@ -835,6 +835,7 @@ stream->fps_known = !is_video; /* bit hacky for audio */ stream->is_video = is_video; stream->need_newsegment = TRUE; + stream->pending_tags = tags; gst_pad_set_element_private (src_pad, stream); @@ -844,20 +845,13 @@ ++demux->num_streams; gst_element_add_pad (GST_ELEMENT (demux), src_pad); - - /* FIXME */ -#if 0 - if (demux->taglist) { - /* ... push tag event downstream ... */ - } -#endif } gst_asf_demux_add_audio_stream (GstASFDemux * demux, asf_stream_audio * audio, guint16 id, guint8 ** p_data, guint64 * p_size) - GstTagList *list = gst_tag_list_new (); + GstTagList *tags = NULL; GstBuffer *extradata = NULL; GstPad *src_pad; GstCaps *caps; @@ -887,10 +881,18 @@ caps = gst_riff_create_audio_caps (audio->codec_tag, NULL, (gst_riff_strf_auds *) audio, extradata, NULL, &codec_name); + if (caps == NULL) { + caps = gst_caps_new_simple ("audio/x-asf-unknown", "codec_id", + G_TYPE_INT, (gint) audio->codec_tag, NULL); + } /* Informing about that audio format we just added */ - gst_tag_list_add (list, GST_TAG_MERGE_APPEND, GST_TAG_AUDIO_CODEC, - codec_name, NULL); - g_free (codec_name); + if (codec_name) { + tags = gst_tag_list_new (); + gst_tag_list_add (tags, GST_TAG_MERGE_APPEND, GST_TAG_AUDIO_CODEC, + codec_name, NULL); + g_free (codec_name); if (extradata) gst_buffer_unref (extradata); @@ -900,17 +902,15 @@ ++demux->num_audio_streams; - gst_asf_demux_setup_pad (demux, src_pad, caps, id, FALSE); - gst_element_found_tags_for_pad (GST_ELEMENT (demux), src_pad, list); + gst_asf_demux_setup_pad (demux, src_pad, caps, id, FALSE, tags); -static void +static gboolean gst_asf_demux_add_video_stream (GstASFDemux * demux, asf_stream_video_format * video, guint16 id, guint8 ** p_data, guint64 * p_size) @@ -929,27 +929,35 @@ gst_asf_demux_get_buffer (&extradata, size_left, p_data, p_size); } + GST_DEBUG ("video codec %" GST_FOURCC_FORMAT, GST_FOURCC_ARGS (video->tag)); /* yes, asf_stream_video_format and gst_riff_strf_vids are the same */ caps = gst_riff_create_video_caps (video->tag, NULL, (gst_riff_strf_vids *) video, extradata, NULL, &codec_name); - gst_tag_list_add (list, GST_TAG_MERGE_APPEND, GST_TAG_VIDEO_CODEC, + caps = gst_caps_new_simple ("video/x-asf-unknown", "fourcc", + GST_TYPE_FOURCC, video->tag, NULL); + gst_tag_list_add (tags, GST_TAG_MERGE_APPEND, GST_TAG_VIDEO_CODEC, - GST_INFO ("Adding video stream %u codec " GST_FOURCC_FORMAT " (0x%08x)", + GST_INFO ("Adding video stream %u codec %" GST_FOURCC_FORMAT " (0x%08x)", demux->num_video_streams, GST_FOURCC_ARGS (video->tag), video->tag); gst_caps_set_simple (caps, "framerate", GST_TYPE_FRACTION, 25, 1, NULL); ++demux->num_video_streams; - gst_asf_demux_setup_pad (demux, src_pad, caps, id, TRUE); + gst_asf_demux_setup_pad (demux, src_pad, caps, id, TRUE, tags); static GstFlowReturn @@ -1767,6 +1775,14 @@ stream->need_newsegment = FALSE; + /* need to send tags? */ + if (stream->pending_tags) { + GST_LOG_OBJECT (demux, "tags %" GST_PTR_FORMAT, stream->pending_tags); + gst_element_found_tags_for_pad (GST_ELEMENT (demux), stream->pad, + stream->pending_tags); + stream->pending_tags = NULL; /* don't set the same time stamp on multiple consecutive outgoing * video buffers, set it on the first one and set NONE on the others, * it's the decoder's job to fill the missing bits properly */ Index: gstasfdemux.h RCS file: /cvs/gstreamer/gst-plugins-ugly/gst/asfdemux/gstasfdemux.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- gstasfdemux.h 1 Jun 2006 21:11:40 -0000 1.20 +++ gstasfdemux.h 28 Jun 2006 11:20:03 -0000 1.21 @@ -60,6 +60,8 @@ GstBuffer *cache; GstCaps *caps; + GstTagList *pending_tags; } asf_stream_context; typedef enum { |