[FFmpeg-devel] [PATCH 2/5] avcodec/hevc_parse: allow setting apply_defdispwin when decoding SPS NAL units

James Almer jamrial at gmail.com
Mon Apr 3 04:45:42 EEST 2017


Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavcodec/hevc_parse.c    | 12 ++++++------
 libavcodec/hevc_parse.h    |  4 ++--
 libavcodec/mediacodecdec.c |  2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/libavcodec/hevc_parse.c b/libavcodec/hevc_parse.c
index 028ca5afe5..3b817c4f4d 100644
--- a/libavcodec/hevc_parse.c
+++ b/libavcodec/hevc_parse.c
@@ -23,7 +23,7 @@
 
 static int hevc_decode_nal_units(const uint8_t *buf, int buf_size, HEVCParamSets *ps,
                                  int is_nalff, int nal_length_size, int err_recognition,
-                                 void *logctx)
+                                 int apply_defdispwin, void *logctx)
 {
     int i;
     int ret = 0;
@@ -45,7 +45,7 @@ static int hevc_decode_nal_units(const uint8_t *buf, int buf_size, HEVCParamSets
                 goto done;
             break;
         case HEVC_NAL_SPS:
-            ret = ff_hevc_decode_nal_sps(&nal->gb, logctx, ps, 1);
+            ret = ff_hevc_decode_nal_sps(&nal->gb, logctx, ps, apply_defdispwin);
             if (ret < 0)
                 goto done;
             break;
@@ -86,8 +86,8 @@ done:
 }
 
 int ff_hevc_decode_extradata(const uint8_t *data, int size, HEVCParamSets *ps,
-                             int *is_nalff, int *nal_length_size,
-                             int err_recognition, void *logctx)
+                             int *is_nalff, int *nal_length_size, int err_recognition,
+                             int apply_defdispwin, void *logctx)
 {
     int ret = 0;
     GetByteContext gb;
@@ -126,7 +126,7 @@ int ff_hevc_decode_extradata(const uint8_t *data, int size, HEVCParamSets *ps,
                 }
 
                 ret = hevc_decode_nal_units(gb.buffer, nalsize, ps, *is_nalff, *nal_length_size,
-                                            err_recognition, logctx);
+                                            err_recognition, apply_defdispwin, logctx);
                 if (ret < 0) {
                     av_log(logctx, AV_LOG_ERROR,
                            "Decoding nal unit %d %d from hvcC failed\n",
@@ -143,7 +143,7 @@ int ff_hevc_decode_extradata(const uint8_t *data, int size, HEVCParamSets *ps,
     } else {
         *is_nalff = 0;
         ret = hevc_decode_nal_units(data, size, ps, *is_nalff, *nal_length_size,
-                                    err_recognition, logctx);
+                                    err_recognition, apply_defdispwin, logctx);
         if (ret < 0)
             return ret;
     }
diff --git a/libavcodec/hevc_parse.h b/libavcodec/hevc_parse.h
index 39bd23e6ea..8aa46a290a 100644
--- a/libavcodec/hevc_parse.h
+++ b/libavcodec/hevc_parse.h
@@ -27,7 +27,7 @@
 #include "hevcdec.h"
 
 int ff_hevc_decode_extradata(const uint8_t *data, int size, HEVCParamSets *ps,
-                             int *is_nalff, int *nal_length_size,
-                             int err_recognition, void *logctx);
+                             int *is_nalff, int *nal_length_size, int err_recognition,
+                             int apply_defdispwin, void *logctx);
 
 #endif /* AVCODEC_HEVC_PARSE_H */
diff --git a/libavcodec/mediacodecdec.c b/libavcodec/mediacodecdec.c
index 79a51ec684..7f7c07720b 100644
--- a/libavcodec/mediacodecdec.c
+++ b/libavcodec/mediacodecdec.c
@@ -202,7 +202,7 @@ static int hevc_set_extradata(AVCodecContext *avctx, FFAMediaFormat *format)
     memset(&ps, 0, sizeof(ps));
 
     ret = ff_hevc_decode_extradata(avctx->extradata, avctx->extradata_size,
-                                &ps, &is_nalff, &nal_length_size, 0, avctx);
+                                   &ps, &is_nalff, &nal_length_size, 0, 1, avctx);
     if (ret < 0) {
         goto done;
     }
-- 
2.12.1



More information about the ffmpeg-devel mailing list