Index: remoting/client/plugin/pepper_view.h |
diff --git a/remoting/client/plugin/pepper_view.h b/remoting/client/plugin/pepper_view.h |
index 4ce932ec9d710cf1ba2093793108d4e4ea24a912..95c180d15385d510574f438afc5bd3f30b1e6a0e 100644 |
--- a/remoting/client/plugin/pepper_view.h |
+++ b/remoting/client/plugin/pepper_view.h |
@@ -18,20 +18,21 @@ |
#include "base/task.h" |
#include "media/base/video_frame.h" |
#include "remoting/client/chromoting_view.h" |
+#include "remoting/client/frame_consumer.h" |
+#include "remoting/client/rectangle_update_decoder.h" |
#include "third_party/ppapi/cpp/graphics_2d.h" |
namespace remoting { |
class ChromotingInstance; |
+class ClientContext; |
-class PepperView : public ChromotingView { |
+class PepperView : public ChromotingView, |
+ public FrameConsumer { |
public: |
// Constructs a PepperView that draws to the |rendering_device|. The |
// |rendering_device| instance must outlive this class. |
- // |
- // TODO(ajwong): This probably needs to synchronize with the pepper thread |
- // to be safe. |
- explicit PepperView(ChromotingInstance* instance); |
+ PepperView(ChromotingInstance* instance, ClientContext* context); |
virtual ~PepperView(); |
// ChromotingView implementation. |
@@ -41,22 +42,33 @@ class PepperView : public ChromotingView { |
virtual void SetSolidFill(uint32 color); |
virtual void UnsetSolidFill(); |
virtual void SetViewport(int x, int y, int width, int height); |
- virtual void SetHostScreenSize(int width, int height); |
- virtual void HandleBeginUpdateStream(ChromotingHostMessage* msg); |
- virtual void HandleUpdateStreamPacket(ChromotingHostMessage* msg); |
- virtual void HandleEndUpdateStream(ChromotingHostMessage* msg); |
+ |
+ // FrameConsumer implementation. |
+ virtual void AllocateFrame(media::VideoFrame::Format format, |
+ size_t width, |
+ size_t height, |
+ base::TimeDelta timestamp, |
+ base::TimeDelta duration, |
+ scoped_refptr<media::VideoFrame>* frame_out, |
+ Task* done); |
+ virtual void ReleaseFrame(media::VideoFrame* frame); |
+ virtual void OnPartialFrameOutput(media::VideoFrame* frame, |
+ UpdatedRects* rects, |
+ Task* done); |
private: |
void OnPaintDone(); |
- void OnPartialDecodeDone(); |
- void OnDecodeDone(); |
+ void PaintFrame(media::VideoFrame* frame, UpdatedRects* rects); |
// Reference to the creating plugin instance. Needed for interacting with |
// pepper. Marking explciitly as const since it must be initialized at |
// object creation, and never change. |
ChromotingInstance* const instance_; |
- pp::Graphics2D device_context_; |
+ // Context should be constant for the lifetime of the plugin. |
+ ClientContext* const context_; |
+ |
+ pp::Graphics2D graphics2d_; |
int viewport_x_; |
int viewport_y_; |