kurento-client-core
Version:
JavaScript Client API for Kurento Media Server
708 lines (707 loc) • 94.3 kB
JSON
{
"name": "core",
"version": "7.3.0",
"kurentoVersion": "7.3.0",
"imports": [],
"code": {
"kmd": {
"java": {
"mavenGroupId": "org.kurento",
"mavenArtifactId": "kms-api-core",
"mavenVersion": "7.3.0"
}
},
"api": {
"java": {
"packageName": "org.kurento.client",
"mavenGroupId": "org.kurento",
"mavenArtifactId": "kurento-client",
"mavenVersion": "7.3.0"
},
"js": {
"nodeName": "kurento-client-core",
"npmDescription": "JavaScript Client API for Kurento Media Server",
"npmGit": "https://github.com/Kurento/kurento-client-core-js.git",
"npmVersion": "7.3.0"
}
},
"implementation": {
"cppNamespace": "kurento",
"lib": "libkmscore"
}
},
"remoteClasses": [
{
"name": "BaseRtpEndpoint",
"doc": "\nBase class for the implementation of RTP-based communication endpoints.\n<p>\n All endpoints that rely on the RTP protocol, like the\n :rom:cls:`RtpEndpoint` or the :rom:cls:`WebRtcEndpoint`, inherit\n from this class. This endpoint provides information about the Connection state\n and the Media state, which can be consulted at any time through the\n :rom:attr:`getMediaState` and the :rom:attr:`getConnectionState` methods. It\n is also possible subscribe to events fired when these properties change:\n</p>\n<ul>\n <li>\n <strong>:rom:evt:`ConnectionStateChanged`</strong>: This event is raised\n when the connection between two peers changes. It can have two values:\n <ul>\n <li>CONNECTED</li>\n <li>DISCONNECTED</li>\n </ul>\n </li>\n <li>\n <strong>:rom:evt:`MediaStateChanged`</strong>: This event provides\n information about the state of the underlying RTP session. Possible values\n are:\n <ul>\n <li>CONNECTED: There is an RTCP packet flow between peers.</li>\n <li>\n DISCONNECTED: Either no RTCP packets have been received yet, or the\n remote peer has ended the RTP session with a <code>BYE</code> message,\n or at least 5 seconds have elapsed since the last RTCP packet was\n received.\n </li>\n </ul>\n <p>\n The standard definition of RTP (<a\n href='https://tools.ietf.org/html/rfc3550'\n target='_blank'\n >RFC 3550</a\n >) describes a session as active whenever there is a maintained flow of\n RTCP control packets, regardless of whether there is actual media flowing\n through RTP data packets or not. The reasoning behind this is that, at any\n given moment, a participant of an RTP session might temporarily stop\n sending RTP data packets, but this wouldn't necessarily mean that the RTP\n session as a whole is finished; it maybe just means that the participant\n has some temporary issues but it will soon resume sending data. For this\n reason, that an RTP session has really finished is something that is\n considered only by the prolonged absence of RTCP control packets between\n participants.\n </p>\n <p>\n Since RTCP packets do not flow at a constant rate (for instance,\n minimizing a browser window with a WebRTC's\n <code>RTCPeerConnection</code> object might affect the sending interval),\n it is not possible to immediately detect their absence and assume that the\n RTP session has finished. Instead, there is a guard period of\n approximately <strong>5 seconds</strong> of missing RTCP packets before\n considering that the underlying RTP session is effectively finished, thus\n triggering a <code>MediaStateChangedEvent = DISCONNECTED</code> event.\n </p>\n <p>\n In other words, there is always a period during which there might be no\n media flowing, but this event hasn't been fired yet. Nevertheless, this is\n the most reliable and useful way of knowing what is the long-term, steady\n state of RTP media exchange.\n </p>\n <p>\n The :rom:evt:`ConnectionStateChanged` comes in contrast with more\n instantaneous events such as MediaElement's\n :rom:evt:`MediaFlowInStateChanged` and\n :rom:evt:`MediaFlowOutStateChanged`, which are triggered almost\n immediately after the RTP data packets stop flowing between RTP session\n participants. This makes the <em>MediaFlow</em> events a good way to know\n if participants are suffering from short-term intermittent connectivity\n issues, but they are not enough to know if the connectivity issues are\n just spurious network hiccups or are part of a more long-term\n disconnection problem.\n </p>\n </li>\n</ul>\n<h2>Bitrate management</h2>\n<p>\n <b>Bandwidth control</b> for the video component of the media session is done\n here.\n <strong>\n Note that the default <em>MaxVideoSendBandwidth</em> is a VERY conservative\n value, and leads to a low maximum video quality. Most applications will\n probably want to increase this to higher values such as 2000 kbps (2 Mbps).\n </strong>\n</p>\n<ul>\n <li>\n <b>Recv bandwidth</b>: Used to request a remote sender that its media\n bitrate is within the requested range.\n <ul>\n <li>\n <strong>MinVideoRecvBandwidth</strong>: Minimum inbound bitrate\n requested by this endpoint. Signaled to compatible WebRTC and RTP\n senders, as part of the REMB bandwidth estimation protocol.\n <ul>\n <li>Unit: kbps (kilobits per second).</li>\n <li>Default: 0.</li>\n <li>\n Note: The actual minimum value is 30 kbps, even if a lower value is\n set.\n </li>\n </ul>\n </li>\n <li>\n <strong>MaxAudioRecvBandwidth</strong> and\n <strong>MaxVideoRecvBandwidth</strong>: Maximum inbound bitrate\n requested by this endpoint. Signaled to compatible WebRTC and RTP\n senders as part of Kurento's REMB bandwidth estimations, and also as an\n SDP bitrate attribute (<code>b=AS:{value}</code>, see\n <a href='https://datatracker.ietf.org/doc/html/rfc8866#section-5.8'\n >RFC 8866 Section 5.8. Bandwidth Information</a\n >) in <i>sendrecv</i> and <i>recvonly</i> SDP Offers.\n <ul>\n <li>Unit: kbps (kilobits per second).</li>\n <li>Default: 0 (unlimited).</li>\n </ul>\n </li>\n </ul>\n </li>\n <li>\n <b>Send bandwidth</b>: Used to control bitrate of the outbound media stream\n sent to remote peers. It is important to keep in mind that outbound bitrate\n ultimately depends on network and remote peer capabilities.\n <ul>\n <li>\n <strong>MinVideoSendBandwidth</strong>: Minimum outbound bitrate sent by\n this endpoint.\n <ul>\n <li>Unit: kbps (kilobits per second).</li>\n <li>Default: 100.</li>\n <li>\n 0 = unlimited: the video bitrate will drop as needed, even to the\n lowest possible quality, which could make the video completely\n blurry and pixelated, but would adapt better to losses caused by\n network congestion.\n </li>\n </ul>\n </li>\n <li>\n <strong>MaxVideoSendBandwidth</strong>: Maximum outbound bitrate sent by\n this endpoint. Remote peers themselves might also announce a maximum\n bitrate as part of their REMB bandwidth estimations, and also as an SDP\n bitrate attribute (<code>b=AS:{value}</code>, see\n <a href='https://datatracker.ietf.org/doc/html/rfc8866#section-5.8'\n >RFC 8866 Section 5.8. Bandwidth Information</a\n >) in <i>sendrecv</i> and <i>recvonly</i> SDP Offers or Answers. Kurento\n will always give priority to bitrate limitations specified by remote\n peers, over internal configurations.\n <ul>\n <li>Unit: kbps (kilobits per second).</li>\n <li>Default: 500.</li>\n <li>\n 0 = unlimited: the video bitrate will grow until all the available\n network bandwidth is used by the stream.<br />\n Note that this might have a bad effect if more than one stream is\n running (as all of them would try to raise the video bitrate\n indefinitely, until the network gets saturated).\n </li>\n </ul>\n </li>\n <li>\n <strong>RembParams.rembOnConnect</strong>: Initial local REMB bandwidth\n estimation that gets used when a new endpoint is connected. Only useful\n for connections that are compatible with the REMB bandwidth estimation\n protocol (such as most WebRTC peers).\n </li>\n </ul>\n </li>\n</ul>\n<p>\n <strong>\n All bandwidth control parameters must be set before the SDP negotiation\n takes place, and can't be modified afterwards.\n </strong>\n</p>\n<p>\n Take into consideration that setting a too high upper limit for the output\n bandwidth can be a reason for the network connection to be congested quickly.\n</p>\n ",
"abstract": true,
"extends": "SdpEndpoint",
"properties": [
{
"name": "minVideoRecvBandwidth",
"doc": "\nMinimum inbound bitrate requested by this endpoint. Signaled to compatible\nWebRTC and RTP senders, as part of the REMB bandwidth estimation protocol.\n<p>\n This is used to set a minimum value of local REMB during bandwidth estimation.\n The REMB estimation will then be sent to remote peers, causing them to send\n at least the indicated video bitrate. It follows that this parameter will only\n have effect for remote peers that support the REMB bandwidth estimation\n protocol (such as e.g. most web browsers compatible with WebRTC).\n</p>\n<ul>\n <li>Unit: kbps (kilobits per second).</li>\n <li>Default: 0.</li>\n <li>\n Note: The actual minimum value is 30 kbps, even if a lower value is set.\n </li>\n</ul>\n ",
"type": "int"
},
{
"name": "minVideoSendBandwidth",
"doc": "\nMinimum outbound bitrate sent by this endpoint.\n<p>\n With this parameter you can control the minimum video quality that will be\n sent when reacting to bad network conditions. Setting this parameter to a low\n value permits the video quality to drop when the network conditions get worse.\n</p>\n<p>\n Note that if you set this parameter too high (trying to avoid bad video\n quality altogether), you would be limiting the adaptation ability of the\n congestion control algorithm, and your stream might be unable to ever recover\n from adverse network conditions.\n</p>\n<ul>\n <li>Unit: kbps (kilobits per second).</li>\n <li>Default: 100.</li>\n <li>\n 0 = unlimited: the video bitrate will drop as needed, even to the lowest\n possible quality, which could make the video completely blurry and\n pixelated, but would adapt better to losses caused by network congestion.\n </li>\n</ul>\n ",
"type": "int"
},
{
"name": "maxVideoSendBandwidth",
"doc": "\nMaximum outbound bitrate sent by this endpoint. Remote peers themselves might\nalso announce a maximum bitrate as part of their REMB bandwidth estimations, and\nalso as an SDP bitrate attribute (<code>b=AS:{value}</code>, see\n<a href='https://datatracker.ietf.org/doc/html/rfc8866#section-5.8'\n >RFC 8866 Section 5.8. Bandwidth Information</a\n>) in <i>sendrecv</i> and <i>recvonly</i> SDP Offers or Answers. Kurento will\nalways give priority to bitrate limitations specified by remote peers, over\ninternal configurations.\n<p>\n With this parameter you can control the maximum video quality that will be\n sent when reacting to good network conditions. Setting this parameter to a\n high value permits the video quality to raise when the network conditions get\n better.\n</p>\n<p>\n <strong>\n Note that the default <em>MaxVideoSendBandwidth</em> is a VERY conservative\n value, and leads to a low maximum video quality. Most applications will\n probably want to increase this to higher values such as 2000 kbps (2 Mbps).\n </strong>\n</p>\n<p>\n The REMB congestion control algorithm works by gradually increasing the output\n video bitrate, until the available bandwidth is fully used or the maximum send\n bitrate has been reached. This is a slow, progressive change, which starts at\n 300 kbps by default. You can change the default starting point of REMB\n estimations, by setting <code>RembParams.rembOnConnect</code>.\n</p>\n<ul>\n <li>Unit: kbps (kilobits per second).</li>\n <li>Default: 500.</li>\n <li>\n 0 = unlimited: the video bitrate will grow until all the available network\n bandwidth is used by the stream.<br />\n Note that this might have a bad effect if more than one stream is running\n (as all of them would try to raise the video bitrate indefinitely, until the\n network gets saturated).\n </li>\n</ul>\n ",
"type": "int"
},
{
"name": "mediaState",
"doc": "Media flow state.\n<ul>\n <li>CONNECTED: There is an RTCP flow.</li>\n <li>DISCONNECTED: No RTCP packets have been received for at least 5 sec.</li>\n</ul>\n ",
"type": "MediaState",
"readOnly": true
},
{
"name": "connectionState",
"doc": "Connection state.\n<ul>\n <li>CONNECTED</li>\n <li>DISCONNECTED</li>\n</ul>\n ",
"type": "ConnectionState",
"readOnly": true
},
{
"name": "mtu",
"doc": "Maximum Transmission Unit (MTU) used for RTP.\n<p>\n This setting affects the maximum size that will be used by RTP payloads. You\n can change it from the default, if you think that a different value would be\n beneficial for the typical network settings of your application.\n</p>\n<p>\n The default value is 1200 Bytes. This is the same as in <b>libwebrtc</b> (from\n webrtc.org), as used by\n <a\n href='https://dxr.mozilla.org/mozilla-central/rev/b5c5ba07d3dbd0d07b66fa42a103f4df2c27d3a2/media/webrtc/trunk/webrtc/media/engine/constants.cc#16'\n >Firefox</a\n >\n or\n <a\n href='https://source.chromium.org/chromium/external/webrtc/src/+/6dd488b2e55125644263e4837f1abd950d5e410d:media/engine/constants.cc;l=15'\n >Chrome</a\n >\n . You can read more about this value in\n <a\n href='https://groups.google.com/d/topic/discuss-webrtc/gH5ysR3SoZI/discussion'\n >Why RTP max packet size is 1200 in WebRTC?</a\n >\n .\n</p>\n<p>\n <b>WARNING</b>: Change this value ONLY if you really know what you are doing\n and you have strong reasons to do so. Do NOT change this parameter just\n because it <i>seems</i> to work better for some reduced scope tests. The\n default value is a consensus chosen by people who have deep knowledge about\n network optimization.\n</p>\n<ul>\n <li>Unit: Bytes.</li>\n <li>Default: 1200.</li>\n</ul>\n ",
"type": "int"
},
{
"name": "rembParams",
"doc": "Advanced parameters to configure the congestion control algorithm.",
"type": "RembParams"
}
],
"methods": [
{
"params": [],
"name": "requestKeyframe",
"doc": "\nForce sending a new keyframe request to the upstream elements in the Kurento\nPipeline, towards the associated producer. Only valid for video consumers.\n "
}
],
"events": [
"MediaStateChanged",
"ConnectionStateChanged"
]
},
{
"name": "Endpoint",
"doc": "Base interface for all end points.\n<p>\n An Endpoint is a :rom:cls:`MediaElement` that allows Kurento to exchange\n media contents with external systems, supporting different transport protocols\n and mechanisms, such as RTP, WebRTC, HTTP(s), ``file://`` URLs, etc.\n</p>\n<p>\n An ``Endpoint`` may contain both sources and sinks for different media types,\n to provide bidirectional communication.\n</p>\n ",
"abstract": true,
"extends": "MediaElement"
},
{
"name": "Filter",
"doc": "Base interface for all filters.\n<p>\n This is a certain type of :rom:cls:`MediaElement`, that processes media\n injected through its sinks, and delivers the outcome through its sources.\n</p>\n ",
"abstract": true,
"extends": "MediaElement"
},
{
"name": "Hub",
"doc": "A Hub is a routing :rom:cls:`MediaObject`.\nIt connects several :rom:cls:`endpoints <Endpoint>` together\n ",
"abstract": true,
"extends": "MediaObject",
"methods": [
{
"params": [
{
"name": "details",
"doc": "Details of graph",
"type": "GstreamerDotDetails",
"optional": true
}
],
"return": {
"type": "String",
"doc": "The dot graph."
},
"name": "getGstreamerDot",
"doc": "Returns a string in dot (graphviz) format that represents the gstreamer elements inside the pipeline"
},
{
"params": [
{
"name": "details",
"doc": "Details of graph",
"type": "GstreamerDotDetails",
"optional": true
}
],
"name": "dumpGstreamerDot",
"doc": "If GST_DEBUG_DUMP_DOT_DIR environment variable is defined dumps in that directoy a file with the GStreamer dot of the Hub.\n <p>The element can be queried for certain type of data:</p>\n<ul>\n <li>SHOW_ALL: default value</li>\n <li>SHOW_CAPS_DETAILS</li>\n <li>SHOW_FULL_PARAMS</li>\n <li>SHOW_MEDIA_TYPE</li>\n <li>SHOW_NON_DEFAULT_PARAMS</li>\n <li>SHOW_STATES</li>\n <li>SHOW_VERBOSE</li>\n</ul>\n "
}
]
},
{
"name": "HubPort",
"doc": "This :rom:cls:`MediaElement` specifies a connection with a :rom:cls:`Hub`",
"extends": "MediaElement",
"constructor": {
"params": [
{
"name": "hub",
"doc": ":rom:cls:`Hub` to which this port belongs",
"type": "Hub"
}
],
"doc": "Creates a :rom:cls:`HubPort` for the given :rom:cls:`Hub`"
}
},
{
"name": "MediaElement",
"doc": "The basic building block of the media server, that can be interconnected inside a pipeline.\n<p>\n A :rom:cls:`MediaElement` is a module that encapsulates a specific media\n capability, and that is able to exchange media with other MediaElements\n through an internal element called <b>pad</b>.\n</p>\n<p>\n A pad can be defined as an input or output interface. Input pads are called\n sinks, and it's where the media elements receive media from other media\n elements. Output interfaces are called sources, and it's the pad used by the\n media element to feed media to other media elements. There can be only one\n sink pad per media element. On the other hand, the number of source pads is\n unconstrained. This means that a certain media element can receive media only\n from one element at a time, while it can send media to many others. Pads are\n created on demand, when the connect method is invoked. When two media elements\n are connected, one media pad is created for each type of media connected. For\n example, if you connect AUDIO and VIDEO between two media elements, each one\n will need to create two new pads: one for AUDIO and one for VIDEO.\n</p>\n<p>\n When media elements are connected, it can be the case that the encoding\n required in both input and output pads is not the same, and thus it needs to\n be transcoded. This is something that is handled transparently by the\n MediaElement internals, but such transcoding has a toll in the form of a\n higher CPU load, so connecting MediaElements that need media encoded in\n different formats is something to consider as a high load operation. The event\n `MediaTranscodingStateChanged` allows to inform the client application of\n whether media transcoding is being enabled or not inside any MediaElement\n object.\n</p>\n ",
"abstract": true,
"extends": "MediaObject",
"properties": [
{
"name": "encoderBitrate",
"doc": "Target video bitrate for media transcoding.\n<p>\n The bitrate of a video has a direct impact on its perceived image quality.\n Higher bitrate means higher quality, but also a larger amount of bytes to\n transmit or store. Use this parameter to set the desired average bitrate in\n videos that are transcoded by the media server.\n</p>\n<p>\n This parameter is most useful for :rom:cls:`RecorderEndpoint` and\n :rom:cls:`RtpEndpoint`: when media is being transcoded (either for streaming\n or storing on disk), the resulting quality is directly controlled with this\n value.\n</p>\n<p>\n For :rom:cls:`WebRtcEndpoint`, this value should be left as default, as remote\n WebRTC receivers will already send feedback to inform the media server about\n what is the optimal bitrate to send.\n</p>\n<p>\n Setting a value will only work if done before the media starts to flow.\n</p>\n<ul>\n <li>Unit: bps (bits per second).</li>\n <li>Default: 300000 (300 kbps).</li>\n</ul>\n ",
"type": "int"
},
{
"name": "minEncoderBitrate",
"doc": "Minimum video bitrate for media transcoding.\n<p>\n This parameter can be used to fine tune the automatic bitrate selection that\n normally takes place within elements that are able to dynamically change the\n encoding bitrate according to the conditions of the streaming, such as\n :rom:cls:`WebRtcEndpoint`.\n</p>\n<p>\n This should be left as default in most cases, given that remote WebRTC\n receivers already send feedback to inform the media server about what is the\n optimal bitrate to send. Otherwise, this parameter could be used for example\n to force a higher bitrate than what is being requested by receivers.\n</p>\n<p>\n Setting a value will only work if done before the media starts to flow.\n</p>\n<ul>\n <li>Unit: bps (bits per second).</li>\n <li>Default: 0.</li>\n</ul>\n ",
"type": "int"
},
{
"name": "maxEncoderBitrate",
"doc": "Maximum video bitrate for media transcoding.\n<p>\n This parameter can be used to fine tune the automatic bitrate selection that\n normally takes place within elements that are able to dynamically change the\n encoding bitrate according to the conditions of the streaming, such as\n :rom:cls:`WebRtcEndpoint`.\n</p>\n<p>\n This should be left as default in most cases, given that remote WebRTC\n receivers already send feedback to inform the media server about what is the\n optimal bitrate to send. Otherwise, this parameter could be used for example\n to limit the total bitrate that is handled by the server, by setting a low\n maximum output for all endpoints.\n</p>\n<p>\n This should be left as default in most cases, given that remote WebRTC\n receivers already send feedback to inform the media server about what is the\n optimal bitrate to send. Otherwise, this parameter could be used for example\n to limit the total bitrate that is handled by the server, by setting a low\n maximum output for all endpoints.\n</p>\n<p>\n Setting a value will only work if done before the media starts to flow.\n</p>\n<ul>\n <li>Unit: bps (bits per second).</li>\n <li>Default: 0.</li>\n <li>\n 0 = unlimited. Encoding performed with bitrate as requested by receivers.\n </li>\n</ul>\n ",
"type": "int"
}
],
"methods": [
{
"params": [
{
"name": "mediaType",
"doc": "One of :rom:attr:`MediaType.AUDIO`, :rom:attr:`MediaType.VIDEO` or :rom:attr:`MediaType.DATA`",
"type": "MediaType",
"optional": true
},
{
"name": "description",
"doc": "A textual description of the media source. Currently not used, aimed mainly for :rom:attr:`MediaType.DATA` sources",
"type": "String",
"optional": true
}
],
"return": {
"type": "ElementConnectionData[]",
"doc": "A list of the connections information that are sending media to this element. The list will be empty if no sources are found."
},
"name": "getSourceConnections",
"doc": "Gets information about the sink pads of this media element.\n<p>\n Since sink pads are the interface through which a media element gets it's\n media, whatever is connected to an element's sink pad is formally a source of\n media. Media can be filtered by type, or by the description given to the pad\n though which both elements are connected.\n</p>\n "
},
{
"params": [
{
"name": "mediaType",
"doc": "One of :rom:attr:`MediaType.AUDIO`, :rom:attr:`MediaType.VIDEO` or :rom:attr:`MediaType.DATA`",
"type": "MediaType",
"optional": true
},
{
"name": "description",
"doc": "A textual description of the media source. Currently not used, aimed mainly for :rom:attr:`MediaType.DATA` sources",
"type": "String",
"optional": true
}
],
"return": {
"type": "ElementConnectionData[]",
"doc": "A list of the connections information that are receiving media from this element. The list will be empty if no sources are found."
},
"name": "getSinkConnections",
"doc": "Gets information about the source pads of this media element.\n<p>\n Since source pads connect to other media element's sinks, this is formally the\n sink of media from the element's perspective. Media can be filtered by type,\n or by the description given to the pad though which both elements are\n connected.\n</p>\n "
},
{
"params": [
{
"name": "sink",
"doc": "the target :rom:cls:`MediaElement` that will receive media",
"type": "MediaElement"
},
{
"name": "mediaType",
"doc": "the :rom:enum:`MediaType` of the pads that will be connected",
"type": "MediaType",
"optional": true
},
{
"name": "sourceMediaDescription",
"doc": "A textual description of the media source. Currently not used, aimed mainly for :rom:attr:`MediaType.DATA` sources",
"type": "String",
"optional": true
},
{
"name": "sinkMediaDescription",
"doc": "A textual description of the media source. Currently not used, aimed mainly for :rom:attr:`MediaType.DATA` sources",
"type": "String",
"optional": true
}
],
"name": "connect",
"doc": "Connects two elements, with the media flowing from left to right.\n<p>\n The element that invokes the connect will be the source of media, creating one\n sink pad for each type of media connected. The element given as parameter to\n the method will be the sink, and it will create one sink pad per media type\n connected.\n</p>\n<p>\n If otherwise not specified, all types of media are connected by default\n (AUDIO, VIDEO and DATA). It is recommended to connect the specific types of\n media if not all of them will be used. For this purpose, the connect method\n can be invoked more than once on the same two elements, but with different\n media types.\n</p>\n<p>\n The connection is unidirectional. If a bidirectional connection is desired,\n the position of the media elements must be inverted. For instance,\n webrtc1.connect(webrtc2) is connecting webrtc1 as source of webrtc2. In order\n to create a WebRTC one-2one conversation, the user would need to specify the\n connection on the other direction with webrtc2.connect(webrtc1).\n</p>\n<p>\n Even though one media element can have one sink pad per type of media, only\n one media element can be connected to another at a given time. If a media\n element is connected to another, the former will become the source of the sink\n media element, regardless whether there was another element connected or not.\n</p>\n "
},
{
"params": [
{
"name": "sink",
"doc": "the target :rom:cls:`MediaElement` that will stop receiving media",
"type": "MediaElement"
},
{
"name": "mediaType",
"doc": "the :rom:enum:`MediaType` of the pads that will be connected",
"type": "MediaType",
"optional": true
},
{
"name": "sourceMediaDescription",
"doc": "A textual description of the media source. Currently not used, aimed mainly for :rom:attr:`MediaType.DATA` sources",
"type": "String",
"optional": true
},
{
"name": "sinkMediaDescription",
"doc": "A textual description of the media source. Currently not used, aimed mainly for :rom:attr:`MediaType.DATA` sources",
"type": "String",
"optional": true
}
],
"name": "disconnect",
"doc": "Disconnects two media elements. This will release the source pads of the source media element, and the sink pads of the sink media element."
},
{
"params": [
{
"name": "caps",
"doc": "The format for the stream of audio",
"type": "AudioCaps"
}
],
"name": "setAudioFormat",
"doc": "Set the type of data for the audio stream.\n<p>\n MediaElements that do not support configuration of audio capabilities will\n throw a MEDIA_OBJECT_ILLEGAL_PARAM_ERROR exception.\n</p>\n<p>\n NOTE: This method is not implemented yet by the Media Server to do anything\n useful.\n</p>\n "
},
{
"params": [
{
"name": "caps",
"doc": "The format for the stream of video",
"type": "VideoCaps"
}
],
"name": "setVideoFormat",
"doc": "Set the type of data for the video stream.\n<p>\n MediaElements that do not support configuration of video capabilities will\n throw a MEDIA_OBJECT_ILLEGAL_PARAM_ERROR exception\n</p>\n<p>\n NOTE: This method is not implemented yet by the Media Server to do anything\n useful.\n</p>\n "
},
{
"params": [
{
"name": "details",
"doc": "Details of graph",
"type": "GstreamerDotDetails",
"optional": true
}
],
"name": "dumpGstreamerDot",
"doc": "If GST_DEBUG_DUMP_DOT_DIR environment variable is defined dumps in that directoy a file with the GStreamer dot of the Media Element.\n <p>The element can be queried for certain type of data:</p>\n<ul>\n <li>SHOW_ALL: default value</li>\n <li>SHOW_CAPS_DETAILS</li>\n <li>SHOW_FULL_PARAMS</li>\n <li>SHOW_MEDIA_TYPE</li>\n <li>SHOW_NON_DEFAULT_PARAMS</li>\n <li>SHOW_STATES</li>\n <li>SHOW_VERBOSE</li>\n</ul>\n "
},
{
"params": [
{
"name": "details",
"doc": "Details of graph",
"type": "GstreamerDotDetails",
"optional": true
}
],
"return": {
"type": "String",
"doc": "The dot graph."
},
"name": "getGstreamerDot",
"doc": "Return a .dot file describing the topology of the media element.\n<p>The element can be queried for certain type of data:</p>\n<ul>\n <li>SHOW_ALL: default value</li>\n <li>SHOW_CAPS_DETAILS</li>\n <li>SHOW_FULL_PARAMS</li>\n <li>SHOW_MEDIA_TYPE</li>\n <li>SHOW_NON_DEFAULT_PARAMS</li>\n <li>SHOW_STATES</li>\n <li>SHOW_VERBOSE</li>\n</ul>\n "
},
{
"params": [
{
"name": "mediaType",
"doc": "One of :rom:attr:`MediaType.AUDIO` or :rom:attr:`MediaType.VIDEO`",
"type": "MediaType",
"optional": true
}
],
"return": {
"type": "Stats<>",
"doc": "Delivers a successful result in the form of a RTC stats report. A RTC stats report represents a map between strings, identifying the inspected objects (RTCStats.id), and their corresponding RTCStats objects."
},
"name": "getStats",
"doc": "Gets the statistics related to an endpoint. If no media type is specified, it returns statistics for all available types."
},
{
"params": [
{
"name": "mediaType",
"doc": "One of :rom:attr:`MediaType.AUDIO` or :rom:attr:`MediaType.VIDEO`",
"type": "MediaType"
},
{
"name": "sinkMediaDescription",
"doc": "Description of the sink",
"type": "String",
"optional": true,
"defaultValue": "default"
}
],
"return": {
"type": "boolean",
"doc": "TRUE if there is media, FALSE in other case."
},
"name": "isMediaFlowingIn",
"doc": "This method indicates whether the media element is receiving media of a certain type. The media sink pad can be identified individually, if needed. It is only supported for AUDIO and VIDEO types, raising a MEDIA_OBJECT_ILLEGAL_PARAM_ERROR otherwise. If the pad indicated does not exist, if will return false."
},
{
"params": [
{
"name": "mediaType",
"doc": "One of :rom:attr:`MediaType.AUDIO` or :rom:attr:`MediaType.VIDEO`",
"type": "MediaType"
},
{
"name": "sourceMediaDescription",
"doc": "Description of the source",
"type": "String",
"optional": true,
"defaultValue": "default"
}
],
"return": {
"type": "boolean",
"doc": "TRUE if there is media, FALSE in other case."
},
"name": "isMediaFlowingOut",
"doc": "This method indicates whether the media element is emitting media of a certain type. The media source pad can be identified individually, if needed. It is only supported for AUDIO and VIDEO types, raising a MEDIA_OBJECT_ILLEGAL_PARAM_ERROR otherwise. If the pad indicated does not exist, if will return false."
},
{
"params": [
{
"name": "mediaType",
"doc": "One of :rom:attr:`MediaType.AUDIO` or :rom:attr:`MediaType.VIDEO`",
"type": "MediaType"
},
{
"name": "binName",
"doc": "Internal name of the processing bin, as previously given by ``MediaTranscodingStateChanged``.",
"type": "String",
"optional": true,
"defaultValue": "default"
}
],
"return": {
"type": "boolean",
"doc": "TRUE if media is being transcoded, FALSE otherwise."
},
"name": "isMediaTranscoding",
"doc": "Indicates whether this media element is actively transcoding between input and output pads. This operation is only supported for AUDIO and VIDEO media types, raising a MEDIA_OBJECT_ILLEGAL_PARAM_ERROR otherwise.\n The internal GStreamer processing bin can be indicated, if needed; if the bin doesn't exist, the return value will be FALSE."
}
],
"events": [
"ElementConnected",
"ElementDisconnected",
"MediaFlowOutStateChanged",
"MediaFlowInStateChanged",
"MediaTranscodingStateChanged"
]
},
{
"name": "MediaObject",
"doc": "Base interface used to manage capabilities common to all Kurento elements.\n<h2>Properties</h2>\n<ul>\n <li>\n <b>id</b>: unique identifier assigned to this <code>MediaObject</code> at\n instantiation time. :rom:cls:`MediaPipeline` IDs are generated with a GUID\n followed by suffix <code>_kurento.MediaPipeline</code>.\n :rom:cls:`MediaElement` IDs are also a GUID with suffix\n <code>_kurento.{ElementType}</code> and prefixed by parent's ID.\n <blockquote>\n <dl>\n <dt><i>MediaPipeline ID example</i></dt>\n <dd>\n <code>\n 907cac3a-809a-4bbe-a93e-ae7e944c5cae_kurento.MediaPipeline\n </code>\n </dd>\n <dt><i>MediaElement ID example</i></dt>\n <dd>\n <code>\n 907cac3a-809a-4bbe-a93e-ae7e944c5cae_kurento.MediaPipeline/403da25a-805b-4cf1-8c55-f190588e6c9b_kurento.WebRtcEndpoint\n </code>\n </dd>\n </dl>\n </blockquote>\n </li>\n <li>\n <b>name</b>: free text intended to provide a friendly name for this\n <code>MediaObject</code>. Its default value is the same as the ID.\n </li>\n <li>\n <b>tags</b>: key-value pairs intended for applications to associate metadata\n to this <code>MediaObject</code> instance.\n </li>\n</ul>\n<br />\n<br />\n<h2>Events</h2>\n<ul>\n <li>\n <strong>:rom:evt:`Error`</strong>: reports asynchronous error events. It is recommended to\n always subscribe a listener to this event, as regular error from the\n pipeline will be notified through it, instead of through an exception when\n invoking a method.\n </li>\n</ul>\n ",
"abstract": true,
"properties": [
{
"name": "mediaPipeline",
"doc": ":rom:cls:`MediaPipeline` to which this <code>MediaObject</code> belongs. It returns itself when invoked for a pipeline object.",
"type": "MediaPipeline",
"final": true
},
{
"name": "parent",
"doc": "Parent of this <code>MediaObject</code>.\n<p>\n The parent of a :rom:cls:`Hub` or a :rom:cls:`MediaElement` is its\n :rom:cls:`MediaPipeline`. A :rom:cls:`MediaPipeline` has no parent, so this\n property will be null.\n</p>\n ",
"type": "MediaObject",
"final": true
},
{
"name": "id",
"doc": "Unique identifier of this <code>MediaObject</code>.\n<p>\n It's a synthetic identifier composed by a GUID and\n <code>MediaObject</code> type. The ID is prefixed with the parent ID when the\n object has parent: <i>ID_parent/ID_media-object</i>.\n</p>\n ",
"type": "String",
"final": true
},
{
"name": "children",
"doc": "Children of this <code>MediaObject</code>.",
"type": "MediaObject[]",
"readOnly": true
},
{
"name": "name",
"doc": "This <code>MediaObject</code>'s name.\n<p>\n This is just sugar to simplify developers' life debugging, it is not used\n internally for indexing nor identifying the objects. By default, it's the\n object's ID.\n</p>\n ",
"type": "String"
},
{
"name": "sendTagsInEvents",
"doc": "Flag activating or deactivating sending the element's tags in fired events.",
"type": "boolean"
},
{
"name": "creationTime",
"doc": "<code>MediaObject</code> creation time in seconds since Epoch.",
"type": "int",
"final": true
}
],
"methods": [
{
"params": [
{
"name": "key",
"doc": "Tag name.",
"type": "String"
},
{
"name": "value",
"doc": "Value associated to this tag.",
"type": "String"
}
],
"name": "addTag",
"doc": "Adds a new tag to this <code>MediaObject</code>.\nIf the tag is already present, it changes the value.\n "
},
{
"params": [
{
"name": "key",
"doc": "Tag name to be removed",
"type": "String"
}
],
"name": "removeTag",
"doc": "Removes an existing tag.\nExists silently with no error if tag is not defined.\n "
},
{
"params": [
{
"name": "key",
"doc": "Tag key.",
"type": "String"
}
],
"return": {
"type": "String",
"doc": "The value associated to the given key."
},
"name": "getTag",
"doc": "Returns the value of given tag, or MEDIA_OBJECT_TAG_KEY_NOT_FOUND if tag is not defined."
},
{
"params": [],
"return": {
"type": "Tag[]",
"doc": "An array containing all key-value pairs associated with this <code>MediaObject</code>."
},
"name": "getTags",
"doc": "Returns all tags attached to this <code>MediaObject</code>."
}
],
"events": [
"Error"
]
},
{
"name": "MediaPipeline",
"doc": "A pipeline is a container for a collection of :rom:cls:`MediaElements<MediaElement>`.\nIt offers the methods needed to control the creation and connection of elements inside a certain pipeline.\n ",
"extends": "MediaObject",
"constructor": {
"params": [],
"doc": "Create a :rom:cls:`MediaPipeline`"
},
"properties": [
{
"name": "latencyStats",
"doc": "If statistics about pipeline latency are enabled for all mediaElements",
"type": "boolean"
}
],
"methods": [
{
"params": [
{
"name": "details",
"doc": "Details of graph",
"type": "GstreamerDotDetails",
"optional": true
}
],
"return": {
"type": "String",
"doc": "The dot graph."
},
"name": "getGstreamerDot",
"doc": "Returns a string in dot (graphviz) format that represents the gstreamer elements inside the pipeline"
},
{
"params": [
{
"name": "details",
"doc": "Details of graph",
"type": "GstreamerDotDetails",
"optional": true
}
],
"name": "dumpGstreamerDot",
"doc": "If GST_DEBUG_DUMP_DOT_DIR environment variable is defined dumps in that directoy a file with the GStreamer dot of the pipeline"
}
]
},
{
"name": "PassThrough",
"doc": "This :rom:cls:`MediaElement` that just passes media through",
"extends": "MediaElement",
"constructor": {
"params": [
{
"name": "mediaPipeline",
"doc": "the :rom:cls:`MediaPipeline` to which the element belongs",
"type": "MediaPipeline"
}
],
"doc": "Builder for the :rom:cls:`PassThrough`"
}
},
{
"name": "SdpEndpoint",
"doc": "Interface implemented by Endpoints that require an SDP Offer/Answer negotiation in order to configure a media session.\n<p>Functionality provided by this API:</p>\n<ul>\n <li>Generate SDP offers.</li>\n <li>Process SDP offers.</li>\n <li>Configure SDP related params.</li>\n</ul>\n ",
"abstract": true,
"extends": "SessionEndpoint",
"properties": [
{
"name": "maxAudioRecvBandwidth",
"doc": "\nMaximum inbound bitrate requested by this endpoint. Signaled to compatible\nWebRTC and RTP senders as part of Kurento's REMB bandwidth estimations, and also\nas an SDP bitrate attribute (<code>b=AS:{value}</code>, see\n<a href='https://datatracker.ietf.org/doc/html/rfc8866#section-5.8'\n >RFC 8866 Section 5.8. Bandwidth Information</a\n>) in <i>sendrecv</i> and <i>recvonly</i> SDP Offers.\n<ul>\n <li>Unit: kbps (kilobits per second).</li>\n <li>Default: 0 (unlimited).</li>\n</ul>\n ",
"type": "int"
},
{
"name": "maxVideoRecvBandwidth",
"doc": "\nMaximum inbound bitrate requested by this endpoint. Signaled to compatible\nWebRTC and RTP senders as part of Kurento's REMB bandwidth estimations, and also\nas an SDP bitrate attribute (<code>b=AS:{value}</code>, see\n<a href='https://datatracker.ietf.org/doc/html/rfc8866#section-5.8'\n >RFC 8866 Section 5.8. Bandwidth Information</a\n>) in <i>sendrecv</i> and <i>recvonly</i> SDP Offers.\n<ul>\n <li>Unit: kbps (kilobits per second).</li>\n <li>Default: 0 (unlimited).</li>\n</ul>\n ",
"type": "int"
}
],
"methods": [
{
"params": [
{
"name": "options",
"doc": "An <code>OfferOptions</code> providing options requested for the offer.",
"type": "OfferOptions",
"optional": true
}
],
"return": {
"type": "String",
"doc": "The SDP offer."
},
"name": "generateOffer",
"doc": "Generates an SDP offer with media capabilities of the Endpoint.\nThrows:\n<ul>\n <li>\n SDP_END_POINT_ALREADY_NEGOTIATED If the endpoint is already negotiated.\n </li>\n <li>\n SDP_END_POINT_GENERATE_OFFER_ERROR if the generated offer is empty. This is\n most likely due to an internal error.\n </li>\n</ul>\n "
},
{
"params": [
{
"name": "offer",
"doc": "SessionSpec offer from the remote User Agent",
"type": "String"
}
],
"return": {
"type": "String",
"doc": "The chosen configuration from the ones stated in the SDP offer."
},
"name": "processOffer",
"doc": "Processes SDP offer of the remote peer, and generates an SDP answer based on the endpoint's capabilities.\n<p>\n If no matching capabilities are found, the SDP will contain no codecs.\n</p>\nThrows:\n<ul>\n <li>\n SDP_PARSE_ERROR If the offer is empty or has errors.\n </li>\n <li>\n SDP_END_POINT_ALREADY_NEGOTIATED If the endpoint is already negotiated.\n </li>\n <li>\n SDP_END_POINT_PROCESS_OFFER_ERROR if the generated offer is empty. This is\n most likely due to an internal error.\n </li>\n</ul>\n "
},
{
"params": [
{
"name": "answer",
"doc": "SessionSpec answer from the remote User Agent",
"type": "String"
}
],
"return": {
"type": "String",
"doc": "Updated SDP offer, based on the answer received."
},
"name": "processAnswer",
"doc": "Generates an SDP offer with media capabilities of the Endpoint.\nThrows:\n<ul>\n <li>\n SDP_PARSE_ERROR If the offer is empty or has errors.\n </li>\n <li>\n SDP_END_POINT_ALREADY_NEGOTIATED If the endpoint is already negotiated.\n </li>\n <li>\n SDP_END_POINT_PROCESS_ANSWER_ERROR if the result of processing the answer is\n an empty string. This is most likely due to an internal error.\n </li>\n <li>\n SDP_END_POINT_NOT_OFFER_GENERATED If the method is invoked before the\n generateOffer method.\n </li>\n</ul>\n "
},
{
"params": [],
"return": {
"type": "String",
"doc": "The last agreed SessionSpec."
},
"name": "getLocalSessionDescriptor",
"doc": "Returns the local SDP.\n<ul>\n <li>\n No offer has been generated: returns null.\n </li>\n <li>\n Offer has been generated: returns the SDP offer.\n </li>\n <li>\n Offer has been generated and answer processed: returns the agreed SDP.\n </li>\n</ul>\n "
},
{
"params": [],
"return": {
"type": "String",
"doc": "The last agreed User Agent session description."
},
"name": "getRemoteSessionDescriptor",
"doc": "This method returns the remote SDP.\nIf the negotiation process is not complete, it will return NULL.\n "
}
]
},
{
"name": "ServerManager",
"doc": "This is a standalone object for managing the MediaServer",
"abstract": true,
"extends": "MediaObject",
"properties": [
{
"name": "info",
"doc": "Server information, version, modules, factories, etc",
"type": "ServerInfo",
"readOnly": true
},
{
"name": "pipelines",
"doc": "All the pipelines available in the server",
"type": "MediaPipeline[]",
"readOnly": true
},
{
"name": "sessions",
"doc": "All active sessions in the server",
"type": "String[]",
"readOnly": true
},
{
"name": "metadata",
"doc": "Metadata stored in the server",
"type": "String",
"readOnly": true
}
],
"methods": [
{
"params": [
{
"name": "moduleName",
"doc": "Name of the module to get its kmd file",
"type": "String"
}
],
"return": {