On Sun, 22 Mar 2015, Luca Barbato wrote:
---Martin, please triplecheck it ^^ libavformat/rtpproto.c | 102 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 69 insertions(+), 33 deletions(-) diff --git a/libavformat/rtpproto.c b/libavformat/rtpproto.c index 5bff00e..f1c2e97 100644 --- a/libavformat/rtpproto.c +++ b/libavformat/rtpproto.c @@ -26,6 +26,7 @@ #include "libavutil/parseutils.h" #include "libavutil/avstring.h" +#include "libavutil/opt.h" #include "avformat.h" #include "avio_internal.h" #include "rtp.h" @@ -42,14 +43,46 @@ #endif typedef struct RTPContext { + const AVClass *class; URLContext *rtp_hd, *rtcp_hd; int rtp_fd, rtcp_fd, nb_ssm_include_addrs, nb_ssm_exclude_addrs; struct sockaddr_storage **ssm_include_addrs, **ssm_exclude_addrs; int write_to_source; struct sockaddr_storage last_rtp_source, last_rtcp_source; socklen_t last_rtp_source_len, last_rtcp_source_len; + int ttl; + int buffer_size; + int rtcp_port, local_rtpport, local_rtcpport; + int connect; + int pkt_size; + char *sources; + char *block; } RTPContext; +#define OFFSET(x) offsetof(RTPContext, x) +#define D AV_OPT_FLAG_DECODING_PARAM +#define E AV_OPT_FLAG_ENCODING_PARAM +static const AVOption options[] = { + { "ttl", "Time to live (in milliseconds, multicast only)", OFFSET(ttl), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, .flags = D|E }, + { "buffer_size", "System buffer size (in bytes)", OFFSET(buffer_size), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, INT_MAX, .flags = D|E },
This isn't an existing option (in the rtp protocol) that is being mapped to avoptions, but a new option, so it perhaps should go as a separate patch, or at least be explicitly mentioned in the commit message.
Other than that, it looks good. // Martin _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
