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
af167d97
Commit
af167d97
authored
Mar 02, 2018
by
Matthieu Bouron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec/mediacodecdec: factorize common extradata functions
parent
535e0202
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
32 deletions
+9
-32
mediacodecdec.c
libavcodec/mediacodecdec.c
+9
-32
No files found.
libavcodec/mediacodecdec.c
View file @
af167d97
...
...
@@ -264,34 +264,11 @@ done:
}
#endif
#if CONFIG_MPEG2_MEDIACODEC_DECODER
static
int
mpeg2_set_extradata
(
AVCodecContext
*
avctx
,
FFAMediaFormat
*
format
)
{
int
ret
=
0
;
if
(
avctx
->
extradata
)
{
ff_AMediaFormat_setBuffer
(
format
,
"csd-0"
,
avctx
->
extradata
,
avctx
->
extradata_size
);
}
return
ret
;
}
#endif
#if CONFIG_MPEG4_MEDIACODEC_DECODER
static
int
mpeg4_set_extradata
(
AVCodecContext
*
avctx
,
FFAMediaFormat
*
format
)
{
int
ret
=
0
;
if
(
avctx
->
extradata
)
{
ff_AMediaFormat_setBuffer
(
format
,
"csd-0"
,
avctx
->
extradata
,
avctx
->
extradata_size
);
}
return
ret
;
}
#endif
#if CONFIG_VP8_MEDIACODEC_DECODER || CONFIG_VP9_MEDIACODEC_DECODER
static
int
vpx_set_extradata
(
AVCodecContext
*
avctx
,
FFAMediaFormat
*
format
)
#if CONFIG_MPEG2_MEDIACODEC_DECODER || \
CONFIG_MPEG4_MEDIACODEC_DECODER || \
CONFIG_VP8_MEDIACODEC_DECODER || \
CONFIG_VP9_MEDIACODEC_DECODER
static
int
common_set_extradata
(
AVCodecContext
*
avctx
,
FFAMediaFormat
*
format
)
{
int
ret
=
0
;
...
...
@@ -342,7 +319,7 @@ static av_cold int mediacodec_decode_init(AVCodecContext *avctx)
case
AV_CODEC_ID_MPEG2VIDEO
:
codec_mime
=
"video/mpeg2"
;
ret
=
mpeg2
_set_extradata
(
avctx
,
format
);
ret
=
common
_set_extradata
(
avctx
,
format
);
if
(
ret
<
0
)
goto
done
;
break
;
...
...
@@ -351,7 +328,7 @@ static av_cold int mediacodec_decode_init(AVCodecContext *avctx)
case
AV_CODEC_ID_MPEG4
:
codec_mime
=
"video/mp4v-es"
,
ret
=
mpeg4
_set_extradata
(
avctx
,
format
);
ret
=
common
_set_extradata
(
avctx
,
format
);
if
(
ret
<
0
)
goto
done
;
break
;
...
...
@@ -360,7 +337,7 @@ static av_cold int mediacodec_decode_init(AVCodecContext *avctx)
case
AV_CODEC_ID_VP8
:
codec_mime
=
"video/x-vnd.on2.vp8"
;
ret
=
vpx
_set_extradata
(
avctx
,
format
);
ret
=
common
_set_extradata
(
avctx
,
format
);
if
(
ret
<
0
)
goto
done
;
break
;
...
...
@@ -369,7 +346,7 @@ static av_cold int mediacodec_decode_init(AVCodecContext *avctx)
case
AV_CODEC_ID_VP9
:
codec_mime
=
"video/x-vnd.on2.vp9"
;
ret
=
vpx
_set_extradata
(
avctx
,
format
);
ret
=
common
_set_extradata
(
avctx
,
format
);
if
(
ret
<
0
)
goto
done
;
break
;
...
...
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