102#define MLT_FRAME_PROPERTIES( frame ) ( &( frame )->parent )
103#define MLT_FRAME_SERVICE_STACK( frame ) ( ( frame )->stack_service )
104#define MLT_FRAME_IMAGE_STACK( frame ) ( ( frame )->stack_image )
105#define MLT_FRAME_AUDIO_STACK( frame ) ( ( frame )->stack_audio )
145#define RGB2YUV_601_SCALED(r, g, b, y, u, v)\
146 y = ((263*r + 516*g + 100*b) >> 10) + 16;\
147 u = ((-152*r - 300*g + 450*b) >> 10) + 128;\
148 v = ((450*r - 377*g - 73*b) >> 10) + 128;
150#define RGB2UV_601_SCALED(r, g, b, u, v)\
151 u = ((-152*r - 300*g + 450*b) >> 10) + 128;\
152 v = ((450*r - 377*g - 73*b) >> 10) + 128;
155#define YUV2RGB_601_SCALED( y, u, v, r, g, b ) \
156 r = ((1192 * ( y - 16 ) + 1634 * ( v - 128 ) ) >> 10 ); \
157 g = ((1192 * ( y - 16 ) - 832 * ( v - 128 ) - 401 * ( u - 128 ) ) >> 10 ); \
158 b = ((1192 * ( y - 16 ) + 2066 * ( u - 128 ) ) >> 10 ); \
159 r = r < 0 ? 0 : r > 255 ? 255 : r; \
160 g = g < 0 ? 0 : g > 255 ? 255 : g; \
161 b = b < 0 ? 0 : b > 255 ? 255 : b;
void mlt_frame_write_ppm(mlt_frame frame)
Definition: mlt_frame.c:775
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:36
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:42
Properties class declaration.
interface declaration for all service classes
int32_t mlt_position
Definition: mlt_types.h:181
void(* mlt_destructor)(void *)
pointer to destructor function
Definition: mlt_types.h:233
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:62
Double-Ended Queue (deque) class.
Definition: mlt_deque.c:50
Frame class.
Definition: mlt_frame.h:75
mlt_position mlt_frame_get_position(mlt_frame self)
Get the time position of this frame.
Definition: mlt_frame.c:151
double mlt_frame_get_aspect_ratio(mlt_frame self)
Get the sample aspect ratio of the frame.
Definition: mlt_frame.c:121
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:350
int mlt_frame_push_audio(mlt_frame self, void *that)
Push an audio item on the stack.
Definition: mlt_frame.c:296
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:813
int mlt_frame_is_test_card(mlt_frame self)
Determine if the frame will produce a test card image.
Definition: mlt_frame.c:91
mlt_frame mlt_frame_clone(mlt_frame self, int is_deep)
Make a copy of a frame.
Definition: mlt_frame.c:861
int mlt_frame_set_aspect_ratio(mlt_frame self, double value)
Set the sample aspect ratio of the frame.
Definition: mlt_frame.c:134
mlt_frame mlt_frame_pop_frame(mlt_frame self)
Pop a frame.
Definition: mlt_frame.c:233
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:335
mlt_frame mlt_frame_init(mlt_service service)
Construct a frame object.
Definition: mlt_frame.c:41
int mlt_frame_is_test_audio(mlt_frame self)
Determine if the frame will produce audio from a test card.
Definition: mlt_frame.c:106
mlt_deque stack_service
a general purpose data stack
Definition: mlt_frame.h:98
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:85
int mlt_frame_set_position(mlt_frame self, mlt_position value)
Set the time position of this frame.
Definition: mlt_frame.c:180
mlt_properties mlt_frame_properties(mlt_frame self)
Get a frame's properties.
Definition: mlt_frame.c:79
int is_processing
indicates if a frame is or was processed by the parallel consumer
Definition: mlt_frame.h:99
void mlt_frame_close(mlt_frame self)
Destroy the frame.
Definition: mlt_frame.c:759
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:283
int mlt_frame_push_service_int(mlt_frame self, int that)
Push a number.
Definition: mlt_frame.c:271
int mlt_frame_push_get_image(mlt_frame self, mlt_get_image get_image)
Stack a get_image callback.
Definition: mlt_frame.c:196
mlt_producer mlt_frame_get_original_producer(mlt_frame self)
Get the end service that produced self frame.
Definition: mlt_frame.c:746
int mlt_frame_push_service(mlt_frame self, void *that)
Push a service.
Definition: mlt_frame.c:246
mlt_deque mlt_frame_service_stack(mlt_frame self)
Return the service stack.
Definition: mlt_frame.c:320
mlt_position mlt_frame_original_position(mlt_frame self)
Get the original time position of this frame.
Definition: mlt_frame.c:166
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:563
void * mlt_frame_pop_service(mlt_frame self)
Pop a service.
Definition: mlt_frame.c:258
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:842
struct mlt_properties_s parent
A frame extends properties.
Definition: mlt_frame.h:76
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:481
mlt_deque stack_image
the image processing stack of operations and data
Definition: mlt_frame.h:96
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:649
mlt_get_image mlt_frame_pop_get_image(mlt_frame self)
Pop a get_image callback.
Definition: mlt_frame.c:208
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:94
mlt_deque stack_audio
the audio processing stack of operations and data
Definition: mlt_frame.h:97
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:669
int mlt_frame_push_frame(mlt_frame self, mlt_frame that)
Push a frame.
Definition: mlt_frame.c:221
void * mlt_frame_pop_audio(mlt_frame self)
Pop an audio item from the stack.
Definition: mlt_frame.c:308
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:532
Producer abstract service class.
Definition: mlt_producer.h:70
Properties class.
Definition: mlt_properties.h:40
Service abstract base class.
Definition: mlt_service.h:58