| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_ENCODER_VERBATIM_H_ | 5 #ifndef REMOTING_CODEC_VIDEO_ENCODER_VERBATIM_H_ |
| 6 #define REMOTING_CODEC_VIDEO_ENCODER_VERBATIM_H_ | 6 #define REMOTING_CODEC_VIDEO_ENCODER_VERBATIM_H_ |
| 7 | 7 |
| 8 #include "remoting/codec/video_encoder.h" | 8 #include "remoting/codec/video_encoder.h" |
| 9 #include "remoting/proto/video.pb.h" | 9 #include "remoting/codec/video_encoder_helper.h" |
| 10 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" | |
| 11 | 10 |
| 12 namespace remoting { | 11 namespace remoting { |
| 13 | 12 |
| 14 // VideoEncoderVerbatim implements a VideoEncoder that sends image data as a | 13 // VideoEncoderVerbatim implements a VideoEncoder that sends image data as a |
| 15 // sequence of RGB values, without compression. | 14 // sequence of RGB values, without compression. |
| 16 class VideoEncoderVerbatim : public VideoEncoder { | 15 class VideoEncoderVerbatim : public VideoEncoder { |
| 17 public: | 16 public: |
| 18 VideoEncoderVerbatim(); | 17 VideoEncoderVerbatim(); |
| 19 virtual ~VideoEncoderVerbatim(); | 18 virtual ~VideoEncoderVerbatim(); |
| 20 | 19 |
| 21 // VideoEncoder interface. | 20 // VideoEncoder interface. |
| 22 virtual scoped_ptr<VideoPacket> Encode( | 21 virtual scoped_ptr<VideoPacket> Encode( |
| 23 const webrtc::DesktopFrame& frame) OVERRIDE; | 22 const webrtc::DesktopFrame& frame) OVERRIDE; |
| 24 | 23 |
| 25 private: | 24 private: |
| 26 // Allocates a buffer of the specified |size| inside |packet| and returns the | 25 VideoEncoderHelper helper_; |
| 27 // pointer to it. | |
| 28 uint8* GetOutputBuffer(VideoPacket* packet, size_t size); | |
| 29 | 26 |
| 30 // The most recent screen size. Used to detect screen size changes. | 27 DISALLOW_COPY_AND_ASSIGN(VideoEncoderVerbatim); |
| 31 webrtc::DesktopSize screen_size_; | |
| 32 }; | 28 }; |
| 33 | 29 |
| 34 } // namespace remoting | 30 } // namespace remoting |
| 35 | 31 |
| 36 #endif // REMOTING_CODEC_VIDEO_ENCODER_VERBATIM_H_ | 32 #endif // REMOTING_CODEC_VIDEO_ENCODER_VERBATIM_H_ |
| OLD | NEW |