mirror of
https://github.com/UltraCoderRU/libwebrtc.git
synced 2026-01-28 11:15:13 +00:00
27 lines
815 B
C++
27 lines
815 B
C++
//
|
|
// Created by ax on 25/09/16.
|
|
//
|
|
|
|
#include "SetRemoteSessionDescriptionObserver.h"
|
|
#include "CreateSessionObserver.h"
|
|
#include "Console.h"
|
|
|
|
|
|
SetRemoteSessionDescriptionObserver::SetRemoteSessionDescriptionObserver(
|
|
IPeer *peer, webrtc::SessionDescriptionInterface* desc):
|
|
_peer(peer), _desc(desc) {
|
|
}
|
|
|
|
void SetRemoteSessionDescriptionObserver::OnSuccess() {
|
|
if (_desc->type() == webrtc::SessionDescriptionInterface::kOffer) {
|
|
rtc::scoped_refptr<CreateSessionObserver> createAnswerObserver =
|
|
new rtc::RefCountedObject<CreateSessionObserver>(_peer);
|
|
|
|
_peer->CreateAnswer(createAnswerObserver);
|
|
}
|
|
}
|
|
|
|
void SetRemoteSessionDescriptionObserver::OnFailure(const std::string& error) {
|
|
Console::Print("[SetRemoteSessionDescriptionObserver::OnFailure] %s",
|
|
error.c_str());
|
|
}
|