[vlc-devel] [PATCH 3/4] vmem: allow clients get info about visible width/height and pixel aspect
Rémi Denis-Courmont
remi at remlab.net
Sat Jan 30 15:41:42 CET 2016
Le 2016-01-30 10:27, Sergey Radionov a écrit :
> ---
> modules/video_output/vmem.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/modules/video_output/vmem.c
> b/modules/video_output/vmem.c
> index ce9584d..3122e5a 100644
> --- a/modules/video_output/vmem.c
> +++ b/modules/video_output/vmem.c
> @@ -174,6 +174,8 @@ static int Open(vlc_object_t *object)
> video_format_t fmt;
> video_format_ApplyRotation(&fmt, &vd->fmt);
>
> + unsigned widths[] = { fmt.i_width, fmt.i_visible_width,
> vd->source.i_sar_num };
> + unsigned heights[] = { fmt.i_height, fmt.i_visible_height,
> vd->source.i_sar_den };
Missing offsets?
> if (setup != NULL) {
> char chroma[5];
>
> @@ -182,7 +184,7 @@ static int Open(vlc_object_t *object)
> memset(sys->pitches, 0, sizeof(sys->pitches));
> memset(sys->lines, 0, sizeof(sys->lines));
>
> - sys->count = setup(&sys->opaque, chroma, &fmt.i_width,
> &fmt.i_height,
> + sys->count = setup(&sys->opaque, chroma, widths, heights,
> sys->pitches, sys->lines);
> if (sys->count == 0) {
> msg_Err(vd, "video format setup failure (no pictures)");
> @@ -196,8 +198,8 @@ static int Open(vlc_object_t *object)
> fmt.i_chroma = vlc_fourcc_GetCodecFromString(VIDEO_ES,
> chroma);
> free(chroma);
>
> - fmt.i_width = var_InheritInteger(vd, "vmem-width");
> - fmt.i_height = var_InheritInteger(vd, "vmem-height");
> + widths[0] = var_InheritInteger(vd, "vmem-width");
> + heights[0] = var_InheritInteger(vd, "vmem-height");
> sys->pitches[0] = var_InheritInteger(vd, "vmem-pitch");
> sys->lines[0] = fmt.i_height;
> for (size_t i = 1; i < PICTURE_PLANE_MAX; i++)
> @@ -209,6 +211,8 @@ static int Open(vlc_object_t *object)
> sys->cleanup = NULL;
> }
> fmt.i_x_offset = fmt.i_y_offset = 0;
> + fmt.i_width = widths[0];
> + fmt.i_height = heights[0];
> fmt.i_visible_width = fmt.i_width;
> fmt.i_visible_height = fmt.i_height;
--
Rémi Denis-Courmont
http://www.remlab.net/
More information about the vlc-devel
mailing list