WebKit Bugzilla
Attachment 349831 Details for
Bug 189635
: Enable VCP for iOS and reenable it for MacOS
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189635-20180914165913.patch (text/plain), 22.95 KB, created by
youenn fablet
on 2018-09-14 16:59:14 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
youenn fablet
Created:
2018-09-14 16:59:14 PDT
Size:
22.95 KB
patch
obsolete
>Subversion Revision: 235935 >diff --git a/Source/ThirdParty/libwebrtc/ChangeLog b/Source/ThirdParty/libwebrtc/ChangeLog >index 6274d2ba5b9482a1f944e85489ec02042feaa0dc..7ab65af1ce61151ab134a495853bd4726c11af04 100644 >--- a/Source/ThirdParty/libwebrtc/ChangeLog >+++ b/Source/ThirdParty/libwebrtc/ChangeLog >@@ -1,3 +1,19 @@ >+2018-09-14 Youenn Fablet <youenn@apple.com> >+ >+ Enable VCP for iOS and reenable it for MacOS >+ https://bugs.webkit.org/show_bug.cgi?id=189635 >+ <rdar://problem/43621029> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Make sure VCP API is used to set encoding session parameters. >+ >+ * Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h: >+ * Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm: >+ (-[RTCVideoEncoderH264 resetCompressionSessionWithPixelFormat:]): >+ * Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/helpers.cc: >+ * Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/helpers.h: >+ > 2018-09-07 Youenn Fablet <youenn@apple.com> > > Add support for unified plan transceivers >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 50651f68e97b6ac6e5c9e78e2af88bed5e1ff859..7622f63baf83a1f4c1e68c5daabd56a251e5f998 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,31 @@ >+2018-09-14 Youenn Fablet <youenn@apple.com> >+ >+ Enable VCP for iOS and reenable it for MacOS >+ https://bugs.webkit.org/show_bug.cgi?id=189635 >+ <rdar://problem/43621029> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Covered by exsiting and modified tests. >+ Instead of using libwebrtc YUV frames for black frames, use CVPixelBuffer to make it efficient. >+ Add internal API to knwo whether VCP is enabled so as to make capture-webrtc test pass on all platforms. >+ >+ * platform/mediastream/RealtimeOutgoingVideoSource.cpp: >+ (WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded): >+ * platform/mediastream/RealtimeOutgoingVideoSource.h: >+ * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h: >+ * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h: >+ * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: >+ (WebCore::createBlackPixelBuffer): >+ (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame): >+ * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp: >+ (WebCore::RealtimeOutgoingVideoSourceCocoa::createBlackFrame): >+ * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h: >+ * testing/Internals.cpp: >+ (WebCore::Internals::supportsVCPEncoder): >+ * testing/Internals.h: >+ * testing/Internals.idl: >+ > 2018-09-12 Guillaume Emont <guijemont@igalia.com> > > Add IGNORE_WARNING_.* macros >diff --git a/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h b/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h >index cfa9dd6da964ac1895755a3bde334897c3ff17ae..9540f6e2607ed84d1b1170d5ea096ab2fd021aea 100644 >--- a/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h >+++ b/Source/ThirdParty/libwebrtc/Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h >@@ -33,17 +33,21 @@ > // Macro taken from WTF/wtf/Platform.h > #if defined __has_include && __has_include(<CoreFoundation/CFPriv.h>) > >-#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 0 >+#if (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE) >+#define ENABLE_VCP_ENCODER (__IPHONE_OS_VERSION_MAX_ALLOWED >= 120000) > #elif (defined(TARGET_OS_MAC) && TARGET_OS_MAC) >-#define ENABLE_VCP_ENCODER 0 //(__MAC_OS_X_VERSION_MAX_ALLOWED >= 101304) >+#define ENABLE_VCP_ENCODER (__MAC_OS_X_VERSION_MAX_ALLOWED >= 101304) >+#endif >+ > #endif > >+#if !defined(ENABLE_VCP_ENCODER) >+#define ENABLE_VCP_ENCODER 0 > #endif > >+#if !defined(ALWAYS_INLINE) > #define ALWAYS_INLINE inline >+#endif > > #ifdef __cplusplus > #define WTF_EXTERN_C_BEGIN extern "C" { >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 d47818f763f15711ed9b06b5a589e726c7f3147f..13f1e8745ac73f570969649248c0d498e8eda26a 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 >@@ -602,8 +602,8 @@ - (int)resetCompressionSessionWithPixelFormat:(OSType)framePixelFormat { > CFRelease(pixelFormat); > pixelFormat = nullptr; > } >+#if (!defined(WEBRTC_IOS) || ENABLE_VCP_ENCODER) > CFDictionaryRef encoderSpecs = nullptr; >-#if defined(WEBRTC_MAC) && !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. >@@ -611,6 +611,7 @@ - (int)resetCompressionSessionWithPixelFormat:(OSType)framePixelFormat { > CFTypeRef sessionValues[] = { useHardwareEncoder, useHardwareEncoder, kCFBooleanTrue }; > encoderSpecs = CFDictionaryCreate(kCFAllocatorDefault, sessionKeys, sessionValues, 3, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); > #endif >+ > OSStatus status = > CompressionSessionCreate(nullptr, // use default allocator > _width, >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..46daf44ecaceb0a7afaa33e2b37cd503ca337a1f 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,12 +35,12 @@ 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); >@@ -50,13 +50,13 @@ void SetVTSessionProperty(VTSessionRef session, > } > > // 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); >@@ -66,9 +66,9 @@ void SetVTSessionProperty(VTSessionRef session, > } > > // 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 >@@ -77,10 +77,10 @@ void SetVTSessionProperty(VTSessionRef session, CFStringRef key, bool value) { > } > > // 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); >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); > >diff --git a/Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.cpp b/Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.cpp >index ad5f7e43286941d9f5102f62f93dd0088a75fbd4..9daef7979757da4e18b92718664783085dba5131 100644 >--- a/Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.cpp >+++ b/Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.cpp >@@ -162,14 +162,12 @@ void RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded() > auto height = m_height; > if (m_shouldApplyRotation && (m_currentRotation == webrtc::kVideoRotation_0 || m_currentRotation == webrtc::kVideoRotation_90)) > std::swap(width, height); >- auto frame = m_bufferPool.CreateBuffer(width, height); >- ASSERT(frame); >- if (!frame) { >+ m_blackFrame = createBlackFrame(width, height); >+ ASSERT(m_blackFrame); >+ if (!m_blackFrame) { > RELEASE_LOG(WebRTC, "RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded unable to send black frames"); > return; > } >- webrtc::I420Buffer::SetBlack(frame.get()); >- m_blackFrame = WTFMove(frame); > } > sendOneBlackFrame(); > m_blackFrameTimer.startRepeating(1_s); >diff --git a/Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.h b/Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.h >index 8505fdcac721f4857fc8ff1a7ad876c0378401c1..42505993858dd5efb646e9348ea6eb6e10471035 100644 >--- a/Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.h >+++ b/Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.h >@@ -79,6 +79,8 @@ protected: > bool m_shouldApplyRotation { false }; > webrtc::VideoRotation m_currentRotation { webrtc::kVideoRotation_0 }; > >+ virtual rtc::scoped_refptr<webrtc::VideoFrameBuffer> createBlackFrame(size_t width, size_t height) = 0; >+ > private: > void sendBlackFramesIfNeeded(); > void sendOneBlackFrame(); >diff --git a/Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h b/Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h >index 6d36b5995a8c3f43f84eec109ddf1bf2bde82074..1f01a254c156587bda5d6ad2e90db08ac9ab69f0 100644 >--- a/Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h >+++ b/Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h >@@ -39,6 +39,8 @@ public: > private: > explicit RealtimeOutgoingVideoSourceLibWebRTC(Ref<MediaStreamTrackPrivate>&&); > >+ rtc::scoped_refptr<webrtc::VideoFrameBuffer> createBlackFrame(size_t, size_t) final { return nullptr; } >+ > // MediaStreamTrackPrivate::Observer API > void sampleBufferUpdated(MediaStreamTrackPrivate&, MediaSample&) final; > }; >diff --git a/Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h b/Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h >index de9892a1c827d4bb961cf261d647906b3a3249ec..13bb02f402b56c14dd6f9d2accc9c819af19b0af 100644 >--- a/Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h >+++ b/Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h >@@ -57,6 +57,8 @@ private: > #endif > }; > >+RetainPtr<CVPixelBufferRef> createBlackPixelBuffer(size_t width, size_t height); >+ > } // namespace WebCore > > #endif // USE(LIBWEBRTC) >diff --git a/Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm b/Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm >index 49cdbde880cd40ea6811b18e005ce96e5b455dd1..d86a59f8c617d0770c5dff360bae26d25332890e 100644 >--- a/Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm >+++ b/Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm >@@ -64,7 +64,7 @@ RealtimeIncomingVideoSourceCocoa::RealtimeIncomingVideoSourceCocoa(rtc::scoped_r > { > } > >-static inline CVPixelBufferRef createBlackFrame(int width, int height) >+RetainPtr<CVPixelBufferRef> createBlackPixelBuffer(size_t width, size_t height) > { > CVPixelBufferRef pixelBuffer = nullptr; > auto status = CVPixelBufferCreate(kCFAllocatorDefault, width, height, kCVPixelFormatType_420YpCbCr8Planar, nullptr, &pixelBuffer); >@@ -79,7 +79,7 @@ static inline CVPixelBufferRef createBlackFrame(int width, int height) > > status = CVPixelBufferUnlockBaseAddress(pixelBuffer, 0); > ASSERT(!status); >- return pixelBuffer; >+ return adoptCF(pixelBuffer); > } > > CVPixelBufferRef RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame(const webrtc::VideoFrame& frame) >@@ -88,7 +88,7 @@ CVPixelBufferRef RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame(con > if (!m_blackFrame || m_blackFrameWidth != frame.width() || m_blackFrameHeight != frame.height()) { > m_blackFrameWidth = frame.width(); > m_blackFrameHeight = frame.height(); >- m_blackFrame = adoptCF(createBlackFrame(m_blackFrameWidth, m_blackFrameHeight)); >+ m_blackFrame = createBlackPixelBuffer(m_blackFrameWidth, m_blackFrameHeight); > } > return m_blackFrame.get(); > } >diff --git a/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp b/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp >index 795f22e31e238fbfbb9189b0c48909a809f3023a..fddb5ea573b5fc681760ad8a9fff9bd173252039 100644 >--- a/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp >+++ b/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp >@@ -29,6 +29,7 @@ > #if USE(LIBWEBRTC) > > #include "Logging.h" >+#include "RealtimeIncomingVideoSourceCocoa.h" > > ALLOW_UNUSED_PARAMETERS_BEGIN > >@@ -92,33 +93,6 @@ RealtimeOutgoingVideoSourceCocoa::RealtimeOutgoingVideoSourceCocoa(Ref<MediaStre > { > } > >-static inline int ConvertToI420(webrtc::VideoType src_video_type, >- const uint8_t* src_frame, >- int crop_x, >- int crop_y, >- int src_width, >- int src_height, >- size_t sample_size, >- libyuv::RotationMode rotation, >- webrtc::I420Buffer* dst_buffer) { >- int dst_width = dst_buffer->width(); >- int dst_height = dst_buffer->height(); >- // LibYuv expects pre-rotation values for dst. >- // Stride values should correspond to the destination values. >- if (rotation == libyuv::kRotate90 || rotation == libyuv::kRotate270) { >- std::swap(dst_width, dst_height); >- } >- return libyuv::ConvertToI420(src_video_type, >- src_frame, sample_size, >- dst_buffer->MutableDataY(), dst_buffer->StrideY(), >- dst_buffer->MutableDataU(), dst_buffer->StrideU(), >- dst_buffer->MutableDataV(), dst_buffer->StrideV(), >- crop_x, crop_y, >- src_width, src_height, >- dst_width, dst_height, >- rotation); >-} >- > void RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated(MediaStreamTrackPrivate&, MediaSample& sample) > { > if (!m_sinks.size()) >@@ -161,6 +135,11 @@ void RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated(MediaStreamTrackPriva > sendFrame(webrtc::pixelBufferToFrame(convertedBuffer.get())); > } > >+rtc::scoped_refptr<webrtc::VideoFrameBuffer> RealtimeOutgoingVideoSourceCocoa::createBlackFrame(size_t width, size_t height) >+{ >+ return webrtc::pixelBufferToFrame(createBlackPixelBuffer(width, height).get()); >+} >+ > > } // namespace WebCore > >diff --git a/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h b/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h >index fc3aacd4a653103d56eeecc870523f15f8304fc6..6cc5ace4a7ab266b3fe0eb21ec559fbab0847aa7 100644 >--- a/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h >+++ b/Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h >@@ -43,6 +43,8 @@ public: > private: > explicit RealtimeOutgoingVideoSourceCocoa(Ref<MediaStreamTrackPrivate>&&); > >+ rtc::scoped_refptr<webrtc::VideoFrameBuffer> createBlackFrame(size_t width, size_t height) final; >+ > // MediaStreamTrackPrivate::Observer API > void sampleBufferUpdated(MediaStreamTrackPrivate&, MediaSample&) final; > >diff --git a/Source/WebCore/testing/Internals.cpp b/Source/WebCore/testing/Internals.cpp >index ec2e733d28154f7de6ecd0a3f1b3ae8cb529b96f..43cd8722c8c5a9d6926a1e84928d2894f19516f4 100644 >--- a/Source/WebCore/testing/Internals.cpp >+++ b/Source/WebCore/testing/Internals.cpp >@@ -271,6 +271,10 @@ > #include "MockAuthenticatorCoordinator.h" > #endif > >+#if PLATFORM(MAC) >+#include <webrtc/sdk/WebKit/VideoProcessingSoftLink.h> >+#endif >+ > using JSC::CallData; > using JSC::CallType; > using JSC::CodeBlock; >@@ -4724,4 +4728,13 @@ unsigned Internals::primaryScreenDisplayID() > #endif > } > >+bool Internals::supportsVCPEncoder() >+{ >+#if defined(ENABLE_VCP_ENCODER) >+ return ENABLE_VCP_ENCODER; >+#else >+ return false; >+#endif >+} >+ > } // namespace WebCore >diff --git a/Source/WebCore/testing/Internals.h b/Source/WebCore/testing/Internals.h >index 9564d274e00ee7479199d200ebed3dbef1ae6087..57bd24559fac15f6d6fc7f9573965fb2129dd015 100644 >--- a/Source/WebCore/testing/Internals.h >+++ b/Source/WebCore/testing/Internals.h >@@ -735,6 +735,8 @@ public: > void notifyResourceLoadObserver(); > > unsigned primaryScreenDisplayID(); >+ >+ bool supportsVCPEncoder(); > > private: > explicit Internals(Document&); >diff --git a/Source/WebCore/testing/Internals.idl b/Source/WebCore/testing/Internals.idl >index 2184fd21dd1ac188dbf041885805c873e1b61f8f..eb456cd826710877c7956b8ce5987d067112542c 100644 >--- a/Source/WebCore/testing/Internals.idl >+++ b/Source/WebCore/testing/Internals.idl >@@ -670,4 +670,6 @@ enum CompositingPolicy { > void notifyResourceLoadObserver(); > > unsigned long primaryScreenDisplayID(); >+ >+ boolean supportsVCPEncoder(); > }; >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index d1ff4f6f6c7a1571545b957404b3494e9768836f..85f2eeb64a9427c45152bf60b6d6e9913a8ea8b5 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2018-09-14 Youenn Fablet <youenn@apple.com> >+ >+ Enable VCP for iOS and reenable it for MacOS >+ https://bugs.webkit.org/show_bug.cgi?id=189635 >+ <rdar://problem/43621029> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html: >+ For platforms suppporting VCP, arbitrary size should be supported. >+ * webrtc/routines.js: >+ > 2018-09-11 Olivia Barnett <obarnett@apple.com> > > Implement the Web Share API for mac >diff --git a/LayoutTests/platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html b/LayoutTests/platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html >index b3e81afd867c1fd87b94e5dd9000e6fb592c6f6a..13045fc9368653ebb0c7f993aed2955cbdef764c 100644 >--- a/LayoutTests/platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html >+++ b/LayoutTests/platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html >@@ -77,9 +77,10 @@ promise_test((test) => { > }).then(() => { > return waitFor(200); > }).then(() => { >- return testCanvas("test2", canvas1, false); >+ const shouldMatch = window.internals ? internals.supportsVCPEncoder() : true; >+ return testCanvas("test2", canvas1, shouldMatch); > }).then(() => { >- return testCanvas("test3", canvas0, true); >+ return testCanvas("test3", canvas0, false); > }).then(() => { > return sender.replaceTrack(canvas0Track); > }).then(() => { >diff --git a/LayoutTests/webrtc/routines.js b/LayoutTests/webrtc/routines.js >index aebe26fe67685b1cfe6bd637d72e99e6d74a9d5e..11499aefc03663257b0fa032ac2022db5de91fe3 100644 >--- a/LayoutTests/webrtc/routines.js >+++ b/LayoutTests/webrtc/routines.js >@@ -170,10 +170,10 @@ function isVideoBlack(canvas, video, startX, startY, grabbedWidth, grabbedHeight > canvas.width = video.videoWidth; > canvas.height = video.videoHeight; > if (!grabbedHeight) { >- startX = 0; >- startY = 0; >- grabbedWidth = canvas.width; >- grabbedHeight = canvas.height; >+ startX = 10; >+ startY = 10; >+ grabbedWidth = canvas.width - 20; >+ grabbedHeight = canvas.height - 20; > } > > canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height); >@@ -193,6 +193,8 @@ async function checkVideoBlack(expected, canvas, video, errorMessage, counter) > if (isVideoBlack(canvas, video) === expected) > return Promise.resolve(); > >+ if (counter === undefined) >+ counter = 0; > if (counter > 50) { > if (!errorMessage) > errorMessage = "checkVideoBlack timed out expecting " + expected;
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 189635
:
349822
|
349827
|
349831
|
349840
|
349843
|
349846
|
349847
|
349865
|
349893
|
349907
|
349956