Bug 142476 - [OpenWebRTC] RealtimeMediaSourceCenter implementation
Summary: [OpenWebRTC] RealtimeMediaSourceCenter implementation
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 142393 142778 145119
Blocks: 79203 143211 124288
  Show dependency treegraph
 
Reported: 2015-03-09 02:47 PDT by Philippe Normand
Modified: 2015-05-18 02:22 PDT (History)
3 users (show)

See Also:


Attachments
patch (27.33 KB, patch)
2015-03-17 02:28 PDT, Philippe Normand
eric.carlson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Normand 2015-03-09 02:47:56 PDT
.
Comment 1 Philippe Normand 2015-03-17 02:28:21 PDT
Created attachment 248833 [details]
patch
Comment 2 Philippe Normand 2015-03-17 02:40:23 PDT
I'll file a bug for EFL's jhbuild
Comment 3 Eric Carlson 2015-03-17 08:23:42 PDT
Comment on attachment 248833 [details]
patch

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

> Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:67
> +    DEPRECATED_DEFINE_STATIC_LOCAL(RealtimeMediaSourceCenterOwr, center, ());

Nit: is there any reason to not use NeverDestroyed?

> Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:80
> +void RealtimeMediaSourceCenterOwr::validateRequestConstraints(PassRefPtr<MediaStreamCreationClient> prpClient, PassRefPtr<MediaConstraints> prpAudioConstraints, PassRefPtr<MediaConstraints> prpVideoConstraints)

Nit: it would be good to switch from PassRefPtr/RefPtr to Ref before the WebRTC implementation(s) get any bigger. Not necessarily in this patch, but soon.

> Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:146
> +    GList* item;
> +
> +    for (item = sources; item; item = item->next) {

Nit: this isn't needed outside of the loop so you shouldn't need to pre-declare it. Can you use "auto"?

> Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:159
> +        if (mediaType & OWR_MEDIA_TYPE_AUDIO)
> +            sourceType = RealtimeMediaSource::Audio;
> +        else if (mediaType & OWR_MEDIA_TYPE_VIDEO)
> +            sourceType = RealtimeMediaSource::Video;

else ASSERT()
Comment 4 Philippe Normand 2015-03-18 08:07:08 PDT
(In reply to comment #3)
> Comment on attachment 248833 [details]
> patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=248833&action=review
> 
> > Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:67
> > +    DEPRECATED_DEFINE_STATIC_LOCAL(RealtimeMediaSourceCenterOwr, center, ());
> 
> Nit: is there any reason to not use NeverDestroyed?
> 

Hum, nope :)

> > Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:80
> > +void RealtimeMediaSourceCenterOwr::validateRequestConstraints(PassRefPtr<MediaStreamCreationClient> prpClient, PassRefPtr<MediaConstraints> prpAudioConstraints, PassRefPtr<MediaConstraints> prpVideoConstraints)
> 
> Nit: it would be good to switch from PassRefPtr/RefPtr to Ref before the
> WebRTC implementation(s) get any bigger. Not necessarily in this patch, but
> soon.
> 

Good idea, I'll file a separate patch for this.

> > Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:146
> > +    GList* item;
> > +
> > +    for (item = sources; item; item = item->next) {
> 
> Nit: this isn't needed outside of the loop so you shouldn't need to
> pre-declare it. Can you use "auto"?
> 

Sure!

> > Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:159
> > +        if (mediaType & OWR_MEDIA_TYPE_AUDIO)
> > +            sourceType = RealtimeMediaSource::Audio;
> > +        else if (mediaType & OWR_MEDIA_TYPE_VIDEO)
> > +            sourceType = RealtimeMediaSource::Video;
> 
> else ASSERT()

Ok, I can add an ASSERT_NOT_REACHED() here indeed.
Comment 5 Philippe Normand 2015-03-24 08:19:21 PDT
Committed r181893: <http://trac.webkit.org/changeset/181893>