Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-14 Thread Steven Liu
2016-10-15 10:19 GMT+08:00 Michael Niedermayer :

> On Sat, Oct 15, 2016 at 09:57:40AM +0800, Steven Liu wrote:
> [...]
> > and ping Luca Abeni
>
> iam not sure he is still maintaining udp, he hasnt been active since
> many years IIRC
>
ping Michael :-D

>
> [...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> There will always be a question for which you do not know the correct
> answer.
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-14 Thread Michael Niedermayer
On Sat, Oct 15, 2016 at 09:57:40AM +0800, Steven Liu wrote:
[...]
> and ping Luca Abeni

iam not sure he is still maintaining udp, he hasnt been active since
many years IIRC

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

There will always be a question for which you do not know the correct answer.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-14 Thread Steven Liu
2016-10-13 20:57 GMT+08:00 Steven Liu :

> ping
>
> 2016-10-12 14:21 GMT+08:00 Steven Liu :
>
>>
>> Signed-off-by: Steven Liu 
>> ---
>>  doc/protocols.texi|3 +++
>>  libavformat/udp.c |   19 ++-
>>  libavformat/version.h |3 +++
>>  3 files changed, 24 insertions(+), 1 deletions(-)
>>
>> diff --git a/doc/protocols.texi b/doc/protocols.texi
>> index 3abc5f3..85a3f56 100644
>> --- a/doc/protocols.texi
>> +++ b/doc/protocols.texi
>> @@ -1304,6 +1304,9 @@ input has enough packets to sustain it.
>>  When using @var{bitrate} this specifies the maximum number of bits in
>>  packet bursts.
>>
>> +@item local_port=@var{port}
>> +This is a deprecated option, you can use localport instead it.
>> +
>>  @item localport=@var{port}
>>  Override the local UDP port to bind with.
>>
>> diff --git a/libavformat/udp.c b/libavformat/udp.c
>> index 3835f98..af06b89 100644
>> --- a/libavformat/udp.c
>> +++ b/libavformat/udp.c
>> @@ -86,6 +86,9 @@ typedef struct UDPContext {
>>  int pkt_size;
>>  int is_multicast;
>>  int is_broadcast;
>> +#if FF_API_UDP_LOCAL_PORT
>> +int local_port_deprecated;
>> +#endif
>>  int local_port;
>>  int reuse_socket;
>>  int overrun_nonfatal;
>> @@ -123,7 +126,9 @@ static const AVOption options[] = {
>>  { "bitrate","Bits to send per second",
>>OFFSET(bitrate),AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
>> INT64_MAX, .flags = E },
>>  { "burst_bits", "Max length of bursts in bits (when using
>> bitrate)", OFFSET(burst_bits),   AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
>> INT64_MAX, .flags = E },
>>  { "localport",  "Local port",
>>   OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1,
>> INT_MAX, D|E },
>> -{ "local_port", "Local port",
>>   OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1,
>> INT_MAX, .flags = D|E },
>> +#if FF_API_UDP_LOCAL_PORT
>> +{ "local_port", "Local port",
>>   OFFSET(local_port_deprecated), AV_OPT_TYPE_INT,{ .i64 = -1 },
>>   -1, INT_MAX, .flags = D|E },
>> +#endif
>>  { "localaddr",  "Local address",
>>OFFSET(localaddr),  AV_OPT_TYPE_STRING, { .str = NULL },
>>.flags = D|E },
>>  { "udplite_coverage", "choose UDPLite head size which should be
>> validated by checksum", OFFSET(udplite_coverage), AV_OPT_TYPE_INT, {.i64 =
>> 0}, 0, INT_MAX, D|E },
>>  { "pkt_size",   "Maximum UDP packet size",
>>OFFSET(pkt_size),   AV_OPT_TYPE_INT,{ .i64 = 1472 },  -1,
>> INT_MAX, .flags = D|E },
>> @@ -377,6 +382,12 @@ static int udp_socket_create(URLContext *h, struct
>> sockaddr_storage *addr,
>>
>>  if (((struct sockaddr *) >dest_addr)->sa_family)
>>  family = ((struct sockaddr *) >dest_addr)->sa_family;
>> +#if FF_API_UDP_LOCAL_PORT
>> +if (s->local_port_deprecated >= 0) {
>> +av_log(s, AV_LOG_WARNING, "the local_port option is deprecated,
>> please use localport option\n");
>> +s->local_port = s->local_port_deprecated;
>> +}
>> +#endif
>>  res0 = udp_resolve_host(h, (localaddr && localaddr[0]) ? localaddr :
>> NULL,
>>  s->local_port,
>>  SOCK_DGRAM, family, AI_PASSIVE);
>> @@ -481,6 +492,12 @@ int ff_udp_set_remote_url(URLContext *h, const char
>> *uri)
>>  int ff_udp_get_local_port(URLContext *h)
>>  {
>>  UDPContext *s = h->priv_data;
>> +#if FF_API_UDP_LOCAL_PORT
>> +if (s->local_port_deprecated >= 0) {
>> +av_log(s, AV_LOG_WARNING, "the local_port option is deprecated,
>> please use localport option\n");
>> +s->local_port = s->local_port_deprecated;
>> +}
>> +#endif
>>  return s->local_port;
>>  }
>>
>> diff --git a/libavformat/version.h b/libavformat/version.h
>> index 92801b4..71c03ef 100644
>> --- a/libavformat/version.h
>> +++ b/libavformat/version.h
>> @@ -85,6 +85,9 @@
>>  #ifndef FF_API_HTTP_USER_AGENT
>>  #define FF_API_HTTP_USER_AGENT  (LIBAVFORMAT_VERSION_MAJOR < 58)
>>  #endif
>> +#ifndef FF_API_UDP_LOCAL_PORT
>> +#define FF_API_UDP_LOCAL_PORT   (LIBAVFORMAT_VERSION_MAJOR < 59)
>> +#endif
>>
>>  #ifndef FF_API_R_FRAME_RATE
>>  #define FF_API_R_FRAME_RATE1
>> --
>> 1.7.1
>>
>>
>>
>> ___
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>
>
hi wm4,

  What about this one?

and ping Luca Abeni
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-14 Thread wm4
On Sat, 8 Oct 2016 15:35:02 +0800
Steven Liu  wrote:

>

If you send a patch like this, make sure you do the following things:
- explain in the commit message WHY
- document the deprecation in the, you know, documentation
- document the replacement

It should be natural that this should be required, and everyone on this
project should follow this and similar guidelines to keep patch quality
high.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-13 Thread Steven Liu
ping

2016-10-12 14:21 GMT+08:00 Steven Liu :

>
> Signed-off-by: Steven Liu 
> ---
>  doc/protocols.texi|3 +++
>  libavformat/udp.c |   19 ++-
>  libavformat/version.h |3 +++
>  3 files changed, 24 insertions(+), 1 deletions(-)
>
> diff --git a/doc/protocols.texi b/doc/protocols.texi
> index 3abc5f3..85a3f56 100644
> --- a/doc/protocols.texi
> +++ b/doc/protocols.texi
> @@ -1304,6 +1304,9 @@ input has enough packets to sustain it.
>  When using @var{bitrate} this specifies the maximum number of bits in
>  packet bursts.
>
> +@item local_port=@var{port}
> +This is a deprecated option, you can use localport instead it.
> +
>  @item localport=@var{port}
>  Override the local UDP port to bind with.
>
> diff --git a/libavformat/udp.c b/libavformat/udp.c
> index 3835f98..af06b89 100644
> --- a/libavformat/udp.c
> +++ b/libavformat/udp.c
> @@ -86,6 +86,9 @@ typedef struct UDPContext {
>  int pkt_size;
>  int is_multicast;
>  int is_broadcast;
> +#if FF_API_UDP_LOCAL_PORT
> +int local_port_deprecated;
> +#endif
>  int local_port;
>  int reuse_socket;
>  int overrun_nonfatal;
> @@ -123,7 +126,9 @@ static const AVOption options[] = {
>  { "bitrate","Bits to send per second",
>  OFFSET(bitrate),AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
> INT64_MAX, .flags = E },
>  { "burst_bits", "Max length of bursts in bits (when using
> bitrate)", OFFSET(burst_bits),   AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
> INT64_MAX, .flags = E },
>  { "localport",  "Local port",
>   OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1,
> INT_MAX, D|E },
> -{ "local_port", "Local port",
>   OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1,
> INT_MAX, .flags = D|E },
> +#if FF_API_UDP_LOCAL_PORT
> +{ "local_port", "Local port",
>   OFFSET(local_port_deprecated), AV_OPT_TYPE_INT,{ .i64 = -1 },
> -1, INT_MAX, .flags = D|E },
> +#endif
>  { "localaddr",  "Local address",
>  OFFSET(localaddr),  AV_OPT_TYPE_STRING, { .str = NULL },
>  .flags = D|E },
>  { "udplite_coverage", "choose UDPLite head size which should be
> validated by checksum", OFFSET(udplite_coverage), AV_OPT_TYPE_INT, {.i64 =
> 0}, 0, INT_MAX, D|E },
>  { "pkt_size",   "Maximum UDP packet size",
>  OFFSET(pkt_size),   AV_OPT_TYPE_INT,{ .i64 = 1472 },  -1, INT_MAX,
> .flags = D|E },
> @@ -377,6 +382,12 @@ static int udp_socket_create(URLContext *h, struct
> sockaddr_storage *addr,
>
>  if (((struct sockaddr *) >dest_addr)->sa_family)
>  family = ((struct sockaddr *) >dest_addr)->sa_family;
> +#if FF_API_UDP_LOCAL_PORT
> +if (s->local_port_deprecated >= 0) {
> +av_log(s, AV_LOG_WARNING, "the local_port option is deprecated,
> please use localport option\n");
> +s->local_port = s->local_port_deprecated;
> +}
> +#endif
>  res0 = udp_resolve_host(h, (localaddr && localaddr[0]) ? localaddr :
> NULL,
>  s->local_port,
>  SOCK_DGRAM, family, AI_PASSIVE);
> @@ -481,6 +492,12 @@ int ff_udp_set_remote_url(URLContext *h, const char
> *uri)
>  int ff_udp_get_local_port(URLContext *h)
>  {
>  UDPContext *s = h->priv_data;
> +#if FF_API_UDP_LOCAL_PORT
> +if (s->local_port_deprecated >= 0) {
> +av_log(s, AV_LOG_WARNING, "the local_port option is deprecated,
> please use localport option\n");
> +s->local_port = s->local_port_deprecated;
> +}
> +#endif
>  return s->local_port;
>  }
>
> diff --git a/libavformat/version.h b/libavformat/version.h
> index 92801b4..71c03ef 100644
> --- a/libavformat/version.h
> +++ b/libavformat/version.h
> @@ -85,6 +85,9 @@
>  #ifndef FF_API_HTTP_USER_AGENT
>  #define FF_API_HTTP_USER_AGENT  (LIBAVFORMAT_VERSION_MAJOR < 58)
>  #endif
> +#ifndef FF_API_UDP_LOCAL_PORT
> +#define FF_API_UDP_LOCAL_PORT   (LIBAVFORMAT_VERSION_MAJOR < 59)
> +#endif
>
>  #ifndef FF_API_R_FRAME_RATE
>  #define FF_API_R_FRAME_RATE1
> --
> 1.7.1
>
>
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-11 Thread Josh de Kock



On 10/10/2016 03:50, Steven Liu wrote:


Signed-off-by: Steven Liu 
---
 doc/protocols.texi|3 +++
 libavformat/udp.c |   19 ++-
 libavformat/version.h |3 +++
 3 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/doc/protocols.texi b/doc/protocols.texi
index 3abc5f3..85a3f56 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -1304,6 +1304,9 @@ input has enough packets to sustain it.
 When using @var{bitrate} this specifies the maximum number of bits in
 packet bursts.

+@item local_port=@var{port}
+This is a deprecated option, you can use localport instead it.
+
 @item localport=@var{port}
 Override the local UDP port to bind with.

diff --git a/libavformat/udp.c b/libavformat/udp.c
index 3835f98..af06b89 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -86,6 +86,9 @@ typedef struct UDPContext {
 int pkt_size;
 int is_multicast;
 int is_broadcast;
+#if FF_API_UDP_LOCAL_PORT
+int local_port_deprecated;
+#endif
 int local_port;
 int reuse_socket;
 int overrun_nonfatal;
@@ -123,7 +126,9 @@ static const AVOption options[] = {
 { "bitrate","Bits to send per second", 
OFFSET(bitrate),AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0, INT64_MAX, .flags = E },
 { "burst_bits", "Max length of bursts in bits (when using bitrate)", 
OFFSET(burst_bits),   AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0, INT64_MAX, .flags = E },
 { "localport",  "Local port",  
OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX, D|E },
-{ "local_port", "Local port",  
OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX, .flags = D|E },
+#if FF_API_UDP_LOCAL_PORT
+{ "local_port", "Local port",  
OFFSET(local_port_deprecated), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX, .flags = D|E 
},
+#endif
 { "localaddr",  "Local address",   
OFFSET(localaddr),  AV_OPT_TYPE_STRING, { .str = NULL },   .flags = D|E },
 { "udplite_coverage", "choose UDPLite head size which should be validated by 
checksum", OFFSET(udplite_coverage), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, D|E },
 { "pkt_size",   "Maximum UDP packet size", 
OFFSET(pkt_size),   AV_OPT_TYPE_INT,{ .i64 = 1472 },  -1, INT_MAX, .flags = D|E },
@@ -377,6 +382,12 @@ static int udp_socket_create(URLContext *h, struct 
sockaddr_storage *addr,

 if (((struct sockaddr *) >dest_addr)->sa_family)
 family = ((struct sockaddr *) >dest_addr)->sa_family;
+#if FF_API_UDP_LOCAL_PORT
+if (s->local_port_deprecated >= 0) {
+av_log(s, AV_LOG_WARNING, "the local_port option will be deprecated, please 
use localport option\n");

is deprecated


+s->local_port = s->local_port_deprecated;
+}
+#endif
 res0 = udp_resolve_host(h, (localaddr && localaddr[0]) ? localaddr : NULL,
 s->local_port,
 SOCK_DGRAM, family, AI_PASSIVE);
@@ -481,6 +492,12 @@ int ff_udp_set_remote_url(URLContext *h, const char *uri)
 int ff_udp_get_local_port(URLContext *h)
 {
 UDPContext *s = h->priv_data;
+#if FF_API_UDP_LOCAL_PORT
+if (s->local_port_deprecated >= 0) {
+av_log(s, AV_LOG_WARNING, "the local_port option will be deprecated, please 
use localport option\n");

again


+s->local_port = s->local_port_deprecated;
+}
+#endif
 return s->local_port;
 }

diff --git a/libavformat/version.h b/libavformat/version.h
index 92801b4..71c03ef 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -85,6 +85,9 @@
 #ifndef FF_API_HTTP_USER_AGENT
 #define FF_API_HTTP_USER_AGENT  (LIBAVFORMAT_VERSION_MAJOR < 58)
 #endif
+#ifndef FF_API_UDP_LOCAL_PORT
+#define FF_API_UDP_LOCAL_PORT   (LIBAVFORMAT_VERSION_MAJOR < 59)
+#endif

 #ifndef FF_API_R_FRAME_RATE
 #define FF_API_R_FRAME_RATE1



Other than that LGTM, no need for two options which do the same thing.

--
Josh
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-11 Thread Steven Liu
ping

2016-10-10 10:50 GMT+08:00 Steven Liu :

>
> Signed-off-by: Steven Liu 
> ---
>  doc/protocols.texi|3 +++
>  libavformat/udp.c |   19 ++-
>  libavformat/version.h |3 +++
>  3 files changed, 24 insertions(+), 1 deletions(-)
>
> diff --git a/doc/protocols.texi b/doc/protocols.texi
> index 3abc5f3..85a3f56 100644
> --- a/doc/protocols.texi
> +++ b/doc/protocols.texi
> @@ -1304,6 +1304,9 @@ input has enough packets to sustain it.
>  When using @var{bitrate} this specifies the maximum number of bits in
>  packet bursts.
>
> +@item local_port=@var{port}
> +This is a deprecated option, you can use localport instead it.
> +
>  @item localport=@var{port}
>  Override the local UDP port to bind with.
>
> diff --git a/libavformat/udp.c b/libavformat/udp.c
> index 3835f98..af06b89 100644
> --- a/libavformat/udp.c
> +++ b/libavformat/udp.c
> @@ -86,6 +86,9 @@ typedef struct UDPContext {
>  int pkt_size;
>  int is_multicast;
>  int is_broadcast;
> +#if FF_API_UDP_LOCAL_PORT
> +int local_port_deprecated;
> +#endif
>  int local_port;
>  int reuse_socket;
>  int overrun_nonfatal;
> @@ -123,7 +126,9 @@ static const AVOption options[] = {
>  { "bitrate","Bits to send per second",
>  OFFSET(bitrate),AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
> INT64_MAX, .flags = E },
>  { "burst_bits", "Max length of bursts in bits (when using
> bitrate)", OFFSET(burst_bits),   AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
> INT64_MAX, .flags = E },
>  { "localport",  "Local port",
>   OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1,
> INT_MAX, D|E },
> -{ "local_port", "Local port",
>   OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1,
> INT_MAX, .flags = D|E },
> +#if FF_API_UDP_LOCAL_PORT
> +{ "local_port", "Local port",
>   OFFSET(local_port_deprecated), AV_OPT_TYPE_INT,{ .i64 = -1 },
> -1, INT_MAX, .flags = D|E },
> +#endif
>  { "localaddr",  "Local address",
>  OFFSET(localaddr),  AV_OPT_TYPE_STRING, { .str = NULL },
>  .flags = D|E },
>  { "udplite_coverage", "choose UDPLite head size which should be
> validated by checksum", OFFSET(udplite_coverage), AV_OPT_TYPE_INT, {.i64 =
> 0}, 0, INT_MAX, D|E },
>  { "pkt_size",   "Maximum UDP packet size",
>  OFFSET(pkt_size),   AV_OPT_TYPE_INT,{ .i64 = 1472 },  -1, INT_MAX,
> .flags = D|E },
> @@ -377,6 +382,12 @@ static int udp_socket_create(URLContext *h, struct
> sockaddr_storage *addr,
>
>  if (((struct sockaddr *) >dest_addr)->sa_family)
>  family = ((struct sockaddr *) >dest_addr)->sa_family;
> +#if FF_API_UDP_LOCAL_PORT
> +if (s->local_port_deprecated >= 0) {
> +av_log(s, AV_LOG_WARNING, "the local_port option will be
> deprecated, please use localport option\n");
> +s->local_port = s->local_port_deprecated;
> +}
> +#endif
>  res0 = udp_resolve_host(h, (localaddr && localaddr[0]) ? localaddr :
> NULL,
>  s->local_port,
>  SOCK_DGRAM, family, AI_PASSIVE);
> @@ -481,6 +492,12 @@ int ff_udp_set_remote_url(URLContext *h, const char
> *uri)
>  int ff_udp_get_local_port(URLContext *h)
>  {
>  UDPContext *s = h->priv_data;
> +#if FF_API_UDP_LOCAL_PORT
> +if (s->local_port_deprecated >= 0) {
> +av_log(s, AV_LOG_WARNING, "the local_port option will be
> deprecated, please use localport option\n");
> +s->local_port = s->local_port_deprecated;
> +}
> +#endif
>  return s->local_port;
>  }
>
> diff --git a/libavformat/version.h b/libavformat/version.h
> index 92801b4..71c03ef 100644
> --- a/libavformat/version.h
> +++ b/libavformat/version.h
> @@ -85,6 +85,9 @@
>  #ifndef FF_API_HTTP_USER_AGENT
>  #define FF_API_HTTP_USER_AGENT  (LIBAVFORMAT_VERSION_MAJOR < 58)
>  #endif
> +#ifndef FF_API_UDP_LOCAL_PORT
> +#define FF_API_UDP_LOCAL_PORT   (LIBAVFORMAT_VERSION_MAJOR < 59)
> +#endif
>
>  #ifndef FF_API_R_FRAME_RATE
>  #define FF_API_R_FRAME_RATE1
> --
> 1.7.1
>
>
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-09 Thread 刘歧

> 在 2016年10月10日,上午10:30,Steven Liu  写道:
> 
> 2016-10-10 10:27 GMT+08:00 James Almer :
> 
>> On 10/9/2016 11:24 PM, Steven Liu wrote:
>>> 
>>> Signed-off-by: Steven Liu 
>>> ---
>>> doc/protocols.texi|3 +++
>>> libavformat/udp.c |   19 ++-
>>> libavformat/version.h |3 +++
>>> 3 files changed, 24 insertions(+), 1 deletions(-)
>>> 
>>> diff --git a/doc/protocols.texi b/doc/protocols.texi
>>> index 3abc5f3..85a3f56 100644
>>> --- a/doc/protocols.texi
>>> +++ b/doc/protocols.texi
>>> @@ -1304,6 +1304,9 @@ input has enough packets to sustain it.
>>> When using @var{bitrate} this specifies the maximum number of bits in
>>> packet bursts.
>>> 
>>> +@item local_port=@var{port}
>>> +This is a deprecated option, you can use localport instead it.
>>> +
>>> @item localport=@var{port}
>>> Override the local UDP port to bind with.
>>> 
>>> diff --git a/libavformat/udp.c b/libavformat/udp.c
>>> index 3835f98..af06b89 100644
>>> --- a/libavformat/udp.c
>>> +++ b/libavformat/udp.c
>>> @@ -86,6 +86,9 @@ typedef struct UDPContext {
>>> int pkt_size;
>>> int is_multicast;
>>> int is_broadcast;
>>> +#if FF_API_UDP_LOCAL_PORT
>>> +int local_port_deprecated;
>>> +#endif
>>> int local_port;
>>> int reuse_socket;
>>> int overrun_nonfatal;
>>> @@ -123,7 +126,9 @@ static const AVOption options[] = {
>>> { "bitrate","Bits to send per second",
>>   OFFSET(bitrate),AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
>> INT64_MAX, .flags = E },
>>> { "burst_bits", "Max length of bursts in bits (when using
>> bitrate)", OFFSET(burst_bits),   AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
>> INT64_MAX, .flags = E },
>>> { "localport",  "Local port",
>>OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1,
>> INT_MAX, D|E },
>>> -{ "local_port", "Local port",
>>OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1,
>> INT_MAX, .flags = D|E },
>>> +#if FF_API_UDP_LOCAL_PORT
>>> +{ "local_port", "Local port",
>>OFFSET(local_port_deprecated), AV_OPT_TYPE_INT,{ .i64 = -1 },
>>  -1, INT_MAX, .flags = D|E },
>>> +#endif
>>> { "localaddr",  "Local address",
>>   OFFSET(localaddr),  AV_OPT_TYPE_STRING, { .str = NULL },
>>   .flags = D|E },
>>> { "udplite_coverage", "choose UDPLite head size which should be
>> validated by checksum", OFFSET(udplite_coverage), AV_OPT_TYPE_INT, {.i64 =
>> 0}, 0, INT_MAX, D|E },
>>> { "pkt_size",   "Maximum UDP packet size",
>>   OFFSET(pkt_size),   AV_OPT_TYPE_INT,{ .i64 = 1472 },  -1,
>> INT_MAX, .flags = D|E },
>>> @@ -377,6 +382,12 @@ static int udp_socket_create(URLContext *h, struct
>> sockaddr_storage *addr,
>>> 
>>> if (((struct sockaddr *) >dest_addr)->sa_family)
>>> family = ((struct sockaddr *) >dest_addr)->sa_family;
>>> +#if FF_API_UDP_LOCAL_PORT
>>> +if (s->local_port_deprecated >= 0) {
>>> +av_log(s, AV_LOG_WARNING, "the local_port option will be
>> deprecated, please use localport option\n");
>>> +s->local_port = s->local_port_deprecated;
>>> +}
>>> +#endif
>>> res0 = udp_resolve_host(h, (localaddr && localaddr[0]) ? localaddr
>> : NULL,
>>> s->local_port,
>>> SOCK_DGRAM, family, AI_PASSIVE);
>>> @@ -481,6 +492,12 @@ int ff_udp_set_remote_url(URLContext *h, const
>> char *uri)
>>> int ff_udp_get_local_port(URLContext *h)
>>> {
>>> UDPContext *s = h->priv_data;
>>> +#if FF_API_UDP_LOCAL_PORT
>>> +if (s->local_port_deprecated >= 0) {
>>> +av_log(s, AV_LOG_WARNING, "the local_port option will be
>> deprecated, please use localport option\n");
>>> +s->local_port = s->local_port_deprecated;
>>> +}
>>> +#endif
>>> return s->local_port;
>>> }
>>> 
>>> diff --git a/libavformat/version.h b/libavformat/version.h
>>> index 92801b4..8606efe 100644
>>> --- a/libavformat/version.h
>>> +++ b/libavformat/version.h
>>> @@ -85,6 +85,9 @@
>>> #ifndef FF_API_HTTP_USER_AGENT
>>> #define FF_API_HTTP_USER_AGENT  (LIBAVFORMAT_VERSION_MAJOR < 58)
>>> #endif
>>> +#ifndef FF_API_UDP_LOCAL_PORT
>>> +#define FF_API_UDP_LOCAL_PORT   (LIBAVFORMAT_VERSION_MAJOR < 68)
>> 
>> 59 is enough. Major bumps usually take place once per year or so, and
>> 
> Ok, Change to 59
> Thanks
> 
>> deprecated features are normally removed after two years.
>> 
>>> +#endif
>>> 
>>> #ifndef FF_API_R_FRAME_RATE
>>> #define FF_API_R_FRAME_RATE1
>>> 
>> 
>> ___
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>> 
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
patch update


0001-avformat-udp-deprecate-local_port-option.patch
Description: Binary data



Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-09 Thread James Almer
On 10/9/2016 11:24 PM, Steven Liu wrote:
> 
> Signed-off-by: Steven Liu 
> ---
>  doc/protocols.texi|3 +++
>  libavformat/udp.c |   19 ++-
>  libavformat/version.h |3 +++
>  3 files changed, 24 insertions(+), 1 deletions(-)
> 
> diff --git a/doc/protocols.texi b/doc/protocols.texi
> index 3abc5f3..85a3f56 100644
> --- a/doc/protocols.texi
> +++ b/doc/protocols.texi
> @@ -1304,6 +1304,9 @@ input has enough packets to sustain it.
>  When using @var{bitrate} this specifies the maximum number of bits in
>  packet bursts.
>  
> +@item local_port=@var{port}
> +This is a deprecated option, you can use localport instead it.
> +
>  @item localport=@var{port}
>  Override the local UDP port to bind with.
>  
> diff --git a/libavformat/udp.c b/libavformat/udp.c
> index 3835f98..af06b89 100644
> --- a/libavformat/udp.c
> +++ b/libavformat/udp.c
> @@ -86,6 +86,9 @@ typedef struct UDPContext {
>  int pkt_size;
>  int is_multicast;
>  int is_broadcast;
> +#if FF_API_UDP_LOCAL_PORT
> +int local_port_deprecated;
> +#endif
>  int local_port;
>  int reuse_socket;
>  int overrun_nonfatal;
> @@ -123,7 +126,9 @@ static const AVOption options[] = {
>  { "bitrate","Bits to send per second", 
> OFFSET(bitrate),AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0, INT64_MAX, 
> .flags = E },
>  { "burst_bits", "Max length of bursts in bits (when using bitrate)", 
> OFFSET(burst_bits),   AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0, INT64_MAX, 
> .flags = E },
>  { "localport",  "Local port",  
> OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX, 
> D|E },
> -{ "local_port", "Local port",  
> OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX, 
> .flags = D|E },
> +#if FF_API_UDP_LOCAL_PORT
> +{ "local_port", "Local port",  
> OFFSET(local_port_deprecated), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, 
> INT_MAX, .flags = D|E },
> +#endif
>  { "localaddr",  "Local address",   
> OFFSET(localaddr),  AV_OPT_TYPE_STRING, { .str = NULL },   
> .flags = D|E },
>  { "udplite_coverage", "choose UDPLite head size which should be 
> validated by checksum", OFFSET(udplite_coverage), AV_OPT_TYPE_INT, {.i64 = 
> 0}, 0, INT_MAX, D|E },
>  { "pkt_size",   "Maximum UDP packet size", 
> OFFSET(pkt_size),   AV_OPT_TYPE_INT,{ .i64 = 1472 },  -1, INT_MAX, 
> .flags = D|E },
> @@ -377,6 +382,12 @@ static int udp_socket_create(URLContext *h, struct 
> sockaddr_storage *addr,
>  
>  if (((struct sockaddr *) >dest_addr)->sa_family)
>  family = ((struct sockaddr *) >dest_addr)->sa_family;
> +#if FF_API_UDP_LOCAL_PORT
> +if (s->local_port_deprecated >= 0) {
> +av_log(s, AV_LOG_WARNING, "the local_port option will be deprecated, 
> please use localport option\n");
> +s->local_port = s->local_port_deprecated;
> +}
> +#endif
>  res0 = udp_resolve_host(h, (localaddr && localaddr[0]) ? localaddr : 
> NULL,
>  s->local_port,
>  SOCK_DGRAM, family, AI_PASSIVE);
> @@ -481,6 +492,12 @@ int ff_udp_set_remote_url(URLContext *h, const char *uri)
>  int ff_udp_get_local_port(URLContext *h)
>  {
>  UDPContext *s = h->priv_data;
> +#if FF_API_UDP_LOCAL_PORT
> +if (s->local_port_deprecated >= 0) {
> +av_log(s, AV_LOG_WARNING, "the local_port option will be deprecated, 
> please use localport option\n");
> +s->local_port = s->local_port_deprecated;
> +}
> +#endif
>  return s->local_port;
>  }
>  
> diff --git a/libavformat/version.h b/libavformat/version.h
> index 92801b4..8606efe 100644
> --- a/libavformat/version.h
> +++ b/libavformat/version.h
> @@ -85,6 +85,9 @@
>  #ifndef FF_API_HTTP_USER_AGENT
>  #define FF_API_HTTP_USER_AGENT  (LIBAVFORMAT_VERSION_MAJOR < 58)
>  #endif
> +#ifndef FF_API_UDP_LOCAL_PORT
> +#define FF_API_UDP_LOCAL_PORT   (LIBAVFORMAT_VERSION_MAJOR < 68)

59 is enough. Major bumps usually take place once per year or so, and
deprecated features are normally removed after two years.

> +#endif
>  
>  #ifndef FF_API_R_FRAME_RATE
>  #define FF_API_R_FRAME_RATE1
> 

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-09 Thread Steven Liu
2016-10-10 10:27 GMT+08:00 James Almer :

> On 10/9/2016 11:24 PM, Steven Liu wrote:
> >
> > Signed-off-by: Steven Liu 
> > ---
> >  doc/protocols.texi|3 +++
> >  libavformat/udp.c |   19 ++-
> >  libavformat/version.h |3 +++
> >  3 files changed, 24 insertions(+), 1 deletions(-)
> >
> > diff --git a/doc/protocols.texi b/doc/protocols.texi
> > index 3abc5f3..85a3f56 100644
> > --- a/doc/protocols.texi
> > +++ b/doc/protocols.texi
> > @@ -1304,6 +1304,9 @@ input has enough packets to sustain it.
> >  When using @var{bitrate} this specifies the maximum number of bits in
> >  packet bursts.
> >
> > +@item local_port=@var{port}
> > +This is a deprecated option, you can use localport instead it.
> > +
> >  @item localport=@var{port}
> >  Override the local UDP port to bind with.
> >
> > diff --git a/libavformat/udp.c b/libavformat/udp.c
> > index 3835f98..af06b89 100644
> > --- a/libavformat/udp.c
> > +++ b/libavformat/udp.c
> > @@ -86,6 +86,9 @@ typedef struct UDPContext {
> >  int pkt_size;
> >  int is_multicast;
> >  int is_broadcast;
> > +#if FF_API_UDP_LOCAL_PORT
> > +int local_port_deprecated;
> > +#endif
> >  int local_port;
> >  int reuse_socket;
> >  int overrun_nonfatal;
> > @@ -123,7 +126,9 @@ static const AVOption options[] = {
> >  { "bitrate","Bits to send per second",
>OFFSET(bitrate),AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
> INT64_MAX, .flags = E },
> >  { "burst_bits", "Max length of bursts in bits (when using
> bitrate)", OFFSET(burst_bits),   AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
> INT64_MAX, .flags = E },
> >  { "localport",  "Local port",
> OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1,
> INT_MAX, D|E },
> > -{ "local_port", "Local port",
> OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1,
> INT_MAX, .flags = D|E },
> > +#if FF_API_UDP_LOCAL_PORT
> > +{ "local_port", "Local port",
> OFFSET(local_port_deprecated), AV_OPT_TYPE_INT,{ .i64 = -1 },
>   -1, INT_MAX, .flags = D|E },
> > +#endif
> >  { "localaddr",  "Local address",
>OFFSET(localaddr),  AV_OPT_TYPE_STRING, { .str = NULL },
>.flags = D|E },
> >  { "udplite_coverage", "choose UDPLite head size which should be
> validated by checksum", OFFSET(udplite_coverage), AV_OPT_TYPE_INT, {.i64 =
> 0}, 0, INT_MAX, D|E },
> >  { "pkt_size",   "Maximum UDP packet size",
>OFFSET(pkt_size),   AV_OPT_TYPE_INT,{ .i64 = 1472 },  -1,
> INT_MAX, .flags = D|E },
> > @@ -377,6 +382,12 @@ static int udp_socket_create(URLContext *h, struct
> sockaddr_storage *addr,
> >
> >  if (((struct sockaddr *) >dest_addr)->sa_family)
> >  family = ((struct sockaddr *) >dest_addr)->sa_family;
> > +#if FF_API_UDP_LOCAL_PORT
> > +if (s->local_port_deprecated >= 0) {
> > +av_log(s, AV_LOG_WARNING, "the local_port option will be
> deprecated, please use localport option\n");
> > +s->local_port = s->local_port_deprecated;
> > +}
> > +#endif
> >  res0 = udp_resolve_host(h, (localaddr && localaddr[0]) ? localaddr
> : NULL,
> >  s->local_port,
> >  SOCK_DGRAM, family, AI_PASSIVE);
> > @@ -481,6 +492,12 @@ int ff_udp_set_remote_url(URLContext *h, const
> char *uri)
> >  int ff_udp_get_local_port(URLContext *h)
> >  {
> >  UDPContext *s = h->priv_data;
> > +#if FF_API_UDP_LOCAL_PORT
> > +if (s->local_port_deprecated >= 0) {
> > +av_log(s, AV_LOG_WARNING, "the local_port option will be
> deprecated, please use localport option\n");
> > +s->local_port = s->local_port_deprecated;
> > +}
> > +#endif
> >  return s->local_port;
> >  }
> >
> > diff --git a/libavformat/version.h b/libavformat/version.h
> > index 92801b4..8606efe 100644
> > --- a/libavformat/version.h
> > +++ b/libavformat/version.h
> > @@ -85,6 +85,9 @@
> >  #ifndef FF_API_HTTP_USER_AGENT
> >  #define FF_API_HTTP_USER_AGENT  (LIBAVFORMAT_VERSION_MAJOR < 58)
> >  #endif
> > +#ifndef FF_API_UDP_LOCAL_PORT
> > +#define FF_API_UDP_LOCAL_PORT   (LIBAVFORMAT_VERSION_MAJOR < 68)
>
> 59 is enough. Major bumps usually take place once per year or so, and
>
Ok, Change to 59
Thanks

> deprecated features are normally removed after two years.
>
> > +#endif
> >
> >  #ifndef FF_API_R_FRAME_RATE
> >  #define FF_API_R_FRAME_RATE1
> >
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-09 Thread Steven Liu
Hi Michael,

  What about this patch, add local_port into documention and tell users
this option will be deprecated,
  and give will be deprecated message to users when user using it.
  and give users 10 versions time. :-)

2016-10-10 10:24 GMT+08:00 Steven Liu :

>
> Signed-off-by: Steven Liu 
> ---
>  doc/protocols.texi|3 +++
>  libavformat/udp.c |   19 ++-
>  libavformat/version.h |3 +++
>  3 files changed, 24 insertions(+), 1 deletions(-)
>
> diff --git a/doc/protocols.texi b/doc/protocols.texi
> index 3abc5f3..85a3f56 100644
> --- a/doc/protocols.texi
> +++ b/doc/protocols.texi
> @@ -1304,6 +1304,9 @@ input has enough packets to sustain it.
>  When using @var{bitrate} this specifies the maximum number of bits in
>  packet bursts.
>
> +@item local_port=@var{port}
> +This is a deprecated option, you can use localport instead it.
> +
>  @item localport=@var{port}
>  Override the local UDP port to bind with.
>
> diff --git a/libavformat/udp.c b/libavformat/udp.c
> index 3835f98..af06b89 100644
> --- a/libavformat/udp.c
> +++ b/libavformat/udp.c
> @@ -86,6 +86,9 @@ typedef struct UDPContext {
>  int pkt_size;
>  int is_multicast;
>  int is_broadcast;
> +#if FF_API_UDP_LOCAL_PORT
> +int local_port_deprecated;
> +#endif
>  int local_port;
>  int reuse_socket;
>  int overrun_nonfatal;
> @@ -123,7 +126,9 @@ static const AVOption options[] = {
>  { "bitrate","Bits to send per second",
>  OFFSET(bitrate),AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
> INT64_MAX, .flags = E },
>  { "burst_bits", "Max length of bursts in bits (when using
> bitrate)", OFFSET(burst_bits),   AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
> INT64_MAX, .flags = E },
>  { "localport",  "Local port",
>   OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1,
> INT_MAX, D|E },
> -{ "local_port", "Local port",
>   OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1,
> INT_MAX, .flags = D|E },
> +#if FF_API_UDP_LOCAL_PORT
> +{ "local_port", "Local port",
>   OFFSET(local_port_deprecated), AV_OPT_TYPE_INT,{ .i64 = -1 },
> -1, INT_MAX, .flags = D|E },
> +#endif
>  { "localaddr",  "Local address",
>  OFFSET(localaddr),  AV_OPT_TYPE_STRING, { .str = NULL },
>  .flags = D|E },
>  { "udplite_coverage", "choose UDPLite head size which should be
> validated by checksum", OFFSET(udplite_coverage), AV_OPT_TYPE_INT, {.i64 =
> 0}, 0, INT_MAX, D|E },
>  { "pkt_size",   "Maximum UDP packet size",
>  OFFSET(pkt_size),   AV_OPT_TYPE_INT,{ .i64 = 1472 },  -1, INT_MAX,
> .flags = D|E },
> @@ -377,6 +382,12 @@ static int udp_socket_create(URLContext *h, struct
> sockaddr_storage *addr,
>
>  if (((struct sockaddr *) >dest_addr)->sa_family)
>  family = ((struct sockaddr *) >dest_addr)->sa_family;
> +#if FF_API_UDP_LOCAL_PORT
> +if (s->local_port_deprecated >= 0) {
> +av_log(s, AV_LOG_WARNING, "the local_port option will be
> deprecated, please use localport option\n");
> +s->local_port = s->local_port_deprecated;
> +}
> +#endif
>  res0 = udp_resolve_host(h, (localaddr && localaddr[0]) ? localaddr :
> NULL,
>  s->local_port,
>  SOCK_DGRAM, family, AI_PASSIVE);
> @@ -481,6 +492,12 @@ int ff_udp_set_remote_url(URLContext *h, const char
> *uri)
>  int ff_udp_get_local_port(URLContext *h)
>  {
>  UDPContext *s = h->priv_data;
> +#if FF_API_UDP_LOCAL_PORT
> +if (s->local_port_deprecated >= 0) {
> +av_log(s, AV_LOG_WARNING, "the local_port option will be
> deprecated, please use localport option\n");
> +s->local_port = s->local_port_deprecated;
> +}
> +#endif
>  return s->local_port;
>  }
>
> diff --git a/libavformat/version.h b/libavformat/version.h
> index 92801b4..8606efe 100644
> --- a/libavformat/version.h
> +++ b/libavformat/version.h
> @@ -85,6 +85,9 @@
>  #ifndef FF_API_HTTP_USER_AGENT
>  #define FF_API_HTTP_USER_AGENT  (LIBAVFORMAT_VERSION_MAJOR < 58)
>  #endif
> +#ifndef FF_API_UDP_LOCAL_PORT
> +#define FF_API_UDP_LOCAL_PORT   (LIBAVFORMAT_VERSION_MAJOR < 68)
> +#endif
>
>  #ifndef FF_API_R_FRAME_RATE
>  #define FF_API_R_FRAME_RATE1
> --
> 1.7.1
>
>
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-09 Thread Steven Liu
2016-10-10 5:53 GMT+08:00 Steven Liu :

>
>
> 2016-10-10 2:11 GMT+08:00 Michael Niedermayer :
>
>> On Sun, Oct 09, 2016 at 11:48:08PM +0800, Steven Liu wrote:
>> > Signed-off-by: Steven Liu 
>> > ---
>> >  libavformat/udp.c | 19 ++-
>> >  libavformat/version.h |  3 +++
>> >  2 files changed, 21 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/libavformat/udp.c b/libavformat/udp.c
>> > index 3835f98..fd400c6 100644
>> > --- a/libavformat/udp.c
>> > +++ b/libavformat/udp.c
>> > @@ -86,6 +86,9 @@ typedef struct UDPContext {
>> >  int pkt_size;
>> >  int is_multicast;
>> >  int is_broadcast;
>> > +#if FF_API_UDP_LOCAL_PORT
>> > +int local_port_deprecated;
>> > +#endif
>> >  int local_port;
>> >  int reuse_socket;
>> >  int overrun_nonfatal;
>> > @@ -123,7 +126,9 @@ static const AVOption options[] = {
>> >  { "bitrate","Bits to send per second",
>>  OFFSET(bitrate),AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
>> INT64_MAX, .flags = E },
>> >  { "burst_bits", "Max length of bursts in bits (when using
>> bitrate)", OFFSET(burst_bits),   AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
>> INT64_MAX, .flags = E },
>> >  { "localport",  "Local port",
>> OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1,
>> INT_MAX, D|E },
>> > -{ "local_port", "Local port",
>> OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1,
>> INT_MAX, .flags = D|E },
>> > +#if FF_API_UDP_LOCAL_PORT
>> > +{ "local_port", "Local port",
>> OFFSET(local_port_deprecated), AV_OPT_TYPE_INT,{ .i64 = -1
>> },-1, INT_MAX, .flags = D|E },
>> > +#endif
>> >  { "localaddr",  "Local address",
>>  OFFSET(localaddr),  AV_OPT_TYPE_STRING, { .str = NULL },
>>  .flags = D|E },
>> >  { "udplite_coverage", "choose UDPLite head size which should be
>> validated by checksum", OFFSET(udplite_coverage), AV_OPT_TYPE_INT, {.i64 =
>> 0}, 0, INT_MAX, D|E },
>> >  { "pkt_size",   "Maximum UDP packet size",
>>  OFFSET(pkt_size),   AV_OPT_TYPE_INT,{ .i64 = 1472 },  -1,
>> INT_MAX, .flags = D|E },
>> > @@ -377,6 +382,12 @@ static int udp_socket_create(URLContext *h, struct
>> sockaddr_storage *addr,
>> >
>> >  if (((struct sockaddr *) >dest_addr)->sa_family)
>> >  family = ((struct sockaddr *) >dest_addr)->sa_family;
>> > +#if FF_API_UDP_LOCAL_PORT
>> > +if (s->local_port_deprecated >= 0) {
>> > +av_log(s, AV_LOG_WARNING, "the local_port option is
>> deprecated, please use localport option\n");
>> > +s->local_port = s->local_port_deprecated;
>> > +}
>> > +#endif
>> >  res0 = udp_resolve_host(h, (localaddr && localaddr[0]) ? localaddr
>> : NULL,
>> >  s->local_port,
>> >  SOCK_DGRAM, family, AI_PASSIVE);
>> > @@ -481,6 +492,12 @@ int ff_udp_set_remote_url(URLContext *h, const
>> char *uri)
>> >  int ff_udp_get_local_port(URLContext *h)
>> >  {
>> >  UDPContext *s = h->priv_data;
>> > +#if FF_API_UDP_LOCAL_PORT
>> > +if (s->local_port_deprecated >= 0) {
>> > +av_log(s, AV_LOG_WARNING, "the local_port option is
>> deprecated, please use localport option\n");
>> > +s->local_port = s->local_port_deprecated;
>> > +}
>> > +#endif
>> >  return s->local_port;
>> >  }
>> >
>> > diff --git a/libavformat/version.h b/libavformat/version.h
>> > index 92801b4..35cfc3b 100644
>> > --- a/libavformat/version.h
>> > +++ b/libavformat/version.h
>> > @@ -85,6 +85,9 @@
>> >  #ifndef FF_API_HTTP_USER_AGENT
>> >  #define FF_API_HTTP_USER_AGENT  (LIBAVFORMAT_VERSION_MAJOR <
>> 58)
>> >  #endif
>>
>> > +#ifndef FF_API_UDP_LOCAL_PORT
>> > +#define FF_API_UDP_LOCAL_PORT   (LIBAVFORMAT_VERSION_MAJOR <
>> 58)
>> > +#endif
>>
>> i think this should be kept for quite a bit longer
>> only my oppinion
>
> The local_port is duplicate to localport.
> Perhaps we need choose one of them.
> Will increase users if it kept longer, then deprecated it will damage more
> user.
> So i think, one version of the cycle maybe better.
>
>>
>>
> [...]
>> --
>> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>>
>> You can kill me, but you cannot change the truth.
>>
>> ___
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>>
>
Okay, i see, ignore this patch please!
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-09 Thread Steven Liu
2016-10-10 2:11 GMT+08:00 Michael Niedermayer :

> On Sun, Oct 09, 2016 at 11:48:08PM +0800, Steven Liu wrote:
> > Signed-off-by: Steven Liu 
> > ---
> >  libavformat/udp.c | 19 ++-
> >  libavformat/version.h |  3 +++
> >  2 files changed, 21 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavformat/udp.c b/libavformat/udp.c
> > index 3835f98..fd400c6 100644
> > --- a/libavformat/udp.c
> > +++ b/libavformat/udp.c
> > @@ -86,6 +86,9 @@ typedef struct UDPContext {
> >  int pkt_size;
> >  int is_multicast;
> >  int is_broadcast;
> > +#if FF_API_UDP_LOCAL_PORT
> > +int local_port_deprecated;
> > +#endif
> >  int local_port;
> >  int reuse_socket;
> >  int overrun_nonfatal;
> > @@ -123,7 +126,9 @@ static const AVOption options[] = {
> >  { "bitrate","Bits to send per second",
>OFFSET(bitrate),AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
> INT64_MAX, .flags = E },
> >  { "burst_bits", "Max length of bursts in bits (when using
> bitrate)", OFFSET(burst_bits),   AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
> INT64_MAX, .flags = E },
> >  { "localport",  "Local port",
> OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1,
> INT_MAX, D|E },
> > -{ "local_port", "Local port",
> OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1,
> INT_MAX, .flags = D|E },
> > +#if FF_API_UDP_LOCAL_PORT
> > +{ "local_port", "Local port",
> OFFSET(local_port_deprecated), AV_OPT_TYPE_INT,{ .i64 = -1 },
>   -1, INT_MAX, .flags = D|E },
> > +#endif
> >  { "localaddr",  "Local address",
>OFFSET(localaddr),  AV_OPT_TYPE_STRING, { .str = NULL },
>.flags = D|E },
> >  { "udplite_coverage", "choose UDPLite head size which should be
> validated by checksum", OFFSET(udplite_coverage), AV_OPT_TYPE_INT, {.i64 =
> 0}, 0, INT_MAX, D|E },
> >  { "pkt_size",   "Maximum UDP packet size",
>OFFSET(pkt_size),   AV_OPT_TYPE_INT,{ .i64 = 1472 },  -1,
> INT_MAX, .flags = D|E },
> > @@ -377,6 +382,12 @@ static int udp_socket_create(URLContext *h, struct
> sockaddr_storage *addr,
> >
> >  if (((struct sockaddr *) >dest_addr)->sa_family)
> >  family = ((struct sockaddr *) >dest_addr)->sa_family;
> > +#if FF_API_UDP_LOCAL_PORT
> > +if (s->local_port_deprecated >= 0) {
> > +av_log(s, AV_LOG_WARNING, "the local_port option is deprecated,
> please use localport option\n");
> > +s->local_port = s->local_port_deprecated;
> > +}
> > +#endif
> >  res0 = udp_resolve_host(h, (localaddr && localaddr[0]) ? localaddr
> : NULL,
> >  s->local_port,
> >  SOCK_DGRAM, family, AI_PASSIVE);
> > @@ -481,6 +492,12 @@ int ff_udp_set_remote_url(URLContext *h, const
> char *uri)
> >  int ff_udp_get_local_port(URLContext *h)
> >  {
> >  UDPContext *s = h->priv_data;
> > +#if FF_API_UDP_LOCAL_PORT
> > +if (s->local_port_deprecated >= 0) {
> > +av_log(s, AV_LOG_WARNING, "the local_port option is deprecated,
> please use localport option\n");
> > +s->local_port = s->local_port_deprecated;
> > +}
> > +#endif
> >  return s->local_port;
> >  }
> >
> > diff --git a/libavformat/version.h b/libavformat/version.h
> > index 92801b4..35cfc3b 100644
> > --- a/libavformat/version.h
> > +++ b/libavformat/version.h
> > @@ -85,6 +85,9 @@
> >  #ifndef FF_API_HTTP_USER_AGENT
> >  #define FF_API_HTTP_USER_AGENT  (LIBAVFORMAT_VERSION_MAJOR < 58)
> >  #endif
>
> > +#ifndef FF_API_UDP_LOCAL_PORT
> > +#define FF_API_UDP_LOCAL_PORT   (LIBAVFORMAT_VERSION_MAJOR < 58)
> > +#endif
>
> i think this should be kept for quite a bit longer
> only my oppinion

The local_port is duplicate to localport.
Perhaps we need choose one of them.
Will increase users if it kept longer, then deprecated it will damage more
user.
So i think, one version of the cycle maybe better.

>
>
[...]
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> You can kill me, but you cannot change the truth.
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-09 Thread Michael Niedermayer
On Sun, Oct 09, 2016 at 11:48:08PM +0800, Steven Liu wrote:
> Signed-off-by: Steven Liu 
> ---
>  libavformat/udp.c | 19 ++-
>  libavformat/version.h |  3 +++
>  2 files changed, 21 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/udp.c b/libavformat/udp.c
> index 3835f98..fd400c6 100644
> --- a/libavformat/udp.c
> +++ b/libavformat/udp.c
> @@ -86,6 +86,9 @@ typedef struct UDPContext {
>  int pkt_size;
>  int is_multicast;
>  int is_broadcast;
> +#if FF_API_UDP_LOCAL_PORT
> +int local_port_deprecated;
> +#endif
>  int local_port;
>  int reuse_socket;
>  int overrun_nonfatal;
> @@ -123,7 +126,9 @@ static const AVOption options[] = {
>  { "bitrate","Bits to send per second", 
> OFFSET(bitrate),AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0, INT64_MAX, 
> .flags = E },
>  { "burst_bits", "Max length of bursts in bits (when using bitrate)", 
> OFFSET(burst_bits),   AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0, INT64_MAX, 
> .flags = E },
>  { "localport",  "Local port",  
> OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX, 
> D|E },
> -{ "local_port", "Local port",  
> OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX, 
> .flags = D|E },
> +#if FF_API_UDP_LOCAL_PORT
> +{ "local_port", "Local port",  
> OFFSET(local_port_deprecated), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, 
> INT_MAX, .flags = D|E },
> +#endif
>  { "localaddr",  "Local address",   
> OFFSET(localaddr),  AV_OPT_TYPE_STRING, { .str = NULL },   
> .flags = D|E },
>  { "udplite_coverage", "choose UDPLite head size which should be 
> validated by checksum", OFFSET(udplite_coverage), AV_OPT_TYPE_INT, {.i64 = 
> 0}, 0, INT_MAX, D|E },
>  { "pkt_size",   "Maximum UDP packet size", 
> OFFSET(pkt_size),   AV_OPT_TYPE_INT,{ .i64 = 1472 },  -1, INT_MAX, 
> .flags = D|E },
> @@ -377,6 +382,12 @@ static int udp_socket_create(URLContext *h, struct 
> sockaddr_storage *addr,
>  
>  if (((struct sockaddr *) >dest_addr)->sa_family)
>  family = ((struct sockaddr *) >dest_addr)->sa_family;
> +#if FF_API_UDP_LOCAL_PORT
> +if (s->local_port_deprecated >= 0) {
> +av_log(s, AV_LOG_WARNING, "the local_port option is deprecated, 
> please use localport option\n");
> +s->local_port = s->local_port_deprecated;
> +}
> +#endif
>  res0 = udp_resolve_host(h, (localaddr && localaddr[0]) ? localaddr : 
> NULL,
>  s->local_port,
>  SOCK_DGRAM, family, AI_PASSIVE);
> @@ -481,6 +492,12 @@ int ff_udp_set_remote_url(URLContext *h, const char *uri)
>  int ff_udp_get_local_port(URLContext *h)
>  {
>  UDPContext *s = h->priv_data;
> +#if FF_API_UDP_LOCAL_PORT
> +if (s->local_port_deprecated >= 0) {
> +av_log(s, AV_LOG_WARNING, "the local_port option is deprecated, 
> please use localport option\n");
> +s->local_port = s->local_port_deprecated;
> +}
> +#endif
>  return s->local_port;
>  }
>  
> diff --git a/libavformat/version.h b/libavformat/version.h
> index 92801b4..35cfc3b 100644
> --- a/libavformat/version.h
> +++ b/libavformat/version.h
> @@ -85,6 +85,9 @@
>  #ifndef FF_API_HTTP_USER_AGENT
>  #define FF_API_HTTP_USER_AGENT  (LIBAVFORMAT_VERSION_MAJOR < 58)
>  #endif

> +#ifndef FF_API_UDP_LOCAL_PORT
> +#define FF_API_UDP_LOCAL_PORT   (LIBAVFORMAT_VERSION_MAJOR < 58)
> +#endif

i think this should be kept for quite a bit longer
only my oppinion

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

You can kill me, but you cannot change the truth.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-09 Thread Steven Liu
ok, this is sent by git send-email :)
there have no newline ,and i'll always use git send-email to send patch


2016-10-09 23:48 GMT+08:00 Steven Liu :

> Signed-off-by: Steven Liu 
> ---
>  libavformat/udp.c | 19 ++-
>  libavformat/version.h |  3 +++
>  2 files changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/udp.c b/libavformat/udp.c
> index 3835f98..fd400c6 100644
> --- a/libavformat/udp.c
> +++ b/libavformat/udp.c
> @@ -86,6 +86,9 @@ typedef struct UDPContext {
>  int pkt_size;
>  int is_multicast;
>  int is_broadcast;
> +#if FF_API_UDP_LOCAL_PORT
> +int local_port_deprecated;
> +#endif
>  int local_port;
>  int reuse_socket;
>  int overrun_nonfatal;
> @@ -123,7 +126,9 @@ static const AVOption options[] = {
>  { "bitrate","Bits to send per second",
>  OFFSET(bitrate),AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
> INT64_MAX, .flags = E },
>  { "burst_bits", "Max length of bursts in bits (when using
> bitrate)", OFFSET(burst_bits),   AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
> INT64_MAX, .flags = E },
>  { "localport",  "Local port",
>   OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1,
> INT_MAX, D|E },
> -{ "local_port", "Local port",
>   OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1,
> INT_MAX, .flags = D|E },
> +#if FF_API_UDP_LOCAL_PORT
> +{ "local_port", "Local port",
>   OFFSET(local_port_deprecated), AV_OPT_TYPE_INT,{ .i64 = -1 },
> -1, INT_MAX, .flags = D|E },
> +#endif
>  { "localaddr",  "Local address",
>  OFFSET(localaddr),  AV_OPT_TYPE_STRING, { .str = NULL },
>  .flags = D|E },
>  { "udplite_coverage", "choose UDPLite head size which should be
> validated by checksum", OFFSET(udplite_coverage), AV_OPT_TYPE_INT, {.i64 =
> 0}, 0, INT_MAX, D|E },
>  { "pkt_size",   "Maximum UDP packet size",
>  OFFSET(pkt_size),   AV_OPT_TYPE_INT,{ .i64 = 1472 },  -1, INT_MAX,
> .flags = D|E },
> @@ -377,6 +382,12 @@ static int udp_socket_create(URLContext *h, struct
> sockaddr_storage *addr,
>
>  if (((struct sockaddr *) >dest_addr)->sa_family)
>  family = ((struct sockaddr *) >dest_addr)->sa_family;
> +#if FF_API_UDP_LOCAL_PORT
> +if (s->local_port_deprecated >= 0) {
> +av_log(s, AV_LOG_WARNING, "the local_port option is deprecated,
> please use localport option\n");
> +s->local_port = s->local_port_deprecated;
> +}
> +#endif
>  res0 = udp_resolve_host(h, (localaddr && localaddr[0]) ? localaddr :
> NULL,
>  s->local_port,
>  SOCK_DGRAM, family, AI_PASSIVE);
> @@ -481,6 +492,12 @@ int ff_udp_set_remote_url(URLContext *h, const char
> *uri)
>  int ff_udp_get_local_port(URLContext *h)
>  {
>  UDPContext *s = h->priv_data;
> +#if FF_API_UDP_LOCAL_PORT
> +if (s->local_port_deprecated >= 0) {
> +av_log(s, AV_LOG_WARNING, "the local_port option is deprecated,
> please use localport option\n");
> +s->local_port = s->local_port_deprecated;
> +}
> +#endif
>  return s->local_port;
>  }
>
> diff --git a/libavformat/version.h b/libavformat/version.h
> index 92801b4..35cfc3b 100644
> --- a/libavformat/version.h
> +++ b/libavformat/version.h
> @@ -85,6 +85,9 @@
>  #ifndef FF_API_HTTP_USER_AGENT
>  #define FF_API_HTTP_USER_AGENT  (LIBAVFORMAT_VERSION_MAJOR < 58)
>  #endif
> +#ifndef FF_API_UDP_LOCAL_PORT
> +#define FF_API_UDP_LOCAL_PORT   (LIBAVFORMAT_VERSION_MAJOR < 58)
> +#endif
>
>  #ifndef FF_API_R_FRAME_RATE
>  #define FF_API_R_FRAME_RATE1
> --
> 2.10.1.382.ga23ca1b.dirty
>
>
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-09 Thread Michael Niedermayer
On Sun, Oct 09, 2016 at 02:33:46PM +0200, Moritz Barsnick wrote:
> On Sun, Oct 09, 2016 at 20:25:39 +0800, Steven Liu wrote:
> > 2016-10-09 20:24 GMT+08:00 Steven Liu :
> > 
> > > check newline with chrome+gmail
> > >
> > Shit!
> 
> https://productforums.google.com/forum/#!topic/gmail/VUbNjK8mUbA
> 
> So you'd probably get the patch marked as text/plain if you renamed it
> to .patch.txt before attaching. But I don't know if
> patchwork.ffmpeg.org would handle that.

btw, if someone has a patch to patchwork to make it take
application/octet stream, please post it

The issue is likely in /patchwork/bin/parsemail.py find_content()
id fix it myself but i dont have a dummy environment to test/play with
it and i dont feel confident enough to change it on the life server
without testing

thx

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who would give up essential Liberty, to purchase a little
temporary Safety, deserve neither Liberty nor Safety -- Benjamin Franklin


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-09 Thread Moritz Barsnick
On Sun, Oct 09, 2016 at 20:25:39 +0800, Steven Liu wrote:
> 2016-10-09 20:24 GMT+08:00 Steven Liu :
> 
> > check newline with chrome+gmail
> >
> Shit!

https://productforums.google.com/forum/#!topic/gmail/VUbNjK8mUbA

So you'd probably get the patch marked as text/plain if you renamed it
to .patch.txt before attaching. But I don't know if
patchwork.ffmpeg.org would handle that.

Or use "git send-email" after all. Preferred!

Do other developers use the gmail web interface for sending patches?

Moritz
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-09 Thread Steven Liu
2016-10-09 20:09 GMT+08:00 Steven Liu :

>
>
> 2016-10-09 19:54 GMT+08:00 Michael Niedermayer :
>
>> On Sun, Oct 09, 2016 at 07:18:48PM +0800, Steven Liu wrote:
>> > 2016-10-09 19:00 GMT+08:00 Michael Niedermayer > >:
>> >
>> > > On Sat, Oct 08, 2016 at 03:35:02PM +0800, Steven Liu wrote:
>> > > >
>> > >
>> > > >  udp.c |   19 ++-
>> > > >  version.h |3 +++
>> > > >  2 files changed, 21 insertions(+), 1 deletion(-)
>> > > > bf9c64b4a0fd9a1d998c11376c5c5c2a90389caf
>> 0001-avformat-udp-deprecate-
>> > > local_port-option.patch
>> > > > From 16a41c1e76fef082bf2a7238f940968238f573d5 Mon Sep 17 00:00:00
>> 2001
>> > > > From: Steven Liu 
>> > > > Date: Sat, 8 Oct 2016 15:31:25 +0800
>> > > > Subject: [PATCH] avformat/udp: deprecate local_port option
>> > >
>> > > patchwork fails to pick up your recent patches
>> > > see: https://patchwork.ffmpeg.org/project/ffmpeg/list/?
>> > > submitter=23=%2A=both
>> > >
>> > > probably because "Type: application/octet-stream"
>> > > (this is the wrong mime type for patches)
>> > >
>> > > [...]
>> > >
>> > > --
>> > > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC7
>> 87040B0FAB
>> > >
>> > > Rewriting code that is poorly written but fully understood is good.
>> > > Rewriting code that one doesnt understand is a sign that one is less
>> smart
>> > > then the original author, trying to rewrite it will not make it
>> better.
>> > >
>> > > ___
>> > > ffmpeg-devel mailing list
>> > > ffmpeg-devel@ffmpeg.org
>> > > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>> > >
>> > >
>> >
>> > paste patch context to test patchwork pick up.
>> >
>> >
>> > Signed-off-by: Steven Liu 
>> > ---
>> >  libavformat/udp.c | 19 ++-
>> >  libavformat/version.h |  3 +++
>> >  2 files changed, 21 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/libavformat/udp.c b/libavformat/udp.c
>> > index 3835f98..fd400c6 100644
>> > --- a/libavformat/udp.c
>> > +++ b/libavformat/udp.c
>> > @@ -86,6 +86,9 @@ typedef struct UDPContext {
>> >  int pkt_size;
>> >  int is_multicast;
>> >  int is_broadcast;
>> > +#if FF_API_UDP_LOCAL_PORT
>> > +int local_port_deprecated;
>> > +#endif
>> >  int local_port;
>> >  int reuse_socket;
>> >  int overrun_nonfatal;
>> > @@ -123,7 +126,9 @@ static const AVOption options[] = {
>> >  { "bitrate","Bits to send per second",
>> > OFFSET(bitrate),AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
>> > INT64_MAX, .flags = E },
>> >  { "burst_bits", "Max length of bursts in bits (when using
>> > bitrate)", OFFSET(burst_bits),   AV_OPT_TYPE_INT64,  { .i64 = 0  },
>>  0,
>> > INT64_MAX, .flags = E },
>> >  { "localport",  "Local port",
>> >  OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1,
>> INT_MAX,
>> > D|E },
>>
>> this is corruptd by newlines
>>
>
> I promise there have no newline, the captrue picture is atteched.
>
>>
>> [...]
>> --
>> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>>
>> I have often repented speaking, but never of holding my tongue.
>> -- Xenocrates
>>
>> ___
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>>
>
I have a question:

the patch is maked by command "git format-patch -s -1", but the patchwork
can not pick up it,
my git version is:

localhost:ffmpeg StevenLiu$ git version
git version 2.8.4 (Apple Git-73)
localhost:ffmpeg StevenLiu$
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-09 Thread Steven Liu
2016-10-09 20:24 GMT+08:00 Steven Liu :

> check newline with chrome+gmail
>
Shit!

>
>
> Signed-off-by: Steven Liu 
> ---
>  libavformat/udp.c | 19 ++-
>  libavformat/version.h |  3 +++
>  2 files changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/udp.c b/libavformat/udp.c
> index 3835f98..fd400c6 100644
> --- a/libavformat/udp.c
> +++ b/libavformat/udp.c
> @@ -86,6 +86,9 @@ typedef struct UDPContext {
>  int pkt_size;
>  int is_multicast;
>  int is_broadcast;
> +#if FF_API_UDP_LOCAL_PORT
> +int local_port_deprecated;
> +#endif
>  int local_port;
>  int reuse_socket;
>  int overrun_nonfatal;
> @@ -123,7 +126,9 @@ static const AVOption options[] = {
>  { "bitrate","Bits to send per second",
>   OFFSET(bitrate),AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
> INT64_MAX, .flags = E },
>  { "burst_bits", "Max length of bursts in bits (when using
> bitrate)", OFFSET(burst_bits),   AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
> INT64_MAX, .flags = E },
>  { "localport",  "Local port",
>  OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX,
> D|E },
> -{ "local_port", "Local port",
>  OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX,
> .flags = D|E },
> +#if FF_API_UDP_LOCAL_PORT
> +{ "local_port", "Local port",
>  OFFSET(local_port_deprecated), AV_OPT_TYPE_INT,{ .i64 = -1 },
>  -1, INT_MAX, .flags = D|E },
> +#endif
>  { "localaddr",  "Local address",
>   OFFSET(localaddr),  AV_OPT_TYPE_STRING, { .str = NULL },
>   .flags = D|E },
>  { "udplite_coverage", "choose UDPLite head size which should be
> validated by checksum", OFFSET(udplite_coverage), AV_OPT_TYPE_INT, {.i64 =
> 0}, 0, INT_MAX, D|E },
>  { "pkt_size",   "Maximum UDP packet size",
>   OFFSET(pkt_size),   AV_OPT_TYPE_INT,{ .i64 = 1472 },  -1,
> INT_MAX, .flags = D|E },
> @@ -377,6 +382,12 @@ static int udp_socket_create(URLContext *h, struct
> sockaddr_storage *addr,
>
>  if (((struct sockaddr *) >dest_addr)->sa_family)
>  family = ((struct sockaddr *) >dest_addr)->sa_family;
> +#if FF_API_UDP_LOCAL_PORT
> +if (s->local_port_deprecated >= 0) {
> +av_log(s, AV_LOG_WARNING, "the local_port option is deprecated,
> please use localport option\n");
> +s->local_port = s->local_port_deprecated;
> +}
> +#endif
>  res0 = udp_resolve_host(h, (localaddr && localaddr[0]) ? localaddr :
> NULL,
>  s->local_port,
>  SOCK_DGRAM, family, AI_PASSIVE);
> @@ -481,6 +492,12 @@ int ff_udp_set_remote_url(URLContext *h, const char
> *uri)
>  int ff_udp_get_local_port(URLContext *h)
>  {
>  UDPContext *s = h->priv_data;
> +#if FF_API_UDP_LOCAL_PORT
> +if (s->local_port_deprecated >= 0) {
> +av_log(s, AV_LOG_WARNING, "the local_port option is deprecated,
> please use localport option\n");
> +s->local_port = s->local_port_deprecated;
> +}
> +#endif
>  return s->local_port;
>  }
>
> diff --git a/libavformat/version.h b/libavformat/version.h
> index 92801b4..35cfc3b 100644
> --- a/libavformat/version.h
> +++ b/libavformat/version.h
> @@ -85,6 +85,9 @@
>  #ifndef FF_API_HTTP_USER_AGENT
>  #define FF_API_HTTP_USER_AGENT  (LIBAVFORMAT_VERSION_MAJOR < 58)
>  #endif
> +#ifndef FF_API_UDP_LOCAL_PORT
> +#define FF_API_UDP_LOCAL_PORT   (LIBAVFORMAT_VERSION_MAJOR < 58)
> +#endif
>
>  #ifndef FF_API_R_FRAME_RATE
>  #define FF_API_R_FRAME_RATE1
> --
> 2.8.4 (Apple Git-73)
>
>
> 2016-10-09 20:22 GMT+08:00 Steven Liu :
>
>>
>>
>> 2016-10-09 20:19 GMT+08:00 Nicolas George :
>>
>>> L'octidi 18 vendémiaire, an CCXXV, Steven Liu a écrit :
>>> > I promise there have no newline, the captrue picture is atteched.
>>>
>>> You can see for yourself there are:
>>> http://ffmpeg.org/pipermail/ffmpeg-devel/2016-October/200799.html
>>>
>>> Your MUA is lying to you.
>>>
>> Thanks, let me try again.
>>
>>
>>>
>>> Also, why do you send JPEG screenshots disguised as PNGs?
>>>
>> Perhaps this is my screenshots tools problem.  This is a mistake.
>>
>>>
>>> Regards,
>>>
>>> --
>>>   Nicolas George
>>>
>>> ___
>>> ffmpeg-devel mailing list
>>> ffmpeg-devel@ffmpeg.org
>>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>>
>>>
>>
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-09 Thread Steven Liu
check newline with chrome+gmail


Signed-off-by: Steven Liu 
---
 libavformat/udp.c | 19 ++-
 libavformat/version.h |  3 +++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/libavformat/udp.c b/libavformat/udp.c
index 3835f98..fd400c6 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -86,6 +86,9 @@ typedef struct UDPContext {
 int pkt_size;
 int is_multicast;
 int is_broadcast;
+#if FF_API_UDP_LOCAL_PORT
+int local_port_deprecated;
+#endif
 int local_port;
 int reuse_socket;
 int overrun_nonfatal;
@@ -123,7 +126,9 @@ static const AVOption options[] = {
 { "bitrate","Bits to send per second",
OFFSET(bitrate),AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
INT64_MAX, .flags = E },
 { "burst_bits", "Max length of bursts in bits (when using
bitrate)", OFFSET(burst_bits),   AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
INT64_MAX, .flags = E },
 { "localport",  "Local port",
 OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX,
D|E },
-{ "local_port", "Local port",
 OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX,
.flags = D|E },
+#if FF_API_UDP_LOCAL_PORT
+{ "local_port", "Local port",
 OFFSET(local_port_deprecated), AV_OPT_TYPE_INT,{ .i64 = -1 },
 -1, INT_MAX, .flags = D|E },
+#endif
 { "localaddr",  "Local address",
OFFSET(localaddr),  AV_OPT_TYPE_STRING, { .str = NULL },
.flags = D|E },
 { "udplite_coverage", "choose UDPLite head size which should be
validated by checksum", OFFSET(udplite_coverage), AV_OPT_TYPE_INT, {.i64 =
0}, 0, INT_MAX, D|E },
 { "pkt_size",   "Maximum UDP packet size",
OFFSET(pkt_size),   AV_OPT_TYPE_INT,{ .i64 = 1472 },  -1, INT_MAX,
.flags = D|E },
@@ -377,6 +382,12 @@ static int udp_socket_create(URLContext *h, struct
sockaddr_storage *addr,

 if (((struct sockaddr *) >dest_addr)->sa_family)
 family = ((struct sockaddr *) >dest_addr)->sa_family;
+#if FF_API_UDP_LOCAL_PORT
+if (s->local_port_deprecated >= 0) {
+av_log(s, AV_LOG_WARNING, "the local_port option is deprecated,
please use localport option\n");
+s->local_port = s->local_port_deprecated;
+}
+#endif
 res0 = udp_resolve_host(h, (localaddr && localaddr[0]) ? localaddr :
NULL,
 s->local_port,
 SOCK_DGRAM, family, AI_PASSIVE);
@@ -481,6 +492,12 @@ int ff_udp_set_remote_url(URLContext *h, const char
*uri)
 int ff_udp_get_local_port(URLContext *h)
 {
 UDPContext *s = h->priv_data;
+#if FF_API_UDP_LOCAL_PORT
+if (s->local_port_deprecated >= 0) {
+av_log(s, AV_LOG_WARNING, "the local_port option is deprecated,
please use localport option\n");
+s->local_port = s->local_port_deprecated;
+}
+#endif
 return s->local_port;
 }

diff --git a/libavformat/version.h b/libavformat/version.h
index 92801b4..35cfc3b 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -85,6 +85,9 @@
 #ifndef FF_API_HTTP_USER_AGENT
 #define FF_API_HTTP_USER_AGENT  (LIBAVFORMAT_VERSION_MAJOR < 58)
 #endif
+#ifndef FF_API_UDP_LOCAL_PORT
+#define FF_API_UDP_LOCAL_PORT   (LIBAVFORMAT_VERSION_MAJOR < 58)
+#endif

 #ifndef FF_API_R_FRAME_RATE
 #define FF_API_R_FRAME_RATE1
-- 
2.8.4 (Apple Git-73)


2016-10-09 20:22 GMT+08:00 Steven Liu :

>
>
> 2016-10-09 20:19 GMT+08:00 Nicolas George :
>
>> L'octidi 18 vendémiaire, an CCXXV, Steven Liu a écrit :
>> > I promise there have no newline, the captrue picture is atteched.
>>
>> You can see for yourself there are:
>> http://ffmpeg.org/pipermail/ffmpeg-devel/2016-October/200799.html
>>
>> Your MUA is lying to you.
>>
> Thanks, let me try again.
>
>
>>
>> Also, why do you send JPEG screenshots disguised as PNGs?
>>
> Perhaps this is my screenshots tools problem.  This is a mistake.
>
>>
>> Regards,
>>
>> --
>>   Nicolas George
>>
>> ___
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>>
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-09 Thread Steven Liu
2016-10-09 20:19 GMT+08:00 Nicolas George :

> L'octidi 18 vendémiaire, an CCXXV, Steven Liu a écrit :
> > I promise there have no newline, the captrue picture is atteched.
>
> You can see for yourself there are:
> http://ffmpeg.org/pipermail/ffmpeg-devel/2016-October/200799.html
>
> Your MUA is lying to you.
>
Thanks, let me try again.


>
> Also, why do you send JPEG screenshots disguised as PNGs?
>
Perhaps this is my screenshots tools problem.  This is a mistake.

>
> Regards,
>
> --
>   Nicolas George
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-09 Thread Nicolas George
L'octidi 18 vendémiaire, an CCXXV, Steven Liu a écrit :
> I promise there have no newline, the captrue picture is atteched.

You can see for yourself there are:
http://ffmpeg.org/pipermail/ffmpeg-devel/2016-October/200799.html

Your MUA is lying to you.

Also, why do you send JPEG screenshots disguised as PNGs?

Regards,

-- 
  Nicolas George


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-09 Thread Michael Niedermayer
On Sun, Oct 09, 2016 at 07:18:48PM +0800, Steven Liu wrote:
> 2016-10-09 19:00 GMT+08:00 Michael Niedermayer :
> 
> > On Sat, Oct 08, 2016 at 03:35:02PM +0800, Steven Liu wrote:
> > >
> >
> > >  udp.c |   19 ++-
> > >  version.h |3 +++
> > >  2 files changed, 21 insertions(+), 1 deletion(-)
> > > bf9c64b4a0fd9a1d998c11376c5c5c2a90389caf  0001-avformat-udp-deprecate-
> > local_port-option.patch
> > > From 16a41c1e76fef082bf2a7238f940968238f573d5 Mon Sep 17 00:00:00 2001
> > > From: Steven Liu 
> > > Date: Sat, 8 Oct 2016 15:31:25 +0800
> > > Subject: [PATCH] avformat/udp: deprecate local_port option
> >
> > patchwork fails to pick up your recent patches
> > see: https://patchwork.ffmpeg.org/project/ffmpeg/list/?
> > submitter=23=%2A=both
> >
> > probably because "Type: application/octet-stream"
> > (this is the wrong mime type for patches)
> >
> > [...]
> >
> > --
> > Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
> >
> > Rewriting code that is poorly written but fully understood is good.
> > Rewriting code that one doesnt understand is a sign that one is less smart
> > then the original author, trying to rewrite it will not make it better.
> >
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> >
> 
> paste patch context to test patchwork pick up.
> 
> 
> Signed-off-by: Steven Liu 
> ---
>  libavformat/udp.c | 19 ++-
>  libavformat/version.h |  3 +++
>  2 files changed, 21 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/udp.c b/libavformat/udp.c
> index 3835f98..fd400c6 100644
> --- a/libavformat/udp.c
> +++ b/libavformat/udp.c
> @@ -86,6 +86,9 @@ typedef struct UDPContext {
>  int pkt_size;
>  int is_multicast;
>  int is_broadcast;
> +#if FF_API_UDP_LOCAL_PORT
> +int local_port_deprecated;
> +#endif
>  int local_port;
>  int reuse_socket;
>  int overrun_nonfatal;
> @@ -123,7 +126,9 @@ static const AVOption options[] = {
>  { "bitrate","Bits to send per second",
> OFFSET(bitrate),AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
> INT64_MAX, .flags = E },
>  { "burst_bits", "Max length of bursts in bits (when using
> bitrate)", OFFSET(burst_bits),   AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
> INT64_MAX, .flags = E },
>  { "localport",  "Local port",
>  OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX,
> D|E },

this is corruptd by newlines

[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have often repented speaking, but never of holding my tongue.
-- Xenocrates


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-09 Thread Steven Liu
2016-10-09 19:18 GMT+08:00 Steven Liu :

>
>
> 2016-10-09 19:00 GMT+08:00 Michael Niedermayer :
>
>> On Sat, Oct 08, 2016 at 03:35:02PM +0800, Steven Liu wrote:
>> >
>>
>> >  udp.c |   19 ++-
>> >  version.h |3 +++
>> >  2 files changed, 21 insertions(+), 1 deletion(-)
>> > bf9c64b4a0fd9a1d998c11376c5c5c2a90389caf
>> 0001-avformat-udp-deprecate-local_port-option.patch
>> > From 16a41c1e76fef082bf2a7238f940968238f573d5 Mon Sep 17 00:00:00 2001
>> > From: Steven Liu 
>> > Date: Sat, 8 Oct 2016 15:31:25 +0800
>> > Subject: [PATCH] avformat/udp: deprecate local_port option
>>
>> patchwork fails to pick up your recent patches
>> see: https://patchwork.ffmpeg.org/project/ffmpeg/list/?submitter=
>> 23=%2A=both
>>
>> probably because "Type: application/octet-stream"
>> (this is the wrong mime type for patches)
>>
>> [...]
>>
>> --
>> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>>
>> Rewriting code that is poorly written but fully understood is good.
>> Rewriting code that one doesnt understand is a sign that one is less smart
>> then the original author, trying to rewrite it will not make it better.
>>
>> ___
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>>
>>
>
> paste patch context to test patchwork pick up.
>
>
> Signed-off-by: Steven Liu 
> ---
>  libavformat/udp.c | 19 ++-
>  libavformat/version.h |  3 +++
>  2 files changed, 21 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/udp.c b/libavformat/udp.c
> index 3835f98..fd400c6 100644
> --- a/libavformat/udp.c
> +++ b/libavformat/udp.c
> @@ -86,6 +86,9 @@ typedef struct UDPContext {
>  int pkt_size;
>  int is_multicast;
>  int is_broadcast;
> +#if FF_API_UDP_LOCAL_PORT
> +int local_port_deprecated;
> +#endif
>  int local_port;
>  int reuse_socket;
>  int overrun_nonfatal;
> @@ -123,7 +126,9 @@ static const AVOption options[] = {
>  { "bitrate","Bits to send per second",
>   OFFSET(bitrate),AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
> INT64_MAX, .flags = E },
>  { "burst_bits", "Max length of bursts in bits (when using
> bitrate)", OFFSET(burst_bits),   AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
> INT64_MAX, .flags = E },
>  { "localport",  "Local port",
>  OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX,
> D|E },
> -{ "local_port", "Local port",
>  OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX,
> .flags = D|E },
> +#if FF_API_UDP_LOCAL_PORT
> +{ "local_port", "Local port",
>  OFFSET(local_port_deprecated), AV_OPT_TYPE_INT,{ .i64 = -1 },
>  -1, INT_MAX, .flags = D|E },
> +#endif
>  { "localaddr",  "Local address",
>   OFFSET(localaddr),  AV_OPT_TYPE_STRING, { .str = NULL },
>   .flags = D|E },
>  { "udplite_coverage", "choose UDPLite head size which should be
> validated by checksum", OFFSET(udplite_coverage), AV_OPT_TYPE_INT, {.i64 =
> 0}, 0, INT_MAX, D|E },
>  { "pkt_size",   "Maximum UDP packet size",
>   OFFSET(pkt_size),   AV_OPT_TYPE_INT,{ .i64 = 1472 },  -1,
> INT_MAX, .flags = D|E },
> @@ -377,6 +382,12 @@ static int udp_socket_create(URLContext *h, struct
> sockaddr_storage *addr,
>
>  if (((struct sockaddr *) >dest_addr)->sa_family)
>  family = ((struct sockaddr *) >dest_addr)->sa_family;
> +#if FF_API_UDP_LOCAL_PORT
> +if (s->local_port_deprecated >= 0) {
> +av_log(s, AV_LOG_WARNING, "the local_port option is deprecated,
> please use localport option\n");
> +s->local_port = s->local_port_deprecated;
> +}
> +#endif
>  res0 = udp_resolve_host(h, (localaddr && localaddr[0]) ? localaddr :
> NULL,
>  s->local_port,
>  SOCK_DGRAM, family, AI_PASSIVE);
> @@ -481,6 +492,12 @@ int ff_udp_set_remote_url(URLContext *h, const char
> *uri)
>  int ff_udp_get_local_port(URLContext *h)
>  {
>  UDPContext *s = h->priv_data;
> +#if FF_API_UDP_LOCAL_PORT
> +if (s->local_port_deprecated >= 0) {
> +av_log(s, AV_LOG_WARNING, "the local_port option is deprecated,
> please use localport option\n");
> +s->local_port = s->local_port_deprecated;
> +}
> +#endif
>  return s->local_port;
>  }
>
> diff --git a/libavformat/version.h b/libavformat/version.h
> index 92801b4..35cfc3b 100644
> --- a/libavformat/version.h
> +++ b/libavformat/version.h
> @@ -85,6 +85,9 @@
>  #ifndef FF_API_HTTP_USER_AGENT
>  #define FF_API_HTTP_USER_AGENT  (LIBAVFORMAT_VERSION_MAJOR < 58)
>  #endif
> +#ifndef FF_API_UDP_LOCAL_PORT
> +#define FF_API_UDP_LOCAL_PORT   (LIBAVFORMAT_VERSION_MAJOR < 58)
> +#endif
>
>  #ifndef FF_API_R_FRAME_RATE
>  #define FF_API_R_FRAME_RATE1
> --
> 2.8.4 (Apple Git-73)
>
> 

Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-09 Thread Steven Liu
2016-10-09 19:00 GMT+08:00 Michael Niedermayer :

> On Sat, Oct 08, 2016 at 03:35:02PM +0800, Steven Liu wrote:
> >
>
> >  udp.c |   19 ++-
> >  version.h |3 +++
> >  2 files changed, 21 insertions(+), 1 deletion(-)
> > bf9c64b4a0fd9a1d998c11376c5c5c2a90389caf  0001-avformat-udp-deprecate-
> local_port-option.patch
> > From 16a41c1e76fef082bf2a7238f940968238f573d5 Mon Sep 17 00:00:00 2001
> > From: Steven Liu 
> > Date: Sat, 8 Oct 2016 15:31:25 +0800
> > Subject: [PATCH] avformat/udp: deprecate local_port option
>
> patchwork fails to pick up your recent patches
> see: https://patchwork.ffmpeg.org/project/ffmpeg/list/?
> submitter=23=%2A=both
>
> probably because "Type: application/octet-stream"
> (this is the wrong mime type for patches)
>
> [...]
>
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> Rewriting code that is poorly written but fully understood is good.
> Rewriting code that one doesnt understand is a sign that one is less smart
> then the original author, trying to rewrite it will not make it better.
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
>

paste patch context to test patchwork pick up.


Signed-off-by: Steven Liu 
---
 libavformat/udp.c | 19 ++-
 libavformat/version.h |  3 +++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/libavformat/udp.c b/libavformat/udp.c
index 3835f98..fd400c6 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -86,6 +86,9 @@ typedef struct UDPContext {
 int pkt_size;
 int is_multicast;
 int is_broadcast;
+#if FF_API_UDP_LOCAL_PORT
+int local_port_deprecated;
+#endif
 int local_port;
 int reuse_socket;
 int overrun_nonfatal;
@@ -123,7 +126,9 @@ static const AVOption options[] = {
 { "bitrate","Bits to send per second",
OFFSET(bitrate),AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
INT64_MAX, .flags = E },
 { "burst_bits", "Max length of bursts in bits (when using
bitrate)", OFFSET(burst_bits),   AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
INT64_MAX, .flags = E },
 { "localport",  "Local port",
 OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX,
D|E },
-{ "local_port", "Local port",
 OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX,
.flags = D|E },
+#if FF_API_UDP_LOCAL_PORT
+{ "local_port", "Local port",
 OFFSET(local_port_deprecated), AV_OPT_TYPE_INT,{ .i64 = -1 },
 -1, INT_MAX, .flags = D|E },
+#endif
 { "localaddr",  "Local address",
OFFSET(localaddr),  AV_OPT_TYPE_STRING, { .str = NULL },
.flags = D|E },
 { "udplite_coverage", "choose UDPLite head size which should be
validated by checksum", OFFSET(udplite_coverage), AV_OPT_TYPE_INT, {.i64 =
0}, 0, INT_MAX, D|E },
 { "pkt_size",   "Maximum UDP packet size",
OFFSET(pkt_size),   AV_OPT_TYPE_INT,{ .i64 = 1472 },  -1, INT_MAX,
.flags = D|E },
@@ -377,6 +382,12 @@ static int udp_socket_create(URLContext *h, struct
sockaddr_storage *addr,

 if (((struct sockaddr *) >dest_addr)->sa_family)
 family = ((struct sockaddr *) >dest_addr)->sa_family;
+#if FF_API_UDP_LOCAL_PORT
+if (s->local_port_deprecated >= 0) {
+av_log(s, AV_LOG_WARNING, "the local_port option is deprecated,
please use localport option\n");
+s->local_port = s->local_port_deprecated;
+}
+#endif
 res0 = udp_resolve_host(h, (localaddr && localaddr[0]) ? localaddr :
NULL,
 s->local_port,
 SOCK_DGRAM, family, AI_PASSIVE);
@@ -481,6 +492,12 @@ int ff_udp_set_remote_url(URLContext *h, const char
*uri)
 int ff_udp_get_local_port(URLContext *h)
 {
 UDPContext *s = h->priv_data;
+#if FF_API_UDP_LOCAL_PORT
+if (s->local_port_deprecated >= 0) {
+av_log(s, AV_LOG_WARNING, "the local_port option is deprecated,
please use localport option\n");
+s->local_port = s->local_port_deprecated;
+}
+#endif
 return s->local_port;
 }

diff --git a/libavformat/version.h b/libavformat/version.h
index 92801b4..35cfc3b 100644
--- a/libavformat/version.h
+++ b/libavformat/version.h
@@ -85,6 +85,9 @@
 #ifndef FF_API_HTTP_USER_AGENT
 #define FF_API_HTTP_USER_AGENT  (LIBAVFORMAT_VERSION_MAJOR < 58)
 #endif
+#ifndef FF_API_UDP_LOCAL_PORT
+#define FF_API_UDP_LOCAL_PORT   (LIBAVFORMAT_VERSION_MAJOR < 58)
+#endif

 #ifndef FF_API_R_FRAME_RATE
 #define FF_API_R_FRAME_RATE1
-- 
2.8.4 (Apple Git-73)
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-09 Thread Michael Niedermayer
On Sat, Oct 08, 2016 at 03:35:02PM +0800, Steven Liu wrote:
> 

>  udp.c |   19 ++-
>  version.h |3 +++
>  2 files changed, 21 insertions(+), 1 deletion(-)
> bf9c64b4a0fd9a1d998c11376c5c5c2a90389caf  
> 0001-avformat-udp-deprecate-local_port-option.patch
> From 16a41c1e76fef082bf2a7238f940968238f573d5 Mon Sep 17 00:00:00 2001
> From: Steven Liu 
> Date: Sat, 8 Oct 2016 15:31:25 +0800
> Subject: [PATCH] avformat/udp: deprecate local_port option

patchwork fails to pick up your recent patches
see: 
https://patchwork.ffmpeg.org/project/ffmpeg/list/?submitter=23=%2A=both

probably because "Type: application/octet-stream"
(this is the wrong mime type for patches)

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-08 Thread Steven Liu
2016-10-09 2:11 GMT+08:00 Michael Niedermayer :

> On Sat, Oct 08, 2016 at 03:35:02PM +0800, Steven Liu wrote:
> >
>
> >  udp.c |   19 ++-
> >  version.h |3 +++
> >  2 files changed, 21 insertions(+), 1 deletion(-)
> > bf9c64b4a0fd9a1d998c11376c5c5c2a90389caf  0001-avformat-udp-deprecate-
> local_port-option.patch
> > From 16a41c1e76fef082bf2a7238f940968238f573d5 Mon Sep 17 00:00:00 2001
> > From: Steven Liu 
> > Date: Sat, 8 Oct 2016 15:31:25 +0800
> > Subject: [PATCH] avformat/udp: deprecate local_port option
> >
> > Signed-off-by: Steven Liu 
> > ---
> >  libavformat/udp.c | 19 ++-
> >  libavformat/version.h |  3 +++
> >  2 files changed, 21 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavformat/udp.c b/libavformat/udp.c
> > index 3835f98..39b3350 100644
> > --- a/libavformat/udp.c
> > +++ b/libavformat/udp.c
> > @@ -86,6 +86,9 @@ typedef struct UDPContext {
> >  int pkt_size;
> >  int is_multicast;
> >  int is_broadcast;
> > +#if FF_API_UDP_LOCAL_PORT
> > +int local_port_deprecated;
> > +#endif
> >  int local_port;
> >  int reuse_socket;
> >  int overrun_nonfatal;
> > @@ -123,7 +126,9 @@ static const AVOption options[] = {
> >  { "bitrate","Bits to send per second",
>OFFSET(bitrate),AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
> INT64_MAX, .flags = E },
> >  { "burst_bits", "Max length of bursts in bits (when using
> bitrate)", OFFSET(burst_bits),   AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0,
> INT64_MAX, .flags = E },
> >  { "localport",  "Local port",
> OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1,
> INT_MAX, D|E },
> > -{ "local_port", "Local port",
> OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1,
> INT_MAX, .flags = D|E },
> > +#ifdef FF_API_UDP_LOCAL_PORT
>
> #ifdef vs #if mistake also there are more such
>
>
> [...]
>
>
> --
> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> The real ebay dictionary, page 2
> "100% positive feedback" - "All either got their money back or didnt
> complain"
> "Best seller ever, very honest" - "Seller refunded buyer after failed scam"
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> patch update


0001-avformat-udp-deprecate-local_port-option.patch
Description: Binary data
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH] avformat/udp: deprecate local_port option

2016-10-08 Thread Michael Niedermayer
On Sat, Oct 08, 2016 at 03:35:02PM +0800, Steven Liu wrote:
> 

>  udp.c |   19 ++-
>  version.h |3 +++
>  2 files changed, 21 insertions(+), 1 deletion(-)
> bf9c64b4a0fd9a1d998c11376c5c5c2a90389caf  
> 0001-avformat-udp-deprecate-local_port-option.patch
> From 16a41c1e76fef082bf2a7238f940968238f573d5 Mon Sep 17 00:00:00 2001
> From: Steven Liu 
> Date: Sat, 8 Oct 2016 15:31:25 +0800
> Subject: [PATCH] avformat/udp: deprecate local_port option
> 
> Signed-off-by: Steven Liu 
> ---
>  libavformat/udp.c | 19 ++-
>  libavformat/version.h |  3 +++
>  2 files changed, 21 insertions(+), 1 deletion(-)
> 
> diff --git a/libavformat/udp.c b/libavformat/udp.c
> index 3835f98..39b3350 100644
> --- a/libavformat/udp.c
> +++ b/libavformat/udp.c
> @@ -86,6 +86,9 @@ typedef struct UDPContext {
>  int pkt_size;
>  int is_multicast;
>  int is_broadcast;
> +#if FF_API_UDP_LOCAL_PORT
> +int local_port_deprecated;
> +#endif
>  int local_port;
>  int reuse_socket;
>  int overrun_nonfatal;
> @@ -123,7 +126,9 @@ static const AVOption options[] = {
>  { "bitrate","Bits to send per second", 
> OFFSET(bitrate),AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0, INT64_MAX, 
> .flags = E },
>  { "burst_bits", "Max length of bursts in bits (when using bitrate)", 
> OFFSET(burst_bits),   AV_OPT_TYPE_INT64,  { .i64 = 0  }, 0, INT64_MAX, 
> .flags = E },
>  { "localport",  "Local port",  
> OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX, 
> D|E },
> -{ "local_port", "Local port",  
> OFFSET(local_port), AV_OPT_TYPE_INT,{ .i64 = -1 },-1, INT_MAX, 
> .flags = D|E },
> +#ifdef FF_API_UDP_LOCAL_PORT

#ifdef vs #if mistake also there are more such


[...]


-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The real ebay dictionary, page 2
"100% positive feedback" - "All either got their money back or didnt complain"
"Best seller ever, very honest" - "Seller refunded buyer after failed scam"


signature.asc
Description: Digital signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel