Changeset 239220 in webkit


Ignore:
Timestamp:
Dec 14, 2018 10:24:21 AM (5 years ago)
Author:
youenn@apple.com
Message:

Set kVTVideoEncoderSpecification_Usage both when creating the compression session and once created
https://bugs.webkit.org/show_bug.cgi?id=192700

Reviewed by Eric Carlson.

Previously we were setting the usage value once the compression session is created.
We now also set it at creation time.

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

(-[RTCSingleVideoEncoderH264 resetCompressionSessionWithPixelFormat:]):

Location:
trunk/Source/ThirdParty/libwebrtc
Files:
2 edited

Legend:

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

    r239136 r239220  
     12018-12-14  Youenn Fablet  <youenn@apple.com>
     2
     3        Set kVTVideoEncoderSpecification_Usage both when creating the compression session and once created
     4        https://bugs.webkit.org/show_bug.cgi?id=192700
     5
     6        Reviewed by Eric Carlson.
     7
     8        Previously we were setting the usage value once the compression session is created.
     9        We now also set it at creation time.
     10
     11        * Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm:
     12        (-[RTCSingleVideoEncoderH264 resetCompressionSessionWithPixelFormat:]):
     13
    1142018-12-12  Youenn Fablet  <youenn@apple.com>
    215
  • trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm

    r237226 r239220  
    609609    pixelFormat = nullptr;
    610610  }
    611   CFDictionaryRef encoderSpecs = nullptr;
     611  CFMutableDictionaryRef encoderSpecs = CFDictionaryCreateMutable(nullptr, 4, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
    612612#if !defined(WEBRTC_IOS)
    613613  auto useHardwareEncoder = webrtc::isH264HardwareEncoderAllowed() ? kCFBooleanTrue : kCFBooleanFalse;
    614614  // Currently hw accl is supported above 360p on mac, below 360p
    615615  // the compression session will be created with hw accl disabled.
    616   CFTypeRef sessionKeys[] = { kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder, kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder, kVTCompressionPropertyKey_RealTime };
    617   CFTypeRef sessionValues[] = { useHardwareEncoder, useHardwareEncoder, kCFBooleanTrue };
    618   encoderSpecs = CFDictionaryCreate(kCFAllocatorDefault, sessionKeys, sessionValues, 3, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
    619 #else
    620   CFTypeRef sessionKeys[] = { kVTCompressionPropertyKey_RealTime };
    621   CFTypeRef sessionValues[] = { kCFBooleanTrue };
    622   encoderSpecs = CFDictionaryCreate(kCFAllocatorDefault, sessionKeys, sessionValues, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
     616  CFDictionarySetValue(encoderSpecs, kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder, useHardwareEncoder);
     617  CFDictionarySetValue(encoderSpecs, kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder, useHardwareEncoder);
    623618#endif
     619  CFDictionarySetValue(encoderSpecs, kVTCompressionPropertyKey_RealTime, kCFBooleanTrue);
     620
     621  if (auto key = getkVTVideoEncoderSpecification_Usage()) {
     622    int usageValue = 1;
     623    auto usage = CFNumberCreate(nullptr, kCFNumberIntType, &usageValue);
     624    CFDictionarySetValue(encoderSpecs, (__bridge CFStringRef)key, usage);
     625    CFRelease(usage);
     626  }
    624627
    625628  OSStatus status =
Note: See TracChangeset for help on using the changeset viewer.