| 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 "media/formats/mp4/avc.h" | 5 #include "media/formats/mp4/avc.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> |
| 8 | 9 |
| 9 #include "base/logging.h" | 10 #include "base/logging.h" |
| 10 #include "media/base/decrypt_config.h" | 11 #include "media/base/decrypt_config.h" |
| 11 #include "media/filters/h264_parser.h" | 12 #include "media/filters/h264_parser.h" |
| 12 #include "media/formats/mp4/box_definitions.h" | 13 #include "media/formats/mp4/box_definitions.h" |
| 13 #include "media/formats/mp4/box_reader.h" | 14 #include "media/formats/mp4/box_reader.h" |
| 14 | 15 |
| 15 namespace media { | 16 namespace media { |
| 16 namespace mp4 { | 17 namespace mp4 { |
| 17 | 18 |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 case H264Parser::kEOStream: | 305 case H264Parser::kEOStream: |
| 305 done = true; | 306 done = true; |
| 306 } | 307 } |
| 307 } | 308 } |
| 308 | 309 |
| 309 return order_state >= kAfterFirstVCL; | 310 return order_state >= kAfterFirstVCL; |
| 310 } | 311 } |
| 311 | 312 |
| 312 AVCBitstreamConverter::AVCBitstreamConverter( | 313 AVCBitstreamConverter::AVCBitstreamConverter( |
| 313 scoped_ptr<AVCDecoderConfigurationRecord> avc_config) | 314 scoped_ptr<AVCDecoderConfigurationRecord> avc_config) |
| 314 : avc_config_(avc_config.Pass()) { | 315 : avc_config_(std::move(avc_config)) { |
| 315 DCHECK(avc_config_); | 316 DCHECK(avc_config_); |
| 316 } | 317 } |
| 317 | 318 |
| 318 AVCBitstreamConverter::~AVCBitstreamConverter() { | 319 AVCBitstreamConverter::~AVCBitstreamConverter() { |
| 319 } | 320 } |
| 320 | 321 |
| 321 bool AVCBitstreamConverter::ConvertFrame( | 322 bool AVCBitstreamConverter::ConvertFrame( |
| 322 std::vector<uint8_t>* frame_buf, | 323 std::vector<uint8_t>* frame_buf, |
| 323 bool is_keyframe, | 324 bool is_keyframe, |
| 324 std::vector<SubsampleEntry>* subsamples) const { | 325 std::vector<SubsampleEntry>* subsamples) const { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 336 // count for that first subsample. | 337 // count for that first subsample. |
| 337 RCHECK(AVC::InsertParamSetsAnnexB(*avc_config_, frame_buf, subsamples)); | 338 RCHECK(AVC::InsertParamSetsAnnexB(*avc_config_, frame_buf, subsamples)); |
| 338 } | 339 } |
| 339 | 340 |
| 340 DCHECK(AVC::IsValidAnnexB(*frame_buf, *subsamples)); | 341 DCHECK(AVC::IsValidAnnexB(*frame_buf, *subsamples)); |
| 341 return true; | 342 return true; |
| 342 } | 343 } |
| 343 | 344 |
| 344 } // namespace mp4 | 345 } // namespace mp4 |
| 345 } // namespace media | 346 } // namespace media |
| OLD | NEW |