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

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

Issue 2121043002: 16 bpp video stream capture, render and WebGL usage - Realsense R200 & SR300 support. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tests: cc, skcanvas_video_renderer, wrtcrecorder... Fake capture supports Y16. Created 4 years, 3 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 f66343f31ab0d62d39d40d1d4d621a5296e41a0f..9e3d92636424d7399dba348cb986570e8685b44d 100644
--- a/content/renderer/media/video_track_recorder.cc
+++ b/content/renderer/media/video_track_recorder.cc
@@ -205,12 +205,14 @@ void VideoTrackRecorder::Encoder::StartFrameEncode(
if (!(video_frame->format() == media::PIXEL_FORMAT_I420 ||
video_frame->format() == media::PIXEL_FORMAT_YV12 ||
video_frame->format() == media::PIXEL_FORMAT_ARGB ||
- video_frame->format() == media::PIXEL_FORMAT_YV12A)) {
+ video_frame->format() == media::PIXEL_FORMAT_YV12A ||
+ video_frame->format() == media::PIXEL_FORMAT_Y16)) {
NOTREACHED() << media::VideoPixelFormatToString(video_frame->format());
return;
}
- if (video_frame->HasTextures()) {
+ if (video_frame->HasTextures() ||
+ video_frame->format() == media::PIXEL_FORMAT_Y16) {
main_task_runner_->PostTask(
FROM_HERE, base::Bind(&Encoder::RetrieveFrameOnMainThread, this,
video_frame, capture_timestamp));
@@ -245,8 +247,10 @@ void VideoTrackRecorder::Encoder::RetrieveFrameOnMainThread(
} else {
// Accelerated decoders produce ARGB/ABGR texture-backed frames (see
// https://crbug.com/585242), fetch them using a SkCanvasVideoRenderer.
- DCHECK(video_frame->HasTextures());
- DCHECK_EQ(media::PIXEL_FORMAT_ARGB, video_frame->format());
+ // Y16 CPU and GPU frames are using the same path for copying to RGBA.
+ DCHECK((video_frame->HasTextures() &&
+ video_frame->format() == media::PIXEL_FORMAT_ARGB) ||
+ video_frame->format() == media::PIXEL_FORMAT_Y16);
frame = media::VideoFrame::CreateFrame(
media::PIXEL_FORMAT_I420, video_frame->coded_size(),

Powered by Google App Engine
This is Rietveld 408576698