Harald Alvestrand | 1090e44 | 2020-10-05 07:01:09 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2020 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 | |
| 11 | #ifndef PC_PEER_CONNECTION_MESSAGE_HANDLER_H_ |
| 12 | #define PC_PEER_CONNECTION_MESSAGE_HANDLER_H_ |
| 13 | |
| 14 | #include "api/rtc_error.h" |
| 15 | #include "api/stats_types.h" |
| 16 | #include "rtc_base/message_handler.h" |
| 17 | #include "rtc_base/thread.h" |
| 18 | |
| 19 | namespace webrtc { |
| 20 | |
| 21 | class CreateSessionDescriptionObserver; |
| 22 | class SetSessionDescriptionObserver; |
| 23 | class StatsCollectorInterface; |
| 24 | class StatsObserver; |
| 25 | class MediaStreamTrackInterface; |
| 26 | |
| 27 | class PeerConnectionMessageHandler : public rtc::MessageHandler { |
| 28 | public: |
| 29 | explicit PeerConnectionMessageHandler(rtc::Thread* signaling_thread) |
| 30 | : signaling_thread_(signaling_thread) {} |
| 31 | ~PeerConnectionMessageHandler(); |
| 32 | |
| 33 | // Implements MessageHandler. |
| 34 | void OnMessage(rtc::Message* msg) override; |
| 35 | void PostSetSessionDescriptionSuccess( |
| 36 | SetSessionDescriptionObserver* observer); |
| 37 | void PostSetSessionDescriptionFailure(SetSessionDescriptionObserver* observer, |
| 38 | RTCError&& error); |
| 39 | void PostCreateSessionDescriptionFailure( |
| 40 | CreateSessionDescriptionObserver* observer, |
| 41 | RTCError error); |
| 42 | void PostGetStats(StatsObserver* observer, |
| 43 | StatsCollectorInterface* stats, |
| 44 | MediaStreamTrackInterface* track); |
| 45 | void RequestUsagePatternReport(std::function<void()>, int delay_ms); |
| 46 | |
| 47 | private: |
| 48 | rtc::Thread* signaling_thread() const { return signaling_thread_; } |
| 49 | |
| 50 | rtc::Thread* const signaling_thread_; |
| 51 | }; |
| 52 | |
| 53 | } // namespace webrtc |
| 54 | |
| 55 | #endif // PC_PEER_CONNECTION_MESSAGE_HANDLER_H_ |