summaryrefslogtreecommitdiff
path: root/libavcodec/hevc_parser.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2015-07-13 14:10:31 -0300
committerJames Almer <jamrial@gmail.com>2015-07-13 14:57:54 -0300
commit84e847c7c80cc71d24f0e4ceb99331389d960b04 (patch)
treec12dca71a7daba5865c202696d90660dc3d9a86d /libavcodec/hevc_parser.c
parentfeb6a94f740bccc8e369f8b74714b940490f3901 (diff)
avcodec/hevc_parser: use the old parser only when hevc decoder is available
If it's not, then the new dependence-free parser will be used instead Reviewed-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/hevc_parser.c')
-rw-r--r--libavcodec/hevc_parser.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/hevc_parser.c b/libavcodec/hevc_parser.c
index 77ca017bd7..fd879a6436 100644
--- a/libavcodec/hevc_parser.c
+++ b/libavcodec/hevc_parser.c
@@ -30,7 +30,7 @@
#define IS_IRAP_NAL(nal) (nal->type >= 16 && nal->type <= 23)
-#define ADVANCED_PARSER
+#define ADVANCED_PARSER CONFIG_HEVC_DECODER
typedef struct HEVCParserContext {
ParseContext pc;
@@ -40,11 +40,12 @@ typedef struct HEVCParserContext {
int parsed_extradata;
-#ifdef ADVANCED_PARSER
+#if ADVANCED_PARSER
HEVCContext h;
#endif
} HEVCParserContext;
+#if !ADVANCED_PARSER
static int hevc_parse_slice_header(AVCodecParserContext *s, HEVCNAL *nal,
AVCodecContext *avctx)
{
@@ -81,7 +82,6 @@ static int hevc_parse_slice_header(AVCodecParserContext *s, HEVCNAL *nal,
return 0;
}
-#ifndef ADVANCED_PARSER
static int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
int buf_size, AVCodecContext *avctx)
{
@@ -166,6 +166,7 @@ static int hevc_find_frame_end(AVCodecParserContext *s, const uint8_t *buf,
return END_NOT_FOUND;
}
+#if ADVANCED_PARSER
/**
* Parse NAL units of found picture and decode some basic information.
*
@@ -174,7 +175,6 @@ static int hevc_find_frame_end(AVCodecParserContext *s, const uint8_t *buf,
* @param buf buffer with field/frame data.
* @param buf_size size of the buffer.
*/
-#ifdef ADVANCED_PARSER
static inline int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
int buf_size, AVCodecContext *avctx)
{
@@ -418,7 +418,7 @@ static void hevc_parser_close(AVCodecParserContext *s)
HEVCParserContext *ctx = s->priv_data;
int i;
-#ifdef ADVANCED_PARSER
+#if ADVANCED_PARSER
HEVCContext *h = &ctx->h;
av_freep(&h->HEVClc);
#endif