2046 Commits

Author SHA1 Message Date
Marc Mutz
3a18580e23 QAbstractVideoFilter: make ctor explicit
Change-Id: If091d751c7e164c0480b48301358833705cd4870
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-06-12 11:14:01 +00:00
Marc Mutz
62d9398a27 QCameraViewFinderSettings: make op== transitive
Using qFuzzyCompare in operator== makes it impossible to create a
consistent qHash() overload for the class later on (qFuzzyCompare
is not transitive).

It is unlikely that there will be numerical instability for frame
rates. If there is, qFuzzyCompare should be overloaded for either
this class or the FrameRateRange class.

Change-Id: Id975ea410b373e2987da160504f7618a8c498b5c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-06-12 11:09:24 +00:00
Marc Mutz
12893e3826 QCameraViewFinderSettings: declare shared
Requires implementing member-swap.

Also implemented move assignment operator.

Change-Id: I077ee85346a8c542cd344720e45a0795a6947e4c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-06-12 11:09:20 +00:00
Marc Mutz
99bda08cb1 QCameraViewFinderSettings: make op== non-member
...and inline op!=. Mark them as nothrow.

More idiomatic C++ (symmetry between lhs and rhs).

Change-Id: I65ecbef961383897e4e17325ad62d45e1772fbb0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-06-12 11:09:16 +00:00
Marc Mutz
c34cf61312 QCameraViewFinderSettings: use correct include
Change-Id: I71f24922872f64d86d55f420b0e27028a6368097
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
2015-06-12 11:09:12 +00:00
Yoann Lopes
36507b71f2 Added 5.5.0 change file.
Task-number: QTBUG-45455
Change-Id: I832dcd02215e6ae004b6f1e6cf3905b95a838e4a
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-06-11 16:14:37 +00:00
Yoann Lopes
7f9beeaf9c Define QCamera::FrameRateRange as a struct.
Instead of an alias for QPair<qreal, qreal>.

Task-number: QTBUG-46563
Change-Id: I7e1ac68242810f7e5f7e161571a11f5de7850e29
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-06-11 05:16:23 +00:00
Yoann Lopes
3cb698c0fc AVFoundation: don't use shared OpenGL contexts unless needed.
We were always using shared OpenGL contexts to render media player
frames into an OpenGL texture. There's no need to do that when there
already is a current context on the current thread. This happens in
non-QtQuick cases, when the OpenGL thread is also the main thread.

Change-Id: Icb97ed49609c764263007a43b6bb481e23768111
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-06-10 11:37:36 +00:00
Yoann Lopes
269c64f47a Support BGR format for OpenGL textures in QPainterVideoSurface.
Also, use the correct shader for RGB formats, we should be using the one
that does swizzling in that case.

Change-Id: I77b6327501f833fb2f7b30411fbe853e975a59c7
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-06-10 11:37:30 +00:00
Joerg Bornemann
f93f4e3daa WinRT: fix namespaced build
Change-Id: I06b18e2a1318bda826befde52ee1fd874e25dd47
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-06-04 11:46:02 +00:00
Laszlo Agocs
2ee7db8519 Add an env var to disable OpenGL texture-based video frames.
Right now we will always use GLTextureHandle frames with Quick. This is
great in many cases, but not always. Applications that wish to examine
the frames (e.g. via video filters) will sometimes prefer frames in
system memory, even if this is slower to display.

Add QT_QUICK_NO_TEXTURE_VIDEOFRAMES which can be used to disable texture-based
video frames.

[ChangeLog] The environment variable QT_QUICK_NO_TEXTURE_VIDEOFRAMES
can now be used to disable OpenGL texture based video frames. This can be useful
in applications that wish to filter and process the video frames and are not
GPU based.

Change-Id: I5ca6f6d485d5bc6c2da8d47db563cd910c238ac9
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-06-03 12:47:44 +00:00
Timur Pocheptsov
912b8e5647 Media asset writer - use the right macro
QT_PREPEND_NAMESPACE, not QT_MANGLE_NAMESPACE.

Change-Id: I9eb4130b203a5fb8f9f7964a0a642686814d5990
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-06-03 10:07:04 +00:00
Liang Qi
2cf8ac3398 Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: I7ac7db69c37cc9e5c5241a25b9a874986a23a886
2015-06-03 10:58:51 +02:00
Peng Wu
00789e7d4e winrt: fix camera preview on Lumia 530
Lumia 530 has the same QTBUG-44838 device bug that gives black frames
when blitting to the target texture for image preview. Add it to
workaround blacklist.

Task-number: QTBUG-45920
Change-Id: Ia411793b90e487fa57b943ed7f01e370bfb84a1f
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-06-03 04:29:19 +00:00
Yoann Lopes
7fd0fec5e5 GStreamer: remove unnecessary qWarning().
Change-Id: Ibbf5d5b7e3675fe6fee30e7486e3bc7b59fa231d
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-06-02 22:29:55 +00:00
Yoann Lopes
9f97abb092 AVFoundation: fix a problem when changing the camera viewfinder size.
We need to restart the video surface when the frame size changes.

Change-Id: I81af3cb40fb40f7d157174ac96d42213880fbacd
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
2015-06-02 22:29:48 +00:00
Yoann Lopes
762bce7a06 AVFoundation: fix wrong Q_ASSERT.
The assert was always triggered, at least on OSX.

Change-Id: I9aabb6103b7f5540cff42facc448ffcf6a6de511
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
2015-06-02 07:31:27 +00:00
Sergio Martins
a08bcb3279 pulseaudio: Remove unused static member variable
Change-Id: I79f8ce318d4fb72ddbd9d4e5c030df01c36084fa
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-06-01 16:36:20 +00:00
Sergio Martins
387c063ed6 Use QSet::intersects() instead of QSet::intersect()
It's much faster.

Change-Id: Iee42359147ebb76b5848f3ac2e17eb92214c8ab6
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-05-30 19:34:10 +00:00
Timur Pocheptsov
1508f775ac Video asset writer for iOS
AVFoundation on iOS lacks the ability to use AVCaptureVideoDataOutput and
AVCaptureMovieFileOutput simultaneously. Right now viewfinder stops working
as soon as we add movie file output. The only workaround
we have now is to write video/audio 'maually' - creating asset writer
and feeding it with audio/video samples.

Change-Id: I33a63546783279c545f0433b5051287269825d3f
Task-number: QTBUG-37655
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-05-29 16:29:39 +00:00
Yoann Lopes
aeb79d4a8b AVFoundation: fix default camera viewfinder pixel format.
It was hardcoded to ARGB32, which is not a good idea, at least on iOS
where the necessary conversion is slow.
We now pick the QAbstractVideoSurface's preferred format, or if no
surface is set, we pick the default from AVFoundation.

As a result, the QML VideoOutput will now always use the NV12 format.

Change-Id: I65205c706455502883b8098f0b5c0577b4106e01
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
2015-05-29 11:09:17 +00:00
Yoann Lopes
8143aff1b2 GStreamer: flush the current frame when stopping a media player.
When stopping, we don't actually stop the GStreamer pipeline, we just
pause it and prevent preroll frames from being shown.
We also need to make sure the last presented frame is cleared in that
case, otherwise it stays on screen.
Fixed for both 0.10 and 1.0.

Change-Id: Ibe26a7567f271ae0c3d8819eb9d35d6a95da1c6a
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-05-27 12:18:50 +00:00
Yoann Lopes
83d1255080 Android: fix setting the camera preview resolution.
- When the video capture resolution or the image capture resolution
  changes, we now always set the viewfinder resolution to the highest
  available one with the same aspect ratio as the capture resolution.
  We were previously not doing anything if the new capture resolution
  had the same aspect ratio as the current viewfinder resolution.
- Some devices don't support using a viewfinder resolution different
  from the video capture resolution. Make sure we handle this case.

Change-Id: I8d3ab7b01c56ed78d1ca838a522ba459692fc332
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-05-27 12:18:43 +00:00
Yoann Lopes
008d57e1d7 AVFoundation: additional build fixes for OSX < 10.9.
0df8d839 didn't fix all of the problems.

Task-number: QTBUG-46159
Change-Id: I4f2a390da1cca13775302aeef60c522e0da55a1a
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
2015-05-27 12:18:34 +00:00
Friedemann Kleint
a26df92bac Add CONFIG += testcase to auto/unit/qaudiobuffer/qaudiobuffer.pro.
When missing, make check is an empty target, meaning the test
is never run in the CI.

Change-Id: I6f09e0f78c26b631fdfe89d2520dc0012d177843
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-05-26 11:58:24 +00:00
Carlos Rafael Giani
288d549474 videonode: imx6: Ensure the video node excludes padding pixels
Padding rows & columns are included in the video frame that is sent to
the VIV direct texture. Scale the UV coordinates to ensure the padding
pixels aren't shown.

Change-Id: I8b870a95ff786f9f80f42f0cc33f468b0c9c3863
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-05-26 11:57:56 +00:00
Yoann Lopes
a3f82a8995 GStreamer: don't use xvimagesink when Qt is not using Xcb.
We need a native X window handle to be able to use xvimagesink. If Qt
doesn't use the Xcb platform plugin, don't try to use that element.

This patch makes QVideoWidget usable when the system doesn't run X11
but xvimagesink is installed anyway. Widget and window controls become
invalid and the plugin therefore falls back to the renderer control.

Change-Id: I6efd410508f35b06f00f6e4e5149c97cbd280d0d
Task-number: QTBUG-46169
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-05-26 11:57:40 +00:00
Jani Heikkinen
10b3466ce4 Updated WinRT license headers to use LGPLv3 instead of LGPLv21
From 5.5.0 -> WinRT port is licensed with LGPLv3, see
http://blog.qt.io/blog/2015/04/29/windows-10-support-in-qt/

Change-Id: I86e43ba051e3bc1dfb3eb9e1d442a9a12e9efdb7
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
2015-05-21 04:52:40 +00:00
Andras Mantia
4be995d251 Initialize the resource, so it can be used from static libraries.
Change-Id: If28509a991fb464dc587705ce62af66b528fdd97
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-05-20 09:59:27 +00:00
Yoann Lopes
5fab28b581 AVFoundation: fix retrieving maximum camera zoom value.
Maximum zoom value was incorrectly reset to 1.0 when doing the transition
Active -> Loaded -> Active.

Change-Id: I799900b1597637039d6c28d1d694fb6340b10540
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
2015-05-19 15:39:31 +00:00
Yoann Lopes
0df8d83932 AVFoundation: fix compilation on OSX < 10.9.
AVCaptureConnection.videoMaxFrameDuration is supported only since 10.9.

Task-number: QTBUG-46159
Change-Id: I8ea57b69e97ea3802b5c444c57ab090c4edf31e2
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
2015-05-19 13:22:15 +00:00
Yoann Lopes
b0111ce5f5 WMF: fix start time of buffers provided by QAudioDecoder.
The time was in milliseconds but should be in microseconds.

Task-number: QTBUG-45571
Change-Id: I54f07975e7a6233254a338dcde8075f740b5455c
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-05-19 11:41:42 +00:00
Topi Reinio
aaff15aec6 Doc: Use the screenshot in the Declarative Radio example documentation
Also, crop the screenshot image to not show any window decoration,
and fix the example \brief.

Change-Id: I86310bdc5a4f124180eac1a1d27064286ba34f59
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
2015-05-19 10:09:34 +00:00
Yoann Lopes
9faaf425e9 Fix documentation for Camera flash mode enum.
Added missing documentation for Camera.FlashVideoLight and corrected
it for Camera.FlashTorch.

Change-Id: Ib1823b6554bd2f9db92e047fd4755ae7fb3e0f96
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
2015-05-18 11:46:59 +00:00
Samuel Gaist
695399c5f5 Fix typo in QCameraViewfinderSettingsControl documentation
Change-Id: Iae4b064f554f501bfce9bc7b811c56685e8ece0d
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2015-05-16 21:09:18 +00:00
Venugopal Shivashankar
f61c89a1b3 Doc: Added a link to the wiki with plugin info.
The wiki summarizes each platform plugin and the
supported features.

Change-Id: Id7707306880d7e0612e73b879fc48201e0a97417
Task-number: QTBUG-30381
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
2015-05-13 10:17:50 +00:00
Yoann Lopes
ab860d8b7f Fix texture unit bug in the YUV video node.
fe13f5bb introduced a bug which could leave the active texture unit set
to GL_TEXTURE1 or GL_TEXTURE2. When the material is done updating its
state, it needs to make sure the active texture unit is reset to 0
since other materials might assume that's the current value.

Change-Id: I64a6a0cd9fcecdf0fa483909193f70045ff0e9fe
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-05-12 10:19:21 +00:00
Liang Qi
66613b4f9c Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: I0390795fa3d5f2a7ba098b514ee2da4a86e243a6
2015-05-11 10:01:29 +02:00
Frank Osterfeld
2463a5f216 OSX/iOS: Fix volume and mute
My last fix for iOS (4e07ff99) introduced this regression of passing
the outdated value to the native player object.

Change-Id: I01b0df8c7a0fe1382ef73b55d288a40daf024e3d
Reviewed-by: James Turner <james.turner@kdab.com>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-05-11 07:57:29 +00:00
Yoann Lopes
0761f2d53f Update license header in qmlvideofx example.
Change-Id: Icb525176a8f00cc1a7414e68a7452452d1ef3da0
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-05-05 11:31:57 +00:00
Yoann Lopes
9d2943bce8 Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts:
	.qmake.conf
	src/plugins/avfoundation/camera/avfcamerasession.h
	src/plugins/avfoundation/camera/avfcamerasession.mm

Change-Id: Ib2e25d907a7069591920d2f69e007f314cc0fd85
2015-05-05 11:48:21 +02:00
Yoann Lopes
cc0569a038 Merge remote-tracking branch 'origin/5.4.2' into 5.4
Change-Id: Ib16e45133bcf4e4d88944df97be6a2f8a3c77135
2015-05-04 14:51:43 +02:00
Christian Strømme
0559f645bb Android: Don't delete the media recorder object twice.
In QAndroidCaptureSession::stop() we call restartViewFinder() which
eventually calls QAndroidCaptureSession::stop() again, but this time
the media recorder object is already released.

Task-number: QTBUG-45637
Change-Id: I943c423398a99d98ccda1063fc16e47cba470deb
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-04-30 22:48:01 +00:00
Yoann Lopes
fe13f5bb05 Minor refactor of built-in QSGVideoNodes.
- Load shader source from resource files.
- Correctly report material types: each material can use different
  shaders depending on the video pixel format but it was reporting
  a unique material type. This was causing the node to keep using
  the same shader even if its pixel format changed.

Change-Id: Ib903ecd6e7dd1dd56d7cefe255ab7049933df17d
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2015-04-30 09:02:20 +00:00
Yoann Lopes
20dbf8490e Added 5.4.2 change file.
Change-Id: Ib9d829e92343d5230875c37bee7b2bf912b1d304
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-04-25 07:20:03 +00:00
Yoann Lopes
bcaec9624c AVFoundation: fix microphone permission when using the camera.
The microphone permission was always requested when using the camera,
even when not actually using the microphone, which can only happen when
recording a video. The permission request is triggered by adding an
audio AVCaptureDeviceInput to the AVCaptureSession, which was done when
setting the camera to LoadedState. This is now done when setting the
camera mode to CaptureVideo.

Task-number: QTBUG-45659
Change-Id: I3692797128cfb70ba5ccbc7a36b6955471039e80
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
2015-04-23 18:39:08 +00:00
Yoann Lopes
d910b6d63f AVFoundation: correctly detect the default audio capture device.
Use AVCaptureDevice::defaultDeviceWithMediaType instead of the first
device in the list of available devices.

Change-Id: I436921f99280a28d7158d345cd977a874cfb8968
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-04-23 12:57:49 +00:00
Siteshwar Vashisht
176d52bb28 Refactored code for audio engine to allow dynamic object creation
QDeclarativeSound, QDeclarativeAudioSample, QDeclarativeAudioCategory
and QDeclarativeAttenuationModel can now be dynamically added to
AudioEngine instance or declared inside AudioEngine object definition.

QDeclarativePlayVariation can now be dynamically added to Sound
instance or declared inside Sound object definition.

Change-Id: If4c2e16895a71eb71ded1998c107360698f8ac7f
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-04-23 11:56:18 +00:00
Peng Wu
61033aa420 winrt: fix camera sample queue thread safety
Replace sample buffer QVector with C array to avoid reallocations. The
resource needs to be protected, so use atomic indexes to prevent writing
into the same array element that is being read.

Task-number: QTBUG-45667
Change-Id: Ifd30dd128765ea4794fe8614f25ef596bba891ee
Reviewed-by: Andrew Knight <qt@panimo.net>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
2015-04-23 07:10:28 +00:00
Christian Strømme
d44f5734bf Remove warning about missing qmake variable on Android.
gstreamer on Android is not supported, so we don't need to check for it.

Change-Id: I7ccde2b9878f9f435828195a5ac1b76a9a6985d1
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-04-22 08:31:59 +00:00