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

Unified Diff: content/renderer/gpu/stream_texture_host_android.h

Issue 10695181: [Android] Upstream all the IPC communications/handlings for stream texture (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
Index: content/renderer/gpu/stream_texture_host_android.h
diff --git a/content/renderer/gpu/stream_texture_host_android.h b/content/renderer/gpu/stream_texture_host_android.h
new file mode 100644
index 0000000000000000000000000000000000000000..ab4bbad79b52e2767032c9c782f0af2535577cce
--- /dev/null
+++ b/content/renderer/gpu/stream_texture_host_android.h
@@ -0,0 +1,68 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_RENDERER_GPU_STREAM_TEXTURE_HOST_ANDROID_H_
+#define CONTENT_RENDERER_GPU_STREAM_TEXTURE_HOST_ANDROID_H_
+#pragma once
+
+#include "base/memory/weak_ptr.h"
+#include "content/common/android/surface_texture_peer.h"
+#include "ipc/ipc_channel.h"
+#include "ipc/ipc_message.h"
+
+namespace gfx {
+class Size;
+}
+
+class GpuChannelHost;
+struct GpuStreamTextureMsg_MatrixChanged_Params;
+
+namespace content {
+
+// Class for handling all the IPC messages between the GPU process and
+// StreamTextureProxy.
+class StreamTextureHost : public IPC::Listener {
+ public:
+ StreamTextureHost(GpuChannelHost* channel);
apatrick_chromium 2012/07/12 23:51:31 explicit
qinmin 2012/07/13 00:41:33 Done.
+ virtual ~StreamTextureHost();
+
+ bool Initialize(int stream_id, const gfx::Size& initial_size);
+
+ // Listener class that is listening to the stream texture updates. It is
+ // implemented by StreamTextureProxyImpl.
+ class Listener {
+ public:
+ virtual void OnFrameAvailable() = 0;
+ virtual void OnMatrixChanged(const float mtx[16]) = 0;
+ virtual ~Listener() {}
+ };
+
+ void SetListener(Listener* listener) { listener_ = listener; }
+
+ // Request the GPU process to create the surface texture and forward it
+ // to the renderer process.
+ void EstablishPeer(SurfaceTexturePeer::SurfaceTextureTarget type,
+ int32 primary_id, int32 secondary_id);
+
+ // IPC::Channel::Listener implementation:
+ virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ virtual void OnChannelError() OVERRIDE;
+
+ private:
+ // Message handlers:
+ void OnFrameAvailable();
+ void OnMatrixChanged(const GpuStreamTextureMsg_MatrixChanged_Params& param);
+
+ int route_id_;
+ int stream_id_;
+ Listener* listener_;
+ scoped_refptr<GpuChannelHost> channel_;
+ base::WeakPtrFactory<StreamTextureHost> weak_ptr_factory_;
+
+ DISALLOW_IMPLICIT_CONSTRUCTORS(StreamTextureHost);
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_GPU_STREAM_TEXTURE_HOST_ANDROID_H_

Powered by Google App Engine
This is Rietveld 408576698