Commit 5c926104 authored by nshah's avatar nshah

OCVET-247, v15 of Content Transformation stubs, 19/Dec/12, 5:16PM

parent 56b1ae98
package org.ocap.hn.content;
/**
* This interface represents a content format. Instances of this
* interface represent the specific formats in which content is
* either available or can be transformed into.
*/
public interface ContentFormat
{
/**
* This method returns an identifier representing the media format of
* the content.
*
*
* @return The media format of the content.
*/
public ContentProfile getContentProfile();
/**
* Returns the protection type of the content.
* This method returns the <code>ProtectionType</code> registered as an
* approved output with CableLabs.
* See {@link ProtectionType}
*
* @return The <code>ProtectionType</code>. Returns empty string if the
* content is not protected.
*/
public ProtectionType getProtectionType();
}
package org.ocap.hn.content;
/**
* Class implementing type safe enums that represent content profile identifiers.
*
*/
public class ContentProfile
{
/**
*
* OCAP applications SHALL NOT use this constructor - it is provided for internal use by the OCAP
* implementation. The result of calling this method from an application is undefined, and valid
* implementations MAY throw any Error or RuntimeException.
*/
protected ContentProfile(String profileId)
{
}
/**
* This string conforms with the rules defined in [OC-BUNDLE]
* for the content format string values.
*
* @return String representing the profile id
*/
public final String toString()
{
return null;
}
/**
* MPEG-DASH Content.
*/
public static final ContentProfile DASH_MPD = new ContentProfile("DASH_MPD");
}
......@@ -190,4 +190,14 @@ public interface ContentResource
* otherwise.
*/
public boolean isRenderable();
/**
• Returns a list of transformed <code>ContentFormat</code> that are available. There may
• be multiple ContentFormat instances returned that correspond to a single ContentResource
• in case of HTTP Adaptive content.
*
* @return List of <code>ContentFormat</code>.
*/
public ContentFormat[] getTransformedContentFormats();
}
package org.ocap.hn.content;
/**
* This interface provides additional parameters for transforming video content.
*/
public interface OutputVideoContentFormat extends ContentFormat
{
/**
* Returns the content vertical resolution in pixels.
*
* @return The vertical content resolution.
*/
public int getVerticalResolution();
/**
* Returns the content horizontal resolution in pixels.
*
* @return The content horizontal resolution.
*/
public int getHorizontalResolution();
/**
* Returns the bit rate in bits per second (bps) of the output content.
*
* @return The bitrate of the content in bits per second
*/
public int getBitRate();
/**
* Returns an indication of progressive or interlaced.
*
* @return True if progressive, false if interlaced.
*/
public boolean isProgressive();
}
package org.ocap.hn.content;
/**
* Class implementing a type safe enum representing supported
* output protection types.
*
*/
public class ProtectionType
{
/**
*
* OCAP applications SHALL NOT use this constructor - it is provided for internal use by the OCAP
* implementation. The result of calling this method from an application is undefined, and valid
* implementations MAY throw any Error or RuntimeException.
*/
protected ProtectionType(String name)
{
}
/**
* Returns a constant string representation of the
* protection type.
*
* @return String representing the protection type
*/
public final String toString()
{
return null;
}
/**
* DTCP-IP protection type as defined in [OC-BUNDLE].
*/
public static final ProtectionType DTCP_IP = new ProtectionType("DTCP-IP");
/**
* DECE DRM type. Used with any DRM that is part of DECE as defined in [OC-BUNDLE].
*/
public static final ProtectionType DECE_DRM = new ProtectionType("DECE-DRM");
}
package org.ocap.hn.transformation;
import org.ocap.hn.content.ContentFormat;
/**
* This interface represents transformations from a single input content format to
* multiple output content formats. Instances implementing this interface are created
* by the <code>TransformationManager</code>.
*/
public interface Transformation
{
/**
* Returns the input content format that can be transformed.
*
* @return The input content format.
*/
public ContentFormat getInputContentFormat();
/**
* Returns all of the possible output content formats the input format can
* be transformed into.
*
* @return The output content formats.
*/
public ContentFormat [] getOutputContentFormats();
}
package org.ocap.hn.transformation;
import java.util.EventListener;
import org.ocap.hn.content.ContentFormat;
import org.ocap.hn.content.ContentItem;
/**
* Listener interface for classes interested in getting notifications from the TransformationManager
* Only one of the notify callbacks will be received for each (ContentItem, ContentFormat) tuple.
*
*/
public interface TransformationListener extends EventListener {
/**
* ReasonCode: Transformation was not successful due to unknown reason(s).
*/
public static final int REASON_UNKNOWN = 0;
/**
* ReasonCode: Some resource was not available to create the transformation.
*/
public static final int REASON_RESOURCE_UNAVAILABLE = 1;
/**
* ReasonCode: The specific content item was deleted after the transformation was requested
*/
public static final int REASON_CONTENTITEM_DELETED = 2;
/**
* Callback indicating the <code>ContentResource</code> for the contentFormat
* has been created.
*
* @param contentItem affected contentItem
* @param contentFormat requested transformation on contentItem
*/
void notifyTransformationReady(ContentItem contentItem, ContentFormat contentFormat);
/**
* Callback indicating the content binary representation for the contentFormat could not
* be created.
*
* @param contentItem affected contentItem
* @param contentFormat requested transformation on contentItem
* @param reasonCode reason for the failure
*/
void notifyTransformationFailed(ContentItem contentItem, ContentFormat contentFormat, int reasonCode);
}
package org.ocap.hn.transformation;
import org.ocap.hn.content.ContentItem;
/**
* This class is a singleton manager that can be used to get transformation
* capabilities of the Host device and to manage the content item transformation
* configuration. Transformation capabilities indicate the transformations from
* input content format to output content format that the device supports.
*/
public abstract class TransformationManager
{
/**
* Constructor protected from erroneous application access.
*/
protected TransformationManager()
{
}
/**
* Gets an instance of the TransformationManager.
*
* @throws SecurityException if the calling application has not been granted
* HomeNetPermission("contentmanagement").
* @throws UnsupportedOperationException if the implementation is not
* capable of content transformation.
*/
public static TransformationManager getInstance()
{
return null;
}
/**
* Adds a TransformationListener to receive callbacks from the TransformationManager.
* The TransformationListener will be notified whenever transformations are applied
* for the ContentItem. Subsequent calls to register the same <code>listener</code>
* will be ignored.
*
* @param listener The listener that will receive the callbacks
*/
public abstract void addTransformationListener(TransformationListener listener);
/**
* Removes the specified TransformationListener.
*
* @param listener The listener to remove
*/
public abstract void removeTransformationListener(TransformationListener listener);
/**
* Gets all of the transformation permutations the Host device supports.
* See [OC-BUNDLE] for additional mapping of this method.
*
* @return Device supported transformations. If the device does not support
* transformations an empty array is returned.
*/
public abstract Transformation [] getSupportedTransformations();
/**
* Sets the default transformations. Default transformations will be applied
* to newly-created ContentItems only and certain calls to TransformationManager.
* A call to setDefaultTransformation over-rides any previously-set default
* transformations and passing an empty array disables any previously-set default
* transformations. See [OC-BUNDLE] for additional mapping of this method.
*
* @param transformations The new default transformations.
*
* @throws IllegalArgumentException if the transformations parameter is null.
*
* @returns The default transformations.
*/
public abstract Transformation [] setDefaultTransformations(Transformation [] transformations);
/**
* Returns the currently-set default transformation.
*
* @returns The default transformations.
*/
public abstract Transformation [] getDefaultTransformations();
/**
* Returns the applied transformations for the content item.
*
* @param item The content item.
*
* @returns The applied transformations
*/
public abstract Transformation [] getTransformations(ContentItem item);
/**
* Applies the transformations to all existing local content items that represent
* network operator content. A call to this method will remove
* any existing transformations before setting the transformations.
* See [OC-BUNDLE] for additional mapping of this method.
*
* @param transformations The array of transformations to be applied. If null, all
* transformations will be removed and none will be applied.
*/
public abstract void setTransformations(Transformation [] transformations);
/**
* Applies the default transformations for a set of content items. Configures
* metadata indicating content transformation support for each ContentItem
* in the <code>items</code> array parameter. If a content item in the array
* parameter is not local or does not represent MSO local content it is
* skipped without change or notification. A call to this method will remove
* any existing transformations before setting the transformations.
* See [OC-BUNDLE] for additional mapping of this method.
*
* @param items The array of content items the transformation metadata will be configured in.
*
* @throws IllegalArgumentException if the parameter is null or empty.
*/
public abstract void setTransformations(ContentItem [] items);
/**
* Applies specific transformations for a set of content items. Configures
* metadata indicating content transformation support that matches any
* of the transformations in the Transformations array parameter for each
* content item in the content item array parameter. If a ContentItem in
* the array parameter is not local or does not represent MSO local
* content it is skipped without change or notification. A call to this method will remove
* any existing transformations before setting the transformations.
* See [OC-BUNDLE] for additional mapping of this method.
*
* @param items The array of content items the transformation metadata will be configured in.
* @param transformations The array of transformations to apply. If null, all
* transformations will be removed and none will be applied.
*
* @throws IllegalArgumentException if items parameter is null or empty.
*/
public abstract void setTransformations(ContentItem [] items,
Transformation [] transformations);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment