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

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

Issue 2508203004: Add hints for potential overlay promotion on android. (Closed)
Patch Set: cleanup 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 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 NOTIFY_ERROR(PLATFORM_FAILURE, 734 NOTIFY_ERROR(PLATFORM_FAILURE,
735 "Can't find PictureBuffer id: " << picture_buffer_id); 735 "Can't find PictureBuffer id: " << picture_buffer_id);
736 return; 736 return;
737 } 737 }
738 738
739 PictureBuffer& picture_buffer = it->second; 739 PictureBuffer& picture_buffer = it->second;
740 const bool size_changed = picture_buffer.size() != size_; 740 const bool size_changed = picture_buffer.size() != size_;
741 if (size_changed) 741 if (size_changed)
742 picture_buffer.set_size(size_); 742 picture_buffer.set_size(size_);
743 743
744 const bool allow_overlay = picture_buffer_manager_.ArePicturesOverlayable(); 744 const bool surface_view = picture_buffer_manager_.ArePicturesOverlayable();
745 UMA_HISTOGRAM_BOOLEAN("Media.AVDA.FrameSentAsOverlay", allow_overlay); 745 UMA_HISTOGRAM_BOOLEAN("Media.AVDA.FrameSentAsOverlay", surface_view);
746 // TODO(hubbe): Insert the correct color space. http://crbug.com/647725 746 // TODO(hubbe): Insert the correct color space. http://crbug.com/647725
747 Picture picture(picture_buffer_id, bitstream_id, gfx::Rect(size_), 747 Picture picture(picture_buffer_id, bitstream_id, gfx::Rect(size_),
748 gfx::ColorSpace(), allow_overlay); 748 gfx::ColorSpace(), true /* allow_overlay */);
749 picture.set_size_changed(size_changed); 749 picture.set_size_changed(size_changed);
750 picture.set_surface_texture(!surface_view);
751 picture.set_wants_promotion_hint(true);
750 752
751 // Notify picture ready before calling UseCodecBufferForPictureBuffer() since 753 // Notify picture ready before calling UseCodecBufferForPictureBuffer() since
752 // that process may be slow and shouldn't delay delivery of the frame to the 754 // that process may be slow and shouldn't delay delivery of the frame to the
753 // renderer. The picture is only used on the same thread as this method is 755 // renderer. The picture is only used on the same thread as this method is
754 // called, so it is safe to do this. 756 // called, so it is safe to do this.
755 NotifyPictureReady(picture); 757 NotifyPictureReady(picture);
756 758
757 // Connect the PictureBuffer to the decoded frame. 759 // Connect the PictureBuffer to the decoded frame.
758 picture_buffer_manager_.UseCodecBufferForPictureBuffer(codec_buffer_index, 760 picture_buffer_manager_.UseCodecBufferForPictureBuffer(codec_buffer_index,
759 picture_buffer); 761 picture_buffer);
(...skipping 750 matching lines...) Expand 10 before | Expand all | Expand 10 after
1510 AVDACodecAllocator::Instance()->DeallocateSurface(this, new_surface_id); 1512 AVDACodecAllocator::Instance()->DeallocateSurface(this, new_surface_id);
1511 } 1513 }
1512 1514
1513 // Regardless of whether we succeeded, we no longer own the previous surface. 1515 // Regardless of whether we succeeded, we no longer own the previous surface.
1514 AVDACodecAllocator::Instance()->DeallocateSurface(this, previous_surface_id); 1516 AVDACodecAllocator::Instance()->DeallocateSurface(this, previous_surface_id);
1515 1517
1516 return success; 1518 return success;
1517 } 1519 }
1518 1520
1519 } // namespace media 1521 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698