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 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 return; | 931 return; |
932 } | 932 } |
933 | 933 |
934 PictureBuffer& picture_buffer = it->second; | 934 PictureBuffer& picture_buffer = it->second; |
935 const bool size_changed = picture_buffer.size() != size_; | 935 const bool size_changed = picture_buffer.size() != size_; |
936 if (size_changed) | 936 if (size_changed) |
937 picture_buffer.set_size(size_); | 937 picture_buffer.set_size(size_); |
938 | 938 |
939 const bool allow_overlay = picture_buffer_manager_.ArePicturesOverlayable(); | 939 const bool allow_overlay = picture_buffer_manager_.ArePicturesOverlayable(); |
940 UMA_HISTOGRAM_BOOLEAN("Media.AVDA.FrameSentAsOverlay", allow_overlay); | 940 UMA_HISTOGRAM_BOOLEAN("Media.AVDA.FrameSentAsOverlay", allow_overlay); |
941 // TODO(hubbe): Insert the correct color space. http://crbug.com/647725 | |
942 Picture picture(picture_buffer_id, bitstream_id, gfx::Rect(size_), | 941 Picture picture(picture_buffer_id, bitstream_id, gfx::Rect(size_), |
943 gfx::ColorSpace(), allow_overlay); | 942 allow_overlay); |
944 picture.set_size_changed(size_changed); | 943 picture.set_size_changed(size_changed); |
945 | 944 |
946 // Notify picture ready before calling UseCodecBufferForPictureBuffer() since | 945 // Notify picture ready before calling UseCodecBufferForPictureBuffer() since |
947 // that process may be slow and shouldn't delay delivery of the frame to the | 946 // that process may be slow and shouldn't delay delivery of the frame to the |
948 // renderer. The picture is only used on the same thread as this method is | 947 // renderer. The picture is only used on the same thread as this method is |
949 // called, so it is safe to do this. | 948 // called, so it is safe to do this. |
950 NotifyPictureReady(picture); | 949 NotifyPictureReady(picture); |
951 | 950 |
952 // Connect the PictureBuffer to the decoded frame. | 951 // Connect the PictureBuffer to the decoded frame. |
953 picture_buffer_manager_.UseCodecBufferForPictureBuffer(codec_buffer_index, | 952 picture_buffer_manager_.UseCodecBufferForPictureBuffer(codec_buffer_index, |
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1702 | 1701 |
1703 bool AndroidVideoDecodeAccelerator::IsMediaCodecSoftwareDecodingForbidden() | 1702 bool AndroidVideoDecodeAccelerator::IsMediaCodecSoftwareDecodingForbidden() |
1704 const { | 1703 const { |
1705 // Prevent MediaCodec from using its internal software decoders when we have | 1704 // Prevent MediaCodec from using its internal software decoders when we have |
1706 // more secure and up to date versions in the renderer process. | 1705 // more secure and up to date versions in the renderer process. |
1707 return !config_.is_encrypted && (codec_config_->codec_ == kCodecVP8 || | 1706 return !config_.is_encrypted && (codec_config_->codec_ == kCodecVP8 || |
1708 codec_config_->codec_ == kCodecVP9); | 1707 codec_config_->codec_ == kCodecVP9); |
1709 } | 1708 } |
1710 | 1709 |
1711 } // namespace media | 1710 } // namespace media |
OLD | NEW |