From patchwork Sun May 20 18:54:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Holljes X-Patchwork-Id: 9024 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:155:0:0:0:0:0 with SMTP id c82-v6csp7565414jad; Sun, 20 May 2018 11:54:36 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpnszLePDTuFLTvVTbpV7+dbUaoXNQBQZDj8gcuCGWaYLRREgGHtiCBqNegxSEG11cZRW2f X-Received: by 2002:a1c:1549:: with SMTP id 70-v6mr8316499wmv.35.1526842476072; Sun, 20 May 2018 11:54:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526842476; cv=none; d=google.com; s=arc-20160816; b=AGLkscAEMQA7DtcglQo5I47L5c44GHvwZHscaaJUGjB8t6M3S0ABlIZxRf3fYZ8GDd ZGDDrIbqNppMq3n2tFOMCPYFMWYoTj0jEQMOy8kRyuPS1lVVfaJPF605oMat4NTFfpED UU590TeD9rdmJFZbbclnt7UZHO7JPreyUBcTPu+pFXmj9rMJcYvxJIW2f91sR9KmpDXy 09sbzFk+wffqgtYtKdUiHjQqAni2qwHimVUZgC93u39ECVraPEqFHBkiH1r2pkVF1Pzk Y87U5+mZw68RgdXxDDskVyefGbQVsKX2SFNj4+UqCahqFnbI/c5oWhgMrPZ7rPR6ZgLG 2A1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=Lfl4UeOHG4bbk+gDlJJCjOa+CbhOq8gszSJcFOIam0U=; b=SPyN1W0JbW0AJNc/A4q8nZVSUuXGtoGtQPiel5vQ7HkUrvcgvHQbNtGAGZmumJLj7w lyLAgpNEuUrxHVwL5PTIuIel+bJCvDwSHMGzKOOu3ReACLYnIh0mWPKRoSCObXdndL9w ACCyKwGFDAJG9+ttNvmS2X4Uo/F3JH23VEbRCoVXkRt2L8APWwyD4/le52qY1XO2UmuV vGZ9mXJdHenW9Zx5oNKBP7yFJTOZH/Ilgx2RTSybyWDSfmnvl1N3JeuT5XJwGTp9HEjx BmE9+BMS935/a0XsJWr4rUB8H2gns01TpUaVfVph6gvjP8KXhTtQSmvZmPSLDsKMww4T LxTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@googlemail.com header.s=20161025 header.b=HCUFHJHx; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id j6-v6si10735610wre.173.2018.05.20.11.54.35; Sun, 20 May 2018 11:54:36 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@googlemail.com header.s=20161025 header.b=HCUFHJHx; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CDAA268A542; Sun, 20 May 2018 21:53:43 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr0-f170.google.com (mail-wr0-f170.google.com [209.85.128.170]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CA50268A53B for ; Sun, 20 May 2018 21:53:37 +0300 (EEST) Received: by mail-wr0-f170.google.com with SMTP id 94-v6so13883580wrf.5 for ; Sun, 20 May 2018 11:54:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=x6ZJp6r5YjFGHS8/++I8QP820TVYQgjDd9i1iKYMo+I=; b=HCUFHJHx2bz/RpnTsf+eHCADSyhYyxNxmEOHTPfR8RoHQlZhVLOh28PmmJv2ncUI4j ZyquoEjPGmaVwoxwytewTlEoFfKqUHSXI1M71BTUzk/y5Hn8A/8TOvNr4cSP89CidKFL 4uK/S3zAqK0+bNtoXFdXozFwha5rK07QZ80qlBqWTxJ4XOMMv+hYQoNP285nautC/vqa CUCxLKwBAbhXYAINA1jm0fbmBAdgvP3etTlqpXSp5Ipg+qP0T1Uglot0sacWpgn9r5X5 4mmp+CmPnijeYImjEBoKhkrR2Ek2d6un1xEzBlvg1yYc8mHBqTOrEWjK5EqFVUobLZ8x rJRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=x6ZJp6r5YjFGHS8/++I8QP820TVYQgjDd9i1iKYMo+I=; b=aGl1/eILGmyfVE2LJDJTGTMwqeUTZ5xdojb18P/iBlXhVVyK7Na3Vtw240rWLmS3LM auss5zQ5FZhW5VVMusjCigE1xen07sFj9DY/Sx//jH+ac0RgVTVfreE1GOgJSIIkI2Gp g/3s+IG87NA3T5SLfblLe9M6fF5mXzTCcBXbFZaIRihj+LTccgjJcNnXdOX5ZWJXk9I6 dUwHLBgpSgUIVtBjG+6WWKafspIrhFCeeyAHN/5ZYHytle+puam5YbVe4pZm+ZxHpbO4 crMR6OoFJoSEggVZdSNAyeC/kEvD4hj61xX5ZXsfW8xl6rm84yDMphoscV5GI7dTAQkA ktNA== X-Gm-Message-State: ALKqPweNnZgVRm2g7EGfXe3p0R+lbZIL1kL4P50+00lRnWR7DQg4dcZm D7wZTbmEWxa3SB+3S0o7v//zZQ== X-Received: by 2002:adf:9006:: with SMTP id h6-v6mr1962080wrh.123.1526842457604; Sun, 20 May 2018 11:54:17 -0700 (PDT) Received: from localhost.localdomain ([46.5.2.0]) by smtp.gmail.com with ESMTPSA id u8-v6sm3755918wmc.40.2018.05.20.11.54.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 May 2018 11:54:16 -0700 (PDT) From: Stephan Holljes To: ffmpeg-devel@ffmpeg.org Date: Sun, 20 May 2018 20:54:01 +0200 Message-Id: <20180520185404.29836-6-klaxa1337@googlemail.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180520185404.29836-1-klaxa1337@googlemail.com> References: <20180520185404.29836-1-klaxa1337@googlemail.com> Subject: [FFmpeg-devel] [PATCH 5/8] publisher.h: Add stream_name to PublisherContext X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Stephan Holljes MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Stephan Holljes --- 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.