Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
uvcengine
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Thiago Santini
uvcengine
Commits
2600e619
Commit
2600e619
authored
Feb 25, 2017
by
Thiago Santini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small adjustments
parent
86a71ed7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
14 deletions
+24
-14
uvcengine/uvccameraservice.cpp
uvcengine/uvccameraservice.cpp
+0
-2
uvcengine/uvccamerasession.cpp
uvcengine/uvccamerasession.cpp
+6
-5
uvcengine/uvcserviceplugin.cpp
uvcengine/uvcserviceplugin.cpp
+12
-3
uvcengine/uvcserviceplugin.h
uvcengine/uvcserviceplugin.h
+6
-4
No files found.
uvcengine/uvccameraservice.cpp
View file @
2600e619
...
...
@@ -57,7 +57,6 @@ UVCCameraService::UVCCameraService(QObject *parent):
m_control
=
new
UVCCameraControl
(
m_session
);
m_videoDevice
=
new
UVCVideoDeviceControl
(
m_session
);
m_viewfinderSettings
=
new
UVCCameraViewfinderSettingsControl
(
m_session
);
// m_imageProcessingControl = new DSCameraImageProcessingControl(m_session);
}
UVCCameraService
::~
UVCCameraService
()
...
...
@@ -66,7 +65,6 @@ UVCCameraService::~UVCCameraService()
delete
m_viewfinderSettings
;
delete
m_videoDevice
;
delete
m_videoRenderer
;
// delete m_imageCapture;
delete
m_session
;
}
...
...
uvcengine/uvccamerasession.cpp
View file @
2600e619
...
...
@@ -11,7 +11,7 @@ UVCCameraSession::UVCCameraSession(QObject *parent)
UVCCameraSession
::~
UVCCameraSession
()
{
unload
();
}
void
UVCCameraSession
::
setDevice
(
uvc_device_t
*
device
)
...
...
@@ -33,7 +33,6 @@ void UVCCameraSession::callback(uvc_frame_t *frame)
return
;
if
(
m_surface
)
{
QVideoFrame
qFrame
;
switch
(
frame
->
frame_format
)
{
case
UVC_FRAME_FORMAT_MJPEG
:
...
...
@@ -58,7 +57,7 @@ void UVCCameraSession::presentFrame(const QVideoFrame &frame, const qreal t)
if
(
latency
<
MAX_LATENCY_MS
)
m_surface
->
present
(
frame
);
else
qDebug
()
<<
"Dropping frame ("
<<
latency
<<
"ms old)"
;
qDebug
()
<<
"Dropping frame ("
<<
latency
<<
"ms old
)"
;
}
bool
UVCCameraSession
::
load
()
...
...
@@ -90,10 +89,12 @@ bool UVCCameraSession::load()
bool
UVCCameraSession
::
unload
()
{
QMutexLocker
sessionLocker
(
&
sessionMutex
);
if
(
streaming
)
stopPreview
();
uvc_close
(
devh
);
if
(
devh
)
uvc_close
(
devh
);
devh
=
NULL
;
m_supportedViewfinderSettings
.
clear
();
...
...
@@ -126,7 +127,7 @@ bool UVCCameraSession::startPreview()
return
false
;
}
res
=
uvc_stream_start
(
strmh
,
cb
,
(
void
*
)
this
,
1.5
f
,
0
);
res
=
uvc_stream_start
(
strmh
,
cb
,
(
void
*
)
this
,
2.0
f
,
0
);
if
(
res
!=
UVC_SUCCESS
)
{
qDebug
()
<<
"uvc_stream_start"
<<
uvc_strerror
(
res
);
return
false
;
...
...
uvcengine/uvcserviceplugin.cpp
View file @
2600e619
...
...
@@ -15,9 +15,9 @@ void UVCServicePlugin::release(QMediaService *service)
QByteArray
UVCServicePlugin
::
defaultDevice
(
const
QByteArray
&
service
)
const
{
if
(
service
==
Q_MEDIASERVICE_CAMERA
)
{
// const QList<UVCVideoDeviceControl
> &devs = UVCVideoDeviceControl::availableDevices();
//
if (!devs.isEmpty())
//
return devs.first().first;
const
QList
<
UVCVideoDeviceInfo
>
&
devs
=
UVCVideoDeviceControl
::
availableDevices
();
if
(
!
devs
.
isEmpty
())
return
devs
.
first
().
first
;
}
return
QByteArray
();
...
...
@@ -48,6 +48,15 @@ QString UVCServicePlugin::deviceDescription(const QByteArray &service, const QBy
return
QString
();
}
QMediaServiceProviderHint
::
Features
UVCServicePlugin
::
supportedFeatures
(
const
QByteArray
&
service
)
const
{
if
(
service
==
Q_MEDIASERVICE_MEDIAPLAYER
)
return
QMediaServiceProviderHint
::
StreamPlayback
|
QMediaServiceProviderHint
::
VideoSurface
;
else
return
QMediaServiceProviderHint
::
Features
();
}
#if QT_VERSION < 0x050000
Q_EXPORT_PLUGIN2
(
uvcengine
,
UVCServicePlugin
)
#endif // QT_VERSION < 0x050000
uvcengine/uvcserviceplugin.h
View file @
2600e619
...
...
@@ -11,13 +11,13 @@
class
UVCServicePlugin
:
public
QMediaServiceProviderPlugin
,
public
QMediaServiceSupportedDevicesInterface
//
, public QMediaServiceDefaultDeviceInterface
//
, public QMediaServiceFeaturesInterface
,
public
QMediaServiceDefaultDeviceInterface
,
public
QMediaServiceFeaturesInterface
{
Q_OBJECT
Q_INTERFACES
(
QMediaServiceSupportedDevicesInterface
)
//
Q_INTERFACES(QMediaServiceDefaultDeviceInterface)
//
Q_INTERFACES(QMediaServiceFeaturesInterface)
Q_INTERFACES
(
QMediaServiceDefaultDeviceInterface
)
Q_INTERFACES
(
QMediaServiceFeaturesInterface
)
#if QT_VERSION >= 0x050000
Q_PLUGIN_METADATA
(
IID
"org.qt-project.qt.mediaserviceproviderfactory/5.0"
FILE
"uvcengine.json"
)
...
...
@@ -27,6 +27,8 @@ public:
QMediaService
*
create
(
const
QString
&
key
);
void
release
(
QMediaService
*
service
);
QMediaServiceProviderHint
::
Features
supportedFeatures
(
const
QByteArray
&
service
)
const
;
QByteArray
defaultDevice
(
const
QByteArray
&
service
)
const
;
QList
<
QByteArray
>
devices
(
const
QByteArray
&
service
)
const
;
QString
deviceDescription
(
const
QByteArray
&
service
,
const
QByteArray
&
device
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment