Skip to content
Snippets Groups Projects
Commit fe186bee authored by Guillaume Roguez's avatar Guillaume Roguez
Browse files

call: move media related API in dedicated header section

Media API are in refactoring.
To help to this huge task this patch moves all media related
API declaration from Call class header into a dedicated section.
It's help maintainance and new insertion, then it help to detect
what is wrong with current media design.

Change-Id: I4f65436112337b4a44eea37680d56e0fb4f5696d
parent d3b9585c
Branches
Tags
No related merge requests found
...@@ -195,39 +195,9 @@ class Call : public Recordable, public std::enable_shared_from_this<Call> { ...@@ -195,39 +195,9 @@ class Call : public Recordable, public std::enable_shared_from_this<Call> {
isIPToIP_ = IPToIP; isIPToIP_ = IPToIP;
} }
/**
* Set local audio port, as seen by me [not protected]
* @param port The local audio port
*/
void setLocalAudioPort(unsigned int port) {
localAudioPort_ = port;
}
/**
* Set local video port, as seen by me [not protected]
* @param port The local video port
*/
void setLocalVideoPort(unsigned int port) {
localVideoPort_ = port;
}
/**
* Return port used locally (for my machine) [mutex protected]
* @return unsigned int The local audio port
*/
unsigned int getLocalAudioPort() const;
/**
* Return port used locally (for my machine) [mutex protected]
* @return unsigned int The local video port
*/
unsigned int getLocalVideoPort() const;
virtual std::map<std::string, std::string> getDetails() const; virtual std::map<std::string, std::string> getDetails() const;
static std::map<std::string, std::string> getNullDetails(); static std::map<std::string, std::string> getNullDetails();
virtual bool toggleRecording();
/** /**
* Answer the call * Answer the call
*/ */
...@@ -239,8 +209,6 @@ class Call : public Recordable, public std::enable_shared_from_this<Call> { ...@@ -239,8 +209,6 @@ class Call : public Recordable, public std::enable_shared_from_this<Call> {
*/ */
virtual void hangup(int reason) = 0; virtual void hangup(int reason) = 0;
virtual void switchInput(const std::string&) {};
/** /**
* Refuse incoming call * Refuse incoming call
*/ */
...@@ -271,6 +239,59 @@ class Call : public Recordable, public std::enable_shared_from_this<Call> { ...@@ -271,6 +239,59 @@ class Call : public Recordable, public std::enable_shared_from_this<Call> {
*/ */
virtual bool offhold() = 0; virtual bool offhold() = 0;
/**
* Peer has hung up a call
*/
virtual void peerHungup();
virtual void removeCall();
using StateListener = std::function<void(CallState, int)>;
template<class T>
void addStateListener(T&& list) {
stateChangedListeners_.emplace_back(std::forward<T>(list));
}
/**
* Attach subcall to this instance.
* If this subcall is answered, this subcall and this instance will be merged using merge().
*/
void addSubCall(Call& call);
public: // media management
/**
* Set local audio port, as seen by me [not protected]
* @param port The local audio port
*/
void setLocalAudioPort(unsigned int port) {
localAudioPort_ = port;
}
/**
* Set local video port, as seen by me [not protected]
* @param port The local video port
*/
void setLocalVideoPort(unsigned int port) {
localVideoPort_ = port;
}
/**
* Return port used locally (for my machine) [mutex protected]
* @return unsigned int The local audio port
*/
unsigned int getLocalAudioPort() const;
/**
* Return port used locally (for my machine) [mutex protected]
* @return unsigned int The local video port
*/
unsigned int getLocalVideoPort() const;
virtual bool toggleRecording();
virtual void switchInput(const std::string&) {};
/** /**
* mute/unmute a media of a call * mute/unmute a media of a call
* @param mediaType type of media * @param mediaType type of media
...@@ -278,11 +299,6 @@ class Call : public Recordable, public std::enable_shared_from_this<Call> { ...@@ -278,11 +299,6 @@ class Call : public Recordable, public std::enable_shared_from_this<Call> {
*/ */
virtual void muteMedia(const std::string& mediaType, bool isMuted) = 0; virtual void muteMedia(const std::string& mediaType, bool isMuted) = 0;
/**
* Peer has hung up a call
*/
virtual void peerHungup();
/** /**
* Send DTMF * Send DTMF
* @param code The char code * @param code The char code
...@@ -301,8 +317,6 @@ class Call : public Recordable, public std::enable_shared_from_this<Call> { ...@@ -301,8 +317,6 @@ class Call : public Recordable, public std::enable_shared_from_this<Call> {
void onTextMessage(std::map<std::string, std::string>&& messages); void onTextMessage(std::map<std::string, std::string>&& messages);
virtual void removeCall();
virtual bool initIceTransport(bool master, unsigned channel_num=4); virtual bool initIceTransport(bool master, unsigned channel_num=4);
bool isIceRunning() const; bool isIceRunning() const;
...@@ -318,20 +332,8 @@ class Call : public Recordable, public std::enable_shared_from_this<Call> { ...@@ -318,20 +332,8 @@ class Call : public Recordable, public std::enable_shared_from_this<Call> {
} }
virtual void restartMediaSender() = 0; virtual void restartMediaSender() = 0;
virtual void restartMediaReceiver() = 0;
using StateListener = std::function<void(CallState, int)>; virtual void restartMediaReceiver() = 0;
template<class T>
void addStateListener(T&& list) {
stateChangedListeners_.emplace_back(std::forward<T>(list));
}
/**
* Attach subcall to this instance.
* If this subcall is answered, this subcall and this instance will be merged using merge().
*/
void addSubCall(Call& call);
protected: protected:
virtual void merge(Call& scall); virtual void merge(Call& scall);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment