Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
4274e481
Commit
4274e481
authored
Jan 05, 2012
by
Alex Converse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mov: Support MOV_CH_LAYOUT_USE_DESCRIPTIONS for labeled descriptions.
parent
9b55b4bb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
9 deletions
+37
-9
mov.c
libavformat/mov.c
+15
-7
mov_chan.c
libavformat/mov_chan.c
+14
-2
mov_chan.h
libavformat/mov_chan.h
+8
-0
No files found.
libavformat/mov.c
View file @
4274e481
...
@@ -559,7 +559,8 @@ static int mov_read_chan(MOVContext *c, AVIOContext *pb, MOVAtom atom)
...
@@ -559,7 +559,8 @@ static int mov_read_chan(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
{
AVStream
*
st
;
AVStream
*
st
;
uint8_t
version
;
uint8_t
version
;
uint32_t
flags
,
layout_tag
,
bitmap
,
num_descr
;
uint32_t
flags
,
layout_tag
,
bitmap
,
num_descr
,
label_mask
;
int
i
;
if
(
c
->
fc
->
nb_streams
<
1
)
if
(
c
->
fc
->
nb_streams
<
1
)
return
0
;
return
0
;
...
@@ -581,9 +582,7 @@ static int mov_read_chan(MOVContext *c, AVIOContext *pb, MOVAtom atom)
...
@@ -581,9 +582,7 @@ static int mov_read_chan(MOVContext *c, AVIOContext *pb, MOVAtom atom)
av_dlog
(
c
->
fc
,
"chan: size=%ld version=%u flags=%u layout=%u bitmap=%u num_descr=%u
\n
"
,
av_dlog
(
c
->
fc
,
"chan: size=%ld version=%u flags=%u layout=%u bitmap=%u num_descr=%u
\n
"
,
atom
.
size
,
version
,
flags
,
layout_tag
,
bitmap
,
num_descr
);
atom
.
size
,
version
,
flags
,
layout_tag
,
bitmap
,
num_descr
);
#if 0
label_mask
=
0
;
/* TODO: use the channel descriptions if the layout tag is 0 */
int i;
for
(
i
=
0
;
i
<
num_descr
;
i
++
)
{
for
(
i
=
0
;
i
<
num_descr
;
i
++
)
{
uint32_t
label
,
cflags
;
uint32_t
label
,
cflags
;
float
coords
[
3
];
float
coords
[
3
];
...
@@ -592,10 +591,19 @@ static int mov_read_chan(MOVContext *c, AVIOContext *pb, MOVAtom atom)
...
@@ -592,10 +591,19 @@ static int mov_read_chan(MOVContext *c, AVIOContext *pb, MOVAtom atom)
AV_WN32
(
&
coords
[
0
],
avio_rl32
(
pb
));
// mCoordinates[0]
AV_WN32
(
&
coords
[
0
],
avio_rl32
(
pb
));
// mCoordinates[0]
AV_WN32
(
&
coords
[
1
],
avio_rl32
(
pb
));
// mCoordinates[1]
AV_WN32
(
&
coords
[
1
],
avio_rl32
(
pb
));
// mCoordinates[1]
AV_WN32
(
&
coords
[
2
],
avio_rl32
(
pb
));
// mCoordinates[2]
AV_WN32
(
&
coords
[
2
],
avio_rl32
(
pb
));
// mCoordinates[2]
if
(
layout_tag
==
0
)
{
uint32_t
mask_incr
=
ff_mov_get_channel_label
(
label
);
if
(
mask_incr
==
0
)
{
label_mask
=
0
;
break
;
}
label_mask
|=
mask_incr
;
}
}
}
#endif
if
(
layout_tag
==
0
)
st
->
codec
->
channel_layout
=
label_mask
;
st
->
codec
->
channel_layout
=
ff_mov_get_channel_layout
(
layout_tag
,
bitmap
);
else
st
->
codec
->
channel_layout
=
ff_mov_get_channel_layout
(
layout_tag
,
bitmap
);
return
0
;
return
0
;
}
}
...
...
libavformat/mov_chan.c
View file @
4274e481
...
@@ -428,8 +428,7 @@ uint64_t ff_mov_get_channel_layout(uint32_t tag, uint32_t bitmap)
...
@@ -428,8 +428,7 @@ uint64_t ff_mov_get_channel_layout(uint32_t tag, uint32_t bitmap)
int
i
,
channels
;
int
i
,
channels
;
const
struct
MovChannelLayoutMap
*
layout_map
;
const
struct
MovChannelLayoutMap
*
layout_map
;
/* handle the use of the channel descriptions */
/* use ff_mov_get_channel_label() to build a layout instead */
/* TODO: map MOV channel labels to Libav channels */
if
(
tag
==
MOV_CH_LAYOUT_USE_DESCRIPTIONS
)
if
(
tag
==
MOV_CH_LAYOUT_USE_DESCRIPTIONS
)
return
0
;
return
0
;
...
@@ -451,6 +450,19 @@ uint64_t ff_mov_get_channel_layout(uint32_t tag, uint32_t bitmap)
...
@@ -451,6 +450,19 @@ uint64_t ff_mov_get_channel_layout(uint32_t tag, uint32_t bitmap)
return
layout_map
[
i
].
layout
;
return
layout_map
[
i
].
layout
;
}
}
uint32_t
ff_mov_get_channel_label
(
uint32_t
label
)
{
if
(
label
==
0
)
return
0
;
if
(
label
<=
18
)
return
1U
<<
(
label
-
1
);
if
(
label
==
38
)
return
AV_CH_STEREO_LEFT
;
if
(
label
==
39
)
return
AV_CH_STEREO_RIGHT
;
return
0
;
}
uint32_t
ff_mov_get_channel_layout_tag
(
enum
CodecID
codec_id
,
uint32_t
ff_mov_get_channel_layout_tag
(
enum
CodecID
codec_id
,
uint64_t
channel_layout
,
uint64_t
channel_layout
,
uint32_t
*
bitmap
)
uint32_t
*
bitmap
)
...
...
libavformat/mov_chan.h
View file @
4274e481
...
@@ -39,6 +39,14 @@
...
@@ -39,6 +39,14 @@
*/
*/
uint64_t
ff_mov_get_channel_layout
(
uint32_t
tag
,
uint32_t
bitmap
);
uint64_t
ff_mov_get_channel_layout
(
uint32_t
tag
,
uint32_t
bitmap
);
/**
* Get the channel layout for the specified channel layout tag.
*
* @param[in] tag channel label
* @return channel layout mask fragment
*/
uint32_t
ff_mov_get_channel_label
(
uint32_t
label
);
/**
/**
* Get the channel layout tag for the specified codec id and channel layout.
* Get the channel layout tag for the specified codec id and channel layout.
* If the layout tag was not found, use a channel bitmap if possible.
* If the layout tag was not found, use a channel bitmap if possible.
...
...
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