Browse code

avdevice/libndi_newtek_dec: add extra_ips option to libndi_newtek allowing use remote network sources

Signed-off-by: Anton Platov <anton@platov.net>
Signed-off-by: Marton Balint <cus@passwd.hu>

Anton Platov authored on 2018/10/29 21:57:31
Showing 3 changed files
... ...
@@ -1078,6 +1078,10 @@ Defaults to @option{0.5}.
1078 1078
 When this flag is @option{false}, all video that you receive will be progressive.
1079 1079
 Defaults to @option{true}.
1080 1080
 
1081
+@item extra_ips
1082
+If is set to list of comma separated ip addresses, scan for sources not only
1083
+using mDNS but also use unicast ip addresses specified by this list.
1084
+
1081 1085
 @end table
1082 1086
 
1083 1087
 @subsection Examples
... ...
@@ -1091,11 +1095,24 @@ ffmpeg -f libndi_newtek -find_sources 1 -i dummy
1091 1091
 @end example
1092 1092
 
1093 1093
 @item
1094
+List local and remote input devices:
1095
+@example
1096
+ffmpeg -f libndi_newtek -extra_ips "192.168.10.10" -find_sources 1 -i dummy
1097
+@end example
1098
+
1099
+@item
1094 1100
 Restream to NDI:
1095 1101
 @example
1096 1102
 ffmpeg -f libndi_newtek -i "DEV-5.INTERNAL.M1STEREO.TV (NDI_SOURCE_NAME_1)" -f libndi_newtek -y NDI_SOURCE_NAME_2
1097 1103
 @end example
1098 1104
 
1105
+@item
1106
+Restream remote NDI to local NDI:
1107
+@example
1108
+ffmpeg -f libndi_newtek -extra_ips "192.168.10.10" -i "DEV-5.REMOTE.M1STEREO.TV (NDI_SOURCE_NAME_1)" -f libndi_newtek -y NDI_SOURCE_NAME_2
1109
+@end example
1110
+
1111
+
1099 1112
 @end itemize
1100 1113
 
1101 1114
 @section openal
... ...
@@ -33,6 +33,7 @@ struct NDIContext {
33 33
     int find_sources;
34 34
     int64_t wait_sources;
35 35
     int allow_video_fields;
36
+    char *extra_ips;
36 37
 
37 38
     /* Runtime */
38 39
     NDIlib_recv_create_t *recv;
... ...
@@ -99,7 +100,7 @@ static int ndi_find_sources(AVFormatContext *avctx, const char *name, NDIlib_sou
99 99
     struct NDIContext *ctx = avctx->priv_data;
100 100
     const NDIlib_source_t *ndi_srcs = NULL;
101 101
     const NDIlib_find_create_t find_create_desc = { .show_local_sources = true,
102
-        .p_groups = NULL, .p_extra_ips = NULL };
102
+        .p_groups = NULL, .p_extra_ips = ctx->extra_ips };
103 103
 
104 104
     if (!ctx->ndi_find)
105 105
         ctx->ndi_find = NDIlib_find_create2(&find_create_desc);
... ...
@@ -317,6 +318,7 @@ static const AVOption options[] = {
317 317
     { "find_sources", "Find available sources"  , OFFSET(find_sources), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, DEC },
318 318
     { "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 },
319 319
     { "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 },
320
+    { "extra_ips", "List of comma separated ip addresses to scan for remote sources",       OFFSET(extra_ips), AV_OPT_TYPE_STRING, {.str = NULL }, 0, 0, DEC },
320 321
     { NULL },
321 322
 };
322 323
 
... ...
@@ -29,7 +29,7 @@
29 29
 
30 30
 #define LIBAVDEVICE_VERSION_MAJOR  58
31 31
 #define LIBAVDEVICE_VERSION_MINOR   4
32
-#define LIBAVDEVICE_VERSION_MICRO 106
32
+#define LIBAVDEVICE_VERSION_MICRO 107
33 33
 
34 34
 #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
35 35
                                                LIBAVDEVICE_VERSION_MINOR, \