mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
ext/dv/gstdvdec.c: Reset segment info on flush.
Original commit message from CVS: * ext/dv/gstdvdec.c: (gst_dvdec_class_init), (gst_dvdec_init), (gst_dvdec_finalize), (gst_dvdec_sink_event), (gst_dvdec_change_state): Reset segment info on flush. Alloc segment in _init, free in _finalize. * ext/dv/gstdvdemux.c: (gst_dvdemux_handle_pull_seek): Don't send segments twice.
This commit is contained in:
parent
4d4c2a5520
commit
778a0bf950
3 changed files with 32 additions and 4 deletions
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
||||||
|
2006-06-14 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
|
* ext/dv/gstdvdec.c: (gst_dvdec_class_init), (gst_dvdec_init),
|
||||||
|
(gst_dvdec_finalize), (gst_dvdec_sink_event),
|
||||||
|
(gst_dvdec_change_state):
|
||||||
|
Reset segment info on flush.
|
||||||
|
Alloc segment in _init, free in _finalize.
|
||||||
|
|
||||||
|
* ext/dv/gstdvdemux.c: (gst_dvdemux_handle_pull_seek):
|
||||||
|
Don't send segments twice.
|
||||||
|
|
||||||
2006-06-14 Wim Taymans <wim@fluendo.com>
|
2006-06-14 Wim Taymans <wim@fluendo.com>
|
||||||
|
|
||||||
* ext/dv/gstdvdemux.c: (gst_dvdemux_demux_frame):
|
* ext/dv/gstdvdemux.c: (gst_dvdemux_demux_frame):
|
||||||
|
|
|
@ -141,6 +141,7 @@ gst_dvdec_quality_get_type (void)
|
||||||
|
|
||||||
GST_BOILERPLATE (GstDVDec, gst_dvdec, GstElement, GST_TYPE_ELEMENT);
|
GST_BOILERPLATE (GstDVDec, gst_dvdec, GstElement, GST_TYPE_ELEMENT);
|
||||||
|
|
||||||
|
static void gst_dvdec_finalize (GObject * object);
|
||||||
static gboolean gst_dvdec_sink_setcaps (GstPad * pad, GstCaps * caps);
|
static gboolean gst_dvdec_sink_setcaps (GstPad * pad, GstCaps * caps);
|
||||||
static GstFlowReturn gst_dvdec_chain (GstPad * pad, GstBuffer * buffer);
|
static GstFlowReturn gst_dvdec_chain (GstPad * pad, GstBuffer * buffer);
|
||||||
static gboolean gst_dvdec_sink_event (GstPad * pad, GstEvent * event);
|
static gboolean gst_dvdec_sink_event (GstPad * pad, GstEvent * event);
|
||||||
|
@ -177,6 +178,7 @@ gst_dvdec_class_init (GstDVDecClass * klass)
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = (GObjectClass *) klass;
|
||||||
gstelement_class = (GstElementClass *) klass;
|
gstelement_class = (GstElementClass *) klass;
|
||||||
|
|
||||||
|
gobject_class->finalize = gst_dvdec_finalize;
|
||||||
gobject_class->set_property = gst_dvdec_set_property;
|
gobject_class->set_property = gst_dvdec_set_property;
|
||||||
gobject_class->get_property = gst_dvdec_get_property;
|
gobject_class->get_property = gst_dvdec_get_property;
|
||||||
|
|
||||||
|
@ -228,6 +230,17 @@ gst_dvdec_init (GstDVDec * dvdec, GstDVDecClass * g_class)
|
||||||
dvdec->clamp_luma = FALSE;
|
dvdec->clamp_luma = FALSE;
|
||||||
dvdec->clamp_chroma = FALSE;
|
dvdec->clamp_chroma = FALSE;
|
||||||
dvdec->quality = DV_DEFAULT_QUALITY;
|
dvdec->quality = DV_DEFAULT_QUALITY;
|
||||||
|
dvdec->segment = gst_segment_new ();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
gst_dvdec_finalize (GObject * object)
|
||||||
|
{
|
||||||
|
GstDVDec *dvdec = GST_DVDEC (object);
|
||||||
|
|
||||||
|
gst_segment_free (dvdec->segment);
|
||||||
|
|
||||||
|
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
@ -293,6 +306,9 @@ gst_dvdec_sink_event (GstPad * pad, GstEvent * event)
|
||||||
dvdec = GST_DVDEC (gst_pad_get_parent (pad));
|
dvdec = GST_DVDEC (gst_pad_get_parent (pad));
|
||||||
|
|
||||||
switch (GST_EVENT_TYPE (event)) {
|
switch (GST_EVENT_TYPE (event)) {
|
||||||
|
case GST_EVENT_FLUSH_STOP:
|
||||||
|
gst_segment_init (dvdec->segment, GST_FORMAT_UNDEFINED);
|
||||||
|
break;
|
||||||
case GST_EVENT_NEWSEGMENT:{
|
case GST_EVENT_NEWSEGMENT:{
|
||||||
gboolean update;
|
gboolean update;
|
||||||
gdouble rate;
|
gdouble rate;
|
||||||
|
@ -302,14 +318,16 @@ gst_dvdec_sink_event (GstPad * pad, GstEvent * event)
|
||||||
/* Once -good depends on core >= 0.10.6, use newsegment_full */
|
/* Once -good depends on core >= 0.10.6, use newsegment_full */
|
||||||
gst_event_parse_new_segment (event, &update, &rate, &format,
|
gst_event_parse_new_segment (event, &update, &rate, &format,
|
||||||
&start, &stop, &position);
|
&start, &stop, &position);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (dvdec, "Got NEWSEGMENT [%" GST_TIME_FORMAT
|
GST_DEBUG_OBJECT (dvdec, "Got NEWSEGMENT [%" GST_TIME_FORMAT
|
||||||
" - %" GST_TIME_FORMAT " / %" GST_TIME_FORMAT "]",
|
" - %" GST_TIME_FORMAT " / %" GST_TIME_FORMAT "]",
|
||||||
GST_TIME_ARGS (start), GST_TIME_ARGS (stop),
|
GST_TIME_ARGS (start), GST_TIME_ARGS (stop),
|
||||||
GST_TIME_ARGS (position));
|
GST_TIME_ARGS (position));
|
||||||
|
|
||||||
gst_segment_set_newsegment (dvdec->segment, update, rate, format,
|
gst_segment_set_newsegment (dvdec->segment, update, rate, format,
|
||||||
start, stop, position);
|
start, stop, position);
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -447,7 +465,6 @@ gst_dvdec_change_state (GstElement * element, GstStateChange transition)
|
||||||
dv_decoder_new (0, dvdec->clamp_luma, dvdec->clamp_chroma);
|
dv_decoder_new (0, dvdec->clamp_luma, dvdec->clamp_chroma);
|
||||||
dvdec->decoder->quality = qualities[dvdec->quality];
|
dvdec->decoder->quality = qualities[dvdec->quality];
|
||||||
dv_set_error_log (dvdec->decoder, NULL);
|
dv_set_error_log (dvdec->decoder, NULL);
|
||||||
dvdec->segment = gst_segment_new ();
|
|
||||||
gst_segment_init (dvdec->segment, GST_FORMAT_UNDEFINED);
|
gst_segment_init (dvdec->segment, GST_FORMAT_UNDEFINED);
|
||||||
/*
|
/*
|
||||||
* Enable this function call when libdv2 0.100 or higher is more
|
* Enable this function call when libdv2 0.100 or higher is more
|
||||||
|
@ -469,8 +486,6 @@ gst_dvdec_change_state (GstElement * element, GstStateChange transition)
|
||||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||||
dv_decoder_free (dvdec->decoder);
|
dv_decoder_free (dvdec->decoder);
|
||||||
dvdec->decoder = NULL;
|
dvdec->decoder = NULL;
|
||||||
gst_segment_free (dvdec->segment);
|
|
||||||
dvdec->segment = NULL;
|
|
||||||
break;
|
break;
|
||||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
case GST_STATE_CHANGE_READY_TO_NULL:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1080,6 +1080,8 @@ gst_dvdemux_handle_pull_seek (GstDVDemux * demux, GstPad * pad,
|
||||||
gst_event_new_new_segment (FALSE,
|
gst_event_new_new_segment (FALSE,
|
||||||
demux->time_segment.rate, demux->time_segment.format,
|
demux->time_segment.rate, demux->time_segment.format,
|
||||||
demux->time_segment.last_stop, stop, demux->time_segment.time));
|
demux->time_segment.last_stop, stop, demux->time_segment.time));
|
||||||
|
|
||||||
|
demux->need_segment = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
demux->running = TRUE;
|
demux->running = TRUE;
|
||||||
|
|
Loading…
Reference in a new issue