Cogs.Core
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Cogs::Core::IVideoDecoder Class Referenceabstract

Classes

struct  Rect
 

Public Member Functions

 IVideoDecoder (Context &ctx)
 
Codec getCodec () const
 
VideoDecoderPresentMode getPresentMode () const
 
double getDiscontinuityDuration () const
 
uint32_t getSpeedupQueueCount () const
 
float getSpeedupFactor () const
 
uint32_t getSurfaceCount () const
 
uint32_t getChromaFormatIdc () const
 
uint32_t getChromaBitDepthMinus8 () const
 
uint32_t getLumaBitDepthMinus8 () const
 
uint32_t getCodedWidth () const
 
uint32_t getCodedHeight () const
 
const RectgetDisplayArea () const
 
uint32_t getOutputWidth () const
 
uint32_t getOutputHeight () const
 
ColourSpace getColourSpace () const
 
TransferFunction getTransferFunction () const
 
float getGamma () const
 
int64_t getClockRate () const
 
int64_t getPreviousClock () const
 
int64_t getClockResidual () const
 
int64_t getPreviousClockResidual () const
 
bool getCheckUnderflow () const
 
int64_t getPresentationTime () const
 
int64_t getPreviousPresentationTime () const
 
int64_t getPlayTime () const
 
int64_t getPreviousPlayTime () const
 
uint32_t getBufferUnderflowCounter () const
 
uint32_t getBufferUnderflowMajorStutterCounter () const
 
uint32_t getBufferOverflowCounter () const
 
uint32_t getDecoderRestartCounter () const
 
uint32_t getDiscontinuitiesSkippedCounter () const
 
const TextureDescriptiongetTextureDescription () const
 
Cogs::TextureHandle getTexture () const
 
RenderTexturegetRenderTexture () const
 
bool & refSkipDiscontinuities ()
 
uint32_t & refSpeedupQueueCount ()
 
float & refSpeedupFactor ()
 
bool shouldSkipDiscontinuities () const
 
void setPresentMode (VideoDecoderPresentMode mode)
 

Protected Member Functions

virtual void cleanup ()
 
virtual int64_t getPresentationTime (size_t queuePosition)=0
 
void parseVideoDescription (const VideoDecoderDescription &desc)
 
void createTexture ()
 
int selectDisplayFrame (size_t queueLength)
 

Protected Attributes

Contextcontext
 
Codec codec = Codec::None
 
VideoDecoderPresentMode presentMode = VideoDecoderPresentMode::Latest
 How will frames be presented.
 
bool skipDiscontinuities = true
 Are discontinuities skipped?
 
bool generateMipMaps = false
 Generate mipmaps for each frame.
 
double discontinuityDuration = 0.5
 Definition of a discontinuity (seconds)
 
uint32_t surfaceCount = 0
 
std::vector< uint8_t > parameterSets
 Cached VPS, SPS, and PPS data.
 
uint32_t speedupQueueCount = 3
 
float speedupFactor = 1.0f
 
VideoDecoderCallback * decodeCallback = nullptr
 Called when a frame is submitted to the decoder.
 
void * decodeCallbackData = nullptr
 
VideoPresentCallback * presentCallback = nullptr
 Called when a frame is chosen for presentation.
 
void * presentCallbackData = nullptr
 
uint32_t chromaFormatIdc = static_cast<uint32_t>(-1)
 
uint32_t chromaBitDepthMinus8 = static_cast<uint32_t>(-1)
 
uint32_t lumaBitDepthMinus8 = static_cast<uint32_t>(-1)
 
uint32_t codedWidth = static_cast<uint32_t>(-1)
 
uint32_t codedHeight = static_cast<uint32_t>(-1)
 
Rect displayArea
 
uint32_t outputWidth = 0
 
uint32_t outputHeight = 0
 
ColourSpace colourSpace = ColourSpace::BT709Full
 
TransferFunction transferFunction = TransferFunction::sRGB
 
float gamma = 1.0f / 2.2f
 Gamma value to be used when transferFunction equals TransferFunction::Gamma.
 
int64_t clockRate = 0
 
int64_t previousClock = 0
 Previous monotonic clock now() (ns)
 
int64_t clockResidual = 0
 Used for pacing frames (clock_rate units)
 
int64_t previousClockResidual = 0
 
bool checkUnderflow = false
 
int64_t presentationTime = 0
 Frame timestamp (clock_rate units)
 
int64_t previousPresentationTime = 0
 Frame timestamp (clock_rate units)
 
int64_t playTime = 0
 play time (realtime ns)
 
int64_t previousPlayTime = 0
 play time (realtime ns)
 
uint32_t bufferUnderflowCounter = 0
 
uint32_t bufferUnderflowMajorStutterCounter = 0
 
uint32_t bufferOverflowCounter = 0
 
uint32_t decoderRestartCounter = 0
 
uint32_t discontinuitiesSkippedCounter = 0
 
TextureDescription textureDesc
 
Cogs::TextureHandle texture = Cogs::TextureHandle::NoHandle
 
RenderTexturerenderTexture = nullptr
 
RenderTargetHandle renderTarget = Cogs::RenderTargetHandle::NoHandle
 

Detailed Description

Definition at line 125 of file IVideoDecoder.h.

Constructor & Destructor Documentation

◆ IVideoDecoder()

Cogs::Core::IVideoDecoder::IVideoDecoder ( Context ctx)
inline

Definition at line 134 of file IVideoDecoder.h.

Member Function Documentation

◆ cleanup()

void Cogs::Core::IVideoDecoder::cleanup ( )
protectedvirtual

Definition at line 37 of file IVideoDecoder.cpp.

◆ createTexture()

void Cogs::Core::IVideoDecoder::createTexture ( )
protected

Definition at line 364 of file IVideoDecoder.cpp.

◆ getBufferOverflowCounter()

uint32_t Cogs::Core::IVideoDecoder::getBufferOverflowCounter ( ) const
inline

Definition at line 165 of file IVideoDecoder.h.

◆ getBufferUnderflowCounter()

uint32_t Cogs::Core::IVideoDecoder::getBufferUnderflowCounter ( ) const
inline

Definition at line 163 of file IVideoDecoder.h.

◆ getBufferUnderflowMajorStutterCounter()

uint32_t Cogs::Core::IVideoDecoder::getBufferUnderflowMajorStutterCounter ( ) const
inline

Definition at line 164 of file IVideoDecoder.h.

◆ getCheckUnderflow()

bool Cogs::Core::IVideoDecoder::getCheckUnderflow ( ) const
inline

Definition at line 158 of file IVideoDecoder.h.

◆ getChromaBitDepthMinus8()

uint32_t Cogs::Core::IVideoDecoder::getChromaBitDepthMinus8 ( ) const
inline

Definition at line 144 of file IVideoDecoder.h.

◆ getChromaFormatIdc()

uint32_t Cogs::Core::IVideoDecoder::getChromaFormatIdc ( ) const
inline

Definition at line 143 of file IVideoDecoder.h.

◆ getClockRate()

int64_t Cogs::Core::IVideoDecoder::getClockRate ( ) const
inline

Definition at line 154 of file IVideoDecoder.h.

◆ getClockResidual()

int64_t Cogs::Core::IVideoDecoder::getClockResidual ( ) const
inline

Definition at line 156 of file IVideoDecoder.h.

◆ getCodec()

Codec Cogs::Core::IVideoDecoder::getCodec ( ) const
inline

Definition at line 137 of file IVideoDecoder.h.

◆ getCodedHeight()

uint32_t Cogs::Core::IVideoDecoder::getCodedHeight ( ) const
inline

Definition at line 147 of file IVideoDecoder.h.

◆ getCodedWidth()

uint32_t Cogs::Core::IVideoDecoder::getCodedWidth ( ) const
inline

Definition at line 146 of file IVideoDecoder.h.

◆ getColourSpace()

ColourSpace Cogs::Core::IVideoDecoder::getColourSpace ( ) const
inline

Definition at line 151 of file IVideoDecoder.h.

◆ getDecoderRestartCounter()

uint32_t Cogs::Core::IVideoDecoder::getDecoderRestartCounter ( ) const
inline

Definition at line 166 of file IVideoDecoder.h.

◆ getDiscontinuitiesSkippedCounter()

uint32_t Cogs::Core::IVideoDecoder::getDiscontinuitiesSkippedCounter ( ) const
inline

Definition at line 167 of file IVideoDecoder.h.

◆ getDiscontinuityDuration()

double Cogs::Core::IVideoDecoder::getDiscontinuityDuration ( ) const
inline

Definition at line 139 of file IVideoDecoder.h.

◆ getDisplayArea()

const Rect & Cogs::Core::IVideoDecoder::getDisplayArea ( ) const
inline

Definition at line 148 of file IVideoDecoder.h.

◆ getGamma()

float Cogs::Core::IVideoDecoder::getGamma ( ) const
inline

Definition at line 153 of file IVideoDecoder.h.

◆ getLumaBitDepthMinus8()

uint32_t Cogs::Core::IVideoDecoder::getLumaBitDepthMinus8 ( ) const
inline

Definition at line 145 of file IVideoDecoder.h.

◆ getOutputHeight()

uint32_t Cogs::Core::IVideoDecoder::getOutputHeight ( ) const
inline

Definition at line 150 of file IVideoDecoder.h.

◆ getOutputWidth()

uint32_t Cogs::Core::IVideoDecoder::getOutputWidth ( ) const
inline

Definition at line 149 of file IVideoDecoder.h.

◆ getPlayTime()

int64_t Cogs::Core::IVideoDecoder::getPlayTime ( ) const
inline

Definition at line 161 of file IVideoDecoder.h.

◆ getPresentationTime()

int64_t Cogs::Core::IVideoDecoder::getPresentationTime ( ) const
inline

Definition at line 159 of file IVideoDecoder.h.

◆ getPresentMode()

VideoDecoderPresentMode Cogs::Core::IVideoDecoder::getPresentMode ( ) const
inline

Definition at line 138 of file IVideoDecoder.h.

◆ getPreviousClock()

int64_t Cogs::Core::IVideoDecoder::getPreviousClock ( ) const
inline

Definition at line 155 of file IVideoDecoder.h.

◆ getPreviousClockResidual()

int64_t Cogs::Core::IVideoDecoder::getPreviousClockResidual ( ) const
inline

Definition at line 157 of file IVideoDecoder.h.

◆ getPreviousPlayTime()

int64_t Cogs::Core::IVideoDecoder::getPreviousPlayTime ( ) const
inline

Definition at line 162 of file IVideoDecoder.h.

◆ getPreviousPresentationTime()

int64_t Cogs::Core::IVideoDecoder::getPreviousPresentationTime ( ) const
inline

Definition at line 160 of file IVideoDecoder.h.

◆ getRenderTexture()

RenderTexture * Cogs::Core::IVideoDecoder::getRenderTexture ( ) const
inline

Definition at line 170 of file IVideoDecoder.h.

◆ getSpeedupFactor()

float Cogs::Core::IVideoDecoder::getSpeedupFactor ( ) const
inline

Definition at line 141 of file IVideoDecoder.h.

◆ getSpeedupQueueCount()

uint32_t Cogs::Core::IVideoDecoder::getSpeedupQueueCount ( ) const
inline

Definition at line 140 of file IVideoDecoder.h.

◆ getSurfaceCount()

uint32_t Cogs::Core::IVideoDecoder::getSurfaceCount ( ) const
inline

Definition at line 142 of file IVideoDecoder.h.

◆ getTexture()

Cogs::TextureHandle Cogs::Core::IVideoDecoder::getTexture ( ) const
inline

Definition at line 169 of file IVideoDecoder.h.

◆ getTextureDescription()

const TextureDescription & Cogs::Core::IVideoDecoder::getTextureDescription ( ) const
inline

Definition at line 168 of file IVideoDecoder.h.

◆ getTransferFunction()

TransferFunction Cogs::Core::IVideoDecoder::getTransferFunction ( ) const
inline

Definition at line 152 of file IVideoDecoder.h.

◆ parseVideoDescription()

void Cogs::Core::IVideoDecoder::parseVideoDescription ( const VideoDecoderDescription desc)
protected

Definition at line 104 of file IVideoDecoder.cpp.

◆ refSkipDiscontinuities()

bool & Cogs::Core::IVideoDecoder::refSkipDiscontinuities ( )
inline

Definition at line 172 of file IVideoDecoder.h.

◆ refSpeedupFactor()

float & Cogs::Core::IVideoDecoder::refSpeedupFactor ( )
inline

Definition at line 174 of file IVideoDecoder.h.

◆ refSpeedupQueueCount()

uint32_t & Cogs::Core::IVideoDecoder::refSpeedupQueueCount ( )
inline

Definition at line 173 of file IVideoDecoder.h.

◆ selectDisplayFrame()

int Cogs::Core::IVideoDecoder::selectDisplayFrame ( size_t  queueLength)
protected

Definition at line 402 of file IVideoDecoder.cpp.

◆ setPresentMode()

void Cogs::Core::IVideoDecoder::setPresentMode ( VideoDecoderPresentMode  mode)
inline

Definition at line 178 of file IVideoDecoder.h.

◆ shouldSkipDiscontinuities()

bool Cogs::Core::IVideoDecoder::shouldSkipDiscontinuities ( ) const
inline

Definition at line 176 of file IVideoDecoder.h.

Member Data Documentation

◆ bufferOverflowCounter

uint32_t Cogs::Core::IVideoDecoder::bufferOverflowCounter = 0
protected

Definition at line 227 of file IVideoDecoder.h.

◆ bufferUnderflowCounter

uint32_t Cogs::Core::IVideoDecoder::bufferUnderflowCounter = 0
protected

Definition at line 225 of file IVideoDecoder.h.

◆ bufferUnderflowMajorStutterCounter

uint32_t Cogs::Core::IVideoDecoder::bufferUnderflowMajorStutterCounter = 0
protected

Definition at line 226 of file IVideoDecoder.h.

◆ checkUnderflow

bool Cogs::Core::IVideoDecoder::checkUnderflow = false
protected

Definition at line 216 of file IVideoDecoder.h.

◆ chromaBitDepthMinus8

uint32_t Cogs::Core::IVideoDecoder::chromaBitDepthMinus8 = static_cast<uint32_t>(-1)
protected

Definition at line 201 of file IVideoDecoder.h.

◆ chromaFormatIdc

uint32_t Cogs::Core::IVideoDecoder::chromaFormatIdc = static_cast<uint32_t>(-1)
protected

Definition at line 200 of file IVideoDecoder.h.

◆ clockRate

int64_t Cogs::Core::IVideoDecoder::clockRate = 0
protected

Definition at line 212 of file IVideoDecoder.h.

◆ clockResidual

int64_t Cogs::Core::IVideoDecoder::clockResidual = 0
protected

Used for pacing frames (clock_rate units)

Definition at line 214 of file IVideoDecoder.h.

◆ codec

Codec Cogs::Core::IVideoDecoder::codec = Codec::None
protected

Definition at line 182 of file IVideoDecoder.h.

◆ codedHeight

uint32_t Cogs::Core::IVideoDecoder::codedHeight = static_cast<uint32_t>(-1)
protected

Definition at line 204 of file IVideoDecoder.h.

◆ codedWidth

uint32_t Cogs::Core::IVideoDecoder::codedWidth = static_cast<uint32_t>(-1)
protected

Definition at line 203 of file IVideoDecoder.h.

◆ colourSpace

ColourSpace Cogs::Core::IVideoDecoder::colourSpace = ColourSpace::BT709Full
protected

Definition at line 208 of file IVideoDecoder.h.

◆ context

Context& Cogs::Core::IVideoDecoder::context
protected

Definition at line 181 of file IVideoDecoder.h.

◆ decodeCallback

VideoDecoderCallback* Cogs::Core::IVideoDecoder::decodeCallback = nullptr
protected

Called when a frame is submitted to the decoder.

Definition at line 194 of file IVideoDecoder.h.

◆ decodeCallbackData

void* Cogs::Core::IVideoDecoder::decodeCallbackData = nullptr
protected

Definition at line 195 of file IVideoDecoder.h.

◆ decoderRestartCounter

uint32_t Cogs::Core::IVideoDecoder::decoderRestartCounter = 0
protected

Definition at line 228 of file IVideoDecoder.h.

◆ discontinuitiesSkippedCounter

uint32_t Cogs::Core::IVideoDecoder::discontinuitiesSkippedCounter = 0
protected

Definition at line 229 of file IVideoDecoder.h.

◆ discontinuityDuration

double Cogs::Core::IVideoDecoder::discontinuityDuration = 0.5
protected

Definition of a discontinuity (seconds)

Definition at line 186 of file IVideoDecoder.h.

◆ displayArea

Rect Cogs::Core::IVideoDecoder::displayArea
protected

Definition at line 205 of file IVideoDecoder.h.

◆ gamma

float Cogs::Core::IVideoDecoder::gamma = 1.0f / 2.2f
protected

Gamma value to be used when transferFunction equals TransferFunction::Gamma.

Definition at line 210 of file IVideoDecoder.h.

◆ generateMipMaps

bool Cogs::Core::IVideoDecoder::generateMipMaps = false
protected

Generate mipmaps for each frame.

Definition at line 185 of file IVideoDecoder.h.

◆ lumaBitDepthMinus8

uint32_t Cogs::Core::IVideoDecoder::lumaBitDepthMinus8 = static_cast<uint32_t>(-1)
protected

Definition at line 202 of file IVideoDecoder.h.

◆ outputHeight

uint32_t Cogs::Core::IVideoDecoder::outputHeight = 0
protected

Definition at line 207 of file IVideoDecoder.h.

◆ outputWidth

uint32_t Cogs::Core::IVideoDecoder::outputWidth = 0
protected

Definition at line 206 of file IVideoDecoder.h.

◆ parameterSets

std::vector<uint8_t> Cogs::Core::IVideoDecoder::parameterSets
protected

Cached VPS, SPS, and PPS data.

Definition at line 188 of file IVideoDecoder.h.

◆ playTime

int64_t Cogs::Core::IVideoDecoder::playTime = 0
protected

play time (realtime ns)

Definition at line 221 of file IVideoDecoder.h.

◆ presentationTime

int64_t Cogs::Core::IVideoDecoder::presentationTime = 0
protected

Frame timestamp (clock_rate units)

Definition at line 218 of file IVideoDecoder.h.

◆ presentCallback

VideoPresentCallback* Cogs::Core::IVideoDecoder::presentCallback = nullptr
protected

Called when a frame is chosen for presentation.

Definition at line 196 of file IVideoDecoder.h.

◆ presentCallbackData

void* Cogs::Core::IVideoDecoder::presentCallbackData = nullptr
protected

Definition at line 197 of file IVideoDecoder.h.

◆ presentMode

VideoDecoderPresentMode Cogs::Core::IVideoDecoder::presentMode = VideoDecoderPresentMode::Latest
protected

How will frames be presented.

Definition at line 183 of file IVideoDecoder.h.

◆ previousClock

int64_t Cogs::Core::IVideoDecoder::previousClock = 0
protected

Previous monotonic clock now() (ns)

Definition at line 213 of file IVideoDecoder.h.

◆ previousClockResidual

int64_t Cogs::Core::IVideoDecoder::previousClockResidual = 0
protected

Definition at line 215 of file IVideoDecoder.h.

◆ previousPlayTime

int64_t Cogs::Core::IVideoDecoder::previousPlayTime = 0
protected

play time (realtime ns)

Definition at line 222 of file IVideoDecoder.h.

◆ previousPresentationTime

int64_t Cogs::Core::IVideoDecoder::previousPresentationTime = 0
protected

Frame timestamp (clock_rate units)

Definition at line 219 of file IVideoDecoder.h.

◆ renderTarget

RenderTargetHandle Cogs::Core::IVideoDecoder::renderTarget = Cogs::RenderTargetHandle::NoHandle
protected

Definition at line 235 of file IVideoDecoder.h.

◆ renderTexture

RenderTexture* Cogs::Core::IVideoDecoder::renderTexture = nullptr
protected

Definition at line 234 of file IVideoDecoder.h.

◆ skipDiscontinuities

bool Cogs::Core::IVideoDecoder::skipDiscontinuities = true
protected

Are discontinuities skipped?

Definition at line 184 of file IVideoDecoder.h.

◆ speedupFactor

float Cogs::Core::IVideoDecoder::speedupFactor = 1.0f
protected

Definition at line 192 of file IVideoDecoder.h.

◆ speedupQueueCount

uint32_t Cogs::Core::IVideoDecoder::speedupQueueCount = 3
protected

Definition at line 191 of file IVideoDecoder.h.

◆ surfaceCount

uint32_t Cogs::Core::IVideoDecoder::surfaceCount = 0
protected

Definition at line 187 of file IVideoDecoder.h.

◆ texture

Cogs::TextureHandle Cogs::Core::IVideoDecoder::texture = Cogs::TextureHandle::NoHandle
protected

Definition at line 233 of file IVideoDecoder.h.

◆ textureDesc

TextureDescription Cogs::Core::IVideoDecoder::textureDesc
protected

Definition at line 232 of file IVideoDecoder.h.

◆ transferFunction

TransferFunction Cogs::Core::IVideoDecoder::transferFunction = TransferFunction::sRGB
protected

Definition at line 209 of file IVideoDecoder.h.


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