OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/video_frame_metadata.h" | 5 #include "media/base/video_frame_metadata.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 } // namespace | 66 } // namespace |
67 | 67 |
68 void VideoFrameMetadata::SetTimeDelta(Key key, const base::TimeDelta& value) { | 68 void VideoFrameMetadata::SetTimeDelta(Key key, const base::TimeDelta& value) { |
69 SetTimeValue(key, value, &dictionary_); | 69 SetTimeValue(key, value, &dictionary_); |
70 } | 70 } |
71 | 71 |
72 void VideoFrameMetadata::SetTimeTicks(Key key, const base::TimeTicks& value) { | 72 void VideoFrameMetadata::SetTimeTicks(Key key, const base::TimeTicks& value) { |
73 SetTimeValue(key, value, &dictionary_); | 73 SetTimeValue(key, value, &dictionary_); |
74 } | 74 } |
75 | 75 |
76 void VideoFrameMetadata::SetValue(Key key, scoped_ptr<base::Value> value) { | 76 void VideoFrameMetadata::SetValue(Key key, std::unique_ptr<base::Value> value) { |
77 dictionary_.SetWithoutPathExpansion(ToInternalKey(key), std::move(value)); | 77 dictionary_.SetWithoutPathExpansion(ToInternalKey(key), std::move(value)); |
78 } | 78 } |
79 | 79 |
80 bool VideoFrameMetadata::GetBoolean(Key key, bool* value) const { | 80 bool VideoFrameMetadata::GetBoolean(Key key, bool* value) const { |
81 DCHECK(value); | 81 DCHECK(value); |
82 return dictionary_.GetBooleanWithoutPathExpansion(ToInternalKey(key), value); | 82 return dictionary_.GetBooleanWithoutPathExpansion(ToInternalKey(key), value); |
83 } | 83 } |
84 | 84 |
85 bool VideoFrameMetadata::GetInteger(Key key, int* value) const { | 85 bool VideoFrameMetadata::GetInteger(Key key, int* value) const { |
86 DCHECK(value); | 86 DCHECK(value); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 const base::Value* internal_value = nullptr; | 154 const base::Value* internal_value = nullptr; |
155 if (dictionary_.GetWithoutPathExpansion(ToInternalKey(key), | 155 if (dictionary_.GetWithoutPathExpansion(ToInternalKey(key), |
156 &internal_value) && | 156 &internal_value) && |
157 internal_value->GetType() == base::Value::TYPE_BINARY) { | 157 internal_value->GetType() == base::Value::TYPE_BINARY) { |
158 return static_cast<const base::BinaryValue*>(internal_value); | 158 return static_cast<const base::BinaryValue*>(internal_value); |
159 } | 159 } |
160 return nullptr; | 160 return nullptr; |
161 } | 161 } |
162 | 162 |
163 } // namespace media | 163 } // namespace media |
OLD | NEW |