OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 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_HOST_ENCODER_VP8_H_ |
| 6 #define REMOTING_HOST_ENCODER_VP8_H_ |
| 7 |
| 8 #include "remoting/host/encoder.h" |
| 9 |
| 10 #include "remoting/base/protocol/chromotocol.pb.h" |
| 11 |
| 12 extern "C" { |
| 13 // TODO(garykac): fix this link with the correct path to on2 |
| 14 #include "remoting/third_party/on2/include/on2_encoder.h" |
| 15 } // extern "C" |
| 16 |
| 17 namespace media { |
| 18 |
| 19 class DataBuffer; |
| 20 |
| 21 } // namespace media |
| 22 |
| 23 namespace remoting { |
| 24 |
| 25 // A class that uses VP8 to perform encoding. |
| 26 class EncoderVp8 : public Encoder { |
| 27 public: |
| 28 EncoderVp8(); |
| 29 virtual ~EncoderVp8(); |
| 30 |
| 31 virtual void Encode(const DirtyRects& dirty_rects, |
| 32 const uint8** input_data, |
| 33 const int* strides, |
| 34 bool key_frame, |
| 35 chromotocol_pb::UpdateStreamPacketHeader* header, |
| 36 scoped_refptr<media::DataBuffer>* output_data, |
| 37 bool* encode_done, |
| 38 Task* data_available_task); |
| 39 virtual void SetSize(int width, int height); |
| 40 virtual void SetPixelFormat(PixelFormat pixel_format); |
| 41 |
| 42 private: |
| 43 // Setup the VP8 encoder. |
| 44 bool Init(); |
| 45 |
| 46 // True if the encoder is initialized. |
| 47 bool initialized_; |
| 48 |
| 49 int width_; |
| 50 int height_; |
| 51 PixelFormat pixel_format_; |
| 52 on2_codec_ctx_t codec_; |
| 53 on2_image_t image_; |
| 54 int last_timestamp_; |
| 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(EncoderVp8); |
| 57 }; |
| 58 |
| 59 } // namespace remoting |
| 60 |
| 61 #endif // REMOTING_HOST_ENCODER_VP8_H_ |
OLD | NEW |