[FFmpeg-devel] [PATCH v4] avformat/libsrt: print streamid at client

Marton Balint cus at passwd.hu
Sat Nov 6 21:42:19 EET 2021



On Mon, 25 Oct 2021, Raghavendra Rao Sidlagatta wrote:

>
> On Friday, July 23, 2021 10:59 BST, "Raghavendra Rao Sidlagatta" <raghavendra.rao at collabora.com> wrote:
>   
> On Monday, March 22, 2021 06:45 GMT, "Raghavendra Rao Sidlagatta" <raghavendra.rao at collabora.com> wrote:
>   
> On Wednesday, January 20, 2021 09:48 GMT, "Raghavendra Rao Sidlagatta" <raghavendra.rao at collabora.com> wrote:
>   
> On Tuesday, October 06, 2020 08:18 BST, raghavendra <raghavendra.rao at collabora.com> wrote:
>  Print the SRT streamid at the client.
> Logged to info.
>
> Signed-off-by: raghavendra <raghavendra.rao at collabora.com>
> ---
> libavformat/libsrt.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c
> index 4025b24976..eed48c11cf 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_INFO, "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);
> --
> 2.25.1

Streamid is already dumped for listen mode. Does it make sense for other 
modes? If it does, then dumping it from listen mode should probably be 
removed. Also your patch does not follow existing coding style, e.g. 
use 4 spaces for identation.

Thanks,
Marton


More information about the ffmpeg-devel mailing list