OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef REMOTING_CODEC_VIDEO_DECODER_VERBATIM_H_ | 5 #ifndef REMOTING_CODEC_VIDEO_DECODER_VERBATIM_H_ |
6 #define REMOTING_CODEC_VIDEO_DECODER_VERBATIM_H_ | 6 #define REMOTING_CODEC_VIDEO_DECODER_VERBATIM_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "remoting/codec/video_decoder.h" | 10 #include "remoting/codec/video_decoder.h" |
11 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" | 11 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
12 #include "third_party/webrtc/modules/desktop_capture/desktop_region.h" | 12 #include "third_party/webrtc/modules/desktop_capture/desktop_region.h" |
13 | 13 |
14 namespace remoting { | 14 namespace remoting { |
15 | 15 |
16 // Video decoder implementations that decodes video packet encoded by | 16 // Video decoder implementations that decodes video packet encoded by |
17 // VideoEncoderVerbatim. It just copies data from incoming packets to the | 17 // VideoEncoderVerbatim. It just copies data from incoming packets to the |
18 // video frames. | 18 // video frames. |
19 class VideoDecoderVerbatim : public VideoDecoder { | 19 class VideoDecoderVerbatim : public VideoDecoder { |
20 public: | 20 public: |
21 ~VideoDecoderVerbatim() override; | 21 ~VideoDecoderVerbatim() override; |
22 | 22 |
23 VideoDecoderVerbatim(); | 23 VideoDecoderVerbatim(); |
24 | 24 |
25 // VideoDecoder implementation. | 25 // VideoDecoder implementation. |
26 void Initialize(const webrtc::DesktopSize& screen_size) override; | |
27 bool DecodePacket(const VideoPacket& packet) override; | 26 bool DecodePacket(const VideoPacket& packet) override; |
28 void Invalidate(const webrtc::DesktopSize& view_size, | 27 void Invalidate(const webrtc::DesktopSize& view_size, |
29 const webrtc::DesktopRegion& region) override; | 28 const webrtc::DesktopRegion& region) override; |
30 void RenderFrame(const webrtc::DesktopSize& view_size, | 29 void RenderFrame(const webrtc::DesktopSize& view_size, |
31 const webrtc::DesktopRect& clip_area, | 30 const webrtc::DesktopRect& clip_area, |
32 uint8* image_buffer, | 31 uint8* image_buffer, |
33 int image_stride, | 32 int image_stride, |
34 webrtc::DesktopRegion* output_region) override; | 33 webrtc::DesktopRegion* output_region) override; |
35 const webrtc::DesktopRegion* GetImageShape() override; | 34 const webrtc::DesktopRegion* GetImageShape() override; |
36 | 35 |
37 private: | 36 private: |
38 // The region updated that hasn't been copied to the screen yet. | 37 // The region updated that hasn't been copied to the screen yet. |
39 webrtc::DesktopRegion updated_region_; | 38 webrtc::DesktopRegion updated_region_; |
40 | 39 |
41 // Size of the remote screen. | 40 // Size of the remote screen. |
42 webrtc::DesktopSize screen_size_; | 41 webrtc::DesktopSize screen_size_; |
43 | 42 |
44 // The bitmap holding the remote screen bits. | 43 // The bitmap holding the remote screen bits. |
45 scoped_ptr<uint8[]> screen_buffer_; | 44 scoped_ptr<uint8[]> screen_buffer_; |
46 | 45 |
47 DISALLOW_COPY_AND_ASSIGN(VideoDecoderVerbatim); | 46 DISALLOW_COPY_AND_ASSIGN(VideoDecoderVerbatim); |
48 }; | 47 }; |
49 | 48 |
50 } // namespace remoting | 49 } // namespace remoting |
51 | 50 |
52 #endif // REMOTING_CODEC_VIDEO_DECODER_VERBATIM_H_ | 51 #endif // REMOTING_CODEC_VIDEO_DECODER_VERBATIM_H_ |
OLD | NEW |