Bug 147007

Summary: Make MediaDevicesPrivate platform agnostic
Product: WebKit Reporter: Matthew Daiter <mdaiter>
Component: MediaAssignee: Matthew Daiter <mdaiter>
Status: RESOLVED INVALID    
Severity: Normal CC: bfulgham, eric.carlson, jonlee, mdaiter, webkit-bug-importer, webkit.review.bot
Priority: P2 Keywords: InRadar, PlatformOnly
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 147048    
Attachments:
Description Flags
Patch
none
Patch eric.carlson: review+

Description Matthew Daiter 2015-07-16 11:03:38 PDT
The MediaDevicsPrivate implementation isn't platform-ambiguous, and so necessary additions to the RealtimeMediaSource protocol and specific implementations needed to be made to abstract away the system.
Comment 1 Radar WebKit Bug Importer 2015-07-16 11:14:09 PDT
<rdar://problem/21858198>
Comment 2 Matthew Daiter 2015-07-16 13:24:44 PDT
Created attachment 256918 [details]
Patch
Comment 3 Eric Carlson 2015-07-16 13:45:03 PDT
Comment on attachment 256918 [details]
Patch

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

> Source/WebCore/ChangeLog:3
> +        Make MediaDevicesPrivate non-platform-specific

Make MediaDevicesPrivate platform agnostic

> Source/WebCore/ChangeLog:11
> +        ambiguous, calls into RealtimeMediaSourceCenter now.

ambiguous -> agnostic

> Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:51
> +    Vector<RefPtr<TrackSourceInfo>> getMediaStreamTracks() override;

You will need to implement this for RealtimeMediaSourceCenterOwr as well.
Comment 4 Matthew Daiter 2015-07-16 15:42:12 PDT
Comment on attachment 256918 [details]
Patch

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

>> Source/WebCore/ChangeLog:3
>> +        Make MediaDevicesPrivate non-platform-specific
> 
> Make MediaDevicesPrivate platform agnostic

Fixed.

>> Source/WebCore/ChangeLog:11
>> +        ambiguous, calls into RealtimeMediaSourceCenter now.
> 
> ambiguous -> agnostic

Fixed.

>> Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:51
>> +    Vector<RefPtr<TrackSourceInfo>> getMediaStreamTracks() override;
> 
> You will need to implement this for RealtimeMediaSourceCenterOwr as well.

Fixed.
Comment 5 Matthew Daiter 2015-07-16 15:42:38 PDT
Created attachment 256935 [details]
Patch
Comment 6 Brent Fulgham 2015-07-19 12:20:10 PDT
You need to fix the compile failures before you can land this. You seem to be missing part of your local changes, since it builds locally:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/PrivateFrameworks -include /Volumes/Data/EWS/WebKit/WebKitBuild/PrecompiledHeaders/WebCorePrefix-gdaocvhjucsrnxcedbeeoiwppumb/WebCorePrefix.h -MMD -MT dependencies -MF /Volumes/Data/EWS/WebKit/WebKitBuild/WebCore.build/Release/WebCore.build/Objects-normal/x86_64/MediaDevicesPrivate.d --serialize-diagnostics /Volumes/Data/EWS/WebKit/WebKitBuild/WebCore.build/Release/WebCore.build/Objects-normal/x86_64/MediaDevicesPrivate.dia -c /Volumes/Data/EWS/WebKit/Source/WebCore/platform/mediastream/MediaDevicesPrivate.cpp -o /Volumes/Data/EWS/WebKit/WebKitBuild/WebCore.build/Release/WebCore.build/Objects-normal/x86_64/MediaDevicesPrivate.o
In file included from /Volumes/Data/EWS/WebKit/Source/WebCore/platform/mediastream/MediaDevicesPrivate.cpp:28:
In file included from /Volumes/Data/EWS/WebKit/Source/WebCore/platform/mediastream/MediaDevicesPrivate.h:32:
In file included from /Volumes/Data/EWS/WebKit/Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.h:31:
In file included from /Volumes/Data/EWS/WebKit/Source/WebCore/platform/mediastream/MediaStreamTrackSourcesRequestClient.h:31:
/Volumes/Data/EWS/WebKit/WebKitBuild/Release/usr/local/include/wtf/PassRefPtr.h:42:16: error: member access into incomplete type 'WebCore::MediaStreamTrackSourcesCallback'
            ptr->deref();
               ^
In file included from /Volumes/Data/EWS/WebKit/Source/WebCore/platform/mediastream/MediaDevicesPrivate.cpp:28:
In file included from /Volumes/Data/EWS/WebKit/Source/WebCore/platform/mediastream/MediaDevicesPrivate.h:32:
In file included from /Volumes/Data/EWS/WebKit/Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.h:31:
In file included from /Volumes/Data/EWS/WebKit/Source/WebCore/platform/mediastream/MediaStreamTrackSourcesRequestClient.h:34:
In file included from /Volumes/Data/EWS/WebKit/WebKitBuild/Release/usr/local/include/wtf/text/AtomicString.h:25:
In file included from /Volumes/Data/EWS/WebKit/WebKitBuild/Release/usr/local/include/wtf/text/AtomicStringImpl.h:24:
In file included from /Volumes/Data/EWS/WebKit/WebKitBuild/Release/usr/local/include/wtf/text/UniquedStringImpl.h:29:
In file included from /Volumes/Data/EWS/WebKit/WebKitBuild/Release/usr/local/include/wtf/text/StringImpl.h:34:
In file included from /Volumes/Data/EWS/WebKit/WebKitBuild/Release/usr/local/include/wtf/Vector.h:35:
In file included from /Volumes/Data/EWS/WebKit/WebKitBuild/Release/usr/local/include/wtf/VectorTraits.h:25:
/Volumes/Data/EWS/WebKit/WebKitBuild/Release/usr/local/include/wtf/RefPtr.h:59:31: note: in instantiation of function template specialization 'WTF::derefIfNotNull<WebCore::MediaStreamTrackSourcesCallback>' requested here
    ALWAYS_INLINE ~RefPtr() { derefIfNotNull(std::exchange(m_ptr, nullptr)); }
                              ^
In file included from /Volumes/Data/EWS/WebKit/Source/WebCore/platform/mediastream/MediaDevicesPrivate.cpp:33:
/Volumes/Data/EWS/WebKit/Source/WebCore/Modules/mediastream/MediaStreamTrackSourcesRequest.h:45:13: note: in instantiation of member function 'WTF::RefPtr<WebCore::MediaStreamTrackSourcesCallback>::~RefPtr' requested here
    virtual ~MediaStreamTrackSourcesRequest() { }
            ^
/Volumes/Data/EWS/WebKit/Source/WebCore/Modules/mediastream/MediaStreamTrackSourcesRequest.h:39:7: note: forward declaration of 'WebCore::MediaStreamTrackSourcesCallback'
class MediaStreamTrackSourcesCallback;
      ^
1 error generated.
Comment 7 Eric Carlson 2015-12-08 10:28:21 PST
This is no longer relevant.