MLT
7.28.0
|
Frame class. More...
#include <mlt_frame.h>
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... | |
Frame class.
The frame is the primary data object that gets passed around to and through services.
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
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.
fps | the frame rate |
frequency | the sample rate |
position | the time 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.
fps | the frame rate |
frequency | the sample rate |
position | the time position |
int mlt_audio_channel_layout_channels | ( | mlt_channel_layout | layout | ) |
Get the number of channels for a channel layout.
layout | the channel layout |
mlt_channel_layout mlt_audio_channel_layout_default | ( | int | channels | ) |
Get a default channel layout for a given number of channels.
channels | the number of channels |
mlt_channel_layout mlt_audio_channel_layout_id | ( | const char * | name | ) |
Get the id of channel layout from short name.
name | the channel layout short name |
Copy audio samples from src to dst.
dst | the destination object |
src | the source object |
samples | the number of samples to copy |
src_offset | the number of samples to skip from the source |
dst_offset | the number of samples to skip from the destination |
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.
format | an audio format enum |
int mlt_audio_format_size | ( | mlt_audio_format | format, |
int | samples, | ||
int | channels | ||
) |
Get the amount of bytes needed for a block of audio.
format | an audio format enum |
samples | the number of samples per channel |
channels | the number of channels |
void mlt_audio_silence | ( | mlt_audio | self, |
int | samples, | ||
int | start | ||
) |
Set a range of samples to silence.
self | the Audio object |
samples | the new number of samples to silent |
start | the sample to begin the silence |
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.
self | the frame to clone |
is_deep | a 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 |
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.
self | the frame to clone |
is_deep | a 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 |
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.
self | the frame to clone |
is_deep | a 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 |
void mlt_frame_close | ( | mlt_frame | self | ) |
Destroy the frame.
self | a frame |
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
.
self | a frame |
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
.
self | a frame |
double mlt_frame_get_aspect_ratio | ( | mlt_frame | self | ) |
Get the sample aspect ratio of the frame.
self | a frame |
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.
self | a frame | |
[out] | buffer | an audio buffer |
[in,out] | format | the audio format |
[in,out] | frequency | the sample rate |
[in,out] | channels | |
[in,out] | samples | the number of samples per frame |
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.
self | a frame | |
[out] | buffer | an image buffer |
[in,out] | format | the image format |
[in,out] | width | the horizontal size in pixels |
[in,out] | height | the vertical size in pixels |
writable | whether or not you will need to be able to write to the memory returned in buffer |
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.
self | a frame |
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.
self | a frame |
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.
self | a frame |
service | a service |
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
.
self | a frame |
w | the width of the image |
h | the height of the image to create |
mlt_frame mlt_frame_init | ( | mlt_service | service | ) |
Construct a frame object.
service | the pointer to any service that can provide access to the profile |
int mlt_frame_is_test_audio | ( | mlt_frame | self | ) |
Determine if the frame will produce audio from a test card.
self | a frame |
int mlt_frame_is_test_card | ( | mlt_frame | self | ) |
Determine if the frame will produce a test card image.
self | a frame |
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.
self | a frame |
void * mlt_frame_pop_audio | ( | mlt_frame | self | ) |
Pop an audio item from the stack.
self | a frame |
Pop a frame.
self | a frame |
mlt_get_image mlt_frame_pop_get_image | ( | mlt_frame | self | ) |
Pop a get_image callback.
self | a frame |
void * mlt_frame_pop_service | ( | mlt_frame | self | ) |
Pop a service.
self | a frame |
int mlt_frame_pop_service_int | ( | mlt_frame | self | ) |
Pop a number.
self | a frame |
mlt_properties mlt_frame_properties | ( | mlt_frame | self | ) |
Get a frame's properties.
self | a frame |
int mlt_frame_push_audio | ( | mlt_frame | self, |
void * | that | ||
) |
Push an audio item on the stack.
self | a frame |
that | an opaque pointer |
Push a frame.
self | a frame |
that | the frame to push onto self |
int mlt_frame_push_get_image | ( | mlt_frame | self, |
mlt_get_image | get_image | ||
) |
Stack a get_image callback.
self | a frame |
get_image | the get_image callback |
int mlt_frame_push_service | ( | mlt_frame | self, |
void * | that | ||
) |
Push a service.
self | a frame |
that | an opaque pointer |
int mlt_frame_push_service_int | ( | mlt_frame | self, |
int | that | ||
) |
Push a number.
self | a frame |
that | an integer |
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...
self | a frame |
image | a new image |
format | the image format |
width | the width of the new image |
height | the height of the new image |
Return the service stack.
self | a frame |
int mlt_frame_set_alpha | ( | mlt_frame | self, |
uint8_t * | alpha, | ||
int | size, | ||
mlt_destructor | destroy | ||
) |
Set a new alpha channel on the frame.
self | a frame |
alpha | a pointer to the alpha channel |
size | the size of the alpha channel in bytes (optional) |
destroy | a function to deallocate alpha when the frame is closed (optional) |
int mlt_frame_set_aspect_ratio | ( | mlt_frame | self, |
double | value | ||
) |
Set the sample aspect ratio of the frame.
self | a frame |
value | the new image sample aspect ratio |
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.
self | a frame |
buffer | an buffer containing audio samples |
format | the format of the audio in the buffer |
size | the total size of the buffer (optional) |
destructor | a function that releases or deallocates the buffer |
int mlt_frame_set_image | ( | mlt_frame | self, |
uint8_t * | image, | ||
int | size, | ||
mlt_destructor | destroy | ||
) |
Set a new image on the frame.
self | a frame |
image | a pointer to the raw image data |
size | the size of the image data in bytes (optional) |
destroy | a function to deallocate image when the frame is closed (optional) |
int mlt_frame_set_position | ( | mlt_frame | self, |
mlt_position | value | ||
) |
Set the time position of this frame.
self | a frame |
value | the position |
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.
self | a frame |
service | a service |
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).
self | a frame | |
[in,out] | audio | a buffer of audio data |
[in,out] | input | the audio format of supplied data |
output | the audio format to which to convert |
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).
self | a frame | |
[in,out] | image | a buffer of image data |
[in,out] | input | the image format of supplied image data |
output | the image format to which to convert |
|
private |
indicates if a frame is or was processed by the parallel consumer
|
private |
A frame extends properties.
|
private |
the audio processing stack of operations and data
|
private |
the image processing stack of operations and data
|
private |
a general purpose data stack