Changeset 231167 in webkit
- Timestamp:
- Apr 30, 2018 1:28:22 PM (6 years ago)
- Location:
- trunk/Source/ThirdParty/libwebrtc
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/ThirdParty/libwebrtc/ChangeLog
r230871 r231167 1 2018-04-30 Youenn Fablet <youenn@apple.com> 2 3 Mandate H264 hardware encoder for Mac in libwebrtc 4 https://bugs.webkit.org/show_bug.cgi?id=184835 5 6 Reviewed by Eric Carlson. 7 8 Tested manually through console traces that hardware VCP encoder code path is actually used instead of software VCP encoder code path. 9 10 * Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm: 11 (-[RTCVideoEncoderH264 resetCompressionSessionWithPixelFormat:]): 12 * WebKit/0001-Update-RTCVideoEncoderH264.mm-for-WebKit.patch: Added to cover this change and changes made in bug 184668 and 183961. 13 1 14 2018-04-20 Commit Queue <commit-queue@webkit.org> 2 15 -
trunk/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm
r230871 r231167 608 608 pixelFormat = nullptr; 609 609 } 610 CF MutableDictionaryRef encoder_specs = nullptr;610 CFDictionaryRef encoderSpecs = nullptr; 611 611 #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) 612 auto useHardwareEncoder = webrtc::isH264HardwareEncoderAllowed() ? kCFBooleanTrue : kCFBooleanFalse; 612 613 // Currently hw accl is supported above 360p on mac, below 360p 613 614 // the compression session will be created with hw accl disabled. 614 encoder_specs = CFDictionaryCreateMutable( 615 nullptr, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); 616 CFDictionarySetValue(encoder_specs, 617 kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder, 618 webrtc::isH264HardwareEncoderAllowed() ? kCFBooleanTrue : kCFBooleanFalse); 615 CFTypeRef sessionKeys[] = {kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder, kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder, kVTCompressionPropertyKey_RealTime }; 616 CFTypeRef sessionValues[] = { useHardwareEncoder, useHardwareEncoder, kCFBooleanTrue }; 617 encoderSpecs = CFDictionaryCreate(kCFAllocatorDefault, sessionKeys, sessionValues, 3, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); 619 618 #endif 620 619 OSStatus status = … … 623 622 _height, 624 623 kCodecTypeH264, 625 encoder _specs, // use hardware accelerated encoder if available624 encoderSpecs, // use hardware accelerated encoder if available 626 625 sourceAttributes, 627 626 nullptr, // use default compressed data allocator … … 633 632 sourceAttributes = nullptr; 634 633 } 635 if (encoder_specs) { 636 CFRelease(encoder_specs); 637 encoder_specs = nullptr; 638 } 634 if (encoderSpecs) { 635 CFRelease(encoderSpecs); 636 encoderSpecs = nullptr; 637 } 638 639 #if ENABLE_VCP_ENCODER || defined(WEBRTC_IOS) 639 640 if (status != noErr) { 640 641 RTC_LOG(LS_ERROR) << "Failed to create compression session: " << status; 641 642 return WEBRTC_VIDEO_CODEC_ERROR; 642 643 } 644 #endif 643 645 #if defined(WEBRTC_MAC) && !defined(WEBRTC_IOS) 644 646 CFBooleanRef hwaccl_enabled = nullptr; 645 status = VTSessionCopyProperty(_compressionSession, 647 if (status == noErr) { 648 status = VTSessionCopyProperty(_compressionSession, 646 649 kVTCompressionPropertyKey_UsingHardwareAcceleratedVideoEncoder, 647 650 nullptr, 648 651 &hwaccl_enabled); 652 } 649 653 if (status == noErr && (CFBooleanGetValue(hwaccl_enabled))) { 650 654 RTC_LOG(LS_INFO) << "Compression session created with hw accl enabled"; … … 715 719 sourceAttributes = nullptr; 716 720 } 717 if (encoder _specs) {718 CFRelease(encoder _specs);719 encoder _specs = nullptr;721 if (encoderSpecs) { 722 CFRelease(encoderSpecs); 723 encoderSpecs = nullptr; 720 724 } 721 725 if (status != noErr) {
Note: See TracChangeset
for help on using the changeset viewer.