[FFmpeg-cvslog] rtpenc: Declare the rtp flags private AVOptions in rtpenc.h

Martin Storsjö git at videolan.org
Sat Jun 11 04:16:54 CEST 2011


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Fri May 27 22:38:36 2011 +0300| [635fac9af10092b0d5780a7d1b422b3044f9abd9] | committer: Martin Storsjö

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 at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=635fac9af10092b0d5780a7d1b422b3044f9abd9
---

 libavformat/rtpenc.c |    3 +--
 libavformat/rtpenc.h |    4 ++++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c
index c264b30..3da6dfb 100644
--- a/libavformat/rtpenc.c
+++ b/libavformat/rtpenc.c
@@ -30,8 +30,7 @@
 //#define DEBUG
 
 static const AVOption options[] = {
-    { "rtpflags", "RTP muxer flags", offsetof(RTPMuxContext, flags), FF_OPT_TYPE_FLAGS, {.dbl = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "rtpflags" },
-    { "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" },
+    FF_RTP_FLAG_OPTS(RTPMuxContext, flags),
     { NULL },
 };
 
diff --git a/libavformat/rtpenc.h b/libavformat/rtpenc.h
index ac5a622..3a9e19b 100644
--- a/libavformat/rtpenc.h
+++ b/libavformat/rtpenc.h
@@ -65,6 +65,10 @@ typedef struct RTPMuxContext RTPMuxContext;
 
 #define FF_RTP_FLAG_MP4A_LATM 1
 
+#define FF_RTP_FLAG_OPTS(ctx, fieldname) \
+    { "rtpflags", "RTP muxer flags", offsetof(ctx, fieldname), FF_OPT_TYPE_FLAGS, {.dbl = 0}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "rtpflags" }, \
+    { "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" } \
+
 void ff_rtp_send_data(AVFormatContext *s1, const uint8_t *buf1, int len, int m);
 
 void ff_rtp_send_h264(AVFormatContext *s1, const uint8_t *buf1, int size);



More information about the ffmpeg-cvslog mailing list