| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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 #include "base/logging.h" | 5 #include "base/logging.h" |
| 6 #include "media/base/callback.h" | 6 #include "media/base/callback.h" |
| 7 #include "media/base/data_buffer.h" | 7 #include "media/base/data_buffer.h" |
| 8 #include "remoting/host/encoder_vp8.h" | 8 #include "remoting/host/encoder_vp8.h" |
| 9 | 9 |
| 10 extern "C" { | 10 extern "C" { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 return false; | 49 return false; |
| 50 | 50 |
| 51 on2_codec_control_(&codec_, VP8E_SET_CPUUSED, -15); | 51 on2_codec_control_(&codec_, VP8E_SET_CPUUSED, -15); |
| 52 return true; | 52 return true; |
| 53 } | 53 } |
| 54 | 54 |
| 55 void EncoderVp8::Encode(const DirtyRects& dirty_rects, | 55 void EncoderVp8::Encode(const DirtyRects& dirty_rects, |
| 56 const uint8** input_data, | 56 const uint8** input_data, |
| 57 const int* strides, | 57 const int* strides, |
| 58 bool key_frame, | 58 bool key_frame, |
| 59 chromotocol_pb::UpdateStreamPacketHeader* header, | 59 UpdateStreamPacketHeader* header, |
| 60 scoped_refptr<media::DataBuffer>* output_data, | 60 scoped_refptr<media::DataBuffer>* output_data, |
| 61 bool* encode_done, | 61 bool* encode_done, |
| 62 Task* data_available_task) { | 62 Task* data_available_task) { |
| 63 // This will allow the task be called when this method exits. | 63 // This will allow the task be called when this method exits. |
| 64 media::AutoTaskRunner task(data_available_task); | 64 media::AutoTaskRunner task(data_available_task); |
| 65 *encode_done = false; | 65 *encode_done = false; |
| 66 | 66 |
| 67 // TODO(hclam): We only initialize the encoder once. We may have to | 67 // TODO(hclam): We only initialize the encoder once. We may have to |
| 68 // allow encoder be initialized with difference sizes. | 68 // allow encoder be initialized with difference sizes. |
| 69 if (!initialized_) { | 69 if (!initialized_) { |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 void EncoderVp8::SetSize(int width, int height) { | 124 void EncoderVp8::SetSize(int width, int height) { |
| 125 width_ = width; | 125 width_ = width; |
| 126 height_ = height; | 126 height_ = height; |
| 127 } | 127 } |
| 128 | 128 |
| 129 void EncoderVp8::SetPixelFormat(PixelFormat pixel_format) { | 129 void EncoderVp8::SetPixelFormat(PixelFormat pixel_format) { |
| 130 pixel_format_ = pixel_format; | 130 pixel_format_ = pixel_format; |
| 131 } | 131 } |
| 132 | 132 |
| 133 } // namespace remoting | 133 } // namespace remoting |
| OLD | NEW |