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 "media/mp4/mp4_stream_parser.h" | 5 #include "media/mp4/mp4_stream_parser.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
407 DLOG(ERROR) << "Failed to prepare AAC sample for decode"; | 407 DLOG(ERROR) << "Failed to prepare AAC sample for decode"; |
408 *err = true; | 408 *err = true; |
409 return false; | 409 return false; |
410 } | 410 } |
411 } | 411 } |
412 | 412 |
413 if (decrypt_config.get() != NULL && !subsamples.empty()) { | 413 if (decrypt_config.get() != NULL && !subsamples.empty()) { |
414 decrypt_config.reset(new DecryptConfig( | 414 decrypt_config.reset(new DecryptConfig( |
415 decrypt_config->key_id(), | 415 decrypt_config->key_id(), |
416 decrypt_config->iv(), | 416 decrypt_config->iv(), |
417 decrypt_config->checksum(), | |
418 decrypt_config->data_offset(), | 417 decrypt_config->data_offset(), |
419 subsamples)); | 418 subsamples)); |
420 } | 419 } |
421 | 420 |
422 scoped_refptr<StreamParserBuffer> stream_buf = | 421 scoped_refptr<StreamParserBuffer> stream_buf = |
423 StreamParserBuffer::CopyFrom(&frame_buf[0], frame_buf.size(), | 422 StreamParserBuffer::CopyFrom(&frame_buf[0], frame_buf.size(), |
424 runs_->is_keyframe()); | 423 runs_->is_keyframe()); |
425 | 424 |
426 if (runs_->is_encrypted()) | 425 if (runs_->is_encrypted()) |
427 stream_buf->SetDecryptConfig(decrypt_config.Pass()); | 426 stream_buf->SetDecryptConfig(decrypt_config.Pass()); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 return !err; | 482 return !err; |
484 } | 483 } |
485 | 484 |
486 void MP4StreamParser::ChangeState(State new_state) { | 485 void MP4StreamParser::ChangeState(State new_state) { |
487 DVLOG(2) << "Changing state: " << new_state; | 486 DVLOG(2) << "Changing state: " << new_state; |
488 state_ = new_state; | 487 state_ = new_state; |
489 } | 488 } |
490 | 489 |
491 } // namespace mp4 | 490 } // namespace mp4 |
492 } // namespace media | 491 } // namespace media |
OLD | NEW |