Commit Graph

805 Commits

Author SHA1 Message Date
Roger Maclean
8b00d8e542 QNX: Handling looping properly
On play, if we're at the end of media, set the position to
the beginning.  The code was previously setting the position
to the last known position, likely just prior to the end
which causes the last few frames of video to be played
endlessly.

Task-number: QTBUG-49668
Change-Id: I9613114294c22152dd66ae7111c38c8cdef5b907
Reviewed-by: Dan Cape <dcape@qnx.com>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-12-03 11:57:51 +00:00
Yoann Lopes
5ed9b6d6d7 AVFoundation: fix setting up the video capture session.
Because of an incorrect 'if' condition, the video capture session was
set up twice when starting the camera.

Change-Id: I4211a8c77ab9b8086628fb0f12fb28842de830cf
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-12-03 09:40:28 +00:00
Yoann Lopes
8dc46cef05 AVFoundation: fix setting the camera viewfinder resolution.
Image capture resolution and viewfinder resolution must be the same,
with the image capture resolution taking precedence over the viewfinder
resolution when both are explicitly set.
The code was getting the active image capture resolution, instead of
the one explicitly requested, to adjust the viewfinder resolution.
That effectively made the viewfinder resolution always ignored since
the active capture resolution always has a default value.

Task-number: QTBUG-49170
Change-Id: I2f3d01366d83a3e28c0a1ea0109663cfdfa75963
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2015-12-03 09:40:21 +00:00
Yoann Lopes
b7880782b9 Android: check for exceptions in some camera operations.
Not all camera operations are documented to raise exceptions, but they
actually might do so depending on the hardware/drivers.
Check for exceptions in all functions that could porentially fail
and react appropriately.

Task-number: QTBUG-49134
Change-Id: I633ca7f2e3aeb6532e1c445735e62135f52cf25f
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-12-03 09:40:16 +00:00
Denis Shienkov
7f04598859 DirectShow: Implement basic QCameraImageProcessingControl interface
This commit implements the contrast, saturation, brightness and
sharpening adjustments, using DirectShow backend.

Change-Id: I438595550ff804f2a20028b4bc020c566d309127
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-12-01 13:00:26 +00:00
Raphael Kubo da Costa
3b322323d0 alsa: Relax ALSA version checks for 1.1.x to be detected.
Relax the check for SND_LIB_MINOR and SND_LIB_SUBMINOR so that ALSA
1.1.x is not considered older than 1.0.10. QtMultimedia builds fine with
ALSA 1.1.

Change-Id: If697c34cc7d9bbe2f2a3413d0c25ac4de4e93b34
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-11-27 22:41:13 +00:00
Samuel Nevala
1950765b65 winrt: Fix Lumia 930 black viewfinder.
Add Lumia 930 to the camera texture blacklist.

Task-number: QTBUG-49660
Change-Id: Icc4cdbb5e5e736b2273c46f0537a62aeaad0c605
Reviewed-by: Matti Malinen <matti.malinen@digia.com>
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-11-27 14:45:13 +00:00
Friedemann Kleint
4b2e4f5924 DirectShow: Remove unused static function decibelsToVolume().
Fix warning:
player\directshowplayercontrol.cpp:56:12: warning: 'int decibelsToVolume(int)' defined but not used [-Wunused-function]

Change-Id: Ic482be6b58f675da008a0e0600d73c127871f3d7
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-11-25 11:57:57 +00:00
Yoann Lopes
9937c67dec Implement volume in audiocapture plugin.
This plugin uses QAudioInput as audio source for the recording, just
forward the volume to it.

Change-Id: Ice3ec5e48195b13d5f738b79a357dfc261ad8955
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-11-23 11:48:37 +00:00
Yoann Lopes
9b5a67d810 AVFoundation: improve viewfinder settings.
Retrieving the supported viewfinder settings don't actually require
a video surface, we just need a capture device. The supported settings
can now be retrieved without calling QCamera::setSurface().
More generally, all viewfinder settings that don't require a video
surface can now be gotten/set before calling setSurface().

Task-number: QTBUG-49170
Change-Id: I39b14eeb40517a9ba399748b5778be8bbc8cfcda
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
2015-11-20 16:49:01 +00:00
Yoann Lopes
7221ed82d2 Merge remote-tracking branch 'origin/5.5' into 5.6
Change-Id: I8e0f222f110cc23b426f2d68416f5cc3982e30f2
2015-11-20 16:21:38 +01:00
Samuel Nevala
4b25972f9b winrt: Wait for focus to finish when camera stopped
Change-Id: I53918a8f7c5f50331593ad09233cd737e040e650
Task-Id: QTBUG-49527
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Matti Malinen <matti.malinen@digia.com>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
2015-11-20 12:57:25 +00:00
John Brooks
5c09c4c3c7 Fix use-after-free in AVFCameraService during renderer destruction
Change-Id: I10a994b71e55565c0de31aa0c34f32964e2e3a1b
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
2015-11-19 23:36:39 +00:00
Samuel Nevala
b80436a3e0 winrt: Early return from searchAndLock if camera not active.
Change-Id: If2279db9cffbc5d06f0d662b6f942b6985034675
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
Reviewed-by: Matti Malinen <matti.malinen@digia.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2015-11-19 12:12:03 +00:00
Yoann Lopes
5135ffaf2a Add qt_real_to_fraction() helper function.
Private API meant to be used by plugins whose backends expect frame
rate values represented by a ratio.
The function implementation was moved from the AVFoundation plugin
to the QtMultimedia library.

Change-Id: I555b9d5da5ca3bae88992ed03501869fb731e45f
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-11-19 11:59:25 +00:00
Yoann Lopes
7c4574a698 Support compiling with GStreamer < 0.10.32 in the camerabin plugin.
The documented minimum GStreamer version for Qt Multimedia is 0.10.24,
however, the camerabin plugin actually required 0.10.32 to compile
successfully. The reason is mainly due to the GstEncodingProfiles
API, which is used to implement the audio and video encoding settings
controls. There's no hard requirement for that API anymore and the
aforementioned controls simply don't do anything when the GStreamer
version used to compile is older than 0.10.32.
A few other GStreamer calls had to be ifdef'd or replaced in order
to compile with 0.10.24.
Note that this patch only makes sure it compiles with older versions,
running the camerabin plugin with GStreamer < 0.10.32 is currently
untested and it might not work as expected.

Task-number: QTBUG-48914
Change-Id: I4ce8e932f24a33e919e29326729e12bbae561faf
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-11-19 11:59:20 +00:00
Morten Minde Neergaard
4a2c597a06 Don't initialize volume on pulse audio input by default.
Task-number: QTBUG-49461
Change-Id: I32b707e19091ab8344175b2dc0cdd1747f1186b3
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-11-19 11:56:04 +00:00
Liang Qi
bcdfb1e6b9 Merge "Merge remote-tracking branch 'origin/5.5' into 5.6" into refs/staging/5.6 2015-11-18 15:27:54 +00:00
Samuel Nevala
88c3398e0e winrt: Fix toggling camera position.
Change scanline direction every time camera position changes.

Change-Id: I8673eabe361c951f97f4422a682d11e862f8b27a
Task-Id: QTBUG-47809
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
2015-11-17 14:59:39 +00:00
Liang Qi
04e36a02f2 Merge remote-tracking branch 'origin/5.5' into 5.6
Change-Id: I72dc669a746c7685874afced3ee0f2f899aaf1cc
2015-11-17 07:22:52 +01:00
Samuel Nevala
da0b7aea9a winrt: Fix crash when camera unloaded while searching focus.
Return early from focus related methods when async operation reports
that it is write protected.

Change-Id: I41bf9121e7ae431e5158b5e4c43cde582c30dfd7
Task-Id: QTBUG-49347
Reviewed-by: Peng Wu <peng.wu@intopalo.com>
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-11-11 22:12:55 +00:00
Denis Shienkov
b05fac61e0 QtMultimedia: Fix build with CONFIG+=use_gstreamer_camera option
Change-Id: If2d996545cc61c019f44c3c4f311b659513ff754
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-11-11 13:35:47 +00:00
Nodir Temirkhodjaev
b611490074 DirectShow: Avoid warning about unresolved error when file is missing.
AddSourceFilter() can return E_FAIL.

Change-Id: Idbd8ec5a4a3c9b9d8fef9ff690cc0169f4027666
Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
2015-11-11 09:05:26 +00:00
Yoann Lopes
12fba3bfb1 DirectShow: fix custom renderer reference counting.
Change-Id: Iadefd4d72bdafb982a79b99ee5880dba32f3e920
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-11-06 16:47:08 +00:00
Yoann Lopes
95bd9d58d8 DirectShow: use the EVR in the window control.
Reuse existing code from the WMF plugin, which already uses the EVR.
This enables HW-accelerated video decoding when using QMediaPlayer
with a QVideoWidget.

Task-number: QTBUG-45593
Change-Id: I757e4d53cd2c648aee6ba33a4851a8c6adc62843
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-11-05 11:34:55 +00:00
Yoann Lopes
3ef5831041 DirectShow: fix media player seeking.
Correctly handle seek requests happening when the media is not playing.

Change-Id: I82c508dae41792b75a26e86512da66a4871f6352
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-11-04 15:04:37 +00:00
Yoann Lopes
953a61e5fd DirectShow: fix some media player status issue.
Change the status to LoadedMedia if the media position is changed while
in the EndOfMedia status.

Change-Id: I6614fc184be80b11952b0e45af22ef030cfc36c5
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-11-04 15:04:30 +00:00
Yoann Lopes
556fa07121 DirectShow: clear current video frame when stopping.
Change-Id: I063d8a1b95f3d751f55dfce7fa2cb749177dc906
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-11-04 15:04:21 +00:00
Yoann Lopes
4c189b18c3 DirectShow: set timestamp on media player frames.
Change-Id: Ie3d395c7ac4a9c1f52c3dedfd5bc3993744aa503
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-11-04 15:04:14 +00:00
Yoann Lopes
1ed707deea DirectShow: fix setting volume when a media is not loaded.
Store the pending volume and apply it once the media is loaded.

Change-Id: I6998e9139aa3680220faa871b3116409855a1b35
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-11-04 15:04:08 +00:00
Yoann Lopes
9ebf1265da AVFoundation: don't automatically rotate camera captures.
We shouldn't do this automatically, as different kind of orientations
might be wanted (sensor, device, UI). The default should be sensor
orientation (no rotation applied).

We should add an API to QCamera to enable automatic orientation of
captured images.

Change-Id: I56fff7f0c4aaaee37eb6ae2628e27073b4946b66
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-11-04 15:03:51 +00:00
Maurice Kalinowski
14adf0f24c Remove superfluous include
Change-Id: Ic8855911515b5fb5283536c4ee73e6f0203ece1e
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-11-03 17:15:20 +00:00
Yoann Lopes
c106041bd6 GStreamer camerabin: always provide the zoom control.
It doesn't actually require GstPhotography to be available at compile
time.

Change-Id: I738e71e4a108a40e79440096be6607afff0134fa
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-10-28 14:59:05 +00:00
Samuel Nevala
ac1b772ec8 winrt: Fix crash when focus operation in progress.
If focus is locked repeatedly and fast on Lumia 920 FocusAsync
returns null IAsyncAction and ::await crash on null pointer. Fix crash
by returning early from method when operation in progress.

Change-Id: Ie268fd2276d3e9090a47bf362cd58743bb83284a
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-10-22 16:50:06 +00:00
Yoann Lopes
038e22078b AVFoundation: fix camera capture previews.
Generate the preview from a viewfinder frame and not from the final
JPG image. In addition, the preview is now rotated to always be in the
same orientation as the device at the time of capture.

Task-number: QTBUG-46971
Change-Id: I48851225738e50fbd89c2f94904bac366303a9ad
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-10-20 12:51:28 +00:00
Yoann Lopes
5b3cd2f8b1 Add private API for conversion from QVideoFrame to QImage.
The Android plugin had a function to convert from NV21 to RGB32.
It's now moved to the Qt Multimedia library and it supports additional
source formats. It could be further improved with more SIMD code, it
could then become a public API.

Change-Id: Ibee349027048a263a1a7ea74dc51237f7747912c
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-10-20 12:51:17 +00:00
Yoann Lopes
ee8aca6c87 Merge remote-tracking branch 'origin/5.5' into 5.6
Change-Id: Ie1e478eca1cdfd99ccd3a3c8a07aefbfa27ccbdb
2015-10-20 13:20:44 +02:00
Yoann Lopes
3d3d2a4967 GStreamer: fix compilation with version < 0.10.31.
Qt 5.4 and earlier required GStreamer 0.10.24 as minimum version.
Qt 5.5 added code that requires 0.10.31, this code is now ifdef'd
and we now support again 0.10.24.

Task-number: QTBUG-48353
Change-Id: Ie708a33c0515874b003ce26a3400475075d316ca
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-10-20 08:32:36 +00:00
Yoann Lopes
d1bf781c66 AVFoundation: fix camera frames texture format.
Change-Id: I87ca4abf80a5be9983aefc791b8a0ef0cd4ac33d
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-10-16 12:45:32 +00:00
Samuel Nevala
f5235af0dc winrt: Unload camera when application is suspended.
Camera needs to be unloaded when going to suspend. Otherwise resume from
suspend will hang and application will be terminated.

Change-Id: Idc8bd47e56c99ebd53a1a4632338cf977317a495
Task-Id: QTBUG-48569
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-10-15 10:53:01 +00:00
Samuel Nevala
787dcd9e4d winrt: Prevent camera device from being suspended.
On certain Lumia devices video buffer gets page locked when camera
is stopped. Subsequent call to video frame map/unmap leads to camera
device suspension. As a fix delay camera unload until all mapped
video frames are unmapped and return early from video frame map when
camera is not active.

Task-Id: QTBUG-48672
Change-Id: If547b9d430727bbe0e12cd8c07a30aeff81d13e3
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-10-15 06:19:14 +00:00
Samuel Nevala
d50a09965a winrt: Fix two possible null pointer exceptions
If camera state is changed rapidly these can occur.

Change-Id: Ia9ccf9e03162350cd411ff9fc059c14f47b9a42e
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-10-14 08:38:26 +00:00
Liang Qi
87e5e24f52 Merge remote-tracking branch 'origin/5.5' into 5.6
Change-Id: I1373622a6d1fd0e2d35df2da79860a373056387f
2015-10-02 13:48:43 +02:00
Samuel Nevala
c5ebfb0c19 winrt: Fix frozen UI caused by camera search and lock focus.
Instead of yielding thread process events while waiting for focus to
complete.

Change-Id: I6b5f08bc175af37430c851f151fce5c3bfe238ad
Task-Id: QTBUG-48534
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-10-01 05:01:37 +00:00
Samuel Nevala
12512d557f Revert: "winrt: fix camera preview on Lumia 630"
This reverts commit be0a231be4. Moving
blitting away from the camera device removed the need to lock buffer.

Change-Id: I3a0e983d9ff2135e32e3e352c443ca653c1dd017
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-09-30 09:46:26 +00:00
Samuel Nevala
f6082d4632 winrt: Fix Lumia 1520 black viewfinder.
The latest Denim update broke VideoProcessorBlt for Lumia 1520. After
the update, the blit results in a black target texture. As a
workaround, don't use DirectVideo, but leave format conversion and
drawing to the EGL Node.

Task-Id: QTBUG-48331
Change-Id: I1dab6b58d52d0e24fbffb91f23772906a576047a
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-09-29 20:07:44 +00:00
Samuel Nevala
572f3f80fc winrt: Optimize camera viewfinder pipeline.
Move blitting from the camera device to render side device.

Change-Id: Iadb89f4285f1fc242dbd825e60e258e7a9cfba58
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-09-29 15:42:31 +00:00
Samuel Nevala
e489e7b5b1 winrt: Introduce DirectX pipeline bypass.
Qt Windows Runtime camera uses DirectVideo to convert NV12 format
texture to BGRA format texture. As the EGL Node can draw using NV12
already, allow video render control to choose which path to take. By
default use DirectVideo. Bypass can be used as fallback when
DirectVideo cannot be used or is not working.

Task-Id: QTBUG-48331
Change-Id: I0cb87a7c4523bfb60610e6b41ab3fb05aff092a1
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
2015-09-29 08:12:34 +00:00
Yoann Lopes
46a83d5b86 AVFoundation: render camera frames using OpenGL textures on iOS.
OpenGL textures can easily be created from a CVImageBuffer using
Apple APIs. It avoids having to map the buffer to main memory and
therefore greatly improves rendering performances.

We could do the same on OSX, but there, the textures are always of
the GL_TEXTURE_RECTANGLE target type and changes need to be
done to the QVideoFrame API and to the video node implementations
to support that.

Change-Id: I6dde7e8d7a27460e41523cd474c3c741affc1480
Reviewed-by: James Turner <james.turner@kdab.com>
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-09-17 13:10:28 +00:00
Yoann Lopes
9c5292927e AVFoundation: implemented QMediaPlayer::seekable.
Change-Id: Iaca8daa2460062954497b3e510dd1828953c80fd
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2015-09-15 09:10:25 +00:00