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
022b4ea5
Commit
022b4ea5
authored
Feb 10, 2017
by
Vittorio Giovara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mov: Export bounds and padding from spherical metadata
Update the fate test as needed.
parent
1b7ffddb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
2 deletions
+32
-2
mov.c
libavformat/mov.c
+27
-1
mov-spherical-mono
tests/ref/fate/mov-spherical-mono
+5
-1
No files found.
libavformat/mov.c
View file @
022b4ea5
...
...
@@ -4637,6 +4637,8 @@ static int mov_read_sv3d(MOVContext *c, AVIOContext *pb, MOVAtom atom)
MOVStreamContext
*
sc
;
int
size
;
int32_t
yaw
,
pitch
,
roll
;
size_t
l
=
0
,
t
=
0
,
r
=
0
,
b
=
0
;
size_t
padding
=
0
;
uint32_t
tag
;
enum
AVSphericalProjection
projection
;
...
...
@@ -4698,9 +4700,26 @@ static int mov_read_sv3d(MOVContext *c, AVIOContext *pb, MOVAtom atom)
switch
(
tag
)
{
case
MKTAG
(
'c'
,
'b'
,
'm'
,
'p'
):
projection
=
AV_SPHERICAL_CUBEMAP
;
padding
=
avio_rb32
(
pb
);
break
;
case
MKTAG
(
'e'
,
'q'
,
'u'
,
'i'
):
projection
=
AV_SPHERICAL_EQUIRECTANGULAR
;
t
=
avio_rb32
(
pb
);
b
=
avio_rb32
(
pb
);
l
=
avio_rb32
(
pb
);
r
=
avio_rb32
(
pb
);
if
(
b
>=
UINT_MAX
-
t
||
r
>=
UINT_MAX
-
l
)
{
av_log
(
c
->
fc
,
AV_LOG_ERROR
,
"Invalid bounding rectangle coordinates %"
SIZE_SPECIFIER
","
"%"
SIZE_SPECIFIER
",%"
SIZE_SPECIFIER
",%"
SIZE_SPECIFIER
"
\n
"
,
l
,
t
,
r
,
b
);
return
AVERROR_INVALIDDATA
;
}
if
(
l
||
t
||
r
||
b
)
projection
=
AV_SPHERICAL_EQUIRECTANGULAR_TILE
;
else
projection
=
AV_SPHERICAL_EQUIRECTANGULAR
;
break
;
default:
av_log
(
c
->
fc
,
AV_LOG_ERROR
,
"Unknown projection type
\n
"
);
...
...
@@ -4717,6 +4736,13 @@ static int mov_read_sv3d(MOVContext *c, AVIOContext *pb, MOVAtom atom)
sc
->
spherical
->
pitch
=
pitch
;
sc
->
spherical
->
roll
=
roll
;
sc
->
spherical
->
padding
=
padding
;
sc
->
spherical
->
bound_left
=
l
;
sc
->
spherical
->
bound_top
=
t
;
sc
->
spherical
->
bound_right
=
r
;
sc
->
spherical
->
bound_bottom
=
b
;
return
0
;
}
...
...
tests/ref/fate/mov-spherical-mono
View file @
022b4ea5
...
...
@@ -8,7 +8,11 @@ inverted=0
[SIDE_DATA]
side_data_type=Spherical Mapping
side_data_size=56
projection=equirectangular
projection=tiled equirectangular
bound_left=148
bound_top=73
bound_right=147
bound_bottom=72
yaw=45
pitch=30
roll=15
...
...
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