[MediaStream] Remove #if USE(VIDEOTOOLBOX) from AVVideoCaptureSource
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Mar 2017 18:20:08 +0000 (18:20 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Mar 2017 18:20:08 +0000 (18:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=169131

Reviewed by Youenn Fablet.

* platform/mediastream/mac/AVVideoCaptureSource.mm:
(WebCore::AVVideoCaptureSource::currentFrameCGImage):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@213372 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/mediastream/mac/AVVideoCaptureSource.mm

index a9ceeec..e3a9c19 100644 (file)
@@ -1,3 +1,13 @@
+2017-03-03  Eric Carlson  <eric.carlson@apple.com>
+
+        [MediaStream] Remove #if USE(VIDEOTOOLBOX) from AVVideoCaptureSource
+        https://bugs.webkit.org/show_bug.cgi?id=169131
+
+        Reviewed by Youenn Fablet.
+
+        * platform/mediastream/mac/AVVideoCaptureSource.mm:
+        (WebCore::AVVideoCaptureSource::currentFrameCGImage):
+
 2017-03-03  Chris Dumez  <cdumez@apple.com>
 
         Add assertion in Frame::setView() to make sure associated document has no living render tree
index f08b3ae..97f5d0f 100644 (file)
@@ -463,14 +463,12 @@ RetainPtr<CGImageRef> AVVideoCaptureSource::currentFrameCGImage()
     CVPixelBufferRef pixelBuffer = static_cast<CVPixelBufferRef>(CMSampleBufferGetImageBuffer(m_buffer.get()));
     ASSERT(CVPixelBufferGetPixelFormatType(pixelBuffer) == videoCaptureFormat);
 
-    if (!m_pixelBufferConformer) {
-#if USE(VIDEOTOOLBOX)
-        NSDictionary *attributes = @{ (NSString *)kCVPixelBufferPixelFormatTypeKey: @(kCVPixelFormatType_32BGRA) };
-#else
-        NSDictionary *attributes = nil;
-#endif
-        m_pixelBufferConformer = std::make_unique<PixelBufferConformerCV>((CFDictionaryRef)attributes);
-    }
+    if (!m_pixelBufferConformer)
+        m_pixelBufferConformer = std::make_unique<PixelBufferConformerCV>((CFDictionaryRef)@{ (NSString *)kCVPixelBufferPixelFormatTypeKey: @(kCVPixelFormatType_32BGRA) });
+
+    ASSERT(m_pixelBufferConformer);
+    if (!m_pixelBufferConformer)
+        return nullptr;
 
     m_lastImage = m_pixelBufferConformer->createImageFromPixelBuffer(pixelBuffer);