| 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/mp4_stream_parser.h" | 5 #include "media/formats/mp4/mp4_stream_parser.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | |
| 9 #include <limits> | 8 #include <limits> |
| 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/callback_helpers.h" | 12 #include "base/callback_helpers.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/time/time.h" | 14 #include "base/time/time.h" |
| 15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 16 #include "media/base/audio_decoder_config.h" | 16 #include "media/base/audio_decoder_config.h" |
| 17 #include "media/base/stream_parser_buffer.h" | 17 #include "media/base/stream_parser_buffer.h" |
| 18 #include "media/base/text_track_config.h" | 18 #include "media/base/text_track_config.h" |
| 19 #include "media/base/timestamp_constants.h" | 19 #include "media/base/timestamp_constants.h" |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 | 523 |
| 524 // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId | 524 // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId |
| 525 // type and allow multiple tracks for same media type, if applicable. See | 525 // type and allow multiple tracks for same media type, if applicable. See |
| 526 // https://crbug.com/341581. | 526 // https://crbug.com/341581. |
| 527 scoped_refptr<StreamParserBuffer> stream_buf = | 527 scoped_refptr<StreamParserBuffer> stream_buf = |
| 528 StreamParserBuffer::CopyFrom(&frame_buf[0], frame_buf.size(), | 528 StreamParserBuffer::CopyFrom(&frame_buf[0], frame_buf.size(), |
| 529 runs_->is_keyframe(), | 529 runs_->is_keyframe(), |
| 530 buffer_type, 0); | 530 buffer_type, 0); |
| 531 | 531 |
| 532 if (decrypt_config) | 532 if (decrypt_config) |
| 533 stream_buf->set_decrypt_config(decrypt_config.Pass()); | 533 stream_buf->set_decrypt_config(std::move(decrypt_config)); |
| 534 | 534 |
| 535 stream_buf->set_duration(runs_->duration()); | 535 stream_buf->set_duration(runs_->duration()); |
| 536 stream_buf->set_timestamp(runs_->cts()); | 536 stream_buf->set_timestamp(runs_->cts()); |
| 537 stream_buf->SetDecodeTimestamp(runs_->dts()); | 537 stream_buf->SetDecodeTimestamp(runs_->dts()); |
| 538 | 538 |
| 539 DVLOG(3) << "Pushing frame: aud=" << audio | 539 DVLOG(3) << "Pushing frame: aud=" << audio |
| 540 << ", key=" << runs_->is_keyframe() | 540 << ", key=" << runs_->is_keyframe() |
| 541 << ", dur=" << runs_->duration().InMilliseconds() | 541 << ", dur=" << runs_->duration().InMilliseconds() |
| 542 << ", dts=" << runs_->dts().InMilliseconds() | 542 << ", dts=" << runs_->dts().InMilliseconds() |
| 543 << ", cts=" << runs_->cts().InMilliseconds() | 543 << ", cts=" << runs_->cts().InMilliseconds() |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 runs.AdvanceSample(); | 627 runs.AdvanceSample(); |
| 628 } | 628 } |
| 629 runs.AdvanceRun(); | 629 runs.AdvanceRun(); |
| 630 } | 630 } |
| 631 | 631 |
| 632 return true; | 632 return true; |
| 633 } | 633 } |
| 634 | 634 |
| 635 } // namespace mp4 | 635 } // namespace mp4 |
| 636 } // namespace media | 636 } // namespace media |
| OLD | NEW |