2 * Copyright (c) 2011 Miroslav Slugeň <Thunder.m@seznam.cz>
4 * This file is part of FFmpeg.
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 #include "rtpdec_formats.h"
24 static int g726_16_parse_sdp_line(AVFormatContext *s, int st_index,
25 PayloadContext *data, const char *line)
27 AVStream *stream = s->streams[st_index];
28 AVCodecContext *codec = stream->codec;
30 codec->bit_rate = 16000;
35 static int g726_24_parse_sdp_line(AVFormatContext *s, int st_index,
36 PayloadContext *data, const char *line)
38 AVStream *stream = s->streams[st_index];
39 AVCodecContext *codec = stream->codec;
41 codec->bit_rate = 24000;
46 static int g726_32_parse_sdp_line(AVFormatContext *s, int st_index,
47 PayloadContext *data, const char *line)
49 AVStream *stream = s->streams[st_index];
50 AVCodecContext *codec = stream->codec;
52 codec->bit_rate = 32000;
57 static int g726_40_parse_sdp_line(AVFormatContext *s, int st_index,
58 PayloadContext *data, const char *line)
60 AVStream *stream = s->streams[st_index];
61 AVCodecContext *codec = stream->codec;
63 codec->bit_rate = 40000;
68 RTPDynamicProtocolHandler ff_g726_16_dynamic_handler = {
69 .enc_name = "G726-16",
70 .codec_type = AVMEDIA_TYPE_AUDIO,
71 .codec_id = CODEC_ID_ADPCM_G726,
72 .parse_sdp_a_line = g726_16_parse_sdp_line,
75 RTPDynamicProtocolHandler ff_g726_24_dynamic_handler = {
76 .enc_name = "G726-24",
77 .codec_type = AVMEDIA_TYPE_AUDIO,
78 .codec_id = CODEC_ID_ADPCM_G726,
79 .parse_sdp_a_line = g726_24_parse_sdp_line,
82 RTPDynamicProtocolHandler ff_g726_32_dynamic_handler = {
83 .enc_name = "G726-32",
84 .codec_type = AVMEDIA_TYPE_AUDIO,
85 .codec_id = CODEC_ID_ADPCM_G726,
86 .parse_sdp_a_line = g726_32_parse_sdp_line,
89 RTPDynamicProtocolHandler ff_g726_40_dynamic_handler = {
90 .enc_name = "G726-40",
91 .codec_type = AVMEDIA_TYPE_AUDIO,
92 .codec_id = CODEC_ID_ADPCM_G726,
93 .parse_sdp_a_line = g726_40_parse_sdp_line,