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
27915e89
Commit
27915e89
authored
Nov 20, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stream_filter: dash: add User-Agent
parent
7b7f4b58
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
8 deletions
+37
-8
modules/stream_filter/Makefile.am
modules/stream_filter/Makefile.am
+1
-0
modules/stream_filter/dash/dash.cpp
modules/stream_filter/dash/dash.cpp
+5
-7
modules/stream_filter/dash/dash.hpp
modules/stream_filter/dash/dash.hpp
+28
-0
modules/stream_filter/dash/http/IHTTPConnection.cpp
modules/stream_filter/dash/http/IHTTPConnection.cpp
+3
-1
No files found.
modules/stream_filter/Makefile.am
View file @
27915e89
...
...
@@ -89,6 +89,7 @@ libdash_plugin_la_SOURCES = \
stream_filter/dash/xml/Node.cpp
\
stream_filter/dash/xml/Node.h
\
stream_filter/dash/dash.cpp
\
stream_filter/dash/dash.hpp
\
stream_filter/dash/DASHDownloader.cpp
\
stream_filter/dash/DASHDownloader.h
\
stream_filter/dash/DASHManager.cpp
\
...
...
modules/stream_filter/dash/dash.cpp
View file @
27915e89
...
...
@@ -38,7 +38,7 @@
#include <errno.h>
#include "
DASHManager.h
"
#include "
dash.hpp
"
#include "xml/DOMParser.h"
#include "mpd/MPDFactory.h"
...
...
@@ -74,12 +74,6 @@ vlc_module_end ()
/*****************************************************************************
* Local prototypes
*****************************************************************************/
struct
stream_sys_t
{
dash
::
DASHManager
*
p_dashManager
;
dash
::
mpd
::
MPD
*
p_mpd
;
uint64_t
position
;
};
static
int
Read
(
stream_t
*
p_stream
,
void
*
p_ptr
,
unsigned
int
i_len
);
static
int
Peek
(
stream_t
*
p_stream
,
const
uint8_t
**
pp_peek
,
unsigned
int
i_peek
);
...
...
@@ -113,6 +107,8 @@ static int Open(vlc_object_t *p_obj)
if
(
unlikely
(
p_sys
==
NULL
))
return
VLC_ENOMEM
;
p_sys
->
psz_useragent
=
var_InheritString
(
p_stream
,
"http-user-agent"
);
p_sys
->
p_mpd
=
mpd
;
dash
::
DASHManager
*
p_dashManager
=
new
dash
::
DASHManager
(
p_sys
->
p_mpd
,
dash
::
logic
::
IAdaptationLogic
::
RateBased
,
...
...
@@ -122,6 +118,7 @@ static int Open(vlc_object_t *p_obj)
{
delete
p_dashManager
;
free
(
p_sys
);
free
(
p_sys
->
psz_useragent
);
return
VLC_EGENERIC
;
}
p_sys
->
p_dashManager
=
p_dashManager
;
...
...
@@ -145,6 +142,7 @@ static void Close(vlc_object_t *p_obj)
dash
::
DASHManager
*
p_dashManager
=
p_sys
->
p_dashManager
;
delete
(
p_dashManager
);
free
(
p_sys
->
psz_useragent
);
free
(
p_sys
);
}
/*****************************************************************************
...
...
modules/stream_filter/dash/dash.hpp
0 → 100644
View file @
27915e89
/*****************************************************************************
* dash.hpp: DASH module
*****************************************************************************
* Copyright © 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 "DASHManager.h"
struct
stream_sys_t
{
dash
::
DASHManager
*
p_dashManager
;
dash
::
mpd
::
MPD
*
p_mpd
;
uint64_t
position
;
char
*
psz_useragent
;
};
modules/stream_filter/dash/http/IHTTPConnection.cpp
View file @
27915e89
...
...
@@ -21,6 +21,7 @@
#include "IHTTPConnection.h"
#include "Chunk.h"
#include "Helper.h"
#include "dash.hpp"
#include <vlc_network.h>
...
...
@@ -63,7 +64,8 @@ std::string IHTTPConnection::getRequestHeader(const Chunk *chunk) const
{
std
::
stringstream
req
;
req
<<
"GET "
<<
chunk
->
getPath
()
<<
" HTTP/1.1
\r\n
"
<<
"Host: "
<<
chunk
->
getHostname
()
<<
"
\r\n
"
;
"Host: "
<<
chunk
->
getHostname
()
<<
"
\r\n
"
<<
"User-Agent: "
<<
std
::
string
(
stream
->
p_sys
->
psz_useragent
)
<<
"
\r\n
"
;
if
(
chunk
->
usesByteRange
())
req
<<
"Range: bytes="
<<
chunk
->
getStartByte
()
<<
"-"
<<
chunk
->
getEndByte
()
<<
"
\r\n
"
;
...
...
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