Chromium Code Reviews| 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 #include "remoting/codec/video_encoder_vp8.h" | 5 #include "remoting/codec/video_encoder_vp8.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/sys_info.h" | 8 #include "base/sys_info.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "media/base/yuv_convert.h" | 10 #include "media/base/yuv_convert.h" |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 // Defines the dimension of a macro block. This is used to compute the active | 24 // Defines the dimension of a macro block. This is used to compute the active |
| 25 // map for the encoder. | 25 // map for the encoder. |
| 26 const int kMacroBlockSize = 16; | 26 const int kMacroBlockSize = 16; |
| 27 | 27 |
| 28 } // namespace remoting | 28 } // namespace remoting |
| 29 | 29 |
| 30 namespace remoting { | 30 namespace remoting { |
| 31 | 31 |
| 32 VideoEncoderVp8::VideoEncoderVp8() | 32 VideoEncoderVp8::VideoEncoderVp8() |
| 33 : initialized_(false), | 33 : initialized_(false), |
| 34 codec_(NULL), | |
| 35 image_(NULL), | |
| 36 active_map_width_(0), | 34 active_map_width_(0), |
| 37 active_map_height_(0), | 35 active_map_height_(0), |
| 38 last_timestamp_(0) { | 36 last_timestamp_(0) {} |
|
Wez
2013/06/13 17:15:52
nit: Please put the closing brace back on the next
dcheng
2013/06/13 18:28:36
This is the result of clang-format-diff.py. If you
| |
| 39 } | |
| 40 | 37 |
| 41 VideoEncoderVp8::~VideoEncoderVp8() { | 38 VideoEncoderVp8::~VideoEncoderVp8() { |
| 42 Destroy(); | 39 Destroy(); |
| 43 } | 40 } |
| 44 | 41 |
| 45 void VideoEncoderVp8::Destroy() { | 42 void VideoEncoderVp8::Destroy() { |
| 46 if (initialized_) { | 43 if (initialized_) { |
| 47 vpx_codec_err_t ret = vpx_codec_destroy(codec_.get()); | 44 vpx_codec_err_t ret = vpx_codec_destroy(codec_.get()); |
| 48 DCHECK_EQ(ret, VPX_CODEC_OK) << "Failed to destroy codec"; | 45 DCHECK_EQ(ret, VPX_CODEC_OK) << "Failed to destroy codec"; |
| 49 initialized_ = false; | 46 initialized_ = false; |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 301 rect->set_x(r.rect().x()); | 298 rect->set_x(r.rect().x()); |
| 302 rect->set_y(r.rect().y()); | 299 rect->set_y(r.rect().y()); |
| 303 rect->set_width(r.rect().width()); | 300 rect->set_width(r.rect().width()); |
| 304 rect->set_height(r.rect().height()); | 301 rect->set_height(r.rect().height()); |
| 305 } | 302 } |
| 306 | 303 |
| 307 data_available_callback.Run(packet.Pass()); | 304 data_available_callback.Run(packet.Pass()); |
| 308 } | 305 } |
| 309 | 306 |
| 310 } // namespace remoting | 307 } // namespace remoting |
| OLD | NEW |