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..96a6af4d0e1e03fac0d9487242c4baada32c5aed 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) { |
@@ -348,6 +350,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; |
Pawel Osciak
2016/05/26 08:54:07
We should probably refuse format change in this cl
|
vda_->AssignPictureBuffers(picture_buffers); |
} |
@@ -400,12 +406,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; |