[vlc-devel] [PATCH 3/4] vmem: allow clients get info about visible width/height and pixel aspect

sergey radionov rsatom at gmail.com
Sat Jan 30 15:53:24 CET 2016


2016-01-30 20:41 GMT+06:00 Rémi Denis-Courmont <remi at remlab.net>:

> 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?


Just didn't think it could be useful. Should I add it?


>
>
>      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/
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20160130/0e1a2fa9/attachment.html>


More information about the vlc-devel mailing list