WebKit Bugzilla
Attachment 339320 Details for
Bug 185201
: Disable VCP for iOS until it is fully working
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-185201-20180502112837.patch (text/plain), 11.95 KB, created by
youenn fablet
on 2018-05-02 11:28:38 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2018-05-02 11:28:38 PDT
Size:
11.95 KB
patch
obsolete
>Subversion Revision: 231238 >diff --git a/Source/ThirdParty/libwebrtc/ChangeLog b/Source/ThirdParty/libwebrtc/ChangeLog >index 48bc5fd27a5f0ac885c3439b08b95dd0e029ea55..3e6f696d5477d58e9da3f0c57471f0a412a5ef7d 100644 >--- a/Source/ThirdParty/libwebrtc/ChangeLog >+++ b/Source/ThirdParty/libwebrtc/ChangeLog >@@ -1,3 +1,26 @@ >+2018-05-02 Youenn Fablet <youenn@apple.com> >+ >+ Disable VCP for iOS until it is fully working >+ https://bugs.webkit.org/show_bug.cgi?id=185201 >+ <rdar://problem/39773857> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Disable VCP for iOS unconditionally. >+ Add check to getkVTVideoEncoderSpecification_Usage to not set this property if not defined as it is optional soft linked. >+ Replace use of VTSessionSetProperty by CompressionSessionSetProperty as the latter is a macro >+ that works for both VT and VCP. >+ >+ * Source/webrtc/sdk/WebKit/EncoderUtilities.h: >+ * Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h: >+ * Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm: >+ (-[RTCVideoEncoderH264 resetCompressionSessionWithPixelFormat:]): >+ (-[RTCVideoEncoderH264 configureCompressionSession]): >+ (-[RTCVideoEncoderH264 setEncoderBitrateBps:]): >+ (-[RTCVideoEncoderH264 frameWasEncoded:flags:sampleBuffer:codecSpecificInfo:width:height:renderTimeMs:timestamp:rotation:]): >+ * Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/helpers.cc: >+ * Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/helpers.h: >+ > 2018-04-30 Youenn Fablet <youenn@apple.com> > > Mandate H264 hardware encoder for Mac in libwebrtc >diff --git a/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/EncoderUtilities.h b/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/EncoderUtilities.h >index 078500ce33d7a6b2ec9b34c2bf9c9000067ea801..5b9bdfda1146ec4a203fe27ae14d158c01c9dcf9 100644 >--- a/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/EncoderUtilities.h >+++ b/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/EncoderUtilities.h >@@ -40,7 +40,7 @@ > #else > > #define CompressionSessionRef VTCompressionSessionRef >-#define CompressionSessionSetProperty VTCompressionSessionSetProperty >+#define CompressionSessionSetProperty VTSessionSetProperty > #define CompressionSessionGetPixelBufferPool VTCompressionSessionGetPixelBufferPool > #define CompressionSessionEncodeFrame VTCompressionSessionEncodeFrame > #define CompressionSessionCreate VTCompressionSessionCreate >diff --git a/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h b/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h >index c1e5ec6eab8d77da3e7a714f2841fad2ddbec6eb..3d599128b3a876e8e0b3eb0d4d541a2ba81a4a40 100644 >--- a/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h >+++ b/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h >@@ -36,7 +36,7 @@ > #if (defined(TARGET_IPHONE_SIMULATOR) && TARGET_IPHONE_SIMULATOR) > #define ENABLE_VCP_ENCODER 0 > #elif (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) >-#define ENABLE_VCP_ENCODER (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110300) >+#define ENABLE_VCP_ENCODER 0 > #elif (defined(TARGET_OS_MAC) && TARGET_OS_MAC) > #define ENABLE_VCP_ENCODER (__MAC_OS_X_VERSION_MAX_ALLOWED >= 101304) > #endif >diff --git a/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm b/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm >index 68118f8f56a3bd591d56aaa636d249e64cad0c8e..dcb4401ca4bde0da3afa1808fb1a1efa74b30a07 100644 >--- a/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm >+++ b/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm >@@ -612,8 +612,8 @@ - (int)resetCompressionSessionWithPixelFormat:(OSType)framePixelFormat { > 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 }; >+ CFTypeRef sessionKeys[] = { kVTVideoEncoderSpecification_EnableHardwareAcceleratedVideoEncoder, kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder, kVTCompressionPropertyKey_RealTime }; >+ CFTypeRef sessionValues[] = { useHardwareEncoder, useHardwareEncoder, kCFBooleanTrue }; > encoderSpecs = CFDictionaryCreate(kCFAllocatorDefault, sessionKeys, sessionValues, 3, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); > #endif > OSStatus status = >@@ -738,7 +738,8 @@ - (void)configureCompressionSession { > SetVTSessionProperty(_compressionSession, kVTCompressionPropertyKey_ProfileLevel, _profile); > SetVTSessionProperty(_compressionSession, kVTCompressionPropertyKey_AllowFrameReordering, false); > #if ENABLE_VCP_ENCODER >- SetVTSessionProperty(_compressionSession, (__bridge CFStringRef)getkVTVideoEncoderSpecification_Usage(), 1); >+ if (auto key = getkVTVideoEncoderSpecification_Usage()) >+ SetVTSessionProperty(_compressionSession, (__bridge CFStringRef)key, 1); > #endif > [self setEncoderBitrateBps:_targetBitrateBps]; > // TODO(tkchin): Look at entropy mode and colorspace matrices. >@@ -787,7 +788,7 @@ - (void)setEncoderBitrateBps:(uint32_t)bitrateBps { > CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt64Type, &oneSecondValue); > const void *nums[2] = {bytesPerSecond, oneSecond}; > CFArrayRef dataRateLimits = CFArrayCreate(nullptr, nums, 2, &kCFTypeArrayCallBacks); >- OSStatus status = VTSessionSetProperty( >+ OSStatus status = CompressionSessionSetProperty( > _compressionSession, kVTCompressionPropertyKey_DataRateLimits, dataRateLimits); > if (bytesPerSecond) { > CFRelease(bytesPerSecond); >@@ -816,7 +817,7 @@ - (void)frameWasEncoded:(OSStatus)status > timestamp:(uint32_t)timestamp > rotation:(RTCVideoRotation)rotation { > if (status != noErr) { >- RTC_LOG(LS_ERROR) << "H264 encode failed."; >+ RTC_LOG(LS_ERROR) << "H264 encode failed: " << status; > return; > } > if (infoFlags & kVTEncodeInfo_FrameDropped) { >diff --git a/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/helpers.cc b/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/helpers.cc >index ac957f1b49723e59a691ffab2af8edb16613d225..d22a6f9087ad12e6a5a00d7ac81cf4c3dbc3dd47 100644 >--- a/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/helpers.cc >+++ b/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/helpers.cc >@@ -35,56 +35,56 @@ std::string CFStringToString(const CFStringRef cf_string) { > } > > // Convenience function for setting a VT property. >-void SetVTSessionProperty(VTSessionRef session, >+void SetVTSessionProperty(CompressionSessionRef session, > CFStringRef key, > int32_t value) { > CFNumberRef cfNum = > CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt32Type, &value); >- OSStatus status = VTSessionSetProperty(session, key, cfNum); >+ OSStatus status = CompressionSessionSetProperty(session, key, cfNum); > CFRelease(cfNum); > if (status != noErr) { > std::string key_string = CFStringToString(key); >- RTC_LOG(LS_ERROR) << "VTSessionSetProperty failed to set: " << key_string >+ RTC_LOG(LS_ERROR) << "CompressionSessionSetProperty failed to set: " << key_string > << " to " << value << ": " << status; > } > } > > // Convenience function for setting a VT property. >-void SetVTSessionProperty(VTSessionRef session, >+void SetVTSessionProperty(CompressionSessionRef session, > CFStringRef key, > uint32_t value) { > int64_t value_64 = value; > CFNumberRef cfNum = > CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt64Type, &value_64); >- OSStatus status = VTSessionSetProperty(session, key, cfNum); >+ OSStatus status = CompressionSessionSetProperty(session, key, cfNum); > CFRelease(cfNum); > if (status != noErr) { > std::string key_string = CFStringToString(key); >- RTC_LOG(LS_ERROR) << "VTSessionSetProperty failed to set: " << key_string >+ RTC_LOG(LS_ERROR) << "CompressionSessionSetProperty failed to set: " << key_string > << " to " << value << ": " << status; > } > } > > // Convenience function for setting a VT property. >-void SetVTSessionProperty(VTSessionRef session, CFStringRef key, bool value) { >+void SetVTSessionProperty(CompressionSessionRef session, CFStringRef key, bool value) { > CFBooleanRef cf_bool = (value) ? kCFBooleanTrue : kCFBooleanFalse; >- OSStatus status = VTSessionSetProperty(session, key, cf_bool); >+ OSStatus status = CompressionSessionSetProperty(session, key, cf_bool); > if (status != noErr) { > std::string key_string = CFStringToString(key); >- RTC_LOG(LS_ERROR) << "VTSessionSetProperty failed to set: " << key_string >+ RTC_LOG(LS_ERROR) << "CompressionSessionSetProperty failed to set: " << key_string > << " to " << value << ": " << status; > } > } > > // Convenience function for setting a VT property. >-void SetVTSessionProperty(VTSessionRef session, >+void SetVTSessionProperty(CompressionSessionRef session, > CFStringRef key, > CFStringRef value) { >- OSStatus status = VTSessionSetProperty(session, key, value); >+ OSStatus status = CompressionSessionSetProperty(session, key, value); > if (status != noErr) { > std::string key_string = CFStringToString(key); > std::string val_string = CFStringToString(value); >- RTC_LOG(LS_ERROR) << "VTSessionSetProperty failed to set: " << key_string >+ RTC_LOG(LS_ERROR) << "CompressionSessionSetProperty failed to set: " << key_string > << " to " << val_string << ": " << status; > } > } >diff --git a/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/helpers.h b/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/helpers.h >index 0683ea79e56ce67b212f894eabbdb1476e9b9f4f..0c669e8bce694cff645dcbc7cc2e625c1f0fd70d 100644 >--- a/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/helpers.h >+++ b/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/helpers.h >@@ -16,6 +16,8 @@ > #include <VideoToolbox/VideoToolbox.h> > #include <string> > >+#include "sdk/WebKit/EncoderUtilities.h" >+ > // Convenience function for creating a dictionary. > inline CFDictionaryRef CreateCFTypeDictionary(CFTypeRef* keys, > CFTypeRef* values, >@@ -29,18 +31,18 @@ inline CFDictionaryRef CreateCFTypeDictionary(CFTypeRef* keys, > std::string CFStringToString(const CFStringRef cf_string); > > // Convenience function for setting a VT property. >-void SetVTSessionProperty(VTSessionRef session, CFStringRef key, int32_t value); >+void SetVTSessionProperty(CompressionSessionRef session, CFStringRef key, int32_t value); > > // Convenience function for setting a VT property. >-void SetVTSessionProperty(VTSessionRef session, >+void SetVTSessionProperty(CompressionSessionRef session, > CFStringRef key, > uint32_t value); > > // Convenience function for setting a VT property. >-void SetVTSessionProperty(VTSessionRef session, CFStringRef key, bool value); >+void SetVTSessionProperty(CompressionSessionRef session, CFStringRef key, bool value); > > // Convenience function for setting a VT property. >-void SetVTSessionProperty(VTSessionRef session, >+void SetVTSessionProperty(CompressionSessionRef session, > CFStringRef key, > CFStringRef value); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 185201
:
339306
| 339320 |
339331