From b5fe40fb0cc2bdb32d25d4da6b669952659e77f8 Mon Sep 17 00:00:00 2001
From: Gareth Stockwell <gareth.stockwell@accenture.com>
Date: Fri, 7 Oct 2011 11:37:52 +0100
Subject: [PATCH 1/4] Respond to events from native video player

If the playback session is terminated by the native framework (e.g. another
higher priority client has claimed video resources), we need to signal this
via the QtMultimediaKit API.

Reviewed-by: PENDING
---
 .../mmf/mediaplayer/s60videoplayersession.cpp      |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/plugins/multimedia/symbian/mmf/mediaplayer/s60videoplayersession.cpp b/plugins/multimedia/symbian/mmf/mediaplayer/s60videoplayersession.cpp
index 99a7e8d..e83f103 100644
--- a/plugins/multimedia/symbian/mmf/mediaplayer/s60videoplayersession.cpp
+++ b/plugins/multimedia/symbian/mmf/mediaplayer/s60videoplayersession.cpp
@@ -62,6 +62,7 @@
 #include <w32std.h>
 #include <mmf/common/mmferrors.h>
 #include <mmf/common/mmfcontrollerframeworkbase.h>
+#include <mmf/common/mmfvideo.h>
 #include <MMFROPCustomCommandConstants.h>
 #ifdef HTTP_COOKIES_ENABLED
 #include <MMFSessionInfoCustomCommandConstants.h>
@@ -777,7 +778,13 @@ void S60VideoPlayerSession::MvpuoPlayComplete(TInt aError)
 
 void S60VideoPlayerSession::MvpuoEvent(const TMMFEvent &aEvent)
 {
-    Q_UNUSED(aEvent);
+    TRACE("S60VideoPlayerSession::MvpuoEvent" << qtThisPtr()
+          << "type" << (void*)aEvent.iEventType.iUid
+          << "error" << aEvent.iErrorCode);
+    if (aEvent.iEventType == KMMFEventCategoryVideoPlayerGeneralError) {
+        setError(aEvent.iErrorCode);
+        doClose();
+    }
 }
 
 #ifdef VIDEOOUTPUT_GRAPHICS_SURFACES
-- 
1.7.4.msysgit.0