11#include "QXmppError.h"
12#include "QXmppJingleIq.h"
14#include "GstWrapper.h"
15#include "StringLiterals.h"
35class QXmppCallPrivate :
public QObject
39 using GstElementPtr = QXmpp::Private::GstElementPtr;
47 QLatin1String gstDepay;
55 QList<Property> encProps;
58 explicit QXmppCallPrivate(
const QString &jid,
const QString &sid,
QXmppCall::Direction direction, QPointer<QXmppCallManager> manager,
QXmppCall::State state, QXmppError &&error, QXmppCall *qq);
61 void ssrcActive(uint sessionId, uint ssrc);
62 void padAdded(GstPad *pad);
63 GstCaps *ptMap(uint sessionId, uint pt);
64 static bool isFormatSupported(
const QString &codecName);
65 static bool isCodecSupported(
const GstCodec &codec);
67 QXmppCallStream *createStream(
const QString &media,
const QString &creator,
const QString &name);
68 QXmppJingleIq::Content localContent(QXmppCallStream *stream)
const;
71 bool handleDescription(QXmppCallStream *stream,
const QXmppJingleIq::Content &content);
72 std::variant<QXmppIq, QXmppStanza::Error> handleRequest(QXmppJingleIq &&iq);
73 bool handleTransport(QXmppCallStream *stream,
const QXmppJingleIq::Content &content);
76 void terminate(QXmppJingleReason reason,
bool delay =
false);
78 bool isOwn(QXmppCallStream *stream)
const;
83 bool videoSupported =
false;
84 QPointer<QXmppCallManager> manager;
89 GstElementPtr pipeline;
93 QList<QXmppCallStream *> streams;
98 QList<GstCodec> videoCodecs = {
99 GstCodec { .pt = 100, .name = u
"H264"_s, .channels = 1, .clockrate = 90000, .gstPay =
"rtph264pay"_L1, .gstDepay =
"rtph264depay"_L1, .gstEnc =
"x264enc"_L1, .gstDec =
"avdec_h264"_L1, .encProps = { {
"tune"_L1, 4 }, {
"speed-preset"_L1, 3 }, {
"byte-stream"_L1,
true }, {
"bitrate"_L1, 512 } } },
100 GstCodec { .pt = 99, .name = u
"VP8"_s, .channels = 1, .clockrate = 90000, .gstPay =
"rtpvp8pay"_L1, .gstDepay =
"rtpvp8depay"_L1, .gstEnc =
"vp8enc"_L1, .gstDec =
"vp8dec"_L1, .encProps = { {
"deadline"_L1, 20000 }, {
"target-bitrate"_L1, 512000 } } },
102 GstCodec { .pt = 102, .name = u
"HEVC"_s, .channels = 1, .clockrate = 90000, .gstPay =
"rtph265pay"_L1, .gstDepay =
"rtph265depay"_L1, .gstEnc =
"x265enc"_L1, .gstDec =
"avdec_h265"_L1, .encProps = { {
"tune"_L1, 4 }, {
"speed-preset"_L1, 3 }, {
"bitrate"_L1, 512 } } },
103 GstCodec { .pt = 101, .name = u
"VP9"_s, .channels = 1, .clockrate = 90000, .gstPay =
"rtpvp9pay"_L1, .gstDepay =
"rtpvp9depay"_L1, .gstEnc =
"vp9enc"_L1, .gstDec =
"vp9dec"_L1, .encProps = { {
"deadline"_L1, 20000 }, {
"target-bitrate"_L1, 512000 } } }
106 QList<GstCodec> audioCodecs = {
107 { .pt = 111, .name = u
"opus"_s, .channels = 2, .clockrate = 48000, .gstPay =
"rtpopuspay"_L1, .gstDepay =
"rtpopusdepay"_L1, .gstEnc =
"opusenc"_L1, .gstDec =
"opusdec"_L1, .encProps = { {
"inband-fec"_L1,
true }, {
"frame-size"_L1, 40 } } },
108 { .pt = 112, .name = u
"opus"_s, .channels = 1, .clockrate = 48000, .gstPay =
"rtpopuspay"_L1, .gstDepay =
"rtpopusdepay"_L1, .gstEnc =
"opusenc"_L1, .gstDec =
"opusdec"_L1, .encProps = { {
"inband-fec"_L1,
true }, {
"frame-size"_L1, 40 } } },
109 { .pt = 96, .name = u
"speex"_s, .channels = 1, .clockrate = 48000, .gstPay =
"rtpspeexpay"_L1, .gstDepay =
"rtpspeexdepay"_L1, .gstEnc =
"speexenc"_L1, .gstDec =
"speexdec"_L1, .encProps = {} },
110 { .pt = 97, .name = u
"speex"_s, .channels = 1, .clockrate = 44100, .gstPay =
"rtpspeexpay"_L1, .gstDepay =
"rtpspeexdepay"_L1, .gstEnc =
"speexenc"_L1, .gstDec =
"speexdec"_L1, .encProps = {} },
111 { .pt = 100, .name = u
"mpeg4-generic"_s, .channels = 2, .clockrate = 48000, .gstPay =
"rtpmp4apay"_L1, .gstDepay =
"rtpmp4adepay"_L1, .gstEnc =
"avenc_aac"_L1, .gstDec =
"avdec_aac"_L1, .encProps = {} },
112 { .pt = 101, .name = u
"mpeg4-generic"_s, .channels = 2, .clockrate = 44100, .gstPay =
"rtpmp4apay"_L1, .gstDepay =
"rtpmp4adepay"_L1, .gstEnc =
"avenc_aac"_L1, .gstDec =
"avdec_aac"_L1, .encProps = {} },
113 { .pt = 102, .name = u
"mpeg4-generic"_s, .channels = 1, .clockrate = 48000, .gstPay =
"rtpmp4apay"_L1, .gstDepay =
"rtpmp4adepay"_L1, .gstEnc =
"avenc_aac"_L1, .gstDec =
"avdec_aac"_L1, .encProps = {} },
114 { .pt = 103, .name = u
"mpeg4-generic"_s, .channels = 1, .clockrate = 44100, .gstPay =
"rtpmp4apay"_L1, .gstDepay =
"rtpmp4adepay"_L1, .gstEnc =
"avenc_aac"_L1, .gstDec =
"avdec_aac"_L1, .encProps = {} },
115 { .pt = 8, .name = u
"PCMA"_s, .channels = 1, .clockrate = 8000, .gstPay =
"rtppcmapay"_L1, .gstDepay =
"rtppcmadepay"_L1, .gstEnc =
"alawenc"_L1, .gstDec =
"alawdec"_L1, .encProps = {} },
116 { .pt = 0, .name = u
"PCMU"_s, .channels = 1, .clockrate = 8000, .gstPay =
"rtppcmupay"_L1, .gstDepay =
"rtppcmudepay"_L1, .gstEnc =
"mulawenc"_L1, .gstDec =
"mulawdec"_L1, .encProps = {} },
Definition QXmppCallStream.h:22
Direction
This enum is used to describe the direction of a call.
Definition QXmppCall.h:35
State
This enum is used to describe the state of a call.
Definition QXmppCall.h:42
@ ConnectingState
The call is being connected.
Definition QXmppCall.h:43
Action
This enum is used to describe a Jingle action.
Definition QXmppJingleData.h:442