Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(815)

Side by Side Diff: media/gpu/android_video_decode_accelerator.cc

Issue 2345123002: Attach color space information to hardware decoded NV12 video frames. (Closed)
Patch Set: compile fixes for several platforms Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 883 matching lines...) Expand 10 before | Expand all | Expand 10 after
894 return; 894 return;
895 } 895 }
896 896
897 PictureBuffer& picture_buffer = it->second; 897 PictureBuffer& picture_buffer = it->second;
898 const bool size_changed = picture_buffer.size() != size_; 898 const bool size_changed = picture_buffer.size() != size_;
899 if (size_changed) 899 if (size_changed)
900 picture_buffer.set_size(size_); 900 picture_buffer.set_size(size_);
901 901
902 const bool allow_overlay = picture_buffer_manager_.ArePicturesOverlayable(); 902 const bool allow_overlay = picture_buffer_manager_.ArePicturesOverlayable();
903 UMA_HISTOGRAM_BOOLEAN("Media.AVDA.FrameSentAsOverlay", allow_overlay); 903 UMA_HISTOGRAM_BOOLEAN("Media.AVDA.FrameSentAsOverlay", allow_overlay);
904 // TODO(hubbe): Insert the correct color space.
Pawel Osciak 2016/09/16 04:37:39 Could we perhaps include a crbug number as well pl
hubbe 2016/09/16 18:03:30 Done.
904 Picture picture(picture_buffer_id, bitstream_id, gfx::Rect(size_), 905 Picture picture(picture_buffer_id, bitstream_id, gfx::Rect(size_),
905 allow_overlay); 906 gfx::ColorSpace(), allow_overlay);
906 picture.set_size_changed(size_changed); 907 picture.set_size_changed(size_changed);
907 908
908 // Notify picture ready before calling UseCodecBufferForPictureBuffer() since 909 // Notify picture ready before calling UseCodecBufferForPictureBuffer() since
909 // that process may be slow and shouldn't delay delivery of the frame to the 910 // that process may be slow and shouldn't delay delivery of the frame to the
910 // renderer. The picture is only used on the same thread as this method is 911 // renderer. The picture is only used on the same thread as this method is
911 // called, so it is safe to do this. 912 // called, so it is safe to do this.
912 NotifyPictureReady(picture); 913 NotifyPictureReady(picture);
913 914
914 // Connect the PictureBuffer to the decoded frame. 915 // Connect the PictureBuffer to the decoded frame.
915 picture_buffer_manager_.UseCodecBufferForPictureBuffer(codec_buffer_index, 916 picture_buffer_manager_.UseCodecBufferForPictureBuffer(codec_buffer_index,
(...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after
1638 1639
1639 bool AndroidVideoDecodeAccelerator::IsMediaCodecSoftwareDecodingForbidden() 1640 bool AndroidVideoDecodeAccelerator::IsMediaCodecSoftwareDecodingForbidden()
1640 const { 1641 const {
1641 // Prevent MediaCodec from using its internal software decoders when we have 1642 // Prevent MediaCodec from using its internal software decoders when we have
1642 // more secure and up to date versions in the renderer process. 1643 // more secure and up to date versions in the renderer process.
1643 return !config_.is_encrypted && (codec_config_->codec_ == kCodecVP8 || 1644 return !config_.is_encrypted && (codec_config_->codec_ == kCodecVP8 ||
1644 codec_config_->codec_ == kCodecVP9); 1645 codec_config_->codec_ == kCodecVP9);
1645 } 1646 }
1646 1647
1647 } // namespace media 1648 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698