[FFmpeg-devel] [PATCH 2/6] libavcodec/dnxhd: add dnxhr parser and decoder

Mark Reid mindmark at gmail.com
Tue Jul 5 04:06:58 EEST 2016


---
 libavcodec/allcodecs.c    |  2 ++
 libavcodec/dnxhd_parser.c |  7 +++++++
 libavcodec/dnxhddec.c     | 14 ++++++++++++++
 3 files changed, 23 insertions(+)

diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 54efaad..87196e2 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -158,6 +158,7 @@ void avcodec_register_all(void)
     REGISTER_DECODER(DFA,               dfa);
     REGISTER_DECODER(DIRAC,             dirac);
     REGISTER_ENCDEC (DNXHD,             dnxhd);
+    REGISTER_DECODER(DNXHR,             dnxhr);
     REGISTER_ENCDEC (DPX,               dpx);
     REGISTER_DECODER(DSICINVIDEO,       dsicinvideo);
     REGISTER_DECODER(DVAUDIO,           dvaudio);
@@ -656,6 +657,7 @@ void avcodec_register_all(void)
     REGISTER_PARSER(DCA,                dca);
     REGISTER_PARSER(DIRAC,              dirac);
     REGISTER_PARSER(DNXHD,              dnxhd);
+    REGISTER_PARSER(DNXHR,              dnxhr);
     REGISTER_PARSER(DPX,                dpx);
     REGISTER_PARSER(DVAUDIO,            dvaudio);
     REGISTER_PARSER(DVBSUB,             dvbsub);
diff --git a/libavcodec/dnxhd_parser.c b/libavcodec/dnxhd_parser.c
index 033b8ee..312e994 100644
--- a/libavcodec/dnxhd_parser.c
+++ b/libavcodec/dnxhd_parser.c
@@ -113,3 +113,10 @@ AVCodecParser ff_dnxhd_parser = {
     .parser_parse   = dnxhd_parse,
     .parser_close   = ff_parse_close,
 };
+
+AVCodecParser ff_dnxhr_parser = {
+    .codec_ids      = { AV_CODEC_ID_DNXHR },
+    .priv_data_size = sizeof(DNXHDParserContext),
+    .parser_parse   = dnxhd_parse,
+    .parser_close   = ff_parse_close,
+};
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 1808080..4dde053 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -693,3 +693,17 @@ AVCodec ff_dnxhd_decoder = {
                       AV_CODEC_CAP_SLICE_THREADS,
     .init_thread_copy = ONLY_IF_THREADS_ENABLED(dnxhd_decode_init_thread_copy),
 };
+
+AVCodec ff_dnxhr_decoder = {
+    .name           = "dnxhr",
+    .long_name      = NULL_IF_CONFIG_SMALL("DNxHR"),
+    .type           = AVMEDIA_TYPE_VIDEO,
+    .id             = AV_CODEC_ID_DNXHR,
+    .priv_data_size = sizeof(DNXHDContext),
+    .init           = dnxhd_decode_init,
+    .close          = dnxhd_decode_close,
+    .decode         = dnxhd_decode_frame,
+    .capabilities   = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS |
+                      AV_CODEC_CAP_SLICE_THREADS,
+    .init_thread_copy = ONLY_IF_THREADS_ENABLED(dnxhd_decode_init_thread_copy),
+};
-- 
2.7.3



More information about the ffmpeg-devel mailing list