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

Unified Diff: media/gpu/v4l2_slice_video_decode_accelerator.cc

Issue 2926593002: V4L2SVDA/VAAPIVDA: use visible size from decoder and pass to client (Closed)
Patch Set: V4L2SVDA/VAAPIVDA: use visible size from decoder and pass to client Created 3 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
Index: media/gpu/v4l2_slice_video_decode_accelerator.cc
diff --git a/media/gpu/v4l2_slice_video_decode_accelerator.cc b/media/gpu/v4l2_slice_video_decode_accelerator.cc
index 26223128a9165cc9dda70d3e4ec0fec9878393ca..df696d25867b476fdf6d493ca447cc8b14dcea95 100644
--- a/media/gpu/v4l2_slice_video_decode_accelerator.cc
+++ b/media/gpu/v4l2_slice_video_decode_accelerator.cc
@@ -800,18 +800,20 @@ bool V4L2SliceVideoDecodeAccelerator::CreateOutputBuffers() {
DCHECK(surfaces_at_display_.empty());
DCHECK(surfaces_at_device_.empty());
- visible_size_ = decoder_->GetPicSize();
+ gfx::Size pic_size = decoder_->GetPicSize();
+ visible_rect_ = decoder_->GetVisibleRect();
size_t num_pictures = decoder_->GetRequiredNumOfPictures();
DCHECK_GT(num_pictures, 0u);
- DCHECK(!visible_size_.IsEmpty());
+ DCHECK(!pic_size.IsEmpty());
+ DCHECK(!visible_rect_.IsEmpty());
Owen Lin 2017/06/07 06:10:59 As said in previous file, remove the check. Is it
johnylin1 2017/06/07 15:38:37 We may pass visible size from decoder to VDA along
struct v4l2_format format;
memset(&format, 0, sizeof(format));
format.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
format.fmt.pix_mp.pixelformat = output_format_fourcc_;
- format.fmt.pix_mp.width = visible_size_.width();
- format.fmt.pix_mp.height = visible_size_.height();
+ format.fmt.pix_mp.width = pic_size.width();
+ format.fmt.pix_mp.height = pic_size.height();
format.fmt.pix_mp.num_planes = input_planes_count_;
if (device_->Ioctl(VIDIOC_S_FMT, &format) != 0) {
@@ -825,14 +827,14 @@ bool V4L2SliceVideoDecodeAccelerator::CreateOutputBuffers() {
DCHECK_EQ(coded_size_.width() % 16, 0);
DCHECK_EQ(coded_size_.height() % 16, 0);
- if (!gfx::Rect(coded_size_).Contains(gfx::Rect(visible_size_))) {
- LOGF(ERROR) << "Got invalid adjusted coded size: "
- << coded_size_.ToString();
+ if (!gfx::Rect(coded_size_).Contains(visible_rect_)) {
Owen Lin 2017/06/07 06:10:59 use pic_size.
johnylin1 2017/06/07 15:38:37 Done.
+ LOGF(ERROR) << "Got invalid adjusted coded size: " << coded_size_.ToString()
+ << ", visible rect:" << visible_rect_.ToString();
return false;
}
DVLOGF(3) << "buffer_count=" << num_pictures
- << ", visible size=" << visible_size_.ToString()
+ << ", visible rect=" << visible_rect_.ToString()
<< ", coded size=" << coded_size_.ToString();
// With ALLOCATE mode the client can sample it as RGB and doesn't need to
@@ -3187,15 +3189,13 @@ void V4L2SliceVideoDecodeAccelerator::OutputSurface(
DCHECK_NE(output_record.picture_id, -1);
output_record.at_client = true;
- // TODO(posciak): Use visible size from decoder here instead
- // (crbug.com/402760). Passing (0, 0) results in the client using the
- // visible size extracted from the container instead.
// TODO(hubbe): Insert correct color space. http://crbug.com/647725
Picture picture(output_record.picture_id, dec_surface->bitstream_id(),
- gfx::Rect(0, 0), gfx::ColorSpace(), false);
+ visible_rect_, gfx::ColorSpace(), false);
DVLOGF(3) << dec_surface->ToString()
<< ", bitstream_id: " << picture.bitstream_buffer_id()
- << ", picture_id: " << picture.picture_buffer_id();
+ << ", picture_id: " << picture.picture_buffer_id()
+ << ", visible_rect: " << visible_rect_.ToString();
pending_picture_ready_.push(PictureRecord(output_record.cleared, picture));
SendPictureReady();
output_record.cleared = true;

Powered by Google App Engine
This is Rietveld 408576698