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

Side by Side Diff: media/gpu/vaapi_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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/gpu/vaapi_video_decode_accelerator.h" 5 #include "media/gpu/vaapi_video_decode_accelerator.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 DVLOG(3) << "Outputting VASurface " << va_surface->id() 420 DVLOG(3) << "Outputting VASurface " << va_surface->id()
421 << " into pixmap bound to picture buffer id " << output_id; 421 << " into pixmap bound to picture buffer id " << output_id;
422 422
423 RETURN_AND_NOTIFY_ON_FAILURE(picture->DownloadFromSurface(va_surface), 423 RETURN_AND_NOTIFY_ON_FAILURE(picture->DownloadFromSurface(va_surface),
424 "Failed putting surface into pixmap", 424 "Failed putting surface into pixmap",
425 PLATFORM_FAILURE, ); 425 PLATFORM_FAILURE, );
426 426
427 // Notify the client a picture is ready to be displayed. 427 // Notify the client a picture is ready to be displayed.
428 ++num_frames_at_client_; 428 ++num_frames_at_client_;
429 TRACE_COUNTER1("Video Decoder", "Textures at client", num_frames_at_client_); 429 TRACE_COUNTER1("Video Decoder", "Textures at client", num_frames_at_client_);
430 DVLOG(4) << "Notifying output picture id " << output_id 430 gfx::Rect visible_rect = decoder_->GetVisibleRect();
Owen Lin 2017/06/07 06:11:00 I am afraid you cannot get the visible size here.
johnylin1 2017/06/07 15:38:37 I think it would be better to put visible_size in
Pawel Osciak 2017/06/08 04:58:24 Could you explain your reasoning please? Owen is
Owen Lin 2017/06/09 02:03:17 I understand why we need this in DecodeSurface. H2
johnylin1 2017/06/12 13:41:53 My thought is same as Owen, we need to have visibl
431 << " for input " << input_id << " is ready"; 431 DVLOG(4) << "Notifying output picture id " << output_id << " for input "
432 // TODO(posciak): Use visible size from decoder here instead 432 << input_id
433 // (crbug.com/402760). Passing (0, 0) results in the client using the 433 << " is ready. visible rect: " << visible_rect.ToString();
434 // visible size extracted from the container instead.
435 // TODO(hubbe): Use the correct color space. http://crbug.com/647725 434 // TODO(hubbe): Use the correct color space. http://crbug.com/647725
436 if (client_) 435 if (client_)
437 client_->PictureReady(Picture(output_id, input_id, gfx::Rect(0, 0), 436 client_->PictureReady(Picture(output_id, input_id, visible_rect,
438 gfx::ColorSpace(), picture->AllowOverlay())); 437 gfx::ColorSpace(), picture->AllowOverlay()));
439 } 438 }
440 439
441 void VaapiVideoDecodeAccelerator::TryOutputSurface() { 440 void VaapiVideoDecodeAccelerator::TryOutputSurface() {
442 DCHECK(task_runner_->BelongsToCurrentThread()); 441 DCHECK(task_runner_->BelongsToCurrentThread());
443 442
444 // Handle Destroy() arriving while pictures are queued for output. 443 // Handle Destroy() arriving while pictures are queued for output.
445 if (!client_) 444 if (!client_)
446 return; 445 return;
447 446
(...skipping 1449 matching lines...) Expand 10 before | Expand all | Expand 10 after
1897 return vaapi_pic->dec_surface(); 1896 return vaapi_pic->dec_surface();
1898 } 1897 }
1899 1898
1900 // static 1899 // static
1901 VideoDecodeAccelerator::SupportedProfiles 1900 VideoDecodeAccelerator::SupportedProfiles
1902 VaapiVideoDecodeAccelerator::GetSupportedProfiles() { 1901 VaapiVideoDecodeAccelerator::GetSupportedProfiles() {
1903 return VaapiWrapper::GetSupportedDecodeProfiles(); 1902 return VaapiWrapper::GetSupportedDecodeProfiles();
1904 } 1903 }
1905 1904
1906 } // namespace media 1905 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698