| 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 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 818 NOTIFY_ERROR(PLATFORM_FAILURE, | 818 NOTIFY_ERROR(PLATFORM_FAILURE, |
| 819 "Can't find PictureBuffer id: " << picture_buffer_id); | 819 "Can't find PictureBuffer id: " << picture_buffer_id); |
| 820 return; | 820 return; |
| 821 } | 821 } |
| 822 | 822 |
| 823 PictureBuffer& picture_buffer = it->second; | 823 PictureBuffer& picture_buffer = it->second; |
| 824 const bool size_changed = picture_buffer.size() != size_; | 824 const bool size_changed = picture_buffer.size() != size_; |
| 825 if (size_changed) | 825 if (size_changed) |
| 826 picture_buffer.set_size(size_); | 826 picture_buffer.set_size(size_); |
| 827 | 827 |
| 828 const bool allow_overlay = picture_buffer_manager_.ArePicturesOverlayable(); | 828 const bool surface_view = picture_buffer_manager_.ArePicturesOverlayable(); |
| 829 UMA_HISTOGRAM_BOOLEAN("Media.AVDA.FrameSentAsOverlay", allow_overlay); | 829 UMA_HISTOGRAM_BOOLEAN("Media.AVDA.FrameSentAsOverlay", surface_view); |
| 830 // TODO(hubbe): Insert the correct color space. http://crbug.com/647725 | 830 // TODO(hubbe): Insert the correct color space. http://crbug.com/647725 |
| 831 Picture picture(picture_buffer_id, bitstream_id, gfx::Rect(size_), | 831 Picture picture(picture_buffer_id, bitstream_id, gfx::Rect(size_), |
| 832 gfx::ColorSpace(), allow_overlay); | 832 gfx::ColorSpace(), true /* allow_overlay */); |
| 833 picture.set_size_changed(size_changed); | 833 picture.set_size_changed(size_changed); |
| 834 picture.set_surface_texture(!surface_view); |
| 834 | 835 |
| 835 // Notify picture ready before calling UseCodecBufferForPictureBuffer() since | 836 // Notify picture ready before calling UseCodecBufferForPictureBuffer() since |
| 836 // that process may be slow and shouldn't delay delivery of the frame to the | 837 // that process may be slow and shouldn't delay delivery of the frame to the |
| 837 // renderer. The picture is only used on the same thread as this method is | 838 // renderer. The picture is only used on the same thread as this method is |
| 838 // called, so it is safe to do this. | 839 // called, so it is safe to do this. |
| 839 NotifyPictureReady(picture); | 840 NotifyPictureReady(picture); |
| 840 | 841 |
| 841 // Connect the PictureBuffer to the decoded frame. | 842 // Connect the PictureBuffer to the decoded frame. |
| 842 picture_buffer_manager_.UseCodecBufferForPictureBuffer(codec_buffer_index, | 843 picture_buffer_manager_.UseCodecBufferForPictureBuffer(codec_buffer_index, |
| 843 picture_buffer); | 844 picture_buffer); |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1617 !media_codec_->SetSurface(codec_config_->surface_.j_surface().obj())) { | 1618 !media_codec_->SetSurface(codec_config_->surface_.j_surface().obj())) { |
| 1618 NOTIFY_ERROR(PLATFORM_FAILURE, "MediaCodec failed to switch surfaces."); | 1619 NOTIFY_ERROR(PLATFORM_FAILURE, "MediaCodec failed to switch surfaces."); |
| 1619 return false; | 1620 return false; |
| 1620 } | 1621 } |
| 1621 | 1622 |
| 1622 pending_surface_id_.reset(); | 1623 pending_surface_id_.reset(); |
| 1623 return true; | 1624 return true; |
| 1624 } | 1625 } |
| 1625 | 1626 |
| 1626 } // namespace media | 1627 } // namespace media |
| OLD | NEW |