no message
parent
752e284510
commit
6dc338bad5
|
@ -91,9 +91,11 @@ void CameraVideoSink::OnFrame(const webrtc::VideoFrame& frame) {
|
|||
new uint8_t[width * height*4];
|
||||
qDebug()<<width*height<<int(frameBuffer->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<std::chrono::milliseconds>(
|
||||
|
|
|
@ -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){
|
||||
|
|
|
@ -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<webrtc::I420BufferInterface>&
|
|||
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<webrtc::VideoCaptureModule::DeviceInfo> info(
|
||||
webrtc::VideoCaptureFactory::CreateDeviceInfo());
|
||||
|
||||
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";
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
<string>MainWindow</string>
|
||||
</property>
|
||||
<widget class="QWidget" name="centralwidget">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="1,12">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="1,9">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,1,1,1,1,3">
|
||||
<item>
|
||||
|
@ -72,7 +72,11 @@
|
|||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="CPlayWidget" name="openGLWidget"/>
|
||||
<layout class="QGridLayout" name="gridLayout" rowstretch="0" columnstretch="0">
|
||||
<item row="0" column="0">
|
||||
<widget class="CPlayWidget" name="openGLWidget"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue