call.h 4.14 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
/*
 * call.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 _CALL_CALL_H_
#define _CALL_CALL_H_

22 23
#include <memory>

24 25 26
#include "linphone/types.h"

#include "object/object.h"
27 28 29
#include "address/address.h"
#include "call/call-listener.h"
#include "conference/params/media-session-params.h"
30 31 32

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

33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
LINPHONE_BEGIN_NAMESPACE

class CallPrivate;
class CallSessionPrivate;
class MediaSessionPrivate;

class Call : public Object {
	friend class CallSessionPrivate;
	friend class MediaSessionPrivate;

public:
	Call (LinphoneCall *call, LinphoneCore *core, LinphoneCallDir direction, const Address &from, const Address &to,
		LinphoneProxyConfig *cfg, SalOp *op, const std::shared_ptr<MediaSessionParams> msp);

	LinphoneStatus accept (const std::shared_ptr<MediaSessionParams> msp = nullptr);
	LinphoneStatus acceptEarlyMedia (const std::shared_ptr<MediaSessionParams> msp = nullptr);
	LinphoneStatus acceptUpdate (const std::shared_ptr<MediaSessionParams> msp);
	LinphoneStatus decline (LinphoneReason reason);
	LinphoneStatus decline (const LinphoneErrorInfo *ei);
52 53
	LinphoneStatus pause ();
	LinphoneStatus resume ();
54 55 56 57 58 59 60 61
	void sendVfuRequest ();
	void startRecording ();
	void stopRecording ();
	LinphoneStatus takePreviewSnapshot (const std::string& file);
	LinphoneStatus takeVideoSnapshot (const std::string& file);
	LinphoneStatus terminate (const LinphoneErrorInfo *ei = nullptr);
	LinphoneStatus update (const std::shared_ptr<MediaSessionParams> msp = nullptr);
	void zoomVideo (float zoomFactor, float *cx, float *cy);
62

63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
	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;
	LinphoneCore * getCore () const;
	const std::shared_ptr<MediaSessionParams> getCurrentParams () const;
	float getCurrentQuality () const;
	LinphoneCallDir getDirection () const;
	int getDuration () const;
	const LinphoneErrorInfo * getErrorInfo () const;
	LinphoneCallLog * getLog () const;
	RtpTransport * getMetaRtcpTransport (int streamIndex);
	RtpTransport * getMetaRtpTransport (int streamIndex);
	float getMicrophoneVolumeGain () const;
	void * getNativeVideoWindowId () const;
	const std::shared_ptr<MediaSessionParams> getParams () const;
	float getPlayVolume () const;
	LinphoneReason getReason () const;
	float getRecordVolume () const;
	const Address& getRemoteAddress () const;
	std::string getRemoteAddressAsString () const;
	std::string getRemoteContact () const;
	const std::shared_ptr<MediaSessionParams> getRemoteParams () const;
	float getSpeakerVolumeGain () const;
	LinphoneCallState getState () const;
	LinphoneCallStats * getStats (LinphoneStreamType type) const;
	int getStreamCount ();
	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 setNextVideoFrameDecodedCallback (LinphoneCallCbFunc cb, void *user_data);
	void setSpeakerVolumeGain (float value);
106

107 108 109 110
private:
	L_DECLARE_PRIVATE(Call);
	L_DISABLE_COPY(Call);
};
111

112
LINPHONE_END_NAMESPACE
113 114

#endif // ifndef _CALL_CALL_H_