From patchwork Thu May 31 22:20:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Holljes X-Patchwork-Id: 9212 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:11c:0:0:0:0:0 with SMTP id c28-v6csp164205jad; Thu, 31 May 2018 15:28:50 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK5DW4qO4MRyApx8O7QX3e4kNpVKNr6lMQcKgBKnZ4A1yZCwjNl02TOQrW30St0w+9jfu5E X-Received: by 2002:a1c:da13:: with SMTP id r19-v6mr1075801wmg.2.1527805730846; Thu, 31 May 2018 15:28:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527805730; cv=none; d=google.com; s=arc-20160816; b=VM2ZRvQbk5ytMqasa+kW6N3kerEPk+ab6Bz0Teo0GqpufhaHPltiYV0PYig1zBGFdf vz1PlnF367BqLNdquunR7nfv9daDYyNvCNXvpSgA127xsqmtLIuZKbWZ9LcW/uwcmbx2 0lXKPG9V0Qb+MZor3TPTUqPahtrppzl74+2ccRrivkieIQGWTMnBY0QMe2prvrBnAW7a rxDDHKJsz5dOUBKKXj3rSjBo5eRTe2jkDcYVwlMIVEuwf2vyKBvI6v+YTWoxTng8f4yS +HDeNEwgayOB2E/Q7wK48kHwdJyqDEd5mOsJnrIns+HkXdaWE8Xi/h6nPVw3hXt2b2e0 dEBQ== 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=zuGZI027JBu5M1O8Byu1ufyIoa3edQcNXApNJUht1MCAViezt3gNTJ5dghrfhJoo4I CsnM5Kh+4Xo3EqqI3foWIlwJb+bGasSbc/APRHQDKlsLLZN+hshVCmV4Z4hEJcafGRGY dcDN2mx6naTElhGtBjCRXlC2SQcyQerx5xzNz5hQfmXDZcch+IEkFh7z93w+EfBIChuN /8RJSwm6Q+AUkwoVpizJGyiKphVxlJzpmjTAt2pCAVkwZP2R86sFvIv2QkzqOyqdKQd4 y2HfTCjz2sephHaVvkzgNlDswFKFmnMILDK+cGwtvg74V7qK4enunv84hMxxbth/z45o 6TSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@googlemail.com header.s=20161025 header.b=nv02d0M7; 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 i11-v6si13917507wrh.108.2018.05.31.15.28.50; Thu, 31 May 2018 15:28:50 -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=nv02d0M7; 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 EB27468A592; Fri, 1 Jun 2018 01:28:03 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr0-f172.google.com (mail-wr0-f172.google.com [209.85.128.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4AE5E68A546 for ; Fri, 1 Jun 2018 01:28:03 +0300 (EEST) Received: by mail-wr0-f172.google.com with SMTP id l41-v6so34499807wre.7 for ; Thu, 31 May 2018 15:28:48 -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=nv02d0M7PlvW8/TxFz1pxDU1xsfn3qqiT4wt6dfc00dl9NOUkG1TWb1Lgj3t1Y+jON f8gKIVutqi53SviQQ0pEn1IUreRhVdhiNjba8KmkX36ebVbEvN0jBvGS0mtwH5RuNVIn X4cKvGwR9M3GAt7HMvO8HJO3aSubmVBUWRlOVOY/1zSVy6Jv5bnWQ91Hf1kvcOBUuC2E 7/ylmhL1fv74v7P8wgvKGV0bIXeu0dUHWZmuNknrXO4Mlgd8Kzsbcm1YMBY8V+UVqu/C UOZ6bMpnVZmirnGSLLSzOallLVjr3Sq4p+myZkk9k5Hf6r9k4S/kMY6Ykdl/sU/nq2Ei NSsA== 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=RTftrkaX3GPVC9Ka6oHJea/0fOzDL3822Xu32ahut1pgvzPjbIxgMmaDYkduShfESU tCQ0cF3Gc3/VmgeEgF6dEDyb5hRC/oFihX3oOD15twmJiaQcJ79Vf6uDJkpE3XyxjKHW HunbK5fQ7qu+B+jwMQgFrQz9X6vNCBM7L/ax9lXXpWUhu1mAp/3vbFAq29GZQhcbObee FyMN0iFmglygJybH01fw1a3XkNmntPh6aUI2cDB65zesDGsWg9QzuWxV/29GI9K0QWFq /Ac9nT7PFKDJ+nGtL/a0HTgOhk+U4q2BsUGrxK7+QE5jyAU2kdW9nl0nJ1MYjQf4y80o kivw== X-Gm-Message-State: ALKqPwcOt26T9FYvuawqpZtctgeDKEtedHy/DSvQTAk5kW+bvoL1Tj4p vafY6++8OS9Z82HiUtLn6nW5nA== X-Received: by 2002:adf:9cc2:: with SMTP id h2-v6mr6476575wre.11.1527805248880; Thu, 31 May 2018 15:20:48 -0700 (PDT) Received: from localhost.localdomain ([46.5.2.0]) by smtp.gmail.com with ESMTPSA id 72-v6sm38288429wrb.22.2018.05.31.15.20.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 May 2018 15:20:47 -0700 (PDT) From: Stephan Holljes To: ffmpeg-devel@ffmpeg.org Date: Fri, 1 Jun 2018 00:20:29 +0200 Message-Id: <20180531222032.30111-6-klaxa1337@googlemail.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180531222032.30111-1-klaxa1337@googlemail.com> References: <20180528181859.12182-1-klaxa1337@googlemail.com> <20180531222032.30111-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.