| 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/time.h" | 10 #include "base/time/time.h" |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 // TODO(ddorwin): Refactor so we do not need a fake key ID ("1"); | 502 // TODO(ddorwin): Refactor so we do not need a fake key ID ("1"); |
| 503 decrypt_config.reset( | 503 decrypt_config.reset( |
| 504 new DecryptConfig("1", "", 0, std::vector<SubsampleEntry>())); | 504 new DecryptConfig("1", "", 0, std::vector<SubsampleEntry>())); |
| 505 } | 505 } |
| 506 | 506 |
| 507 scoped_refptr<StreamParserBuffer> stream_buf = | 507 scoped_refptr<StreamParserBuffer> stream_buf = |
| 508 StreamParserBuffer::CopyFrom(&frame_buf[0], frame_buf.size(), | 508 StreamParserBuffer::CopyFrom(&frame_buf[0], frame_buf.size(), |
| 509 runs_->is_keyframe()); | 509 runs_->is_keyframe()); |
| 510 | 510 |
| 511 if (decrypt_config) | 511 if (decrypt_config) |
| 512 stream_buf->SetDecryptConfig(decrypt_config.Pass()); | 512 stream_buf->set_decrypt_config(decrypt_config.Pass()); |
| 513 | 513 |
| 514 stream_buf->SetDuration(runs_->duration()); | 514 stream_buf->set_duration(runs_->duration()); |
| 515 stream_buf->SetTimestamp(runs_->cts()); | 515 stream_buf->set_timestamp(runs_->cts()); |
| 516 stream_buf->SetDecodeTimestamp(runs_->dts()); | 516 stream_buf->SetDecodeTimestamp(runs_->dts()); |
| 517 | 517 |
| 518 DVLOG(3) << "Pushing frame: aud=" << audio | 518 DVLOG(3) << "Pushing frame: aud=" << audio |
| 519 << ", key=" << runs_->is_keyframe() | 519 << ", key=" << runs_->is_keyframe() |
| 520 << ", dur=" << runs_->duration().InMilliseconds() | 520 << ", dur=" << runs_->duration().InMilliseconds() |
| 521 << ", dts=" << runs_->dts().InMilliseconds() | 521 << ", dts=" << runs_->dts().InMilliseconds() |
| 522 << ", cts=" << runs_->cts().InMilliseconds() | 522 << ", cts=" << runs_->cts().InMilliseconds() |
| 523 << ", size=" << runs_->sample_size(); | 523 << ", size=" << runs_->sample_size(); |
| 524 | 524 |
| 525 if (audio) { | 525 if (audio) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 return !err; | 569 return !err; |
| 570 } | 570 } |
| 571 | 571 |
| 572 void MP4StreamParser::ChangeState(State new_state) { | 572 void MP4StreamParser::ChangeState(State new_state) { |
| 573 DVLOG(2) << "Changing state: " << new_state; | 573 DVLOG(2) << "Changing state: " << new_state; |
| 574 state_ = new_state; | 574 state_ = new_state; |
| 575 } | 575 } |
| 576 | 576 |
| 577 } // namespace mp4 | 577 } // namespace mp4 |
| 578 } // namespace media | 578 } // namespace media |
| OLD | NEW |