*****************************************************************************/
static picture_t *VideoBufferNew(filter_t *filter)
{
- vout_display_t *vd = (vout_display_t*)filter->p_owner;
+ vout_display_t *vd = filter->owner.sys;
const video_format_t *fmt = &filter->fmt_out.video;
assert(vd->fmt.i_chroma == fmt->i_chroma &&
static int FilterAllocationInit(filter_t *filter, void *vd)
{
- filter->pf_video_buffer_new = VideoBufferNew;
- filter->pf_video_buffer_del = VideoBufferDelete;
- filter->p_owner = vd;
-
+ filter->owner.sys = vd;
+ filter->owner.video.buffer_new = VideoBufferNew;
+ filter->owner.video.buffer_del = VideoBufferDelete;
return VLC_SUCCESS;
}
-static void FilterAllocationClean(filter_t *filter)
-{
- filter->pf_video_buffer_new = NULL;
- filter->pf_video_buffer_del = NULL;
- filter->p_owner = NULL;
-}
/*****************************************************************************
*
*width = *width * cfg->zoom.num / cfg->zoom.den;
*height = *height * cfg->zoom.num / cfg->zoom.den;
+
+ if (ORIENT_IS_SWAP(source->orientation)) {
+
+ unsigned store = *width;
+ *width = *height;
+ *height = store;
+ }
}
/* */
unsigned display_width;
unsigned display_height;
+ video_format_t source_rot;
+ video_format_ApplyRotation(&source_rot, source);
+ source = &source_rot;
+
if (cfg->is_display_filled) {
display_width = cfg->display.width;
display_height = cfg->display.height;
}
}
+void vout_display_SendMouseMovedDisplayCoordinates(vout_display_t *vd, video_orientation_t orient_display, int m_x, int m_y, vout_display_place_t *place)
+{
+ video_format_t source_rot = vd->source;
+ video_format_TransformTo(&source_rot, orient_display);
+
+ if (place->width > 0 && place->height > 0) {
+
+ int x = (int)(source_rot.i_x_offset +
+ (int64_t)(m_x - place->x) * source_rot.i_visible_width / place->width);
+ int y = (int)(source_rot.i_y_offset +
+ (int64_t)(m_y - place->y) * source_rot.i_visible_height/ place->height);
+
+ video_transform_t transform = video_format_GetTransform(vd->source.orientation, orient_display);
+
+ int store;
+
+ switch (transform) {
+
+ case TRANSFORM_R90:
+ store = x;
+ x = y;
+ y = vd->source.i_visible_height - store;
+ break;
+ case TRANSFORM_R180:
+ x = vd->source.i_visible_width - x;
+ y = vd->source.i_visible_height - y;
+ break;
+ case TRANSFORM_R270:
+ store = x;
+ x = vd->source.i_visible_width - y;
+ y = store;
+ break;
+ case TRANSFORM_HFLIP:
+ x = vd->source.i_visible_width - x;
+ break;
+ case TRANSFORM_VFLIP:
+ y = vd->source.i_visible_height - y;
+ break;
+ case TRANSFORM_TRANSPOSE:
+ store = x;
+ x = y;
+ y = store;
+ break;
+ case TRANSFORM_ANTI_TRANSPOSE:
+ store = x;
+ x = vd->source.i_visible_width - y;
+ y = vd->source.i_visible_height - store;
+ break;
+ default:
+ break;
+ }
+
+ vout_display_SendEventMouseMoved (vd, x, y);
+ }
+}
+
struct vout_display_owner_sys_t {
vout_thread_t *vout;
bool is_wrapper; /* Is the current display a wrapper */
msg_Dbg(vd, "A filter to adapt decoder to display is needed");
osys->filters = filter_chain_New(vd, "video filter2", false,
- FilterAllocationInit,
- FilterAllocationClean, vd);
+ FilterAllocationInit, NULL, vd);
assert(osys->filters); /* TODO critical */
/* */
if (!cfg.is_fullscreen != !display_is_fullscreen ||
vout_display_Control(vd, VOUT_DISPLAY_CHANGE_DISPLAY_SIZE, &cfg, display_is_forced)) {
- if (!cfg.is_fullscreen == !display_is_fullscreen)
+ if (!display_is_forced)
msg_Err(vd, "Failed to resize display");
/* We ignore the resized */