media-session.h 4.05 KB
Newer Older
1 2
/*
 * media-session.h
Ghislain MARY's avatar
Ghislain MARY committed
3
 * Copyright (C) 2010-2017 Belledonne Communications SARL
4
 *
Ghislain MARY's avatar
Ghislain MARY committed
5 6 7 8
 * 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 2
 * of the License, or (at your option) any later version.
9 10 11 12 13 14 15
 *
 * 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
Ghislain MARY's avatar
Ghislain MARY committed
16 17
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 19 20 21 22 23
 */

#ifndef _MEDIA_SESSION_H_
#define _MEDIA_SESSION_H_

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

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

LINPHONE_BEGIN_NAMESPACE

30
class CallPrivate;
31
class Core;
32
class IceAgent;
33
class MediaSessionPrivate;
34
class Participant;
35

36
class LINPHONE_PUBLIC MediaSession : public CallSession {
Ghislain MARY's avatar
Ghislain MARY committed
37
	friend class Call;
38 39 40
	friend class CallPrivate;
	friend class IceAgent;

41
public:
42 43
	MediaSession (const std::shared_ptr<Core> &core, std::shared_ptr<Participant> me, const CallSessionParams *params, CallSessionListener *listener);
	virtual ~MediaSession ();
44

45 46 47
	LinphoneStatus accept (const MediaSessionParams *msp = nullptr);
	LinphoneStatus acceptEarlyMedia (const MediaSessionParams *msp = nullptr);
	LinphoneStatus acceptUpdate (const MediaSessionParams *msp);
48
	void configure (LinphoneCallDir direction, LinphoneProxyConfig *cfg, SalCallOp *op, const Address &from, const Address &to) override;
49 50 51
	void initiateIncoming () override;
	bool initiateOutgoing () override;
	void iterate (time_t currentRealTime, bool oneSecondElapsed) override;
52 53
	LinphoneStatus pause ();
	LinphoneStatus resume ();
54
	void sendVfuRequest ();
55
	void startIncomingNotification () override;
56
	int startInvite (const Address *destination, const std::string &subject = "", const Content *content = nullptr) override;
57 58
	void startRecording ();
	void stopRecording ();
59
	LinphoneStatus update (const MediaSessionParams *msp, const std::string &subject = "");
60 61 62 63 64

	void resetFirstVideoFrameDecoded ();
	LinphoneStatus takePreviewSnapshot (const std::string& file);
	LinphoneStatus takeVideoSnapshot (const std::string& file);
	void zoomVideo (float zoomFactor, float *cx, float *cy);
65
	void zoomVideo (float zoomFactor, float cx, float cy);
66 67 68 69 70 71 72 73 74 75 76 77

	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;
78
	MediaSessionParams *getCurrentParams () const;
79
	float getCurrentQuality () const;
80
	const MediaSessionParams *getMediaParams () const;
81 82
	RtpTransport * getMetaRtcpTransport (int streamIndex) const;
	RtpTransport * getMetaRtpTransport (int streamIndex) const;
83 84
	float getMicrophoneVolumeGain () const;
	void * getNativeVideoWindowId () const;
85
	const CallSessionParams *getParams () const override;
86 87
	float getPlayVolume () const;
	float getRecordVolume () const;
88
	const MediaSessionParams *getRemoteParams ();
89 90
	float getSpeakerVolumeGain () const;
	LinphoneCallStats * getStats (LinphoneStreamType type) const;
91
	int getStreamCount () const;
92 93 94 95 96 97 98 99
	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);
100 101 102 103 104 105 106 107 108

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

LINPHONE_END_NAMESPACE

#endif // ifndef _MEDIA_SESSION_H_