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
b985df92
Commit
b985df92
authored
Jan 28, 2011
by
Steve Lhomme
Committed by
Jean-Baptiste Kempf
Jan 30, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MKV: use the new libebml macros
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
5e67eccf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
33 deletions
+33
-33
modules/demux/mkv/Ebml_parser.cpp
modules/demux/mkv/Ebml_parser.cpp
+2
-2
modules/demux/mkv/Ebml_parser.hpp
modules/demux/mkv/Ebml_parser.hpp
+1
-1
modules/demux/mkv/demux.cpp
modules/demux/mkv/demux.cpp
+5
-5
modules/demux/mkv/matroska_segment_parse.cpp
modules/demux/mkv/matroska_segment_parse.cpp
+25
-25
No files found.
modules/demux/mkv/Ebml_parser.cpp
View file @
b985df92
...
...
@@ -152,7 +152,7 @@ EbmlElement *EbmlParser::Get( void )
if
(
m_el
[
mi_level
]
)
{
m_el
[
mi_level
]
->
SkipData
(
*
m_es
,
m_el
[
mi_level
]
->
Generic
().
Context
);
m_el
[
mi_level
]
->
SkipData
(
*
m_es
,
EBML_CONTEXT
(
m_el
[
mi_level
])
);
if
(
!
mb_keep
)
{
if
(
MKV_IS_ID
(
m_el
[
mi_level
],
KaxBlockVirtual
)
)
...
...
@@ -162,7 +162,7 @@ EbmlElement *EbmlParser::Get( void )
mb_keep
=
false
;
}
m_el
[
mi_level
]
=
m_es
->
FindNextElement
(
m_el
[
mi_level
-
1
]
->
Generic
().
Context
,
i_ulev
,
0xFFFFFFFFL
,
mb_dummy
!=
0
,
1
);
m_el
[
mi_level
]
=
m_es
->
FindNextElement
(
EBML_CONTEXT
(
m_el
[
mi_level
-
1
])
,
i_ulev
,
0xFFFFFFFFL
,
mb_dummy
!=
0
,
1
);
// mi_remain_size[mi_level] = m_el[mi_level]->GetSize();
if
(
i_ulev
>
0
)
{
...
...
modules/demux/mkv/Ebml_parser.hpp
View file @
b985df92
...
...
@@ -67,7 +67,7 @@ class KaxBlockVirtualWorkaround : public KaxBlockVirtual
public:
void
Fix
()
{
if
(
Data
==
DataBlock
)
if
(
GetBuffer
()
==
DataBlock
)
SetBuffer
(
NULL
,
0
);
}
};
...
...
modules/demux/mkv/demux.cpp
View file @
b985df92
...
...
@@ -55,7 +55,7 @@ matroska_stream_c *demux_sys_t::AnalyseAllSegmentsFound( demux_t *p_demux, EbmlS
bool
b_keep_stream
=
false
,
b_keep_segment
;
// verify the EBML Header
p_l0
=
p_estream
->
FindNextID
(
E
bmlHead
::
ClassInfos
,
0xFFFFFFFFL
);
p_l0
=
p_estream
->
FindNextID
(
E
BML_INFO
(
EbmlHead
)
,
0xFFFFFFFFL
);
if
(
p_l0
==
NULL
)
{
msg_Err
(
p_demux
,
"No EBML header found"
);
...
...
@@ -63,7 +63,7 @@ matroska_stream_c *demux_sys_t::AnalyseAllSegmentsFound( demux_t *p_demux, EbmlS
}
// verify we can read this Segment, we only support Matroska version 1 for now
p_l0
->
Read
(
*
p_estream
,
E
bmlHead
::
ClassInfos
.
Context
,
i_upper_lvl
,
p_l0
,
true
);
p_l0
->
Read
(
*
p_estream
,
E
BML_CLASS_CONTEXT
(
EbmlHead
)
,
i_upper_lvl
,
p_l0
,
true
);
EDocType
doc_type
=
GetChild
<
EDocType
>
(
*
static_cast
<
EbmlHead
*>
(
p_l0
));
if
(
std
::
string
(
doc_type
)
!=
"matroska"
&&
std
::
string
(
doc_type
)
!=
"webm"
)
...
...
@@ -83,7 +83,7 @@ matroska_stream_c *demux_sys_t::AnalyseAllSegmentsFound( demux_t *p_demux, EbmlS
// find all segments in this file
p_l0
=
p_estream
->
FindNextID
(
KaxSegment
::
ClassInfos
,
0xFFFFFFFFFLL
);
p_l0
=
p_estream
->
FindNextID
(
EBML_INFO
(
KaxSegment
)
,
0xFFFFFFFFFLL
);
if
(
p_l0
==
NULL
)
{
return
NULL
;
...
...
@@ -110,7 +110,7 @@ matroska_stream_c *demux_sys_t::AnalyseAllSegmentsFound( demux_t *p_demux, EbmlS
// find the families of this segment
KaxInfo
*
p_info
=
static_cast
<
KaxInfo
*>
(
p_l1
);
p_info
->
Read
(
*
p_estream
,
KaxInfo
::
ClassInfos
.
Context
,
i_upper_lvl
,
p_l2
,
true
);
p_info
->
Read
(
*
p_estream
,
EBML_CLASS_CONTEXT
(
KaxInfo
)
,
i_upper_lvl
,
p_l2
,
true
);
for
(
size_t
i
=
0
;
i
<
p_info
->
ListSize
();
i
++
)
{
EbmlElement
*
l
=
(
*
p_info
)[
i
];
...
...
@@ -156,7 +156,7 @@ matroska_stream_c *demux_sys_t::AnalyseAllSegmentsFound( demux_t *p_demux, EbmlS
if
(
p_l0
->
IsFiniteSize
()
)
{
p_l0
->
SkipData
(
*
p_estream
,
KaxMatroska_Context
);
p_l0
=
p_estream
->
FindNextID
(
KaxSegment
::
ClassInfos
,
0xFFFFFFFFL
);
p_l0
=
p_estream
->
FindNextID
(
EBML_INFO
(
KaxSegment
)
,
0xFFFFFFFFL
);
}
else
{
...
...
modules/demux/mkv/matroska_segment_parse.cpp
View file @
b985df92
...
...
@@ -57,7 +57,7 @@ void matroska_segment_c::ParseSeekHead( KaxSeekHead *seekhead )
{
if
(
MKV_IS_ID
(
l
,
KaxSeek
)
)
{
EbmlId
id
=
E
bmlVoid
::
ClassInfos
.
GlobalId
;
EbmlId
id
=
E
BML_ID
(
EbmlVoid
)
;
int64_t
i_pos
=
-
1
;
#ifdef MKV_DEBUG
...
...
@@ -88,40 +88,40 @@ void matroska_segment_c::ParseSeekHead( KaxSeekHead *seekhead )
if
(
i_pos
>=
0
)
{
if
(
id
==
KaxCues
::
ClassInfos
.
GlobalId
)
if
(
id
==
EBML_ID
(
KaxCues
)
)
{
msg_Dbg
(
&
sys
.
demuxer
,
"| - cues at %"
PRId64
,
i_pos
);
LoadSeekHeadItem
(
KaxCues
::
ClassInfos
,
i_pos
);
LoadSeekHeadItem
(
EBML_INFO
(
KaxCues
)
,
i_pos
);
}
else
if
(
id
==
KaxInfo
::
ClassInfos
.
GlobalId
)
else
if
(
id
==
EBML_ID
(
KaxInfo
)
)
{
msg_Dbg
(
&
sys
.
demuxer
,
"| - info at %"
PRId64
,
i_pos
);
LoadSeekHeadItem
(
KaxInfo
::
ClassInfos
,
i_pos
);
LoadSeekHeadItem
(
EBML_INFO
(
KaxInfo
)
,
i_pos
);
}
else
if
(
id
==
KaxChapters
::
ClassInfos
.
GlobalId
)
else
if
(
id
==
EBML_ID
(
KaxChapters
)
)
{
msg_Dbg
(
&
sys
.
demuxer
,
"| - chapters at %"
PRId64
,
i_pos
);
LoadSeekHeadItem
(
KaxChapters
::
ClassInfos
,
i_pos
);
LoadSeekHeadItem
(
EBML_INFO
(
KaxChapters
)
,
i_pos
);
}
else
if
(
id
==
KaxTags
::
ClassInfos
.
GlobalId
)
else
if
(
id
==
EBML_ID
(
KaxTags
)
)
{
msg_Dbg
(
&
sys
.
demuxer
,
"| - tags at %"
PRId64
,
i_pos
);
LoadSeekHeadItem
(
KaxTags
::
ClassInfos
,
i_pos
);
LoadSeekHeadItem
(
EBML_INFO
(
KaxTags
)
,
i_pos
);
}
else
if
(
id
==
KaxSeekHead
::
ClassInfos
.
GlobalId
)
else
if
(
id
==
EBML_ID
(
KaxSeekHead
)
)
{
msg_Dbg
(
&
sys
.
demuxer
,
"| - chained seekhead at %"
PRId64
,
i_pos
);
LoadSeekHeadItem
(
KaxSeekHead
::
ClassInfos
,
i_pos
);
LoadSeekHeadItem
(
EBML_INFO
(
KaxSeekHead
)
,
i_pos
);
}
else
if
(
id
==
KaxTracks
::
ClassInfos
.
GlobalId
)
else
if
(
id
==
EBML_ID
(
KaxTracks
)
)
{
msg_Dbg
(
&
sys
.
demuxer
,
"| - tracks at %"
PRId64
,
i_pos
);
LoadSeekHeadItem
(
KaxTracks
::
ClassInfos
,
i_pos
);
LoadSeekHeadItem
(
EBML_INFO
(
KaxTracks
)
,
i_pos
);
}
else
if
(
id
==
KaxAttachments
::
ClassInfos
.
GlobalId
)
else
if
(
id
==
EBML_ID
(
KaxAttachments
)
)
{
msg_Dbg
(
&
sys
.
demuxer
,
"| - attachments at %"
PRId64
,
i_pos
);
LoadSeekHeadItem
(
KaxAttachments
::
ClassInfos
,
i_pos
);
LoadSeekHeadItem
(
EBML_INFO
(
KaxAttachments
)
,
i_pos
);
}
#ifdef MKV_DEBUG
else
...
...
@@ -439,21 +439,21 @@ void matroska_segment_c::ParseTrackEntry( KaxTrackEntry *m )
}
}
}
// else if(
EbmlId( *l ) == KaxCodecSettings::ClassInfos.GlobalId
) DEPRECATED by matroska
// else if(
MKV_IS_ID( l, KaxCodecSettings)
) DEPRECATED by matroska
// {
// KaxCodecSettings &cset = *(KaxCodecSettings*)l;
// tk->psz_codec_settings = ToUTF8( UTFstring( cset ) );
// msg_Dbg( &sys.demuxer, "| | | + Track Codec Settings=%s", tk->psz_codec_settings );
// }
// else if(
EbmlId( *l ) == KaxCodecInfoURL::ClassInfos.GlobalId
) DEPRECATED by matroska
// else if(
MKV_IS_ID( l, KaxCodecInfoURL)
) DEPRECATED by matroska
// {
// KaxCodecInfoURL &ciurl = *(KaxCodecInfoURL*)l;
// tk->psz_codec_info_url = strdup( string( ciurl ).c_str() );
// msg_Dbg( &sys.demuxer, "| | | + Track Codec Info URL=%s", tk->psz_codec_info_url );
// }
// else if(
EbmlId( *l ) == KaxCodecDownloadURL::ClassInfos.GlobalId
) DEPRECATED by matroska
// else if(
MKV_IS_ID( l, KaxCodecDownloadURL)
) DEPRECATED by matroska
// {
// KaxCodecDownloadURL &cdurl = *(KaxCodecDownloadURL*)l;
...
...
@@ -565,7 +565,7 @@ void matroska_segment_c::ParseTrackEntry( KaxTrackEntry *m )
tk
->
f_fps
=
float
(
vfps
);
msg_Dbg
(
&
sys
.
demuxer
,
" | | | + fps=%f"
,
float
(
vfps
)
);
}
// else if(
EbmlId( *l ) == KaxVideoGamma::ClassInfos.GlobalId
) //DEPRECATED by Matroska
// else if(
MKV_IS_ID( l, KaxVideoGamma)
) //DEPRECATED by Matroska
// {
// KaxVideoGamma &gamma = *(KaxVideoGamma*)l;
...
...
@@ -664,7 +664,7 @@ void matroska_segment_c::ParseTracks( KaxTracks *tracks )
int
i_upper_level
=
0
;
/* Master elements */
tracks
->
Read
(
es
,
tracks
->
Generic
().
Context
,
i_upper_level
,
el
,
true
);
tracks
->
Read
(
es
,
EBML_CONTEXT
(
tracks
)
,
i_upper_level
,
el
,
true
);
for
(
size_t
i
=
0
;
i
<
tracks
->
ListSize
();
i
++
)
{
...
...
@@ -692,7 +692,7 @@ void matroska_segment_c::ParseInfo( KaxInfo *info )
/* Master elements */
m
=
static_cast
<
EbmlMaster
*>
(
info
);
m
->
Read
(
es
,
info
->
Generic
().
Context
,
i_upper_level
,
el
,
true
);
m
->
Read
(
es
,
EBML_CONTEXT
(
info
)
,
i_upper_level
,
el
,
true
);
for
(
size_t
i
=
0
;
i
<
m
->
ListSize
();
i
++
)
{
...
...
@@ -801,7 +801,7 @@ void matroska_segment_c::ParseInfo( KaxInfo *info )
KaxChapterTranslate
*
p_trans
=
static_cast
<
KaxChapterTranslate
*>
(
l
);
chapter_translation_c
*
p_translate
=
new
chapter_translation_c
();
p_trans
->
Read
(
es
,
p_trans
->
Generic
().
Context
,
i_upper_level
,
el
,
true
);
p_trans
->
Read
(
es
,
EBML_CONTEXT
(
p_trans
)
,
i_upper_level
,
el
,
true
);
for
(
size_t
j
=
0
;
j
<
p_trans
->
ListSize
();
j
++
)
{
EbmlElement
*
l
=
(
*
p_trans
)[
j
];
...
...
@@ -966,7 +966,7 @@ void matroska_segment_c::ParseAttachments( KaxAttachments *attachments )
EbmlElement
*
el
;
int
i_upper_level
=
0
;
attachments
->
Read
(
es
,
attachments
->
Generic
().
Context
,
i_upper_level
,
el
,
true
);
attachments
->
Read
(
es
,
EBML_CONTEXT
(
attachments
)
,
i_upper_level
,
el
,
true
);
KaxAttached
*
attachedFile
=
FindChild
<
KaxAttached
>
(
*
attachments
);
...
...
@@ -1010,7 +1010,7 @@ void matroska_segment_c::ParseChapters( KaxChapters *chapters )
mtime_t
i_dur
;
/* Master elements */
chapters
->
Read
(
es
,
chapters
->
Generic
().
Context
,
i_upper_level
,
el
,
true
);
chapters
->
Read
(
es
,
EBML_CONTEXT
(
chapters
)
,
i_upper_level
,
el
,
true
);
for
(
size_t
i
=
0
;
i
<
chapters
->
ListSize
();
i
++
)
{
...
...
@@ -1084,7 +1084,7 @@ void matroska_segment_c::ParseCluster( )
/* Master elements */
m
=
static_cast
<
EbmlMaster
*>
(
cluster
);
m
->
Read
(
es
,
cluster
->
Generic
().
Context
,
i_upper_level
,
el
,
true
);
m
->
Read
(
es
,
EBML_CONTEXT
(
cluster
)
,
i_upper_level
,
el
,
true
);
for
(
unsigned
int
i
=
0
;
i
<
m
->
ListSize
();
i
++
)
{
...
...
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