Kodi Documentation 23.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CMediaPipelineWasm Class Referencefinal

Plays audio and video through a media player of the browser or the device. More...

#include <MediaPipelineWasm.h>

Inheritance diagram for CMediaPipelineWasm:
CThread

Public Member Functions

 CMediaPipelineWasm (std::unique_ptr< IMediaBackendWasm > backend, CProcessInfo &processInfo, CRenderManager &renderManager, CDVDClock &clock, CDVDMessageQueue &parent, CDVDOverlayContainer &overlay, bool hasAudio, std::function< int()> streamLength, std::function< double()> seekTarget)
 
 ~CMediaPipelineWasm () override
 
IMediaBackendWasm & Backend () const
 
void SetHasAudio (bool hasAudio)
 
void FlushVideoMessages ()
 
void FlushAudioMessages ()
 
bool OpenVideoStream (const CDVDStreamInfo &hint)
 
bool OpenAudioStream (const CDVDStreamInfo &hint)
 
void CloseVideoStream ()
 
void CloseAudioStream ()
 
void Flush ()
 
bool AcceptsVideoData () const
 
bool AcceptsAudioData () const
 
bool HasVideoData () const
 
bool HasAudioData () const
 
bool IsVideoInited () const
 
bool IsAudioInited () const
 
int GetAudioLevel () const
 
bool IsStalled () const
 The backend buffers on its own.
 
void SendVideoMessage (const std::shared_ptr< CDVDMsg > &msg, int priority)
 
void SendAudioMessage (const std::shared_ptr< CDVDMsg > &msg, int priority)
 
void SetSpeed (int speed)
 
double GetCurrentPts () const
 
int GetAudioChannels () const
 
void EnableSubtitle (bool enable)
 
bool IsSubtitleEnabled () const
 
double GetSubtitleDelay () const
 
void SetSubtitleDelay (double delay)
 
int GetVideoBitrate () const
 
std::string GetVideoInfo () const
 
std::string GetAudioInfo () const
 
void GetVideoResolution (unsigned int &width, unsigned int &height) const
 
- Public Member Functions inherited from CThread
 CThread (IRunnable *pRunnable, const char *ThreadName)
 
virtual ~CThread ()
 
void Create (bool bAutoDelete=false)
 
template<typename Rep , typename Period >
void Sleep (std::chrono::duration< Rep, Period > duration)
 
bool IsAutoDelete () const
 
virtual void StopThread (bool bWait=true)
 
bool IsRunning () const
 
bool IsCurrentThread () const
 
bool Join (std::chrono::milliseconds duration)
 
bool SetPriority (const ThreadPriority &priority)
 Set the threads priority. This uses the platforms native threading library to do so.
 
bool SetTask (const ThreadTask &task)
 Assign the current thread a task for OS scheduling (platform dependent)
 
bool RevertTask ()
 Revert the current thread to normal scheduling (platform dependent)
 
virtual void OnException ()
 

Static Public Member Functions

static bool SupportsVideo (IMediaBackendWasm &backend, const CDVDStreamInfo &hint)
 Whether backend can play the video stream through a pipeline.
 
- Static Public Member Functions inherited from CThread
static const std::thread::id GetCurrentThreadId ()
 
static CThread * GetCurrentThread ()
 

Protected Member Functions

void Process () override
 
- Protected Member Functions inherited from CThread
 CThread (const char *ThreadName)
 
virtual void OnStartup ()
 
virtual void OnExit ()
 
CEvent & GetStopEvent ()
 Set by StopThread(), i.e. once the owner may be blocked waiting for this thread.
 
WaitResponse AbortableWait (CEvent &event, std::chrono::milliseconds duration=std::chrono::milliseconds(-1))
 

Additional Inherited Members

- Protected Types inherited from CThread
enum  WaitResponse { WAIT_INTERRUPTED = -1 , WAIT_SIGNALED = 0 , WAIT_TIMEDOUT = 1 }
 
- Protected Attributes inherited from CThread
std::atomic< bool > m_bStop
 

Detailed Description

Plays audio and video through a media player of the browser or the device.

The backend decodes both streams, keeps them in sync and shows the video in a <video> element under the GUI. This thread appends video packets and drives playback, m_audioThread appends audio; VideoPlayer's clock and RenderManager follow the backend's position.

Constructor & Destructor Documentation

◆ CMediaPipelineWasm()

CMediaPipelineWasm::CMediaPipelineWasm ( std::unique_ptr< IMediaBackendWasm > backend,
CProcessInfo & processInfo,
CRenderManager & renderManager,
CDVDClock & clock,
CDVDMessageQueue & parent,
CDVDOverlayContainer & overlay,
bool hasAudio,
std::function< int()> streamLength,
std::function< double()> seekTarget )
Parameters
streamLengthLength of the stream in milliseconds, 0 when unknown.
seekTargetThe pts an accurate seek shows first, DVD_NOPTS_VALUE for other seeks.

◆ ~CMediaPipelineWasm()

CMediaPipelineWasm::~CMediaPipelineWasm ( )
override

Member Function Documentation

◆ AcceptsAudioData()

bool CMediaPipelineWasm::AcceptsAudioData ( ) const

◆ AcceptsVideoData()

bool CMediaPipelineWasm::AcceptsVideoData ( ) const

◆ Backend()

IMediaBackendWasm & CMediaPipelineWasm::Backend ( ) const
inline

◆ CloseAudioStream()

void CMediaPipelineWasm::CloseAudioStream ( )

◆ CloseVideoStream()

void CMediaPipelineWasm::CloseVideoStream ( )

◆ EnableSubtitle()

void CMediaPipelineWasm::EnableSubtitle ( bool enable)
inline

◆ Flush()

void CMediaPipelineWasm::Flush ( )

◆ FlushAudioMessages()

void CMediaPipelineWasm::FlushAudioMessages ( )

◆ FlushVideoMessages()

void CMediaPipelineWasm::FlushVideoMessages ( )

◆ GetAudioChannels()

int CMediaPipelineWasm::GetAudioChannels ( ) const
inline

◆ GetAudioInfo()

std::string CMediaPipelineWasm::GetAudioInfo ( ) const

◆ GetAudioLevel()

int CMediaPipelineWasm::GetAudioLevel ( ) const

◆ GetCurrentPts()

double CMediaPipelineWasm::GetCurrentPts ( ) const

◆ GetSubtitleDelay()

double CMediaPipelineWasm::GetSubtitleDelay ( ) const
inline

◆ GetVideoBitrate()

int CMediaPipelineWasm::GetVideoBitrate ( ) const

◆ GetVideoInfo()

std::string CMediaPipelineWasm::GetVideoInfo ( ) const

◆ GetVideoResolution()

void CMediaPipelineWasm::GetVideoResolution ( unsigned int & width,
unsigned int & height ) const

◆ HasAudioData()

bool CMediaPipelineWasm::HasAudioData ( ) const

◆ HasVideoData()

bool CMediaPipelineWasm::HasVideoData ( ) const

◆ IsAudioInited()

bool CMediaPipelineWasm::IsAudioInited ( ) const

◆ IsStalled()

bool CMediaPipelineWasm::IsStalled ( ) const
inline

The backend buffers on its own.

◆ IsSubtitleEnabled()

bool CMediaPipelineWasm::IsSubtitleEnabled ( ) const
inline

◆ IsVideoInited()

bool CMediaPipelineWasm::IsVideoInited ( ) const

◆ OpenAudioStream()

bool CMediaPipelineWasm::OpenAudioStream ( const CDVDStreamInfo & hint)

◆ OpenVideoStream()

bool CMediaPipelineWasm::OpenVideoStream ( const CDVDStreamInfo & hint)

◆ Process()

void CMediaPipelineWasm::Process ( void )
overrideprotectedvirtual

Reimplemented from CThread.

◆ SendAudioMessage()

void CMediaPipelineWasm::SendAudioMessage ( const std::shared_ptr< CDVDMsg > & msg,
int priority )

◆ SendVideoMessage()

void CMediaPipelineWasm::SendVideoMessage ( const std::shared_ptr< CDVDMsg > & msg,
int priority )

◆ SetHasAudio()

void CMediaPipelineWasm::SetHasAudio ( bool hasAudio)
inline

◆ SetSpeed()

void CMediaPipelineWasm::SetSpeed ( int speed)

◆ SetSubtitleDelay()

void CMediaPipelineWasm::SetSubtitleDelay ( double delay)
inline

◆ SupportsVideo()

bool CMediaPipelineWasm::SupportsVideo ( IMediaBackendWasm & backend,
const CDVDStreamInfo & hint )
static

Whether backend can play the video stream through a pipeline.


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