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
4a3faf87
Commit
4a3faf87
authored
Jan 18, 2004
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* mp4: cosmetics.
parent
72550238
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
117 additions
and
172 deletions
+117
-172
modules/demux/mp4/mp4.c
modules/demux/mp4/mp4.c
+109
-96
modules/demux/mp4/mp4.h
modules/demux/mp4/mp4.h
+8
-76
No files found.
modules/demux/mp4/mp4.c
View file @
4a3faf87
This diff is collapsed.
Click to expand it.
modules/demux/mp4/mp4.h
View file @
4a3faf87
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* mp4.h : MP4 file input module for vlc
* mp4.h : MP4 file input module for vlc
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* Copyright (C) 2001 VideoLAN
* $Id: mp4.h,v 1.1
1 2004/01/09 04:37:43 jlj
Exp $
* $Id: mp4.h,v 1.1
2 2004/01/18 18:31:50 fenrir
Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
*
* This program is free software; you can redistribute it and/or modify
* This program is free software; you can redistribute it and/or modify
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
/*****************************************************************************
/*****************************************************************************
* Contain all information about a chunk
* Contain all information about a chunk
*****************************************************************************/
*****************************************************************************/
typedef
struct
chunk_data_mp4_s
typedef
struct
{
{
uint64_t
i_offset
;
/* absolute position of this chunk in the file */
uint64_t
i_offset
;
/* absolute position of this chunk in the file */
uint32_t
i_sample_description_index
;
/* index for SampleEntry to use */
uint32_t
i_sample_description_index
;
/* index for SampleEntry to use */
...
@@ -42,13 +42,13 @@ typedef struct chunk_data_mp4_s
...
@@ -42,13 +42,13 @@ typedef struct chunk_data_mp4_s
/* TODO if needed add pts
/* TODO if needed add pts
but quickly *add* support for edts and seeking */
but quickly *add* support for edts and seeking */
}
chunk_data_mp4
_t
;
}
mp4_chunk
_t
;
/*****************************************************************************
/*****************************************************************************
* Contain all needed information for read all track with vlc
* Contain all needed information for read all track with vlc
*****************************************************************************/
*****************************************************************************/
typedef
struct
track_data_mp4_s
typedef
struct
{
{
int
i_track_ID
;
/* this should be unique */
int
i_track_ID
;
/* this should be unique */
...
@@ -74,7 +74,7 @@ typedef struct track_data_mp4_s
...
@@ -74,7 +74,7 @@ typedef struct track_data_mp4_s
uint32_t
i_chunk_count
;
uint32_t
i_chunk_count
;
uint32_t
i_sample_count
;
uint32_t
i_sample_count
;
chunk_data_mp4
_t
*
chunk
;
/* always defined for each chunk */
mp4_chunk
_t
*
chunk
;
/* always defined for each chunk */
/* sample size, p_sample_size defined only if i_sample_size == 0
/* sample size, p_sample_size defined only if i_sample_size == 0
else i_sample_size is size for all sample */
else i_sample_size is size for all sample */
...
@@ -89,7 +89,7 @@ typedef struct track_data_mp4_s
...
@@ -89,7 +89,7 @@ typedef struct track_data_mp4_s
vlc_bool_t
b_drms
;
vlc_bool_t
b_drms
;
void
*
p_drms
;
void
*
p_drms
;
}
track_data_mp4
_t
;
}
mp4_track
_t
;
/*****************************************************************************
/*****************************************************************************
...
@@ -106,75 +106,7 @@ struct demux_sys_t
...
@@ -106,75 +106,7 @@ struct demux_sys_t
uint64_t
i_timescale
;
/* movie time scale */
uint64_t
i_timescale
;
/* movie time scale */
uint64_t
i_duration
;
/* movie duration */
uint64_t
i_duration
;
/* movie duration */
unsigned
int
i_tracks
;
/* number of tracks */
unsigned
int
i_tracks
;
/* number of tracks */
track_data_mp4
_t
*
track
;
/* array of track */
mp4_track
_t
*
track
;
/* array of track */
};
};
#if 0
static inline uint64_t MP4_GetTrackPos( track_data_mp4_t *p_track )
{
unsigned int i_sample;
uint64_t i_pos;
i_pos = p_track->chunk[p_track->i_chunk].i_offset;
if( p_track->i_sample_size )
{
i_pos += ( p_track->i_sample -
p_track->chunk[p_track->i_chunk].i_sample_first ) *
p_track->i_sample_size;
}
else
{
for( i_sample = p_track->chunk[p_track->i_chunk].i_sample_first;
i_sample < p_track->i_sample; i_sample++ )
{
i_pos += p_track->p_sample_size[i_sample];
}
}
return( i_pos );
}
#endif
/* Return time in s of a track */
static
inline
mtime_t
MP4_GetTrackPTS
(
track_data_mp4_t
*
p_track
)
{
unsigned
int
i_sample
;
unsigned
int
i_index
;
uint64_t
i_dts
;
i_sample
=
p_track
->
i_sample
-
p_track
->
chunk
[
p_track
->
i_chunk
].
i_sample_first
;
i_dts
=
p_track
->
chunk
[
p_track
->
i_chunk
].
i_first_dts
;
i_index
=
0
;
while
(
i_sample
>
0
)
{
if
(
i_sample
>
p_track
->
chunk
[
p_track
->
i_chunk
].
p_sample_count_dts
[
i_index
]
)
{
i_dts
+=
p_track
->
chunk
[
p_track
->
i_chunk
].
p_sample_count_dts
[
i_index
]
*
p_track
->
chunk
[
p_track
->
i_chunk
].
p_sample_delta_dts
[
i_index
];
i_sample
-=
p_track
->
chunk
[
p_track
->
i_chunk
].
p_sample_count_dts
[
i_index
];
i_index
++
;
}
else
{
i_dts
+=
i_sample
*
p_track
->
chunk
[
p_track
->
i_chunk
].
p_sample_delta_dts
[
i_index
];
i_sample
=
0
;
break
;
}
}
return
(
(
mtime_t
)(
(
mtime_t
)
1000000
*
(
mtime_t
)
i_dts
/
(
mtime_t
)
p_track
->
i_timescale
)
);
}
static
inline
mtime_t
MP4_GetMoviePTS
(
demux_sys_t
*
p_demux
)
{
return
(
(
mtime_t
)(
(
mtime_t
)
1000000
*
(
mtime_t
)
p_demux
->
i_time
/
(
mtime_t
)
p_demux
->
i_timescale
)
);
}
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