Commit Graph

1698 Commits

Author SHA1 Message Date
Timur Pocheptsov
71fc289373 Add NV12/NV21 support into SG videonode.
Add new fragment shaders and update declarative render (video node) to support NV12/NV21
pixel format.

Task-number: QTBUG-45021
Change-Id: I5d52007f0da56165752268d06efca156f7496b42
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-03-20 14:13:59 +00:00
Timur Pocheptsov
09afe9377d AVFCameraViewfinderSettings - add NV12 format
Add QVideoFrame::Format_NV12 (AVFoundation has kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange
and kCVPixelFormatType_420YpCbCr8BiPlanarFullRange). Report it (set it) only if
it's supported by renderer's surface. Add bi-planar format support into CVPixelBufferVideoBuffer.

Change-Id: Ibc1c2be056bddf5cf3b595570fc40c626ee3ccf5
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-03-20 13:23:00 +00:00
Yoann Lopes
7e9520e8d3 Fix order of QSGVideoNode_RGB's supported formats.
RGB565 should not be the first pick. As a matter of fact it should be
the last pick.

Change-Id: I4b96fb02093e70d9c642efd79c48358ec7a664b0
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-03-18 10:57:23 +00:00
Yoann Lopes
2d8fcc1560 WMF: fix RGB24 format matching.
MFVideoFormat_RGB24 has a BGR layout and should therefore be matched to
QVideoFrame::Format_BGR24, not Format_RGB24.

Task-number: QTBUG-42323
Change-Id: I1749b575b1738168e3d3c0d055dee10f6d870c0c
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-03-18 10:54:19 +00:00
Yoann Lopes
7420fb409a Use proper d_ptr for QPlaylistFileParser.
Task-number: QTBUG-42473
Change-Id: Iff8f14ed6ab99c8e7844b9e43009b82b442f5238
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-03-18 10:53:16 +00:00
Peng Wu
10354f4127 Fix WinRT Audio elements cannot play Qt resouce audio files
URL argument of Windows media API SetSourceFromByteStream can not be
empty. Initial proper value for playing audio stream case.

Task-number: QTBUG-42263
Change-Id: If0bb44b60d517228bfe8b6cb30afeeb4a8ac62d3
Reviewed-by: Andrew Knight <qt@panimo.net>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-03-17 14:32:31 +00:00
Frederik Gladhorn
64b75cc1d7 Merge remote-tracking branch 'origin/5.4' into 5.5
Change-Id: Id24f14bef17b86e7027e055473f0357854780979
2015-03-17 09:48:51 +01:00
Laszlo Agocs
d109e6dd5d Improvide device selection in the video filter example
The non-OS X path also uses clGetGLContextInfoKHR when available,
instead of just blindly taking the first GPU device for the platform.

This way we get the correct OpenCL device in case the application is using an
OpenGL context on the same vendor's second GPU.

On Windows desktop OpenGL is now correctly forced and therefore there is
no need to waste time on runtime checks for ANGLE later on.

Remove the hard-coded custom pathes from the .pro file.

Also fixes error reporting on the OS X specific path.

Change-Id: I8d6ab867510d113d5135b61e66822381e81c995a
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-03-16 13:00:43 +00:00
Yoann Lopes
d4208cc5a1 QPainterVideoSurface: restore original order for the supported formats.
The formats returned by supportedPixelFormats() are supposed to be in
descending order of preference. Some formats were changed positions
in commit 66ba2197.

Change-Id: Ib52e93ba3554d80fa388a01f0b47fa049ac046ec
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2015-03-13 10:06:01 +00:00
Yoann Lopes
e1d76e2df5 Revert "Alsa: fix crash when detecting devices."
This reverts commit 0ab81ef59f.
The workaround causes software devices not to appear in the list
of available devices. Besides, since the crash is caused by a bug
in older versions of Alsa, the workaround was probably a bad idea
in the first place. People should update Alsa instead.

Task-number: QTBUG-42326
Change-Id: I37923a87180d1c5abc18d52d84f633e14ba46860
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-03-11 14:17:14 +00:00
Friedemann Kleint
2099a8c3c7 Fix uninitialized memory reads in MFAudioDecoderControl.
Initialize all members in constructor.

[W] UMR: Uninitialized memory read in MFAudioDecoderControl::handleMediaSourceReady(void) {1 occurrence}
         Error location
            MFAudioDecoderControl::handleMediaSourceReady(void) [c:\qt\qt-55-32\qt-55-32\qtmultimedia\src\plugins\wmf\decoder\mfaudiodecodercontrol.cpp:254]
[W] UMR: Uninitialized memory read in MFAudioDecoderControl::activatePipeline(void) {1 occurrence}
            MFAudioDecoderControl::activatePipeline(void) [c:\qt\qt-55-32\qt-55-32\qtmultimedia\src\plugins\wmf\decoder\mfaudiodecodercontrol.cpp:289]

Task-number: QTBUG-40571
Change-Id: I6f97cf72284f739ceffcf65162963d00de979ea2
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-03-10 17:02:39 +00:00
Friedemann Kleint
7b2178768f Free d in QAudioBuffer &QAudioBuffer::operator =(const QAudioBuffer &).
Task-number: QTBUG-40571
Change-Id: Idc2dcc7d254873edda653b9c9eb8d88cbb91d4f6
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-03-10 17:01:40 +00:00
Timur Pocheptsov
f839f9e3eb AVCaptureDeviceFormat - avoid duplicates (OS X/iOS)
Excluding video range (iOS) is not the right way to avoid "duplicates" - with
other devices there can be also duplicates (formats with the same resolutions),
but completely different pixel formats. Since we do not know what they will be in advance,
we take the media subtype from the initial preset for a capture device and use it
as a filter. Update viewfinder and image encoder settings controls.

Change-Id: If20aea24b19b43574d5c3e9bf2ba85f50fc08916
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-03-10 16:35:59 +00:00
Yoann Lopes
95e9155b7f Android: fix some MediaPlayer signals not being emitted on first load.
When loading the first media while the video output was not yet ready,
mediaChanged() and mediaStatusChanged() signals were not emitted.
That's because in that particular situation, the backend believed
the delayed loading was a reload of the same media.

Change-Id: If5dfbf383ea2dac065fc26b70640ebfb2c52862d
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-03-04 16:36:04 +00:00
Yoann Lopes
dbcf44247d Improve QMediaPlayer auto tests.
Use test data only for test functions that require it.

Change-Id: I7fde1ba53ee8d2f5294597fd309a6e7d7dbbe15d
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-03-04 15:50:04 +00:00
Frederik Gladhorn
b348c9e7b0 Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts:
	src/gsttools/qgstutils.cpp

Change-Id: Ic54ab6c6560ded0db4b98f83256d997bee828083
2015-03-03 18:18:12 +01:00
Timur Pocheptsov
33b27c3c15 Image encoder control - version for OS X/iOS
QImageEncoderControl - implementation for AVFoundation plugin (OS X/iOS,
at the moment iOS >= 7.0).

Change-Id: Ibc2c3ae48252dd4698e263f5abca5c328482d5e7
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-03-02 12:44:51 +00:00
Timur Pocheptsov
985ee3261b Viewfinder settings control (1) for OS X/iOS
QCameraViewfinderSettingsControl - version for AVFoundation plugin
('obsolete' viewfinder settings control interface, camera session uses v2
instead). v1 is implemented using v2 (the v2 object from camera service).

Change-Id: I81207b52b0ba5a67e64465f0e5e0c80d7267df3e
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-03-02 12:44:41 +00:00
Timur Pocheptsov
0d783b7303 Viewfinder settings control (2) - version for iOS/OS X
QCameraViewfinderSettingsControl2 - version for AV foundation plugin
(the new settings control interface implemented).

Change-Id: I3fbfb87925e57c914d43eb711fa5422e26981207
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-03-02 12:44:29 +00:00
Timur Pocheptsov
d27f493df0 Add AVF camera utilities - general aux. functions/classes
Move configuration lock class into avfutility.h + add several standalone functions
to work with  AVCaptureDeviceFormat/AVCaptureDevice etc. - utility functions that are not
specific to any class.

Change-Id: Idba544248772a3b2a4e00dddb377b1c0e62b8085
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-03-02 12:44:19 +00:00
Andy Shaw
f39d8b73ee Check for the quick module before adding the videonode plugin
Change-Id: I050356086f5d82221968016754eb01c1b8f35490
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-02-27 12:37:14 +00:00
Yoann Lopes
5a0a3791a1 DirectShow: implemented QCameraViewfinderSettingsControl2.
Change-Id: I42ed49676e2fbc7207d8fe4579ad1fc0d62df138
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-02-26 15:56:27 +00:00
Frank Osterfeld
4e07ff99f6 ios: Enable volume and mute functionality
AVPlayer::setVolume and setMute also exist on iOS, so no need to ifdef
them to be OS X-only. As they require iOS 7.0, add runtime checks to
ensure that the methods exist.

Task-number: QTBUG-39240
Change-Id: I10810705cef8e5d8c18e4c79a15fa06425ea57f9
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
Reviewed-by: James Turner <james.turner@kdab.com>
2015-02-25 15:39:03 +00:00
Frank Osterfeld
b0f283b65e ios: Do not leak texture cache objects
Do not recreate m_textureCache if it already exists. This changes the
memory allocation behavior of a simple iOS example program from
linearly increasing to constant over time.

Change-Id: I6ff13b586c653fb7b4cadfa9f4ebf985b07ee455
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-02-25 12:36:38 +00:00
Libor Tomsik
0e161675e6 Fixing camera enumeration on hotplug
Emptying camera HW devices buffer when it becomes obsolete (500ms).
Leaving the list filled was causing video cameras to keep
on the list even when the camera was unplugged. Or vice versa, empty
after the camera was plugged into the system.

Change-Id: I3b38a0b327553cbb6e18dd5421cdde3ded1b7895
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-02-25 10:29:21 +00:00
Frederik Gladhorn
39bb642cb2 Merge remote-tracking branch 'origin/5.4' into 5.5
Conflicts:
	qtmultimedia.pro
	src/gsttools/qgstreamervideowidget.cpp
	src/plugins/gstreamer/camerabin/camerabinservice.cpp

Change-Id: I883f20dc17924ab42514a1aa00d16675a0f13d99
2015-02-24 17:38:46 +01:00
Laszlo Agocs
f86a3b7bb3 Add Linux and AMD support to the OpenCL filter example
Change-Id: I1ea91f93677c53322c3867db6069e4362c58cebd
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-02-24 10:30:15 +00:00
Oswald Buddenhagen
b35a55f215 Merge dev into 5.5
Change-Id: I715a549b4cc10220a6e3b48799fdc38865a9345e
2015-02-24 11:02:25 +01:00
Friedemann Kleint
8c73595c02 Fix some qdoc-warnings.
qtmultimedia/src/multimedia/qmediaserviceprovider.cpp:850: warning: Cannot find 'defaultDevice(...)' in '\fn' QMediaServiceSupportedDevicesInterface::defaultDevice(const QByteArray &service) const
qtmultimedia/src/multimedia/qmediaserviceprovider.cpp:850: warning: Cannot find 'defaultDevice(...)' in '\fn' QByteArray QMediaServiceSupportedDevicesInterface::defaultDevice(const QByteArray &service) const
qtmultimedia/src/multimedia/video/qabstractvideofilter.cpp:261: warning: Undocumented parameter 'parent' in QAbstractVideoFilter::QAbstractVideoFilter()

Change-Id: I72bfc1dc7697cd1323cb7aad16539932ace9d8ea
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
2015-02-23 08:57:35 +00:00
Sergio Ahumada
e7e34562fe Merge "Merge remote-tracking branch 'origin/5.4' into dev" into refs/staging/dev 2015-02-22 22:21:39 +00:00
Rafael Roquetto
e5ffc6a876 Remove BlackBerry PlayBook support.
Change-Id: I21f9c21bd3badd30f3a989ce3412c9ad03f5f21d
Reviewed-by: Bernd Weimer <bernd.weimer@pelagicore.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
2015-02-18 15:44:42 +00:00
Yoann Lopes
178c040168 GStreamer: some improvements with the camerabin's capture settings.
- Don't pretend we support changing the image or video capture
  settings while the camera is active. The pipeline needs to be
  restarted in order to renegotiate caps.
- Improved retrieving the supported capture resolutions and frame
  rates when using wrappercamerabinsrc. We now always get the
  supported values directly from the video source.

Change-Id: I107193288e370af105a25d16568a8f5a76022ada
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-02-18 13:15:45 +00:00
Yoann Lopes
656da3d4d6 GStreamer: improve camerabin audio settings checking.
Don't try setting a sample rate or a channel count equal to 0.

Change-Id: Ib2e1728f0d9af09df9c4d3fd1322b5cb174a2981
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-02-18 13:15:36 +00:00
Yoann Lopes
e47ecb75b5 GStreamer camerabin: don't recreate camera source on device change.
Change-Id: If62573b11c8e3112d386d93de9a504f49965d597
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-02-18 13:15:30 +00:00
Yoann Lopes
b179f15bb3 GStreamer: remove unused function and enum.
Change-Id: I67b329784d94e60b94c10d4a8942d02b050e0b2c
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-02-18 13:15:25 +00:00
Yoann Lopes
e48546b44f GStreamer: runtime check for controls that require GstPhotography.
Exposure, Flash, Focus and Locks controls were always initialized,
even when the GstPhotography interface was not available (on desktop
for example), causing some warnings and fooling the user in believing
that these features were available.
These controls are now lazily initialized and only when
GstPhotography is available.

The zoom control is not compile-checked anymore since it doesn't
actually require GstPhotography.

Change-Id: I5e8315d796dd920c9c29ccfa4155707f5f0fd7dc
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-02-18 13:15:20 +00:00
Yoann Lopes
d4f88c3ec9 GStreamer 1.0: fix some problems with QGstVideoRendererSink.
- Correctly free resources on deletion.
- Correctly stop the sink. We were stopping only when null caps
  were passed to set_caps() but that doesn't seem to always happen.
  Implement GstBaseSink.stop() which is always and consistently
  called by GStreamer.
- Remove pre-roll support (as done previously for 0.10, see
  commit 3b20608f).

Change-Id: I4c5808938f244f4f8a35e121a3a4a862588b752d
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-02-18 13:15:15 +00:00
Yoann Lopes
e4bf7d90bf GStreamer: implemented QCameraViewfinderSettingsControl2.
Change-Id: I4436e39c152f6c251792c1504d4a7b57db7b9d9a
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-02-18 13:15:09 +00:00
Yoann Lopes
82e71d733f GStreamer 1.0: fix frame rate retrieved with QGstUtils::formatFromCaps.
Change-Id: I88e8416e50440bbd14b34a8b2b3b262b5c8401ab
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-02-18 13:15:05 +00:00
Yoann Lopes
d9354b2299 GStreamer: fix camerabin state and status changes.
Not all status changes where reported and setting the QCamera
to LoadedState was not actually loading anything.

State and status changes have been refactored.
Camera status is now reported directly by the camera session.
Setting the camera state to LoadedState now sets the camerabin to
GST_STATE_READY, that allows to query for camera capabilities without
having to start the camera (and have a valid viewfinder).

Change-Id: I249b1ad32690679ff34a427410bc709ed3ab461c
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-02-18 13:14:59 +00:00
Yoann Lopes
fcf5d826a0 GStreamer: improved logic for window and widget controls usage.
Provide these controls only when the xvimagesink gstreamer element is
available. This allows QVideoWidget to fallback to QVideoRendererControl
when xvimagesink is not available.

Task-number: QTBUG-41618
Change-Id: I59f90ea8857c7ec0ffa08be9804e5458d95b79c4
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-02-18 11:38:34 +00:00
Sergio Ahumada
e49d92959c Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: I89bfde0a1618ebf3b34948c1c1f74c2cbf5d8abf
2015-02-17 16:12:27 +01:00
Sergio Ahumada
36e90b6928 Fix BSD license headers
Change-Id: I639ed933b789393fa50630af133e51abe3d7fae3
Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-02-17 13:32:36 +00:00
Yoann Lopes
14b2b53edc Compile Alsa and PulseAudio plugins only when enabled by configure.
They are enabled by default, this simply makes sure -no-alsa and
-no-pulseaudio work.

Change-Id: I8e921381363064bb65b414152eab27c08a551dc4
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-02-17 12:49:41 +00:00
Yoann Lopes
df66e8a4ba Use configured GStreamer version.
The gstreamer version detected or set by the configure script can be
overridden by passing GST_VERSION=<version> to qmake qtmultimedia.pro.

Change-Id: I6f2eac3705d3d6fe0ec8e79042017add6751ee8c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2015-02-16 16:01:16 +00:00
Frederik Gladhorn
f9014d136f Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: I5575a4ba13212c9bfe73a3de3ef17c6528beafc3
2015-02-13 13:10:48 +01:00
Antti Kokko
bbfccc7135 Update copyright headers
Qt copyrights are now in The Qt Company, so we could update the source
code headers accordingly. In the same go we should also fix the links to
point to qt.io.

Change-Id: I1c6faa4f59f8eca54f01ef20941fa60161dd7872
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-02-12 10:27:47 +00:00
Yoann Lopes
06259f1dfb Android: fix adjusting camera viewfinder resolution.
The viewfinder resolution must be in the same aspect ratio as the
image capture resolution. When adjusting the viewfinder resolution to
comply with that restriction, we assumed that the ratios had to be
exactly equal. Though, in practice, there can be a small difference.
For example for resolutions 2592x1952 (ratio=1.3278) and resolution
640x480 (ratio=1.3333).

Task-number: QTBUG-37525
Change-Id: Ia5a6dd3a4a6d901b24bf74f8aa4e34bffe61f89b
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-02-11 14:11:23 +00:00
Sergio Ahumada
4ce9d89d7a Fix some typos
Change-Id: Iaf8f50741d3103480668b4a654a202d8a363bc45
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-02-11 09:37:28 +00:00
Frederik Gladhorn
13b24ab18b Merge "Merge remote-tracking branch 'origin/5.4.1' into 5.4" into refs/staging/5.4 2015-02-10 21:28:00 +00:00