|
33 | 33 | #include "GPUProcessConnectionInfo.h" |
34 | 34 | #include "GPUProcessConnectionMessages.h" |
35 | 35 | #include "GPUProcessConnectionParameters.h" |
| 36 | +#include "GPUProcessMediaCodecCapabilities.h" |
36 | 37 | #include "GPUProcessMessages.h" |
37 | 38 | #include "GPUProcessProxyMessages.h" |
38 | 39 | #include "LayerHostingContext.h" |
|
149 | 150 | #if ENABLE(VP9) && PLATFORM(COCOA) |
150 | 151 | #include <WebCore/VP9UtilitiesCocoa.h> |
151 | 152 | #endif |
| 153 | +#if (ENABLE(OPUS) || ENABLE(VORBIS)) && PLATFORM(COCOA) |
| 154 | +#include <WebCore/WebMAudioUtilitiesCocoa.h> |
| 155 | +#endif |
152 | 156 |
|
153 | 157 | #if ENABLE(ROUTING_ARBITRATION) && HAVE(AVAUDIO_ROUTING_ARBITER) |
154 | 158 | #include "LocalAudioSessionRoutingArbitrator.h" |
@@ -357,35 +361,31 @@ GPUConnectionToWebProcess::GPUConnectionToWebProcess(GPUProcess& gpuProcess, Web |
357 | 361 | connection->setOnlySendMessagesAsDispatchWhenWaitingForSyncReplyWhenProcessingSuchAMessage(true); |
358 | 362 | connection->open(*this); |
359 | 363 |
|
| 364 | + auto capabilities = parameters.mediaCodecCapabilities.value_or(GPUProcessMediaCodecCapabilities { |
360 | 365 | #if ENABLE(VP9) |
361 | | - bool hasVP9HardwareDecoder; |
362 | | - if (parameters.hasVP9HardwareDecoder) |
363 | | - hasVP9HardwareDecoder = *parameters.hasVP9HardwareDecoder; |
364 | | - else { |
365 | | - hasVP9HardwareDecoder = WebCore::vp9HardwareDecoderAvailableInProcess(); |
366 | | - gpuProcess.send(Messages::GPUProcessProxy::SetHasVP9HardwareDecoder(hasVP9HardwareDecoder)); |
367 | | - } |
| 366 | + .hasVP9HardwareDecoder = WebCore::vp9HardwareDecoderAvailableInProcess(), |
368 | 367 | #endif |
369 | 368 | #if ENABLE(AV1) |
370 | | - bool hasAV1HardwareDecoder; |
371 | | - if (parameters.hasAV1HardwareDecoder) |
372 | | - hasAV1HardwareDecoder = *parameters.hasAV1HardwareDecoder; |
373 | | - else { |
374 | | - hasAV1HardwareDecoder = WebCore::av1HardwareDecoderAvailable(); |
375 | | - gpuProcess.send(Messages::GPUProcessProxy::SetHasAV1HardwareDecoder(hasAV1HardwareDecoder)); |
376 | | - } |
| 369 | + .hasAV1HardwareDecoder = WebCore::av1HardwareDecoderAvailable(), |
377 | 370 | #endif |
378 | | - |
379 | | - WebKit::GPUProcessConnectionInfo info { |
380 | | -#if HAVE(AUDIT_TOKEN) |
381 | | - gpuProcess.protectedParentProcessConnection()->getAuditToken(), |
| 371 | +#if PLATFORM(COCOA) |
| 372 | +#if ENABLE(OPUS) |
| 373 | + .hasOpusDecoder = WebCore::isOpusDecoderAvailable(), |
382 | 374 | #endif |
383 | | -#if ENABLE(VP9) |
384 | | - hasVP9HardwareDecoder, |
| 375 | +#if ENABLE(VORBIS) |
| 376 | + .hasVorbisDecoder = WebCore::isVorbisDecoderAvailable() |
385 | 377 | #endif |
386 | | -#if ENABLE(AV1) |
387 | | - hasAV1HardwareDecoder |
388 | 378 | #endif |
| 379 | + }); |
| 380 | + |
| 381 | + if (!parameters.mediaCodecCapabilities) |
| 382 | + gpuProcess.send(Messages::GPUProcessProxy::SetMediaCodecCapabilities(capabilities)); |
| 383 | + |
| 384 | + GPUProcessConnectionInfo info { |
| 385 | +#if HAVE(AUDIT_TOKEN) |
| 386 | + .auditToken = gpuProcess.protectedParentProcessConnection()->getAuditToken(), |
| 387 | +#endif |
| 388 | + .mediaCodecCapabilities = capabilities |
389 | 389 | }; |
390 | 390 | m_connection->send(Messages::GPUProcessConnection::DidInitialize(info), 0); |
391 | 391 | ++gObjectCountForTesting; |
|
0 commit comments