Bug 171497

Summary: Ensure RealtimeOutgoingVideoSource sends a black frame when its related source is muted
Product: WebKit Reporter: youenn fablet <youennf>
Component: MediaAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, commit-queue, eric.carlson, jer.noble, jonlee, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=170704
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews106 for mac-elcapitan-wk2
none
Archive of layout-test-results from ews123 for ios-simulator-wk2
none
Patch for landing
none
Archive of layout-test-results from ews125 for ios-simulator-wk2
none
Patch for landing none

Description youenn fablet 2017-05-01 08:59:35 PDT
As per the spec, a black frame should be sent when a track is muted.
We are currently doing so at track consumer level.
Comment 1 youenn fablet 2017-05-01 10:14:38 PDT
Created attachment 308729 [details]
Patch
Comment 2 Build Bot 2017-05-01 11:21:30 PDT
Comment on attachment 308729 [details]
Patch

Attachment 308729 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.webkit.org/results/3652157

New failing tests:
webrtc/video-mute.html
Comment 3 Build Bot 2017-05-01 11:21:31 PDT
Created attachment 308735 [details]
Archive of layout-test-results from ews106 for mac-elcapitan-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-elcapitan-wk2  Platform: Mac OS X 10.11.6
Comment 4 Build Bot 2017-05-01 11:50:55 PDT
Comment on attachment 308729 [details]
Patch

Attachment 308729 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/3652191

New failing tests:
webrtc/video-mute.html
Comment 5 Build Bot 2017-05-01 11:50:57 PDT
Created attachment 308740 [details]
Archive of layout-test-results from ews123 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews123  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.6
Comment 6 Eric Carlson 2017-05-01 13:48:53 PDT
Comment on attachment 308729 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=308729&action=review

> Source/WebCore/ChangeLog:11
> +        VideoToolBox sometimes do not output a frame until receveing the other.

Nit: "sometimes do not" -> "sometimes does not"

"until receveing the other -> "until it receives another"

> Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:84
> +        sendBlackFrame();
> +        // FIXME: We should not need to send two black frames but VTB requires that so we are sure a black frame is sent over the wire.
> +        m_blackFrameTimer.startOneShot(0_s);

Nit: this could be put into a helper function since it is repeated in sourceEnabledChanged.

> Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.h:95
> +    uint32_t m_width { 0 };
> +    uint32_t m_height { 0 };

Nit: can you use an IntSize here?
Comment 7 youenn fablet 2017-05-01 14:04:38 PDT
Thanks for the review.

(In reply to Eric Carlson from comment #6)
> Comment on attachment 308729 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=308729&action=review
> 
> > Source/WebCore/ChangeLog:11
> > +        VideoToolBox sometimes do not output a frame until receveing the other.
> 
> Nit: "sometimes do not" -> "sometimes does not"
> 
> "until receveing the other -> "until it receives another"

OK

> > Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:84
> > +        sendBlackFrame();
> > +        // FIXME: We should not need to send two black frames but VTB requires that so we are sure a black frame is sent over the wire.
> > +        m_blackFrameTimer.startOneShot(0_s);
> 
> Nit: this could be put into a helper function since it is repeated in
> sourceEnabledChanged.

OK

> > Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.h:95
> > +    uint32_t m_width { 0 };
> > +    uint32_t m_height { 0 };
> 
> Nit: can you use an IntSize here?

IntSize is int-based while settings is uint32_t based, which seems better for values that can only be positive.
Comment 8 youenn fablet 2017-05-01 15:57:06 PDT
Created attachment 308782 [details]
Patch for landing
Comment 9 Build Bot 2017-05-01 17:32:17 PDT
Comment on attachment 308782 [details]
Patch for landing

Attachment 308782 [details] did not pass ios-sim-ews (ios-simulator-wk2):
Output: http://webkit-queues.webkit.org/results/3654423

New failing tests:
webrtc/video-mute.html
Comment 10 Build Bot 2017-05-01 17:32:19 PDT
Created attachment 308792 [details]
Archive of layout-test-results from ews125 for ios-simulator-wk2

The attached test failures were seen while running run-webkit-tests on the ios-sim-ews.
Bot: ews125  Port: ios-simulator-wk2  Platform: Mac OS X 10.11.6
Comment 11 youenn fablet 2017-05-01 17:53:10 PDT
Created attachment 308794 [details]
Patch for landing
Comment 12 WebKit Commit Bot 2017-05-01 18:33:41 PDT
Comment on attachment 308794 [details]
Patch for landing

Clearing flags on attachment: 308794

Committed r216054: <http://trac.webkit.org/changeset/216054>
Comment 13 WebKit Commit Bot 2017-05-01 18:33:42 PDT
All reviewed patches have been landed.  Closing bug.
Comment 14 Jon Lee 2017-05-01 19:01:50 PDT
rdar://problem/29265874