Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / remoting / codec / video_decoder_verbatim.h
blob24203d9f84f8c349f36ccf4f5afac641703bec68
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_CODEC_VIDEO_DECODER_VERBATIM_H_
6 #define REMOTING_CODEC_VIDEO_DECODER_VERBATIM_H_
8 #include "base/compiler_specific.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "remoting/codec/video_decoder.h"
11 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h"
12 #include "third_party/webrtc/modules/desktop_capture/desktop_region.h"
14 namespace remoting {
16 // Video decoder implementations that decodes video packet encoded by
17 // VideoEncoderVerbatim. It just copies data from incoming packets to the
18 // video frames.
19 class VideoDecoderVerbatim : public VideoDecoder {
20 public:
21 virtual ~VideoDecoderVerbatim();
23 VideoDecoderVerbatim();
25 // VideoDecoder implementation.
26 virtual void Initialize(const webrtc::DesktopSize& screen_size) OVERRIDE;
27 virtual bool DecodePacket(const VideoPacket& packet) OVERRIDE;
28 virtual void Invalidate(const webrtc::DesktopSize& view_size,
29 const webrtc::DesktopRegion& region) OVERRIDE;
30 virtual void RenderFrame(const webrtc::DesktopSize& view_size,
31 const webrtc::DesktopRect& clip_area,
32 uint8* image_buffer,
33 int image_stride,
34 webrtc::DesktopRegion* output_region) OVERRIDE;
35 virtual const webrtc::DesktopRegion* GetImageShape() OVERRIDE;
37 private:
38 // The region updated that hasn't been copied to the screen yet.
39 webrtc::DesktopRegion updated_region_;
41 // Size of the remote screen.
42 webrtc::DesktopSize screen_size_;
44 // The bitmap holding the remote screen bits.
45 scoped_ptr<uint8[]> screen_buffer_;
47 DISALLOW_COPY_AND_ASSIGN(VideoDecoderVerbatim);
50 } // namespace remoting
52 #endif // REMOTING_CODEC_VIDEO_DECODER_VERBATIM_H_