summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMurray Read <ext-murray.2.read@nokia.com>2012-04-12 11:36:22 +0100
committerMurray Read <ext-murray.2.read@nokia.com>2012-04-12 14:21:03 +0100
commit198f1a3979c58957e19c5caf29cde120f346068c (patch)
treedbca17e4eda73106039b05191b38da0e22ece896 /plugins
parentb450d79fd9f65f9f36edda08f775bd8952914421 (diff)
Fix crash in apps that assume access to frame data
The camera service has been creating video frames with CPU addressable content, until recently. Some apps are written to assume this content is available and they now crash, since the camera service stated creating EGL video frames instead. The fix is to have the camera service default to creating CPU addressable video frames again, unless its client has set a property to allow it to use EGL. Task-number: ou1cimx1#991661 Reviewed-by: Juha Kukkonen
Diffstat (limited to 'plugins')
-rw-r--r--plugins/multimedia/symbian/ecam/s60cameraservice.cpp4
-rw-r--r--plugins/multimedia/symbian/mmf/mediaplayer/s60mediaplayerservice.cpp7
-rw-r--r--plugins/multimedia/symbian/videooutput/s60videooutputfactory.cpp23
-rw-r--r--plugins/multimedia/symbian/videooutput/s60videooutputfactory.h5
4 files changed, 38 insertions, 1 deletions
diff --git a/plugins/multimedia/symbian/ecam/s60cameraservice.cpp b/plugins/multimedia/symbian/ecam/s60cameraservice.cpp
index cc3c03e690..9eee947b01 100644
--- a/plugins/multimedia/symbian/ecam/s60cameraservice.cpp
+++ b/plugins/multimedia/symbian/ecam/s60cameraservice.cpp
@@ -74,6 +74,10 @@
S60CameraService::S60CameraService(QObject *parent) :
QMediaService(parent)
{
+ // by default, the camera service will not allow EGL rendering as clients may
+ // reasonably often want access to the raw frame data
+ setProperty(S60VideoOutputFactory::eglRenderingAllowedPropertyName(), false);
+
// Session classes for video and image capturing
m_imagesession = new S60ImageCaptureSession(this);
m_videosession = new S60VideoCaptureSession(this);
diff --git a/plugins/multimedia/symbian/mmf/mediaplayer/s60mediaplayerservice.cpp b/plugins/multimedia/symbian/mmf/mediaplayer/s60mediaplayerservice.cpp
index 0a7c1a12d9..add14c7cbc 100644
--- a/plugins/multimedia/symbian/mmf/mediaplayer/s60mediaplayerservice.cpp
+++ b/plugins/multimedia/symbian/mmf/mediaplayer/s60mediaplayerservice.cpp
@@ -66,6 +66,13 @@ S60MediaPlayerService::S60MediaPlayerService(QObject *parent)
, m_videoOutputFactory(0)
{
TRACE("S60MediaPlayerService::S60MediaPlayerService" << qtThisPtr());
+
+ // By default, the media player service will allow EGL rendering for video.
+ // Clients will not be able to access raw frame data directly with EGL rendering, but they are
+ // assumed to be interested in playing video efficiently rather than accessing or manipulating
+ // the frame images.
+ setProperty(S60VideoOutputFactory::eglRenderingAllowedPropertyName(), true);
+
m_control = new S60MediaPlayerControl(this);
m_metaData = new S60MediaMetaDataProvider(m_control, this);
m_audioEndpointSelector = new S60MediaPlayerAudioEndpointSelector(m_control, this);
diff --git a/plugins/multimedia/symbian/videooutput/s60videooutputfactory.cpp b/plugins/multimedia/symbian/videooutput/s60videooutputfactory.cpp
index cf77ade0cf..ee48496fd4 100644
--- a/plugins/multimedia/symbian/videooutput/s60videooutputfactory.cpp
+++ b/plugins/multimedia/symbian/videooutput/s60videooutputfactory.cpp
@@ -82,7 +82,7 @@ QMediaControl *S60VideoOutputFactory::requestControl(const char *name)
if (!control) {
#ifdef VIDEOOUTPUT_GRAPHICS_SURFACES
if (qstrcmp(name, QVideoRendererControl_iid) == 0) {
- if (m_eglExtensions)
+ if (m_eglExtensions && isEglRenderingAllowed())
control = new S60VideoEglRendererControl(m_eglExtensions, this);
} else
#endif
@@ -114,3 +114,24 @@ void S60VideoOutputFactory::releaseControl(QMediaControl *control)
m_data.remove(index);
}
}
+
+const char *S60VideoOutputFactory::eglRenderingAllowedPropertyName()
+{
+ return "_q_eglRenderingAllowed";
+}
+
+bool S60VideoOutputFactory::isEglRenderingAllowed() const
+{
+ bool allowed = true;
+ const QObject *obj = this;
+ const char *propertyName = eglRenderingAllowedPropertyName();
+ while (obj) {
+ QVariant v = obj->property(propertyName);
+ if (v.isValid()) {
+ allowed = v.toBool();
+ break;
+ }
+ obj = obj->parent();
+ }
+ return allowed;
+}
diff --git a/plugins/multimedia/symbian/videooutput/s60videooutputfactory.h b/plugins/multimedia/symbian/videooutput/s60videooutputfactory.h
index 2d0a5681ea..363bbd20b4 100644
--- a/plugins/multimedia/symbian/videooutput/s60videooutputfactory.h
+++ b/plugins/multimedia/symbian/videooutput/s60videooutputfactory.h
@@ -58,6 +58,11 @@ public:
QMediaControl *requestControl(const char *name);
void releaseControl(QMediaControl *control);
+ static const char *eglRenderingAllowedPropertyName();
+
+private:
+ bool isEglRenderingAllowed() const;
+
private:
struct ControlData
{