org.ocap.hardware.device.DynamicVideoOutputConfiguration Maven / Gradle / Ivy
/*
* Created on Mar 20, 2007
*/
package org.ocap.hardware.device;
import java.util.Enumeration;
import org.dvb.media.VideoFormatControl;
/**
* An instance of this class may be used to represent a dynamic selection of video
* output configurations based upon specified input video.
* An instance of DynamicVideoOutputConfiguration
would mainly be used
* to allow for the HScreen
resolution and the video output port resolution
* to closely match the resolution of the input video, generally with the intention of
* letting the display monitor connected to the output port manage aspect ratio conversions.
*
* Such configurations are only valid for the current
* {@link HostSettings#getMainVideoOutputPort main} video output port for
* a given HScreen
.
* If a video output port is not the current main output port or
* ceases to be the main, then this configuration setting SHALL be
* effectively ignored and output resolution settings SHALL revert to an
* implementation-specific configuration.
*
* Application of the input-to-output video resolution mapping described by an
* instance of DynamicVideoOutputConfiguration
MAY result in configuration
* changes for the component HScreenDevice
s of the relevant
* HScreen
as if the output resolution were selected via a
* {@link FixedVideoOutputConfiguration static} configuration.
*/
public class DynamicVideoOutputConfiguration implements VideoOutputConfiguration
{
/**
* Constant representing any Standard Definition input video.
*/
public static final VideoResolution INPUT_SD = new VideoResolution(null, -1, 0F, VideoResolution.SCANMODE_UNKNOWN);
/**
* Constant reprsenting any High Definition input video.
*/
public static final VideoResolution INPUT_HD = new VideoResolution(null, -1, 0F, VideoResolution.SCANMODE_UNKNOWN);
/**
* Construct a new instance of DynamicVideoOutputConfiguration
.
* The newly created DynamicVideoOutputConfiguration
contains
* no mappings from input video to output video configuration.
*/
public DynamicVideoOutputConfiguration()
{
// to be implemented
}
/**
* Returns "Dynamic".
* @return "Dynamic"
* @see org.ocap.hardware.device.VideoOutputConfiguration#getName()
*/
public String getName()
{
return "Dynamic";
}
/**
* Add a desired input video resolution to output video resolution mapping.
* If this configuration is {@link VideoOutputSettings#setOutputConfiguration applied}
* successfully, the video output port would use the given output resolution whenever
* the main video input resolution matched the given input resolution.
*
* The desired video output resolution is specified as an instance of
* FixedVideoOutputConfiguration
. Valid configurations are those
* returned by {@link VideoOutputSettings#getSupportedConfigurations()} for a
* given video output port instance.
* This class does not guard against addition of an invalid video
* resolution configuration.
* Instead, the instance of DynamicVideoOutputConfiguration
* would be rejected by the video output port.
*
* For a given input resolution, wildcard values may be specified for some attributes.
* The following table documents accepted wildcard (or "don't care") values.
*
* Attribute Wildcard value
* {@link VideoResolution#getPixelResolution()}
* null
* {@link VideoResolution#getAspectRatio()}
* {@link VideoFormatControl#ASPECT_RATIO_UNKNOWN}
* {@link VideoResolution#getRate()}
* <= 0.0F
* {@link VideoResolution#getScanMode()}
* {@link VideoResolution#SCANMODE_UNKNOWN}
*
*
* @param inputResolution The given input video resolution.
* May be an application-created instance of VideoResolution
;
* or one of {@link #INPUT_SD} or {@link #INPUT_HD} may be specified to
* indicate a wildcard value covering all SD or HD resolutions.
* @param outputResolution The desired output configuration that video of the given input
* resolution should be mapped.
*
* @see #getOutputResolution
*/
public void addOutputResolution(VideoResolution inputResolution, FixedVideoOutputConfiguration outputResolution)
{
// to be implemented
}
/**
* Get the output configuration that should be applied for the given input resolution
* if this configuration were successfully set on a video output port.
*
* @param inputResolution The given input video resolution.
* May be an application-created instance of VideoResolution
;
* or one of {@link #INPUT_SD} or {@link #INPUT_HD} may be specified to
* indicate a wildcard value covering all SD or HD resolutions.
* @return The output video configuration mapped to by the given input resolution
* or null
if no mapping is defined.
*
* @see #addOutputResolution
*/
public FixedVideoOutputConfiguration getOutputResolution(VideoResolution inputResolution)
{
return null;
}
/**
* Get the set of input video resolutions for which a mapping to output configuration
* is specified.
*
* @return A non-null
Enumeration
of VideoResolution
instances.
*/
public Enumeration getInputResolutions()
{
return null;
}
}