-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix segment handling in interpipesrc #98
base: develop
Are you sure you want to change the base?
Changes from all commits
3064a06
2fdcbd8
4d78cba
dba90fc
b261bf6
7d09a3a
ccbcb49
afda5ae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -473,13 +473,14 @@ gst_inter_pipe_src_create (GstBaseSrc * base, guint64 offset, guint size, | |
"Dequeue buffer %p with timestamp (PTS) %" GST_TIME_FORMAT, *buf, | ||
GST_TIME_ARGS (GST_BUFFER_PTS (*buf))); | ||
|
||
if (!g_queue_is_empty (src->pending_serial_events)) { | ||
while (!g_queue_is_empty (src->pending_serial_events)) { | ||
guint curr_bytes; | ||
/*Pending Serial Events Queue */ | ||
serial_event = g_queue_peek_head (src->pending_serial_events); | ||
|
||
GST_DEBUG_OBJECT (src, | ||
"Got event with timestamp %" GST_TIME_FORMAT, | ||
"Got event %s with timestamp %" GST_TIME_FORMAT, | ||
GST_EVENT_TYPE_NAME (serial_event), | ||
GST_TIME_ARGS (GST_EVENT_TIMESTAMP (serial_event))); | ||
|
||
curr_bytes = gst_app_src_get_current_level_bytes (GST_APP_SRC (src)); | ||
|
@@ -490,11 +491,27 @@ gst_inter_pipe_src_create (GstBaseSrc * base, guint64 offset, guint size, | |
GST_EVENT_TYPE_NAME (serial_event)); | ||
|
||
serial_event = g_queue_pop_head (src->pending_serial_events); | ||
gst_pad_push_event (srcpad, serial_event); | ||
|
||
if (GST_EVENT_TYPE (serial_event) == GST_EVENT_SEGMENT) { | ||
const GstSegment *segment = NULL; | ||
|
||
gst_event_parse_segment (serial_event, &segment); | ||
g_assert (segment != NULL); | ||
|
||
GST_DEBUG_OBJECT (src, | ||
"Update new segment %" GST_PTR_FORMAT, serial_event); | ||
if (!gst_base_src_new_segment (base, segment)) { | ||
GST_ERROR_OBJECT (src, | ||
"Couldn't set new segment %" GST_PTR_FORMAT, serial_event); | ||
} | ||
} else { | ||
gst_pad_push_event (srcpad, serial_event); | ||
} | ||
} else { | ||
GST_DEBUG_OBJECT (src, "Event %s timestamp is greater than the " | ||
"buffer timestamp, can't send serial event yet", | ||
GST_EVENT_TYPE_NAME (serial_event)); | ||
break; | ||
} | ||
} | ||
|
||
|
@@ -671,6 +688,7 @@ gst_inter_pipe_src_push_buffer (GstInterPipeIListener * iface, | |
GST_TIME_ARGS (GST_BUFFER_PTS (buffer))); | ||
} else if (GST_INTER_PIPE_SRC_RESTART_TIMESTAMP == src->stream_sync) { | ||
/* Remove the incoming timestamp to be generated according this basetime */ | ||
buffer = gst_buffer_make_writable (buffer); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please remove this change from this pull request this corresponds to a different fix There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
GST_BUFFER_PTS (buffer) = GST_CLOCK_TIME_NONE; | ||
GST_BUFFER_DTS (buffer) = GST_CLOCK_TIME_NONE; | ||
} | ||
|
@@ -719,8 +737,11 @@ gst_inter_pipe_src_push_event (GstInterPipeIListener * iface, GstEvent * event, | |
srcbasetime = gst_element_get_base_time (GST_ELEMENT (appsrc)); | ||
|
||
if (srcbasetime > basetime) { | ||
GST_EVENT_TIMESTAMP (event) = | ||
GST_EVENT_TIMESTAMP (event) - (srcbasetime - basetime); | ||
if (GST_EVENT_TIMESTAMP (event) > (srcbasetime - basetime)) | ||
GST_EVENT_TIMESTAMP (event) = | ||
GST_EVENT_TIMESTAMP (event) - (srcbasetime - basetime); | ||
else | ||
GST_EVENT_TIMESTAMP (event) = 0; | ||
Comment on lines
+740
to
+744
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please remove these changes from this pull request that correspond to a different fix There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This fix is now in #103 |
||
} else { | ||
GST_EVENT_TIMESTAMP (event) = | ||
GST_EVENT_TIMESTAMP (event) + (basetime - srcbasetime); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for runtime errors, this project uses GST_ERROR_OBJECT instead of assertions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done