From 0bc8a6f1de48da432733e2bd21c5c793b7a0393d Mon Sep 17 00:00:00 2001 From: Teng-Hui Zhu Date: Tue, 31 May 2011 15:24:42 -0700 Subject: Support the screen shot while the video is paused. Basically, the GL textures generated for the surface texture will be used for showing the screenshot. Surface texture will be recycled every time a new video starts. But GL textures will be recycled either when running out of memory bound, or when the mediaplayer is deleted. 1. Add the VideoLayerManager as a static instance to manage the info of textures allocated for the screenshot. The basic info will be added into the manager while the video is played and prepared. During the draw time, the matirx info will be updated, too. 2. When there are too many screenshots are created, then we will discard the oldest one and just show the grey static rectangle to replace the screenshot. The corresponding framework change is 112501. Change-Id: Ifea60c96532500f9c93062cc97f7c4ef978046b0 --- Source/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Source/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp') diff --git a/Source/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp b/Source/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp index e6a2710..0a4acad 100644 --- a/Source/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp +++ b/Source/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp @@ -35,6 +35,7 @@ #include "FrameView.h" #include "GraphicsContext.h" #include "SkiaUtils.h" +#include "TilesManager.h" #include "VideoLayerAndroid.h" #include "WebCoreJni.h" #include "WebViewCore.h" @@ -72,6 +73,7 @@ struct MediaPlayerPrivate::JavaGlue { MediaPlayerPrivate::~MediaPlayerPrivate() { + TilesManager::instance()->videoLayerManager()->removeLayer(m_videoLayer->uniqueId()); // m_videoLayer is reference counted, unref is enough here. m_videoLayer->unref(); if (m_glue->m_javaProxy) { @@ -290,6 +292,8 @@ public: m_naturalSizeUnknown = false; m_player->durationChanged(); m_player->sizeChanged(); + TilesManager::instance()->videoLayerManager()->updateVideoLayerSize( + m_player->platformLayer()->uniqueId(), width*height); } virtual bool hasAudio() const { return false; } // do not display the audio UI -- cgit v1.1