From c2736c3a629d944818c44db9ad69beffb872bdd5 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Wed, 12 Dec 2012 22:22:38 +0100 Subject: sync.profile: Point dependencies to 'refs/heads/dev' We should test dev branches against dev branches only by default. At some point we should automate the merges from release->stable->dev and/or decide how to handle possible conflicts. This is good enough for the time being. Change-Id: I9f3c9977b162b82611e48cd304cfcc316fed95ad Reviewed-by: Thiago Macieira Reviewed-by: Frederik Gladhorn --- sync.profile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sync.profile b/sync.profile index da5324322..abccf5625 100644 --- a/sync.profile +++ b/sync.profile @@ -20,8 +20,8 @@ # - any git symbolic ref resolvable from the module's repository (e.g. "refs/heads/master" to track master branch) # %dependencies = ( - "qtbase" => "refs/heads/master", - "qtxmlpatterns" => "refs/heads/master", - "qtdeclarative" => "refs/heads/master", - "qtjsbackend" => "refs/heads/master", + "qtbase" => "refs/heads/dev", + "qtxmlpatterns" => "refs/heads/dev", + "qtdeclarative" => "refs/heads/dev", + "qtjsbackend" => "refs/heads/dev", ); -- cgit v1.2.3 From f462bb9177d550f16f2ec768571b9076eb489dfa Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Fri, 11 Jan 2013 13:53:15 +0100 Subject: Bump Qt version to 5.1.0 Change-Id: I68f5c34fe14860c40537a23f28e741f0ac1eef1e Reviewed-by: David Faure (KDE) --- src/multimedia/doc/qtmultimedia.qdocconf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/multimedia/doc/qtmultimedia.qdocconf b/src/multimedia/doc/qtmultimedia.qdocconf index 3873bd25c..0d5e6b102 100644 --- a/src/multimedia/doc/qtmultimedia.qdocconf +++ b/src/multimedia/doc/qtmultimedia.qdocconf @@ -3,7 +3,7 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf) project = qtmultimedia description = Qt Multimedia Documentation url = http://qt-project.org/doc/qtmultimedia -version = 5.0.1 +version = 5.1.0 # The following parameters are for creating a qhp file, the qhelpgenerator # program can convert the qhp file into a qch file which can be opened in @@ -14,7 +14,7 @@ version = 5.0.1 # format. qhp.projects = qtmultimedia qhp.qtmultimedia.file = qtmultimedia.qhp -qhp.qtmultimedia.namespace = org.qt-project.qtmultimedia.500 +qhp.qtmultimedia.namespace = org.qt-project.qtmultimedia.510 qhp.qtmultimedia.indexTitle = Qt Multimedia qhp.qtmultimedia.virtualFolder = qtmultimedia -- cgit v1.2.3 From 157f4f982bd3b78a3471f0a22652c3d32d89df70 Mon Sep 17 00:00:00 2001 From: Sergio Ahumada Date: Sun, 27 Jan 2013 09:19:58 +0100 Subject: Remove QT_{BEGIN,END}_HEADER macro usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The macro was made empty in qtbase/ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id95d10f5d9c146d9eb496119af6a8b8501ffcb17 Reviewed-by: Jędrzej Nowacki --- src/imports/audioengine/qaudioengine_openal_p.h | 4 ---- src/imports/audioengine/qaudioengine_p.h | 4 ---- src/imports/audioengine/qdeclarative_attenuationmodel_p.h | 4 ---- src/imports/audioengine/qdeclarative_audiocategory_p.h | 4 ---- src/imports/audioengine/qdeclarative_audioengine_p.h | 4 ---- src/imports/audioengine/qdeclarative_audiolistener_p.h | 4 ---- src/imports/audioengine/qdeclarative_audiosample_p.h | 4 ---- src/imports/audioengine/qdeclarative_playvariation_p.h | 4 ---- src/imports/audioengine/qdeclarative_sound_p.h | 4 ---- src/imports/audioengine/qdeclarative_soundinstance_p.h | 4 ---- src/imports/audioengine/qsoundbuffer_p.h | 4 ---- src/imports/audioengine/qsoundinstance_p.h | 4 ---- src/imports/audioengine/qsoundsource_p.h | 4 ---- src/imports/multimedia/qdeclarativeaudio_p.h | 4 ---- src/imports/multimedia/qdeclarativecamera_p.h | 4 ---- src/imports/multimedia/qdeclarativecameracapture_p.h | 4 ---- src/imports/multimedia/qdeclarativecameraexposure_p.h | 4 ---- src/imports/multimedia/qdeclarativecameraflash_p.h | 4 ---- src/imports/multimedia/qdeclarativecamerafocus_p.h | 4 ---- src/imports/multimedia/qdeclarativecameraimageprocessing_p.h | 4 ---- src/imports/multimedia/qdeclarativecamerapreviewprovider_p.h | 4 ---- src/imports/multimedia/qdeclarativecamerarecorder_p.h | 4 ---- src/imports/multimedia/qdeclarativemediametadata_p.h | 4 ---- src/imports/multimedia/qdeclarativeradio_p.h | 4 ---- src/imports/multimedia/qdeclarativeradiodata_p.h | 4 ---- src/imports/multimedia/qdeclarativetorch_p.h | 4 ---- src/multimedia/audio/qaudio.h | 4 ---- src/multimedia/audio/qaudio_mac_p.h | 4 ---- src/multimedia/audio/qaudiobuffer.h | 4 ---- src/multimedia/audio/qaudiobuffer_p.h | 4 ---- src/multimedia/audio/qaudiodecoder.h | 4 ---- src/multimedia/audio/qaudiodevicefactory_p.h | 4 ---- src/multimedia/audio/qaudiodeviceinfo.h | 4 ---- src/multimedia/audio/qaudiodeviceinfo_alsa_p.h | 4 ---- src/multimedia/audio/qaudiodeviceinfo_mac_p.h | 4 ---- src/multimedia/audio/qaudiodeviceinfo_win32_p.h | 4 ---- src/multimedia/audio/qaudioformat.h | 4 ---- src/multimedia/audio/qaudioinput.h | 4 ---- src/multimedia/audio/qaudioinput_alsa_p.h | 4 ---- src/multimedia/audio/qaudioinput_mac_p.h | 4 ---- src/multimedia/audio/qaudioinput_win32_p.h | 4 ---- src/multimedia/audio/qaudiooutput.h | 4 ---- src/multimedia/audio/qaudiooutput_alsa_p.h | 4 ---- src/multimedia/audio/qaudiooutput_mac_p.h | 4 ---- src/multimedia/audio/qaudiooutput_win32_p.h | 4 ---- src/multimedia/audio/qaudioprobe.h | 4 ---- src/multimedia/audio/qaudiosystem.h | 4 ---- src/multimedia/audio/qaudiosystemplugin.h | 4 ---- src/multimedia/audio/qsamplecache_p.h | 4 ---- src/multimedia/audio/qsound.h | 4 ---- src/multimedia/audio/qsoundeffect.h | 4 ---- src/multimedia/audio/qsoundeffect_pulse_p.h | 4 ---- src/multimedia/audio/qsoundeffect_qaudio_p.h | 4 ---- src/multimedia/audio/qwavedecoder_p.h | 4 ---- src/multimedia/camera/qcamera.h | 4 ---- src/multimedia/camera/qcameraexposure.h | 4 ---- src/multimedia/camera/qcamerafocus.h | 4 ---- src/multimedia/camera/qcameraimagecapture.h | 4 ---- src/multimedia/camera/qcameraimageprocessing.h | 4 ---- src/multimedia/controls/qaudiodecodercontrol.h | 4 ---- src/multimedia/controls/qaudioencodersettingscontrol.h | 4 ---- src/multimedia/controls/qaudioinputselectorcontrol.h | 4 ---- src/multimedia/controls/qaudiooutputselectorcontrol.h | 4 ---- src/multimedia/controls/qcameracapturebufferformatcontrol.h | 4 ---- src/multimedia/controls/qcameracapturedestinationcontrol.h | 4 ---- src/multimedia/controls/qcameracontrol.h | 4 ---- src/multimedia/controls/qcameraexposurecontrol.h | 4 ---- src/multimedia/controls/qcamerafeedbackcontrol.h | 4 ---- src/multimedia/controls/qcameraflashcontrol.h | 4 ---- src/multimedia/controls/qcamerafocuscontrol.h | 4 ---- src/multimedia/controls/qcameraimagecapturecontrol.h | 4 ---- src/multimedia/controls/qcameraimageprocessingcontrol.h | 4 ---- src/multimedia/controls/qcameralockscontrol.h | 4 ---- src/multimedia/controls/qcameraviewfindersettingscontrol.h | 4 ---- src/multimedia/controls/qcamerazoomcontrol.h | 4 ---- src/multimedia/controls/qimageencodercontrol.h | 4 ---- src/multimedia/controls/qmediaaudioprobecontrol.h | 4 ---- src/multimedia/controls/qmediaavailabilitycontrol.h | 4 ---- src/multimedia/controls/qmediacontainercontrol.h | 4 ---- src/multimedia/controls/qmediagaplessplaybackcontrol.h | 4 ---- src/multimedia/controls/qmedianetworkaccesscontrol.h | 4 ---- src/multimedia/controls/qmediaplayercontrol.h | 4 ---- src/multimedia/controls/qmediaplaylistcontrol_p.h | 4 ---- src/multimedia/controls/qmediaplaylistsourcecontrol_p.h | 4 ---- src/multimedia/controls/qmediarecordercontrol.h | 4 ---- src/multimedia/controls/qmediastreamscontrol.h | 4 ---- src/multimedia/controls/qmediavideoprobecontrol.h | 4 ---- src/multimedia/controls/qmetadatareadercontrol.h | 4 ---- src/multimedia/controls/qmetadatawritercontrol.h | 4 ---- src/multimedia/controls/qradiodatacontrol.h | 4 ---- src/multimedia/controls/qradiotunercontrol.h | 4 ---- src/multimedia/controls/qvideodeviceselectorcontrol.h | 4 ---- src/multimedia/controls/qvideoencodersettingscontrol.h | 4 ---- src/multimedia/controls/qvideorenderercontrol.h | 4 ---- src/multimedia/controls/qvideowindowcontrol.h | 4 ---- src/multimedia/playback/playlistfileparser_p.h | 4 ---- src/multimedia/playback/qmediacontent.h | 4 ---- src/multimedia/playback/qmedianetworkplaylistprovider_p.h | 4 ---- src/multimedia/playback/qmediaplayer.h | 4 ---- src/multimedia/playback/qmediaplaylist.h | 4 ---- src/multimedia/playback/qmediaplaylist_p.h | 4 ---- src/multimedia/playback/qmediaplaylistioplugin_p.h | 4 ---- src/multimedia/playback/qmediaplaylistnavigator_p.h | 4 ---- src/multimedia/playback/qmediaplaylistprovider_p.h | 4 ---- src/multimedia/playback/qmediaresource.h | 4 ---- src/multimedia/qmediabindableinterface.h | 4 ---- src/multimedia/qmediacontrol.h | 4 ---- src/multimedia/qmediacontrol_p.h | 4 ---- src/multimedia/qmediaenumdebug.h | 2 -- src/multimedia/qmediametadata.h | 4 ---- src/multimedia/qmediaobject.h | 4 ---- src/multimedia/qmediaobject_p.h | 4 ---- src/multimedia/qmediapluginloader_p.h | 4 ---- src/multimedia/qmediaresourcepolicy_p.h | 4 ---- src/multimedia/qmediaresourcepolicyplugin_p.h | 4 ---- src/multimedia/qmediaresourceset_p.h | 4 ---- src/multimedia/qmediaservice.h | 4 ---- src/multimedia/qmediaservice_p.h | 4 ---- src/multimedia/qmediaserviceprovider_p.h | 4 ---- src/multimedia/qmediaserviceproviderplugin.h | 4 ---- src/multimedia/qmediatimerange.h | 4 ---- src/multimedia/qmultimedia.h | 4 ---- src/multimedia/qtmultimediadefs.h | 3 --- src/multimedia/qtmultimediaquicktools_headers/qsgvideonode_p.h | 4 ---- .../qtmultimediaquicktools_headers/qtmultimediaquickdefs_p.h | 4 ---- src/multimedia/radio/qradiodata.h | 4 ---- src/multimedia/radio/qradiotuner.h | 4 ---- src/multimedia/recording/qaudiorecorder.h | 4 ---- src/multimedia/recording/qmediaencodersettings.h | 4 ---- src/multimedia/recording/qmediarecorder.h | 4 ---- src/multimedia/video/qabstractvideobuffer.h | 4 ---- src/multimedia/video/qabstractvideobuffer_p.h | 4 ---- src/multimedia/video/qabstractvideosurface.h | 4 ---- src/multimedia/video/qimagevideobuffer_p.h | 4 ---- src/multimedia/video/qmemoryvideobuffer_p.h | 8 -------- src/multimedia/video/qvideoframe.h | 4 ---- src/multimedia/video/qvideoprobe.h | 4 ---- src/multimedia/video/qvideosurfaceformat.h | 4 ---- src/multimedia/video/qvideosurfaceoutput_p.h | 4 ---- src/multimediawidgets/qcameraviewfinder.h | 4 ---- src/multimediawidgets/qeglimagetexturesurface_p.h | 4 ---- src/multimediawidgets/qgraphicsvideoitem.h | 4 ---- src/multimediawidgets/qpaintervideosurface_mac_p.h | 4 ---- src/multimediawidgets/qpaintervideosurface_p.h | 4 ---- src/multimediawidgets/qtmultimediawidgetdefs.h | 2 -- src/multimediawidgets/qvideowidget.h | 4 ---- src/multimediawidgets/qvideowidget_p.h | 4 ---- src/multimediawidgets/qvideowidgetcontrol.h | 4 ---- src/plugins/directshow/camera/dscameracontrol.h | 4 ---- src/plugins/directshow/camera/dscameraservice.h | 4 ---- src/plugins/directshow/camera/dscamerasession.h | 4 ---- src/plugins/directshow/camera/dsimagecapturecontrol.h | 4 ---- src/plugins/directshow/camera/dsvideodevicecontrol.h | 4 ---- src/plugins/directshow/camera/dsvideorenderer.h | 4 ---- src/plugins/directshow/camera/dsvideowidgetcontrol.h | 4 ---- tests/auto/unit/qmultimedia_common/mockaudiodecodercontrol.h | 4 ---- 156 files changed, 623 deletions(-) diff --git a/src/imports/audioengine/qaudioengine_openal_p.h b/src/imports/audioengine/qaudioengine_openal_p.h index 95ea38889..da0032f83 100644 --- a/src/imports/audioengine/qaudioengine_openal_p.h +++ b/src/imports/audioengine/qaudioengine_openal_p.h @@ -58,8 +58,6 @@ #include "qsoundsource_p.h" #include "qsoundbuffer_p.h" -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QSoundBufferPrivateAL : public QSoundBuffer @@ -168,6 +166,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/imports/audioengine/qaudioengine_p.h b/src/imports/audioengine/qaudioengine_p.h index 8c8b664f0..81983009d 100644 --- a/src/imports/audioengine/qaudioengine_p.h +++ b/src/imports/audioengine/qaudioengine_p.h @@ -47,8 +47,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QSoundSource; @@ -105,6 +103,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/imports/audioengine/qdeclarative_attenuationmodel_p.h b/src/imports/audioengine/qdeclarative_attenuationmodel_p.h index 8ce38cb4a..7d883c54d 100644 --- a/src/imports/audioengine/qdeclarative_attenuationmodel_p.h +++ b/src/imports/audioengine/qdeclarative_attenuationmodel_p.h @@ -46,8 +46,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QDeclarativeAttenuationModel : public QObject, public QQmlParserStatus @@ -133,6 +131,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/imports/audioengine/qdeclarative_audiocategory_p.h b/src/imports/audioengine/qdeclarative_audiocategory_p.h index 4e192bd8b..8513709a8 100644 --- a/src/imports/audioengine/qdeclarative_audiocategory_p.h +++ b/src/imports/audioengine/qdeclarative_audiocategory_p.h @@ -45,8 +45,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QDeclarativeAudioCategory : public QObject, public QQmlParserStatus @@ -89,6 +87,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/imports/audioengine/qdeclarative_audioengine_p.h b/src/imports/audioengine/qdeclarative_audioengine_p.h index 4c82c7229..ea0221d1d 100644 --- a/src/imports/audioengine/qdeclarative_audioengine_p.h +++ b/src/imports/audioengine/qdeclarative_audioengine_p.h @@ -50,8 +50,6 @@ #include #include "qaudioengine_p.h" -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QDeclarativeSoundInstance; @@ -163,6 +161,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/imports/audioengine/qdeclarative_audiolistener_p.h b/src/imports/audioengine/qdeclarative_audiolistener_p.h index ec45deeb0..278aeaddf 100644 --- a/src/imports/audioengine/qdeclarative_audiolistener_p.h +++ b/src/imports/audioengine/qdeclarative_audiolistener_p.h @@ -45,8 +45,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QDeclarativeAudioEngine; @@ -97,6 +95,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/imports/audioengine/qdeclarative_audiosample_p.h b/src/imports/audioengine/qdeclarative_audiosample_p.h index 6bd8d1e1d..0cf11e476 100644 --- a/src/imports/audioengine/qdeclarative_audiosample_p.h +++ b/src/imports/audioengine/qdeclarative_audiosample_p.h @@ -45,8 +45,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QSoundBuffer; @@ -106,6 +104,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/imports/audioengine/qdeclarative_playvariation_p.h b/src/imports/audioengine/qdeclarative_playvariation_p.h index 450e9e92f..4ca9ebe71 100644 --- a/src/imports/audioengine/qdeclarative_playvariation_p.h +++ b/src/imports/audioengine/qdeclarative_playvariation_p.h @@ -45,8 +45,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QDeclarativeAudioSample; @@ -106,6 +104,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/imports/audioengine/qdeclarative_sound_p.h b/src/imports/audioengine/qdeclarative_sound_p.h index 68ba6bee7..5d9080061 100644 --- a/src/imports/audioengine/qdeclarative_sound_p.h +++ b/src/imports/audioengine/qdeclarative_sound_p.h @@ -47,8 +47,6 @@ #include #include "qdeclarative_playvariation_p.h" -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QDeclarativeAudioCategory; @@ -171,6 +169,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/imports/audioengine/qdeclarative_soundinstance_p.h b/src/imports/audioengine/qdeclarative_soundinstance_p.h index 6c35e1119..bf6d87d16 100644 --- a/src/imports/audioengine/qdeclarative_soundinstance_p.h +++ b/src/imports/audioengine/qdeclarative_soundinstance_p.h @@ -46,8 +46,6 @@ #include #include "qsoundinstance_p.h" -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QDeclarativeSound; @@ -150,6 +148,4 @@ private Q_SLOTS: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/imports/audioengine/qsoundbuffer_p.h b/src/imports/audioengine/qsoundbuffer_p.h index 1228d4b11..c4322f204 100644 --- a/src/imports/audioengine/qsoundbuffer_p.h +++ b/src/imports/audioengine/qsoundbuffer_p.h @@ -44,8 +44,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QSoundBuffer : public QObject @@ -65,6 +63,4 @@ protected: QT_END_NAMESPACE -QT_END_HEADER - #endif // QSOUNDBUFFER_P_H diff --git a/src/imports/audioengine/qsoundinstance_p.h b/src/imports/audioengine/qsoundinstance_p.h index dbdb95d63..92cf05f70 100644 --- a/src/imports/audioengine/qsoundinstance_p.h +++ b/src/imports/audioengine/qsoundinstance_p.h @@ -46,8 +46,6 @@ #include #include "qsoundsource_p.h" -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QDeclarativeSound; @@ -134,6 +132,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // QSOUNDINSTANCE_P_H diff --git a/src/imports/audioengine/qsoundsource_p.h b/src/imports/audioengine/qsoundsource_p.h index 5c3b90b68..5a623cb9b 100644 --- a/src/imports/audioengine/qsoundsource_p.h +++ b/src/imports/audioengine/qsoundsource_p.h @@ -45,8 +45,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QSoundBuffer; @@ -93,6 +91,4 @@ protected: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/imports/multimedia/qdeclarativeaudio_p.h b/src/imports/multimedia/qdeclarativeaudio_p.h index 3164f4d4b..bd30049a1 100644 --- a/src/imports/multimedia/qdeclarativeaudio_p.h +++ b/src/imports/multimedia/qdeclarativeaudio_p.h @@ -59,8 +59,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QTimerEvent; @@ -271,6 +269,4 @@ QT_END_NAMESPACE QML_DECLARE_TYPE(QT_PREPEND_NAMESPACE(QDeclarativeAudio)) -QT_END_HEADER - #endif diff --git a/src/imports/multimedia/qdeclarativecamera_p.h b/src/imports/multimedia/qdeclarativecamera_p.h index 64c396d99..50e55d375 100644 --- a/src/imports/multimedia/qdeclarativecamera_p.h +++ b/src/imports/multimedia/qdeclarativecamera_p.h @@ -65,8 +65,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QDeclarativeCameraExposure; @@ -312,6 +310,4 @@ QT_END_NAMESPACE QML_DECLARE_TYPE(QT_PREPEND_NAMESPACE(QDeclarativeCamera)) -QT_END_HEADER - #endif diff --git a/src/imports/multimedia/qdeclarativecameracapture_p.h b/src/imports/multimedia/qdeclarativecameracapture_p.h index 5583c5bb3..3034a8ab3 100644 --- a/src/imports/multimedia/qdeclarativecameracapture_p.h +++ b/src/imports/multimedia/qdeclarativecameracapture_p.h @@ -59,8 +59,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QDeclarativeCamera; @@ -125,6 +123,4 @@ QT_END_NAMESPACE QML_DECLARE_TYPE(QT_PREPEND_NAMESPACE(QDeclarativeCameraCapture)) -QT_END_HEADER - #endif diff --git a/src/imports/multimedia/qdeclarativecameraexposure_p.h b/src/imports/multimedia/qdeclarativecameraexposure_p.h index 457762583..8c5b77b50 100644 --- a/src/imports/multimedia/qdeclarativecameraexposure_p.h +++ b/src/imports/multimedia/qdeclarativecameraexposure_p.h @@ -57,8 +57,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QDeclarativeCamera; @@ -142,6 +140,4 @@ QT_END_NAMESPACE QML_DECLARE_TYPE(QT_PREPEND_NAMESPACE(QDeclarativeCameraExposure)) -QT_END_HEADER - #endif diff --git a/src/imports/multimedia/qdeclarativecameraflash_p.h b/src/imports/multimedia/qdeclarativecameraflash_p.h index 1a1cdf887..737e63a00 100644 --- a/src/imports/multimedia/qdeclarativecameraflash_p.h +++ b/src/imports/multimedia/qdeclarativecameraflash_p.h @@ -56,8 +56,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QDeclarativeCamera; @@ -91,6 +89,4 @@ QT_END_NAMESPACE QML_DECLARE_TYPE(QT_PREPEND_NAMESPACE(QDeclarativeCameraFlash)) -QT_END_HEADER - #endif diff --git a/src/imports/multimedia/qdeclarativecamerafocus_p.h b/src/imports/multimedia/qdeclarativecamerafocus_p.h index e93a90d32..a287973e5 100644 --- a/src/imports/multimedia/qdeclarativecamerafocus_p.h +++ b/src/imports/multimedia/qdeclarativecamerafocus_p.h @@ -58,8 +58,6 @@ #include #include "qdeclarativecamera_p.h" -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class FocusZonesModel; @@ -131,6 +129,4 @@ QT_END_NAMESPACE QML_DECLARE_TYPE(QT_PREPEND_NAMESPACE(QDeclarativeCameraFocus)) -QT_END_HEADER - #endif diff --git a/src/imports/multimedia/qdeclarativecameraimageprocessing_p.h b/src/imports/multimedia/qdeclarativecameraimageprocessing_p.h index d41e35c66..3502d04a1 100644 --- a/src/imports/multimedia/qdeclarativecameraimageprocessing_p.h +++ b/src/imports/multimedia/qdeclarativecameraimageprocessing_p.h @@ -56,8 +56,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QDeclarativeCamera; @@ -127,6 +125,4 @@ QT_END_NAMESPACE QML_DECLARE_TYPE(QT_PREPEND_NAMESPACE(QDeclarativeCameraImageProcessing)) -QT_END_HEADER - #endif diff --git a/src/imports/multimedia/qdeclarativecamerapreviewprovider_p.h b/src/imports/multimedia/qdeclarativecamerapreviewprovider_p.h index 6f1afa277..1ae492462 100644 --- a/src/imports/multimedia/qdeclarativecamerapreviewprovider_p.h +++ b/src/imports/multimedia/qdeclarativecamerapreviewprovider_p.h @@ -55,8 +55,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QDeclarativeCameraPreviewProvider : public QQuickImageProvider @@ -71,6 +69,4 @@ public: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/imports/multimedia/qdeclarativecamerarecorder_p.h b/src/imports/multimedia/qdeclarativecamerarecorder_p.h index d1482bcff..c6b53ce8b 100644 --- a/src/imports/multimedia/qdeclarativecamerarecorder_p.h +++ b/src/imports/multimedia/qdeclarativecamerarecorder_p.h @@ -57,8 +57,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QDeclarativeCamera; @@ -227,6 +225,4 @@ QT_END_NAMESPACE QML_DECLARE_TYPE(QT_PREPEND_NAMESPACE(QDeclarativeCameraRecorder)) -QT_END_HEADER - #endif diff --git a/src/imports/multimedia/qdeclarativemediametadata_p.h b/src/imports/multimedia/qdeclarativemediametadata_p.h index b9c45ac17..4a65dc9cf 100644 --- a/src/imports/multimedia/qdeclarativemediametadata_p.h +++ b/src/imports/multimedia/qdeclarativemediametadata_p.h @@ -56,8 +56,6 @@ #include #include "qmediaobject.h" -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QDeclarativeMediaMetaData : public QObject @@ -179,6 +177,4 @@ QT_END_NAMESPACE QML_DECLARE_TYPE(QT_PREPEND_NAMESPACE(QDeclarativeMediaMetaData)) -QT_END_HEADER - #endif diff --git a/src/imports/multimedia/qdeclarativeradio_p.h b/src/imports/multimedia/qdeclarativeradio_p.h index e3abef382..b32af6a5b 100644 --- a/src/imports/multimedia/qdeclarativeradio_p.h +++ b/src/imports/multimedia/qdeclarativeradio_p.h @@ -56,8 +56,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QDeclarativeRadioData; @@ -202,6 +200,4 @@ QT_END_NAMESPACE QML_DECLARE_TYPE(QT_PREPEND_NAMESPACE(QDeclarativeRadio)) -QT_END_HEADER - #endif // QDECLARATIVERADIO_P_H diff --git a/src/imports/multimedia/qdeclarativeradiodata_p.h b/src/imports/multimedia/qdeclarativeradiodata_p.h index 44790bca2..b8fa649a2 100644 --- a/src/imports/multimedia/qdeclarativeradiodata_p.h +++ b/src/imports/multimedia/qdeclarativeradiodata_p.h @@ -57,8 +57,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QDeclarativeRadioData : public QObject @@ -191,6 +189,4 @@ QT_END_NAMESPACE QML_DECLARE_TYPE(QT_PREPEND_NAMESPACE(QDeclarativeRadioData)) -QT_END_HEADER - #endif // QDECLARATIVERADIODATA_P_H diff --git a/src/imports/multimedia/qdeclarativetorch_p.h b/src/imports/multimedia/qdeclarativetorch_p.h index e427799af..12569e50d 100644 --- a/src/imports/multimedia/qdeclarativetorch_p.h +++ b/src/imports/multimedia/qdeclarativetorch_p.h @@ -49,8 +49,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QDeclarativeTorch : public QObject @@ -88,6 +86,4 @@ QT_END_NAMESPACE QML_DECLARE_TYPE(QT_PREPEND_NAMESPACE(QDeclarativeTorch)) -QT_END_HEADER - #endif // QDECLARATIVETORCH_P_H diff --git a/src/multimedia/audio/qaudio.h b/src/multimedia/audio/qaudio.h index 1af692f68..a9bfd1a0c 100644 --- a/src/multimedia/audio/qaudio.h +++ b/src/multimedia/audio/qaudio.h @@ -48,8 +48,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE //QTM_SYNC_HEADER_EXPORT QAudio @@ -75,6 +73,4 @@ Q_DECLARE_METATYPE(QAudio::Error) Q_DECLARE_METATYPE(QAudio::State) Q_DECLARE_METATYPE(QAudio::Mode) -QT_END_HEADER - #endif // QAUDIO_H diff --git a/src/multimedia/audio/qaudio_mac_p.h b/src/multimedia/audio/qaudio_mac_p.h index a677b06a2..4df9ed3ad 100644 --- a/src/multimedia/audio/qaudio_mac_p.h +++ b/src/multimedia/audio/qaudio_mac_p.h @@ -61,8 +61,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE extern QAudioFormat toQAudioFormat(const AudioStreamBasicDescription& streamFormat); @@ -132,8 +130,6 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // QAUDIO_MAC_P_H diff --git a/src/multimedia/audio/qaudiobuffer.h b/src/multimedia/audio/qaudiobuffer.h index 42fe7c621..3c05ceadb 100644 --- a/src/multimedia/audio/qaudiobuffer.h +++ b/src/multimedia/audio/qaudiobuffer.h @@ -50,8 +50,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QAbstractAudioBuffer; @@ -152,6 +150,4 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(QAudioBuffer) -QT_END_HEADER - #endif // QAUDIOBUFFER_H diff --git a/src/multimedia/audio/qaudiobuffer_p.h b/src/multimedia/audio/qaudiobuffer_p.h index 20265444a..0c7369dc1 100644 --- a/src/multimedia/audio/qaudiobuffer_p.h +++ b/src/multimedia/audio/qaudiobuffer_p.h @@ -47,8 +47,6 @@ #include "qaudioformat.h" -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -86,6 +84,4 @@ public: QT_END_NAMESPACE -QT_END_HEADER - #endif // QAUDIOBUFFER_P_H diff --git a/src/multimedia/audio/qaudiodecoder.h b/src/multimedia/audio/qaudiodecoder.h index 099c89502..ce03286f8 100644 --- a/src/multimedia/audio/qaudiodecoder.h +++ b/src/multimedia/audio/qaudiodecoder.h @@ -47,8 +47,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QAudioDecoderPrivate; @@ -142,6 +140,4 @@ Q_DECLARE_METATYPE(QAudioDecoder::Error) Q_MEDIA_ENUM_DEBUG(QAudioDecoder, State) Q_MEDIA_ENUM_DEBUG(QAudioDecoder, Error) -QT_END_HEADER - #endif // QAUDIODECODER_H diff --git a/src/multimedia/audio/qaudiodevicefactory_p.h b/src/multimedia/audio/qaudiodevicefactory_p.h index 40b08aae9..1c34b02f1 100644 --- a/src/multimedia/audio/qaudiodevicefactory_p.h +++ b/src/multimedia/audio/qaudiodevicefactory_p.h @@ -61,8 +61,6 @@ #include "qaudiodeviceinfo.h" -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -92,7 +90,5 @@ public: QT_END_NAMESPACE -QT_END_HEADER - #endif // QAUDIODEVICEFACTORY_P_H diff --git a/src/multimedia/audio/qaudiodeviceinfo.h b/src/multimedia/audio/qaudiodeviceinfo.h index 41b37e867..0c8c0d3bc 100644 --- a/src/multimedia/audio/qaudiodeviceinfo.h +++ b/src/multimedia/audio/qaudiodeviceinfo.h @@ -55,8 +55,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -110,6 +108,4 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(QAudioDeviceInfo) -QT_END_HEADER - #endif // QAUDIODEVICEINFO_H diff --git a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.h b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.h index cd27ce792..61a633f56 100644 --- a/src/multimedia/audio/qaudiodeviceinfo_alsa_p.h +++ b/src/multimedia/audio/qaudiodeviceinfo_alsa_p.h @@ -65,8 +65,6 @@ #include "qaudiodeviceinfo.h" #include "qaudiosystem.h" -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -120,8 +118,6 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimedia/audio/qaudiodeviceinfo_mac_p.h b/src/multimedia/audio/qaudiodeviceinfo_mac_p.h index d76d60b3d..6734e836d 100644 --- a/src/multimedia/audio/qaudiodeviceinfo_mac_p.h +++ b/src/multimedia/audio/qaudiodeviceinfo_mac_p.h @@ -58,8 +58,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -92,6 +90,4 @@ public: QT_END_NAMESPACE -QT_END_HEADER - #endif // QDEVICEINFO_MAC_P_H diff --git a/src/multimedia/audio/qaudiodeviceinfo_win32_p.h b/src/multimedia/audio/qaudiodeviceinfo_win32_p.h index 2b3da88fc..8b657d8c9 100644 --- a/src/multimedia/audio/qaudiodeviceinfo_win32_p.h +++ b/src/multimedia/audio/qaudiodeviceinfo_win32_p.h @@ -63,8 +63,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -112,7 +110,5 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimedia/audio/qaudioformat.h b/src/multimedia/audio/qaudioformat.h index 90f8a1f54..e7ff04fa9 100644 --- a/src/multimedia/audio/qaudioformat.h +++ b/src/multimedia/audio/qaudioformat.h @@ -49,8 +49,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QAudioFormatPrivate; @@ -117,6 +115,4 @@ Q_DECLARE_METATYPE(QAudioFormat) Q_DECLARE_METATYPE(QAudioFormat::SampleType) Q_DECLARE_METATYPE(QAudioFormat::Endian) -QT_END_HEADER - #endif // QAUDIOFORMAT_H diff --git a/src/multimedia/audio/qaudioinput.h b/src/multimedia/audio/qaudioinput.h index eab79793e..2867781b8 100644 --- a/src/multimedia/audio/qaudioinput.h +++ b/src/multimedia/audio/qaudioinput.h @@ -53,8 +53,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -110,6 +108,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // QAUDIOINPUT_H diff --git a/src/multimedia/audio/qaudioinput_alsa_p.h b/src/multimedia/audio/qaudioinput_alsa_p.h index cb02e2717..7b793ce24 100644 --- a/src/multimedia/audio/qaudioinput_alsa_p.h +++ b/src/multimedia/audio/qaudioinput_alsa_p.h @@ -67,8 +67,6 @@ #include "qaudiodeviceinfo.h" #include "qaudiosystem.h" -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -186,7 +184,5 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimedia/audio/qaudioinput_mac_p.h b/src/multimedia/audio/qaudioinput_mac_p.h index 6c319b061..4fba4d7d0 100644 --- a/src/multimedia/audio/qaudioinput_mac_p.h +++ b/src/multimedia/audio/qaudioinput_mac_p.h @@ -68,8 +68,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -172,6 +170,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // QAUDIOINPUT_MAC_P_H diff --git a/src/multimedia/audio/qaudioinput_win32_p.h b/src/multimedia/audio/qaudioinput_win32_p.h index af9943bd1..3ce117702 100644 --- a/src/multimedia/audio/qaudioinput_win32_p.h +++ b/src/multimedia/audio/qaudioinput_win32_p.h @@ -69,8 +69,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -178,7 +176,5 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimedia/audio/qaudiooutput.h b/src/multimedia/audio/qaudiooutput.h index b4296e5ef..8ab0c5999 100644 --- a/src/multimedia/audio/qaudiooutput.h +++ b/src/multimedia/audio/qaudiooutput.h @@ -53,8 +53,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -113,6 +111,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // QAUDIOOUTPUT_H diff --git a/src/multimedia/audio/qaudiooutput_alsa_p.h b/src/multimedia/audio/qaudiooutput_alsa_p.h index 08b1783d0..2cbf54abc 100644 --- a/src/multimedia/audio/qaudiooutput_alsa_p.h +++ b/src/multimedia/audio/qaudiooutput_alsa_p.h @@ -66,8 +66,6 @@ #include "qaudiodeviceinfo.h" #include "qaudiosystem.h" -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -171,7 +169,5 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimedia/audio/qaudiooutput_mac_p.h b/src/multimedia/audio/qaudiooutput_mac_p.h index 490de7ea0..48b0c2dd0 100644 --- a/src/multimedia/audio/qaudiooutput_mac_p.h +++ b/src/multimedia/audio/qaudiooutput_mac_p.h @@ -68,8 +68,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -171,6 +169,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimedia/audio/qaudiooutput_win32_p.h b/src/multimedia/audio/qaudiooutput_win32_p.h index 9558299a3..39127ff3d 100644 --- a/src/multimedia/audio/qaudiooutput_win32_p.h +++ b/src/multimedia/audio/qaudiooutput_win32_p.h @@ -76,8 +76,6 @@ # endif #endif -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -170,7 +168,5 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimedia/audio/qaudioprobe.h b/src/multimedia/audio/qaudioprobe.h index 748944906..25ea9b7fe 100644 --- a/src/multimedia/audio/qaudioprobe.h +++ b/src/multimedia/audio/qaudioprobe.h @@ -45,8 +45,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QMediaObject; @@ -75,6 +73,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // QAUDIOPROBE_H diff --git a/src/multimedia/audio/qaudiosystem.h b/src/multimedia/audio/qaudiosystem.h index 2cefeebf8..badb05807 100644 --- a/src/multimedia/audio/qaudiosystem.h +++ b/src/multimedia/audio/qaudiosystem.h @@ -49,8 +49,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -140,6 +138,4 @@ Q_SIGNALS: QT_END_NAMESPACE -QT_END_HEADER - #endif // QAUDIOSYSTEM_H diff --git a/src/multimedia/audio/qaudiosystemplugin.h b/src/multimedia/audio/qaudiosystemplugin.h index 7a8a4606a..d3ae55141 100644 --- a/src/multimedia/audio/qaudiosystemplugin.h +++ b/src/multimedia/audio/qaudiosystemplugin.h @@ -53,8 +53,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -92,6 +90,4 @@ public: QT_END_NAMESPACE -QT_END_HEADER - #endif // QAUDIOSYSTEMPLUGIN_H diff --git a/src/multimedia/audio/qsamplecache_p.h b/src/multimedia/audio/qsamplecache_p.h index ecae7d2f5..1d7a9a7a5 100644 --- a/src/multimedia/audio/qsamplecache_p.h +++ b/src/multimedia/audio/qsamplecache_p.h @@ -62,8 +62,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QIODevice; @@ -165,6 +163,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // QSAMPLECACHE_P_H diff --git a/src/multimedia/audio/qsound.h b/src/multimedia/audio/qsound.h index a4d5327e0..3968e43a7 100644 --- a/src/multimedia/audio/qsound.h +++ b/src/multimedia/audio/qsound.h @@ -45,8 +45,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QSoundEffect; @@ -85,7 +83,5 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // QSOUND_H diff --git a/src/multimedia/audio/qsoundeffect.h b/src/multimedia/audio/qsoundeffect.h index 7192d0302..0da47e6ad 100644 --- a/src/multimedia/audio/qsoundeffect.h +++ b/src/multimedia/audio/qsoundeffect.h @@ -48,8 +48,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -132,7 +130,5 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // QSOUNDEFFECT_H diff --git a/src/multimedia/audio/qsoundeffect_pulse_p.h b/src/multimedia/audio/qsoundeffect_pulse_p.h index 78f3d1104..85332ef3d 100644 --- a/src/multimedia/audio/qsoundeffect_pulse_p.h +++ b/src/multimedia/audio/qsoundeffect_pulse_p.h @@ -62,8 +62,6 @@ #include #include "qsamplecache_p.h" -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QSoundEffectRef; @@ -169,6 +167,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // QSOUNDEFFECT_PULSE_H diff --git a/src/multimedia/audio/qsoundeffect_qaudio_p.h b/src/multimedia/audio/qsoundeffect_qaudio_p.h index 142d1046c..c5b476bed 100644 --- a/src/multimedia/audio/qsoundeffect_qaudio_p.h +++ b/src/multimedia/audio/qsoundeffect_qaudio_p.h @@ -59,8 +59,6 @@ #include "qsamplecache_p.h" #include "qsoundeffect.h" -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QSoundEffectPrivate; @@ -151,6 +149,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // QSOUNDEFFECT_QAUDIO_H diff --git a/src/multimedia/audio/qwavedecoder_p.h b/src/multimedia/audio/qwavedecoder_p.h index 3947ad515..0be420fd0 100644 --- a/src/multimedia/audio/qwavedecoder_p.h +++ b/src/multimedia/audio/qwavedecoder_p.h @@ -57,8 +57,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -134,6 +132,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // WAVEDECODER_H diff --git a/src/multimedia/camera/qcamera.h b/src/multimedia/camera/qcamera.h index 7a6cf2ea5..5cda4551d 100644 --- a/src/multimedia/camera/qcamera.h +++ b/src/multimedia/camera/qcamera.h @@ -58,8 +58,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -234,6 +232,4 @@ Q_MEDIA_ENUM_DEBUG(QCamera, LockType) Q_MEDIA_ENUM_DEBUG(QCamera, LockStatus) Q_MEDIA_ENUM_DEBUG(QCamera, LockChangeReason) -QT_END_HEADER - #endif // QCAMERA_H diff --git a/src/multimedia/camera/qcameraexposure.h b/src/multimedia/camera/qcameraexposure.h index 31be78719..4be10f25f 100644 --- a/src/multimedia/camera/qcameraexposure.h +++ b/src/multimedia/camera/qcameraexposure.h @@ -45,8 +45,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -183,6 +181,4 @@ Q_MEDIA_ENUM_DEBUG(QCameraExposure, ExposureMode) Q_MEDIA_ENUM_DEBUG(QCameraExposure, FlashMode) Q_MEDIA_ENUM_DEBUG(QCameraExposure, MeteringMode) -QT_END_HEADER - #endif // QCAMERAEXPOSURE_H diff --git a/src/multimedia/camera/qcamerafocus.h b/src/multimedia/camera/qcamerafocus.h index 7f50170a0..9f1dfb73b 100644 --- a/src/multimedia/camera/qcamerafocus.h +++ b/src/multimedia/camera/qcamerafocus.h @@ -52,8 +52,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -176,6 +174,4 @@ Q_DECLARE_METATYPE(QCameraFocus::FocusPointMode) Q_MEDIA_ENUM_DEBUG(QCameraFocus, FocusMode) Q_MEDIA_ENUM_DEBUG(QCameraFocus, FocusPointMode) -QT_END_HEADER - #endif // QCAMERAFOCUS_H diff --git a/src/multimedia/camera/qcameraimagecapture.h b/src/multimedia/camera/qcameraimagecapture.h index fafffcbf3..91099ab7b 100644 --- a/src/multimedia/camera/qcameraimagecapture.h +++ b/src/multimedia/camera/qcameraimagecapture.h @@ -49,8 +49,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QSize; @@ -161,7 +159,5 @@ Q_DECLARE_METATYPE(QCameraImageCapture::CaptureDestinations) Q_MEDIA_ENUM_DEBUG(QCameraImageCapture, Error) Q_MEDIA_ENUM_DEBUG(QCameraImageCapture, CaptureDestination) -QT_END_HEADER - #endif diff --git a/src/multimedia/camera/qcameraimageprocessing.h b/src/multimedia/camera/qcameraimageprocessing.h index ee3975dd5..e2fa4d58f 100644 --- a/src/multimedia/camera/qcameraimageprocessing.h +++ b/src/multimedia/camera/qcameraimageprocessing.h @@ -53,8 +53,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -116,6 +114,4 @@ Q_DECLARE_METATYPE(QCameraImageProcessing::WhiteBalanceMode) Q_MEDIA_ENUM_DEBUG(QCameraImageProcessing, WhiteBalanceMode) -QT_END_HEADER - #endif // QCAMERAIMAGEPROCESSING_H diff --git a/src/multimedia/controls/qaudiodecodercontrol.h b/src/multimedia/controls/qaudiodecodercontrol.h index 5b5a81472..12ca4b134 100644 --- a/src/multimedia/controls/qaudiodecodercontrol.h +++ b/src/multimedia/controls/qaudiodecodercontrol.h @@ -49,8 +49,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QIODevice; @@ -104,6 +102,4 @@ Q_MEDIA_DECLARE_CONTROL(QAudioDecoderControl, QAudioDecoderControl_iid) QT_END_NAMESPACE -QT_END_HEADER - #endif // QAUDIODECODERCONTROL_H diff --git a/src/multimedia/controls/qaudioencodersettingscontrol.h b/src/multimedia/controls/qaudioencodersettingscontrol.h index 99e6e95b0..0880ffad4 100644 --- a/src/multimedia/controls/qaudioencodersettingscontrol.h +++ b/src/multimedia/controls/qaudioencodersettingscontrol.h @@ -47,8 +47,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QStringList; @@ -85,7 +83,5 @@ Q_MEDIA_DECLARE_CONTROL(QAudioEncoderSettingsControl, QAudioEncoderSettingsContr QT_END_NAMESPACE -QT_END_HEADER - #endif // QAUDIOENCODERSETTINGSCONTROL_H diff --git a/src/multimedia/controls/qaudioinputselectorcontrol.h b/src/multimedia/controls/qaudioinputselectorcontrol.h index a147d2a33..9061e5ff9 100644 --- a/src/multimedia/controls/qaudioinputselectorcontrol.h +++ b/src/multimedia/controls/qaudioinputselectorcontrol.h @@ -45,8 +45,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -80,7 +78,5 @@ Q_MEDIA_DECLARE_CONTROL(QAudioInputSelectorControl, QAudioInputSelectorControl_i QT_END_NAMESPACE -QT_END_HEADER - #endif // QAUDIOINPUTSELECTORCONTROL_H diff --git a/src/multimedia/controls/qaudiooutputselectorcontrol.h b/src/multimedia/controls/qaudiooutputselectorcontrol.h index 7462d9eb9..3087118ce 100644 --- a/src/multimedia/controls/qaudiooutputselectorcontrol.h +++ b/src/multimedia/controls/qaudiooutputselectorcontrol.h @@ -45,8 +45,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -80,7 +78,5 @@ Q_MEDIA_DECLARE_CONTROL(QAudioOutputSelectorControl, QAudioOutputSelectorControl QT_END_NAMESPACE -QT_END_HEADER - #endif // QAUDIOOUTPUTSELECTORCONTROL_H diff --git a/src/multimedia/controls/qcameracapturebufferformatcontrol.h b/src/multimedia/controls/qcameracapturebufferformatcontrol.h index 2cc3d0313..fe5a5f7b3 100644 --- a/src/multimedia/controls/qcameracapturebufferformatcontrol.h +++ b/src/multimedia/controls/qcameracapturebufferformatcontrol.h @@ -45,8 +45,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -74,8 +72,6 @@ Q_MEDIA_DECLARE_CONTROL(QCameraCaptureBufferFormatControl, QCameraCaptureBufferF QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimedia/controls/qcameracapturedestinationcontrol.h b/src/multimedia/controls/qcameracapturedestinationcontrol.h index a1bfbba84..09ad745c7 100644 --- a/src/multimedia/controls/qcameracapturedestinationcontrol.h +++ b/src/multimedia/controls/qcameracapturedestinationcontrol.h @@ -45,8 +45,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -74,8 +72,6 @@ Q_MEDIA_DECLARE_CONTROL(QCameraCaptureDestinationControl, QCameraCaptureDestinat QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimedia/controls/qcameracontrol.h b/src/multimedia/controls/qcameracontrol.h index 41d44bb3e..9db849e3c 100644 --- a/src/multimedia/controls/qcameracontrol.h +++ b/src/multimedia/controls/qcameracontrol.h @@ -47,8 +47,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -94,8 +92,6 @@ Q_MEDIA_DECLARE_CONTROL(QCameraControl, QCameraControl_iid) QT_END_NAMESPACE -QT_END_HEADER - #endif // QCAMERACONTROL_H diff --git a/src/multimedia/controls/qcameraexposurecontrol.h b/src/multimedia/controls/qcameraexposurecontrol.h index 70b194629..391076d71 100644 --- a/src/multimedia/controls/qcameraexposurecontrol.h +++ b/src/multimedia/controls/qcameraexposurecontrol.h @@ -49,8 +49,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -103,8 +101,6 @@ Q_DECLARE_METATYPE(QCameraExposureControl::ExposureParameter) Q_MEDIA_ENUM_DEBUG(QCameraExposureControl, ExposureParameter) -QT_END_HEADER - #endif // QCAMERAEXPOSURECONTROL_H diff --git a/src/multimedia/controls/qcamerafeedbackcontrol.h b/src/multimedia/controls/qcamerafeedbackcontrol.h index c355c4cc9..f0b132992 100644 --- a/src/multimedia/controls/qcamerafeedbackcontrol.h +++ b/src/multimedia/controls/qcamerafeedbackcontrol.h @@ -50,8 +50,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -96,7 +94,5 @@ Q_MEDIA_DECLARE_CONTROL(QCameraFeedbackControl, QCameraFeedbackControl_iid) QT_END_NAMESPACE -QT_END_HEADER - #endif // QCAMERAFEEDBACKCONTROL_H diff --git a/src/multimedia/controls/qcameraflashcontrol.h b/src/multimedia/controls/qcameraflashcontrol.h index 5fd19bcd5..d5f2428bd 100644 --- a/src/multimedia/controls/qcameraflashcontrol.h +++ b/src/multimedia/controls/qcameraflashcontrol.h @@ -48,8 +48,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -80,8 +78,6 @@ Q_MEDIA_DECLARE_CONTROL(QCameraFlashControl, QCameraFlashControl_iid) QT_END_NAMESPACE -QT_END_HEADER - #endif // QCAMERAFLASHCONTROL_H diff --git a/src/multimedia/controls/qcamerafocuscontrol.h b/src/multimedia/controls/qcamerafocuscontrol.h index 362f75b62..d18ae3ba7 100644 --- a/src/multimedia/controls/qcamerafocuscontrol.h +++ b/src/multimedia/controls/qcamerafocuscontrol.h @@ -47,8 +47,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -89,8 +87,6 @@ Q_MEDIA_DECLARE_CONTROL(QCameraFocusControl, QCameraFocusControl_iid) QT_END_NAMESPACE -QT_END_HEADER - #endif // QCAMERAFOCUSCONTROL_H diff --git a/src/multimedia/controls/qcameraimagecapturecontrol.h b/src/multimedia/controls/qcameraimagecapturecontrol.h index c738c0ac0..a47538a54 100644 --- a/src/multimedia/controls/qcameraimagecapturecontrol.h +++ b/src/multimedia/controls/qcameraimagecapturecontrol.h @@ -45,8 +45,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QImage; @@ -92,8 +90,6 @@ Q_MEDIA_DECLARE_CONTROL(QCameraImageCaptureControl, QCameraImageCaptureControl_i QT_END_NAMESPACE -QT_END_HEADER - #endif // QCAMERAIMAGECAPTURECONTROL_H diff --git a/src/multimedia/controls/qcameraimageprocessingcontrol.h b/src/multimedia/controls/qcameraimageprocessingcontrol.h index 9b5456a28..04c5fa657 100644 --- a/src/multimedia/controls/qcameraimageprocessingcontrol.h +++ b/src/multimedia/controls/qcameraimageprocessingcontrol.h @@ -48,8 +48,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -97,7 +95,5 @@ Q_DECLARE_METATYPE(QCameraImageProcessingControl::ProcessingParameter) Q_MEDIA_ENUM_DEBUG(QCameraImageProcessingControl, ProcessingParameter) -QT_END_HEADER - #endif diff --git a/src/multimedia/controls/qcameralockscontrol.h b/src/multimedia/controls/qcameralockscontrol.h index 89a72b961..774eb8fa0 100644 --- a/src/multimedia/controls/qcameralockscontrol.h +++ b/src/multimedia/controls/qcameralockscontrol.h @@ -47,8 +47,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -79,8 +77,6 @@ Q_MEDIA_DECLARE_CONTROL(QCameraLocksControl, QCameraLocksControl_iid) QT_END_NAMESPACE -QT_END_HEADER - #endif // QCAMERALOCKSCONTROL_H diff --git a/src/multimedia/controls/qcameraviewfindersettingscontrol.h b/src/multimedia/controls/qcameraviewfindersettingscontrol.h index 31aa81bc5..561840e92 100644 --- a/src/multimedia/controls/qcameraviewfindersettingscontrol.h +++ b/src/multimedia/controls/qcameraviewfindersettingscontrol.h @@ -46,8 +46,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -81,6 +79,4 @@ Q_MEDIA_DECLARE_CONTROL(QCameraViewfinderSettingsControl, QCameraViewfinderSetti QT_END_NAMESPACE -QT_END_HEADER - #endif // QCAMERAVIEWFINDERSETTINGSCONTROL_H diff --git a/src/multimedia/controls/qcamerazoomcontrol.h b/src/multimedia/controls/qcamerazoomcontrol.h index d143abcff..3b3f69fdd 100644 --- a/src/multimedia/controls/qcamerazoomcontrol.h +++ b/src/multimedia/controls/qcamerazoomcontrol.h @@ -45,8 +45,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -87,6 +85,4 @@ Q_MEDIA_DECLARE_CONTROL(QCameraZoomControl, QCameraZoomControl_iid) QT_END_NAMESPACE -QT_END_HEADER - #endif // QCAMERAZOOMCONTROL_H diff --git a/src/multimedia/controls/qimageencodercontrol.h b/src/multimedia/controls/qimageencodercontrol.h index b870499c5..155eead68 100644 --- a/src/multimedia/controls/qimageencodercontrol.h +++ b/src/multimedia/controls/qimageencodercontrol.h @@ -48,8 +48,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QByteArray; @@ -86,7 +84,5 @@ Q_MEDIA_DECLARE_CONTROL(QImageEncoderControl, QImageEncoderControl_iid) QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimedia/controls/qmediaaudioprobecontrol.h b/src/multimedia/controls/qmediaaudioprobecontrol.h index de13af8b3..c375b3f75 100644 --- a/src/multimedia/controls/qmediaaudioprobecontrol.h +++ b/src/multimedia/controls/qmediaaudioprobecontrol.h @@ -44,8 +44,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QAudioBuffer; @@ -68,7 +66,5 @@ Q_MEDIA_DECLARE_CONTROL(QMediaAudioProbeControl, QMediaAudioProbeControl_iid) QT_END_NAMESPACE -QT_END_HEADER - #endif // QMEDIAAUDIOPROBECONTROL_H diff --git a/src/multimedia/controls/qmediaavailabilitycontrol.h b/src/multimedia/controls/qmediaavailabilitycontrol.h index 781d173b6..30b7db7f2 100644 --- a/src/multimedia/controls/qmediaavailabilitycontrol.h +++ b/src/multimedia/controls/qmediaavailabilitycontrol.h @@ -46,8 +46,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -74,6 +72,4 @@ Q_MEDIA_DECLARE_CONTROL(QMediaAvailabilityControl, QMediaAvailabilityControl_iid QT_END_NAMESPACE -QT_END_HEADER - #endif // QMEDIAAVAILABILITYCONTROL_H diff --git a/src/multimedia/controls/qmediacontainercontrol.h b/src/multimedia/controls/qmediacontainercontrol.h index 760081174..22dcd7e32 100644 --- a/src/multimedia/controls/qmediacontainercontrol.h +++ b/src/multimedia/controls/qmediacontainercontrol.h @@ -45,8 +45,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -74,7 +72,5 @@ Q_MEDIA_DECLARE_CONTROL(QMediaContainerControl, QMediaContainerControl_iid) QT_END_NAMESPACE -QT_END_HEADER - #endif // QMEDIACONTAINERCONTROL_H diff --git a/src/multimedia/controls/qmediagaplessplaybackcontrol.h b/src/multimedia/controls/qmediagaplessplaybackcontrol.h index 050edf95b..c25a9eb87 100644 --- a/src/multimedia/controls/qmediagaplessplaybackcontrol.h +++ b/src/multimedia/controls/qmediagaplessplaybackcontrol.h @@ -44,8 +44,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -78,6 +76,4 @@ Q_MEDIA_DECLARE_CONTROL(QMediaGaplessPlaybackControl, QMediaGaplessPlaybackContr QT_END_NAMESPACE -QT_END_HEADER - #endif // QMEDIAGAPLESSPLAYBACKCONTROL_H diff --git a/src/multimedia/controls/qmedianetworkaccesscontrol.h b/src/multimedia/controls/qmedianetworkaccesscontrol.h index fb5847d91..7d9fd9885 100644 --- a/src/multimedia/controls/qmedianetworkaccesscontrol.h +++ b/src/multimedia/controls/qmedianetworkaccesscontrol.h @@ -48,8 +48,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -77,7 +75,5 @@ Q_MEDIA_DECLARE_CONTROL(QMediaNetworkAccessControl, QMediaNetworkAccessControl_i QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimedia/controls/qmediaplayercontrol.h b/src/multimedia/controls/qmediaplayercontrol.h index 9c54ff211..7e70a3b25 100644 --- a/src/multimedia/controls/qmediaplayercontrol.h +++ b/src/multimedia/controls/qmediaplayercontrol.h @@ -48,8 +48,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -122,8 +120,6 @@ Q_MEDIA_DECLARE_CONTROL(QMediaPlayerControl, QMediaPlayerControl_iid) QT_END_NAMESPACE -QT_END_HEADER - #endif // QMEDIAPLAYERCONTROL_H diff --git a/src/multimedia/controls/qmediaplaylistcontrol_p.h b/src/multimedia/controls/qmediaplaylistcontrol_p.h index 9bd8a9585..a2489fa62 100644 --- a/src/multimedia/controls/qmediaplaylistcontrol_p.h +++ b/src/multimedia/controls/qmediaplaylistcontrol_p.h @@ -59,8 +59,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -102,7 +100,5 @@ Q_MEDIA_DECLARE_CONTROL(QMediaPlaylistControl, QMediaPlaylistControl_iid) QT_END_NAMESPACE -QT_END_HEADER - #endif // QMEDIAPLAYLISTCONTROL_P_H diff --git a/src/multimedia/controls/qmediaplaylistsourcecontrol_p.h b/src/multimedia/controls/qmediaplaylistsourcecontrol_p.h index 7be4b43a5..950dd949f 100644 --- a/src/multimedia/controls/qmediaplaylistsourcecontrol_p.h +++ b/src/multimedia/controls/qmediaplaylistsourcecontrol_p.h @@ -56,8 +56,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -85,7 +83,5 @@ Q_MEDIA_DECLARE_CONTROL(QMediaPlaylistSourceControl, QMediaPlaylistSourceControl QT_END_NAMESPACE -QT_END_HEADER - #endif // QMEDIAPLAYLISTCONTROL_P_H diff --git a/src/multimedia/controls/qmediarecordercontrol.h b/src/multimedia/controls/qmediarecordercontrol.h index e254390a8..4dfd21d40 100644 --- a/src/multimedia/controls/qmediarecordercontrol.h +++ b/src/multimedia/controls/qmediarecordercontrol.h @@ -45,8 +45,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QUrl; @@ -100,7 +98,5 @@ Q_MEDIA_DECLARE_CONTROL(QMediaRecorderControl, QMediaRecorderControl_iid) QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimedia/controls/qmediastreamscontrol.h b/src/multimedia/controls/qmediastreamscontrol.h index f7a92fee6..a31c9f976 100644 --- a/src/multimedia/controls/qmediastreamscontrol.h +++ b/src/multimedia/controls/qmediastreamscontrol.h @@ -48,8 +48,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -89,7 +87,5 @@ Q_DECLARE_METATYPE(QMediaStreamsControl::StreamType) Q_MEDIA_ENUM_DEBUG(QMediaStreamsControl, StreamType) -QT_END_HEADER - #endif // QMEDIASTREAMSCONTROL_H diff --git a/src/multimedia/controls/qmediavideoprobecontrol.h b/src/multimedia/controls/qmediavideoprobecontrol.h index 7764cc1f5..3bfaf922c 100644 --- a/src/multimedia/controls/qmediavideoprobecontrol.h +++ b/src/multimedia/controls/qmediavideoprobecontrol.h @@ -46,8 +46,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QVideoFrame; @@ -70,7 +68,5 @@ Q_MEDIA_DECLARE_CONTROL(QMediaVideoProbeControl, QMediaVideoProbeControl_iid) QT_END_NAMESPACE -QT_END_HEADER - #endif // QMEDIAVIDEOPROBECONTROL_H diff --git a/src/multimedia/controls/qmetadatareadercontrol.h b/src/multimedia/controls/qmetadatareadercontrol.h index 93996180a..8248cbcc9 100644 --- a/src/multimedia/controls/qmetadatareadercontrol.h +++ b/src/multimedia/controls/qmetadatareadercontrol.h @@ -50,8 +50,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -83,7 +81,5 @@ Q_MEDIA_DECLARE_CONTROL(QMetaDataReaderControl, QMetaDataReaderControl_iid) QT_END_NAMESPACE -QT_END_HEADER - #endif // QMETADATAPROVIDER_H diff --git a/src/multimedia/controls/qmetadatawritercontrol.h b/src/multimedia/controls/qmetadatawritercontrol.h index dcd62f2f2..584f00f4f 100644 --- a/src/multimedia/controls/qmetadatawritercontrol.h +++ b/src/multimedia/controls/qmetadatawritercontrol.h @@ -50,8 +50,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -86,7 +84,5 @@ Q_MEDIA_DECLARE_CONTROL(QMetaDataWriterControl, QMetaDataWriterControl_iid) QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimedia/controls/qradiodatacontrol.h b/src/multimedia/controls/qradiodatacontrol.h index 7d485a3bb..9c9cb019e 100644 --- a/src/multimedia/controls/qradiodatacontrol.h +++ b/src/multimedia/controls/qradiodatacontrol.h @@ -45,8 +45,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -88,7 +86,5 @@ Q_MEDIA_DECLARE_CONTROL(QRadioDataControl, QRadioDataControl_iid) QT_END_NAMESPACE -QT_END_HEADER - #endif // QRADIODATACONTROL_H diff --git a/src/multimedia/controls/qradiotunercontrol.h b/src/multimedia/controls/qradiotunercontrol.h index 1bc24fca3..7de3c7770 100644 --- a/src/multimedia/controls/qradiotunercontrol.h +++ b/src/multimedia/controls/qradiotunercontrol.h @@ -45,8 +45,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -119,7 +117,5 @@ Q_MEDIA_DECLARE_CONTROL(QRadioTunerControl, QRadioTunerControl_iid) QT_END_NAMESPACE -QT_END_HEADER - #endif // QRADIOTUNERCONTROL_H diff --git a/src/multimedia/controls/qvideodeviceselectorcontrol.h b/src/multimedia/controls/qvideodeviceselectorcontrol.h index c7ee9b513..d48fd9d50 100644 --- a/src/multimedia/controls/qvideodeviceselectorcontrol.h +++ b/src/multimedia/controls/qvideodeviceselectorcontrol.h @@ -44,8 +44,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -83,6 +81,4 @@ Q_MEDIA_DECLARE_CONTROL(QVideoDeviceSelectorControl, QVideoDeviceSelectorControl QT_END_NAMESPACE -QT_END_HEADER - #endif // QVIDEODEVICESELECTORCONTROL_H diff --git a/src/multimedia/controls/qvideoencodersettingscontrol.h b/src/multimedia/controls/qvideoencodersettingscontrol.h index a7a6aa81a..e8cfaddc8 100644 --- a/src/multimedia/controls/qvideoencodersettingscontrol.h +++ b/src/multimedia/controls/qvideoencodersettingscontrol.h @@ -48,8 +48,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QByteArray; @@ -89,7 +87,5 @@ Q_MEDIA_DECLARE_CONTROL(QVideoEncoderSettingsControl, QVideoEncoderSettingsContr QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimedia/controls/qvideorenderercontrol.h b/src/multimedia/controls/qvideorenderercontrol.h index 0d1a18645..506517d26 100644 --- a/src/multimedia/controls/qvideorenderercontrol.h +++ b/src/multimedia/controls/qvideorenderercontrol.h @@ -44,8 +44,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QAbstractVideoSurface; @@ -68,7 +66,5 @@ Q_MEDIA_DECLARE_CONTROL(QVideoRendererControl, QVideoRendererControl_iid) QT_END_NAMESPACE -QT_END_HEADER - #endif // QVIDEORENDERERCONTROL_H diff --git a/src/multimedia/controls/qvideowindowcontrol.h b/src/multimedia/controls/qvideowindowcontrol.h index 443417a08..d4d7b87a5 100644 --- a/src/multimedia/controls/qvideowindowcontrol.h +++ b/src/multimedia/controls/qvideowindowcontrol.h @@ -47,8 +47,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -106,7 +104,5 @@ Q_MEDIA_DECLARE_CONTROL(QVideoWindowControl, QVideoWindowControl_iid) QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimedia/playback/playlistfileparser_p.h b/src/multimedia/playback/playlistfileparser_p.h index d8fca090f..4173970a1 100644 --- a/src/multimedia/playback/playlistfileparser_p.h +++ b/src/multimedia/playback/playlistfileparser_p.h @@ -56,8 +56,6 @@ #include #include "qtmultimediadefs.h" -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QPlaylistFileParserPrivate; @@ -108,6 +106,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // PLAYLISTFILEPARSER_P_H diff --git a/src/multimedia/playback/qmediacontent.h b/src/multimedia/playback/qmediacontent.h index 2e7a9417c..f63f5545b 100644 --- a/src/multimedia/playback/qmediacontent.h +++ b/src/multimedia/playback/qmediacontent.h @@ -49,8 +49,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QMediaPlaylist; @@ -90,6 +88,4 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(QMediaContent) -QT_END_HEADER - #endif // QMEDIACONTENT_H diff --git a/src/multimedia/playback/qmedianetworkplaylistprovider_p.h b/src/multimedia/playback/qmedianetworkplaylistprovider_p.h index 825c309a0..12d0b86b1 100644 --- a/src/multimedia/playback/qmedianetworkplaylistprovider_p.h +++ b/src/multimedia/playback/qmedianetworkplaylistprovider_p.h @@ -55,8 +55,6 @@ #include "qmediaplaylistprovider_p.h" -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -95,7 +93,5 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // QMEDIANETWORKPAYLISTSOURCE_P_H diff --git a/src/multimedia/playback/qmediaplayer.h b/src/multimedia/playback/qmediaplayer.h index df75d61c2..dd63b9370 100644 --- a/src/multimedia/playback/qmediaplayer.h +++ b/src/multimedia/playback/qmediaplayer.h @@ -48,8 +48,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -226,6 +224,4 @@ Q_MEDIA_ENUM_DEBUG(QMediaPlayer, State) Q_MEDIA_ENUM_DEBUG(QMediaPlayer, MediaStatus) Q_MEDIA_ENUM_DEBUG(QMediaPlayer, Error) -QT_END_HEADER - #endif // QMEDIAPLAYER_H diff --git a/src/multimedia/playback/qmediaplaylist.h b/src/multimedia/playback/qmediaplaylist.h index 78bde5c30..b19e293b2 100644 --- a/src/multimedia/playback/qmediaplaylist.h +++ b/src/multimedia/playback/qmediaplaylist.h @@ -50,8 +50,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -148,6 +146,4 @@ Q_DECLARE_METATYPE(QMediaPlaylist::Error) Q_MEDIA_ENUM_DEBUG(QMediaPlaylist, PlaybackMode) Q_MEDIA_ENUM_DEBUG(QMediaPlaylist, Error) -QT_END_HEADER - #endif // QMEDIAPLAYLIST_H diff --git a/src/multimedia/playback/qmediaplaylist_p.h b/src/multimedia/playback/qmediaplaylist_p.h index 0b053dd8c..65e34d26e 100644 --- a/src/multimedia/playback/qmediaplaylist_p.h +++ b/src/multimedia/playback/qmediaplaylist_p.h @@ -66,8 +66,6 @@ # pragma Q_MOC_EXPAND_MACROS #endif -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -169,7 +167,5 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // QMEDIAPLAYLIST_P_H diff --git a/src/multimedia/playback/qmediaplaylistioplugin_p.h b/src/multimedia/playback/qmediaplaylistioplugin_p.h index 0a385613f..dfa97bbe5 100644 --- a/src/multimedia/playback/qmediaplaylistioplugin_p.h +++ b/src/multimedia/playback/qmediaplaylistioplugin_p.h @@ -60,8 +60,6 @@ #include "qmediacontent.h" -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QString; @@ -126,7 +124,5 @@ public: QT_END_NAMESPACE -QT_END_HEADER - #endif // QMEDIAPLAYLISTIOPLUGIN_P_H diff --git a/src/multimedia/playback/qmediaplaylistnavigator_p.h b/src/multimedia/playback/qmediaplaylistnavigator_p.h index d0f3a371f..4e0a9e235 100644 --- a/src/multimedia/playback/qmediaplaylistnavigator_p.h +++ b/src/multimedia/playback/qmediaplaylistnavigator_p.h @@ -57,8 +57,6 @@ #include "qmediaplaylist.h" #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -118,7 +116,5 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // QMEDIAPLAYLISTNAVIGATOR_P_H diff --git a/src/multimedia/playback/qmediaplaylistprovider_p.h b/src/multimedia/playback/qmediaplaylistprovider_p.h index 579590394..d33c155f9 100644 --- a/src/multimedia/playback/qmediaplaylistprovider_p.h +++ b/src/multimedia/playback/qmediaplaylistprovider_p.h @@ -56,8 +56,6 @@ #include "qmediacontent.h" #include "qmediaplaylist.h" -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -120,8 +118,6 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // QMEDIAPLAYLISTSOURCE_P_H diff --git a/src/multimedia/playback/qmediaresource.h b/src/multimedia/playback/qmediaresource.h index ff29d49fd..6848ca0ab 100644 --- a/src/multimedia/playback/qmediaresource.h +++ b/src/multimedia/playback/qmediaresource.h @@ -48,8 +48,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Class forward declaration required for QDoc bug @@ -128,6 +126,4 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(QMediaResource) Q_DECLARE_METATYPE(QMediaResourceList) -QT_END_HEADER - #endif diff --git a/src/multimedia/qmediabindableinterface.h b/src/multimedia/qmediabindableinterface.h index d8c85665d..0caaa55a5 100644 --- a/src/multimedia/qmediabindableinterface.h +++ b/src/multimedia/qmediabindableinterface.h @@ -44,8 +44,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -69,7 +67,5 @@ Q_DECLARE_INTERFACE(QMediaBindableInterface, QMediaBindableInterface_iid) QT_END_NAMESPACE -QT_END_HEADER - #endif // QMEDIABINDABLEINTERFACE_H diff --git a/src/multimedia/qmediacontrol.h b/src/multimedia/qmediacontrol.h index b014a14eb..89409d446 100644 --- a/src/multimedia/qmediacontrol.h +++ b/src/multimedia/qmediacontrol.h @@ -49,8 +49,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -79,7 +77,5 @@ template const char *qmediacontrol_iid() { return 0; } QT_END_NAMESPACE -QT_END_HEADER - #endif // QABSTRACTMEDIACONTROL_H diff --git a/src/multimedia/qmediacontrol_p.h b/src/multimedia/qmediacontrol_p.h index 9f362b320..b582dc64c 100644 --- a/src/multimedia/qmediacontrol_p.h +++ b/src/multimedia/qmediacontrol_p.h @@ -55,8 +55,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -72,7 +70,5 @@ public: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimedia/qmediaenumdebug.h b/src/multimedia/qmediaenumdebug.h index 9acf612cb..918d25efd 100644 --- a/src/multimedia/qmediaenumdebug.h +++ b/src/multimedia/qmediaenumdebug.h @@ -55,7 +55,6 @@ #include #include -QT_BEGIN_HEADER QT_BEGIN_NAMESPACE #ifndef QT_NO_DEBUG_STREAM @@ -75,7 +74,6 @@ inline QDebug operator<<(QDebug dbg, Class::Enum value) \ #endif //QT_NO_DEBUG_STREAM QT_END_NAMESPACE -QT_END_HEADER #endif diff --git a/src/multimedia/qmediametadata.h b/src/multimedia/qmediametadata.h index 99398743a..8a8caaa9b 100644 --- a/src/multimedia/qmediametadata.h +++ b/src/multimedia/qmediametadata.h @@ -48,8 +48,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Class forward declaration required for QDoc bug @@ -289,6 +287,4 @@ namespace QMediaMetaData { QT_END_NAMESPACE -QT_END_HEADER - #endif // QMEDIAMETADATA_H diff --git a/src/multimedia/qmediaobject.h b/src/multimedia/qmediaobject.h index 3726af5c4..94b1b01de 100644 --- a/src/multimedia/qmediaobject.h +++ b/src/multimedia/qmediaobject.h @@ -48,8 +48,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -110,7 +108,5 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // QABSTRACTMEDIAOBJECT_H diff --git a/src/multimedia/qmediaobject_p.h b/src/multimedia/qmediaobject_p.h index faddb94ff..9c64bf4bb 100644 --- a/src/multimedia/qmediaobject_p.h +++ b/src/multimedia/qmediaobject_p.h @@ -59,8 +59,6 @@ #include "qmediaobject.h" -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -95,7 +93,5 @@ public: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimedia/qmediapluginloader_p.h b/src/multimedia/qmediapluginloader_p.h index 13dbd3cf8..26a8f87e0 100644 --- a/src/multimedia/qmediapluginloader_p.h +++ b/src/multimedia/qmediapluginloader_p.h @@ -61,8 +61,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QFactoryLoader; @@ -92,7 +90,5 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // QMEDIAPLUGINLOADER_H diff --git a/src/multimedia/qmediaresourcepolicy_p.h b/src/multimedia/qmediaresourcepolicy_p.h index d8b3443aa..24c540b6c 100644 --- a/src/multimedia/qmediaresourcepolicy_p.h +++ b/src/multimedia/qmediaresourcepolicy_p.h @@ -45,8 +45,6 @@ #include #include "qtmultimediadefs.h" -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class Q_MULTIMEDIA_EXPORT QMediaResourcePolicy @@ -68,6 +66,4 @@ T* QMediaResourcePolicy::createResourceSet() QT_END_NAMESPACE -QT_END_HEADER - #endif // QMEDIARESOURCEPOLICY_H diff --git a/src/multimedia/qmediaresourcepolicyplugin_p.h b/src/multimedia/qmediaresourcepolicyplugin_p.h index f594a3f05..ab14a7d99 100644 --- a/src/multimedia/qmediaresourcepolicyplugin_p.h +++ b/src/multimedia/qmediaresourcepolicyplugin_p.h @@ -45,8 +45,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE struct Q_MULTIMEDIA_EXPORT QMediaResourceSetFactoryInterface @@ -71,6 +69,4 @@ public: QT_END_NAMESPACE -QT_END_HEADER - #endif // QRESOURCEPOLICYPLUGIN_P_H diff --git a/src/multimedia/qmediaresourceset_p.h b/src/multimedia/qmediaresourceset_p.h index 65acabe97..2c65861da 100644 --- a/src/multimedia/qmediaresourceset_p.h +++ b/src/multimedia/qmediaresourceset_p.h @@ -44,8 +44,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE #define QMediaPlayerResourceSetInterface_iid \ @@ -78,6 +76,4 @@ protected: QT_END_NAMESPACE -QT_END_HEADER - #endif // QMEDIARESOURCESET_P_H diff --git a/src/multimedia/qmediaservice.h b/src/multimedia/qmediaservice.h index 91b8fcf9c..ccb42eb3f 100644 --- a/src/multimedia/qmediaservice.h +++ b/src/multimedia/qmediaservice.h @@ -48,8 +48,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -88,8 +86,6 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // QABSTRACTMEDIASERVICE_H diff --git a/src/multimedia/qmediaservice_p.h b/src/multimedia/qmediaservice_p.h index 3c95e8b40..b808eac97 100644 --- a/src/multimedia/qmediaservice_p.h +++ b/src/multimedia/qmediaservice_p.h @@ -53,8 +53,6 @@ // We mean it. // -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -71,8 +69,6 @@ public: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimedia/qmediaserviceprovider_p.h b/src/multimedia/qmediaserviceprovider_p.h index f6dc203d7..830bffaa0 100644 --- a/src/multimedia/qmediaserviceprovider_p.h +++ b/src/multimedia/qmediaserviceprovider_p.h @@ -48,8 +48,6 @@ #include "qmultimedia.h" #include "qmediaserviceproviderplugin.h" -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -78,7 +76,5 @@ public: QT_END_NAMESPACE -QT_END_HEADER - #endif // QMEDIASERVICEPROVIDER_H diff --git a/src/multimedia/qmediaserviceproviderplugin.h b/src/multimedia/qmediaserviceproviderplugin.h index 870ee5966..6a85de2d0 100644 --- a/src/multimedia/qmediaserviceproviderplugin.h +++ b/src/multimedia/qmediaserviceproviderplugin.h @@ -51,8 +51,6 @@ # pragma Q_MOC_EXPAND_MACROS #endif -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE // Required for QDoc workaround @@ -226,6 +224,4 @@ public: QT_END_NAMESPACE -QT_END_HEADER - #endif // QMEDIASERVICEPROVIDERPLUGIN_H diff --git a/src/multimedia/qmediatimerange.h b/src/multimedia/qmediatimerange.h index c0a6993ad..82a37e04e 100644 --- a/src/multimedia/qmediatimerange.h +++ b/src/multimedia/qmediatimerange.h @@ -46,8 +46,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -132,7 +130,5 @@ Q_MULTIMEDIA_EXPORT QDebug operator<<(QDebug, const QMediaTimeRange &); QT_END_NAMESPACE -QT_END_HEADER - #endif // QMEDIATIMERANGE_H diff --git a/src/multimedia/qmultimedia.h b/src/multimedia/qmultimedia.h index c0dafe7f5..4e8e660d6 100644 --- a/src/multimedia/qmultimedia.h +++ b/src/multimedia/qmultimedia.h @@ -49,8 +49,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE namespace QMultimedia @@ -97,7 +95,5 @@ Q_DECLARE_METATYPE(QMultimedia::SupportEstimate) Q_DECLARE_METATYPE(QMultimedia::EncodingMode) Q_DECLARE_METATYPE(QMultimedia::EncodingQuality) -QT_END_HEADER - #endif diff --git a/src/multimedia/qtmultimediadefs.h b/src/multimedia/qtmultimediadefs.h index 03d4c3834..a632f6717 100644 --- a/src/multimedia/qtmultimediadefs.h +++ b/src/multimedia/qtmultimediadefs.h @@ -55,7 +55,6 @@ #include -QT_BEGIN_HEADER QT_BEGIN_NAMESPACE #ifndef QT_STATIC @@ -69,8 +68,6 @@ QT_BEGIN_NAMESPACE #endif QT_END_NAMESPACE -QT_END_HEADER - #endif // QMULTIMEDIA_P_H diff --git a/src/multimedia/qtmultimediaquicktools_headers/qsgvideonode_p.h b/src/multimedia/qtmultimediaquicktools_headers/qsgvideonode_p.h index 9a3923236..fe39adced 100644 --- a/src/multimedia/qtmultimediaquicktools_headers/qsgvideonode_p.h +++ b/src/multimedia/qtmultimediaquicktools_headers/qsgvideonode_p.h @@ -49,8 +49,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE const QLatin1String QSGVideoNodeFactoryPluginKey("sgvideonodes"); @@ -92,6 +90,4 @@ public: QT_END_NAMESPACE -QT_END_HEADER - #endif // QSGVIDEONODE_H diff --git a/src/multimedia/qtmultimediaquicktools_headers/qtmultimediaquickdefs_p.h b/src/multimedia/qtmultimediaquicktools_headers/qtmultimediaquickdefs_p.h index b7ed86941..0325aa48d 100644 --- a/src/multimedia/qtmultimediaquicktools_headers/qtmultimediaquickdefs_p.h +++ b/src/multimedia/qtmultimediaquicktools_headers/qtmultimediaquickdefs_p.h @@ -55,8 +55,6 @@ #include -QT_BEGIN_HEADER - #ifndef QT_STATIC # if defined(QT_BUILD_QTMM_QUICK_LIB) # define Q_MULTIMEDIAQUICK_EXPORT Q_DECL_EXPORT @@ -67,8 +65,6 @@ QT_BEGIN_HEADER # define Q_MULTIMEDIAQUICK_EXPORT #endif -QT_END_HEADER - #endif // QMULTIMEDIAQUICKDEFS_P_H diff --git a/src/multimedia/radio/qradiodata.h b/src/multimedia/radio/qradiodata.h index 92d08b927..c875d780e 100644 --- a/src/multimedia/radio/qradiodata.h +++ b/src/multimedia/radio/qradiodata.h @@ -48,8 +48,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -135,6 +133,4 @@ Q_DECLARE_METATYPE(QRadioData::ProgramType) Q_MEDIA_ENUM_DEBUG(QRadioData, Error) Q_MEDIA_ENUM_DEBUG(QRadioData, ProgramType) -QT_END_HEADER - #endif // QRADIOPLAYER_H diff --git a/src/multimedia/radio/qradiotuner.h b/src/multimedia/radio/qradiotuner.h index de92e95f0..b93197551 100644 --- a/src/multimedia/radio/qradiotuner.h +++ b/src/multimedia/radio/qradiotuner.h @@ -49,8 +49,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QRadioData; @@ -163,6 +161,4 @@ Q_MEDIA_ENUM_DEBUG(QRadioTuner, Error) Q_MEDIA_ENUM_DEBUG(QRadioTuner, StereoMode) Q_MEDIA_ENUM_DEBUG(QRadioTuner, SearchMode) -QT_END_HEADER - #endif // QRADIOPLAYER_H diff --git a/src/multimedia/recording/qaudiorecorder.h b/src/multimedia/recording/qaudiorecorder.h index cb1d0a722..760c1171c 100644 --- a/src/multimedia/recording/qaudiorecorder.h +++ b/src/multimedia/recording/qaudiorecorder.h @@ -49,8 +49,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QString; @@ -89,6 +87,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // QAUDIORECORDER_H diff --git a/src/multimedia/recording/qmediaencodersettings.h b/src/multimedia/recording/qmediaencodersettings.h index 06ee9212f..f97b4bf32 100644 --- a/src/multimedia/recording/qmediaencodersettings.h +++ b/src/multimedia/recording/qmediaencodersettings.h @@ -49,8 +49,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -180,7 +178,5 @@ Q_DECLARE_METATYPE(QAudioEncoderSettings) Q_DECLARE_METATYPE(QVideoEncoderSettings) Q_DECLARE_METATYPE(QImageEncoderSettings) -QT_END_HEADER - #endif diff --git a/src/multimedia/recording/qmediarecorder.h b/src/multimedia/recording/qmediarecorder.h index 7c019d724..af8f86ebd 100644 --- a/src/multimedia/recording/qmediarecorder.h +++ b/src/multimedia/recording/qmediarecorder.h @@ -50,8 +50,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QUrl; @@ -224,6 +222,4 @@ Q_MEDIA_ENUM_DEBUG(QMediaRecorder, State) Q_MEDIA_ENUM_DEBUG(QMediaRecorder, Status) Q_MEDIA_ENUM_DEBUG(QMediaRecorder, Error) -QT_END_HEADER - #endif // QMEDIARECORDER_H diff --git a/src/multimedia/video/qabstractvideobuffer.h b/src/multimedia/video/qabstractvideobuffer.h index b3b0644f4..ebacb05e3 100644 --- a/src/multimedia/video/qabstractvideobuffer.h +++ b/src/multimedia/video/qabstractvideobuffer.h @@ -48,8 +48,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -112,6 +110,4 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(QAbstractVideoBuffer::HandleType) Q_DECLARE_METATYPE(QAbstractVideoBuffer::MapMode) -QT_END_HEADER - #endif diff --git a/src/multimedia/video/qabstractvideobuffer_p.h b/src/multimedia/video/qabstractvideobuffer_p.h index 5b355ff1b..6accfbbd8 100644 --- a/src/multimedia/video/qabstractvideobuffer_p.h +++ b/src/multimedia/video/qabstractvideobuffer_p.h @@ -60,8 +60,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QAbstractVideoBufferPrivate @@ -76,7 +74,5 @@ public: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimedia/video/qabstractvideosurface.h b/src/multimedia/video/qabstractvideosurface.h index bd634f6d5..ab87b7c70 100644 --- a/src/multimedia/video/qabstractvideosurface.h +++ b/src/multimedia/video/qabstractvideosurface.h @@ -45,8 +45,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QRectF; @@ -113,6 +111,4 @@ QT_END_NAMESPACE Q_DECLARE_METATYPE(QAbstractVideoSurface*) Q_DECLARE_METATYPE(QAbstractVideoSurface::Error) -QT_END_HEADER - #endif diff --git a/src/multimedia/video/qimagevideobuffer_p.h b/src/multimedia/video/qimagevideobuffer_p.h index 99f09b569..0acdd3e42 100644 --- a/src/multimedia/video/qimagevideobuffer_p.h +++ b/src/multimedia/video/qimagevideobuffer_p.h @@ -55,8 +55,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -79,7 +77,5 @@ public: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimedia/video/qmemoryvideobuffer_p.h b/src/multimedia/video/qmemoryvideobuffer_p.h index d34be47f3..7b21e767e 100644 --- a/src/multimedia/video/qmemoryvideobuffer_p.h +++ b/src/multimedia/video/qmemoryvideobuffer_p.h @@ -55,10 +55,6 @@ // We mean it. // -QT_BEGIN_HEADER - -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -79,9 +75,5 @@ public: QT_END_NAMESPACE -QT_END_HEADER - - -QT_END_HEADER #endif diff --git a/src/multimedia/video/qvideoframe.h b/src/multimedia/video/qvideoframe.h index 84a048e22..6bc24db14 100644 --- a/src/multimedia/video/qvideoframe.h +++ b/src/multimedia/video/qvideoframe.h @@ -48,8 +48,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QSize; @@ -177,7 +175,5 @@ Q_DECLARE_METATYPE(QVideoFrame) Q_DECLARE_METATYPE(QVideoFrame::FieldType) Q_DECLARE_METATYPE(QVideoFrame::PixelFormat) -QT_END_HEADER - #endif diff --git a/src/multimedia/video/qvideoprobe.h b/src/multimedia/video/qvideoprobe.h index e7718c603..de585d7b2 100644 --- a/src/multimedia/video/qvideoprobe.h +++ b/src/multimedia/video/qvideoprobe.h @@ -45,8 +45,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QMediaObject; @@ -75,6 +73,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // QVIDEOPROBE_H diff --git a/src/multimedia/video/qvideosurfaceformat.h b/src/multimedia/video/qvideosurfaceformat.h index 617eccaa3..689ed506e 100644 --- a/src/multimedia/video/qvideosurfaceformat.h +++ b/src/multimedia/video/qvideosurfaceformat.h @@ -49,8 +49,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -143,7 +141,5 @@ Q_DECLARE_METATYPE(QVideoSurfaceFormat) Q_DECLARE_METATYPE(QVideoSurfaceFormat::Direction) Q_DECLARE_METATYPE(QVideoSurfaceFormat::YCbCrColorSpace) -QT_END_HEADER - #endif diff --git a/src/multimedia/video/qvideosurfaceoutput_p.h b/src/multimedia/video/qvideosurfaceoutput_p.h index 741f6325b..0b74d5939 100644 --- a/src/multimedia/video/qvideosurfaceoutput_p.h +++ b/src/multimedia/video/qvideosurfaceoutput_p.h @@ -47,8 +47,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -79,7 +77,5 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimediawidgets/qcameraviewfinder.h b/src/multimediawidgets/qcameraviewfinder.h index 134ec4186..14585b89a 100644 --- a/src/multimediawidgets/qcameraviewfinder.h +++ b/src/multimediawidgets/qcameraviewfinder.h @@ -53,8 +53,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -80,7 +78,5 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // QCAMERA_H diff --git a/src/multimediawidgets/qeglimagetexturesurface_p.h b/src/multimediawidgets/qeglimagetexturesurface_p.h index 011971f0c..ca06b7984 100644 --- a/src/multimediawidgets/qeglimagetexturesurface_p.h +++ b/src/multimediawidgets/qeglimagetexturesurface_p.h @@ -65,8 +65,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QGLContext; @@ -142,7 +140,5 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimediawidgets/qgraphicsvideoitem.h b/src/multimediawidgets/qgraphicsvideoitem.h index 6137846b7..910925a47 100644 --- a/src/multimediawidgets/qgraphicsvideoitem.h +++ b/src/multimediawidgets/qgraphicsvideoitem.h @@ -47,8 +47,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QVideoSurfaceFormat; @@ -107,7 +105,5 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimediawidgets/qpaintervideosurface_mac_p.h b/src/multimediawidgets/qpaintervideosurface_mac_p.h index b1d56dcd3..a81ed7fd3 100644 --- a/src/multimediawidgets/qpaintervideosurface_mac_p.h +++ b/src/multimediawidgets/qpaintervideosurface_mac_p.h @@ -57,8 +57,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -95,6 +93,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimediawidgets/qpaintervideosurface_p.h b/src/multimediawidgets/qpaintervideosurface_p.h index 007cad44e..671769bb0 100644 --- a/src/multimediawidgets/qpaintervideosurface_p.h +++ b/src/multimediawidgets/qpaintervideosurface_p.h @@ -61,8 +61,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class QGLContext; @@ -181,7 +179,5 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QPainterVideoSurface::ShaderTypes) QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimediawidgets/qtmultimediawidgetdefs.h b/src/multimediawidgets/qtmultimediawidgetdefs.h index b5da320ff..83e150fd0 100644 --- a/src/multimediawidgets/qtmultimediawidgetdefs.h +++ b/src/multimediawidgets/qtmultimediawidgetdefs.h @@ -55,7 +55,6 @@ #include -QT_BEGIN_HEADER QT_BEGIN_NAMESPACE #ifndef QT_STATIC @@ -69,7 +68,6 @@ QT_BEGIN_NAMESPACE #endif QT_END_NAMESPACE -QT_END_HEADER #endif // QMULTIMEDIAWIDGETS_P_H diff --git a/src/multimediawidgets/qvideowidget.h b/src/multimediawidgets/qvideowidget.h index 8ffaffb0f..f9fae32ce 100644 --- a/src/multimediawidgets/qvideowidget.h +++ b/src/multimediawidgets/qvideowidget.h @@ -47,8 +47,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -131,7 +129,5 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimediawidgets/qvideowidget_p.h b/src/multimediawidgets/qvideowidget_p.h index 6d968ed86..04a3ca180 100644 --- a/src/multimediawidgets/qvideowidget_p.h +++ b/src/multimediawidgets/qvideowidget_p.h @@ -64,8 +64,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -282,7 +280,5 @@ public: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/multimediawidgets/qvideowidgetcontrol.h b/src/multimediawidgets/qvideowidgetcontrol.h index 872621094..66736c62b 100644 --- a/src/multimediawidgets/qvideowidgetcontrol.h +++ b/src/multimediawidgets/qvideowidgetcontrol.h @@ -47,8 +47,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -97,7 +95,5 @@ Q_MEDIA_DECLARE_CONTROL(QVideoWidgetControl, QVideoWidgetControl_iid) QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/plugins/directshow/camera/dscameracontrol.h b/src/plugins/directshow/camera/dscameracontrol.h index d36f70c35..216ac744c 100644 --- a/src/plugins/directshow/camera/dscameracontrol.h +++ b/src/plugins/directshow/camera/dscameracontrol.h @@ -45,8 +45,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class DSCameraService; @@ -87,8 +85,6 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/plugins/directshow/camera/dscameraservice.h b/src/plugins/directshow/camera/dscameraservice.h index f86c34226..31c35c6d1 100644 --- a/src/plugins/directshow/camera/dscameraservice.h +++ b/src/plugins/directshow/camera/dscameraservice.h @@ -46,8 +46,6 @@ #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class DSCameraControl; @@ -85,6 +83,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/plugins/directshow/camera/dscamerasession.h b/src/plugins/directshow/camera/dscamerasession.h index 592bba3f1..c02a99098 100644 --- a/src/plugins/directshow/camera/dscamerasession.h +++ b/src/plugins/directshow/camera/dscamerasession.h @@ -70,8 +70,6 @@ struct ICaptureGraphBuilder2; struct ISampleGrabber; -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class DSVideoRenderer; @@ -202,7 +200,5 @@ protected: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/plugins/directshow/camera/dsimagecapturecontrol.h b/src/plugins/directshow/camera/dsimagecapturecontrol.h index abde36208..ff8dc9bff 100644 --- a/src/plugins/directshow/camera/dsimagecapturecontrol.h +++ b/src/plugins/directshow/camera/dsimagecapturecontrol.h @@ -45,8 +45,6 @@ #include #include "dscamerasession.h" -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class DSImageCaptureControl : public QCameraImageCaptureControl @@ -75,6 +73,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // DSCAPTURECONTROL_H diff --git a/src/plugins/directshow/camera/dsvideodevicecontrol.h b/src/plugins/directshow/camera/dsvideodevicecontrol.h index f6c9dbbd2..74635ddb2 100644 --- a/src/plugins/directshow/camera/dsvideodevicecontrol.h +++ b/src/plugins/directshow/camera/dsvideodevicecontrol.h @@ -45,8 +45,6 @@ #include #include -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class DSCameraSession; @@ -80,6 +78,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif diff --git a/src/plugins/directshow/camera/dsvideorenderer.h b/src/plugins/directshow/camera/dsvideorenderer.h index 2fc08a7b0..518384917 100644 --- a/src/plugins/directshow/camera/dsvideorenderer.h +++ b/src/plugins/directshow/camera/dsvideorenderer.h @@ -47,8 +47,6 @@ class CameraFormatConverter; -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE @@ -72,6 +70,4 @@ private: QT_END_NAMESPACE -QT_END_HEADER - #endif // DSVIDEORENDERER_H diff --git a/src/plugins/directshow/camera/dsvideowidgetcontrol.h b/src/plugins/directshow/camera/dsvideowidgetcontrol.h index 9249c3178..16207d3f6 100644 --- a/src/plugins/directshow/camera/dsvideowidgetcontrol.h +++ b/src/plugins/directshow/camera/dsvideowidgetcontrol.h @@ -51,8 +51,6 @@ #include #include "dscameracontrol.h" -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class DSVideoWidgetSurface : public QAbstractVideoSurface @@ -149,6 +147,4 @@ private: // Data QT_END_NAMESPACE -QT_END_HEADER - #endif // DSVideoWidgetControl_H diff --git a/tests/auto/unit/qmultimedia_common/mockaudiodecodercontrol.h b/tests/auto/unit/qmultimedia_common/mockaudiodecodercontrol.h index 1d44fed47..dbc0ac758 100644 --- a/tests/auto/unit/qmultimedia_common/mockaudiodecodercontrol.h +++ b/tests/auto/unit/qmultimedia_common/mockaudiodecodercontrol.h @@ -53,8 +53,6 @@ #define MOCK_DECODER_MAX_BUFFERS 10 -QT_BEGIN_HEADER - QT_BEGIN_NAMESPACE class MockAudioDecoderControl : public QAudioDecoderControl @@ -218,6 +216,4 @@ public: QT_END_NAMESPACE -QT_END_HEADER - #endif // QAUDIODECODERCONTROL_H -- cgit v1.2.3 From a0707d50cd792a6fd75b28fd0dd80b9801fc0990 Mon Sep 17 00:00:00 2001 From: Tobias Koenig Date: Thu, 31 Jan 2013 09:53:51 +0100 Subject: Blackberry: Refactor plugin directory structure Move the mediaplayer related code in its own subdirectory. This is a preparation for adding camera support in the future. Change-Id: I880ff90e154165c2a3a31fd2b51e1dd224fea8fd Reviewed-by: Thomas McGuire --- src/plugins/blackberry/bbserviceplugin.cpp | 69 +++ src/plugins/blackberry/bbserviceplugin.h | 65 +++ src/plugins/blackberry/blackberry.pro | 16 +- .../blackberry/blackberry_mediaservice.json | 3 + .../mediaplayer/bbmediaplayercontrol.cpp | 616 +++++++++++++++++++++ .../blackberry/mediaplayer/bbmediaplayercontrol.h | 155 ++++++ .../mediaplayer/bbmediaplayerservice.cpp | 96 ++++ .../blackberry/mediaplayer/bbmediaplayerservice.h | 71 +++ src/plugins/blackberry/mediaplayer/bbmetadata.cpp | 164 ++++++ src/plugins/blackberry/mediaplayer/bbmetadata.h | 74 +++ src/plugins/blackberry/mediaplayer/bbutil.cpp | 100 ++++ src/plugins/blackberry/mediaplayer/bbutil.h | 56 ++ .../mediaplayer/bbvideowindowcontrol.cpp | 415 ++++++++++++++ .../blackberry/mediaplayer/bbvideowindowcontrol.h | 121 ++++ src/plugins/blackberry/mediaplayer/mediaplayer.pri | 17 + .../mediaservice/bbmediaplayercontrol.cpp | 616 --------------------- .../blackberry/mediaservice/bbmediaplayercontrol.h | 155 ------ .../mediaservice/bbmediaplayerservice.cpp | 96 ---- .../blackberry/mediaservice/bbmediaplayerservice.h | 71 --- src/plugins/blackberry/mediaservice/bbmetadata.cpp | 164 ------ src/plugins/blackberry/mediaservice/bbmetadata.h | 74 --- .../blackberry/mediaservice/bbserviceplugin.cpp | 69 --- .../blackberry/mediaservice/bbserviceplugin.h | 65 --- src/plugins/blackberry/mediaservice/bbutil.cpp | 100 ---- src/plugins/blackberry/mediaservice/bbutil.h | 56 -- .../mediaservice/bbvideowindowcontrol.cpp | 415 -------------- .../blackberry/mediaservice/bbvideowindowcontrol.h | 121 ---- .../mediaservice/blackberry_mediaservice.json | 3 - .../blackberry/mediaservice/mediaservice.pro | 26 - 29 files changed, 2035 insertions(+), 2034 deletions(-) create mode 100644 src/plugins/blackberry/bbserviceplugin.cpp create mode 100644 src/plugins/blackberry/bbserviceplugin.h create mode 100644 src/plugins/blackberry/blackberry_mediaservice.json create mode 100644 src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.cpp create mode 100644 src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.h create mode 100644 src/plugins/blackberry/mediaplayer/bbmediaplayerservice.cpp create mode 100644 src/plugins/blackberry/mediaplayer/bbmediaplayerservice.h create mode 100644 src/plugins/blackberry/mediaplayer/bbmetadata.cpp create mode 100644 src/plugins/blackberry/mediaplayer/bbmetadata.h create mode 100644 src/plugins/blackberry/mediaplayer/bbutil.cpp create mode 100644 src/plugins/blackberry/mediaplayer/bbutil.h create mode 100644 src/plugins/blackberry/mediaplayer/bbvideowindowcontrol.cpp create mode 100644 src/plugins/blackberry/mediaplayer/bbvideowindowcontrol.h create mode 100644 src/plugins/blackberry/mediaplayer/mediaplayer.pri delete mode 100644 src/plugins/blackberry/mediaservice/bbmediaplayercontrol.cpp delete mode 100644 src/plugins/blackberry/mediaservice/bbmediaplayercontrol.h delete mode 100644 src/plugins/blackberry/mediaservice/bbmediaplayerservice.cpp delete mode 100644 src/plugins/blackberry/mediaservice/bbmediaplayerservice.h delete mode 100644 src/plugins/blackberry/mediaservice/bbmetadata.cpp delete mode 100644 src/plugins/blackberry/mediaservice/bbmetadata.h delete mode 100644 src/plugins/blackberry/mediaservice/bbserviceplugin.cpp delete mode 100644 src/plugins/blackberry/mediaservice/bbserviceplugin.h delete mode 100644 src/plugins/blackberry/mediaservice/bbutil.cpp delete mode 100644 src/plugins/blackberry/mediaservice/bbutil.h delete mode 100644 src/plugins/blackberry/mediaservice/bbvideowindowcontrol.cpp delete mode 100644 src/plugins/blackberry/mediaservice/bbvideowindowcontrol.h delete mode 100644 src/plugins/blackberry/mediaservice/blackberry_mediaservice.json delete mode 100644 src/plugins/blackberry/mediaservice/mediaservice.pro diff --git a/src/plugins/blackberry/bbserviceplugin.cpp b/src/plugins/blackberry/bbserviceplugin.cpp new file mode 100644 index 000000000..92dc4aee4 --- /dev/null +++ b/src/plugins/blackberry/bbserviceplugin.cpp @@ -0,0 +1,69 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "bbserviceplugin.h" +#include "bbmediaplayerservice.h" + +QT_BEGIN_NAMESPACE + +BbServicePlugin::BbServicePlugin() +{ +} + +QMediaService *BbServicePlugin::create(const QString &key) +{ + if (key == QLatin1String(Q_MEDIASERVICE_MEDIAPLAYER)) + return new BbMediaPlayerService(); + + return 0; +} + +void BbServicePlugin::release(QMediaService *service) +{ + delete service; +} + +QMediaServiceProviderHint::Features BbServicePlugin::supportedFeatures(const QByteArray &service) const +{ + Q_UNUSED(service) + return QMediaServiceProviderHint::Features(); +} + +QT_END_NAMESPACE diff --git a/src/plugins/blackberry/bbserviceplugin.h b/src/plugins/blackberry/bbserviceplugin.h new file mode 100644 index 000000000..dbf507f10 --- /dev/null +++ b/src/plugins/blackberry/bbserviceplugin.h @@ -0,0 +1,65 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BBRSERVICEPLUGIN_H +#define BBRSERVICEPLUGIN_H + +#include + +QT_BEGIN_NAMESPACE + +class BbServicePlugin + : public QMediaServiceProviderPlugin, + public QMediaServiceFeaturesInterface +{ + Q_OBJECT + Q_INTERFACES(QMediaServiceFeaturesInterface) + Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "blackberry_mediaservice.json") +public: + BbServicePlugin(); + + QMediaService *create(const QString &key) Q_DECL_OVERRIDE; + void release(QMediaService *service) Q_DECL_OVERRIDE; + QMediaServiceProviderHint::Features supportedFeatures(const QByteArray &service) const Q_DECL_OVERRIDE; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/blackberry/blackberry.pro b/src/plugins/blackberry/blackberry.pro index a03476523..ef414d7eb 100644 --- a/src/plugins/blackberry/blackberry.pro +++ b/src/plugins/blackberry/blackberry.pro @@ -1,5 +1,15 @@ -TEMPLATE = subdirs +TARGET = qtmedia_blackberry +QT += multimedia-private gui-private -SUBDIRS += \ - mediaservice +PLUGIN_TYPE=mediaservice +PLUGIN_CLASS_NAME = BbServicePlugin +load(qt_plugin) +LIBS += -lscreen + +HEADERS += bbserviceplugin.h +SOURCES += bbserviceplugin.cpp + +include(mediaplayer/mediaplayer.pri) + +OTHER_FILES += blackberry_mediaservice.json diff --git a/src/plugins/blackberry/blackberry_mediaservice.json b/src/plugins/blackberry/blackberry_mediaservice.json new file mode 100644 index 000000000..c4a27ea01 --- /dev/null +++ b/src/plugins/blackberry/blackberry_mediaservice.json @@ -0,0 +1,3 @@ +{ + "Keys": ["org.qt-project.qt.mediaplayer"] +} diff --git a/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.cpp b/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.cpp new file mode 100644 index 000000000..41d3bc479 --- /dev/null +++ b/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.cpp @@ -0,0 +1,616 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "bbmediaplayercontrol.h" +#include "bbvideowindowcontrol.h" +#include "bbutil.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +static int idCounter = 0; + +BbMediaPlayerControl::BbMediaPlayerControl(QObject *parent) + : QMediaPlayerControl(parent), + m_connection(0), + m_context(0), + m_audioId(-1), + m_state(QMediaPlayer::StoppedState), + m_volume(100), + m_muted(false), + m_rate(1), + m_id(-1), + m_eventMonitor(0), + m_position(0), + m_mediaStatus(QMediaPlayer::NoMedia), + m_playAfterMediaLoaded(false), + m_inputAttached(false), + m_stopEventsToIgnore(0), + m_bufferStatus(0) +{ + m_loadingTimer.setSingleShot(true); + m_loadingTimer.setInterval(0); + connect(&m_loadingTimer, SIGNAL(timeout()), this, SLOT(continueLoadMedia())); + QCoreApplication::eventDispatcher()->installNativeEventFilter(this); + openConnection(); +} + +BbMediaPlayerControl::~BbMediaPlayerControl() +{ + stop(); + detach(); + closeConnection(); + QCoreApplication::eventDispatcher()->removeNativeEventFilter(this); +} + +void BbMediaPlayerControl::openConnection() +{ + m_connection = mmr_connect(NULL); + if (!m_connection) { + emitPError("Unable to connect to the multimedia renderer"); + return; + } + + m_id = idCounter++; + m_contextName = QString("BbMediaPlayerControl_%1_%2").arg(m_id) + .arg(QCoreApplication::applicationPid()); + m_context = mmr_context_create(m_connection, m_contextName.toLatin1(), + 0, S_IRWXU|S_IRWXG|S_IRWXO); + if (!m_context) { + emitPError("Unable to create context"); + closeConnection(); + return; + } + + m_eventMonitor = mmrenderer_request_events(m_contextName.toLatin1(), 0, m_id); + if (!m_eventMonitor) { + qDebug() << "Unable to request multimedia events"; + emit error(0, "Unable to request multimedia events"); + } +} + +void BbMediaPlayerControl::closeConnection() +{ + if (m_eventMonitor) { + mmrenderer_stop_events(m_eventMonitor); + m_eventMonitor = 0; + } + + if (m_context) { + mmr_context_destroy(m_context); + m_context = 0; + m_contextName.clear(); + } + + if (m_connection) { + mmr_disconnect(m_connection); + m_connection = 0; + } +} + +QString BbMediaPlayerControl::resourcePathForUrl(const QUrl &url) +{ + // If this is a local file, mmrenderer expects the file:// prefix and an absolute path. + // We treat URLs without scheme as local files, most likely someone just forgot to set the + // file:// prefix when constructing the URL. + if (url.isLocalFile() || url.scheme().isEmpty()) { + QString relativeFilePath; + if (!url.scheme().isEmpty()) + relativeFilePath = url.toLocalFile(); + else + relativeFilePath = url.path(); + const QFileInfo fileInfo(relativeFilePath); + return QStringLiteral("file://") + fileInfo.absoluteFilePath(); + + // QRC, copy to temporary file, as mmrenderer does not support resource files + } else if (url.scheme() == QStringLiteral("qrc")) { + const QString qrcPath = ':' + url.path(); + const QFileInfo resourceFileInfo(qrcPath); + m_tempMediaFileName = QDir::tempPath() + QStringLiteral("/qtmedia_") + + QUuid::createUuid().toString() + QStringLiteral(".") + + resourceFileInfo.suffix(); + if (!QFile::copy(qrcPath, m_tempMediaFileName)) { + const QString errorMsg = + QString("Failed to copy resource file to temporary file %1 for playback").arg(m_tempMediaFileName); + qDebug() << errorMsg; + emit error(0, errorMsg); + return QString(); + } + return m_tempMediaFileName; + + // HTTP or similar URL, use as-is + } else { + return url.toString(); + } +} + +void BbMediaPlayerControl::attach() +{ + // Should only be called in detached state + Q_ASSERT(m_audioId == -1 && !m_inputAttached && m_tempMediaFileName.isEmpty()); + + if (m_media.isNull() || !m_context) { + setMediaStatus(QMediaPlayer::NoMedia); + return; + } + + if (m_videoControl) + m_videoControl->attachDisplay(m_context); + + m_audioId = mmr_output_attach(m_context, "audio:default", "audio"); + if (m_audioId == -1) { + emitMmError("mmr_output_attach() for audio failed"); + return; + } + + const QString resourcePath = resourcePathForUrl(m_media.canonicalUrl()); + if (resourcePath.isEmpty()) { + detach(); + return; + } + + if (mmr_input_attach(m_context, QFile::encodeName(resourcePath), "track") != 0) { + emitMmError(QString("mmr_input_attach() for %1 failed").arg(resourcePath)); + setMediaStatus(QMediaPlayer::InvalidMedia); + detach(); + return; + } + + // For whatever reason, the mmrenderer sends out a MMR_STOPPED event when calling + // mmr_input_attach() above. Ignore it, as otherwise we'll trigger stopping right after we + // started. + m_stopEventsToIgnore++; + + m_inputAttached = true; + setMediaStatus(QMediaPlayer::LoadedMedia); + m_bufferStatus = 0; + emit bufferStatusChanged(m_bufferStatus); +} + +void BbMediaPlayerControl::detach() +{ + if (m_context) { + if (m_inputAttached) { + mmr_input_detach(m_context); + m_inputAttached = false; + } + if (m_videoControl) + m_videoControl->detachDisplay(); + if (m_audioId != -1 && m_context) { + mmr_output_detach(m_context, m_audioId); + m_audioId = -1; + } + } + + if (!m_tempMediaFileName.isEmpty()) { + QFile::remove(m_tempMediaFileName); + m_tempMediaFileName.clear(); + } + m_loadingTimer.stop(); +} + +QMediaPlayer::State BbMediaPlayerControl::state() const +{ + return m_state; +} + +QMediaPlayer::MediaStatus BbMediaPlayerControl::mediaStatus() const +{ + return m_mediaStatus; +} + +qint64 BbMediaPlayerControl::duration() const +{ + return m_metaData.duration(); +} + +qint64 BbMediaPlayerControl::position() const +{ + return m_position; +} + +void BbMediaPlayerControl::setPosition(qint64 position) +{ + if (m_position != position) { + m_position = position; + + // Don't update in stopped state, it would not have any effect. Instead, the position is + // updated in play(). + if (m_state != QMediaPlayer::StoppedState) + setPositionInternal(m_position); + + emit positionChanged(m_position); + } +} + +int BbMediaPlayerControl::volume() const +{ + return m_volume; +} + +void BbMediaPlayerControl::setVolumeInternal(int newVolume) +{ + if (!m_context) + return; + + newVolume = qBound(0, newVolume, 100); + if (m_audioId != -1) { + strm_dict_t * dict = strm_dict_new(); + dict = strm_dict_set(dict, "volume", QString::number(newVolume).toLatin1()); + if (mmr_output_parameters(m_context, m_audioId, dict) != 0) + emitMmError("mmr_output_parameters: Setting volume failed"); + } +} + +void BbMediaPlayerControl::setPlaybackRateInternal(qreal rate) +{ + if (!m_context) + return; + + const int mmRate = rate * 1000; + if (mmr_speed_set(m_context, mmRate) != 0) + emitMmError("mmr_speed_set failed"); +} + +void BbMediaPlayerControl::setPositionInternal(qint64 position) +{ + if (!m_context) + return; + + if (mmr_seek(m_context, QString::number(position).toLatin1()) != 0) + emitMmError("Seeking failed"); +} + +void BbMediaPlayerControl::setMediaStatus(QMediaPlayer::MediaStatus status) +{ + if (m_mediaStatus != status) { + m_mediaStatus = status; + emit mediaStatusChanged(m_mediaStatus); + } +} + +void BbMediaPlayerControl::setState(QMediaPlayer::State state) +{ + if (m_state != state) { + m_state = state; + emit stateChanged(m_state); + } +} + +void BbMediaPlayerControl::stopInternal(StopCommand stopCommand) +{ + if (m_state != QMediaPlayer::StoppedState) { + + if (stopCommand == StopMmRenderer) { + ++m_stopEventsToIgnore; + mmr_stop(m_context); + } + + setState(QMediaPlayer::StoppedState); + } + + if (m_position != 0) { + m_position = 0; + emit positionChanged(0); + } +} + +void BbMediaPlayerControl::setVolume(int volume) +{ + const int newVolume = qBound(0, volume, 100); + if (m_volume != newVolume) { + m_volume = newVolume; + if (!m_muted) + setVolumeInternal(m_volume); + emit volumeChanged(m_volume); + } +} + +bool BbMediaPlayerControl::isMuted() const +{ + return m_muted; +} + +void BbMediaPlayerControl::setMuted(bool muted) +{ + if (m_muted != muted) { + m_muted = muted; + setVolumeInternal(muted ? 0 : m_volume); + emit mutedChanged(muted); + } +} + +int BbMediaPlayerControl::bufferStatus() const +{ + return m_bufferStatus; +} + +bool BbMediaPlayerControl::isAudioAvailable() const +{ + return m_metaData.hasAudio(); +} + +bool BbMediaPlayerControl::isVideoAvailable() const +{ + return m_metaData.hasVideo(); +} + +bool BbMediaPlayerControl::isSeekable() const +{ + // We can currently not get that information from the mmrenderer API. Just pretend we can seek, + // it will fail at runtime if we can not. + return true; +} + +QMediaTimeRange BbMediaPlayerControl::availablePlaybackRanges() const +{ + // We can't get this information from the mmrenderer API yet, so pretend we can seek everywhere + return QMediaTimeRange(0, m_metaData.duration()); +} + +qreal BbMediaPlayerControl::playbackRate() const +{ + return m_rate; +} + +void BbMediaPlayerControl::setPlaybackRate(qreal rate) +{ + if (m_rate != rate) { + m_rate = rate; + setPlaybackRateInternal(m_rate); + emit playbackRateChanged(m_rate); + } +} + +QMediaContent BbMediaPlayerControl::media() const +{ + return m_media; +} + +const QIODevice *BbMediaPlayerControl::mediaStream() const +{ + // Always 0, we don't support QIODevice streams + return 0; +} + +void BbMediaPlayerControl::setMedia(const QMediaContent &media, QIODevice *stream) +{ + Q_UNUSED(stream); // not supported + + stop(); + detach(); + + m_media = media; + emit mediaChanged(m_media); + + // Slight hack: With MediaPlayer QtQuick elements that have autoPlay set to true, playback + // would start before the QtQuick canvas is propagated to all elements, and therefore our + // video output would not work. Therefore, delay actually playing the media a bit so that the + // canvas is ready. + // The mmrenderer doesn't allow to attach video outputs after playing has started, otherwise + // this would be unnecessary. + if (!m_media.isNull()) { + setMediaStatus(QMediaPlayer::LoadingMedia); + m_loadingTimer.start(); // singleshot timer to continueLoadMedia() + } else { + continueLoadMedia(); // still needed, as it will update the media status and clear metadata + } +} + +void BbMediaPlayerControl::continueLoadMedia() +{ + attach(); + updateMetaData(); + if (m_playAfterMediaLoaded) + play(); +} + +void BbMediaPlayerControl::play() +{ + if (m_playAfterMediaLoaded) + m_playAfterMediaLoaded = false; + + // No-op if we are already playing, except if we were called from continueLoadMedia(), in which + // case m_playAfterMediaLoaded is true (hence the 'else'). + else if (m_state == QMediaPlayer::PlayingState) + return; + + if (m_mediaStatus == QMediaPlayer::LoadingMedia) { + + // State changes are supposed to be synchronous + setState(QMediaPlayer::PlayingState); + + // Defer playing to later, when the timer triggers continueLoadMedia() + m_playAfterMediaLoaded = true; + return; + } + + // Un-pause the state when it is paused + if (m_state == QMediaPlayer::PausedState) { + setPlaybackRateInternal(m_rate); + setState(QMediaPlayer::PlayingState); + return; + } + + if (m_media.isNull() || !m_connection || !m_context || m_audioId == -1) { + setState(QMediaPlayer::StoppedState); + return; + } + + setPositionInternal(m_position); + setVolumeInternal(m_volume); + setPlaybackRateInternal(m_rate); + + if (mmr_play(m_context) != 0) { + setState(QMediaPlayer::StoppedState); + emitMmError("mmr_play() failed"); + return; + } + + setState( QMediaPlayer::PlayingState); +} + +void BbMediaPlayerControl::pause() +{ + if (m_state == QMediaPlayer::PlayingState) { + setPlaybackRateInternal(0); + setState(QMediaPlayer::PausedState); + } +} + +void BbMediaPlayerControl::stop() +{ + stopInternal(StopMmRenderer); +} + +void BbMediaPlayerControl::setVideoControl(BbVideoWindowControl *videoControl) +{ + m_videoControl = videoControl; +} + +bool BbMediaPlayerControl::nativeEventFilter(const QByteArray &eventType, void *message, long *result) +{ + Q_UNUSED(eventType); + Q_UNUSED(result); + + bps_event_t * const event = static_cast(message); + if (!event || + (bps_event_get_domain(event) != mmrenderer_get_domain() && + bps_event_get_domain(event) != screen_get_domain())) + return false; + + if (m_videoControl) + m_videoControl->bpsEventHandler(event); + + if (bps_event_get_domain(event) == mmrenderer_get_domain()) { + if (bps_event_get_code(event) == MMRENDERER_STATE_CHANGE) { + const mmrenderer_state_t newState = mmrenderer_event_get_state(event); + if (newState == MMR_STOPPED) { + + // Only react to stop events that happen when the end of the stream is reached and + // playback is stopped because of this. + // Ignore other stop event sources, souch as calling mmr_stop() ourselves and + // mmr_input_attach(). + if (m_stopEventsToIgnore > 0) { + --m_stopEventsToIgnore; + } else { + setMediaStatus(QMediaPlayer::EndOfMedia); + stopInternal(IgnoreMmRenderer); + } + return false; + } + } + + if (bps_event_get_code(event) == MMRENDERER_STATUS_UPDATE) { + + // Prevent spurious position change events from overriding our own position, for example + // when setting the position to 0 in stop(). + // Also, don't change the position while we're loading the media, as then play() would + // set a wrong initial position. + if (m_state != QMediaPlayer::PlayingState || + m_mediaStatus == QMediaPlayer::LoadingMedia || + m_mediaStatus == QMediaPlayer::NoMedia || + m_mediaStatus == QMediaPlayer::InvalidMedia) + return false; + + const qint64 newPosition = QString::fromLatin1(mmrenderer_event_get_position(event)).toLongLong(); + if (newPosition != 0 && newPosition != m_position) { + m_position = newPosition; + emit positionChanged(m_position); + } + + const QString bufferStatus = QString::fromLatin1(mmrenderer_event_get_bufferlevel(event)); + const int slashPos = bufferStatus.indexOf('/'); + if (slashPos != -1) { + const int fill = bufferStatus.left(slashPos).toInt(); + const int capacity = bufferStatus.mid(slashPos + 1).toInt(); + if (capacity != 0) { + m_bufferStatus = fill / static_cast(capacity) * 100.0f; + emit bufferStatusChanged(m_bufferStatus); + } + } + } + } + + return false; +} + +void BbMediaPlayerControl::updateMetaData() +{ + if (m_mediaStatus == QMediaPlayer::LoadedMedia) + m_metaData.parse(m_contextName); + else + m_metaData.clear(); + + if (m_videoControl) + m_videoControl->setMetaData(m_metaData); + + emit durationChanged(m_metaData.duration()); + emit audioAvailableChanged(m_metaData.hasAudio()); + emit videoAvailableChanged(m_metaData.hasVideo()); + emit availablePlaybackRangesChanged(availablePlaybackRanges()); +} + +void BbMediaPlayerControl::emitMmError(const QString &msg) +{ + int errorCode = MMR_ERROR_NONE; + const QString errorMessage = mmErrorMessage(msg, m_context, &errorCode); + qDebug() << errorMessage; + emit error(errorCode, errorMessage); +} + +void BbMediaPlayerControl::emitPError(const QString &msg) +{ + const QString errorMessage = QString("%1: %2").arg(msg).arg(strerror(errno)); + qDebug() << errorMessage; + emit error(errno, errorMessage); +} + +QT_END_NAMESPACE diff --git a/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.h b/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.h new file mode 100644 index 000000000..eb87ea872 --- /dev/null +++ b/src/plugins/blackberry/mediaplayer/bbmediaplayercontrol.h @@ -0,0 +1,155 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BBMEDIAPLAYERCONTROL_H +#define BBMEDIAPLAYERCONTROL_H + +#include "bbmetadata.h" +#include +#include +#include +#include + +struct bps_event_t; +typedef struct mmr_connection mmr_connection_t; +typedef struct mmr_context mmr_context_t; +typedef struct mmrenderer_monitor mmrenderer_monitor_t; + +QT_BEGIN_NAMESPACE + +class BbVideoWindowControl; + +class BbMediaPlayerControl : public QMediaPlayerControl, public QAbstractNativeEventFilter +{ + Q_OBJECT +public: + explicit BbMediaPlayerControl(QObject *parent = 0); + ~BbMediaPlayerControl(); + + QMediaPlayer::State state() const Q_DECL_OVERRIDE; + + QMediaPlayer::MediaStatus mediaStatus() const Q_DECL_OVERRIDE; + + qint64 duration() const Q_DECL_OVERRIDE; + + qint64 position() const Q_DECL_OVERRIDE; + void setPosition(qint64 position) Q_DECL_OVERRIDE; + + int volume() const Q_DECL_OVERRIDE; + void setVolume(int volume) Q_DECL_OVERRIDE; + + bool isMuted() const Q_DECL_OVERRIDE; + void setMuted(bool muted) Q_DECL_OVERRIDE; + + int bufferStatus() const Q_DECL_OVERRIDE; + + bool isAudioAvailable() const Q_DECL_OVERRIDE; + bool isVideoAvailable() const Q_DECL_OVERRIDE; + + bool isSeekable() const Q_DECL_OVERRIDE; + + QMediaTimeRange availablePlaybackRanges() const Q_DECL_OVERRIDE; + + qreal playbackRate() const Q_DECL_OVERRIDE; + void setPlaybackRate(qreal rate) Q_DECL_OVERRIDE; + + QMediaContent media() const Q_DECL_OVERRIDE; + const QIODevice *mediaStream() const Q_DECL_OVERRIDE; + void setMedia(const QMediaContent &media, QIODevice *stream) Q_DECL_OVERRIDE; + + void play() Q_DECL_OVERRIDE; + void pause() Q_DECL_OVERRIDE; + void stop() Q_DECL_OVERRIDE; + + void setVideoControl(BbVideoWindowControl *videoControl); + bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE; + +private Q_SLOTS: + void continueLoadMedia(); + +private: + QString resourcePathForUrl(const QUrl &url); + void openConnection(); + void closeConnection(); + void attach(); + void detach(); + void updateMetaData(); + + void emitMmError(const QString &msg); + void emitPError(const QString &msg); + + // All these set the specified value to the backend, but neither emit changed signals + // nor change the member value. + void setVolumeInternal(int newVolume); + void setPlaybackRateInternal(qreal rate); + void setPositionInternal(qint64 position); + + void setMediaStatus(QMediaPlayer::MediaStatus status); + void setState(QMediaPlayer::State state); + + enum StopCommand { StopMmRenderer, IgnoreMmRenderer }; + void stopInternal(StopCommand stopCommand); + + QMediaContent m_media; + mmr_connection_t *m_connection; + mmr_context_t *m_context; + QString m_contextName; + int m_audioId; + QMediaPlayer::State m_state; + int m_volume; + bool m_muted; + qreal m_rate; + QPointer m_videoControl; + BbMetaData m_metaData; + int m_id; + mmrenderer_monitor_t *m_eventMonitor; + qint64 m_position; + QMediaPlayer::MediaStatus m_mediaStatus; + bool m_playAfterMediaLoaded; + bool m_inputAttached; + int m_stopEventsToIgnore; + int m_bufferStatus; + QString m_tempMediaFileName; + QTimer m_loadingTimer; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/blackberry/mediaplayer/bbmediaplayerservice.cpp b/src/plugins/blackberry/mediaplayer/bbmediaplayerservice.cpp new file mode 100644 index 000000000..8730d2ddc --- /dev/null +++ b/src/plugins/blackberry/mediaplayer/bbmediaplayerservice.cpp @@ -0,0 +1,96 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "bbmediaplayerservice.h" + +#include "bbmediaplayercontrol.h" +#include "bbvideowindowcontrol.h" + +QT_BEGIN_NAMESPACE + +BbMediaPlayerService::BbMediaPlayerService(QObject *parent) + : QMediaService(parent), + m_videoWindowControl(0), + m_mediaPlayerControl(0) +{ +} + +BbMediaPlayerService::~BbMediaPlayerService() +{ + // Someone should have called releaseControl(), but better be safe + delete m_videoWindowControl; + delete m_mediaPlayerControl; +} + +QMediaControl *BbMediaPlayerService::requestControl(const char *name) +{ + if (qstrcmp(name, QMediaPlayerControl_iid) == 0) { + if (!m_mediaPlayerControl) { + m_mediaPlayerControl = new BbMediaPlayerControl(); + updateControls(); + } + return m_mediaPlayerControl; + } + else if (qstrcmp(name, QVideoWindowControl_iid) == 0) { + if (!m_videoWindowControl) { + m_videoWindowControl = new BbVideoWindowControl(); + updateControls(); + } + return m_videoWindowControl; + } + return 0; +} + +void BbMediaPlayerService::releaseControl(QMediaControl *control) +{ + if (control == m_videoWindowControl) + m_videoWindowControl = 0; + if (control == m_mediaPlayerControl) + m_mediaPlayerControl = 0; + delete control; +} + +void BbMediaPlayerService::updateControls() +{ + if (m_videoWindowControl && m_mediaPlayerControl) + m_mediaPlayerControl->setVideoControl(m_videoWindowControl); +} + +QT_END_NAMESPACE diff --git a/src/plugins/blackberry/mediaplayer/bbmediaplayerservice.h b/src/plugins/blackberry/mediaplayer/bbmediaplayerservice.h new file mode 100644 index 000000000..8ff52cd28 --- /dev/null +++ b/src/plugins/blackberry/mediaplayer/bbmediaplayerservice.h @@ -0,0 +1,71 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BBMEDIAPLAYERSERVICE_H +#define BBMEDIAPLAYERSERVICE_H + +#include +#include + +QT_BEGIN_NAMESPACE + +class BbMediaPlayerControl; +class BbVideoWindowControl; + +class BbMediaPlayerService : public QMediaService +{ + Q_OBJECT +public: + explicit BbMediaPlayerService(QObject *parent = 0); + ~BbMediaPlayerService(); + + QMediaControl *requestControl(const char *name) Q_DECL_OVERRIDE; + void releaseControl(QMediaControl *control) Q_DECL_OVERRIDE; + +private: + void updateControls(); + + QPointer m_videoWindowControl; + QPointer m_mediaPlayerControl; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/blackberry/mediaplayer/bbmetadata.cpp b/src/plugins/blackberry/mediaplayer/bbmetadata.cpp new file mode 100644 index 000000000..b34b63e72 --- /dev/null +++ b/src/plugins/blackberry/mediaplayer/bbmetadata.cpp @@ -0,0 +1,164 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "bbmetadata.h" + +#include +#include +#include + +QT_BEGIN_NAMESPACE + +BbMetaData::BbMetaData() +{ + clear(); +} + +static const char * durationKey = "md_title_duration"; +static const char * widthKey = "md_video_width"; +static const char * heightKey = "md_video_height"; +static const char * mediaTypeKey = "md_title_mediatype"; +static const char * pixelWidthKey = "md_video_pixel_height"; +static const char * pixelHeightKey = "md_video_pixel_width"; + +static const int mediaTypeAudioFlag = 4; +static const int mediaTypeVideoFlag = 2; + +bool BbMetaData::parse(const QString &contextName) +{ + clear(); + QString fileName = + QString("/pps/services/multimedia/renderer/context/%1/metadata").arg(contextName); + + // In newer OS versions, the filename is "metadata0", not metadata, so try both. + if (!QFile::exists(fileName)) + fileName += '0'; + + QFile metaDataFile(fileName); + if (!metaDataFile.open(QFile::ReadOnly)) { + qWarning() << "Unable to open media metadata file" << fileName << ":" + << metaDataFile.errorString(); + return false; + } + + const QString separator("::"); + QTextStream stream(&metaDataFile); + Q_FOREVER { + const QString line = stream.readLine(); + if (line.isNull()) + break; + + const int separatorPos = line.indexOf(separator); + if (separatorPos != -1) { + const QString key = line.left(separatorPos); + const QString value = line.mid(separatorPos + separator.length()); + + if (key == durationKey) + m_duration = value.toLongLong(); + else if (key == widthKey) + m_width = value.toInt(); + else if (key == heightKey) + m_height = value.toInt(); + else if (key == mediaTypeKey) + m_mediaType = value.toInt(); + else if (key == pixelWidthKey) + m_pixelWidth = value.toFloat(); + else if (key == pixelHeightKey) + m_pixelHeight = value.toFloat(); + } + } + + return true; +} + +void BbMetaData::clear() +{ + m_duration = 0; + m_height = 0; + m_width = 0; + m_mediaType = -1; + m_pixelWidth = 1; + m_pixelHeight = 1; +} + +qlonglong BbMetaData::duration() const +{ + return m_duration; +} + +// Handling of pixel aspect ratio +// +// If the pixel aspect ratio is different from 1:1, it means the video needs to be stretched in +// order to look natural. +// For example, if the pixel width is 2, and the pixel height is 1, it means a video of 300x200 +// pixels needs to be displayed as 600x200 to look correct. +// In order to support this the easiest way, we simply pretend that the actual size of the video +// is 600x200, which will cause the video to be displayed in an aspect ratio of 3:1 instead of 3:2, +// and therefore look correct. + +int BbMetaData::height() const +{ + return m_height * m_pixelHeight; +} + +int BbMetaData::width() const +{ + return m_width * m_pixelWidth; +} + +bool BbMetaData::hasVideo() const +{ + // By default, assume no video if we can't extract the information + if (m_mediaType == -1) + return false; + + return (m_mediaType & mediaTypeVideoFlag); +} + +bool BbMetaData::hasAudio() const +{ + // By default, assume audio only if we can't extract the information + if (m_mediaType == -1) + return true; + + return (m_mediaType & mediaTypeAudioFlag); +} + +QT_END_NAMESPACE diff --git a/src/plugins/blackberry/mediaplayer/bbmetadata.h b/src/plugins/blackberry/mediaplayer/bbmetadata.h new file mode 100644 index 000000000..a983a6af1 --- /dev/null +++ b/src/plugins/blackberry/mediaplayer/bbmetadata.h @@ -0,0 +1,74 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BBMETADATA_H +#define BBMETADATA_H + +#include + +QT_BEGIN_NAMESPACE + +class BbMetaData +{ +public: + BbMetaData(); + bool parse(const QString &contextName); + void clear(); + + // Duration in milliseconds + qlonglong duration() const; + + int height() const; + int width() const; + bool hasVideo() const; + bool hasAudio() const; + +private: + qlonglong m_duration; + int m_height; + int m_width; + int m_mediaType; + float m_pixelWidth; + float m_pixelHeight; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/blackberry/mediaplayer/bbutil.cpp b/src/plugins/blackberry/mediaplayer/bbutil.cpp new file mode 100644 index 000000000..f79bcb1ba --- /dev/null +++ b/src/plugins/blackberry/mediaplayer/bbutil.cpp @@ -0,0 +1,100 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "bbutil.h" + +#include +#include + +QT_BEGIN_NAMESPACE + +struct MmError { + int errorCode; + const char *name; +}; + +#define MM_ERROR_ENTRY(error) { error, #error } +static const MmError mmErrors[] = { + MM_ERROR_ENTRY(MMR_ERROR_NONE), + MM_ERROR_ENTRY(MMR_ERROR_UNKNOWN ), + MM_ERROR_ENTRY(MMR_ERROR_INVALID_PARAMETER ), + MM_ERROR_ENTRY(MMR_ERROR_INVALID_STATE), + MM_ERROR_ENTRY(MMR_ERROR_UNSUPPORTED_VALUE), + MM_ERROR_ENTRY(MMR_ERROR_UNSUPPORTED_MEDIA_TYPE), + MM_ERROR_ENTRY(MMR_ERROR_MEDIA_PROTECTED), + MM_ERROR_ENTRY(MMR_ERROR_UNSUPPORTED_OPERATION), + MM_ERROR_ENTRY(MMR_ERROR_READ), + MM_ERROR_ENTRY(MMR_ERROR_WRITE), + MM_ERROR_ENTRY(MMR_ERROR_MEDIA_UNAVAILABLE), + MM_ERROR_ENTRY(MMR_ERROR_MEDIA_CORRUPTED), + MM_ERROR_ENTRY(MMR_ERROR_OUTPUT_UNAVAILABLE), + MM_ERROR_ENTRY(MMR_ERROR_NO_MEMORY), + MM_ERROR_ENTRY(MMR_ERROR_RESOURCE_UNAVAILABLE), + MM_ERROR_ENTRY(MMR_ERROR_MEDIA_DRM_NO_RIGHTS), + MM_ERROR_ENTRY(MMR_ERROR_DRM_CORRUPTED_DATA_STORE), + MM_ERROR_ENTRY(MMR_ERROR_DRM_OUTPUT_PROTECTION), + MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_HDMI), + MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_DISPLAYPORT), + MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_DVI), + MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_ANALOG_VIDEO), + MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_ANALOG_AUDIO), + MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_TOSLINK), + MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_SPDIF), + MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_BLUETOOTH), + MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_WIRELESSHD), +}; +static const int numMmErrors = sizeof(mmErrors) / sizeof(MmError); + +QString mmErrorMessage(const QString &msg, mmr_context_t *context, int *errorCode) +{ + const mmr_error_info_t * const mmError = mmr_error_info(context); + + if (errorCode) + *errorCode = mmError->error_code; + + if (mmError->error_code >= 0 && mmError->error_code < numMmErrors) { + return QString("%1: %2 (code %3)").arg(msg).arg(mmErrors[mmError->error_code].name) + .arg(mmError->error_code); + } else { + return QString("%1: Unknown error code %2").arg(msg).arg(mmError->error_code); + } +} + +QT_END_NAMESPACE diff --git a/src/plugins/blackberry/mediaplayer/bbutil.h b/src/plugins/blackberry/mediaplayer/bbutil.h new file mode 100644 index 000000000..44fde4ed4 --- /dev/null +++ b/src/plugins/blackberry/mediaplayer/bbutil.h @@ -0,0 +1,56 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BBUTIL_H +#define BBUTIL_H + +#include + +typedef struct mmr_context mmr_context_t; + +QT_BEGIN_NAMESPACE + +class QString; + +QString mmErrorMessage(const QString &msg, mmr_context_t *context, int * errorCode = 0); + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/blackberry/mediaplayer/bbvideowindowcontrol.cpp b/src/plugins/blackberry/mediaplayer/bbvideowindowcontrol.cpp new file mode 100644 index 000000000..5668332d1 --- /dev/null +++ b/src/plugins/blackberry/mediaplayer/bbvideowindowcontrol.cpp @@ -0,0 +1,415 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "bbvideowindowcontrol.h" +#include "bbutil.h" +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +static int winIdCounter = 0; + +BbVideoWindowControl::BbVideoWindowControl(QObject *parent) + : QVideoWindowControl(parent), + m_videoId(-1), + m_winId(0), + m_context(0), + m_fullscreen(false), + m_aspectRatioMode(Qt::IgnoreAspectRatio), + m_window(0), + m_hue(0), + m_brightness(0), + m_contrast(0), + m_saturation(0) +{ +} + +BbVideoWindowControl::~BbVideoWindowControl() +{ +} + +WId BbVideoWindowControl::winId() const +{ + return m_winId; +} + +void BbVideoWindowControl::setWinId(WId id) +{ + m_winId = id; +} + +QRect BbVideoWindowControl::displayRect() const +{ + return m_displayRect ; +} + +void BbVideoWindowControl::setDisplayRect(const QRect &rect) +{ + if (m_displayRect != rect) { + m_displayRect = rect; + updateVideoPosition(); + } +} + +bool BbVideoWindowControl::isFullScreen() const +{ + return m_fullscreen; +} + +void BbVideoWindowControl::setFullScreen(bool fullScreen) +{ + if (m_fullscreen != fullScreen) { + m_fullscreen = fullScreen; + updateVideoPosition(); + emit fullScreenChanged(m_fullscreen); + } +} + +void BbVideoWindowControl::repaint() +{ + // Nothing we can or should do here +} + +QSize BbVideoWindowControl::nativeSize() const +{ + return QSize(m_metaData.width(), m_metaData.height()); +} + +Qt::AspectRatioMode BbVideoWindowControl::aspectRatioMode() const +{ + return m_aspectRatioMode; +} + +void BbVideoWindowControl::setAspectRatioMode(Qt::AspectRatioMode mode) +{ + m_aspectRatioMode = mode; +} + +int BbVideoWindowControl::brightness() const +{ + return m_brightness; +} + +void BbVideoWindowControl::setBrightness(int brightness) +{ + if (m_brightness != brightness) { + m_brightness = brightness; + updateBrightness(); + emit brightnessChanged(m_brightness); + } +} + +int BbVideoWindowControl::contrast() const +{ + return m_contrast; +} + +void BbVideoWindowControl::setContrast(int contrast) +{ + if (m_contrast != contrast) { + m_contrast = contrast; + updateContrast(); + emit contrastChanged(m_contrast); + } +} + +int BbVideoWindowControl::hue() const +{ + return m_hue; +} + +void BbVideoWindowControl::setHue(int hue) +{ + if (m_hue != hue) { + m_hue = hue; + updateHue(); + emit hueChanged(m_hue); + } +} + +int BbVideoWindowControl::saturation() const +{ + return m_saturation; +} + +void BbVideoWindowControl::setSaturation(int saturation) +{ + if (m_saturation != saturation) { + m_saturation = saturation; + updateSaturation(); + emit saturationChanged(m_saturation); + } +} + +void BbVideoWindowControl::attachDisplay(mmr_context_t *context) +{ + if (m_videoId != -1) { + qDebug() << "BbVideoWindowControl: Video output already attached!"; + return; + } + + if (!context) { + qDebug() << "BbVideoWindowControl: No media player context!"; + return; + } + + QWindow * const window = findWindow(m_winId); + if (!window) { + qDebug() << "BbVideoWindowControl: No video window!"; + return; + } + + QPlatformNativeInterface * const nativeInterface = QGuiApplication::platformNativeInterface(); + if (!nativeInterface) { + qDebug() << "BbVideoWindowControl: Unable to get platform native interface. Qt too old?"; + return; + } + + const char * const groupNameData = static_cast( + nativeInterface->nativeResourceForWindow("windowGroup", window)); + if (!groupNameData) { + qDebug() << "BbVideoWindowControl: Unable to find window group for window" << window; + return; + } + + const QString groupName = QString::fromLatin1(groupNameData); + m_windowName = QString("BbVideoWindowControl_%1_%2").arg(winIdCounter++) + .arg(QCoreApplication::applicationPid()); + // Start with an invisible window. If it would be visible right away, it would be at the wrong + // position, and we can only change the position once we get the window handle. + const QString videoDeviceUrl = + QString("screen:?winid=%1&wingrp=%2&initflags=invisible&nodstviewport=1").arg(m_windowName).arg(groupName); + + m_videoId = mmr_output_attach(context, videoDeviceUrl.toLatin1(), "video"); + if (m_videoId == -1) { + qDebug() << mmErrorMessage("mmr_output_attach() for video failed", context); + return; + } + + m_context = context; + updateVideoPosition(); + updateHue(); + updateContrast(); + updateBrightness(); + updateSaturation(); +} + +void BbVideoWindowControl::updateVideoPosition() +{ + QWindow * const window = findWindow(m_winId); + if (m_context && m_videoId != -1 && window) { + QPoint topLeft = m_fullscreen ? + QPoint(0,0) : + window->mapToGlobal(m_displayRect.topLeft()); + + QScreen * const screen = window->screen(); + int width = m_fullscreen ? + screen->size().width() : + m_displayRect.width(); + int height = m_fullscreen ? + screen->size().height() : + m_displayRect.height(); + + if (m_metaData.hasVideo()) { // We need the source size to do aspect ratio scaling + const qreal sourceRatio = m_metaData.width() / static_cast(m_metaData.height()); + const qreal targetRatio = width / static_cast(height); + + if (m_aspectRatioMode == Qt::KeepAspectRatio) { + if (targetRatio < sourceRatio) { + // Need to make height smaller + const int newHeight = width / sourceRatio; + const int heightDiff = height - newHeight; + topLeft.ry() += heightDiff / 2; + height = newHeight; + } else { + // Need to make width smaller + const int newWidth = sourceRatio * height; + const int widthDiff = width - newWidth; + topLeft.rx() += widthDiff / 2; + width = newWidth; + } + + } else if (m_aspectRatioMode == Qt::KeepAspectRatioByExpanding) { + if (targetRatio < sourceRatio) { + // Need to make width larger + const int newWidth = sourceRatio * height; + const int widthDiff = newWidth - width; + topLeft.rx() -= widthDiff / 2; + width = newWidth; + } else { + // Need to make height larger + const int newHeight = width / sourceRatio; + const int heightDiff = newHeight - height; + topLeft.ry() -= heightDiff / 2; + height = newHeight; + } + } + } + + if (m_window != 0) { + const int position[2] = { topLeft.x(), topLeft.y() }; + const int size[2] = { width, height }; + const int visible = m_displayRect.isValid(); + if (screen_set_window_property_iv(m_window, SCREEN_PROPERTY_POSITION, position) != 0) + perror("Setting video position failed"); + if (screen_set_window_property_iv(m_window, SCREEN_PROPERTY_SIZE, size) != 0) + perror("Setting video size failed"); + if (screen_set_window_property_iv(m_window, SCREEN_PROPERTY_VISIBLE, &visible) != 0) + perror("Setting video visibility failed"); + } + } +} + +void BbVideoWindowControl::updateBrightness() +{ + if (m_window != 0) { + const int backendValue = m_brightness * 2.55f; + if (screen_set_window_property_iv(m_window, SCREEN_PROPERTY_BRIGHTNESS, &backendValue) != 0) + perror("Setting brightness failed"); + } +} + +void BbVideoWindowControl::updateContrast() +{ + if (m_window != 0) { + const int backendValue = m_contrast * 1.27f; + if (screen_set_window_property_iv(m_window, SCREEN_PROPERTY_CONTRAST, &backendValue) != 0) + perror("Setting contrast failed"); + } +} + +void BbVideoWindowControl::updateHue() +{ + if (m_window != 0) { + const int backendValue = m_hue * 1.27f; + if (screen_set_window_property_iv(m_window, SCREEN_PROPERTY_HUE, &backendValue) != 0) + perror("Setting hue failed"); + } +} + +void BbVideoWindowControl::updateSaturation() +{ + if (m_window != 0) { + const int backendValue = m_saturation * 1.27f; + if (screen_set_window_property_iv(m_window, SCREEN_PROPERTY_SATURATION, &backendValue) != 0) + perror("Setting saturation failed"); + } +} + +void BbVideoWindowControl::detachDisplay() +{ + if (m_context && m_videoId != -1) + mmr_output_detach(m_context, m_videoId); + + m_context = 0; + m_videoId = -1; + m_metaData.clear(); + m_windowName.clear(); + m_window = 0; + m_hue = 0; + m_brightness = 0; + m_contrast = 0; + m_saturation = 0; +} + +void BbVideoWindowControl::setMetaData(const BbMetaData &metaData) +{ + m_metaData = metaData; + emit nativeSizeChanged(); + + // To handle the updated source size data + updateVideoPosition(); +} + +void BbVideoWindowControl::bpsEventHandler(bps_event_t *event) +{ + if (event && bps_event_get_domain(event) == screen_get_domain()) { + const screen_event_t screen_event = screen_event_get_event(event); + + int eventType; + if (screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_TYPE, &eventType) != 0) { + perror("BbVideoWindowControl: Failed to query screen event type"); + return; + } + + if (eventType != SCREEN_EVENT_CREATE) + return; + + screen_window_t window = 0; + if (screen_get_event_property_pv(screen_event, SCREEN_PROPERTY_WINDOW, (void**)&window) != 0) { + perror("BbVideoWindowControl: Failed to query window property"); + return; + } + + const int maxIdStrLength = 128; + char idString[maxIdStrLength]; + if (screen_get_window_property_cv(window, SCREEN_PROPERTY_ID_STRING, maxIdStrLength, idString) != 0) { + perror("BbVideoWindowControl: Failed to query window ID string"); + return; + } + + if (m_windowName == idString) { + m_window = window; + updateVideoPosition(); + + const int visibleFlag = 1; + if (screen_set_window_property_iv(m_window, SCREEN_PROPERTY_VISIBLE, &visibleFlag) != 0) { + perror("BbVideoWindowControl: Failed to make window visible"); + return; + } + } + } +} + +QWindow *BbVideoWindowControl::findWindow(WId id) const +{ + Q_FOREACH (QWindow *window, QGuiApplication::allWindows()) + if (window->winId() == id) + return window; + return 0; +} + +QT_END_NAMESPACE diff --git a/src/plugins/blackberry/mediaplayer/bbvideowindowcontrol.h b/src/plugins/blackberry/mediaplayer/bbvideowindowcontrol.h new file mode 100644 index 000000000..81bf79682 --- /dev/null +++ b/src/plugins/blackberry/mediaplayer/bbvideowindowcontrol.h @@ -0,0 +1,121 @@ +/**************************************************************************** +** +** Copyright (C) 2012 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BBVIDEOWINDOWCONTROL_H +#define BBVIDEOWINDOWCONTROL_H + +#include "bbmetadata.h" +#include +#include + +typedef struct mmr_context mmr_context_t; +struct bps_event_t; + +QT_BEGIN_NAMESPACE + +class BbVideoWindowControl : public QVideoWindowControl +{ + Q_OBJECT +public: + explicit BbVideoWindowControl(QObject *parent = 0); + ~BbVideoWindowControl(); + + WId winId() const Q_DECL_OVERRIDE; + void setWinId(WId id) Q_DECL_OVERRIDE; + + QRect displayRect() const Q_DECL_OVERRIDE; + void setDisplayRect(const QRect &rect) Q_DECL_OVERRIDE; + + bool isFullScreen() const Q_DECL_OVERRIDE; + void setFullScreen(bool fullScreen) Q_DECL_OVERRIDE; + + void repaint() Q_DECL_OVERRIDE; + + QSize nativeSize() const Q_DECL_OVERRIDE; + + Qt::AspectRatioMode aspectRatioMode() const Q_DECL_OVERRIDE; + void setAspectRatioMode(Qt::AspectRatioMode mode) Q_DECL_OVERRIDE; + + int brightness() const Q_DECL_OVERRIDE; + void setBrightness(int brightness) Q_DECL_OVERRIDE; + + int contrast() const Q_DECL_OVERRIDE; + void setContrast(int contrast) Q_DECL_OVERRIDE; + + int hue() const Q_DECL_OVERRIDE; + void setHue(int hue) Q_DECL_OVERRIDE; + + int saturation() const Q_DECL_OVERRIDE; + void setSaturation(int saturation) Q_DECL_OVERRIDE; + + // + // Called by media control + // + void detachDisplay(); + void attachDisplay(mmr_context_t *context); + void setMetaData(const BbMetaData &metaData); + void bpsEventHandler(bps_event_t *event); + +private: + QWindow *findWindow(WId id) const; + void updateVideoPosition(); + void updateBrightness(); + void updateContrast(); + void updateHue(); + void updateSaturation(); + + int m_videoId; + WId m_winId; + QRect m_displayRect; + mmr_context_t *m_context; + bool m_fullscreen; + BbMetaData m_metaData; + Qt::AspectRatioMode m_aspectRatioMode; + QString m_windowName; + screen_window_t m_window; + int m_hue; + int m_brightness; + int m_contrast; + int m_saturation; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/blackberry/mediaplayer/mediaplayer.pri b/src/plugins/blackberry/mediaplayer/mediaplayer.pri new file mode 100644 index 000000000..cf888f655 --- /dev/null +++ b/src/plugins/blackberry/mediaplayer/mediaplayer.pri @@ -0,0 +1,17 @@ +INCLUDEPATH += $$PWD + +HEADERS += \ + $$PWD/bbmediaplayercontrol.h \ + $$PWD/bbmediaplayerservice.h \ + $$PWD/bbmetadata.h \ + $$PWD/bbutil.h \ + $$PWD/bbvideowindowcontrol.h + +SOURCES += \ + $$PWD/bbmediaplayercontrol.cpp \ + $$PWD/bbmediaplayerservice.cpp \ + $$PWD/bbmetadata.cpp \ + $$PWD/bbutil.cpp \ + $$PWD/bbvideowindowcontrol.cpp + +LIBS += -lmmrndclient -lstrm diff --git a/src/plugins/blackberry/mediaservice/bbmediaplayercontrol.cpp b/src/plugins/blackberry/mediaservice/bbmediaplayercontrol.cpp deleted file mode 100644 index 41d3bc479..000000000 --- a/src/plugins/blackberry/mediaservice/bbmediaplayercontrol.cpp +++ /dev/null @@ -1,616 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "bbmediaplayercontrol.h" -#include "bbvideowindowcontrol.h" -#include "bbutil.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -static int idCounter = 0; - -BbMediaPlayerControl::BbMediaPlayerControl(QObject *parent) - : QMediaPlayerControl(parent), - m_connection(0), - m_context(0), - m_audioId(-1), - m_state(QMediaPlayer::StoppedState), - m_volume(100), - m_muted(false), - m_rate(1), - m_id(-1), - m_eventMonitor(0), - m_position(0), - m_mediaStatus(QMediaPlayer::NoMedia), - m_playAfterMediaLoaded(false), - m_inputAttached(false), - m_stopEventsToIgnore(0), - m_bufferStatus(0) -{ - m_loadingTimer.setSingleShot(true); - m_loadingTimer.setInterval(0); - connect(&m_loadingTimer, SIGNAL(timeout()), this, SLOT(continueLoadMedia())); - QCoreApplication::eventDispatcher()->installNativeEventFilter(this); - openConnection(); -} - -BbMediaPlayerControl::~BbMediaPlayerControl() -{ - stop(); - detach(); - closeConnection(); - QCoreApplication::eventDispatcher()->removeNativeEventFilter(this); -} - -void BbMediaPlayerControl::openConnection() -{ - m_connection = mmr_connect(NULL); - if (!m_connection) { - emitPError("Unable to connect to the multimedia renderer"); - return; - } - - m_id = idCounter++; - m_contextName = QString("BbMediaPlayerControl_%1_%2").arg(m_id) - .arg(QCoreApplication::applicationPid()); - m_context = mmr_context_create(m_connection, m_contextName.toLatin1(), - 0, S_IRWXU|S_IRWXG|S_IRWXO); - if (!m_context) { - emitPError("Unable to create context"); - closeConnection(); - return; - } - - m_eventMonitor = mmrenderer_request_events(m_contextName.toLatin1(), 0, m_id); - if (!m_eventMonitor) { - qDebug() << "Unable to request multimedia events"; - emit error(0, "Unable to request multimedia events"); - } -} - -void BbMediaPlayerControl::closeConnection() -{ - if (m_eventMonitor) { - mmrenderer_stop_events(m_eventMonitor); - m_eventMonitor = 0; - } - - if (m_context) { - mmr_context_destroy(m_context); - m_context = 0; - m_contextName.clear(); - } - - if (m_connection) { - mmr_disconnect(m_connection); - m_connection = 0; - } -} - -QString BbMediaPlayerControl::resourcePathForUrl(const QUrl &url) -{ - // If this is a local file, mmrenderer expects the file:// prefix and an absolute path. - // We treat URLs without scheme as local files, most likely someone just forgot to set the - // file:// prefix when constructing the URL. - if (url.isLocalFile() || url.scheme().isEmpty()) { - QString relativeFilePath; - if (!url.scheme().isEmpty()) - relativeFilePath = url.toLocalFile(); - else - relativeFilePath = url.path(); - const QFileInfo fileInfo(relativeFilePath); - return QStringLiteral("file://") + fileInfo.absoluteFilePath(); - - // QRC, copy to temporary file, as mmrenderer does not support resource files - } else if (url.scheme() == QStringLiteral("qrc")) { - const QString qrcPath = ':' + url.path(); - const QFileInfo resourceFileInfo(qrcPath); - m_tempMediaFileName = QDir::tempPath() + QStringLiteral("/qtmedia_") + - QUuid::createUuid().toString() + QStringLiteral(".") + - resourceFileInfo.suffix(); - if (!QFile::copy(qrcPath, m_tempMediaFileName)) { - const QString errorMsg = - QString("Failed to copy resource file to temporary file %1 for playback").arg(m_tempMediaFileName); - qDebug() << errorMsg; - emit error(0, errorMsg); - return QString(); - } - return m_tempMediaFileName; - - // HTTP or similar URL, use as-is - } else { - return url.toString(); - } -} - -void BbMediaPlayerControl::attach() -{ - // Should only be called in detached state - Q_ASSERT(m_audioId == -1 && !m_inputAttached && m_tempMediaFileName.isEmpty()); - - if (m_media.isNull() || !m_context) { - setMediaStatus(QMediaPlayer::NoMedia); - return; - } - - if (m_videoControl) - m_videoControl->attachDisplay(m_context); - - m_audioId = mmr_output_attach(m_context, "audio:default", "audio"); - if (m_audioId == -1) { - emitMmError("mmr_output_attach() for audio failed"); - return; - } - - const QString resourcePath = resourcePathForUrl(m_media.canonicalUrl()); - if (resourcePath.isEmpty()) { - detach(); - return; - } - - if (mmr_input_attach(m_context, QFile::encodeName(resourcePath), "track") != 0) { - emitMmError(QString("mmr_input_attach() for %1 failed").arg(resourcePath)); - setMediaStatus(QMediaPlayer::InvalidMedia); - detach(); - return; - } - - // For whatever reason, the mmrenderer sends out a MMR_STOPPED event when calling - // mmr_input_attach() above. Ignore it, as otherwise we'll trigger stopping right after we - // started. - m_stopEventsToIgnore++; - - m_inputAttached = true; - setMediaStatus(QMediaPlayer::LoadedMedia); - m_bufferStatus = 0; - emit bufferStatusChanged(m_bufferStatus); -} - -void BbMediaPlayerControl::detach() -{ - if (m_context) { - if (m_inputAttached) { - mmr_input_detach(m_context); - m_inputAttached = false; - } - if (m_videoControl) - m_videoControl->detachDisplay(); - if (m_audioId != -1 && m_context) { - mmr_output_detach(m_context, m_audioId); - m_audioId = -1; - } - } - - if (!m_tempMediaFileName.isEmpty()) { - QFile::remove(m_tempMediaFileName); - m_tempMediaFileName.clear(); - } - m_loadingTimer.stop(); -} - -QMediaPlayer::State BbMediaPlayerControl::state() const -{ - return m_state; -} - -QMediaPlayer::MediaStatus BbMediaPlayerControl::mediaStatus() const -{ - return m_mediaStatus; -} - -qint64 BbMediaPlayerControl::duration() const -{ - return m_metaData.duration(); -} - -qint64 BbMediaPlayerControl::position() const -{ - return m_position; -} - -void BbMediaPlayerControl::setPosition(qint64 position) -{ - if (m_position != position) { - m_position = position; - - // Don't update in stopped state, it would not have any effect. Instead, the position is - // updated in play(). - if (m_state != QMediaPlayer::StoppedState) - setPositionInternal(m_position); - - emit positionChanged(m_position); - } -} - -int BbMediaPlayerControl::volume() const -{ - return m_volume; -} - -void BbMediaPlayerControl::setVolumeInternal(int newVolume) -{ - if (!m_context) - return; - - newVolume = qBound(0, newVolume, 100); - if (m_audioId != -1) { - strm_dict_t * dict = strm_dict_new(); - dict = strm_dict_set(dict, "volume", QString::number(newVolume).toLatin1()); - if (mmr_output_parameters(m_context, m_audioId, dict) != 0) - emitMmError("mmr_output_parameters: Setting volume failed"); - } -} - -void BbMediaPlayerControl::setPlaybackRateInternal(qreal rate) -{ - if (!m_context) - return; - - const int mmRate = rate * 1000; - if (mmr_speed_set(m_context, mmRate) != 0) - emitMmError("mmr_speed_set failed"); -} - -void BbMediaPlayerControl::setPositionInternal(qint64 position) -{ - if (!m_context) - return; - - if (mmr_seek(m_context, QString::number(position).toLatin1()) != 0) - emitMmError("Seeking failed"); -} - -void BbMediaPlayerControl::setMediaStatus(QMediaPlayer::MediaStatus status) -{ - if (m_mediaStatus != status) { - m_mediaStatus = status; - emit mediaStatusChanged(m_mediaStatus); - } -} - -void BbMediaPlayerControl::setState(QMediaPlayer::State state) -{ - if (m_state != state) { - m_state = state; - emit stateChanged(m_state); - } -} - -void BbMediaPlayerControl::stopInternal(StopCommand stopCommand) -{ - if (m_state != QMediaPlayer::StoppedState) { - - if (stopCommand == StopMmRenderer) { - ++m_stopEventsToIgnore; - mmr_stop(m_context); - } - - setState(QMediaPlayer::StoppedState); - } - - if (m_position != 0) { - m_position = 0; - emit positionChanged(0); - } -} - -void BbMediaPlayerControl::setVolume(int volume) -{ - const int newVolume = qBound(0, volume, 100); - if (m_volume != newVolume) { - m_volume = newVolume; - if (!m_muted) - setVolumeInternal(m_volume); - emit volumeChanged(m_volume); - } -} - -bool BbMediaPlayerControl::isMuted() const -{ - return m_muted; -} - -void BbMediaPlayerControl::setMuted(bool muted) -{ - if (m_muted != muted) { - m_muted = muted; - setVolumeInternal(muted ? 0 : m_volume); - emit mutedChanged(muted); - } -} - -int BbMediaPlayerControl::bufferStatus() const -{ - return m_bufferStatus; -} - -bool BbMediaPlayerControl::isAudioAvailable() const -{ - return m_metaData.hasAudio(); -} - -bool BbMediaPlayerControl::isVideoAvailable() const -{ - return m_metaData.hasVideo(); -} - -bool BbMediaPlayerControl::isSeekable() const -{ - // We can currently not get that information from the mmrenderer API. Just pretend we can seek, - // it will fail at runtime if we can not. - return true; -} - -QMediaTimeRange BbMediaPlayerControl::availablePlaybackRanges() const -{ - // We can't get this information from the mmrenderer API yet, so pretend we can seek everywhere - return QMediaTimeRange(0, m_metaData.duration()); -} - -qreal BbMediaPlayerControl::playbackRate() const -{ - return m_rate; -} - -void BbMediaPlayerControl::setPlaybackRate(qreal rate) -{ - if (m_rate != rate) { - m_rate = rate; - setPlaybackRateInternal(m_rate); - emit playbackRateChanged(m_rate); - } -} - -QMediaContent BbMediaPlayerControl::media() const -{ - return m_media; -} - -const QIODevice *BbMediaPlayerControl::mediaStream() const -{ - // Always 0, we don't support QIODevice streams - return 0; -} - -void BbMediaPlayerControl::setMedia(const QMediaContent &media, QIODevice *stream) -{ - Q_UNUSED(stream); // not supported - - stop(); - detach(); - - m_media = media; - emit mediaChanged(m_media); - - // Slight hack: With MediaPlayer QtQuick elements that have autoPlay set to true, playback - // would start before the QtQuick canvas is propagated to all elements, and therefore our - // video output would not work. Therefore, delay actually playing the media a bit so that the - // canvas is ready. - // The mmrenderer doesn't allow to attach video outputs after playing has started, otherwise - // this would be unnecessary. - if (!m_media.isNull()) { - setMediaStatus(QMediaPlayer::LoadingMedia); - m_loadingTimer.start(); // singleshot timer to continueLoadMedia() - } else { - continueLoadMedia(); // still needed, as it will update the media status and clear metadata - } -} - -void BbMediaPlayerControl::continueLoadMedia() -{ - attach(); - updateMetaData(); - if (m_playAfterMediaLoaded) - play(); -} - -void BbMediaPlayerControl::play() -{ - if (m_playAfterMediaLoaded) - m_playAfterMediaLoaded = false; - - // No-op if we are already playing, except if we were called from continueLoadMedia(), in which - // case m_playAfterMediaLoaded is true (hence the 'else'). - else if (m_state == QMediaPlayer::PlayingState) - return; - - if (m_mediaStatus == QMediaPlayer::LoadingMedia) { - - // State changes are supposed to be synchronous - setState(QMediaPlayer::PlayingState); - - // Defer playing to later, when the timer triggers continueLoadMedia() - m_playAfterMediaLoaded = true; - return; - } - - // Un-pause the state when it is paused - if (m_state == QMediaPlayer::PausedState) { - setPlaybackRateInternal(m_rate); - setState(QMediaPlayer::PlayingState); - return; - } - - if (m_media.isNull() || !m_connection || !m_context || m_audioId == -1) { - setState(QMediaPlayer::StoppedState); - return; - } - - setPositionInternal(m_position); - setVolumeInternal(m_volume); - setPlaybackRateInternal(m_rate); - - if (mmr_play(m_context) != 0) { - setState(QMediaPlayer::StoppedState); - emitMmError("mmr_play() failed"); - return; - } - - setState( QMediaPlayer::PlayingState); -} - -void BbMediaPlayerControl::pause() -{ - if (m_state == QMediaPlayer::PlayingState) { - setPlaybackRateInternal(0); - setState(QMediaPlayer::PausedState); - } -} - -void BbMediaPlayerControl::stop() -{ - stopInternal(StopMmRenderer); -} - -void BbMediaPlayerControl::setVideoControl(BbVideoWindowControl *videoControl) -{ - m_videoControl = videoControl; -} - -bool BbMediaPlayerControl::nativeEventFilter(const QByteArray &eventType, void *message, long *result) -{ - Q_UNUSED(eventType); - Q_UNUSED(result); - - bps_event_t * const event = static_cast(message); - if (!event || - (bps_event_get_domain(event) != mmrenderer_get_domain() && - bps_event_get_domain(event) != screen_get_domain())) - return false; - - if (m_videoControl) - m_videoControl->bpsEventHandler(event); - - if (bps_event_get_domain(event) == mmrenderer_get_domain()) { - if (bps_event_get_code(event) == MMRENDERER_STATE_CHANGE) { - const mmrenderer_state_t newState = mmrenderer_event_get_state(event); - if (newState == MMR_STOPPED) { - - // Only react to stop events that happen when the end of the stream is reached and - // playback is stopped because of this. - // Ignore other stop event sources, souch as calling mmr_stop() ourselves and - // mmr_input_attach(). - if (m_stopEventsToIgnore > 0) { - --m_stopEventsToIgnore; - } else { - setMediaStatus(QMediaPlayer::EndOfMedia); - stopInternal(IgnoreMmRenderer); - } - return false; - } - } - - if (bps_event_get_code(event) == MMRENDERER_STATUS_UPDATE) { - - // Prevent spurious position change events from overriding our own position, for example - // when setting the position to 0 in stop(). - // Also, don't change the position while we're loading the media, as then play() would - // set a wrong initial position. - if (m_state != QMediaPlayer::PlayingState || - m_mediaStatus == QMediaPlayer::LoadingMedia || - m_mediaStatus == QMediaPlayer::NoMedia || - m_mediaStatus == QMediaPlayer::InvalidMedia) - return false; - - const qint64 newPosition = QString::fromLatin1(mmrenderer_event_get_position(event)).toLongLong(); - if (newPosition != 0 && newPosition != m_position) { - m_position = newPosition; - emit positionChanged(m_position); - } - - const QString bufferStatus = QString::fromLatin1(mmrenderer_event_get_bufferlevel(event)); - const int slashPos = bufferStatus.indexOf('/'); - if (slashPos != -1) { - const int fill = bufferStatus.left(slashPos).toInt(); - const int capacity = bufferStatus.mid(slashPos + 1).toInt(); - if (capacity != 0) { - m_bufferStatus = fill / static_cast(capacity) * 100.0f; - emit bufferStatusChanged(m_bufferStatus); - } - } - } - } - - return false; -} - -void BbMediaPlayerControl::updateMetaData() -{ - if (m_mediaStatus == QMediaPlayer::LoadedMedia) - m_metaData.parse(m_contextName); - else - m_metaData.clear(); - - if (m_videoControl) - m_videoControl->setMetaData(m_metaData); - - emit durationChanged(m_metaData.duration()); - emit audioAvailableChanged(m_metaData.hasAudio()); - emit videoAvailableChanged(m_metaData.hasVideo()); - emit availablePlaybackRangesChanged(availablePlaybackRanges()); -} - -void BbMediaPlayerControl::emitMmError(const QString &msg) -{ - int errorCode = MMR_ERROR_NONE; - const QString errorMessage = mmErrorMessage(msg, m_context, &errorCode); - qDebug() << errorMessage; - emit error(errorCode, errorMessage); -} - -void BbMediaPlayerControl::emitPError(const QString &msg) -{ - const QString errorMessage = QString("%1: %2").arg(msg).arg(strerror(errno)); - qDebug() << errorMessage; - emit error(errno, errorMessage); -} - -QT_END_NAMESPACE diff --git a/src/plugins/blackberry/mediaservice/bbmediaplayercontrol.h b/src/plugins/blackberry/mediaservice/bbmediaplayercontrol.h deleted file mode 100644 index eb87ea872..000000000 --- a/src/plugins/blackberry/mediaservice/bbmediaplayercontrol.h +++ /dev/null @@ -1,155 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef BBMEDIAPLAYERCONTROL_H -#define BBMEDIAPLAYERCONTROL_H - -#include "bbmetadata.h" -#include -#include -#include -#include - -struct bps_event_t; -typedef struct mmr_connection mmr_connection_t; -typedef struct mmr_context mmr_context_t; -typedef struct mmrenderer_monitor mmrenderer_monitor_t; - -QT_BEGIN_NAMESPACE - -class BbVideoWindowControl; - -class BbMediaPlayerControl : public QMediaPlayerControl, public QAbstractNativeEventFilter -{ - Q_OBJECT -public: - explicit BbMediaPlayerControl(QObject *parent = 0); - ~BbMediaPlayerControl(); - - QMediaPlayer::State state() const Q_DECL_OVERRIDE; - - QMediaPlayer::MediaStatus mediaStatus() const Q_DECL_OVERRIDE; - - qint64 duration() const Q_DECL_OVERRIDE; - - qint64 position() const Q_DECL_OVERRIDE; - void setPosition(qint64 position) Q_DECL_OVERRIDE; - - int volume() const Q_DECL_OVERRIDE; - void setVolume(int volume) Q_DECL_OVERRIDE; - - bool isMuted() const Q_DECL_OVERRIDE; - void setMuted(bool muted) Q_DECL_OVERRIDE; - - int bufferStatus() const Q_DECL_OVERRIDE; - - bool isAudioAvailable() const Q_DECL_OVERRIDE; - bool isVideoAvailable() const Q_DECL_OVERRIDE; - - bool isSeekable() const Q_DECL_OVERRIDE; - - QMediaTimeRange availablePlaybackRanges() const Q_DECL_OVERRIDE; - - qreal playbackRate() const Q_DECL_OVERRIDE; - void setPlaybackRate(qreal rate) Q_DECL_OVERRIDE; - - QMediaContent media() const Q_DECL_OVERRIDE; - const QIODevice *mediaStream() const Q_DECL_OVERRIDE; - void setMedia(const QMediaContent &media, QIODevice *stream) Q_DECL_OVERRIDE; - - void play() Q_DECL_OVERRIDE; - void pause() Q_DECL_OVERRIDE; - void stop() Q_DECL_OVERRIDE; - - void setVideoControl(BbVideoWindowControl *videoControl); - bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) Q_DECL_OVERRIDE; - -private Q_SLOTS: - void continueLoadMedia(); - -private: - QString resourcePathForUrl(const QUrl &url); - void openConnection(); - void closeConnection(); - void attach(); - void detach(); - void updateMetaData(); - - void emitMmError(const QString &msg); - void emitPError(const QString &msg); - - // All these set the specified value to the backend, but neither emit changed signals - // nor change the member value. - void setVolumeInternal(int newVolume); - void setPlaybackRateInternal(qreal rate); - void setPositionInternal(qint64 position); - - void setMediaStatus(QMediaPlayer::MediaStatus status); - void setState(QMediaPlayer::State state); - - enum StopCommand { StopMmRenderer, IgnoreMmRenderer }; - void stopInternal(StopCommand stopCommand); - - QMediaContent m_media; - mmr_connection_t *m_connection; - mmr_context_t *m_context; - QString m_contextName; - int m_audioId; - QMediaPlayer::State m_state; - int m_volume; - bool m_muted; - qreal m_rate; - QPointer m_videoControl; - BbMetaData m_metaData; - int m_id; - mmrenderer_monitor_t *m_eventMonitor; - qint64 m_position; - QMediaPlayer::MediaStatus m_mediaStatus; - bool m_playAfterMediaLoaded; - bool m_inputAttached; - int m_stopEventsToIgnore; - int m_bufferStatus; - QString m_tempMediaFileName; - QTimer m_loadingTimer; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/blackberry/mediaservice/bbmediaplayerservice.cpp b/src/plugins/blackberry/mediaservice/bbmediaplayerservice.cpp deleted file mode 100644 index 8730d2ddc..000000000 --- a/src/plugins/blackberry/mediaservice/bbmediaplayerservice.cpp +++ /dev/null @@ -1,96 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "bbmediaplayerservice.h" - -#include "bbmediaplayercontrol.h" -#include "bbvideowindowcontrol.h" - -QT_BEGIN_NAMESPACE - -BbMediaPlayerService::BbMediaPlayerService(QObject *parent) - : QMediaService(parent), - m_videoWindowControl(0), - m_mediaPlayerControl(0) -{ -} - -BbMediaPlayerService::~BbMediaPlayerService() -{ - // Someone should have called releaseControl(), but better be safe - delete m_videoWindowControl; - delete m_mediaPlayerControl; -} - -QMediaControl *BbMediaPlayerService::requestControl(const char *name) -{ - if (qstrcmp(name, QMediaPlayerControl_iid) == 0) { - if (!m_mediaPlayerControl) { - m_mediaPlayerControl = new BbMediaPlayerControl(); - updateControls(); - } - return m_mediaPlayerControl; - } - else if (qstrcmp(name, QVideoWindowControl_iid) == 0) { - if (!m_videoWindowControl) { - m_videoWindowControl = new BbVideoWindowControl(); - updateControls(); - } - return m_videoWindowControl; - } - return 0; -} - -void BbMediaPlayerService::releaseControl(QMediaControl *control) -{ - if (control == m_videoWindowControl) - m_videoWindowControl = 0; - if (control == m_mediaPlayerControl) - m_mediaPlayerControl = 0; - delete control; -} - -void BbMediaPlayerService::updateControls() -{ - if (m_videoWindowControl && m_mediaPlayerControl) - m_mediaPlayerControl->setVideoControl(m_videoWindowControl); -} - -QT_END_NAMESPACE diff --git a/src/plugins/blackberry/mediaservice/bbmediaplayerservice.h b/src/plugins/blackberry/mediaservice/bbmediaplayerservice.h deleted file mode 100644 index 8ff52cd28..000000000 --- a/src/plugins/blackberry/mediaservice/bbmediaplayerservice.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef BBMEDIAPLAYERSERVICE_H -#define BBMEDIAPLAYERSERVICE_H - -#include -#include - -QT_BEGIN_NAMESPACE - -class BbMediaPlayerControl; -class BbVideoWindowControl; - -class BbMediaPlayerService : public QMediaService -{ - Q_OBJECT -public: - explicit BbMediaPlayerService(QObject *parent = 0); - ~BbMediaPlayerService(); - - QMediaControl *requestControl(const char *name) Q_DECL_OVERRIDE; - void releaseControl(QMediaControl *control) Q_DECL_OVERRIDE; - -private: - void updateControls(); - - QPointer m_videoWindowControl; - QPointer m_mediaPlayerControl; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/blackberry/mediaservice/bbmetadata.cpp b/src/plugins/blackberry/mediaservice/bbmetadata.cpp deleted file mode 100644 index b34b63e72..000000000 --- a/src/plugins/blackberry/mediaservice/bbmetadata.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "bbmetadata.h" - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -BbMetaData::BbMetaData() -{ - clear(); -} - -static const char * durationKey = "md_title_duration"; -static const char * widthKey = "md_video_width"; -static const char * heightKey = "md_video_height"; -static const char * mediaTypeKey = "md_title_mediatype"; -static const char * pixelWidthKey = "md_video_pixel_height"; -static const char * pixelHeightKey = "md_video_pixel_width"; - -static const int mediaTypeAudioFlag = 4; -static const int mediaTypeVideoFlag = 2; - -bool BbMetaData::parse(const QString &contextName) -{ - clear(); - QString fileName = - QString("/pps/services/multimedia/renderer/context/%1/metadata").arg(contextName); - - // In newer OS versions, the filename is "metadata0", not metadata, so try both. - if (!QFile::exists(fileName)) - fileName += '0'; - - QFile metaDataFile(fileName); - if (!metaDataFile.open(QFile::ReadOnly)) { - qWarning() << "Unable to open media metadata file" << fileName << ":" - << metaDataFile.errorString(); - return false; - } - - const QString separator("::"); - QTextStream stream(&metaDataFile); - Q_FOREVER { - const QString line = stream.readLine(); - if (line.isNull()) - break; - - const int separatorPos = line.indexOf(separator); - if (separatorPos != -1) { - const QString key = line.left(separatorPos); - const QString value = line.mid(separatorPos + separator.length()); - - if (key == durationKey) - m_duration = value.toLongLong(); - else if (key == widthKey) - m_width = value.toInt(); - else if (key == heightKey) - m_height = value.toInt(); - else if (key == mediaTypeKey) - m_mediaType = value.toInt(); - else if (key == pixelWidthKey) - m_pixelWidth = value.toFloat(); - else if (key == pixelHeightKey) - m_pixelHeight = value.toFloat(); - } - } - - return true; -} - -void BbMetaData::clear() -{ - m_duration = 0; - m_height = 0; - m_width = 0; - m_mediaType = -1; - m_pixelWidth = 1; - m_pixelHeight = 1; -} - -qlonglong BbMetaData::duration() const -{ - return m_duration; -} - -// Handling of pixel aspect ratio -// -// If the pixel aspect ratio is different from 1:1, it means the video needs to be stretched in -// order to look natural. -// For example, if the pixel width is 2, and the pixel height is 1, it means a video of 300x200 -// pixels needs to be displayed as 600x200 to look correct. -// In order to support this the easiest way, we simply pretend that the actual size of the video -// is 600x200, which will cause the video to be displayed in an aspect ratio of 3:1 instead of 3:2, -// and therefore look correct. - -int BbMetaData::height() const -{ - return m_height * m_pixelHeight; -} - -int BbMetaData::width() const -{ - return m_width * m_pixelWidth; -} - -bool BbMetaData::hasVideo() const -{ - // By default, assume no video if we can't extract the information - if (m_mediaType == -1) - return false; - - return (m_mediaType & mediaTypeVideoFlag); -} - -bool BbMetaData::hasAudio() const -{ - // By default, assume audio only if we can't extract the information - if (m_mediaType == -1) - return true; - - return (m_mediaType & mediaTypeAudioFlag); -} - -QT_END_NAMESPACE diff --git a/src/plugins/blackberry/mediaservice/bbmetadata.h b/src/plugins/blackberry/mediaservice/bbmetadata.h deleted file mode 100644 index a983a6af1..000000000 --- a/src/plugins/blackberry/mediaservice/bbmetadata.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef BBMETADATA_H -#define BBMETADATA_H - -#include - -QT_BEGIN_NAMESPACE - -class BbMetaData -{ -public: - BbMetaData(); - bool parse(const QString &contextName); - void clear(); - - // Duration in milliseconds - qlonglong duration() const; - - int height() const; - int width() const; - bool hasVideo() const; - bool hasAudio() const; - -private: - qlonglong m_duration; - int m_height; - int m_width; - int m_mediaType; - float m_pixelWidth; - float m_pixelHeight; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/blackberry/mediaservice/bbserviceplugin.cpp b/src/plugins/blackberry/mediaservice/bbserviceplugin.cpp deleted file mode 100644 index 92dc4aee4..000000000 --- a/src/plugins/blackberry/mediaservice/bbserviceplugin.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "bbserviceplugin.h" -#include "bbmediaplayerservice.h" - -QT_BEGIN_NAMESPACE - -BbServicePlugin::BbServicePlugin() -{ -} - -QMediaService *BbServicePlugin::create(const QString &key) -{ - if (key == QLatin1String(Q_MEDIASERVICE_MEDIAPLAYER)) - return new BbMediaPlayerService(); - - return 0; -} - -void BbServicePlugin::release(QMediaService *service) -{ - delete service; -} - -QMediaServiceProviderHint::Features BbServicePlugin::supportedFeatures(const QByteArray &service) const -{ - Q_UNUSED(service) - return QMediaServiceProviderHint::Features(); -} - -QT_END_NAMESPACE diff --git a/src/plugins/blackberry/mediaservice/bbserviceplugin.h b/src/plugins/blackberry/mediaservice/bbserviceplugin.h deleted file mode 100644 index dbf507f10..000000000 --- a/src/plugins/blackberry/mediaservice/bbserviceplugin.h +++ /dev/null @@ -1,65 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef BBRSERVICEPLUGIN_H -#define BBRSERVICEPLUGIN_H - -#include - -QT_BEGIN_NAMESPACE - -class BbServicePlugin - : public QMediaServiceProviderPlugin, - public QMediaServiceFeaturesInterface -{ - Q_OBJECT - Q_INTERFACES(QMediaServiceFeaturesInterface) - Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "blackberry_mediaservice.json") -public: - BbServicePlugin(); - - QMediaService *create(const QString &key) Q_DECL_OVERRIDE; - void release(QMediaService *service) Q_DECL_OVERRIDE; - QMediaServiceProviderHint::Features supportedFeatures(const QByteArray &service) const Q_DECL_OVERRIDE; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/blackberry/mediaservice/bbutil.cpp b/src/plugins/blackberry/mediaservice/bbutil.cpp deleted file mode 100644 index f79bcb1ba..000000000 --- a/src/plugins/blackberry/mediaservice/bbutil.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "bbutil.h" - -#include -#include - -QT_BEGIN_NAMESPACE - -struct MmError { - int errorCode; - const char *name; -}; - -#define MM_ERROR_ENTRY(error) { error, #error } -static const MmError mmErrors[] = { - MM_ERROR_ENTRY(MMR_ERROR_NONE), - MM_ERROR_ENTRY(MMR_ERROR_UNKNOWN ), - MM_ERROR_ENTRY(MMR_ERROR_INVALID_PARAMETER ), - MM_ERROR_ENTRY(MMR_ERROR_INVALID_STATE), - MM_ERROR_ENTRY(MMR_ERROR_UNSUPPORTED_VALUE), - MM_ERROR_ENTRY(MMR_ERROR_UNSUPPORTED_MEDIA_TYPE), - MM_ERROR_ENTRY(MMR_ERROR_MEDIA_PROTECTED), - MM_ERROR_ENTRY(MMR_ERROR_UNSUPPORTED_OPERATION), - MM_ERROR_ENTRY(MMR_ERROR_READ), - MM_ERROR_ENTRY(MMR_ERROR_WRITE), - MM_ERROR_ENTRY(MMR_ERROR_MEDIA_UNAVAILABLE), - MM_ERROR_ENTRY(MMR_ERROR_MEDIA_CORRUPTED), - MM_ERROR_ENTRY(MMR_ERROR_OUTPUT_UNAVAILABLE), - MM_ERROR_ENTRY(MMR_ERROR_NO_MEMORY), - MM_ERROR_ENTRY(MMR_ERROR_RESOURCE_UNAVAILABLE), - MM_ERROR_ENTRY(MMR_ERROR_MEDIA_DRM_NO_RIGHTS), - MM_ERROR_ENTRY(MMR_ERROR_DRM_CORRUPTED_DATA_STORE), - MM_ERROR_ENTRY(MMR_ERROR_DRM_OUTPUT_PROTECTION), - MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_HDMI), - MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_DISPLAYPORT), - MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_DVI), - MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_ANALOG_VIDEO), - MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_ANALOG_AUDIO), - MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_TOSLINK), - MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_SPDIF), - MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_BLUETOOTH), - MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_WIRELESSHD), -}; -static const int numMmErrors = sizeof(mmErrors) / sizeof(MmError); - -QString mmErrorMessage(const QString &msg, mmr_context_t *context, int *errorCode) -{ - const mmr_error_info_t * const mmError = mmr_error_info(context); - - if (errorCode) - *errorCode = mmError->error_code; - - if (mmError->error_code >= 0 && mmError->error_code < numMmErrors) { - return QString("%1: %2 (code %3)").arg(msg).arg(mmErrors[mmError->error_code].name) - .arg(mmError->error_code); - } else { - return QString("%1: Unknown error code %2").arg(msg).arg(mmError->error_code); - } -} - -QT_END_NAMESPACE diff --git a/src/plugins/blackberry/mediaservice/bbutil.h b/src/plugins/blackberry/mediaservice/bbutil.h deleted file mode 100644 index 44fde4ed4..000000000 --- a/src/plugins/blackberry/mediaservice/bbutil.h +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef BBUTIL_H -#define BBUTIL_H - -#include - -typedef struct mmr_context mmr_context_t; - -QT_BEGIN_NAMESPACE - -class QString; - -QString mmErrorMessage(const QString &msg, mmr_context_t *context, int * errorCode = 0); - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/blackberry/mediaservice/bbvideowindowcontrol.cpp b/src/plugins/blackberry/mediaservice/bbvideowindowcontrol.cpp deleted file mode 100644 index 5668332d1..000000000 --- a/src/plugins/blackberry/mediaservice/bbvideowindowcontrol.cpp +++ /dev/null @@ -1,415 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#include "bbvideowindowcontrol.h" -#include "bbutil.h" -#include -#include -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -static int winIdCounter = 0; - -BbVideoWindowControl::BbVideoWindowControl(QObject *parent) - : QVideoWindowControl(parent), - m_videoId(-1), - m_winId(0), - m_context(0), - m_fullscreen(false), - m_aspectRatioMode(Qt::IgnoreAspectRatio), - m_window(0), - m_hue(0), - m_brightness(0), - m_contrast(0), - m_saturation(0) -{ -} - -BbVideoWindowControl::~BbVideoWindowControl() -{ -} - -WId BbVideoWindowControl::winId() const -{ - return m_winId; -} - -void BbVideoWindowControl::setWinId(WId id) -{ - m_winId = id; -} - -QRect BbVideoWindowControl::displayRect() const -{ - return m_displayRect ; -} - -void BbVideoWindowControl::setDisplayRect(const QRect &rect) -{ - if (m_displayRect != rect) { - m_displayRect = rect; - updateVideoPosition(); - } -} - -bool BbVideoWindowControl::isFullScreen() const -{ - return m_fullscreen; -} - -void BbVideoWindowControl::setFullScreen(bool fullScreen) -{ - if (m_fullscreen != fullScreen) { - m_fullscreen = fullScreen; - updateVideoPosition(); - emit fullScreenChanged(m_fullscreen); - } -} - -void BbVideoWindowControl::repaint() -{ - // Nothing we can or should do here -} - -QSize BbVideoWindowControl::nativeSize() const -{ - return QSize(m_metaData.width(), m_metaData.height()); -} - -Qt::AspectRatioMode BbVideoWindowControl::aspectRatioMode() const -{ - return m_aspectRatioMode; -} - -void BbVideoWindowControl::setAspectRatioMode(Qt::AspectRatioMode mode) -{ - m_aspectRatioMode = mode; -} - -int BbVideoWindowControl::brightness() const -{ - return m_brightness; -} - -void BbVideoWindowControl::setBrightness(int brightness) -{ - if (m_brightness != brightness) { - m_brightness = brightness; - updateBrightness(); - emit brightnessChanged(m_brightness); - } -} - -int BbVideoWindowControl::contrast() const -{ - return m_contrast; -} - -void BbVideoWindowControl::setContrast(int contrast) -{ - if (m_contrast != contrast) { - m_contrast = contrast; - updateContrast(); - emit contrastChanged(m_contrast); - } -} - -int BbVideoWindowControl::hue() const -{ - return m_hue; -} - -void BbVideoWindowControl::setHue(int hue) -{ - if (m_hue != hue) { - m_hue = hue; - updateHue(); - emit hueChanged(m_hue); - } -} - -int BbVideoWindowControl::saturation() const -{ - return m_saturation; -} - -void BbVideoWindowControl::setSaturation(int saturation) -{ - if (m_saturation != saturation) { - m_saturation = saturation; - updateSaturation(); - emit saturationChanged(m_saturation); - } -} - -void BbVideoWindowControl::attachDisplay(mmr_context_t *context) -{ - if (m_videoId != -1) { - qDebug() << "BbVideoWindowControl: Video output already attached!"; - return; - } - - if (!context) { - qDebug() << "BbVideoWindowControl: No media player context!"; - return; - } - - QWindow * const window = findWindow(m_winId); - if (!window) { - qDebug() << "BbVideoWindowControl: No video window!"; - return; - } - - QPlatformNativeInterface * const nativeInterface = QGuiApplication::platformNativeInterface(); - if (!nativeInterface) { - qDebug() << "BbVideoWindowControl: Unable to get platform native interface. Qt too old?"; - return; - } - - const char * const groupNameData = static_cast( - nativeInterface->nativeResourceForWindow("windowGroup", window)); - if (!groupNameData) { - qDebug() << "BbVideoWindowControl: Unable to find window group for window" << window; - return; - } - - const QString groupName = QString::fromLatin1(groupNameData); - m_windowName = QString("BbVideoWindowControl_%1_%2").arg(winIdCounter++) - .arg(QCoreApplication::applicationPid()); - // Start with an invisible window. If it would be visible right away, it would be at the wrong - // position, and we can only change the position once we get the window handle. - const QString videoDeviceUrl = - QString("screen:?winid=%1&wingrp=%2&initflags=invisible&nodstviewport=1").arg(m_windowName).arg(groupName); - - m_videoId = mmr_output_attach(context, videoDeviceUrl.toLatin1(), "video"); - if (m_videoId == -1) { - qDebug() << mmErrorMessage("mmr_output_attach() for video failed", context); - return; - } - - m_context = context; - updateVideoPosition(); - updateHue(); - updateContrast(); - updateBrightness(); - updateSaturation(); -} - -void BbVideoWindowControl::updateVideoPosition() -{ - QWindow * const window = findWindow(m_winId); - if (m_context && m_videoId != -1 && window) { - QPoint topLeft = m_fullscreen ? - QPoint(0,0) : - window->mapToGlobal(m_displayRect.topLeft()); - - QScreen * const screen = window->screen(); - int width = m_fullscreen ? - screen->size().width() : - m_displayRect.width(); - int height = m_fullscreen ? - screen->size().height() : - m_displayRect.height(); - - if (m_metaData.hasVideo()) { // We need the source size to do aspect ratio scaling - const qreal sourceRatio = m_metaData.width() / static_cast(m_metaData.height()); - const qreal targetRatio = width / static_cast(height); - - if (m_aspectRatioMode == Qt::KeepAspectRatio) { - if (targetRatio < sourceRatio) { - // Need to make height smaller - const int newHeight = width / sourceRatio; - const int heightDiff = height - newHeight; - topLeft.ry() += heightDiff / 2; - height = newHeight; - } else { - // Need to make width smaller - const int newWidth = sourceRatio * height; - const int widthDiff = width - newWidth; - topLeft.rx() += widthDiff / 2; - width = newWidth; - } - - } else if (m_aspectRatioMode == Qt::KeepAspectRatioByExpanding) { - if (targetRatio < sourceRatio) { - // Need to make width larger - const int newWidth = sourceRatio * height; - const int widthDiff = newWidth - width; - topLeft.rx() -= widthDiff / 2; - width = newWidth; - } else { - // Need to make height larger - const int newHeight = width / sourceRatio; - const int heightDiff = newHeight - height; - topLeft.ry() -= heightDiff / 2; - height = newHeight; - } - } - } - - if (m_window != 0) { - const int position[2] = { topLeft.x(), topLeft.y() }; - const int size[2] = { width, height }; - const int visible = m_displayRect.isValid(); - if (screen_set_window_property_iv(m_window, SCREEN_PROPERTY_POSITION, position) != 0) - perror("Setting video position failed"); - if (screen_set_window_property_iv(m_window, SCREEN_PROPERTY_SIZE, size) != 0) - perror("Setting video size failed"); - if (screen_set_window_property_iv(m_window, SCREEN_PROPERTY_VISIBLE, &visible) != 0) - perror("Setting video visibility failed"); - } - } -} - -void BbVideoWindowControl::updateBrightness() -{ - if (m_window != 0) { - const int backendValue = m_brightness * 2.55f; - if (screen_set_window_property_iv(m_window, SCREEN_PROPERTY_BRIGHTNESS, &backendValue) != 0) - perror("Setting brightness failed"); - } -} - -void BbVideoWindowControl::updateContrast() -{ - if (m_window != 0) { - const int backendValue = m_contrast * 1.27f; - if (screen_set_window_property_iv(m_window, SCREEN_PROPERTY_CONTRAST, &backendValue) != 0) - perror("Setting contrast failed"); - } -} - -void BbVideoWindowControl::updateHue() -{ - if (m_window != 0) { - const int backendValue = m_hue * 1.27f; - if (screen_set_window_property_iv(m_window, SCREEN_PROPERTY_HUE, &backendValue) != 0) - perror("Setting hue failed"); - } -} - -void BbVideoWindowControl::updateSaturation() -{ - if (m_window != 0) { - const int backendValue = m_saturation * 1.27f; - if (screen_set_window_property_iv(m_window, SCREEN_PROPERTY_SATURATION, &backendValue) != 0) - perror("Setting saturation failed"); - } -} - -void BbVideoWindowControl::detachDisplay() -{ - if (m_context && m_videoId != -1) - mmr_output_detach(m_context, m_videoId); - - m_context = 0; - m_videoId = -1; - m_metaData.clear(); - m_windowName.clear(); - m_window = 0; - m_hue = 0; - m_brightness = 0; - m_contrast = 0; - m_saturation = 0; -} - -void BbVideoWindowControl::setMetaData(const BbMetaData &metaData) -{ - m_metaData = metaData; - emit nativeSizeChanged(); - - // To handle the updated source size data - updateVideoPosition(); -} - -void BbVideoWindowControl::bpsEventHandler(bps_event_t *event) -{ - if (event && bps_event_get_domain(event) == screen_get_domain()) { - const screen_event_t screen_event = screen_event_get_event(event); - - int eventType; - if (screen_get_event_property_iv(screen_event, SCREEN_PROPERTY_TYPE, &eventType) != 0) { - perror("BbVideoWindowControl: Failed to query screen event type"); - return; - } - - if (eventType != SCREEN_EVENT_CREATE) - return; - - screen_window_t window = 0; - if (screen_get_event_property_pv(screen_event, SCREEN_PROPERTY_WINDOW, (void**)&window) != 0) { - perror("BbVideoWindowControl: Failed to query window property"); - return; - } - - const int maxIdStrLength = 128; - char idString[maxIdStrLength]; - if (screen_get_window_property_cv(window, SCREEN_PROPERTY_ID_STRING, maxIdStrLength, idString) != 0) { - perror("BbVideoWindowControl: Failed to query window ID string"); - return; - } - - if (m_windowName == idString) { - m_window = window; - updateVideoPosition(); - - const int visibleFlag = 1; - if (screen_set_window_property_iv(m_window, SCREEN_PROPERTY_VISIBLE, &visibleFlag) != 0) { - perror("BbVideoWindowControl: Failed to make window visible"); - return; - } - } - } -} - -QWindow *BbVideoWindowControl::findWindow(WId id) const -{ - Q_FOREACH (QWindow *window, QGuiApplication::allWindows()) - if (window->winId() == id) - return window; - return 0; -} - -QT_END_NAMESPACE diff --git a/src/plugins/blackberry/mediaservice/bbvideowindowcontrol.h b/src/plugins/blackberry/mediaservice/bbvideowindowcontrol.h deleted file mode 100644 index 81bf79682..000000000 --- a/src/plugins/blackberry/mediaservice/bbvideowindowcontrol.h +++ /dev/null @@ -1,121 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2012 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef BBVIDEOWINDOWCONTROL_H -#define BBVIDEOWINDOWCONTROL_H - -#include "bbmetadata.h" -#include -#include - -typedef struct mmr_context mmr_context_t; -struct bps_event_t; - -QT_BEGIN_NAMESPACE - -class BbVideoWindowControl : public QVideoWindowControl -{ - Q_OBJECT -public: - explicit BbVideoWindowControl(QObject *parent = 0); - ~BbVideoWindowControl(); - - WId winId() const Q_DECL_OVERRIDE; - void setWinId(WId id) Q_DECL_OVERRIDE; - - QRect displayRect() const Q_DECL_OVERRIDE; - void setDisplayRect(const QRect &rect) Q_DECL_OVERRIDE; - - bool isFullScreen() const Q_DECL_OVERRIDE; - void setFullScreen(bool fullScreen) Q_DECL_OVERRIDE; - - void repaint() Q_DECL_OVERRIDE; - - QSize nativeSize() const Q_DECL_OVERRIDE; - - Qt::AspectRatioMode aspectRatioMode() const Q_DECL_OVERRIDE; - void setAspectRatioMode(Qt::AspectRatioMode mode) Q_DECL_OVERRIDE; - - int brightness() const Q_DECL_OVERRIDE; - void setBrightness(int brightness) Q_DECL_OVERRIDE; - - int contrast() const Q_DECL_OVERRIDE; - void setContrast(int contrast) Q_DECL_OVERRIDE; - - int hue() const Q_DECL_OVERRIDE; - void setHue(int hue) Q_DECL_OVERRIDE; - - int saturation() const Q_DECL_OVERRIDE; - void setSaturation(int saturation) Q_DECL_OVERRIDE; - - // - // Called by media control - // - void detachDisplay(); - void attachDisplay(mmr_context_t *context); - void setMetaData(const BbMetaData &metaData); - void bpsEventHandler(bps_event_t *event); - -private: - QWindow *findWindow(WId id) const; - void updateVideoPosition(); - void updateBrightness(); - void updateContrast(); - void updateHue(); - void updateSaturation(); - - int m_videoId; - WId m_winId; - QRect m_displayRect; - mmr_context_t *m_context; - bool m_fullscreen; - BbMetaData m_metaData; - Qt::AspectRatioMode m_aspectRatioMode; - QString m_windowName; - screen_window_t m_window; - int m_hue; - int m_brightness; - int m_contrast; - int m_saturation; -}; - -QT_END_NAMESPACE - -#endif diff --git a/src/plugins/blackberry/mediaservice/blackberry_mediaservice.json b/src/plugins/blackberry/mediaservice/blackberry_mediaservice.json deleted file mode 100644 index c4a27ea01..000000000 --- a/src/plugins/blackberry/mediaservice/blackberry_mediaservice.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "Keys": ["org.qt-project.qt.mediaplayer"] -} diff --git a/src/plugins/blackberry/mediaservice/mediaservice.pro b/src/plugins/blackberry/mediaservice/mediaservice.pro deleted file mode 100644 index ffaed4816..000000000 --- a/src/plugins/blackberry/mediaservice/mediaservice.pro +++ /dev/null @@ -1,26 +0,0 @@ -TARGET = qtmedia_blackberry -QT += multimedia-private gui-private - -PLUGIN_TYPE=mediaservice -PLUGIN_CLASS_NAME = BbServicePlugin -load(qt_plugin) - -LIBS += -lmmrndclient -lstrm -lscreen - -HEADERS += \ - bbserviceplugin.h \ - bbmediaplayerservice.h \ - bbmediaplayercontrol.h \ - bbmetadata.h \ - bbutil.h \ - bbvideowindowcontrol.h - -SOURCES += \ - bbserviceplugin.cpp \ - bbmediaplayerservice.cpp \ - bbmediaplayercontrol.cpp \ - bbmetadata.cpp \ - bbutil.cpp \ - bbvideowindowcontrol.cpp - -OTHER_FILES += blackberry_mediaservice.json -- cgit v1.2.3 From 7c1d490d1ab6a03dce390280e795a5b42468754e Mon Sep 17 00:00:00 2001 From: Thomas McGuire Date: Thu, 31 Jan 2013 17:14:42 +0100 Subject: Blackberry: Fix warning about unsigned integer comparison Change-Id: I00592dd078e85497589156e156e7a665f935d325 Reviewed-by: Sean Harmer --- src/plugins/blackberry/mediaplayer/bbutil.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/blackberry/mediaplayer/bbutil.cpp b/src/plugins/blackberry/mediaplayer/bbutil.cpp index f79bcb1ba..9fef98a3a 100644 --- a/src/plugins/blackberry/mediaplayer/bbutil.cpp +++ b/src/plugins/blackberry/mediaplayer/bbutil.cpp @@ -80,7 +80,7 @@ static const MmError mmErrors[] = { MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_BLUETOOTH), MM_ERROR_ENTRY(MMR_ERROR_DRM_OPL_WIRELESSHD), }; -static const int numMmErrors = sizeof(mmErrors) / sizeof(MmError); +static const unsigned int numMmErrors = sizeof(mmErrors) / sizeof(MmError); QString mmErrorMessage(const QString &msg, mmr_context_t *context, int *errorCode) { @@ -89,7 +89,7 @@ QString mmErrorMessage(const QString &msg, mmr_context_t *context, int *errorCod if (errorCode) *errorCode = mmError->error_code; - if (mmError->error_code >= 0 && mmError->error_code < numMmErrors) { + if (mmError->error_code < numMmErrors) { return QString("%1: %2 (code %3)").arg(msg).arg(mmErrors[mmError->error_code].name) .arg(mmError->error_code); } else { -- cgit v1.2.3 From 36655ccdfb55fc16044d6ebb78c27e98abf00019 Mon Sep 17 00:00:00 2001 From: Tobias Koenig Date: Thu, 31 Jan 2013 10:48:16 +0100 Subject: Blackberry: Add camera support for BB10 platform Reimplement all camera related controls as they are supported by the BB10 camera API. Change-Id: Ie7d2258be22c1c1821489bd7074b80cff4242afa Reviewed-by: Bernd Weimer Reviewed-by: Thomas McGuire --- src/plugins/blackberry/bbserviceplugin.cpp | 43 + src/plugins/blackberry/bbserviceplugin.h | 12 + src/plugins/blackberry/blackberry.pro | 1 + .../blackberry/blackberry_mediaservice.json | 2 +- .../camera/bbcameraaudioencodersettingscontrol.cpp | 89 ++ .../camera/bbcameraaudioencodersettingscontrol.h | 68 + .../camera/bbcameracapturebufferformatcontrol.cpp | 66 + .../camera/bbcameracapturebufferformatcontrol.h | 61 + .../camera/bbcameracapturedestinationcontrol.cpp | 70 + .../camera/bbcameracapturedestinationcontrol.h | 66 + src/plugins/blackberry/camera/bbcameracontrol.cpp | 92 ++ src/plugins/blackberry/camera/bbcameracontrol.h | 73 ++ .../blackberry/camera/bbcameraexposurecontrol.cpp | 232 ++++ .../blackberry/camera/bbcameraexposurecontrol.h | 73 ++ .../blackberry/camera/bbcameraflashcontrol.cpp | 113 ++ .../blackberry/camera/bbcameraflashcontrol.h | 68 + .../blackberry/camera/bbcamerafocuscontrol.cpp | 331 +++++ .../blackberry/camera/bbcamerafocuscontrol.h | 79 ++ .../camera/bbcameraimagecapturecontrol.cpp | 85 ++ .../camera/bbcameraimagecapturecontrol.h | 70 + .../camera/bbcameraimageprocessingcontrol.cpp | 146 +++ .../camera/bbcameraimageprocessingcontrol.h | 67 + .../blackberry/camera/bbcameralockscontrol.cpp | 75 ++ .../blackberry/camera/bbcameralockscontrol.h | 67 + .../camera/bbcameramediarecordercontrol.cpp | 158 +++ .../camera/bbcameramediarecordercontrol.h | 76 ++ .../camera/bbcameraorientationhandler.cpp | 100 ++ .../blackberry/camera/bbcameraorientationhandler.h | 69 + src/plugins/blackberry/camera/bbcameraservice.cpp | 141 ++ src/plugins/blackberry/camera/bbcameraservice.h | 104 ++ src/plugins/blackberry/camera/bbcamerasession.cpp | 1343 ++++++++++++++++++++ src/plugins/blackberry/camera/bbcamerasession.h | 234 ++++ .../camera/bbcameravideoencodersettingscontrol.cpp | 90 ++ .../camera/bbcameravideoencodersettingscontrol.h | 69 + .../camera/bbcameraviewfindersettingscontrol.cpp | 247 ++++ .../camera/bbcameraviewfindersettingscontrol.h | 66 + .../blackberry/camera/bbcamerazoomcontrol.cpp | 157 +++ .../blackberry/camera/bbcamerazoomcontrol.h | 79 ++ .../blackberry/camera/bbimageencodercontrol.cpp | 81 ++ .../blackberry/camera/bbimageencodercontrol.h | 68 + .../blackberry/camera/bbmediastoragelocation.cpp | 119 ++ .../blackberry/camera/bbmediastoragelocation.h | 66 + .../camera/bbvideodeviceselectorcontrol.cpp | 146 +++ .../camera/bbvideodeviceselectorcontrol.h | 79 ++ .../blackberry/camera/bbvideorenderercontrol.cpp | 64 + .../blackberry/camera/bbvideorenderercontrol.h | 65 + src/plugins/blackberry/camera/camera.pri | 49 + 47 files changed, 5718 insertions(+), 1 deletion(-) create mode 100644 src/plugins/blackberry/camera/bbcameraaudioencodersettingscontrol.cpp create mode 100644 src/plugins/blackberry/camera/bbcameraaudioencodersettingscontrol.h create mode 100644 src/plugins/blackberry/camera/bbcameracapturebufferformatcontrol.cpp create mode 100644 src/plugins/blackberry/camera/bbcameracapturebufferformatcontrol.h create mode 100644 src/plugins/blackberry/camera/bbcameracapturedestinationcontrol.cpp create mode 100644 src/plugins/blackberry/camera/bbcameracapturedestinationcontrol.h create mode 100644 src/plugins/blackberry/camera/bbcameracontrol.cpp create mode 100644 src/plugins/blackberry/camera/bbcameracontrol.h create mode 100644 src/plugins/blackberry/camera/bbcameraexposurecontrol.cpp create mode 100644 src/plugins/blackberry/camera/bbcameraexposurecontrol.h create mode 100644 src/plugins/blackberry/camera/bbcameraflashcontrol.cpp create mode 100644 src/plugins/blackberry/camera/bbcameraflashcontrol.h create mode 100644 src/plugins/blackberry/camera/bbcamerafocuscontrol.cpp create mode 100644 src/plugins/blackberry/camera/bbcamerafocuscontrol.h create mode 100644 src/plugins/blackberry/camera/bbcameraimagecapturecontrol.cpp create mode 100644 src/plugins/blackberry/camera/bbcameraimagecapturecontrol.h create mode 100644 src/plugins/blackberry/camera/bbcameraimageprocessingcontrol.cpp create mode 100644 src/plugins/blackberry/camera/bbcameraimageprocessingcontrol.h create mode 100644 src/plugins/blackberry/camera/bbcameralockscontrol.cpp create mode 100644 src/plugins/blackberry/camera/bbcameralockscontrol.h create mode 100644 src/plugins/blackberry/camera/bbcameramediarecordercontrol.cpp create mode 100644 src/plugins/blackberry/camera/bbcameramediarecordercontrol.h create mode 100644 src/plugins/blackberry/camera/bbcameraorientationhandler.cpp create mode 100644 src/plugins/blackberry/camera/bbcameraorientationhandler.h create mode 100644 src/plugins/blackberry/camera/bbcameraservice.cpp create mode 100644 src/plugins/blackberry/camera/bbcameraservice.h create mode 100644 src/plugins/blackberry/camera/bbcamerasession.cpp create mode 100644 src/plugins/blackberry/camera/bbcamerasession.h create mode 100644 src/plugins/blackberry/camera/bbcameravideoencodersettingscontrol.cpp create mode 100644 src/plugins/blackberry/camera/bbcameravideoencodersettingscontrol.h create mode 100644 src/plugins/blackberry/camera/bbcameraviewfindersettingscontrol.cpp create mode 100644 src/plugins/blackberry/camera/bbcameraviewfindersettingscontrol.h create mode 100644 src/plugins/blackberry/camera/bbcamerazoomcontrol.cpp create mode 100644 src/plugins/blackberry/camera/bbcamerazoomcontrol.h create mode 100644 src/plugins/blackberry/camera/bbimageencodercontrol.cpp create mode 100644 src/plugins/blackberry/camera/bbimageencodercontrol.h create mode 100644 src/plugins/blackberry/camera/bbmediastoragelocation.cpp create mode 100644 src/plugins/blackberry/camera/bbmediastoragelocation.h create mode 100644 src/plugins/blackberry/camera/bbvideodeviceselectorcontrol.cpp create mode 100644 src/plugins/blackberry/camera/bbvideodeviceselectorcontrol.h create mode 100644 src/plugins/blackberry/camera/bbvideorenderercontrol.cpp create mode 100644 src/plugins/blackberry/camera/bbvideorenderercontrol.h create mode 100644 src/plugins/blackberry/camera/camera.pri diff --git a/src/plugins/blackberry/bbserviceplugin.cpp b/src/plugins/blackberry/bbserviceplugin.cpp index 92dc4aee4..90364f3f8 100644 --- a/src/plugins/blackberry/bbserviceplugin.cpp +++ b/src/plugins/blackberry/bbserviceplugin.cpp @@ -39,7 +39,12 @@ ** ****************************************************************************/ #include "bbserviceplugin.h" + +#include "bbcameraservice.h" #include "bbmediaplayerservice.h" +#include "bbvideodeviceselectorcontrol.h" + +#include QT_BEGIN_NAMESPACE @@ -49,6 +54,9 @@ BbServicePlugin::BbServicePlugin() QMediaService *BbServicePlugin::create(const QString &key) { + if (key == QLatin1String(Q_MEDIASERVICE_CAMERA)) + return new BbCameraService(); + if (key == QLatin1String(Q_MEDIASERVICE_MEDIAPLAYER)) return new BbMediaPlayerService(); @@ -66,4 +74,39 @@ QMediaServiceProviderHint::Features BbServicePlugin::supportedFeatures(const QBy return QMediaServiceProviderHint::Features(); } +QList BbServicePlugin::devices(const QByteArray &service) const +{ + if (service == Q_MEDIASERVICE_CAMERA) { + if (m_cameraDevices.isEmpty()) + updateDevices(); + + return m_cameraDevices; + } + + return QList(); +} + +QString BbServicePlugin::deviceDescription(const QByteArray &service, const QByteArray &device) +{ + if (service == Q_MEDIASERVICE_CAMERA) { + if (m_cameraDevices.isEmpty()) + updateDevices(); + + for (int i = 0; i < m_cameraDevices.count(); i++) + if (m_cameraDevices[i] == device) + return m_cameraDescriptions[i]; + } + + return QString(); +} + +void BbServicePlugin::updateDevices() const +{ + BbVideoDeviceSelectorControl::enumerateDevices(&m_cameraDevices, &m_cameraDescriptions); + + if (m_cameraDevices.isEmpty()) { + qWarning() << "No camera devices found"; + } +} + QT_END_NAMESPACE diff --git a/src/plugins/blackberry/bbserviceplugin.h b/src/plugins/blackberry/bbserviceplugin.h index dbf507f10..62fc4a0df 100644 --- a/src/plugins/blackberry/bbserviceplugin.h +++ b/src/plugins/blackberry/bbserviceplugin.h @@ -47,9 +47,11 @@ QT_BEGIN_NAMESPACE class BbServicePlugin : public QMediaServiceProviderPlugin, + public QMediaServiceSupportedDevicesInterface, public QMediaServiceFeaturesInterface { Q_OBJECT + Q_INTERFACES(QMediaServiceSupportedDevicesInterface) Q_INTERFACES(QMediaServiceFeaturesInterface) Q_PLUGIN_METADATA(IID "org.qt-project.qt.mediaserviceproviderfactory/5.0" FILE "blackberry_mediaservice.json") public: @@ -58,6 +60,16 @@ public: QMediaService *create(const QString &key) Q_DECL_OVERRIDE; void release(QMediaService *service) Q_DECL_OVERRIDE; QMediaServiceProviderHint::Features supportedFeatures(const QByteArray &service) const Q_DECL_OVERRIDE; + + QList devices(const QByteArray &service) const Q_DECL_OVERRIDE; + QString deviceDescription(const QByteArray &service, const QByteArray &device) Q_DECL_OVERRIDE; + QVariant deviceProperty(const QByteArray &service, const QByteArray &device, const QByteArray &property) Q_DECL_OVERRIDE; + +private: + void updateDevices() const; + + mutable QList m_cameraDevices; + mutable QStringList m_cameraDescriptions; }; QT_END_NAMESPACE diff --git a/src/plugins/blackberry/blackberry.pro b/src/plugins/blackberry/blackberry.pro index ef414d7eb..3d9488a3c 100644 --- a/src/plugins/blackberry/blackberry.pro +++ b/src/plugins/blackberry/blackberry.pro @@ -10,6 +10,7 @@ LIBS += -lscreen HEADERS += bbserviceplugin.h SOURCES += bbserviceplugin.cpp +include(camera/camera.pri) include(mediaplayer/mediaplayer.pri) OTHER_FILES += blackberry_mediaservice.json diff --git a/src/plugins/blackberry/blackberry_mediaservice.json b/src/plugins/blackberry/blackberry_mediaservice.json index c4a27ea01..54c1c9f04 100644 --- a/src/plugins/blackberry/blackberry_mediaservice.json +++ b/src/plugins/blackberry/blackberry_mediaservice.json @@ -1,3 +1,3 @@ { - "Keys": ["org.qt-project.qt.mediaplayer"] + "Keys": ["org.qt-project.qt.camera", "org.qt-project.qt.mediaplayer"] } diff --git a/src/plugins/blackberry/camera/bbcameraaudioencodersettingscontrol.cpp b/src/plugins/blackberry/camera/bbcameraaudioencodersettingscontrol.cpp new file mode 100644 index 000000000..2ff800a0f --- /dev/null +++ b/src/plugins/blackberry/camera/bbcameraaudioencodersettingscontrol.cpp @@ -0,0 +1,89 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "bbcameraaudioencodersettingscontrol.h" + +#include "bbcamerasession.h" + +QT_BEGIN_NAMESPACE + +BbCameraAudioEncoderSettingsControl::BbCameraAudioEncoderSettingsControl(BbCameraSession *session, QObject *parent) + : QAudioEncoderSettingsControl(parent) + , m_session(session) +{ +} + +QStringList BbCameraAudioEncoderSettingsControl::supportedAudioCodecs() const +{ + return QStringList() << QLatin1String("none") << QLatin1String("aac") << QLatin1String("raw"); +} + +QString BbCameraAudioEncoderSettingsControl::codecDescription(const QString &codecName) const +{ + if (codecName == QLatin1String("none")) + return tr("No compression"); + else if (codecName == QLatin1String("aac")) + return tr("AAC compression"); + else if (codecName == QLatin1String("raw")) + return tr("PCM uncompressed"); + + return QString(); +} + +QList BbCameraAudioEncoderSettingsControl::supportedSampleRates(const QAudioEncoderSettings &settings, bool *continuous) const +{ + Q_UNUSED(settings); + Q_UNUSED(continuous); + + // no API provided by BB10 yet + return QList(); +} + +QAudioEncoderSettings BbCameraAudioEncoderSettingsControl::audioSettings() const +{ + return m_session->audioSettings(); +} + +void BbCameraAudioEncoderSettingsControl::setAudioSettings(const QAudioEncoderSettings &settings) +{ + m_session->setAudioSettings(settings); +} + +QT_END_NAMESPACE diff --git a/src/plugins/blackberry/camera/bbcameraaudioencodersettingscontrol.h b/src/plugins/blackberry/camera/bbcameraaudioencodersettingscontrol.h new file mode 100644 index 000000000..21fb520e7 --- /dev/null +++ b/src/plugins/blackberry/camera/bbcameraaudioencodersettingscontrol.h @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BBCAMERAAUDIOENCODERSETTINGSCONTROL_H +#define BBCAMERAAUDIOENCODERSETTINGSCONTROL_H + +#include + +QT_BEGIN_NAMESPACE + +class BbCameraSession; + +class BbCameraAudioEncoderSettingsControl : public QAudioEncoderSettingsControl +{ + Q_OBJECT +public: + explicit BbCameraAudioEncoderSettingsControl(BbCameraSession *session, QObject *parent = 0); + + QStringList supportedAudioCodecs() const Q_DECL_OVERRIDE; + QString codecDescription(const QString &codecName) const Q_DECL_OVERRIDE; + QList supportedSampleRates(const QAudioEncoderSettings &settings, bool *continuous = 0) const Q_DECL_OVERRIDE; + QAudioEncoderSettings audioSettings() const Q_DECL_OVERRIDE; + void setAudioSettings(const QAudioEncoderSettings &settings) Q_DECL_OVERRIDE; + +private: + BbCameraSession *m_session; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/blackberry/camera/bbcameracapturebufferformatcontrol.cpp b/src/plugins/blackberry/camera/bbcameracapturebufferformatcontrol.cpp new file mode 100644 index 000000000..57f3c9fb1 --- /dev/null +++ b/src/plugins/blackberry/camera/bbcameracapturebufferformatcontrol.cpp @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "bbcameracapturebufferformatcontrol.h" + +QT_BEGIN_NAMESPACE + +BbCameraCaptureBufferFormatControl::BbCameraCaptureBufferFormatControl(QObject *parent) + : QCameraCaptureBufferFormatControl(parent) +{ +} + +QList BbCameraCaptureBufferFormatControl::supportedBufferFormats() const +{ + return (QList() << QVideoFrame::Format_Jpeg); +} + +QVideoFrame::PixelFormat BbCameraCaptureBufferFormatControl::bufferFormat() const +{ + return QVideoFrame::Format_Jpeg; +} + +void BbCameraCaptureBufferFormatControl::setBufferFormat(QVideoFrame::PixelFormat format) +{ + Q_UNUSED(format) + // Do nothing, we support only Jpeg for now +} + +QT_END_NAMESPACE diff --git a/src/plugins/blackberry/camera/bbcameracapturebufferformatcontrol.h b/src/plugins/blackberry/camera/bbcameracapturebufferformatcontrol.h new file mode 100644 index 000000000..2897cb2fd --- /dev/null +++ b/src/plugins/blackberry/camera/bbcameracapturebufferformatcontrol.h @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BBCAMERACAPTUREBUFFERFORMATCONTROL_H +#define BBCAMERACAPTUREBUFFERFORMATCONTROL_H + +#include + +QT_BEGIN_NAMESPACE + +class BbCameraCaptureBufferFormatControl : public QCameraCaptureBufferFormatControl +{ + Q_OBJECT +public: + explicit BbCameraCaptureBufferFormatControl(QObject *parent = 0); + + QList supportedBufferFormats() const Q_DECL_OVERRIDE; + QVideoFrame::PixelFormat bufferFormat() const Q_DECL_OVERRIDE; + void setBufferFormat(QVideoFrame::PixelFormat format) Q_DECL_OVERRIDE; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/blackberry/camera/bbcameracapturedestinationcontrol.cpp b/src/plugins/blackberry/camera/bbcameracapturedestinationcontrol.cpp new file mode 100644 index 000000000..6b6bcfcb9 --- /dev/null +++ b/src/plugins/blackberry/camera/bbcameracapturedestinationcontrol.cpp @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "bbcameracapturedestinationcontrol.h" + +#include "bbcamerasession.h" + +QT_BEGIN_NAMESPACE + +BbCameraCaptureDestinationControl::BbCameraCaptureDestinationControl(BbCameraSession *session, QObject *parent) + : QCameraCaptureDestinationControl(parent) + , m_session(session) +{ + connect(m_session, SIGNAL(captureDestinationChanged(QCameraImageCapture::CaptureDestinations)), + this, SIGNAL(captureDestinationChanged(QCameraImageCapture::CaptureDestinations))); +} + +bool BbCameraCaptureDestinationControl::isCaptureDestinationSupported(QCameraImageCapture::CaptureDestinations destination) const +{ + return m_session->isCaptureDestinationSupported(destination); +} + +QCameraImageCapture::CaptureDestinations BbCameraCaptureDestinationControl::captureDestination() const +{ + return m_session->captureDestination();; +} + +void BbCameraCaptureDestinationControl::setCaptureDestination(QCameraImageCapture::CaptureDestinations destination) +{ + m_session->setCaptureDestination(destination); +} + +QT_END_NAMESPACE diff --git a/src/plugins/blackberry/camera/bbcameracapturedestinationcontrol.h b/src/plugins/blackberry/camera/bbcameracapturedestinationcontrol.h new file mode 100644 index 000000000..93a7d2d14 --- /dev/null +++ b/src/plugins/blackberry/camera/bbcameracapturedestinationcontrol.h @@ -0,0 +1,66 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BBCAMERACAPTUREDESTINATIONCONTROL_H +#define BBCAMERACAPTUREDESTINATIONCONTROL_H + +#include + +QT_BEGIN_NAMESPACE + +class BbCameraSession; + +class BbCameraCaptureDestinationControl : public QCameraCaptureDestinationControl +{ + Q_OBJECT +public: + explicit BbCameraCaptureDestinationControl(BbCameraSession *session, QObject *parent = 0); + + bool isCaptureDestinationSupported(QCameraImageCapture::CaptureDestinations destination) const Q_DECL_OVERRIDE; + QCameraImageCapture::CaptureDestinations captureDestination() const Q_DECL_OVERRIDE; + void setCaptureDestination(QCameraImageCapture::CaptureDestinations destination) Q_DECL_OVERRIDE; + +private: + BbCameraSession *m_session; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/blackberry/camera/bbcameracontrol.cpp b/src/plugins/blackberry/camera/bbcameracontrol.cpp new file mode 100644 index 000000000..bc3c78264 --- /dev/null +++ b/src/plugins/blackberry/camera/bbcameracontrol.cpp @@ -0,0 +1,92 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "bbcameracontrol.h" + +#include "bbcamerasession.h" + +QT_BEGIN_NAMESPACE + +BbCameraControl::BbCameraControl(BbCameraSession *session, QObject *parent) + : QCameraControl(parent) + , m_session(session) +{ + connect(m_session, SIGNAL(statusChanged(QCamera::Status)), this, SIGNAL(statusChanged(QCamera::Status))); + connect(m_session, SIGNAL(stateChanged(QCamera::State)), this, SIGNAL(stateChanged(QCamera::State))); + connect(m_session, SIGNAL(error(int,QString)), this, SIGNAL(error(int,QString))); + connect(m_session, SIGNAL(captureModeChanged(QCamera::CaptureModes)), this, SIGNAL(captureModeChanged(QCamera::CaptureModes))); +} + +QCamera::State BbCameraControl::state() const +{ + return m_session->state(); +} + +void BbCameraControl::setState(QCamera::State state) +{ + m_session->setState(state); +} + +QCamera::CaptureModes BbCameraControl::captureMode() const +{ + return m_session->captureMode(); +} + +void BbCameraControl::setCaptureMode(QCamera::CaptureModes mode) +{ + m_session->setCaptureMode(mode); +} + +QCamera::Status BbCameraControl::status() const +{ + return m_session->status(); +} + +bool BbCameraControl::isCaptureModeSupported(QCamera::CaptureModes mode) const +{ + return m_session->isCaptureModeSupported(mode); +} + +bool BbCameraControl::canChangeProperty(PropertyChangeType /* changeType */, QCamera::Status /* status */) const +{ + return false; +} + +QT_END_NAMESPACE diff --git a/src/plugins/blackberry/camera/bbcameracontrol.h b/src/plugins/blackberry/camera/bbcameracontrol.h new file mode 100644 index 000000000..a5792c5df --- /dev/null +++ b/src/plugins/blackberry/camera/bbcameracontrol.h @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BBCAMERACONTROL_H +#define BBCAMERACONTROL_H + +#include + +QT_BEGIN_NAMESPACE + +class BbCameraSession; + +class BbCameraControl : public QCameraControl +{ + Q_OBJECT +public: + explicit BbCameraControl(BbCameraSession *session, QObject *parent = 0); + + QCamera::State state() const Q_DECL_OVERRIDE; + void setState(QCamera::State state) Q_DECL_OVERRIDE; + + QCamera::Status status() const Q_DECL_OVERRIDE; + + QCamera::CaptureModes captureMode() const Q_DECL_OVERRIDE; + void setCaptureMode(QCamera::CaptureModes) Q_DECL_OVERRIDE; + bool isCaptureModeSupported(QCamera::CaptureModes mode) const Q_DECL_OVERRIDE; + + bool canChangeProperty(PropertyChangeType changeType, QCamera::Status status) const Q_DECL_OVERRIDE; + +private: + BbCameraSession *m_session; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/blackberry/camera/bbcameraexposurecontrol.cpp b/src/plugins/blackberry/camera/bbcameraexposurecontrol.cpp new file mode 100644 index 000000000..a24fdbaf1 --- /dev/null +++ b/src/plugins/blackberry/camera/bbcameraexposurecontrol.cpp @@ -0,0 +1,232 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "bbcameraexposurecontrol.h" + +#include "bbcamerasession.h" + +#include + +QT_BEGIN_NAMESPACE + +BbCameraExposureControl::BbCameraExposureControl(BbCameraSession *session, QObject *parent) + : QCameraExposureControl(parent) + , m_session(session) + , m_requestedExposureMode(QCameraExposure::ExposureAuto) +{ + connect(m_session, SIGNAL(statusChanged(QCamera::Status)), this, SLOT(statusChanged(QCamera::Status))); +} + +bool BbCameraExposureControl::isParameterSupported(ExposureParameter parameter) const +{ + switch (parameter) { + case QCameraExposureControl::ISO: + return false; + case QCameraExposureControl::Aperture: + return false; + case QCameraExposureControl::ShutterSpeed: + return false; + case QCameraExposureControl::ExposureCompensation: + return false; + case QCameraExposureControl::FlashPower: + return false; + case QCameraExposureControl::FlashCompensation: + return false; + case QCameraExposureControl::TorchPower: + return false; + case QCameraExposureControl::SpotMeteringPoint: + return false; + case QCameraExposureControl::ExposureMode: + return true; + case QCameraExposureControl::MeteringMode: + return false; + default: + return false; + } +} + +QVariantList BbCameraExposureControl::supportedParameterRange(ExposureParameter parameter, bool *continuous) const +{ + if (parameter != QCameraExposureControl::ExposureMode) // no other parameter supported by BB10 API at the moment + return QVariantList(); + + if (m_session->status() != QCamera::ActiveStatus) // we can query supported exposure modes only with active viewfinder + return QVariantList(); + + if (continuous) + *continuous = false; + + int supported = 0; + camera_scenemode_t modes[20]; + const camera_error_t result = camera_get_scene_modes(m_session->handle(), 20, &supported, modes); + if (result != CAMERA_EOK) { + qWarning() << "Unable to retrieve supported scene modes:" << result; + return QVariantList(); + } + + QVariantList exposureModes; + for (int i = 0; i < supported; ++i) { + switch (modes[i]) { + case CAMERA_SCENE_AUTO: + exposureModes << QVariant::fromValue(QCameraExposure::ExposureAuto); + break; + case CAMERA_SCENE_SPORTS: + exposureModes << QVariant::fromValue(QCameraExposure::ExposureSports); + break; + case CAMERA_SCENE_CLOSEUP: + exposureModes << QVariant::fromValue(QCameraExposure::ExposurePortrait); + break; + case CAMERA_SCENE_ACTION: + exposureModes << QVariant::fromValue(QCameraExposure::ExposureSports); + break; + case CAMERA_SCENE_BEACHANDSNOW: + exposureModes << QVariant::fromValue(QCameraExposure::ExposureBeach) << QVariant::fromValue(QCameraExposure::ExposureSnow); + break; + case CAMERA_SCENE_NIGHT: + exposureModes << QVariant::fromValue(QCameraExposure::ExposureNight); + break; + default: break; + } + } + + return exposureModes; +} + +QVariant BbCameraExposureControl::requestedValue(ExposureParameter parameter) const +{ + if (parameter != QCameraExposureControl::ExposureMode) // no other parameter supported by BB10 API at the moment + return QVariant(); + + return QVariant::fromValue(m_requestedExposureMode); +} + +QVariant BbCameraExposureControl::actualValue(ExposureParameter parameter) const +{ + if (parameter != QCameraExposureControl::ExposureMode) // no other parameter supported by BB10 API at the moment + return QVariantList(); + + if (m_session->status() != QCamera::ActiveStatus) // we can query actual scene modes only with active viewfinder + return QVariantList(); + + camera_scenemode_t sceneMode = CAMERA_SCENE_DEFAULT; + const camera_error_t result = camera_get_scene_mode(m_session->handle(), &sceneMode); + + if (result != CAMERA_EOK) { + qWarning() << "Unable to retrieve scene mode:" << result; + return QVariant(); + } + + switch (sceneMode) { + case CAMERA_SCENE_AUTO: + return QVariant::fromValue(QCameraExposure::ExposureAuto); + case CAMERA_SCENE_SPORTS: + return QVariant::fromValue(QCameraExposure::ExposureSports); + case CAMERA_SCENE_CLOSEUP: + return QVariant::fromValue(QCameraExposure::ExposurePortrait); + case CAMERA_SCENE_ACTION: + return QVariant::fromValue(QCameraExposure::ExposureSports); + case CAMERA_SCENE_BEACHANDSNOW: + return (m_requestedExposureMode == QCameraExposure::ExposureBeach ? QVariant::fromValue(QCameraExposure::ExposureBeach) + : QVariant::fromValue(QCameraExposure::ExposureSnow)); + case CAMERA_SCENE_NIGHT: + return QVariant::fromValue(QCameraExposure::ExposureNight); + default: + return QVariant(); + } +} + +bool BbCameraExposureControl::setValue(ExposureParameter parameter, const QVariant& value) +{ + if (parameter != QCameraExposureControl::ExposureMode) // no other parameter supported by BB10 API at the moment + return false; + + if (m_session->status() != QCamera::ActiveStatus) // we can set actual scene modes only with active viewfinder + return false; + + camera_scenemode_t sceneMode = CAMERA_SCENE_DEFAULT; + + if (value.isValid()) { + m_requestedExposureMode = value.value(); + emit requestedValueChanged(QCameraExposureControl::ExposureMode); + + switch (m_requestedExposureMode) { + case QCameraExposure::ExposureAuto: + sceneMode = CAMERA_SCENE_AUTO; + break; + case QCameraExposure::ExposureSports: + sceneMode = CAMERA_SCENE_SPORTS; + break; + case QCameraExposure::ExposurePortrait: + sceneMode = CAMERA_SCENE_CLOSEUP; + break; + case QCameraExposure::ExposureBeach: + sceneMode = CAMERA_SCENE_BEACHANDSNOW; + break; + case QCameraExposure::ExposureSnow: + sceneMode = CAMERA_SCENE_BEACHANDSNOW; + break; + case QCameraExposure::ExposureNight: + sceneMode = CAMERA_SCENE_NIGHT; + break; + default: + sceneMode = CAMERA_SCENE_DEFAULT; + break; + } + } + + const camera_error_t result = camera_set_scene_mode(m_session->handle(), sceneMode); + + if (result != CAMERA_EOK) { + qWarning() << "Unable to set scene mode:" << result; + return false; + } + + emit actualValueChanged(QCameraExposureControl::ExposureMode); + + return true; +} + +void BbCameraExposureControl::statusChanged(QCamera::Status status) +{ + if (status == QCamera::ActiveStatus || status == QCamera::LoadedStatus) + emit parameterRangeChanged(QCameraExposureControl::ExposureMode); +} + +QT_END_NAMESPACE diff --git a/src/plugins/blackberry/camera/bbcameraexposurecontrol.h b/src/plugins/blackberry/camera/bbcameraexposurecontrol.h new file mode 100644 index 000000000..f4659b624 --- /dev/null +++ b/src/plugins/blackberry/camera/bbcameraexposurecontrol.h @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BBCAMERAEXPOSURECONTROL_H +#define BBCAMERAEXPOSURECONTROL_H + +#include + +QT_BEGIN_NAMESPACE + +class BbCameraSession; + +class BbCameraExposureControl : public QCameraExposureControl +{ + Q_OBJECT +public: + explicit BbCameraExposureControl(BbCameraSession *session, QObject *parent = 0); + + virtual bool isParameterSupported(ExposureParameter parameter) const Q_DECL_OVERRIDE; + virtual QVariantList supportedParameterRange(ExposureParameter parameter, bool *continuous) const Q_DECL_OVERRIDE; + + virtual QVariant requestedValue(ExposureParameter parameter) const Q_DECL_OVERRIDE; + virtual QVariant actualValue(ExposureParameter parameter) const Q_DECL_OVERRIDE; + virtual bool setValue(ExposureParameter parameter, const QVariant& value) Q_DECL_OVERRIDE; + +private Q_SLOTS: + void statusChanged(QCamera::Status status); + +private: + BbCameraSession *m_session; + QCameraExposure::ExposureMode m_requestedExposureMode; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/blackberry/camera/bbcameraflashcontrol.cpp b/src/plugins/blackberry/camera/bbcameraflashcontrol.cpp new file mode 100644 index 000000000..06ebe01f6 --- /dev/null +++ b/src/plugins/blackberry/camera/bbcameraflashcontrol.cpp @@ -0,0 +1,113 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "bbcameraflashcontrol.h" + +#include "bbcamerasession.h" + +#include + +QT_BEGIN_NAMESPACE + +BbCameraFlashControl::BbCameraFlashControl(BbCameraSession *session, QObject *parent) + : QCameraFlashControl(parent) + , m_session(session) + , m_flashMode(QCameraExposure::FlashAuto) +{ +} + +QCameraExposure::FlashModes BbCameraFlashControl::flashMode() const +{ + return m_flashMode; +} + +void BbCameraFlashControl::setFlashMode(QCameraExposure::FlashModes mode) +{ + if (m_flashMode == mode) + return; + + if (m_session->status() != QCamera::ActiveStatus) // can only be changed when viewfinder is active + return; + + if (m_flashMode == QCameraExposure::FlashVideoLight) { + const camera_error_t result = camera_config_videolight(m_session->handle(), CAMERA_VIDEOLIGHT_OFF); + if (result != CAMERA_EOK) + qWarning() << "Unable to switch off video light:" << result; + } + + m_flashMode = mode; + + if (m_flashMode == QCameraExposure::FlashVideoLight) { + const camera_error_t result = camera_config_videolight(m_session->handle(), CAMERA_VIDEOLIGHT_ON); + if (result != CAMERA_EOK) + qWarning() << "Unable to switch on video light:" << result; + } else { + camera_flashmode_t flashMode = CAMERA_FLASH_AUTO; + + if (m_flashMode.testFlag(QCameraExposure::FlashAuto)) flashMode = CAMERA_FLASH_AUTO; + else if (mode.testFlag(QCameraExposure::FlashOff)) flashMode = CAMERA_FLASH_OFF; + else if (mode.testFlag(QCameraExposure::FlashOn)) flashMode = CAMERA_FLASH_ON; + + const camera_error_t result = camera_config_flash(m_session->handle(), flashMode); + if (result != CAMERA_EOK) + qWarning() << "Unable to configure flash:" << result; + } +} + +bool BbCameraFlashControl::isFlashModeSupported(QCameraExposure::FlashModes mode) const +{ + bool supportsVideoLight = false; + if (m_session->handle() != CAMERA_HANDLE_INVALID) { + supportsVideoLight = camera_has_feature(m_session->handle(), CAMERA_FEATURE_VIDEOLIGHT); + } + + return (mode == QCameraExposure::FlashOff || + mode == QCameraExposure::FlashOn || + mode == QCameraExposure::FlashAuto || + ((mode == QCameraExposure::FlashVideoLight) && supportsVideoLight)); +} + +bool BbCameraFlashControl::isFlashReady() const +{ + //TODO: check for flash charge-level here?!? + return true; +} + +QT_END_NAMESPACE diff --git a/src/plugins/blackberry/camera/bbcameraflashcontrol.h b/src/plugins/blackberry/camera/bbcameraflashcontrol.h new file mode 100644 index 000000000..d46dc8c12 --- /dev/null +++ b/src/plugins/blackberry/camera/bbcameraflashcontrol.h @@ -0,0 +1,68 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BBCAMERAFLASHCONTROL_H +#define BBCAMERAFLASHCONTROL_H + +#include + +QT_BEGIN_NAMESPACE + +class BbCameraSession; + +class BbCameraFlashControl : public QCameraFlashControl +{ + Q_OBJECT +public: + explicit BbCameraFlashControl(BbCameraSession *session, QObject *parent = 0); + + QCameraExposure::FlashModes flashMode() const Q_DECL_OVERRIDE; + void setFlashMode(QCameraExposure::FlashModes mode) Q_DECL_OVERRIDE; + bool isFlashModeSupported(QCameraExposure::FlashModes mode) const Q_DECL_OVERRIDE; + bool isFlashReady() const Q_DECL_OVERRIDE; + +private: + BbCameraSession *m_session; + QCameraExposure::FlashModes m_flashMode; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/blackberry/camera/bbcamerafocuscontrol.cpp b/src/plugins/blackberry/camera/bbcamerafocuscontrol.cpp new file mode 100644 index 000000000..e0b57d6c6 --- /dev/null +++ b/src/plugins/blackberry/camera/bbcamerafocuscontrol.cpp @@ -0,0 +1,331 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "bbcamerafocuscontrol.h" + +#include "bbcamerasession.h" + +#include + +QT_BEGIN_NAMESPACE + +BbCameraFocusControl::BbCameraFocusControl(BbCameraSession *session, QObject *parent) + : QCameraFocusControl(parent) + , m_session(session) + , m_focusMode(QCameraFocus::FocusModes()) + , m_focusPointMode(QCameraFocus::FocusPointAuto) + , m_customFocusPoint(QPointF(0, 0)) +{ +} + +QCameraFocus::FocusModes BbCameraFocusControl::focusMode() const +{ + camera_focusmode_t focusMode = CAMERA_FOCUSMODE_OFF; + + const camera_error_t result = camera_get_focus_mode(m_session->handle(), &focusMode); + if (result != CAMERA_EOK) { + qWarning() << "Unable to retrieve focus mode from camera:" << result; + return QCameraFocus::FocusModes(); + } + + switch (focusMode) { + case CAMERA_FOCUSMODE_EDOF: + return QCameraFocus::HyperfocalFocus; + case CAMERA_FOCUSMODE_MANUAL: + return QCameraFocus::ManualFocus; + case CAMERA_FOCUSMODE_AUTO: + return QCameraFocus::AutoFocus; + case CAMERA_FOCUSMODE_MACRO: + return QCameraFocus::MacroFocus; + case CAMERA_FOCUSMODE_CONTINUOUS_AUTO: + return QCameraFocus::ContinuousFocus; + case CAMERA_FOCUSMODE_CONTINUOUS_MACRO: // fall through + case CAMERA_FOCUSMODE_OFF: // fall through + default: + return QCameraFocus::FocusModes(); + } +} + +void BbCameraFocusControl::setFocusMode(QCameraFocus::FocusModes mode) +{ + if (m_focusMode == mode) + return; + + camera_focusmode_t focusMode = CAMERA_FOCUSMODE_OFF; + + if (mode == QCameraFocus::HyperfocalFocus) + focusMode = CAMERA_FOCUSMODE_EDOF; + else if (mode == QCameraFocus::ManualFocus) + focusMode = CAMERA_FOCUSMODE_MANUAL; + else if (mode == QCameraFocus::AutoFocus) + focusMode = CAMERA_FOCUSMODE_AUTO; + else if (mode == QCameraFocus::MacroFocus) + focusMode = CAMERA_FOCUSMODE_MACRO; + else if (mode == QCameraFocus::ContinuousFocus) + focusMode = CAMERA_FOCUSMODE_CONTINUOUS_AUTO; + + const camera_error_t result = camera_set_focus_mode(m_session->handle(), focusMode); + + if (result != CAMERA_EOK) { + qWarning() << "Unable to set focus mode:" << result; + return; + } + + m_focusMode = mode; + emit focusModeChanged(m_focusMode); +} + +bool BbCameraFocusControl::isFocusModeSupported(QCameraFocus::FocusModes mode) const +{ + if (m_session->state() == QCamera::UnloadedState) + return false; + + if (mode == QCameraFocus::HyperfocalFocus) + return false; //TODO how to check? + else if (mode == QCameraFocus::ManualFocus) + return camera_has_feature(m_session->handle(), CAMERA_FEATURE_MANUALFOCUS); + else if (mode == QCameraFocus::AutoFocus) + return camera_has_feature(m_session->handle(), CAMERA_FEATURE_AUTOFOCUS); + else if (mode == QCameraFocus::MacroFocus) + return camera_has_feature(m_session->handle(), CAMERA_FEATURE_MACROFOCUS); + else if (mode == QCameraFocus::ContinuousFocus) + return camera_has_feature(m_session->handle(), CAMERA_FEATURE_AUTOFOCUS); + + return false; +} + +QCameraFocus::FocusPointMode BbCameraFocusControl::focusPointMode() const +{ + return m_focusPointMode; +} + +void BbCameraFocusControl::setFocusPointMode(QCameraFocus::FocusPointMode mode) +{ + if (m_session->status() != QCamera::ActiveStatus) + return; + + if (m_focusPointMode == mode) + return; + + m_focusPointMode = mode; + emit focusPointModeChanged(m_focusPointMode); + + if (m_focusPointMode == QCameraFocus::FocusPointAuto) { + //TODO: is this correct? + const camera_error_t result = camera_set_focus_regions(m_session->handle(), 0, 0); + if (result != CAMERA_EOK) { + qWarning() << "Unable to set focus region:" << result; + return; + } + + emit focusZonesChanged(); + } else if (m_focusPointMode == QCameraFocus::FocusPointCenter) { + // get the size of the viewfinder + int viewfinderWidth = 0; + int viewfinderHeight = 0; + + if (!retrieveViewfinderSize(&viewfinderWidth, &viewfinderHeight)) + return; + + // define a 40x40 pixel focus region in the center of the viewfinder + camera_region_t focusRegion; + focusRegion.left = (viewfinderWidth / 2) - 20; + focusRegion.top = (viewfinderHeight / 2) - 20; + focusRegion.width = 40; + focusRegion.height = 40; + + camera_error_t result = camera_set_focus_regions(m_session->handle(), 1, &focusRegion); + if (result != CAMERA_EOK) { + qWarning() << "Unable to set focus region:" << result; + return; + } + + // re-set focus mode to apply focus region changes + camera_focusmode_t focusMode = CAMERA_FOCUSMODE_OFF; + result = camera_get_focus_mode(m_session->handle(), &focusMode); + camera_set_focus_mode(m_session->handle(), focusMode); + + emit focusZonesChanged(); + + } else if (m_focusPointMode == QCameraFocus::FocusPointFaceDetection) { + //TODO: implement later + } else if (m_focusPointMode == QCameraFocus::FocusPointCustom) { + updateCustomFocusRegion(); + } +} + +bool BbCameraFocusControl::isFocusPointModeSupported(QCameraFocus::FocusPointMode mode) const +{ + if (m_session->state() == QCamera::UnloadedState) + return false; + + if (mode == QCameraFocus::FocusPointAuto) { + return camera_has_feature(m_session->handle(), CAMERA_FEATURE_AUTOFOCUS); + } else if (mode == QCameraFocus::FocusPointCenter) { + return camera_has_feature(m_session->handle(), CAMERA_FEATURE_REGIONFOCUS); + } else if (mode == QCameraFocus::FocusPointFaceDetection) { + return false; //TODO: implement via custom region in combination with face detection in viewfinder + } else if (mode == QCameraFocus::FocusPointCustom) { + return camera_has_feature(m_session->handle(), CAMERA_FEATURE_REGIONFOCUS); + } + + return false; +} + +QPointF BbCameraFocusControl::customFocusPoint() const +{ + return m_customFocusPoint; +} + +void BbCameraFocusControl::setCustomFocusPoint(const QPointF &point) +{ + if (m_customFocusPoint == point) + return; + + m_customFocusPoint = point; + emit customFocusPointChanged(m_customFocusPoint); + + updateCustomFocusRegion(); +} + +QCameraFocusZoneList BbCameraFocusControl::focusZones() const +{ + if (m_session->state() == QCamera::UnloadedState) + return QCameraFocusZoneList(); + + camera_region_t regions[20]; + int supported = 0; + int asked = 0; + camera_error_t result = camera_get_focus_regions(m_session->handle(), 20, &supported, &asked, regions); + + if (result != CAMERA_EOK) { + qWarning() << "Unable to retrieve focus regions:" << result; + return QCameraFocusZoneList(); + } + + // retrieve width and height of viewfinder + int viewfinderWidth = 0; + int viewfinderHeight = 0; + if (m_session->captureMode() & QCamera::CaptureStillImage) + result = camera_get_photovf_property(m_session->handle(), + CAMERA_IMGPROP_WIDTH, &viewfinderWidth, + CAMERA_IMGPROP_HEIGHT, &viewfinderHeight); + else if (m_session->captureMode() & QCamera::CaptureVideo) + result = camera_get_videovf_property(m_session->handle(), + CAMERA_IMGPROP_WIDTH, &viewfinderWidth, + CAMERA_IMGPROP_HEIGHT, &viewfinderHeight); + + if (result != CAMERA_EOK) { + qWarning() << "Unable to retrieve viewfinder size:" << result; + return QCameraFocusZoneList(); + } + + QCameraFocusZoneList list; + for (int i = 0; i < asked; ++i) { + const int x = regions[i].left; + const int y = regions[i].top; + const int width = regions[i].width; + const int height = regions[i].height; + + QRectF rect(static_cast(x)/static_cast(viewfinderWidth), + static_cast(y)/static_cast(viewfinderHeight), + static_cast(width)/static_cast(viewfinderWidth), + static_cast(height)/static_cast(viewfinderHeight)); + + list << QCameraFocusZone(rect, QCameraFocusZone::Focused); //TODO: how to know if a zone is unused/selected/focused?!? + } + + return list; +} + +void BbCameraFocusControl::updateCustomFocusRegion() +{ + // get the size of the viewfinder + int viewfinderWidth = 0; + int viewfinderHeight = 0; + + if (!retrieveViewfinderSize(&viewfinderWidth, &viewfinderHeight)) + return; + + // define a 40x40 pixel focus region around the custom focus point + camera_region_t focusRegion; + focusRegion.left = qMax(0, static_cast(m_customFocusPoint.x() * viewfinderWidth) - 20); + focusRegion.top = qMax(0, static_cast(m_customFocusPoint.y() * viewfinderHeight) - 20); + focusRegion.width = 40; + focusRegion.height = 40; + + camera_error_t result = camera_set_focus_regions(m_session->handle(), 1, &focusRegion); + if (result != CAMERA_EOK) { + qWarning() << "Unable to set focus region:" << result; + return; + } + + // re-set focus mode to apply focus region changes + camera_focusmode_t focusMode = CAMERA_FOCUSMODE_OFF; + result = camera_get_focus_mode(m_session->handle(), &focusMode); + camera_set_focus_mode(m_session->handle(), focusMode); + + emit focusZonesChanged(); +} + +bool BbCameraFocusControl::retrieveViewfinderSize(int *width, int *height) +{ + if (!width || !height) + return false; + + camera_error_t result = CAMERA_EOK; + if (m_session->captureMode() & QCamera::CaptureStillImage) + result = camera_get_photovf_property(m_session->handle(), + CAMERA_IMGPROP_WIDTH, width, + CAMERA_IMGPROP_HEIGHT, height); + else if (m_session->captureMode() & QCamera::CaptureVideo) + result = camera_get_videovf_property(m_session->handle(), + CAMERA_IMGPROP_WIDTH, width, + CAMERA_IMGPROP_HEIGHT, height); + + if (result != CAMERA_EOK) { + qWarning() << "Unable to retrieve viewfinder size:" << result; + return false; + } + + return true; +} + +QT_END_NAMESPACE diff --git a/src/plugins/blackberry/camera/bbcamerafocuscontrol.h b/src/plugins/blackberry/camera/bbcamerafocuscontrol.h new file mode 100644 index 000000000..052c29b4b --- /dev/null +++ b/src/plugins/blackberry/camera/bbcamerafocuscontrol.h @@ -0,0 +1,79 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BBCAMERAFOCUSCONTROL_H +#define BBCAMERAFOCUSCONTROL_H + +#include + +QT_BEGIN_NAMESPACE + +class BbCameraSession; + +class BbCameraFocusControl : public QCameraFocusControl +{ + Q_OBJECT +public: + explicit BbCameraFocusControl(BbCameraSession *session, QObject *parent = 0); + + QCameraFocus::FocusModes focusMode() const Q_DECL_OVERRIDE; + void setFocusMode(QCameraFocus::FocusModes mode) Q_DECL_OVERRIDE; + bool isFocusModeSupported(QCameraFocus::FocusModes mode) const Q_DECL_OVERRIDE; + QCameraFocus::FocusPointMode focusPointMode() const Q_DECL_OVERRIDE; + void setFocusPointMode(QCameraFocus::FocusPointMode mode) Q_DECL_OVERRIDE; + bool isFocusPointModeSupported(QCameraFocus::FocusPointMode mode) const Q_DECL_OVERRIDE; + QPointF customFocusPoint() const Q_DECL_OVERRIDE; + void setCustomFocusPoint(const QPointF &point) Q_DECL_OVERRIDE; + QCameraFocusZoneList focusZones() const Q_DECL_OVERRIDE; + +private: + void updateCustomFocusRegion(); + bool retrieveViewfinderSize(int *width, int *height); + + BbCameraSession *m_session; + + QCameraFocus::FocusModes m_focusMode; + QCameraFocus::FocusPointMode m_focusPointMode; + QPointF m_customFocusPoint; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/blackberry/camera/bbcameraimagecapturecontrol.cpp b/src/plugins/blackberry/camera/bbcameraimagecapturecontrol.cpp new file mode 100644 index 000000000..a2f61f73d --- /dev/null +++ b/src/plugins/blackberry/camera/bbcameraimagecapturecontrol.cpp @@ -0,0 +1,85 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "bbcameraimagecapturecontrol.h" + +#include "bbcamerasession.h" + +QT_BEGIN_NAMESPACE + +BbCameraImageCaptureControl::BbCameraImageCaptureControl(BbCameraSession *session, QObject *parent) + : QCameraImageCaptureControl(parent) + , m_session(session) +{ + connect(m_session, SIGNAL(readyForCaptureChanged(bool)), this, SIGNAL(readyForCaptureChanged(bool))); + connect(m_session, SIGNAL(imageExposed(int)), this, SIGNAL(imageExposed(int))); + connect(m_session, SIGNAL(imageCaptured(int,QImage)), this, SIGNAL(imageCaptured(int,QImage))); + connect(m_session, SIGNAL(imageMetadataAvailable(int,QString,QVariant)), this, SIGNAL(imageMetadataAvailable(int,QString,QVariant))); + connect(m_session, SIGNAL(imageAvailable(int,QVideoFrame)), this, SIGNAL(imageAvailable(int,QVideoFrame))); + connect(m_session, SIGNAL(imageSaved(int,QString)), this, SIGNAL(imageSaved(int,QString))); + connect(m_session, SIGNAL(imageCaptureError(int,int,QString)), this, SIGNAL(error(int,int,QString))); +} + +bool BbCameraImageCaptureControl::isReadyForCapture() const +{ + return m_session->isReadyForCapture(); +} + +QCameraImageCapture::DriveMode BbCameraImageCaptureControl::driveMode() const +{ + return m_session->driveMode(); +} + +void BbCameraImageCaptureControl::setDriveMode(QCameraImageCapture::DriveMode mode) +{ + m_session->setDriveMode(mode); +} + +int BbCameraImageCaptureControl::capture(const QString &fileName) +{ + return m_session->capture(fileName); +} + +void BbCameraImageCaptureControl::cancelCapture() +{ + m_session->cancelCapture(); +} + +QT_END_NAMESPACE diff --git a/src/plugins/blackberry/camera/bbcameraimagecapturecontrol.h b/src/plugins/blackberry/camera/bbcameraimagecapturecontrol.h new file mode 100644 index 000000000..a73a4f1d5 --- /dev/null +++ b/src/plugins/blackberry/camera/bbcameraimagecapturecontrol.h @@ -0,0 +1,70 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BBCAMERAIMAGECAPTURECONTROL_H +#define BBCAMERAIMAGECAPTURECONTROL_H + +#include + +QT_BEGIN_NAMESPACE + +class BbCameraSession; + +class BbCameraImageCaptureControl : public QCameraImageCaptureControl +{ + Q_OBJECT +public: + explicit BbCameraImageCaptureControl(BbCameraSession *session, QObject *parent = 0); + + bool isReadyForCapture() const Q_DECL_OVERRIDE; + + QCameraImageCapture::DriveMode driveMode() const Q_DECL_OVERRIDE; + void setDriveMode(QCameraImageCapture::DriveMode mode) Q_DECL_OVERRIDE; + + int capture(const QString &fileName) Q_DECL_OVERRIDE; + void cancelCapture() Q_DECL_OVERRIDE; + +private: + BbCameraSession *m_session; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/blackberry/camera/bbcameraimageprocessingcontrol.cpp b/src/plugins/blackberry/camera/bbcameraimageprocessingcontrol.cpp new file mode 100644 index 000000000..54ae48c6b --- /dev/null +++ b/src/plugins/blackberry/camera/bbcameraimageprocessingcontrol.cpp @@ -0,0 +1,146 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "bbcameraimageprocessingcontrol.h" + +#include "bbcamerasession.h" + +#include + +QT_BEGIN_NAMESPACE + +BbCameraImageProcessingControl::BbCameraImageProcessingControl(BbCameraSession *session, QObject *parent) + : QCameraImageProcessingControl(parent) + , m_session(session) +{ +} + +bool BbCameraImageProcessingControl::isParameterSupported(ProcessingParameter parameter) const +{ + return (parameter == QCameraImageProcessingControl::WhiteBalancePreset); +} + +bool BbCameraImageProcessingControl::isParameterValueSupported(ProcessingParameter parameter, const QVariant &value) const +{ + if (parameter != QCameraImageProcessingControl::WhiteBalancePreset) + return false; + + if (m_session->handle() == CAMERA_HANDLE_INVALID) + return false; + + int supported = 0; + camera_whitebalancemode_t modes[20]; + const camera_error_t result = camera_get_whitebalance_modes(m_session->handle(), 20, &supported, modes); + + if (result != CAMERA_EOK) { + qWarning() << "Unable to retrieve supported whitebalance modes:" << result; + return false; + } + + QSet supportedModes; + for (int i = 0; i < supported; ++i) { + switch (modes[i]) { + case CAMERA_WHITEBALANCEMODE_AUTO: + supportedModes.insert(QCameraImageProcessing::WhiteBalanceAuto); + break; + case CAMERA_WHITEBALANCEMODE_MANUAL: + supportedModes.insert(QCameraImageProcessing::WhiteBalanceManual); + break; + default: + break; + } + } + + return supportedModes.contains(value.value()); +} + +QVariant BbCameraImageProcessingControl::parameter(ProcessingParameter parameter) const +{ + if (parameter != QCameraImageProcessingControl::WhiteBalancePreset) + return QVariant(); + + if (m_session->handle() == CAMERA_HANDLE_INVALID) + return QVariant(); + + camera_whitebalancemode_t mode; + const camera_error_t result = camera_get_whitebalance_mode(m_session->handle(), &mode); + + if (result != CAMERA_EOK) { + qWarning() << "Unable to retrieve current whitebalance mode:" << result; + return QVariant(); + } + + switch (mode) { + case CAMERA_WHITEBALANCEMODE_AUTO: + return QVariant::fromValue(QCameraImageProcessing::WhiteBalanceAuto); + case CAMERA_WHITEBALANCEMODE_MANUAL: + return QVariant::fromValue(QCameraImageProcessing::WhiteBalanceManual); + default: + return QVariant(); + } +} + +void BbCameraImageProcessingControl::setParameter(ProcessingParameter parameter, const QVariant &value) +{ + if (parameter != QCameraImageProcessingControl::WhiteBalancePreset) + return; + + if (m_session->handle() == CAMERA_HANDLE_INVALID) + return; + + camera_whitebalancemode_t mode = CAMERA_WHITEBALANCEMODE_DEFAULT; + switch (value.value()) { + case QCameraImageProcessing::WhiteBalanceAuto: + mode = CAMERA_WHITEBALANCEMODE_AUTO; + break; + case QCameraImageProcessing::WhiteBalanceManual: + mode = CAMERA_WHITEBALANCEMODE_MANUAL; + break; + default: + break; + } + + const camera_error_t result = camera_set_whitebalance_mode(m_session->handle(), mode); + + if (result != CAMERA_EOK) + qWarning() << "Unable to set whitebalance mode:" << result; +} + +QT_END_NAMESPACE diff --git a/src/plugins/blackberry/camera/bbcameraimageprocessingcontrol.h b/src/plugins/blackberry/camera/bbcameraimageprocessingcontrol.h new file mode 100644 index 000000000..ec16d66d7 --- /dev/null +++ b/src/plugins/blackberry/camera/bbcameraimageprocessingcontrol.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BBCAMERAIMAGEPROCESSINGCONTROL_H +#define BBCAMERAIMAGEPROCESSINGCONTROL_H + +#include + +QT_BEGIN_NAMESPACE + +class BbCameraSession; + +class BbCameraImageProcessingControl : public QCameraImageProcessingControl +{ + Q_OBJECT +public: + explicit BbCameraImageProcessingControl(BbCameraSession *session, QObject *parent = 0); + + bool isParameterSupported(ProcessingParameter) const Q_DECL_OVERRIDE; + bool isParameterValueSupported(ProcessingParameter parameter, const QVariant &value) const Q_DECL_OVERRIDE; + QVariant parameter(ProcessingParameter parameter) const Q_DECL_OVERRIDE; + void setParameter(ProcessingParameter parameter, const QVariant &value) Q_DECL_OVERRIDE; + +private: + BbCameraSession *m_session; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/blackberry/camera/bbcameralockscontrol.cpp b/src/plugins/blackberry/camera/bbcameralockscontrol.cpp new file mode 100644 index 000000000..471940549 --- /dev/null +++ b/src/plugins/blackberry/camera/bbcameralockscontrol.cpp @@ -0,0 +1,75 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "bbcameralockscontrol.h" + +#include "bbcamerasession.h" + +QT_BEGIN_NAMESPACE + +BbCameraLocksControl::BbCameraLocksControl(BbCameraSession *session, QObject *parent) + : QCameraLocksControl(parent) + , m_session(session) +{ + connect(m_session, SIGNAL(lockStatusChanged(QCamera::LockType,QCamera::LockStatus,QCamera::LockChangeReason)), + this, SIGNAL(lockStatusChanged(QCamera::LockType,QCamera::LockStatus,QCamera::LockChangeReason))); +} + +QCamera::LockTypes BbCameraLocksControl::supportedLocks() const +{ + return m_session->supportedLocks(); +} + +QCamera::LockStatus BbCameraLocksControl::lockStatus(QCamera::LockType lock) const +{ + return m_session->lockStatus(lock); +} + +void BbCameraLocksControl::searchAndLock(QCamera::LockTypes locks) +{ + m_session->searchAndLock(locks); +} + +void BbCameraLocksControl::unlock(QCamera::LockTypes locks) +{ + m_session->unlock(locks); +} + +QT_END_NAMESPACE diff --git a/src/plugins/blackberry/camera/bbcameralockscontrol.h b/src/plugins/blackberry/camera/bbcameralockscontrol.h new file mode 100644 index 000000000..6c4b2da6b --- /dev/null +++ b/src/plugins/blackberry/camera/bbcameralockscontrol.h @@ -0,0 +1,67 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#ifndef BBCAMERALOCKSCONTROL_H +#define BBCAMERALOCKSCONTROL_H + +#include + +QT_BEGIN_NAMESPACE + +class BbCameraSession; + +class BbCameraLocksControl : public QCameraLocksControl +{ + Q_OBJECT +public: + explicit BbCameraLocksControl(BbCameraSession *session, QObject *parent = 0); + + QCamera::LockTypes supportedLocks() const Q_DECL_OVERRIDE; + QCamera::LockStatus lockStatus(QCamera::LockType lock) const Q_DECL_OVERRIDE; + void searchAndLock(QCamera::LockTypes locks) Q_DECL_OVERRIDE; + void unlock(QCamera::LockTypes locks) Q_DECL_OVERRIDE; + +private: + BbCameraSession *m_session; +}; + +QT_END_NAMESPACE + +#endif diff --git a/src/plugins/blackberry/camera/bbcameramediarecordercontrol.cpp b/src/plugins/blackberry/camera/bbcameramediarecordercontrol.cpp new file mode 100644 index 000000000..86d32d19f --- /dev/null +++ b/src/plugins/blackberry/camera/bbcameramediarecordercontrol.cpp @@ -0,0 +1,158 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Research In Motion +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 2.1 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 2.1 requirements +** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Digia gives you certain additional +** rights. These rights are described in the Digia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3.0 as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL included in the +** packaging of this file. Please review the following information to +** ensure the GNU General Public License version 3.0 requirements will be +** met: http://www.gnu.org/copyleft/gpl.html. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +#include "bbcameramediarecordercontrol.h" + +#include "bbcamerasession.h" + +#include +#include + +#include