Leviathan  0.8.0.0
Leviathan game engine
Leviathan::Codec Class Referenceabstract

Base codec interface for all supported video and audio codecs. More...

#include <Codec.h>

+ Inheritance diagram for Leviathan::Codec:

Public Types

using FrameCallback = std::function< bool(const DecodedFrame &frame)>
 

Public Member Functions

 Codec ()=default
 
 Codec (const Codec &other)=delete
 
Codecoperator= (const Codec &other)=delete
 
virtual bool FeedRawFrame (const uint8_t *data, size_t length)=0
 Sends the raw data frame to the codec. More...
 
virtual void ReceiveDecodedFrames (FrameCallback callback)=0
 Returns decoded frames one by one after they are ready. More...
 

Detailed Description

Base codec interface for all supported video and audio codecs.

Definition at line 60 of file Codec.h.

Member Typedef Documentation

◆ FrameCallback

using Leviathan::Codec::FrameCallback = std::function<bool(const DecodedFrame& frame)>

Definition at line 62 of file Codec.h.

Constructor & Destructor Documentation

◆ Codec() [1/2]

Leviathan::Codec::Codec ( )
default

◆ Codec() [2/2]

Leviathan::Codec::Codec ( const Codec other)
delete

Member Function Documentation

◆ FeedRawFrame()

virtual bool Leviathan::Codec::FeedRawFrame ( const uint8_t *  data,
size_t  length 
)
pure virtual

Sends the raw data frame to the codec.

Returns
True on success. False if the codec couldn't handle the frame and is now possibly in broken state

Implemented in Leviathan::VorbisCodec, and Leviathan::AV1Codec.

◆ operator=()

Codec& Leviathan::Codec::operator= ( const Codec other)
delete

◆ ReceiveDecodedFrames()

virtual void Leviathan::Codec::ReceiveDecodedFrames ( FrameCallback  callback)
pure virtual

Returns decoded frames one by one after they are ready.

Call FeedRawFrame and then call this afterwards, there may be more than 1 or no decoded frames for each raw frame. If the callback returns false the loop for iterating the finished frames stops before all frames are passed to the callback

Implemented in Leviathan::VorbisCodec, and Leviathan::AV1Codec.


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