Update to the peerconnection sample app.
* Fixes bug where remote video wasn't renderered. * Update the Conductor class in accordance to the latest changes in the API. We now process the stream add/remove callbacks asynchronously. * When a remote peer connects to us, we now call AddStream for our local streams to share with the peer if we haven't already done so. To do that, we maintain a set of streams we have already shared. BUG=11 Review URL: http://webrtc-codereview.appspot.com/131011 git-svn-id: http://webrtc.googlecode.com/svn/trunk@506 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <deque>
|
||||
#include <set>
|
||||
#include <string>
|
||||
|
||||
#include "peerconnection/samples/client/main_wnd.h"
|
||||
@@ -36,6 +37,8 @@ class Conductor
|
||||
SEND_MESSAGE_TO_PEER,
|
||||
PEER_CONNECTION_ADDSTREAMS,
|
||||
PEER_CONNECTION_ERROR,
|
||||
NEW_STREAM_ADDED,
|
||||
STREAM_REMOVED,
|
||||
};
|
||||
|
||||
Conductor(PeerConnectionClient* client, MainWindow* main_wnd);
|
||||
@@ -49,6 +52,7 @@ class Conductor
|
||||
bool InitializePeerConnection();
|
||||
void DeletePeerConnection();
|
||||
void StartCaptureDevice();
|
||||
bool AddStream(const std::string& id, bool video);
|
||||
void AddStreams();
|
||||
|
||||
//
|
||||
@@ -94,17 +98,14 @@ class Conductor
|
||||
virtual void UIThreadCallback(int msg_id, void* data);
|
||||
|
||||
protected:
|
||||
bool waiting_for_audio_;
|
||||
bool waiting_for_video_;
|
||||
int peer_id_;
|
||||
talk_base::scoped_ptr<webrtc::PeerConnection> peer_connection_;
|
||||
talk_base::scoped_ptr<webrtc::PeerConnectionFactory> peer_connection_factory_;
|
||||
talk_base::scoped_ptr<talk_base::Thread> worker_thread_;
|
||||
PeerConnectionClient* client_;
|
||||
MainWindow* main_wnd_;
|
||||
std::string video_channel_;
|
||||
std::string audio_channel_;
|
||||
std::deque<std::string*> pending_messages_;
|
||||
std::set<std::string> active_streams_;
|
||||
};
|
||||
|
||||
#endif // PEERCONNECTION_SAMPLES_CLIENT_CONDUCTOR_H_
|
||||
|
||||
Reference in New Issue
Block a user