 Chromium Code Reviews
 Chromium Code Reviews Issue 1955273002:
  Fix codec name logging in ivf_file_writer.cc  (Closed) 
  Base URL: https://chromium.googlesource.com/external/webrtc.git@master
    
  
    Issue 1955273002:
  Fix codec name logging in ivf_file_writer.cc  (Closed) 
  Base URL: https://chromium.googlesource.com/external/webrtc.git@master| OLD | NEW | 
|---|---|
| 1 /* | 1 /* | 
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 
| 3 * | 3 * | 
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license | 
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source | 
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found | 
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may | 
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. | 
| 9 */ | 9 */ | 
| 10 | 10 | 
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 110 width_ = encoded_image._encodedWidth; | 110 width_ = encoded_image._encodedWidth; | 
| 111 height_ = encoded_image._encodedHeight; | 111 height_ = encoded_image._encodedHeight; | 
| 112 RTC_CHECK_GT(width_, 0); | 112 RTC_CHECK_GT(width_, 0); | 
| 113 RTC_CHECK_GT(height_, 0); | 113 RTC_CHECK_GT(height_, 0); | 
| 114 using_capture_timestamps_ = encoded_image._timeStamp == 0; | 114 using_capture_timestamps_ = encoded_image._timeStamp == 0; | 
| 115 | 115 | 
| 116 if (!WriteHeader()) | 116 if (!WriteHeader()) | 
| 117 return false; | 117 return false; | 
| 118 | 118 | 
| 119 std::string codec_name; | 119 std::string codec_name; | 
| 120 switch (codec_type_) { | 120 switch (codec_type_) { | 
| 
pbos-webrtc
2016/05/09 16:44:33
Can you store codec_type_ as the proper enum type
 
hta-webrtc
2016/05/09 16:59:08
It was, and it didn't. codec_type_ is the proper e
 | |
| 121 case kRtpVideoVp8: | 121 case kVideoCodecVP8: | 
| 122 codec_name = "VP8"; | 122 codec_name = "VP8"; | 
| 123 break; | 123 break; | 
| 124 case kRtpVideoVp9: | 124 case kVideoCodecVP9: | 
| 125 codec_name = "VP9"; | 125 codec_name = "VP9"; | 
| 126 break; | 126 break; | 
| 127 case kRtpVideoH264: | 127 case kVideoCodecH264: | 
| 128 codec_name = "H264"; | 128 codec_name = "H264"; | 
| 129 break; | 129 break; | 
| 130 default: | 130 default: | 
| 131 codec_name = "Unkown"; | 131 codec_name = "Unknown"; | 
| 132 } | 132 } | 
| 133 LOG(LS_WARNING) << "Created IVF file " << file_name_ | 133 LOG(LS_WARNING) << "Created IVF file " << file_name_ | 
| 134 << " for codec data of type " << codec_name | 134 << " for codec data of type " << codec_name | 
| 135 << " at resolution " << width_ << " x " << height_ | 135 << " at resolution " << width_ << " x " << height_ | 
| 136 << ", using " << (using_capture_timestamps_ ? "1" : "90") | 136 << ", using " << (using_capture_timestamps_ ? "1" : "90") | 
| 137 << "kHz clock resolution."; | 137 << "kHz clock resolution."; | 
| 138 return true; | 138 return true; | 
| 139 } | 139 } | 
| 140 | 140 | 
| 141 bool IvfFileWriter::WriteFrame(const EncodedImage& encoded_image) { | 141 bool IvfFileWriter::WriteFrame(const EncodedImage& encoded_image) { | 
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 187 if (remove(file_name_.c_str()) != 0) | 187 if (remove(file_name_.c_str()) != 0) | 
| 188 LOG(LS_WARNING) << "Failed to remove empty IVF file " << file_name_; | 188 LOG(LS_WARNING) << "Failed to remove empty IVF file " << file_name_; | 
| 189 | 189 | 
| 190 return true; | 190 return true; | 
| 191 } | 191 } | 
| 192 | 192 | 
| 193 return WriteHeader() && (file_->CloseFile() == 0); | 193 return WriteHeader() && (file_->CloseFile() == 0); | 
| 194 } | 194 } | 
| 195 | 195 | 
| 196 } // namespace webrtc | 196 } // namespace webrtc | 
| OLD | NEW |