All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.ocap.media.ClosedCaptioningControl.html Maven / Gradle / Ivy

There is a newer version: 1.3.1
Show newest version






ClosedCaptioningControl














org.ocap.media
Interface ClosedCaptioningControl

All Superinterfaces:
javax.media.Control

public interface ClosedCaptioningControl
extends javax.media.Control

This interface is used to turn closed-captioning in a running JMF player on and off and to select a captioning service (C1 to C4 and T1 to T4) to be represented. Instance of the ClosedCaptioningControl interface shall be obtained via a Controller.getControl(java.lang.String) and a Controller.getControls() method by all applications. But MonitorAppPermission(?handler.closedCaptioning?) is necessary to call methods in this interface.

The captioning text is represented according to preferred attribute values set by a ClosedCaptioningAttribute class.


Field Summary
static int CC_ANALOG_SERVICE_CC1
          Indicates an analog closed-captioning service CC1.
static int CC_ANALOG_SERVICE_CC2
          Indicates an analog closed-captioning service CC2.
static int CC_ANALOG_SERVICE_CC3
          Indicates an analog closed-captioning service CC3.
static int CC_ANALOG_SERVICE_CC4
          Indicates an analog closed-captioning service CC4.
static int CC_ANALOG_SERVICE_T1
          Indicates an analog closed-captioning service T1.
static int CC_ANALOG_SERVICE_T2
          Indicates an analog closed-captioning service T2.
static int CC_ANALOG_SERVICE_T3
          Indicates an analog closed-captioning service T3.
static int CC_ANALOG_SERVICE_T4
          Indicates an analog closed-captioning service T4.
static int CC_NO_SERVICE
          Indicates no closed-captioning service.
static int CC_TURN_OFF
          Indicates turn digital/analog closed-captioning on.
static int CC_TURN_ON
          Indicates turn digital/analog closed-captioning off.
static int CC_TURN_ON_MUTE
          Indicates turn digital/analog closed-captioning on only when muting an audio.
 
Method Summary
 void addClosedCaptioningListener(ClosedCaptioningListener ccListener)
          Add a listener to notify a closed-captioning state change.
 int[] getClosedCaptioningServiceNumber()
          This method returns a current closed-captioning service for a JMF Player that is controlled by a ClosedCaptioningControl instance.
 int getClosedCaptioningState()
          Get the current state of closed-captioning of a JMF Player that is controlled by a ClosedCaptioningControl instance.
 int[] getSupportedClosedCaptioningServiceNumber()
          This method returns closed-captioning service numbers that are supported by a JMF Player that is controlled by a ClosedCaptioningControl instance.
 void removeClosedCaptioningListener(ClosedCaptioningListener ccListener)
          Remove the given ClosedCaptioningListener.
 void setClosedCaptioningServiceNumber(int analogServiceNumber, int digitalServiceNumber)
           This method sets a new closed-captioning service number to be represented by a JMF Player that is controlled by a ClosedCaptioningControl instance.
 void setClosedCaptioningState(int turnOn)
          Turn closed-captioning of a JMF Player that is controlled by a ClosedCaptioningControl instance on or off.
 
Methods inherited from interface javax.media.Control
getControlComponent
 

Field Detail

CC_ANALOG_SERVICE_CC1

static final int CC_ANALOG_SERVICE_CC1
Indicates an analog closed-captioning service CC1.

See Also:
Constant Field Values

CC_ANALOG_SERVICE_CC2

static final int CC_ANALOG_SERVICE_CC2
Indicates an analog closed-captioning service CC2.

See Also:
Constant Field Values

CC_ANALOG_SERVICE_CC3

static final int CC_ANALOG_SERVICE_CC3
Indicates an analog closed-captioning service CC3.

See Also:
Constant Field Values

CC_ANALOG_SERVICE_CC4

static final int CC_ANALOG_SERVICE_CC4
Indicates an analog closed-captioning service CC4.

See Also:
Constant Field Values

CC_ANALOG_SERVICE_T1

static final int CC_ANALOG_SERVICE_T1
Indicates an analog closed-captioning service T1.

See Also:
Constant Field Values

CC_ANALOG_SERVICE_T2

static final int CC_ANALOG_SERVICE_T2
Indicates an analog closed-captioning service T2.

See Also:
Constant Field Values

CC_ANALOG_SERVICE_T3

static final int CC_ANALOG_SERVICE_T3
Indicates an analog closed-captioning service T3.

See Also:
Constant Field Values

CC_ANALOG_SERVICE_T4

static final int CC_ANALOG_SERVICE_T4
Indicates an analog closed-captioning service T4.

See Also:
Constant Field Values

CC_NO_SERVICE

static final int CC_NO_SERVICE
Indicates no closed-captioning service.

See Also:
Constant Field Values

CC_TURN_OFF

static final int CC_TURN_OFF
Indicates turn digital/analog closed-captioning on.

See Also:
Constant Field Values

CC_TURN_ON

static final int CC_TURN_ON
Indicates turn digital/analog closed-captioning off.

See Also:
Constant Field Values

CC_TURN_ON_MUTE

static final int CC_TURN_ON_MUTE
Indicates turn digital/analog closed-captioning on only when muting an audio.

See Also:
Constant Field Values
Method Detail

setClosedCaptioningState

void setClosedCaptioningState(int turnOn)
Turn closed-captioning of a JMF Player that is controlled by a ClosedCaptioningControl instance on or off. Note that only one closed-captioning decoding may be supported on the OCAP implementation at once. This method may turn off closed-captioning of another JMF Player automatically. Such a automatic turn off is notified by a ClosedCaptioningEvent event.

Parameters:
turnOn - An integer value specifying whether to turn closed-captioning on, off or "on mute". CC_TURN_ON, to turn closed-captioning represented by a Player instance that is controlled by the ClosedCaptioningControl instance on. CC_TURN_OFF, to turn it off. CC_TURN_ON_MUTE, to turn it on only when muting an audio.
Throws:
java.lang.SecurityException - if the caller doesn't have MonitorAppPermission("handler.closedCaptioning").

getClosedCaptioningState

int getClosedCaptioningState()
Get the current state of closed-captioning of a JMF Player that is controlled by a ClosedCaptioningControl instance. Note that this method returns a current status set by the setClosedCaptioningState() method or automatic turning off brought by the method call. This method doesn't care if an actual caption channel packet in the MPEG video header or line 21 data exist, or if an Caption Service Descriptor has changed.

Returns:
An integer value representing a closed captioning state. One of CC TURN ON, CC TURN OFF, and CC TURN ON MUTE.
Throws:
java.lang.SecurityException - if the caller doesn't have MonitorAppPermission("handler.closedCaptioning").

setClosedCaptioningServiceNumber

void setClosedCaptioningServiceNumber(int analogServiceNumber,
                                      int digitalServiceNumber)

This method sets a new closed-captioning service number to be represented by a JMF Player that is controlled by a ClosedCaptioningControl instance.

Captioning text will be rendered when captioning is turned on and corresponding captioning text data is transmitted. When an analog video is played on the JMF player, captioning service of an analogServiceNumber in VBI signal defined by EIA-608-B analog closed captioning will be rendered. When a digital video is played on the JMF player, captioning service of a digitalServiceNumber in MPEG picture header defined by EIA-708-B digital closed captioning will be rendered. If MPEG picture header doesn?t contain a captioning service of the digitalServiceNumber, a captioning service of analogServiceNumber in the MPEG picture header may be used instead.

The previously represented caption service shall be disappeared, when a new service is set. This method doesn't check if the specified closed-captioning service is transmitted with the current video actually.

Parameters:
analogServiceNumber - An integer representing an analog closed-captioning service number. The serviceNumber value shall be a return value of the getSupportedClosedCaptioningServiceNumber() method and shall be an analog captioning service, i.e., have a CC_ANALOG_SERVICE prefix. A value of CC_NO_SERVICE if no decoding of analog captioning is necessary.
digitalServiceNumber - An integer representing a digital closed-captioning service number. The serviceNumber value shall be a return value of the getSupportedClosedCaptioningServiceNumber() method and shall be an digital captioning service. A value of CC_NO_SERVICE if no decoding of digital captioning is necessary.
Throws:
java.lang.IllegalArgumentException - if the serviceNumber is not a return value of the getSupportedClosedCaptioningServiceNumber() method.
java.lang.SecurityException - if the caller doesn't have MonitorAppPermission("handler.closedCaptioning").

getClosedCaptioningServiceNumber

int[] getClosedCaptioningServiceNumber()
This method returns a current closed-captioning service for a JMF Player that is controlled by a ClosedCaptioningControl instance. This method doesn't care if the specified closed-captioning service is transmitted in the current video.

Returns:
An array of integers representing a closed-captioning service. The first item shall be an analog captioning service number and the second item shall be a digital captioning service number. The array length shall be 2. A value of CC_NO_SERVICE indicates no captioning service number is specified for the captioning type.
Throws:
java.lang.SecurityException - if the caller doesn't have MonitorAppPermission("handler.closedCaptioning").

getSupportedClosedCaptioningServiceNumber

int[] getSupportedClosedCaptioningServiceNumber()
This method returns closed-captioning service numbers that are supported by a JMF Player that is controlled by a ClosedCaptioningControl instance. Only service numbers returned by this method can be specified to the setClosedCaptioningServiceNumber(int, int) method. Note that this method doesn't check if the returned closed-captioning service is transmitted with the current video actually, i.e., this method returns just a capability of the host device.

Returns:
An array of closed-captioning service numbers that are supported by a JMF Player that is controlled by a ClosedCaptioningControl instance. If the service is analog captioning of EIA-608-B, the returned service number value shall be one of constants that has a prefix of CC_ANALOG_SERVICE_. If the service is digital captioning of EIA-708-B, the returned service number value shall be an actual service number (1 to 63).
Throws:
java.lang.SecurityException - if the caller doesn't have MonitorAppPermission("handler.closedCaptioning").

addClosedCaptioningListener

void addClosedCaptioningListener(ClosedCaptioningListener ccListener)
Add a listener to notify a closed-captioning state change. Multiple calls with same ccListener instance is simply ignored with throwing no exception.

Parameters:
ccListener - a ClosedCaptioningListener instance to notify a change of the closed-captioning state.
Throws:
java.lang.SecurityException - if the caller doesn't have MonitorAppPermission("handler.closedCaptioning").

removeClosedCaptioningListener

void removeClosedCaptioningListener(ClosedCaptioningListener ccListener)
Remove the given ClosedCaptioningListener. This method does nothing if the specified ccListener is null, not previously added or already removed.

Parameters:
ccListener - a ClosedCaptioningListener instance to be removed.
Throws:
java.lang.SecurityException - if the caller doesn't have MonitorAppPermission("handler.closedCaptioning").






© 2015 - 2025 Weber Informatics LLC | Privacy Policy