⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243811 in webkit


Ignore:
Timestamp:
Apr 3, 2019, 10:37:55 AM (7 years ago)
Author:
youenn@apple.com
Message:

Adopt new VCP SPI
https://bugs.webkit.org/show_bug.cgi?id=193357
<rdar://problem/43656651>

Reviewed by Eric Carlson.

Source/ThirdParty/libwebrtc:

Enable VCP through VTB API with specific encoder id.

  • Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.cpp:
  • Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h:
  • Source/webrtc/sdk/WebKit/WebKitUtilities.mm:

(webrtc::setApplicationStatus):

  • Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm:

(-[RTCSingleVideoEncoderH264 resetCompressionSessionWithPixelFormat:]):

Source/WebCore:

Covered by existing tests.

  • testing/Internals.cpp:

(WebCore::Internals::supportsVCPEncoder):

Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/ThirdParty/libwebrtc/ChangeLog

    r243741 r243811  
     12019-04-03  Youenn Fablet  <youenn@apple.com>
     2
     3        Adopt new VCP SPI
     4        https://bugs.webkit.org/show_bug.cgi?id=193357
     5        <rdar://problem/43656651>
     6
     7        Reviewed by Eric Carlson.
     8
     9       Enable VCP through VTB API with specific encoder id.
     10
     11        * Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.cpp:
     12        * Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h:
     13        * Source/webrtc/sdk/WebKit/WebKitUtilities.mm:
     14        (webrtc::setApplicationStatus):
     15        * Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm:
     16        (-[RTCSingleVideoEncoderH264 resetCompressionSessionWithPixelFormat:]):
     17
    1182019-04-02  Thibault Saunier  <tsaunier@igalia.com>
    219
  • trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.cpp

    r240728 r243811  
    2626#include "VideoProcessingSoftLink.h"
    2727
    28 #if ENABLE_VCP_ENCODER
     28#if ENABLE_VCP_ENCODER || ENABLE_VCP_VTB_ENCODER
    2929
    3030#include "rtc_base/logging.h"
     
    6868
    6969SOFT_LINK_PRIVATE_FRAMEWORK_FOR_SOURCE(webrtc, VideoProcessing)
     70SOFT_LINK_FUNCTION_FOR_SOURCE(webrtc, VideoProcessing, VPModuleInitialize, void, (), ())
     71
     72#endif
     73
     74#if ENABLE_VCP_ENCODER
    7075
    7176SOFT_LINK_FUNCTION_FOR_SOURCE(webrtc, VideoProcessing, VCPCompressionSessionSetProperty, OSStatus, (VCPCompressionSessionRef session, CFStringRef key, CFTypeRef value), (session, key, value))
     
    7479SOFT_LINK_FUNCTION_FOR_SOURCE(webrtc, VideoProcessing, VCPCompressionSessionCreate, OSStatus, (CFAllocatorRef allocator1, int32_t value1 , int32_t value2, CMVideoCodecType type, CFDictionaryRef dictionary1, CFDictionaryRef dictionary2, CFAllocatorRef allocator3, VTCompressionOutputCallback callback, void* data, VCPCompressionSessionRef* session), (allocator1, value1, value2, type, dictionary1, dictionary2, allocator3, callback, data, session))
    7580SOFT_LINK_FUNCTION_FOR_SOURCE(webrtc, VideoProcessing, VCPCompressionSessionInvalidate, void, (VCPCompressionSessionRef session), (session))
    76 SOFT_LINK_FUNCTION_FOR_SOURCE(webrtc, VideoProcessing, VPModuleInitialize, void, (), ())
    7781
    7882#endif // ENABLE_VCP_ENCODER
  • trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h

    r240728 r243811  
    3636#if (defined(TARGET_IPHONE_SIMULATOR)  && TARGET_IPHONE_SIMULATOR)
    3737#define ENABLE_VCP_ENCODER 0
     38#define ENABLE_VCP_VTB_ENCODER 0
    3839#elif (defined(TARGET_OS_IPHONE)  && TARGET_OS_IPHONE)
    39 #define ENABLE_VCP_ENCODER 1
     40#define ENABLE_VCP_ENCODER __MAC_OS_X_VERSION_MAX_ALLOWED < 101500
     41#define ENABLE_VCP_VTB_ENCODER __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500
    4042#elif (defined(TARGET_OS_MAC) && TARGET_OS_MAC)
    41 #define ENABLE_VCP_ENCODER (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101300 && __MAC_OS_X_VERSION_MAX_ALLOWED >= 101304)
     43#define ENABLE_VCP_ENCODER (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101300 && __MAC_OS_X_VERSION_MAX_ALLOWED < 101500)
     44#define ENABLE_VCP_VTB_ENCODER __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500
    4245#endif
    4346
     
    4649#if !defined(ENABLE_VCP_ENCODER)
    4750#define ENABLE_VCP_ENCODER 0
     51#endif
     52#if !defined(ENABLE_VCP_VTB_ENCODER)
     53#define ENABLE_VCP_VTB_ENCODER 0
    4854#endif
    4955
     
    112118    }
    113119
    114 #if ENABLE_VCP_ENCODER
     120#if ENABLE_VCP_ENCODER || ENABLE_VCP_VTB_ENCODER
    115121
    116122#include <VideoProcessing/VideoProcessing.h>
    117123
    118124SOFT_LINK_FRAMEWORK_FOR_HEADER(webrtc, VideoProcessing)
     125
     126SOFT_LINK_FUNCTION_FOR_HEADER(webrtc, VideoProcessing, VPModuleInitialize, void, (), ())
     127#define VPModuleInitialize softLink_VideoProcessing_VPModuleInitialize
     128
     129#endif
     130
     131#if ENABLE_VCP_ENCODER
    119132
    120133SOFT_LINK_FUNCTION_FOR_HEADER(webrtc, VideoProcessing, VCPCompressionSessionSetProperty, OSStatus, (VCPCompressionSessionRef session, CFStringRef key, CFTypeRef value), (session, key, value))
     
    133146#define VCPCompressionSessionInvalidate softLink_VideoProcessing_VCPCompressionSessionInvalidate
    134147
    135 SOFT_LINK_FUNCTION_FOR_HEADER(webrtc, VideoProcessing, VPModuleInitialize, void, (), ())
    136 #define VPModuleInitialize softLink_VideoProcessing_VPModuleInitialize
    137 
    138148#endif // ENABLE_VCP_ENCODER
    139149
  • trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/WebKitUtilities.mm

    r240728 r243811  
    106106std::unique_ptr<webrtc::VideoEncoderFactory> createWebKitEncoderFactory(WebKitCodecSupport codecSupport)
    107107{
    108 #if ENABLE_VCP_ENCODER
     108#if ENABLE_VCP_ENCODER || ENABLE_VCP_VTB_ENCODER
    109109    static std::once_flag onceFlag;
    110110    std::call_once(onceFlag, [] {
  • trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm

    r240728 r243811  
    4141VT_EXPORT const CFStringRef kVTCompressionPropertyKey_Usage;
    4242
    43 #if !ENABLE_VCP_ENCODER && !defined(WEBRTC_IOS)
     43#if !ENABLE_VCP_ENCODER && !defined(WEBRTC_IOS) && !ENABLE_VCP_VTB_ENCODER
    4444static inline bool isStandardFrameSize(int32_t width, int32_t height)
    4545{
     
    609609    pixelFormat = nullptr;
    610610  }
    611   CFMutableDictionaryRef encoderSpecs = CFDictionaryCreateMutable(nullptr, 4, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
     611  CFMutableDictionaryRef encoderSpecs = CFDictionaryCreateMutable(nullptr, 5, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
    612612#if !defined(WEBRTC_IOS)
    613613  auto useHardwareEncoder = webrtc::isH264HardwareEncoderAllowed() ? kCFBooleanTrue : kCFBooleanFalse;
     
    619619  CFDictionarySetValue(encoderSpecs, kVTCompressionPropertyKey_RealTime, kCFBooleanTrue);
    620620
    621 #if ENABLE_VCP_ENCODER
     621#if ENABLE_VCP_ENCODER || ENABLE_VCP_VTB_ENCODER
    622622  int usageValue = 1;
    623623  auto usage = CFNumberCreate(nullptr, kCFNumberIntType, &usageValue);
    624624  CFDictionarySetValue(encoderSpecs, kVTCompressionPropertyKey_Usage, usage);
    625625  CFRelease(usage);
     626#endif
     627#if ENABLE_VCP_VTB_ENCODER
     628    CFDictionarySetValue(encoderSpecs, kVTVideoEncoderList_EncoderID, CFSTR("com.apple.videotoolbox.videoencoder.h264.rtvc"));
    626629#endif
    627630  OSStatus status =
     
    664667    RTC_LOG(LS_INFO) << "Compression session created with hw accl disabled";
    665668
    666 #if !ENABLE_VCP_ENCODER && !defined(WEBRTC_IOS)
     669#if !ENABLE_VCP_ENCODER && !ENABLE_VCP_VTB_ENCODER && !defined(WEBRTC_IOS)
    667670    if (!isStandardFrameSize(_width, _height)) {
    668671      _disableEncoding = true;
  • trunk/Source/WebCore/ChangeLog

    r243810 r243811  
     12019-04-03  Youenn Fablet  <youenn@apple.com>
     2
     3        Adopt new VCP SPI
     4        https://bugs.webkit.org/show_bug.cgi?id=193357
     5        <rdar://problem/43656651>
     6
     7        Reviewed by Eric Carlson.
     8
     9        Covered by existing tests.
     10
     11        * testing/Internals.cpp:
     12        (WebCore::Internals::supportsVCPEncoder):
     13
    1142019-04-03  Chris Dumez  <cdumez@apple.com>
    215
  • trunk/Source/WebCore/testing/Internals.cpp

    r243804 r243811  
    49344934{
    49354935#if defined(ENABLE_VCP_ENCODER)
    4936     return ENABLE_VCP_ENCODER;
     4936    return ENABLE_VCP_ENCODER || ENABLE_VCP_VTB_ENCODER;
    49374937#else
    49384938    return false;
Note: See TracChangeset for help on using the changeset viewer.