Set value of m_suspended false after resuming of mediaElement asynchronously.
authorkeonho07.kim <keonho07.kim@samsung.com>
Fri, 29 Mar 2013 00:33:17 +0000 (09:33 +0900)
committerkeonho07.kim <keonho07.kim@samsung.com>
Fri, 29 Mar 2013 00:59:32 +0000 (09:59 +0900)
[Title] Set value of m_suspended false after resuming of mediaElement asynchronously.
[Problem] long horizontal video frame is displayed for while during resuming video.
[Cause] height of mediadocument is set 0 before resuming of video yet in calculateIntrinsicSize().
[Solution] Set value of m_suspended false after resuming of mediaElement asynchronously.

Change-Id: I26e0f9fe52d3a73388cae614c1f8f6a34d899650

Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h [changed mode: 0644->0755]
Source/WebCore/platform/graphics/MediaPlayer.h [changed mode: 0644->0755]
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
Source/WebCore/rendering/RenderVideo.cpp

index 3281492..6a3ace4 100755 (executable)
@@ -3930,10 +3930,10 @@ void HTMLMediaElement::resume()
         renderer()->updateFromElement();
 
 #if ENABLE(TIZEN_GSTREAMER_VIDEO)
-    if (m_suspended) {
+    // Player will resume asynchronously.
+    // Set m_suspended to false in setSuspended().
+    if (m_suspended)
         m_player->resume();
-        m_suspended = false;
-    }
 #endif
 }
 
@@ -4728,6 +4728,11 @@ bool HTMLMediaElement::shouldSuspendMedia()
         return true;
 #endif
 }
+
+void HTMLMediaElement::setSuspended(bool suspended)
+{
+    m_suspended = suspended;
+}
 #endif
 
 }
old mode 100644 (file)
new mode 100755 (executable)
index b46dfa0..972d9ac
@@ -333,6 +333,10 @@ public:
 
     virtual bool willRespondToMouseClickEvents() OVERRIDE;
 
+#if ENABLE(TIZEN_GSTREAMER_VIDEO)
+    bool suspended() { return m_suspended; }
+#endif
+
 protected:
     HTMLMediaElement(const QualifiedName&, Document*, bool);
     virtual ~HTMLMediaElement();
@@ -455,6 +459,10 @@ private:
     virtual GraphicsDeviceAdapter* mediaPlayerGraphicsDeviceAdapter(const MediaPlayer*) const OVERRIDE;
 #endif
 
+#if ENABLE(TIZEN_GSTREAMER_VIDEO)
+    virtual void setSuspended(bool);
+#endif
+
     void loadTimerFired(Timer<HTMLMediaElement>*);
     void progressEventTimerFired(Timer<HTMLMediaElement>*);
     void playbackProgressTimerFired(Timer<HTMLMediaElement>*);
old mode 100644 (file)
new mode 100755 (executable)
index 859a96b..3840e6b
@@ -200,6 +200,11 @@ public:
     virtual bool mediaPlayerIsLooping() const { return false; }
     virtual HostWindow* mediaPlayerHostWindow() { return 0; }
     virtual IntRect mediaPlayerWindowClipRect() { return IntRect(); }
+
+#if ENABLE(TIZEN_GSTREAMER_VIDEO)
+    virtual void setSuspended(bool) { }
+#endif
+
 };
 
 class MediaPlayerSupportsTypeClient {
index 3806c12..ccb2212 100755 (executable)
@@ -1055,6 +1055,7 @@ gboolean MediaPlayerPrivateGStreamer::handleMessage(GstMessage* message)
             if (m_suspendTime > 0 && newState == GST_STATE_PAUSED) {
                 seek(m_suspendTime);
                 m_suspendTime = 0;
+                m_player->mediaPlayerClient()->setSuspended(false);
             }
 
             HTMLMediaElement* element = static_cast<HTMLMediaElement*>(player()->mediaPlayerClient());
index 37f2f08..044fbd6 100644 (file)
@@ -89,6 +89,12 @@ void RenderVideo::updateIntrinsicSize()
     if (size == intrinsicSize())
         return;
 
+#if ENABLE(TIZEN_GSTREAMER_VIDEO)
+    // Do not update IntrinsicSize while videoElement is suspended.
+    if (videoElement()->suspended())
+        return;
+#endif
+
     setIntrinsicSize(size);
     setPreferredLogicalWidthsDirty(true);
     setNeedsLayout(true);