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
a40ba3af
Commit
a40ba3af
authored
Apr 10, 2012
by
Sebastien Zwickert
Committed by
Martin Storsjö
Apr 10, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vda: Signal 4 byte NAL headers to the decoder regardless of what's in the extradata
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
14f063d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
vda.c
libavcodec/vda.c
+20
-1
No files found.
libavcodec/vda.c
View file @
a40ba3af
...
...
@@ -142,6 +142,26 @@ int ff_vda_create_decoder(struct vda_context *vda_ctx,
pthread_mutex_init
(
&
vda_ctx
->
queue_mutex
,
NULL
);
/* Each VCL NAL in the bistream sent to the decoder
* is preceeded by a 4 bytes length header.
* Change the avcC atom header if needed, to signal headers of 4 bytes. */
if
(
extradata_size
>=
4
&&
(
extradata
[
4
]
&
0x03
)
!=
0x03
)
{
uint8_t
*
rw_extradata
;
if
(
!
(
rw_extradata
=
av_malloc
(
extradata_size
)))
return
AVERROR
(
ENOMEM
);
memcpy
(
rw_extradata
,
extradata
,
extradata_size
);
rw_extradata
[
4
]
|=
0x03
;
avc_data
=
CFDataCreate
(
kCFAllocatorDefault
,
rw_extradata
,
extradata_size
);
av_freep
(
&
rw_extradata
);
}
else
{
avc_data
=
CFDataCreate
(
kCFAllocatorDefault
,
extradata
,
extradata_size
);
}
config_info
=
CFDictionaryCreateMutable
(
kCFAllocatorDefault
,
4
,
&
kCFTypeDictionaryKeyCallBacks
,
...
...
@@ -150,7 +170,6 @@ int ff_vda_create_decoder(struct vda_context *vda_ctx,
height
=
CFNumberCreate
(
kCFAllocatorDefault
,
kCFNumberSInt32Type
,
&
vda_ctx
->
height
);
width
=
CFNumberCreate
(
kCFAllocatorDefault
,
kCFNumberSInt32Type
,
&
vda_ctx
->
width
);
format
=
CFNumberCreate
(
kCFAllocatorDefault
,
kCFNumberSInt32Type
,
&
vda_ctx
->
format
);
avc_data
=
CFDataCreate
(
kCFAllocatorDefault
,
extradata
,
extradata_size
);
CFDictionarySetValue
(
config_info
,
kVDADecoderConfiguration_Height
,
height
);
CFDictionarySetValue
(
config_info
,
kVDADecoderConfiguration_Width
,
width
);
...
...
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