From: <so...@fr...> - 2005-12-27 19:07:20
|
CVS Root: /cvs/gstreamer Module: gst-plugins-ugly Changes by: soto Date: Tue Dec 27 2005 11:06:20 PST Log message: 2005-12-27 Martin Soto <mar...@us...> * gst/mpegstream/gstdvddemux.c (AUDIO_CAPS) (gst_dvd_demux_get_audio_stream): Use audio/x-lpcm as mimetype for LPCM. * gstmpegdemux.h: * gstmpegdemux.c (gst_mpeg_demux_get_video_stream) (gst_mpeg_demux_get_audio_stream): * gst/mpegstream/gstdvddemux.c (gst_dvd_demux_get_video_stream) (gst_dvd_demux_get_audio_stream) (gst_dvd_demux_get_subpicture_stream) (gst_dvd_demux_send_subbuffer): Send current* pad buffers with appropriate caps. Modified files: . : ChangeLog gst/iec958 : ac3iec.c gst/mpegstream : gstdvddemux.c gstmpegdemux.c gstmpegdemux.h Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-ugly/ChangeLog.diff?r1=1.1926&r2=1.1927 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-ugly/gst/iec958/ac3iec.c.diff?r1=1.12&r2=1.13 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-ugly/gst/mpegstream/gstdvddemux.c.diff?r1=1.29&r2=1.30 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-ugly/gst/mpegstream/gstmpegdemux.c.diff?r1=1.82&r2=1.83 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-ugly/gst/mpegstream/gstmpegdemux.h.diff?r1=1.22&r2=1.23 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-ugly/ChangeLog,v retrieving revision 1.1926 retrieving revision 1.1927 diff -u -d -r1.1926 -r1.1927 --- ChangeLog 26 Dec 2005 17:48:32 -0000 1.1926 +++ ChangeLog 27 Dec 2005 19:06:07 -0000 1.1927 @@ -1,3 +1,18 @@ +2005-12-27 Martin Soto <mar...@us...> + + * gst/mpegstream/gstdvddemux.c (AUDIO_CAPS) + (gst_dvd_demux_get_audio_stream): Use audio/x-lpcm as mimetype for + LPCM. + * gstmpegdemux.h: + * gstmpegdemux.c (gst_mpeg_demux_get_video_stream) + (gst_mpeg_demux_get_audio_stream): + * gst/mpegstream/gstdvddemux.c (gst_dvd_demux_get_video_stream) + (gst_dvd_demux_get_audio_stream) + (gst_dvd_demux_get_subpicture_stream) + (gst_dvd_demux_send_subbuffer): + Send current* pad buffers with appropriate caps. 2005-12-26 Martin Soto <mar...@us...> * gst/iec958/ac3iec.h: Index: gstdvddemux.c RCS file: /cvs/gstreamer/gst-plugins-ugly/gst/mpegstream/gstdvddemux.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- gstdvddemux.c 19 Dec 2005 17:26:47 -0000 1.29 +++ gstdvddemux.c 27 Dec 2005 19:06:08 -0000 1.30 @@ -83,7 +83,7 @@ GST_STATIC_CAPS ( \ "audio/mpeg, " \ "mpegversion = (int) 1;" \ - "audio/x-dvd-lpcm, " \ + "audio/x-lpcm, " \ "width = (int) { 16, 20, 24 }, " \ "rate = (int) { 48000, 96000 }, " \ "channels = (int) [ 1, 8 ], " \ @@ -456,19 +456,19 @@ gint mpeg_version = *((gint *) info); if (dvd_demux->mpeg_version != mpeg_version) { - GstCaps *caps; - - caps = gst_caps_new_simple ("video/mpeg", + str->caps = gst_caps_new_simple ("video/mpeg", "mpegversion", G_TYPE_INT, mpeg_version, "systemstream", G_TYPE_BOOLEAN, FALSE, NULL); - if (!gst_pad_set_caps (dvd_demux->cur_video, caps)) { + if (!gst_pad_set_caps (dvd_demux->cur_video, str->caps)) { GST_ELEMENT_ERROR (GST_ELEMENT (mpeg_demux), CORE, NEGOTIATION, (NULL), ("failed to set caps")); + gst_caps_unref (str->caps); + str->caps = NULL; + return str; } else { dvd_demux->mpeg_version = mpeg_version; } - gst_caps_unref (caps); } dvd_demux->mpeg_version = mpeg_version; @@ -484,7 +484,6 @@ GstMPEGStream *str; GstDVDLPCMStream *lpcm_str = NULL; gboolean add_pad = FALSE; - GstCaps *caps; const gchar *codec = NULL, *lang_code = NULL; g_return_val_if_fail (stream_nr < GST_MPEG_DEMUX_NUM_AUDIO_STREAMS, NULL); @@ -576,7 +575,7 @@ /* Determine the number of channels. */ channels = ((sample_info >> 8) & 0x7) + 1; - caps = gst_caps_new_simple ("audio/x-dvd-lpcm", + str->caps = gst_caps_new_simple ("audio/x-lpcm", "width", G_TYPE_INT, width, "rate", G_TYPE_INT, rate, "channels", G_TYPE_INT, channels, @@ -595,12 +594,12 @@ break; case GST_DVD_DEMUX_AUDIO_AC3: - caps = gst_caps_new_simple ("audio/x-ac3", NULL); + str->caps = gst_caps_new_simple ("audio/x-ac3", NULL); codec = "AC-3 audio"; case GST_DVD_DEMUX_AUDIO_DTS: - caps = gst_caps_new_simple ("audio/x-dts", NULL); + str->caps = gst_caps_new_simple ("audio/x-dts", NULL); codec = "DTS audio"; @@ -609,15 +608,18 @@ - if (!gst_pad_set_caps (str->pad, caps)) { + if (!gst_pad_set_caps (str->pad, str->caps)) { CORE, NEGOTIATION, (NULL), ("failed to set caps on pad %s:%s", gst_element_get_name (dvd_demux), gst_pad_get_name (str->pad))); if (str->number == dvd_demux->cur_audio_nr) { /* This is the current audio stream. Use the same caps. */ - if (!gst_pad_set_caps (dvd_demux->cur_audio, gst_caps_copy (caps))) { + if (!gst_pad_set_caps (dvd_demux->cur_audio, str->caps)) { GST_ELEMENT_ERROR (GST_ELEMENT (mpeg_demux), CORE, NEGOTIATION, (NULL), ("failed to set caps on pad %s:%s", gst_element_get_name (dvd_demux), @@ -668,7 +670,6 @@ GstDVDDemux *dvd_demux = GST_DVD_DEMUX (mpeg_demux); gchar *name; const gchar *lang_code = NULL; @@ -697,24 +698,26 @@ if (str->type != GST_DVD_DEMUX_SUBP_DVD) { /* We need to set new caps for this pad. */ - caps = gst_caps_new_simple ("video/x-dvd-subpicture", NULL); + str->caps = gst_caps_new_simple ("video/x-dvd-subpicture", NULL); if (str->number == dvd_demux->cur_subpicture_nr) { /* This is the current subpicture stream. Use the same caps. */ - if (!gst_pad_set_caps (dvd_demux->cur_subpicture, caps)) { + if (!gst_pad_set_caps (dvd_demux->cur_subpicture, str->caps)) { gst_element_get_name (dvd_demux), gst_pad_get_name (str->pad))); } if (add_pad) { gst_element_add_pad (GST_ELEMENT (mpeg_demux), str->pad); @@ -950,6 +953,7 @@ GST_BUFFER_TIMESTAMP (outbuf) = timestamp; GST_BUFFER_OFFSET (outbuf) = GST_BUFFER_OFFSET (buffer) + offset; + gst_buffer_set_caps (outbuf, outstream->caps); ret = gst_pad_push (outpad, outbuf); Index: gstmpegdemux.c RCS file: /cvs/gstreamer/gst-plugins-ugly/gst/mpegstream/gstmpegdemux.c,v retrieving revision 1.82 retrieving revision 1.83 diff -u -d -r1.82 -r1.83 --- gstmpegdemux.c 19 Dec 2005 17:26:47 -0000 1.82 +++ gstmpegdemux.c 27 Dec 2005 19:06:08 -0000 1.83 @@ -299,7 +299,6 @@ GstMPEGVideoStream *video_str; gboolean set_caps = FALSE; g_return_val_if_fail (stream_nr < GST_MPEG_DEMUX_NUM_VIDEO_STREAMS, NULL); @@ -332,17 +331,17 @@ GstTagList *list; - gst_caps_unref (caps); return str; gst_element_add_pad (GST_ELEMENT (mpeg_demux), str->pad); /* Store the current values. */ @@ -366,7 +365,6 @@ { @@ -402,16 +400,16 @@ - caps = gst_caps_new_simple ("audio/mpeg", + str->caps = gst_caps_new_simple ("audio/mpeg", "mpegversion", G_TYPE_INT, 1, NULL); /* stream metadata */ Index: gstmpegdemux.h RCS file: /cvs/gstreamer/gst-plugins-ugly/gst/mpegstream/gstmpegdemux.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- gstmpegdemux.h 19 Dec 2005 17:26:47 -0000 1.22 +++ gstmpegdemux.h 27 Dec 2005 19:06:08 -0000 1.23 @@ -91,6 +91,7 @@ gint type; gint number; GstPad *pad; + GstCaps *caps; gint index_id; gint size_bound; GstClockTime cur_ts; |