Commit Graph

2000 Commits

Author SHA1 Message Date
Oswald Buddenhagen
df169ba0aa Bump version
Change-Id: I2b6dc0d097a79d91d0c24cebadac1a891337f576
2016-05-19 13:27:00 +02:00
Liang Qi
9ee131c416 Merge remote-tracking branch 'origin/5.6.1' into 5.6
Change-Id: Iaecbb5c4a33bf0eaffa4f1896bdc09751b1f04c4
2016-05-19 06:36:20 +02:00
Ralf Nolden
1df147d533 Make qtmultimedia 5.6 branch compile without c++11:nullptr usage
5.6 should not require c++11 features, however, nullptr slipped in here.
Replace nullptr with Q_NULLPTR for initialization.

Change-Id: Icf62618657b5bb725bd4c8f924853fa191f6e413
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-17 11:45:23 +00:00
Topi Reinio
3e70c65d2c Doc: Remove repository name from examplesinstallpath
Examples in binary packages now directly match the install path.

Change-Id: Ic272c741ca0bb805dc50ce591ac0ea1d93f07944
Task-number: QTBUG-52953
Reviewed-by: Antti Kokko <antti.kokko@qt.io>
2016-05-12 10:08:30 +00:00
Oswald Buddenhagen
690064468c Merge 5.6 into 5.6.1
Change-Id: Ib4a7640e12319d78ea5ae8f58d79c9fab8d0ea60
2016-05-12 11:18:04 +02:00
Maurice Kalinowski
c84bdf63e4 winrt: Fix crash when initializing certain cameras
Some cameras return video properties when querying for
MediaStreamType_Photo, ie. Surface Book. This caused an assert.

Instead when asking for photo resolutions, only query the available
image resolutions and skip results not of type image.

Change-Id: Ia1886a11f47676d6713eec86f3a80c664871a968
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-05-11 10:47:57 +00:00
Maurice Kalinowski
15951e672e winrt: Only set focus if supported
Change-Id: Ic6dc2eb6acbd0f5167aa4bad9af08ce8aa5a456b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-05-10 15:42:13 +00:00
Oswald Buddenhagen
f0e0d5d901 decruft project file
the "created by qt creator" header is not supposed to be checked in.

Change-Id: I6d8c623f41c633babe5923344c915412d3d6bcd4
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-05-10 11:12:21 +00:00
Yoann Lopes
ba81276398 Android: improve texture rendering on API level >= 16.
Android API level 16 added SurfaceTexture::attachToGLContext(). This
allows to create the OpenGL texture when the first video frame is
available, rather than at initialization. This means we can do without
the ugly hack that makes the render thread call us back through some
custom property.
Additionally, it allows to recreate a new OpenGL texture every time
the SurfaceTexture is reset.

Task-number: QTBUG-51911
Change-Id: I17b04524d426c42ef8aa0288b0731597bc9eba62
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2016-05-10 07:37:51 +00:00
Ralf Nolden
37d91ff58d Add FreeBSD define and include for <sys/types.h> where <linux/types.h> is used
Compile fix: FreeBSD uses <sys/types.h> instead of the linux version <linux/types.h>, so this patch
changes the include by Q_OS_FREEBSD define.

Change-Id: Iafe18614ad2360dce9858039b22f9b6c2dd9caaa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-05-09 16:28:41 +00:00
Yoann Lopes
3c3ea1ca20 Android: detect more error cases when rendering frames to textures.
Don't render the frame if the SurfaceTexture has been released or
if the render size is invalid.

Change-Id: I6b8bf14e023ff54a560b0a9e6027ef9d7d06ab6a
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-05-09 13:11:05 +00:00
Yoann Lopes
80d8466a47 Android: correctly use mutex for texture rendering.
Some sections were not protected by the mutex, even though they should
have been. An example of problem that could happen because of this was
if the SurfaceTexture was reset while the render thread was rendering
that texture.

Change-Id: Ie95860fd4eb722bbac04cccc430cc1a8abf1df4d
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-05-09 13:10:55 +00:00
Friedemann Kleint
6f3e6a78ca Polish the videowidget example.
- Add command line parsing and file argument.
- Port to Qt 5 connection syntax.
- Adapt size to available geometry (for High DPI).

Task-number: QTBUG-53114
Change-Id: I1c1c547ddb14210ef5900f99f4870d6d91b67088
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
2016-05-04 04:28:10 +00:00
Friedemann Kleint
1afe2ed975 DirectShow: Invoke IGraphBuilder::AddSourceFilter() with local file name.
When possible, convert the URL to a local file name with native separators.
The method seems to accept URLs with file scheme, but fails when passing
UNC paths.

Task-number: QTBUG-53114
Change-Id: Ib7418090080be8c1b8472e77541e686adaa3a18a
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
2016-05-03 09:24:36 +00:00
Oswald Buddenhagen
6dc5ff99ac fix example installs
Change-Id: I9daec1e1ec1bc163d451ac03685ef6caba7dbde7
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
2016-04-28 12:25:31 +00:00
Zhang Xingtao
20528da413 GStreamer camerabin: return the proper camera source
- return m_cameraSrc for function cameraSource() instead of m_videoSrc.
   m_videoSrc is not always assigned(default 0), it will crash on:
   if (g_object_class_find_property(
      G_OBJECT_GET_CLASS(m_session->cameraSource()), "exposure-mode")) {
   And as the function name says, it would be better to return the
   value m_cameraSrc.
 - make sure pointers are not NULL before using them.

Change-Id: I8a56db34a805724b428409b87de7d072ee7bfa57
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
2016-04-28 12:24:41 +00:00
Dyami Caliri
cf44daa754 CoreAudio: use AudioComponent instead of deprecated Carbon Component
OS X 10.11 generates a warning when the code uses the Carbon Component
Manager to locate audio devices. The new AudioComponent interface has
been available since 10.7.

Change-Id: I46ecbcd62871ecc46ce3ebd9ea2a37a9e1342f41
Task-number: QTBUG-48828
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
2016-04-27 12:27:26 +00:00
Dan Cape
c1cfbd98d2 QNX: Avoid reading frames faster than they're rendered
The previous code would capture frames with a 60Hz timer
into two pixmaps alternating pixmaps with each successive
frame.  Rendering was somewhat disconnected from this, if
rendering was unable to occur at 60fps, multiple frames
might be copied for each frame rendered.  This meant that
it might try copying a video frame into a pixmap that was
currently being used by the GPU with bad effects.  The
primary effect being severe flicker on i.mx6 targets.

The change is to ensure that we don't read the window data
until we're just about to make use of it.  This means we
don't ever get ahead of ourselves and read the video window
once for every frame rendered.

The code has been significantly refactored.  There is now
a class that manages the pixmaps and egl images.  This is
created on demand and the images are created and destroyed
when sizes change.  Since this all now occurs in the proper
thread, much of the nonsense of setting _q_GLThreadCallback
to arrange a call from the render thread is avoided.

Remove BlackBerry ifdefs that are no longer used.

Change-Id: I4bf5efa4c39c8170e3f55499c167ee10e521e100
Reviewed-by: James McDonnell <jmcdonnell@qnx.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2016-04-27 10:58:11 +00:00
Christian Stromme
80deebcee3 Fix macro redefinition warning
Don't re-define APIENTRY macros unconditionally on mac.

Change-Id: I894f866da0ec0d6da76a62f01c24739be92d851f
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
2016-04-27 10:54:41 +00:00
Christian Stromme
d73812dcb6 Fix unused variable warning
- warning: unused variable 'm_renderer' [-Wunused-variable]

Change-Id: Ie7d8ebe35a3ab0beb66cda3448595ed952f7dea4
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
2016-04-26 13:53:04 +00:00
Christian Stromme
eabe79f9fd Fix property attributes.
A property can't be both constant and writable at the same time.

Change-Id: Ie1f81fdf10eba7fe84f98f7c34f829cdac654e75
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
2016-04-26 13:51:23 +00:00
Maurice Kalinowski
7553a05213 winrt: Disable camera deactivation automation in debug mode
Camera control reacts to an application becoming inactive and turns off
the camera. However, when debugging or watching internals inside an IDE
this feature breaks the state of the application as the IDE gets focus
and hence camera is turned off.

Change-Id: I6f80476592c0faa32e9da11401f699c6211d226a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-04-22 11:44:56 +00:00
Maurice Kalinowski
a75f8fd0bb winrt: Fix device watcher handling
When device watcher has been started it can have the enumerationComplete
state in addition to started. Hence only start the watcher if none of
those two states is present. This fixes an assert where starting an
already started watcher failed.

Change-Id: Idc3af256845f0993a26e8d186b499ef1c7e7dacc
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-04-22 11:44:51 +00:00
Maurice Kalinowski
a0a20157ef winrt: fix camera control after move to xaml thread
Camera control management has to happen inside the xaml thread,
otherwise the behavior is undefined. This results in ie. the first
capture not working due to synchronization issues.

When (de-)activating the videoRenderer we have to switch to the UI
thread first.

In addition add focus for Windows 10 (Mobile), previously it was compiled
for Windows Phone 8.1 only. On desktop this might return no focus mode
to be supported, but API-wise this is available.

Task-number: QTBUG-47803
Change-Id: I9b345ebc82502fc6e00aede43b9096893cd0ad53
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-04-22 11:44:45 +00:00
Maurice Kalinowski
65c9e24c10 winrt: Add categorized logging to camera control
Change-Id: I6d823ac07950212d766905c9409469f2b1b84954
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
2016-04-22 11:44:40 +00:00
Maurice Kalinowski
5206d37836 winrt: Use ComPtr for better ref count tracking
Just forwarding the content of a ComPtr is potentially dangerous.

Change-Id: I4f3dfa04a5844d299a5653e31a4a0d1e1b86f9b5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-04-22 11:44:37 +00:00
Timur Pocheptsov
f97e1988a6 AVFMediaAssetWriter - fix potential race condition(s)
1. m_writerQueue is now shared by recorder control and asset writer
   to ensure it lives long enough.

2. m_delegate->method() calls from async block can be dangerous, since by the time
   this block is actually executed, delegate can be deleted already. This fix uses
   Q_INVOKABLE and invokeMethod with QueuedConnection instead.

3. -finishWritingWithCompletionHandler: is async and when the block finally gets
   executed, lock and 'if aborted' test are still needed.

4. Simplify the logic and reduce locking.

Change-Id: If23daf2fe22043244033427a7f6517a0fe3f23d1
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
2016-04-21 11:32:41 +00:00
Maurice Kalinowski
ffe61fd516 winrt: Remove capability specification
This is handled with 34e0e908c896126138a95abdeba7456499d0fb68 in qtbase.

Change-Id: I41cf27690189aefb3000de90df4a518d8dd449f0
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-04-21 08:31:28 +00:00
Timur Pocheptsov
2170a3b0fc AVFFoundation - fix a compilation error (iOS, XCode 7.3)
__weak previously was a simple noop, but now it ends up in a compilation
error in non-ARC'ed source code ('declaration uses __weak, but ARC is disabled').

Task-number: QTBUG-52671
Change-Id: I574519f892ba1d5f71488c5cc26423d04d5e02cf
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
2016-04-19 13:24:12 +00:00
Stephen Hurd
9047d9b84e ALSA: Call snd_pcm_drain() on suspend
The ALSA plugin previously didn't suspend the ALSA device when the
::suspend() method is called.  This results in underrun errors when
it's resumed.

In ALSA, stopping a pcm doesn't close it, so the ALSA stop/start
functions map to the QAudioInput suspend/resume functions.

Change-Id: I2507065a1b7472af29eef70c531b9f6e8e5b3072
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-04-15 15:06:38 +00:00
Yoann Lopes
b5a184ec2d AVFoundation: fix switching to still image capture mode.
It would reset the active format on the capture device. The patch
prevents that.

Change-Id: I97c192c064bf3c6ed4ba1f8d78768196927819a7
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-04-13 12:44:15 +00:00
Yoann Lopes
c8090b7952 AVFoundation: return correct viewfinder settings.
When the camera is unloaded, return the requested settings.

Change-Id: If39e158cd8d0fd8d4bbd7cf6cd48226cdefc1272
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-04-13 12:44:02 +00:00
Liang Qi
40924657e9 tests: skip tst_qaudiodecoderbackend when no audio decoding support
Task-number: QTBUG-46331
Change-Id: I9168ae7d89869cc0811394fc4091a5e44c136b9b
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-04-08 18:18:36 +00:00
Maurice Kalinowski
c8eed01f1f winrt: add default capabilities
A module compiled for WinRT should define a default set of capabilities
to enable all features specified by the module.

Task-number: QTBUG-38802
Change-Id: I57c3aec60c72b1383b836cee2087b801196def1d
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2016-04-08 04:41:13 +00:00
Andreas Holzammer
c9e668cdb6 wince: revert flipping Video content
It turned out in my previous tests, that the codec which I used is
buggy and does not play well with this documented behavior.

Change-Id: I8aff9f68d449da10de4fa33073d5d5cbe9b2a281
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2016-04-06 13:30:39 +00:00
Christian Strømme
3fb3231a9e DirectShow: Release all filters when disconnecting the graph.
When disconnecting the graph we need to make sure that all the filters
in the graph are released, even the ones that are automatically added.
Since we can't know in advance which filters the graph consists of, we
need release them one by one.

Task-number: QTBUG-49281
Change-Id: Ifdf2fb6fe1c90ab85b47565c5fe82b6ebe55b183
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2016-03-31 10:12:37 +00:00
Marc Mutz
6569c25619 tst_qdeclarativeaudio: fix ubsan build
The test uses QDeclarativePlaylist, but no out-of-line methods or
data members, so it got by with just including the header.

But a ubsan build requires access to the class' typeinfo objects,
so add QDeclarativePlaylist's implementation to the test, too.

Change-Id: Ib6bb155b71c0082969f77a13a0e50132a782db2d
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2016-03-29 12:28:58 +00:00
Dan Cape
15c42ebccb QNX: Fix video playback on VMWare
Mark eglImage as not supported on VMWare since that path requires
that the image data be in GPU accessible memory which is not the
case for video

Change-Id: I2ea1ec52842adf0bc1ca39c882e6771e6a992c65
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2016-03-22 12:18:01 +00:00
Edward Welbourne
45ca387cb0 Purge sRGB chunks from PNGs in documentation.
Subjects each *.png file that matched grep -law "sRGB" to:
pngcrush -ow -brute -rem allb -reduce -force

Change-Id: I2ac34243ebe39c93860c5ac595c2f1eca4322eb8
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-03-22 12:09:19 +00:00
Edward Welbourne
7b68ca81dd Purge sRGB chunks from PNGs in examples.
Subjects each *.png file that matched grep -law "sRGB" to:
pngcrush -ow -brute -rem allb -reduce

Change-Id: Iff326d7e63d6e0106204beb1f42700032cb6b79a
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
2016-03-22 12:09:07 +00:00
Friedemann Kleint
71a6b1b620 DirectShow: Fix MinGW warnings about signedness of comparison.
Use a switch on int instead of else if.

common\evr\evrcustompresenter.cpp: In member function 'virtual bool EVRCustomPresenter::event(QEvent*)':
common\evr\evrcustompresenter.cpp:1882:22: warning: comparison between 'enum QEvent::Type' and 'enum EVRCustomPresenter::PresenterEvents' [-Wenum-compare]
     if (e->type() == StartSurface) {
                      ^
common\evr\evrcustompresenter.cpp:1885:29: warning: comparison between 'enum QEvent::Type' and 'enum EVRCustomPresenter::PresenterEvents' [-Wenum-compare]
     } else if (e->type() == StopSurface) {
                             ^
common\evr\evrcustompresenter.cpp:1888:29: warning: comparison between 'enum QEvent::Type' and 'enum EVRCustomPresenter::PresenterEvents' [-Wenum-compare]
     } else if (e->type() == PresentSample) {

Change-Id: I8533e2c6d9b0a01b7b95e1d8bb119b50d4aabd25
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2016-03-21 08:08:46 +00:00
Dan Cape
d48fbf286b QNX: Fixed issue with non Qt-related mm-renderer windows
Windowgrabber would catch events from windows that were not related to
Qt Media Playback. Now there is a check to ensure the window id to
compare against is set before assigning the window to the Windowgrabber.

Change-Id: Ic85198de5fdb05e9fa740fc7b3b81f3bdffd631d
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: James McDonnell <jmcdonnell@qnx.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2016-03-20 03:53:27 +00:00
Mark Brand
bf899dbf4d fix case of included files
Cross-compiling for mingw requires lowercase filenames.

Change-Id: I135deca455ca2ff6bb3969aca990fe9d1c2dd345
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2016-03-18 13:50:09 +00:00
Frederik Gladhorn
812ab8e6a3 Merge remote-tracking branch 'origin/5.6.0' into 5.6
Change-Id: I91fb2886b4ab8f0b9e2e28329cec69dfa2cb5435
2016-03-17 16:05:28 +01:00
Yoann Lopes
b17e0cd5dd PulseAudio: change the way volume is applied.
We used to change the PulseAudio sink input volume. Doing so had
some potential unwanted side effects depending on the PulseAudio server
configuration. When flat volumes were enabled, it would affect the
global system volume. It could also affect the volume of other streams
having the same audio role.
Volumes in Qt Multimedia are supposed to be relative to the application
volume and should not affect anything else than the object on which it
was changed. To guarantee that, PulseAudio volume APIs are not used
anymore. Instead, software-based volume attenuation is applied on the
audio samples before being passed to PulseAudio.

Applies to QSoundEffect, QAudioOutput and QAudioInput.

Task-number: QTBUG-40823
Task-number: QTBUG-49461
Change-Id: I690716976bda8fe666969ca2cbdf6d8d0b419733
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-03-16 12:04:33 +00:00
Yoann Lopes
399ec97f10 Windows EVR: show frames when pausing from stopped state.
The QAbstractVideoSurface was started only when calling play(), causing
frames received before (e.g. when pausing from stopped state) to not
be rendered.
The surface is now started as soon as a media type is agreed between
the EVR and the upstream element. Conversely, the surface is stopped
whenever the media type is cleared.

Change-Id: Ia96a07dbd277adce67de5a9cfbf9acc0d33b6497
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-03-15 15:35:49 +00:00
Maurice Kalinowski
b044066835 Reinitialize audio when changing device in examples
Different devices might have different audio formats supported. Always
relying on the format of the default device can cause the audio endpoint
to not start/initialize.

Change-Id: I4d05949fd023f2cc7eb1f75db3577242e0e66680
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-03-11 07:06:49 +00:00
Lisandro Damián Nicanor Pérez Meyer
680cc0c974 ALSA: simplify checking the available version.
Make use of SND_LIB_VERSION instead of SND_LIB_[MAJOR MINOR SUBMINOR]
in order to simplify the tests.

Task-number: QTBUG-51681
Change-Id: Ib9f28ff15ddc643cc426ded3a5779fb4ff651139
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-03-10 12:42:42 +00:00
Andreas Holzammer
77c9ab4a38 Port DirectShow backend to wince
dshow.h needs to be included before Qt headers as they include the
windows header with NOMINMAX macro set. DirectShow header needs min/max
macro definition to compile. The min/max macro then conflicts with
QDateTime header, hence needs to be undefined again for some occasions.

Windows Embedded Compact then defines INTERFACE as macro, which conflicts.

Windows Embedded Compact does not support audio end point selection.
Feature has been disabled for this platform.

Windows Embedded Compact does not support setting meta data, control has
been disabled.

Windows Embedded Compact does not support VMR, feature was disabled.

Direct Show renders always top to buttom.

Change-Id: Id17700835e2105fb127b12e3448bea16e3b52546
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2016-03-09 12:09:49 +00:00
Marc Mutz
3198bf4944 Add explicit and make public headers compile with -Wzero-as-null-pointer-constant
... or equivalent.

QtBase 5.6 headers already compile that way, so let the other
modules follow suit.

Cleaned up placement of * and & in parameters as a drive-by.

Added explicit where it was missing as a drive-by. This is
not a source-incompatible change, because code that breaks
by this is a bug. Let's not have this sitting around in an LTS.

Task-number: QTBUG-45291
Change-Id: If81ed0c71393aee21d347f5ade4bf3fcc07cd82f
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2016-03-03 16:34:50 +00:00