| 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 "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 // frame-level resource utilization stats. Use Get/SetTimeDelta() for this | 36 // frame-level resource utilization stats. Use Get/SetTimeDelta() for this |
| 37 // key. | 37 // key. |
| 38 FRAME_DURATION, | 38 FRAME_DURATION, |
| 39 | 39 |
| 40 // Represents either the fixed frame rate, or the maximum frame rate to | 40 // Represents either the fixed frame rate, or the maximum frame rate to |
| 41 // expect from a variable-rate source. This value generally remains the | 41 // expect from a variable-rate source. This value generally remains the |
| 42 // same for all frames in the same session. Use Get/SetDouble() for this | 42 // same for all frames in the same session. Use Get/SetDouble() for this |
| 43 // key. | 43 // key. |
| 44 FRAME_RATE, | 44 FRAME_RATE, |
| 45 | 45 |
| 46 // A feedback signal that indicates the fraction of the tolerable maximum |
| 47 // amount of resources that were utilized to process this frame. A producer |
| 48 // can check this value after-the-fact, usually via a VideoFrame destruction |
| 49 // observer, to determine whether the consumer can handle more or less data |
| 50 // volume, and achieve the right quality versus performance trade-off. |
| 51 // |
| 52 // Use Get/SetDouble() for this key. Values are interpreted as follows: |
| 53 // Less than 0.0 is meaningless and should be ignored. 1.0 indicates a |
| 54 // maximum sustainable utilization. Greater than 1.0 indicates the consumer |
| 55 // is likely to stall or drop frames if the data volume is not reduced. |
| 56 // |
| 57 // Example: In a system that encodes and transmits video frames over the |
| 58 // network, this value can be used to indicate whether sufficient CPU |
| 59 // is available for encoding and/or sufficient bandwidth is available for |
| 60 // transmission over the network. The maximum of the two utilization |
| 61 // measurements would be used as feedback. |
| 62 RESOURCE_UTILIZATION, |
| 63 |
| 46 NUM_KEYS | 64 NUM_KEYS |
| 47 }; | 65 }; |
| 48 | 66 |
| 49 VideoFrameMetadata(); | 67 VideoFrameMetadata(); |
| 50 ~VideoFrameMetadata(); | 68 ~VideoFrameMetadata(); |
| 51 | 69 |
| 52 bool HasKey(Key key) const; | 70 bool HasKey(Key key) const; |
| 53 | 71 |
| 54 void Clear() { dictionary_.Clear(); } | 72 void Clear() { dictionary_.Clear(); } |
| 55 | 73 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 81 const base::BinaryValue* GetBinaryValue(Key key) const; | 99 const base::BinaryValue* GetBinaryValue(Key key) const; |
| 82 | 100 |
| 83 base::DictionaryValue dictionary_; | 101 base::DictionaryValue dictionary_; |
| 84 | 102 |
| 85 DISALLOW_COPY_AND_ASSIGN(VideoFrameMetadata); | 103 DISALLOW_COPY_AND_ASSIGN(VideoFrameMetadata); |
| 86 }; | 104 }; |
| 87 | 105 |
| 88 } // namespace media | 106 } // namespace media |
| 89 | 107 |
| 90 #endif // MEDIA_BASE_VIDEO_FRAME_METADATA_H_ | 108 #endif // MEDIA_BASE_VIDEO_FRAME_METADATA_H_ |
| OLD | NEW |