public class HVideoConfigTemplate extends HScreenConfigTemplate
HVideoConfigTemplate
class is used to obtain a valid HVideoConfiguration. An
application instantiates one of these objects and then sets all
non-default attributes as desired. The object is then passed to the
HVideoDevice.getBestConfiguration(org.havi.ui.HVideoConfigTemplate) method found in the
HVideoDevice class. If possible,
a valid HVideoConfiguration
is returned which meets or exceeds the requirements set in
the HVideoConfigTemplate.
This class may be subclassed to support additional properties of video configurations which may be requested by applications.
| Parameter | Description | Default value | Set method | Get method |
|---|---|---|---|---|
| None. | ||||
| Description | Default value | Set method | Get method |
|---|---|---|---|
| None. | |||
| Modifier and Type | Field and Description |
|---|---|
static int |
GRAPHICS_MIXING
A value for use in the preference field of the
setPreference
and getPreferencePriority methods in the HVideoConfigTemplate that
indicates that the device configuration supports the display of
graphics in addition to video streams. |
DONT_CARE, FLICKER_FILTERING, INTERLACED_DISPLAY, PIXEL_ASPECT_RATIO, PIXEL_RESOLUTION, PREFERRED, PREFERRED_NOT, REQUIRED, REQUIRED_NOT, SCREEN_RECTANGLE, VIDEO_GRAPHICS_PIXEL_ALIGNED, ZERO_BACKGROUND_IMPACT, ZERO_GRAPHICS_IMPACT, ZERO_VIDEO_IMPACT| Constructor and Description |
|---|
HVideoConfigTemplate()
Creates an
HVideoConfigTemplate
object. |
| Modifier and Type | Method and Description |
|---|---|
Object |
getPreferenceObject(int preference)
Return the preference object for the specified preference.
|
int |
getPreferencePriority(int preference)
Return the priority for the specified preference.
|
boolean |
isConfigSupported(HVideoConfiguration hvc)
Returns a boolean indicating whether or not the specified
HVideoConfiguration can
be used to create a video plane that supports the features set
in this template. |
void |
setPreference(int preference,
Object object,
int priority)
Set the indicated preference (and associated value object) to
have the specified priority.
|
setPreferencepublic static final int GRAPHICS_MIXING
setPreference
and getPreferencePriority methods in the HVideoConfigTemplate that
indicates that the device configuration supports the display of
graphics in addition to video streams. This display includes
both configurations where the video pixels and graphics pixels
are fully aligned (same size) as well as configurations where
they are displayed together but where a more complex
relationship exists between the two pixel coordinate
spaces. The graphics configuration for mixing is specified as an
HGraphicsConfiguration.
This preference is used by the platform as a constraint in
selecting configurations. Templates generated by the platform
and then returned to applications (e.g. from a
getConfigTemplate method) shall not have this
preference filled in by the platform.
public HVideoConfigTemplate()
HVideoConfigTemplate
object. See the class description for
details of constructor parameters and default values.public boolean isConfigSupported(HVideoConfiguration hvc)
HVideoConfiguration can
be used to create a video plane that supports the features set
in this template.hvc - - the HVideoConfiguration
object to test against this template.HVideoConfiguration
object can be used to create a video plane
that supports the features set in this template, false
otherwise.public int getPreferencePriority(int preference)
By default the preferences in a template returned from the
system will have a HScreenConfigTemplate.DONT_CARE
priority unless specified otherwise. Any configuration always
satisfies these attributes.
getPreferencePriority in class HScreenConfigTemplatepreference - the preference to be indicated. Valid values
for an HVideoConfigTemplate are:
HScreenConfigTemplate.ZERO_BACKGROUND_IMPACT,
HScreenConfigTemplate.ZERO_GRAPHICS_IMPACT,
HScreenConfigTemplate.ZERO_VIDEO_IMPACT,
HScreenConfigTemplate.INTERLACED_DISPLAY,
HScreenConfigTemplate.FLICKER_FILTERING,
HScreenConfigTemplate.VIDEO_GRAPHICS_PIXEL_ALIGNED,
HScreenConfigTemplate.PIXEL_ASPECT_RATIO,
HScreenConfigTemplate.PIXEL_RESOLUTION,
HScreenConfigTemplate.SCREEN_RECTANGLE and
GRAPHICS_MIXING.
Subclasses may add further valid values. An
IllegalArgumentException shall be thrown if the preference is
not a valid value for this instance of HVideoConfigTemplate
public void setPreference(int preference,
Object object,
int priority)
Attributes that are not filled in in a template (through setPreference(int, java.lang.Object, int)),
shall have the priority HScreenConfigTemplate.DONT_CARE. Any
configuration always satisfies these attributes.
An application which wishes to remove a preference from an existing template (e.g. one generated by the platform) may call this method with null for the object parameter. Specifying null as the object parameter shall have no effect if the preference is not in the template.
setPreference in class HScreenConfigTemplatepreference - the preference to be indicated. Valid values
for an HScreenConfigTemplate are:
HScreenConfigTemplate.PIXEL_ASPECT_RATIO,
HScreenConfigTemplate.PIXEL_RESOLUTION,
HScreenConfigTemplate.SCREEN_RECTANGLE,
HScreenConfigTemplate.VIDEO_GRAPHICS_PIXEL_ALIGNED
and GRAPHICS_MIXING.
Subclasses may add further valid values. An
IllegalArgumentException shall be thrown if the preference is
not a valid value for this instance of HVideoConfigTemplate
object - the Object associated with the given preference,
or null.priority - the priority of the preference. Valid values include:
HScreenConfigTemplate.REQUIRED,
HScreenConfigTemplate.PREFERRED,
HScreenConfigTemplate.DONT_CARE,
HScreenConfigTemplate.PREFERRED_NOT and
HScreenConfigTemplate.REQUIRED_NOT.
If priority is not a valid priority as defined here a
java.lang.IllegalArgumentException will be thrown.
public Object getPreferenceObject(int preference)
Instances of HVideoConfigTemplate
which have not had this preference set
shall return null for this object. Note that instances
constructed by the platform and returned to applications are
required to have all preferences (except where explicitly
identified) set by the platform before it is returned.
getPreferenceObject in class HScreenConfigTemplatepreference - the preference to be indicated. Valid values
for an HVideoConfigTemplate are:
HScreenConfigTemplate.VIDEO_GRAPHICS_PIXEL_ALIGNED,
HScreenConfigTemplate.PIXEL_ASPECT_RATIO,
HScreenConfigTemplate.PIXEL_RESOLUTION,
HScreenConfigTemplate.SCREEN_RECTANGLE,
and
GRAPHICS_MIXING.
Subclasses may add further valid values. A
IllegalArgumentException shall be thrown if the preference is
not a valid value for this instance of HVideoConfigTemplate, or
if preference does not have an associated value object.
Copyright © 2012 code4tv.com. All Rights Reserved.