mirror of
https://gitee.com/drabel/LibQQt.git
synced 2025-01-04 10:18:44 +08:00
update qqt logic video manager
This commit is contained in:
parent
0ffec43d63
commit
a18ffcf2b5
@ -1,9 +1,9 @@
|
||||
#include <qqtlogicvideomanager_p.h>
|
||||
#include <qqtlogicvideomanager.h>
|
||||
|
||||
int QQtLogicVideoManagerPrivate::sDmmuRefCount = 0;
|
||||
int QQtLogicVideoInputPrivate::sDmmuRefCount = 0;
|
||||
|
||||
QQtLogicVideoManagerPrivate::QQtLogicVideoManagerPrivate ( QQtLogicVideoManager* q, QObject* parent )
|
||||
QQtLogicVideoInputPrivate::QQtLogicVideoInputPrivate ( QQtLogicVideoInput* q, QObject* parent )
|
||||
: q_ptr ( q ), QObject ( parent )
|
||||
{
|
||||
memset ( &sinfo, 0, sizeof ( struct sensor_info ) );
|
||||
@ -42,7 +42,7 @@ QQtLogicVideoManagerPrivate::QQtLogicVideoManagerPrivate ( QQtLogicVideoManager*
|
||||
sDmmuRefCount++;
|
||||
}
|
||||
|
||||
QQtLogicVideoManagerPrivate::~QQtLogicVideoManagerPrivate()
|
||||
QQtLogicVideoInputPrivate::~QQtLogicVideoInputPrivate()
|
||||
{
|
||||
sDmmuRefCount--;
|
||||
if ( sDmmuRefCount <= 0 )
|
||||
@ -51,18 +51,18 @@ QQtLogicVideoManagerPrivate::~QQtLogicVideoManagerPrivate()
|
||||
}
|
||||
}
|
||||
|
||||
void QQtLogicVideoManagerPrivate::init_dmmu()
|
||||
void QQtLogicVideoInputPrivate::init_dmmu()
|
||||
{
|
||||
dmmu_init();
|
||||
dmmu_get_page_table_base_phys ( &tlb_base_phys );
|
||||
}
|
||||
|
||||
void QQtLogicVideoManagerPrivate::deinit_dmmu()
|
||||
void QQtLogicVideoInputPrivate::deinit_dmmu()
|
||||
{
|
||||
dmmu_deinit();
|
||||
}
|
||||
|
||||
bool QQtLogicVideoManagerPrivate::open ( QString devName )
|
||||
bool QQtLogicVideoInputPrivate::open ( QString devName )
|
||||
{
|
||||
//待测试
|
||||
close();
|
||||
@ -175,7 +175,7 @@ bool QQtLogicVideoManagerPrivate::open ( QString devName )
|
||||
return true;
|
||||
}
|
||||
|
||||
bool QQtLogicVideoManagerPrivate::close()
|
||||
bool QQtLogicVideoInputPrivate::close()
|
||||
{
|
||||
timer->stop();
|
||||
|
||||
@ -210,7 +210,7 @@ bool QQtLogicVideoManagerPrivate::close()
|
||||
return true;
|
||||
}
|
||||
|
||||
void QQtLogicVideoManagerPrivate::slotSendImageToClient()
|
||||
void QQtLogicVideoInputPrivate::slotSendImageToClient()
|
||||
{
|
||||
if ( fd <= 0 )
|
||||
return;
|
||||
|
@ -23,14 +23,14 @@ extern "C" {
|
||||
|
||||
#include <qqtimageconverter.h>
|
||||
|
||||
class QQtLogicVideoManager;
|
||||
class QQtLogicVideoManagerPrivate : public QObject
|
||||
class QQtLogicVideoInput;
|
||||
class QQtLogicVideoInputPrivate : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit QQtLogicVideoManagerPrivate ( QQtLogicVideoManager* q, QObject* parent = 0 );
|
||||
virtual ~QQtLogicVideoManagerPrivate();
|
||||
explicit QQtLogicVideoInputPrivate ( QQtLogicVideoInput* q, QObject* parent = 0 );
|
||||
virtual ~QQtLogicVideoInputPrivate();
|
||||
|
||||
bool open ( QString devName );
|
||||
bool close();
|
||||
@ -70,8 +70,8 @@ private:
|
||||
protected:
|
||||
|
||||
private:
|
||||
Q_DECLARE_PUBLIC ( QQtLogicVideoManager )
|
||||
QQtLogicVideoManager* q_ptr;
|
||||
Q_DECLARE_PUBLIC ( QQtLogicVideoInput )
|
||||
QQtLogicVideoInput* q_ptr;
|
||||
|
||||
static int sDmmuRefCount;
|
||||
};
|
||||
|
@ -6,7 +6,7 @@ QQtLogicPreviewWidget::QQtLogicPreviewWidget ( QWidget* parent ) :
|
||||
ui ( new Ui::QQtLogicPreviewWidget )
|
||||
{
|
||||
ui->setupUi ( this );
|
||||
manager = new QQtLogicVideoManager ( this );
|
||||
manager = new QQtLogicVideoInput ( this );
|
||||
connect ( manager, SIGNAL ( readyRead ( const QImage& ) ),
|
||||
this, SLOT ( slotReadyRead ( const QImage& ) ) );
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ private:
|
||||
QRect geome;
|
||||
Qt::WindowFlags flags;
|
||||
|
||||
QQtLogicVideoManager* manager;
|
||||
QQtLogicVideoInput* manager;
|
||||
QImage mImage;
|
||||
// QWidget interface
|
||||
protected:
|
||||
|
@ -1,25 +1,45 @@
|
||||
#include "qqtlogicvideomanager.h"
|
||||
#include "qqtlogicvideomanager_p.h"
|
||||
|
||||
QQtLogicVideoManager::QQtLogicVideoManager ( QObject* parent ) :
|
||||
d_ptr ( new QQtLogicVideoManagerPrivate ( this, this ) ), QObject ( parent )
|
||||
QQtLogicVideoInput::QQtLogicVideoInput ( QObject* parent ) :
|
||||
d_ptr ( new QQtLogicVideoInputPrivate ( this, this ) ), QObject ( parent )
|
||||
{
|
||||
}
|
||||
|
||||
QQtLogicVideoManager::~QQtLogicVideoManager()
|
||||
QQtLogicVideoInput::~QQtLogicVideoInput()
|
||||
{
|
||||
Q_D ( QQtLogicVideoManager );
|
||||
Q_D ( QQtLogicVideoInput );
|
||||
d->deleteLater();
|
||||
}
|
||||
|
||||
bool QQtLogicVideoManager::open ( QString devName )
|
||||
bool QQtLogicVideoInput::open ( QString devName )
|
||||
{
|
||||
Q_D ( QQtLogicVideoManager );
|
||||
Q_D ( QQtLogicVideoInput );
|
||||
return d->open ( devName );
|
||||
}
|
||||
|
||||
bool QQtLogicVideoManager::close()
|
||||
bool QQtLogicVideoInput::close()
|
||||
{
|
||||
Q_D ( QQtLogicVideoManager );
|
||||
Q_D ( QQtLogicVideoInput );
|
||||
return d->close();
|
||||
}
|
||||
|
||||
QQtLogicVideoManager::QQtLogicVideoManager ( QObject* parent )
|
||||
: QObject ( parent )
|
||||
{
|
||||
mInputManager = new QQtLogicVideoInput ( this );
|
||||
connect ( mInputManager, SIGNAL ( readyRead ( const QImage& ) ),
|
||||
this, SIGNAL ( readyRead ( const QImage& ) ) );
|
||||
}
|
||||
|
||||
QQtLogicVideoManager::~QQtLogicVideoManager() {}
|
||||
|
||||
bool QQtLogicVideoManager::openInput ( QString devName )
|
||||
{
|
||||
return mInputManager->open ( devName );
|
||||
}
|
||||
|
||||
bool QQtLogicVideoManager::closeInput()
|
||||
{
|
||||
return mInputManager->close();
|
||||
}
|
||||
|
@ -6,17 +6,17 @@
|
||||
|
||||
#include "qqt-local.h"
|
||||
/**
|
||||
* @brief The QQtLogicVideoManager class
|
||||
* @brief The QQtLogicVideoInput class
|
||||
* 模拟摄像头管理器
|
||||
*/
|
||||
class QQtLogicVideoManagerPrivate;
|
||||
class QQTSHARED_EXPORT QQtLogicVideoManager : public QObject
|
||||
class QQtLogicVideoInputPrivate;
|
||||
class QQTSHARED_EXPORT QQtLogicVideoInput : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit QQtLogicVideoManager ( QObject* parent = 0 );
|
||||
virtual ~QQtLogicVideoManager();
|
||||
explicit QQtLogicVideoInput ( QObject* parent = 0 );
|
||||
virtual ~QQtLogicVideoInput();
|
||||
|
||||
//开启某个确定的模拟摄像头
|
||||
bool open ( QString devName = "/dev/cim" );
|
||||
@ -29,8 +29,32 @@ signals:
|
||||
protected:
|
||||
|
||||
private:
|
||||
Q_DECLARE_PRIVATE ( QQtLogicVideoManager )
|
||||
QQtLogicVideoManagerPrivate* d_ptr;
|
||||
Q_DECLARE_PRIVATE ( QQtLogicVideoInput )
|
||||
QQtLogicVideoInputPrivate* d_ptr;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The QQtLogicVideoManager class
|
||||
*/
|
||||
class QQTSHARED_EXPORT QQtLogicVideoManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit QQtLogicVideoManager ( QObject* parent = 0 );
|
||||
virtual ~QQtLogicVideoManager();
|
||||
|
||||
|
||||
public:
|
||||
//开启某个确定的模拟摄像头
|
||||
bool openInput ( QString devName = "/dev/cim" );
|
||||
bool closeInput();
|
||||
|
||||
signals:
|
||||
//获取图像
|
||||
void readyRead ( const QImage& image );
|
||||
|
||||
private:
|
||||
QQtLogicVideoInput* mInputManager;
|
||||
};
|
||||
|
||||
#endif // QQTLOGICVIDEOMANAGER_H
|
||||
|
@ -239,6 +239,7 @@ defineTest(add_defines_QQt){
|
||||
#LOGIC CAMERA PREVIEW
|
||||
#depend on dmmu
|
||||
#need fix, linux embedded armhf32 mips
|
||||
#DEFINES += __LOGICCAMERAMODULE__
|
||||
contains(QSYS_PRIVATE, Embedded|Armhf32|Mips32):DEFINES += __LOGICCAMERAMODULE__
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user