Browse code

rtpenc: Declare the rtp flags private AVOptions in rtpenc.h

This allows other muxers that chain a RTP muxer to declare
the same options easily.

Signed-off-by: Martin Storsjö <martin@martin.st>

Martin Storsjö authored on 2011/05/28 04:38:36
Showing 2 changed files
... ...
@@ -30,8 +30,7 @@
30 30
 //#define DEBUG
31 31
 
32 32
 static const AVOption options[] = {
33
-    { "rtpflags", "RTP muxer flags", offsetof(RTPMuxContext, flags), FF_OPT_TYPE_FLAGS, {.dbl = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "rtpflags" },
34
-    { "latm", "Use MP4A-LATM packetization instead of MPEG4-GENERIC for AAC", 0, FF_OPT_TYPE_CONST, {.dbl = FF_RTP_FLAG_MP4A_LATM}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "rtpflags" },
33
+    FF_RTP_FLAG_OPTS(RTPMuxContext, flags),
35 34
     { NULL },
36 35
 };
37 36
 
... ...
@@ -65,6 +65,10 @@ typedef struct RTPMuxContext RTPMuxContext;
65 65
 
66 66
 #define FF_RTP_FLAG_MP4A_LATM 1
67 67
 
68
+#define FF_RTP_FLAG_OPTS(ctx, fieldname) \
69
+    { "rtpflags", "RTP muxer flags", offsetof(ctx, fieldname), FF_OPT_TYPE_FLAGS, {.dbl = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "rtpflags" }, \
70
+    { "latm", "Use MP4A-LATM packetization instead of MPEG4-GENERIC for AAC", 0, FF_OPT_TYPE_CONST, {.dbl = FF_RTP_FLAG_MP4A_LATM}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "rtpflags" } \
71
+
68 72
 void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m);
69 73
 
70 74
 void ff_rtp_send_h264(AVFormatContext *s1, const uint8_t *buf1, int size);