Commit 01035c80 authored by oposso's avatar oposso

initial check in of OCAP 1.1.1 stubs from Ken into branch

parent 9ed0b37d
<html>
<body>
This is the OCAP 1.0.2 profile and extensions.
<p>It includes:</p>
<p>PBP 1.1.2</p>
<p>JavaTV 1.0</p>
<p>JMF 1.0</p>
<p>MHP 1.0.3</p>
<p>MHP 1.1.3</p>
<p>and Extensions:</p>
<p>OCAP Device Setttings I01</p>
<p>OCAP DVR I04#</p>
<p>OCAP Front Panel I02</p>
<p>OCAP Home Networking I03</p>
<p>OCAP MultiScreenManger I01</p>
<p>#org.ocap.shared.* packages also included</p>
</body>
<html>
<body>
This is the OCAP 1.1.1 profile and extensions.
<p>It includes:</p>
<p>PBP 1.1.2</p>
<p>JavaTV 1.0</p>
<p>JMF 1.0</p>
<p>MHP 1.0.3</p>
<p>MHP 1.1.3</p>
<p>and Extensions:</p>
<p>OCAP Device Setttings I01</p>
<p>OCAP DVR I04#</p>
<p>OCAP Front Panel I02</p>
<p>OCAP Home Networking I03</p>
<p>OCAP MultiScreenManger I01</p>
<p>#org.ocap.shared.* packages also included</p>
</body>
</html>
\ No newline at end of file
......@@ -256,4 +256,4 @@ public class Host {
*/
public void setPowerMode(int mode) {
}
}
\ No newline at end of file
}
package org.ocap.media;
import javax.tv.service.Service;
import java.util.Date;
/**
* This class represents a service that is blocked from a start time for a
* specific duration. Whenever a <code>Service</code> or
* <code>ServiceComponent</code> from a service that is blocked are selected
* for new or changed presentation in a service context or a discrete player,
* the implementation SHALL block the corresponding presentation. When any
* service components in a blocked service are selected in a service context
* or discrete player they are blocked.
* <p>
* A blocked service is associated with an application specific level. This
* blocking level is not associated with a specific content rating system, but
* MAY be used by a <code>MediaAccessHandler</code> to set up different levels
* of blocking.
*/
public class BlockedService
{
/**
* Constructor.
*
* @param startTime Wall clock time to start blocking the service.
* @param duration Amount of time in milli-seconds to block the service.
* @param service Service to block.
* @param askMediaAccessHandler When true the implementation SHALL call a
* registered <code>MediaAccessHandler.checkMediaAccessAuthorization</code>
* method.
* @param level The blocking level.
*
* @throws IllegalArgumentException if the duration is less than or equal to
* zero.
*/
public BlockedService(Date startTime,
long duration,
Service service,
boolean askMediaAccessHandler,
int level)
{
}
/**
* Gets the wall clock start time to begin service blocking.
*
* @return Blocked service start time.
*/
public Date getStartTime()
{
return null;
}
/**
* Gets the duration to block the service.
*
* @return The duration in milli-seconds to block the service.
*/
public long getDuration()
{
return 0;
}
/**
* Gets the blocked <code>Service</code>.
*
* @return The service to be blocked.
*/
public Service getService()
{
return null;
}
/**
* Gets the action when a service is blocked.
*
* @return True when a registered
* <code>{@link MediaAccessHandler#checkMediaAccessAuthorization}</code> is
* to be called and returns false when the service is to be blocked without
* calling the <code>MediaAccessHandler</code>
*/
public boolean isAskMediaAccessHandler()
{
return false;
}
/**
* Gets the level of blocking.
*
* @return The blocking level.
*/
public int getLevel()
{
return 0;
}
}
package org.ocap.media;
/**
* This interface contains constant definitions that can be used
* with the {@link MediaAccessHandlerRegistrar#setSignaledBlocking} method.
* The constants coincide with CEA-766-A April 2001 table 3.
*/
public interface ParentalControlRatings
{
/**
* See CEA-766-A April 2001 for definitions.
*/
public static final int TV_NONE = 1;
public static final int TV_Y = 2;
public static final int TV_Y7 = 3;
public static final int TV_Y7_FV = 4;
public static final int TV_G = 5;
public static final int TV_PG = 6;
public static final int TV_PG_D = 7;
public static final int TV_PG_L = 8;
public static final int TV_PG_S = 9;
public static final int TV_PG_V = 10;
public static final int TV_PG_D_L = 11;
public static final int TV_PG_D_S = 12;
public static final int TV_PG_D_V = 13;
public static final int TV_PG_L_S = 14;
public static final int TV_PG_L_V = 15;
public static final int TV_PG_S_V = 16;
public static final int TV_PG_D_L_S = 17;
public static final int TV_PG_D_L_V = 18;
public static final int TV_PG_D_S_V = 19;
public static final int TV_PG_L_S_V = 20;
public static final int TV_PG_D_L_S_V = 21;
public static final int TV_14 = 22;
public static final int TV_14_D = 23;
public static final int TV_14_L = 24;
public static final int TV_14_S = 25;
public static final int TV_14_V = 26;
public static final int TV_14_D_L = 27;
public static final int TV_14_D_S = 28;
public static final int TV_14_D_V = 29;
public static final int TV_14_L_S = 30;
public static final int TV_14_L_V = 31;
public static final int TV_14_S_V = 32;
public static final int TV_14_D_L_S = 33;
public static final int TV_14_D_L_V = 34;
public static final int TV_14_D_S_V = 35;
public static final int TV_14_L_S_V = 36;
public static final int TV_14_D_L_S_V = 37;
public static final int TV_MA = 38;
public static final int TV_MA_L = 39;
public static final int TV_MA_S = 40;
public static final int TV_MA_V = 41;
public static final int TV_MA_L_S = 42;
public static final int TV_MA_L_V = 43;
public static final int TV_MA_S_V = 44;
public static final int TV_MA_L_S_V = 45;
public static final int MPAA_NA = 0x100;
public static final int MPAA_G = 0x200;
public static final int MPAA_PG = 0x300;
public static final int MPAA_PG13 = 0x400;
public static final int MPAA_R = 0x500;
public static final int MPAA_NC_17 = 0x600;
public static final int MPAA_X = 0x700;
public static final int MPAA_NOT_RATED = 0x800;
}
package org.ocap.media;
/**
* This interface extends <code>VideoFormatControl</code> with constant
* definitions representing additional decoder format conversion (DFC)
* options.
* These constants SHALL be accepted by any method that accepts
* <code>VideoFormatControl.DFC_*</code> constants and MAY be returned
* by methods that return such constants.
* <p>
* This control extends the capability of
* <code>org.dvb.media.VideoFormatControl</code> and instances of this
* control SHALL be available for both MPEG-2 and non-MPEG-2 streams.
* <p>
* In OCAP Host devices, all instances of
* <code>org.dvb.media.VideoFormatControl</code> SHALL also be instances
* of <code>org.ocap.media.VideoFormatControl</code>.
*
* @see VideoFormatControl#getDecoderFormatConversion()
* @see VideoFormatControl#getVideoTransformation(int)
*
* @author Aaron Kamienski
*/
public interface VideoFormatControl extends org.dvb.media.VideoFormatControl
{
/**
* Constant representing the pillarbox conversion of the 4:3 input video
* to 16:9 output video.
* The 4:3 input video SHALL be framed within the center of the 16:9 output
* video, such that the original pixel aspect ratio is maintained.
*/
public static final int DFC_PROCESSING_PILLARBOX_4_3 = 100;
/**
* Constant representing the wide conversion of the 4:3 input video
* to 16:9 output video.
* In this mode the 4:3 input video SHALL be expanded horizontally to
* fill the 16:9 output frame, with pixels toward the outside edges
* stretched more than those toward the center.
*/
public static final int DFC_PROCESSING_WIDE_4_3 = 101;
}
package org.ocap.resource;
import org.davic.resources.ResourceClient;
import org.davic.resources.ResourceProxy;
/**
* An instances of <code>RequestRetryCallback</code> SHALL be provided when
* enabling automatic reservation request retry via the {@link ResourceContext}.
* This defines the callback interface that is used to notify the application
* of successful resource reservation in case of a retry.
* <p>
* This interface is used only to notify the application of successful
* resource reservation following an automatic retry. It SHALL NOT be invoked
* due to an immediate reservation request.
*
* @see ResourceContext#setRequestRetry
*
* @author Aaron Kamienski
*/
public interface RequestRetryCallback
{
/**
* A call to this method notifies the implementing application that the
* given resource was successfully reserved following an automatic retry.
*
* @param proxy represents the scarce resource that was reserved
* @param requestData application specific data given at original reservation request
* @param client the <code>ResourceClient</code> specified for the original reservation request
*/
public void notifyReserved(ResourceProxy proxy, Object requestData, ResourceClient client);
}
package org.ocap.resource;
/**
* A computation to be performed within a specific <i>resource context</i>.
* The computation is performed by invoking <code>ResourceContext.doResourceAction</code>
* on the <code>ResourceAction</code> object.
* This interface is used only for computations that do not throw checked exceptions;
* computations that throw checked exceptions must use <code>ResourceExceptionAction</code>
* instead.
*
* @see ResourceContext
* @see ResourceContext#doResourceAction(ResourceAction)
* @see ResourceExceptionAction
*
* @author Aaron Kamienski
*/
public interface ResourceAction
{
/**
* Performs the computation.
* This method will be called by <code>ResourceContext.doResourceAction</code>.
* All resource reservation operations performed as part of this computation
* will implicitly have access to the <code>ResourceContext</code> and its
* attributes.
*
* @return A class-dependent value that may represent the results of the
* computation.
*
* @see ResourceContext#doResourceAction(ResourceAction)
*
* @throws RuntimeException unchecked exceptions may be thrown
* @throws Error unchecked exceptions may be thrown
*/
public Object executeAction();
}
package org.ocap.resource;
/**
* A class implementing this interface decides which application(s) shall be
* allowed to reserve a resource.
* <P>
* An application which has been granted <code>MonitorAppPermission("handler.resource")</code>
* MAY set an instance of this interface as the current resource contention
* handler with the <code>ResourceContentionManager</code>.
* <p>
* The {@link #resolveResourceContention(ResourceUsage[], ResourceUsage[])}
* method SHALL be invoked to decide how to resolve conflicts due to one ore more
* enqueued requests (as MAY be enabled via {@link ResourceContext#setRequestRetry})
* or simultaneous implicit reservations, and existing resource allocations.
* The {@link ResourceContentionHandler#resolveResourceContention(ResourceUsage,ResourceUsage[])}
* method SHALL be invoked to decide how to resolve conflicts due to a
* single reservation request and existing resource allocations.
*
* @see ResourceContentionManager
*/
public interface ResourceContentionHandler2 extends ResourceContentionHandler
{
/**
* This method notifies the ResourceContentionHandler that
* resource contentions have occurred between one or more applications
* and system modules, except the Emergency Alert System (EAS) module.
* EAS system module resource requests SHALL be given the highest
* priority by the implementation and resource requests by this module
* SHALL not be reported to the ResourceContentionHandler.
* In the case of one application, the same application is conflicting
* with itself and a registered ResourceContentionHandler SHALL be
* notified in this case.
* <p>
* Each entry in the <i>batchRequests</i> indicates a set of resources for
* which there is a current or outstanding reservation request by an application
* for a single activity.
* Each entry in the <i>currentReservations</i> indicates a set of resources
* reserved by an application for a single activity such as a resource usage
* by a single service context.
* There may be multiple entries in these lists from a single application.
* An entry may correspond to a current resource usage or resource reservations
* for a future activity.
* <p>
* A prioritized array of {@link ResourceUsage} instances is returned.
* The array is in priority order from highest to lowest indicating the
* priority order to be followed by the implementation while resolving the
* conflicts. When this method returns the implementation will iterate
* through each entry in the array in the order of priority, awarding resources
* as required by the activity represented by the resourceUsage. The
* ResourceContentionHandler may use information such as
* {@link org.dvb.application.AppAttributes#getPriority application priority} or
* {@link ResourceUsage#getResourcePriority resource priority}
* to prioritize the array of ResourceUsages returned. When the value
* returned is not null the ResourceContentionHandler MAY return an array
* containing all of the <code>ResourceUsage</code> objects passed to it,
* or it MAY return a subset of those objects.
* </p>
*
* @param batchRequests The set of resource usage objects containing the attributes
* of the current outstanding resource request(s)
*
* @param currentReservations The set of resource usage objects that describe
* current resource reservations which are in conflict with the batchRequests.
* A <code>ResourceUsage</code> associated
* with a current reservation MAY belong to an application that has been
* destroyed. Use of the <code>AppID</code> contained within such a
* <code>ResourceUsage</code>
* with any of the methods in <code>org.dvb.application.AppsDatabase</code>
* MAY cause a failure status to be returned.
*
* @return A prioritized array of resource usage objects. The first entry has the highest
* priority. This function returns null if the contention handler wants the
* implementation to resolve the conflict.
*/
public ResourceUsage [] resolveResourceContention(
ResourceUsage[] batchRequests,
ResourceUsage[] currentReservations);
}
package org.ocap.resource;
import java.lang.reflect.InvocationTargetException;
import org.davic.resources.ResourceClient;
import org.davic.resources.ResourceProxy;
/**
* An instance of <code>ResourceContext</code> may be used to specify implicit parameters
* to resource reservation requests, including implicit reservations made on an application's
* behalf.
* <p>
* The scope of a resource context (that is the scope to which its set attributes
* apply) SHALL be the execution of a given resource action (<code>ResourceAction</code>
* or <code>ResourceExceptionAction</code>) up to but not including the introduction
* of another resource context scope. At most one resource context SHALL be in scope at
* a time.
* The resource context that is in scope when an API that explicitly or implicitly
* (including at some time in the future) reserves one or more resources is invoked
* by an application SHALL be considered to be an implicit parameter to such reservation
* operations.
* <p>
* The following example shows how <code>ResourceContext</code> may be used
* to lower the stated priority of implicit reservations made as part
* of service selection.
* <pre>
* final boolean[] maybe = { false };
* ResourceContext ctx = ResourceContext.createInstance();
* ctx.setResourcePriority(ResourcePriority.PRIORITY_HIGH);
* ctx.setResourceClient(new org.davic.resource.ResourceClient() {
* public boolean requestRelease(org.davic.resource.ResourceProxy proxy, Object data) {
* return maybe[0];
* }
* public void release(org.davic.resource.ResourceProxy) { /* ... *&#47; }
* public void notifyRelease(org.davic.resource.ResourceProxy proxy) { /* ... *&#47; }
* });
*
* final javax.tv.service.Service service = /* ... *&#47; ;
* final javax.tv.service.selection.ServiceContext sc = /* ...*&#47; ;
* ctx.doResourceAction(new ResourceAction() {
* public Object executeAction()
* {
* // Select the service...
* // Specifying the ResourceClient and importance
* sc.select(service);
* }
* });
*
* // ...
* // At some later time, lower the priority.
* ctx.setResourcePriority(ResourcePriority.PRIORITY_MEDIUM);
* // Or perhaps avoid contention with other requests altogether
* maybe[0] = true;
* </pre>
*
* @see ResourcePriority
* @see ResourceAction
* @see ResourceExceptionAction
*
* @author Aaron Kamienski
*/
public abstract class ResourceContext
{
/**
* Not publicly instantiable.
*
* @see #createInstance
*/
protected ResourceContext()
{
// initialize
}
/**
* Creates and returns a new instance of <code>ResourceContext</code>.
* The returned resource context object may subsequently be used to
* specify additional parameters that should implicitly apply to resource
* reservation operations executed within the context.
*
* @return A new instance of <code>ResourceContext</code>.
*/
public static ResourceContext createInstance()
{
return null;
}
/**
* Sets the <i>resource priority</i> for this resource context.
* A default resource priority value of {@link ResourcePriority#PRIORITY_UNKNOWN}
* SHALL be used if this method is never called.
* <p>
* This priority will be exposed to the {@link ResourceContentionHandler} in case
* of resource contention via the {@link ResourceUsage#getResourcePriority} method.
* If the application that created this <code>ResourceContext</code>
* is destroyed (including upon reboot of the OCAP environment), then the resource
* priority value SHALL be frozen as last set by the application.
*
* @param priority The new resource priority for this resource context.
*
* @throws IllegalArgumentException if the given value is not a valid resource
* priority as defined by the {@link ResourcePriority} interface
*
* @see ResourcePriority
*/
public abstract void setResourcePriority(int priority);
/**
* Sets the <code>ResourceClient</code> for this resource context.
* A default value of <code>null</code> SHALL be assumed if this method is never called.
* <p>
* This method allows an application to explicitly specify a <code>ResourceClient</code>
* to be used for implicit reservations made on its behalf. This gives the application the
* opportunity to respond to {@link ResourceClient#requestRelease(ResourceProxy, Object)
* release} requests and be {@link ResourceClient#notifyRelease(ResourceProxy) notified}
* of resource loss.
*
* @param rc The resource client for this resource context; may be <code>null</code>.
*/
public abstract void setResourceClient(ResourceClient rc);
/**
* Enables or disables automatic reservation request retry for this resource context.
* This method allows an application to request that the implementation queue
* failed resource reservation requests for later automatic retry.
* <p>
* If the <i>request retry</i> attribute is non-<code>null</code> when a reservation
* request is made and fails, the implementation SHALL enqueue that request for
* later consideration. When a successful reservation is made due to an automatic
* retry, the given <code>RequestRetryCallback</code> SHALL be notified.
* <p>
* If the <i>request retry</i> attribute is <code>null</code> when a reservation
* request is made and fails, then no enqueuing SHALL occur,
* even if a non-<code>null</code> value is specified in the future.
* Setting the <i>request retry</i> attribute to <code>null</code>,
* if previously non-<code>null</code>, SHALL cancel any retry requests that
* were previously enqueued while the attribute was non-<code>null</code>.
*
* @param callback if <code>null</code>, disables automatic request retry;
* otherwise, enables automatic request retry, specifying the object to be
* notified of successful reservation due to automatic request retry.
*/
public abstract void setRequestRetry(RequestRetryCallback callback);
/**
* Executes the given <code>ResourceAction</code> within the context of
* this <code>ResourceContext</code>.
* The scope of this resource context is the execution of the <code>ResourceAction</code>
* {@link ResourceAction#executeAction() executeAction} method.
* This <code>ResourceContext</code> is an implicit argument to any resource
* reservation (explicit or implicit) operations performed by the given
* <code>ResourceAction</code>.
*
* @param action The <code>ResourceAction</code> to execute.
* @return The <code>Object</code> reference returned by
* {@link ResourceAction#executeAction action.executeAction()}.
*
* @throws RuntimeException uncaught <code>RuntimeException</code> thrown during the
* execution of <code>action.executeAction()</code>
* @throws Error uncaught <code>Error</code> thrown during the
* execution of <code>action.executeAction()</code>
*/
public abstract Object doResourceAction(ResourceAction action);
/**
* Executes the given <code>ResourceExceptionAction</code> within the context of
* this <code>ResourceContext</code>.
* The scope of this context is the execution of the <code>ResourceExceptionAction</code>
* {@link ResourceExceptionAction#executeAction() executeAction} method.
* This <code>ResourceContext</code> is an implicit argument to any resource
* reservation (explicit or implicit) operations performed by the given
* <code>ResourceExceptionAction</code>.
*
* @param action The <code>ResourceExceptionAction</code> to execute.
* @return The <code>Object</code> reference returned by
* {@link ResourceExceptionAction#executeAction action.executeAction()}.
*
* @throws InvocationTargetException encapsulates an uncaught exception thrown during the
* execution of <code>action.executeAction()</code>
* @throws RuntimeException uncaught <code>RuntimeException</code> thrown during the
* execution of <code>action.executeAction()</code>
* @throws Error uncaught <code>Error</code> thrown during the
* execution of <code>action.executeAction()</code>
*/
public abstract Object doResourceAction(ResourceExceptionAction action)
throws InvocationTargetException;
}
package org.ocap.resource;
/**
* A computation to be performed within a specific <i>resource context</i>.
* The computation is performed by invoking <code>doResourceAction</code> on
* a given <code>ResourceContext</code>.
* This interface is used only for computations that may throw checked exceptions;
* computations that do not throw checked exceptions may use <code>ResourceAction</code>
* instead.
*
* @see ResourceContext
* @see ResourceContext#doResourceAction(ResourceExceptionAction)
* @see ResourceAction
*
* @author Aaron Kamienski
*/
public interface ResourceExceptionAction
{
/**
* Performs the computation.
* This method will be called by <code>ResourceContext.doResourceAction</code>.
* All resource reservation operations performed as part of this computation
* will implicitly have access to the <code>ResourceContext</code> and its
* attributes.
*
* @return a class-dependent value that may represent the results of the
* computation
*
* @see ResourceContext#doResourceAction(ResourceExceptionAction)
*
* @throws Exception an exceptional condition that occurred during the computation
* (includes checked or unchecked exceptions)
* @throws Error unchecked exceptions may be thrown
*/
public Object executeAction() throws Exception;