GESTimelinePipeline

GESTimelinePipeline — Convenience GstPipeline for editing.

Synopsis

#include <ges/ges.h>

                    GESTimelinePipeline;
enum                GESPipelineFlags;
GESTimelinePipeline *  ges_timeline_pipeline_new        (void);
gboolean            ges_timeline_pipeline_add_timeline  (GESTimelinePipeline *pipeline,
                                                         GESTimeline *timeline);
gboolean            ges_timeline_pipeline_set_mode      (GESTimelinePipeline *pipeline,
                                                         GESPipelineFlags mode);
gboolean            ges_timeline_pipeline_set_render_settings
                                                        (GESTimelinePipeline *pipeline,
                                                         gchar *output_uri,
                                                         GstEncodingProfile *profile);
GstBuffer *         ges_timeline_pipeline_get_thumbnail_buffer
                                                        (GESTimelinePipeline *self,
                                                         GstCaps *caps);
GstBuffer *         ges_timeline_pipeline_get_thumbnail_rgb24
                                                        (GESTimelinePipeline *self,
                                                         gint width,
                                                         gint height);
gboolean            ges_timeline_pipeline_save_thumbnail
                                                        (GESTimelinePipeline *self,
                                                         int width,
                                                         int height,
                                                         const gchar *format,
                                                         const gchar *location);

Object Hierarchy

  GObject
   +----GstObject
         +----GstElement
               +----GstBin
                     +----GstPipeline
                           +----GESTimelinePipeline

Implemented Interfaces

GESTimelinePipeline implements GstChildProxy.

Description

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

Details

GESTimelinePipeline

typedef struct _GESTimelinePipeline GESTimelinePipeline;

enum GESPipelineFlags

typedef enum {
  TIMELINE_MODE_PREVIEW_AUDIO = 1 << 0,
  TIMELINE_MODE_PREVIEW_VIDEO = 1 << 1,
  TIMELINE_MODE_PREVIEW		= TIMELINE_MODE_PREVIEW_AUDIO | TIMELINE_MODE_PREVIEW_VIDEO,
  TIMELINE_MODE_RENDER		= 1 << 2,
  TIMELINE_MODE_SMART_RENDER = 1 << 3
} GESPipelineFlags;

The various modes the GESTimelinePipeline can be configured to.

TIMELINE_MODE_PREVIEW_AUDIO

output audio to the soundcard

TIMELINE_MODE_PREVIEW_VIDEO

output video to the screen

TIMELINE_MODE_PREVIEW

output audio/video to soundcard/screen (default)

TIMELINE_MODE_RENDER

render timeline (forces decoding)

TIMELINE_MODE_SMART_RENDER

render timeline (tries to avoid decoding/reencoding)

ges_timeline_pipeline_new ()

GESTimelinePipeline *  ges_timeline_pipeline_new        (void);

Creates a new conveninence GESTimelinePipeline.

Returns :

the new GESTimelinePipeline.

ges_timeline_pipeline_add_timeline ()

gboolean            ges_timeline_pipeline_add_timeline  (GESTimelinePipeline *pipeline,
                                                         GESTimeline *timeline);

Sets the timeline to use in this pipeline.

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

pipeline :

a GESTimelinePipeline

timeline :

the GESTimeline to set on the pipeline.

Returns :

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

ges_timeline_pipeline_set_mode ()

gboolean            ges_timeline_pipeline_set_mode      (GESTimelinePipeline *pipeline,
                                                         GESPipelineFlags mode);

switches the pipeline to the specified mode. The default mode when creating a GESTimelinePipeline is TIMELINE_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 GESTimelinePipeline

mode :

the GESPipelineFlags to use

Returns :

TRUE if the mode was properly set, else FALSE.

ges_timeline_pipeline_set_render_settings ()

gboolean            ges_timeline_pipeline_set_render_settings
                                                        (GESTimelinePipeline *pipeline,
                                                         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 TIMELINE_MODE_RENDER

pipeline :

a GESTimelinePipeline

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_timeline_pipeline_get_thumbnail_buffer ()

GstBuffer *         ges_timeline_pipeline_get_thumbnail_buffer
                                                        (GESTimelinePipeline *self,
                                                         GstCaps *caps);

Returns a GstBuffer with the currently playing in the format specified by caps. The caller should unref the gst_buffer_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 GESTimelinePipeline in GST_STATE_PLAYING or GST_STATE_PAUSED

caps :

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

Returns :

a GstBuffer or NULL. [transfer full]

ges_timeline_pipeline_get_thumbnail_rgb24 ()

GstBuffer *         ges_timeline_pipeline_get_thumbnail_rgb24
                                                        (GESTimelinePipeline *self,
                                                         gint width,
                                                         gint height);

A convenience method for ges_timeline_pipeline_get_thumbnail_raw 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 buffer with gst_buffer_unref.

self :

a GESTimelinePipeline 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 GstBuffer or NULL. [transfer full]

ges_timeline_pipeline_save_thumbnail ()

gboolean            ges_timeline_pipeline_save_thumbnail
                                                        (GESTimelinePipeline *self,
                                                         int width,
                                                         int height,
                                                         const gchar *format,
                                                         const gchar *location);

Saves the current frame to the specified location.

self :

a GESTimelinePipeline 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

Returns :

TRUE if the thumbnail was properly save, else FALSE.