Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cVideoFSComp Class Reference

#include <cVideoFS.h>

Inheritance diagram for GrayLib::cVideoFSComp:
GrayLib::IVideoCompress GrayLib::cVideoFS

Public Member Functions

 cVideoFSComp (int nBlockX=k_BLOCK_DEF, int nBlockY=k_BLOCK_DEF)
 
 cVideoFSComp (const cVideoFSComp &copythis)
 
virtual ~cVideoFSComp ()
 
virtual HRESULT CompStart (const cSurfaceInfo &rInfo, cSurfaceBitmapInfo *pbiOut) override
 
virtual HRESULT CompFrame (const cSurfaceBase &frame, OUT const void *&rpCompRet, OUT size_t &rnSizeRet, OUT bool &rbIsKey) override
 
- Public Member Functions inherited from GrayLib::IVideoCompress
virtual ~IVideoCompress ()
 
virtual void CompEnd ()
 
virtual AV_QUALITY_t get_CompQuality () const
 

Protected Member Functions

void SetBlockDirty (int x, int y)
 
void UpdateBlockDirtyBits (const cSurfaceBase &frame)
 
size_t AddImageBlock (BYTE *pComp, INT_PTR nCompSizeMax, int row, int col)
 
- Protected Member Functions inherited from GrayLib::cVideoFS
 cVideoFS (int nBlockX=k_BLOCK_DEF, int nBlockY=k_BLOCK_DEF)
 
 ~cVideoFS ()
 
void UpdateBlockParams ()
 
BYTE * BuildCompFrameHeader (BYTE *pComp) const
 
bool isReady () const noexcept
 
int get_BlocksTotal () const noexcept
 
void GetBlockRect (int col, int row, cRectI &rect) const noexcept
 
 UNITTEST_FRIEND (cVideoFS)
 

Protected Attributes

cNewPtr< cColor888m_FrameLast
 The last full frame m_FrameSize. (diff against this) More...
 
cBitArrayStatic m_BlocksDirty
 are any of the pixels in the block changed? 2d array of m_Blocks More...
 
cHeapBlock m_CompFrame
 holder for the last compressed frame. key or diff. persisted for CompFrame( rpCompRet ) More...
 

Additional Inherited Members

- Public Attributes inherited from GrayLib::cVideoFS
cWinSize m_BlockSize
 Preconfigured size of the dirty block in pixels. (arbitrary 16..256, multiple of 16) More...
 
cWinSize m_FrameSize
 total size in pixels in Frame. More...
 
cWinSize m_Blocks
 Count of blocks = m_FrameSize / m_BlockSize. More...
 
UINT m_nFrameNum
 frame number in video stream so far. More...
 
cArrayVal< cColor888m_BlockTmp
 space to hold a block for (de)compression. m_BlockSize More...
 
- Static Public Attributes inherited from GrayLib::cVideoFS
static const int k_BLOCK_DEF = 32
 
static const FOURCC k_Form = ((DWORD)(BYTE)( 'F' ) | ((DWORD)(BYTE)( 'S' ) << 8) | ((DWORD)(BYTE)( 'V' ) << 16) | ((DWORD)(BYTE)( '1' ) << 24 ))
 

Detailed Description

the Adobe Flash 'screenshare' compressor. FOURCC(fsv1)

Constructor & Destructor Documentation

◆ cVideoFSComp() [1/2]

GrayLib::cVideoFSComp::cVideoFSComp ( int  nBlockX = k_BLOCK_DEF,
int  nBlockY = k_BLOCK_DEF 
)

◆ cVideoFSComp() [2/2]

GrayLib::cVideoFSComp::cVideoFSComp ( const cVideoFSComp copythis)

◆ ~cVideoFSComp()

GrayLib::cVideoFSComp::~cVideoFSComp ( )
virtual

Member Function Documentation

◆ AddImageBlock()

size_t GrayLib::cVideoFSComp::AddImageBlock ( BYTE *  pComp,
INT_PTR  nCompSizeMax,
int  row,
int  col 
)
protected

Take the image block from m_FrameLast and compress to pComp in m_CompFrame nCompSizeMax = sanity check on my buffer size.

Returns
compressed size of block.

◆ CompFrame()

HRESULT GrayLib::cVideoFSComp::CompFrame ( const cSurfaceBase frame,
OUT const void *&  rpCompRet,
OUT size_t &  rnSizeRet,
OUT bool &  rbIsKey 
)
overridevirtual

IVideoCompress compress a single frame into the stream.

Returns
count of dirty blocks. <0 = HRESULT

Implements GrayLib::IVideoCompress.

◆ CompStart()

HRESULT GrayLib::cVideoFSComp::CompStart ( const cSurfaceInfo rInfo,
cSurfaceBitmapInfo pbiOut 
)
overridevirtual

IVideoCompress Must call this again if the image size changes or the block size changes.

Returns
pbiOut = the compressed format info.

size of the frame.

Implements GrayLib::IVideoCompress.

◆ SetBlockDirty()

void GrayLib::cVideoFSComp::SetBlockDirty ( int  x,
int  y 
)
protected

Mark this block is changed. x,y = pixels.

◆ UpdateBlockDirtyBits()

void GrayLib::cVideoFSComp::UpdateBlockDirtyBits ( const cSurfaceBase frame)
protected

Discover which pixels/blocks have changed and copy them into the m_FrameLast

Member Data Documentation

◆ m_BlocksDirty

cBitArrayStatic GrayLib::cVideoFSComp::m_BlocksDirty
protected

are any of the pixels in the block changed? 2d array of m_Blocks

◆ m_CompFrame

cHeapBlock GrayLib::cVideoFSComp::m_CompFrame
protected

holder for the last compressed frame. key or diff. persisted for CompFrame( rpCompRet )

◆ m_FrameLast

cNewPtr<cColor888> GrayLib::cVideoFSComp::m_FrameLast
protected

The last full frame m_FrameSize. (diff against this)


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