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
2fe30b47
Commit
2fe30b47
authored
Nov 07, 2016
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hevc: Allow parsing external extradata buffers
parent
5be21531
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
7 deletions
+5
-7
hevcdec.c
libavcodec/hevcdec.c
+5
-7
No files found.
libavcodec/hevcdec.c
View file @
2fe30b47
...
...
@@ -2698,17 +2698,15 @@ static int verify_md5(HEVCContext *s, AVFrame *frame)
return
0
;
}
static
int
hevc_decode_extradata
(
HEVCContext
*
s
)
static
int
hevc_decode_extradata
(
HEVCContext
*
s
,
uint8_t
*
buf
,
int
length
)
{
AVCodecContext
*
avctx
=
s
->
avctx
;
GetByteContext
gb
;
int
ret
,
i
;
bytestream2_init
(
&
gb
,
avctx
->
extradata
,
avctx
->
extradata_size
);
bytestream2_init
(
&
gb
,
buf
,
length
);
if
(
avctx
->
extradata_size
>
3
&&
(
avctx
->
extradata
[
0
]
||
avctx
->
extradata
[
1
]
||
avctx
->
extradata
[
2
]
>
1
))
{
if
(
length
>
3
&&
(
buf
[
0
]
||
buf
[
1
]
||
buf
[
2
]
>
1
))
{
/* It seems the extradata is encoded as hvcC format.
* Temporarily, we support configurationVersion==0 until 14496-15 3rd
* is finalized. When finalized, configurationVersion will be 1 and we
...
...
@@ -2755,7 +2753,7 @@ static int hevc_decode_extradata(HEVCContext *s)
s
->
nal_length_size
=
nal_len_size
;
}
else
{
s
->
is_nalff
=
0
;
ret
=
decode_nal_units
(
s
,
avctx
->
extradata
,
avctx
->
extradata_size
);
ret
=
decode_nal_units
(
s
,
buf
,
length
);
if
(
ret
<
0
)
return
ret
;
}
...
...
@@ -3009,7 +3007,7 @@ static av_cold int hevc_decode_init(AVCodecContext *avctx)
return
ret
;
if
(
avctx
->
extradata_size
>
0
&&
avctx
->
extradata
)
{
ret
=
hevc_decode_extradata
(
s
);
ret
=
hevc_decode_extradata
(
s
,
avctx
->
extradata
,
avctx
->
extradata_size
);
if
(
ret
<
0
)
{
hevc_decode_free
(
avctx
);
return
ret
;
...
...
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