|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface VBIFilter
This class represents a VBI filter.
VBIFilter instances are created by a VBIFilterGroup based on the OCAP
resource management.
Line numbers and a data format to be filtered are specified when the filter
is created via VBIFilterGroup.newVBIFilter(int[], int, int, int, int)
The startFiltering() method starts filtering of the specified data format in the specified VBI line and stores data units in an internal buffer. When the first single data unit is filtered, a VBIFilterEvent with EVENT_CODE_FIRST_VBI_DATA_AVAILABLE is issued only once. The VBIFilter continues filtering.
VBI filtering stops in the following cases:
setTimeOut(long)
) occurs, a VBIFilterEvent with
EVENT_CODE_TIMEOUT notifies it.
VBI filtering continues in the following cases:
See also the VBIFilterGroup
.
Method Summary | |
---|---|
void |
addVBIFilterListener(VBIFilterListener listener)
Add a new VBIFilterListener instance to this VBI filter. |
void |
clearBuffer()
Clear an internal buffer to store retrieved VBI data. |
byte[] |
getVBIData()
This method returns multiple VBI data unit bytes. |
void |
removeVBIFilterListener(VBIFilterListener listener)
Remove an existing VBIFilterListener instance from this VBI filter. |
void |
setNotificationByDataUnits(int numberOfDataUnits)
Set the number of data units to receive a cyclic notification. |
void |
setNotificationByTime(long milliseconds)
Set a notification time. |
void |
setTimeOut(long milliseconds)
Set a timeout value. |
void |
startFiltering(Object appData)
Initiate filtering of VBI data for the specified line and the specified data format by a VBIFilterGroup. |
void |
startFiltering(Object appData,
int offset,
byte[] posFilterDef,
byte[] posFilterMask,
byte[] negFilterDef,
byte[] negFilterMask)
Initiate filtering of VBI data for the specified line and the specified data format by a VBIFilterGroup. |
void |
stopFiltering()
Stop current filtering of this VBI filter. |
Method Detail |
---|
void startFiltering(Object appData) throws ConnectionLostException
VBIFilterGroup.attach(javax.tv.service.selection.ServiceContext, org.davic.resources.ResourceClient, java.lang.Object)
method is called.
appData
- application specific data. This data is notified
to the application with a VBIFilterEvent. Null is
possible.
ConnectionLostException
- if the
ServiceContext to which the parent VBIFilterGroup is
attached has entered the destroyed state and
hence is unable to satisfy the method call, or if the
parent VBIFilterGroup has been detached from the
ServiceContext.void startFiltering(Object appData, int offset, byte[] posFilterDef, byte[] posFilterMask, byte[] negFilterDef, byte[] negFilterMask) throws ConnectionLostException, IllegalFilterDefinitionException
VBIFilterGroup.attach(javax.tv.service.selection.ServiceContext, org.davic.resources.ResourceClient, java.lang.Object)
method is called.
appData
- application specific data. This data is notified
to the application with a VBIFilterEvent. Null is
possible.offset
- defines a number of offset bytes that the specified
matching bits and masking bits are applied. Value 0
means no offset. Value 1 means that the matching/masking
bit is applied from the second byte.posFilterDef
- defines values to match for bits in a single data
unit. Only data unit that has matching bytes with this
posFilterDef are retrieved.
Maximum length is 36 bytes.posFilterMask
- defines which bits in the data unit are to be
compared against the posFilterDef bytes.
Matching calculation of negFilterDef and negFilterMask
obeys E.8.1 of DAVIC 1.4.1 Part 9.
Maximum length is 36 bytes.negFilterDef
- defines values to match for bits in a single data
unit. Only data unit that has matching bytes with this
negFilterDef are retrieved.
Maximum length is 36 bytes.negFilterMask
- defines which bits in the data unit are to be
compared against the negFilterDef bytes.
Matching calculation of negFilterDef and negFilterMask
obeys E.8.1 of DAVIC 1.4.1 Part 9.
Maximum length is 36 bytes.
ConnectionLostException
- if the
ServiceContext to which the parent VBIFilterGroup is
attached has entered the destroyed state and
hence is unable to satisfy the method call, or if the
parent VBIFilterGroup has been detached from the
ServiceContext.
IllegalFilterDefinitionException
- if the
filter definition specified is illegal either because the
arrays posFilterDef, posFilterMask, negFilterDef,
negFilterMask are not all the same size or because their
length is greater than the maximum allowable 36 bytes.void stopFiltering()
void setTimeOut(long milliseconds)
milliseconds
- a timeout value in milli seconds. A default
value is -1 that indicates infinite.void setNotificationByTime(long milliseconds)
milliseconds
- a time-period value in milliseconds. A default
value is -1 that indicates infinite.void setNotificationByDataUnits(int numberOfDataUnits)
numberOfDataUnits
- the number of data units to be notified.
A default value is 0 that indicates no notification.
Note that if a small number of data units is specified,
the notification may be delayed and host performance may
be affected. For example, if 1 is specified for a
VBI_DATA_FORMAT_UNKNOWN data unit that comes every field
(i.e., 1/60 seconds), the host has to notify every 1/60
seconds, possibly degrading performance.
IllegalArgumentException
- if the numberOfDataUnit is larger
than the bufferSize specified by a
VBIFilterGroup.newVBIFilter(int[], int, int, int, int)
method.void addVBIFilterListener(VBIFilterListener listener)
listener
- a VBIFilterListener instance to be notified
a VBI filtering events.void removeVBIFilterListener(VBIFilterListener listener)
byte[] getVBIData()
VBIFilter
interface.
The returned bytes are simply the concatenated VBI data currently held
within the internal buffer.
Note that the return value is not necessarily aligned by a complete VBI
data unit. I.e., an incomplete data unit may return.
When this method is called, the internal buffer is cleared once. I.e.,
the next call returns the next byte of retrieved VBI data.
VBIFilterGroup.newVBIFilter(int[], int, int, int, int)
method.void clearBuffer()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |