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

Unified Diff: media/filters/decrypting_video_decoder.cc

Issue 2872223002: media: Set ColorSpace on decoded frames in DecryptingVideoDecoder (Closed)
Patch Set: more fix and test Created 3 years, 7 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/test_helpers.cc ('k') | media/filters/decrypting_video_decoder_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/decrypting_video_decoder.cc
diff --git a/media/filters/decrypting_video_decoder.cc b/media/filters/decrypting_video_decoder.cc
index bb883bd59a4b297fccc7b73254bd72315b235085..5051d8864c7c9b17037ce5efea6d666bc720103b 100644
--- a/media/filters/decrypting_video_decoder.cc
+++ b/media/filters/decrypting_video_decoder.cc
@@ -275,8 +275,18 @@ void DecryptingVideoDecoder::DeliverFrame(
}
DCHECK_EQ(status, Decryptor::kSuccess);
- // No frame returned with kSuccess should be end-of-stream frame.
+ // Frame returned with kSuccess should not be an end-of-stream frame.
DCHECK(!frame->metadata()->IsTrue(VideoFrameMetadata::END_OF_STREAM));
+
+ // If color space is not set, use the color space in the |config_|.
+ if (!frame->ColorSpace().IsValid()) {
+ DVLOG(3) << "Setting color space using information in the config.";
+ frame->metadata()->SetInteger(VideoFrameMetadata::COLOR_SPACE,
+ config_.color_space());
+ if (config_.color_space_info() != VideoColorSpace())
+ frame->set_color_space(config_.color_space_info().ToGfxColorSpace());
+ }
+
output_cb_.Run(frame);
if (scoped_pending_buffer_to_decode->end_of_stream()) {
« no previous file with comments | « media/base/test_helpers.cc ('k') | media/filters/decrypting_video_decoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698