Skip to content

[GStreamer][MSE] Removes the use of timeouts to detect data starve and last sample stages - #21

Merged
philn merged 14 commits into
masterfrom
calvaris/timeouts
Feb 11, 2016
Merged

[GStreamer][MSE] Removes the use of timeouts to detect data starve and last sample stages#21
philn merged 14 commits into
masterfrom
calvaris/timeouts

Conversation

@calvaris

Copy link
Copy Markdown
Member

The timeouts were kept and raising an error and an ASSERT to be able to detect any possible regressions in the near future. If this goes were, we can remove the timeouts.

This implementation was based on an initial one by @eocanha and I corrected the pending issues.

void AppendPipeline::handleEndOfAppendDataMarkNeeded()
{
GstEvent* event = gst_event_new_custom(GST_EVENT_CUSTOM_DOWNSTREAM, gst_structure_new_empty("end-of-append-data-mark"));
m_appendIdMarkedInSrc = guint64(gst_event_get_seqnum(event));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please simply make this member a guint32

return GST_PAD_PROBE_OK;

guint id = gst_event_get_seqnum(event);
TRACE_MEDIA_MESSAGE("custom downstream event id=%d", id);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

%u

@calvaris

Copy link
Copy Markdown
MemberAuthor

Thx for the comments, I'll fix these tomorrow morning. There seems to be also some other typos, like "reinsterting".

calvarisand others added 9 commits February 11, 2016 09:50
For this we use custom events.
Signed-off-by: Xabier Rodriguez Calvar <calvaris@igalia.com>
They only assert if reached.
Instead of deferring to the main thread with timeouts, we always put the
message through the bus as an application message. We get the message
and move the state if we are in Sampling instead of Ongoing.
This method does not blindly declares the end of the append operation,
it does the checks that were done in some cases before calling that
method.
Also, we reset to 0 the mark received at the sink when it was dealt
with.
In some cases current custom events can go thru the appsrc src pad
before the buffer itself, causing that the buffer is not processed. Now
we send a probe for buffers in the appsrc src pad and when a buffer goes
thru, we engage the process of marking the end of the append. The end of
the append is done at the main thread by sending an application message
thru the bus.
This renames the appsink probe functions and attributes.
typefind is causing problems by swaling some buffers and not letting
that information go through
In same rare cases, specially in test 30, where appends happen with not
enough data, qtdemux stalls waiting for data and append never ends. This
is a case that should happen very rarely so I reinstated the timeout to
resolve that issue while we find and alternate and more robust solution.
public:
enum AppendStage { Invalid, NotStarted, Ongoing, KeyNegotiation, DataStarve, Sampling, LastSample, Aborting };

static const unsigned int s_dataStarvedTimeoutMsec = 1000;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The lower this value is (while keeping things working), the better.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and no. This case is triggered only in cases happening not very often at all so it is not a performance loss and you also told me that having these low timeouts could cause issues in Debug mode, etc. Because of these reasons I increased the value and I think 2s is ok for the cases it has to be triggered.

philn added a commit that referenced this pull request Feb 11, 2016
[GStreamer][MSE] Removes the use of timeouts to detect data starve and last sample stages
@philn
philn merged commit 68e855a into masterFeb 11, 2016
@calvaris
calvaris deleted the calvaris/timeouts branch February 11, 2016 14:00
zdobersek added a commit that referenced this pull request May 12, 2016
README.md: improve instructions
@aazamansariaazamansari mentioned this pull request Jun 5, 2017
@nrajan002cnrajan002c mentioned this pull request Sep 27, 2018
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@calvaris@philn@eocanha