Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
BC
public
external
Qt
QtMultimedia
Commits
bfabb13f
Commit
bfabb13f
authored
6 years ago
by
Qt Forward Merge Bot
Browse files
Options
Download
Plain Diff
Merge remote-tracking branch 'origin/5.11' into dev
Change-Id: I4f6a59c4b9af45bfc0a5aeec8092c0d4e8fd3b2e
parents
4378984c
02ac3f58
dev
5.12
5.12.1
5.12.10
5.12.11
5.12.12
5.12.2
5.12.3
5.12.4
5.12.5
5.12.6
5.12.7
5.12.8
5.12.9
5.13
5.13.0
5.13.1
5.13.2
5.14
5.14.0
5.14.1
5.14.2
5.15
5.15.0
5.15.1
5.15.2
6.2
6.2.0
6.2.1
6.2.2
wip/cmake
wip/qt6
v5.15.0-alpha1
v5.14.1
v5.14.0
v5.14.0-rc2
v5.14.0-rc1
v5.14.0-beta3
v5.14.0-beta2
v5.14.0-beta1
v5.14.0-alpha1
v5.13.2
v5.13.1
v5.13.0
v5.13.0-rc3
v5.13.0-rc2
v5.13.0-rc1
v5.13.0-beta4
v5.13.0-beta3
v5.13.0-beta2
v5.13.0-beta1
v5.13.0-alpha1
v5.12.7
v5.12.6
v5.12.5
v5.12.4
v5.12.3
v5.12.2
v5.12.1
v5.12.0
v5.12.0-rc2
v5.12.0-rc1
v5.12.0-beta4
v5.12.0-beta3
v5.12.0-beta2
v5.12.0-beta1
v5.12.0-alpha1
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/plugins/avfoundation/mediaplayer/avfvideoframerenderer.mm
+7
-7
...plugins/avfoundation/mediaplayer/avfvideoframerenderer.mm
src/plugins/directshow/camera/dscameracontrol.cpp
+6
-2
src/plugins/directshow/camera/dscameracontrol.cpp
src/plugins/directshow/camera/dscamerasession.cpp
+38
-3
src/plugins/directshow/camera/dscamerasession.cpp
src/plugins/directshow/camera/dscamerasession.h
+4
-1
src/plugins/directshow/camera/dscamerasession.h
with
55 additions
and
13 deletions
src/plugins/avfoundation/mediaplayer/avfvideoframerenderer.mm
+
7
−
7
View file @
bfabb13f
...
...
@@ -126,8 +126,14 @@ QOpenGLFramebufferObject *AVFVideoFrameRenderer::initRenderer(AVPlayerLayer *lay
//Get size from AVPlayerLayer
m_targetSize
=
QSize
(
layer
.
bounds
.
size
.
width
,
layer
.
bounds
.
size
.
height
);
QOpenGLContext
*
shareContext
=
!
m_glContext
&&
m_surface
?
qobject_cast
<
QOpenGLContext
*>
(
m_surface
->
property
(
"GLContext"
).
value
<
QObject
*>
())
:
nullptr
;
//Make sure we have an OpenGL context to make current
if
(
!
QOpenGLContext
::
currentContext
()
&&
!
m_glContext
)
{
if
((
shareContext
&&
shareContext
!=
QOpenGLContext
::
currentContext
())
||
(
!
QOpenGLContext
::
currentContext
()
&&
!
m_glContext
))
{
//Create Hidden QWindow surface to create context in this thread
m_offscreenSurface
=
new
QWindow
();
m_offscreenSurface
->
setSurfaceType
(
QWindow
::
OpenGLSurface
);
...
...
@@ -135,12 +141,6 @@ QOpenGLFramebufferObject *AVFVideoFrameRenderer::initRenderer(AVPlayerLayer *lay
m_offscreenSurface
->
setGeometry
(
0
,
0
,
1
,
1
);
m_offscreenSurface
->
create
();
//Create OpenGL context and set share context from surface
QOpenGLContext
*
shareContext
=
0
;
if
(
m_surface
)
{
//QOpenGLContext *renderThreadContext = 0;
shareContext
=
qobject_cast
<
QOpenGLContext
*>
(
m_surface
->
property
(
"GLContext"
).
value
<
QObject
*>
());
}
m_glContext
=
new
QOpenGLContext
();
m_glContext
->
setFormat
(
m_offscreenSurface
->
requestedFormat
());
...
...
This diff is collapsed.
Click to expand it.
src/plugins/directshow/camera/dscameracontrol.cpp
+
6
−
2
View file @
bfabb13f
...
...
@@ -51,8 +51,12 @@ DSCameraControl::DSCameraControl(QObject *parent)
,
m_captureMode
(
QCamera
::
CaptureStillImage
)
{
m_session
=
qobject_cast
<
DSCameraSession
*>
(
parent
);
connect
(
m_session
,
SIGNAL
(
statusChanged
(
QCamera
::
Status
)),
this
,
SIGNAL
(
statusChanged
(
QCamera
::
Status
)));
connect
(
m_session
,
&
DSCameraSession
::
statusChanged
,
[
&
](
QCamera
::
Status
status
)
{
if
(
status
==
QCamera
::
UnloadedStatus
)
m_state
=
QCamera
::
UnloadedState
;
emit
statusChanged
(
status
);
});
connect
(
m_session
,
&
DSCameraSession
::
cameraError
,
this
,
&
DSCameraControl
::
error
);
}
...
...
This diff is collapsed.
Click to expand it.
src/plugins/directshow/camera/dscamerasession.cpp
+
38
−
3
View file @
bfabb13f
...
...
@@ -76,6 +76,30 @@ DSCameraSession::DSCameraSession(QObject *parent)
{
connect
(
this
,
SIGNAL
(
statusChanged
(
QCamera
::
Status
)),
this
,
SLOT
(
updateReadyForCapture
()));
m_deviceLostEventTimer
.
setSingleShot
(
true
);
connect
(
&
m_deviceLostEventTimer
,
&
QTimer
::
timeout
,
[
&
]()
{
IMediaEvent
*
pEvent
=
com_cast
<
IMediaEvent
>
(
m_filterGraph
,
IID_IMediaEvent
);
if
(
!
pEvent
)
return
;
long
eventCode
;
LONG_PTR
param1
;
LONG_PTR
param2
;
while
(
pEvent
->
GetEvent
(
&
eventCode
,
&
param1
,
&
param2
,
0
)
==
S_OK
)
{
switch
(
eventCode
)
{
case
EC_DEVICE_LOST
:
unload
();
break
;
default:
break
;
}
pEvent
->
FreeEventParams
(
eventCode
,
param1
,
param2
);
}
pEvent
->
Release
();
});
}
DSCameraSession
::~
DSCameraSession
()
...
...
@@ -208,8 +232,8 @@ QVariant DSCameraSession::imageProcessingParameter(
QCameraImageProcessingControl
::
ProcessingParameter
parameter
)
const
{
if
(
!
m_graphBuilder
)
{
qWarning
()
<<
"failed to access to the graph build
er
"
;
return
QVariant
();
auto
it
=
m_pendingImageProcessingParametrs
.
find
(
paramet
er
)
;
return
it
!=
m_pendingImageProcessingParametrs
.
end
()
?
it
.
value
()
:
QVariant
();
}
const
QCameraImageProcessingControl
::
ProcessingParameter
resultingParameter
=
...
...
@@ -249,7 +273,7 @@ void DSCameraSession::setImageProcessingParameter(
const
QVariant
&
value
)
{
if
(
!
m_graphBuilder
)
{
qWarning
()
<<
"failed to access to the graph builder"
;
m_pendingImageProcessingParametrs
.
insert
(
parameter
,
value
)
;
return
;
}
...
...
@@ -582,6 +606,10 @@ void DSCameraSession::onFrameAvailable(double time, const QByteArray &data)
m_presentMutex
.
lock
();
// If no frames provided from ISampleGrabber for some time
// the device might be potentially unplugged.
m_deviceLostEventTimer
.
start
(
100
);
// (We should be getting only RGB32 data)
int
stride
=
m_previewSize
.
width
()
*
4
;
...
...
@@ -960,6 +988,13 @@ void DSCameraSession::updateImageProcessingParametersInfos()
}
pVideoProcAmp
->
Release
();
for
(
auto
it
=
m_pendingImageProcessingParametrs
.
cbegin
();
it
!=
m_pendingImageProcessingParametrs
.
cend
();
++
it
)
{
setImageProcessingParameter
(
it
.
key
(),
it
.
value
());
}
m_pendingImageProcessingParametrs
.
clear
();
}
bool
DSCameraSession
::
connectGraph
()
...
...
This diff is collapsed.
Click to expand it.
src/plugins/directshow/camera/dscamerasession.h
+
4
−
1
View file @
bfabb13f
...
...
@@ -44,7 +44,7 @@
#include
<QTime>
#include
<QUrl>
#include
<QMutex>
#include
<QTimer>
#include
<qcamera.h>
#include
<QtMultimedia/qvideoframe.h>
#include
<QtMultimedia/qabstractvideosurface.h>
...
...
@@ -229,6 +229,9 @@ private:
// Internal state
QCamera
::
Status
m_status
;
QTimer
m_deviceLostEventTimer
;
QMap
<
QCameraImageProcessingControl
::
ProcessingParameter
,
QVariant
>
m_pendingImageProcessingParametrs
;
friend
class
SampleGrabberCallbackPrivate
;
};
...
...
This diff is collapsed.
Click to expand it.
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets