[Webkit-unassigned] [Bug 70895] Add WebCore platform interface needed by updated MediaStream API design

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 18 03:01:25 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=70895





--- Comment #3 from Adam Bergkvist <adam.bergkvist at ericsson.com>  2011-11-18 03:01:24 PST ---
(In reply to comment #2)
> (From update of attachment 115608 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=115608&action=review
> 
> > Source/WebCore/platform/mediastream/MediaStreamCenter.cpp:57
> > +void MediaStreamCenter::endLocalMediaStream(MediaStreamDescriptor* streamDescriptor)
> > +{
> > +    MediaStream* stream = streamDescriptor->owner();
> > +    if (stream)
> > +        stream->streamEnded();
> > +    else
> > +        streamDescriptor->setEnded();
> > +}
> 
> This function doesn't appear to have any callers.  Why wouldn't the callers just do this work directly?  What's the value in having a static MediaStreamCenter to help?

It works as a utility function, but its main purpose is layering so that the platform doesn't have to be aware of DOM objects (MediaStream).

> > Source/WebCore/platform/mediastream/MediaStreamCenter.h:44
> > +class MediaStreamCenter {
> 
> Can you help me understand what role the MediaStreamCenter plays?

DOM objects:                              | Browser chrome:
                                          |
 +--------------+  +-------------------+  |  +-------------------+  +----------------+
 | MediaStream: |  | LocalMediaStream: |  |  | Mute Video Button |  | getUserMedia   |
 | stream1      |  | stream2           |  |  +-------------------+  | Selector UI    |
 +--------------+  +-------------------+  |                         | (user consent) |
                                          |                         +----------------+
                                          |

                                 | Requests from DOM objects and the WebKit API
                                 V
                              +-------------------+
==============================| MediaStreamCenter |====================================
                              +-------------------+
                                 ^
                                 | Requests from platform layer to higher layers
Platform:

 +=================+
 | Active streams: |
 +=================+
 | stream1         |
 +-----------------+
 | stream2         |
 +-----------------+

MediaStreamCenter responsibilities:
* Expose media stream source probing functionality to higher layers
* Notify the platform that:
 - A MediaStreamTrack has been enabled/disabled (from JavaScript)
 - A LocalMediaStream has been stopped (from JavaScript)
 - A local MediaStreamSource has been muted (via mute button in browser chrome)
* Notify a MediaStream that the corresponding stream in the platfom has ended (e.g. USB camera was unplugged)

Our platform specific implementation of MediaStreamCenter is responsible for all the plumbing of the media pipelines (e.g. from local media stream sources to player sinks and network transport sinks).

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list