Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
222d7055
Commit
222d7055
authored
Jan 20, 2018
by
James Almer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/hevc_parser: use ff_hevc_decode_extradata() to parse extradata
Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
42323c3e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
+9
-12
hevc_parser.c
libavcodec/hevc_parser.c
+9
-12
No files found.
libavcodec/hevc_parser.c
View file @
222d7055
...
@@ -24,6 +24,7 @@
...
@@ -24,6 +24,7 @@
#include "golomb.h"
#include "golomb.h"
#include "hevc.h"
#include "hevc.h"
#include "hevc_parse.h"
#include "hevc_ps.h"
#include "hevc_ps.h"
#include "hevc_sei.h"
#include "hevc_sei.h"
#include "h2645_parse.h"
#include "h2645_parse.h"
...
@@ -43,6 +44,8 @@ typedef struct HEVCParserContext {
...
@@ -43,6 +44,8 @@ typedef struct HEVCParserContext {
HEVCSEI
sei
;
HEVCSEI
sei
;
SliceHeader
sh
;
SliceHeader
sh
;
int
is_avc
;
int
nal_length_size
;
int
parsed_extradata
;
int
parsed_extradata
;
int
poc
;
int
poc
;
...
@@ -181,7 +184,6 @@ static int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
...
@@ -181,7 +184,6 @@ static int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
HEVCParserContext
*
ctx
=
s
->
priv_data
;
HEVCParserContext
*
ctx
=
s
->
priv_data
;
HEVCParamSets
*
ps
=
&
ctx
->
ps
;
HEVCParamSets
*
ps
=
&
ctx
->
ps
;
HEVCSEI
*
sei
=
&
ctx
->
sei
;
HEVCSEI
*
sei
=
&
ctx
->
sei
;
int
is_global
=
buf
==
avctx
->
extradata
;
int
ret
,
i
;
int
ret
,
i
;
/* set some sane default values */
/* set some sane default values */
...
@@ -191,8 +193,8 @@ static int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
...
@@ -191,8 +193,8 @@ static int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
ff_hevc_reset_sei
(
sei
);
ff_hevc_reset_sei
(
sei
);
ret
=
ff_h2645_packet_split
(
&
ctx
->
pkt
,
buf
,
buf_size
,
avctx
,
0
,
0
,
ret
=
ff_h2645_packet_split
(
&
ctx
->
pkt
,
buf
,
buf_size
,
avctx
,
ctx
->
is_avc
,
AV_CODEC_ID_HEVC
,
1
);
ctx
->
nal_length_size
,
AV_CODEC_ID_HEVC
,
1
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
ret
;
return
ret
;
...
@@ -230,12 +232,6 @@ static int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
...
@@ -230,12 +232,6 @@ static int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
case
HEVC_NAL_RADL_R
:
case
HEVC_NAL_RADL_R
:
case
HEVC_NAL_RASL_N
:
case
HEVC_NAL_RASL_N
:
case
HEVC_NAL_RASL_R
:
case
HEVC_NAL_RASL_R
:
if
(
is_global
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Invalid NAL unit: %d
\n
"
,
nal
->
type
);
return
AVERROR_INVALIDDATA
;
}
ret
=
hevc_parse_slice_header
(
s
,
nal
,
avctx
);
ret
=
hevc_parse_slice_header
(
s
,
nal
,
avctx
);
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
...
@@ -243,8 +239,7 @@ static int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
...
@@ -243,8 +239,7 @@ static int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
}
}
}
}
/* didn't find a picture! */
/* didn't find a picture! */
if
(
!
is_global
)
av_log
(
avctx
,
AV_LOG_ERROR
,
"missing picture in access unit
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"missing picture in access unit
\n
"
);
return
-
1
;
return
-
1
;
}
}
...
@@ -301,7 +296,9 @@ static int hevc_parse(AVCodecParserContext *s, AVCodecContext *avctx,
...
@@ -301,7 +296,9 @@ static int hevc_parse(AVCodecParserContext *s, AVCodecContext *avctx,
ParseContext
*
pc
=
&
ctx
->
pc
;
ParseContext
*
pc
=
&
ctx
->
pc
;
if
(
avctx
->
extradata
&&
!
ctx
->
parsed_extradata
)
{
if
(
avctx
->
extradata
&&
!
ctx
->
parsed_extradata
)
{
parse_nal_units
(
s
,
avctx
->
extradata
,
avctx
->
extradata_size
,
avctx
);
ff_hevc_decode_extradata
(
avctx
->
extradata
,
avctx
->
extradata_size
,
&
ctx
->
ps
,
&
ctx
->
sei
,
&
ctx
->
is_avc
,
&
ctx
->
nal_length_size
,
avctx
->
err_recognition
,
1
,
avctx
);
ctx
->
parsed_extradata
=
1
;
ctx
->
parsed_extradata
=
1
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment