107#define MLT_FRAME_PROPERTIES( frame ) ( &( frame )->parent )
108#define MLT_FRAME_SERVICE_STACK( frame ) ( ( frame )->stack_service )
109#define MLT_FRAME_IMAGE_STACK( frame ) ( ( frame )->stack_image )
110#define MLT_FRAME_AUDIO_STACK( frame ) ( ( frame )->stack_audio )
155#define RGB2YUV_601_SCALED(r, g, b, y, u, v)\
156 y = ((263*r + 516*g + 100*b) >> 10) + 16;\
157 u = ((-152*r - 300*g + 450*b) >> 10) + 128;\
158 v = ((450*r - 377*g - 73*b) >> 10) + 128;
160#define RGB2UV_601_SCALED(r, g, b, u, v)\
161 u = ((-152*r - 300*g + 450*b) >> 10) + 128;\
162 v = ((450*r - 377*g - 73*b) >> 10) + 128;
165#define YUV2RGB_601_SCALED( y, u, v, r, g, b ) \
166 r = ((1192 * ( y - 16 ) + 1634 * ( v - 128 ) ) >> 10 ); \
167 g = ((1192 * ( y - 16 ) - 832 * ( v - 128 ) - 401 * ( u - 128 ) ) >> 10 ); \
168 b = ((1192 * ( y - 16 ) + 2066 * ( u - 128 ) ) >> 10 ); \
169 r = r < 0 ? 0 : r > 255 ? 255 : r; \
170 g = g < 0 ? 0 : g > 255 ? 255 : g; \
171 b = b < 0 ? 0 : b > 255 ? 255 : b;
void mlt_frame_write_ppm(mlt_frame frame)
Definition: mlt_frame.c:941
int(* mlt_get_image)(mlt_frame self, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable)
Callback function to get video data.
Definition: mlt_frame.h:35
int(* mlt_get_audio)(mlt_frame self, void **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples)
Callback function to get audio data.
Definition: mlt_frame.h:41
Properties class declaration.
interface declaration for all service classes
int32_t mlt_position
Definition: mlt_types.h:163
void(* mlt_destructor)(void *)
pointer to destructor function
Definition: mlt_types.h:212
mlt_image_format
The set of supported image formats.
Definition: mlt_types.h:46
mlt_audio_format
The set of supported audio formats.
Definition: mlt_types.h:63
Double-Ended Queue (deque) class.
Definition: mlt_deque.c:50
Frame class.
Definition: mlt_frame.h:74
mlt_position mlt_frame_get_position(mlt_frame self)
Get the time position of this frame.
Definition: mlt_frame.c:150
double mlt_frame_get_aspect_ratio(mlt_frame self)
Get the sample aspect ratio of the frame.
Definition: mlt_frame.c:120
int mlt_frame_set_alpha(mlt_frame self, uint8_t *alpha, int size, mlt_destructor destroy)
Set a new alpha channel on the frame.
Definition: mlt_frame.c:349
uint8_t * mlt_frame_get_alpha_mask(mlt_frame self)
Get the alpha channel associated to the frame.
Definition: mlt_frame.c:665
int mlt_frame_push_audio(mlt_frame self, void *that)
Push an audio item on the stack.
Definition: mlt_frame.c:295
mlt_properties mlt_frame_unique_properties(mlt_frame self, mlt_service service)
Get or create a properties object unique to this service instance.
Definition: mlt_frame.c:979
mlt_image_format mlt_image_format_id(const char *name)
Get the id of image format from short name.
Definition: mlt_frame.c:426
int mlt_frame_is_test_card(mlt_frame self)
Determine if the frame will produce a test card image.
Definition: mlt_frame.c:90
mlt_frame mlt_frame_clone(mlt_frame self, int is_deep)
Make a copy of a frame.
Definition: mlt_frame.c:1027
int mlt_frame_set_aspect_ratio(mlt_frame self, double value)
Set the sample aspect ratio of the frame.
Definition: mlt_frame.c:133
const char * mlt_image_format_name(mlt_image_format format)
Get the short name for an image format.
Definition: mlt_frame.c:401
mlt_frame mlt_frame_pop_frame(mlt_frame self)
Pop a frame.
Definition: mlt_frame.c:232
int mlt_frame_set_image(mlt_frame self, uint8_t *image, int size, mlt_destructor destroy)
Set a new image on the frame.
Definition: mlt_frame.c:334
mlt_frame mlt_frame_init(mlt_service service)
Construct a frame object.
Definition: mlt_frame.c:40
int mlt_frame_is_test_audio(mlt_frame self)
Determine if the frame will produce audio from a test card.
Definition: mlt_frame.c:105
mlt_deque stack_service
a general purpose data stack
Definition: mlt_frame.h:103
int(* convert_image)(mlt_frame self, uint8_t **image, mlt_image_format *input, mlt_image_format output)
Convert the image format (callback function).
Definition: mlt_frame.h:90
int mlt_image_format_planes(mlt_image_format format, int width, int height, void *data, unsigned char *planes[4], int strides[4])
Build a planes pointers of image mapping.
Definition: mlt_frame.c:1113
int mlt_frame_set_position(mlt_frame self, mlt_position value)
Set the time position of this frame.
Definition: mlt_frame.c:179
mlt_properties mlt_frame_properties(mlt_frame self)
Get a frame's properties.
Definition: mlt_frame.c:78
int is_processing
indicates if a frame is or was processed by the parallel consumer
Definition: mlt_frame.h:104
void mlt_frame_close(mlt_frame self)
Destroy the frame.
Definition: mlt_frame.c:925
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.
Definition: mlt_frame.c:381
int mlt_frame_pop_service_int(mlt_frame self)
Pop a number.
Definition: mlt_frame.c:282
int mlt_frame_push_service_int(mlt_frame self, int that)
Push a number.
Definition: mlt_frame.c:270
int mlt_frame_push_get_image(mlt_frame self, mlt_get_image get_image)
Stack a get_image callback.
Definition: mlt_frame.c:195
mlt_producer mlt_frame_get_original_producer(mlt_frame self)
Get the end service that produced self frame.
Definition: mlt_frame.c:912
int mlt_frame_push_service(mlt_frame self, void *that)
Push a service.
Definition: mlt_frame.c:245
mlt_deque mlt_frame_service_stack(mlt_frame self)
Return the service stack.
Definition: mlt_frame.c:319
mlt_position mlt_frame_original_position(mlt_frame self)
Get the original time position of this frame.
Definition: mlt_frame.c:165
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.
Definition: mlt_frame.c:729
void * mlt_frame_pop_service(mlt_frame self)
Pop a service.
Definition: mlt_frame.c:257
mlt_properties mlt_frame_get_unique_properties(mlt_frame self, mlt_service service)
Get a properties object unique to this service instance.
Definition: mlt_frame.c:1008
struct mlt_properties_s parent
A frame extends properties.
Definition: mlt_frame.h:75
int mlt_image_format_size(mlt_image_format format, int width, int height, int *bpp)
Get the number of bytes needed for an image.
Definition: mlt_frame.c:449
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.
Definition: mlt_frame.c:610
mlt_deque stack_image
the image processing stack of operations and data
Definition: mlt_frame.h:101
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.
Definition: mlt_frame.c:815
mlt_get_image mlt_frame_pop_get_image(mlt_frame self)
Pop a get_image callback.
Definition: mlt_frame.c:207
int(* convert_audio)(mlt_frame self, void **audio, mlt_audio_format *input, mlt_audio_format output)
Convert the audio format (callback function).
Definition: mlt_frame.h:99
mlt_deque stack_audio
the audio processing stack of operations and data
Definition: mlt_frame.h:102
unsigned char * mlt_frame_get_waveform(mlt_frame self, int w, int h)
Get audio on a frame as a waveform image.
Definition: mlt_frame.c:835
int mlt_frame_push_frame(mlt_frame self, mlt_frame that)
Push a frame.
Definition: mlt_frame.c:220
void * mlt_frame_pop_audio(mlt_frame self)
Pop an audio item from the stack.
Definition: mlt_frame.c:307
uint8_t * mlt_frame_get_alpha(mlt_frame self)
Get the alpha channel associated to the frame (without creating if it has not).
Definition: mlt_frame.c:695
Producer abstract service class.
Definition: mlt_producer.h:70
Properties class.
Definition: mlt_properties.h:37
Service abstract base class.
Definition: mlt_service.h:58