Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Unified Diff: cc/video_layer_impl.h

Issue 11274017: Added support for YUV videos to the software compositor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/video_layer.cc ('k') | cc/video_layer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/video_layer_impl.h
diff --git a/cc/video_layer_impl.h b/cc/video_layer_impl.h
index 47172d0139fd053e294d66cd0e81c8dde1addc16..964d35c69987fa1a76710b401134f68e9f09e976 100644
--- a/cc/video_layer_impl.h
+++ b/cc/video_layer_impl.h
@@ -6,8 +6,10 @@
#define CCVideoLayerImpl_h
#include "IntSize.h"
+#include "base/callback.h"
#include "base/synchronization/lock.h"
#include "cc/layer_impl.h"
+#include "media/base/video_frame.h"
#include "third_party/khronos/GLES2/gl2.h"
#include <public/WebTransformationMatrix.h>
#include <public/WebVideoFrameProvider.h>
@@ -16,17 +18,24 @@ namespace WebKit {
class WebVideoFrame;
}
+namespace media {
+class SkCanvasVideoRenderer;
+}
+
namespace cc {
class LayerTreeHostImpl;
class VideoLayerImpl;
class VideoLayerImpl : public LayerImpl
- , public WebKit::WebVideoFrameProvider::Client {
+ , public WebKit::WebVideoFrameProvider::Client {
public:
- static scoped_ptr<VideoLayerImpl> create(int id, WebKit::WebVideoFrameProvider* provider)
+ typedef base::Callback<media::VideoFrame* (WebKit::WebVideoFrame*)> FrameUnwrapper;
+
+ static scoped_ptr<VideoLayerImpl> create(int id, WebKit::WebVideoFrameProvider* provider,
+ const FrameUnwrapper& unwrapper)
{
- return make_scoped_ptr(new VideoLayerImpl(id, provider));
+ return make_scoped_ptr(new VideoLayerImpl(id, provider, unwrapper));
}
virtual ~VideoLayerImpl();
@@ -58,9 +67,8 @@ public:
};
private:
- VideoLayerImpl(int, WebKit::WebVideoFrameProvider*);
+ VideoLayerImpl(int, WebKit::WebVideoFrameProvider*, const FrameUnwrapper&);
- static IntSize computeVisibleSize(const WebKit::WebVideoFrame&, unsigned plane);
virtual const char* layerTypeAsString() const OVERRIDE;
void willDrawInternal(ResourceProvider*);
@@ -68,6 +76,7 @@ private:
bool copyPlaneData(ResourceProvider*);
void freePlaneData(ResourceProvider*);
void freeUnusedPlaneData(ResourceProvider*);
+ size_t numPlanes() const;
// Guards the destruction of m_provider and the frame that it provides
base::Lock m_providerLock;
@@ -75,12 +84,16 @@ private:
WebKit::WebTransformationMatrix m_streamTextureMatrix;
- WebKit::WebVideoFrame* m_frame;
+ FrameUnwrapper m_unwrapper;
+ WebKit::WebVideoFrame *m_webFrame;
+ media::VideoFrame* m_frame;
GLenum m_format;
+ bool m_convertYUV;
ResourceProvider::ResourceId m_externalTextureResource;
+ scoped_ptr<media::SkCanvasVideoRenderer> m_videoRenderer;
- // Each index in this array corresponds to a plane in WebKit::WebVideoFrame.
- FramePlane m_framePlanes[WebKit::WebVideoFrame::maxPlanes];
+ // Each index in this array corresponds to a plane in media::VideoFrame.
+ FramePlane m_framePlanes[media::VideoFrame::kMaxPlanes];
};
} // namespace cc
« no previous file with comments | « cc/video_layer.cc ('k') | cc/video_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698