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

Unified Diff: media/filters/decrypting_video_decoder.cc

Issue 2872223002: media: Set ColorSpace on decoded frames in DecryptingVideoDecoder (Closed)
Patch Set: 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 | « no previous file | no next file » | 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..554cd688ae3f6b3b2b8d515c6097ddf6fd5157f6 100644
--- a/media/filters/decrypting_video_decoder.cc
+++ b/media/filters/decrypting_video_decoder.cc
@@ -275,8 +275,17 @@ 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() == gfx::ColorSpace() &&
hubbe 2017/05/10 17:23:11 It's probably better to use frame->ColorSpace().Is
xhwang 2017/05/10 20:17:23 Done and improved this block.
+ config_.color_space_info() != VideoColorSpace()) {
+ frame->metadata()->SetInteger(VideoFrameMetadata::COLOR_SPACE,
+ config_.color_space());
+ 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 | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698