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
9875cd9a
Commit
9875cd9a
authored
Jul 15, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: hls: handle packed audio ID3 time offset
parent
d5ddecc8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
127 additions
and
24 deletions
+127
-24
modules/demux/Makefile.am
modules/demux/Makefile.am
+2
-0
modules/demux/hls/HLSManager.cpp
modules/demux/hls/HLSManager.cpp
+0
-18
modules/demux/hls/HLSManager.hpp
modules/demux/hls/HLSManager.hpp
+0
-6
modules/demux/hls/HLSStreams.cpp
modules/demux/hls/HLSStreams.cpp
+77
-0
modules/demux/hls/HLSStreams.hpp
modules/demux/hls/HLSStreams.hpp
+47
-0
modules/demux/hls/hls.cpp
modules/demux/hls/hls.cpp
+1
-0
No files found.
modules/demux/Makefile.am
View file @
9875cd9a
...
@@ -374,6 +374,8 @@ libhls_plugin_la_SOURCES = \
...
@@ -374,6 +374,8 @@ libhls_plugin_la_SOURCES = \
demux/hls/HLSManager.hpp
\
demux/hls/HLSManager.hpp
\
demux/hls/HLSManager.cpp
\
demux/hls/HLSManager.cpp
\
demux/hls/HLSStreamFormat.hpp
\
demux/hls/HLSStreamFormat.hpp
\
demux/hls/HLSStreams.hpp
\
demux/hls/HLSStreams.cpp
\
demux/hls/hls.cpp
\
demux/hls/hls.cpp
\
demux/hls/hls.hpp
demux/hls/hls.hpp
...
...
modules/demux/hls/HLSManager.cpp
View file @
9875cd9a
...
@@ -23,7 +23,6 @@
...
@@ -23,7 +23,6 @@
#endif
#endif
#include "HLSManager.hpp"
#include "HLSManager.hpp"
#include "HLSStreamFormat.hpp"
#include "../adaptative/logic/RateBasedAdaptationLogic.h"
#include "../adaptative/logic/RateBasedAdaptationLogic.h"
#include "../adaptative/tools/Retrieve.hpp"
#include "../adaptative/tools/Retrieve.hpp"
#include "playlist/Parser.hpp"
#include "playlist/Parser.hpp"
...
@@ -35,23 +34,6 @@ using namespace adaptative::logic;
...
@@ -35,23 +34,6 @@ using namespace adaptative::logic;
using
namespace
hls
;
using
namespace
hls
;
using
namespace
hls
::
playlist
;
using
namespace
hls
::
playlist
;
AbstractStreamOutput
*
HLSStreamOutputFactory
::
create
(
demux_t
*
demux
,
const
StreamFormat
&
format
)
const
{
unsigned
fmt
=
format
;
switch
(
fmt
)
{
case
HLSStreamFormat
:
:
PACKEDAAC
:
return
new
BaseStreamOutput
(
demux
,
format
,
"any"
);
break
;
default:
case
HLSStreamFormat
:
:
UNKNOWN
:
case
HLSStreamFormat
:
:
MPEG2TS
:
return
new
BaseStreamOutput
(
demux
,
format
,
"ts"
);
}
return
NULL
;
}
HLSManager
::
HLSManager
(
M3U8
*
playlist
,
HLSManager
::
HLSManager
(
M3U8
*
playlist
,
AbstractStreamOutputFactory
*
factory
,
AbstractStreamOutputFactory
*
factory
,
AbstractAdaptationLogic
::
LogicType
type
,
stream_t
*
stream
)
:
AbstractAdaptationLogic
::
LogicType
type
,
stream_t
*
stream
)
:
...
...
modules/demux/hls/HLSManager.hpp
View file @
9875cd9a
...
@@ -28,12 +28,6 @@ namespace hls
...
@@ -28,12 +28,6 @@ namespace hls
{
{
using
namespace
adaptative
;
using
namespace
adaptative
;
class
HLSStreamOutputFactory
:
public
AbstractStreamOutputFactory
{
public:
virtual
AbstractStreamOutput
*
create
(
demux_t
*
,
const
StreamFormat
&
)
const
;
};
class
HLSManager
:
public
PlaylistManager
class
HLSManager
:
public
PlaylistManager
{
{
public:
public:
...
...
modules/demux/hls/HLSStreams.cpp
0 → 100644
View file @
9875cd9a
/*
* HLSStreams.cpp
*****************************************************************************
* Copyright (C) 2015 - 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 "HLSStreams.hpp"
#include "HLSStreamFormat.hpp"
#include <vlc_demux.h>
using
namespace
hls
;
AbstractStreamOutput
*
HLSStreamOutputFactory
::
create
(
demux_t
*
demux
,
const
StreamFormat
&
format
)
const
{
unsigned
fmt
=
format
;
switch
(
fmt
)
{
case
HLSStreamFormat
:
:
PACKEDAAC
:
return
new
HLSPackedStreamOutput
(
demux
,
format
,
"any"
);
break
;
default:
case
HLSStreamFormat
:
:
UNKNOWN
:
case
HLSStreamFormat
:
:
MPEG2TS
:
return
new
BaseStreamOutput
(
demux
,
format
,
"ts"
);
}
return
NULL
;
}
HLSPackedStreamOutput
::
HLSPackedStreamOutput
(
demux_t
*
demux
,
const
StreamFormat
&
format
,
const
std
::
string
&
name
)
:
BaseStreamOutput
(
demux
,
format
,
name
)
{
}
void
HLSPackedStreamOutput
::
pushBlock
(
block_t
*
p_block
,
bool
b_first
)
{
if
(
b_first
&&
p_block
&&
p_block
->
i_buffer
>=
10
&&
!
memcmp
(
p_block
->
p_buffer
,
"ID3"
,
3
))
{
uint32_t
size
=
GetDWBE
(
&
p_block
->
p_buffer
[
6
])
+
10
;
size
=
__MIN
(
p_block
->
i_buffer
,
size
);
if
(
size
>=
73
&&
timestamps_offset
==
VLC_TS_INVALID
)
{
if
(
!
memcmp
(
&
p_block
->
p_buffer
[
10
],
"PRIV"
,
4
)
&&
!
memcmp
(
&
p_block
->
p_buffer
[
20
],
"com.apple.streaming.transportStreamTimestamp"
,
45
))
{
setTimestampOffset
(
GetQWBE
(
&
p_block
->
p_buffer
[
65
])
*
100
/
9
);
}
}
/* Skip ID3 for demuxer */
p_block
->
p_buffer
+=
size
;
p_block
->
i_buffer
-=
size
;
}
BaseStreamOutput
::
pushBlock
(
p_block
,
b_first
);
}
void
HLSPackedStreamOutput
::
setPosition
(
mtime_t
nztime
)
{
BaseStreamOutput
::
setPosition
(
nztime
);
/* Should be correct, has a restarted demux shouldn't have been fed with data yet */
setTimestampOffset
(
VLC_TS_INVALID
-
VLC_TS_0
);
}
modules/demux/hls/HLSStreams.hpp
0 → 100644
View file @
9875cd9a
/*
* HLSStreams.hpp
*****************************************************************************
* Copyright (C) 2015 - 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 HLSSTREAM_HPP
#define HLSSTREAM_HPP
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "../adaptative/Streams.hpp"
namespace
hls
{
using
namespace
adaptative
;
class
HLSStreamOutputFactory
:
public
AbstractStreamOutputFactory
{
public:
virtual
AbstractStreamOutput
*
create
(
demux_t
*
,
const
StreamFormat
&
)
const
;
};
class
HLSPackedStreamOutput
:
public
BaseStreamOutput
{
public:
HLSPackedStreamOutput
(
demux_t
*
,
const
StreamFormat
&
,
const
std
::
string
&
);
virtual
void
pushBlock
(
block_t
*
,
bool
);
/* reimpl */
virtual
void
setPosition
(
mtime_t
);
/* reimpl */
};
}
#endif // HLSSTREAMS_HPP
modules/demux/hls/hls.cpp
View file @
9875cd9a
...
@@ -37,6 +37,7 @@
...
@@ -37,6 +37,7 @@
#include "../adaptative/logic/AbstractAdaptationLogic.h"
#include "../adaptative/logic/AbstractAdaptationLogic.h"
#include "HLSManager.hpp"
#include "HLSManager.hpp"
#include "HLSStreams.hpp"
#include "playlist/Parser.hpp"
#include "playlist/Parser.hpp"
#include "playlist/M3U8.hpp"
#include "playlist/M3U8.hpp"
...
...
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