You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

533 lines
18 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. /*
  2. * libjingle
  3. * Copyright 2012, Google Inc.
  4. *
  5. * Redistribution and use in source and binary forms, with or without
  6. * modification, are permitted provided that the following conditions are met:
  7. *
  8. * 1. Redistributions of source code must retain the above copyright notice,
  9. * this list of conditions and the following disclaimer.
  10. * 2. Redistributions in binary form must reproduce the above copyright notice,
  11. * this list of conditions and the following disclaimer in the documentation
  12. * and/or other materials provided with the distribution.
  13. * 3. The name of the author may not be used to endorse or promote products
  14. * derived from this software without specific prior written permission.
  15. *
  16. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
  17. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  18. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  19. * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  20. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  21. * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  22. * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  23. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  24. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  25. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  26. */
  27. #include "talk/app/webrtc/peerconnectionproxy.h"
  28. namespace {
  29. enum {
  30. MSG_ADDSTREAM = 1,
  31. MSG_REMOVESTREAM,
  32. MSG_CREATEDTMFSENDER,
  33. MSG_RETURNLOCALMEDIASTREAMS,
  34. MSG_RETURNREMOTEMEDIASTREAMS,
  35. MSG_SIGNALINGSTATE,
  36. MSG_ICESTATE,
  37. MSG_ICECONNECTION,
  38. MSG_ICEGATHERING,
  39. MSG_CREATEDATACHANNEL,
  40. MSG_TERMINATE,
  41. MSG_CREATEOFFER,
  42. MSG_CREATEANSWER,
  43. MSG_SETLOCALDESCRIPTION,
  44. MSG_SETREMOTEDESCRIPTION,
  45. MSG_UPDATEICE,
  46. MSG_ADDICECANDIDATE,
  47. MSG_GETLOCALDESCRIPTION,
  48. MSG_GETREMOTEDESCRIPTION,
  49. MSG_GETSTATS,
  50. };
  51. struct MediaStreamParams : public talk_base::MessageData {
  52. MediaStreamParams(webrtc::MediaStreamInterface* stream,
  53. const webrtc::MediaConstraintsInterface* constraints)
  54. : stream(stream),
  55. constraints(constraints),
  56. result(false) {
  57. }
  58. webrtc::MediaStreamInterface* stream;
  59. const webrtc::MediaConstraintsInterface* constraints;
  60. bool result;
  61. };
  62. struct DtmfSenderParams : public talk_base::MessageData {
  63. explicit DtmfSenderParams(webrtc::AudioTrackInterface* track)
  64. : track(track),
  65. dtmf_sender(NULL) {
  66. }
  67. webrtc::AudioTrackInterface* track;
  68. talk_base::scoped_refptr<webrtc::DtmfSenderInterface> dtmf_sender;
  69. };
  70. struct IceConfigurationParams : public talk_base::MessageData {
  71. IceConfigurationParams()
  72. : configuration(NULL),
  73. constraints(NULL),
  74. result(false) {
  75. }
  76. const webrtc::PeerConnectionInterface::IceServers* configuration;
  77. const webrtc::MediaConstraintsInterface* constraints;
  78. bool result;
  79. };
  80. struct StatsParams : public talk_base::MessageData {
  81. StatsParams(webrtc::StatsObserver* observer,
  82. webrtc::MediaStreamTrackInterface* track)
  83. : observer(observer),
  84. track(track),
  85. result(false) {
  86. }
  87. webrtc::StatsObserver* observer;
  88. webrtc::MediaStreamTrackInterface* track;
  89. bool result;
  90. };
  91. struct StreamLabelParams : public talk_base::MessageData {
  92. explicit StreamLabelParams(const std::string& label)
  93. : label(label),
  94. result(false) {
  95. }
  96. std::string label;
  97. bool result;
  98. };
  99. struct JsepSessionDescriptionParams : public talk_base::MessageData {
  100. JsepSessionDescriptionParams()
  101. : result(false), desc(NULL), const_desc(NULL) {
  102. }
  103. bool result;
  104. webrtc::SessionDescriptionInterface* desc;
  105. const webrtc::SessionDescriptionInterface* const_desc;
  106. };
  107. struct CreateSessionDescriptionParams : public talk_base::MessageData {
  108. CreateSessionDescriptionParams() : observer(NULL), constraints(NULL) {}
  109. webrtc::CreateSessionDescriptionObserver* observer;
  110. const webrtc::MediaConstraintsInterface* constraints;
  111. };
  112. struct SetSessionDescriptionParams : public talk_base::MessageData {
  113. SetSessionDescriptionParams() : observer(NULL), desc(NULL) {}
  114. webrtc::SetSessionDescriptionObserver* observer;
  115. webrtc::SessionDescriptionInterface* desc;
  116. };
  117. struct JsepIceCandidateParams : public talk_base::MessageData {
  118. explicit JsepIceCandidateParams(
  119. const webrtc::IceCandidateInterface* candidate)
  120. : result(false),
  121. candidate(candidate) {}
  122. bool result;
  123. const webrtc::IceCandidateInterface* candidate;
  124. };
  125. struct StreamCollectionParams : public talk_base::MessageData {
  126. explicit StreamCollectionParams(webrtc::StreamCollectionInterface* streams)
  127. : streams(streams) {}
  128. talk_base::scoped_refptr<webrtc::StreamCollectionInterface> streams;
  129. };
  130. struct SignalingStateMessage : public talk_base::MessageData {
  131. SignalingStateMessage() : state(webrtc::PeerConnectionInterface::kStable) {}
  132. webrtc::PeerConnectionInterface::SignalingState state;
  133. };
  134. struct IceStateMessage : public talk_base::MessageData {
  135. IceStateMessage() : state(webrtc::PeerConnectionInterface::kIceNew) {}
  136. webrtc::PeerConnectionInterface::IceState state;
  137. };
  138. struct IceConnectionMessage : public talk_base::MessageData {
  139. IceConnectionMessage()
  140. : state(webrtc::PeerConnectionInterface::kIceConnectionNew) {}
  141. webrtc::PeerConnectionInterface::IceConnectionState state;
  142. };
  143. struct IceGatheringMessage : public talk_base::MessageData {
  144. IceGatheringMessage()
  145. : state(webrtc::PeerConnectionInterface::kIceGatheringNew) {}
  146. webrtc::PeerConnectionInterface::IceGatheringState state;
  147. };
  148. struct CreateDataChannelMessageData : public talk_base::MessageData {
  149. CreateDataChannelMessageData(std::string label,
  150. const webrtc::DataChannelInit* init)
  151. : label(label),
  152. init(init) {
  153. }
  154. std::string label;
  155. const webrtc::DataChannelInit* init;
  156. talk_base::scoped_refptr<webrtc::DataChannelInterface> data_channel;
  157. };
  158. } // namespace
  159. namespace webrtc {
  160. PeerConnectionInterface* PeerConnectionProxy::Create(
  161. talk_base::Thread* signaling_thread,
  162. PeerConnectionInterface* peerconnection) {
  163. ASSERT(signaling_thread != NULL);
  164. return new talk_base::RefCountedObject<PeerConnectionProxy>(
  165. signaling_thread, peerconnection);
  166. }
  167. PeerConnectionProxy::PeerConnectionProxy(
  168. talk_base::Thread* signaling_thread,
  169. PeerConnectionInterface* peerconnection)
  170. : signaling_thread_(signaling_thread),
  171. peerconnection_(peerconnection) {
  172. }
  173. PeerConnectionProxy::~PeerConnectionProxy() {
  174. signaling_thread_->Send(this, MSG_TERMINATE);
  175. }
  176. talk_base::scoped_refptr<StreamCollectionInterface>
  177. PeerConnectionProxy::local_streams() {
  178. if (!signaling_thread_->IsCurrent()) {
  179. StreamCollectionParams msg(NULL);
  180. signaling_thread_->Send(this, MSG_RETURNLOCALMEDIASTREAMS, &msg);
  181. return msg.streams;
  182. }
  183. return peerconnection_->local_streams();
  184. }
  185. talk_base::scoped_refptr<StreamCollectionInterface>
  186. PeerConnectionProxy::remote_streams() {
  187. if (!signaling_thread_->IsCurrent()) {
  188. StreamCollectionParams msg(NULL);
  189. signaling_thread_->Send(this, MSG_RETURNREMOTEMEDIASTREAMS, &msg);
  190. return msg.streams;
  191. }
  192. return peerconnection_->remote_streams();
  193. }
  194. bool PeerConnectionProxy::AddStream(
  195. MediaStreamInterface* local_stream,
  196. const MediaConstraintsInterface* constraints) {
  197. if (!signaling_thread_->IsCurrent()) {
  198. MediaStreamParams msg(local_stream, constraints);
  199. signaling_thread_->Send(this, MSG_ADDSTREAM, &msg);
  200. return msg.result;
  201. }
  202. return peerconnection_->AddStream(local_stream, constraints);
  203. }
  204. void PeerConnectionProxy::RemoveStream(MediaStreamInterface* remove_stream) {
  205. if (!signaling_thread_->IsCurrent()) {
  206. MediaStreamParams msg(remove_stream, NULL);
  207. signaling_thread_->Send(this, MSG_REMOVESTREAM, &msg);
  208. return;
  209. }
  210. peerconnection_->RemoveStream(remove_stream);
  211. }
  212. talk_base::scoped_refptr<DtmfSenderInterface>
  213. PeerConnectionProxy::CreateDtmfSender(AudioTrackInterface* track) {
  214. if (!signaling_thread_->IsCurrent()) {
  215. DtmfSenderParams msg(track);
  216. signaling_thread_->Send(this, MSG_CREATEDTMFSENDER, &msg);
  217. return msg.dtmf_sender;
  218. }
  219. return peerconnection_->CreateDtmfSender(track);
  220. }
  221. bool PeerConnectionProxy::GetStats(StatsObserver* observer,
  222. MediaStreamTrackInterface* track) {
  223. if (!signaling_thread_->IsCurrent()) {
  224. StatsParams msg(observer, track);
  225. signaling_thread_->Send(this, MSG_GETSTATS, &msg);
  226. return msg.result;
  227. }
  228. return peerconnection_->GetStats(observer, track);
  229. }
  230. PeerConnectionInterface::SignalingState PeerConnectionProxy::signaling_state() {
  231. if (!signaling_thread_->IsCurrent()) {
  232. SignalingStateMessage msg;
  233. signaling_thread_->Send(this, MSG_SIGNALINGSTATE, &msg);
  234. return msg.state;
  235. }
  236. return peerconnection_->signaling_state();
  237. }
  238. PeerConnectionInterface::IceState PeerConnectionProxy::ice_state() {
  239. if (!signaling_thread_->IsCurrent()) {
  240. IceStateMessage msg;
  241. signaling_thread_->Send(this, MSG_ICESTATE, &msg);
  242. return msg.state;
  243. }
  244. return peerconnection_->ice_state();
  245. }
  246. PeerConnectionInterface::IceConnectionState
  247. PeerConnectionProxy::ice_connection_state() {
  248. if (!signaling_thread_->IsCurrent()) {
  249. IceConnectionMessage msg;
  250. signaling_thread_->Send(this, MSG_ICECONNECTION, &msg);
  251. return msg.state;
  252. }
  253. return peerconnection_->ice_connection_state();
  254. }
  255. PeerConnectionInterface::IceGatheringState
  256. PeerConnectionProxy::ice_gathering_state() {
  257. if (!signaling_thread_->IsCurrent()) {
  258. IceGatheringMessage msg;
  259. signaling_thread_->Send(this, MSG_ICEGATHERING, &msg);
  260. return msg.state;
  261. }
  262. return peerconnection_->ice_gathering_state();
  263. }
  264. talk_base::scoped_refptr<DataChannelInterface>
  265. PeerConnectionProxy::CreateDataChannel(const std::string& label,
  266. const DataChannelInit* config) {
  267. if (!signaling_thread_->IsCurrent()) {
  268. CreateDataChannelMessageData msg(label, config);
  269. signaling_thread_->Send(this, MSG_CREATEDATACHANNEL, &msg);
  270. return msg.data_channel;
  271. }
  272. return peerconnection_->CreateDataChannel(label, config);
  273. }
  274. void PeerConnectionProxy::CreateOffer(
  275. CreateSessionDescriptionObserver* observer,
  276. const MediaConstraintsInterface* constraints) {
  277. if (!signaling_thread_->IsCurrent()) {
  278. CreateSessionDescriptionParams msg;
  279. msg.observer = observer;
  280. msg.constraints = constraints;
  281. signaling_thread_->Send(this, MSG_CREATEOFFER, &msg);
  282. return;
  283. }
  284. peerconnection_->CreateOffer(observer, constraints);
  285. }
  286. void PeerConnectionProxy::CreateAnswer(
  287. CreateSessionDescriptionObserver* observer,
  288. const MediaConstraintsInterface* constraints) {
  289. if (!signaling_thread_->IsCurrent()) {
  290. CreateSessionDescriptionParams msg;
  291. msg.observer = observer;
  292. msg.constraints = constraints;
  293. signaling_thread_->Send(this, MSG_CREATEANSWER, &msg);
  294. return;
  295. }
  296. peerconnection_->CreateAnswer(observer, constraints);
  297. }
  298. void PeerConnectionProxy::SetLocalDescription(
  299. SetSessionDescriptionObserver* observer,
  300. SessionDescriptionInterface* desc) {
  301. if (!signaling_thread_->IsCurrent()) {
  302. SetSessionDescriptionParams msg;
  303. msg.observer = observer;
  304. msg.desc = desc;
  305. signaling_thread_->Send(this, MSG_SETLOCALDESCRIPTION, &msg);
  306. return;
  307. }
  308. peerconnection_->SetLocalDescription(observer, desc);
  309. }
  310. void PeerConnectionProxy::SetRemoteDescription(
  311. SetSessionDescriptionObserver* observer,
  312. SessionDescriptionInterface* desc) {
  313. if (!signaling_thread_->IsCurrent()) {
  314. SetSessionDescriptionParams msg;
  315. msg.observer = observer;
  316. msg.desc = desc;
  317. signaling_thread_->Send(this, MSG_SETREMOTEDESCRIPTION, &msg);
  318. return;
  319. }
  320. peerconnection_->SetRemoteDescription(observer, desc);
  321. }
  322. bool PeerConnectionProxy::UpdateIce(
  323. const IceServers& configuration,
  324. const MediaConstraintsInterface* constraints) {
  325. if (!signaling_thread_->IsCurrent()) {
  326. IceConfigurationParams msg;
  327. msg.configuration = &configuration;
  328. msg.constraints = constraints;
  329. signaling_thread_->Send(this, MSG_UPDATEICE, &msg);
  330. return msg.result;
  331. }
  332. return peerconnection_->UpdateIce(configuration, constraints);
  333. }
  334. bool PeerConnectionProxy::AddIceCandidate(
  335. const IceCandidateInterface* ice_candidate) {
  336. if (!signaling_thread_->IsCurrent()) {
  337. JsepIceCandidateParams msg(ice_candidate);
  338. signaling_thread_->Send(this, MSG_ADDICECANDIDATE, &msg);
  339. return msg.result;
  340. }
  341. return peerconnection_->AddIceCandidate(ice_candidate);
  342. }
  343. const SessionDescriptionInterface*
  344. PeerConnectionProxy::local_description() const {
  345. if (!signaling_thread_->IsCurrent()) {
  346. JsepSessionDescriptionParams msg;
  347. signaling_thread_->Send(const_cast<PeerConnectionProxy*>(this),
  348. MSG_GETLOCALDESCRIPTION, &msg);
  349. return msg.const_desc;
  350. }
  351. return peerconnection_->local_description();
  352. }
  353. const SessionDescriptionInterface*
  354. PeerConnectionProxy::remote_description() const {
  355. if (!signaling_thread_->IsCurrent()) {
  356. JsepSessionDescriptionParams msg;
  357. signaling_thread_->Send(const_cast<PeerConnectionProxy*>(this),
  358. MSG_GETREMOTEDESCRIPTION, &msg);
  359. return msg.const_desc;
  360. }
  361. return peerconnection_->remote_description();
  362. }
  363. void PeerConnectionProxy::OnMessage(talk_base::Message* msg) {
  364. talk_base::MessageData* data = msg->pdata;
  365. switch (msg->message_id) {
  366. case MSG_ADDSTREAM: {
  367. MediaStreamParams* param(static_cast<MediaStreamParams*> (data));
  368. param->result = peerconnection_->AddStream(param->stream,
  369. param->constraints);
  370. break;
  371. }
  372. case MSG_REMOVESTREAM: {
  373. MediaStreamParams* param(static_cast<MediaStreamParams*> (data));
  374. peerconnection_->RemoveStream(param->stream);
  375. break;
  376. }
  377. case MSG_CREATEDTMFSENDER: {
  378. DtmfSenderParams* param(static_cast<DtmfSenderParams*> (data));
  379. param->dtmf_sender =
  380. peerconnection_->CreateDtmfSender(param->track);
  381. break;
  382. }
  383. case MSG_GETSTATS: {
  384. StatsParams* param(static_cast<StatsParams*> (data));
  385. param->result = peerconnection_->GetStats(param->observer, param->track);
  386. break;
  387. }
  388. case MSG_RETURNLOCALMEDIASTREAMS: {
  389. StreamCollectionParams* param(static_cast<StreamCollectionParams*>(data));
  390. param->streams = peerconnection_->local_streams();
  391. break;
  392. }
  393. case MSG_RETURNREMOTEMEDIASTREAMS: {
  394. StreamCollectionParams* param(static_cast<StreamCollectionParams*>(data));
  395. param->streams = peerconnection_->remote_streams();
  396. break;
  397. }
  398. case MSG_SIGNALINGSTATE: {
  399. SignalingStateMessage* param(static_cast<SignalingStateMessage*> (data));
  400. param->state = peerconnection_->signaling_state();
  401. break;
  402. }
  403. case MSG_ICESTATE: {
  404. IceStateMessage* param(static_cast<IceStateMessage*> (data));
  405. param->state = peerconnection_->ice_state();
  406. break;
  407. }
  408. case MSG_ICECONNECTION: {
  409. IceConnectionMessage* param(static_cast<IceConnectionMessage*> (data));
  410. param->state = peerconnection_->ice_connection_state();
  411. break;
  412. }
  413. case MSG_ICEGATHERING: {
  414. IceGatheringMessage* param(static_cast<IceGatheringMessage*> (data));
  415. param->state = peerconnection_->ice_gathering_state();
  416. break;
  417. }
  418. case MSG_CREATEDATACHANNEL: {
  419. CreateDataChannelMessageData* param(
  420. static_cast<CreateDataChannelMessageData*>(data));
  421. param->data_channel = peerconnection_->CreateDataChannel(param->label,
  422. param->init);
  423. break;
  424. }
  425. case MSG_CREATEOFFER: {
  426. CreateSessionDescriptionParams* param(
  427. static_cast<CreateSessionDescriptionParams*> (data));
  428. peerconnection_->CreateOffer(param->observer, param->constraints);
  429. break;
  430. }
  431. case MSG_CREATEANSWER: {
  432. CreateSessionDescriptionParams* param(
  433. static_cast<CreateSessionDescriptionParams*> (data));
  434. peerconnection_->CreateAnswer(param->observer, param->constraints);
  435. break;
  436. }
  437. case MSG_SETLOCALDESCRIPTION: {
  438. SetSessionDescriptionParams* param(
  439. static_cast<SetSessionDescriptionParams*> (data));
  440. peerconnection_->SetLocalDescription(param->observer,
  441. param->desc);
  442. break;
  443. }
  444. case MSG_SETREMOTEDESCRIPTION: {
  445. SetSessionDescriptionParams* param(
  446. static_cast<SetSessionDescriptionParams*> (data));
  447. peerconnection_->SetRemoteDescription(param->observer,
  448. param->desc);
  449. break;
  450. }
  451. case MSG_UPDATEICE: {
  452. IceConfigurationParams* param(
  453. static_cast<IceConfigurationParams*> (data));
  454. param->result = peerconnection_->UpdateIce(*param->configuration,
  455. param->constraints);
  456. break;
  457. }
  458. case MSG_ADDICECANDIDATE: {
  459. JsepIceCandidateParams* param(
  460. static_cast<JsepIceCandidateParams*> (data));
  461. param->result = peerconnection_->AddIceCandidate(param->candidate);
  462. break;
  463. }
  464. case MSG_GETLOCALDESCRIPTION: {
  465. JsepSessionDescriptionParams* param(
  466. static_cast<JsepSessionDescriptionParams*> (data));
  467. param->const_desc = peerconnection_->local_description();
  468. break;
  469. }
  470. case MSG_GETREMOTEDESCRIPTION: {
  471. JsepSessionDescriptionParams* param(
  472. static_cast<JsepSessionDescriptionParams*> (data));
  473. param->const_desc = peerconnection_->remote_description();
  474. break;
  475. }
  476. case MSG_TERMINATE: {
  477. // Called by the destructor to release the peerconnection reference on the
  478. // signaling thread.
  479. peerconnection_ = NULL;
  480. break;
  481. }
  482. default:
  483. ASSERT(!"NOT IMPLEMENTED");
  484. break;
  485. }
  486. }
  487. } // namespace webrtc