Commit Graph

2029 Commits

Author SHA1 Message Date
Pavel Golikov
278fd530f0 Android: Fix OpenGL texture name leak
This fixes texture name leak when changing media player's source. Texture name
shold be deleted by OpenGLResourcesDeleter class, but when player's source is
changed OpenGLResourcesDeleter's texture name is reassigned with new one
without old name deletion.
This change deletes OpenGLResourcesDeleter's current texture name when new name
is assigned.

Task-number: QTBUG-54340
Change-Id: I22bbd60b4462b0034fd115f0582ea43b9bcaee4b
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
2016-07-06 14:22:04 +00:00
Yoann Lopes
fd89c0946a DirectShow: correctly clear surface in EVR presenter
The surface was never cleared in the EVR presenter. It could lead to
situations where the presenter would use a destroyed surface.

Change-Id: If2223f09f6f8c20c06345bed40803da10dcf4ae3
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2016-07-06 07:35:57 +00:00
Christian Strømme
443ed0be09 Android: Fix attach- and detachFromGLContext()
This fixes a regression caused by ba81276398. The change
assumed that the AndroidSurfaceTexture class could cope with changing
textures, but since the callback from the SurfaceTextureListener was
tied to the initial, invalid, texture handle, it would only work as
long as there were only one texture; all textures would register
the callback to the same invalid handle.
This change maps the callback directly to the android texture object,
instead of the texture handle.

Task-number: QTBUG-54340
Change-Id: I39568d0f97fa6b9cb1182efaca568b16a26f0d09
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
2016-07-05 14:24:40 +00:00
Yoann Lopes
7fb7f278ff DirectShow: fix deadlock in VideoSurfaceFilter
When the DirectShow graph is done being built, there's no need to wake
up any blocking calls on the main thread since setting a source is done
asynchronously anyway.
This could cause synchronous operations (like stopping or changing the
video output) to end prematurely if called while a source was still
being loaded, in turn causing the deadlock.

Task-number: QTBUG-54504
Change-Id: I4f534e637bfca6d3020a3bc28725c8c7042941d5
Reviewed-by: Andreas Holzammer <andreas.holzammer@kdab.com>
2016-07-05 13:57:19 +00:00
Dan Cape
fa91fc211c QNX: Reset playback position before stopping media
This change ensures that the next media file to be played back will start
playing at position 0. Without this change, it would start playback at the
last position of the previous media file.

In the play() function, when attempting to play a video, we first go into
the loading state which just defers playing until later. Since we set the
state to “Playing”, we now accept events from mm-renderer. It sends us a
position update which ends up being from the previous video. Since we’re
in “Playing” state, we trust this event is right and set our internal
m_position variable to that value. Once the media has loaded, play() is
called again and then we hit the call setPositionInternal() which seeks
the media to our internal m_position (the position we got from mm-renderer).

To resolve this, we now will call setPosition in the stop function that
will cause mm-renderer to seek to 0 just before it stops playback
(as recommended in documentation) so that any events we get from mm-renderer
when we move to the “Playing” state will be related to the current media.

Change-Id: I8ae35e57dd690bbae1fb996c1feb15ee4addab55
Reviewed-by: James McDonnell <jmcdonnell@qnx.com>
Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
2016-07-04 14:01:51 +00:00
Tuomas Heimonen
efccadf055 tst_qsoundeffect: Update to case testLooping
Be more permissive while checking loops remaining.
Remove file BLACKLIST

Task-number: QTBUG-46689
Change-Id: I15b5fb55ee770a190b2c21dd8cf1fad45665a73c
Reviewed-by: Milla Pohjanheimo <milla.pohjanheimo@qt.io>
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
2016-07-04 13:32:26 +00:00
Maurice Kalinowski
59f20906d9 winrt: Do not assert when missing region of interest
Asserting is too heavy and can cause false positive on devices like the
Lumia 535, where focus is supported, but not setting a focus point.

Later on we check for existence of the control during the
initialization, so it is safe to continue here.

Task-number: QTBUG-54278
Change-Id: Ie68ff754d742888bdd6f4047e07d207707c90c91
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-07-04 13:20:27 +00:00
Ralf Nolden
bc53bb7913 Fix use of -ESTRPIPE where it's not available in errno
NetBSD does not have -ESTRPIPE, so use it only when defined.
http://netbsd.gw.com/cgi-bin/man-cgi?errno+2+NetBSD-6.0
and https://mail-index.netbsd.org/pkgsrc-wip-discuss/2013/10/27/msg002529.html

Change-Id: I92921a16fcae95f58a870aea98ca66f5a5d30a12
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2016-06-29 09:55:13 +00:00
Yoann Lopes
970128036a PulseAudio: keep device list up to date.
The list of devices was cached on startup and was never updated
when a device was plugged, unplugged or if the default device changed.
We now use the event subscription mechanism in PulseAudio to get
notified of these changes and update the list accordingly.

Change-Id: I5fe1c81494702aa9d38b91009621629dc9606323
Reviewed-by: Karim Pinter <karim.pinter@theqtcompany.com>
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2016-06-20 12:41:30 +00:00
Sze Howe Koh
6d48deed48 Expand license scope from "Qt GUI Toolkit" to "Qt Toolkit"
See http://comments.gmane.org/gmane.comp.lib.qt.devel/25771

Change-Id: I9fc15721bf7a26d5da82739a6c83e76e33bb2827
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
2016-06-16 09:15:28 +00:00
Yoann Lopes
32b8310e34 AVFoundation: improve changing the capture device format.
Make sure the device format is always set in the same way.
We don't actually set the format anymore when it's the same as
the current one. We also make sure the frame rate is preserved.

Change-Id: I1c68239bc99d9c3cef920effcf47fc253220c26f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-06-14 09:55:13 +00:00
Yoann Lopes
af5e0d0485 AVFoundation: re-apply viewfinder settings on mode changes.
Since the active viewfinder resolution can be overridden by the image
and video capture resolutions, we need to re-evaluate the viewfinder
settings whenever the capture mode changes.

Change-Id: Ibdb7a070585cf67ebb2fcfb95ccbdd105f5f41cf
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2016-06-13 13:20:57 +00:00
Yoann Lopes
c6a8c2c846 AVFoundation: fix orientation of recorded videos.
Make sure the video is recorded in the same orientation as the device.
That means the top of the video matches the physical side of the device
which is on top when starting recording.
This patch makes sure the behavior is the same as on Android. In a
future version, we should have an API to pick the desired orientation
of the recorded video.

Change-Id: Ia8bbfe621a0e54de3cb6bfe0a520f37e8a932539
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2016-06-13 13:20:42 +00:00
Yoann Lopes
f5de141070 AVFoundation: implement QAudioEncoderSettings.
Change-Id: I24d3da1417142bc80bc6b6c1c8124c246afe03db
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2016-06-09 12:28:24 +00:00
Yoann Lopes
2303d2fef8 AVFoundation: implement QMediaContainerControl.
Change-Id: I5097a0450f5836e48a697249619a1822775f3ad8
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2016-06-09 12:28:18 +00:00
Liang Qi
e1992d9d1d Merge remote-tracking branch 'origin/5.6.1' into 5.6
Change-Id: I0b4fde2a47b428fd04012a8dbec16fd14797b8dd
2016-06-09 11:15:37 +02:00
Maurice Kalinowski
bff19dbe67 winrt: Fix synchronization problems to render thread
QWinRTAbstractVideoRendererControl::setActive was using
QThread::requestInterrupt previously to indicate to the render thread
that it is supposed to quit.

However, when switching cameras you cannot tell the render thread to
continue rendering. Instead start() is called and then the render thread
recognized the previous interrupt request, resulting in a quit and no
further rendering happening.

Instead we wait for the render thread to complete by using shutdown().

Task-number: QTBUG-53722
Change-Id: Ibee2ed4f64400ca14c788984a73df4be0653ed2b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-06-08 11:09:36 +00:00
Maurice Kalinowski
20299cfc4a winrt: Add logging to QWinRTAbstractVideoRendererControl
Change-Id: I44620b8513fdf20ebc0e093368044133eabdd6b3
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-06-08 11:09:31 +00:00
Christian Strømme
b3af8f65fc Android: Fix crash in AndroidCamere::open()
We would attempt to delete the AndroidCameraPrivate object twice if the
native call to open failed. On recent version of Android (~6.0), this
problem is harder to reproduce, as the camera is properly released when
the application goes into the background.

Task-number: QTBUG-53536
Change-Id: I064d276f9025924dfdb071aa52311d2b553c6953
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
2016-06-03 12:43:55 +00:00
Edward Welbourne
b3aa26a0ff QCameraPrivate: NULL-fill fields to be set up by init().
c.f. the constructor already doing the same for provider and the
various fields populated by initControls(), which init() calls.
Should be redundant (all QCamera constructors do invoke d->init() as
soon as they've constructed d), but better safe than sorry.  Calms
Coverity (CID 22319).

Change-Id: Ibf5d13bb1ef17be8e66fa14ed5617b700051c495
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
2016-06-03 12:38:02 +00:00
Yoann Lopes
5473621bde ALSA: improve handling of default device.
- "default" is a valid argument for snd_pcm_open(), let ALSA handle that
case rather than using the first device in the list.
- Don't add "default" in the list of available devices if there is
already one.

Change-Id: Icd41aa6677923a79faf6c90d0627eedd8700b91b
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2016-06-03 09:44:48 +00:00
Yoann Lopes
d76d3184b7 Android: flush the current video frame when the video output is reset.
The texture renderer could end up in a situation where a frame could be
scheduled to be rendered after the renderer was reset.

Change-Id: Ie6b6c9d0b5f5851f14aa6eb5f8421196aff8c691
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2016-06-03 09:44:10 +00:00
Yoann Lopes
a4656b06eb AVFoundation: correctly set default frame rate on OSX.
On OSX, it's not possible to reset the frame rate to the default value
by passing kCMTimeInvalid, so just set the first value from the
supported frame rates.

Change-Id: I984101c2a95e13053228e56f19b353e716eb2b67
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2016-06-03 09:43:48 +00:00
Yoann Lopes
4fa23e08a1 AVFoundation: implement QVideoEncoderSettingsControl.
Task-number: QTBUG-40338
Change-Id: Ic23dabaad94d7b293019460710ae1a097002e227
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2016-06-03 09:43:10 +00:00
Maurice Kalinowski
c0319d1cfb winrt: focus action has to happen in the xaml thread
Otherwise it will cause asserts and/or crashes.

Change-Id: If8af4202395ae573b280744343dd853346a8c160
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-05-31 11:53:54 +00:00
Maurice Kalinowski
711efc552d winrt: Fix potential crash when querying for resolutions
c84bdf63e4 introduced a potential crash on
Windows Phone as querying for photo resolutions still might return video
properties. As a result, querying for ImageEncodingProperties will fail
and the function returns no resolution at all causing an assert later
on.

Instead of checking for the stream type passed to
getMediaStreamResolutions we have to check for the property type of the
list itself.

Task-number: QTBUG-53714
Change-Id: I7bfc48ebf1fef4f9165135af604ce6c91a418438
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-05-31 10:23:00 +00:00
Oswald Buddenhagen
6d5f375644 do not enable example installs explicitly any more
it's done centrally now.

Change-Id: I67cdafc4f2d419b05fc07bc1d1046afba95a3544
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2016-05-24 15:55:00 +00:00
Yoann Lopes
52ce26c056 Add changelog for 5.6.1.
Change-Id: I5e4d301ff056b3de2da8f9a5271d36364bfd5dc8
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2016-05-23 18:31:50 +00:00
Yoann Lopes
d44a327da4 DirectShow: fix playing resource files.
Our custom filter that streams the data into the pipeline was incorrectly
negotiating the sample type with the downstream filter.
This also fixes playback when passing a QIODevice to QMediaPlayer.

Task-number: QTBUG-46899
Change-Id: Iea8b8731d5404c416c8ed0d59cb61958b13b61b0
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2016-05-20 12:59:25 +00:00
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