diff mbox

[FFmpeg-devel] libavdevice/libndi_newtek: Added extra_ips option to libndi_newtek allowing use remote network sources

Message ID 1540541762-13475-1-git-send-email-anton@platov.net
State Superseded
Headers show

Commit Message

Anton Platov Oct. 26, 2018, 8:16 a.m. UTC
Signed-off-by: Anton Platov <anton@platov.net>
---
 libavdevice/libndi_newtek_dec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Moritz Barsnick Oct. 26, 2018, 12:01 p.m. UTC | #1
On Fri, Oct 26, 2018 at 11:16:02 +0300, Anton Platov wrote:
> +    { "extra_ips", "Find available sources on extra ip addresses",       OFFSET(extra_ips), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC },
                       ^

This makes it sound like a boolean option (i.e. whether to find). In
reality, you want a comma separated string of IP addresses[1]. You
should say so, e.g.

"Extra IP addresses to find available sources on (comma separated)".

Moritz

[1] https://github.com/Palakis/obs-ndi/blob/3b9772bb64eb7b53e02df863720d48798cfe30f0/lib/ndi/Include/Processing.NDI.Find.h#L42
Marton Balint Oct. 26, 2018, 8:27 p.m. UTC | #2
On Fri, 26 Oct 2018, Moritz Barsnick wrote:

> On Fri, Oct 26, 2018 at 11:16:02 +0300, Anton Platov wrote:
>> +    { "extra_ips", "Find available sources on extra ip addresses",       OFFSET(extra_ips), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC },
>                       ^
>
> This makes it sound like a boolean option (i.e. whether to find). In
> reality, you want a comma separated string of IP addresses[1]. You
> should say so, e.g.
>
> "Extra IP addresses to find available sources on (comma separated)".

Also please update docs/indev.texi with the new option.

Thanks,
Marton
diff mbox

Patch

diff --git a/libavdevice/libndi_newtek_dec.c b/libavdevice/libndi_newtek_dec.c
index 4fb7197..a781edc 100644
--- a/libavdevice/libndi_newtek_dec.c
+++ b/libavdevice/libndi_newtek_dec.c
@@ -33,6 +33,7 @@  struct NDIContext {
     int find_sources;
     int64_t wait_sources;
     int allow_video_fields;
+    char *extra_ips;
 
     /* Runtime */
     NDIlib_recv_create_t *recv;
@@ -99,7 +100,7 @@  static int ndi_find_sources(AVFormatContext *avctx, const char *name, NDIlib_sou
     struct NDIContext *ctx = avctx->priv_data;
     const NDIlib_source_t *ndi_srcs = NULL;
     const NDIlib_find_create_t find_create_desc = { .show_local_sources = true,
-        .p_groups = NULL, .p_extra_ips = NULL };
+        .p_groups = NULL, .p_extra_ips = ctx->extra_ips };
 
     if (!ctx->ndi_find)
         ctx->ndi_find = NDIlib_find_create2(&find_create_desc);
@@ -317,6 +318,7 @@  static const AVOption options[] = {
     { "find_sources", "Find available sources"  , OFFSET(find_sources), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, DEC },
     { "wait_sources", "Time to wait until the number of online sources have changed"  , OFFSET(wait_sources), AV_OPT_TYPE_DURATION, { .i64 = 1000000 }, 100000, 20000000, DEC },
     { "allow_video_fields", "When this flag is FALSE, all video that you receive will be progressive"  , OFFSET(allow_video_fields), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, DEC },
+    { "extra_ips", "Find available sources on extra ip addresses",       OFFSET(extra_ips), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC },
     { NULL },
 };