1 Star 1 Fork 1

柏松/DShowCaptureToLocal

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
SampleGrabberCB.h 1.70 KB
一键复制 编辑 原始数据 按行查看 历史
柏松 提交于 2017-08-31 15:25 . 加入回调函数中控制帧率
#pragma once
#pragma include_alias( "dxtrans.h", "qedit.h" )
#define __IDxtCompositor_INTERFACE_DEFINED__
#define __IDxtAlphaSetter_INTERFACE_DEFINED__
#define __IDxtJpeg_INTERFACE_DEFINED__
#define __IDxtKey_INTERFACE_DEFINED__
#include "qedit.h"
//---------------ṹ-----------------
#include <vector>
using namespace std;
struct GrabDataInfo
{
BYTE *pData;
int nDataSize;
double dSampleTime;
GrabDataInfo()
{
pData = NULL;
nDataSize = 0;
dSampleTime = 0.0;
};
GrabDataInfo(const GrabDataInfo &other)
{
*this = other;
};
GrabDataInfo& operator = (const GrabDataInfo& other)
{
pData = other.pData;
nDataSize = other.nDataSize;
dSampleTime = other.dSampleTime;
return *this;
};
};
typedef vector<GrabDataInfo> ASGrabDataInfoArray;
//---------------ṹ-----------------
class CSampleGrabberCB :
public ISampleGrabberCB
{
public:
CSampleGrabberCB(void);
virtual ~CSampleGrabberCB(void);
public:
long lWidth;
long lHeight;
BOOL m_bBeginEncode;
BOOL m_bFirst;
BOOL m_bEndEncode;
//CString m_sSavePath;
ULONG m_ulBitRate;
//FILE* m_fp_dst;
//x264_param_t* m_pParam;
//x264_picture_t* m_pPic_in;
//x264_picture_t* m_pPic_out;
//x264_t* m_pHandle;
int m_nFrameIndex;
ASGrabDataInfoArray m_arrGrabDataArr;
//CMutex m_mxMsgLog;
HANDLE m_hMainExitEvent;
public:
ULONG STDMETHODCALLTYPE AddRef();
ULONG STDMETHODCALLTYPE Release();
HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void ** ppv);
HRESULT STDMETHODCALLTYPE SampleCB(double SampleTime, IMediaSample *pSample);
HRESULT STDMETHODCALLTYPE BufferCB(double SampleTime, BYTE *pBuffer, long BufferLen);
BOOL RGB2YUV(LPBYTE RgbBuf, UINT nWidth, UINT nHeight, LPBYTE yuvBuf, unsigned long *len);
void VideoDeal();
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/poisson/DShowCaptureToLocal.git
git@gitee.com:poisson/DShowCaptureToLocal.git
poisson
DShowCaptureToLocal
DShowCaptureToLocal
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385