[vdr] ScaleVideo Discussion: API extension or custom service?

Lucian Muresan lucianm at users.sourceforge.net
Wed Nov 28 11:59:38 CET 2012

Hi Klaus,

On 28.11.2012 11:18, Klaus Schmidinger wrote:
> On 28.11.2012 10:41, Lucian Muresan wrote:


> I think this should be done by cDevice and not by some obscure "service"
> plugin developers
> happen to agree upon.
> The interface I would suggest looks like this:
>    virtual cRect cDevice::CanScaleVideo(const cRect &Rect,
> eTextAlignment Alignment = taCenter) { return cRect::Null; }
>        ///< Asks the output device whether it can scale the currently
> shown video in such a way that
>        ///< it fits into the given Rect. If the scaled video doesn't
> exactly fit into Rect,
>        ///< Alignment is used to determine how to align the actual
> rectangle with the requested one.
>        ///< The actual rectangle can be smaller, larger or the same size
> as the given Rect.
>        ///< Returns the rectangle that can actually be used when scaling
> the video. A skin plugin
>        ///< using this function should rearrange its content according
> to the rectangle returned
>        ///< from calling this function, and should especially be
> prepared for cases where the
>        ///< returned rectangle is way off the requested Rect, or even
> Null. In such cases, the skin
>        ///< may want to fall back to working with full screen video.
>        ///< If this device can't scale the video, a Null rectangle is
> returned (this is also the
>        ///< default implementation).
>    virtual void cDevice::ScaleVideo(const cRect &Rect = cRect::Null) {}
>        ///< Scales the currently shown video in such a way that it fits
> into the given Rect.
>        ///< Rect must have been retrieved through a previous call to
> CanScaleVideo().
>        ///< If this device can't scale the video, nothing happens.
>        ///< To restore full screen video, call this function with a Null
> rectangle.
> eTextAlignment is somewhat abused here, maybe we should rename that to a
> more general eAlignment.
> Since this API extension doesn't have any further impact on any existing
> VDR functions, I would
> be willing to add it even before version 2.0.

this is just, what can I say, great! Kudos for the proposals you made 
(they make A LOT of sense), and also for willing to quickly introduce it 
before 2.0!

Thank you,

More information about the vdr mailing list