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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 void VideoFrameMetadata::MergeInternalValuesInto( | 138 void VideoFrameMetadata::MergeInternalValuesInto( |
139 base::DictionaryValue* out) const { | 139 base::DictionaryValue* out) const { |
140 out->MergeDictionary(&dictionary_); | 140 out->MergeDictionary(&dictionary_); |
141 } | 141 } |
142 | 142 |
143 void VideoFrameMetadata::MergeInternalValuesFrom( | 143 void VideoFrameMetadata::MergeInternalValuesFrom( |
144 const base::DictionaryValue& in) { | 144 const base::DictionaryValue& in) { |
145 dictionary_.MergeDictionary(&in); | 145 dictionary_.MergeDictionary(&in); |
146 } | 146 } |
147 | 147 |
| 148 void VideoFrameMetadata::MergeMetadataFrom( |
| 149 const VideoFrameMetadata* metadata_source) { |
| 150 dictionary_.MergeDictionary(&metadata_source->dictionary_); |
| 151 } |
| 152 |
148 const base::BinaryValue* VideoFrameMetadata::GetBinaryValue(Key key) const { | 153 const base::BinaryValue* VideoFrameMetadata::GetBinaryValue(Key key) const { |
149 const base::Value* internal_value = nullptr; | 154 const base::Value* internal_value = nullptr; |
150 if (dictionary_.GetWithoutPathExpansion(ToInternalKey(key), | 155 if (dictionary_.GetWithoutPathExpansion(ToInternalKey(key), |
151 &internal_value) && | 156 &internal_value) && |
152 internal_value->GetType() == base::Value::TYPE_BINARY) { | 157 internal_value->GetType() == base::Value::TYPE_BINARY) { |
153 return static_cast<const base::BinaryValue*>(internal_value); | 158 return static_cast<const base::BinaryValue*>(internal_value); |
154 } | 159 } |
155 return nullptr; | 160 return nullptr; |
156 } | 161 } |
157 | 162 |
158 } // namespace media | 163 } // namespace media |
OLD | NEW |