summaryrefslogtreecommitdiff
path: root/src/lib.h
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2014-07-23 21:51:50 (GMT)
committerNirbheek Chauhan <nirbheek@centricular.com>2014-07-23 21:51:50 (GMT)
commitd6044621bfa82debbb70f3609d08b69badac36c2 (patch)
treee41b823bc83a0111085ebb3d66c7cce3dac1329c /src/lib.h
parent478b78c77e32612d84f2bfa7cc7dcc70ed59d5fb (diff)
downloadsoup-transcoding-proxy-d6044621bfa82debbb70f3609d08b69badac36c2.zip
soup-transcoding-proxy-d6044621bfa82debbb70f3609d08b69badac36c2.tar.gz
server: Track stream state better, and abort better
We now differentiate between STREAMING, FLUSHING, and FINISHED. Server aborting is now consolidated into a single function that's called from everywhere.
Diffstat (limited to 'src/lib.h')
-rw-r--r--src/lib.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lib.h b/src/lib.h
index fe63114..4813321 100644
--- a/src/lib.h
+++ b/src/lib.h
@@ -30,6 +30,13 @@
typedef struct _TranscodeServerCtx TranscodeServerCtx;
typedef struct _TranscodeClientCtx TranscodeClientCtx;
+enum stp_stream_status {
+ STP_STATUS_NONE,
+ STP_STATUS_STREAMING,
+ STP_STATUS_FLUSHING,
+ STP_STATUS_FINISHED,
+};
+
struct _TranscodeServerCtx {
SoupMessage *msg;
GstElement *pipeline;
@@ -41,7 +48,7 @@ struct _TranscodeServerCtx {
* we need to set the PUT response on EOS/ERROR on the pipeline,
* and whether to reject further data when using a persistent
* Content-Length + Content-Range PUT stream. */
- gboolean stream_finished;
+ enum stp_stream_status status;
guint seconds_since_read;
/* List of client contexts */
@@ -72,6 +79,9 @@ struct _TranscodeClientCtx {
#define stp_print_status(...) do {} while (0)
#endif
+gboolean invoke_g_hash_table_remove (TranscodeServerCtx *ctx);
+gboolean invoke_g_free_client_context (TranscodeClientCtx *ctx);
+
void stp_cleanup_transcode_server_ctx (TranscodeServerCtx *ctx);
void stp_cleanup_transcode_client_ctx (TranscodeClientCtx *ctx);