修复CLSID_NullRenderer在mingw下头文件丢失导致找不到摄像头

master
a7458969 2020-05-16 15:36:47 +08:00
parent 587a642bbb
commit 0441204f6e
2 changed files with 21 additions and 2 deletions

View File

@ -2,7 +2,11 @@
#include <QApplication>
#include "cplaywidget.h"
#include <QTimer>
#include "CameraCapture.h"
void CameraDataCallback(double ts, BYTE *dat, LONG size){
qDebug()<<"reieve cnt"<<size;
}
int main(int argc, char *argv[])
{
@ -11,5 +15,18 @@ int main(int argc, char *argv[])
CPlayWidget x(nullptr);
x.show();
x.PlayOneFrame();
Camera *gCam = Camera::GetInstance();
std::vector<std::wstring> names = gCam->EnumAllCamera();
for(auto itr = names.begin();itr != names.end();itr++){
qDebug()<<QString::fromStdWString(*itr);
}
gCam->SetCallBack(CameraDataCallback);
if(gCam->Open(*names.begin()) ){
qDebug("open success");
}else{
qDebug("open fail");
}
return a.exec();
}

View File

@ -8,6 +8,7 @@ QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
QT += network
QT += multimedia
TARGET = yuvgl
TEMPLATE = app
@ -30,6 +31,7 @@ SOURCES += \
mainwindow.cpp \
cplaywidget.cpp \
media/AACAudioCoder.cpp \
media/CameraCapture.cpp \
utils/Base64.cpp \
utils/Debuger.cpp \
utils/utils.cpp
@ -48,8 +50,8 @@ message($$PWD/third/libs/)
LIBS += -L$$PWD/third/libs/
LIBS += -lws2_32
LIBS += -lm
LIBS += -lavformat -lavdevice -lavcodec -lavutil -lswresample -lpthread -lbz2 -lm -lfdk-aac -lx264 -lOle32 -lbcrypt -liconv -lucrtbase
LIBS += -lavformat -lavdevice -lavcodec -lavutil -lswresample -lpthread -lbz2 -lm -lfdk-aac -lx264 -lbcrypt -liconv -lucrtbase -lstrmiids -lGdi32
LIBS += -lole32 -loleAut32 -lquartz -ldxguid -ldxapi
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin