media-session.h 3.72 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
/*
 * media-session.h
 * Copyright (C) 2017  Belledonne Communications SARL
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _MEDIA_SESSION_H_
#define _MEDIA_SESSION_H_

#include "call-session.h"
23
#include "conference/params/media-session-params.h"
24 25 26 27 28

// =============================================================================

LINPHONE_BEGIN_NAMESPACE

29 30
class CallPrivate;
class IceAgent;
31 32 33
class MediaSessionPrivate;

class MediaSession : public CallSession {
34 35 36
	friend class CallPrivate;
	friend class IceAgent;

37
public:
38
	MediaSession (const Conference &conference, const CallSessionParams *params, CallSessionListener *listener);
39

40 41 42
	LinphoneStatus accept (const MediaSessionParams *msp = nullptr);
	LinphoneStatus acceptEarlyMedia (const MediaSessionParams *msp = nullptr);
	LinphoneStatus acceptUpdate (const MediaSessionParams *msp);
43 44 45 46
	void configure (LinphoneCallDir direction, LinphoneProxyConfig *cfg, SalOp *op, const Address &from, const Address &to) override;
	void initiateIncoming () override;
	bool initiateOutgoing () override;
	void iterate (time_t currentRealTime, bool oneSecondElapsed) override;
47 48
	LinphoneStatus pause ();
	LinphoneStatus resume ();
49
	void sendVfuRequest ();
50
	void startIncomingNotification () override;
51
	int startInvite (const Address *destination, const std::string &subject) override;
52 53
	void startRecording ();
	void stopRecording ();
54
	LinphoneStatus update (const MediaSessionParams *msp);
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71

	void resetFirstVideoFrameDecoded ();
	LinphoneStatus takePreviewSnapshot (const std::string& file);
	LinphoneStatus takeVideoSnapshot (const std::string& file);
	void zoomVideo (float zoomFactor, float *cx, float *cy);

	bool cameraEnabled () const;
	bool echoCancellationEnabled () const;
	bool echoLimiterEnabled () const;
	void enableCamera (bool value);
	void enableEchoCancellation (bool value);
	void enableEchoLimiter (bool value);
	bool getAllMuted () const;
	LinphoneCallStats * getAudioStats () const;
	std::string getAuthenticationToken () const;
	bool getAuthenticationTokenVerified () const;
	float getAverageQuality () const;
72
	MediaSessionParams *getCurrentParams () const;
73
	float getCurrentQuality () const;
74
	const MediaSessionParams *getMediaParams () const;
75 76
	RtpTransport * getMetaRtcpTransport (int streamIndex) const;
	RtpTransport * getMetaRtpTransport (int streamIndex) const;
77 78
	float getMicrophoneVolumeGain () const;
	void * getNativeVideoWindowId () const;
79
	const CallSessionParams *getParams () const override;
80 81
	float getPlayVolume () const;
	float getRecordVolume () const;
82
	const MediaSessionParams *getRemoteParams ();
83 84
	float getSpeakerVolumeGain () const;
	LinphoneCallStats * getStats (LinphoneStreamType type) const;
85
	int getStreamCount () const;
86 87 88 89 90 91 92 93
	MSFormatType getStreamType (int streamIndex) const;
	LinphoneCallStats * getTextStats () const;
	LinphoneCallStats * getVideoStats () const;
	bool mediaInProgress () const;
	void setAuthenticationTokenVerified (bool value);
	void setMicrophoneVolumeGain (float value);
	void setNativeVideoWindowId (void *id);
	void setSpeakerVolumeGain (float value);
94 95 96 97 98 99 100 101 102

private:
	L_DECLARE_PRIVATE(MediaSession);
	L_DISABLE_COPY(MediaSession);
};

LINPHONE_END_NAMESPACE

#endif // ifndef _MEDIA_SESSION_H_