An interface that describes a class that can render closed captions.
Rendering of closed captions is initiated by a call to Begin(), followed by zero or more calls to the Draw functions, and ends with a call to End(). Implementation may draw as they receive Draw calls, or may wait until the End() call.
Each of the Begin(), Draw and End() receives a reference to a CYIClosedCaptionsAttributes object which indicates what the default style of the closed captions should be. Within a single rendering block, all function calls receive a reference to the same CYIClosedCaptionsAttributes object.
#include <player/YiClosedCaptionsRenderer.h>
Classes | |
struct | Cue |
struct | Span |
Public Member Functions | |
virtual | ~IYIClosedCaptionsRenderer () |
virtual void | Clear ()=0 |
virtual void | Begin ()=0 |
virtual void | End ()=0 |
virtual void | AddCue (const Cue &cue)=0 |
virtual void | RemoveCues (const CYIString &cueText)=0 |
virtual void | OnVideoTimeUpdated (uint64_t videoTimeMs)=0 |
|
strong |
An enum that details how long a cue should be rendered for.
Enumerator | |
---|---|
UntilNextBegin | The cue should be rendered until the next call to Begin(). The cue may also be removed if it has a duration and that duration has elapsed. |
UntilRemoved | The cue should be rendered until manually removed by a call to RemoveCues(). The cue may also be removed if it has a duration and that duration has elapsed. |
|
strong |
An enum that indicates what provided text positions are in reference to.
|
strong |
|
inlinevirtual |
|
pure virtual |
Adds a subtitle cue for rendering.
Implemented in CYIClosedCaptionsDispatcher.
|
pure virtual |
Clears any captions that use the timing mode TIMING_MODE::Lifetime::UntilNextBegin and marks the beginning of a new set of rendering commands.
This should be called before any new cues are added.
Implemented in CYIClosedCaptionsDispatcher.
|
pure virtual |
Clears any displayed closed captions.
Implemented in CYIClosedCaptionsDispatcher.
|
pure virtual |
Marks the end of a set of rendering commands.
This should be called once all of the cues necessary to complete the closed captions presentation have been submitted.
Implemented in CYIClosedCaptionsDispatcher.
|
pure virtual |
Called when the video playback time has been updated. This is used to remove time-based closed captions when they expire.
Implemented in CYIClosedCaptionsDispatcher.
|
pure virtual |
Removes the subtitle cues identified by the text cueText.
Implemented in CYIClosedCaptionsDispatcher.