Mercurial > pidgin.yaz
annotate libpurple/media/codec.h @ 32699:3e2191125ad7
PURPLE_CONV_TYPE_MISC never actually used.
author | andrew.victor@mxit.com |
---|---|
date | Sat, 01 Oct 2011 13:49:37 +0000 |
parents | 02a2e8183b1d |
children |
rev | line source |
---|---|
29538 | 1 /** |
2 * @file codec.h Codec for Media API | |
3 * @ingroup core | |
4 */ | |
5 | |
6 /* purple | |
7 * | |
8 * Purple is the legal property of its developers, whose names are too numerous | |
9 * to list here. Please refer to the COPYRIGHT file distributed with this | |
10 * source distribution. | |
11 * | |
12 * This program is free software; you can redistribute it and/or modify | |
13 * it under the terms of the GNU General Public License as published by | |
14 * the Free Software Foundation; either version 2 of the License, or | |
15 * (at your option) any later version. | |
16 * | |
17 * This program is distributed in the hope that it will be useful, | |
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
20 * GNU General Public License for more details. | |
21 * | |
22 * You should have received a copy of the GNU General Public License | |
23 * along with this program; if not, write to the Free Software | |
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA | |
25 */ | |
26 | |
27 #ifndef _PURPLE_MEDIA_CODEC_H_ | |
28 #define _PURPLE_MEDIA_CODEC_H_ | |
29 | |
30 #include "enum-types.h" | |
31 | |
32 /** An opaque structure representing an audio or video codec. */ | |
33 typedef struct _PurpleMediaCodec PurpleMediaCodec; | |
34 | |
29735
a52831eada67
Add pidgin-2 and purple-2 .pc variants
Will Thompson <will.thompson@collabora.co.uk>
parents:
29635
diff
changeset
|
35 #include "../util.h" |
29538 | 36 |
37 #include <glib-object.h> | |
38 | |
39 G_BEGIN_DECLS | |
40 | |
41 #define PURPLE_TYPE_MEDIA_CODEC (purple_media_codec_get_type()) | |
42 #define PURPLE_IS_MEDIA_CODEC(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_MEDIA_CODEC)) | |
43 #define PURPLE_IS_MEDIA_CODEC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_MEDIA_CODEC)) | |
44 #define PURPLE_MEDIA_CODEC(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_MEDIA_CODEC, PurpleMediaCodec)) | |
45 #define PURPLE_MEDIA_CODEC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_MEDIA_CODEC, PurpleMediaCodec)) | |
46 #define PURPLE_MEDIA_CODEC_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_MEDIA_CODEC, PurpleMediaCodec)) | |
47 | |
48 | |
49 /** | |
50 * Gets the type of the media codec structure. | |
51 * | |
52 * @return The media codec's GType | |
53 */ | |
54 GType purple_media_codec_get_type(void); | |
55 | |
56 /** | |
57 * Creates a new PurpleMediaCodec instance. | |
58 * | |
59 * @param id Codec identifier. | |
60 * @param encoding_name Name of the media type this encodes. | |
61 * @param media_type PurpleMediaSessionType of this codec. | |
62 * @param clock_rate The clock rate this codec encodes at, if applicable. | |
63 * | |
64 * @return The newly created PurpleMediaCodec. | |
65 */ | |
66 PurpleMediaCodec *purple_media_codec_new(int id, const char *encoding_name, | |
67 PurpleMediaSessionType media_type, guint clock_rate); | |
68 | |
29635 | 69 /** |
70 * Gets the codec id. | |
71 * | |
72 * @param The codec to get the id from. | |
73 * | |
74 * @return The codec id. | |
75 */ | |
29538 | 76 guint purple_media_codec_get_id(PurpleMediaCodec *codec); |
29635 | 77 |
78 /** | |
79 * Gets the encoding name. | |
80 * | |
81 * @param The codec to get the encoding name from. | |
82 * | |
83 * @return The encoding name. | |
84 */ | |
29538 | 85 gchar *purple_media_codec_get_encoding_name(PurpleMediaCodec *codec); |
29635 | 86 |
87 /** | |
88 * Gets the clock rate. | |
89 * | |
90 * @param The codec to get the clock rate from. | |
91 * | |
92 * @return The clock rate. | |
93 */ | |
29538 | 94 guint purple_media_codec_get_clock_rate(PurpleMediaCodec *codec); |
29635 | 95 |
96 /** | |
97 * Gets the number of channels. | |
98 * | |
99 * @param The codec to get the number of channels from. | |
100 * | |
101 * @return The number of channels. | |
102 */ | |
29538 | 103 guint purple_media_codec_get_channels(PurpleMediaCodec *codec); |
29635 | 104 |
105 /** | |
106 * Gets a list of the optional parameters. | |
107 * | |
31533
44f53d3fc54f
Remove trailing whitespace
Richard Laager <rlaager@wiktel.com>
parents:
30871
diff
changeset
|
108 * The list consists of PurpleKeyValuePair's. |
29635 | 109 * |
110 * @param The codec to get the optional parameters from. | |
111 * | |
30871
d91e3a6c4a91
Clarify documentation on a function return value.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29735
diff
changeset
|
112 * @return The list of optional parameters. The list is owned by the codec and |
d91e3a6c4a91
Clarify documentation on a function return value.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
29735
diff
changeset
|
113 * should not be freed. |
29635 | 114 */ |
29538 | 115 GList *purple_media_codec_get_optional_parameters(PurpleMediaCodec *codec); |
116 | |
117 /** | |
118 * Adds an optional parameter to the codec. | |
119 * | |
120 * @param codec The codec to add the parameter to. | |
121 * @param name The name of the parameter to add. | |
122 * @param value The value of the parameter to add. | |
123 */ | |
124 void purple_media_codec_add_optional_parameter(PurpleMediaCodec *codec, | |
125 const gchar *name, const gchar *value); | |
126 | |
127 /** | |
128 * Removes an optional parameter from the codec. | |
129 * | |
130 * @param codec The codec to remove the parameter from. | |
131 * @param param A pointer to the parameter to remove. | |
132 */ | |
133 void purple_media_codec_remove_optional_parameter(PurpleMediaCodec *codec, | |
134 PurpleKeyValuePair *param); | |
135 | |
136 /** | |
137 * Gets an optional parameter based on the values given. | |
138 * | |
139 * @param codec The codec to find the parameter in. | |
140 * @param name The name of the parameter to search for. | |
141 * @param value The value to search for or NULL. | |
142 * | |
143 * @return The value found or NULL. | |
144 */ | |
145 PurpleKeyValuePair *purple_media_codec_get_optional_parameter( | |
146 PurpleMediaCodec *codec, const gchar *name, | |
147 const gchar *value); | |
148 | |
149 /** | |
150 * Copies a PurpleMediaCodec object. | |
151 * | |
152 * @param codec The codec to copy. | |
153 * | |
154 * @return The copy of the codec. | |
155 */ | |
156 PurpleMediaCodec *purple_media_codec_copy(PurpleMediaCodec *codec); | |
157 | |
158 /** | |
159 * Copies a GList of PurpleMediaCodec and its contents. | |
160 * | |
161 * @param codecs The list of codecs to be copied. | |
162 * | |
163 * @return The copy of the GList. | |
164 */ | |
165 GList *purple_media_codec_list_copy(GList *codecs); | |
166 | |
167 /** | |
168 * Frees a GList of PurpleMediaCodec and its contents. | |
169 * | |
170 * @param codecs The list of codecs to be freed. | |
171 */ | |
172 void purple_media_codec_list_free(GList *codecs); | |
173 | |
174 /** | |
175 * Creates a string representation of the codec. | |
176 * | |
177 * @param codec The codec to create the string of. | |
178 * | |
179 * @return The new string representation. | |
180 */ | |
181 gchar *purple_media_codec_to_string(const PurpleMediaCodec *codec); | |
182 | |
183 G_END_DECLS | |
184 | |
185 #endif /* _PURPLE_MEDIA_CODEC_H_ */ | |
186 |