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

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

Issue 1942123002: Plumb decoded video pixel format from GPU process to renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: content/renderer/media/rtc_video_decoder.cc
diff --git a/content/renderer/media/rtc_video_decoder.cc b/content/renderer/media/rtc_video_decoder.cc
index abbc95ef96b3357f33c8348dbfd5c39ede84729f..7bd17cc841fac2383ec17fa3a10797c56e89d922 100644
--- a/content/renderer/media/rtc_video_decoder.cc
+++ b/content/renderer/media/rtc_video_decoder.cc
@@ -60,6 +60,7 @@ RTCVideoDecoder::RTCVideoDecoder(webrtc::VideoCodecType type,
video_codec_type_(type),
factories_(factories),
decoder_texture_target_(0),
+ pixel_format_(media::PIXEL_FORMAT_UNKNOWN),
next_picture_buffer_id_(0),
state_(UNINITIALIZED),
decode_complete_callback_(nullptr),
@@ -295,6 +296,7 @@ int32_t RTCVideoDecoder::Release() {
}
void RTCVideoDecoder::ProvidePictureBuffers(uint32_t count,
+ media::VideoPixelFormat format,
uint32_t textures_per_buffer,
const gfx::Size& size,
uint32_t texture_target) {
@@ -332,6 +334,10 @@ void RTCVideoDecoder::ProvidePictureBuffers(uint32_t count,
picture_buffers.back().id(), picture_buffers.back())).second;
DCHECK(inserted);
}
+
+ pixel_format_ = format;
+ if (pixel_format_ == media::PIXEL_FORMAT_UNKNOWN)
+ pixel_format_ = media::PIXEL_FORMAT_ARGB;
vda_->AssignPictureBuffers(picture_buffers);
}
@@ -384,12 +390,8 @@ void RTCVideoDecoder::PictureReady(const media::Picture& picture) {
return;
}
- media::VideoPixelFormat pixel_format = vda_->GetOutputFormat();
- if (pixel_format == media::PIXEL_FORMAT_UNKNOWN)
- pixel_format = media::PIXEL_FORMAT_ARGB;
-
scoped_refptr<media::VideoFrame> frame =
- CreateVideoFrame(picture, pb, timestamp, visible_rect, pixel_format);
+ CreateVideoFrame(picture, pb, timestamp, visible_rect, pixel_format_);
if (!frame) {
NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE);
return;

Powered by Google App Engine
This is Rietveld 408576698