| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include <CoreVideo/CoreVideo.h> | 7 #include <CoreVideo/CoreVideo.h> |
| 8 #include <OpenGL/CGLIOSurface.h> | 8 #include <OpenGL/CGLIOSurface.h> |
| 9 #include <OpenGL/gl.h> | 9 #include <OpenGL/gl.h> |
| 10 | 10 |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 DCHECK(!make_context_current_.is_null()); | 306 DCHECK(!make_context_current_.is_null()); |
| 307 callback_.decompressionOutputCallback = OutputThunk; | 307 callback_.decompressionOutputCallback = OutputThunk; |
| 308 callback_.decompressionOutputRefCon = this; | 308 callback_.decompressionOutputRefCon = this; |
| 309 weak_this_ = weak_this_factory_.GetWeakPtr(); | 309 weak_this_ = weak_this_factory_.GetWeakPtr(); |
| 310 } | 310 } |
| 311 | 311 |
| 312 VTVideoDecodeAccelerator::~VTVideoDecodeAccelerator() { | 312 VTVideoDecodeAccelerator::~VTVideoDecodeAccelerator() { |
| 313 DCHECK(gpu_thread_checker_.CalledOnValidThread()); | 313 DCHECK(gpu_thread_checker_.CalledOnValidThread()); |
| 314 } | 314 } |
| 315 | 315 |
| 316 bool VTVideoDecodeAccelerator::Initialize( | 316 bool VTVideoDecodeAccelerator::Initialize(const Config& config, |
| 317 media::VideoCodecProfile profile, | 317 Client* client) { |
| 318 Client* client) { | |
| 319 DCHECK(gpu_thread_checker_.CalledOnValidThread()); | 318 DCHECK(gpu_thread_checker_.CalledOnValidThread()); |
| 319 |
| 320 if (config.is_encrypted) { |
| 321 NOTREACHED() << "Encrypted streams are not supported for this VDA"; |
| 322 return false; |
| 323 } |
| 324 |
| 320 client_ = client; | 325 client_ = client; |
| 321 | 326 |
| 322 if (!InitializeVideoToolbox()) | 327 if (!InitializeVideoToolbox()) |
| 323 return false; | 328 return false; |
| 324 | 329 |
| 325 bool profile_supported = false; | 330 bool profile_supported = false; |
| 326 for (const auto& supported_profile : kSupportedProfiles) { | 331 for (const auto& supported_profile : kSupportedProfiles) { |
| 327 if (profile == supported_profile) { | 332 if (config.profile == supported_profile) { |
| 328 profile_supported = true; | 333 profile_supported = true; |
| 329 break; | 334 break; |
| 330 } | 335 } |
| 331 } | 336 } |
| 332 if (!profile_supported) | 337 if (!profile_supported) |
| 333 return false; | 338 return false; |
| 334 | 339 |
| 335 // Spawn a thread to handle parsing and calling VideoToolbox. | 340 // Spawn a thread to handle parsing and calling VideoToolbox. |
| 336 if (!decoder_thread_.Start()) | 341 if (!decoder_thread_.Start()) |
| 337 return false; | 342 return false; |
| (...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1130 SupportedProfile profile; | 1135 SupportedProfile profile; |
| 1131 profile.profile = supported_profile; | 1136 profile.profile = supported_profile; |
| 1132 profile.min_resolution.SetSize(16, 16); | 1137 profile.min_resolution.SetSize(16, 16); |
| 1133 profile.max_resolution.SetSize(4096, 2160); | 1138 profile.max_resolution.SetSize(4096, 2160); |
| 1134 profiles.push_back(profile); | 1139 profiles.push_back(profile); |
| 1135 } | 1140 } |
| 1136 return profiles; | 1141 return profiles; |
| 1137 } | 1142 } |
| 1138 | 1143 |
| 1139 } // namespace content | 1144 } // namespace content |
| OLD | NEW |