ClutterGstVideoTexture

ClutterGstVideoTexture — Actor for playback of video files.

Synopsis

enum                ClutterGstSeekFlags;
enum                ClutterGstBufferingMode;
                    ClutterGstVideoTexture;
                    ClutterGstVideoTextureClass;
ClutterActor *      clutter_gst_video_texture_new       (void);
GstElement *        clutter_gst_video_texture_get_pipeline
                                                        (ClutterGstVideoTexture *texture);
CoglHandle          clutter_gst_video_texture_get_idle_material
                                                        (ClutterGstVideoTexture *texture);
void                clutter_gst_video_texture_set_idle_material
                                                        (ClutterGstVideoTexture *texture,
                                                         CoglHandle material);
gchar *             clutter_gst_video_texture_get_user_agent
                                                        (ClutterGstVideoTexture *texture);
void                clutter_gst_video_texture_set_user_agent
                                                        (ClutterGstVideoTexture *texture,
                                                         const gchar *user_agent);
void                clutter_gst_video_texture_set_seek_flags
                                                        (ClutterGstVideoTexture *texture,
                                                         ClutterGstSeekFlags flags);
ClutterGstSeekFlags  clutter_gst_video_texture_get_seek_flags
                                                        (ClutterGstVideoTexture *texture);
ClutterGstBufferingMode  clutter_gst_video_texture_get_buffering_mode
                                                        (ClutterGstVideoTexture *texture);
void                clutter_gst_video_texture_set_buffering_mode
                                                        (ClutterGstVideoTexture *texture,
                                                         ClutterGstBufferingMode mode);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----ClutterActor
               +----ClutterTexture
                     +----ClutterGstVideoTexture

Implemented Interfaces

ClutterGstVideoTexture implements ClutterScriptable, ClutterAnimatable, AtkImplementorIface and ClutterMedia.

Properties

  "idle-material"            CoglHandle*           : Read / Write
  "seek-flags"               ClutterGstSeekFlags   : Read / Write
  "user-agent"               gchar*                : Read / Write

Signals

  "download-buffering"                             : Run Last

Description

ClutterGstVideoTexture is a ClutterTexture that plays video files.

Details

enum ClutterGstSeekFlags

typedef enum _ClutterGstSeekFlags
{
  CLUTTER_GST_SEEK_FLAG_NONE     = 0,
  CLUTTER_GST_SEEK_FLAG_ACCURATE = 1 << 0
} ClutterGstSeekFlags;

Flags that can be given to clutter_gst_video_texture_set_seek_flags().

CLUTTER_GST_SEEK_FLAG_NONE

Fast seeks (key frame boundaries, default)

CLUTTER_GST_SEEK_FLAG_ACCURATE

Accurate seeks (potentially slower)

Since 1.4


enum ClutterGstBufferingMode

typedef enum _ClutterGstBufferingMode
{
  CLUTTER_GST_BUFFERING_MODE_STREAM,
  CLUTTER_GST_BUFFERING_MODE_DOWNLOAD
} ClutterGstBufferingMode;

Different buffering policies clutter-gst supports

CLUTTER_GST_BUFFERING_MODE_STREAM

In-memory buffering

CLUTTER_GST_BUFFERING_MODE_DOWNLOAD

On-disk buffering

Since 1.4


ClutterGstVideoTexture

typedef struct _ClutterGstVideoTexture ClutterGstVideoTexture;

Subclass of ClutterTexture that displays videos using GStreamer.

The ClutterGstVideoTexture structure contains only private data and should not be accessed directly.


ClutterGstVideoTextureClass

typedef struct {
} ClutterGstVideoTextureClass;

Base class for ClutterGstVideoTexture.


clutter_gst_video_texture_new ()

ClutterActor *      clutter_gst_video_texture_new       (void);

Creates a video texture.

Note

This function has to be called from Clutter's main thread. While GStreamer will spawn threads to do its work, we want all the GL calls to happen in the same thread. Clutter-gst knows which thread it is by assuming this constructor is called from the Clutter thread.

Returns :

the newly created video texture actor

clutter_gst_video_texture_get_pipeline ()

GstElement *        clutter_gst_video_texture_get_pipeline
                                                        (ClutterGstVideoTexture *texture);

Retrieves the GstPipeline used by the texture, for direct use with GStreamer API.

texture :

a ClutterGstVideoTexture

Returns :

the pipeline element used by the video texture

clutter_gst_video_texture_get_idle_material ()

CoglHandle          clutter_gst_video_texture_get_idle_material
                                                        (ClutterGstVideoTexture *texture);

Retrieves the material used to draw when no media is being played.

texture :

a ClutterGstVideoTexture

Returns :

the CoglHandle of the idle material

Since 1.2


clutter_gst_video_texture_set_idle_material ()

void                clutter_gst_video_texture_set_idle_material
                                                        (ClutterGstVideoTexture *texture,
                                                         CoglHandle material);

Sets a material to use to draw when no media is being played. The ClutterGstVideoTexture holds a reference of the material.

The default idle material will paint the ClutterGstVideoTexture in black. If COGL_INVALID_HANDLE is given as material to this function, this default idle material will be used.

texture :

a ClutterGstVideoTexture

material :

the handle of a Cogl material

Since 1.2


clutter_gst_video_texture_get_user_agent ()

gchar *             clutter_gst_video_texture_get_user_agent
                                                        (ClutterGstVideoTexture *texture);

Retrieves the user agent used when streaming.

texture :

a ClutterGstVideoTexture

Returns :

the user agent used. The returned string has to be freed with g_free()

Since 1.2


clutter_gst_video_texture_set_user_agent ()

void                clutter_gst_video_texture_set_user_agent
                                                        (ClutterGstVideoTexture *texture,
                                                         const gchar *user_agent);

Sets the user agent to use when streaming.

When streaming content, you might want to set a custom user agent, eg. to promote your software, make it appear in statistics or because the server requires a special user agent you want to impersonate.

texture :

a ClutterGstVideoTexture

user_agent :

the user agent

Since 1.2


clutter_gst_video_texture_set_seek_flags ()

void                clutter_gst_video_texture_set_seek_flags
                                                        (ClutterGstVideoTexture *texture,
                                                         ClutterGstSeekFlags flags);

Seeking can be done with several trade-offs. Clutter-gst defaults to CLUTTER_GST_SEEK_FLAG_NONE.

texture :

a ClutterGstVideoTexture

flags :

a combination of ClutterGstSeekFlags

Since 1.4


clutter_gst_video_texture_get_seek_flags ()

ClutterGstSeekFlags  clutter_gst_video_texture_get_seek_flags
                                                        (ClutterGstVideoTexture *texture);

Get the current value of the seek-flags property.

texture :

a ClutterGstVideoTexture

Returns :

a combination of ClutterGstSeekFlags

Since 1.4


clutter_gst_video_texture_get_buffering_mode ()

ClutterGstBufferingMode  clutter_gst_video_texture_get_buffering_mode
                                                        (ClutterGstVideoTexture *texture);

Since 1.4


clutter_gst_video_texture_set_buffering_mode ()

void                clutter_gst_video_texture_set_buffering_mode
                                                        (ClutterGstVideoTexture *texture,
                                                         ClutterGstBufferingMode mode);

Since 1.4

Property Details

The "idle-material" property

  "idle-material"            CoglHandle*           : Read / Write

Material to use for drawing when not playing.


The "seek-flags" property

  "seek-flags"               ClutterGstSeekFlags   : Read / Write

Flags to use when seeking.


The "user-agent" property

  "user-agent"               gchar*                : Read / Write

User Agent used with network protocols.

Default value: NULL

Signal Details

The "download-buffering" signal

void                user_function                      (ClutterGstVideoTexture *start,
                                                        gdouble                 stop,
                                                        gdouble                 arg2,
                                                        gpointer                user_data)      : Run Last

When streaming, GStreamer can cache the data in a buffer on the disk, something called progressive download or download buffering. This signal is fired when this streaming mode.

start :

Start of the buffer (between 0.0 and 1.0)

stop :

End of the buffer (between 0.0 and 1.0)

user_data :

user data set when the signal handler was connected.