[FFmpeg-cvslog] avcodec/nvenc: Need a separate class for each encoder
Philip Langdale
git at videolan.org
Wed Mar 25 23:32:33 CET 2015
ffmpeg | branch: master | Philip Langdale <philipl at overt.org> | Wed Mar 25 15:24:30 2015 -0700| [21adb9964e2a6160006412d2b85c02b9ce588f25] | committer: Philip Langdale
avcodec/nvenc: Need a separate class for each encoder
The encoders can't share a class instance.
Signed-off-by: Philip Langdale <philipl at overt.org>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=21adb9964e2a6160006412d2b85c02b9ce588f25
---
libavcodec/nvenc.c | 23 +++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c
index 8194974..78b5253 100644
--- a/libavcodec/nvenc.c
+++ b/libavcodec/nvenc.c
@@ -1264,13 +1264,6 @@ static const AVOption options[] = {
{ NULL }
};
-static const AVClass nvenc_class = {
- .class_name = "nvenc",
- .item_name = av_default_item_name,
- .option = options,
- .version = LIBAVUTIL_VERSION_INT,
-};
-
static const AVCodecDefault nvenc_defaults[] = {
{ "b", "0" },
{ "qmin", "-1" },
@@ -1282,6 +1275,13 @@ static const AVCodecDefault nvenc_defaults[] = {
};
#if CONFIG_NVENC_ENCODER
+static const AVClass nvenc_class = {
+ .class_name = "nvenc",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
AVCodec ff_nvenc_encoder = {
.name = "nvenc",
.long_name = NULL_IF_CONFIG_SMALL("Nvidia NVENC h264 encoder"),
@@ -1299,6 +1299,13 @@ AVCodec ff_nvenc_encoder = {
#endif
#if CONFIG_NVENC_H265_ENCODER
+static const AVClass nvenc_h265_class = {
+ .class_name = "nvenc_h265",
+ .item_name = av_default_item_name,
+ .option = options,
+ .version = LIBAVUTIL_VERSION_INT,
+};
+
AVCodec ff_nvenc_h265_encoder = {
.name = "nvenc_h265",
.long_name = NULL_IF_CONFIG_SMALL("Nvidia NVENC h265 encoder"),
@@ -1309,7 +1316,7 @@ AVCodec ff_nvenc_h265_encoder = {
.encode2 = nvenc_encode_frame,
.close = nvenc_encode_close,
.capabilities = CODEC_CAP_DELAY,
- .priv_class = &nvenc_class,
+ .priv_class = &nvenc_h265_class,
.defaults = nvenc_defaults,
.pix_fmts = pix_fmts_nvenc,
};
More information about the ffmpeg-cvslog
mailing list