Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-12-18 16:27:41 +0300
committerHendrik Leppkes <h.leppkes@gmail.com>2015-12-18 16:27:41 +0300
commit2630f7f709049113dc03d6b999efad6acc423d67 (patch)
treed7a217a844f6b7939d3f08da45c027caa9e6761c /libavcodec/libschroedingerenc.c
parentec1b95dda4a856ae532a0a27aa6213040e712d68 (diff)
parentbe00ec832c519427cd92218abac77dafdc1d5487 (diff)
Merge commit 'be00ec832c519427cd92218abac77dafdc1d5487'
* commit 'be00ec832c519427cd92218abac77dafdc1d5487': lavc: Deprecate coder_type and its symbols Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavcodec/libschroedingerenc.c')
-rw-r--r--libavcodec/libschroedingerenc.c31
1 files changed, 28 insertions, 3 deletions
diff --git a/libavcodec/libschroedingerenc.c b/libavcodec/libschroedingerenc.c
index c5d6e764c7..98f6bc9496 100644
--- a/libavcodec/libschroedingerenc.c
+++ b/libavcodec/libschroedingerenc.c
@@ -34,6 +34,7 @@
#include "libavutil/attributes.h"
#include "libavutil/avassert.h"
#include "libavutil/imgutils.h"
+#include "libavutil/opt.h"
#include "avcodec.h"
#include "internal.h"
@@ -72,6 +73,9 @@ typedef struct SchroEncoderParams {
/* counter for frames submitted to encoder, used as dts */
int64_t dts;
+
+ /** enable noarith */
+ int noarith;
} SchroEncoderParams;
/**
@@ -166,9 +170,15 @@ static av_cold int libschroedinger_encode_init(AVCodecContext *avctx)
"gop_structure",
SCHRO_ENCODER_GOP_INTRA_ONLY);
- if (avctx->coder_type == FF_CODER_TYPE_VLC)
- schro_encoder_setting_set_double(p_schro_params->encoder,
- "enable_noarith", 1);
+#if FF_API_CODER_TYPE
+FF_DISABLE_DEPRECATION_WARNINGS
+ if (avctx->coder_type != FF_CODER_TYPE_VLC)
+ p_schro_params->noarith = 0;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
+ schro_encoder_setting_set_double(p_schro_params->encoder,
+ "enable_noarith",
+ p_schro_params->noarith);
} else {
schro_encoder_setting_set_double(p_schro_params->encoder,
"au_distance", avctx->gop_size);
@@ -441,6 +451,20 @@ static int libschroedinger_encode_close(AVCodecContext *avctx)
return 0;
}
+#define OFFSET(x) offsetof(SchroEncoderParams, x)
+#define VE AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM
+static const AVOption options[] = {
+ { "noarith", "Enable noarith", OFFSET(noarith), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
+
+ { NULL },
+};
+
+static const AVClass libschroedinger_class = {
+ .class_name = "libschroedinger",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
AVCodec ff_libschroedinger_encoder = {
.name = "libschroedinger",
@@ -448,6 +472,7 @@ AVCodec ff_libschroedinger_encoder = {
.type = AVMEDIA_TYPE_VIDEO,
.id = AV_CODEC_ID_DIRAC,
.priv_data_size = sizeof(SchroEncoderParams),
+ .priv_class = &libschroedinger_class,
.init = libschroedinger_encode_init,
.encode2 = libschroedinger_encode_frame,
.close = libschroedinger_encode_close,