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
48e64324
Commit
48e64324
authored
Jun 06, 2014
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
matroska: Factor out mkv_write_stereo_mode
parent
b75a1f98
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
17 deletions
+22
-17
matroskaenc.c
libavformat/matroskaenc.c
+22
-17
No files found.
libavformat/matroskaenc.c
View file @
48e64324
...
...
@@ -624,6 +624,27 @@ static int mkv_write_codecprivate(AVFormatContext *s, AVIOContext *pb,
return
ret
;
}
static
void
mkv_write_stereo_mode
(
AVIOContext
*
pb
,
uint8_t
stereo_fmt
,
int
mode
)
{
int
valid_fmt
=
0
;
switch
(
mode
)
{
case
MODE_WEBM
:
if
(
stereo_fmt
<=
MATROSKA_VIDEO_STEREOMODE_TYPE_TOP_BOTTOM
||
stereo_fmt
==
MATROSKA_VIDEO_STEREOMODE_TYPE_RIGHT_LEFT
)
valid_fmt
=
1
;
break
;
case
MODE_MATROSKAv2
:
if
(
stereo_fmt
<=
MATROSKA_VIDEO_STEREOMODE_TYPE_BOTH_EYES_BLOCK_RL
)
valid_fmt
=
1
;
break
;
}
if
(
valid_fmt
)
put_ebml_uint
(
pb
,
MATROSKA_ID_VIDEOSTEREOMODE
,
stereo_fmt
);
}
static
int
mkv_write_track
(
AVFormatContext
*
s
,
MatroskaMuxContext
*
mkv
,
int
i
,
AVIOContext
*
pb
)
{
...
...
@@ -723,23 +744,7 @@ static int mkv_write_track(AVFormatContext *s, MatroskaMuxContext *mkv,
put_ebml_uint
(
pb
,
MATROSKA_ID_VIDEOPIXELWIDTH
,
codec
->
width
);
put_ebml_uint
(
pb
,
MATROSKA_ID_VIDEOPIXELHEIGHT
,
codec
->
height
);
if
((
tag
=
av_dict_get
(
s
->
metadata
,
"stereo_mode"
,
NULL
,
0
)))
{
uint8_t
stereo_fmt
=
atoi
(
tag
->
value
);
int
valid_fmt
=
0
;
switch
(
mkv
->
mode
)
{
case
MODE_WEBM
:
if
(
stereo_fmt
<=
MATROSKA_VIDEO_STEREOMODE_TYPE_TOP_BOTTOM
||
stereo_fmt
==
MATROSKA_VIDEO_STEREOMODE_TYPE_RIGHT_LEFT
)
valid_fmt
=
1
;
break
;
case
MODE_MATROSKAv2
:
if
(
stereo_fmt
<=
MATROSKA_VIDEO_STEREOMODE_TYPE_BOTH_EYES_BLOCK_RL
)
valid_fmt
=
1
;
break
;
}
if
(
valid_fmt
)
put_ebml_uint
(
pb
,
MATROSKA_ID_VIDEOSTEREOMODE
,
stereo_fmt
);
mkv_write_stereo_mode
(
pb
,
atoi
(
tag
->
value
),
mkv
->
mode
);
}
if
(
st
->
sample_aspect_ratio
.
num
)
{
int
d_width
=
codec
->
width
*
av_q2d
(
st
->
sample_aspect_ratio
);
...
...
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