From patchwork Thu Oct 1 13:52:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raghavendra Rao Sidlagatta X-Patchwork-Id: 22678 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id A413444BCC9 for ; Thu, 1 Oct 2020 16:52:41 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8141968A0F1; Thu, 1 Oct 2020 16:52:41 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 730BD68A0F1 for ; Thu, 1 Oct 2020 16:52:34 +0300 (EEST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: raghavendra) with ESMTPSA id 18F7829A8A0 From: raghavendra To: ffmpeg-devel@ffmpeg.org Date: Thu, 1 Oct 2020 19:22:02 +0530 Message-Id: <20201001135202.1105554-1-raghavendra.rao@collabora.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201001122910.GD8116@sunshine.barsnick.net> References: <20201001122910.GD8116@sunshine.barsnick.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v3] avformat/libsrt: print streamid at client 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: raghavendra Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Print the SRT streamid at the client. Logged to the context and changed into to verbose. Signed-off-by: raghavendra --- libavformat/libsrt.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c index 4025b24976..2cf5f57304 100644 --- a/libavformat/libsrt.c +++ b/libavformat/libsrt.c @@ -359,6 +359,13 @@ static int libsrt_set_options_pre(URLContext *h, int fd) return 0; } +static void libsrt_dump_streamid(URLContext *h, int fd) +{ + char streamid[512]; + int optlen = sizeof(streamid); + if (!libsrt_getsockopt(h, fd, SRTO_STREAMID, "SRTO_STREAMID", streamid, &optlen)) + av_log(h, AV_LOG_VERBOSE, "srt_streamid : %s\n", streamid); +} static int libsrt_setup(URLContext *h, const char *uri, int flags) { @@ -442,6 +449,8 @@ static int libsrt_setup(URLContext *h, const char *uri, int flags) goto fail1; listen_fd = fd; fd = ret; + // dump srt streamid at client + libsrt_dump_streamid(h, fd); } else { if (s->mode == SRT_MODE_RENDEZVOUS) { ret = srt_bind(fd, cur_ai->ai_addr, cur_ai->ai_addrlen);