diff --git a/client/webrtc_capture/src/camera_video_sink.cpp b/client/webrtc_capture/src/camera_video_sink.cpp index 40ea1a6..cd55558 100644 --- a/client/webrtc_capture/src/camera_video_sink.cpp +++ b/client/webrtc_capture/src/camera_video_sink.cpp @@ -91,9 +91,11 @@ void CameraVideoSink::OnFrame(const webrtc::VideoFrame& frame) { new uint8_t[width * height*4]; qDebug()<GetI420()->type()); memcpy(data,frameBuffer->GetI420()->DataY(),width*height); - memcpy(data + width*height ,frameBuffer->GetI420()->DataU(),width*height/4); + memcpy(data + width*height ,frameBuffer->GetI420()->DataU(), + width*height/4); memcpy(data + width*height + width*height/4, - frameBuffer->GetI420()->DataY(),width*height/4); + frameBuffer->GetI420()->DataV(), + width*height/4); m_buf.PushFirst(data); auto timestamp_curr = std::chrono::duration_cast( diff --git a/client/webrtc_capture/src/cplaywidget.cpp b/client/webrtc_capture/src/cplaywidget.cpp index 6cf0960..4a344e1 100644 --- a/client/webrtc_capture/src/cplaywidget.cpp +++ b/client/webrtc_capture/src/cplaywidget.cpp @@ -199,17 +199,11 @@ void CPlayWidget::initializeGL() } #define PROGRAM_VERTEX_ATTRIBUTE 0 #define PROGRAM_TEXCOORD_ATTRIBUTE 1 - m_pShaderProgram = new QOpenGLShaderProgram; - m_pShaderProgram->addShader(m_pFSHader); - m_pShaderProgram->addShader(m_pVSHader); - m_pShaderProgram->bindAttributeLocation("vertexIn", ATTRIB_VERTEX); - m_pShaderProgram->bindAttributeLocation("textureIn", ATTRIB_TEXTURE); - m_pShaderProgram->link(); m_pShaderProgram->bind(); if(this->mType == TYPE_YUV420P){ diff --git a/client/webrtc_capture/src/mainwindow.cpp b/client/webrtc_capture/src/mainwindow.cpp index 52b3a1c..b837274 100644 --- a/client/webrtc_capture/src/mainwindow.cpp +++ b/client/webrtc_capture/src/mainwindow.cpp @@ -58,10 +58,6 @@ MainWindow::MainWindow(QWidget *parent) char name[100]; info->GetDeviceName(i,name,100,nullptr,0,nullptr,0); ui->comboBox->addItem(QString::asprintf("%s",name),i); -// capturer.reset(CameraVideoSink::Create(kWidth, kHeight, kFps, i)); -// if (capturer) { -// break; -// } } } @@ -79,8 +75,17 @@ void MainWindow::OnUpdateFrame( rtc::scoped_refptr& void MainWindow::on_pushButton_clicked() { int id = ui->comboBox->currentData().toInt(); + webrtc::VideoCaptureCapability p; - m_capturer.reset(CameraVideoSink::Create(1280, 800, 25, id)); + std::unique_ptr info( + webrtc::VideoCaptureFactory::CreateDeviceInfo()); + + char ids[128]; + info->GetDeviceName(id,nullptr,0,ids,128,nullptr,0); + info->GetCapability(ids,id,p); + qDebug()<MainWindow - + @@ -72,7 +72,11 @@ - + + + + + diff --git a/client/webrtc_capture/webrtc_capture.pro b/client/webrtc_capture/webrtc_capture.pro index 81f2da9..ddeffaa 100644 --- a/client/webrtc_capture/webrtc_capture.pro +++ b/client/webrtc_capture/webrtc_capture.pro @@ -1,6 +1,6 @@ QT += core gui -include(D:\\project\\qt_project\\qsswraper\\qsswraper.pri) +include(D:\\project\\c++qt\\qsswraper\\qsswraper.pri) RESOURCES += $$PWD/qss/qss.qrc greaterThan(QT_MAJOR_VERSION, 4): QT += widgets