no message
parent
b872dbf500
commit
e0cf4f960f
|
@ -82,24 +82,9 @@ void CameraVideoSink::OnFrame(const webrtc::VideoFrame& frame) {
|
|||
cnt++;
|
||||
int width = this->m_capability.width;
|
||||
int height = this->m_capability.height;
|
||||
<<<<<<< HEAD
|
||||
webrtc::VideoCaptureCapability cap;
|
||||
int ret = this->Capability(cap);
|
||||
if(ret < 0)
|
||||
return ;
|
||||
qDebug()<<cap.height<<cap.width
|
||||
<<int(cap.videoType)
|
||||
<<int(webrtc::VideoType::kI420)
|
||||
<<cap.interlaced<<width * height*4;
|
||||
|
||||
uint8_t *data =
|
||||
new uint8_t[width * height*4];
|
||||
qDebug()<<width*height<<int(frameBuffer->GetI420()->type());
|
||||
=======
|
||||
|
||||
uint8_t *data = new uint8_t[width * height*4];
|
||||
// qDebug()<<width*height<<int(frameBuffer->GetI420()->type());
|
||||
>>>>>>> ceaccb7db090d07a75d14c43e07a96773ac1e9a6
|
||||
memcpy(data,frameBuffer->GetI420()->DataY(),width*height);
|
||||
memcpy(data + width*height ,frameBuffer->GetI420()->DataU(),
|
||||
width*height/4);
|
||||
|
@ -120,13 +105,9 @@ void CameraVideoSink::OnFrame(const webrtc::VideoFrame& frame) {
|
|||
}
|
||||
|
||||
|
||||
int CameraVideoSink::Capability(webrtc::VideoCaptureCapability &cap)
|
||||
webrtc::VideoCaptureCapability CameraVideoSink::Capability()
|
||||
{
|
||||
if(nullptr != this)
|
||||
cap = this->m_capability;
|
||||
else
|
||||
return -1;
|
||||
return 0;
|
||||
return this->m_capability;
|
||||
}
|
||||
|
||||
uint8_t *FrameBufferList::TakeLast()
|
||||
|
|
|
@ -31,7 +31,7 @@ public:
|
|||
size_t capture_device_index);
|
||||
virtual ~CameraVideoSink();
|
||||
void OnFrame(const webrtc::VideoFrame& frame) override;
|
||||
int Capability(webrtc::VideoCaptureCapability &cap);
|
||||
webrtc::VideoCaptureCapability Capability();
|
||||
FrameBufferList *VideoBuffer(){
|
||||
return &this->m_buf;
|
||||
}
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
#include <QMetaType>
|
||||
#include "cv_ssd.h"
|
||||
|
||||
|
||||
# pragma comment(lib, "secur32.lib")
|
||||
# pragma comment(lib, "winmm.lib")
|
||||
# pragma comment(lib, "dmoguids.lib")
|
||||
|
@ -22,7 +21,6 @@
|
|||
# pragma comment(lib, "Strmiids.lib")
|
||||
# pragma comment(lib, "User32.lib")
|
||||
|
||||
|
||||
int BubbleSort(int *p,int len){
|
||||
if(nullptr == p)
|
||||
return -1;
|
||||
|
@ -89,7 +87,7 @@ int main(int argc, char *argv[])
|
|||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||
QApplication a(argc, argv);
|
||||
MainWindow w;
|
||||
w.setWindowTitle("webrtc easy demo");
|
||||
w.setWindowTitle("learning tool");
|
||||
w.show();
|
||||
return a.exec();
|
||||
}
|
||||
|
|
|
@ -187,30 +187,6 @@ void MainWindow::on_pushButton_clicked()
|
|||
info->GetCapability(ids,id,p);
|
||||
qDebug()<<QString::asprintf("GetCapability: %d %d %d %d",id,p.width,p.height,p.maxFPS);
|
||||
|
||||
<<<<<<< HEAD
|
||||
char ids[128];
|
||||
info->GetDeviceName(id,nullptr,0,ids,128,nullptr,0);
|
||||
info->GetCapability(ids,id,p);
|
||||
qDebug()<<QString::asprintf("GetCapability: %d %d %d %d",id,p.width,p.height,p.maxFPS);
|
||||
|
||||
m_capturer.reset(CameraVideoSink::Create(p.width, p.height, 25, id));
|
||||
if (!m_capturer) {
|
||||
qDebug()<<"error";
|
||||
}
|
||||
webrtc::VideoCaptureCapability cap;
|
||||
int ret = m_capturer->Capability(cap);
|
||||
if(ret < 0)
|
||||
return;
|
||||
ui->openGLWidget->SetDataType(CPlayWidget::TYPE_YUV420P);
|
||||
ui->openGLWidget->SetImgSize(cap.width,
|
||||
cap.height);
|
||||
ui->openGLWidget->StartRender();
|
||||
// ui->openGLWidget->moveToThread(&gRender->Thread());
|
||||
if(gRender == nullptr){
|
||||
gRender = new AsyncRennder(this,m_capturer->VideoBuffer(),ui->openGLWidget);
|
||||
gRender->Start(this);
|
||||
connect(gRender,&QSSASyncProcess::Done,this,&MainWindow::RenderDone);
|
||||
=======
|
||||
m_capturer.reset(CameraVideoSink::Create(p.width, p.height, 25, id));
|
||||
if (!m_capturer) {
|
||||
qDebug()<<"error";
|
||||
|
@ -231,7 +207,6 @@ void MainWindow::on_pushButton_clicked()
|
|||
ui->pushButton->setText(QString::asprintf("正在采集"));
|
||||
}else{
|
||||
ui->openGLWidget->StopRender();
|
||||
>>>>>>> ceaccb7db090d07a75d14c43e07a96773ac1e9a6
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue