Stream

Stream — Stream interface

Functions

Types and Values

Description

Stream interface

Functions

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.

[transfer full]


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. Returned structure lifetime is the same as the associated FluStream instance. If you need to keep FluStreamInfo data beyond the lifetime of the FluStream instance, you can use flu_stream_info_copy() to copy them to a local instance. Don't forget to call flu_stream_info_clear() later on your local instance to free up memory.

[out][transfer none]

Returns

TRUE if the operation succeeded, FALSE otherwise


flu_stream_get_source ()

FluSource *
flu_stream_get_source (FluStream *thiz);

get the source the stream belongs to

Parameters

thiz

The FluStream

 

Returns

source of the stream or NULL.

[transfer full]


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.

[out]

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.

[out]

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.

[out]

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.

[out]

y

The y coordinate of the ROI rectangle.

[out]

w

The width of the ROI rectangle.

[out]

h

The height of the ROI rectangle.

[out]

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

 

width

The width of the render rectangle

 

height

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.

[out]

y

The y coordinate of the render rectangle.

[out]

width

The width of the render rectangle.

[out]

height

The height of the render rectangle.

[out]

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.

[out]

len

The length of the content pointer.

[out]

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.

[out]

len

The length of the content pointer.

[out]

Returns

TRUE if successful, FALSE otherwise


flu_stream_data_xml_get ()

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

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

Parameters

thiz

The FluStream to get the xml text content from

 

content

The pointer to store the text xml content on

 

len

The length of the content

 

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 width of the frame (-1 to use the native width)

 

height

The desired height 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,
                          gpointer 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 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 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_encoded_get ()

gboolean
flu_stream_frame_encoded_get (FluStream *thiz,
                              FluStreamVideoFrameFormat format,
                              gint width,
                              gint height,
                              guint8 **data,
                              guint *size);

Get the current frame out of a FluStream, encoded in the format specified by FluStreamVideoFrameFormat format. Note: Stream must be active and have FLU_STREAM_TYPE_VIDEO or FLU_STREAM_TYPE_TEXT type.

Parameters

thiz

The FluStream to get the frame pixels from

 

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.

[out][type gpointer]

size

size in bytes of the buffer returned by data parameter.

[out]

Returns

TRUE if successful, FALSE otherwise


flu_stream_frame_save ()

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

Save the current frame into an image file Note: Stream must be active and have FLU_STREAM_TYPE_VIDEO or FLU_STREAM_TYPE_TEXT type.

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

 

Returns

A pointer to the user data.

[transfer none]


flu_stream_last_sample_copy ()

gboolean
flu_stream_last_sample_copy (FluStream *thiz,
                             FluStream *out_stream);

Gets the last sample from a stream and forwards it the output stream.

note: The output stream must be a FluStream requested, for example from a FluRecorder. Both streams must be of the same type, as you can't copy an audio sample to a stream of type FLU_STREAM_TYPE_VIDEO

Parameters

thiz

The FluStream to copy the last sample from

 

out_stream

The FluStream to copy the last sample too

 

Returns

TRUE if successful, FALSE otherwise

Types and Values

enum FluStreamVideoYcbcrFormat

Enum values used to describe different types of YCbCr formats

Members

FLU_STREAM_VIDEO_YCBCR_FORMAT_YUYV

Identical to YUY2, YUNV, V422.

 

FLU_STREAM_VIDEO_YCBCR_FORMAT_YV12

YV12

 

FLU_STREAM_VIDEO_YCBCR_FORMAT_I420

   

enum FluStreamVideoRgbFormat

Enum values used to describe different types of RGB formats

Members

FLU_STREAM_VIDEO_RGB_FORMAT_R8G8B8

   

FLU_STREAM_VIDEO_RGB_FORMAT_B8G8R8X8

   

FLU_STREAM_VIDEO_RGB_FORMAT_B8G8R8A8

   

FluStreamChangedFlags

Bit-field structure to inform what changed in a stream

Members

guint32 all;

   

guint32 added :1;

the stream was added

 

guint32 removed :1;

the stream was removed

 

guint32 active :1;

the stream was activated or deactivated

 

guint32 info :1;

FluStreamInfo changed

 

enum FluStreamAudioInfoFeatures

Audio specific mask to inform what fields are set or not

Members

FLU_STREAM_AUDIO_FEATURE_EXTENSION

Has the extension field set

 

FLU_STREAM_AUDIO_FEATURE_DESCRIPTION

Has the audio description field set

 

enum FluStreamTextInfoFeatures

Text specific mask to inform what fields are set or not

Members

FLU_STREAM_TEXT_FEATURE_HEARING_IMPAIRED

Has the hearing_impaired field set

 

enum FluStreamInfoFeatures

Specific mask to inform what fields are set or not

Members

FLU_STREAM_FEATURE_GROUP_INDEX

Has the group_index field set

 

FLU_STREAM_FEATURE_COMPONENT_TAG

Has the component_tag field set

 

FLU_STREAM_FEATURE_AV_PID

Has the av_pid field set

 

FLU_STREAM_FEATURE_IS_ENCRYPTED

Has the is_encrypted field set

 

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.

Members

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.