Commit 654d8a72 authored by Laurent Aimar's avatar Laurent Aimar

Used direct rendering for chroma conversion in "vout display".

parent fbedc7c6
...@@ -47,14 +47,14 @@ static void SplitterClose(vout_display_t *vd); ...@@ -47,14 +47,14 @@ static void SplitterClose(vout_display_t *vd);
*****************************************************************************/ *****************************************************************************/
static picture_t *VideoBufferNew(filter_t *filter) static picture_t *VideoBufferNew(filter_t *filter)
{ {
vout_display_t *vd = (vout_display_t*)filter->p_owner;
const video_format_t *fmt = &filter->fmt_out.video; const video_format_t *fmt = &filter->fmt_out.video;
picture_t *picture = picture_New(fmt->i_chroma, assert(vd->fmt.i_chroma == fmt->i_chroma &&
fmt->i_width, fmt->i_height, vd->fmt.i_width == fmt->i_width &&
fmt->i_aspect); vd->fmt.i_height == fmt->i_height);
if (!picture)
msg_Err(filter, "Failed to allocate picture"); return vout_display_Get(vd);
return picture;
} }
static void VideoBufferDelete(filter_t *filter, picture_t *picture) static void VideoBufferDelete(filter_t *filter, picture_t *picture)
{ {
...@@ -62,12 +62,11 @@ static void VideoBufferDelete(filter_t *filter, picture_t *picture) ...@@ -62,12 +62,11 @@ static void VideoBufferDelete(filter_t *filter, picture_t *picture)
picture_Release(picture); picture_Release(picture);
} }
static int FilterAllocationInit(filter_t *filter, void *data) static int FilterAllocationInit(filter_t *filter, void *vd)
{ {
VLC_UNUSED(data);
filter->pf_vout_buffer_new = VideoBufferNew; filter->pf_vout_buffer_new = VideoBufferNew;
filter->pf_vout_buffer_del = VideoBufferDelete; filter->pf_vout_buffer_del = VideoBufferDelete;
filter->p_owner = vd;
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -75,6 +74,7 @@ static void FilterAllocationClean(filter_t *filter) ...@@ -75,6 +74,7 @@ static void FilterAllocationClean(filter_t *filter)
{ {
filter->pf_vout_buffer_new = NULL; filter->pf_vout_buffer_new = NULL;
filter->pf_vout_buffer_del = NULL; filter->pf_vout_buffer_del = NULL;
filter->p_owner = NULL;
} }
/***************************************************************************** /*****************************************************************************
...@@ -379,7 +379,7 @@ static void VoutDisplayCreateRender(vout_display_t *vd) ...@@ -379,7 +379,7 @@ static void VoutDisplayCreateRender(vout_display_t *vd)
osys->filters = filter_chain_New(vd, "video filter2", false, osys->filters = filter_chain_New(vd, "video filter2", false,
FilterAllocationInit, FilterAllocationInit,
FilterAllocationClean, NULL); FilterAllocationClean, vd);
assert(osys->filters); /* TODO critical */ assert(osys->filters); /* TODO critical */
/* */ /* */
...@@ -849,8 +849,7 @@ picture_t *vout_FilterDisplay(vout_display_t *vd, picture_t *picture) ...@@ -849,8 +849,7 @@ picture_t *vout_FilterDisplay(vout_display_t *vd, picture_t *picture)
{ {
vout_display_owner_sys_t *osys = vd->owner.sys; vout_display_owner_sys_t *osys = vd->owner.sys;
if (!osys->filters) assert(osys->filters);
return picture;
return filter_chain_VideoFilter(osys->filters, picture); return filter_chain_VideoFilter(osys->filters, picture);
} }
...@@ -1137,6 +1136,7 @@ static void SplitterPrepare(vout_display_t *vd, picture_t *picture) ...@@ -1137,6 +1136,7 @@ static void SplitterPrepare(vout_display_t *vd, picture_t *picture)
for (int i = 0; i < sys->count; i++) { for (int i = 0; i < sys->count; i++) {
/* */ /* */
/* FIXME now vout_FilterDisplay already return a direct buffer FIXME */
sys->picture[i] = vout_FilterDisplay(sys->display[i], sys->picture[i]); sys->picture[i] = vout_FilterDisplay(sys->display[i], sys->picture[i]);
if (!sys->picture[i]) if (!sys->picture[i])
continue; continue;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment