Commit Graph

1710 Commits

Author SHA1 Message Date
Yoann Lopes
7bb8b76373 GStreamer 1.0: fix frames being presented too many times.
Presenting a frame originates from a gstreamer thread, we block there
until the frame is actually presented in the main thread. The problem
is that it was presented over and over again until the gstreamer thread
was unblocked.
Make sure a given frame is presented only once.

Change-Id: I46f246740313968637add802f509ebffcc5c19b8
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
2015-04-07 11:59:19 +00:00
Yoann Lopes
de700906a1 Don't error out when presenting empty frames in QSGVideoItemSurface.
There's no good reason to do so. Backends can actually provide empty
frames, for example when flushing the pipeline or after stopping
playback.

Change-Id: I687c12b667e31b25e91c3201f59c52a8969d8e05
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
2015-04-07 11:58:41 +00:00
Yoann Lopes
cbbcf4f3a5 GStreamer: implement unlock() in QGstVideoRendererSink.
There are cases where blocking operations happening in the video sink
need to be unblocked, that's why GstBaseSink has an unlock() virtual
function. Since our custom video sink blocks when starting and when
rendering a frame (while waiting for the main thread to actually do
these operations), we need to implement the unlock() function in order
to unblock these operations when requested by GstBaseSink.

Change-Id: I5cb19ea689e655f572729d931cefec8a4266c94e
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
2015-04-07 11:35:05 +00:00
Yoann Lopes
f3ee857564 GStreamer 1.0: show preroll frames.
We need to implement the show_frame() function from GstVideoSink, which
handles both preroll and normal frames, instead of just
GstBaseSink.render(), which is called only for normal frames.
This was changed for GStreamer 0.10 by 3b20608f.

Change-Id: I4823a575d499cd0d6f9f4cb62e0420e070a05214
Reviewed-by: Andrew den Exter <andrew.den.exter@qinetic.com.au>
2015-04-07 11:34:22 +00:00
Sergio Martins
197373b2d1 Fix BlackBerry -qtnamespace build
Change-Id: I717dad59a466cb7a7480bc772d8f6308ca669d54
Task-number: QTBUG-43569
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2015-04-01 16:17:40 +00:00
Andy Shaw
90fe52d086 WMF: don't resume playback after doing a seek while paused.
Task-number: QTBUG-32746
Change-Id: I5a9ee96324e0ddc65311f47dc887bcb91b036fd2
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-03-31 11:15:18 +00:00
Andrew Knight
6e7a3657dd Remove stray <QtNetwork> includes
Module includes slow down the build when PCH is disabled, so don't use
them.

Change-Id: Ic0bf0d938ef06dea9dba6897df592311230a6529
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-03-30 12:36:16 +00:00
Sergio Martins
14e80dc2d3 Fix QNX 6.6 build by using qSqrt() and qLn()
spectrumanalyser.cpp: In member function 'void SpectrumAnalyserThread::calculateSpectrum(const QByteArray&, int, int)':
spectrumanalyser.cpp:138:59: error: 'sqrt' was not declared in this scope

Change-Id: Ib43c693d73d2342059092094cfc3f48a0f73b4bc
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2015-03-28 18:01:13 +00:00
Yoann Lopes
92ea7cb89b Add missing documentation for AudioSample::source.
Change-Id: Iabfb7749bf42413fc19b53b907027caad931092c
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-03-24 16:03:40 +00:00
Yoann Lopes
d046bc67c7 GStreamer: don't use ximagesink in QGstreamerVideoWidget.
When xvimagesink is not available, we were falling back to ximagesink.
That element doesn't provide some important features: it doesn't scale
frames to the window size and doesn't support brightness, contrast, hue
and saturation adjustments. That kind of makes it useless, at least
on its own. We would need to use at least a 'videoscale' element
together with it to have it working properly.
We're better off letting QVideoWidget fall back to QVideoRendererControl
when xvimagesink is not available.

Change-Id: Ic8c62fbefa3227430e3bae24630c8b3944aabb47
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-03-24 16:03:25 +00:00
Yoann Lopes
4f7e5bf169 WMF: report the surface's supported formats in the correct order.
QAbstractVideoSurface::supportedFormats() returns the formats in
descending order of preference while IMFMediaTypeHandler expects the
list to be in ascending order.

Change-Id: I0ecb5a3b228c0cad78c1a84091e3c3cf272f7ebc
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-03-24 16:03:13 +00:00
Sergio Martins
08058f8483 Fix inconsistent overrides. [-Winconsistent-missing-override]
Change-Id: Icb3e2a640c122424704a8e4b10172ecc7602845a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2015-03-22 19:56:47 +00:00
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