| 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 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 | 938 |
| 939 bool size_changed = false; | 939 bool size_changed = false; |
| 940 if (i->second.size() != size_) { | 940 if (i->second.size() != size_) { |
| 941 // Size may have changed due to resolution change since the last time this | 941 // Size may have changed due to resolution change since the last time this |
| 942 // PictureBuffer was used. | 942 // PictureBuffer was used. |
| 943 strategy_->UpdatePictureBufferSize(&i->second, size_); | 943 strategy_->UpdatePictureBufferSize(&i->second, size_); |
| 944 size_changed = true; | 944 size_changed = true; |
| 945 } | 945 } |
| 946 | 946 |
| 947 const bool allow_overlay = strategy_->ArePicturesOverlayable(); | 947 const bool allow_overlay = strategy_->ArePicturesOverlayable(); |
| 948 UMA_HISTOGRAM_BOOLEAN("Media.AVDA.FrameSentAsOverlay", allow_overlay); |
| 948 Picture picture(picture_buffer_id, bitstream_id, gfx::Rect(size_), | 949 Picture picture(picture_buffer_id, bitstream_id, gfx::Rect(size_), |
| 949 allow_overlay); | 950 allow_overlay); |
| 950 picture.set_size_changed(size_changed); | 951 picture.set_size_changed(size_changed); |
| 951 | 952 |
| 952 // Notify picture ready before calling UseCodecBufferForPictureBuffer() since | 953 // Notify picture ready before calling UseCodecBufferForPictureBuffer() since |
| 953 // that process may be slow and shouldn't delay delivery of the frame to the | 954 // that process may be slow and shouldn't delay delivery of the frame to the |
| 954 // renderer. The picture is only used on the same thread as this method is | 955 // renderer. The picture is only used on the same thread as this method is |
| 955 // called, so it is safe to do this. | 956 // called, so it is safe to do this. |
| 956 NotifyPictureReady(picture); | 957 NotifyPictureReady(picture); |
| 957 | 958 |
| (...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1780 | 1781 |
| 1781 bool AndroidVideoDecodeAccelerator::IsMediaCodecSoftwareDecodingForbidden() | 1782 bool AndroidVideoDecodeAccelerator::IsMediaCodecSoftwareDecodingForbidden() |
| 1782 const { | 1783 const { |
| 1783 // Prevent MediaCodec from using its internal software decoders when we have | 1784 // Prevent MediaCodec from using its internal software decoders when we have |
| 1784 // more secure and up to date versions in the renderer process. | 1785 // more secure and up to date versions in the renderer process. |
| 1785 return !config_.is_encrypted && (codec_config_->codec_ == media::kCodecVP8 || | 1786 return !config_.is_encrypted && (codec_config_->codec_ == media::kCodecVP8 || |
| 1786 codec_config_->codec_ == media::kCodecVP9); | 1787 codec_config_->codec_ == media::kCodecVP9); |
| 1787 } | 1788 } |
| 1788 | 1789 |
| 1789 } // namespace media | 1790 } // namespace media |
| OLD | NEW |