Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(982)

Unified Diff: media/base/video_frame.h

Issue 955253002: Add metadata to media::VideoFrame and plumb it through IPC/MediaStream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Windows compile errors. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/base/video_frame.h
diff --git a/media/base/video_frame.h b/media/base/video_frame.h
index 366a356735ab9ab1e8c57039321d779202005022..8470d1bb140015602934208ea1c09b1b08330d7b 100644
--- a/media/base/video_frame.h
+++ b/media/base/video_frame.h
@@ -11,6 +11,7 @@
#include "base/md5.h"
#include "base/memory/shared_memory.h"
#include "base/synchronization/lock.h"
+#include "base/values.h"
#include "media/base/buffers.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/size.h"
@@ -68,6 +69,11 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> {
FORMAT_MAX = YV12HD, // Must always be equal to largest entry logged.
};
+ // Key for getting/setting the frame rate value (of type DoubleValue) in the
+ // metadata dictionary. The value represents either the fixed frame rate, or
+ // the maximum frame rate to expect from a variable-rate source.
+ static const char kFrameRateMetadataKey[];
+
// Returns the name of a Format as a string.
static std::string FormatToString(Format format);
@@ -288,6 +294,15 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> {
// Returns the offset into the shared memory where the frame data begins.
size_t shared_memory_offset() const;
+ // Returns a dictionary of optional metadata. This contains information
+ // associated with the frame that downstream clients might use for frame-level
+ // logging, quality/performance optimizations, signaling, etc.
+ //
+ // TODO(miu): Move some of the "extra" members of VideoFrame (below) into
+ // here as a later clean-up step.
+ const base::DictionaryValue& metadata() const { return metadata_; }
+ base::DictionaryValue& metadata() { return metadata_; }
+
bool allow_overlay() const { return allow_overlay_; }
#if defined(OS_POSIX)
@@ -403,6 +418,8 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> {
const bool end_of_stream_;
+ base::DictionaryValue metadata_;
+
bool allow_overlay_;
DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame);

Powered by Google App Engine
This is Rietveld 408576698