Title: [239220] trunk/Source/ThirdParty/libwebrtc
Revision
239220
Author
you...@apple.com
Date
2018-12-14 10:24:21 -0800 (Fri, 14 Dec 2018)

Log 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:]):

Modified Paths

Diff

Modified: trunk/Source/ThirdParty/libwebrtc/ChangeLog (239219 => 239220)


--- trunk/Source/ThirdParty/libwebrtc/ChangeLog	2018-12-14 18:23:55 UTC (rev 239219)
+++ trunk/Source/ThirdParty/libwebrtc/ChangeLog	2018-12-14 18:24:21 UTC (rev 239220)
@@ -1,3 +1,16 @@
+2018-12-14  Youenn Fablet  <you...@apple.com>
+
+        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:]):
+
 2018-12-12  Youenn Fablet  <you...@apple.com>
 
         Recycling the m section should work if it was rejected remotely

Modified: trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm (239219 => 239220)


--- trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm	2018-12-14 18:23:55 UTC (rev 239219)
+++ trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/components/video_codec/RTCVideoEncoderH264.mm	2018-12-14 18:24:21 UTC (rev 239220)
@@ -608,20 +608,23 @@
     CFRelease(pixelFormat);
     pixelFormat = nullptr;
   }
-  CFDictionaryRef encoderSpecs = nullptr;
+  CFMutableDictionaryRef encoderSpecs = CFDictionaryCreateMutable(nullptr, 4, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
 #if !defined(WEBRTC_IOS)
   auto useHardwareEncoder = webrtc::isH264HardwareEncoderAllowed() ? kCFBooleanTrue : kCFBooleanFalse;
   // Currently hw accl is supported above 360p on mac, below 360p
   // the compression session will be created with hw accl disabled.
-  CFTypeRef sessionKeys[] = { kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder, kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder, kVTCompressionPropertyKey_RealTime };
-  CFTypeRef sessionValues[] = { useHardwareEncoder, useHardwareEncoder, kCFBooleanTrue };
-  encoderSpecs = CFDictionaryCreate(kCFAllocatorDefault, sessionKeys, sessionValues, 3, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
-#else
-  CFTypeRef sessionKeys[] = { kVTCompressionPropertyKey_RealTime };
-  CFTypeRef sessionValues[] = { kCFBooleanTrue };
-  encoderSpecs = CFDictionaryCreate(kCFAllocatorDefault, sessionKeys, sessionValues, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);
+  CFDictionarySetValue(encoderSpecs, kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder, useHardwareEncoder);
+  CFDictionarySetValue(encoderSpecs, kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder, useHardwareEncoder);
 #endif
+  CFDictionarySetValue(encoderSpecs, kVTCompressionPropertyKey_RealTime, kCFBooleanTrue);
 
+  if (auto key = getkVTVideoEncoderSpecification_Usage()) {
+    int usageValue = 1;
+    auto usage = CFNumberCreate(nullptr, kCFNumberIntType, &usageValue);
+    CFDictionarySetValue(encoderSpecs, (__bridge CFStringRef)key, usage);
+    CFRelease(usage);
+  }
+
   OSStatus status =
       CompressionSessionCreate(nullptr,  // use default allocator
                                  _width,
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to