On Wed, 12 Oct 2011, Anton Khirnov wrote:


On Wed, 12 Oct 2011 20:56:13 +0300, Martin Storsjö <[email protected]> wrote:
     FF_RTP_FLAG_OPTS(RTSPState, rtp_muxer_flags),
+    { "rtsp_transport", "RTSP transport protocols", offsetof(RTSPState, 
lower_transport_mask), FF_OPT_TYPE_FLAGS, {.dbl = 0}, INT_MIN, INT_MAX, 
AV_OPT_FLAG_DECODING_PARAM|AV_OPT_FLAG_ENCODING_PARAM, "rtsp_transport" }, \
+    { "udp", "UDP", 0, FF_OPT_TYPE_CONST, {.dbl = 1 << RTSP_LOWER_TRANSPORT_UDP}, 
INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM|AV_OPT_FLAG_ENCODING_PARAM, "rtsp_transport" }, \
+    { "tcp", "TCP", 0, FF_OPT_TYPE_CONST, {.dbl = 1 << RTSP_LOWER_TRANSPORT_TCP}, 
INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM|AV_OPT_FLAG_ENCODING_PARAM, "rtsp_transport" }, \
+    { "udp_multicast", "UDP multicast", 0, FF_OPT_TYPE_CONST, {.dbl = 1 << 
RTSP_LOWER_TRANSPORT_UDP_MULTICAST}, INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM, "rtsp_transport" },
+    { "http", "HTTP tunneling", 0, FF_OPT_TYPE_CONST, {.dbl = (1 << 
RTSP_LOWER_TRANSPORT_HTTP)}, INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM, "rtsp_transport" },
+    { "rtsp_flags", "RTSP flags", offsetof(RTSPState, rtsp_flags), FF_OPT_TYPE_FLAGS, 
{.dbl = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM, "rtsp_flags" },
+    { "filter_src", "Only receive packets from the negotiated peer IP", 0, 
FF_OPT_TYPE_CONST, {.dbl = RTSP_FLAG_FILTER_SRC}, INT_MIN, INT_MAX, AV_OPT_FLAG_DECODING_PARAM, 
"rtsp_flags" },
     { NULL },
 };

Except for FF->AV issue, some cosmetics suggestions
* we usually #define OFFSET(x) offsetof(priv context, x) and
 AV_OPT_FLAG_blah to something shorter, this saves a lot of space
* you can omit .dbl as it's the first element in the union
* min/max make no sense for named constants, so you can set them to 0
 and save some more space
* vertical alignment would help readability
feel free to implement as many or as few as you like

Implemented all of these except for vertical alignment, which is a bit tricky since the length of the description texts vary a lot.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to