SetSessionDescriptionObserver.cpp 974 B

12345678910111213141516171819202122232425262728293031323334
  1. #include "pch.h"
  2. #include "PeerConnectionObject.h"
  3. #include "SetSessionDescriptionObserver.h"
  4. namespace unity
  5. {
  6. namespace webrtc
  7. {
  8. DelegateSetSessionDesc SetSessionDescriptionObserver::s_setSessionDescCallback = nullptr;
  9. rtc::scoped_refptr<SetSessionDescriptionObserver>
  10. SetSessionDescriptionObserver::Create(PeerConnectionObject* connection)
  11. {
  12. return new rtc::RefCountedObject<SetSessionDescriptionObserver>(connection);
  13. }
  14. SetSessionDescriptionObserver::SetSessionDescriptionObserver(PeerConnectionObject* connection)
  15. {
  16. m_connection = connection;
  17. }
  18. void SetSessionDescriptionObserver::OnSuccess()
  19. {
  20. s_setSessionDescCallback(m_connection, this, RTCErrorType::NONE, nullptr);
  21. }
  22. void SetSessionDescriptionObserver::OnFailure(webrtc::RTCError error)
  23. {
  24. s_setSessionDescCallback(m_connection, this, error.type(), error.message());
  25. }
  26. } // end namespace webrtc
  27. } // end namespace unity