ext/dvdnav/README: Update the README to use dvddemux

Original commit message from CVS:
* 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 *
This commit is contained in:
Jan Schmidt 2004-07-28 13:47:59 +00:00
parent 00fb53e725
commit f160963387
5 changed files with 67 additions and 6 deletions

View file

@ -1,3 +1,24 @@
2004-07-28 Jan Schmidt <thaytan@mad.scientist.com>
* 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 <thomas at apestaart dot org>
* configure.ac: update GStreamer requirement to 0.8.4 because of

View file

@ -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.

View file

@ -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);

View file

@ -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 */
};

View file

@ -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;