Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
aac93fa6
Commit
aac93fa6
authored
Jan 12, 2012
by
Gaurav Narula
Committed by
Jean-Baptiste Kempf
Jan 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MP4: Parse transformation matrix
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
d16dfb39
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
2 deletions
+34
-2
configure.ac
configure.ac
+1
-1
modules/demux/mp4/libmp4.c
modules/demux/mp4/libmp4.c
+33
-1
No files found.
configure.ac
View file @
aac93fa6
...
...
@@ -601,7 +601,7 @@ AC_CHECK_FUNC(getopt_long,, [
AC_SUBST(GNUGETOPT_LIBS)
AC_CHECK_LIB(m,cos,[
VLC_ADD_LIBS([adjust wave ripple psychedelic gradient a52tofloat32 dtstofloat32 x264 goom visual panoramix rotate noise grain scene kate flac lua chorus_flanger freetype avcodec avformat access_avio swscale postproc i420_rgb faad twolame equalizer spatializer param_eq samplerate freetype mod mpc dmo quicktime realvideo qt4 compressor headphone_channel_mixer normvol audiobargraph_a speex mono colorthres extract ball access_imem hotkeys mosaic gaussianblur dbus x264 hqdn3d],[-lm])
VLC_ADD_LIBS([adjust wave ripple psychedelic gradient a52tofloat32 dtstofloat32 x264 goom visual panoramix rotate noise grain scene kate flac lua chorus_flanger freetype avcodec avformat access_avio swscale postproc i420_rgb faad twolame equalizer spatializer param_eq samplerate freetype mod mpc dmo
mp4
quicktime realvideo qt4 compressor headphone_channel_mixer normvol audiobargraph_a speex mono colorthres extract ball access_imem hotkeys mosaic gaussianblur dbus x264 hqdn3d],[-lm])
LIBM="-lm"
], [
LIBM=""
...
...
modules/demux/mp4/libmp4.c
View file @
aac93fa6
...
...
@@ -33,6 +33,7 @@
#include "libmp4.h"
#include "drms.h"
#include <math.h>
/*****************************************************************************
* Here are defined some macro to make life simpler but before using it
...
...
@@ -145,6 +146,13 @@ static void CreateUUID( UUID_t *p_uuid, uint32_t i_fourcc )
(
void
)
i_fourcc
;
}
/* convert 16.16 fixed point to floating point */
static
double
conv_fx
(
int32_t
fx
)
{
double
fp
=
fx
;
fp
/=
65536
.;
return
fp
;
}
/* some functions for mp4 encoding of variables */
#ifdef MP4_VERBOSE
static
void
MP4_ConvertDate2Str
(
char
*
psz
,
uint64_t
i_date
)
...
...
@@ -637,12 +645,31 @@ static int MP4_ReadBox_tkhd( stream_t *p_stream, MP4_Box_t *p_box )
MP4_GET4BYTES
(
p_box
->
data
.
p_tkhd
->
i_width
);
MP4_GET4BYTES
(
p_box
->
data
.
p_tkhd
->
i_height
);
double
rotation
;
//angle in degrees to be rotated clockwise
double
scale
[
2
];
// scale factor; sx = scale[0] , sy = scale[1]
double
translate
[
2
];
// amount to translate; tx = translate[0] , ty = translate[1]
int
*
matrix
=
p_box
->
data
.
p_tkhd
->
i_matrix
;
translate
[
0
]
=
conv_fx
(
matrix
[
6
]);
translate
[
1
]
=
conv_fx
(
matrix
[
7
]);
scale
[
0
]
=
sqrt
(
conv_fx
(
matrix
[
0
])
*
conv_fx
(
matrix
[
0
])
+
conv_fx
(
matrix
[
3
])
*
conv_fx
(
matrix
[
3
]));
scale
[
1
]
=
sqrt
(
conv_fx
(
matrix
[
1
])
*
conv_fx
(
matrix
[
1
])
+
conv_fx
(
matrix
[
4
])
*
conv_fx
(
matrix
[
4
]));
rotation
=
atan2
(
conv_fx
(
matrix
[
1
])
/
scale
[
1
],
conv_fx
(
matrix
[
0
])
/
scale
[
0
])
*
180
/
M_PI
;
if
(
rotation
<
0
)
rotation
+=
360
.;
#ifdef MP4_VERBOSE
MP4_ConvertDate2Str
(
s_creation_time
,
p_box
->
data
.
p_mvhd
->
i_creation_time
);
MP4_ConvertDate2Str
(
s_modification_time
,
p_box
->
data
.
p_mvhd
->
i_modification_time
);
MP4_ConvertDate2Str
(
s_duration
,
p_box
->
data
.
p_mvhd
->
i_duration
);
msg_Dbg
(
p_stream
,
"read box:
\"
tkhd
\"
creation %s modification %s duration %s track ID %d layer %d volume %f width %f height %f. "
msg_Dbg
(
p_stream
,
"read box:
\"
tkhd
\"
creation %s modification %s duration %s track ID %d layer %d volume %f
rotation %f scaleX %f scaleY %f translateX %f translateY %f
width %f height %f. "
"Matrix: %i %i %i %i %i %i %i %i %i"
,
s_creation_time
,
s_modification_time
,
...
...
@@ -650,6 +677,11 @@ static int MP4_ReadBox_tkhd( stream_t *p_stream, MP4_Box_t *p_box )
p_box
->
data
.
p_tkhd
->
i_track_ID
,
p_box
->
data
.
p_tkhd
->
i_layer
,
(
float
)
p_box
->
data
.
p_tkhd
->
i_volume
/
256
,
rotation
,
scale
[
0
],
scale
[
1
],
translate
[
0
],
translate
[
1
],
(
float
)
p_box
->
data
.
p_tkhd
->
i_width
/
65536
,
(
float
)
p_box
->
data
.
p_tkhd
->
i_height
/
65536
,
p_box
->
data
.
p_tkhd
->
i_matrix
[
0
],
...
...
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