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
6b49065d
Commit
6b49065d
authored
Oct 27, 2011
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added 'pasp' atom support to mp4/mov demuxer.
This atom can store an optionnal aspect ratio.
parent
a2e00626
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
0 deletions
+35
-0
modules/demux/mp4/libmp4.c
modules/demux/mp4/libmp4.c
+18
-0
modules/demux/mp4/libmp4.h
modules/demux/mp4/libmp4.h
+8
-0
modules/demux/mp4/mp4.c
modules/demux/mp4/mp4.c
+9
-0
No files found.
modules/demux/mp4/libmp4.c
View file @
6b49065d
...
...
@@ -2704,6 +2704,23 @@ static int MP4_ReadBox_iods( stream_t *p_stream, MP4_Box_t *p_box )
MP4_READBOX_EXIT
(
1
);
}
static
int
MP4_ReadBox_pasp
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
{
MP4_READBOX_ENTER
(
MP4_Box_data_pasp_t
);
MP4_GET4BYTES
(
p_box
->
data
.
p_pasp
->
i_horizontal_spacing
);
MP4_GET4BYTES
(
p_box
->
data
.
p_pasp
->
i_vertical_spacing
);
#ifdef MP4_VERBOSE
msg_Dbg
(
p_stream
,
"read box:
\"
paps
\"
%dx%d"
,
p_box
->
data
.
p_pasp
->
i_horizontal_spacing
,
p_box
->
data
.
p_pasp
->
i_vertical_spacing
);
#endif
MP4_READBOX_EXIT
(
1
);
}
/* For generic */
static
int
MP4_ReadBox_default
(
stream_t
*
p_stream
,
MP4_Box_t
*
p_box
)
...
...
@@ -2818,6 +2835,7 @@ static const struct
{
ATOM_gnre
,
MP4_ReadBox_gnre
,
MP4_FreeBox_Common
},
{
ATOM_trkn
,
MP4_ReadBox_trkn
,
MP4_FreeBox_Common
},
{
ATOM_iods
,
MP4_ReadBox_iods
,
MP4_FreeBox_Common
},
{
ATOM_pasp
,
MP4_ReadBox_pasp
,
MP4_FreeBox_Common
},
/* Nothing to do with this box */
{
ATOM_mdat
,
MP4_ReadBoxSkip
,
MP4_FreeBox_Common
},
...
...
modules/demux/mp4/libmp4.h
View file @
6b49065d
...
...
@@ -80,6 +80,7 @@
#define ATOM_trun VLC_FOURCC( 't', 'r', 'u', 'n' )
#define ATOM_cprt VLC_FOURCC( 'c', 'p', 'r', 't' )
#define ATOM_iods VLC_FOURCC( 'i', 'o', 'd', 's' )
#define ATOM_pasp VLC_FOURCC( 'p', 'a', 's', 'p' )
#define ATOM_nmhd VLC_FOURCC( 'n', 'm', 'h', 'd' )
#define ATOM_mp2v VLC_FOURCC( 'm', 'p', '2', 'v' )
...
...
@@ -981,6 +982,12 @@ typedef struct
}
MP4_Box_data_iods_t
;
typedef
struct
{
uint32_t
i_horizontal_spacing
;
uint32_t
i_vertical_spacing
;
}
MP4_Box_data_pasp_t
;
/*
typedef struct MP4_Box_data__s
{
...
...
@@ -1022,6 +1029,7 @@ typedef union MP4_Box_data_s
MP4_Box_data_gnre_t
*
p_gnre
;
MP4_Box_data_trkn_t
*
p_trkn
;
MP4_Box_data_iods_t
*
p_iods
;
MP4_Box_data_pasp_t
*
p_pasp
;
MP4_Box_data_stsz_t
*
p_stsz
;
MP4_Box_data_stz2_t
*
p_stz2
;
...
...
modules/demux/mp4/mp4.c
View file @
6b49065d
...
...
@@ -1506,6 +1506,7 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
MP4_Box_t
*
p_esds
;
MP4_Box_t
*
p_frma
;
MP4_Box_t
*
p_enda
;
MP4_Box_t
*
p_pasp
;
if
(
pp_es
)
*
pp_es
=
NULL
;
...
...
@@ -1541,6 +1542,8 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
if
(
!
p_enda
)
p_enda
=
MP4_BoxGet
(
p_sample
,
"enda"
);
p_pasp
=
MP4_BoxGet
(
p_sample
,
"pasp"
);
if
(
p_track
->
fmt
.
i_cat
==
AUDIO_ES
&&
(
p_track
->
i_sample_size
==
1
||
p_track
->
i_sample_size
==
2
)
)
{
MP4_Box_data_sample_soun_t
*
p_soun
;
...
...
@@ -1640,6 +1643,12 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
p_track
->
fmt
.
video
.
i_sar_num
=
p_track
->
i_width
*
p_track
->
fmt
.
video
.
i_height
;
p_track
->
fmt
.
video
.
i_sar_den
=
p_track
->
i_height
*
p_track
->
fmt
.
video
.
i_width
;
}
if
(
p_pasp
&&
p_pasp
->
data
.
p_pasp
->
i_horizontal_spacing
>
0
&&
p_pasp
->
data
.
p_pasp
->
i_vertical_spacing
>
0
)
{
p_track
->
fmt
.
video
.
i_sar_num
=
p_pasp
->
data
.
p_pasp
->
i_horizontal_spacing
;
p_track
->
fmt
.
video
.
i_sar_den
=
p_pasp
->
data
.
p_pasp
->
i_vertical_spacing
;
}
/* Support for cropping (eg. in H263 files) */
p_track
->
fmt
.
video
.
i_visible_width
=
p_track
->
fmt
.
video
.
i_width
;
...
...
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