diff --git a/ChangeLog b/ChangeLog index 86bc370553..8252702ff1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2004-07-28 Jan Schmidt + + * ext/dvdnav/README: + Update the README to use dvddemux + * ext/gdk_pixbuf/pixbufscale.c: (gst_pixbufscale_getcaps): + Ensure getcaps returns a subset of the template caps + * gst/mpeg2sub/gstmpeg2subt.c: (gst_mpeg2subt_base_init), + (gst_mpeg2subt_init): + Ensure getcaps returns a subset of the template caps + * gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_class_init), + (gst_dvd_demux_init), (gst_dvd_demux_get_video_stream), + (gst_dvd_demux_get_subpicture_stream), + (gst_dvd_demux_send_subbuffer), (gst_dvd_demux_set_cur_subpicture): + * gst/mpegstream/gstdvddemux.h: + Set the explicit caps on the current_video pad before pushing + anything + * gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_get_video_stream), + (gst_mpeg_demux_get_audio_stream): + Free caps used to gst_pad_set_explicit_caps, which takes a const + GstCaps * + 2004-07-28 Thomas Vander Stichele * configure.ac: update GStreamer requirement to 0.8.4 because of diff --git a/ext/dvdnav/README b/ext/dvdnav/README index 7584b67126..faeeea743b 100644 --- a/ext/dvdnav/README +++ b/ext/dvdnav/README @@ -6,6 +6,6 @@ http://dvd.sourceforge.net/ Try this: -./gst-launch dvdnavsrc location=/dev/dvd ! mpegdemux .video_%02d ! { queue ! mpeg2dec ! xvideosink } mpegdemux0.private_stream_1_0 ! { queue ! a52dec ! osssink } +./gst-launch dvdnavsrc location=/dev/dvd ! dvddemux .current_video ! { queue ! mpeg2dec ! xvimagesink } dvddemux0.current_audio ! { queue ! a52dec ! osssink } You can give title, chapter, and angle parameters to dvdnavsrc. diff --git a/gst/mpegstream/gstdvddemux.c b/gst/mpegstream/gstdvddemux.c index a74d45669e..f39587dc90 100644 --- a/gst/mpegstream/gstdvddemux.c +++ b/gst/mpegstream/gstdvddemux.c @@ -127,6 +127,9 @@ static void gst_dvd_demux_send_discont static gboolean gst_dvd_demux_handle_dvd_event (GstDVDDemux * dvd_demux, GstEvent * event); +static GstMPEGStream *gst_dvd_demux_get_video_stream + (GstMPEGDemux * mpeg_demux, + guint8 stream_nr, gint type, const gpointer info); static GstMPEGStream *gst_dvd_demux_get_audio_stream (GstMPEGDemux * dvd_demux, guint8 stream_nr, gint type, const gpointer info); @@ -232,6 +235,7 @@ gst_dvd_demux_class_init (GstDVDDemuxClass * klass) mpeg_parse_class->send_discont = gst_dvd_demux_send_discont; mpeg_demux_class->get_audio_stream = gst_dvd_demux_get_audio_stream; + mpeg_demux_class->get_video_stream = gst_dvd_demux_get_video_stream; mpeg_demux_class->send_subbuffer = gst_dvd_demux_send_subbuffer; mpeg_demux_class->process_private = gst_dvd_demux_process_private; @@ -259,6 +263,7 @@ gst_dvd_demux_init (GstDVDDemux * dvd_demux) DEMUX_CLASS (dvd_demux)->new_output_pad (mpeg_demux, "current_subpicture", CLASS (dvd_demux)->cur_subpicture_template); + dvd_demux->mpeg_version = 0; dvd_demux->cur_video_nr = 0; dvd_demux->cur_audio_nr = 0; dvd_demux->cur_subpicture_nr = 0; @@ -443,6 +448,33 @@ gst_dvd_demux_send_discont (GstMPEGParse * mpeg_parse, GstClockTime time) } } +static GstMPEGStream * +gst_dvd_demux_get_video_stream (GstMPEGDemux * mpeg_demux, + guint8 stream_nr, gint type, const gpointer info) +{ + GstDVDDemux *dvd_demux = GST_DVD_DEMUX (mpeg_demux); + GstMPEGStream *str = + parent_class->get_video_stream (mpeg_demux, stream_nr, type, info); + gint mpeg_version = *((gint *) info); + + if (dvd_demux->mpeg_version != mpeg_version) { + GstCaps *caps; + + caps = gst_caps_new_simple ("video/mpeg", + "mpegversion", G_TYPE_INT, mpeg_version, + "systemstream", G_TYPE_BOOLEAN, FALSE, NULL); + + if (!gst_pad_set_explicit_caps (dvd_demux->cur_video, caps)) { + GST_ELEMENT_ERROR (GST_ELEMENT (mpeg_demux), + CORE, NEGOTIATION, (NULL), ("failed to set caps")); + } else { + dvd_demux->mpeg_version = mpeg_version; + } + gst_caps_free (caps); + } + + return str; +} static GstMPEGStream * gst_dvd_demux_get_audio_stream (GstMPEGDemux * mpeg_demux, @@ -601,10 +633,10 @@ gst_dvd_demux_get_subpicture_stream (GstMPEGDemux * mpeg_demux, if (str->number == dvd_demux->cur_subpicture_nr) { /* This is the current subpicture stream. Use the same caps. */ - gst_pad_set_explicit_caps (dvd_demux->cur_subpicture, - gst_caps_copy (caps)); + gst_pad_set_explicit_caps (dvd_demux->cur_subpicture, caps); } + gst_caps_free (caps); str->type = GST_DVD_DEMUX_SUBP_DVD; } @@ -780,7 +812,7 @@ gst_dvd_demux_send_subbuffer (GstMPEGDemux * mpeg_demux, break; } - if (outpad != NULL && cur_nr == outstream->number && (size > 0)) { + if ((outpad != NULL) && (cur_nr == outstream->number) && (size > 0)) { GstBuffer *outbuf; /* We have a packet of the current stream. Send it to the @@ -830,7 +862,7 @@ static void gst_dvd_demux_set_cur_subpicture (GstDVDDemux * dvd_demux, gint stream_nr) { GstMPEGStream *str; - const GstCaps *caps; + const GstCaps *caps = NULL; g_return_if_fail (stream_nr >= -1 && stream_nr < GST_DVD_DEMUX_NUM_SUBPICTURE_STREAMS); diff --git a/gst/mpegstream/gstdvddemux.h b/gst/mpegstream/gstdvddemux.h index abf7f3ee03..4a192f794d 100644 --- a/gst/mpegstream/gstdvddemux.h +++ b/gst/mpegstream/gstdvddemux.h @@ -52,7 +52,7 @@ enum { /* Supported number of streams. */ #define GST_DVD_DEMUX_NUM_SUBPICTURE_STREAMS 32 - +#define GST_DVD_DEMUX_MAX_SUBPICTURE_DELAY 0 typedef struct _GstDVDLPCMStream GstDVDLPCMStream ; typedef struct _GstDVDDemux GstDVDDemux; @@ -109,8 +109,12 @@ struct _GstDVDDemux { given time, before sending the next dara block.. */ + gint mpeg_version; /* Version of the MPEG video stream */ + GstMPEGStream *subpicture_stream[GST_DVD_DEMUX_NUM_SUBPICTURE_STREAMS]; /* Subpicture output streams. */ + GstClockTime subpicture_time[GST_DVD_DEMUX_NUM_SUBPICTURE_STREAMS]; + /* Last timestamp for buffer on each stream */ }; diff --git a/gst/mpegstream/gstmpegdemux.c b/gst/mpegstream/gstmpegdemux.c index bc7a34072a..69934f6f79 100644 --- a/gst/mpegstream/gstmpegdemux.c +++ b/gst/mpegstream/gstmpegdemux.c @@ -405,8 +405,10 @@ gst_mpeg_demux_get_video_stream (GstMPEGDemux * mpeg_demux, if (!gst_pad_set_explicit_caps (str->pad, caps)) { GST_ELEMENT_ERROR (GST_ELEMENT (mpeg_demux), CORE, NEGOTIATION, (NULL), ("failed to set caps")); + gst_caps_free (caps); return str; } + gst_caps_free (caps); /* Store the current values. */ video_str->mpeg_version = mpeg_version; @@ -455,8 +457,10 @@ gst_mpeg_demux_get_audio_stream (GstMPEGDemux * mpeg_demux, if (!gst_pad_set_explicit_caps (str->pad, caps)) { GST_ELEMENT_ERROR (GST_ELEMENT (mpeg_demux), CORE, NEGOTIATION, (NULL), ("failed to set caps")); + gst_caps_free (caps); return str; } + gst_caps_free (caps); } return str;