sdp_callbacks.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) 2019 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. #ifndef TEST_PEER_SCENARIO_SDP_CALLBACKS_H_
  11. #define TEST_PEER_SCENARIO_SDP_CALLBACKS_H_
  12. #include "api/peer_connection_interface.h"
  13. // Helpers to allow usage of std::function/lambdas to observe SDP operation in
  14. // the peer conenction API. As they only have handlers for sucess, failures will
  15. // cause a crash.
  16. namespace webrtc {
  17. namespace test {
  18. namespace webrtc_sdp_obs_impl {
  19. class SdpSetObserversInterface : public SetSessionDescriptionObserver,
  20. public SetRemoteDescriptionObserverInterface {
  21. };
  22. } // namespace webrtc_sdp_obs_impl
  23. // Implementation of both SetSessionDescriptionObserver and
  24. // SetRemoteDescriptionObserverInterface for use with SDP set operations. This
  25. // return a raw owning pointer as it's only intended to be used as input to
  26. // PeerConnection API which will take ownership.
  27. webrtc_sdp_obs_impl::SdpSetObserversInterface* SdpSetObserver(
  28. std::function<void()> callback);
  29. // Implementation of CreateSessionDescriptionObserver for use with SDP create
  30. // operations. This return a raw owning pointer as it's only intended to be used
  31. // as input to PeerConnection API which will take ownership.
  32. CreateSessionDescriptionObserver* SdpCreateObserver(
  33. std::function<void(SessionDescriptionInterface*)> callback);
  34. } // namespace test
  35. } // namespace webrtc
  36. #endif // TEST_PEER_SCENARIO_SDP_CALLBACKS_H_