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 "base/logging.h" | 7 #include "base/logging.h" |
8 #include "media/base/buffers.h" | 8 #include "media/base/buffers.h" |
9 | 9 |
10 namespace media { | 10 namespace media { |
(...skipping 17 matching lines...) Expand all Loading... |
28 void StreamParserBuffer::SetDecodeTimestamp(const base::TimeDelta& timestamp) { | 28 void StreamParserBuffer::SetDecodeTimestamp(const base::TimeDelta& timestamp) { |
29 decode_timestamp_ = timestamp; | 29 decode_timestamp_ = timestamp; |
30 } | 30 } |
31 | 31 |
32 StreamParserBuffer::StreamParserBuffer(const uint8* data, int data_size, | 32 StreamParserBuffer::StreamParserBuffer(const uint8* data, int data_size, |
33 bool is_keyframe) | 33 bool is_keyframe) |
34 : DecoderBuffer(data, data_size), | 34 : DecoderBuffer(data, data_size), |
35 is_keyframe_(is_keyframe), | 35 is_keyframe_(is_keyframe), |
36 decode_timestamp_(kNoTimestamp()), | 36 decode_timestamp_(kNoTimestamp()), |
37 config_id_(kInvalidConfigId) { | 37 config_id_(kInvalidConfigId) { |
38 SetDuration(kNoTimestamp()); | 38 if (data) { |
| 39 SetDuration(kNoTimestamp()); |
| 40 } |
39 } | 41 } |
40 | 42 |
41 StreamParserBuffer::~StreamParserBuffer() { | 43 StreamParserBuffer::~StreamParserBuffer() { |
42 } | 44 } |
43 | 45 |
44 int StreamParserBuffer::GetConfigId() const { | 46 int StreamParserBuffer::GetConfigId() const { |
45 return config_id_; | 47 return config_id_; |
46 } | 48 } |
47 | 49 |
48 void StreamParserBuffer::SetConfigId(int config_id) { | 50 void StreamParserBuffer::SetConfigId(int config_id) { |
49 config_id_ = config_id; | 51 config_id_ = config_id; |
50 } | 52 } |
51 | 53 |
52 } // namespace media | 54 } // namespace media |
OLD | NEW |