Commit 305b0ad3 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

XCB/X11: handle scaling, crop and A/R

(Crop is currently dysfunctional, picture offset are missing)
parent bad101ba
...@@ -226,3 +226,46 @@ void PictureFree (picture_t *pic, xcb_connection_t *conn) ...@@ -226,3 +226,46 @@ void PictureFree (picture_t *pic, xcb_connection_t *conn)
} }
shmdt (pic->p->p_pixels); shmdt (pic->p->p_pixels);
} }
/**
* Video output thread management stuff.
* FIXME: Much of this should move to core
*/
void CommonManage (vout_thread_t *vout)
{
if (vout->i_changes & VOUT_SCALE_CHANGE)
{
vout->b_autoscale = var_GetBool (vout, "autoscale");
vout->i_zoom = ZOOM_FP_FACTOR;
vout->i_changes &= ~VOUT_SCALE_CHANGE;
vout->i_changes |= VOUT_SIZE_CHANGE;
}
if (vout->i_changes & VOUT_ZOOM_CHANGE)
{
vout->b_autoscale = false;
vout->i_zoom = var_GetFloat (vout, "scale") * ZOOM_FP_FACTOR;
vout->i_changes &= ~VOUT_ZOOM_CHANGE;
vout->i_changes |= VOUT_SIZE_CHANGE;
}
if (vout->i_changes & VOUT_CROP_CHANGE)
{
vout->fmt_out.i_x_offset = vout->fmt_in.i_x_offset;
vout->fmt_out.i_y_offset = vout->fmt_in.i_y_offset;
vout->fmt_out.i_visible_width = vout->fmt_in.i_visible_width;
vout->fmt_out.i_visible_height = vout->fmt_in.i_visible_height;
vout->i_changes &= ~VOUT_CROP_CHANGE;
vout->i_changes |= VOUT_SIZE_CHANGE;
}
if (vout->i_changes & VOUT_ASPECT_CHANGE)
{
vout->fmt_out.i_aspect = vout->fmt_in.i_aspect;
vout->fmt_out.i_sar_num = vout->fmt_in.i_sar_num;
vout->fmt_out.i_sar_den = vout->fmt_in.i_sar_den;
vout->output.i_aspect = vout->fmt_in.i_aspect;
vout->i_changes &= ~VOUT_ASPECT_CHANGE;
vout->i_changes |= VOUT_SIZE_CHANGE;
}
}
...@@ -408,6 +408,8 @@ static int Manage (vout_thread_t *vout) ...@@ -408,6 +408,8 @@ static int Manage (vout_thread_t *vout)
msg_Err (vout, "X server failure"); msg_Err (vout, "X server failure");
return VLC_EGENERIC; return VLC_EGENERIC;
} }
CommonManage (vout); /* FIXME: <-- move that to core */
return VLC_SUCCESS; return VLC_SUCCESS;
} }
......
...@@ -51,3 +51,4 @@ int GetWindowSize (struct vout_window_t *wnd, xcb_connection_t *conn, ...@@ -51,3 +51,4 @@ int GetWindowSize (struct vout_window_t *wnd, xcb_connection_t *conn,
unsigned *restrict width, unsigned *restrict height); unsigned *restrict width, unsigned *restrict height);
int PictureAlloc (vout_thread_t *, picture_t *, size_t, xcb_connection_t *); int PictureAlloc (vout_thread_t *, picture_t *, size_t, xcb_connection_t *);
void PictureFree (picture_t *pic, xcb_connection_t *conn); void PictureFree (picture_t *pic, xcb_connection_t *conn);
void CommonManage (vout_thread_t *);
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