[Media Router] Support dual discovery

Desktop / Chromium - Bin Zhao [chromium.org] - 9 August 2017 19:25 EDT

Porting from https://codereview.chromium.org/2965843002/

- Added DialMediaSinkServiceDelegate class to monitor OnDialSinkAdded() and OnDialSinksRemoved()- CastMediaSinkServiceImpl implements DialMediaSinkServiceDelegate- MediaRouterMojoImpl registers CastMediaSinkService as a delegate of DialMediaSinkService

Dual discovery process: DialMediaSinkServiceImpl::OnDeviceDescriptionAvailable() CastMediaSinkService::OnDialSinkAdded() CastMediaSinkServiceImpl::OnDialSinkAdded() CastMediaSinkServiceImpl::OpenChannel() ... async open channel CastMediaSinkServiceImpl::OnChannelOpened() if succeeded, add cast_sink to |current_sinks_by_dial_map_|

CastMediaSinkServiceImpl::OnFetchCompleted() is invoked when timer expires. It will merge sinks discovered by mDNS service and DIAL.

Bug: 687377 Change-Id: Ie5e526ccdde36daa9f871f66ca84cd1553484a4d Reviewed-on: https://chromium-review.googlesource.com/590510 Commit-Queue: Bin Zhao

7c4a262 [Media Router] Support dual discovery
.../discovery/dial/dial_media_sink_service_impl.cc | 21 +++-
.../discovery/dial/dial_media_sink_service_impl.h | 20 ++++
.../dial/dial_media_sink_service_impl_unittest.cc | 2 +-
.../dial/dial_media_sink_service_proxy.cc | 16 ++-
.../discovery/dial/dial_media_sink_service_proxy.h | 10 ++
.../discovery/mdns/cast_media_sink_service.cc | 11 +++
.../discovery/mdns/cast_media_sink_service.h | 6 +-
.../discovery/mdns/cast_media_sink_service_impl.cc | 86 +++++++++++++---
.../discovery/mdns/cast_media_sink_service_impl.h | 14 +++
.../mdns/cast_media_sink_service_impl_unittest.cc | 108 +++++++++++++++++++--
.../router/discovery/media_sink_service_base.h | 2 +-
.../media/router/mojo/media_router_mojo_impl.cc | 27 +++---
.../media_router/discovery/media_sink_internal.cc | 3 +-
.../media_router/discovery/media_sink_internal.h | 3 +
14 files changed, 291 insertions(+), 38 deletions(-)

Upstream: git.chromium.org


  • Share