pidgin: media-gst.h Source File

pidgin 2.14.4

Loading...
Searching...
No Matches
media-gst.h
Go to the documentation of this file.
1
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_GST_H_
28#define _PURPLE_MEDIA_GST_H_
29
30#include "media.h"
31#include "mediamanager.h"
32
33#include <gst/gst.h>
34
35G_BEGIN_DECLS
36
37#define PURPLE_TYPE_MEDIA_ELEMENT_TYPE (purple_media_element_type_get_type())
38#define PURPLE_TYPE_MEDIA_ELEMENT_INFO (purple_media_element_info_get_type())
39#define PURPLE_MEDIA_ELEMENT_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_MEDIA_ELEMENT_INFO, PurpleMediaElementInfo))
40#define PURPLE_MEDIA_ELEMENT_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_MEDIA_ELEMENT_INFO, PurpleMediaElementInfo))
41#define PURPLE_IS_MEDIA_ELEMENT_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_MEDIA_ELEMENT_INFO))
42#define PURPLE_IS_MEDIA_ELEMENT_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_MEDIA_ELEMENT_INFO))
43#define PURPLE_MEDIA_ELEMENT_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_MEDIA_ELEMENT_INFO, PurpleMediaElementInfo))
44
46 typedef struct _PurpleMediaElementInfo PurpleMediaElementInfo;
47typedef struct _PurpleMediaElementInfoClass PurpleMediaElementInfoClass;
48typedef GstElement *(*PurpleMediaElementCreateCallback)(PurpleMedia *media,
49 const gchar *session_id, const gchar *participant);
50
51 typedef enum {
52 PURPLE_MEDIA_ELEMENT_NONE = 0,
53 PURPLE_MEDIA_ELEMENT_AUDIO = 1,
54 PURPLE_MEDIA_ELEMENT_VIDEO = 1 << 1,
55 PURPLE_MEDIA_ELEMENT_AUDIO_VIDEO = PURPLE_MEDIA_ELEMENT_AUDIO
56 | PURPLE_MEDIA_ELEMENT_VIDEO,
58 PURPLE_MEDIA_ELEMENT_NO_SRCS = 0,
59 PURPLE_MEDIA_ELEMENT_ONE_SRC = 1 << 2,
60 PURPLE_MEDIA_ELEMENT_MULTI_SRC = 1 << 3,
61 PURPLE_MEDIA_ELEMENT_REQUEST_SRC = 1 << 4,
63 PURPLE_MEDIA_ELEMENT_NO_SINKS = 0,
64 PURPLE_MEDIA_ELEMENT_ONE_SINK = 1 << 5,
65 PURPLE_MEDIA_ELEMENT_MULTI_SINK = 1 << 6,
66 PURPLE_MEDIA_ELEMENT_REQUEST_SINK = 1 << 7,
68 PURPLE_MEDIA_ELEMENT_UNIQUE = 1 << 8,
72 PURPLE_MEDIA_ELEMENT_SRC = 1 << 9,
73 PURPLE_MEDIA_ELEMENT_SINK = 1 << 10,
74 PURPLE_MEDIA_ELEMENT_APPLICATION = 1 << 11,
75} PurpleMediaElementType;
76
77#ifdef __cplusplus
78extern "C" {
79#endif
80
88GType purple_media_element_type_get_type(void);
89
97GType purple_media_element_info_get_type(void);
98
109GstElement *purple_media_get_src(PurpleMedia *media, const gchar *sess_id);
110
122GstElement *purple_media_get_tee(PurpleMedia *media,
123 const gchar *session_id, const gchar *participant);
124
125
135GstElement *purple_media_manager_get_pipeline(PurpleMediaManager *manager);
136
148GstElement *purple_media_manager_get_element(PurpleMediaManager *manager,
149 PurpleMediaSessionType type, PurpleMedia *media,
150 const gchar *session_id, const gchar *participant);
151
160GList *purple_media_manager_enumerate_elements(PurpleMediaManager *manager,
161 PurpleMediaElementType type);
162
163 PurpleMediaElementInfo *purple_media_manager_get_element_info(
164 PurpleMediaManager *manager, const gchar *name);
165gboolean purple_media_manager_register_element(PurpleMediaManager *manager,
166 PurpleMediaElementInfo *info);
167gboolean purple_media_manager_unregister_element(PurpleMediaManager *manager,
168 const gchar *name);
169gboolean purple_media_manager_set_active_element(PurpleMediaManager *manager,
170 PurpleMediaElementInfo *info);
171 PurpleMediaElementInfo *purple_media_manager_get_active_element(
172 PurpleMediaManager *manager, PurpleMediaElementType type);
173
185 void purple_media_manager_set_video_caps(PurpleMediaManager *manager,
186 GstCaps *caps);
187
197GstCaps *purple_media_manager_get_video_caps(PurpleMediaManager *manager);
198
199gchar *purple_media_element_info_get_id(PurpleMediaElementInfo *info);
200gchar *purple_media_element_info_get_name(PurpleMediaElementInfo *info);
201 PurpleMediaElementType purple_media_element_info_get_element_type(
202 PurpleMediaElementInfo *info);
203GstElement *purple_media_element_info_call_create(
204 PurpleMediaElementInfo *info, PurpleMedia *media,
205 const gchar *session_id, const gchar *participant);
206
207#ifdef __cplusplus
208}
209#endif
210
211G_END_DECLS
212
213#endif /* _PURPLE_MEDIA_GST_H_ */
purple_media_manager_set_video_caps
void purple_media_manager_set_video_caps(PurpleMediaManager *manager, GstCaps *caps)
Reduces media formats supported by the video source to given set.
purple_media_element_type_get_type
GType purple_media_element_type_get_type(void)
Gets the element type's GType.
purple_media_manager_get_pipeline
GstElement * purple_media_manager_get_pipeline(PurpleMediaManager *manager)
Gets the pipeline from the media manager.
purple_media_get_src
GstElement * purple_media_get_src(PurpleMedia *media, const gchar *sess_id)
Gets the source from a session.
purple_media_manager_enumerate_elements
GList * purple_media_manager_enumerate_elements(PurpleMediaManager *manager, PurpleMediaElementType type)
purple_media_manager_enumerate_elements: @manager: The media manager to use to obtain the element inf...
purple_media_element_info_get_type
GType purple_media_element_info_get_type(void)
Gets the element info's GType.
purple_media_get_tee
GstElement * purple_media_get_tee(PurpleMedia *media, const gchar *session_id, const gchar *participant)
Gets the tee from a given session/stream.
PurpleMediaElementType
PurpleMediaElementType
Definition: media-gst.h:51
PURPLE_MEDIA_ELEMENT_MULTI_SRC
@ PURPLE_MEDIA_ELEMENT_MULTI_SRC
has one src pad
Definition: media-gst.h:60
PURPLE_MEDIA_ELEMENT_UNIQUE
@ PURPLE_MEDIA_ELEMENT_UNIQUE
sink pads must be requested
Definition: media-gst.h:68
PURPLE_MEDIA_ELEMENT_SINK
@ PURPLE_MEDIA_ELEMENT_SINK
can be set as an active src
Definition: media-gst.h:73
PURPLE_MEDIA_ELEMENT_NO_SINKS
@ PURPLE_MEDIA_ELEMENT_NO_SINKS
src pads must be requested
Definition: media-gst.h:63
PURPLE_MEDIA_ELEMENT_AUDIO_VIDEO
@ PURPLE_MEDIA_ELEMENT_AUDIO_VIDEO
supports video
Definition: media-gst.h:55
PURPLE_MEDIA_ELEMENT_APPLICATION
@ PURPLE_MEDIA_ELEMENT_APPLICATION
can be set as an active sink
Definition: media-gst.h:74
PURPLE_MEDIA_ELEMENT_REQUEST_SINK
@ PURPLE_MEDIA_ELEMENT_REQUEST_SINK
has multiple sink pads
Definition: media-gst.h:66
PURPLE_MEDIA_ELEMENT_VIDEO
@ PURPLE_MEDIA_ELEMENT_VIDEO
supports audio
Definition: media-gst.h:54
PURPLE_MEDIA_ELEMENT_NO_SRCS
@ PURPLE_MEDIA_ELEMENT_NO_SRCS
supports audio and video
Definition: media-gst.h:58
PURPLE_MEDIA_ELEMENT_SRC
@ PURPLE_MEDIA_ELEMENT_SRC
This element is unique and only one instance of it should be created at a time.
Definition: media-gst.h:72
PURPLE_MEDIA_ELEMENT_ONE_SINK
@ PURPLE_MEDIA_ELEMENT_ONE_SINK
has no sink pads
Definition: media-gst.h:64
PURPLE_MEDIA_ELEMENT_MULTI_SINK
@ PURPLE_MEDIA_ELEMENT_MULTI_SINK
has one sink pad
Definition: media-gst.h:65
PURPLE_MEDIA_ELEMENT_REQUEST_SRC
@ PURPLE_MEDIA_ELEMENT_REQUEST_SRC
has multiple src pads
Definition: media-gst.h:61
PURPLE_MEDIA_ELEMENT_AUDIO
@ PURPLE_MEDIA_ELEMENT_AUDIO
empty element
Definition: media-gst.h:53
PURPLE_MEDIA_ELEMENT_ONE_SRC
@ PURPLE_MEDIA_ELEMENT_ONE_SRC
has no src pads
Definition: media-gst.h:59
purple_media_manager_get_element
GstElement * purple_media_manager_get_element(PurpleMediaManager *manager, PurpleMediaSessionType type, PurpleMedia *media, const gchar *session_id, const gchar *participant)
Returns a GStreamer source or sink for audio or video.
PurpleMediaElementInfo
struct _PurpleMediaElementInfo PurpleMediaElementInfo
An opaque structure representing an audio/video source/sink.
Definition: media-gst.h:46
purple_media_manager_get_video_caps
GstCaps * purple_media_manager_get_video_caps(PurpleMediaManager *manager)
Returns current set of media formats limiting the output from video source.
media.h
Media API.
PurpleMedia
struct _PurpleMedia PurpleMedia
An opaque structure representing a media call.
Definition: media.h:48
mediamanager.h
Media Manager API.
PurpleMediaManager
struct _PurpleMediaManager PurpleMediaManager
An opaque structure representing a group of (usually all) media calls.
Definition: mediamanager.h:34