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
0e9356ef
Commit
0e9356ef
authored
Sep 23, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: adaptative: add streamoutput recycling
parent
de283d70
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
48 additions
and
19 deletions
+48
-19
modules/demux/adaptative/plumbing/StreamOutput.cpp
modules/demux/adaptative/plumbing/StreamOutput.cpp
+16
-4
modules/demux/adaptative/plumbing/StreamOutput.hpp
modules/demux/adaptative/plumbing/StreamOutput.hpp
+4
-2
modules/demux/dash/DASHManager.cpp
modules/demux/dash/DASHManager.cpp
+11
-4
modules/demux/dash/DASHManager.h
modules/demux/dash/DASHManager.h
+1
-1
modules/demux/hls/HLSStreams.cpp
modules/demux/hls/HLSStreams.cpp
+12
-6
modules/demux/hls/HLSStreams.hpp
modules/demux/hls/HLSStreams.hpp
+4
-2
No files found.
modules/demux/adaptative/plumbing/StreamOutput.cpp
View file @
0e9356ef
...
...
@@ -48,7 +48,8 @@ AbstractStreamOutput::~AbstractStreamOutput()
{
}
BaseStreamOutput
::
BaseStreamOutput
(
demux_t
*
demux
,
const
StreamFormat
&
format
,
const
std
::
string
&
name
)
:
BaseStreamOutput
::
BaseStreamOutput
(
demux_t
*
demux
,
const
StreamFormat
&
format
,
const
std
::
string
&
name
,
AbstractStreamOutput
*
recycled
)
:
AbstractStreamOutput
(
demux
,
format
)
{
this
->
name
=
name
;
...
...
@@ -57,7 +58,18 @@ BaseStreamOutput::BaseStreamOutput(demux_t *demux, const StreamFormat &format, c
CommandsFactory
*
factory
=
new
CommandsFactory
();
/* Try to recycle compatible output if any */
BaseStreamOutput
*
my_recycled
=
dynamic_cast
<
BaseStreamOutput
*>
(
recycled
);
if
(
my_recycled
)
{
fakeesout
=
my_recycled
->
fakeesout
;
my_recycled
->
fakeesout
=
NULL
;
}
else
{
fakeesout
=
new
(
std
::
nothrow
)
FakeESOut
(
realdemux
->
out
,
factory
);
}
if
(
!
fakeesout
)
{
delete
factory
;
...
...
@@ -75,6 +87,7 @@ BaseStreamOutput::~BaseStreamOutput()
if
(
demuxstream
)
stream_Delete
(
demuxstream
);
if
(
fakeesout
)
delete
fakeesout
;
}
...
...
@@ -163,4 +176,3 @@ void BaseStreamOutput::fillExtraFMTInfo( es_format_t *p_fmt ) const
if
(
!
p_fmt
->
psz_description
&&
!
description
.
empty
())
p_fmt
->
psz_description
=
strdup
(
description
.
c_str
());
}
modules/demux/adaptative/plumbing/StreamOutput.hpp
View file @
0e9356ef
...
...
@@ -67,7 +67,8 @@ namespace adaptative
{
public:
virtual
~
AbstractStreamOutputFactory
()
{}
virtual
AbstractStreamOutput
*
create
(
demux_t
*
,
const
StreamFormat
&
)
const
=
0
;
virtual
AbstractStreamOutput
*
create
(
demux_t
*
,
const
StreamFormat
&
,
AbstractStreamOutput
*
=
NULL
)
const
=
0
;
};
class
BaseStreamOutput
:
public
AbstractStreamOutput
,
...
...
@@ -76,7 +77,8 @@ namespace adaptative
friend
class
BaseStreamOutputEsOutControlPCRCommand
;
public:
BaseStreamOutput
(
demux_t
*
,
const
StreamFormat
&
,
const
std
::
string
&
);
BaseStreamOutput
(
demux_t
*
,
const
StreamFormat
&
,
const
std
::
string
&
,
AbstractStreamOutput
*
=
NULL
);
virtual
~
BaseStreamOutput
();
virtual
void
pushBlock
(
block_t
*
,
bool
);
/* reimpl */
virtual
mtime_t
getPCR
()
const
;
/* reimpl */
...
...
modules/demux/dash/DASHManager.cpp
View file @
0e9356ef
...
...
@@ -48,18 +48,25 @@ using namespace dash::mpd;
using
namespace
adaptative
::
logic
;
AbstractStreamOutput
*
DASHStreamOutputFactory
::
create
(
demux_t
*
demux
,
const
StreamFormat
&
format
)
const
AbstractStreamOutput
*
DASHStreamOutputFactory
::
create
(
demux_t
*
demux
,
const
StreamFormat
&
format
,
AbstractStreamOutput
*
recycled
)
const
{
AbstractStreamOutput
*
ret
=
NULL
;
unsigned
fmt
=
format
;
switch
(
fmt
)
{
case
DASHStreamFormat
:
:
MP4
:
return
new
BaseStreamOutput
(
demux
,
format
,
"mp4"
);
ret
=
new
BaseStreamOutput
(
demux
,
format
,
"mp4"
,
recycled
);
break
;
case
DASHStreamFormat
:
:
MPEG2TS
:
return
new
BaseStreamOutput
(
demux
,
format
,
"ts"
);
ret
=
new
BaseStreamOutput
(
demux
,
format
,
"ts"
,
recycled
);
break
;
}
return
NULL
;
delete
recycled
;
return
ret
;
}
DASHManager
::
DASHManager
(
demux_t
*
demux_
,
MPD
*
mpd
,
...
...
modules/demux/dash/DASHManager.h
View file @
0e9356ef
...
...
@@ -37,7 +37,7 @@ namespace dash
class
DASHStreamOutputFactory
:
public
AbstractStreamOutputFactory
{
public:
virtual
AbstractStreamOutput
*
create
(
demux_t
*
,
const
StreamFormat
&
)
const
;
virtual
AbstractStreamOutput
*
create
(
demux_t
*
,
const
StreamFormat
&
,
AbstractStreamOutput
*
=
NULL
)
const
;
};
class
DASHManager
:
public
PlaylistManager
...
...
modules/demux/hls/HLSStreams.cpp
View file @
0e9356ef
...
...
@@ -23,28 +23,34 @@
using
namespace
hls
;
AbstractStreamOutput
*
HLSStreamOutputFactory
::
create
(
demux_t
*
demux
,
const
StreamFormat
&
format
)
const
AbstractStreamOutput
*
HLSStreamOutputFactory
::
create
(
demux_t
*
demux
,
const
StreamFormat
&
format
,
AbstractStreamOutput
*
recycled
)
const
{
AbstractStreamOutput
*
ret
=
NULL
;
unsigned
fmt
=
format
;
switch
(
fmt
)
{
case
HLSStreamFormat
:
:
PACKEDAAC
:
ret
urn
new
HLSPackedStreamOutput
(
demux
,
format
,
"any"
);
ret
=
new
HLSPackedStreamOutput
(
demux
,
format
,
"any"
,
recycled
);
break
;
case
HLSStreamFormat
:
:
UNKNOWN
:
case
HLSStreamFormat
:
:
MPEG2TS
:
ret
urn
new
BaseStreamOutput
(
demux
,
format
,
"ts"
);
ret
=
new
BaseStreamOutput
(
demux
,
format
,
"ts"
,
recycled
);
case
HLSStreamFormat
:
:
UNSUPPORTED
:
default:
break
;
}
return
NULL
;
delete
recycled
;
return
ret
;
}
HLSPackedStreamOutput
::
HLSPackedStreamOutput
(
demux_t
*
demux
,
const
StreamFormat
&
format
,
const
std
::
string
&
name
)
:
BaseStreamOutput
(
demux
,
format
,
name
)
HLSPackedStreamOutput
::
HLSPackedStreamOutput
(
demux_t
*
demux
,
const
StreamFormat
&
format
,
const
std
::
string
&
name
,
AbstractStreamOutput
*
recycled
)
:
BaseStreamOutput
(
demux
,
format
,
name
,
recycled
)
{
b_timestamps_offset_set
=
false
;
}
...
...
modules/demux/hls/HLSStreams.hpp
View file @
0e9356ef
...
...
@@ -33,13 +33,15 @@ namespace hls
class
HLSStreamOutputFactory
:
public
AbstractStreamOutputFactory
{
public:
virtual
AbstractStreamOutput
*
create
(
demux_t
*
,
const
StreamFormat
&
)
const
;
virtual
AbstractStreamOutput
*
create
(
demux_t
*
,
const
StreamFormat
&
,
AbstractStreamOutput
*
=
NULL
)
const
;
};
class
HLSPackedStreamOutput
:
public
BaseStreamOutput
{
public:
HLSPackedStreamOutput
(
demux_t
*
,
const
StreamFormat
&
,
const
std
::
string
&
);
HLSPackedStreamOutput
(
demux_t
*
,
const
StreamFormat
&
,
const
std
::
string
&
,
AbstractStreamOutput
*
=
NULL
);
virtual
void
pushBlock
(
block_t
*
,
bool
);
/* reimpl */
virtual
void
setPosition
(
mtime_t
);
/* reimpl */
...
...
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