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

Unified Diff: content/renderer/media/video_track_recorder.cc

Issue 1737253002: Handle Alpha channel in Canvas capture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: content/renderer/media/video_track_recorder.cc
diff --git a/content/renderer/media/video_track_recorder.cc b/content/renderer/media/video_track_recorder.cc
index 82ae3ea9ba7dc9ed25e19f9277f1e0fd758de253..8cddb2653b44b0134007801f42f67f0c093b7f61 100644
--- a/content/renderer/media/video_track_recorder.cc
+++ b/content/renderer/media/video_track_recorder.cc
@@ -192,6 +192,17 @@ void VideoTrackRecorder::VpxEncoder::EncodeOnEncodingThread(
"VideoTrackRecorder::VpxEncoder::EncodeOnEncodingThread");
DCHECK(encoding_thread_->task_runner()->BelongsToCurrentThread());
+ if (!(frame->IsMappable() &&
mcasas 2016/02/25 22:06:25 Why add this here now? (Same elsewhere).
emircan 2016/02/26 01:33:08 Removing IsMappable() checks.
+ (frame->format() == media::PIXEL_FORMAT_I420 ||
+ frame->format() == media::PIXEL_FORMAT_YV12A))) {
+ NOTREACHED();
+ return;
+ }
mcasas 2016/02/25 22:06:25 Judgment call: turn this into a DCHECK() and let i
emircan 2016/02/26 01:33:08 I actually started with DCHECKs but then found [0]
+
+ // Drop alpha channel since we do not support it yet.
+ if (frame->format() == media::PIXEL_FORMAT_YV12A)
+ frame->DropYV12AAlphaChannel();
+
const gfx::Size frame_size = frame->visible_rect().size();
if (!IsInitialized() ||
gfx::Size(codec_config_.g_w, codec_config_.g_h) != frame_size) {

Powered by Google App Engine
This is Rietveld 408576698