Commit 56ada4ab authored by nshah's avatar nshah

Tagging ocap_ds for the 1.2.3 bundle release

parent 24b559fe
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>stubs-parent</artifactId>
<groupId>com.cablelabs.ocap</groupId>
<version>1.2.3-SNAPSHOT</version>
</parent>
<artifactId>ocap_ds</artifactId>
<packaging>jar</packaging>
<name>OCAP RI DS Stubs</name>
<dependencies>
<dependency>
<groupId>com.cablelabs.ocap</groupId>
<artifactId>ocap_api</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>${basedir}/src</sourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<configuration>
<descriptorRefs>
<descriptorRef>src</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>srcpkg</id>
<goals>
<goal>single</goal>
</goals>
<phase>prepare-package</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
This diff is collapsed.
/*
* 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 <code>DynamicVideoOutputConfiguration</code> would mainly be used
* to allow for the <code>HScreen</code> 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.
* <p>
* Such configurations are only valid for the current
* {@link HostSettings#getMainVideoOutputPort main} video output port for
* a given <code>HScreen</code>.
* If a video output port is not the current <i>main</i> output port or
* ceases to be the <i>main</i>, then this configuration setting SHALL be
* effectively ignored and output resolution settings SHALL revert to an
* implementation-specific configuration.
* <p>
* Application of the input-to-output video resolution mapping described by an
* instance of <code>DynamicVideoOutputConfiguration</code> MAY result in configuration
* changes for the component <code>HScreenDevice</code>s of the relevant
* <code>HScreen</code> 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 <code>DynamicVideoOutputConfiguration</code>.
* The newly created <code>DynamicVideoOutputConfiguration</code> 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.
* <p>
* The desired video output resolution is specified as an instance of
* <code>FixedVideoOutputConfiguration</code>. 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 <code>DynamicVideoOutputConfiguration</code>
* would be rejected by the video output port.
* <p>
* For a given input resolution, wildcard values may be specified for some attributes.
* The following table documents accepted wildcard (or "don't care") values.
* <table border>
* <tr><th>Attribute</th> <th>Wildcard value</th></tr>
* <tr><td>{@link VideoResolution#getPixelResolution()}</td>
* <td><code>null</code></td></tr>
* <tr><td>{@link VideoResolution#getAspectRatio()}</td>
* <td><code>{@link VideoFormatControl#ASPECT_RATIO_UNKNOWN}</code></td></tr>
* <tr><td>{@link VideoResolution#getRate()}</td>
* <td><code><= 0.0F</code></td></tr>
* <tr><td>{@link VideoResolution#getScanMode()}</td>
* <td><code>{@link VideoResolution#SCANMODE_UNKNOWN}</code></td></tr>
* </table>
*
* @param inputResolution The given input video resolution.
* May be an application-created instance of <code>VideoResolution</code>;
* 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 <code>VideoResolution</code>;
* 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 <code>null</code> 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-<code>null</code> <code>Enumeration</code> of <code>VideoResolution</code> instances.
*/
public Enumeration getInputResolutions()
{
return null;
}
}
package org.ocap.hardware.device;
/**
* Thrown when an application attempts to query/set/get a feature
* not supported on the device.
*/
public class FeatureNotSupportedException extends java.lang.Exception
{
/**
* Creates an FeatureNotSupportedException object. See the class
* description for details of constructor parameters and default
* values.
*/
public FeatureNotSupportedException()
{
throw new RuntimeException("Not implemented");
}
/**
* Creates an FeatureNotSupportedException object with a specified
* reason string.
*
* @param message the reason why the exception was raised
*/
public FeatureNotSupportedException(String message)
{
throw new RuntimeException("Not implemented");
}
}
/*
* Created on Mar 20, 2007
*/
package org.ocap.hardware.device;
import org.havi.ui.event.HScreenConfigurationEvent;
/**
* An instance of this class represents a video output configuration defined by
* a fixed set of attributes.
* <p>
* When such a configuration is successfully applied to a <code>VideoOutputPort</code>,
* the output resolution SHALL be suitably adjusted.
* This MAY in turn adjust the aspect ratio and resolution of the associated
* <code>HScreen</code> and its component <code>HScreenDevice</code>s.
* Any such changes will be announced via the dispatch of
* {@link HScreenConfigurationEvent}s.
*
* @see VideoOutputSettings#getSupportedConfigurations()
* @see VideoOutputSettings#setOutputConfiguration
*/
public interface FixedVideoOutputConfiguration
extends VideoOutputConfiguration
{
/**
* Get the fixed video resolution represented by this <code>VideoOuputConfiguration</code>.
*
* @return the fixed video resolution represent by this configuration
*/
public VideoResolution getVideoResolution();
}
package org.ocap.hardware.device;
import org.havi.ui.HScreen;
import org.ocap.hardware.Host;
import org.ocap.hardware.PowerModeChangeListener;
import org.ocap.hardware.VideoOutputPort;
/**
* System-level extensions to OCAP <code>Host</code>.
* On Host devices implementing this specification, the instance of <code>Host</code>
* returned by {@link Host#getInstance} SHALL also implement this interface.
*/
public interface HostSettings
{
/**
* Constant representing a <i>narrow</i> range of volume control.
*/
public static final int RANGE_NARROW = 1;
/**
* Constant representing a <i>normal</i> range of volume control.
*/
public static final int RANGE_NORMAL = 2;
/**
* Constant representing a <i>wide</i> range of volume control.
*/
public static final int RANGE_WIDE = 3;
/**
* Transition the power mode of the system to the given mode.
* <p>
*
* If the power mode is already in the target mode, this method
* SHALL do nothing.
*
* Setting host power mode to low-power SHALL not disrupt
* any ongoing recording.
*
* In devices where a separate power mode is maintained for standby
* recordings, setting the power mode to low-power SHALL transition
* to standby-recording power mode when a recording is in progress.
* <p>
*
* A change of power mode SHALL be communicated to installed
* {@link PowerModeChangeListener}s.
*
* The power mode set via this method SHALL NOT be persisted and
* restored at boot time (see {@link #resetAllDefaults}). The default
* power mode at boot time is specified by the OCAP specification.
*
* @param mode The new power mode for the system.
*
* @throws IllegalArgumentException if <i>mode</i> is not one of
* {@link Host#FULL_POWER} or {@link Host#LOW_POWER}
* @throws SecurityException if the caller does not have
* <code>MonitorAppPermission("powerMode” or "deviceController")</code>
*/
public void setPowerMode( int mode );
/**
* Get the set of individually controllable audio outputs for this host.
*
* @return The set of <code>AudioOutputPort</code>s as an <code>Enumeration</code>.
*
* @throws SecurityException if the caller does not have
* <code>MonitorAppPermission("deviceController")</code>
*/
public java.util.Enumeration getAudioOutputs();
/**
* Enable or disable system handling of volume keys.
*
* This method may be used by applications to disable the OCAP default
* behavior of system volume level being handled by the OCAP device
* based upon volume keys (i.e., <code>VK_VOLUME_UP</code> and <code>VK_VOLUME_DOWN</code>).
* OCAP-defined behavior SHALL be the default if this method is never called.
* <p>
* If the system volume control is disabled, the device SHALL not process
* volume key events internally. In other words, the volume keys SHALL
* no longer be considered <i>system</i> keys when system volume control
* is disabled. While disabled it is the responsibility of applications
* to manage the master volume of the device via the {@link AudioOutputPort}
* API.
*
* @param enable Enable or disable system handling of volume keys.
* If <code>true</code> is specified, then system volume SHALL
* be handled by the OCAP device (as is the default).
* If <code>false</code> is specified, then the system volume
* SHALL NOT be managed directly by the OCAP device based
* upon volume keys.
*
* @throws SecurityException If the caller does not have
* <code>MonitorAppPermission("deviceController")</code>
*/
public void setSystemVolumeKeyControl(boolean enable);
/**
* Enable or disable system handling of the mute key.
*
* This method may be used by applications to disable the OCAP default
* behavior of system volume muting being handled by the OCAP device
* based upon the mute key (i.e., <code>VK_MUTE</code>).
* OCAP-defined behavior SHALL be the default if this method is never called.
* <p>
* If the system volume mute control is disabled, the device SHALL not process
* the volume mute events internally. In other words, the mute key SHALL
* no longer be considered a <i>system</i> key when system volume mute control
* is disabled. While disabled it is the responsibility of applications
* to manage the master volume mute state of the device via the {@link AudioOutputPort}
* API.
*
* @param enable Enable or disable system handling of the volume mute key.
* If <code>true</code> is specified, then system volume mute SHALL
* be handled by the OCAP device (as is the default).
* If <code>false</code> is specified, then the system volume mute
* SHALL NOT be managed directly by the OCAP device based
* upon the mute key.
*
* @throws SecurityException If the caller does not have
* <code>MonitorAppPermission("deviceController")</code>
*/
public void setSystemMuteKeyControl(boolean enable);
/**
* Set the range of volume level controlled by the system volume keys.
* <p>
* This method may be used by applications to control the range in dB levels
* controlled by the system volume keys.
* If system volume control is disabled (via {@link #setSystemVolumeKeyControl})
* then this setting SHALL have no effect.
*
* The following table describes the range values.
* <table border>
* <tr><th>Range</th> <th>Description</th></tr>
* <tr><td><code>RANGE_NARROW</code></td>
* <td>A very limited range of volume level is controllable via system volume keys.</td>
* </tr>
* <tr><td><code>RANGE_NORMAL</code></td>
* <td>A limited range of volume level is controllable via system volume keys.</td>
* </tr>
* <tr><td><code>RANGE_WIDE</code></td>
* <td>The full volume level is controllable via system volume keys.</td>
* </tr>
* </table>
*
* @param range The desired control range.
* One of {@link #RANGE_NARROW}, {@link #RANGE_NORMAL}, or {@link #RANGE_WIDE}
*
* @throws IllegalArgumentException if an invalid range value is specified
* @throws SecurityException if the caller does not have
* <code>MonitorAppPermission("deviceController")</code>
*/
public void setSystemVolumeRange(int range);
/**
* Get the <i>main</i> video output port for the given <code>HScreen</code>.
*
* @return The instance of <code>VideoOutputPort</code> that represents the
* <i>main</i> video output port for the given screen
*/
public VideoOutputPort getMainVideoOutputPort(HScreen screen);
/**
* Set the <i>main</i> video output port for the given <code>HScreen</code>.
* <p>
* Changing this setting MAY affect the configuration of <code>HScreenDevice</code>s
* of the given <code>HScreen</code> to maintain consistent display
* aspect ratios as described in the body of this specification.
*
* @param screen The specified <code>HScreen</code> for which to set the <i>main</i>
* video output port.
* @param port The desired main <code>VideoOutputPort</code>.
*
* @throws SecurityException if the caller does not have
* <code>MonitorAppPermission("deviceController")</code>
* @throws FeatureNotSupportedException if the given setting is not supported
*/
public void setMainVideoOutputPort(HScreen screen, VideoOutputPort port) throws FeatureNotSupportedException;
/**
* Reset all Host device settings to their factory default values.
* <p>
* Calling this method SHALL result in the Host restoring all configurable
* scalar settings to their default values, regardless of storage location.
* This includes both settings that persist and do no persist across Host
* device reboots.
* <p>
* This method SHALL affect the following:
* <ul>
* <li> All settings defined by this specification.
* Including {@link AudioOutputPort audio} and {@link VideoOutputSettings video}
* as well as those defined by this class.
* <li> All {@link Host} settings.
* Including {@link Host#setRFBypass RF bypass} and {@link Host#setACOutlet AC outlet} settings.
* <li> Closed-captioning settings controllable via
* the {@link org.ocap.media.ClosedCaptioningAttribute ClosedCaptioningAttribute}.
* <li> User preferences controllable via the
* {@link org.dvb.user.UserPreferenceManager UserPreferenceManager}.
* </ul>
* Further, any subsequent operations that would be affected by this change
* in settings SHALL be affected as if the corresponding API were invoked
* directly.
*
* @throws SecurityException if the caller does not have
* <code>MonitorAppPermission("deviceController")</code>
*/
public void resetAllDefaults();
}
package org.ocap.hardware.device;
import org.havi.ui.HSound;
/**
* Extends the HAVi <code>HSound</code> class, adding additional configuration options.
* Instances of this class provide control over audio gain level, muting, and
* output ports.
*
* @see AudioOutputPort
*/
public class OCSound extends HSound
{
/**
* Creates an <code>OCSound</code> object.
* The following defaults apply upon construction:
* <table border>
* <tr> <th>Attribute</th> <th>Method</th> <th>Default</th> </tr>
* <tr> <td>Level</td>
* <td>{@link #getLevel()}</td>
* <td><code>1.0</code></td> </tr>
* <tr> <td>Mute</td>
* <td>{@link #isMuted()}</td>
* <td><code>false</code></td> </tr>
* <tr> <td>Outputs</td>
* <td>{@link #getAudioOutputs}</td>
* <td>the default audio output for the application constructing the
* <code>OCSound</code> instance</td>
* </table>
*/
public OCSound()
{
// to be implemented
}
/**
* Set the gain using a floating point scale with values between 0.0 and 1.0.
* 0.0 is silence; 1.0 is the loudest level for associated audio output ports.
*
* @param level The new gain value specified in the level scale.
* @return The level that was actually set.
*
* @see #getLevel
* @see AudioOutputPort#setLevel
* @see AudioOutputPort#getLevel
*/
public float setLevel(float level)
{
return 0F;
}
/**
* Get the current gain set for this <code>OCSound</code>
* as a value between 0.0 and 1.0.
*
* @return The gain in the level scale (0.0-1.0).
* @see #setLevel
*/
public float getLevel()
{
return 0F;
}
/**
* Get the mute state of the audio signal associated with this audio clip.
*
* @return The current mute state:
* <code>true</code> if muted and <code>false</code> otherwise.
* @see #setMuted
*/
public boolean isMuted()
{
return true;
}
/**
* Mute or unmute the signal associated with this <code>OCSound</code>.
* Redundant invocations of this method are ignored.
* The mute state does not effect the gain (as represented by {@link #getLevel()}.
*
* @param mute The new mute state:
* <code>true</code> mutes the signal and <code>false</code> unmutes the signal.
*
* @see #isMuted()
*/
public void setMuted(boolean mute)
{
// to be implemented
}
/**
* Get the audio output ports on which this audio clip would be played.
* By default, audio-clips will be played on the default audio output port
* for the application that created this <code>OCSound</code>.
* Unless <code>AudioOutputPort</code>s have been removed by calling
* <code>removeAudioOutput</code>, this method SHALL return the
* at least the default <code>AudioOutputPort</code> for the application.
* Unless <code>AudioOutputPort</code>s have been added by calling
* <code>addAudioOutput</code>, this method SHALL return at most
* the default <code>AudioOutputPort</code> for the application.
*
* @return The set of target <code>AudioOutputPort</code>s as an array.
* If all ports have been removed, then an empty array SHALL be returned.
*
* @see #addAudioOutput
* @see #removeAudioOutput
*/
public AudioOutputPort[] getAudioOutputs()
{
return new AudioOutputPort[0];
}
/**
* Add an <code>AudioOutputPort</code> to the set of audio output ports where
* this clip will be played.
* <p>
* Redundant additions SHALL have no effect.
*
* @param au The <code>AudioOutputPort</code> to add.
*/
public void addAudioOutput(AudioOutputPort au)
{
// to be implemented
}
/**
* Remove an <code>AudioOutputPort</code> from the set of audio ouput ports where
* this clip will be played.
* <p>
* Attempting to remove an <code>AudioOutputPort</code> that is not currently
* in the set of audio output ports for this <code>OCSound</code> SHALL have
* no effect.
*
* @param au The <code>AudioOutputPort</code> to remove.
*/
public void removeAudioOutput(AudioOutputPort au)
{
// to be implemented
}
}
/*
* Created on Mar 20, 2007
*/
package org.ocap.hardware.device;
/**
* Describes a <code>VideoOutputConfiguration</code> supported by a
* <code>VideoOutputPort</code>.
*
* @see VideoOutputSettings
*
* @author Aaron Kamienski
*/
public interface VideoOutputConfiguration
{
/**
* Get the <code>String</code> representation of this <code>VideoOutputConfiguration</code>,
* suitable for display to the user.
*
* @return <code>String</code> representation of this object
*/