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

Unified Diff: media/base/video_frame_metadata.cc

Issue 2150203002: Apply rotation for texture backed VideoFrames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments. Created 4 years, 5 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
« no previous file with comments | « media/base/video_frame_metadata.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_frame_metadata.cc
diff --git a/media/base/video_frame_metadata.cc b/media/base/video_frame_metadata.cc
index 1fcba0f3adf8168783392331557a904c16930a93..388e001ca84c4d173e40ae14eb24f165374e1dac 100644
--- a/media/base/video_frame_metadata.cc
+++ b/media/base/video_frame_metadata.cc
@@ -42,6 +42,11 @@ void VideoFrameMetadata::SetDouble(Key key, double value) {
dictionary_.SetDoubleWithoutPathExpansion(ToInternalKey(key), value);
}
+void VideoFrameMetadata::SetRotation(Key key, VideoRotation value) {
+ DCHECK_EQ(ROTATION, key);
+ dictionary_.SetIntegerWithoutPathExpansion(ToInternalKey(key), value);
+}
+
void VideoFrameMetadata::SetString(Key key, const std::string& value) {
dictionary_.SetWithoutPathExpansion(
ToInternalKey(key),
@@ -92,6 +97,17 @@ bool VideoFrameMetadata::GetDouble(Key key, double* value) const {
return dictionary_.GetDoubleWithoutPathExpansion(ToInternalKey(key), value);
}
+bool VideoFrameMetadata::GetRotation(Key key, VideoRotation* value) const {
+ DCHECK_EQ(ROTATION, key);
+ DCHECK(value);
+ int int_value;
+ const bool rv = dictionary_.GetIntegerWithoutPathExpansion(ToInternalKey(key),
+ &int_value);
+ if (rv)
+ *value = static_cast<VideoRotation>(int_value);
+ return rv;
+}
+
bool VideoFrameMetadata::GetString(Key key, std::string* value) const {
DCHECK(value);
const base::BinaryValue* const binary_value = GetBinaryValue(key);
« no previous file with comments | « media/base/video_frame_metadata.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698