MLT 6.22.1
mlt_audio.h
Go to the documentation of this file.
1
23#ifndef MLT_AUDIO_H
24#define MLT_AUDIO_H
25
26#include "mlt_types.h"
27
34{
35 void* data;
43};
44
46extern void mlt_audio_close( mlt_audio self );
47extern void mlt_audio_set_values( mlt_audio self, void* data, int frequency, mlt_audio_format format, int samples, int channels );
48extern void mlt_audio_get_values( mlt_audio self, void** data, int* frequency, mlt_audio_format* format, int* samples, int* channels );
49extern void mlt_audio_alloc_data( mlt_audio self );
53extern void mlt_audio_get_planes( mlt_audio self, uint8_t** planes );
54extern void mlt_audio_shrink( mlt_audio self , int samples );
55extern void mlt_audio_reverse( mlt_audio self );
56extern void mlt_audio_copy( mlt_audio dst, mlt_audio src, int samples, int src_start, int dst_start );
57extern int mlt_audio_calculate_frame_samples( float fps, int frequency, int64_t position );
58extern int64_t mlt_audio_calculate_samples_to_position( float fps, int frequency, int64_t position );
59extern const char * mlt_audio_format_name( mlt_audio_format format );
60extern int mlt_audio_format_size( mlt_audio_format format, int samples, int channels );
61extern const char * mlt_audio_channel_layout_name( mlt_channel_layout layout );
65
66// Deprecated functions
67extern int mlt_sample_calculator( float fps, int frequency, int64_t position );
68extern int64_t mlt_sample_calculator_to_now( float fps, int frequency, int64_t position );
69extern const char * mlt_channel_layout_name( mlt_channel_layout layout );
70extern mlt_channel_layout mlt_channel_layout_id( const char * name );
73
74#endif
mlt_channel_layout mlt_channel_layout_id(const char *name)
Get the id of channel layout from short name.
Definition: mlt_audio.c:688
const char * mlt_audio_channel_layout_name(mlt_channel_layout layout)
Get the short name for a channel layout.
Definition: mlt_audio.c:536
int mlt_sample_calculator(float fps, int frequency, int64_t position)
Determine the number of samples that belong in a frame at a time position.
Definition: mlt_audio.c:658
const char * mlt_channel_layout_name(mlt_channel_layout layout)
Get the short name for a channel layout.
Definition: mlt_audio.c:678
mlt_audio mlt_audio_new()
Allocate a new Audio object.
Definition: mlt_audio.c:35
int mlt_channel_layout_channels(mlt_channel_layout layout)
Get the number of channels for a channel layout.
Definition: mlt_audio.c:698
int64_t mlt_sample_calculator_to_now(float fps, int frequency, int64_t position)
Determine the number of samples that belong before a time position.
Definition: mlt_audio.c:668
mlt_channel_layout mlt_channel_layout_default(int channels)
Get a default channel layout for a given number of channels.
Definition: mlt_audio.c:708
Provides forward definitions of all public types.
mlt_channel_layout
Definition: mlt_types.h:76
void(* mlt_destructor)(void *)
pointer to destructor function
Definition: mlt_types.h:212
mlt_audio_format
The set of supported audio formats.
Definition: mlt_types.h:63
Audio class.
Definition: mlt_audio.h:34
mlt_destructor release_data
Definition: mlt_audio.h:41
void mlt_audio_reverse(mlt_audio self)
Reverse the audio samples.
Definition: mlt_audio.c:257
int mlt_audio_calculate_size(mlt_audio self)
Calculate the number of bytes needed for the Audio data.
Definition: mlt_audio.c:143
mlt_audio_format format
Definition: mlt_audio.h:37
void mlt_audio_get_planes(mlt_audio self, uint8_t **planes)
Populate an array of pointers each pointing to the beginning of an audio plane.
Definition: mlt_audio.c:200
void * data
Definition: mlt_audio.h:35
int mlt_audio_plane_count(mlt_audio self)
Get the number of planes for the audio type.
Definition: mlt_audio.c:156
mlt_destructor close
Definition: mlt_audio.h:42
int channels
Definition: mlt_audio.h:39
mlt_channel_layout layout
Definition: mlt_audio.h:40
void mlt_audio_set_values(mlt_audio self, void *data, int frequency, mlt_audio_format format, int samples, int channels)
Set the most common values for the audio.
Definition: mlt_audio.c:77
void mlt_audio_shrink(mlt_audio self, int samples)
Shrink the audio to the new number of samples.
Definition: mlt_audio.c:222
int mlt_audio_plane_size(mlt_audio self)
Get the size of an audio plane.
Definition: mlt_audio.c:178
void mlt_audio_close(mlt_audio self)
Destroy an audio object created by mlt_audio_new().
Definition: mlt_audio.c:48
int frequency
Definition: mlt_audio.h:36
int samples
Definition: mlt_audio.h:38
void mlt_audio_get_values(mlt_audio self, void **data, int *frequency, mlt_audio_format *format, int *samples, int *channels)
Get the most common values for the audio.
Definition: mlt_audio.c:100
void mlt_audio_alloc_data(mlt_audio self)
Allocate the data field based on the other properties of the Audio.
Definition: mlt_audio.c:122
const char * mlt_audio_format_name(mlt_audio_format format)
Get the short name for an audio format.
Definition: mlt_audio.c:489
int mlt_audio_channel_layout_channels(mlt_channel_layout layout)
Get the number of channels for a channel layout.
Definition: mlt_audio.c:600
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.
Definition: mlt_audio.c:367
mlt_channel_layout mlt_audio_channel_layout_default(int channels)
Get a default channel layout for a given number of channels.
Definition: mlt_audio.c:642
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.
Definition: mlt_audio.c:446
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.
Definition: mlt_audio.c:468
mlt_channel_layout mlt_audio_channel_layout_id(const char *name)
Get the id of channel layout from short name.
Definition: mlt_audio.c:578
int mlt_audio_format_size(mlt_audio_format format, int samples, int channels)
Get the amount of bytes needed for a block of audio.
Definition: mlt_audio.c:513