| 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 #ifndef MEDIA_BASE_VIDEO_FRAME_METADATA_H_ | 5 #ifndef MEDIA_BASE_VIDEO_FRAME_METADATA_H_ |
| 6 #define MEDIA_BASE_VIDEO_FRAME_METADATA_H_ | 6 #define MEDIA_BASE_VIDEO_FRAME_METADATA_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 | 10 |
| 10 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "media/base/media_export.h" | 15 #include "media/base/media_export.h" |
| 16 | 16 |
| 17 namespace media { | 17 namespace media { |
| 18 | 18 |
| 19 class MEDIA_EXPORT VideoFrameMetadata { | 19 class MEDIA_EXPORT VideoFrameMetadata { |
| 20 public: | 20 public: |
| 21 enum Key { | 21 enum Key { |
| 22 // Sources of VideoFrames use this marker to indicate that the associated | 22 // Sources of VideoFrames use this marker to indicate that the associated |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 116 |
| 117 void Clear() { dictionary_.Clear(); } | 117 void Clear() { dictionary_.Clear(); } |
| 118 | 118 |
| 119 // Setters. Overwrites existing value, if present. | 119 // Setters. Overwrites existing value, if present. |
| 120 void SetBoolean(Key key, bool value); | 120 void SetBoolean(Key key, bool value); |
| 121 void SetInteger(Key key, int value); | 121 void SetInteger(Key key, int value); |
| 122 void SetDouble(Key key, double value); | 122 void SetDouble(Key key, double value); |
| 123 void SetString(Key key, const std::string& value); | 123 void SetString(Key key, const std::string& value); |
| 124 void SetTimeDelta(Key key, const base::TimeDelta& value); | 124 void SetTimeDelta(Key key, const base::TimeDelta& value); |
| 125 void SetTimeTicks(Key key, const base::TimeTicks& value); | 125 void SetTimeTicks(Key key, const base::TimeTicks& value); |
| 126 void SetValue(Key key, scoped_ptr<base::Value> value); | 126 void SetValue(Key key, std::unique_ptr<base::Value> value); |
| 127 | 127 |
| 128 // Getters. Returns true if |key| is present, and its value has been set. | 128 // Getters. Returns true if |key| is present, and its value has been set. |
| 129 bool GetBoolean(Key key, bool* value) const WARN_UNUSED_RESULT; | 129 bool GetBoolean(Key key, bool* value) const WARN_UNUSED_RESULT; |
| 130 bool GetInteger(Key key, int* value) const WARN_UNUSED_RESULT; | 130 bool GetInteger(Key key, int* value) const WARN_UNUSED_RESULT; |
| 131 bool GetDouble(Key key, double* value) const WARN_UNUSED_RESULT; | 131 bool GetDouble(Key key, double* value) const WARN_UNUSED_RESULT; |
| 132 bool GetString(Key key, std::string* value) const WARN_UNUSED_RESULT; | 132 bool GetString(Key key, std::string* value) const WARN_UNUSED_RESULT; |
| 133 bool GetTimeDelta(Key key, base::TimeDelta* value) const WARN_UNUSED_RESULT; | 133 bool GetTimeDelta(Key key, base::TimeDelta* value) const WARN_UNUSED_RESULT; |
| 134 bool GetTimeTicks(Key key, base::TimeTicks* value) const WARN_UNUSED_RESULT; | 134 bool GetTimeTicks(Key key, base::TimeTicks* value) const WARN_UNUSED_RESULT; |
| 135 | 135 |
| 136 // Returns null if |key| was not present. | 136 // Returns null if |key| was not present. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 150 const base::BinaryValue* GetBinaryValue(Key key) const; | 150 const base::BinaryValue* GetBinaryValue(Key key) const; |
| 151 | 151 |
| 152 base::DictionaryValue dictionary_; | 152 base::DictionaryValue dictionary_; |
| 153 | 153 |
| 154 DISALLOW_COPY_AND_ASSIGN(VideoFrameMetadata); | 154 DISALLOW_COPY_AND_ASSIGN(VideoFrameMetadata); |
| 155 }; | 155 }; |
| 156 | 156 |
| 157 } // namespace media | 157 } // namespace media |
| 158 | 158 |
| 159 #endif // MEDIA_BASE_VIDEO_FRAME_METADATA_H_ | 159 #endif // MEDIA_BASE_VIDEO_FRAME_METADATA_H_ |
| OLD | NEW |