mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-10 10:04:23 +00:00
gst/mpegstream/: Recreate pads on new-media (#160730).
Original commit message from CVS: Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net> * gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_class_init), (gst_dvd_demux_handle_discont): * gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init), (gst_mpeg_demux_handle_discont): Recreate pads on new-media (#160730). * gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_new_pad): Send discont even if manager changes timestamps (#161929).
This commit is contained in:
parent
b4d24c0b57
commit
a95af88f1f
4 changed files with 52 additions and 1 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
2005-01-05 Martin Eikermann <meiker@upb.de>
|
||||
|
||||
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||
|
||||
* gst/mpegstream/gstdvddemux.c: (gst_dvd_demux_class_init),
|
||||
(gst_dvd_demux_handle_discont):
|
||||
* gst/mpegstream/gstmpegdemux.c: (gst_mpeg_demux_class_init),
|
||||
(gst_mpeg_demux_handle_discont):
|
||||
Recreate pads on new-media (#160730).
|
||||
* gst/mpegstream/gstmpegparse.c: (gst_mpeg_parse_new_pad):
|
||||
Send discont even if manager changes timestamps (#161929).
|
||||
|
||||
2005-01-05 Sebastien Cote <sc5@hermes.usherb.ca>
|
||||
|
||||
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||
|
|
|
@ -131,6 +131,8 @@ static void gst_dvd_demux_send_data (GstMPEGParse * mpeg_parse,
|
|||
|
||||
static void gst_dvd_demux_send_discont
|
||||
(GstMPEGParse * mpeg_parse, GstClockTime time);
|
||||
static void gst_dvd_demux_handle_discont
|
||||
(GstMPEGParse * mpeg_parse, GstEvent * event);
|
||||
static gboolean gst_dvd_demux_handle_dvd_event
|
||||
(GstDVDDemux * dvd_demux, GstEvent * event);
|
||||
|
||||
|
@ -159,6 +161,9 @@ static void gst_dvd_demux_set_cur_audio
|
|||
static void gst_dvd_demux_set_cur_subpicture
|
||||
(GstDVDDemux * dvd_demux, gint stream_nr);
|
||||
|
||||
static void gst_dvd_demux_reset (GstDVDDemux * dvd_demux);
|
||||
|
||||
|
||||
static GstElementStateReturn gst_dvd_demux_change_state (GstElement * element);
|
||||
|
||||
static GstMPEGDemuxClass *parent_class = NULL;
|
||||
|
@ -247,6 +252,7 @@ gst_dvd_demux_class_init (GstDVDDemuxClass * klass)
|
|||
gstelement_class->change_state = gst_dvd_demux_change_state;
|
||||
|
||||
mpeg_parse_class->send_discont = gst_dvd_demux_send_discont;
|
||||
mpeg_parse_class->handle_discont = gst_dvd_demux_handle_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;
|
||||
|
@ -478,6 +484,20 @@ gst_dvd_demux_send_discont (GstMPEGParse * mpeg_parse, GstClockTime time)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gst_dvd_demux_handle_discont (GstMPEGParse * mpeg_parse, GstEvent * event)
|
||||
{
|
||||
GstDVDDemux *dvd_demux = GST_DVD_DEMUX (mpeg_parse);
|
||||
|
||||
if (GST_EVENT_DISCONT_NEW_MEDIA (event)) {
|
||||
gst_dvd_demux_reset (dvd_demux);
|
||||
}
|
||||
|
||||
/* before we reset let parent handle and forward discont */
|
||||
if (GST_MPEG_PARSE_CLASS (parent_class)->handle_discont != NULL)
|
||||
GST_MPEG_PARSE_CLASS (parent_class)->handle_discont (mpeg_parse, event);
|
||||
}
|
||||
|
||||
static GstMPEGStream *
|
||||
gst_dvd_demux_get_video_stream (GstMPEGDemux * mpeg_demux,
|
||||
guint8 stream_nr, gint type, const gpointer info)
|
||||
|
|
|
@ -93,6 +93,9 @@ static void gst_mpeg_demux_send_data (GstMPEGParse * mpeg_parse,
|
|||
GstData * data, GstClockTime time);
|
||||
static void gst_mpeg_demux_send_discont (GstMPEGParse * mpeg_parse,
|
||||
GstClockTime time);
|
||||
static void gst_mpeg_demux_handle_discont (GstMPEGParse * mpeg_parse,
|
||||
GstEvent * event);
|
||||
|
||||
|
||||
static GstPad *gst_mpeg_demux_new_output_pad (GstMPEGDemux * mpeg_demux,
|
||||
const gchar * name, GstPadTemplate * temp);
|
||||
|
@ -130,6 +133,8 @@ static gboolean normal_seek (GstPad * pad, GstEvent * event, gint64 * offset);
|
|||
|
||||
static gboolean gst_mpeg_demux_handle_src_event (GstPad * pad,
|
||||
GstEvent * event);
|
||||
static void gst_mpeg_demux_reset (GstMPEGDemux * mpeg_demux);
|
||||
|
||||
|
||||
static GstElementStateReturn gst_mpeg_demux_change_state (GstElement * element);
|
||||
|
||||
|
@ -207,6 +212,7 @@ gst_mpeg_demux_class_init (GstMPEGDemuxClass * klass)
|
|||
mpeg_parse_class->parse_pes = gst_mpeg_demux_parse_pes;
|
||||
mpeg_parse_class->send_data = gst_mpeg_demux_send_data;
|
||||
mpeg_parse_class->send_discont = gst_mpeg_demux_send_discont;
|
||||
mpeg_parse_class->handle_discont = gst_mpeg_demux_handle_discont;
|
||||
|
||||
klass->new_output_pad = gst_mpeg_demux_new_output_pad;
|
||||
klass->init_stream = gst_mpeg_demux_init_stream;
|
||||
|
@ -301,6 +307,19 @@ gst_mpeg_demux_send_discont (GstMPEGParse * mpeg_parse, GstClockTime time)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gst_mpeg_demux_handle_discont (GstMPEGParse * mpeg_parse, GstEvent * event)
|
||||
{
|
||||
GstMPEGDemux *mpeg_demux = GST_MPEG_DEMUX (mpeg_parse);
|
||||
|
||||
if (GST_EVENT_DISCONT_NEW_MEDIA (event)) {
|
||||
gst_mpeg_demux_reset (mpeg_demux);
|
||||
}
|
||||
|
||||
if (parent_class->handle_discont != NULL)
|
||||
parent_class->handle_discont (mpeg_parse, event);
|
||||
}
|
||||
|
||||
static gint
|
||||
_demux_get_writer_id (GstIndex * index, GstPad * pad)
|
||||
{
|
||||
|
|
|
@ -363,7 +363,7 @@ gst_mpeg_parse_new_pad (GstElement * element, GstPad * pad)
|
|||
* time. This is required because MPEG allows any sort of order of
|
||||
* packets, including setting base time before defining streams or
|
||||
* even adding streams halfway a stream. */
|
||||
if (!mpeg_parse->scr_pending && !mpeg_parse->do_adjust) {
|
||||
if (!mpeg_parse->scr_pending) {
|
||||
GstEvent *event = gst_event_new_discontinuous (FALSE,
|
||||
GST_FORMAT_TIME,
|
||||
(guint64) MPEGTIME_TO_GSTTIME (mpeg_parse->current_scr +
|
||||
|
|
Loading…
Reference in a new issue