|
- DWORD dwFuncMode = BRAC_FUNC_VIDEO_AUTODISP | BRAC_FUNC_AUDIO_AUTOPLAY | BRAC_FUNC_CHKDEPENDMODULE |
- BRAC_FUNC_AUDIO_VOLUMECALC | BRAC_FUNC_NET_SUPPORTUPNP | BRAC_FUNC_FIREWALL_OPEN |
- BRAC_FUNC_AUDIO_AUTOVOLUME| BRAC_FUNC_AUDIO_VOLUMECALC | BRAC_FUNC_CONFIG_LOCALINI | BRAC_FUNC_VIDEO_CBDATA;
- BRAC_InitSDK((HWND*)this->winId(),dwFuncMode);
- DWORD dw = BRAC_SetVideoDataCallBack(BRAC_PIX_FMT_RGB24,VideoData_CallBack,this);
- qDebug()<<"dw"<<(int)dw;
- BRAC_SetAudioDataCallBack(AudioData_CallBack,this);
- BRAC_SetVolumeChangeCallBack(VolumeChange_CallBack,this);
- BRAC_SetTransBufferExCallBack(TransBufferEx_CallBack,this);
- BRAC_SetTransBufferCallBack(TransBuffer_CallBack,this);
- BRAC_SetTransFileCallBack(TransFile_CallBack,this);
- BRAC_SetRecordSnapShotCallBack(RecordSnapShot_CallBack,this);
- BRAC_SetSDKFilterDataCallBack(SDKFilterData_CallBack,this);
复制代码
- void MainWindow::DrawUserVideo(DWORD dwUserid, LPVOID lpBuf, DWORD dwLen, BITMAPINFOHEADER bmiHeader)
- {
- BITMAPINFOHEADER *lpbmi = (BITMAPINFOHEADER*)malloc(sizeof(BITMAPINFOHEADER)+dwLen);
- memset( lpbmi, 0 ,sizeof(BITMAPINFOHEADER)+dwLen);
- memcpy((LPBYTE)lpbmi,&bmiHeader,sizeof(bmiHeader));
- memcpy(((LPBYTE)lpbmi+sizeof(BITMAPINFOHEADER)),lpBuf,dwLen);
- qDebug()<<"bmiHeader.biWidth"<<bmiHeader.biWidth;
- qDebug()<<"bmiHeader.biHeight"<<bmiHeader.biHeight;
- QImage *image;
- int width = bmiHeader.biWidth;
- int height = bmiHeader.biHeight;
- image=new QImage(width,height,QImage::Format_RGB888);
- image->loadFromData((uchar *)lpBuf,dwLen);
- image->save(tr("/hxy/%1.bmp").arg(QTime::currentTime().toString("hhmmss")));
- delete image;
- delete lpbmi;
复制代码 上面保存出来来的图片,很不稳定,一会正常,一会出现花屏,或者图片只有半截,分辨率也很低。
同时终端里出现下面语句
[swscaler @ 0x9f68b20] No accelerated colorspace conversion found from yuv420p to bgr24.
环境: 服务器 ubuntu12.04
客户端 ubuntu10.04
编辑器 QT4.8
|
|