| OLD | NEW |
| 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 Loading... |
| 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 // TODO(liberato): request a hint for promotability. crbug.com/671365 . |
| 744 const bool allow_overlay = picture_buffer_manager_.ArePicturesOverlayable(); | 745 const bool allow_overlay = picture_buffer_manager_.ArePicturesOverlayable(); |
| 745 UMA_HISTOGRAM_BOOLEAN("Media.AVDA.FrameSentAsOverlay", allow_overlay); | 746 UMA_HISTOGRAM_BOOLEAN("Media.AVDA.FrameSentAsOverlay", allow_overlay); |
| 746 // TODO(hubbe): Insert the correct color space. http://crbug.com/647725 | 747 // TODO(hubbe): Insert the correct color space. http://crbug.com/647725 |
| 747 Picture picture(picture_buffer_id, bitstream_id, gfx::Rect(size_), | 748 Picture picture(picture_buffer_id, bitstream_id, gfx::Rect(size_), |
| 748 gfx::ColorSpace(), allow_overlay); | 749 gfx::ColorSpace(), allow_overlay); |
| 749 picture.set_size_changed(size_changed); | 750 picture.set_size_changed(size_changed); |
| 750 | 751 |
| 751 // Notify picture ready before calling UseCodecBufferForPictureBuffer() since | 752 // Notify picture ready before calling UseCodecBufferForPictureBuffer() since |
| 752 // that process may be slow and shouldn't delay delivery of the frame to the | 753 // 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 | 754 // renderer. The picture is only used on the same thread as this method is |
| (...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |
| OLD | NEW |