Bug 164837 - [MediaStream][Mac] Use AVCapturePreview interfaces for camera/microphone rendering
Summary: [MediaStream][Mac] Use AVCapturePreview interfaces for camera/microphone rend...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Eric Carlson
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2016-11-16 15:12 PST by Eric Carlson
Modified: 2016-11-17 10:43 PST (History)
5 users (show)

See Also:


Attachments
Proposed patch. (48.42 KB, patch)
2016-11-16 15:39 PST, Eric Carlson
no flags Details | Formatted Diff | Diff
Updated patch. (48.42 KB, patch)
2016-11-16 16:02 PST, Eric Carlson
no flags Details | Formatted Diff | Diff
Updated patch. (48.98 KB, patch)
2016-11-16 16:20 PST, Eric Carlson
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Carlson 2016-11-16 15:12:50 PST
Use AVCaptureAudioPreview and AVCaptureVideoPreviewLayer for previewing audio and video when possible.
Comment 1 Radar WebKit Bug Importer 2016-11-16 15:16:06 PST
<rdar://problem/29297727>
Comment 2 Eric Carlson 2016-11-16 15:39:36 PST
Created attachment 294988 [details]
Proposed patch.
Comment 3 Eric Carlson 2016-11-16 16:02:23 PST
Created attachment 294991 [details]
Updated patch.
Comment 4 Eric Carlson 2016-11-16 16:20:41 PST
Created attachment 294995 [details]
Updated patch.
Comment 5 Jer Noble 2016-11-17 09:36:33 PST
Comment on attachment 294995 [details]
Updated patch.

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

r=me with minor nit.

> Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.cpp:185
> +RealtimeMediaSourcePreview* MediaStreamTrackPrivate::preview()
> +{
> +    if (m_preview)
> +        return m_preview.get();
> +
> +    m_preview = m_source->preview();
> +    return m_preview.get();
> +}
> +

Is there any reason to cache the value of m_source->preview() at this level? m_source can never change, but it may want to swap out the preview layer (in some future patch), and caching this here would make that harder.
Comment 6 Eric Carlson 2016-11-17 10:17:36 PST
(In reply to comment #5)
> Comment on attachment 294995 [details]
> Updated patch.
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=294995&action=review
> 
> r=me with minor nit.
> 
> > Source/WebCore/platform/mediastream/MediaStreamTrackPrivate.cpp:185
> > +RealtimeMediaSourcePreview* MediaStreamTrackPrivate::preview()
> > +{
> > +    if (m_preview)
> > +        return m_preview.get();
> > +
> > +    m_preview = m_source->preview();
> > +    return m_preview.get();
> > +}
> > +
> 
> Is there any reason to cache the value of m_source->preview() at this level?
> m_source can never change, but it may want to swap out the preview layer (in
> some future patch), and caching this here would make that harder.

I will commit this patch as-is, but we can talk about changing this in another patch.
Comment 7 WebKit Commit Bot 2016-11-17 10:43:47 PST
Comment on attachment 294995 [details]
Updated patch.

Clearing flags on attachment: 294995

Committed r208851: <http://trac.webkit.org/changeset/208851>
Comment 8 WebKit Commit Bot 2016-11-17 10:43:51 PST
All reviewed patches have been landed.  Closing bug.