| 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 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 decrypt_config.reset( | 598 decrypt_config.reset( |
| 599 new DecryptConfig("1", "", std::vector<SubsampleEntry>())); | 599 new DecryptConfig("1", "", std::vector<SubsampleEntry>())); |
| 600 } | 600 } |
| 601 | 601 |
| 602 StreamParserBuffer::Type buffer_type = audio ? DemuxerStream::AUDIO : | 602 StreamParserBuffer::Type buffer_type = audio ? DemuxerStream::AUDIO : |
| 603 DemuxerStream::VIDEO; | 603 DemuxerStream::VIDEO; |
| 604 | 604 |
| 605 // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId | 605 // TODO(wolenetz/acolwell): Validate and use a common cross-parser TrackId |
| 606 // type and allow multiple tracks for same media type, if applicable. See | 606 // type and allow multiple tracks for same media type, if applicable. See |
| 607 // https://crbug.com/341581. | 607 // https://crbug.com/341581. |
| 608 scoped_refptr<StreamParserBuffer> stream_buf = | 608 scoped_refptr<StreamParserBuffer> stream_buf = StreamParserBuffer::CopyFrom( |
| 609 StreamParserBuffer::CopyFrom(&frame_buf[0], frame_buf.size(), | 609 &frame_buf[0], frame_buf.size(), runs_->is_keyframe(), buffer_type, |
| 610 runs_->is_keyframe(), | 610 runs_->track_id()); |
| 611 buffer_type, 0); | |
| 612 | 611 |
| 613 if (decrypt_config) | 612 if (decrypt_config) |
| 614 stream_buf->set_decrypt_config(std::move(decrypt_config)); | 613 stream_buf->set_decrypt_config(std::move(decrypt_config)); |
| 615 | 614 |
| 616 stream_buf->set_duration(runs_->duration()); | 615 stream_buf->set_duration(runs_->duration()); |
| 617 stream_buf->set_timestamp(runs_->cts()); | 616 stream_buf->set_timestamp(runs_->cts()); |
| 618 stream_buf->SetDecodeTimestamp(runs_->dts()); | 617 stream_buf->SetDecodeTimestamp(runs_->dts()); |
| 619 | 618 |
| 620 DVLOG(3) << "Pushing frame: aud=" << audio | 619 DVLOG(3) << "Pushing frame: aud=" << audio |
| 621 << ", key=" << runs_->is_keyframe() | 620 << ", key=" << runs_->is_keyframe() |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 runs.AdvanceSample(); | 707 runs.AdvanceSample(); |
| 709 } | 708 } |
| 710 runs.AdvanceRun(); | 709 runs.AdvanceRun(); |
| 711 } | 710 } |
| 712 | 711 |
| 713 return true; | 712 return true; |
| 714 } | 713 } |
| 715 | 714 |
| 716 } // namespace mp4 | 715 } // namespace mp4 |
| 717 } // namespace media | 716 } // namespace media |
| OLD | NEW |