| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 // This has to be included first. | 7 // This has to be included first. |
| 8 // See http://code.google.com/p/googletest/issues/detail?id=371 | 8 // See http://code.google.com/p/googletest/issues/detail?id=371 |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 const scoped_refptr<media::VideoFrame>& frame) { | 242 const scoped_refptr<media::VideoFrame>& frame) { |
| 243 frame->HashFrameForTesting(&md5_context_); | 243 frame->HashFrameForTesting(&md5_context_); |
| 244 | 244 |
| 245 if (output_file_.empty()) | 245 if (output_file_.empty()) |
| 246 return true; | 246 return true; |
| 247 | 247 |
| 248 for (size_t i = 0; i < media::VideoFrame::NumPlanes(frame->format()); i++) { | 248 for (size_t i = 0; i < media::VideoFrame::NumPlanes(frame->format()); i++) { |
| 249 int to_write = media::VideoFrame::PlaneAllocationSize( | 249 int to_write = media::VideoFrame::PlaneAllocationSize( |
| 250 frame->format(), i, frame->coded_size()); | 250 frame->format(), i, frame->coded_size()); |
| 251 const char* buf = reinterpret_cast<const char*>(frame->data(i)); | 251 const char* buf = reinterpret_cast<const char*>(frame->data(i)); |
| 252 int written = base::AppendToFile(output_file_, buf, to_write); | 252 if (!base::AppendToFile(output_file_, buf, to_write)) |
| 253 if (written != to_write) | |
| 254 return false; | 253 return false; |
| 255 } | 254 } |
| 256 return true; | 255 return true; |
| 257 } | 256 } |
| 258 | 257 |
| 259 void VaapiH264DecoderLoop::OutputPicture( | 258 void VaapiH264DecoderLoop::OutputPicture( |
| 260 int32 input_id, | 259 int32 input_id, |
| 261 const scoped_refptr<VASurface>& va_surface) { | 260 const scoped_refptr<VASurface>& va_surface) { |
| 262 VLOG(1) << "OutputPicture: picture " << num_outputted_pictures_++; | 261 VLOG(1) << "OutputPicture: picture " << num_outputted_pictures_++; |
| 263 | 262 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 content::g_md5sum = it->second; | 376 content::g_md5sum = it->second; |
| 378 continue; | 377 continue; |
| 379 } | 378 } |
| 380 if (it->first == "v" || it->first == "vmodule") | 379 if (it->first == "v" || it->first == "vmodule") |
| 381 continue; | 380 continue; |
| 382 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; | 381 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; |
| 383 } | 382 } |
| 384 | 383 |
| 385 return RUN_ALL_TESTS(); | 384 return RUN_ALL_TESTS(); |
| 386 } | 385 } |
| OLD | NEW |