GESPipeline

GESPipeline — Convenience GstPipeline for editing.

Synopsis

#include <ges/ges.h>

                    GESPipeline;
GESPipeline *       ges_pipeline_new                    (void);
gboolean            ges_pipeline_set_timeline           (GESPipeline *pipeline,
                                                         GESTimeline *timeline);
gboolean            ges_pipeline_set_mode               (GESPipeline *pipeline,
                                                         GESPipelineFlags mode);
gboolean            ges_pipeline_set_render_settings    (GESPipeline *pipeline,
                                                         const gchar *output_uri,
                                                         GstEncodingProfile *profile);
GstElement *        ges_pipeline_preview_get_audio_sink (GESPipeline *self);
GstElement *        ges_pipeline_preview_get_video_sink (GESPipeline *self);
void                ges_pipeline_preview_set_audio_sink (GESPipeline *self,
                                                         GstElement *sink);
void                ges_pipeline_preview_set_video_sink (GESPipeline *self,
                                                         GstElement *sink);
GESPipelineFlags    ges_pipeline_get_mode               (GESPipeline *pipeline);
GstSample *         ges_pipeline_get_thumbnail          (GESPipeline *self,
                                                         GstCaps *caps);
GstSample *         ges_pipeline_get_thumbnail_rgb24    (GESPipeline *self,
                                                         gint width,
                                                         gint height);
gboolean            ges_pipeline_save_thumbnail         (GESPipeline *self,
                                                         int width,
                                                         int height,
                                                         const gchar *format,
                                                         const gchar *location,
                                                         GError **error);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GstObject
               +----GstElement
                     +----GstBin
                           +----GstPipeline
                                 +----GESPipeline

Implemented Interfaces

GESPipeline implements GstChildProxy and GstVideoOverlay.

Properties

  "audio-sink"               GstElement*           : Read / Write
  "mode"                     GESPipelineFlags      : Read / Write
  "timeline"                 GESTimeline*          : Read / Write
  "video-sink"               GstElement*           : Read / Write

Description

GESPipeline allows developers to view and render GESTimeline in a simple fashion. Its usage is inspired by the 'playbin' element from gst-plugins-base.

Details

GESPipeline

typedef struct _GESPipeline GESPipeline;

ges_pipeline_new ()

GESPipeline *       ges_pipeline_new                    (void);

Creates a new conveninence GESPipeline.

Returns :

the new GESPipeline.

ges_pipeline_set_timeline ()

gboolean            ges_pipeline_set_timeline           (GESPipeline *pipeline,
                                                         GESTimeline *timeline);

Sets the timeline to use in this pipeline.

The reference to the timeline will be stolen by the pipeline.

pipeline :

a GESPipeline

timeline :

the GESTimeline to set on the pipeline.

Returns :

TRUE if the timeline could be successfully set on the pipeline, else FALSE.

ges_pipeline_set_mode ()

gboolean            ges_pipeline_set_mode               (GESPipeline *pipeline,
                                                         GESPipelineFlags mode);

switches the pipeline to the specified mode. The default mode when creating a GESPipeline is GES_PIPELINE_MODE_PREVIEW.

Note: The pipeline will be set to GST_STATE_NULL during this call due to the internal changes that happen. The caller will therefore have to set the pipeline to the requested state after calling this method.

pipeline :

a GESPipeline

mode :

the GESPipelineFlags to use

Returns :

TRUE if the mode was properly set, else FALSE.

ges_pipeline_set_render_settings ()

gboolean            ges_pipeline_set_render_settings    (GESPipeline *pipeline,
                                                         const gchar *output_uri,
                                                         GstEncodingProfile *profile);

Specify where the pipeline shall be rendered and with what settings.

A copy of profile and output_uri will be done internally, the caller can safely free those values afterwards.

This method must be called before setting the pipeline mode to GES_PIPELINE_MODE_RENDER

pipeline :

a GESPipeline

output_uri :

the URI to which the timeline will be rendered

profile :

the GstEncodingProfile to use to render the timeline.

Returns :

TRUE if the settings were aknowledged properly, else FALSE

ges_pipeline_preview_get_audio_sink ()

GstElement *        ges_pipeline_preview_get_audio_sink (GESPipeline *self);

Obtains a pointer to playsink's audio sink element that is used for displaying audio when the GESPipeline is in GES_PIPELINE_MODE_PREVIEW

The caller is responsible for unreffing the returned element with gst_object_unref.

self :

a GESPipeline

Returns :

a pointer to the playsink audio sink GstElement. [transfer full]

ges_pipeline_preview_get_video_sink ()

GstElement *        ges_pipeline_preview_get_video_sink (GESPipeline *self);

Obtains a pointer to playsink's video sink element that is used for displaying video when the GESPipeline is in GES_PIPELINE_MODE_PREVIEW

The caller is responsible for unreffing the returned element with gst_object_unref.

self :

a GESPipeline

Returns :

a pointer to the playsink video sink GstElement. [transfer full]

ges_pipeline_preview_set_audio_sink ()

void                ges_pipeline_preview_set_audio_sink (GESPipeline *self,
                                                         GstElement *sink);

Sets playsink's audio sink element that is used for displaying audio when the GESPipeline is in GES_PIPELINE_MODE_PREVIEW

self :

a GESPipeline in GST_STATE_NULL

sink :

a audio sink GstElement. [transfer none]

ges_pipeline_preview_set_video_sink ()

void                ges_pipeline_preview_set_video_sink (GESPipeline *self,
                                                         GstElement *sink);

Sets playsink's video sink element that is used for displaying video when the GESPipeline is in GES_PIPELINE_MODE_PREVIEW

self :

a GESPipeline in GST_STATE_NULL

sink :

a video sink GstElement. [transfer none]

ges_pipeline_get_mode ()

GESPipelineFlags    ges_pipeline_get_mode               (GESPipeline *pipeline);

pipeline :

a GESPipeline

Returns :

the GESPipelineFlags currently in use.

ges_pipeline_get_thumbnail ()

GstSample *         ges_pipeline_get_thumbnail          (GESPipeline *self,
                                                         GstCaps *caps);

Returns a GstSample with the currently playing image in the format specified by caps. The caller should free the sample with gst_sample_unref when finished. If ANY caps are specified, the information will be returned in the whatever format is currently used by the sink. This information can be retrieve from caps associated with the buffer.

self :

a GESPipeline in GST_STATE_PLAYING or GST_STATE_PAUSED

caps :

caps specifying current format. Use GST_CAPS_ANY for native size. [transfer none]

Returns :

a GstSample or NULL. [transfer full]

ges_pipeline_get_thumbnail_rgb24 ()

GstSample *         ges_pipeline_get_thumbnail_rgb24    (GESPipeline *self,
                                                         gint width,
                                                         gint height);

A convenience method for ges_pipeline_get_thumbnail which returns a buffer in 24-bit RGB, optionally scaled to the specified width and height. If -1 is specified for either dimension, it will be left at native size. You can retreive this information from the caps associated with the buffer.

The caller is responsible for unreffing the returned sample with gst_sample_unref.

self :

a GESPipeline in GST_STATE_PLAYING or GST_STATE_PAUSED

width :

the requested width or -1 for native size

height :

the requested height or -1 for native size

Returns :

a GstSample or NULL. [transfer full]

ges_pipeline_save_thumbnail ()

gboolean            ges_pipeline_save_thumbnail         (GESPipeline *self,
                                                         int width,
                                                         int height,
                                                         const gchar *format,
                                                         const gchar *location,
                                                         GError **error);

Saves the current frame to the specified location.

self :

a GESPipeline in GST_STATE_PLAYING or GST_STATE_PAUSED

width :

the requested width or -1 for native size

height :

the requested height or -1 for native size

format :

a string specifying the desired mime type (for example, image/jpeg)

location :

the path to save the thumbnail

error :

An error to be set in case something wrong happens or NULL. [out][allow-none][transfer full]

Returns :

TRUE if the thumbnail was properly save, else FALSE.

Property Details

The "audio-sink" property

  "audio-sink"               GstElement*           : Read / Write

Audio sink for the preview.


The "mode" property

  "mode"                     GESPipelineFlags      : Read / Write

Pipeline mode. See ges_pipeline_set_mode() for more info.

Default value: GES_PIPELINE_MODE_PREVIEW_AUDIO|GES_PIPELINE_MODE_PREVIEW_VIDEO


The "timeline" property

  "timeline"                 GESTimeline*          : Read / Write

Timeline to use in this pipeline. See also ges_pipeline_set_timeline() for more info.


The "video-sink" property

  "video-sink"               GstElement*           : Read / Write

Video sink for the preview.