| | 1 | |
| | 2 | #include "avformat.h" |
| | 3 | #include "rtpdec_formats.h" |
| | 4 | |
| | 5 | static int g726_16_parse_sdp_line(AVFormatContext *s, int st_index, |
| | 6 | PayloadContext *data, const char *line) |
| | 7 | { |
| | 8 | AVStream *stream = s->streams[st_index]; |
| | 9 | AVCodecContext *codec = stream->codec; |
| | 10 | |
| | 11 | codec->bit_rate = 16000; |
| | 12 | |
| | 13 | return 0; |
| | 14 | } |
| | 15 | |
| | 16 | static int g726_24_parse_sdp_line(AVFormatContext *s, int st_index, |
| | 17 | PayloadContext *data, const char *line) |
| | 18 | { |
| | 19 | AVStream *stream = s->streams[st_index]; |
| | 20 | AVCodecContext *codec = stream->codec; |
| | 21 | |
| | 22 | codec->bit_rate = 24000; |
| | 23 | |
| | 24 | return 0; |
| | 25 | } |
| | 26 | |
| | 27 | static int g726_32_parse_sdp_line(AVFormatContext *s, int st_index, |
| | 28 | PayloadContext *data, const char *line) |
| | 29 | { |
| | 30 | AVStream *stream = s->streams[st_index]; |
| | 31 | AVCodecContext *codec = stream->codec; |
| | 32 | |
| | 33 | codec->bit_rate = 32000; |
| | 34 | |
| | 35 | return 0; |
| | 36 | } |
| | 37 | |
| | 38 | static int g726_40_parse_sdp_line(AVFormatContext *s, int st_index, |
| | 39 | PayloadContext *data, const char *line) |
| | 40 | { |
| | 41 | AVStream *stream = s->streams[st_index]; |
| | 42 | AVCodecContext *codec = stream->codec; |
| | 43 | |
| | 44 | codec->bit_rate = 40000; |
| | 45 | |
| | 46 | return 0; |
| | 47 | } |
| | 48 | |
| | 49 | RTPDynamicProtocolHandler ff_g726_16_dynamic_handler = { |
| | 50 | .enc_name = "G726-16", |
| | 51 | .codec_type = AVMEDIA_TYPE_AUDIO, |
| | 52 | .codec_id = CODEC_ID_ADPCM_G726, |
| | 53 | .parse_sdp_a_line = g726_16_parse_sdp_line, |
| | 54 | }; |
| | 55 | |
| | 56 | RTPDynamicProtocolHandler ff_g726_24_dynamic_handler = { |
| | 57 | .enc_name = "G726-24", |
| | 58 | .codec_type = AVMEDIA_TYPE_AUDIO, |
| | 59 | .codec_id = CODEC_ID_ADPCM_G726, |
| | 60 | .parse_sdp_a_line = g726_24_parse_sdp_line, |
| | 61 | }; |
| | 62 | |
| | 63 | RTPDynamicProtocolHandler ff_g726_32_dynamic_handler = { |
| | 64 | .enc_name = "G726-32", |
| | 65 | .codec_type = AVMEDIA_TYPE_AUDIO, |
| | 66 | .codec_id = CODEC_ID_ADPCM_G726, |
| | 67 | .parse_sdp_a_line = g726_32_parse_sdp_line, |
| | 68 | }; |
| | 69 | |
| | 70 | RTPDynamicProtocolHandler ff_g726_40_dynamic_handler = { |
| | 71 | .enc_name = "G726-40", |
| | 72 | .codec_type = AVMEDIA_TYPE_AUDIO, |
| | 73 | .codec_id = CODEC_ID_ADPCM_G726, |
| | 74 | .parse_sdp_a_line = g726_40_parse_sdp_line, |
| | 75 | }; |