You.i Engine
CYICastLabsVideoPlayer Class Reference

#include <player/YiCastLabsVideoPlayer.h>

Inheritance diagram for CYICastLabsVideoPlayer:

Public Member Functions

 CYICastLabsVideoPlayer ()
 
virtual ~CYICastLabsVideoPlayer ()
 
void SetMaxResolution (const glm::ivec2 &rMaxResolution)
 
void SetMinimumBufferTime (uint64_t minimumBufferTimeMs)
 
void SetMaximumBufferTime (uint64_t maximumBufferTimeMs)
 
void SetLiveDelayTime (uint64_t liveDelayTimeMs)
 
void SetLoggingEnabled (bool enabled)
 
bool IsLoggingEnabled () const
 
virtual CYIString GetName_ () const override
 
virtual Statistics GetStatistics_ () const override
 
virtual TimedMetadataInterfaceGetTimedMetadataInterface_ () const override
 
virtual VideoRequestHTTPHeadersInterfaceGetVideoRequestHTTPHeadersInterface_ () override
 
- Public Member Functions inherited from CYIAbstractVideoPlayer
virtual ~CYIAbstractVideoPlayer ()
 
CYIString GetName () const
 
CYIString GetVersion () const
 
Statistics GetStatistics () const
 
void Init ()
 
void Prepare (const CYIUrl &videoURI, StreamingFormat formatHint, CYIAbstractVideoPlayer::PlaybackState initialState=CYIAbstractVideoPlayer::PlaybackState::Paused, std::unique_ptr< DRMConfiguration > pDRMConfiguration=nullptr, uint64_t startTimeMs=0)
 
void Prepare (const std::shared_ptr< CYIAssetVideo > &videoAsset, StreamingFormat formatHint, CYIAbstractVideoPlayer::PlaybackState initialState=CYIAbstractVideoPlayer::PlaybackState::Paused, std::unique_ptr< DRMConfiguration > pDRMConfiguration=nullptr, uint64_t startTimeMs=0)
 
void Play ()
 
void Pause ()
 
void Stop ()
 
std::vector< SeekableRangeGetLiveSeekableRanges () const
 
void Seek (uint64_t seekPositionMs)
 
bool SupportsFormat (StreamingFormat streamingFormat, DRMScheme drmScheme=DRMScheme::None)
 
uint64_t GetDurationMs () const
 
uint64_t GetCurrentTimeMs () const
 
CYIAbstractVideoPlayer::PlayerState GetPlayerState () const
 
void SetClosedCaptionsEnabled (bool enabled)
 
bool AreClosedCaptionsTracksAvailable () const
 
bool SelectClosedCaptionsTrack (uint32_t id)
 
std::vector< ClosedCaptionsTrackInfoGetClosedCaptionsTracks () const
 
ClosedCaptionsTrackInfo GetActiveClosedCaptionsTrack () const
 
CYIClosedCaptionsDispatcherGetClosedCaptionsDispatcher () const
 
CYIVideoSurfaceGetSurface () const
 
bool AreAudioTracksAvailable () const
 
bool SelectAudioTrack (uint32_t id)
 
std::vector< AudioTrackInfoGetAudioTracks () const
 
AudioTrackInfo GetActiveAudioTrack () const
 
bool IsMuted () const
 
void Mute (bool mute)
 
void SetMaxBitrate (uint64_t maxBitrate)
 
void SetInitialBandwidthHint (uint64_t initialBandwidthHint)
 
void SetUserAgent (const CYIString &userAgent)
 
const DRMConfigurationGetDRMConfiguration () const
 
DRMConfigurationGetDRMConfiguration ()
 
BackgroundPlaybackInterfaceGetBackgroundPlaybackInterface () const
 
HeadphoneJackInterfaceGetHeadphoneJackInterface () const
 
BufferingInterfaceGetBufferingInterface () const
 
TimedMetadataInterfaceGetTimedMetadataInterface () const
 
VideoRequestHTTPHeadersInterfaceGetVideoRequestHTTPHeadersInterface ()
 
MediaPlaybackControlsInterfaceGetMediaPlaybackControlsInterface () const
 
void SetRefreshDRMConfigurationCallback (RefreshDRMConfigurationCallback callback)
 
- Public Member Functions inherited from CYISignalHandler
 CYISignalHandler ()
 
 CYISignalHandler (const CYISignalHandler &rSignalHandler)
 
virtual ~CYISignalHandler ()
 
CYISignalHandleroperator= (const CYISignalHandler &rSignalHandler)
 
void MoveToThread (CYIThread *pThread)
 This function allows the user to override the default thread affinity to any CYIThread that may or may not be running. More...
 
CYIThreadHandle GetThreadAffinity () const
 
void SetThreadAffinity (const CYIThreadHandle &rThreadAffinity)
 
virtual bool IsConnected () const
 
virtual bool IsConnected (const CYISignalBase &rSignal) const
 
void Disconnect (CYISignalBase &rSignal)
 
void DisconnectFromAllSignals ()
 
- Public Member Functions inherited from CYIThread::Listener
 Listener ()
 
virtual ~Listener ()
 
virtual void OnThreadStarted (CYIThread *)
 
virtual void OnThreadTerminated (CYIThread *)
 
virtual void OnThreadFinished (CYIThread *)
 

Friends

class CYICastLabsVideoPlayerPriv
 

Additional Inherited Members

- Public Types inherited from CYIAbstractVideoPlayer
enum  MediaState {
  MediaState::Unloaded,
  MediaState::Preparing,
  MediaState::Ready
}
 
enum  PlaybackState {
  PlaybackState::Playing,
  PlaybackState::Paused,
  PlaybackState::Buffering
}
 
enum  StreamingFormat {
  StreamingFormat::HLS = 0,
  StreamingFormat::Smooth,
  StreamingFormat::DASH,
  StreamingFormat::MP4
}
 
enum  DRMScheme {
  DRMScheme::None = 0,
  DRMScheme::FairPlay,
  DRMScheme::PlayReady,
  DRMScheme::WidevineModular,
  DRMScheme::WidevineModularCustomRequest
}
 
enum  ErrorCode {
  ErrorCode::PlaybackError,
  ErrorCode::UnsupportedFormat,
  ErrorCode::StateTransitionError,
  ErrorCode::DRMError,
  ErrorCode::InitializationError,
  ErrorCode::Unknown
}
 
using RTTIInstantiatability = CYIRuntimeTypeInfo::NonInstantiableTag
 
using RefreshDRMConfigurationCallback = std::function< std::unique_ptr< CYIAbstractVideoPlayer::DRMConfiguration >(std::unique_ptr< CYIAbstractVideoPlayer::DRMConfiguration >)>
 
- Public Attributes inherited from CYIAbstractVideoPlayer
CYISignal BufferingStarted
 
CYISignal BufferingEnded
 
CYISignal< ErrorErrorOccurred
 
CYISignal Preparing
 
CYISignal Ready
 
CYISignal Playing
 
CYISignal Paused
 
CYISignal PlaybackComplete
 
CYISignal Finalized
 
CYISignal< uint64_t > CurrentTimeUpdated
 
CYISignal< uint64_t > DurationChanged
 
CYISignal< bool, uint64_t > SeekCompleted
 
CYISignal< const CYIAbstractVideoPlayer::PlayerState & > PlayerStateChanged
 
CYISignal< std::vector< AudioTrackInfo > > AvailableAudioTracksChanged
 
CYISignal< std::vector< ClosedCaptionsTrackInfo > > AvailableClosedCaptionsTracksChanged
 
CYISignal< float > TotalBitrateChanged
 
CYISignal< float > VideoBitrateChanged
 
CYISignal< float > AudioBitrateChanged
 
- Protected Member Functions inherited from CYIAbstractVideoPlayer
 CYIAbstractVideoPlayer ()
 
const std::shared_ptr< CYIMaterial > & GetVideoMaterial () const
 
void SetVideoSurfaceSize (const glm::ivec2 &size)
 
void ChangeInitialPlaybackState (CYIAbstractVideoPlayer::PlaybackState initialState)
 
CYIAbstractVideoPlayer::PlaybackState GetRequestedInitialPlaybackState () const
 
void CheckAndNotifyMediaTracksChanged ()
 
void UpdateCurrentTime ()
 
void OnRefreshDRMConfiguration ()
 
virtual CYIString GetVersion_ () const
 
virtual void Init_ ()
 
virtual bool HasNativeBitrateEventHandling_ () const
 
virtual bool HasInitialBandwidthHintHandling_ () const
 
virtual void GetClosedCaptionsDispatcher_ () const
 
virtual BackgroundPlaybackInterfaceGetBackgroundPlaybackInterface_ () const
 
virtual HeadphoneJackInterfaceGetHeadphoneJackInterface_ () const
 
virtual BufferingInterfaceGetBufferingInterface_ () const
 
virtual MediaPlaybackControlsInterfaceGetMediaPlaybackControlsInterface_ () const
 
- Protected Attributes inherited from CYIAbstractVideoPlayer
CYISignal< ErrorNotifyErrorOccurred
 
CYISignal NotifyPlaybackComplete
 
CYISignal< uint64_t > NotifyDurationChanged
 
CYISignal< bool, uint64_t > NotifySeekCompleted
 
std::unique_ptr< CYIVideoPlayerStateManagerm_pStateManager
 
std::unique_ptr< CYIClosedCaptionsDispatcherm_pClosedCaptionsDispatcher
 
std::unique_ptr< DRMConfigurationm_pDRMConfiguration
 
uint64_t m_maxBitrate
 
uint64_t m_initialBandwidthHint
 
uint64_t m_initialStartTimeMs
 
RefreshDRMConfigurationCallback m_refreshDRMConfigurationCallback
 

Constructor & Destructor Documentation

◆ CYICastLabsVideoPlayer()

CYICastLabsVideoPlayer::CYICastLabsVideoPlayer ( )

◆ ~CYICastLabsVideoPlayer()

virtual CYICastLabsVideoPlayer::~CYICastLabsVideoPlayer ( )
virtual

Member Function Documentation

◆ GetName_()

virtual CYIString CYICastLabsVideoPlayer::GetName_ ( ) const
overridevirtual

Returns the name of the player.

Reimplemented from CYIAbstractVideoPlayer.

◆ GetStatistics_()

virtual Statistics CYICastLabsVideoPlayer::GetStatistics_ ( ) const
overridevirtual

Returns the latest statistics from the player.

Reimplemented from CYIAbstractVideoPlayer.

◆ GetTimedMetadataInterface_()

virtual TimedMetadataInterface* CYICastLabsVideoPlayer::GetTimedMetadataInterface_ ( ) const
overridevirtual

Subclasses may implement this function to provide a timed metadata interface. By default this returns null.

Reimplemented from CYIAbstractVideoPlayer.

◆ GetVideoRequestHTTPHeadersInterface_()

virtual VideoRequestHTTPHeadersInterface* CYICastLabsVideoPlayer::GetVideoRequestHTTPHeadersInterface_ ( )
overridevirtual

Subclasses may implement this function to provide a custom video request HTTP headers interface. By default this returns null.

Reimplemented from CYIAbstractVideoPlayer.

◆ IsLoggingEnabled()

bool CYICastLabsVideoPlayer::IsLoggingEnabled ( ) const

Returns true if the Castlabs player internal logging is enabled.

◆ SetLiveDelayTime()

void CYICastLabsVideoPlayer::SetLiveDelayTime ( uint64_t  liveDelayTimeMs)

Set Live delay. When playing live streams, point the player before the live edge by the specified amount.

◆ SetLoggingEnabled()

void CYICastLabsVideoPlayer::SetLoggingEnabled ( bool  enabled)

Enable or Disable the Castlabs player internal logging.

◆ SetMaximumBufferTime()

void CYICastLabsVideoPlayer::SetMaximumBufferTime ( uint64_t  maximumBufferTimeMs)

Set the maximum time that should be buffered. The higher the value, the smoother the streaming with less frequent buffering, but will increase memory usage. Call this before Prepare().

The default maximum buffer time is 60 seconds on PS4.

◆ SetMaxResolution()

void CYICastLabsVideoPlayer::SetMaxResolution ( const glm::ivec2 &  rMaxResolution)

Set the max resolution supported by this player instance. This will create a decoder specific to that resolution, and higher resolution won't be allowed to be played. Call this before Prepare().

By default it will be set to the max the platform can support.

◆ SetMinimumBufferTime()

void CYICastLabsVideoPlayer::SetMinimumBufferTime ( uint64_t  minimumBufferTimeMs)

Set the minimum time that should be buffered before the video starts playing or resumes from buffering. Call this before Prepare().

The default minimum buffer time is 1 second.

Friends And Related Function Documentation

◆ CYICastLabsVideoPlayerPriv

friend class CYICastLabsVideoPlayerPriv
friend

The documentation for this class was generated from the following file: