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
2343a99c
Commit
2343a99c
authored
Apr 18, 2012
by
Mohamed Naufal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libstagefright: support more output pixel formats
parent
1d48e88d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
libstagefright.cpp
libavcodec/libstagefright.cpp
+9
-6
No files found.
libavcodec/libstagefright.cpp
View file @
2343a99c
...
...
@@ -153,6 +153,7 @@ void* decode_thread(void *arg)
{
AVCodecContext
*
avctx
=
(
AVCodecContext
*
)
arg
;
StagefrightContext
*
s
=
(
StagefrightContext
*
)
avctx
->
priv_data
;
const
AVPixFmtDescriptor
*
pix_desc
=
&
av_pix_fmt_descriptors
[
avctx
->
pix_fmt
];
Frame
*
frame
;
MediaBuffer
*
buffer
;
int32_t
w
,
h
;
...
...
@@ -207,15 +208,13 @@ void* decode_thread(void *arg)
avctx
->
height
=
h
;
}
src_linesize
[
0
]
=
w
;
if
(
avctx
->
pix_fmt
==
PIX_FMT_YUV420P
)
src_linesize
[
1
]
=
src_linesize
[
2
]
=
w
/
2
;
else
if
(
avctx
->
pix_fmt
==
PIX_FMT_NV21
)
src_linesize
[
1
]
=
w
;
src_linesize
[
0
]
=
av_image_get_linesize
(
avctx
->
pix_fmt
,
w
,
0
);
src_linesize
[
1
]
=
av_image_get_linesize
(
avctx
->
pix_fmt
,
w
,
1
);
src_linesize
[
2
]
=
av_image_get_linesize
(
avctx
->
pix_fmt
,
w
,
2
);
src_data
[
0
]
=
(
uint8_t
*
)
buffer
->
data
();
src_data
[
1
]
=
src_data
[
0
]
+
src_linesize
[
0
]
*
h
;
src_data
[
2
]
=
src_data
[
1
]
+
src_linesize
[
1
]
*
h
/
2
;
src_data
[
2
]
=
src_data
[
1
]
+
src_linesize
[
1
]
*
-
(
-
h
>>
pix_desc
->
log2_chroma_h
)
;
av_image_copy
(
frame
->
vframe
->
data
,
frame
->
vframe
->
linesize
,
src_data
,
src_linesize
,
avctx
->
pix_fmt
,
avctx
->
width
,
avctx
->
height
);
...
...
@@ -327,6 +326,10 @@ static av_cold int Stagefright_init(AVCodecContext *avctx)
if
(
colorFormat
==
OMX_QCOM_COLOR_FormatYVU420SemiPlanar
||
colorFormat
==
OMX_COLOR_FormatYUV420SemiPlanar
)
avctx
->
pix_fmt
=
PIX_FMT_NV21
;
else
if
(
colorFormat
==
OMX_COLOR_FormatYCbYCr
)
avctx
->
pix_fmt
=
PIX_FMT_YUYV422
;
else
if
(
colorFormat
==
OMX_COLOR_FormatCbYCrY
)
avctx
->
pix_fmt
=
PIX_FMT_UYVY422
;
else
avctx
->
pix_fmt
=
PIX_FMT_YUV420P
;
...
...
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