Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cc-spu-fix
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Leandro Consiglio
cc-spu-fix
Commits
1fdf88d7
Commit
1fdf88d7
authored
6 years ago
by
François Cartegnie
Browse files
Options
Downloads
Patches
Plain Diff
demux: adaptive: expose content-type
parent
7bbd00f2
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/demux/adaptive/http/HTTPConnection.cpp
+18
-0
18 additions, 0 deletions
modules/demux/adaptive/http/HTTPConnection.cpp
modules/demux/adaptive/http/HTTPConnection.hpp
+2
-0
2 additions, 0 deletions
modules/demux/adaptive/http/HTTPConnection.hpp
with
20 additions
and
0 deletions
modules/demux/adaptive/http/HTTPConnection.cpp
+
18
−
0
View file @
1fdf88d7
...
...
@@ -59,6 +59,11 @@ size_t AbstractConnection::getContentLength() const
return
contentLength
;
}
const
std
::
string
&
AbstractConnection
::
getContentType
()
const
{
return
contentType
;
}
HTTPConnection
::
HTTPConnection
(
vlc_object_t
*
p_object_
,
AuthStorage
*
auth
,
Socket
*
socket_
,
const
ConnectionParams
&
proxy
,
bool
persistent
)
:
AbstractConnection
(
p_object_
)
...
...
@@ -123,6 +128,7 @@ void HTTPConnection::disconnect()
chunked
=
false
;
chunkLength
=
0
;
bytesRange
=
BytesRange
();
contentType
=
std
::
string
();
socket
->
disconnect
();
}
...
...
@@ -380,6 +386,10 @@ void HTTPConnection::onHeader(const std::string &key,
{
chunked
=
true
;
}
else
if
(
key
==
"Content-Type"
)
{
contentType
=
value
;
}
else
if
(
key
==
"Location"
)
{
locationparams
=
ConnectionParams
();
...
...
@@ -464,6 +474,7 @@ void StreamUrlConnection::reset()
p_streamurl
=
NULL
;
bytesRead
=
0
;
contentLength
=
0
;
contentType
=
std
::
string
();
bytesRange
=
BytesRange
();
}
...
...
@@ -486,6 +497,13 @@ int StreamUrlConnection::request(const std::string &path, const BytesRange &rang
if
(
!
p_streamurl
)
return
VLC_EGENERIC
;
char
*
psz_type
=
stream_ContentType
(
p_streamurl
);
if
(
psz_type
)
{
contentType
=
std
::
string
(
psz_type
);
free
(
psz_type
);
}
stream_t
*
p_chain
=
vlc_stream_FilterNew
(
p_streamurl
,
"inflate"
);
if
(
p_chain
)
p_streamurl
=
p_chain
;
...
...
This diff is collapsed.
Click to expand it.
modules/demux/adaptive/http/HTTPConnection.hpp
+
2
−
0
View file @
1fdf88d7
...
...
@@ -50,6 +50,7 @@ namespace adaptive
virtual
ssize_t
read
(
void
*
p_buffer
,
size_t
len
)
=
0
;
virtual
size_t
getContentLength
()
const
;
virtual
const
std
::
string
&
getContentType
()
const
;
virtual
void
setUsed
(
bool
)
=
0
;
protected:
...
...
@@ -57,6 +58,7 @@ namespace adaptive
ConnectionParams
params
;
bool
available
;
size_t
contentLength
;
std
::
string
contentType
;
BytesRange
bytesRange
;
size_t
bytesRead
;
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment