]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
[transcode]: h264_omx fix + bitrate setting
authorlekma <lekmalek@gmail.com>
Mon, 22 Aug 2016 10:15:04 +0000 (12:15 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 28 Aug 2017 13:32:17 +0000 (15:32 +0200)
src/transcoding/codec/codecs/libs/omx.c

index 6cf4ecb0bbb961c5d8a682498af057a0e61d379e..f836becdc89b95ff6415d92f4ea888d1248faa8f 100644 (file)
@@ -34,6 +34,11 @@ typedef struct {
 static int
 tvh_codec_profile_omx_open(tvh_codec_profile_omx_t *self, AVDictionary **opts)
 {
+    AV_DICT_SET_FLAGS_GLOBAL_HEADER(opts);
+    // bit_rate
+    if (self->bit_rate) {
+        AV_DICT_SET_BIT_RATE(opts, self->bit_rate);
+    }
     if (self->libname && strlen(self->libname)) {
         AV_DICT_SET(opts, "omx_libname", self->libname, 0);
     }
@@ -51,6 +56,16 @@ static const codec_profile_class_t codec_profile_omx_class = {
         .ic_class   = "codec_profile_omx",
         .ic_caption = N_("omx_h264"),
         .ic_properties = (const property_t[]){
+            {
+                .type     = PT_DBL,
+                .id       = "bit_rate",
+                .name     = N_("Bitrate (kb/s) (0=auto)"),
+                .desc     = N_("Constant bitrate (CBR) mode."),
+                .group    = 3,
+                .get_opts = codec_profile_class_get_opts,
+                .off      = offsetof(TVHCodecProfile, bit_rate),
+                .def.d    = 0,
+            },
             {
                 .type     = PT_STR,
                 .id       = "omx_libname",