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
88537655
Commit
88537655
authored
Nov 23, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stream_filter: dash: add MP4 atoms reader
parent
75f7f4f6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
157 additions
and
1 deletion
+157
-1
modules/stream_filter/Makefile.am
modules/stream_filter/Makefile.am
+9
-1
modules/stream_filter/dash/Streams.hpp
modules/stream_filter/dash/Streams.hpp
+10
-0
modules/stream_filter/dash/mp4/AtomsReader.cpp
modules/stream_filter/dash/mp4/AtomsReader.cpp
+84
-0
modules/stream_filter/dash/mp4/AtomsReader.hpp
modules/stream_filter/dash/mp4/AtomsReader.hpp
+52
-0
modules/stream_filter/dash/mpd/Segment.cpp
modules/stream_filter/dash/mpd/Segment.cpp
+2
-0
No files found.
modules/stream_filter/Makefile.am
View file @
88537655
...
...
@@ -84,6 +84,8 @@ libdash_plugin_la_SOURCES = \
stream_filter/dash/mpd/SegmentTimeline.h
\
stream_filter/dash/mpd/TrickModeType.cpp
\
stream_filter/dash/mpd/TrickModeType.h
\
stream_filter/dash/mp4/AtomsReader.cpp
\
stream_filter/dash/mp4/AtomsReader.hpp
\
stream_filter/dash/xml/DOMHelper.cpp
\
stream_filter/dash/xml/DOMHelper.h
\
stream_filter/dash/xml/DOMParser.cpp
\
...
...
@@ -98,8 +100,14 @@ libdash_plugin_la_SOURCES = \
stream_filter/dash/DASHManager.h
\
stream_filter/dash/Helper.cpp
\
stream_filter/dash/Helper.h
libdash_plugin_la_SOURCES
+=
demux/mp4/libmp4.c demux/mp4/libmp4.h
libdash_plugin_la_CXXFLAGS
=
$(AM_CFLAGS)
-I
$(srcdir)
/stream_filter/dash
libdash_plugin_la_LIBADD
=
$(SOCKET_LIBS)
libdash_plugin_la_LIBADD
=
$(SOCKET_LIBS)
$(LIBM)
if
HAVE_ZLIB
libdash_plugin_la_LIBADD
+=
-lz
endif
stream_filter_LTLIBRARIES
+=
libdash_plugin.la
libsmooth_plugin_la_SOURCES
=
\
...
...
modules/stream_filter/dash/Streams.hpp
0 → 100644
View file @
88537655
#ifndef STREAM_HPP
#define STREAM_HPP
class
Stream
{
public:
Stream
();
};
#endif // STREAM_HPP
modules/stream_filter/dash/mp4/AtomsReader.cpp
0 → 100644
View file @
88537655
/*
* AtomsReader.cpp
*****************************************************************************
* Copyright (C) 2014 - VideoLAN authors
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include "AtomsReader.hpp"
#include "mpd/Representation.h"
#include "mpd/MPD.h"
using
namespace
dash
::
mp4
;
using
namespace
dash
::
mpd
;
AtomsReader
::
AtomsReader
(
ISegment
*
segment_
)
{
segment
=
segment_
;
rootbox
=
NULL
;
}
AtomsReader
::~
AtomsReader
()
{
vlc_object_t
*
object
=
segment
->
getRepresentation
()
->
getMPD
()
->
getVLCObject
();
while
(
rootbox
&&
rootbox
->
p_first
)
{
MP4_Box_t
*
p_next
=
rootbox
->
p_first
->
p_next
;
MP4_BoxFree
(
(
stream_t
*
)
object
,
rootbox
->
p_first
);
rootbox
->
p_first
=
p_next
;
}
delete
rootbox
;
}
bool
AtomsReader
::
parseBlock
(
void
*
buffer
,
size_t
size
)
{
if
(
!
segment
->
getRepresentation
())
return
false
;
vlc_object_t
*
object
=
segment
->
getRepresentation
()
->
getMPD
()
->
getVLCObject
();
stream_t
*
stream
=
stream_MemoryNew
(
object
,
(
uint8_t
*
)
buffer
,
size
,
true
);
if
(
stream
)
{
rootbox
=
new
MP4_Box_t
;
if
(
!
rootbox
)
{
stream_Delete
(
stream
);
return
false
;
}
memset
(
rootbox
,
0
,
sizeof
(
*
rootbox
));
rootbox
->
i_type
=
ATOM_root
;
rootbox
->
i_size
=
size
;
if
(
MP4_ReadBoxContainerChildren
(
stream
,
rootbox
,
0
)
==
1
)
{
#ifndef NDEBUG
MP4_BoxDumpStructure
(
stream
,
rootbox
);
#endif
MP4_Box_t
*
sidxbox
=
MP4_BoxGet
(
rootbox
,
"sidx"
);
if
(
sidxbox
)
{
MP4_Box_data_sidx_t
*
sidx
=
sidxbox
->
data
.
p_sidx
;
size_t
offset
=
sidx
->
i_first_offset
;
for
(
uint16_t
i
=
0
;
i
<
sidx
->
i_reference_count
;
i
++
)
{
std
::
cerr
<<
" offset "
<<
offset
<<
std
::
endl
;
offset
+=
sidx
->
p_items
[
i
].
i_referenced_size
;
}
}
std
::
cerr
<<
"index seg "
<<
((
uint8_t
*
)
buffer
)[
4
]
<<
((
uint8_t
*
)
buffer
)[
5
]
<<
std
::
endl
;
}
stream_Delete
(
stream
);
}
return
true
;
}
modules/stream_filter/dash/mp4/AtomsReader.hpp
0 → 100644
View file @
88537655
/*
* AtomsReader.hpp
*****************************************************************************
* Copyright (C) 2014 - VideoLAN authors
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifndef ATOMSREADER_HPP
#define ATOMSREADER_HPP
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "mpd/Segment.h"
#include <vlc_common.h>
#include <vlc_stream.h>
extern
"C"
{
#include "../../demux/mp4/libmp4.h"
}
namespace
dash
{
namespace
mp4
{
class
AtomsReader
{
public:
AtomsReader
(
dash
::
mpd
::
ISegment
*
);
~
AtomsReader
();
bool
parseBlock
(
void
*
,
size_t
);
protected:
dash
::
mpd
::
ISegment
*
segment
;
MP4_Box_t
*
rootbox
;
};
}
}
#endif // ATOMSREADER_HPP
modules/stream_filter/dash/mpd/Segment.cpp
View file @
88537655
...
...
@@ -27,6 +27,8 @@
#include "Segment.h"
#include "Representation.h"
#include "MPD.h"
#include "mp4/AtomsReader.hpp"
#include <cassert>
...
...
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