Commit 884213b8 authored by Sebastian Dröge's avatar Sebastian Dröge

base: Update for SEGMENT event parse API changes

parent a46485e3
...@@ -210,21 +210,21 @@ gst_gio_base_sink_event (GstBaseSink * base_sink, GstEvent * event) ...@@ -210,21 +210,21 @@ gst_gio_base_sink_event (GstBaseSink * base_sink, GstEvent * event)
switch (GST_EVENT_TYPE (event)) { switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEGMENT: case GST_EVENT_SEGMENT:
if (G_IS_OUTPUT_STREAM (sink->stream)) { if (G_IS_OUTPUT_STREAM (sink->stream)) {
GstSegment segment; const GstSegment *segment;
gst_event_parse_segment (event, &segment); gst_event_parse_segment (event, &segment);
if (segment.format != GST_FORMAT_BYTES) { if (segment->format != GST_FORMAT_BYTES) {
GST_WARNING_OBJECT (sink, "ignored SEGMENT event in %s format", GST_WARNING_OBJECT (sink, "ignored SEGMENT event in %s format",
gst_format_get_name (segment.format)); gst_format_get_name (segment->format));
break; break;
} }
if (GST_GIO_STREAM_IS_SEEKABLE (sink->stream)) { if (GST_GIO_STREAM_IS_SEEKABLE (sink->stream)) {
ret = gst_gio_seek (sink, G_SEEKABLE (sink->stream), segment.start, ret = gst_gio_seek (sink, G_SEEKABLE (sink->stream), segment->start,
sink->cancel); sink->cancel);
if (ret == GST_FLOW_OK) if (ret == GST_FLOW_OK)
sink->position = segment.start; sink->position = segment->start;
} else { } else {
ret = GST_FLOW_NOT_SUPPORTED; ret = GST_FLOW_NOT_SUPPORTED;
} }
......
...@@ -442,27 +442,27 @@ gst_gnome_vfs_sink_handle_event (GstBaseSink * basesink, GstEvent * event) ...@@ -442,27 +442,27 @@ gst_gnome_vfs_sink_handle_event (GstBaseSink * basesink, GstEvent * event)
switch (GST_EVENT_TYPE (event)) { switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEGMENT:{ case GST_EVENT_SEGMENT:{
GnomeVFSResult res; GnomeVFSResult res;
GstSegment segment; const GstSegment *segment;
gst_event_parse_segment (event, &segment); gst_event_parse_segment (event, &segment);
if (segment.format != GST_FORMAT_BYTES) { if (segment->format != GST_FORMAT_BYTES) {
GST_WARNING_OBJECT (sink, "ignored NEWSEGMENT event in %s format", GST_WARNING_OBJECT (sink, "ignored NEWSEGMENT event in %s format",
gst_format_get_name (segment.format)); gst_format_get_name (segment->format));
break; break;
} }
GST_LOG_OBJECT (sink, "seeking to offset %" G_GINT64_FORMAT, GST_LOG_OBJECT (sink, "seeking to offset %" G_GINT64_FORMAT,
segment.start); segment->start);
res = gnome_vfs_seek (sink->handle, GNOME_VFS_SEEK_START, segment.start); res = gnome_vfs_seek (sink->handle, GNOME_VFS_SEEK_START, segment->start);
if (res != GNOME_VFS_OK) { if (res != GNOME_VFS_OK) {
GST_ERROR_OBJECT (sink, "Failed to seek to offset %" GST_ERROR_OBJECT (sink, "Failed to seek to offset %"
G_GINT64_FORMAT ": %s", segment.start, G_GINT64_FORMAT ": %s", segment->start,
gnome_vfs_result_to_string (res)); gnome_vfs_result_to_string (res));
ret = FALSE; ret = FALSE;
} else { } else {
sink->current_pos = segment.start; sink->current_pos = segment->start;
} }
break; break;
......
...@@ -513,7 +513,7 @@ gst_visual_sink_event (GstPad * pad, GstEvent * event) ...@@ -513,7 +513,7 @@ gst_visual_sink_event (GstPad * pad, GstEvent * event)
/* the newsegment values are used to clip the input samples /* the newsegment values are used to clip the input samples
* and to convert the incomming timestamps to running time so * and to convert the incomming timestamps to running time so
* we can do QoS */ * we can do QoS */
gst_event_parse_segment (event, &visual->segment); gst_event_copy_segment (event, &visual->segment);
/* and forward */ /* and forward */
res = gst_pad_push_event (visual->srcpad, event); res = gst_pad_push_event (visual->srcpad, event);
......
...@@ -283,18 +283,18 @@ gst_ogg_mux_sink_event (GstPad * pad, GstEvent * event) ...@@ -283,18 +283,18 @@ gst_ogg_mux_sink_event (GstPad * pad, GstEvent * event)
switch (GST_EVENT_TYPE (event)) { switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEGMENT: case GST_EVENT_SEGMENT:
{ {
GstSegment segment; const GstSegment *segment;
gst_event_parse_segment (event, &segment); gst_event_parse_segment (event, &segment);
/* We don't support non time NEWSEGMENT events */ /* We don't support non time NEWSEGMENT events */
if (segment.format != GST_FORMAT_TIME) { if (segment->format != GST_FORMAT_TIME) {
gst_event_unref (event); gst_event_unref (event);
event = NULL; event = NULL;
break; break;
} }
gst_segment_copy_into (&segment, &ogg_pad->segment); gst_segment_copy_into (segment, &ogg_pad->segment);
break; break;
} }
case GST_EVENT_FLUSH_STOP:{ case GST_EVENT_FLUSH_STOP:{
......
...@@ -2131,15 +2131,15 @@ gst_base_text_overlay_text_event (GstPad * pad, GstEvent * event) ...@@ -2131,15 +2131,15 @@ gst_base_text_overlay_text_event (GstPad * pad, GstEvent * event)
switch (GST_EVENT_TYPE (event)) { switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEGMENT: case GST_EVENT_SEGMENT:
{ {
GstSegment segment; const GstSegment *segment;
overlay->text_eos = FALSE; overlay->text_eos = FALSE;
gst_event_parse_segment (event, &segment); gst_event_parse_segment (event, &segment);
if (segment.format == GST_FORMAT_TIME) { if (segment->format == GST_FORMAT_TIME) {
GST_OBJECT_LOCK (overlay); GST_OBJECT_LOCK (overlay);
gst_segment_copy_into (&segment, &overlay->text_segment); gst_segment_copy_into (segment, &overlay->text_segment);
GST_DEBUG_OBJECT (overlay, "TEXT SEGMENT now: %" GST_SEGMENT_FORMAT, GST_DEBUG_OBJECT (overlay, "TEXT SEGMENT now: %" GST_SEGMENT_FORMAT,
&overlay->text_segment); &overlay->text_segment);
GST_OBJECT_UNLOCK (overlay); GST_OBJECT_UNLOCK (overlay);
...@@ -2212,17 +2212,17 @@ gst_base_text_overlay_video_event (GstPad * pad, GstEvent * event) ...@@ -2212,17 +2212,17 @@ gst_base_text_overlay_video_event (GstPad * pad, GstEvent * event)
switch (GST_EVENT_TYPE (event)) { switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEGMENT: case GST_EVENT_SEGMENT:
{ {
GstSegment segment; const GstSegment *segment;
GST_DEBUG_OBJECT (overlay, "received new segment"); GST_DEBUG_OBJECT (overlay, "received new segment");
gst_event_parse_segment (event, &segment); gst_event_parse_segment (event, &segment);
if (segment.format == GST_FORMAT_TIME) { if (segment->format == GST_FORMAT_TIME) {
GST_DEBUG_OBJECT (overlay, "VIDEO SEGMENT now: %" GST_SEGMENT_FORMAT, GST_DEBUG_OBJECT (overlay, "VIDEO SEGMENT now: %" GST_SEGMENT_FORMAT,
&overlay->segment); &overlay->segment);
gst_segment_copy_into (&segment, &overlay->segment); gst_segment_copy_into (segment, &overlay->segment);
} else { } else {
GST_ELEMENT_WARNING (overlay, STREAM, MUX, (NULL), GST_ELEMENT_WARNING (overlay, STREAM, MUX, (NULL),
("received non-TIME newsegment event on video input")); ("received non-TIME newsegment event on video input"));
......
...@@ -630,18 +630,18 @@ theora_dec_sink_event (GstPad * pad, GstEvent * event) ...@@ -630,18 +630,18 @@ theora_dec_sink_event (GstPad * pad, GstEvent * event)
break; break;
case GST_EVENT_SEGMENT: case GST_EVENT_SEGMENT:
{ {
GstSegment segment; const GstSegment *segment;
gst_event_parse_segment (event, &segment); gst_event_parse_segment (event, &segment);
/* we need TIME format */ /* we need TIME format */
if (segment.format != GST_FORMAT_TIME) if (segment->format != GST_FORMAT_TIME)
goto newseg_wrong_format; goto newseg_wrong_format;
GST_DEBUG_OBJECT (dec, "segment: %" GST_SEGMENT_FORMAT, &segment); GST_DEBUG_OBJECT (dec, "segment: %" GST_SEGMENT_FORMAT, segment);
/* now configure the values */ /* now configure the values */
gst_segment_copy_into (&segment, &dec->segment); gst_segment_copy_into (segment, &dec->segment);
dec->seqnum = gst_event_get_seqnum (event); dec->seqnum = gst_event_get_seqnum (event);
/* We don't forward this unless/until the decoder is initialised */ /* We don't forward this unless/until the decoder is initialised */
......
...@@ -831,7 +831,7 @@ theora_enc_sink_event (GstPad * pad, GstEvent * event) ...@@ -831,7 +831,7 @@ theora_enc_sink_event (GstPad * pad, GstEvent * event)
switch (GST_EVENT_TYPE (event)) { switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEGMENT: case GST_EVENT_SEGMENT:
{ {
gst_event_parse_segment (event, &enc->segment); gst_event_copy_segment (event, &enc->segment);
res = gst_pad_push_event (enc->srcpad, event); res = gst_pad_push_event (enc->srcpad, event);
break; break;
......
...@@ -488,18 +488,18 @@ vorbis_dec_sink_event (GstPad * pad, GstEvent * event) ...@@ -488,18 +488,18 @@ vorbis_dec_sink_event (GstPad * pad, GstEvent * event)
break; break;
case GST_EVENT_SEGMENT: case GST_EVENT_SEGMENT:
{ {
GstSegment segment; const GstSegment *segment;
gst_event_parse_segment (event, &segment); gst_event_parse_segment (event, &segment);
/* we need time for now */ /* we need time for now */
if (segment.format != GST_FORMAT_TIME) if (segment->format != GST_FORMAT_TIME)
goto newseg_wrong_format; goto newseg_wrong_format;
GST_DEBUG_OBJECT (dec, "segment: %" GST_SEGMENT_FORMAT, &segment); GST_DEBUG_OBJECT (dec, "segment: %" GST_SEGMENT_FORMAT, segment);
/* now configure the values */ /* now configure the values */
gst_segment_copy_into (&segment, &dec->segment); gst_segment_copy_into (segment, &dec->segment);
dec->seqnum = gst_event_get_seqnum (event); dec->seqnum = gst_event_get_seqnum (event);
if (dec->initialized) if (dec->initialized)
......
...@@ -968,12 +968,12 @@ gst_vorbis_enc_sink_event (GstPad * pad, GstEvent * event) ...@@ -968,12 +968,12 @@ gst_vorbis_enc_sink_event (GstPad * pad, GstEvent * event)
break; break;
case GST_EVENT_SEGMENT: case GST_EVENT_SEGMENT:
{ {
GstSegment segment; const GstSegment *segment;
gst_event_parse_segment (event, &segment); gst_event_parse_segment (event, &segment);
if (segment.format == GST_FORMAT_TIME) { if (segment->format == GST_FORMAT_TIME) {
gst_segment_copy_into (&segment, &vorbisenc->segment); gst_segment_copy_into (segment, &vorbisenc->segment);
} }
} }
/* fall through */ /* fall through */
......
...@@ -407,7 +407,7 @@ gst_base_rtp_depayload_handle_event (GstBaseRTPDepayload * filter, ...@@ -407,7 +407,7 @@ gst_base_rtp_depayload_handle_event (GstBaseRTPDepayload * filter,
break; break;
case GST_EVENT_SEGMENT: case GST_EVENT_SEGMENT:
{ {
gst_event_parse_segment (event, &filter->segment); gst_event_copy_segment (event, &filter->segment);
/* don't pass the event downstream, we generate our own segment including /* don't pass the event downstream, we generate our own segment including
* the NTP time and other things we receive in caps */ * the NTP time and other things we receive in caps */
forward = FALSE; forward = FALSE;
......
...@@ -412,7 +412,7 @@ gst_basertppayload_event (GstPad * pad, GstEvent * event) ...@@ -412,7 +412,7 @@ gst_basertppayload_event (GstPad * pad, GstEvent * event)
GstSegment *segment; GstSegment *segment;
segment = &basertppayload->segment; segment = &basertppayload->segment;
gst_event_parse_segment (event, segment); gst_event_copy_segment (event, segment);
GST_DEBUG_OBJECT (basertppayload, GST_DEBUG_OBJECT (basertppayload,
"configured SEGMENT %" GST_SEGMENT_FORMAT, segment); "configured SEGMENT %" GST_SEGMENT_FORMAT, segment);
......
...@@ -738,7 +738,7 @@ gst_tag_demux_sink_event (GstPad * pad, GstEvent * event) ...@@ -738,7 +738,7 @@ gst_tag_demux_sink_event (GstPad * pad, GstEvent * event)
break; break;
case GST_EVENT_SEGMENT: case GST_EVENT_SEGMENT:
{ {
gst_event_parse_segment (event, &demux->priv->segment); gst_event_copy_segment (event, &demux->priv->segment);
demux->priv->need_newseg = TRUE; demux->priv->need_newseg = TRUE;
gst_event_unref (event); gst_event_unref (event);
......
...@@ -316,7 +316,7 @@ gst_audio_rate_sink_event (GstPad * pad, GstEvent * event) ...@@ -316,7 +316,7 @@ gst_audio_rate_sink_event (GstPad * pad, GstEvent * event)
break; break;
case GST_EVENT_SEGMENT: case GST_EVENT_SEGMENT:
{ {
gst_event_parse_segment (event, &audiorate->sink_segment); gst_event_copy_segment (event, &audiorate->sink_segment);
GST_DEBUG_OBJECT (audiorate, "handle NEWSEGMENT"); GST_DEBUG_OBJECT (audiorate, "handle NEWSEGMENT");
#if 0 #if 0
......
...@@ -352,7 +352,7 @@ smart_encoder_sink_event (GstPad * pad, GstEvent * event) ...@@ -352,7 +352,7 @@ smart_encoder_sink_event (GstPad * pad, GstEvent * event)
break; break;
case GST_EVENT_SEGMENT: case GST_EVENT_SEGMENT:
{ {
gst_event_parse_segment (event, smart_encoder->segment); gst_event_copy_segment (event, smart_encoder->segment);
GST_DEBUG_OBJECT (smart_encoder, "segment: %" GST_SEGMENT_FORMAT, GST_DEBUG_OBJECT (smart_encoder, "segment: %" GST_SEGMENT_FORMAT,
smart_encoder->segment); smart_encoder->segment);
......
...@@ -240,7 +240,7 @@ gst_play_sink_audio_convert_sink_event (GstPad * pad, GstEvent * event) ...@@ -240,7 +240,7 @@ gst_play_sink_audio_convert_sink_event (GstPad * pad, GstEvent * event)
GST_PLAY_SINK_AUDIO_CONVERT_LOCK (self); GST_PLAY_SINK_AUDIO_CONVERT_LOCK (self);
GST_DEBUG_OBJECT (self, "Segment before %" GST_SEGMENT_FORMAT, GST_DEBUG_OBJECT (self, "Segment before %" GST_SEGMENT_FORMAT,
&self->segment); &self->segment);
gst_event_parse_segment (event, &self->segment); gst_event_copy_segment (event, &self->segment);
GST_DEBUG_OBJECT (self, "Segment after %" GST_SEGMENT_FORMAT, GST_DEBUG_OBJECT (self, "Segment after %" GST_SEGMENT_FORMAT,
&self->segment); &self->segment);
GST_PLAY_SINK_AUDIO_CONVERT_UNLOCK (self); GST_PLAY_SINK_AUDIO_CONVERT_UNLOCK (self);
......
...@@ -222,7 +222,7 @@ gst_play_sink_video_convert_sink_event (GstPad * pad, GstEvent * event) ...@@ -222,7 +222,7 @@ gst_play_sink_video_convert_sink_event (GstPad * pad, GstEvent * event)
GST_PLAY_SINK_VIDEO_CONVERT_LOCK (self); GST_PLAY_SINK_VIDEO_CONVERT_LOCK (self);
GST_DEBUG_OBJECT (self, "Segment before %" GST_SEGMENT_FORMAT, GST_DEBUG_OBJECT (self, "Segment before %" GST_SEGMENT_FORMAT,
&self->segment); &self->segment);
gst_event_parse_segment (event, &self->segment); gst_event_copy_segment (event, &self->segment);
GST_DEBUG_OBJECT (self, "Segment after %" GST_SEGMENT_FORMAT, GST_DEBUG_OBJECT (self, "Segment after %" GST_SEGMENT_FORMAT,
&self->segment); &self->segment);
GST_PLAY_SINK_VIDEO_CONVERT_UNLOCK (self); GST_PLAY_SINK_VIDEO_CONVERT_UNLOCK (self);
......
...@@ -239,7 +239,7 @@ gst_selector_pad_event (GstPad * pad, GstEvent * event) ...@@ -239,7 +239,7 @@ gst_selector_pad_event (GstPad * pad, GstEvent * event)
break; break;
case GST_EVENT_SEGMENT: case GST_EVENT_SEGMENT:
{ {
gst_event_parse_segment (event, &selpad->segment); gst_event_copy_segment (event, &selpad->segment);
GST_DEBUG_OBJECT (selpad, "configured SEGMENT %" GST_SEGMENT_FORMAT, GST_DEBUG_OBJECT (selpad, "configured SEGMENT %" GST_SEGMENT_FORMAT,
&selpad->segment); &selpad->segment);
......
...@@ -350,7 +350,7 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstEvent * event) ...@@ -350,7 +350,7 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstEvent * event)
GstStream *stream; GstStream *stream;
GstSegment segment; GstSegment segment;
gst_event_parse_segment (event, &segment); gst_event_copy_segment (event, &segment);
GST_STREAM_SYNCHRONIZER_LOCK (self); GST_STREAM_SYNCHRONIZER_LOCK (self);
stream = gst_pad_get_element_private (pad); stream = gst_pad_get_element_private (pad);
......
...@@ -1644,7 +1644,7 @@ gst_subtitle_overlay_video_sink_event (GstPad * pad, GstEvent * event) ...@@ -1644,7 +1644,7 @@ gst_subtitle_overlay_video_sink_event (GstPad * pad, GstEvent * event)
if (GST_EVENT_TYPE (event) == GST_EVENT_SEGMENT) { if (GST_EVENT_TYPE (event) == GST_EVENT_SEGMENT) {
GST_DEBUG_OBJECT (pad, "segment event: %" GST_PTR_FORMAT, event); GST_DEBUG_OBJECT (pad, "segment event: %" GST_PTR_FORMAT, event);
gst_event_parse_segment (event, &self->video_segment); gst_event_copy_segment (event, &self->video_segment);
if (self->video_segment.format != GST_FORMAT_TIME) { if (self->video_segment.format != GST_FORMAT_TIME) {
GST_ERROR_OBJECT (pad, "Newsegment event in non-time format: %s", GST_ERROR_OBJECT (pad, "Newsegment event in non-time format: %s",
...@@ -1928,7 +1928,7 @@ gst_subtitle_overlay_subtitle_sink_event (GstPad * pad, GstEvent * event) ...@@ -1928,7 +1928,7 @@ gst_subtitle_overlay_subtitle_sink_event (GstPad * pad, GstEvent * event)
if (GST_EVENT_TYPE (event) == GST_EVENT_SEGMENT) { if (GST_EVENT_TYPE (event) == GST_EVENT_SEGMENT) {
GST_DEBUG_OBJECT (pad, "segment event: %" GST_PTR_FORMAT, event); GST_DEBUG_OBJECT (pad, "segment event: %" GST_PTR_FORMAT, event);
gst_event_parse_segment (event, &self->subtitle_segment); gst_event_copy_segment (event, &self->subtitle_segment);
GST_DEBUG_OBJECT (pad, "New subtitle segment: %" GST_SEGMENT_FORMAT, GST_DEBUG_OBJECT (pad, "New subtitle segment: %" GST_SEGMENT_FORMAT,
&self->subtitle_segment); &self->subtitle_segment);
} }
......
...@@ -1580,7 +1580,7 @@ gst_sub_parse_sink_event (GstPad * pad, GstEvent * event) ...@@ -1580,7 +1580,7 @@ gst_sub_parse_sink_event (GstPad * pad, GstEvent * event)
} }
case GST_EVENT_SEGMENT: case GST_EVENT_SEGMENT:
{ {
gst_event_parse_segment (event, &self->segment); gst_event_copy_segment (event, &self->segment);
GST_DEBUG_OBJECT (self, "newsegment (%s)", GST_DEBUG_OBJECT (self, "newsegment (%s)",
gst_format_get_name (self->segment.format)); gst_format_get_name (self->segment.format));
......
...@@ -616,11 +616,11 @@ gst_video_rate_event (GstPad * pad, GstEvent * event) ...@@ -616,11 +616,11 @@ gst_video_rate_event (GstPad * pad, GstEvent * event)
switch (GST_EVENT_TYPE (event)) { switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_SEGMENT: case GST_EVENT_SEGMENT:
{ {
GstSegment segment; const GstSegment *segment;
gst_event_parse_segment (event, &segment); gst_event_parse_segment (event, &segment);
if (segment.format != GST_FORMAT_TIME) if (segment->format != GST_FORMAT_TIME)
goto format_error; goto format_error;
GST_DEBUG_OBJECT (videorate, "handle NEWSEGMENT"); GST_DEBUG_OBJECT (videorate, "handle NEWSEGMENT");
...@@ -659,7 +659,7 @@ gst_video_rate_event (GstPad * pad, GstEvent * event) ...@@ -659,7 +659,7 @@ gst_video_rate_event (GstPad * pad, GstEvent * event)
} }
/* We just want to update the accumulated stream_time */ /* We just want to update the accumulated stream_time */
gst_segment_copy_into (&segment, &videorate->segment); gst_segment_copy_into (segment, &videorate->segment);
GST_DEBUG_OBJECT (videorate, "updated segment: %" GST_SEGMENT_FORMAT, GST_DEBUG_OBJECT (videorate, "updated segment: %" GST_SEGMENT_FORMAT,
&videorate->segment); &videorate->segment);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment