Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Steve Lhomme
VLC
Commits
e2cdb06f
Commit
e2cdb06f
authored
Mar 13, 2018
by
François Cartegnie
🤞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: libmp4: read rotation atom
parent
b6968b7d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
0 deletions
+27
-0
modules/demux/mp4/heif.c
modules/demux/mp4/heif.c
+10
-0
modules/demux/mp4/libmp4.c
modules/demux/mp4/libmp4.c
+10
-0
modules/demux/mp4/libmp4.h
modules/demux/mp4/libmp4.h
+7
-0
No files found.
modules/demux/mp4/heif.c
View file @
e2cdb06f
...
...
@@ -304,6 +304,16 @@ static int DemuxHEIF( demux_t *p_demux )
fmt
.
video
.
i_sar_den
=
p_prop
->
data
.
p_pasp
->
i_vertical_spacing
;
}
break
;
case
ATOM_irot
:
switch
(
p_prop
->
data
.
p_irot
->
i_ccw_degrees
%
360
)
{
default:
case
0
:
fmt
.
video
.
orientation
=
ORIENT_NORMAL
;
break
;
case
90
:
fmt
.
video
.
orientation
=
ORIENT_ROTATED_90
;
break
;
case
180
:
fmt
.
video
.
orientation
=
ORIENT_ROTATED_180
;
break
;
case
270
:
fmt
.
video
.
orientation
=
ORIENT_ROTATED_270
;
break
;
}
break
;
}
}
}
...
...
modules/demux/mp4/libmp4.c
View file @
e2cdb06f
...
...
@@ -3874,6 +3874,15 @@ static int MP4_ReadBox_colr( stream_t *p_stream, MP4_Box_t *p_box )
MP4_READBOX_EXIT
(
1
);
}
static
int
MP4_ReadBox_irot
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
{
MP4_READBOX_ENTER
(
MP4_Box_data_irot_t
,
NULL
);
MP4_GET1BYTE
(
p_box
->
data
.
p_irot
->
i_ccw_degrees
);
p_box
->
data
.
p_irot
->
i_ccw_degrees
&=
0x03
;
p_box
->
data
.
p_irot
->
i_ccw_degrees
*=
90
;
MP4_READBOX_EXIT
(
1
);
}
static
int
MP4_ReadBox_meta
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
{
const
uint8_t
*
p_peek
;
...
...
@@ -4850,6 +4859,7 @@ static const struct
{
ATOM_btrt
,
MP4_ReadBox_btrt
,
0
},
/* codecs bitrate stsd/????/btrt */
{
ATOM_keys
,
MP4_ReadBox_keys
,
ATOM_meta
},
{
ATOM_colr
,
MP4_ReadBox_colr
,
0
},
{
ATOM_irot
,
MP4_ReadBox_irot
,
0
},
/* heif */
/* XiphQT */
{
ATOM_vCtH
,
MP4_ReadBox_Binary
,
ATOM_wave
},
...
...
modules/demux/mp4/libmp4.h
View file @
e2cdb06f
...
...
@@ -391,6 +391,7 @@ typedef int64_t stime_t;
#define ATOM_gsst VLC_FOURCC( 'g', 's', 's', 't' )
#define ATOM_gstd VLC_FOURCC( 'g', 's', 't', 'd' )
#define ATOM_colr VLC_FOURCC( 'c', 'o', 'l', 'r' )
#define ATOM_irot VLC_FOURCC( 'i', 'r', 'o', 't' )
#define ATOM_SmDm VLC_FOURCC( 'S', 'm', 'D', 'm' )
#define ATOM_CoLL VLC_FOURCC( 'C', 'o', 'L', 'L' )
...
...
@@ -675,6 +676,11 @@ typedef struct MP4_Box_data_colr_s
};
}
MP4_Box_data_colr_t
;
typedef
struct
{
uint16_t
i_ccw_degrees
;
}
MP4_Box_data_irot_t
;
typedef
struct
MP4_Box_data_sample_soun_s
{
uint8_t
i_reserved1
[
6
];
...
...
@@ -1757,6 +1763,7 @@ typedef union MP4_Box_data_s
MP4_Box_data_ctts_t
*
p_ctts
;
MP4_Box_data_cslg_t
*
p_cslg
;
MP4_Box_data_colr_t
*
p_colr
;
MP4_Box_data_irot_t
*
p_irot
;
MP4_Box_data_sbgp_t
*
p_sbgp
;
MP4_Box_data_sgpd_t
*
p_sgpd
;
...
...
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