| 1 |
public abstract class Xmpp.Xep.JingleRtp.Stream : Object { |
| 2 |
public Jingle.Content content { get; protected set; } |
| 3 |
|
| 4 |
public string name { get { |
| 5 |
return content.content_name; |
| 6 |
}} |
| 7 |
public string? media { get { |
| 8 |
var content_params = content.content_params; |
| 9 |
if (content_params is Parameters) { |
| 10 |
return ((Parameters)content_params).media; |
| 11 |
} |
| 12 |
return null; |
| 13 |
}} |
| 14 |
public JingleRtp.PayloadType? payload_type { get { |
| 15 |
var content_params = content.content_params; |
| 16 |
if (content_params is Parameters) { |
| 17 |
return ((Parameters)content_params).agreed_payload_type; |
| 18 |
} |
| 19 |
return null; |
| 20 |
}} |
| 21 |
public JingleRtp.Crypto? local_crypto { get { |
| 22 |
var content_params = content.content_params; |
| 23 |
if (content_params is Parameters) { |
| 24 |
return ((Parameters)content_params).local_crypto; |
| 25 |
} |
| 26 |
return null; |
| 27 |
}} |
| 28 |
public JingleRtp.Crypto? remote_crypto { get { |
| 29 |
var content_params = content.content_params; |
| 30 |
if (content_params is Parameters) { |
| 31 |
return ((Parameters)content_params).remote_crypto; |
| 32 |
} |
| 33 |
return null; |
| 34 |
}} |
| 35 |
public Gee.List<JingleRtp.HeaderExtension>? header_extensions { get { |
| 36 |
var content_params = content.content_params; |
| 37 |
if (content_params is Parameters) { |
| 38 |
return ((Parameters)content_params).header_extensions; |
| 39 |
} |
| 40 |
return null; |
| 41 |
}} |
| 42 |
public bool sending { get { |
| 43 |
return content.session.senders_include_us(content.senders); |
| 44 |
}} |
| 45 |
public bool receiving { get { |
| 46 |
return content.session.senders_include_counterpart(content.senders); |
| 47 |
}} |
| 48 |
public bool rtcp_mux { get { |
| 49 |
var content_params = content.content_params; |
| 50 |
if (content_params is Parameters) { |
| 51 |
return ((Parameters)content_params).rtcp_mux; |
| 52 |
} |
| 53 |
return false; |
| 54 |
}} |
| 55 |
|
| 56 |
// Receiver Estimated Maximum Bitrate |
| 57 |
public bool remb_enabled { get { |
| 58 |
return payload_type != null ? payload_type.rtcp_fbs.any_match((it) => it.type_ == "goog-remb") : false; |
| 59 |
}} |
| 60 |
public uint target_receive_bitrate { get; set; default=256; } |
| 61 |
public uint target_send_bitrate { get; set; default=256; } |
| 62 |
|
| 63 |
protected Stream(Jingle.Content content) { |
| 64 |
this.content = content; |
| 65 |
} |
| 66 |
|
| 67 |
public signal void on_send_rtp_data(Bytes bytes); |
| 68 |
public signal void on_send_rtcp_data(Bytes bytes); |
| 69 |
|
| 70 |
public abstract void on_recv_rtp_data(Bytes bytes); |
| 71 |
public abstract void on_recv_rtcp_data(Bytes bytes); |
| 72 |
|
| 73 |
public abstract void on_rtp_ready(); |
| 74 |
public abstract void on_rtcp_ready(); |
| 75 |
|
| 76 |
public abstract void create(); |
| 77 |
public abstract void destroy(); |
| 78 |
|
| 79 |
public string to_string() { |
| 80 |
return @"$name/$media stream in $(content.session.sid)"; |
| 81 |
} |
| 82 |
} |