[FFmpeg-devel] [PATCH 5/8] publisher.h: Add stream_name to PublisherContext

Stephan Holljes klaxa1337 at googlemail.com
Fri Jun 1 01:20:29 EEST 2018


Signed-off-by: Stephan Holljes <klaxa1337 at googlemail.com>
---
 publisher.c | 3 ++-
 publisher.h | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/publisher.c b/publisher.c
index 1123056..2e96f2f 100644
--- a/publisher.c
+++ b/publisher.c
@@ -93,11 +93,12 @@ void client_push_segment(struct Client *c, struct Segment *seg)
     client_set_state(c, WRITABLE);
 }
 
-void publisher_init(struct PublisherContext **pub)
+void publisher_init(struct PublisherContext **pub, char *stream_name)
 {
     int i;
     struct PublisherContext *pc = (struct PublisherContext*) av_malloc(sizeof(struct PublisherContext));
     pc->nb_threads = 8;
+    pc->stream_name = stream_name;
     pc->current_segment_id = -1;
     pc->shutdown = 0;
     pc->buffer = av_fifo_alloc_array(sizeof(struct Segment), MAX_SEGMENTS);
diff --git a/publisher.h b/publisher.h
index 97b745d..e25c33d 100644
--- a/publisher.h
+++ b/publisher.h
@@ -73,6 +73,7 @@ struct PublisherContext {
     int nb_threads;
     int current_segment_id;
     int shutdown; // indicate shutdown, gracefully close client connections and files and exit
+    char *stream_name;
 };
 
 /**
@@ -101,8 +102,9 @@ void client_set_state(struct Client *c, enum State state);
  * Allocate and initialize a PublisherContext
  *
  * @param pub pointer to a pointer to a PublisherContext. It will be allocated and initialized.
+ * @param stream_name string containing the name of the stream.
  */
-void publisher_init(struct PublisherContext **pub);
+void publisher_init(struct PublisherContext **pub, char *stream_name);
 
 /**
  * Push a Segment to a PublisherContext.
-- 
2.16.2



More information about the ffmpeg-devel mailing list