rename accountopt.[ch] to purpleaccountoption.[ch]
[pidgin-git.git] / libpurple / media / codec.h
blob4919d6f6b7140a6b071b57668120f5159fc2c558
1 /* purple
3 * Purple is the legal property of its developers, whose names are too numerous
4 * to list here. Please refer to the COPYRIGHT file distributed with this
5 * source distribution.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
22 #ifndef PURPLE_MEDIA_CODEC_H
23 #define PURPLE_MEDIA_CODEC_H
24 /**
25 * SECTION:codec
26 * @section_id: libpurple-codec
27 * @short_description: <filename>media/codec.h</filename>
28 * @title: Codec for Media API
31 #include "enum-types.h"
33 /**
34 * PurpleMediaCodec:
36 * An opaque structure representing an audio or video codec.
38 typedef struct _PurpleMediaCodec PurpleMediaCodec;
40 #include "../util.h"
42 #include <glib-object.h>
44 G_BEGIN_DECLS
46 #define PURPLE_TYPE_MEDIA_CODEC purple_media_codec_get_type()
48 /**
49 * purple_media_codec_get_type:
51 * Gets the type of the media codec structure.
53 * Returns: The media codec's GType
55 G_DECLARE_FINAL_TYPE(PurpleMediaCodec, purple_media_codec, PURPLE,
56 MEDIA_CODEC, GObject)
58 /**
59 * purple_media_codec_new:
60 * @id: Codec identifier.
61 * @encoding_name: Name of the media type this encodes.
62 * @media_type: PurpleMediaSessionType of this codec.
63 * @clock_rate: The clock rate this codec encodes at, if applicable.
65 * Creates a new PurpleMediaCodec instance.
67 * Returns: The newly created PurpleMediaCodec.
69 PurpleMediaCodec *purple_media_codec_new(int id, const char *encoding_name,
70 PurpleMediaSessionType media_type, guint clock_rate);
72 /**
73 * purple_media_codec_get_id:
74 * @codec: The codec to get the id from.
76 * Gets the codec id.
78 * Returns: The codec id.
80 guint purple_media_codec_get_id(PurpleMediaCodec *codec);
82 /**
83 * purple_media_codec_get_encoding_name:
84 * @codec: The codec to get the encoding name from.
86 * Gets the encoding name.
88 * Returns: The encoding name.
90 gchar *purple_media_codec_get_encoding_name(PurpleMediaCodec *codec);
92 /**
93 * purple_media_codec_get_clock_rate:
94 * @codec: The codec to get the clock rate from.
96 * Gets the clock rate.
98 * Returns: The clock rate.
100 guint purple_media_codec_get_clock_rate(PurpleMediaCodec *codec);
103 * purple_media_codec_get_channels:
104 * @codec: The codec to get the number of channels from.
106 * Gets the number of channels.
108 * Returns: The number of channels.
110 guint purple_media_codec_get_channels(PurpleMediaCodec *codec);
113 * purple_media_codec_get_optional_parameters:
114 * @codec: The codec to get the optional parameters from.
116 * Gets a list of the optional parameters.
118 * Returns: (element-type PurpleKeyValuePair) (transfer none): The list of
119 * optional parameters.
121 GList *purple_media_codec_get_optional_parameters(PurpleMediaCodec *codec);
124 * purple_media_codec_add_optional_parameter:
125 * @codec: The codec to add the parameter to.
126 * @name: The name of the parameter to add.
127 * @value: The value of the parameter to add.
129 * Adds an optional parameter to the codec.
131 void purple_media_codec_add_optional_parameter(PurpleMediaCodec *codec,
132 const gchar *name, const gchar *value);
135 * purple_media_codec_remove_optional_parameter:
136 * @codec: The codec to remove the parameter from.
137 * @param: A pointer to the parameter to remove.
139 * Removes an optional parameter from the codec.
141 void purple_media_codec_remove_optional_parameter(PurpleMediaCodec *codec,
142 PurpleKeyValuePair *param);
145 * purple_media_codec_get_optional_parameter:
146 * @codec: The codec to find the parameter in.
147 * @name: The name of the parameter to search for.
148 * @value: The value to search for or NULL.
150 * Gets an optional parameter based on the values given.
152 * Returns: The value found or NULL.
154 PurpleKeyValuePair *purple_media_codec_get_optional_parameter(
155 PurpleMediaCodec *codec, const gchar *name,
156 const gchar *value);
159 * purple_media_codec_copy:
160 * @codec: The codec to copy.
162 * Copies a PurpleMediaCodec object.
164 * Returns: (transfer full): The copy of the codec.
166 PurpleMediaCodec *purple_media_codec_copy(PurpleMediaCodec *codec);
169 * purple_media_codec_list_copy:
170 * @codecs: (element-type PurpleMediaCodec) (transfer none): The list of codecs
171 * to be copied.
173 * Copies a GList of PurpleMediaCodec and its contents.
175 * Returns: (element-type PurpleMediaCodec) (transfer full): The copy of the
176 * codec list.
178 GList *purple_media_codec_list_copy(GList *codecs);
181 * purple_media_codec_list_free:
182 * @codecs: (element-type PurpleMediaCodec) (transfer full): The list of codecs
183 * to be freed.
185 * Frees a GList of PurpleMediaCodec and its contents.
187 void purple_media_codec_list_free(GList *codecs);
190 * purple_media_codec_to_string:
191 * @codec: The codec to create the string of.
193 * Creates a string representation of the codec.
195 * Returns: The new string representation.
197 gchar *purple_media_codec_to_string(PurpleMediaCodec *codec);
199 G_END_DECLS
201 #endif /* PURPLE_MEDIA_CODEC_H */