Stream

Description

Stream interface

flu_stream_type_get ()

FluStreamType flu_stream_type_get (FluStream *thiz);

Gets the type of a FluStream

Parameters

thiz

The stream to get the type from

Returns

The type of the stream

flu_stream_ref ()

FluStream * flu_stream_ref (FluStream *thiz);

Increase the reference count of an FluStream

Parameters

thiz

The stream to increase the reference count

Returns

The same stream for programming convenience

flu_stream_unref ()

void flu_stream_unref (FluStream *thiz);

Decrease the reference count of an FluStream

Parameters

thiz

The stream to decrease the reference count

flu_stream_is_active ()

gboolean flu_stream_is_active (FluStream *thiz);

Checks if an FluStream is active

Parameters

thiz

The stream to check if it is active

Returns

TRUE if the stream is active, FALSE otherwise

flu_stream_is_ignored ()

gboolean flu_stream_is_ignored (FluStream *thiz);

Checks if an FluStream is ignored

Parameters

thiz

The stream to check if it is ignored

Returns

TRUE if the stream is ignored, FALSE otherwise

flu_stream_is_pending ()

gboolean flu_stream_is_pending (FluStream *thiz);

Checks if an FluStream is pending for activation

Parameters

thiz

The stream to check if it is pending for activation

Returns

TRUE if the stream is pending for activation, FALSE otherwise

flu_stream_info_get ()

gboolean flu_stream_info_get (FluStream *thiz, const FluStreamInfo **info);

Gets the information of an FluStream

Parameters

thiz

The stream to get the information from

info

The pointer to store the stream information

Returns

TRUE if the operation succeeded, FALSE otherwise

flu_stream_expose ()

void flu_stream_expose (FluStream *thiz);

Tell an FluStream to expose the last frame This will redraw the last frame on the destination texture

Parameters

thiz

The FluStream of type FLU_STREAM_TYPE_VIDEO to expose

flu_stream_mouse_event_send ()

void flu_stream_mouse_event_send (FluStream *thiz, const gchar *event, gint button, gdouble x, gdouble y);

Send a mouse event to a FluStream. These events are typically retrieved from the user Interface layer (e.g. GTK) and sent to the stream for processing (e.g., by the DVD virtual machine inside Fluendo SDK).

Parameters

thiz

The FluStream to send the mouse event to

event

The type of mouse event, as a text string. Recognised values are "mouse-button-press", "mouse-button-release" and "mouse-move".

button

The pressed button

x

The X coordinate of the mouse event

y

The Y coordinate of the mouse event

flu_stream_key_event_send ()

void flu_stream_key_event_send (FluStream *thiz, const gchar *event, const gchar *key);

Send a key event to a FluStream. These events are typically retrieved from the user Interface layer (e.g. GTK) and sent to the stream for processing (e.g., by the DVD virtual machine inside Fluendo SDK).

Parameters

thiz

The FluStream to send the key event to

event

The type of the key event, as a text string. Recognised values are "key-press" and "key-release".

key

The key to send

flu_stream_navigation_cmd_send ()

void flu_stream_navigation_cmd_send (FluStream *thiz, FluStreamNavigationCommand command);

Send a navigation command to a FluStream. These events are typically generated through a User Interface menu, remote or special key and sent to the stream for processing (e.g., by the DVD virtual machine inside Fluendo SDK).

Parameters

thiz

The FluStream to send the navigation command to

command

The command to send

flu_stream_texture_set ()

void flu_stream_texture_set (FluStream *thiz, guintptr handle, gboolean handle_aspect_ratio);

Sets the video texture on a FluStream. The texture pointer is system dependent. For X11 you need to pass a XDrawable, for android a ANativeWindow, for Windows a HWND and for Quartz an NSView.

Parameters

thiz

The FluStream of type FLU_STREAM_TYPE_VIDEO to set the texture on

handle

The texture to set

handle_aspect_ratio

indicates that the video rendering element should handle the black borders to maintain video's original aspect ratio.

flu_stream_texture_get ()

guintptr flu_stream_texture_get (FluStream *thiz);

Gets the video texture from a FluStream

Parameters

thiz

The FluStream of type FLU_STREAM_TYPE_VIDEO to get the texture from

Returns

The system dependent pointer see flu_stream_texture_set()

flu_stream_volume_set ()

void flu_stream_volume_set (FluStream *thiz, gfloat volume);

Sets the volume of a FluStream

Parameters

thiz

The FluStream of type FLU_STREAM_TYPE_AUDIO to set the volume on

volume

The volume to set, in the range of 0 to 1

flu_stream_volume_get ()

void flu_stream_volume_get (FluStream *thiz, gfloat *volume);

Gets the volume of a FluStream

Parameters

thiz

The FluStream of type FLU_STREAM_TYPE_AUDIO to get the volume from

volume

The volume to get, in the range of 0 to 1

flu_stream_time_offset_set ()

void flu_stream_time_offset_set (FluStream *thiz, gint64 offset);

Sets the time offset of a FluStream. Setting a time offset on a stream will make the playback of the stream be shifted by the time specified. This is useful, for example, to synchronize the playback in case the streams are badly muxed, or to synchronize the subtitles.

Parameters

thiz

The FluStream to set the offset to

offset

The offset time in nanoseconds

flu_stream_time_offset_get ()

void flu_stream_time_offset_get (FluStream *thiz, gint64 *offset);

Gets the time offset of a FluStream. Initially the offset will be set to zero. In case flu_stream_time_offset_set() is used to set another value, this function will return such value.

Parameters

thiz

The FluStream to get the offset from

offset

The offset time in nanoseconds

flu_stream_position_get ()

gboolean flu_stream_position_get (FluStream *thiz, gint64 *position);

Gets the current position of this stream. Player position describes an overall clock position, and not the current sample that is being rendered for a particular stream. In some cases it might be required by the application developer to know what is the current position of a specific stream to easily return to that position. (For exemple a subtitle buffer or sparse video stream)

Parameters

thiz

The FluStream to get the position from

position

The position specified in nanoseconds

Returns

TRUE if the position is valid, FALSE otherwise

flu_stream_roi_set ()

gboolean flu_stream_roi_set (FluStream *thiz, gint x, gint y, gint w, gint h);

Set the ROI (Region of Interest) on a stream note: The stream must be of type FLU_STREAM_TYPE_VIDEO

Parameters

thiz

The FluStream to set the ROI

x

The x coordinate of the ROI rectangle

y

The y coordinate of the ROI rectangle

w

The width of the ROI rectangle

h

The height of the ROI rectangle

Returns

TRUE of the ROI can be set, FALSE otherwise

flu_stream_roi_get ()

gboolean flu_stream_roi_get (FluStream *thiz, gint *x, gint *y, gint *w, gint *h);

Get the ROI (Region of Interest) of a stream note: The stream must be of type FLU_STREAM_TYPE_VIDEO

Parameters

thiz

The FluStream to set the ROI

x

The x coordinate of the ROI rectangle

y

The y coordinate of the ROI rectangle

w

The width of the ROI rectangle

h

The height of the ROI rectangle

Returns

TRUE if successful, FALSE otherwise

flu_stream_render_rectangle_set ()

gboolean flu_stream_render_rectangle_set (FluStream *thiz, gint x, gint y, gint width, gint height);

Set the render rectangle on a stream. A render rectangle specifies the area of the texture the stream must draw into note: The stream must be of type FLU_STREAM_TYPE_VIDEO

Parameters

thiz

The FluStream to set the render rectangle

x

The x coordinate of the render rectangle

y

The y coordinate of the render rectangle

w

The width of the render rectangle

h

The height of the render rectangle

Returns

TRUE of the render rectangle can be set, FALSE otherwise

flu_stream_render_rectangle_get ()

gboolean flu_stream_render_rectangle_get (FluStream *thiz, gint *x, gint *y, gint *width, gint *height);

Get the render rectangle on a stream. A render rectangle specifies the area of the texture the stream must draw into note: The stream must be of type FLU_STREAM_TYPE_VIDEO

Parameters

thiz

The FluStream to get the render rectangle from

x

The x coordinate of the render rectangle

y

The y coordinate of the render rectangle

w

The width of the render rectangle

h

The height of the render rectangle

Returns

TRUE of the render rectangle can be get, FALSE otherwise

flu_stream_text_pango_get ()

gboolean flu_stream_text_pango_get (FluStream *thiz, gchar **content, gsize *len);

Get the current pango content from a FluStream note: The stream must be active and of type FLU_STREAM_TYPE_TEXT

Parameters

thiz

The FluStream to get the pango content from

content

The pointer to store the pango content on

len

The length of the content pointer

Returns

TRUE if successful, FALSE otherwise

flu_stream_text_plain_get ()

gboolean flu_stream_text_plain_get (FluStream *thiz, gchar **content, gsize *len);

Get the current plain text from a FluStream note: The stream must be active and of type FLU_STREAM_TYPE_TEXT

Parameters

thiz

The FluStream to get the plain text content from

content

The pointer to store the text plain content on

len

The length of the content pointer

Returns

TRUE if successful, FALSE otherwise

flu_stream_frame_ycbcr_get ()

gboolean flu_stream_frame_ycbcr_get (FluStream *thiz, FluStreamVideoYcbcrFormat format, gint width, gint height, guint8 **planes, guint32 *pitches);

Get the current YCbCr frame pixels from a FluStream note: The stream must be active and of type FLU_STREAM_TYPE_VIDEO

Parameters

thiz

The FluStream to get the YCbCr pixels from

format

The FluStreamVideoYcbcrFormat format to use

width

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

height

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

planes

The planes pointer to store the pixels. The number of planes depend on the format used

pitches

The pitch for each plane. The number of pitches depend on the format used.

Returns

TRUE if successful, FALSE otherwise

flu_stream_frame_ycbcr_push ()

gboolean flu_stream_frame_ycbcr_push (FluStream *thiz, FluStreamVideoYcbcrFormat format, gint width, gint height, guint8 **planes, guint32 *pitches);

flu_stream_frame_rgb_get ()

gboolean flu_stream_frame_rgb_get (FluStream *thiz, FluStreamVideoRgbFormat format, gint width, gint height, guint8 *data, guint32 pitch);

Get the current RGB frame pixels from a FluStream note: The stream must be active and of type FLU_STREAM_TYPE_VIDEO

Parameters

thiz

The FluStream to get the RGB pixels from

format

The FluStreamVideoRgbFormat format to use

width

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

height

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

data

The pointer where data is to be stored

pitch

The pitch of the frame (distance in bytes from the beginning of a row to the beginning of the next)

Returns

TRUE if successful, FALSE otherwise

flu_stream_frame_rgb_push ()

gboolean flu_stream_frame_rgb_push (FluStream *thiz, FluStreamVideoRgbFormat format, gint width, gint height, guint8 *data, guint32 pitch);

flu_stream_frame_save ()

gboolean flu_stream_frame_save (FluStream *thiz, FluStreamVideoFrameFormat format, gint width, gint height, gchar *location);

Save the current frame into an image file note: The stream must be active and of type FLU_STREAM_TYPE_VIDEO

Parameters

thiz

The FluStream to save to a file

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)

Returns

TRUE if successful, FALSE otherwise

flu_stream_user_data_add ()

void flu_stream_user_data_add (FluStream *thiz, const gchar *key, gpointer user_data, GDestroyNotify destroy);

Add user provided data into a stream

Parameters

thiz

The FluStream to store the user data into

key

The name to identify the data stored

destroy

The callback function to relase user_data when the FluStream is destroyed

flu_stream_user_data_remove ()

void flu_stream_user_data_remove (FluStream *thiz, const gchar *key);

Remove user provided data from a stream

Parameters

thiz

The FluStream to remove the user data from

key

The name to identify the data stored

flu_stream_user_data_get ()

gpointer flu_stream_user_data_get (FluStream *thiz, const gchar *key);

Get the user provided data from a stream

Parameters

thiz

The FluStream to get the user data from

key

The name to identify the data stored

flu_stream_info_clear ()

void flu_stream_info_clear (FluStreamInfo *sinfo);

Clear (initialize to default values) a FluStreamInfo structure and frees associated memory.

Parameters

sinfo

The information to clear

flu_stream_info_copy ()

void flu_stream_info_copy (FluStreamInfo *target, const FluStreamInfo *src);

Copy the information of a stream This function will copy data from a source FluStreamInfo into a target structure. While doing so it will first free the members of target to avoid memory leaks. Target does not need to be of the same type as src.

note: Use flu_stream_info_clear() to clear and free the information of the struct

Parameters

target

The FluStreamInfo to write the information to

src

The FluStreamInfo to the copy the information from

flu_stream_info_merge ()

void flu_stream_info_merge (FluStreamInfo *target, const FluStreamInfo *src);

Merge the information of a stream with another information. This function will merge data from a source FluStreamInfo into a target structure. Merging means copying fields that are present in source but not in target. Both src and target should be of the same type or target should be of unknown type.

Parameters

target

The FluStreamInfo to merge the information into

src

The FluStreamInfo to merge the information from

Types and Values

enum FluStreamType

Enum values used to describe different type of streams handled by an FluPlayer.

FLU_STREAM_TYPE_UNKNOWN

Unknown stream type, mostly used for uninitialized.

FLU_STREAM_TYPE_VIDEO

Video stream.

FLU_STREAM_TYPE_AUDIO

Audio stream.

FLU_STREAM_TYPE_TEXT

Text stream.

enum FluStreamTextType

Enum values used to describe different type of text data that can be received by a text FluStream.

FLU_STREAM_TEXT_TYPE_UNKNOWN

Unknown text data format.

FLU_STREAM_TEXT_TYPE_PANGO_MARKUP

UTF-8 text using Pango Markup language.

FLU_STREAM_TEXT_TYPE_PLAIN

UTF-8 plain text with no markup.

FLU_STREAM_TEXT_TYPE_TTML

TTML Markup language.

enum FluStreamVideoYcbcrFormat

Enum values used to describe different types of YCbCr formats

FLU_STREAM_VIDEO_YCBCR_FORMAT_YUYV

Identical to YUY2, YUNV, V422.

FLU_STREAM_VIDEO_YCBCR_FORMAT_YV12

YV12

enum FluStreamVideoRgbFormat

Enum values used to describe different types of RGB formats

FLU_STREAM_VIDEO_RGB_FORMAT_R8G8B8

FLU_STREAM_VIDEO_RGB_FORMAT_B8G8R8X8

FLU_STREAM_VIDEO_RGB_FORMAT_B8G8R8A8

enum FluStreamVideoFrameFormat

Enum values to describe different type of frame formats used when exporting to a file.

FLU_STREAM_VIDEO_FILE_FORMAT_JPEG

JPEG

FLU_STREAM_VIDEO_FILE_FORMAT_PNG

PNG

enum FluStreamVideoOrientation

Enum values used to describe different video orientations

FLU_STREAM_VIDEO_ORIENTATION_0

No rotation

FLU_STREAM_VIDEO_ORIENTATION_90

90 degrees clockwise rotation

FLU_STREAM_VIDEO_ORIENTATION_180

180 degrees clockwise rotation

FLU_STREAM_VIDEO_ORIENTATION_270

270 degrees clockwise rotation

FLU_STREAM_VIDEO_ORIENTATION_FLIP_0

No rotation and horizontal mirroring

FLU_STREAM_VIDEO_ORIENTATION_FLIP_90

90 degrees clockwise rotation and horizontal mirroring

FLU_STREAM_VIDEO_ORIENTATION_FLIP_180

180 degrees clockwise rotation and horizontal mirroring

FLU_STREAM_VIDEO_ORIENTATION_FLIP_270

270 degrees clockwise rotation and horizontal mirroring

enum FluStreamVideoCodec

List of known codecs that can be used for encoding

FLU_STREAM_VIDEO_CODEC_UNKNOWN

FLU_STREAM_VIDEO_CODEC_H264

FLU_STREAM_VIDEO_CODEC_WMV

FluStreamVideoInfo

typedef struct { gint width; gint height; gint fps_n; gint fps_d; gint par_n; gint par_d; gint bitrate; gchar *codec; FluStreamVideoOrientation orientation; FluStreamVideoCodec vcodec; } FluStreamVideoInfo;

Video specific information about an FluStream.

enum FluStreamAudioCodec

List of known codecs that can be used for encoding

FLU_STREAM_AUDIO_CODEC_UNKNOWN

FLU_STREAM_AUDIO_CODEC_AAC

FLU_STREAM_AUDIO_CODEC_MP3

FLU_STREAM_AUDIO_CODEC_WMA

FluStreamAudioInfo

typedef struct { gint channels; gint rate; gint width; gint depth; gint bitrate; gchar *language; gchar *iso; gchar *codec; guint extension; FluStreamAudioCodec acodec; } FluStreamAudioInfo;

Audio specific information about an FluStream.

FluStreamTextInfo

typedef struct { FluStreamTextType type; gchar *language; gchar *iso; gchar *codec; guint extension; gboolean external; } FluStreamTextInfo;

union FluStreamInfoData

Generic "stream info data" type, used only in FluStreamInfo;

struct FluStreamInfo

struct FluStreamInfo { FluStreamType type; gint index; guint group_index; FluStreamInfoData data; };

Generic structure providing information about an FluStream. Use the type field to know how to access data in the FluStreamInfoData union .

enum FluMediaInfoFormat

Enum values used to describe the different known formats available

FLU_MEDIA_INFO_FORMAT_UNKNOWN

Unknown format

FLU_MEDIA_INFO_FORMAT_AUDIO_ONLY

Audio only format

FLU_MEDIA_INFO_FORMAT_ASF

ASF Format

FLU_MEDIA_INFO_FORMAT_MP4

MPEG4 Format

FLU_MEDIA_INFO_FORMAT_WEBM

WEBM Format

FluMediaInfo

typedef struct { gchar *title; gchar *author; gchar *copyright; gchar *container; gint64 duration; FluMediaInfoFormat format; } FluMediaInfo;

General media information about the media currently opened by an FluPlayer or generated by a FluRecorder

enum FluStreamNavigationCommand

Enum values used to describe different user commands that can be sent to an FluStream through the navigation interface. These are typically used for DVD menu navigation, for example.

FLU_STREAM_NAVIGATION_COMMAND_MENU1

Go to menu 1.

FLU_STREAM_NAVIGATION_COMMAND_MENU2

Go to menu 2.

FLU_STREAM_NAVIGATION_COMMAND_MENU3

Go to menu 3.

FLU_STREAM_NAVIGATION_COMMAND_MENU4

Go to menu 4.

FLU_STREAM_NAVIGATION_COMMAND_MENU5

Go to menu 5.

FLU_STREAM_NAVIGATION_COMMAND_MENU6

Go to menu 6.

FLU_STREAM_NAVIGATION_COMMAND_MENU7

Go to menu 7.

FLU_STREAM_NAVIGATION_COMMAND_LEFT

Go left.

FLU_STREAM_NAVIGATION_COMMAND_RIGHT

Go right.

FLU_STREAM_NAVIGATION_COMMAND_UP

Go up.

FLU_STREAM_NAVIGATION_COMMAND_DOWN

Go down.

FLU_STREAM_NAVIGATION_COMMAND_ACTIVATE

Activate current selection

FLU_STREAM_NAVIGATION_COMMAND_PREV_ANGLE

Select previous angle

FLU_STREAM_NAVIGATION_COMMAND_NEXT_ANGLE

Select next angle

FluStream

typedef struct { } FluStream;

An opaque structure representing a media stream instance.