media_stream_track_proxy.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Copyright 2011 The WebRTC project authors. All Rights Reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. // This file includes proxy classes for tracks. The purpose is
  11. // to make sure tracks are only accessed from the signaling thread.
  12. #ifndef API_MEDIA_STREAM_TRACK_PROXY_H_
  13. #define API_MEDIA_STREAM_TRACK_PROXY_H_
  14. #include <string>
  15. #include "api/media_stream_interface.h"
  16. #include "api/proxy.h"
  17. namespace webrtc {
  18. // TODO(deadbeef): Move this to .cc file and out of api/. What threads methods
  19. // are called on is an implementation detail.
  20. BEGIN_SIGNALING_PROXY_MAP(AudioTrack)
  21. PROXY_SIGNALING_THREAD_DESTRUCTOR()
  22. BYPASS_PROXY_CONSTMETHOD0(std::string, kind)
  23. BYPASS_PROXY_CONSTMETHOD0(std::string, id)
  24. PROXY_CONSTMETHOD0(TrackState, state)
  25. PROXY_CONSTMETHOD0(bool, enabled)
  26. PROXY_CONSTMETHOD0(AudioSourceInterface*, GetSource)
  27. PROXY_METHOD1(void, AddSink, AudioTrackSinkInterface*)
  28. PROXY_METHOD1(void, RemoveSink, AudioTrackSinkInterface*)
  29. PROXY_METHOD1(bool, GetSignalLevel, int*)
  30. PROXY_METHOD0(rtc::scoped_refptr<AudioProcessorInterface>, GetAudioProcessor)
  31. PROXY_METHOD1(bool, set_enabled, bool)
  32. PROXY_METHOD1(void, RegisterObserver, ObserverInterface*)
  33. PROXY_METHOD1(void, UnregisterObserver, ObserverInterface*)
  34. END_PROXY_MAP()
  35. BEGIN_PROXY_MAP(VideoTrack)
  36. PROXY_SIGNALING_THREAD_DESTRUCTOR()
  37. BYPASS_PROXY_CONSTMETHOD0(std::string, kind)
  38. BYPASS_PROXY_CONSTMETHOD0(std::string, id)
  39. PROXY_CONSTMETHOD0(TrackState, state)
  40. PROXY_CONSTMETHOD0(bool, enabled)
  41. PROXY_METHOD1(bool, set_enabled, bool)
  42. PROXY_CONSTMETHOD0(ContentHint, content_hint)
  43. PROXY_METHOD1(void, set_content_hint, ContentHint)
  44. PROXY_WORKER_METHOD2(void,
  45. AddOrUpdateSink,
  46. rtc::VideoSinkInterface<VideoFrame>*,
  47. const rtc::VideoSinkWants&)
  48. PROXY_WORKER_METHOD1(void, RemoveSink, rtc::VideoSinkInterface<VideoFrame>*)
  49. PROXY_CONSTMETHOD0(VideoTrackSourceInterface*, GetSource)
  50. PROXY_METHOD1(void, RegisterObserver, ObserverInterface*)
  51. PROXY_METHOD1(void, UnregisterObserver, ObserverInterface*)
  52. END_PROXY_MAP()
  53. } // namespace webrtc
  54. #endif // API_MEDIA_STREAM_TRACK_PROXY_H_