annotate libpurple/media-gst.h @ 32796:5ae7e1f36b43

Fix a possible XMPP remote crash A series of specially crafted file transfer requests can cause clients to reference invalid memory. The user must have accepted one of the file transfer requests. The fix is to correctly cancel and free a SOCKS5 connection attempt so that it does not trigger an attempt to access invalid memory later. This was reported to us by Jos«± Valent«żn Guti«±rrez and this patch is written by Paul Aurich.
author Mark Doliner <mark@kingant.net>
date Mon, 07 May 2012 03:16:31 +0000
parents 55e30c0eca22
children 02a2e8183b1d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26349
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
1 /**
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
2 * @file media-gst.h Media API
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
3 * @ingroup core
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
4 */
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
5
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
6 /* purple
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
7 *
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
8 * Purple is the legal property of its developers, whose names are too numerous
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
9 * to list here. Please refer to the COPYRIGHT file distributed with this
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
10 * source distribution.
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
11 *
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
12 * This program is free software; you can redistribute it and/or modify
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
13 * it under the terms of the GNU General Public License as published by
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
15 * (at your option) any later version.
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
16 *
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
17 * This program is distributed in the hope that it will be useful,
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
20 * GNU General Public License for more details.
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
21 *
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
22 * You should have received a copy of the GNU General Public License
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
23 * along with this program; if not, write to the Free Software
28047
8c991e09efcb Update various header copyrights thanks to licensecheck.
Paul Aurich <paul@darkrain42.org>
parents: 26438
diff changeset
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
26349
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
25 */
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
26
26438
fd97c0de433d Add PURPLE to the media header sentinels and reorder includes to fix building gf2
Paul Aurich <paul@darkrain42.org>
parents: 26437
diff changeset
27 #ifndef _PURPLE_MEDIA_GST_H_
fd97c0de433d Add PURPLE to the media header sentinels and reorder includes to fix building gf2
Paul Aurich <paul@darkrain42.org>
parents: 26437
diff changeset
28 #define _PURPLE_MEDIA_GST_H_
26349
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
29
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
30 #include "media.h"
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
31 #include "mediamanager.h"
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
32
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
33 #include <gst/gst.h>
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
34
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
35 G_BEGIN_DECLS
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
36
26402
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
37 #define PURPLE_TYPE_MEDIA_ELEMENT_TYPE (purple_media_element_type_get_type())
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
38 #define PURPLE_TYPE_MEDIA_ELEMENT_INFO (purple_media_element_info_get_type())
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
39 #define PURPLE_MEDIA_ELEMENT_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_MEDIA_ELEMENT_INFO, PurpleMediaElementInfo))
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
40 #define PURPLE_MEDIA_ELEMENT_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_MEDIA_ELEMENT_INFO, PurpleMediaElementInfo))
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
41 #define PURPLE_IS_MEDIA_ELEMENT_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_MEDIA_ELEMENT_INFO))
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
42 #define PURPLE_IS_MEDIA_ELEMENT_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_MEDIA_ELEMENT_INFO))
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
43 #define PURPLE_MEDIA_ELEMENT_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_MEDIA_ELEMENT_INFO, PurpleMediaElementInfo))
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
44
28135
713987ae3215 Fix some docs warnings. Thanks to darkrain for pointing them out.
maiku@pidgin.im
parents: 28047
diff changeset
45 /** An opaque structure representing an audio/video source/sink. */
26349
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
46 typedef struct _PurpleMediaElementInfo PurpleMediaElementInfo;
26402
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
47 typedef struct _PurpleMediaElementInfoClass PurpleMediaElementInfoClass;
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
48 typedef GstElement *(*PurpleMediaElementCreateCallback)(PurpleMedia *media,
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
49 const gchar *session_id, const gchar *participant);
26349
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
50
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
51 typedef enum {
26402
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
52 PURPLE_MEDIA_ELEMENT_NONE = 0, /** empty element */
26349
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
53 PURPLE_MEDIA_ELEMENT_AUDIO = 1, /** supports audio */
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
54 PURPLE_MEDIA_ELEMENT_VIDEO = 1 << 1, /** supports video */
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
55 PURPLE_MEDIA_ELEMENT_AUDIO_VIDEO = PURPLE_MEDIA_ELEMENT_AUDIO
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
56 | PURPLE_MEDIA_ELEMENT_VIDEO, /** supports audio and video */
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
57
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
58 PURPLE_MEDIA_ELEMENT_NO_SRCS = 0, /** has no src pads */
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
59 PURPLE_MEDIA_ELEMENT_ONE_SRC = 1 << 2, /** has one src pad */
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
60 PURPLE_MEDIA_ELEMENT_MULTI_SRC = 1 << 3, /** has multiple src pads */
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
61 PURPLE_MEDIA_ELEMENT_REQUEST_SRC = 1 << 4, /** src pads must be requested */
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
62
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
63 PURPLE_MEDIA_ELEMENT_NO_SINKS = 0, /** has no sink pads */
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
64 PURPLE_MEDIA_ELEMENT_ONE_SINK = 1 << 5, /** has one sink pad */
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
65 PURPLE_MEDIA_ELEMENT_MULTI_SINK = 1 << 6, /** has multiple sink pads */
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
66 PURPLE_MEDIA_ELEMENT_REQUEST_SINK = 1 << 7, /** sink pads must be requested */
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
67
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
68 PURPLE_MEDIA_ELEMENT_UNIQUE = 1 << 8, /** This element is unique and
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
69 only one instance of it should
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
70 be created at a time */
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
71
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
72 PURPLE_MEDIA_ELEMENT_SRC = 1 << 9, /** can be set as an active src */
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
73 PURPLE_MEDIA_ELEMENT_SINK = 1 << 10, /** can be set as an active sink */
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
74 } PurpleMediaElementType;
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
75
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
76 #ifdef __cplusplus
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
77 extern "C" {
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
78 #endif
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
79
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
80 /**
26402
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
81 * Gets the element type's GType.
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
82 *
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
83 * @return The element type's GType.
26437
9eb8c8ec0a75 Even more @since tags, because Maiku's watching...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26402
diff changeset
84 *
9eb8c8ec0a75 Even more @since tags, because Maiku's watching...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26402
diff changeset
85 * @since 2.6.0
26402
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
86 */
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
87 GType purple_media_element_type_get_type(void);
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
88
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
89 /**
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
90 * Gets the element info's GType.
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
91 *
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
92 * @return The element info's GType.
26437
9eb8c8ec0a75 Even more @since tags, because Maiku's watching...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26402
diff changeset
93 *
9eb8c8ec0a75 Even more @since tags, because Maiku's watching...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26402
diff changeset
94 * @since 2.6.0
26402
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
95 */
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
96 GType purple_media_element_info_get_type(void);
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
97
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
98 /**
26349
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
99 * Gets the source from a session
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
100 *
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
101 * @param media The media object the session is in.
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
102 * @param sess_id The session id of the session to get the source from.
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
103 *
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
104 * @return The source retrieved.
26437
9eb8c8ec0a75 Even more @since tags, because Maiku's watching...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26402
diff changeset
105 *
9eb8c8ec0a75 Even more @since tags, because Maiku's watching...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26402
diff changeset
106 * @since 2.6.0
26349
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
107 */
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
108 GstElement *purple_media_get_src(PurpleMedia *media, const gchar *sess_id);
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
109
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
110 /**
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
111 * Gets the tee from a given session/stream.
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
112 *
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
113 * @param media The instance to get the tee from.
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
114 * @param session_id The id of the session to get the tee from.
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
115 * @param participant Optionally, the participant of the stream to get the tee from.
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
116 *
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
117 * @return The GstTee element from the chosen session/stream.
26437
9eb8c8ec0a75 Even more @since tags, because Maiku's watching...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26402
diff changeset
118 *
9eb8c8ec0a75 Even more @since tags, because Maiku's watching...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26402
diff changeset
119 * @since 2.6.0
26349
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
120 */
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
121 GstElement *purple_media_get_tee(PurpleMedia *media,
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
122 const gchar *session_id, const gchar *participant);
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
123
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
124
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
125 /**
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
126 * Gets the pipeline from the media manager.
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
127 *
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
128 * @param manager The media manager to get the pipeline from.
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
129 *
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
130 * @return The pipeline.
26437
9eb8c8ec0a75 Even more @since tags, because Maiku's watching...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26402
diff changeset
131 *
9eb8c8ec0a75 Even more @since tags, because Maiku's watching...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26402
diff changeset
132 * @since 2.6.0
26349
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
133 */
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
134 GstElement *purple_media_manager_get_pipeline(PurpleMediaManager *manager);
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
135
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
136 /**
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
137 * Returns a GStreamer source or sink for audio or video.
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
138 *
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
139 * @param manager The media manager to use to obtain the source/sink.
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
140 * @param type The type of source/sink to get.
28135
713987ae3215 Fix some docs warnings. Thanks to darkrain for pointing them out.
maiku@pidgin.im
parents: 28047
diff changeset
141 * @param media The media call this element is requested for.
713987ae3215 Fix some docs warnings. Thanks to darkrain for pointing them out.
maiku@pidgin.im
parents: 28047
diff changeset
142 * @param session_id The id of the session this element is requested for or NULL.
713987ae3215 Fix some docs warnings. Thanks to darkrain for pointing them out.
maiku@pidgin.im
parents: 28047
diff changeset
143 * @param participant The remote user this element is requested for or NULL.
26437
9eb8c8ec0a75 Even more @since tags, because Maiku's watching...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26402
diff changeset
144 *
9eb8c8ec0a75 Even more @since tags, because Maiku's watching...
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 26402
diff changeset
145 * @since 2.6.0
26349
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
146 */
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
147 GstElement *purple_media_manager_get_element(PurpleMediaManager *manager,
26392
9c671fc1b351 Give more information to element creation functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26350
diff changeset
148 PurpleMediaSessionType type, PurpleMedia *media,
9c671fc1b351 Give more information to element creation functions.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26350
diff changeset
149 const gchar *session_id, const gchar *participant);
26349
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
150
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
151 PurpleMediaElementInfo *purple_media_manager_get_element_info(
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
152 PurpleMediaManager *manager, const gchar *name);
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
153 gboolean purple_media_manager_register_element(PurpleMediaManager *manager,
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
154 PurpleMediaElementInfo *info);
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
155 gboolean purple_media_manager_unregister_element(PurpleMediaManager *manager,
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
156 const gchar *name);
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
157 gboolean purple_media_manager_set_active_element(PurpleMediaManager *manager,
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
158 PurpleMediaElementInfo *info);
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
159 PurpleMediaElementInfo *purple_media_manager_get_active_element(
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
160 PurpleMediaManager *manager, PurpleMediaElementType type);
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
161
31365
55e30c0eca22 Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
jakub.adam@ktknet.cz
parents: 28135
diff changeset
162 /**
55e30c0eca22 Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
jakub.adam@ktknet.cz
parents: 28135
diff changeset
163 * Reduces media formats supported by the video source to given set.
55e30c0eca22 Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
jakub.adam@ktknet.cz
parents: 28135
diff changeset
164 *
55e30c0eca22 Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
jakub.adam@ktknet.cz
parents: 28135
diff changeset
165 * Useful to force negotiation of smaller picture resolution more suitable for
55e30c0eca22 Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
jakub.adam@ktknet.cz
parents: 28135
diff changeset
166 * use with particular codec and communication protocol without rescaling.
55e30c0eca22 Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
jakub.adam@ktknet.cz
parents: 28135
diff changeset
167 *
55e30c0eca22 Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
jakub.adam@ktknet.cz
parents: 28135
diff changeset
168 * @param manager The media manager to set the media formats.
55e30c0eca22 Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
jakub.adam@ktknet.cz
parents: 28135
diff changeset
169 * @param caps Set of allowed media formats.
55e30c0eca22 Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
jakub.adam@ktknet.cz
parents: 28135
diff changeset
170 *
55e30c0eca22 Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
jakub.adam@ktknet.cz
parents: 28135
diff changeset
171 * @since 2.8.0
55e30c0eca22 Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
jakub.adam@ktknet.cz
parents: 28135
diff changeset
172 */
55e30c0eca22 Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
jakub.adam@ktknet.cz
parents: 28135
diff changeset
173 void purple_media_manager_set_video_caps(PurpleMediaManager *manager,
55e30c0eca22 Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
jakub.adam@ktknet.cz
parents: 28135
diff changeset
174 GstCaps *caps);
55e30c0eca22 Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
jakub.adam@ktknet.cz
parents: 28135
diff changeset
175
55e30c0eca22 Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
jakub.adam@ktknet.cz
parents: 28135
diff changeset
176 /**
55e30c0eca22 Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
jakub.adam@ktknet.cz
parents: 28135
diff changeset
177 * Returns current set of media formats limiting the output from video source.
55e30c0eca22 Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
jakub.adam@ktknet.cz
parents: 28135
diff changeset
178 *
55e30c0eca22 Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
jakub.adam@ktknet.cz
parents: 28135
diff changeset
179 * @param manager The media manager to get the media formats from.
55e30c0eca22 Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
jakub.adam@ktknet.cz
parents: 28135
diff changeset
180 *
55e30c0eca22 Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
jakub.adam@ktknet.cz
parents: 28135
diff changeset
181 * @return @c GstCaps limiting the video source's formats.
55e30c0eca22 Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
jakub.adam@ktknet.cz
parents: 28135
diff changeset
182 *
55e30c0eca22 Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
jakub.adam@ktknet.cz
parents: 28135
diff changeset
183 * @since 2.8.0
55e30c0eca22 Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
jakub.adam@ktknet.cz
parents: 28135
diff changeset
184 */
55e30c0eca22 Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
jakub.adam@ktknet.cz
parents: 28135
diff changeset
185 GstCaps *purple_media_manager_get_video_caps(PurpleMediaManager *manager);
55e30c0eca22 Public API allowing plugins (including prpls) to get/set video capabilities where desired/appropriate. Fixes #13095.
jakub.adam@ktknet.cz
parents: 28135
diff changeset
186
26402
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
187 gchar *purple_media_element_info_get_id(PurpleMediaElementInfo *info);
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
188 gchar *purple_media_element_info_get_name(PurpleMediaElementInfo *info);
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
189 PurpleMediaElementType purple_media_element_info_get_element_type(
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
190 PurpleMediaElementInfo *info);
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
191 GstElement *purple_media_element_info_call_create(
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
192 PurpleMediaElementInfo *info, PurpleMedia *media,
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
193 const gchar *session_id, const gchar *participant);
081a819bc710 Hide and gobjectify PurpleMediaElementInfo.
Mike Ruprecht <maiku@soc.pidgin.im>
parents: 26393
diff changeset
194
26349
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
195 #ifdef __cplusplus
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
196 }
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
197 #endif
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
198
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
199 G_END_DECLS
1ae3af12095a Move GStreamer related media functions into its own header.
Mike Ruprecht <maiku@soc.pidgin.im>
parents:
diff changeset
200
26438
fd97c0de433d Add PURPLE to the media header sentinels and reorder includes to fix building gf2
Paul Aurich <paul@darkrain42.org>
parents: 26437
diff changeset
201 #endif /* _PURPLE_MEDIA_GST_H_ */