blob: e50d8423e1061bcdcf71926107b503c1476c018a [file] [log] [blame]
James Kuszmaul82f6c042021-01-17 11:30:16 -08001/**
2 * @file sdp/str.c SDP strings
3 *
4 * Copyright (C) 2010 Creytiv.com
5 */
6#include <re_types.h>
7#include <re_fmt.h>
8#include <re_list.h>
9#include <re_sa.h>
10#include <re_sdp.h>
11
12
13const char sdp_attr_fmtp[] = "fmtp"; /**< fmtp */
14const char sdp_attr_maxptime[] = "maxptime"; /**< maxptime */
15const char sdp_attr_ptime[] = "ptime"; /**< ptime */
16const char sdp_attr_rtcp[] = "rtcp"; /**< rtcp */
17const char sdp_attr_rtpmap[] = "rtpmap"; /**< rtpmap */
18
19const char sdp_media_audio[] = "audio"; /**< Media type 'audio' */
20const char sdp_media_video[] = "video"; /**< Media type 'video' */
21const char sdp_media_text[] = "text"; /**< Media type 'text' */
22
23const char sdp_proto_rtpavp[] = "RTP/AVP"; /**< RTP Profile */
24const char sdp_proto_rtpsavp[] = "RTP/SAVP"; /**< Secure RTP Profile */
25
26
27/**
28 * Get the SDP media direction name
29 *
30 * @param dir Media direction
31 *
32 * @return Name of media direction
33 */
34const char *sdp_dir_name(enum sdp_dir dir)
35{
36 switch (dir) {
37
38 case SDP_INACTIVE: return "inactive";
39 case SDP_RECVONLY: return "recvonly";
40 case SDP_SENDONLY: return "sendonly";
41 case SDP_SENDRECV: return "sendrecv";
42 default: return "??";
43 }
44}
45
46
47/**
48 * Get the SDP bandwidth name
49 *
50 * @param type Bandwidth type
51 *
52 * @return Bandwidth name
53 */
54const char *sdp_bandwidth_name(enum sdp_bandwidth type)
55{
56 switch (type) {
57
58 case SDP_BANDWIDTH_CT: return "CT";
59 case SDP_BANDWIDTH_AS: return "AS";
60 case SDP_BANDWIDTH_RS: return "RS";
61 case SDP_BANDWIDTH_RR: return "RR";
62 case SDP_BANDWIDTH_TIAS: return "TIAS";
63 default: return "??";
64 }
65}