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

Side by Side Diff: media/gpu/android_video_decode_accelerator.cc

Issue 2508203004: Add hints for potential overlay promotion on android. (Closed)
Patch Set: rebased Created 4 years 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/android_video_decode_accelerator.h" 5 #include "media/gpu/android_video_decode_accelerator.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
733 NOTIFY_ERROR(PLATFORM_FAILURE, 733 NOTIFY_ERROR(PLATFORM_FAILURE,
734 "Can't find PictureBuffer id: " << picture_buffer_id); 734 "Can't find PictureBuffer id: " << picture_buffer_id);
735 return; 735 return;
736 } 736 }
737 737
738 PictureBuffer& picture_buffer = it->second; 738 PictureBuffer& picture_buffer = it->second;
739 const bool size_changed = picture_buffer.size() != size_; 739 const bool size_changed = picture_buffer.size() != size_;
740 if (size_changed) 740 if (size_changed)
741 picture_buffer.set_size(size_); 741 picture_buffer.set_size(size_);
742 742
743 // TODO(liberato): request a hint for promotability. crbug.com/671365 .
743 const bool allow_overlay = picture_buffer_manager_.ArePicturesOverlayable(); 744 const bool allow_overlay = picture_buffer_manager_.ArePicturesOverlayable();
744 UMA_HISTOGRAM_BOOLEAN("Media.AVDA.FrameSentAsOverlay", allow_overlay); 745 UMA_HISTOGRAM_BOOLEAN("Media.AVDA.FrameSentAsOverlay", allow_overlay);
745 // TODO(hubbe): Insert the correct color space. http://crbug.com/647725 746 // TODO(hubbe): Insert the correct color space. http://crbug.com/647725
746 Picture picture(picture_buffer_id, bitstream_id, gfx::Rect(size_), 747 Picture picture(picture_buffer_id, bitstream_id, gfx::Rect(size_),
747 gfx::ColorSpace(), allow_overlay); 748 gfx::ColorSpace(), allow_overlay);
748 picture.set_size_changed(size_changed); 749 picture.set_size_changed(size_changed);
749 750
750 // Notify picture ready before calling UseCodecBufferForPictureBuffer() since 751 // Notify picture ready before calling UseCodecBufferForPictureBuffer() since
751 // that process may be slow and shouldn't delay delivery of the frame to the 752 // that process may be slow and shouldn't delay delivery of the frame to the
752 // renderer. The picture is only used on the same thread as this method is 753 // renderer. The picture is only used on the same thread as this method is
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after
1510 AVDACodecAllocator::Instance()->DeallocateSurface(this, new_surface_id); 1511 AVDACodecAllocator::Instance()->DeallocateSurface(this, new_surface_id);
1511 } 1512 }
1512 1513
1513 // Regardless of whether we succeeded, we no longer own the previous surface. 1514 // Regardless of whether we succeeded, we no longer own the previous surface.
1514 AVDACodecAllocator::Instance()->DeallocateSurface(this, previous_surface_id); 1515 AVDACodecAllocator::Instance()->DeallocateSurface(this, previous_surface_id);
1515 1516
1516 return success; 1517 return success;
1517 } 1518 }
1518 1519
1519 } // namespace media 1520 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/gpu_video_decoder.cc ('k') | media/gpu/ipc/client/gpu_video_decode_accelerator_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698