Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
b6140023
Commit
b6140023
authored
Feb 14, 2012
by
Christopher Mueller
Committed by
Hugo Beauzée-Luyssen
Feb 14, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dash: added buffer and downloader to manager
Signed-off-by:
Hugo Beauzée-Luyssen
<
beauze.h@gmail.com
>
parent
2ef51274
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
45 deletions
+28
-45
modules/stream_filter/dash/DASHManager.cpp
modules/stream_filter/dash/DASHManager.cpp
+19
-42
modules/stream_filter/dash/DASHManager.h
modules/stream_filter/dash/DASHManager.h
+9
-3
No files found.
modules/stream_filter/dash/DASHManager.cpp
View file @
b6140023
...
...
@@ -32,17 +32,18 @@ using namespace dash::http;
using
namespace
dash
::
xml
;
using
namespace
dash
::
logic
;
using
namespace
dash
::
mpd
;
using
namespace
dash
::
buffer
;
using
namespace
dash
::
exception
;
DASHManager
::
DASHManager
(
HTTPConnectionManager
*
conManager
,
MPD
*
mpd
,
IAdaptationLogic
::
LogicType
type
,
stream_t
*
stream
)
:
conManager
(
conManager
),
currentChunk
(
NULL
),
adaptationLogic
(
NULL
),
logicType
(
type
),
mpdManager
(
NULL
),
mpd
(
mpd
),
stream
(
stream
)
conManager
(
conManager
),
currentChunk
(
NULL
),
adaptationLogic
(
NULL
),
logicType
(
type
),
mpdManager
(
NULL
),
mpd
(
mpd
),
stream
(
stream
)
{
this
->
mpdManager
=
mpd
::
MPDManagerFactory
::
create
(
mpd
);
if
(
this
->
mpdManager
==
NULL
)
...
...
@@ -51,54 +52,30 @@ DASHManager::DASHManager ( HTTPConnectionManager *conManager, MPD *mpd,
if
(
this
->
adaptationLogic
==
NULL
)
return
;
this
->
conManager
->
attach
(
this
->
adaptationLogic
);
this
->
buffer
=
new
BlockBuffer
(
this
->
stream
);
this
->
downloader
=
new
DASHDownloader
(
this
->
conManager
,
this
->
adaptationLogic
,
this
->
buffer
);
}
DASHManager
::~
DASHManager
()
{
delete
this
->
downloader
;
delete
this
->
buffer
;
delete
this
->
adaptationLogic
;
delete
this
->
mpdManager
;
}
bool
DASHManager
::
start
()
{
return
this
->
downloader
->
start
();
}
int
DASHManager
::
read
(
void
*
p_buffer
,
size_t
len
)
{
if
(
this
->
currentChunk
==
NULL
)
{
try
{
this
->
currentChunk
=
this
->
adaptationLogic
->
getNextChunk
();
}
catch
(
EOFException
&
e
)
{
this
->
currentChunk
=
NULL
;
return
0
;
}
}
int
ret
=
this
->
conManager
->
read
(
this
->
currentChunk
,
p_buffer
,
len
);
if
(
ret
==
0
)
{
this
->
currentChunk
=
NULL
;
return
this
->
read
(
p_buffer
,
len
);
}
return
ret
;
return
this
->
buffer
->
get
(
p_buffer
,
len
);
}
int
DASHManager
::
peek
(
const
uint8_t
**
pp_peek
,
size_t
i_peek
)
{
if
(
this
->
currentChunk
==
NULL
)
{
try
{
this
->
currentChunk
=
this
->
adaptationLogic
->
getNextChunk
();
}
catch
(
EOFException
&
e
)
{
return
0
;
}
}
int
ret
=
this
->
conManager
->
peek
(
this
->
currentChunk
,
pp_peek
,
i_peek
);
return
ret
;
return
this
->
buffer
->
peek
(
pp_peek
,
i_peek
);
}
const
mpd
::
IMPDManager
*
DASHManager
::
getMpdManager
()
const
...
...
modules/stream_filter/dash/DASHManager.h
View file @
b6140023
...
...
@@ -31,6 +31,8 @@
#include "adaptationlogic/AdaptationLogicFactory.h"
#include "mpd/IMPDManager.h"
#include "mpd/MPDManagerFactory.h"
#include "buffer/BlockBuffer.h"
#include "DASHDownloader.h"
#include "exceptions/EOFException.h"
#include "mpd/MPD.h"
...
...
@@ -43,9 +45,11 @@ namespace dash
logic
::
IAdaptationLogic
::
LogicType
type
,
stream_t
*
stream
);
virtual
~
DASHManager
();
int
read
(
void
*
p_buffer
,
size_t
len
);
int
peek
(
const
uint8_t
**
pp_peek
,
size_t
i_peek
);
const
mpd
::
IMPDManager
*
getMpdManager
()
const
;
bool
start
();
int
read
(
void
*
p_buffer
,
size_t
len
);
int
peek
(
const
uint8_t
**
pp_peek
,
size_t
i_peek
);
const
mpd
::
IMPDManager
*
getMpdManager
()
const
;
const
logic
::
IAdaptationLogic
*
getAdaptionLogic
()
const
;
const
http
::
Chunk
*
getCurrentChunk
()
const
;
...
...
@@ -57,6 +61,8 @@ namespace dash
mpd
::
IMPDManager
*
mpdManager
;
mpd
::
MPD
*
mpd
;
stream_t
*
stream
;
DASHDownloader
*
downloader
;
buffer
::
BlockBuffer
*
buffer
;
};
}
...
...
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