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
be6bf779
Commit
be6bf779
authored
May 22, 2015
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
demux: adaptative: allow altering block after download
parent
4603cb4a
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
16 additions
and
14 deletions
+16
-14
modules/demux/adaptative/Streams.cpp
modules/demux/adaptative/Streams.cpp
+1
-1
modules/demux/adaptative/http/Chunk.h
modules/demux/adaptative/http/Chunk.h
+3
-1
modules/demux/adaptative/playlist/Segment.cpp
modules/demux/adaptative/playlist/Segment.cpp
+3
-3
modules/demux/adaptative/playlist/Segment.h
modules/demux/adaptative/playlist/Segment.h
+2
-2
modules/demux/dash/mp4/AtomsReader.cpp
modules/demux/dash/mp4/AtomsReader.cpp
+3
-3
modules/demux/dash/mp4/AtomsReader.hpp
modules/demux/dash/mp4/AtomsReader.hpp
+1
-1
modules/demux/dash/mpd/DASHSegment.cpp
modules/demux/dash/mpd/DASHSegment.cpp
+2
-2
modules/demux/dash/mpd/DASHSegment.h
modules/demux/dash/mpd/DASHSegment.h
+1
-1
No files found.
modules/demux/adaptative/Streams.cpp
View file @
be6bf779
...
@@ -221,7 +221,7 @@ size_t Stream::read(HTTPConnectionManager *connManager)
...
@@ -221,7 +221,7 @@ size_t Stream::read(HTTPConnectionManager *connManager)
if
(
chunk
->
getBytesToRead
()
==
0
)
if
(
chunk
->
getBytesToRead
()
==
0
)
{
{
chunk
->
onDownload
(
block
->
p_buffer
,
block
->
i_buffer
);
chunk
->
onDownload
(
&
block
);
chunk
->
getConnection
()
->
releaseChunk
();
chunk
->
getConnection
()
->
releaseChunk
();
currentChunk
=
NULL
;
currentChunk
=
NULL
;
delete
chunk
;
delete
chunk
;
...
...
modules/demux/adaptative/http/Chunk.h
View file @
be6bf779
...
@@ -29,6 +29,8 @@
...
@@ -29,6 +29,8 @@
#include <string>
#include <string>
#include <stdint.h>
#include <stdint.h>
typedef
struct
block_t
block_t
;
namespace
adaptative
namespace
adaptative
{
{
namespace
http
namespace
http
...
@@ -65,7 +67,7 @@ namespace adaptative
...
@@ -65,7 +67,7 @@ namespace adaptative
void
setBitrate
(
uint64_t
bitrate
);
void
setBitrate
(
uint64_t
bitrate
);
int
getBitrate
();
int
getBitrate
();
virtual
void
onDownload
(
void
*
,
size_t
)
{}
virtual
void
onDownload
(
block_t
**
)
{}
private:
private:
std
::
string
url
;
std
::
string
url
;
...
...
modules/demux/adaptative/playlist/Segment.cpp
View file @
be6bf779
...
@@ -49,7 +49,7 @@ Chunk * ISegment::getChunk(const std::string &url)
...
@@ -49,7 +49,7 @@ Chunk * ISegment::getChunk(const std::string &url)
return
new
(
std
::
nothrow
)
SegmentChunk
(
this
,
url
);
return
new
(
std
::
nothrow
)
SegmentChunk
(
this
,
url
);
}
}
void
ISegment
::
onChunkDownload
(
void
*
,
size_t
,
Chunk
*
,
BaseRepresentation
*
)
void
ISegment
::
onChunkDownload
(
block_t
**
,
Chunk
*
,
BaseRepresentation
*
)
{
{
}
}
...
@@ -121,9 +121,9 @@ void ISegment::SegmentChunk::setRepresentation(BaseRepresentation *rep_)
...
@@ -121,9 +121,9 @@ void ISegment::SegmentChunk::setRepresentation(BaseRepresentation *rep_)
rep
=
rep_
;
rep
=
rep_
;
}
}
void
ISegment
::
SegmentChunk
::
onDownload
(
void
*
data
,
size_t
size
)
void
ISegment
::
SegmentChunk
::
onDownload
(
block_t
**
pp_block
)
{
{
segment
->
onChunkDownload
(
data
,
size
,
this
,
rep
);
segment
->
onChunkDownload
(
pp_block
,
this
,
rep
);
}
}
Segment
::
Segment
(
ICanonicalUrl
*
parent
)
:
Segment
::
Segment
(
ICanonicalUrl
*
parent
)
:
...
...
modules/demux/adaptative/playlist/Segment.h
View file @
be6bf779
...
@@ -75,7 +75,7 @@ namespace adaptative
...
@@ -75,7 +75,7 @@ namespace adaptative
public:
public:
SegmentChunk
(
ISegment
*
segment
,
const
std
::
string
&
url
);
SegmentChunk
(
ISegment
*
segment
,
const
std
::
string
&
url
);
void
setRepresentation
(
BaseRepresentation
*
);
void
setRepresentation
(
BaseRepresentation
*
);
virtual
void
onDownload
(
void
*
,
size_t
);
// reimpl
virtual
void
onDownload
(
block_t
**
);
// reimpl
protected:
protected:
ISegment
*
segment
;
ISegment
*
segment
;
...
@@ -83,7 +83,7 @@ namespace adaptative
...
@@ -83,7 +83,7 @@ namespace adaptative
};
};
virtual
Chunk
*
getChunk
(
const
std
::
string
&
);
virtual
Chunk
*
getChunk
(
const
std
::
string
&
);
virtual
void
onChunkDownload
(
void
*
,
size_t
,
Chunk
*
,
BaseRepresentation
*
);
virtual
void
onChunkDownload
(
block_t
**
,
Chunk
*
,
BaseRepresentation
*
);
};
};
class
Segment
:
public
ISegment
class
Segment
:
public
ISegment
...
...
modules/demux/dash/mp4/AtomsReader.cpp
View file @
be6bf779
...
@@ -41,12 +41,12 @@ AtomsReader::~AtomsReader()
...
@@ -41,12 +41,12 @@ AtomsReader::~AtomsReader()
delete
rootbox
;
delete
rootbox
;
}
}
bool
AtomsReader
::
parseBlock
(
void
*
buffer
,
size_t
size
,
BaseRepresentation
*
rep
)
bool
AtomsReader
::
parseBlock
(
block_t
*
p_block
,
BaseRepresentation
*
rep
)
{
{
if
(
!
rep
)
if
(
!
rep
)
return
false
;
return
false
;
stream_t
*
stream
=
stream_MemoryNew
(
object
,
(
uint8_t
*
)
buffer
,
size
,
true
);
stream_t
*
stream
=
stream_MemoryNew
(
object
,
p_block
->
p_buffer
,
p_block
->
i_buffer
,
true
);
if
(
stream
)
if
(
stream
)
{
{
rootbox
=
new
MP4_Box_t
;
rootbox
=
new
MP4_Box_t
;
...
@@ -57,7 +57,7 @@ bool AtomsReader::parseBlock(void *buffer, size_t size, BaseRepresentation *rep)
...
@@ -57,7 +57,7 @@ bool AtomsReader::parseBlock(void *buffer, size_t size, BaseRepresentation *rep)
}
}
memset
(
rootbox
,
0
,
sizeof
(
*
rootbox
));
memset
(
rootbox
,
0
,
sizeof
(
*
rootbox
));
rootbox
->
i_type
=
ATOM_root
;
rootbox
->
i_type
=
ATOM_root
;
rootbox
->
i_size
=
size
;
rootbox
->
i_size
=
p_block
->
i_buffer
;
if
(
MP4_ReadBoxContainerChildren
(
stream
,
rootbox
,
0
)
==
1
)
if
(
MP4_ReadBoxContainerChildren
(
stream
,
rootbox
,
0
)
==
1
)
{
{
#ifndef NDEBUG
#ifndef NDEBUG
...
...
modules/demux/dash/mp4/AtomsReader.hpp
View file @
be6bf779
...
@@ -49,7 +49,7 @@ namespace dash
...
@@ -49,7 +49,7 @@ namespace dash
public:
public:
AtomsReader
(
vlc_object_t
*
);
AtomsReader
(
vlc_object_t
*
);
~
AtomsReader
();
~
AtomsReader
();
bool
parseBlock
(
void
*
,
size_t
,
adaptative
::
playlist
::
BaseRepresentation
*
);
bool
parseBlock
(
block_t
*
,
adaptative
::
playlist
::
BaseRepresentation
*
);
protected:
protected:
vlc_object_t
*
object
;
vlc_object_t
*
object
;
...
...
modules/demux/dash/mpd/DASHSegment.cpp
View file @
be6bf779
...
@@ -49,11 +49,11 @@ Chunk* DashIndexSegment::toChunk(size_t index, BaseRepresentation *ctxrep)
...
@@ -49,11 +49,11 @@ Chunk* DashIndexSegment::toChunk(size_t index, BaseRepresentation *ctxrep)
return
chunk
;
return
chunk
;
}
}
void
DashIndexSegment
::
onChunkDownload
(
void
*
data
,
size_t
size
,
Chunk
*
,
BaseRepresentation
*
rep
)
void
DashIndexSegment
::
onChunkDownload
(
block_t
**
pp_block
,
Chunk
*
,
BaseRepresentation
*
rep
)
{
{
if
(
!
rep
)
if
(
!
rep
)
return
;
return
;
AtomsReader
br
(
rep
->
getPlaylist
()
->
getVLCObject
());
AtomsReader
br
(
rep
->
getPlaylist
()
->
getVLCObject
());
br
.
parseBlock
(
data
,
size
,
rep
);
br
.
parseBlock
(
*
pp_block
,
rep
);
}
}
modules/demux/dash/mpd/DASHSegment.h
View file @
be6bf779
...
@@ -41,7 +41,7 @@ namespace dash
...
@@ -41,7 +41,7 @@ namespace dash
virtual
Chunk
*
toChunk
(
size_t
,
BaseRepresentation
*
=
NULL
);
//reimpl
virtual
Chunk
*
toChunk
(
size_t
,
BaseRepresentation
*
=
NULL
);
//reimpl
protected:
protected:
virtual
void
onChunkDownload
(
void
*
,
size_t
,
Chunk
*
,
BaseRepresentation
*
);
//reimpl
virtual
void
onChunkDownload
(
block_t
**
,
Chunk
*
,
BaseRepresentation
*
);
//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