pidgin 2.14.14dev
Loading...
Searching...
No Matches
media-gst.h File Reference

Media API. More...

#include "media.h"
#include "mediamanager.h"
#include <gst/gst.h>
Include dependency graph for media-gst.h:

Go to the source code of this file.

Macros

#define PURPLE_TYPE_MEDIA_ELEMENT_TYPE   (purple_media_element_type_get_type())
 
#define PURPLE_TYPE_MEDIA_ELEMENT_INFO   (purple_media_element_info_get_type())
 
#define PURPLE_MEDIA_ELEMENT_INFO(obj)   (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_MEDIA_ELEMENT_INFO, PurpleMediaElementInfo))
 
#define PURPLE_MEDIA_ELEMENT_INFO_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_MEDIA_ELEMENT_INFO, PurpleMediaElementInfo))
 
#define PURPLE_IS_MEDIA_ELEMENT_INFO(obj)   (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_MEDIA_ELEMENT_INFO))
 
#define PURPLE_IS_MEDIA_ELEMENT_INFO_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_MEDIA_ELEMENT_INFO))
 
#define PURPLE_MEDIA_ELEMENT_INFO_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_MEDIA_ELEMENT_INFO, PurpleMediaElementInfo))
 

Typedefs

typedef struct _PurpleMediaElementInfo PurpleMediaElementInfo
 An opaque structure representing an audio/video source/sink.
 
typedef struct _PurpleMediaElementInfoClass PurpleMediaElementInfoClass
 
typedef GstElement *(* PurpleMediaElementCreateCallback) (PurpleMedia *media, const gchar *session_id, const gchar *participant)
 

Enumerations

enum  PurpleMediaElementType {
  PURPLE_MEDIA_ELEMENT_NONE = 0 , PURPLE_MEDIA_ELEMENT_AUDIO = 1 , PURPLE_MEDIA_ELEMENT_VIDEO = 1 << 1 , PURPLE_MEDIA_ELEMENT_AUDIO_VIDEO ,
  PURPLE_MEDIA_ELEMENT_NO_SRCS = 0 , PURPLE_MEDIA_ELEMENT_ONE_SRC = 1 << 2 , PURPLE_MEDIA_ELEMENT_MULTI_SRC = 1 << 3 , PURPLE_MEDIA_ELEMENT_REQUEST_SRC = 1 << 4 ,
  PURPLE_MEDIA_ELEMENT_NO_SINKS = 0 , PURPLE_MEDIA_ELEMENT_ONE_SINK = 1 << 5 , PURPLE_MEDIA_ELEMENT_MULTI_SINK = 1 << 6 , PURPLE_MEDIA_ELEMENT_REQUEST_SINK = 1 << 7 ,
  PURPLE_MEDIA_ELEMENT_UNIQUE = 1 << 8 , PURPLE_MEDIA_ELEMENT_SRC = 1 << 9 , PURPLE_MEDIA_ELEMENT_SINK = 1 << 10 , PURPLE_MEDIA_ELEMENT_APPLICATION = 1 << 11
}
 

Functions

GType purple_media_element_type_get_type (void)
 Gets the element type's GType.
 
GType purple_media_element_info_get_type (void)
 Gets the element info's GType.
 
GstElement * purple_media_get_src (PurpleMedia *media, const gchar *sess_id)
 Gets the source from a session.
 
GstElement * purple_media_get_tee (PurpleMedia *media, const gchar *session_id, const gchar *participant)
 Gets the tee from a given session/stream.
 
GstElement * purple_media_manager_get_pipeline (PurpleMediaManager *manager)
 Gets the pipeline from the media manager.
 
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.
 
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 infos.
 
PurpleMediaElementInfopurple_media_manager_get_element_info (PurpleMediaManager *manager, const gchar *name)
 
gboolean purple_media_manager_register_element (PurpleMediaManager *manager, PurpleMediaElementInfo *info)
 
gboolean purple_media_manager_unregister_element (PurpleMediaManager *manager, const gchar *name)
 
gboolean purple_media_manager_set_active_element (PurpleMediaManager *manager, PurpleMediaElementInfo *info)
 
PurpleMediaElementInfopurple_media_manager_get_active_element (PurpleMediaManager *manager, PurpleMediaElementType type)
 
void purple_media_manager_set_video_caps (PurpleMediaManager *manager, GstCaps *caps)
 Reduces media formats supported by the video source to given set.
 
GstCaps * purple_media_manager_get_video_caps (PurpleMediaManager *manager)
 Returns current set of media formats limiting the output from video source.
 
gchar * purple_media_element_info_get_id (PurpleMediaElementInfo *info)
 
gchar * purple_media_element_info_get_name (PurpleMediaElementInfo *info)
 
PurpleMediaElementType purple_media_element_info_get_element_type (PurpleMediaElementInfo *info)
 
GstElement * purple_media_element_info_call_create (PurpleMediaElementInfo *info, PurpleMedia *media, const gchar *session_id, const gchar *participant)
 

Detailed Description

Media API.

Definition in file media-gst.h.

Macro Definition Documentation

◆ PURPLE_IS_MEDIA_ELEMENT_INFO

#define PURPLE_IS_MEDIA_ELEMENT_INFO (   obj)    (G_TYPE_CHECK_INSTANCE_TYPE((obj), PURPLE_TYPE_MEDIA_ELEMENT_INFO))

Definition at line 41 of file media-gst.h.

◆ PURPLE_IS_MEDIA_ELEMENT_INFO_CLASS

#define PURPLE_IS_MEDIA_ELEMENT_INFO_CLASS (   klass)    (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_MEDIA_ELEMENT_INFO))

Definition at line 42 of file media-gst.h.

◆ PURPLE_MEDIA_ELEMENT_INFO

#define PURPLE_MEDIA_ELEMENT_INFO (   obj)    (G_TYPE_CHECK_INSTANCE_CAST((obj), PURPLE_TYPE_MEDIA_ELEMENT_INFO, PurpleMediaElementInfo))

Definition at line 39 of file media-gst.h.

◆ PURPLE_MEDIA_ELEMENT_INFO_CLASS

#define PURPLE_MEDIA_ELEMENT_INFO_CLASS (   klass)    (G_TYPE_CHECK_CLASS_CAST((klass), PURPLE_TYPE_MEDIA_ELEMENT_INFO, PurpleMediaElementInfo))

Definition at line 40 of file media-gst.h.

◆ PURPLE_MEDIA_ELEMENT_INFO_GET_CLASS

#define PURPLE_MEDIA_ELEMENT_INFO_GET_CLASS (   obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_MEDIA_ELEMENT_INFO, PurpleMediaElementInfo))

Definition at line 43 of file media-gst.h.

◆ PURPLE_TYPE_MEDIA_ELEMENT_INFO

#define PURPLE_TYPE_MEDIA_ELEMENT_INFO   (purple_media_element_info_get_type())

Definition at line 38 of file media-gst.h.

◆ PURPLE_TYPE_MEDIA_ELEMENT_TYPE

#define PURPLE_TYPE_MEDIA_ELEMENT_TYPE   (purple_media_element_type_get_type())

Definition at line 37 of file media-gst.h.

Typedef Documentation

◆ PurpleMediaElementCreateCallback

typedef GstElement *(* PurpleMediaElementCreateCallback) (PurpleMedia *media, const gchar *session_id, const gchar *participant)

Definition at line 48 of file media-gst.h.

◆ PurpleMediaElementInfo

typedef struct _PurpleMediaElementInfo PurpleMediaElementInfo

An opaque structure representing an audio/video source/sink.

Definition at line 46 of file media-gst.h.

◆ PurpleMediaElementInfoClass

typedef struct _PurpleMediaElementInfoClass PurpleMediaElementInfoClass

Definition at line 47 of file media-gst.h.

Enumeration Type Documentation

◆ PurpleMediaElementType

Enumerator
PURPLE_MEDIA_ELEMENT_AUDIO 

empty element

PURPLE_MEDIA_ELEMENT_VIDEO 

supports audio

PURPLE_MEDIA_ELEMENT_AUDIO_VIDEO 

supports video

PURPLE_MEDIA_ELEMENT_NO_SRCS 

supports audio and video

PURPLE_MEDIA_ELEMENT_ONE_SRC 

has no src pads

PURPLE_MEDIA_ELEMENT_MULTI_SRC 

has one src pad

PURPLE_MEDIA_ELEMENT_REQUEST_SRC 

has multiple src pads

PURPLE_MEDIA_ELEMENT_NO_SINKS 

src pads must be requested

PURPLE_MEDIA_ELEMENT_ONE_SINK 

has no sink pads

PURPLE_MEDIA_ELEMENT_MULTI_SINK 

has one sink pad

PURPLE_MEDIA_ELEMENT_REQUEST_SINK 

has multiple sink pads

PURPLE_MEDIA_ELEMENT_UNIQUE 

sink pads must be requested

PURPLE_MEDIA_ELEMENT_SRC 

This element is unique and only one instance of it should be created at a time.

PURPLE_MEDIA_ELEMENT_SINK 

can be set as an active src

PURPLE_MEDIA_ELEMENT_APPLICATION 

can be set as an active sink

Definition at line 51 of file media-gst.h.

Function Documentation

◆ purple_media_element_info_get_type()

GType purple_media_element_info_get_type ( void  )

Gets the element info's GType.

Returns
The element info's GType.
Since
2.6.0

◆ purple_media_element_type_get_type()

GType purple_media_element_type_get_type ( void  )

Gets the element type's GType.

Returns
The element type's GType.
Since
2.6.0

◆ purple_media_get_src()

GstElement * purple_media_get_src ( PurpleMedia media,
const gchar *  sess_id 
)

Gets the source from a session.

Parameters
mediaThe media object the session is in.
sess_idThe session id of the session to get the source from.
Returns
The source retrieved.
Since
2.6.0

◆ 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.

Parameters
mediaThe instance to get the tee from.
session_idThe id of the session to get the tee from.
participantOptionally, the participant of the stream to get the tee from.
Returns
The GstTee element from the chosen session/stream.
Since
2.6.0

◆ 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 infos.

@type: The type of element infos to get.

Returns: A #GList of registered PurpleMediaElementInfo instances that match @type.

◆ 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.

Parameters
managerThe media manager to use to obtain the source/sink.
typeThe type of source/sink to get.
mediaThe media call this element is requested for.
session_idThe id of the session this element is requested for or NULL.
participantThe remote user this element is requested for or NULL.
Since
2.6.0

◆ purple_media_manager_get_pipeline()

GstElement * purple_media_manager_get_pipeline ( PurpleMediaManager manager)

Gets the pipeline from the media manager.

Parameters
managerThe media manager to get the pipeline from.
Returns
The pipeline.
Since
2.6.0

◆ 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.

Parameters
managerThe media manager to get the media formats from.
Returns
GstCaps limiting the video source's formats.
Since
2.8.0

◆ 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.

Useful to force negotiation of smaller picture resolution more suitable for use with particular codec and communication protocol without rescaling.

Parameters
managerThe media manager to set the media formats.
capsSet of allowed media formats.
Since
2.8.0