1 /* GStreamer 2 * Copyright (C) <2005,2006> Wim Taymans <wim@fluendo.com> 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Library General Public 6 * License as published by the Free Software Foundation; either 7 * version 2 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Library General Public License for more details. 13 * 14 * You should have received a copy of the GNU Library General Public 15 * License along with this library; if not, write to the 16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 17 * Boston, MA 02110-1301, USA. 18 */ 19 /* 20 * Unless otherwise indicated, Source Code is licensed under MIT license. 21 * See further explanation attached in License Statement (distributed in the file 22 * LICENSE). 23 * 24 * Permission is hereby granted, free of charge, to any person obtaining a copy of 25 * this software and associated documentation files (the "Software"), to deal in 26 * the Software without restriction, including without limitation the rights to 27 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 28 * of the Software, and to permit persons to whom the Software is furnished to do 29 * so, subject to the following conditions: 30 * 31 * The above copyright notice and this permission notice shall be included in all 32 * copies or substantial portions of the Software. 33 * 34 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 35 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 36 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 37 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 38 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 39 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 40 * SOFTWARE. 41 */ 42 43 #ifndef __GST_SDP_MESSAGE_H__ 44 #define __GST_SDP_MESSAGE_H__ 45 46 #include "gstmikey.h" 47 48 #include <glib.h> 49 #include <gst/gst.h> 50 #include <gst/sdp/sdp.h> 51 52 G_BEGIN_DECLS 53 54 /** 55 * GstSDPOrigin: 56 * @username: the user's login on the originating host, or it is "-" 57 * if the originating host does not support the concept of user ids. 58 * @sess_id: is a numeric string such that the tuple of @username, @sess_id, 59 * @nettype, @addrtype and @addr form a globally unique identifier for the 60 * session. 61 * @sess_version: a version number for this announcement 62 * @nettype: the type of network. "IN" is defined to have the meaning 63 * "Internet". 64 * @addrtype: the type of @addr. 65 * @addr: the globally unique address of the machine from which the session was 66 * created. 67 * 68 * The contents of the SDP "o=" field which gives the originator of the session 69 * (their username and the address of the user's host) plus a session id and 70 * session version number. 71 */ 72 typedef struct { 73 gchar *username; 74 gchar *sess_id; 75 gchar *sess_version; 76 gchar *nettype; 77 gchar *addrtype; 78 gchar *addr; 79 } GstSDPOrigin; 80 81 /** 82 * GstSDPConnection: 83 * @nettype: the type of network. "IN" is defined to have the meaning 84 * "Internet". 85 * @addrtype: the type of @address. 86 * @address: the address 87 * @ttl: the time to live of the address 88 * @addr_number: the number of layers 89 * 90 * The contents of the SDP "c=" field which contains connection data. 91 */ 92 typedef struct { 93 gchar *nettype; 94 gchar *addrtype; 95 gchar *address; 96 guint ttl; 97 guint addr_number; 98 } GstSDPConnection; 99 100 GST_SDP_API 101 GstSDPResult gst_sdp_connection_set (GstSDPConnection *conn, 102 const gchar *nettype, 103 const gchar *addrtype, 104 const gchar *address, 105 guint ttl, guint addr_number); 106 107 GST_SDP_API 108 GstSDPResult gst_sdp_connection_clear (GstSDPConnection *conn); 109 110 111 /** 112 * GST_SDP_BWTYPE_CT: 113 * 114 * The Conference Total bandwidth modifier. 115 */ 116 #define GST_SDP_BWTYPE_CT "CT" 117 /** 118 * GST_SDP_BWTYPE_AS: 119 * 120 * The Application-Specific Maximum bandwidth modifier. 121 */ 122 #define GST_SDP_BWTYPE_AS "AS" 123 /** 124 * GST_SDP_BWTYPE_EXT_PREFIX: 125 * 126 * The extension prefix bandwidth modifier. 127 */ 128 #define GST_SDP_BWTYPE_EXT_PREFIX "X-" 129 130 /** 131 * GST_SDP_BWTYPE_RS: 132 * 133 * RTCP bandwidth allocated to active data senders (RFC 3556). 134 */ 135 #define GST_SDP_BWTYPE_RS "RS" 136 /** 137 * GST_SDP_BWTYPE_RR: 138 * 139 * RTCP bandwidth allocated to data receivers (RFC 3556). 140 */ 141 #define GST_SDP_BWTYPE_RR "RR" 142 /** 143 * GST_SDP_BWTYPE_TIAS: 144 * 145 * Transport Independent Application Specific Maximum bandwidth (RFC 3890). 146 */ 147 #define GST_SDP_BWTYPE_TIAS "TIAS" 148 149 150 /** 151 * GstSDPBandwidth: 152 * @bwtype: the bandwidth modifier type 153 * @bandwidth: the bandwidth in kilobits per second 154 * 155 * The contents of the SDP "b=" field which specifies the proposed bandwidth to 156 * be used by the session or media. 157 */ 158 typedef struct { 159 gchar *bwtype; 160 guint bandwidth; 161 } GstSDPBandwidth; 162 163 GST_SDP_API 164 GstSDPResult gst_sdp_bandwidth_set (GstSDPBandwidth *bw, const gchar *bwtype, 165 guint bandwidth); 166 167 GST_SDP_API 168 GstSDPResult gst_sdp_bandwidth_clear (GstSDPBandwidth *bw); 169 170 /** 171 * GstSDPTime: 172 * @start: start time for the conference. The value is the decimal 173 * representation of Network Time Protocol (NTP) time values in seconds 174 * @stop: stop time for the conference. The value is the decimal 175 * representation of Network Time Protocol (NTP) time values in seconds 176 * @repeat: repeat times for a session 177 * 178 * The contents of the SDP "t=" field which specify the start and stop times for 179 * a conference session. 180 */ 181 typedef struct { 182 gchar *start; 183 gchar *stop; 184 GArray *repeat; 185 } GstSDPTime; 186 187 GST_SDP_API 188 GstSDPResult gst_sdp_time_set (GstSDPTime *t, const gchar *start, 189 const gchar *stop, const gchar **repeat); 190 191 GST_SDP_API 192 GstSDPResult gst_sdp_time_clear (GstSDPTime *t); 193 194 /** 195 * GstSDPZone: 196 * @time: the NTP time that a time zone adjustment happens 197 * @typed_time: the offset from the time when the session was first scheduled 198 * 199 * The contents of the SDP "z=" field which allows the sender to 200 * specify a list of time zone adjustments and offsets from the base 201 * time. 202 */ 203 typedef struct { 204 gchar *time; 205 gchar *typed_time; 206 } GstSDPZone; 207 208 GST_SDP_API 209 GstSDPResult gst_sdp_zone_set (GstSDPZone *zone, const gchar *adj_time, 210 const gchar *typed_time); 211 212 GST_SDP_API 213 GstSDPResult gst_sdp_zone_clear (GstSDPZone *zone); 214 215 216 /** 217 * GstSDPKey: 218 * @type: the encryption type 219 * @data: the encryption data 220 * 221 * The contents of the SDP "k=" field which is used to convey encryption 222 * keys. 223 */ 224 typedef struct { 225 gchar *type; 226 gchar *data; 227 } GstSDPKey; 228 229 /** 230 * GstSDPAttribute: 231 * @key: the attribute key 232 * @value: the attribute value or NULL when it was a property attribute 233 * 234 * The contents of the SDP "a=" field which contains a key/value pair. 235 */ 236 typedef struct { 237 gchar *key; 238 gchar *value; 239 } GstSDPAttribute; 240 241 GST_SDP_API 242 GstSDPResult gst_sdp_attribute_set (GstSDPAttribute *attr, const gchar *key, 243 const gchar *value); 244 245 GST_SDP_API 246 GstSDPResult gst_sdp_attribute_clear (GstSDPAttribute *attr); 247 248 /** 249 * GstSDPMedia: 250 * @media: the media type 251 * @port: the transport port to which the media stream will be sent 252 * @num_ports: the number of ports or -1 if only one port was specified 253 * @proto: the transport protocol 254 * @fmts: an array of #gchar formats 255 * @information: the media title 256 * @connections: array of #GstSDPConnection with media connection information 257 * @bandwidths: array of #GstSDPBandwidth with media bandwidth information 258 * @key: the encryption key 259 * @attributes: array of #GstSDPAttribute with the additional media attributes 260 * 261 * The contents of the SDP "m=" field with all related fields. 262 */ 263 typedef struct { 264 gchar *media; 265 guint port; 266 guint num_ports; 267 gchar *proto; 268 GArray *fmts; 269 gchar *information; 270 GArray *connections; 271 GArray *bandwidths; 272 GstSDPKey key; 273 GArray *attributes; 274 } GstSDPMedia; 275 276 /** 277 * GstSDPMessage: 278 * @version: the protocol version 279 * @origin: owner/creator and session identifier 280 * @session_name: session name 281 * @information: session information 282 * @uri: URI of description 283 * @emails: array of #gchar with email addresses 284 * @phones: array of #gchar with phone numbers 285 * @connection: connection information for the session 286 * @bandwidths: array of #GstSDPBandwidth with bandwidth information 287 * @times: array of #GstSDPTime with time descriptions 288 * @zones: array of #GstSDPZone with time zone adjustments 289 * @key: encryption key 290 * @attributes: array of #GstSDPAttribute with session attributes 291 * @medias: array of #GstSDPMedia with media descriptions 292 * 293 * The contents of the SDP message. 294 */ 295 typedef struct { 296 gchar *version; 297 GstSDPOrigin origin; 298 gchar *session_name; 299 gchar *information; 300 gchar *uri; 301 GArray *emails; 302 GArray *phones; 303 GstSDPConnection connection; 304 GArray *bandwidths; 305 GArray *times; 306 GArray *zones; 307 GstSDPKey key; 308 GArray *attributes; 309 GArray *medias; 310 } GstSDPMessage; 311 312 313 GST_SDP_API 314 GType gst_sdp_message_get_type (void); 315 316 #define GST_TYPE_SDP_MESSAGE (gst_sdp_message_get_type()) 317 #define GST_SDP_MESSAGE_CAST(object) ((GstSDPMessage *)(object)) 318 #define GST_SDP_MESSAGE(object) (GST_SDP_MESSAGE_CAST(object)) 319 320 /* Session descriptions */ 321 322 GST_SDP_API 323 GstSDPResult gst_sdp_message_new (GstSDPMessage **msg); 324 325 GST_SDP_API 326 GstSDPResult gst_sdp_message_init (GstSDPMessage *msg); 327 328 GST_SDP_API 329 GstSDPResult gst_sdp_message_uninit (GstSDPMessage *msg); 330 331 GST_SDP_API 332 GstSDPResult gst_sdp_message_free (GstSDPMessage *msg); 333 334 GST_SDP_API 335 GstSDPResult gst_sdp_message_copy (const GstSDPMessage *msg, GstSDPMessage **copy); 336 337 GST_SDP_API 338 GstSDPResult gst_sdp_message_parse_buffer (const guint8 *data, guint size, GstSDPMessage *msg); 339 340 GST_SDP_API 341 gchar* gst_sdp_message_as_text (const GstSDPMessage *msg); 342 343 GST_SDP_API 344 GstSDPResult gst_sdp_message_new_from_text (const gchar *text, GstSDPMessage ** msg); 345 346 /* convert from/to uri */ 347 348 GST_SDP_API 349 GstSDPResult gst_sdp_message_parse_uri (const gchar *uri, GstSDPMessage *msg); 350 351 GST_SDP_API 352 gchar* gst_sdp_message_as_uri (const gchar *scheme, const GstSDPMessage *msg); 353 354 /* utils */ 355 356 GST_SDP_API 357 gboolean gst_sdp_address_is_multicast (const gchar *nettype, const gchar *addrtype, 358 const gchar *addr); 359 /* v=.. */ 360 361 GST_SDP_API 362 const gchar* gst_sdp_message_get_version (const GstSDPMessage *msg); 363 364 GST_SDP_API 365 GstSDPResult gst_sdp_message_set_version (GstSDPMessage *msg, const gchar *version); 366 367 /* o=<username> <sess-id> <sess-version> <nettype> <addrtype> <unicast-address> */ 368 369 GST_SDP_API 370 const GstSDPOrigin* gst_sdp_message_get_origin (const GstSDPMessage *msg); 371 372 GST_SDP_API 373 GstSDPResult gst_sdp_message_set_origin (GstSDPMessage *msg, const gchar *username, 374 const gchar *sess_id, const gchar *sess_version, 375 const gchar *nettype, const gchar *addrtype, 376 const gchar *addr); 377 378 /* s=<session name> */ 379 380 GST_SDP_API 381 const gchar* gst_sdp_message_get_session_name (const GstSDPMessage *msg); 382 383 GST_SDP_API 384 GstSDPResult gst_sdp_message_set_session_name (GstSDPMessage *msg, const gchar *session_name); 385 386 /* i=<session description> */ 387 388 GST_SDP_API 389 const gchar* gst_sdp_message_get_information (const GstSDPMessage *msg); 390 391 GST_SDP_API 392 GstSDPResult gst_sdp_message_set_information (GstSDPMessage *msg, const gchar *information); 393 394 /* u=<uri> */ 395 396 GST_SDP_API 397 const gchar* gst_sdp_message_get_uri (const GstSDPMessage *msg); 398 399 GST_SDP_API 400 GstSDPResult gst_sdp_message_set_uri (GstSDPMessage *msg, const gchar *uri); 401 402 /* e=<email-address> */ 403 404 GST_SDP_API 405 guint gst_sdp_message_emails_len (const GstSDPMessage *msg); 406 407 GST_SDP_API 408 const gchar* gst_sdp_message_get_email (const GstSDPMessage *msg, guint idx); 409 410 GST_SDP_API 411 GstSDPResult gst_sdp_message_insert_email (GstSDPMessage *msg, gint idx, 412 const gchar *email); 413 414 GST_SDP_API 415 GstSDPResult gst_sdp_message_replace_email (GstSDPMessage *msg, guint idx, 416 const gchar *email); 417 418 GST_SDP_API 419 GstSDPResult gst_sdp_message_remove_email (GstSDPMessage *msg, guint idx); 420 421 GST_SDP_API 422 GstSDPResult gst_sdp_message_add_email (GstSDPMessage *msg, const gchar *email); 423 424 /* p=<phone-number> */ 425 426 GST_SDP_API 427 guint gst_sdp_message_phones_len (const GstSDPMessage *msg); 428 429 GST_SDP_API 430 const gchar* gst_sdp_message_get_phone (const GstSDPMessage *msg, guint idx); 431 432 GST_SDP_API 433 GstSDPResult gst_sdp_message_insert_phone (GstSDPMessage *msg, gint idx, 434 const gchar *phone); 435 436 GST_SDP_API 437 GstSDPResult gst_sdp_message_replace_phone (GstSDPMessage *msg, guint idx, 438 const gchar *phone); 439 440 GST_SDP_API 441 GstSDPResult gst_sdp_message_remove_phone (GstSDPMessage *msg, guint idx); 442 443 GST_SDP_API 444 GstSDPResult gst_sdp_message_add_phone (GstSDPMessage *msg, const gchar *phone); 445 446 /* c=<nettype> <addrtype> <connection-address>[/<ttl>][/<number of addresses>] */ 447 448 GST_SDP_API 449 const GstSDPConnection* gst_sdp_message_get_connection (const GstSDPMessage *msg); 450 451 GST_SDP_API 452 GstSDPResult gst_sdp_message_set_connection (GstSDPMessage *msg, const gchar *nettype, 453 const gchar *addrtype, const gchar *address, 454 guint ttl, guint addr_number); 455 /* b=<bwtype>:<bandwidth> */ 456 457 GST_SDP_API 458 guint gst_sdp_message_bandwidths_len (const GstSDPMessage *msg); 459 460 GST_SDP_API 461 const GstSDPBandwidth* gst_sdp_message_get_bandwidth (const GstSDPMessage *msg, guint idx); 462 463 GST_SDP_API 464 GstSDPResult gst_sdp_message_insert_bandwidth (GstSDPMessage * msg, gint idx, 465 GstSDPBandwidth * bw); 466 467 GST_SDP_API 468 GstSDPResult gst_sdp_message_replace_bandwidth (GstSDPMessage * msg, guint idx, 469 GstSDPBandwidth * bw); 470 471 GST_SDP_API 472 GstSDPResult gst_sdp_message_remove_bandwidth (GstSDPMessage * msg, guint idx); 473 474 GST_SDP_API 475 GstSDPResult gst_sdp_message_add_bandwidth (GstSDPMessage *msg, const gchar *bwtype, 476 guint bandwidth); 477 478 /* t=<start-time> <stop-time> and 479 * r=<repeat interval> <active duration> <offsets from start-time> */ 480 481 GST_SDP_API 482 guint gst_sdp_message_times_len (const GstSDPMessage *msg); 483 484 GST_SDP_API 485 const GstSDPTime* gst_sdp_message_get_time (const GstSDPMessage *msg, guint idx); 486 487 GST_SDP_API 488 GstSDPResult gst_sdp_message_insert_time (GstSDPMessage *msg, gint idx, 489 GstSDPTime *t); 490 491 GST_SDP_API 492 GstSDPResult gst_sdp_message_replace_time (GstSDPMessage *msg, guint idx, 493 GstSDPTime *t); 494 495 GST_SDP_API 496 GstSDPResult gst_sdp_message_remove_time (GstSDPMessage *msg, guint idx); 497 498 GST_SDP_API 499 GstSDPResult gst_sdp_message_add_time (GstSDPMessage *msg, const gchar *start, 500 const gchar *stop, const gchar **repeat); 501 502 /* z=<adjustment time> <offset> <adjustment time> <offset> .... */ 503 504 GST_SDP_API 505 guint gst_sdp_message_zones_len (const GstSDPMessage *msg); 506 507 GST_SDP_API 508 const GstSDPZone* gst_sdp_message_get_zone (const GstSDPMessage *msg, guint idx); 509 510 GST_SDP_API 511 GstSDPResult gst_sdp_message_insert_zone (GstSDPMessage *msg, gint idx, 512 GstSDPZone *zone); 513 514 GST_SDP_API 515 GstSDPResult gst_sdp_message_replace_zone (GstSDPMessage *msg, guint idx, 516 GstSDPZone *zone); 517 518 GST_SDP_API 519 GstSDPResult gst_sdp_message_remove_zone (GstSDPMessage *msg, guint idx); 520 521 GST_SDP_API 522 GstSDPResult gst_sdp_message_add_zone (GstSDPMessage *msg, const gchar *adj_time, 523 const gchar *typed_time); 524 525 /* k=<method>[:<encryption key>] */ 526 527 GST_SDP_API 528 const GstSDPKey* gst_sdp_message_get_key (const GstSDPMessage *msg); 529 530 GST_SDP_API 531 GstSDPResult gst_sdp_message_set_key (GstSDPMessage *msg, const gchar *type, 532 const gchar *data); 533 /* a=... */ 534 535 GST_SDP_API 536 guint gst_sdp_message_attributes_len (const GstSDPMessage *msg); 537 538 GST_SDP_API 539 const GstSDPAttribute* gst_sdp_message_get_attribute (const GstSDPMessage *msg, guint idx); 540 541 GST_SDP_API 542 const gchar* gst_sdp_message_get_attribute_val (const GstSDPMessage *msg, 543 const gchar *key); 544 545 GST_SDP_API 546 const gchar* gst_sdp_message_get_attribute_val_n (const GstSDPMessage *msg, 547 const gchar *key, guint nth); 548 549 GST_SDP_API 550 GstSDPResult gst_sdp_message_insert_attribute (GstSDPMessage *msg, gint idx, 551 GstSDPAttribute *attr); 552 553 GST_SDP_API 554 GstSDPResult gst_sdp_message_replace_attribute (GstSDPMessage *msg, guint idx, 555 GstSDPAttribute *attr); 556 557 GST_SDP_API 558 GstSDPResult gst_sdp_message_remove_attribute (GstSDPMessage *msg, guint idx); 559 560 GST_SDP_API 561 GstSDPResult gst_sdp_message_add_attribute (GstSDPMessage *msg, const gchar *key, 562 const gchar *value); 563 564 /* m=.. sections */ 565 566 GST_SDP_API 567 guint gst_sdp_message_medias_len (const GstSDPMessage *msg); 568 569 GST_SDP_API 570 const GstSDPMedia* gst_sdp_message_get_media (const GstSDPMessage *msg, guint idx); 571 572 GST_SDP_API 573 GstSDPResult gst_sdp_message_add_media (GstSDPMessage *msg, GstSDPMedia *media); 574 575 GST_SDP_API 576 GstSDPResult gst_sdp_message_dump (const GstSDPMessage *msg); 577 578 /* Media descriptions */ 579 580 GST_SDP_API 581 GstSDPResult gst_sdp_media_new (GstSDPMedia **media); 582 583 GST_SDP_API 584 GstSDPResult gst_sdp_media_init (GstSDPMedia *media); 585 586 GST_SDP_API 587 GstSDPResult gst_sdp_media_uninit (GstSDPMedia *media); 588 589 GST_SDP_API 590 GstSDPResult gst_sdp_media_free (GstSDPMedia *media); 591 592 GST_SDP_API 593 GstSDPResult gst_sdp_media_copy (const GstSDPMedia *media, GstSDPMedia **copy); 594 595 GST_SDP_API 596 gchar* gst_sdp_media_as_text (const GstSDPMedia *media); 597 598 /* m=<media> <port>/<number of ports> <proto> <fmt> ... */ 599 600 GST_SDP_API 601 const gchar* gst_sdp_media_get_media (const GstSDPMedia *media); 602 603 GST_SDP_API 604 GstSDPResult gst_sdp_media_set_media (GstSDPMedia *media, const gchar *med); 605 606 GST_SDP_API 607 guint gst_sdp_media_get_port (const GstSDPMedia *media); 608 609 GST_SDP_API 610 guint gst_sdp_media_get_num_ports (const GstSDPMedia *media); 611 612 GST_SDP_API 613 GstSDPResult gst_sdp_media_set_port_info (GstSDPMedia *media, guint port, 614 guint num_ports); 615 616 GST_SDP_API 617 const gchar* gst_sdp_media_get_proto (const GstSDPMedia *media); 618 619 GST_SDP_API 620 GstSDPResult gst_sdp_media_set_proto (GstSDPMedia *media, const gchar *proto); 621 622 GST_SDP_API 623 guint gst_sdp_media_formats_len (const GstSDPMedia *media); 624 625 GST_SDP_API 626 const gchar* gst_sdp_media_get_format (const GstSDPMedia *media, guint idx); 627 628 GST_SDP_API 629 GstSDPResult gst_sdp_media_insert_format (GstSDPMedia *media, gint idx, 630 const gchar *format); 631 632 GST_SDP_API 633 GstSDPResult gst_sdp_media_replace_format (GstSDPMedia *media, guint idx, 634 const gchar *format); 635 636 GST_SDP_API 637 GstSDPResult gst_sdp_media_remove_format (GstSDPMedia *media, guint idx); 638 639 GST_SDP_API 640 GstSDPResult gst_sdp_media_add_format (GstSDPMedia *media, const gchar *format); 641 642 /* i=<session description> */ 643 644 GST_SDP_API 645 const gchar* gst_sdp_media_get_information (const GstSDPMedia *media); 646 647 GST_SDP_API 648 GstSDPResult gst_sdp_media_set_information (GstSDPMedia *media, const gchar *information); 649 650 /* c=<nettype> <addrtype> <connection-address>[/<ttl>][/<number of addresses>] */ 651 652 GST_SDP_API 653 guint gst_sdp_media_connections_len (const GstSDPMedia *media); 654 655 GST_SDP_API 656 const GstSDPConnection* gst_sdp_media_get_connection (const GstSDPMedia *media, guint idx); 657 658 GST_SDP_API 659 GstSDPResult gst_sdp_media_insert_connection (GstSDPMedia *media, gint idx, 660 GstSDPConnection *conn); 661 662 GST_SDP_API 663 GstSDPResult gst_sdp_media_replace_connection (GstSDPMedia *media, guint idx, 664 GstSDPConnection *conn); 665 666 GST_SDP_API 667 GstSDPResult gst_sdp_media_remove_connection (GstSDPMedia *media, guint idx); 668 669 GST_SDP_API 670 GstSDPResult gst_sdp_media_add_connection (GstSDPMedia *media, 671 const gchar *nettype, 672 const gchar *addrtype, 673 const gchar *address, 674 guint ttl, guint addr_number); 675 676 /* b=<bwtype>:<bandwidth> */ 677 678 GST_SDP_API 679 guint gst_sdp_media_bandwidths_len (const GstSDPMedia *media); 680 681 GST_SDP_API 682 const GstSDPBandwidth* gst_sdp_media_get_bandwidth (const GstSDPMedia *media, guint idx); 683 684 GST_SDP_API 685 GstSDPResult gst_sdp_media_insert_bandwidth (GstSDPMedia *media, gint idx, 686 GstSDPBandwidth *bw); 687 688 GST_SDP_API 689 GstSDPResult gst_sdp_media_replace_bandwidth (GstSDPMedia *media, guint idx, 690 GstSDPBandwidth *bw); 691 692 GST_SDP_API 693 GstSDPResult gst_sdp_media_remove_bandwidth (GstSDPMedia *media, guint idx); 694 695 GST_SDP_API 696 GstSDPResult gst_sdp_media_add_bandwidth (GstSDPMedia *media, const gchar *bwtype, 697 guint bandwidth); 698 699 /* k=<method>:<encryption key> */ 700 701 GST_SDP_API 702 const GstSDPKey* gst_sdp_media_get_key (const GstSDPMedia *media); 703 704 GST_SDP_API 705 GstSDPResult gst_sdp_media_set_key (GstSDPMedia *media, const gchar *type, 706 const gchar *data); 707 /* a=... */ 708 709 GST_SDP_API 710 guint gst_sdp_media_attributes_len (const GstSDPMedia *media); 711 712 GST_SDP_API 713 const GstSDPAttribute * gst_sdp_media_get_attribute (const GstSDPMedia *media, guint idx); 714 715 GST_SDP_API 716 const gchar* gst_sdp_media_get_attribute_val (const GstSDPMedia *media, const gchar *key); 717 718 GST_SDP_API 719 const gchar* gst_sdp_media_get_attribute_val_n (const GstSDPMedia *media, const gchar *key, 720 guint nth); 721 722 GST_SDP_API 723 GstSDPResult gst_sdp_media_insert_attribute (GstSDPMedia *media, gint idx, 724 GstSDPAttribute *attr); 725 726 GST_SDP_API 727 GstSDPResult gst_sdp_media_replace_attribute (GstSDPMedia *media, guint idx, 728 GstSDPAttribute *attr); 729 730 GST_SDP_API 731 GstSDPResult gst_sdp_media_remove_attribute (GstSDPMedia *media, guint idx); 732 733 GST_SDP_API 734 GstSDPResult gst_sdp_media_add_attribute (GstSDPMedia *media, const gchar *key, 735 const gchar *value); 736 737 GST_SDP_API 738 GstCaps* gst_sdp_media_get_caps_from_media (const GstSDPMedia *media, gint pt); 739 740 GST_SDP_API 741 GstSDPResult gst_sdp_media_set_media_from_caps (const GstCaps* caps, GstSDPMedia *media); 742 743 GST_SDP_API 744 gchar * gst_sdp_make_keymgmt (const gchar *uri, const gchar *base64); 745 746 GST_SDP_API 747 GstSDPResult gst_sdp_message_parse_keymgmt (const GstSDPMessage *msg, GstMIKEYMessage **mikey); 748 749 GST_SDP_API 750 GstSDPResult gst_sdp_media_parse_keymgmt (const GstSDPMedia *media, GstMIKEYMessage **mikey); 751 752 GST_SDP_API 753 GstSDPResult gst_sdp_message_attributes_to_caps (const GstSDPMessage *msg, GstCaps *caps); 754 755 GST_SDP_API 756 GstSDPResult gst_sdp_media_attributes_to_caps (const GstSDPMedia *media, GstCaps *caps); 757 758 G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstSDPMessage, gst_sdp_message_free) 759 760 G_END_DECLS 761 762 #endif /* __GST_SDP_MESSAGE_H__ */ 763