Feature: Support recording video in remote desktop control
This commit is contained in:
55
server/2015Remote/Bmp2Video.h
Normal file
55
server/2015Remote/Bmp2Video.h
Normal file
@@ -0,0 +1,55 @@
|
||||
#pragma once
|
||||
#include <Vfw.h>
|
||||
#pragma comment(lib,"Vfw32.lib")
|
||||
|
||||
#define ERR_INVALID_PARAM 1
|
||||
#define ERR_NO_ENCODER 2
|
||||
#define ERR_INTERNAL 3
|
||||
#define ERR_NOT_SUPPORT 4
|
||||
|
||||
enum FCCHandler {
|
||||
ENCODER_BMP = BI_RGB,
|
||||
ENCODER_MJPEG = mmioFOURCC('M', 'J', 'P', 'G'),
|
||||
// <20><>װx264vfw<66><77><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: https://sourceforge.net/projects/x264vfw/
|
||||
ENCODER_H264 = mmioFOURCC('X', '2', '6', '4'),
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
* @class CBmpToAvi
|
||||
* @brief λͼתAVI֡
|
||||
************************************************************************/
|
||||
class CBmpToAvi
|
||||
{
|
||||
public:
|
||||
CBmpToAvi();
|
||||
virtual ~CBmpToAvi();
|
||||
int Open(LPCTSTR szFile, LPBITMAPINFO lpbmi, int rate = 4, FCCHandler h = ENCODER_BMP);
|
||||
bool Write(unsigned char* lpBuffer);
|
||||
void Close();
|
||||
static std::string GetErrMsg(int result) {
|
||||
switch (result) {
|
||||
case ERR_INVALID_PARAM:
|
||||
return ("<EFBFBD><EFBFBD>Ч<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
|
||||
case ERR_NOT_SUPPORT:
|
||||
return ("<EFBFBD><EFBFBD>֧<EFBFBD>ֵ<EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD>ȣ<EFBFBD><EFBFBD><EFBFBD>Ҫ24λ<EFBFBD><EFBFBD>32λ");
|
||||
case ERR_NO_ENCODER:
|
||||
return ("δ<EFBFBD><EFBFBD>װx264<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> \n<EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD>ַ<EFBFBD><EFBFBD>https://sourceforge.net/projects/x264vfw");
|
||||
case ERR_INTERNAL:
|
||||
return("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>AVI<EFBFBD>ļ<EFBFBD>ʧ<EFBFBD><EFBFBD>");
|
||||
default:
|
||||
return "succeed";
|
||||
}
|
||||
}
|
||||
private:
|
||||
FCCHandler m_fccHandler;
|
||||
PAVIFILE m_pfile;
|
||||
PAVISTREAM m_pavi;
|
||||
int m_nFrames;
|
||||
static AVISTREAMINFO m_si; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD>Ǿ<EFBFBD>̬<EFBFBD><CCAC>
|
||||
|
||||
int m_bitCount = 24;
|
||||
int m_width = 1920;
|
||||
int m_height = 1080;
|
||||
int m_quality = 90;
|
||||
HIC m_hic = NULL;
|
||||
};
|
||||
Reference in New Issue
Block a user