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

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

Issue 1690063002: Fix mime type mappings when the unified media pipeline is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix all teh things. Created 4 years, 10 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 "content/common/gpu/media/android_video_decode_accelerator.h" 5 #include "content/common/gpu/media/android_video_decode_accelerator.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/android/build_info.h" 9 #include "base/android/build_info.h"
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/bind_helpers.h" 12 #include "base/bind_helpers.h"
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/message_loop/message_loop.h" 15 #include "base/message_loop/message_loop.h"
16 #include "base/metrics/histogram.h" 16 #include "base/metrics/histogram.h"
17 #include "base/trace_event/trace_event.h" 17 #include "base/trace_event/trace_event.h"
18 #include "content/common/gpu/gpu_channel.h" 18 #include "content/common/gpu/gpu_channel.h"
19 #include "content/common/gpu/media/android_copying_backing_strategy.h" 19 #include "content/common/gpu/media/android_copying_backing_strategy.h"
20 #include "content/common/gpu/media/android_deferred_rendering_backing_strategy.h " 20 #include "content/common/gpu/media/android_deferred_rendering_backing_strategy.h "
21 #include "content/public/common/content_switches.h" 21 #include "content/public/common/content_switches.h"
22 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" 22 #include "gpu/command_buffer/service/gles2_cmd_decoder.h"
23 #include "gpu/command_buffer/service/gpu_switches.h" 23 #include "gpu/command_buffer/service/gpu_switches.h"
24 #include "gpu/command_buffer/service/mailbox_manager.h" 24 #include "gpu/command_buffer/service/mailbox_manager.h"
25 #include "media/base/android/media_codec_util.h"
25 #include "media/base/bind_to_current_loop.h" 26 #include "media/base/bind_to_current_loop.h"
26 #include "media/base/bitstream_buffer.h" 27 #include "media/base/bitstream_buffer.h"
27 #include "media/base/limits.h" 28 #include "media/base/limits.h"
28 #include "media/base/media_switches.h" 29 #include "media/base/media_switches.h"
29 #include "media/base/timestamp_constants.h" 30 #include "media/base/timestamp_constants.h"
30 #include "media/base/video_decoder_config.h" 31 #include "media/base/video_decoder_config.h"
31 #include "media/video/picture.h" 32 #include "media/video/picture.h"
32 #include "ui/gl/android/scoped_java_surface.h" 33 #include "ui/gl/android/scoped_java_surface.h"
33 #include "ui/gl/android/surface_texture.h" 34 #include "ui/gl/android/surface_texture.h"
34 #include "ui/gl/gl_bindings.h" 35 #include "ui/gl/gl_bindings.h"
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
985 } 986 }
986 987
987 // static 988 // static
988 media::VideoDecodeAccelerator::Capabilities 989 media::VideoDecodeAccelerator::Capabilities
989 AndroidVideoDecodeAccelerator::GetCapabilities() { 990 AndroidVideoDecodeAccelerator::GetCapabilities() {
990 Capabilities capabilities; 991 Capabilities capabilities;
991 SupportedProfiles& profiles = capabilities.supported_profiles; 992 SupportedProfiles& profiles = capabilities.supported_profiles;
992 993
993 SupportedProfile profile; 994 SupportedProfile profile;
994 995
995 profile.profile = media::VP8PROFILE_ANY; 996 if (!media::MediaCodecUtil::IsVp8Blacklisted()) {
996 profile.min_resolution.SetSize(0, 0); 997 profile.profile = media::VP8PROFILE_ANY;
997 profile.max_resolution.SetSize(1920, 1088); 998 profile.min_resolution.SetSize(0, 0);
998 profiles.push_back(profile); 999 profile.max_resolution.SetSize(1920, 1088);
1000 profiles.push_back(profile);
1001 }
999 1002
1000 profile.profile = media::VP9PROFILE_ANY; 1003 profile.profile = media::VP9PROFILE_ANY;
1001 profile.min_resolution.SetSize(0, 0); 1004 profile.min_resolution.SetSize(0, 0);
1002 profile.max_resolution.SetSize(1920, 1088); 1005 profile.max_resolution.SetSize(1920, 1088);
1003 profiles.push_back(profile); 1006 profiles.push_back(profile);
1004 1007
1005 for (const auto& supported_profile : kSupportedH264Profiles) { 1008 for (const auto& supported_profile : kSupportedH264Profiles) {
1006 SupportedProfile profile; 1009 SupportedProfile profile;
1007 profile.profile = supported_profile; 1010 profile.profile = supported_profile;
1008 profile.min_resolution.SetSize(0, 0); 1011 profile.min_resolution.SetSize(0, 0);
1009 // Advertise support for 4k and let the MediaCodec fail when decoding if it 1012 // Advertise support for 4k and let the MediaCodec fail when decoding if it
1010 // doesn't support the resolution. It's assumed that consumers won't have 1013 // doesn't support the resolution. It's assumed that consumers won't have
1011 // software fallback for H264 on Android anyway. 1014 // software fallback for H264 on Android anyway.
1012 profile.max_resolution.SetSize(3840, 2160); 1015 profile.max_resolution.SetSize(3840, 2160);
1013 profiles.push_back(profile); 1016 profiles.push_back(profile);
1014 } 1017 }
1015 1018
1016 if (UseDeferredRenderingStrategy()) { 1019 if (UseDeferredRenderingStrategy()) {
1017 capabilities.flags = media::VideoDecodeAccelerator::Capabilities:: 1020 capabilities.flags = media::VideoDecodeAccelerator::Capabilities::
1018 NEEDS_ALL_PICTURE_BUFFERS_TO_DECODE; 1021 NEEDS_ALL_PICTURE_BUFFERS_TO_DECODE;
1019 } 1022 }
1020 1023
1021 return capabilities; 1024 return capabilities;
1022 } 1025 }
1023 1026
1024 } // namespace content 1027 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/render_frame_impl.cc » ('j') | content/renderer/render_frame_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698