Changeset 227206 in webkit


Ignore:
Timestamp:
Jan 19, 2018 9:48:23 AM (6 years ago)
Author:
commit-queue@webkit.org
Message:

Softlink VideoProcessing in WebKit
https://bugs.webkit.org/show_bug.cgi?id=181853
<rdar://problem/36590005>

Patch by Youenn Fablet <youenn@apple.com> on 2018-01-19
Reviewed by Eric Carlson.

  • Configurations/libwebrtc.xcconfig:
  • Source/webrtc/sdk/objc/Framework/Classes/VideoProcessing/VideoProcessingSoftLink.cpp: Added.
  • Source/webrtc/sdk/objc/Framework/Classes/VideoProcessing/VideoProcessingSoftLink.h: Added.
  • Source/webrtc/sdk/objc/Framework/Classes/VideoProcessing/encoder_vcp.h:
  • Source/webrtc/sdk/objc/Framework/Classes/VideoProcessing/encoder_vcp.mm:

(internal::SetVTSessionProperty):
(webrtc::H264VideoToolboxEncoderVCP::Encode):

  • Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/videocodecfactory.mm:

(webrtc::VideoToolboxVideoEncoderFactory::VideoToolboxVideoEncoderFactory):

  • libwebrtc.xcodeproj/project.pbxproj:
Location:
trunk/Source/ThirdParty/libwebrtc
Files:
2 added
6 edited

Legend:

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

    r227156 r227206  
     12018-01-19  Youenn Fablet  <youenn@apple.com>
     2
     3        Softlink VideoProcessing in WebKit
     4        https://bugs.webkit.org/show_bug.cgi?id=181853
     5        <rdar://problem/36590005>
     6
     7        Reviewed by Eric Carlson.
     8
     9        * Configurations/libwebrtc.xcconfig:
     10        * Source/webrtc/sdk/objc/Framework/Classes/VideoProcessing/VideoProcessingSoftLink.cpp: Added.
     11        * Source/webrtc/sdk/objc/Framework/Classes/VideoProcessing/VideoProcessingSoftLink.h: Added.
     12        * Source/webrtc/sdk/objc/Framework/Classes/VideoProcessing/encoder_vcp.h:
     13        * Source/webrtc/sdk/objc/Framework/Classes/VideoProcessing/encoder_vcp.mm:
     14        (internal::SetVTSessionProperty):
     15        (webrtc::H264VideoToolboxEncoderVCP::Encode):
     16        * Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/videocodecfactory.mm:
     17        (webrtc::VideoToolboxVideoEncoderFactory::VideoToolboxVideoEncoderFactory):
     18        * libwebrtc.xcodeproj/project.pbxproj:
     19
    1202018-01-18  Dan Bernstein  <mitz@apple.com>
    221
  • trunk/Source/ThirdParty/libwebrtc/Configurations/libwebrtc.xcconfig

    r225761 r227206  
    4141EXCLUDED_SOURCE_FILE_NAMES[sdk=macosx*] = voice_processing_audio_unit.mm;
    4242
    43 OTHER_LDFLAGS[sdk=macosx10.13*] = $(inherited) -framework VideoProcessing;
    44 OTHER_LDFLAGS[sdk=macosx10.14*] = $(inherited) -framework VideoProcessing;
     43OTHER_LDFLAGS[sdk=macosx10.13*] = $(inherited);
     44OTHER_LDFLAGS[sdk=macosx10.14*] = $(inherited);
  • trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/VideoProcessing/encoder_vcp.h

    r225761 r227206  
    1313#pragma once
    1414
    15 #ifdef __APPLE__
    16 #include <Availability.h>
    17 #include <AvailabilityMacros.h>
    18 #include <TargetConditionals.h>
    19 
    20 #if (defined(TARGET_OS_IPHONE)  && TARGET_OS_IPHONE) || (defined(TARGET_IPHONE_SIMULATOR)  && TARGET_IPHONE_SIMULATOR)
    21 // FIXME: Activate VCP for iOS/iOS simulator
    22 #define ENABLE_VCP_ENCODER 0
    23 #elif (defined(TARGET_OS_MAC)  && TARGET_OS_MAC)
    24 #define ENABLE_VCP_ENCODER (__MAC_OS_X_VERSION_MAX_ALLOWED >= 101304)
    25 #endif
     15#include "VideoProcessingSoftLink.h"
    2616
    2717#if ENABLE_VCP_ENCODER
     
    3525#include "webrtc/modules/video_coding/utility/quality_scaler.h"
    3626
    37 #include <VideoProcessing/VideoProcessing.h>
    3827#include <vector>
    3928
     
    128117#endif // ENABLE_VCP_ENCODER
    129118
    130 #endif // __APPLE__
  • trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/VideoProcessing/encoder_vcp.mm

    r225761 r227206  
    7575  CFNumberRef cfNum =
    7676      CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &value);
    77   OSStatus status = VCPCompressionSessionSetProperty(session, key, cfNum);
     77  OSStatus status = webrtc::VCPCompressionSessionSetProperty(session, key, cfNum);
    7878  CFRelease(cfNum);
    7979  if (status != noErr) {
     
    9191  CFNumberRef cfNum =
    9292      CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt64Type, &value_64);
    93   OSStatus status = VCPCompressionSessionSetProperty(session, key, cfNum);
     93  OSStatus status = webrtc::VCPCompressionSessionSetProperty(session, key, cfNum);
    9494  CFRelease(cfNum);
    9595  if (status != noErr) {
     
    103103void SetVTSessionProperty(VCPCompressionSessionRef session, CFStringRef key, bool value) {
    104104  CFBooleanRef cf_bool = (value) ? kCFBooleanTrue : kCFBooleanFalse;
    105   OSStatus status = VCPCompressionSessionSetProperty(session, key, cf_bool);
     105  OSStatus status = webrtc::VCPCompressionSessionSetProperty(session, key, cf_bool);
    106106  if (status != noErr) {
    107107    std::string key_string = CFStringToString(key);
     
    115115                          CFStringRef key,
    116116                          CFStringRef value) {
    117   OSStatus status = VCPCompressionSessionSetProperty(session, key, value);
     117  OSStatus status = webrtc::VCPCompressionSessionSetProperty(session, key, value);
    118118  if (status != noErr) {
    119119    std::string key_string = CFStringToString(key);
     
    414414  // Get a pixel buffer from the pool and copy frame data over.
    415415  CVPixelBufferPoolRef pixel_buffer_pool =
    416       VCPCompressionSessionGetPixelBufferPool(compression_session_);
     416      webrtc::VCPCompressionSessionGetPixelBufferPool(compression_session_);
    417417#if defined(WEBRTC_IOS)
    418418  if (!pixel_buffer_pool) {
     
    424424    ResetCompressionSession();
    425425    pixel_buffer_pool =
    426         VCPCompressionSessionGetPixelBufferPool(compression_session_);
     426        webrtc::VCPCompressionSessionGetPixelBufferPool(compression_session_);
    427427    is_keyframe_required = true;
    428428    LOG(LS_INFO) << "Resetting compression session due to invalid pool.";
     
    497497  SetBitrateBps(bitrate_adjuster_.GetAdjustedBitrateBps());
    498498
    499   OSStatus status = VCPCompressionSessionEncodeFrame(
     499  OSStatus status = webrtc::VCPCompressionSessionEncodeFrame(
    500500      compression_session_, pixel_buffer, presentation_time_stamp,
    501501      kCMTimeInvalid, frame_properties, encode_params.release(), nullptr);
     
    594594#endif
    595595
    596   OSStatus status = VCPCompressionSessionCreate(
     596  OSStatus status = webrtc::VCPCompressionSessionCreate(
    597597      nullptr,  // use default allocator
    598598      width, height, kVCPCodecType4CC_H264,
     
    646646void H264VideoToolboxEncoderVCP::DestroyCompressionSession() {
    647647  if (compression_session_) {
    648     VCPCompressionSessionInvalidate(compression_session_);
     648    webrtc::VCPCompressionSessionInvalidate(compression_session_);
    649649    CFRelease(compression_session_);
    650650    compression_session_ = nullptr;
  • trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/videocodecfactory.mm

    r225761 r227206  
    3333{
    3434#if ENABLE_VCP_ENCODER
    35     VPModuleInitialize();
     35    webrtc::VPModuleInitialize();
    3636#endif
    3737}
  • trunk/Source/ThirdParty/libwebrtc/libwebrtc.xcodeproj/project.pbxproj

    r225974 r227206  
    168168                416D2F151FA8CCAE00097345 /* encoder_vcp.h in Headers */ = {isa = PBXBuildFile; fileRef = 416D2F131FA8CCAD00097345 /* encoder_vcp.h */; };
    169169                416D2F161FA8CCAE00097345 /* encoder_vcp.mm in Sources */ = {isa = PBXBuildFile; fileRef = 416D2F141FA8CCAD00097345 /* encoder_vcp.mm */; };
     170                417CF799201239AF001ADF3A /* VideoProcessingSoftLink.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 417CF797201239AE001ADF3A /* VideoProcessingSoftLink.cpp */; };
     171                417CF79A201239AF001ADF3A /* VideoProcessingSoftLink.h in Headers */ = {isa = PBXBuildFile; fileRef = 417CF798201239AE001ADF3A /* VideoProcessingSoftLink.h */; };
    170172                417DA4581EF9CD0D00E869DB /* RTCUIApplicationStatusObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 417DA4561EF9CD0A00E869DB /* RTCUIApplicationStatusObserver.h */; };
    171173                41A391731EFC447C00C4516A /* sha1-altivec.c in Sources */ = {isa = PBXBuildFile; fileRef = 41A3914F1EFC446E00C4516A /* sha1-altivec.c */; };
     
    29382940                416D2F131FA8CCAD00097345 /* encoder_vcp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = encoder_vcp.h; path = VideoProcessing/encoder_vcp.h; sourceTree = "<group>"; };
    29392941                416D2F141FA8CCAD00097345 /* encoder_vcp.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = encoder_vcp.mm; path = VideoProcessing/encoder_vcp.mm; sourceTree = "<group>"; };
     2942                417CF797201239AE001ADF3A /* VideoProcessingSoftLink.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VideoProcessingSoftLink.cpp; path = VideoProcessing/VideoProcessingSoftLink.cpp; sourceTree = "<group>"; };
     2943                417CF798201239AE001ADF3A /* VideoProcessingSoftLink.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VideoProcessingSoftLink.h; path = VideoProcessing/VideoProcessingSoftLink.h; sourceTree = "<group>"; };
    29402944                417DA4561EF9CD0A00E869DB /* RTCUIApplicationStatusObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RTCUIApplicationStatusObserver.h; path = Source/webrtc/sdk/objc/Framework/Classes/Common/RTCUIApplicationStatusObserver.h; sourceTree = SOURCE_ROOT; };
    29412945                41A391451EFC446E00C4516A /* sha1-586.pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = "sha1-586.pl"; sourceTree = "<group>"; };
     
    56545658                                416D2F131FA8CCAD00097345 /* encoder_vcp.h */,
    56555659                                416D2F141FA8CCAD00097345 /* encoder_vcp.mm */,
     5660                                417CF797201239AE001ADF3A /* VideoProcessingSoftLink.cpp */,
     5661                                417CF798201239AE001ADF3A /* VideoProcessingSoftLink.h */,
    56565662                        );
    56575663                        name = VideoProcessing;
     
    1094110947                                5CD286251E6A666D0094FDC8 /* videodecodersoftwarefallbackwrapper.h in Headers */,
    1094210948                                5C4B488A1E42C1BA002651C8 /* videoencodersoftwarefallbackwrapper.h in Headers */,
     10949                                417CF79A201239AF001ADF3A /* VideoProcessingSoftLink.h in Headers */,
    1094310950                                5C4B490A1E42C1E3002651C8 /* videosinkinterface.h in Headers */,
    1094410951                                5C4B490C1E42C1E3002651C8 /* videosourcebase.h in Headers */,
     
    1264212649                                5CD286241E6A666D0094FDC8 /* videodecodersoftwarefallbackwrapper.cc in Sources */,
    1264312650                                5C4B48891E42C1BA002651C8 /* videoencodersoftwarefallbackwrapper.cc in Sources */,
     12651                                417CF799201239AF001ADF3A /* VideoProcessingSoftLink.cpp in Sources */,
    1264412652                                5C4B490B1E42C1E3002651C8 /* videosourcebase.cc in Sources */,
    1264512653                                5CD285161E6A60570094FDC8 /* videotrack.cc in Sources */,
Note: See TracChangeset for help on using the changeset viewer.