6 #ifndef _INC_cVideoFS_H
7 #define _INC_cVideoFS_H
14 #include "../Math/cBitArray.h"
15 #include "../Image/cSurfaceBase.h"
16 #include "../Geometry/cRectI.h"
34 static const int k_BLOCK_DEF = 32;
45 cVideoFS(
int nBlockX = k_BLOCK_DEF,
int nBlockY = k_BLOCK_DEF);
48 void UpdateBlockParams();
49 BYTE* BuildCompFrameHeader(BYTE* pComp)
const;
53 return m_Blocks.cx && m_Blocks.cy;
57 return m_Blocks.cx*m_Blocks.cy;
63 rect.left = col * m_BlockSize.cx;
64 rect.top = row * m_BlockSize.cy;
65 rect.right = (col >= m_Blocks.cx - 1) ? m_FrameSize.cx : (
rect.left + m_BlockSize.cx);
66 rect.bottom = (row >= m_Blocks.cy - 1) ? m_FrameSize.cy : (
rect.top + m_BlockSize.cy);
85 void SetBlockDirty(
int x,
int y);
87 size_t AddImageBlock(BYTE* pComp, INT_PTR nCompSizeMax,
int row,
int col);
90 cVideoFSComp(
int nBlockX = k_BLOCK_DEF,
int nBlockY = k_BLOCK_DEF);
96 virtual HRESULT CompFrame(
const cSurfaceBase& frame, OUT
const void*& rpCompRet, OUT
size_t& rnSizeRet, OUT
bool& rbIsKey)
override;
106 virtual HRESULT DecompFrame(
const void* pCompData,
size_t nSizeComp,
cSurfaceBase& frame)
override;
128 void UpdateBlockParams();
139 virtual HRESULT OnHeaderStream(
const cAVHeaderStream& head,
const void* pForm,
size_t nSizeForm)
override;
143 virtual HRESULT BuildCompFrame(
TIMESYS_t tWhenLast,
const void*& rpCompRet,
size_t& rnSizeRet)
override;
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
INT32 HRESULT
_WIN32 style error codes. INT32
Definition: SysTypes.h:465
UINT32 FOURCC
32 bit code. Also defined in _MMSYSTEM_H
Definition: cFourCC.h:19
#define MAKEFOURCC(ch0, ch1, ch2, ch3)
Definition: cFourCC.h:24
Definition: cAVSink.h:231
Definition: cBitArray.h:28
Definition: cSurfaceBase.h:26
Definition: cSurfaceInfo.h:308
Definition: cSurfaceInfo.h:109
Definition: cVideoFS.h:73
cHeapBlock m_CompFrame
holder for the last compressed frame. key or diff. persisted for CompFrame( rpCompRet )
Definition: cVideoFS.h:82
cNewPtr< cColor888 > m_FrameLast
The last full frame m_FrameSize. (diff against this)
Definition: cVideoFS.h:78
cBitArrayStatic m_BlocksDirty
are any of the pixels in the block changed? 2d array of m_Blocks
Definition: cVideoFS.h:81
Definition: cVideoFS.h:100
Definition: cVideoFS.h:110
virtual ~cVideoFSRateController()
Definition: cVideoFS.h:134
cVideoFSRateController()
Definition: cVideoFS.h:131
cArrayStruct< CBlock > m_aBlocks
the blocks making up the current frame.
Definition: cVideoFS.h:124
cHeapBlock m_CompFrame
holder for the last compressed frame. key or diff. persisted for BuildCompFrame( rpCompRet )
Definition: cVideoFS.h:125
Definition: cVideoFS.h:26
cWinSize m_Blocks
Count of blocks = m_FrameSize / m_BlockSize.
Definition: cVideoFS.h:40
void GetBlockRect(int col, int row, cRectI &rect) const noexcept
Definition: cVideoFS.h:60
int get_BlocksTotal() const noexcept
Definition: cVideoFS.h:55
UNITTEST_FRIEND(cVideoFS)
cWinSize m_BlockSize
Preconfigured size of the dirty block in pixels. (arbitrary 16..256, multiple of 16)
Definition: cVideoFS.h:37
cArrayVal< cColor888 > m_BlockTmp
space to hold a block for (de)compression. m_BlockSize
Definition: cVideoFS.h:42
bool isReady() const noexcept
Definition: cVideoFS.h:51
UINT m_nFrameNum
frame number in video stream so far.
Definition: cVideoFS.h:41
cWinSize m_FrameSize
total size in pixels in Frame.
Definition: cVideoFS.h:38
Definition: WinTypes.h:128
Definition: cTimeSys.h:93
interface const RECTQ_t & rect
Definition: cQuadtree.h:44
UINT32 TIMESYS_t
TIMESYS_t = The normal system tick timer. milli-seconds since start of system/app ?
Definition: cTimeSys.h:27
Definition: cVideoCodec.h:25
Definition: cVideoCodec.h:45
Definition: cVideoFS.h:117
cTimeSys m_tUpdated
When was this last built/current.
Definition: cVideoFS.h:120
cHeapBlock m_Compressed
store a compressed key frame block.
Definition: cVideoFS.h:121