DASH Media Packaging SDK
|
#include <webvtt_sample_converter.h>
Public Member Functions | |
virtual void | PushCue (const Cue &cue) |
virtual void | Flush () |
virtual size_t | ReadySamplesSize () |
virtual std::shared_ptr < MediaSample > | PopSample () |
According to the spec, when cues overlap, samples must be created.
The example below has 2 WebVTT cues:
00:01:00.000 –> 00:02:00.000
hello
00:01:15.000 –> 00:02:15.000
how are you?
These are added (AddSample()) as 2 samples but must be split into 3 samples and 4 cues ('vttc' boxes).
First sample:
start_time: 00:01:00.000
duration: 15 seconds
cue payload: hello
Second sample:
start_time: 00:01:15.000
duration: 45 seconds
cue payload: hello
cue payload: how are you?
Third sample:
start_time: 00:02:00.000
duration: 15 seconds
cue payload: how are you?
This class buffers the samples that are passed to AddSample() and creates more samples as necessary. Methods are virtual only for mocking, not intended for inheritance.
Definition at line 55 of file webvtt_sample_converter.h.
|
virtual |
Process all the buffered samples. This finalizes the object and further calls to PushSample() may result in an undefined behavior.
Definition at line 174 of file webvtt_sample_converter.cc.
|
virtual |
Returns a MediaSample that is non-overlapping with the previous samples that it has output. The data in the sample is one or more ISO-BMFF boxes for the duration of the sample.
Definition at line 199 of file webvtt_sample_converter.cc.
|
virtual |
Add a webvtt cue.
cue | is a webvtt cue. |
Definition at line 139 of file webvtt_sample_converter.cc.
|
virtual |
Definition at line 195 of file webvtt_sample_converter.cc.