• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 
5 #ifndef REMOTING_CODEC_VIDEO_DECODER_VERBATIM_H_
6 #define REMOTING_CODEC_VIDEO_DECODER_VERBATIM_H_
7 
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"
13 
14 namespace remoting {
15 
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();
22 
23   VideoDecoderVerbatim();
24 
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;
36 
37  private:
38   // The region updated that hasn't been copied to the screen yet.
39   webrtc::DesktopRegion updated_region_;
40 
41   // Size of the remote screen.
42   webrtc::DesktopSize screen_size_;
43 
44   // The bitmap holding the remote screen bits.
45   scoped_ptr<uint8[]> screen_buffer_;
46 
47   DISALLOW_COPY_AND_ASSIGN(VideoDecoderVerbatim);
48 };
49 
50 }  // namespace remoting
51 
52 #endif  // REMOTING_CODEC_VIDEO_DECODER_VERBATIM_H_
53