Commit 812621ba authored by Markus Handell's avatar Markus Handell Committed by Commit Bot

MediaRecorder: support PIXEL_FORMAT_XRGB

While trying out MediaRecorder with a H.264 profile_idc 77 level_idc 52 remote stream
on Mac, the code DCHECKs in video_track_recorder.cc:239. This change adds support
in the same way as the fix for crbug/585242.

Bug: 1022294
Change-Id: I0e8804b6b0b2a22f64b4af07d0078a0415499bac
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1908537Reviewed-by: default avatarGuido Urdaneta <guidou@chromium.org>
Reviewed-by: default avatarMiguel Casas <mcasas@chromium.org>
Commit-Queue: Guido Urdaneta <guidou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714275}
parent 74cceb49
......@@ -235,7 +235,8 @@ void VideoTrackRecorder::Encoder::StartFrameEncode(
if (!(video_frame->format() == media::PIXEL_FORMAT_I420 ||
video_frame->format() == media::PIXEL_FORMAT_ARGB ||
video_frame->format() == media::PIXEL_FORMAT_I420A ||
video_frame->format() == media::PIXEL_FORMAT_NV12)) {
video_frame->format() == media::PIXEL_FORMAT_NV12 ||
video_frame->format() == media::PIXEL_FORMAT_XRGB)) {
NOTREACHED() << media::VideoPixelFormatToString(video_frame->format());
return;
}
......@@ -299,8 +300,13 @@ void VideoTrackRecorder::Encoder::RetrieveFrameOnMainThread(
} else {
// Accelerated decoders produce ARGB/ABGR texture-backed frames (see
// https://crbug.com/585242), fetch them using a PaintCanvasVideoRenderer.
// Additionally, Macintosh accelerated decoders can produce XRGB content
// and are treated the same way.
//
// TODO(crbug/1023390): Add browsertest for these.
DCHECK(video_frame->HasTextures());
DCHECK_EQ(media::PIXEL_FORMAT_ARGB, video_frame->format());
DCHECK(video_frame->format() == media::PIXEL_FORMAT_ARGB ||
video_frame->format() == media::PIXEL_FORMAT_XRGB);
const gfx::Size& old_visible_size = video_frame->visible_rect().size();
gfx::Size new_visible_size = old_visible_size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment