[FFmpeg-cvslog] Added AVClass for AVSubtitleRect

hakuya git at videolan.org
Mon Apr 30 20:04:32 CEST 2012


ffmpeg | branch: master | hakuya <erikmiranda at gmail.com> | Wed Apr 18 02:08:25 2012 -0400| [1f46b50a9591f68b697e943f829c79a4f4829dd6] | committer: Michael Niedermayer

Added AVClass for AVSubtitleRect

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/avcodec.h |    8 ++++++++
 libavcodec/options.c |   23 +++++++++++++++++++++++
 2 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index ba51ec1..f8700dd 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3292,6 +3292,14 @@ const AVClass *avcodec_get_class(void);
 const AVClass *avcodec_get_frame_class(void);
 
 /**
+ * Get the AVClass for AVSubtitleRect. It can be used in combination with
+ * AV_OPT_SEARCH_FAKE_OBJ for examining options.
+ *
+ * @see av_opt_find().
+ */
+const AVClass *avcodec_get_subtitle_rect_class(void);
+
+/**
  * Copy the settings of the source AVCodecContext into the destination
  * AVCodecContext. The resulting destination codec context will be
  * unopened, i.e. you are required to call avcodec_open2() before you
diff --git a/libavcodec/options.c b/libavcodec/options.c
index 3731b1f..f4daf14 100644
--- a/libavcodec/options.c
+++ b/libavcodec/options.c
@@ -255,3 +255,26 @@ const AVClass *avcodec_get_frame_class(void)
 {
     return &av_frame_class;
 }
+
+#define SROFFSET(x) offsetof(AVSubtitleRect,x)
+
+static const AVOption subtitle_rect_options[]={
+{"x", "", SROFFSET(x), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, 0},
+{"y", "", SROFFSET(y), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, 0},
+{"w", "", SROFFSET(w), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, 0},
+{"h", "", SROFFSET(h), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, 0},
+{"type", "", SROFFSET(type), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, 0},
+{NULL},
+};
+
+static const AVClass av_subtitle_rect_class = {
+    .class_name             = "AVSubtitleRect",
+    .item_name              = NULL,
+    .option                 = subtitle_rect_options,
+    .version                = LIBAVUTIL_VERSION_INT,
+};
+
+const AVClass *avcodec_get_subtitle_rect_class(void)
+{
+    return &av_subtitle_rect_class;
+}



More information about the ffmpeg-cvslog mailing list