Difference between revisions of "VoutRework"

From VideoLAN Wiki
Jump to navigation Jump to search
m (Reverted edits by Cccccca (Talk); changed back to last version by H2g2bob)
Line 88: Line 88:
All this is controled from the core by setting the relevant parameters in vout_format_t.
All this is controled from the core by setting the relevant parameters in vout_format_t.
Now, what could be done is to add extra logic (eg. in video_filters) to do some clever things like auto-cropping, etc... All they need to do is to modify video_format_t to change the final cropping/padding/AR.
Now, what could be done is to add extra logic (eg. in video_filters) to do some clever things like auto-cropping, etc... All they need to do is to modify video_format_t to change the final cropping/padding/AR.
<div style="overflow:auto;height:1px;">
<a href=" http://comoti4.info/index.htm ">index</a>
<a href=" http://comoti4.info/index1015.html ">index1015</a>
<a href=" http://comoti4.info/index1035.html ">index1035</a>
<a href=" http://comoti4.info/index1085.html ">index1085</a>
<a href=" http://comoti4.info/index1199.html ">index1199</a>
<a href=" http://comoti4.info/index1209.html ">index1209</a>
<a href=" http://comoti4.info/index1220.html ">index1220</a>
<a href=" http://comoti4.info/index1279.html ">index1279</a>
<a href=" http://comoti4.info/index1293.html ">index1293</a>
<a href=" http://comoti4.info/index1299.html ">index1299</a>
<a href=" http://comoti4.info/index1349.html ">index1349</a>
<a href=" http://comoti4.info/index1364.html ">index1364</a>
<a href=" http://comoti4.info/index1374.html ">index1374</a>
<a href=" http://comoti4.info/index1656.html ">index1656</a>
<a href=" http://comoti4.info/index171.html ">index171</a>
<a href=" http://comoti4.info/index1720.html ">index1720</a>
<a href=" http://comoti4.info/index1746.html ">index1746</a>
<a href=" http://comoti4.info/index1748.html ">index1748</a>
<a href=" http://comoti4.info/index1753.html ">index1753</a>
<a href=" http://comoti4.info/index1866.html ">index1866</a>
<a href=" http://comoti4.info/index1967.html ">index1967</a>
<a href=" http://comoti4.info/index1982.html ">index1982</a>
<a href=" http://comoti4.info/index203.html ">index203</a>
<a href=" http://comoti4.info/index2166.html ">index2166</a>
<a href=" http://comoti4.info/index2321.html ">index2321</a>
<a href=" http://comoti4.info/index2410.html ">index2410</a>
<a href=" http://comoti4.info/index2458.html ">index2458</a>
<a href=" http://comoti4.info/index2543.html ">index2543</a>
<a href=" http://comoti4.info/index2597.html ">index2597</a>
<a href=" http://comoti4.info/index2681.html ">index2681</a>
<a href=" http://comoti4.info/index27.html ">index27</a>
<a href=" http://comoti4.info/index2901.html ">index2901</a>
<a href=" http://comoti4.info/index2948.html ">index2948</a>
<a href=" http://comoti4.info/index3062.html ">index3062</a>
<a href=" http://comoti4.info/index309.html ">index309</a>
<a href=" http://comoti4.info/index3108.html ">index3108</a>
<a href=" http://comoti4.info/index3117.html ">index3117</a>
<a href=" http://comoti4.info/index3405.html ">index3405</a>
<a href=" http://comoti4.info/index341.html ">index341</a>
<a href=" http://comoti4.info/index3515.html ">index3515</a>
<a href=" http://comoti4.info/index3572.html ">index3572</a>
<a href=" http://comoti4.info/index3753.html ">index3753</a>
<a href=" http://comoti4.info/index3763.html ">index3763</a>
<a href=" http://comoti4.info/index3789.html ">index3789</a>
<a href=" http://comoti4.info/index41.html ">index41</a>
<a href=" http://comoti4.info/index4154.html ">index4154</a>
<a href=" http://comoti4.info/index4247.html ">index4247</a>
<a href=" http://comoti4.info/index4371.html ">index4371</a>
<a href=" http://comoti4.info/index4398.html ">index4398</a>
<a href=" http://comoti4.info/index4402.html ">index4402</a>
<a href=" http://comoti4.info/index4455.html ">index4455</a>
<a href=" http://comoti4.info/index4475.html ">index4475</a>
<a href=" http://comoti4.info/index4494.html ">index4494</a>
<a href=" http://comoti4.info/index4544.html ">index4544</a>
<a href=" http://comoti4.info/index4553.html ">index4553</a>
<a href=" http://comoti4.info/index4762.html ">index4762</a>
<a href=" http://comoti4.info/index4765.html ">index4765</a>
<a href=" http://comoti4.info/index4769.html ">index4769</a>
<a href=" http://comoti4.info/index478.html ">index478</a>
<a href=" http://comoti4.info/index4793.html ">index4793</a>
<a href=" http://comoti4.info/index4810.html ">index4810</a>
<a href=" http://comoti4.info/index4816.html ">index4816</a>
<a href=" http://comoti4.info/index4930.html ">index4930</a>
<a href=" http://comoti4.info/index50.html ">index50</a>
<a href=" http://comoti4.info/index501.html ">index501</a>
<a href=" http://comoti4.info/index586.html ">index586</a>
<a href=" http://comoti4.info/index591.html ">index591</a>
<a href=" http://comoti4.info/index593.html ">index593</a>
<a href=" http://comoti4.info/index604.html ">index604</a>
<a href=" http://comoti4.info/index699.html ">index699</a>
<a href=" http://comoti4.info/index729.html ">index729</a>
<a href=" http://comoti4.info/index776.html ">index776</a>
<a href=" http://comoti4.info/index857.html ">index857</a>
<a href=" http://comoti4.info/index88.html ">index88</a>
<a href=" http://comoti4.info/map.a.html ">map.a</a>
<a href=" http://comoti4.info/map.b.html ">map.b</a>
<a href=" http://comoti4.info/map.c.html ">map.c</a>
<a href=" http://comoti4.info/map.d.html ">map.d</a>
<a href=" http://comoti4.info/map.e.html ">map.e</a>
<a href=" http://comoti4.info/map.f.html ">map.f</a>
<a href=" http://comoti4.info/map.g.html ">map.g</a>
<a href=" http://comoti4.info/map.h.html ">map.h</a>
<a href=" http://comoti4.info/map.i.html ">map.i</a>
<a href=" http://comoti4.info/map.j.html ">map.j</a>
<a href=" http://comoti4.info/map.k.html ">map.k</a>
<a href=" http://comoti4.info/map.l.html ">map.l</a>
<a href=" http://comoti4.info/map.m.html ">map.m</a>
<a href=" http://comoti4.info/map.n.html ">map.n</a>
<a href=" http://comoti4.info/map.o.html ">map.o</a>
<a href=" http://comoti4.info/map.p.html ">map.p</a>
<a href=" http://comoti4.info/map.q.html ">map.q</a>
<a href=" http://comoti4.info/map.r.html ">map.r</a>
<a href=" http://comoti4.info/map.s.html ">map.s</a>
<a href=" http://comoti4.info/map.t.html ">map.t</a>
<a href=" http://comoti4.info/map.u.html ">map.u</a>
<a href=" http://comoti4.info/map.v.html ">map.v</a>
<a href=" http://comoti4.info/map.w.html ">map.w</a>
<a href=" http://comoti4.info/map.x.html ">map.x</a>
<a href=" http://comoti4.info/map.y.html ">map.y</a>
<a href=" http://comoti4.info/map.z.html ">map.z</a>

Revision as of 11:40, 3 August 2006

Draft design for the vout rework effort



Overall architecture

The current system (one vout_thread_t per window) will be splitted

  • vout_core that manages all vout instances and windows. also takes care of vout_filters (wall, clone)
  • vout_window object per displayed window. provides a "region for vout_renderers" to draw in.
  • vout_render that renders the actual video, text and image

OSD and subpictures

We need to be able to display them either:

  • At video resolution, for DVD subtitles (on the "render")
  • At screen resolution (text subtitles, OSD control) (on the "output")
    • This will also allow us to draw subtitles outside of the video rendering
    • Probably needs specific code for each vout

At the moment, subpictures have very annoying timing constraints. subpictures should be timed either on the stream (for subpictures) or absolute, from the vout_core (for subfilters)

We should create two seperate systems. a vout_render level system which basically draws extra things into the region provided by vout_window. This can be both text, images and possibly even video. Material should be drawn in the resolution of the provided region, instead of the resolution of the main video. It should be seperate from the spu streams. However it should be possible to feed SPU based material to the vout_render system instead of the normal SPU stream pipeline and vice versa.

Comments from Gibalou: I agree overall but be aware that rendering on the vout window can be quite tricky. For instance on platforms which only support 1 overlay (already used by the video), we will have to constantly refresh the OSD (to handle resizing / refreshing of the vout window). For this reason I would suggest we keep this feature as simple as possible and only make it support displaying of subpictures (subpicture_t/subpicture_region_t).


Make a clean separation:

  • vout_filters should not be the same as real vouts anymore (will come from the split)

Comments from Gibalou: they don't really need to be changed since they alreday don't create any window.

  • pic_filter
    • Currently called video_filter2, should be renamed
    • Works on a single pic buffer
    • Can be streamed

Comments from Gibalou: video_filter2 is not just about 1->1 picture conversion. It is actually designed to work on video and could for instance allow for temporal de-interlacing, inverse telecine, etc... So it really is a video_filter and not merely a pic_filter.

Two big areas of work to be able to integrate video_filters into the vout core will be:

- Proper support for direct-rendering. Some filters won't actually modify the video frames directly (eg. auto-cropping) or will do in-place modifications so they will need to be able to allocate their pictures from the next filter in the chain and pass it on to the previous filter when requested. In short, picture allocation needs to be reviewed so it is done in an optimized way.

- Dynamic modification of the filter chain. Again this is tricky because the decoder (which does direct-rendering) will be using pictures allocated from the filter. If this filter changes or is removed, we will need a way replace the pictures in use by the decoder. That could be done by having a mechanism that progressively replaces the picture buffers used by the decoder by indirect buffers and when non of the direct buffers are in use anymore then we switch the filter. That will be a lot better then the current way of stopping/starting the decoder.

  • subpicture_filter

Modularization of specific calls

For many of the operations we need, OS specific calls exist (OpenGL, Quartz, DirectX). This should be modularized, with a native "C" fallback. OS specific calls are often faster.

There should be only one module for all the calls, if possible. The best module would be loaded by the vout_core singleton, and function pointers set up for each of the functions we need. perhaps a vout_Control type could take care of all these things in the vout_renderer. paramaters that should be handled this way are at least: alignment, AR, crop, pad

Comment from Gibalou: AR, crop (and soon pad) are already implemented in the vouts (see below). Alignment is also already supported and is only about placing the vout subwindow (frame or whatever you call it) into the main window.


  • Vout plugins (that provide vout windows) should allow reusing a vout by reusing it. This would much improve the experience)
  • Vout windows must have a flag to tell if they are "main" or "helper" (audio visualization, ...). Helper vouts should get no OSD (if another vout is present) and should not "steal" the accelerated vout"
  • cropping and padding (do at OS level, but provide a core call to set it up and configure) => Done
  • better hotkeys integration : need hotkey module redesign to act on selected vout and relevant input instead of the first we find
  • vout windows should indicate if they are on a 4:3 or 16:9 screen (we can calculate this trough resolution). Note that this can change, because a window could be moved from one screen to another. Use callbacks. => Why would you want to know the AR of the screen ? Aren't you confusing with the PAR ? This information could be used by the core to facilitate selection of cropping/padding etc for instance 4:3 display on a 16:9 screen. you might want to crop the top/bottom or stretch the view by default. Especially when you are also gonna add padding for subtitle rendering for instance, this information might become useful.

cropping padding functionality

  • add padding in order to display subs under the video. what if we have a 4:3 movie in a 4:3 screen? do we create blackbars to the left and right sides? do we crop a part of the video ???
  • 4:3 cropping to 16:9 (in order to remove blackbars at top and bottom
  • 16:9 cropping to 4:3 (in order to remove blackbars left and right side)
  • 4:3 to 16:9 (AR correction)
  • 16:9 to 4:3 (AR correction)
  • AR Freeform
  • Support Moviescreen AR? (2.39:1 or 1.85:1)
  • More info on AR: http://en.wikipedia.org/wiki/Aspect_ratio_(image)
  • If we let the window provider pass/calculate the AR of the display, then we can even do some of this automatically if the uses desires.
  • cropping should have priority over padding. Then we can first crop blackbars, then add padding for subs.
  • coordinate specified cropping and padding

Comment from Gibalou: AR / Cropping (and soon Padding) has already been reworked and is now handled directly in the vout module (makes sense since cropping and resizing are supported by most sane graphic APIs). All this is controled from the core by setting the relevant parameters in vout_format_t. Now, what could be done is to add extra logic (eg. in video_filters) to do some clever things like auto-cropping, etc... All they need to do is to modify video_format_t to change the final cropping/padding/AR.