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