diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2014-07-10 15:12:34 (GMT) |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2014-07-10 15:14:52 (GMT) |
commit | aefc695d53e0d519d438741ca96923b95212f73a (patch) | |
tree | 8c598f51500299ad3863a6ba5e3d091409d0ef03 /src/lib.h | |
parent | 720b406ed6382187bbb60ec9038828178d58736b (diff) | |
download | soup-transcoding-proxy-aefc695d53e0d519d438741ca96923b95212f73a.zip soup-transcoding-proxy-aefc695d53e0d519d438741ca96923b95212f73a.tar.gz |
appsink: Add a client timeout, and handle eos separately
If no chunks are written to a client for 10 seconds, we end that stream and
clean it up. This is currently happening due to a bug, but might happen due to
bad/slow clients as well.
Instead of handling EOS from null samples, handle EOS through the signal
handler. This is a more reliable way of handling EOS, and also works when the
whole pipeline is torn down because the PUT stream ended.
Diffstat (limited to 'src/lib.h')
-rw-r--r-- | src/lib.h | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -32,11 +32,13 @@ struct _TranscodeServerCtx { struct _TranscodeClientCtx { SoupMessage *msg; - GstElement *appsink; + GstElement *appsink; /* We hold an extra ref to this */ GstPad *ghostsinkpad; + GMutex can_write_chunk; - gulong first_sample_handler_id; - /* The transcode server context */ + guint timeout_handler_id; + guint seconds_since_write; + /* The transcode server context; we don't hold a ref to this */ TranscodeServerCtx *server_ctx; }; |