Macros | Typedefs | Enumerations | Functions
media-gst.h File Reference
libpurple

Media API. More...

`#include "media.h"`
`#include "mediamanager.h"`
`#include <gst/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. More...
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. More...
GType | purple_media_element_info_get_type (void)
| Gets the element info's GType. More...
GstElement * | purple_media_get_src (PurpleMedia *media, const gchar *sess_id)
| Gets the source from a session. More...
GstElement * | purple_media_get_tee (PurpleMedia *media, const gchar *session_id, const gchar *participant)
| Gets the tee from a given session/stream. More...
GstElement * | purple_media_manager_get_pipeline (PurpleMediaManager *manager)
| Gets the pipeline from the media manager. More...
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. More...
PurpleMediaElementInfo * | purple_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)
PurpleMediaElementInfo * | purple_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. More...
GstCaps * | purple_media_manager_get_video_caps (PurpleMediaManager *manager)
| Returns current set of media formats limiting the output from video source. More...
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.

## Typedef Documentation

## ◆ PurpleMediaElementInfo

typedef struct _PurpleMediaElementInfo PurpleMediaElementInfo

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

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

## Enumeration Type Documentation

## ◆ PurpleMediaElementType

enum 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

  media | The media object the session is in.
  sess_id | The 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

  media | The instance to get the tee from.
  session_id | The id of the session to get the tee from.
  participant | Optionally, 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_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

  manager | The media manager to use to obtain the source/sink.
  type | The type of source/sink to get.
  media | The media call this element is requested for.
  session_id | The id of the session this element is requested for or NULL.
  participant | The 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

  manager | The 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

  manager | The 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

  manager | The media manager to set the media formats.
  caps | Set of allowed media formats.

Since
  2.8.0