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

The browser's Media Source Extensions: each track is muxed into fragmented MP4 and appended to a SourceBuffer of a <video> element. Audio the browser cannot play is converted to FLAC, or to Opus where FLAC does not play. More...

#include <MediaBackendMse.h>

Inheritance diagram for CMediaBackendMse:
IMediaBackendWasm

Classes

class  CAudioEncoder
 Encodes decoded audio as FLAC or Opus. More...
 
class  CFragmentWriter
 

Public Member Functions

 CMediaBackendMse ()
 
 ~CMediaBackendMse () override
 
std::string Name () const override
 
bool SupportsVideo (const CDVDStreamInfo &hint) override
 Looks at the codec, profile, bit depth, size and frame rate only.
 
AudioPath GetAudioPath (const CDVDStreamInfo &hint) override
 Looks at the codec, profile, channels and sample rate only.
 
std::string Open (const CDVDStreamInfo &video, const CDVDStreamInfo *audio, AudioPath audioPath, double duration) override
 Creates the media source with its tracks and waits until it takes packets.
 
void Close () override
 
std::string VideoCodecName () const override
 
std::string AudioCodecName () const override
 
double MaxAudioAhead () const override
 How far ahead of the playback position audio can be appended.
 
bool PrepareVideo (DemuxPacket &packet, Packet &out) override
 
AppendResult AppendVideo (const Packet &packet) override
 
AppendResult AppendAudio (const Packet &packet) override
 
bool EndVideo () override
 
bool EndAudio () override
 
void ConvertAudio (const DVDAudioFrame &frame) override
 For AudioPath::CONVERTED: takes decoded frames and returns them as packets to append.
 
void FinishConvertedAudio () override
 Turns the frames held back for a bigger packet into one.
 
bool PeekConvertedAudio (Packet &out) override
 
void PopConvertedAudio () override
 
void Flush () override
 Drops what the backend holds for the position before a flush.
 
void Play () override
 
void Pause () override
 
void SetRate (double rate) override
 
bool HasVolume () const override
 Whether SetVolume() applies Kodi's volume; otherwise the device's own volume does.
 
void SetVolume (float volume) override
 
void Seek (double seconds) override
 Moves playback to seconds and returns once the tracks take packets for it.
 
void SetStartPosition (double seconds) override
 Where a fresh source reports to be until it plays.
 
int Error () const override
 0 while playback has no error.
 
bool CanPlay () const override
 
bool Ended () const override
 
double Position () const override
 
- Public Member Functions inherited from IMediaBackendWasm
virtual ~IMediaBackendWasm ()=default
 
virtual bool IsHardwareVideoDecoder () const
 Whether the backend confirmed hardware video decoding.
 
virtual int Resumes () const
 

Additional Inherited Members

- Public Types inherited from IMediaBackendWasm
enum class  AppendResult {
  OK , FULL , STALE , NEEDS_KEY_FRAME ,
  FAILED
}
 
enum class  AudioPath { NONE , NATIVE , CONVERTED }
 
- Static Public Member Functions inherited from IMediaBackendWasm
static std::vector< std::unique_ptr< IMediaBackendWasm > > Create ()
 The backends for this device and settings, the preferred one first.
 

Detailed Description

The browser's Media Source Extensions: each track is muxed into fragmented MP4 and appended to a SourceBuffer of a <video> element. Audio the browser cannot play is converted to FLAC, or to Opus where FLAC does not play.

Constructor & Destructor Documentation

◆ CMediaBackendMse()

CMediaBackendMse::CMediaBackendMse ( )

◆ ~CMediaBackendMse()

CMediaBackendMse::~CMediaBackendMse ( )
override

Member Function Documentation

◆ AppendAudio()

IMediaBackendWasm::AppendResult CMediaBackendMse::AppendAudio ( const Packet & packet)
overridevirtual

Implements IMediaBackendWasm.

◆ AppendVideo()

IMediaBackendWasm::AppendResult CMediaBackendMse::AppendVideo ( const Packet & packet)
overridevirtual

Implements IMediaBackendWasm.

◆ AudioCodecName()

std::string CMediaBackendMse::AudioCodecName ( ) const
inlineoverridevirtual

Implements IMediaBackendWasm.

◆ CanPlay()

bool CMediaBackendMse::CanPlay ( ) const
overridevirtual

Implements IMediaBackendWasm.

◆ Close()

void CMediaBackendMse::Close ( )
overridevirtual

Implements IMediaBackendWasm.

◆ ConvertAudio()

void CMediaBackendMse::ConvertAudio ( const DVDAudioFrame & frame)
overridevirtual

For AudioPath::CONVERTED: takes decoded frames and returns them as packets to append.

Implements IMediaBackendWasm.

◆ EndAudio()

bool CMediaBackendMse::EndAudio ( )
overridevirtual

Implements IMediaBackendWasm.

◆ Ended()

bool CMediaBackendMse::Ended ( ) const
overridevirtual

Implements IMediaBackendWasm.

◆ EndVideo()

bool CMediaBackendMse::EndVideo ( )
overridevirtual

Ends the track after the data appended so far.

Returns
false when it has to be called again later.

Implements IMediaBackendWasm.

◆ Error()

int CMediaBackendMse::Error ( ) const
overridevirtual

0 while playback has no error.

Implements IMediaBackendWasm.

◆ FinishConvertedAudio()

void CMediaBackendMse::FinishConvertedAudio ( )
overridevirtual

Turns the frames held back for a bigger packet into one.

Implements IMediaBackendWasm.

◆ Flush()

void CMediaBackendMse::Flush ( )
overridevirtual

Drops what the backend holds for the position before a flush.

Implements IMediaBackendWasm.

◆ GetAudioPath()

IMediaBackendWasm::AudioPath CMediaBackendMse::GetAudioPath ( const CDVDStreamInfo & hint)
overridevirtual

Looks at the codec, profile, channels and sample rate only.

Implements IMediaBackendWasm.

◆ HasVolume()

bool CMediaBackendMse::HasVolume ( ) const
inlineoverridevirtual

Whether SetVolume() applies Kodi's volume; otherwise the device's own volume does.

Implements IMediaBackendWasm.

◆ MaxAudioAhead()

double CMediaBackendMse::MaxAudioAhead ( ) const
inlineoverridevirtual

How far ahead of the playback position audio can be appended.

Implements IMediaBackendWasm.

◆ Name()

std::string CMediaBackendMse::Name ( ) const
inlineoverridevirtual

Implements IMediaBackendWasm.

◆ Open()

std::string CMediaBackendMse::Open ( const CDVDStreamInfo & video,
const CDVDStreamInfo * audio,
AudioPath audioPath,
double duration )
overridevirtual

Creates the media source with its tracks and waits until it takes packets.

Parameters
audionullptr for no audio.
durationinfinity when unknown.
Returns
A description of the tracks for the log, empty on failure.

Implements IMediaBackendWasm.

◆ Pause()

void CMediaBackendMse::Pause ( )
overridevirtual

Implements IMediaBackendWasm.

◆ PeekConvertedAudio()

bool CMediaBackendMse::PeekConvertedAudio ( Packet & out)
overridevirtual

Implements IMediaBackendWasm.

◆ Play()

void CMediaBackendMse::Play ( )
overridevirtual

Implements IMediaBackendWasm.

◆ PopConvertedAudio()

void CMediaBackendMse::PopConvertedAudio ( )
overridevirtual

Implements IMediaBackendWasm.

◆ Position()

double CMediaBackendMse::Position ( ) const
overridevirtual

Implements IMediaBackendWasm.

◆ PrepareVideo()

bool CMediaBackendMse::PrepareVideo ( DemuxPacket & packet,
Packet & out )
overridevirtual
Returns
false when the packet is not to be appended, such as before the first parameter sets. out stays valid until the next call.

Implements IMediaBackendWasm.

◆ Seek()

void CMediaBackendMse::Seek ( double seconds)
overridevirtual

Moves playback to seconds and returns once the tracks take packets for it.

Implements IMediaBackendWasm.

◆ SetRate()

void CMediaBackendMse::SetRate ( double rate)
overridevirtual

Implements IMediaBackendWasm.

◆ SetStartPosition()

void CMediaBackendMse::SetStartPosition ( double seconds)
overridevirtual

Where a fresh source reports to be until it plays.

Implements IMediaBackendWasm.

◆ SetVolume()

void CMediaBackendMse::SetVolume ( float volume)
overridevirtual

Implements IMediaBackendWasm.

◆ SupportsVideo()

bool CMediaBackendMse::SupportsVideo ( const CDVDStreamInfo & hint)
overridevirtual

Looks at the codec, profile, bit depth, size and frame rate only.

Implements IMediaBackendWasm.

◆ VideoCodecName()

std::string CMediaBackendMse::VideoCodecName ( ) const
inlineoverridevirtual

Implements IMediaBackendWasm.


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