Title: [203362] trunk/Source/WebCore
Revision
203362
Author
eric.carl...@apple.com
Date
2016-07-18 12:18:23 -0700 (Mon, 18 Jul 2016)

Log Message

[MSE][Mac] Pass AVSampleBufferDisplayLayer HDCP status to a newly created key session
https://bugs.webkit.org/show_bug.cgi?id=159812
<rdar://problem/27371624>

Reviewed by Jon Lee.

No new tests, it isn't possible to test this with our current testing infrastructure.

* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::setCDMSession): Call layerDidReceiveError if there has
been an HDCP error.
(WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError): Remember an HDCP error.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (203361 => 203362)


--- trunk/Source/WebCore/ChangeLog	2016-07-18 19:12:57 UTC (rev 203361)
+++ trunk/Source/WebCore/ChangeLog	2016-07-18 19:18:23 UTC (rev 203362)
@@ -1,3 +1,19 @@
+2016-07-18  Eric Carlson  <eric.carl...@apple.com>
+
+        [MSE][Mac] Pass AVSampleBufferDisplayLayer HDCP status to a newly created key session
+        https://bugs.webkit.org/show_bug.cgi?id=159812
+        <rdar://problem/27371624>
+
+        Reviewed by Jon Lee.
+
+        No new tests, it isn't possible to test this with our current testing infrastructure.
+
+        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
+        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
+        (WebCore::SourceBufferPrivateAVFObjC::setCDMSession): Call layerDidReceiveError if there has
+        been an HDCP error.
+        (WebCore::SourceBufferPrivateAVFObjC::rendererDidReceiveError): Remember an HDCP error.
+
 2016-07-18  Yoav Weiss  <y...@yoav.ws>
 
         Add preload to features.json

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h (203361 => 203362)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h	2016-07-18 19:12:57 UTC (rev 203361)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h	2016-07-18 19:18:23 UTC (rev 203362)
@@ -146,6 +146,7 @@
     HashMap<int, RetainPtr<AVSampleBufferAudioRenderer>> m_audioRenderers;
     RetainPtr<WebAVStreamDataParserListener> m_delegate;
     RetainPtr<WebAVSampleBufferErrorListener> m_errorListener;
+    RetainPtr<NSError> m_hdcpError;
     OSObjectPtr<dispatch_semaphore_t> m_hasSessionSemaphore;
 
     MediaSourcePrivateAVFObjC* m_mediaSource;

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm (203361 => 203362)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm	2016-07-18 19:12:57 UTC (rev 203361)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm	2016-07-18 19:18:23 UTC (rev 203362)
@@ -945,6 +945,17 @@
             dispatch_semaphore_signal(m_hasSessionSemaphore.get());
             m_hasSessionSemaphore = nullptr;
         }
+
+        if (m_hdcpError) {
+            WeakPtr<SourceBufferPrivateAVFObjC> weakThis = createWeakPtr();
+            callOnMainThread([weakThis] {
+                if (!weakThis || !weakThis->m_session || !weakThis->m_hdcpError)
+                    return;
+
+                bool ignored = false;
+                weakThis->m_session->layerDidReceiveError(nullptr, weakThis->m_hdcpError.get(), ignored);
+            });
+        }
     }
 }
 
@@ -993,6 +1004,9 @@
 {
     LOG(MediaSource, "SourceBufferPrivateAVFObjC::rendererDidReceiveError(%p): renderer(%p), error(%@)", this, renderer, [error description]);
 
+    if ([error code] == 'HDCP')
+        m_hdcpError = error;
+
     // FIXME(142246): Remove the following once <rdar://problem/20027434> is resolved.
     bool anyIgnored = false;
     for (auto& client : m_errorClients) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to