Thumbnailer

Description

Thumbnailer related functions

flu_thumbnailer_new ()

FluThumbnailer * flu_thumbnailer_new (void);

Creates a new FluThumbnailer

Since: 1.0

Returns

The newly created thumnailer

flu_thumbnailer_ref ()

FluThumbnailer * flu_thumbnailer_ref (FluThumbnailer *thiz);

Add a reference to a FluThumbnailer

Since: 1.1

Parameters

thiz

The thumbnailer to be referenced

Returns

The same object, for programming convenience.

[transfer full]

flu_thumbnailer_unref ()

void flu_thumbnailer_unref (FluThumbnailer *thiz);

Remove a reference from a FluThumbnailer

Since: 1.1

Parameters

thiz

The thumbnailer to be unreferenced

flu_thumbnailer_open ()

gboolean flu_thumbnailer_open (FluThumbnailer *thiz, const gchar *input_uri, gboolean disable_hw_accel, GError **error);

Opens a file with an FluThumbnailer

Since: 1.0

Parameters

thiz

The FluThumbnailer

input_uri

URI of the input video to open.

disable_hw_accel

Disables hardware acceleration

error

Pass the address of a GError pointer to store back detailed information about any error that may occur while opening the thumbnailer. You can pass NULL to ignore detailed error reporting.

Returns

TRUE if successful, FALSE otherwise

flu_thumbnailer_close ()

void flu_thumbnailer_close (FluThumbnailer *thiz);

Closes an FluThumbnailer

Since: 1.0

Parameters

thiz

The FluThumbnailer to close

flu_thumbnailer_frame_rgb_get ()

gboolean flu_thumbnailer_frame_rgb_get (FluThumbnailer *thiz, gint64 position, gboolean accurate, FluStreamVideoRgbFormat format, gint *width, gint *height, guint8 **data, guint32 *pitch, GError **error);

Takes a RGB thumbnail at a stream position

Since: 1.0

Parameters

thiz

The FluThumbnailer

position

The position in the stream, pass -1 to extract thumbnail at current position.

accurate

Indicates weither the position can be approximated

format

The FluStreamVideoRgbFormat format to use

width

The desired width of the frame (-1 to use the native width).

height

The desired height of the frame (-1 to use the native height).

data

The pointer to get the frame data from. In case of NULL the library will allocate the memory for you and you should use g_free().

pitch

The pitch of the frame. The number of pitches depend on the format used. In case data is NULL the pitch value will be set.

error

Pass the address of a GError pointer to store back detailed information about any error that may occur while extracting a frame. You can pass NULL to ignore detailed error reporting.

Returns

TRUE if successful, FALSE otherwise

flu_thumbnailer_frame_ycbcr_get ()

gboolean flu_thumbnailer_frame_ycbcr_get (FluThumbnailer *thiz, gint64 position, gboolean accurate, FluStreamVideoYcbcrFormat format, gint *width, gint *height, guint8 **planes, guint32 *pitches, GError **error);

Takes a YCbCr thumbnail at a stream position

Since: 1.0

Parameters

thiz

The FluThumbnailer

position

The position in the stream, pass -1 to extract thumbnail at current position.

accurate

Indicates weither the position can be approximated

format

The FluStreamVideoYcbcrFormat format to use

width

The desired width of the frame (-1 to use the native width).

height

The desired height of the frame (-1 to use the native height).

planes

array of planes pointers to store the pixels. The number of planes in the provided array depends on the format used (1 plane with YUYV and 2 planes with other formats). Each plane pointer can be NULL in such case the library will allocate the memory for you and you should use g_free() to free the corresponding memory. The provided array must be valid and must have enough size to store pointers for each plane.

pitches

array of pitches for each plane. The number of pitches depends on the format used and must be equal to the number of planes. The provided array must be valid and must have enough size to store pitches for each plane.

error

Pass the address of a GError pointer to store back detailed information about any error that may occur while extracting a frame. You can pass NULL to ignore detailed error reporting.

Returns

TRUE if successful, FALSE otherwise

flu_thumbnailer_frame_encoded_get ()

gboolean flu_thumbnailer_frame_encoded_get (FluThumbnailer *thiz, gint64 position, gboolean accurate, FluStreamVideoFrameFormat format, gint *width, gint *height, guint8 **data, guint *size, GError **error);

Extract a JPEG or PNG thumbnail at a stream position.

Since: 1.1

Parameters

thiz

The FluThumbnailer

position

The position in the stream, pass -1 to get thumbnail at current position.

accurate

Indicates weither the position can be approximated

format

The FluStreamVideoFrameFormat format to use

width

The desired width of the frame (-1 to use the native width).

height

The desired height of the frame (-1 to use the native height).

data

Address of a pointer where data are going to be copied. On succes, data pointer will be filled out with the address of a binary data block representing the encoded content of the frame. In this case, data content must be freed using g_free(). In case of failure, data pointer will be filled out with NULL.

size

size in bytes of the buffer returned by data parameter.

error

Pass the address of a GError pointer to store back detailed information about any error that may occur while extracting a frame. You can pass NULL to ignore detailed error reporting.

Returns

TRUE if successful, FALSE otherwise

flu_thumbnailer_frame_save ()

gboolean flu_thumbnailer_frame_save (FluThumbnailer *thiz, gint64 position, gboolean accurate, FluStreamVideoFrameFormat format, gint width, gint height, const gchar *location, GError **error);

Saves a frame at a stream position into an image file

Since: 1.0

Parameters

thiz

The FluThumbnailer

position

The position in the stream, pass -1 to save thumbnail at current position.

accurate

Indicates weither the position can be approximated

format

The FluStreamVideoFrameFormat format to use

width

The desired width of the frame (-1 to use the native width)

height

The desired height of the frame (-1 to use the native height)

location

The file path to save the file (not a URI)

error

Pass the address of a GError pointer to store back detailed information about any error that may occur while saving a thumbnail. You can pass NULL to ignore detailed error reporting.

Returns

TRUE if successful, FALSE otherwise

flu_thumbnailer_duration_get ()

gboolean flu_thumbnailer_duration_get (FluThumbnailer *thiz, gint64 *duration);

Gets the duration of the media set

Since: 1.0

Parameters

thiz

The FluThumbnailer to get the duration from

duration

The duration specified in nanoseconds.

Returns

TRUE if the duration is valid, FALSE otherwise

Types and Values

FluThumbnailer

typedef struct { } FluThumbnailer;

An opaque structure representing a thumbnailer instance.