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/base/stream_parser_buffer.h" | 5 #include "media/base/stream_parser_buffer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 buffer.track_id()); | 27 buffer.track_id()); |
28 copied_buffer->SetDecodeTimestamp(buffer.GetDecodeTimestamp()); | 28 copied_buffer->SetDecodeTimestamp(buffer.GetDecodeTimestamp()); |
29 copied_buffer->SetConfigId(buffer.GetConfigId()); | 29 copied_buffer->SetConfigId(buffer.GetConfigId()); |
30 copied_buffer->set_timestamp(buffer.timestamp()); | 30 copied_buffer->set_timestamp(buffer.timestamp()); |
31 copied_buffer->set_duration(buffer.duration()); | 31 copied_buffer->set_duration(buffer.duration()); |
32 copied_buffer->set_is_duration_estimated(buffer.is_duration_estimated()); | 32 copied_buffer->set_is_duration_estimated(buffer.is_duration_estimated()); |
33 copied_buffer->set_discard_padding(buffer.discard_padding()); | 33 copied_buffer->set_discard_padding(buffer.discard_padding()); |
34 copied_buffer->set_splice_timestamp(buffer.splice_timestamp()); | 34 copied_buffer->set_splice_timestamp(buffer.splice_timestamp()); |
35 const DecryptConfig* decrypt_config = buffer.decrypt_config(); | 35 const DecryptConfig* decrypt_config = buffer.decrypt_config(); |
36 if (decrypt_config) { | 36 if (decrypt_config) { |
37 copied_buffer->set_decrypt_config(base::WrapUnique( | 37 copied_buffer->set_decrypt_config(base::MakeUnique<DecryptConfig>( |
38 new DecryptConfig(decrypt_config->key_id(), decrypt_config->iv(), | 38 decrypt_config->key_id(), decrypt_config->iv(), |
39 decrypt_config->subsamples()))); | 39 decrypt_config->subsamples())); |
40 } | 40 } |
41 | 41 |
42 return copied_buffer; | 42 return copied_buffer; |
43 } | 43 } |
44 | 44 |
45 scoped_refptr<StreamParserBuffer> StreamParserBuffer::CreateEOSBuffer() { | 45 scoped_refptr<StreamParserBuffer> StreamParserBuffer::CreateEOSBuffer() { |
46 return make_scoped_refptr(new StreamParserBuffer(NULL, 0, NULL, 0, false, | 46 return make_scoped_refptr(new StreamParserBuffer(NULL, 0, NULL, 0, false, |
47 DemuxerStream::UNKNOWN, 0)); | 47 DemuxerStream::UNKNOWN, 0)); |
48 } | 48 } |
49 | 49 |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 std::make_pair(kInfiniteDuration, base::TimeDelta())); | 235 std::make_pair(kInfiniteDuration, base::TimeDelta())); |
236 } | 236 } |
237 | 237 |
238 void StreamParserBuffer::set_timestamp(base::TimeDelta timestamp) { | 238 void StreamParserBuffer::set_timestamp(base::TimeDelta timestamp) { |
239 DecoderBuffer::set_timestamp(timestamp); | 239 DecoderBuffer::set_timestamp(timestamp); |
240 if (preroll_buffer_.get()) | 240 if (preroll_buffer_.get()) |
241 preroll_buffer_->set_timestamp(timestamp); | 241 preroll_buffer_->set_timestamp(timestamp); |
242 } | 242 } |
243 | 243 |
244 } // namespace media | 244 } // namespace media |
OLD | NEW |