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
0e2b401c
Commit
0e2b401c
authored
Feb 11, 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 downloader and bitrate to chunk
Signed-off-by:
Hugo Beauzée-Luyssen
<
beauze.h@gmail.com
>
parent
152916ce
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
182 additions
and
0 deletions
+182
-0
modules/stream_filter/dash/DASHDownloader.cpp
modules/stream_filter/dash/DASHDownloader.cpp
+108
-0
modules/stream_filter/dash/DASHDownloader.h
modules/stream_filter/dash/DASHDownloader.h
+61
-0
modules/stream_filter/dash/Modules.am
modules/stream_filter/dash/Modules.am
+2
-0
modules/stream_filter/dash/http/Chunk.cpp
modules/stream_filter/dash/http/Chunk.cpp
+8
-0
modules/stream_filter/dash/http/Chunk.h
modules/stream_filter/dash/http/Chunk.h
+3
-0
No files found.
modules/stream_filter/dash/DASHDownloader.cpp
0 → 100644
View file @
0e2b401c
/*
* DASHDownloader.h
*****************************************************************************
* Copyright (C) 2010 - 2011 Klagenfurt University
*
* Created on: Aug 10, 2010
* Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
* Christian Timmerer <christian.timmerer@itec.uni-klu.ac.at>
*
* 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 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.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "DASHDownloader.h"
using
namespace
dash
;
using
namespace
dash
::
http
;
using
namespace
dash
::
logic
;
using
namespace
dash
::
exception
;
using
namespace
dash
::
buffer
;
DASHDownloader
::
DASHDownloader
(
HTTPConnectionManager
*
conManager
,
IAdaptationLogic
*
adaptationLogic
,
BlockBuffer
*
buffer
)
{
this
->
t_sys
=
(
thread_sys_t
*
)
malloc
(
sizeof
(
thread_sys_t
));
this
->
t_sys
->
conManager
=
conManager
;
this
->
t_sys
->
adaptationLogic
=
adaptationLogic
;
this
->
t_sys
->
buffer
=
buffer
;
}
DASHDownloader
::~
DASHDownloader
()
{
std
::
cout
<<
"Downloader set eof"
<<
std
::
endl
;
this
->
t_sys
->
buffer
->
setEOF
(
true
);
std
::
cout
<<
"Downloader try to join"
<<
std
::
endl
;
vlc_join
(
this
->
dashDLThread
,
NULL
);
free
(
this
->
t_sys
);
std
::
cout
<<
"Downloader thread joined tsys freed"
<<
std
::
endl
;
}
bool
DASHDownloader
::
start
()
{
if
(
vlc_clone
(
&
(
this
->
dashDLThread
),
download
,
(
void
*
)
this
->
t_sys
,
VLC_THREAD_PRIORITY_LOW
))
return
false
;
return
true
;
}
void
*
DASHDownloader
::
download
(
void
*
thread_sys
)
{
thread_sys_t
*
t_sys
=
(
thread_sys_t
*
)
thread_sys
;
HTTPConnectionManager
*
conManager
=
t_sys
->
conManager
;
IAdaptationLogic
*
adaptationLogic
=
t_sys
->
adaptationLogic
;
BlockBuffer
*
buffer
=
t_sys
->
buffer
;
Chunk
*
currentChunk
=
NULL
;
block_t
*
block
=
block_Alloc
(
BLOCKSIZE
);
do
{
if
(
currentChunk
==
NULL
)
{
try
{
currentChunk
=
adaptationLogic
->
getNextChunk
();
}
catch
(
EOFException
&
e
)
{
buffer
->
setEOF
(
true
);
}
}
else
{
int
ret
=
conManager
->
read
(
currentChunk
,
block
->
p_buffer
,
block
->
i_buffer
);
if
(
ret
<=
0
)
{
currentChunk
=
NULL
;
}
else
{
block_t
*
bufBlock
=
block_Alloc
(
ret
);
memcpy
(
bufBlock
->
p_buffer
,
block
->
p_buffer
,
ret
);
bufBlock
->
i_length
=
(
mtime_t
)((
ret
*
8
)
/
((
float
)
currentChunk
->
getBitrate
()
/
1000000
));
std
::
cout
<<
"Put block into buffer MilliSeconds: "
<<
bufBlock
->
i_length
<<
" Bytes: "
<<
bufBlock
->
i_buffer
<<
" Bitrate: "
<<
currentChunk
->
getBitrate
()
<<
std
::
endl
;
buffer
->
put
(
bufBlock
);
}
}
}
while
(
!
buffer
->
getEOF
());
std
::
cout
<<
"Downloader end: "
<<
std
::
endl
;
block_Release
(
block
);
return
NULL
;
}
modules/stream_filter/dash/DASHDownloader.h
0 → 100644
View file @
0e2b401c
/*
* DASHDownloader.h
*****************************************************************************
* Copyright (C) 2010 - 2011 Klagenfurt University
*
* Created on: Aug 10, 2010
* Authors: Christopher Mueller <christopher.mueller@itec.uni-klu.ac.at>
* Christian Timmerer <christian.timmerer@itec.uni-klu.ac.at>
*
* 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 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 DASHDOWNLOADER_H_
#define DASHDOWNLOADER_H_
#include "http/HTTPConnectionManager.h"
#include "adaptationlogic/IAdaptationLogic.h"
#include "exceptions/EOFException.h"
#include "buffer/BlockBuffer.h"
#define BLOCKSIZE 32768
#include <iostream>
namespace
dash
{
struct
thread_sys_t
{
dash
::
http
::
HTTPConnectionManager
*
conManager
;
logic
::
IAdaptationLogic
*
adaptationLogic
;
buffer
::
BlockBuffer
*
buffer
;
};
class
DASHDownloader
{
public:
DASHDownloader
(
http
::
HTTPConnectionManager
*
conManager
,
logic
::
IAdaptationLogic
*
adaptationLogic
,
buffer
::
BlockBuffer
*
buffer
);
virtual
~
DASHDownloader
();
bool
start
();
static
void
*
download
(
void
*
);
private:
thread_sys_t
*
t_sys
;
vlc_thread_t
dashDLThread
;
};
}
#endif
/* DASHDOWNLOADER_H_ */
modules/stream_filter/dash/Modules.am
View file @
0e2b401c
...
@@ -76,6 +76,8 @@ SOURCES_stream_filter_dash = \
...
@@ -76,6 +76,8 @@ SOURCES_stream_filter_dash = \
xml/Node.cpp \
xml/Node.cpp \
xml/Node.h \
xml/Node.h \
dash.cpp \
dash.cpp \
DASHDownloader.cpp \
DASHDownloader.h \
DASHManager.cpp \
DASHManager.cpp \
DASHManager.h \
DASHManager.h \
$(NULL)
$(NULL)
...
...
modules/stream_filter/dash/http/Chunk.cpp
View file @
0e2b401c
...
@@ -72,3 +72,11 @@ void Chunk::setUseByteRange (bool value)
...
@@ -72,3 +72,11 @@ void Chunk::setUseByteRange (bool value)
{
{
this
->
hasByteRange
=
value
;
this
->
hasByteRange
=
value
;
}
}
void
Chunk
::
setBitrate
(
int
bitrate
)
{
this
->
bitrate
=
bitrate
;
}
int
Chunk
::
getBitrate
()
{
return
this
->
bitrate
;
}
modules/stream_filter/dash/http/Chunk.h
View file @
0e2b401c
...
@@ -46,6 +46,8 @@ namespace dash
...
@@ -46,6 +46,8 @@ namespace dash
void
addOptionalUrl
(
const
std
::
string
&
url
);
void
addOptionalUrl
(
const
std
::
string
&
url
);
bool
useByteRange
();
bool
useByteRange
();
void
setUseByteRange
(
bool
value
);
void
setUseByteRange
(
bool
value
);
void
setBitrate
(
int
bitrate
);
int
getBitrate
();
private:
private:
std
::
string
url
;
std
::
string
url
;
...
@@ -53,6 +55,7 @@ namespace dash
...
@@ -53,6 +55,7 @@ namespace dash
int
startByte
;
int
startByte
;
int
endByte
;
int
endByte
;
bool
hasByteRange
;
bool
hasByteRange
;
int
bitrate
;
};
};
}
}
...
...
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