📄 h263decoder.cpp
字号:
// H263decoder.cpp: implementation of the CH263Decoder class.
//
//////////////////////////////////////////////////////////////////////
#include "H263decoder.h"
#include "bitstream.h"
#include "byteordr.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CH263Decoder::CH263Decoder()
{
pDecoder = NULL;
pDecoder = new CBitStream();
if(pDecoder)
pDecoder->ATInitH263Decode();
}
CH263Decoder::~CH263Decoder()
{
if(pDecoder)
pDecoder->ATDestroyH263Decode();
if(NULL !=pDecoder)
delete pDecoder;
pDecoder = NULL;
}
int CH263Decoder::ATDecodeH263Frame(unsigned char *buffer, int length, unsigned char **rgb, int *width, int *height)
{
if (pDecoder == NULL) {
return -1;}
return pDecoder->ATDecodeH263Frame(buffer+4,length-4,rgb,width,height);
}
//void CH263Decoder::SetDecoderUsing(bool bUse)
//{
// m_bIsUsing = bUse;
//}
//bool CH263Decoder::GetDecoderUsing()
//{
// return m_bIsUsing;
//}
bool CH263Decoder::IsKeyFrame(unsigned char *buffer)
{
return pDecoder->IsKeyFrame(buffer + 4);
}
unsigned long CH263Decoder::GetTimeStamp(unsigned char *buffer)
{
return Net2HostLong(*(unsigned long*)buffer);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -