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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 const AndroidVideoDecodeAccelerator::PlatformConfig& platform_config) { | 119 const AndroidVideoDecodeAccelerator::PlatformConfig& platform_config) { |
120 if (platform_config.force_deferred_surface_creation) | 120 if (platform_config.force_deferred_surface_creation) |
121 return true; | 121 return true; |
122 | 122 |
123 // TODO(liberato): We might still want to defer if we've got a routing | 123 // TODO(liberato): We might still want to defer if we've got a routing |
124 // token. It depends on whether we want to use it right away or not. | 124 // token. It depends on whether we want to use it right away or not. |
125 if (surface_id != SurfaceManager::kNoSurfaceID || overlay_routing_token) | 125 if (surface_id != SurfaceManager::kNoSurfaceID || overlay_routing_token) |
126 return false; | 126 return false; |
127 | 127 |
128 return codec == kCodecH264 && codec_allocator->IsAnyRegisteredAVDA() && | 128 return codec == kCodecH264 && codec_allocator->IsAnyRegisteredAVDA() && |
129 platform_config.sdk_int <= 18; | 129 platform_config.sdk_int <= base::android::SDK_VERSION_JELLY_BEAN_MR2; |
130 } | 130 } |
131 | 131 |
132 std::unique_ptr<AndroidOverlay> CreateContentVideoViewOverlay( | 132 std::unique_ptr<AndroidOverlay> CreateContentVideoViewOverlay( |
133 int32_t surface_id, | 133 int32_t surface_id, |
134 AndroidOverlayConfig config) { | 134 AndroidOverlayConfig config) { |
135 return base::MakeUnique<ContentVideoViewOverlay>(surface_id, | 135 return base::MakeUnique<ContentVideoViewOverlay>(surface_id, |
136 std::move(config)); | 136 std::move(config)); |
137 } | 137 } |
138 | 138 |
139 } // namespace | 139 } // namespace |
(...skipping 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1693 codec_allocator_->ReleaseMediaCodec(std::move(media_codec_), | 1693 codec_allocator_->ReleaseMediaCodec(std::move(media_codec_), |
1694 codec_config_->surface_bundle); | 1694 codec_config_->surface_bundle); |
1695 } | 1695 } |
1696 | 1696 |
1697 void AndroidVideoDecodeAccelerator::ReleaseCodecAndBundle() { | 1697 void AndroidVideoDecodeAccelerator::ReleaseCodecAndBundle() { |
1698 ReleaseCodec(); | 1698 ReleaseCodec(); |
1699 codec_config_->surface_bundle = nullptr; | 1699 codec_config_->surface_bundle = nullptr; |
1700 } | 1700 } |
1701 | 1701 |
1702 } // namespace media | 1702 } // namespace media |
OLD | NEW |