1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef REMOTING_CLIENT_FRAME_CONSUMER_H_
6 #define REMOTING_CLIENT_FRAME_CONSUMER_H_
8 #include "base/basictypes.h"
23 // List of supported pixel formats needed by various platforms.
25 FORMAT_BGRA
, // Used by the Pepper plugin.
26 FORMAT_RGBA
, // Used for Android's Bitmap class.
29 // Paints the contents of |buffer| into the area of the view identified
30 // by |clip_area|. |view_size| specifies the full-frame dimensions to which
31 // the |buffer|/|clip_area| portion was scaled. Implementations may be
32 // optimized to only paint pixels within the intersection of |region| and
33 // |clip_area|. If |shape| is non-NULL then it specifies the complete shape
34 // of the frame, otherwise the frame is un-shaped.
36 // N.B. |clip_area|, |region| and |shape| should be provided in output view
38 virtual void ApplyBuffer(const webrtc::DesktopSize
& view_size
,
39 const webrtc::DesktopRect
& clip_area
,
40 webrtc::DesktopFrame
* buffer
,
41 const webrtc::DesktopRegion
& region
,
42 const webrtc::DesktopRegion
* shape
) = 0;
44 // Accepts a buffer that couldn't be used for drawing for any reason (shutdown
45 // is in progress, the view area has changed, etc.). The accepted buffer can
46 // be freed or reused for another drawing operation.
47 virtual void ReturnBuffer(webrtc::DesktopFrame
* buffer
) = 0;
49 // Set the dimension of the entire host screen.
50 virtual void SetSourceSize(const webrtc::DesktopSize
& source_size
,
51 const webrtc::DesktopVector
& dpi
) = 0;
53 // Returns the preferred pixel encoding for the platform.
54 virtual PixelFormat
GetPixelFormat() = 0;
58 virtual ~FrameConsumer() {}
61 DISALLOW_COPY_AND_ASSIGN(FrameConsumer
);
64 } // namespace remoting
66 #endif // REMOTING_CLIENT_FRAME_CONSUMER_H_