Valkka  1.6.1
OpenSource Video Management
Public Member Functions | Public Attributes | Private Attributes | List of all members
SlotContext Class Reference

Each Frame carries information about it's slot number in Frame::slot. More...

#include <openglthread.h>

Collaboration diagram for SlotContext:
Collaboration graph
[legend]

Public Member Functions

 SlotContext (YUVTEX *statictex, YUVShader *shader)
 Default constructor.
 
 ~SlotContext ()
 Default destructor.
 
 ban_copy_ctor (SlotContext)
 
 ban_copy_asm (SlotContext)
 
void activate (BitmapPars bmpars)
 Allocate SlotContext::yuvtex (for a frame of certain size)
 
void deActivate ()
 Deallocate textures.
 
void loadYUVFrame (YUVFrame *yuvframe)
 Load bitmap from YUVFrame to SlotContext::yuvtex.
 
YUVTEXgetTEX ()
 Returns the relevant texture set (static or live)
 
bool manageTimer (long int mstime)
 Updates SlotContext::lastmstime. Returns false if too little time has passed since receiving the last frame.
 
void checkIfDead (long int mstime)
 Compares SlotContext::lastmstime to mstime and changes the state of SlotContext::is_dead.
 
bool isPending (long int mstime)
 Compares SlotContext::lastmstime to mstime and returns true of a treshold is met (if last frame was received long time ago)
 
bool isUsed () const
 
bool isDead () const
 
void inc_ref_count ()
 
void dec_ref_count ()
 
void loadFlag (bool val)
 
void keepFlag (bool val)
 

Public Attributes

YUVTEXyuvtex
 This could be a base class for different kinds of textures (now only YUVTEX)
 
YUVTEXstatictex
 A static texture to be shown on the screen if no video is received.
 
YUVShadershader
 Base class for the chosen Shader for this slot. Now always YUVShader.
 
BitmapPars bmpars
 
long int lastmstime
 Last millisecond timestamp when this slot received a frame.
 

Private Attributes

uint ref_count
 
bool active
 Is activated or not. Active = has received a setup frame.
 
bool is_dead
 Has received frames or not for a while ?
 
AVCodecID codec_id
 FFmpeg codec id.
 
bool load_flag
 This flag is cleared when a new frame is loaded.
 
bool keep_flag
 Should we keep on showing the previous frame, even if the slot is_dead?
 
long int prev_mstimestamp
 for debugging: check if frames are fed in correct timestamp order
 

Detailed Description

Each Frame carries information about it's slot number in Frame::slot.

Slot number identifies the origin of the stream. When the bitmap Frame arrives to OpenGLThread, each stream/slot requires:

This class encapsulates all that. SlotContext can be in an active (with textures reserved and shaders set) or in an inactive state.


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