MLT  7.22.0
Public Member Functions | Data Fields | Private Attributes
mlt_frame_s Struct Reference

Frame class. More...

#include <mlt_frame.h>

Inheritance diagram for mlt_frame_s:
mlt_properties_s

Public Member Functions

int mlt_audio_calculate_frame_samples (float fps, int frequency, int64_t position)
 Determine the number of samples that belong in a frame at a time position. More...
 
int64_t mlt_audio_calculate_samples_to_position (float fps, int frequency, int64_t position)
 Determine the number of samples that belong before a time position. More...
 
int mlt_audio_channel_layout_channels (mlt_channel_layout layout)
 Get the number of channels for a channel layout. More...
 
mlt_channel_layout mlt_audio_channel_layout_default (int channels)
 Get a default channel layout for a given number of channels. More...
 
mlt_channel_layout mlt_audio_channel_layout_id (const char *name)
 Get the id of channel layout from short name. More...
 
void mlt_audio_copy (mlt_audio dst, mlt_audio src, int samples, int src_start, int dst_start)
 Copy audio samples from src to dst. More...
 
const char * mlt_audio_format_name (mlt_audio_format format)
 Get the short name for an audio format. More...
 
int mlt_audio_format_size (mlt_audio_format format, int samples, int channels)
 Get the amount of bytes needed for a block of audio. More...
 
void mlt_audio_silence (mlt_audio self, int samples, int start)
 Set a range of samples to silence. More...
 
mlt_frame mlt_frame_clone (mlt_frame self, int is_deep)
 Make a copy of a frame. More...
 
mlt_frame mlt_frame_clone_audio (mlt_frame self, int is_deep)
 Make a copy of a frame and audio. More...
 
mlt_frame mlt_frame_clone_image (mlt_frame self, int is_deep)
 Make a copy of a frame and image. More...
 
void mlt_frame_close (mlt_frame self)
 Destroy the frame. More...
 
uint8_t * mlt_frame_get_alpha (mlt_frame self)
 Get the alpha channel associated to the frame (without creating if it has not). More...
 
uint8_t * mlt_frame_get_alpha_size (mlt_frame self, int *size)
 Get the alpha channel associated to the frame and its size. More...
 
double mlt_frame_get_aspect_ratio (mlt_frame self)
 Get the sample aspect ratio of the frame. More...
 
int mlt_frame_get_audio (mlt_frame self, void **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples)
 Get the audio associated to the frame. More...
 
int mlt_frame_get_image (mlt_frame self, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable)
 Get the image associated to the frame. More...
 
mlt_producer mlt_frame_get_original_producer (mlt_frame self)
 Get the end service that produced self frame. More...
 
mlt_position mlt_frame_get_position (mlt_frame self)
 Get the time position of this frame. More...
 
mlt_properties mlt_frame_get_unique_properties (mlt_frame self, mlt_service service)
 Get a properties object unique to this service instance. More...
 
unsigned char * mlt_frame_get_waveform (mlt_frame self, int w, int h)
 Get audio on a frame as a waveform image. More...
 
mlt_frame mlt_frame_init (mlt_service service)
 Construct a frame object. More...
 
int mlt_frame_is_test_audio (mlt_frame self)
 Determine if the frame will produce audio from a test card. More...
 
int mlt_frame_is_test_card (mlt_frame self)
 Determine if the frame will produce a test card image. More...
 
mlt_position mlt_frame_original_position (mlt_frame self)
 Get the original time position of this frame. More...
 
void * mlt_frame_pop_audio (mlt_frame self)
 Pop an audio item from the stack. More...
 
mlt_frame mlt_frame_pop_frame (mlt_frame self)
 Pop a frame. More...
 
mlt_get_image mlt_frame_pop_get_image (mlt_frame self)
 Pop a get_image callback. More...
 
void * mlt_frame_pop_service (mlt_frame self)
 Pop a service. More...
 
int mlt_frame_pop_service_int (mlt_frame self)
 Pop a number. More...
 
mlt_properties mlt_frame_properties (mlt_frame self)
 Get a frame's properties. More...
 
int mlt_frame_push_audio (mlt_frame self, void *that)
 Push an audio item on the stack. More...
 
int mlt_frame_push_frame (mlt_frame self, mlt_frame that)
 Push a frame. More...
 
int mlt_frame_push_get_image (mlt_frame self, mlt_get_image get_image)
 Stack a get_image callback. More...
 
int mlt_frame_push_service (mlt_frame self, void *that)
 Push a service. More...
 
int mlt_frame_push_service_int (mlt_frame self, int that)
 Push a number. More...
 
void mlt_frame_replace_image (mlt_frame self, uint8_t *image, mlt_image_format format, int width, int height)
 Replace image stack with the information provided. More...
 
mlt_deque mlt_frame_service_stack (mlt_frame self)
 Return the service stack. More...
 
int mlt_frame_set_alpha (mlt_frame self, uint8_t *alpha, int size, mlt_destructor destroy)
 Set a new alpha channel on the frame. More...
 
int mlt_frame_set_aspect_ratio (mlt_frame self, double value)
 Set the sample aspect ratio of the frame. More...
 
int mlt_frame_set_audio (mlt_frame self, void *buffer, mlt_audio_format format, int size, mlt_destructor destructor)
 Set the audio on a frame. More...
 
int mlt_frame_set_image (mlt_frame self, uint8_t *image, int size, mlt_destructor destroy)
 Set a new image on the frame. More...
 
int mlt_frame_set_position (mlt_frame self, mlt_position value)
 Set the time position of this frame. More...
 
mlt_properties mlt_frame_unique_properties (mlt_frame self, mlt_service service)
 Get or create a properties object unique to this service instance. More...
 
- Public Member Functions inherited from mlt_properties_s
char * mlt_properties_anim_get (mlt_properties self, const char *name, int position, int length)
 Get a string value by name at a frame position. More...
 
mlt_color mlt_properties_anim_get_color (mlt_properties self, const char *name, int position, int length)
 Get a color associated to the name at a frame position. More...
 
double mlt_properties_anim_get_double (mlt_properties self, const char *name, int position, int length)
 Get a real number associated to the name at a frame position. More...
 
int mlt_properties_anim_get_int (mlt_properties self, const char *name, int position, int length)
 Get an integer associated to the name at a frame position. More...
 
mlt_rect mlt_properties_anim_get_rect (mlt_properties self, const char *name, int position, int length)
 Get a rectangle associated to the name at a frame position. More...
 
int mlt_properties_anim_set (mlt_properties self, const char *name, const char *value, int position, int length)
 Set a property to a string at a frame position. More...
 
int mlt_properties_anim_set_color (mlt_properties self, const char *name, mlt_color value, int position, int length, mlt_keyframe_type keyframe_type)
 Set a property to an integer value by color at a frame position. More...
 
int mlt_properties_anim_set_double (mlt_properties self, const char *name, double value, int position, int length, mlt_keyframe_type keyframe_type)
 Set a property to a real number at a frame position. More...
 
int mlt_properties_anim_set_int (mlt_properties self, const char *name, int value, int position, int length, mlt_keyframe_type keyframe_type)
 Set a property to an integer value at a frame position. More...
 
int mlt_properties_anim_set_rect (mlt_properties self, const char *name, mlt_rect value, int position, int length, mlt_keyframe_type keyframe_type)
 Set a property to a rectangle value at a frame position. More...
 
void mlt_properties_clear (mlt_properties self, const char *name)
 Remove the value for a property. More...
 
void mlt_properties_close (mlt_properties self)
 Close a properties object. More...
 
int mlt_properties_copy (mlt_properties self, mlt_properties that, const char *prefix)
 Copy all serializable properties that match a prefix to another properties object. More...
 
int mlt_properties_count (mlt_properties self)
 Return the number of items in the list. More...
 
void mlt_properties_debug (mlt_properties self, const char *title, FILE *output)
 Output the properties to a file handle. More...
 
int mlt_properties_dec_ref (mlt_properties self)
 Decrement the reference count. More...
 
int mlt_properties_dir_list (mlt_properties self, const char *dirname, const char *pattern, int sort)
 Get the contents of a directory. More...
 
void mlt_properties_dump (mlt_properties self, FILE *output)
 Dump the properties to a file handle. More...
 
int mlt_properties_exists (mlt_properties self, const char *name)
 Check if a property exists. More...
 
char * mlt_properties_frames_to_time (mlt_properties self, mlt_position frames, mlt_time_format format)
 Convert a frame count to a time string. More...
 
int mlt_properties_from_utf8 (mlt_properties properties, const char *name_from, const char *name_to)
 Convert UTF-8 property to the locale-defined encoding. More...
 
char * mlt_properties_get (mlt_properties self, const char *name)
 Get a string value by name. More...
 
mlt_animation mlt_properties_get_animation (mlt_properties self, const char *name)
 Get the animation associated to the name. More...
 
mlt_color mlt_properties_get_color (mlt_properties self, const char *name)
 Convert a numeric property to a tuple of color components. More...
 
void * mlt_properties_get_data (mlt_properties self, const char *name, int *length)
 Get a binary data value associated to the name. More...
 
void * mlt_properties_get_data_at (mlt_properties self, int index, int *size)
 Get a data value by index. More...
 
double mlt_properties_get_double (mlt_properties self, const char *name)
 Get a floating point value associated to the name. More...
 
int mlt_properties_get_int (mlt_properties self, const char *name)
 Get an integer associated to the name. More...
 
int64_t mlt_properties_get_int64 (mlt_properties self, const char *name)
 Get a 64-bit integer associated to the name. More...
 
const char * mlt_properties_get_lcnumeric (mlt_properties self)
 Get the numeric locale for this properties object. More...
 
char * mlt_properties_get_name (mlt_properties self, int index)
 Get a property name by index. More...
 
mlt_position mlt_properties_get_position (mlt_properties self, const char *name)
 Get a position value associated to the name. More...
 
mlt_properties mlt_properties_get_properties (mlt_properties self, const char *name)
 Get a nested properties object by name. More...
 
mlt_properties mlt_properties_get_properties_at (mlt_properties self, int index)
 Get a nested properties object by index. More...
 
mlt_rect mlt_properties_get_rect (mlt_properties self, const char *name)
 Get a rectangle associated to the name. More...
 
char * mlt_properties_get_time (mlt_properties self, const char *name, mlt_time_format format)
 Get a time string associated to the name. More...
 
char * mlt_properties_get_value (mlt_properties self, int index)
 Get a property's string value by index. More...
 
char * mlt_properties_get_value_tf (mlt_properties self, int index, mlt_time_format time_format)
 Get a property's string value by index (with time format). More...
 
int mlt_properties_inc_ref (mlt_properties self)
 Increment the reference count. More...
 
int mlt_properties_inherit (mlt_properties self, mlt_properties that)
 Copy all serializable properties to another properties list. More...
 
int mlt_properties_init (mlt_properties self, void *child)
 Initialize a properties object that was already allocated. More...
 
int mlt_properties_is_anim (mlt_properties self, const char *name)
 Check if a property is animated. More...
 
int mlt_properties_is_sequence (mlt_properties properties)
 Determine if the properties list is really just a sequence or ordered list. More...
 
mlt_properties mlt_properties_load (const char *filename)
 Create a properties object by reading a .properties text file. More...
 
void mlt_properties_lock (mlt_properties self)
 Protect a properties list against concurrent access. More...
 
void mlt_properties_mirror (mlt_properties self, mlt_properties that)
 Set a properties list to be a mirror copy of another. More...
 
mlt_properties mlt_properties_new ()
 Create a properties object. More...
 
int mlt_properties_parse (mlt_properties self, const char *namevalue)
 Set a value by parsing a name=value string. More...
 
mlt_properties mlt_properties_parse_yaml (const char *filename)
 Parse a YAML Tiny file by name. More...
 
int mlt_properties_pass (mlt_properties self, mlt_properties that, const char *prefix)
 Pass all serializable properties that match a prefix to another properties object. More...
 
int mlt_properties_pass_list (mlt_properties self, mlt_properties that, const char *list)
 Copy all properties specified in a comma-separated list to another properties list. More...
 
void mlt_properties_pass_property (mlt_properties self, mlt_properties that, const char *name)
 Copy a property to another properties list. More...
 
int mlt_properties_preset (mlt_properties self, const char *name)
 Set properties from a preset. More...
 
int mlt_properties_ref_count (mlt_properties self)
 Get the reference count. More...
 
int mlt_properties_rename (mlt_properties self, const char *source, const char *dest)
 Rename a property. More...
 
int mlt_properties_save (mlt_properties self, const char *filename)
 Save the properties to a file by name. More...
 
char * mlt_properties_serialise_yaml (mlt_properties self)
 Serialize a properties list as a string of YAML Tiny. More...
 
int mlt_properties_set (mlt_properties self, const char *name, const char *value)
 Set a property to a string. More...
 
int mlt_properties_set_color (mlt_properties self, const char *name, mlt_color color)
 Set a property to an integer value by color. More...
 
int mlt_properties_set_data (mlt_properties self, const char *name, void *value, int length, mlt_destructor destroy, mlt_serialiser serialise)
 Store binary data as a property. More...
 
int mlt_properties_set_double (mlt_properties self, const char *name, double value)
 Set a property to a floating point value. More...
 
int mlt_properties_set_int (mlt_properties self, const char *name, int value)
 Set a property to an integer value. More...
 
int mlt_properties_set_int64 (mlt_properties self, const char *name, int64_t value)
 Set a property to a 64-bit integer value. More...
 
int mlt_properties_set_lcnumeric (mlt_properties self, const char *locale)
 Set the numeric locale used for string/double conversions. More...
 
int mlt_properties_set_or_default (mlt_properties self, const char *name, const char *value, const char *def)
 Set or default a property to a string. More...
 
int mlt_properties_set_position (mlt_properties self, const char *name, mlt_position value)
 Set a property to a position value. More...
 
int mlt_properties_set_properties (mlt_properties self, const char *name, mlt_properties properties)
 Set a property to a nested properties object. More...
 
int mlt_properties_set_rect (mlt_properties self, const char *name, mlt_rect value)
 Set a property to a rectangle value. More...
 
int mlt_properties_set_string (mlt_properties self, const char *name, const char *value)
 Set a property to a string. More...
 
mlt_position mlt_properties_time_to_frames (mlt_properties self, const char *time)
 Convert a time string to a frame count. More...
 
void mlt_properties_unlock (mlt_properties self)
 End protecting a properties list against concurrent access. More...
 

Data Fields

int(* convert_audio )(mlt_frame self, void **audio, mlt_audio_format *input, mlt_audio_format output)
 Convert the audio format (callback function). More...
 
int(* convert_image )(mlt_frame self, uint8_t **image, mlt_image_format *input, mlt_image_format output)
 Convert the image format (callback function). More...
 
- Data Fields inherited from mlt_properties_s
mlt_destructor close
 the destructor virtual function More...
 
void * close_object
 the object supplied to the close virtual function More...
 

Private Attributes

int is_processing
 indicates if a frame is or was processed by the parallel consumer More...
 
struct mlt_properties_s parent
 A frame extends properties. More...
 
mlt_deque stack_audio
 the audio processing stack of operations and data More...
 
mlt_deque stack_image
 the image processing stack of operations and data More...
 
mlt_deque stack_service
 a general purpose data stack More...
 

Detailed Description

Frame class.

The frame is the primary data object that gets passed around to and through services.

Property:

test_image set if the frame holds a "test card" image

test_audio set if the frame holds "test card" audio

_producer holds a reference to the frame's end producer

_speed the current speed of the producer that generated the frame

_position the position of the frame

meta.* holds metadata

hide set to 1 to hide the video, 2 to mute the audio

last_track a flag to indicate an end-of-tracks frame

previous frame a reference to the unfiltered preceding frame (no speed factor applied, only available when _need_previous_next is set on the producer)

next frame a reference to the unfiltered following frame (no speed factor applied, only available when _need_previous_next is set on the producer)

colorspace the standard for the YUV coefficients

force_full_luma luma range handling: 1 for full range, 0 for scaling (DEPRECATED)

color_trc the color transfer characteristic (gamma)

audio_frequency the sample rate of the audio

audio_channels the number of audio channels

audio_samples the number of audio samples

audio_format the mlt_audio_format for the audio on this frame

format the mlt_image_format of the image on this frame

width the horizontal resolution of the image

height the vertical resolution of the image

aspect_ratio the sample aspect ratio of the image

full_range set if the video is full range - only applies to Y'CbCr

meta.playlist.clip_position mlt_playlist sets this property to the time position of this frame's clip in the playlist

meta.playlist.clip_length mlt_playlist sets this property to the playlist index of this frame's clip in the playlist

Member Function Documentation

◆ mlt_audio_calculate_frame_samples()

int mlt_audio_calculate_frame_samples ( float  fps,
int  frequency,
int64_t  position 
)

Determine the number of samples that belong in a frame at a time position.

Parameters
fpsthe frame rate
frequencythe sample rate
positionthe time position
Returns
the number of samples per channel

◆ mlt_audio_calculate_samples_to_position()

int64_t mlt_audio_calculate_samples_to_position ( float  fps,
int  frequency,
int64_t  position 
)

Determine the number of samples that belong before a time position.

Parameters
fpsthe frame rate
frequencythe sample rate
positionthe time position
Returns
the number of samples per channel

◆ mlt_audio_channel_layout_channels()

int mlt_audio_channel_layout_channels ( mlt_channel_layout  layout)

Get the number of channels for a channel layout.

Parameters
layoutthe channel layout
Returns
the number of channels for the channel layout

◆ mlt_audio_channel_layout_default()

mlt_channel_layout mlt_audio_channel_layout_default ( int  channels)

Get a default channel layout for a given number of channels.

Parameters
channelsthe number of channels
Returns
the default channel layout

◆ mlt_audio_channel_layout_id()

mlt_channel_layout mlt_audio_channel_layout_id ( const char *  name)

Get the id of channel layout from short name.

Parameters
namethe channel layout short name
Returns
a channel layout

◆ mlt_audio_copy()

void mlt_audio_copy ( mlt_audio  dst,
mlt_audio  src,
int  samples,
int  src_start,
int  dst_start 
)

Copy audio samples from src to dst.

Parameters
dstthe destination object
srcthe source object
samplesthe number of samples to copy
src_offsetthe number of samples to skip from the source
dst_offsetthe number of samples to skip from the destination
Returns
none

◆ mlt_audio_format_name()

const char * mlt_audio_format_name ( mlt_audio_format  format)

Get the short name for an audio format.

You do not need to deallocate the returned string.

Parameters
formatan audio format enum
Returns
a string for the name of the image format

◆ mlt_audio_format_size()

int mlt_audio_format_size ( mlt_audio_format  format,
int  samples,
int  channels 
)

Get the amount of bytes needed for a block of audio.

Parameters
formatan audio format enum
samplesthe number of samples per channel
channelsthe number of channels
Returns
the number of bytes

◆ mlt_audio_silence()

void mlt_audio_silence ( mlt_audio  self,
int  samples,
int  start 
)

Set a range of samples to silence.

Parameters
selfthe Audio object
samplesthe new number of samples to silent
startthe sample to begin the silence
Returns
none

◆ mlt_frame_clone()

mlt_frame mlt_frame_clone ( mlt_frame  self,
int  is_deep 
)

Make a copy of a frame.

This does not copy the get_image/get_audio processing stacks or any data properties other than the audio and image.

Parameters
selfthe frame to clone
is_deepa boolean to indicate whether to make a deep copy of the audio and video data chunks or to make a shallow copy by pointing to the supplied frame
Returns
a almost-complete copy of the frame
Todo:
copy the processing deques

◆ mlt_frame_clone_audio()

mlt_frame mlt_frame_clone_audio ( mlt_frame  self,
int  is_deep 
)

Make a copy of a frame and audio.

This does not copy the get_image/get_audio processing stacks or any data properties other than the audio.

Parameters
selfthe frame to clone
is_deepa boolean to indicate whether to make a deep copy of the audio data chunks or to make a shallow copy by pointing to the supplied frame
Returns
a almost-complete copy of the frame
Todo:
copy the processing deques

◆ mlt_frame_clone_image()

mlt_frame mlt_frame_clone_image ( mlt_frame  self,
int  is_deep 
)

Make a copy of a frame and image.

This does not copy the get_image/get_audio processing stacks or any data properties other than the image.

Parameters
selfthe frame to clone
is_deepa boolean to indicate whether to make a deep copy of the video data chunks or to make a shallow copy by pointing to the supplied frame
Returns
a almost-complete copy of the frame
Todo:
copy the processing deques

◆ mlt_frame_close()

void mlt_frame_close ( mlt_frame  self)

Destroy the frame.

Parameters
selfa frame

◆ mlt_frame_get_alpha()

uint8_t * mlt_frame_get_alpha ( mlt_frame  self)

Get the alpha channel associated to the frame (without creating if it has not).

This returns NULL if the frame's image format is mlt_image_rgba.

Parameters
selfa frame
Returns
the alpha channel or NULL

◆ mlt_frame_get_alpha_size()

uint8_t * mlt_frame_get_alpha_size ( mlt_frame  self,
int *  size 
)

Get the alpha channel associated to the frame and its size.

This returns NULL and sets size to 0 if the frame's image format is mlt_image_rgba.

Parameters
selfa frame
Returns
the alpha channel or NULL

◆ mlt_frame_get_aspect_ratio()

double mlt_frame_get_aspect_ratio ( mlt_frame  self)

Get the sample aspect ratio of the frame.

Parameters
selfa frame
Returns
the aspect ratio

◆ mlt_frame_get_audio()

int mlt_frame_get_audio ( mlt_frame  self,
void **  buffer,
mlt_audio_format format,
int *  frequency,
int *  channels,
int *  samples 
)

Get the audio associated to the frame.

You should express the desired format, frequency, channels, and samples as inputs. As long as the loader producer was used to generate this or the audioconvert filter was attached, then you will get the audio back in the format you desire. However, you do not always get the channels and samples you request depending on properties and filters. You do not need to supply a pre-allocated buffer, but you should always supply the desired audio format. The audio is always in interleaved format. You should use the mlt_audio_sample_calculator to determine the number of samples you want.

Parameters
selfa frame
[out]bufferan audio buffer
[in,out]formatthe audio format
[in,out]frequencythe sample rate
[in,out]channels
[in,out]samplesthe number of samples per frame
Returns
true if error

◆ mlt_frame_get_image()

int mlt_frame_get_image ( mlt_frame  self,
uint8_t **  buffer,
mlt_image_format format,
int *  width,
int *  height,
int  writable 
)

Get the image associated to the frame.

You should express the desired format, width, and height as inputs. As long as the loader producer was used to generate this or the imageconvert filter was attached, then you will get the image back in the format you desire. However, you do not always get the width and height you request depending on properties and filters. You do not need to supply a pre-allocated buffer, but you should always supply the desired image format.

Parameters
selfa frame
[out]bufferan image buffer
[in,out]formatthe image format
[in,out]widththe horizontal size in pixels
[in,out]heightthe vertical size in pixels
writablewhether or not you will need to be able to write to the memory returned in buffer
Returns
true if error
Todo:
Better describe the width and height as inputs.

◆ mlt_frame_get_original_producer()

mlt_producer mlt_frame_get_original_producer ( mlt_frame  self)

Get the end service that produced self frame.

This fetches the first producer of the frame and not any producers that encapsulate it.

Parameters
selfa frame
Returns
a producer

◆ mlt_frame_get_position()

mlt_position mlt_frame_get_position ( mlt_frame  self)

Get the time position of this frame.

This position is not necessarily the position as the original producer knows it. It could be the position that the playlist, multitrack, or tractor producer set.

Parameters
selfa frame
Returns
the position
See also
mlt_frame_original_position

◆ mlt_frame_get_unique_properties()

mlt_properties mlt_frame_get_unique_properties ( mlt_frame  self,
mlt_service  service 
)

Get a properties object unique to this service instance.

Unlike mlt_frame_unique_properties, this function does not create the service-unique properties object if it does not exist.

Parameters
selfa frame
servicea service
Returns
a properties object or NULL if it does not exist

◆ mlt_frame_get_waveform()

unsigned char * mlt_frame_get_waveform ( mlt_frame  self,
int  w,
int  h 
)

Get audio on a frame as a waveform image.

This generates an 8-bit grayscale image representation of the audio in a frame. Currently, this only really works for 2 channels. This allocates the bitmap using mlt_pool so you should release the return value with mlt_pool_release.

Parameters
selfa frame
wthe width of the image
hthe height of the image to create
Returns
a pointer to a new bitmap

◆ mlt_frame_init()

mlt_frame mlt_frame_init ( mlt_service  service)

Construct a frame object.

Parameters
servicethe pointer to any service that can provide access to the profile
Returns
a frame object on success or NULL if there was an allocation error

◆ mlt_frame_is_test_audio()

int mlt_frame_is_test_audio ( mlt_frame  self)

Determine if the frame will produce audio from a test card.

Parameters
selfa frame
Returns
true (non-zero) if this will produce from a test card

◆ mlt_frame_is_test_card()

int mlt_frame_is_test_card ( mlt_frame  self)

Determine if the frame will produce a test card image.

Parameters
selfa frame
Returns
true (non-zero) if this will produce from a test card

◆ mlt_frame_original_position()

mlt_position mlt_frame_original_position ( mlt_frame  self)

Get the original time position of this frame.

This is the position that the original producer set on the frame.

Parameters
selfa frame
Returns
the position

◆ mlt_frame_pop_audio()

void * mlt_frame_pop_audio ( mlt_frame  self)

Pop an audio item from the stack.

Parameters
selfa frame
Returns
an opaque pointer to something that was pushed onto the frame's audio stack

◆ mlt_frame_pop_frame()

mlt_frame mlt_frame_pop_frame ( mlt_frame  self)

Pop a frame.

Parameters
selfa frame
Returns
a frame that was previously pushed

◆ mlt_frame_pop_get_image()

mlt_get_image mlt_frame_pop_get_image ( mlt_frame  self)

Pop a get_image callback.

Parameters
selfa frame
Returns
the get_image callback

◆ mlt_frame_pop_service()

void * mlt_frame_pop_service ( mlt_frame  self)

Pop a service.

Parameters
selfa frame
Returns
an opaque pointer to something previously pushed

◆ mlt_frame_pop_service_int()

int mlt_frame_pop_service_int ( mlt_frame  self)

Pop a number.

Parameters
selfa frame
Returns
an integer that was previously pushed

◆ mlt_frame_properties()

mlt_properties mlt_frame_properties ( mlt_frame  self)

Get a frame's properties.

Parameters
selfa frame
Returns
the frame's properties or NULL if an invalid frame is supplied

◆ mlt_frame_push_audio()

int mlt_frame_push_audio ( mlt_frame  self,
void *  that 
)

Push an audio item on the stack.

Parameters
selfa frame
thatan opaque pointer
Returns
true if error

◆ mlt_frame_push_frame()

int mlt_frame_push_frame ( mlt_frame  self,
mlt_frame  that 
)

Push a frame.

Parameters
selfa frame
thatthe frame to push onto self
Returns
true if error

◆ mlt_frame_push_get_image()

int mlt_frame_push_get_image ( mlt_frame  self,
mlt_get_image  get_image 
)

Stack a get_image callback.

Parameters
selfa frame
get_imagethe get_image callback
Returns
true if error

◆ mlt_frame_push_service()

int mlt_frame_push_service ( mlt_frame  self,
void *  that 
)

Push a service.

Parameters
selfa frame
thatan opaque pointer
Returns
true if error

◆ mlt_frame_push_service_int()

int mlt_frame_push_service_int ( mlt_frame  self,
int  that 
)

Push a number.

Parameters
selfa frame
thatan integer
Returns
true if error

◆ mlt_frame_replace_image()

void mlt_frame_replace_image ( mlt_frame  self,
uint8_t *  image,
mlt_image_format  format,
int  width,
int  height 
)

Replace image stack with the information provided.

This might prove to be unreliable and restrictive - the idea is that a transition which normally uses two images may decide to only use the b frame (ie: in the case of a composite where the b frame completely obscures the a frame).

The image must be writable and the destructor for the image itself must be taken care of on another frame and that frame cannot have a replace applied to it... Further it assumes that no alpha mask is in use.

For these reasons, it can only be used in a specific situation - when you have multiple tracks each with their own transition and these transitions are applied in a strictly reversed order (ie: highest numbered [lowest track] is processed first).

More reliable approach - the cases should be detected during the process phase and the upper tracks should simply not be invited to stack...

Parameters
selfa frame
imagea new image
formatthe image format
widththe width of the new image
heightthe height of the new image

◆ mlt_frame_service_stack()

mlt_deque mlt_frame_service_stack ( mlt_frame  self)

Return the service stack.

Parameters
selfa frame
Returns
the service stack

◆ mlt_frame_set_alpha()

int mlt_frame_set_alpha ( mlt_frame  self,
uint8_t *  alpha,
int  size,
mlt_destructor  destroy 
)

Set a new alpha channel on the frame.

Parameters
selfa frame
alphaa pointer to the alpha channel
sizethe size of the alpha channel in bytes (optional)
destroya function to deallocate alpha when the frame is closed (optional)
Returns
true if error

◆ mlt_frame_set_aspect_ratio()

int mlt_frame_set_aspect_ratio ( mlt_frame  self,
double  value 
)

Set the sample aspect ratio of the frame.

Parameters
selfa frame
valuethe new image sample aspect ratio
Returns
true if error

◆ mlt_frame_set_audio()

int mlt_frame_set_audio ( mlt_frame  self,
void *  buffer,
mlt_audio_format  format,
int  size,
mlt_destructor  destructor 
)

Set the audio on a frame.

Parameters
selfa frame
bufferan buffer containing audio samples
formatthe format of the audio in the buffer
sizethe total size of the buffer (optional)
destructora function that releases or deallocates the buffer
Returns
true if error

◆ mlt_frame_set_image()

int mlt_frame_set_image ( mlt_frame  self,
uint8_t *  image,
int  size,
mlt_destructor  destroy 
)

Set a new image on the frame.

Parameters
selfa frame
imagea pointer to the raw image data
sizethe size of the image data in bytes (optional)
destroya function to deallocate image when the frame is closed (optional)
Returns
true if error

◆ mlt_frame_set_position()

int mlt_frame_set_position ( mlt_frame  self,
mlt_position  value 
)

Set the time position of this frame.

Parameters
selfa frame
valuethe position
Returns
true if error

◆ mlt_frame_unique_properties()

mlt_properties mlt_frame_unique_properties ( mlt_frame  self,
mlt_service  service 
)

Get or create a properties object unique to this service instance.

Use this function to hold a service's processing parameters for this particular frame. Set the parameters in the service's process function. Then, get the parameters in the function it pushes to the frame's audio or image stack. This makes the service more parallel by reducing race conditions and less sensitive to multiple instances (by not setting a non-unique property on the frame). Creation and destruction of the properties object is handled automatically.

Parameters
selfa frame
servicea service
Returns
a properties object

Field Documentation

◆ convert_audio

int(* mlt_frame_s::convert_audio) (mlt_frame self, void **audio, mlt_audio_format *input, mlt_audio_format output)

Convert the audio format (callback function).

Parameters
selfa frame
[in,out]audioa buffer of audio data
[in,out]inputthe audio format of supplied data
outputthe audio format to which to convert
Returns
true if error

◆ convert_image

int(* mlt_frame_s::convert_image) (mlt_frame self, uint8_t **image, mlt_image_format *input, mlt_image_format output)

Convert the image format (callback function).

Parameters
selfa frame
[in,out]imagea buffer of image data
[in,out]inputthe image format of supplied image data
outputthe image format to which to convert
Returns
true if error

◆ is_processing

int mlt_frame_s::is_processing
private

indicates if a frame is or was processed by the parallel consumer

◆ parent

struct mlt_properties_s mlt_frame_s::parent
private

A frame extends properties.

◆ stack_audio

mlt_deque mlt_frame_s::stack_audio
private

the audio processing stack of operations and data

◆ stack_image

mlt_deque mlt_frame_s::stack_image
private

the image processing stack of operations and data

◆ stack_service

mlt_deque mlt_frame_s::stack_service
private

a general purpose data stack


The documentation for this struct was generated from the following files: