Shaka Player Embedded
|
#include <streams.h>
Classes | |
class | Impl |
Public Member Functions | |
StreamBase (bool order_by_dts) | |
~StreamBase () | |
StreamBase (const StreamBase &)=delete | |
StreamBase & | operator= (const StreamBase &)=delete |
StreamBase (StreamBase &&)=delete | |
StreamBase & | operator= (StreamBase &&)=delete |
size_t | CountFramesBetween (double start, double end) const |
std::vector< BufferedRange > | GetBufferedRanges () const |
size_t | EstimateSize () const |
void | Remove (double start, double end) |
void | Clear () |
void | DebugPrint (bool all_frames) const |
Static Public Attributes | |
static constexpr const double | kMaxGapSize = 0.15 |
Protected Member Functions | |
std::shared_ptr< BaseFrame > | GetFrameInternal (double time, FrameLocation kind) const |
void | AddFrameInternal (std::shared_ptr< BaseFrame > frame) |
Defines a base class for a stream containing frames. This represents a stream of frames of a single type (i.e. video-only or audio-only); but this may contain frames from different source streams (i.e. from adaptation). Frames are all within a single timeline and have been reordered/moved according to MSE.
This type is internally thread-safe.
|
explicit |
Creates a new StreamBase that stores frames based on the given ordering. This will order and query frames based on PTS or DTS. So when you ask for a time of N seconds, this will either use PTS or DTS to determine the correct frame. Some methods always use PTS to match requirements of MSE; this means there may be differences between the times used in some methods.
Definition at line 147 of file streams.cc.
shaka::media::StreamBase::~StreamBase | ( | ) |
Definition at line 149 of file streams.cc.
|
delete |
|
delete |
|
protected |
Adds a new frame to the stream. This won't check for compatible streams or for keyframe requirements; it is assumed the caller will only append frames that can be played. For example, the caller may need to discard demuxed frames until they find a keyframe.
If adding a frame with the same start time, this will replace the existing frame; otherwise this will insert based on the start time, even if they overlap.
Definition at line 162 of file streams.cc.
void shaka::media::StreamBase::Clear | ( | ) |
Removes all frames in the stream.
Definition at line 326 of file streams.cc.
size_t shaka::media::StreamBase::CountFramesBetween | ( | double | start, |
double | end | ||
) | const |
start | The exclusive time to start from. |
end | The exclusive time to end at. |
Definition at line 237 of file streams.cc.
void shaka::media::StreamBase::DebugPrint | ( | bool | all_frames | ) | const |
Prints debug info about the stream to stderr.
all_frames | True to print times of all frames; false to only print a summary. |
Definition at line 331 of file streams.cc.
size_t shaka::media::StreamBase::EstimateSize | ( | ) | const |
Estimates the size of the stream by adding up all the stored frames.
Definition at line 151 of file streams.cc.
std::vector< BufferedRange > shaka::media::StreamBase::GetBufferedRanges | ( | ) | const |
Returns the time ranges of the contiguously buffered ranges. Each element contains a start and end time of a range that has contiguous frames in it. Each range should start with a keyframe and will be sorted. This always uses PTS to report the ranges.
Definition at line 225 of file streams.cc.
|
protected |
Gets the frame that is associated with the given time. How this searches for frames depends on the second argument. This may return nullptr if there is no such frame.
time | The time (in seconds) to search for. |
kind | How to search for the frame. |
Definition at line 356 of file streams.cc.
|
delete |
|
delete |
void shaka::media::StreamBase::Remove | ( | double | start, |
double | end | ||
) |
Removes any frames that start in the given range. Since this type returns a shared_ptr to the frames, they will not be destroyed until they are no longer being used by the renderers or the app.
This always uses PTS to determine what frames to remove. This will keep removing past the end until the next keyframe; all DemuxedFrame objects are considered keyframes.
start | The inclusive time to start removing. |
end | The exclusive time to end removing. |
Definition at line 270 of file streams.cc.
|
static |