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