Commit Graph

1782 Commits

Author SHA1 Message Date
Konstantin Ritt
d9a988971f [QtAudioEngine] Fix C&P typo in the SoundInstance docs
Change-Id: Iffe26a13f58c1e4cffe81099d5f0ef204f582999
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-04-13 13:59:44 +00:00
Konstantin Ritt
45d4ef1699 [QDeclarativeSound] Pass QString by const-ref
Change-Id: Ic600e62420c2e3ccc66f037e0fe44374e505c0d1
Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-04-13 10:02:33 +00:00
Konstantin Ritt
b987b7087e [AudioEngine] Minor code clean-up
Move StaticSoundBufferAL declaration to .h file and replace
inherits("StaticSoundBufferAL") check with qobject_cast.

Change-Id: Icedc2796cf31b3a92335112a77cac24a5a34ac15
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-04-13 10:02:06 +00:00
Konstantin Ritt
fe1046794d [AudioEngine] Do not crash on destruction after sample loading error
m_sampleLoader must be destroyed AFTER releasing the buffers it holds.
Also properly release sample on error and be safer
while destroying the buffer.

Change-Id: I5e39c6c815b8760f72cc5fdc61fad020d3cd1cc1
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-04-13 10:00:56 +00:00
Konstantin Ritt
37d5b53fae [AudioEngine] Minor improvement to the docu snippets
Without mentioning the playType property, it is unclear for the user
not familiar with AudioEngine why there are several PlayVariation-s
binded to a single Sound element.
Also fix a simply typo.

Change-Id: Ie6b4bff759318c70c94e75797cc6991cb9b918ca
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-04-13 09:58:53 +00:00
Konstantin Ritt
277d104faa [DirectShow] Fix potential memory access violation
Change-Id: I5da495d255e6fdd3a70c1ed486afb61f157c923e
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-04-13 09:58:28 +00:00
Konstantin Ritt
740f16ac60 [DirectShow] Fix potention undefined behavior on destruction
The exact warning is:
> deleting object of polymorphic class type which has non-virtual
  destructor might cause undefined behavior

Change-Id: I8f259def3f1f7f776fb31ace9dfcc7145426f5c0
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-04-13 09:58:12 +00:00
d3fault
e88da21a20 Made audio output example easier to understand. No real code changes
Maybe it's just me, but every time I try to read the "toggleMode" method
in the audio output example, I get confused on whether I'm switching to/
from push/pull mode, and even what pushing and pulling entails. The name
of the push timer also seemed backwards (which added to the confusion).

Change-Id: I5ff7d18f72490c22b91a948ad7513b402a01c5e4
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-04-10 22:21:57 +00:00
Yoann Lopes
def89d7171 AVFoundation: fix QCameraInfo::availableCameras() on OS X.
Cameras can be dynamically added or removed on OS X. Make sure
the cache is updated often enough so QCameraInfo::availableCameras()
return an up to date list.

Task-number: QTBUG-39708
Change-Id: Id806d52278e1a29163fcc6707da7f86c0f3e7c0d
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
2015-04-10 09:12:41 +00:00
Friedemann Kleint
614dee2f8f Fix tr()-context of message in QMediaPlayerPrivate.
QObject::tr() should be avoided.

Change-Id: I583ff7f6fec664030f5637fe216dfd44c1b1f2ac
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-04-09 10:35:02 +00:00
Yoann Lopes
fa9e829a60 Updated plugins.qmltypes.
Task-number: QTBUG-44300
Change-Id: Id6c8dce17e03c79f29581bd49be184a8d3e7f21b
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-04-09 09:36:40 +00:00
Yoann Lopes
a700ff9674 Make the QtMultimedia singleton type a QObject.
It was a QJSValue for the sake of being as lightweight as possible
and because we don't actually need any of the QObject features for that
type in its current state.
However, this implies that type information is not available at
runtime. This is a problem for qmlplugindump which currently crashes
because it always expects every QML type to have an associated meta
object.

We can safely make that type a QObject since it doesn't affect source
compatibility in any way. This type was bound to become a QObject at
some point anyway.

Task-number: QTBUG-44299
Change-Id: I2d9b874f15ffc94ed95ef74fadc3b1fd193fe1ef
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2015-04-09 09:36:34 +00:00
Liang Qi
3059103201 Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: I17ddd1ce77e07cf75567e2dc723e29d54088f68e
2015-04-08 21:24:43 +02:00
Yoann Lopes
ddec92543f Fix type of Camera's errorCode property.
It's supposed to be of type enumeration (Error) and not QString.

Change-Id: Ia3ce112efa3e87614c79b89d05313b0faa557289
Reviewed-by: Andrew Knight <qt@panimo.net>
2015-04-08 10:07:27 +00:00
Yoann Lopes
63cff37741 QMediaPlayer: handle resource files in a cross-platform way.
It was the backend's responsibility to handle resource files in an
appropriate way. In practice, it was either not handled at all,
or implemented in an almost identical manner in every backend
that does handle it.
This is now dealt with in QMediaPlayer, always passing to the
backend something it will be able to play. If the backend has the
StreamPlayback capability, we pass a QFile from which it streams
the data. If it doesn't, we copy the resource to a temporary
file and pass its path to the backend.

Task-number: QTBUG-36175
Task-number: QTBUG-42263
Task-number: QTBUG-43839
Change-Id: I57b355c72692d02661baeaf74e66581ca0a0bd1d
Reviewed-by: Andrew Knight <qt@panimo.net>
Reviewed-by: Peng Wu <peng.wu@intopalo.com>
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-04-07 17:21:47 +00:00
Friedemann Kleint
4d17db19f8 Fix debug stream operators.
- Use QDebugStateSaver to restore space setting in stream operators
  instead of returning dbg.space() which breaks formatting on streams
  that already have nospace() set.
- Fix some single character string constants, streamline code.

Change-Id: I18ae7324b172ea801aa9b5fe56ddf6fe527fdde9
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-04-07 17:21:38 +00:00
Andy Shaw
72a43cee90 Fix compile issue when building with -no-widgets
Change-Id: I49a9aa684b0dfbe0e3d9e576aad06d65d6c3ecdd
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-04-07 13:28:16 +00:00
Yoann Lopes
0cd222c9b4 Fix audioengine example.
- Add missing audio files
- Fix 'Unable to assign double to QVector3D' warning
- Don't show decimal part of the volume

Task-number: QTBUG-41841
Task-number: QTBUG-44304
Change-Id: Ie24284242bbac0d10bd85841932c506d7634a514
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-04-07 12:08:01 +00:00
Yoann Lopes
9fccf8064d Fix incorrect warning in QML AudioEngine.
We need to do an early return when an AudioCategory is successfully
added to an AudioEngine, otherwise a warning is incorrectly shown.

Change-Id: If310c694a703242aff7f1c5ae04ad3e40c3f1acd
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-04-07 11:59:30 +00:00
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
Liang Qi
c1dbca5f10 Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: Ic09d6310fcb6d8198b6ec2dc0459c1694e9df8c9
2015-03-17 16:40:28 +01: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
Frederik Gladhorn
7dfcc372cb Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: Idd1e7cf9f11d05b8d1a19ba349474eda67bc705a
2015-03-03 18:13:51 +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