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

Unified Diff: media/base/video_color_space.cc

Issue 2746013006: use VideoColorSpace in decoder configuration (Closed)
Patch Set: oops, win compile fix reapplied Created 3 years, 9 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_color_space.h ('k') | media/base/video_decoder_config.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_color_space.cc
diff --git a/media/base/video_color_space.cc b/media/base/video_color_space.cc
index 0501ec4e12cd6b86e8e5f82aa25b12096f676dfd..036cd57f92050a4d55eaccd4fdc0fbc3c7bf7c88 100644
--- a/media/base/video_color_space.cc
+++ b/media/base/video_color_space.cc
@@ -43,6 +43,16 @@ VideoColorSpace::VideoColorSpace(int primaries,
matrix(GetMatrixID(matrix)),
range(range) {}
+bool VideoColorSpace::operator==(const VideoColorSpace& other) const {
+ return primaries == other.primaries && transfer == other.transfer &&
+ matrix == other.matrix && range == other.range;
+}
+
+bool VideoColorSpace::operator!=(const VideoColorSpace& other) const {
+ return primaries != other.primaries || transfer != other.transfer ||
+ matrix != other.matrix || range != other.range;
+}
+
gfx::ColorSpace VideoColorSpace::ToGfxColorSpace() const {
// TODO(hubbe): Make this type-safe.
return gfx::ColorSpace::CreateVideo(static_cast<int>(primaries),
@@ -50,9 +60,20 @@ gfx::ColorSpace VideoColorSpace::ToGfxColorSpace() const {
static_cast<int>(matrix), range);
}
-VideoColorSpace VideoColorSpace::BT709() {
+VideoColorSpace VideoColorSpace::REC709() {
return VideoColorSpace(PrimaryID::BT709, TransferID::BT709, MatrixID::BT709,
gfx::ColorSpace::RangeID::LIMITED);
}
+VideoColorSpace VideoColorSpace::REC601() {
+ return VideoColorSpace(PrimaryID::SMPTE170M, TransferID::SMPTE170M,
+ MatrixID::SMPTE170M,
+ gfx::ColorSpace::RangeID::LIMITED);
+}
+VideoColorSpace VideoColorSpace::JPEG() {
+ // TODO(ccameron): Determine which primaries and transfer function were
+ // intended here.
+ return VideoColorSpace(PrimaryID::BT709, TransferID::IEC61966_2_1,
+ MatrixID::SMPTE170M, gfx::ColorSpace::RangeID::FULL);
+}
} // namespace
« no previous file with comments | « media/base/video_color_space.h ('k') | media/base/video_decoder_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698