| 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 3ebb3821b033a2403672591fc50dd84ec958426a..4e4b3199683e7a0f33e37f48fee7360be304417c 100644
|
| --- a/content/renderer/media/rtc_video_decoder.cc
|
| +++ b/content/renderer/media/rtc_video_decoder.cc
|
| @@ -61,9 +61,13 @@
|
|
|
| RTCVideoDecoder::BufferData::BufferData(int32 bitstream_buffer_id,
|
| uint32_t timestamp,
|
| + int width,
|
| + int height,
|
| size_t size)
|
| : bitstream_buffer_id(bitstream_buffer_id),
|
| timestamp(timestamp),
|
| + width(width),
|
| + height(height),
|
| size(size) {}
|
|
|
| RTCVideoDecoder::BufferData::BufferData() {}
|
| @@ -223,6 +227,8 @@
|
| // Create buffer metadata.
|
| BufferData buffer_data(next_bitstream_buffer_id_,
|
| inputImage._timeStamp,
|
| + frame_size_.width(),
|
| + frame_size_.height(),
|
| inputImage._length);
|
| // Mask against 30 bits, to avoid (undefined) wraparound on signed integer.
|
| next_bitstream_buffer_id_ = (next_bitstream_buffer_id_ + 1) & ID_LAST;
|
| @@ -358,21 +364,13 @@
|
| }
|
| const media::PictureBuffer& pb = it->second;
|
|
|
| - // Validate picture rectangle from GPU.
|
| - if (picture.visible_rect().IsEmpty() ||
|
| - !gfx::Rect(pb.size()).Contains(picture.visible_rect())) {
|
| - NOTREACHED() << "Invalid picture size from VDA: "
|
| - << picture.visible_rect().ToString() << " should fit in "
|
| - << pb.size().ToString();
|
| - NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE);
|
| - return;
|
| - }
|
| -
|
| // Create a media::VideoFrame.
|
| - uint32_t timestamp = 0;
|
| - GetBufferData(picture.bitstream_buffer_id(), ×tamp);
|
| + uint32_t timestamp = 0, width = 0, height = 0;
|
| + size_t size = 0;
|
| + GetBufferData(
|
| + picture.bitstream_buffer_id(), ×tamp, &width, &height, &size);
|
| scoped_refptr<media::VideoFrame> frame =
|
| - CreateVideoFrame(picture, pb, timestamp);
|
| + CreateVideoFrame(picture, pb, timestamp, width, height, size);
|
| bool inserted =
|
| picture_buffers_at_display_.insert(std::make_pair(
|
| picture.picture_buffer_id(),
|
| @@ -382,11 +380,7 @@
|
| // Create a WebRTC video frame.
|
| webrtc::RefCountImpl<NativeHandleImpl>* handle =
|
| new webrtc::RefCountImpl<NativeHandleImpl>(frame);
|
| - webrtc::TextureVideoFrame decoded_image(handle,
|
| - picture.visible_rect().width(),
|
| - picture.visible_rect().height(),
|
| - timestamp,
|
| - 0);
|
| + webrtc::TextureVideoFrame decoded_image(handle, width, height, timestamp, 0);
|
|
|
| // Invoke decode callback. WebRTC expects no callback after Reset or Release.
|
| {
|
| @@ -429,8 +423,11 @@
|
| scoped_refptr<media::VideoFrame> RTCVideoDecoder::CreateVideoFrame(
|
| const media::Picture& picture,
|
| const media::PictureBuffer& pb,
|
| - uint32_t timestamp) {
|
| - gfx::Rect visible_rect(picture.visible_rect());
|
| + uint32_t timestamp,
|
| + uint32_t width,
|
| + uint32_t height,
|
| + size_t size) {
|
| + gfx::Rect visible_rect(width, height);
|
| DCHECK(decoder_texture_target_);
|
| // Convert timestamp from 90KHz to ms.
|
| base::TimeDelta timestamp_ms = base::TimeDelta::FromInternalValue(
|
| @@ -780,13 +777,18 @@
|
| }
|
|
|
| void RTCVideoDecoder::GetBufferData(int32 bitstream_buffer_id,
|
| - uint32_t* timestamp) {
|
| + uint32_t* timestamp,
|
| + uint32_t* width,
|
| + uint32_t* height,
|
| + size_t* size) {
|
| for (std::list<BufferData>::iterator it = input_buffer_data_.begin();
|
| it != input_buffer_data_.end();
|
| ++it) {
|
| if (it->bitstream_buffer_id != bitstream_buffer_id)
|
| continue;
|
| *timestamp = it->timestamp;
|
| + *width = it->width;
|
| + *height = it->height;
|
| return;
|
| }
|
| NOTREACHED() << "Missing bitstream buffer id: " << bitstream_buffer_id;
|
|
|