Bug 191490 - RealtimeOutgoing A/V sources should observe their sources only if having a sink
Summary: RealtimeOutgoing A/V sources should observe their sources only if having a sink
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebRTC (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-11-09 15:12 PST by youenn fablet
Modified: 2018-11-12 11:50 PST (History)
4 users (show)

See Also:


Attachments
Patch (18.84 KB, patch)
2018-11-09 15:37 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (19.91 KB, patch)
2018-11-09 16:42 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (20.19 KB, patch)
2018-11-09 20:46 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch (21.02 KB, patch)
2018-11-09 21:21 PST, youenn fablet
no flags Details | Formatted Diff | Diff
Patch for landing (22.01 KB, patch)
2018-11-12 11:00 PST, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2018-11-09 15:12:00 PST
This is useless otherwise
Comment 1 youenn fablet 2018-11-09 15:37:55 PST
Created attachment 354395 [details]
Patch
Comment 2 youenn fablet 2018-11-09 16:42:16 PST
Created attachment 354413 [details]
Patch
Comment 3 youenn fablet 2018-11-09 20:46:27 PST
Created attachment 354434 [details]
Patch
Comment 4 youenn fablet 2018-11-09 21:21:04 PST
Created attachment 354438 [details]
Patch
Comment 5 Eric Carlson 2018-11-12 08:29:15 PST
Comment on attachment 354438 [details]
Patch

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

> Source/WebCore/platform/mediastream/RealtimeOutgoingAudioSource.cpp:65
> +    observeSource();

As we discussed, this shouldn't be necessary because you also call it in AddSink.

> Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.cpp:73
> +    observeSource();

Ditto.

> Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.cpp:81
>      m_videoSource->removeObserver(*this);

Nit: why does RealtimeOutgoingAudioSource have unobserveSource and RealtimeOutgoingVideoSource just calls removeObserver?
Comment 6 youenn fablet 2018-11-12 10:27:50 PST
Thanks for the review.

(In reply to Eric Carlson from comment #5)
> Comment on attachment 354438 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=354438&action=review
> 
> > Source/WebCore/platform/mediastream/RealtimeOutgoingAudioSource.cpp:65
> > +    observeSource();
> 
> As we discussed, this shouldn't be necessary because you also call it in
> AddSink.

Yes, I will lock the sinks so that we observe/unobserve appropriately.

> > Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.cpp:73
> > +    observeSource();
> 
> Ditto.
> 
> > Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.cpp:81
> >      m_videoSource->removeObserver(*this);
> 
> Nit: why does RealtimeOutgoingAudioSource have unobserveSource and
> RealtimeOutgoingVideoSource just calls removeObserver?

I will add unobserveSource.
Comment 7 youenn fablet 2018-11-12 11:00:36 PST
Created attachment 354571 [details]
Patch for landing
Comment 8 WebKit Commit Bot 2018-11-12 11:49:20 PST
Comment on attachment 354571 [details]
Patch for landing

Clearing flags on attachment: 354571

Committed r238102: <https://trac.webkit.org/changeset/238102>
Comment 9 WebKit Commit Bot 2018-11-12 11:49:22 PST
All reviewed patches have been landed.  Closing bug.
Comment 10 Radar WebKit Bug Importer 2018-11-12 11:50:38 PST
<rdar://problem/45998054>