3
* Ekiga -- A VoIP and Video-Conferencing application
4
* Copyright (C) 2000-2009 Damien Sandras <dsandras@seconix.com>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or (at
9
* your option) any later version. This program is distributed in the hope
10
* that it will be useful, but WITHOUT ANY WARRANTY; without even the
11
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12
* See the GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License along
15
* with this program; if not, write to the Free Software Foundation, Inc.,
16
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
18
* Ekiga is licensed under the GPL license and as a special exception, you
19
* have permission to link or otherwise combine this program with the
20
* programs OPAL, OpenH323 and PWLIB, and distribute the combination, without
21
* applying the requirements of the GNU GPL to the OPAL, OpenH323 and PWLIB
22
* programs, as long as you do follow the requirements of the GNU GPL for all
23
* the rest of the software thus combined.
28
* codec-description.h - description
29
* ------------------------------------------
30
* begin : written in January 2008 by Damien Sandras
31
* copyright : (c) 2008 by Damien Sandras
32
* description : declaration of the interface of a codec description.
36
#ifndef __CODEC_DESCRIPTION_H__
37
#define __CODEC_DESCRIPTION_H__
52
/** This class holds the representation of a codec.
53
* That representation is different from the codec itself, but can be used
54
* at several places in the engine.
56
class CodecDescription
60
/** Create an empty codec description
64
/** Create a codec description based on the parameters
65
* @param name is the codec name as defined in the RFC
66
* @param rate is the clock rate
67
* @param audio is true if it reprensents an audio codec
68
* @param protocols is a comma separated list of protocols supported
70
* @param active is true if the codec is active
72
CodecDescription (std::string name,
75
std::string protocols,
78
/** Create a codec description from a string
79
* @param codec is a string representing the codec description.
80
* All fields are separated by a *
82
CodecDescription (std::string codec);
84
/** Return the codec description under the form of a string.
85
* @return the std::string representing the string description.
90
/** name is the codec name as defined in the RFC
94
/** rate is the clock rate
98
/** active is true if the codec is active
102
/** audio is true if it reprensents an audio codec
106
/** protocols is a list of protocols supported by the codec
108
std::list<std::string> protocols;
111
/** Return true if both CodecDescription are identical, false otherwise
112
* @return true if both CodecDescription are identical, false otherwise
114
bool operator== (const CodecDescription & c) const;
116
/** Return true if both CodecDescription are different, false otherwise
117
* @return true if both CodecDescription are different, false otherwise
119
bool operator!= (const CodecDescription & c) const;
123
class CodecList : public std::list<CodecDescription>
127
/** Constructor that creates an empty CodecList
131
/** Constructor that creates a CodecList from a GSList whose elements
132
* are CodecDescription objects formatted as a string.
134
CodecList (GSList *);
137
/** Append the given CodecList at the end of the current CodecList.
138
* @param list is the CodecList to append to the current one
140
void append (CodecList & list);
143
/** Return the list of audio codecs descriptions in the current CodecList
144
* @return the list of audio CodecDescription
146
CodecList get_audio_list ();
149
/** Return the list of video codecs descriptions in the current CodecList
150
* @return the list of video CodecDescription
152
CodecList get_video_list ();
155
/** Return the list of codecs descriptions under their str form
156
* @return the list of CodecDescription
161
/** Return true if both CodecList are identical, false otherwise
162
* @return true if both CodecList are identical, false otherwise
164
bool operator== (const CodecList & c) const;
167
/** Return true if both CodecList are different, false otherwise
168
* @return true if both CodecList are different, false otherwise
170
bool operator!= (const CodecList & c) const;
179
/** Output the CodecList
181
std::ostream& operator<< (std::ostream & os, const Ekiga::CodecList & c);