Commit Graph

2012 Commits

Author SHA1 Message Date
Adam Pigg
80f7ecabd3 [declarative] Add missing enums to declarative camera MER#1976 2019-04-15 22:09:30 +01:00
Andrew Branson
63e071957b Merge branch 'mer-5.6-gst-properties' into 'mer-5.6'
Mer 5.6 gst properties

See merge request mer-core/qtmultimedia!19
2018-12-13 13:03:26 +00:00
Adam Pigg
662f758526 [camerabin] Implement retrieval of supported camera features MER#1976
scene-modes
flash-modes
focus-modes
effects
white-balance-modes
iso-values
2018-12-12 22:16:10 +00:00
Slava Monich
1428794048 Merge branch 'leaks-5.6' into 'mer-5.6'
Fix memory leaks

See merge request mer-core/qtmultimedia!15
2018-05-02 14:55:43 +00:00
Slava Monich
f17f824b68 [qtmultimedia] Fixed memory leak in QGstreamerPlayerSession. Fixes JB#41822
==25456== 83 bytes in 1 blocks are definitely lost in loss record 7,587 of 8,690
==25456==    at 0x483F3EC: malloc (vg_replace_malloc.c:299)
==25456==    by 0x5AF00DF: g_malloc (gmem.c:94)
==25456==    by 0x5B07185: g_strdup (gstrfuncs.c:363)
==25456==    by 0x5A87EC3: value_lcopy_string (gvaluetypes.c:312)
==25456==    by 0x5A6B607: g_object_get_valist (gobject.c:2234)
==25456==    by 0x5A6B7F3: g_object_get (gobject.c:2322)
==25456==    by 0x10241575: QGstreamerPlayerSession::playlistTypeFindFunction(_GstTypeFind*, void*) (qgstreamerplayersession.cpp:1901)
2018-05-02 16:40:38 +03:00
Christian Strømme
f0f5cfe307 Fix memory leak in CameraBinImageCapture
The element name needs to be released when we're done with it.

Change-Id: I650671288bd143551188094b0d934e7da2028a2d
Reviewed-by: VaL Doroshchuk <valentyn.doroshchuk@qt.io>
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2018-05-02 14:46:08 +03:00
chriadam
94614bc00a Merge branch 'jb36676' into 'mer-5.6'
[qtmultimedia] Don't append suggested extension if filename includes extension. Contributes to JB#36676

Commit 6b19a24b58 changed the way that the file name is composed
for a video recording, so that a suggested extension for the given
media format is appended to the file name.  That introduced a bug
in the case where the correct extension was already part of the
output location (filename) set for the sink, by causing a second
(and possibly incorrect) extension to be appended to the filename.

This commit ensures that if the filename already has a suffix, no
suggested extension is appended.

Contributes to JB#36676

See merge request !12
2016-11-10 04:26:17 +00:00
Chris Adams
57f20e65ec [qtmultimedia] Don't append suggested extension if filename includes extension. Contributes to JB#36676
Commit 6b19a24b58 changed the way that the file name is composed
for a video recording, so that a suggested extension for the given
media format is appended to the file name.  That introduced a bug
in the case where the correct extension was already part of the
output location (filename) set for the sink, by causing a second
(and possibly incorrect) extension to be appended to the filename.

This commit ensures that if the filename already has a suffix, no
suggested extension is appended.

Contributes to JB#36676
2016-10-31 14:17:32 +10:00
Juho Hämäläinen
a70278b12b [packaging] Require new libresourceqt. JB#35838 2016-10-06 21:36:19 +00:00
Juho Hämäläinen
ed12ac3527 [camerabin] When using resource policy need RearFlashlight as well. JB#35838 2016-10-06 21:36:19 +00:00
Mohammed Hassan
da15fb57ed [qtmultimedia] disable v4l test to prevent enabling v4l. Fixes JB#34605
On some Android adaptation based devices (Like Jolla1) accessing v4l2 devices
can cause crashes.
Since we don't use V4L for anything and our media pipelines depend on GStreamer, it should
be safe to disable V4L.
2016-10-06 21:36:19 +00:00
Mohammed Hassan
1f90ee5518 [camera] Account for errors reported by camera source. Contributes to JB#35616
There are errors which can occur during manipulating camera HW.
camerabin does not relay any errors and it is the responsibility of camerabin
user to handle those errors. We just react to them and propagate them farther.
2016-10-06 21:36:19 +00:00
Mohammed Hassan
46c29f5b0b nemo: gstreamer: take into account ready-for-capture property when we are calculating the final state 2016-10-06 21:36:19 +00:00
Mohammed Hassan
b04854b489 nemo: Add basic ready-for-capture handling to CameraBinSession
This property is provided and controlled by the camera source and should be used to tell
whether the camera source can capture more or not

Conflicts:
	src/plugins/gstreamer/camerabin/camerabinsession.h
2016-10-06 21:36:19 +00:00
Mohammed Hassan
1992c78705 nemo: Add support for camera torch mode
This is based on the work by Dmytro Poplavskiy
Original patch URL: https://codereview.qt-project.org/#/c/5503/1
2016-10-06 21:36:18 +00:00
Mohammed Hassan
3a328a2ff3 [qtmultimedia] don't stop recording pipeline blindly if we are unloading. Fixes JB#32434
This is an extension to commit c09756
If we set the state to Unloaded then the check in setState() for the busy pipeline
will be missed.
2016-10-06 21:36:18 +00:00
Mohammed Hassan
c6886bc00d [qtmultimedia] Don't seek to the beginning when we set a new media. Fixes JB#30723
There is no need to do any seeking since we will restart the pipeline which will
cause GStreamer to start playback from the beginning. We just invalidate any potential
pending seek request.
2016-10-06 21:36:18 +00:00
Mohammed Hassan
6ecbfc3cb1 [qtmultimedia] don't stop the camera pipeline until it's done recording. Fixes JB#30862
stopping video recording is asynchronous. Aan EOS event gets sent from camera source,
travels across the whole pipeline until it reaches the muxer which then finalizes the
file by writing the mov atom and friends and then pushes the EOS event farther downstream
until it reaches our file writer (multifilesink in our case).

The sink sends an EOS _message_ which is then caught by camerabin and causes it to flip the
idle property from FALSE to TRUE.

Any attempt to stop the pipeline before this property gets flipped will cause corrupted videos.
Probably because the muxer gets shut down before it gets the EOS event so it does not write the
needed header.

When we are unloading camera we stop video recording and immediately switch camera bin to NULL state.
This can lead to corrupted files. A more proper solution would be to postpone this pipeline tear down
until we are idle.
Since an application can attempt to start the pipeline again before it's completely unloaded, I have added
a check to make sure we never tear down the pipeline if we are not in unloaded state. This check is also needed
because we will be notified about the idle property change while we are loading the camera and we should
not unload it when that happens.

This also required removing the pipeline state change to NULL when we are loading camera.
2016-10-06 21:36:18 +00:00
Mohammed Hassan
770e009cff Mer: disable camerabin previews handling
Our camera source does not yet support generating previews thus enabling it without
a proper support from the source leads to issues with processing counter and camerabin
never reaching idle state.
2016-10-06 21:36:18 +00:00
Mohammed Sameer
3ae638fdea [qtmultimedia] don't play with sink sync property. Contributes to JB#30082
I cannot find a reason why someone would flip sync to false and git history
does not say much but in general. Just don't play with it as it can cause
an av desync in case we are using a live source
2016-10-06 21:36:18 +00:00
Juho Hämäläinen
1d2a4045a2 Do not try to acquire resources in setMedia() in mediaplayer.
Acquire() is called in play() anyway.

Change-Id: I4c6688006d74490d774813b3f1fb381d915ffe23
2016-10-06 21:36:18 +00:00
Juho Hämäläinen
9a188059eb More thorough handling of VideoResourceType.
Add proper application pid for VideoResource upon resource object
creation. Also handle VideoResource when removing resource client.

Change-Id: I1c19c875c2d7d3d29aa9426b092081e3fdf47588
2016-10-06 21:36:18 +00:00
Juho Hämäläinen
e9c2cce662 Maintain proper internal state when releasing resources.
Previously when releasing resources when resources were in "acquiring"
state left the internal status in broken state. Because of this calling
acquire() would not really call acquire from Resource Policy. Change the
implementation so that client state is always set to Initial when
calling release(), but call Resource Policy release() only when no clients
are in acquiring or granted state.

Change-Id: I7fb84aefb64da84808375515950a28331531a71e
2016-10-06 21:36:18 +00:00
Mohammed Hassan
a756991a42 [qtmultimedia] fix capsForFormats to generate caps permitting caps features. Fixes JB#29720 2016-10-06 21:36:18 +00:00
Mohammed Hassan
4806e55411 [qtmultimedia] MER: Disable exposure and white balance locks for now. Fixes JB#29490
They are unsupported and cause the search and lock status to always be set to unlocked

We disable it now until we implement it later in droidcamsrc

Conflicts:
	src/plugins/gstreamer/camerabin/camerabinlocks.cpp
2016-10-06 21:36:18 +00:00
Mohammed Sameer
9a1e40c211 apply encoding settings when we load camera
If we do not apply those then setting camerabin to READY will fail on SailfishOS because
our camera source does not produce standard YUV data and the default constructed camerabin
encoding profile will not work. This will lead to a situation where camera will never work
2016-10-06 21:36:18 +00:00
Mohammed Hassan
c895f17f7b don't seek if the current position is the same 2016-10-06 21:36:18 +00:00
Mohammed Hassan
a824c2da1a watch for zoom and max-zoom property changes.
camerabin can signal a change in those properties and we need to communicate those back to the application
2016-10-06 21:36:18 +00:00
Juho Hämäläinen
4822715845 Resource policy for QAudioOutput.
Change-Id: I561b8b6216d94f56362f52d65482f6e9cd6d7f3a

Conflicts:
	src/plugins/pulseaudio/qaudiooutput_pulse.cpp
2016-10-06 21:36:18 +00:00
Juho Hämäläinen
dc7453c28a Add resource release timer when pausing or stopping media.
If media is paused, stopped, or end of media, if state hasn't changed to
playing state, release the resources. The idea with the timer is that if
for example media player is playing one song which ends, there won't be
release()/acquire() unnecessarily if next song is immediately set as
media and started playing.
2016-10-06 21:36:18 +00:00
Andrew den Exter
e2ca2d2485 Add a control which allows overriding the gstreamer video sink.
This enables applications to selectively use platform specific or
unusual (video4linux perhaps) gstreamer sink elements to render video.

Change-Id: Ife2c2f9b2149d6b598c69a78f1e116ba05b46e10

Conflicts:
	src/gsttools/gsttools.pro
2016-10-06 21:36:18 +00:00
Martin Jones
469f5e0818 MER: Add packaging 2016-10-06 21:36:18 +00:00
Maurice Kalinowski
3420041883 Blacklist testSetSourceWhileLoading on all Linux distros
(cherry picked from ccb985990880717f29fdec16f119b0c02b93d643)
Change-Id: I94d970cb51202d35d894503b1fa5c342b8e8ae44
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2016-10-06 11:27:05 +00:00
Yoann Lopes
69cc0fb330 GStreamer: emit mediaStatus changes before state changes
This makes sure all mediaStatus changes are emitted, even when some
action is done on the media player as a result of a state change.

Task-number: QTBUG-49578
Change-Id: I60153cd8e1d665797a25549ab81afcfb553ce2cc
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2016-10-06 10:30:07 +00:00
Milla Pohjanheimo
026aec5079 Blacklist testSetSourceWhilePlaying() in 5.6
The test is flaky and running it 300 times didn't reproduce the
failure.

Change-Id: Ib03722579dbe58c05cb324fdca37eb7e5b732e33
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
2016-09-29 13:30:49 +00:00
Christian Strømme
309dcb9259 Doc: Add comment about stream requirements
Change-Id: I92e16722dc5cc8df23cf4ed0d048a0d2a23956eb
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
2016-09-28 11:30:11 +00:00
Christian Strømme
5472ea1506 Remove useless cast
Casting to same type.

Change-Id: I93935b75edac56c958d0669eff216b9dcf16a153
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
2016-09-28 11:30:05 +00:00
Yoann Lopes
2f3cf6bca7 Clamp out-of-range volume values in QAudioInput and QAudioOutput
Change-Id: I6da76524533e16f6987fad6029b1f42960972383
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2016-09-28 11:29:53 +00:00
Yoann Lopes
91d12e6242 Clamp volume in QMediaRecorder and QSoundEffect
Change-Id: Ie61c33592873b7e5a2ed1b8ccf3386b20edb2cef
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2016-09-27 15:32:24 +00:00
Yoann Lopes
81a48edb54 AVFoundation: fix metadata control
Correctly emit metaDataAvailableChanged and metaDataChanged signals.

Task-number: QTBUG-46368
Change-Id: Ic79acd519b47f4d864fa335c8f75758fe9185c39
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2016-09-27 11:11:12 +00:00
Milla Pohjanheimo
c4bf444f5c Stabilize pushSuspendResume() autotest
Same as 7d00a457e4.

Change-Id: Ia7b01eef7650c1db23562d1a36a4a19748c92fc7
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
2016-09-27 08:03:18 +00:00
Milla Pohjanheimo
9d9a29bcc3 Stabilize tst_QAudioOutput::pull() and push() autotests
Same as 7d00a457e4.

Change-Id: Iaf4a9d4eb5b5afe307a82af6f1a7fdf3e49f08ac
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
2016-09-23 07:02:11 +00:00
Yoann Lopes
7d00a457e4 Stabilize tst_QAudioOutput::pullSuspendResume()
Don't wait after resume(); the test is meant to check the state of the
QAudioOutput right after the call, not later. The state and the error
status are supposed to change immediately, even if the backend runs in
another thread.
Ignore any state change that can happen because of underrun errors
(likely to happen on CI).
Removed the test from blacklist.

Change-Id: Idaef6a9e0dfcfc89424fb2383cf3830a3184f975
Reviewed-by: Milla Pohjanheimo <milla.pohjanheimo@qt.io>
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2016-09-21 13:13:41 +00:00
Yoann Lopes
6b94b3ca91 GStreamer: print a warning when the camerabin plugin is missing
Don't create the camera service when the camerabin plugin is not
available on the system and print a warning.

Task-number: QTBUG-50775
Change-Id: I56c7e6297bebe4b90596cb3c0323f1d38231bceb
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2016-09-21 13:13:28 +00:00
Yoann Lopes
4bae769725 PulseAudio: make code more robust
Some asynchronous operations return a pa_operation pointer, which can
be null if the operation fails. In some cases we were not checking that
the returned object was non null, leading to some asserts being raised
in pa_operation_unref.

Change-Id: Iff1cc67b7f79b758fa81d79e658debb1d737b29f
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2016-09-21 13:13:05 +00:00
Yoann Lopes
bf5c7ca718 Make tst_QMediaObject::notifySignals() less flaky
Rather than expecting a certain amount of signals to be fired within
a fixed period, check that all the required signals are emitted and
that it doesn't take longer than expected. Use a margin of error to
take into account timers firing later because of high system load.

Change-Id: I1569ce524e87efc47eb8d11066e509e5dc90f6f8
(cherry picked from commit 586abbd9732f9ccce127429fe0698c25a09ecefb)
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2016-09-20 15:10:53 +00:00
Yoann Lopes
07d55b154e Don't try to compile Vivante video node plugin without OpenGL ES
Task-number: QTBUG-54315
Change-Id: I559f67e1f24cbed5155fd0e4330cd12150d4dbf9
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-09-20 05:56:54 +00:00
Yoann Lopes
c37caa8070 Remove unnecessary import statement in QML snippet
Change-Id: I1f34e52c4a8f72a91b1c673fe7e152335d8a0ade
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2016-09-20 05:56:23 +00:00
Liang Qi
e535480e13 Merge remote-tracking branch 'origin/5.6.2' into 5.6
Change-Id: Ibf6ca6de08694f80a586c05953a21b151c7b051a
2016-09-16 23:07:26 +02:00
Yoann Lopes
e2adbda766 DirectShow: support MJPEG cameras
Map MEDIASUBTYPE_MJPG to QVideoFrame::Format_Jpeg, which makes sure
that cameras that only support MJPEG are configured properly.

Task-number: QTBUG-55359
Change-Id: I732c56afc51109aba0231c8537f795e8d276c194
Reviewed-by: Christian Stromme <christian.stromme@qt.io>
2016-09-16 11:50:50 +00:00