Commit Graph

327 Commits

Author SHA1 Message Date
Jonas Rabbe
a8ba6e3c7f Updated plugins to use new plugin architecture
Changed QMediaPluginLoader to use QFactoryLoader instead of QPluginLoader
and used metadata to get keys.
Removed QAudioPluginLoader and changed audio classes to use instead use
QMediaPluginLoader.
The plugins must include the Q_PLUGIN_METADATA macro, and no longer use
the Q_PLUGIN_EXPORT/Q_PLUGIN_EXPORT2 macros.
A json file has been added for each plugin which can contain metadata
which is available to the plugin loader before the plugin is actually
loaded, and is used to read the keys for the plugin, e.g. supported
services.
QFactoryInterface will be deprecated and has been removed from all
plugins.

Change-Id: I035b82f9c9c65717bebf704d560ea8f891df21da
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
2012-03-20 23:39:45 +01:00
Michael Goddard
e9ebbeef72 Make QDeclarativeAudio use QMediaPlayer instead of the controls.
Very minor changes in semantics due to previous differences:
* negative positions are not supported any more (clamped to >= 0)
* setting muted to the same value previously set to the control itself
  won't signal any more.

Change-Id: Iacf4310508d853ae82b63dee28095fce12b6ff28
Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
2012-03-16 06:58:46 +01:00
Michael Goddard
7c0b1da0ed Merge the QDeclarativeMediaBase and QDeclarativeAudio classes.
Since there is only one subclass of base.

Next step is to clean up QDeclarativeAudio

Change-Id: Ibda8c3006efa165b58372a011121f04a39458562
Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
2012-03-16 05:38:11 +01:00
Kalle Juhani Lehtonen
1f1bdbec82 Add use of TESTDATA feature to integration tests
Use TESTDATA and QFINDTESTDATA in integration tests. Also remove
unused path defines from unit test .pro files.

Change-Id: I46dc6a96b918e989acf79eb3bd23c53125c7c3d6
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
2012-03-15 04:03:17 +01:00
Jonas Rabbe
8e82f57c6a Updated declarative components to use the QML module
Change-Id: I4b49466ba5248683c2285f98ce17bc2c24bba515
Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
2012-03-14 05:55:40 +01:00
Jonas Rabbe
942ff7a3c6 Made QRadioData bind to QRadioTuner to avoid using multiple services
QRadioData has been updated to be a QMediaBindableInterface, and it
will bind to a QRadioTuner instance, i.e. a QMediaObject that provides
a service which implements the QRadioDataControl.
This change is reflected in the declarative implementations of radio
tuner and data. There is a new `radioData` property in the Radio element
which will give access to the declarative RadioData element for the
tuner.
If a RadioData element is created in QML, it will have an anonymous
tuner which communicates with the underlying media service (which is
pretty much the same how the QRadioTuner and QRadioData classes work
previously).
Updated radio tuner and data test cases to use availability control
and extended the mock media service to allow providing a number of
controls rather than just one (needed for testing availability of
all classes extending from or using QMediaObject).

Change-Id: Id41dde66eee529decd828fd2dcdfe4a54c0e81f4
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
2012-03-12 08:21:07 +01:00
Kalle Juhani Lehtonen
d6cc6e393f Update Qt Multimedia tests to use TESTDATA
Qt5 brought support for general for test data install and find. This
change replaces old Qt4 time deployment supported in WinCE and Symbian
with the new general solution using TESTDATA in .pro files and
QFINDTESTDATA in source code.

Change-Id: I5dbe3ca22e2259f249ebb4df570ea91f17d23526
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
2012-03-12 05:53:03 +01:00
Lev Zelenskiy
87de0979e5 Added playlist property to QMediaContent
This is a part of changes to QMediaPlayer related to playlist handling.
Updated unit test.

Change-Id: Ic2460dc4d3121788cd5eb08df71e6d45aac032bc
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
2012-03-12 05:29:56 +01:00
Dmytro Poplavskiy
e2eaa283fb Don't request renderer control if null surface is set as video output.
QCamera and QMediaPlayer are likely to wait for valid
surface to be passed to the renderer control before startup, so after
player->setVideoOutput(nullSurface)
player will not start playback.

If the renderer control was already requested before for valid
surface it should be released when the null surface is assigned.

Change-Id: I3f78f2d82e61fae5f305874874c0ffbc4cb7dc1d
Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
2012-03-12 04:38:44 +01:00
Lev Zelenskiy
10b0063401 Move most of playlist API to private.
Moved objects either not needed to be public or require API review/redesign.

Change-Id: Ibeb8b8c9c9a74bea32191c119fa4daaffde57c17
Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
2012-03-06 07:54:47 +01:00
Michael Goddard
362e443896 Fix some memory leaks.
Adjusted a unit test or two to make leaks easier to find, and then fixed
a few leaks.

Change-Id: I47a20df8de7cac113d34a2015f76a65ab957dedd
Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
2012-03-05 03:08:42 +01:00
Michael Goddard
2a8463711c Expose availability from the backend to C++ and QML.
The availabilityError property was static based on the service, but it
can change at run time, so add the plumbing to allow the backend to
report it itself.

Also make sure that both QML and C++ expose the availability.

The radio tuner and data controls previously had properties (but no
signals) for availability - these have been removed.

Change-Id: I9240cf93e2a51b14cd38642f9312ae3c75f05361
Reviewed-by: Ling Hu <ling.hu@nokia.com>
2012-03-02 09:30:34 +01:00
Lev Zelenskiy
b56d3e70df Changes to GStreamer backend for audio decoder.
Removed WaitingState.
New signals: finished(), positionChanged(), durationChanged().
New methods: position(), duration().
A parameter removed from read() method.
Unit tests updated.

Change-Id: Ie9d8a2804285c5542e592cce69963adbdf6ebfb8
Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
2012-02-24 06:00:41 +01:00
Bradley T. Hughes
ea1037a7d0 Don't use QT_ARCH to detect ARM or OpenGL ES 2 on ARM
Use Q_PROCESSOR_ARM instead of QT_ARCH_ARM.

On maemo6, don't use QT_ARCH==armv6 to conditionally include egl
code. Instead check for opengles2 in QT_CONFIG, which is detected
by the configure script.

Change-Id: Ib3062fbd81c3a3acd318df32c49ad133a5b0d07c
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
2012-02-22 12:27:04 +01:00
Michael Goddard
2ab74b7ff2 Fix a few audiodecoder things.
Beef up the autotest a little, and check the conversion.

Change-Id: Ifffca118e092eb6c388db50a6eb12810a87aa32a
Reviewed-by: Lev Zelenskiy <lev.zelenskiy@nokia.com>
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
2012-02-21 07:35:35 +01:00
Michael Goddard
b9e2410a2a Fix QAudioBuffer sampleCount vs. channelCount.
There were some inconsistencies in when the sample count was per channel
or in total.  The docs mention that it is in total, so fix a few cases
where it went wrong and test it.

Change-Id: I55c855911fcde66a218d6cdd327e09ad5406d5a4
Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
Reviewed-by: Lev Zelenskiy <lev.zelenskiy@nokia.com>
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
2012-02-21 07:35:23 +01:00
Lev Zelenskiy
6468334eb9 GStreamer backend for audio decoder service.
Includes basic integration test.

Change-Id: I4c6d1dbefa1f27e107b3556a3d4da58811eeb122
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
2012-02-17 07:27:55 +01:00
Michael Goddard
d5042c1ec7 Use QTESTFINDDATA to FIND TEST DATA.
Change-Id: I5fd222e562045085b3d08e19c6544f674e9429d4
Reviewed-by: Ling Hu <ling.hu@nokia.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-17 07:27:44 +01:00
Lev Zelenskiy
0374f0de5e GStreamer backend changes for media probing API.
QGstreamerPlayerSession: Using GStreamer buffer probes
to access media data.

Change-Id: Ibc056283fdedaebba90456cc4e86ab63eae5f5f7
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
2012-02-16 07:18:16 +01:00
Michael Goddard
4f38f950b0 Fix some compiler warnings.
As it turns out, we had an overloaded virtual from an earlier era,
with the extra parameter never used.  So cleaning that up was a
bonus to remove the compiler warning.

Change-Id: I780287f8a5d2b0a1ec84ec62c88ba50e051f372b
Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
2012-02-14 08:30:40 +01:00
Jason McDonald
0d74c7193a Remove duplicates definitions of QTRY_VERIFY and QTRY_COMPARE.
These definitions were already ignored due to #ifndef directives
surrounding them, so presumably the differences in timeout values
between these definitions and those in testlib are acceptable.

Change-Id: Ib860fc1ed27ef0690e619ffeed516f7417ae4cd0
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-02-13 06:28:20 +01:00
dakovaci
61048053fd Moved camera tests
Moved camera tests out of Qt5Multimedia

Change-Id: I571332217dac885810c8fb7a6d28020d4578e55f
Reviewed-by: Natalia Shubina <natalia.shubina@nokia.com>
2012-02-09 04:41:09 +01:00
Michael Goddard
87ec3461c1 Add the audio decoder variant of QMediaPlayer.
Rather than the probe based way of doing it.  Initially private.

Change-Id: I30005f8da22f6451cb9de8eb3f0e193838d48c93
Reviewed-by: Ling Hu <ling.hu@nokia.com>
Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
2012-02-08 11:36:08 +01:00
Michael Goddard
e241932c97 Remove some more QTest::qWait(10) calls.
Since it seems to have changed slightly recently.  Just use
QTRY_COMPARE instead.

Change-Id: I802c2e26acf5418bb5904fadd2a978a44fd9eb01
Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
2012-02-08 04:38:16 +01:00
Angus Cummings
a94c8a1ac2 API changes to QML element MediaPlayer aka Audio
Changed Video.qml for new API
Removed lowercase enum copies, replaced with calling
	parent (VideoOutput, MediaPlayer) enums
Removed properties playing, paused
Removed signals started, resumed
Added readonly property playbackState
Added signal playing
Added autoPlay property
Fixed unit tests for new API

Added backwards compatibility for QtMultimedia 4

Change-Id: I27c91cd46d91402b8c4c42bb7d4961ad67909aeb
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
2012-02-08 03:48:51 +01:00
Dmytro Poplavskiy
6c51d2aadf tst_qmediaplayerbackend: try to load test file from the current dir.
This makes testing easier on other system than test was build.

Change-Id: I75c4d620c8132a7fd298fe735dfdc1bf6f775e08
Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
2012-02-07 04:12:55 +01:00
Michael Goddard
3c4dcf00bb Add a QAudioBuffer class.
Prereq for probing or decoding.  The abstract API probably needs
to change.

Change-Id: Ie0bf796c1f581f34bbc0a8af2dffc387c513a330
Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
2012-02-06 23:18:56 +01:00
Dmytro Poplavskiy
ee39683e27 Moved QMediaServiceProvider to private header.
It's not intended to be used by applications.

Change-Id: I2acc26180ebb5c2419438169827f39aaf4578389
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
2012-02-06 13:57:42 +01:00
Lev Zelenskiy
39c96db2b3 Changes to QMediaPlayer GStreamer backend to allow setPosition before pause
Do not display prerolled frames in stopped state.
Instead store prerolled frame and display it only after switching to
pause or playback state.
Added new unit test with a sample video file to check this functionality.

Change-Id: I3fd159a199b65ca10fdf9843af5675c5ae9dad05
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
2012-02-06 08:56:34 +01:00
Lev Zelenskiy
51ca5582c2 QMediaPlayer::setPosition: do not check isSeekable and do not bound by duration
To allow setPosition to be called in stopped state we no longer check
if the player is in seekable state and allow position to be greater than
duration.
Unit test has been updated accordingly.

Change-Id: I29447ffe797a7cc3dcc80d20b2527e9eda493ab6
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
2012-02-06 06:33:47 +01:00
Dmytro Poplavskiy
fd3a3a7292 Added metaDataChanged(key,value) signal to metadata controls.
It may be more efficient and convenient for application to use this
signal instead of metaDataChanged().

metaDataChanged() signal is emitted for compatibility,
backends should emit both signals.

Signal added QMetadataReader/WritterControl,
QMediaObject and QMediaRecorder.

Change-Id: I5ca34a40e64b22034e6fde8cd7f9735cc3f72c68
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
2012-02-06 05:35:11 +01:00
Dmytro Poplavskiy
fb73a56574 Made camera unit tests more stable
Replaced qWait() with QTRY_COMPARE()

Change-Id: I951bd8ca1eaaf8d0fd7308a90f82afcdb0475819
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
2012-02-06 05:35:06 +01:00
Michael Goddard
78ffd1bc18 Remove QMediaImageViewer (SC break).
This class has turned out to be not very useful at this point in time.

Change-Id: Ic07132bdcd01a912a6dd1160c867979fd1307b6a
Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
2012-02-03 03:21:43 +01:00
Dmytro Poplavskiy
d292f4a7d3 Changed QCameraFocus::focusMode type to QFlags based FocusModes
It was intended to be QFlags based from the start.

Change-Id: I0919b3440eb18e84fc596fb894f18a53e5ff1da0
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
2012-02-02 03:34:13 +01:00
Dmytro Poplavskiy
6a88794db4 QCameraImageProcessingControl API fixes
Moved white balance preset from the separate methods to
QCameraImageProcessingControl::ProcessingParameter;

Separated absolute contrast/saturation/sharpening/denoising
settings with adjustments to backend decided values,
with QCameraImageProcessing using adjustments versions.

Changed type of parameters from int to qreal
with [0..1] range for absolute values and [-1..1] for adjustments.

Change-Id: I85c8781c046be6dd45bcf626c25908e1ce5f6bcb
Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
2012-02-02 02:37:33 +01:00
Dmytro Poplavskiy
ba37f73d44 Added QMediaRecorder::actualLocation property
To report the actual location file was written.

Change-Id: Ibb56a720a258a1e5cedceaf0f9bcea73fb93bc96
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
2012-02-01 08:10:33 +01:00
Dmytro Poplavskiy
a22a0195f1 Split QMediaRecorder::setEncodingSettings to separate setters.
It's easier to change only the necessary part of encoding settings.
The settings are applied during the next event loop or before recording
starts.

Change-Id: Ia2b5c93826a302212aa7f79a0c75e4cbaaf1dd7a
Reviewed-by: Ling Hu <ling.hu@nokia.com>
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
2012-02-01 08:10:20 +01:00
Jason McDonald
5e801e2793 Remove "All rights reserved" line from license headers.
As in the past, to avoid rewriting various autotests that contain
line-number information, an extra blank line has been inserted at the
end of the license text to ensure that this commit does not change the
total number of lines in the license header.

Change-Id: I20e5215108c6ebd5f8474fed5c3665118e4791e6
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-30 07:08:05 +01:00
Dmytro Poplavskiy
155c48b97e Moved zoom related properties out of QCameraFocusControl
Change-Id: I16f9b80ebbacc0b325530e81c291dc030763b65e
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
2012-01-27 08:26:47 +01:00
Michael Goddard
88431b2841 Fix some surface assignment errors.
On destruction and changing sources, make sure we don't clobber the
surface property if it's been changed.

Change-Id: I3080b98a547911543a391c8bc040792d260782fd
Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
2012-01-27 07:35:09 +01:00
Michael Goddard
bad94a5329 Add a rendered and content rectangle properties to VideoOutput QML.
So you can align controls with an edge of the rendered area.  There's
also some convenience functions for mapping source to and from
destination coordinates. Also tweaked the updateGeometry function to
bail out if no input parameters have changed, rather than doing some
more boring maths.

Added a unit test for a lot of the class, too.

Change-Id: I943bb45e4e56356247d5d6deb5d446222edcb7ca
Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
2012-01-27 07:35:06 +01:00
Michael Goddard
3b00730eca Add a volume (gain) property to QAudioInput.
Only implemented for PulseAudio so far, but the API does explain that
it's optional.

Change-Id: I4543a1c81d810fe92bb08f1ed13f3a3534a371e4
Reviewed-by: Ling Hu <ling.hu@nokia.com>
2012-01-25 07:18:48 +01:00
Dmytro Poplavskiy
2db9b4b1c8 QCameraExposure API refactoring
QCameraExposureControl:
 Separated requested from actual exposure values.
 Removed ParameterFlags, it's confusing and seldom used.
 Moved ExposureMode and MeteringMode to parameters.

QCameraExposure:
 Added requestedAperture/ShutterSpeed/Iso getters

Change-Id: I408586d85e6c9de0c8a711c32b3c90ea46052270
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
2012-01-25 06:14:59 +01:00
Dmytro Poplavskiy
a78a95ccd4 Removed QMediaServiceProvider parameter from media objects constructors.
QMediaServiceProvider should be removed from the public API,
to provide media objects with a custom media service.

A protected QMediaPlayer/QCamera/QRadioTuner/etc constructor
with QMediaService* parameter is a cleaner and more
flexible solution.

Change-Id: I335cce4bbebe0e548c3df338f206e7be7c93c3dd
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
2012-01-24 09:11:07 +01:00
Michael Goddard
01e7cb9950 Implement QAudioDeviceInfo operator==/!=
Compares some of the useful parts, but perhaps should be made more
tolerant.

Also refactored the auto test to properly skip if there are no
(output) devices, rather than manually skip.

Task-number: QTBUG-13723
Change-Id: I3b83f87a440a83f4237fa119a23009bc99e7626a
Reviewed-by: Jonas Rabbe <jonas.rabbe@nokia.com>
Reviewed-by: Dmytro Poplavskiy <dmytro.poplavskiy@nokia.com>
2012-01-23 07:30:16 +01:00
Jason McDonald
6390157fd7 Update obsolete contact address.
Replace Nokia contact email address with Qt Project website.

Change-Id: Ie8cd560b6d9a2c6e552b6be1ad8bc96c80a6535c
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
2012-01-23 04:21:51 +01:00
Rohan McGovern
0889d69790 Fixed compile.
Removed usage of QBool.

Change-Id: I5e1db9cd3e833a196d73a3493967daa573200c77
Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
2012-01-23 01:29:56 +01:00
Dmytro Poplavskiy
8ff5b88b27 Changed metadata keys type from enum to QString.
This allows to combine metaData and extendedMetaData
and simplify metadata handling on both backend and application sides.

Change-Id: I136eedc86c215be3485db101c43069ca7c82101b
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
2012-01-20 06:30:37 +01:00
Dmytro Poplavskiy
b48009ce9e QAudioRecorder: fixed handling the missing inputs control.
Added check for null audioEndpointSelector
control in QAudioRecorder::audioInputs()

Change-Id: I506dcea9e8d3a468319acf2489cd4d803a5c187d
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
2012-01-19 05:13:31 +01:00
Dmytro Poplavskiy
69cef0c24c Replaced QAudioCaptureSource with QAudioRecorder.
QAudioCaptureSource name is confusing, it's essentially an audio
recording service but it's not evident from API.

QAudioRecorder replaces QAudioCaptureSource+QMediaRecorder combination.

Change-Id: I0082d766fc0d1b8d5ecbfc527f13e715add730c8
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
2012-01-19 03:56:45 +01:00