SDL_Surface *sdl_screen;
SDL_Overlay *sdl_overlay;
SDL_Rect rect;
+ uint8_t *buffer;
int bpp;
};
// Default scaler (for now we'll use nearest)
mlt_properties_set( this->properties, "rescale", "nearest" );
mlt_properties_set( this->properties, "deinterlace_method", "onefield" );
+ mlt_properties_set_int( this->properties, "top_field_first", -1 );
// Default buffer for low latency
mlt_properties_set_int( this->properties, "buffer", 1 );
// Default audio buffer
mlt_properties_set_int( this->properties, "audio_buffer", 2048 );
- // Tell render thread we prefer yuv420p
- mlt_properties_set( this->properties, "mlt_image_format", "yuv420p" );
- mlt_properties_set_int( this->properties, "top_field_first", -1 );
-
// Ensure we don't join on a non-running object
this->joined = 1;
// Get the properties of this consumer
mlt_properties properties = this->properties;
- mlt_image_format vfmt = mlt_image_yuv420p;
+ mlt_image_format vfmt = mlt_image_yuv422;
int width = this->width, height = this->height;
uint8_t *image;
int changed = 0;
if ( this->running && this->sdl_screen != NULL && this->sdl_overlay == NULL )
{
SDL_SetClipRect( this->sdl_screen, &this->rect );
- this->sdl_overlay = SDL_CreateYUVOverlay( width, height, SDL_YV12_OVERLAY, this->sdl_screen );
+ this->sdl_overlay = SDL_CreateYUVOverlay( width, height, SDL_YUY2_OVERLAY, this->sdl_screen );
}
if ( this->running && this->sdl_screen != NULL && this->sdl_overlay != NULL )
{
+ this->buffer = this->sdl_overlay->pixels[ 0 ];
if ( SDL_LockYUVOverlay( this->sdl_overlay ) >= 0 )
{
if ( image != NULL )
- {
- int img_sz = width * height;
- int quarter_img_sz = width * height / 4;
- memcpy( this->sdl_overlay->pixels[ 0 ], image, img_sz );
- memcpy( this->sdl_overlay->pixels[ 2 ], image + img_sz, quarter_img_sz );
- memcpy( this->sdl_overlay->pixels[ 1 ], image + img_sz + quarter_img_sz, quarter_img_sz );
- }
+ memcpy( this->buffer, image, width * height * 2 );
SDL_UnlockYUVOverlay( this->sdl_overlay );
SDL_DisplayYUVOverlay( this->sdl_overlay, &this->sdl_screen->clip_rect );
}