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

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: fix test on bots Created 4 years, 6 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 | « content/renderer/media/rtc_video_decoder.h ('k') | content/renderer/pepper/pepper_video_decoder_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d0d0387957c6c07795450b2b343c40dd393c2b42..fc119f759d576636ae32da6d20f14e722fc59742 100644
--- a/content/renderer/media/rtc_video_decoder.cc
+++ b/content/renderer/media/rtc_video_decoder.cc
@@ -66,6 +66,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),
@@ -311,6 +312,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) {
@@ -324,6 +326,17 @@ void RTCVideoDecoder::ProvidePictureBuffers(uint32_t count,
std::vector<uint32_t> texture_ids;
std::vector<gpu::Mailbox> texture_mailboxes;
decoder_texture_target_ = texture_target;
+
+ if (format == media::PIXEL_FORMAT_UNKNOWN)
+ format = media::PIXEL_FORMAT_ARGB;
+
+ if ((pixel_format_ != media::PIXEL_FORMAT_UNKNOWN) &&
+ (format != pixel_format_)) {
+ NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE);
+ return;
+ }
+
+ pixel_format_ = format;
if (!factories_->CreateTextures(count,
size,
&texture_ids,
@@ -400,12 +413,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;
« no previous file with comments | « content/renderer/media/rtc_video_decoder.h ('k') | content/renderer/pepper/pepper_video_decoder_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698