flinging_controller.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. // Copyright 2018 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef MEDIA_BASE_FLINGING_CONTROLLER_H_
  5. #define MEDIA_BASE_FLINGING_CONTROLLER_H_
  6. #include "base/time/time.h"
  7. #include "media/base/media_controller.h"
  8. #include "media/base/media_status_observer.h"
  9. namespace media {
  10. // Interface that groups all the necessary hooks to control media that is being
  11. // flung to a cast device, as part of RemotePlayback.
  12. // TODO(https://crbug.com/820277): Rename this interface to MediaRouteController
  13. // and change media_router::MediaRouteController to MojoMediaRouteController.
  14. class FlingingController {
  15. public:
  16. virtual ~FlingingController() = default;
  17. // Gets a MediaContoller owned by |this| to issue simple commands.
  18. virtual MediaController* GetMediaController() = 0;
  19. // Subscribe or un-subscribe to changes in the media status.
  20. virtual void AddMediaStatusObserver(MediaStatusObserver* observer) = 0;
  21. virtual void RemoveMediaStatusObserver(MediaStatusObserver* observer) = 0;
  22. // Gets the current media playback time. Implementers may sacrifice precision
  23. // to avoid a round-trip query to cast devices (see
  24. // RemoteMediaPlayer.getApproximateStreamPosition() for example).
  25. virtual base::TimeDelta GetApproximateCurrentTime() = 0;
  26. };
  27. } // namespace media
  28. #endif // MEDIA_BASE_FLINGING_CONTROLLER_H_