RESOLVED FIXED 147202
Linking WebKit2 to be able to grab media sources from a UID
https://bugs.webkit.org/show_bug.cgi?id=147202
Summary Linking WebKit2 to be able to grab media sources from a UID
Matthew Daiter
Reported 2015-07-22 13:34:49 PDT
Need to be able to grab TrackSourceInfo from a UID, mainly names of devices to display.
Attachments
Patch (15.33 KB, patch)
2015-07-22 13:38 PDT, Matthew Daiter
no flags
Patch (15.06 KB, patch)
2015-07-23 10:08 PDT, Matthew Daiter
no flags
Patch (15.06 KB, patch)
2015-07-23 16:08 PDT, Matthew Daiter
no flags
Patch (15.04 KB, patch)
2015-07-23 16:27 PDT, Matthew Daiter
no flags
Patch (15.03 KB, patch)
2015-07-23 16:45 PDT, Matthew Daiter
no flags
Patch (15.02 KB, patch)
2015-07-23 17:40 PDT, Matthew Daiter
no flags
Radar WebKit Bug Importer
Comment 1 2015-07-22 13:36:03 PDT
Matthew Daiter
Comment 2 2015-07-22 13:38:21 PDT
Darin Adler
Comment 3 2015-07-22 14:36:50 PDT
Comment on attachment 257292 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=257292&action=review > Source/WebCore/platform/mediastream/mac/AVCaptureDeviceManager.mm:416 > +RefPtr<RealtimeMediaSource> AVCaptureDeviceManager::sourceWithUID(const String &deviceUID, RealtimeMediaSource::Type type, MediaConstraints* constraints) Should be const String& rather than const String &. > Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:188 > + for (auto iter = m_sourceMap.begin(); iter != m_sourceMap.end(); ++iter) { > + RefPtr<RealtimeMediaSource> source = iter->value; Should be modern for loop: for (auto& source : m_sourceMap.values()) { > Source/WebCore/platform/mock/MockRealtimeMediaSourceCenter.cpp:222 > + MockSourceMap& map = mockSourceMap(); > + MockSourceMap::iterator end = map.end(); > + > + for (MockSourceMap::iterator it = map.begin(); it != end; ++it) { > + MockSource* source = it->value.get(); > + Should be a modern for loop: for (auto& source : mockSourceMap()) {
Brent Fulgham
Comment 4 2015-07-22 20:20:40 PDT
Comment on attachment 257292 [details] Patch Please upload a patch against the current ToT; this one doesn't build! Also, please fix darin's comments.
Matthew Daiter
Comment 5 2015-07-23 10:08:27 PDT
Darin Adler
Comment 6 2015-07-23 14:19:51 PDT
Comment on attachment 257355 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=257355&action=review > Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:144 > + return TrackSourceInfo::create(mediaSource->id(), mediaSource->type() == RealtimeMediaSource::Type::Video ? TrackSourceInfo::SourceKind::Video : TrackSourceInfo::SourceKind::Audio , mediaSource->name()); Stray space here after Audio. Might be nice to have a function to convert a RealtimeMediaSource::Type into TrackSourceInfo::SourceKind rather than writing out the ?: expression like this. > Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:61 > + const TrackSourceInfo& sourceWithUID(const String&, RealtimeMediaSource::Type, MediaConstraints*) override; Return type needs to be RefPtr<TrackSourceInfo>.
Matthew Daiter
Comment 7 2015-07-23 16:08:26 PDT
Matthew Daiter
Comment 8 2015-07-23 16:09:16 PDT
Comment on attachment 257355 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=257355&action=review >> Source/WebCore/platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:144 >> + return TrackSourceInfo::create(mediaSource->id(), mediaSource->type() == RealtimeMediaSource::Type::Video ? TrackSourceInfo::SourceKind::Video : TrackSourceInfo::SourceKind::Audio , mediaSource->name()); > > Stray space here after Audio. > > Might be nice to have a function to convert a RealtimeMediaSource::Type into TrackSourceInfo::SourceKind rather than writing out the ?: expression like this. Fixed. >> Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:61 >> + const TrackSourceInfo& sourceWithUID(const String&, RealtimeMediaSource::Type, MediaConstraints*) override; > > Return type needs to be RefPtr<TrackSourceInfo>. Fixed.
Matthew Daiter
Comment 9 2015-07-23 16:27:50 PDT
Brent Fulgham
Comment 10 2015-07-23 16:34:25 PDT
Comment on attachment 257404 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=257404&action=review Please fix the build failure this patch introduces (see my comment). > Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:185 > +RefPtr<TrackSourceInfo> RealtimeMediaSourceCenterOwr::sourceWithUID(const String& UID, RealtimeMediaSource::Type type, MediaConstraints* constraints) The "constraints" parameter is causing build failures on other ports. Comment it out until you need to use it: ", MediaConstraints*)" or ", MediaConstraints* /* constraints */)"
Brent Fulgham
Comment 11 2015-07-23 16:35:09 PDT
Build error after this patch: .../openwebrtc/RealtimeMediaSourceCenterOwr.cpp:185:138: error: unused parameter 'constraints' [-Werror=unused-parameter]
Matthew Daiter
Comment 12 2015-07-23 16:45:17 PDT
Comment on attachment 257404 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=257404&action=review >> Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:185 >> +RefPtr<TrackSourceInfo> RealtimeMediaSourceCenterOwr::sourceWithUID(const String& UID, RealtimeMediaSource::Type type, MediaConstraints* constraints) > > The "constraints" parameter is causing build failures on other ports. Comment it out until you need to use it: > > ", MediaConstraints*)" > > or > > ", MediaConstraints* /* constraints */)" Fixed.
Matthew Daiter
Comment 13 2015-07-23 16:45:33 PDT
Brent Fulgham
Comment 14 2015-07-23 16:56:38 PDT
../../Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:185:114: error: unused parameter 'type' [-Werror=unused-parameter] RefPtr<TrackSourceInfo> RealtimeMediaSourceCenterOwr::sourceWithUID(const String& UID, RealtimeMediaSource::Type type, MediaConstraints*)
Brent Fulgham
Comment 15 2015-07-23 16:57:47 PDT
Comment on attachment 257405 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=257405&action=review Another build failure... I think this may be the last one, though. > Source/WebCore/platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:185 > +RefPtr<TrackSourceInfo> RealtimeMediaSourceCenterOwr::sourceWithUID(const String& UID, RealtimeMediaSource::Type type, MediaConstraints*) 'type' isn't used, so it's causing a build failure. Please correct!
Matthew Daiter
Comment 16 2015-07-23 17:40:26 PDT
Brent Fulgham
Comment 17 2015-07-23 18:29:08 PDT
Comment on attachment 257413 [details] Patch Looks good!
WebKit Commit Bot
Comment 18 2015-07-23 19:24:59 PDT
Comment on attachment 257413 [details] Patch Clearing flags on attachment: 257413 Committed r187282: <http://trac.webkit.org/changeset/187282>
WebKit Commit Bot
Comment 19 2015-07-23 19:25:03 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.