MLT  7.28.0
Data Structures | Macros | Typedefs | Functions
mlt_frame.h File Reference

interface for all frame classes More...

#include "mlt_audio.h"
#include "mlt_deque.h"
#include "mlt_image.h"
#include "mlt_properties.h"
#include "mlt_service.h"

Go to the source code of this file.

Data Structures

struct  mlt_frame_s
 Frame class. More...
 

Macros

#define MLT_FRAME_AUDIO_STACK(frame)   ((frame)->stack_audio)
 
#define MLT_FRAME_IMAGE_STACK(frame)   ((frame)->stack_image)
 
#define MLT_FRAME_PROPERTIES(frame)   (&(frame)->parent)
 
#define MLT_FRAME_SERVICE_STACK(frame)   ((frame)->stack_service)
 
#define RGB2UV_601_SCALED(r, g, b, u, v)
 This macro scales RGB into the YUV gamut - uv is scaled by 224/255 (y unused). More...
 
#define RGB2YUV_601_SCALED(r, g, b, y, u, v)
 This macro scales RGB into the YUV gamut - y is scaled by 219/255 and uv by 224/255. More...
 
#define YUV2RGB_601_SCALED(y, u, v, r, g, b)
 This macro scales YUV up into the full gamut of the RGB color space. More...
 

Typedefs

typedef 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. More...
 
typedef 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. More...
 

Functions

mlt_frame mlt_frame_clone (mlt_frame self, int is_deep)
 
mlt_frame mlt_frame_clone_audio (mlt_frame self, int is_deep)
 
mlt_frame mlt_frame_clone_image (mlt_frame self, int is_deep)
 
void mlt_frame_close (mlt_frame self)
 
uint8_t * mlt_frame_get_alpha (mlt_frame self)
 
uint8_t * mlt_frame_get_alpha_size (mlt_frame self, int *size)
 
double mlt_frame_get_aspect_ratio (mlt_frame self)
 
int mlt_frame_get_audio (mlt_frame self, void **buffer, mlt_audio_format *format, int *frequency, int *channels, int *samples)
 
int mlt_frame_get_image (mlt_frame self, uint8_t **buffer, mlt_image_format *format, int *width, int *height, int writable)
 
mlt_producer mlt_frame_get_original_producer (mlt_frame self)
 
mlt_position mlt_frame_get_position (mlt_frame self)
 
mlt_properties mlt_frame_get_unique_properties (mlt_frame self, mlt_service service)
 
unsigned char * mlt_frame_get_waveform (mlt_frame self, int w, int h)
 
mlt_frame mlt_frame_init (mlt_service service)
 
int mlt_frame_is_test_audio (mlt_frame self)
 
int mlt_frame_is_test_card (mlt_frame self)
 
mlt_position mlt_frame_original_position (mlt_frame self)
 
void * mlt_frame_pop_audio (mlt_frame self)
 
mlt_frame mlt_frame_pop_frame (mlt_frame self)
 
mlt_get_image mlt_frame_pop_get_image (mlt_frame self)
 
void * mlt_frame_pop_service (mlt_frame self)
 
int mlt_frame_pop_service_int (mlt_frame self)
 
mlt_properties mlt_frame_properties (mlt_frame self)
 
int mlt_frame_push_audio (mlt_frame self, void *that)
 
int mlt_frame_push_frame (mlt_frame self, mlt_frame that)
 
int mlt_frame_push_get_image (mlt_frame self, mlt_get_image get_image)
 
int mlt_frame_push_service (mlt_frame self, void *that)
 
int mlt_frame_push_service_int (mlt_frame self, int that)
 
void mlt_frame_replace_image (mlt_frame self, uint8_t *image, mlt_image_format format, int width, int height)
 
mlt_deque mlt_frame_service_stack (mlt_frame self)
 
int mlt_frame_set_alpha (mlt_frame self, uint8_t *alpha, int size, mlt_destructor destroy)
 
int mlt_frame_set_aspect_ratio (mlt_frame self, double value)
 
int mlt_frame_set_audio (mlt_frame self, void *buffer, mlt_audio_format, int size, mlt_destructor)
 
int mlt_frame_set_image (mlt_frame self, uint8_t *image, int size, mlt_destructor destroy)
 
int mlt_frame_set_position (mlt_frame self, mlt_position value)
 
mlt_properties mlt_frame_unique_properties (mlt_frame self, mlt_service service)
 
void mlt_frame_write_ppm (mlt_frame frame)
 

Detailed Description

interface for all frame classes

See also
mlt_frame_s

Copyright (C) 2003-2023 Meltytech, LLC

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Macro Definition Documentation

◆ MLT_FRAME_AUDIO_STACK

#define MLT_FRAME_AUDIO_STACK (   frame)    ((frame)->stack_audio)

◆ MLT_FRAME_IMAGE_STACK

#define MLT_FRAME_IMAGE_STACK (   frame)    ((frame)->stack_image)

◆ MLT_FRAME_PROPERTIES

#define MLT_FRAME_PROPERTIES (   frame)    (&(frame)->parent)

◆ MLT_FRAME_SERVICE_STACK

#define MLT_FRAME_SERVICE_STACK (   frame)    ((frame)->stack_service)

◆ RGB2UV_601_SCALED

#define RGB2UV_601_SCALED (   r,
  g,
  b,
  u,
 
)
Value:
u = ((-152 * r - 300 * g + 450 * b) >> 10) + 128; \
v = ((450 * r - 377 * g - 73 * b) >> 10) + 128;

This macro scales RGB into the YUV gamut - uv is scaled by 224/255 (y unused).

◆ RGB2YUV_601_SCALED

#define RGB2YUV_601_SCALED (   r,
  g,
  b,
  y,
  u,
 
)
Value:
y = ((263 * r + 516 * g + 100 * b) >> 10) + 16; \
u = ((-152 * r - 300 * g + 450 * b) >> 10) + 128; \
v = ((450 * r - 377 * g - 73 * b) >> 10) + 128;

This macro scales RGB into the YUV gamut - y is scaled by 219/255 and uv by 224/255.

◆ YUV2RGB_601_SCALED

#define YUV2RGB_601_SCALED (   y,
  u,
  v,
  r,
  g,
 
)
Value:
r = ((1192 * (y - 16) + 1634 * (v - 128)) >> 10); \
g = ((1192 * (y - 16) - 832 * (v - 128) - 401 * (u - 128)) >> 10); \
b = ((1192 * (y - 16) + 2066 * (u - 128)) >> 10); \
r = r < 0 ? 0 : r > 255 ? 255 : r; \
g = g < 0 ? 0 : g > 255 ? 255 : g; \
b = b < 0 ? 0 : b > 255 ? 255 : b;

This macro scales YUV up into the full gamut of the RGB color space.

Typedef Documentation

◆ mlt_get_audio

typedef 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.

◆ mlt_get_image

typedef 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.

Function Documentation

◆ mlt_frame_clone()

mlt_frame mlt_frame_clone ( mlt_frame  self,
int  is_deep 
)

◆ mlt_frame_clone_audio()

mlt_frame mlt_frame_clone_audio ( mlt_frame  self,
int  is_deep 
)

◆ mlt_frame_clone_image()

mlt_frame mlt_frame_clone_image ( mlt_frame  self,
int  is_deep 
)

◆ mlt_frame_close()

void mlt_frame_close ( mlt_frame  self)

◆ mlt_frame_get_alpha()

uint8_t* mlt_frame_get_alpha ( mlt_frame  self)

◆ mlt_frame_get_alpha_size()

uint8_t* mlt_frame_get_alpha_size ( mlt_frame  self,
int *  size 
)

◆ mlt_frame_get_aspect_ratio()

double mlt_frame_get_aspect_ratio ( mlt_frame  self)

◆ mlt_frame_get_audio()

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

◆ 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 
)

◆ mlt_frame_get_original_producer()

mlt_producer mlt_frame_get_original_producer ( mlt_frame  self)

◆ mlt_frame_get_position()

mlt_position mlt_frame_get_position ( mlt_frame  self)

◆ mlt_frame_get_unique_properties()

mlt_properties mlt_frame_get_unique_properties ( mlt_frame  self,
mlt_service  service 
)

◆ mlt_frame_get_waveform()

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

◆ mlt_frame_init()

mlt_frame mlt_frame_init ( mlt_service  service)

◆ mlt_frame_is_test_audio()

int mlt_frame_is_test_audio ( mlt_frame  self)

◆ mlt_frame_is_test_card()

int mlt_frame_is_test_card ( mlt_frame  self)

◆ mlt_frame_original_position()

mlt_position mlt_frame_original_position ( mlt_frame  self)

◆ mlt_frame_pop_audio()

void* mlt_frame_pop_audio ( mlt_frame  self)

◆ mlt_frame_pop_frame()

mlt_frame mlt_frame_pop_frame ( mlt_frame  self)

◆ mlt_frame_pop_get_image()

mlt_get_image mlt_frame_pop_get_image ( mlt_frame  self)

◆ mlt_frame_pop_service()

void* mlt_frame_pop_service ( mlt_frame  self)

◆ mlt_frame_pop_service_int()

int mlt_frame_pop_service_int ( mlt_frame  self)

◆ mlt_frame_properties()

mlt_properties mlt_frame_properties ( mlt_frame  self)

◆ mlt_frame_push_audio()

int mlt_frame_push_audio ( mlt_frame  self,
void *  that 
)

◆ mlt_frame_push_frame()

int mlt_frame_push_frame ( mlt_frame  self,
mlt_frame  that 
)

◆ mlt_frame_push_get_image()

int mlt_frame_push_get_image ( mlt_frame  self,
mlt_get_image  get_image 
)

◆ mlt_frame_push_service()

int mlt_frame_push_service ( mlt_frame  self,
void *  that 
)

◆ mlt_frame_push_service_int()

int mlt_frame_push_service_int ( mlt_frame  self,
int  that 
)

◆ mlt_frame_replace_image()

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

◆ mlt_frame_service_stack()

mlt_deque mlt_frame_service_stack ( mlt_frame  self)

◆ mlt_frame_set_alpha()

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

◆ mlt_frame_set_aspect_ratio()

int mlt_frame_set_aspect_ratio ( mlt_frame  self,
double  value 
)

◆ mlt_frame_set_audio()

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

◆ mlt_frame_set_image()

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

◆ mlt_frame_set_position()

int mlt_frame_set_position ( mlt_frame  self,
mlt_position  value 
)

◆ mlt_frame_unique_properties()

mlt_properties mlt_frame_unique_properties ( mlt_frame  self,
mlt_service  service 
)

◆ mlt_frame_write_ppm()

void mlt_frame_write_ppm ( mlt_frame  frame)