mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
base: Update for SEGMENT event parse API changes
This commit is contained in:
parent
a46485e357
commit
884213b8b8
21 changed files with 49 additions and 49 deletions
|
@ -210,21 +210,21 @@ gst_gio_base_sink_event (GstBaseSink * base_sink, GstEvent * event)
|
|||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_SEGMENT:
|
||||
if (G_IS_OUTPUT_STREAM (sink->stream)) {
|
||||
GstSegment segment;
|
||||
const GstSegment *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_format_get_name (segment.format));
|
||||
gst_format_get_name (segment->format));
|
||||
break;
|
||||
}
|
||||
|
||||
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);
|
||||
if (ret == GST_FLOW_OK)
|
||||
sink->position = segment.start;
|
||||
sink->position = segment->start;
|
||||
} else {
|
||||
ret = GST_FLOW_NOT_SUPPORTED;
|
||||
}
|
||||
|
|
|
@ -442,27 +442,27 @@ gst_gnome_vfs_sink_handle_event (GstBaseSink * basesink, GstEvent * event)
|
|||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_SEGMENT:{
|
||||
GnomeVFSResult res;
|
||||
GstSegment segment;
|
||||
const GstSegment *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_format_get_name (segment.format));
|
||||
gst_format_get_name (segment->format));
|
||||
break;
|
||||
}
|
||||
|
||||
GST_LOG_OBJECT (sink, "seeking to offset %" G_GINT64_FORMAT,
|
||||
segment.start);
|
||||
res = gnome_vfs_seek (sink->handle, GNOME_VFS_SEEK_START, segment.start);
|
||||
segment->start);
|
||||
res = gnome_vfs_seek (sink->handle, GNOME_VFS_SEEK_START, segment->start);
|
||||
|
||||
if (res != GNOME_VFS_OK) {
|
||||
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));
|
||||
ret = FALSE;
|
||||
} else {
|
||||
sink->current_pos = segment.start;
|
||||
sink->current_pos = segment->start;
|
||||
}
|
||||
|
||||
break;
|
||||
|
|
|
@ -513,7 +513,7 @@ gst_visual_sink_event (GstPad * pad, GstEvent * event)
|
|||
/* the newsegment values are used to clip the input samples
|
||||
* and to convert the incomming timestamps to running time so
|
||||
* we can do QoS */
|
||||
gst_event_parse_segment (event, &visual->segment);
|
||||
gst_event_copy_segment (event, &visual->segment);
|
||||
|
||||
/* and forward */
|
||||
res = gst_pad_push_event (visual->srcpad, event);
|
||||
|
|
|
@ -283,18 +283,18 @@ gst_ogg_mux_sink_event (GstPad * pad, GstEvent * event)
|
|||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_SEGMENT:
|
||||
{
|
||||
GstSegment segment;
|
||||
const GstSegment *segment;
|
||||
|
||||
gst_event_parse_segment (event, &segment);
|
||||
|
||||
/* We don't support non time NEWSEGMENT events */
|
||||
if (segment.format != GST_FORMAT_TIME) {
|
||||
if (segment->format != GST_FORMAT_TIME) {
|
||||
gst_event_unref (event);
|
||||
event = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
gst_segment_copy_into (&segment, &ogg_pad->segment);
|
||||
gst_segment_copy_into (segment, &ogg_pad->segment);
|
||||
break;
|
||||
}
|
||||
case GST_EVENT_FLUSH_STOP:{
|
||||
|
|
|
@ -2131,15 +2131,15 @@ gst_base_text_overlay_text_event (GstPad * pad, GstEvent * event)
|
|||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_SEGMENT:
|
||||
{
|
||||
GstSegment segment;
|
||||
const GstSegment *segment;
|
||||
|
||||
overlay->text_eos = FALSE;
|
||||
|
||||
gst_event_parse_segment (event, &segment);
|
||||
|
||||
if (segment.format == GST_FORMAT_TIME) {
|
||||
if (segment->format == GST_FORMAT_TIME) {
|
||||
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,
|
||||
&overlay->text_segment);
|
||||
GST_OBJECT_UNLOCK (overlay);
|
||||
|
@ -2212,17 +2212,17 @@ gst_base_text_overlay_video_event (GstPad * pad, GstEvent * event)
|
|||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_SEGMENT:
|
||||
{
|
||||
GstSegment segment;
|
||||
const GstSegment *segment;
|
||||
|
||||
GST_DEBUG_OBJECT (overlay, "received new 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,
|
||||
&overlay->segment);
|
||||
|
||||
gst_segment_copy_into (&segment, &overlay->segment);
|
||||
gst_segment_copy_into (segment, &overlay->segment);
|
||||
} else {
|
||||
GST_ELEMENT_WARNING (overlay, STREAM, MUX, (NULL),
|
||||
("received non-TIME newsegment event on video input"));
|
||||
|
|
|
@ -630,18 +630,18 @@ theora_dec_sink_event (GstPad * pad, GstEvent * event)
|
|||
break;
|
||||
case GST_EVENT_SEGMENT:
|
||||
{
|
||||
GstSegment segment;
|
||||
const GstSegment *segment;
|
||||
|
||||
gst_event_parse_segment (event, &segment);
|
||||
|
||||
/* we need TIME format */
|
||||
if (segment.format != GST_FORMAT_TIME)
|
||||
if (segment->format != GST_FORMAT_TIME)
|
||||
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 */
|
||||
gst_segment_copy_into (&segment, &dec->segment);
|
||||
gst_segment_copy_into (segment, &dec->segment);
|
||||
dec->seqnum = gst_event_get_seqnum (event);
|
||||
|
||||
/* We don't forward this unless/until the decoder is initialised */
|
||||
|
|
|
@ -831,7 +831,7 @@ theora_enc_sink_event (GstPad * pad, GstEvent * event)
|
|||
switch (GST_EVENT_TYPE (event)) {
|
||||
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);
|
||||
break;
|
||||
|
|
|
@ -488,18 +488,18 @@ vorbis_dec_sink_event (GstPad * pad, GstEvent * event)
|
|||
break;
|
||||
case GST_EVENT_SEGMENT:
|
||||
{
|
||||
GstSegment segment;
|
||||
const GstSegment *segment;
|
||||
|
||||
gst_event_parse_segment (event, &segment);
|
||||
|
||||
/* we need time for now */
|
||||
if (segment.format != GST_FORMAT_TIME)
|
||||
if (segment->format != GST_FORMAT_TIME)
|
||||
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 */
|
||||
gst_segment_copy_into (&segment, &dec->segment);
|
||||
gst_segment_copy_into (segment, &dec->segment);
|
||||
dec->seqnum = gst_event_get_seqnum (event);
|
||||
|
||||
if (dec->initialized)
|
||||
|
|
|
@ -968,12 +968,12 @@ gst_vorbis_enc_sink_event (GstPad * pad, GstEvent * event)
|
|||
break;
|
||||
case GST_EVENT_SEGMENT:
|
||||
{
|
||||
GstSegment segment;
|
||||
const GstSegment *segment;
|
||||
|
||||
gst_event_parse_segment (event, &segment);
|
||||
|
||||
if (segment.format == GST_FORMAT_TIME) {
|
||||
gst_segment_copy_into (&segment, &vorbisenc->segment);
|
||||
if (segment->format == GST_FORMAT_TIME) {
|
||||
gst_segment_copy_into (segment, &vorbisenc->segment);
|
||||
}
|
||||
}
|
||||
/* fall through */
|
||||
|
|
|
@ -407,7 +407,7 @@ gst_base_rtp_depayload_handle_event (GstBaseRTPDepayload * filter,
|
|||
break;
|
||||
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
|
||||
* the NTP time and other things we receive in caps */
|
||||
forward = FALSE;
|
||||
|
|
|
@ -412,7 +412,7 @@ gst_basertppayload_event (GstPad * pad, GstEvent * event)
|
|||
GstSegment *segment;
|
||||
|
||||
segment = &basertppayload->segment;
|
||||
gst_event_parse_segment (event, segment);
|
||||
gst_event_copy_segment (event, segment);
|
||||
|
||||
GST_DEBUG_OBJECT (basertppayload,
|
||||
"configured SEGMENT %" GST_SEGMENT_FORMAT, segment);
|
||||
|
|
|
@ -738,7 +738,7 @@ gst_tag_demux_sink_event (GstPad * pad, GstEvent * event)
|
|||
break;
|
||||
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;
|
||||
gst_event_unref (event);
|
||||
|
|
|
@ -316,7 +316,7 @@ gst_audio_rate_sink_event (GstPad * pad, GstEvent * event)
|
|||
break;
|
||||
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");
|
||||
#if 0
|
||||
|
|
|
@ -352,7 +352,7 @@ smart_encoder_sink_event (GstPad * pad, GstEvent * event)
|
|||
break;
|
||||
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,
|
||||
smart_encoder->segment);
|
||||
|
|
|
@ -240,7 +240,7 @@ gst_play_sink_audio_convert_sink_event (GstPad * pad, GstEvent * event)
|
|||
GST_PLAY_SINK_AUDIO_CONVERT_LOCK (self);
|
||||
GST_DEBUG_OBJECT (self, "Segment before %" GST_SEGMENT_FORMAT,
|
||||
&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,
|
||||
&self->segment);
|
||||
GST_PLAY_SINK_AUDIO_CONVERT_UNLOCK (self);
|
||||
|
|
|
@ -222,7 +222,7 @@ gst_play_sink_video_convert_sink_event (GstPad * pad, GstEvent * event)
|
|||
GST_PLAY_SINK_VIDEO_CONVERT_LOCK (self);
|
||||
GST_DEBUG_OBJECT (self, "Segment before %" GST_SEGMENT_FORMAT,
|
||||
&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,
|
||||
&self->segment);
|
||||
GST_PLAY_SINK_VIDEO_CONVERT_UNLOCK (self);
|
||||
|
|
|
@ -239,7 +239,7 @@ gst_selector_pad_event (GstPad * pad, GstEvent * event)
|
|||
break;
|
||||
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,
|
||||
&selpad->segment);
|
||||
|
|
|
@ -350,7 +350,7 @@ gst_stream_synchronizer_sink_event (GstPad * pad, GstEvent * event)
|
|||
GstStream *stream;
|
||||
GstSegment segment;
|
||||
|
||||
gst_event_parse_segment (event, &segment);
|
||||
gst_event_copy_segment (event, &segment);
|
||||
|
||||
GST_STREAM_SYNCHRONIZER_LOCK (self);
|
||||
stream = gst_pad_get_element_private (pad);
|
||||
|
|
|
@ -1644,7 +1644,7 @@ gst_subtitle_overlay_video_sink_event (GstPad * pad, GstEvent * event)
|
|||
if (GST_EVENT_TYPE (event) == GST_EVENT_SEGMENT) {
|
||||
|
||||
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) {
|
||||
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)
|
|||
|
||||
if (GST_EVENT_TYPE (event) == GST_EVENT_SEGMENT) {
|
||||
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,
|
||||
&self->subtitle_segment);
|
||||
}
|
||||
|
|
|
@ -1580,7 +1580,7 @@ gst_sub_parse_sink_event (GstPad * pad, GstEvent * event)
|
|||
}
|
||||
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_format_get_name (self->segment.format));
|
||||
|
||||
|
|
|
@ -616,11 +616,11 @@ gst_video_rate_event (GstPad * pad, GstEvent * event)
|
|||
switch (GST_EVENT_TYPE (event)) {
|
||||
case GST_EVENT_SEGMENT:
|
||||
{
|
||||
GstSegment segment;
|
||||
const GstSegment *segment;
|
||||
|
||||
gst_event_parse_segment (event, &segment);
|
||||
|
||||
if (segment.format != GST_FORMAT_TIME)
|
||||
if (segment->format != GST_FORMAT_TIME)
|
||||
goto format_error;
|
||||
|
||||
GST_DEBUG_OBJECT (videorate, "handle NEWSEGMENT");
|
||||
|
@ -659,7 +659,7 @@ gst_video_rate_event (GstPad * pad, GstEvent * event)
|
|||
}
|
||||
|
||||
/* 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,
|
||||
&videorate->segment);
|
||||
|
|
Loading…
Reference in a new issue