|
Media Authoring with Java API |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttv.amwa.maj.entity.InterchangeObject
tv.amwa.maj.entity.Component
tv.amwa.maj.entity.Segment
tv.amwa.maj.entity.TimecodeStream
@AAFClass(uuid1=218169601, uuid2=257, uuid3=5376, uuid4={6,14,43,52,2,6,1,1}, definedName="TimecodeStream", description="The TimecodeStream class specifies a stream of timecode data.") public abstract class TimecodeStream
Implements a representation of a stream of timecode data.
THE COMMENTS FOR THIS CLASS ARE INCOMPLETE.
Nested Class Summary | |
---|---|
static class |
TimecodeStream.XMLHandler
|
Nested classes/interfaces inherited from class tv.amwa.maj.entity.Segment |
---|
Segment.SegmentXMLHandler |
Nested classes/interfaces inherited from class tv.amwa.maj.entity.Component |
---|
Component.ComponentAttributesXMLHandler, Component.ComponentUserCommentsXMLHandler, Component.ComponentXMLHandler, Component.KLVDataXMLHandler |
Nested classes/interfaces inherited from class tv.amwa.maj.entity.InterchangeObject |
---|
InterchangeObject.InterchangeObjectXMLHandler |
Field Summary |
---|
Fields inherited from class tv.amwa.maj.entity.Component |
---|
COMPONENT_ITEM |
Constructor Summary | |
---|---|
TimecodeStream()
|
Method Summary | |
---|---|
void |
appendXMLChildren(Node parent)
Append child elements to the given parent node to serialize the value of an object to an XML fragment. |
boolean |
equals(Object o)
Tests to see if the given object is equal to this interchange object. |
TimecodeValue |
getPositionTimecode(long position)
Returns the timecode value for a given frame of this timecode stream. |
Rational |
getSampleRate()
Returns the sample rate of the timecode stream, which specifies the sample rate of the timecode data contained in the source property. |
abstract int |
getSampleSize()
Returns the size of one sample of the timecode data of this timecode stream, measured in bytes. |
byte[] |
getSource()
Returns the data buffer containing the stream of timecode data of this timecode stream. |
int |
getSourceBufferLength()
Returns the length of the timecode stream buffer contained within the timecode stream object. |
TCSource |
getSourceType()
Returns the kind of timecode of this timecode stream, which is one of LTC or VITC. |
byte[] |
getUserDataAtPosition(long position)
Returns the user data (user-bits) for a particular frame of this timecode stream. |
abstract int |
getUserDataLength()
Returns the length of user data for one frame of this timecode stream. |
int |
hashCode()
Returns a hash code value for this interchange object. |
abstract byte[] |
packTimecode(TimecodeValue timecode,
byte[] packedBuffer)
Pack a given timecode value into a give byte array. |
abstract byte[] |
packUserBits(byte[] userBits,
byte[] packedBuffer)
Pack user data from the given byte array into the given packed buffer. |
TimecodeValue |
segmentOffsetToTC(long offset)
Converts the given segment offset to a timecode value. |
long |
segmentTCToOffset(TimecodeValue timecode,
Rational editRate)
Converts the given timecode and edit rate to a segment offset value. |
void |
setPositionTimecode(long position,
TimecodeValue timecode)
Sets the timecode value for a given frame of this timecode stream. |
void |
setPropertiesFromInterface(TimecodeStream castFrom)
|
void |
setSampleRate(Rational sampleRate)
Sets the sample rate of this timecode stream, which specifies the sample rate of the timecode data contained in the source property. |
void |
setSource(byte[] value)
Sets the data buffer containing the stream of timecode data of this timecode stream. |
void |
setSourceType(TCSource sourceType)
Sets the kind of timecode of this timecode stream, which is one of LTC or VITC. |
void |
setUserDataAtPosition(long position,
byte[] buffer)
Sets the user data (userbits) for a particular frame of the timecode stream. |
abstract TimecodeValue |
unpackTimecode(byte[] buffer,
short fps)
Unpack a timecode value from the given buffer for the given number of frames per second. |
abstract byte[] |
unpackUserBits(byte[] buffer)
Unpack user data from the given sample of the timecode stream. |
Methods inherited from class tv.amwa.maj.entity.Segment |
---|
clone, setPropertiesFromInterface |
Methods inherited from class tv.amwa.maj.entity.Component |
---|
appendAttribute, appendAttribute, appendComment, appendComment, appendKLVData, countAttributes, countComments, countKLVData, getAttributes, getComments, getDataDefinition, getKLVData, getLength, getLengthPresent, removeAttribute, removeComment, removeKLVData, setDataDefinition, setLength, setLengthPresent, setPropertiesFromInterface |
Methods inherited from class tv.amwa.maj.entity.InterchangeObject |
---|
castFromInterface, countProperties, createOptionalPropertyValue, disableGenerationTracking, enableGenerationTracking, getDefinition, getGeneration, getGenerationAUID, getProperties, getPropertyValue, isGenerationTracked, isPropertyPresent, omitOpionalProperty, registerImplementation, setPropertiesFromInterface, setPropertyValue, toString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface tv.amwa.maj.iface.Component |
---|
appendAttribute, appendAttribute, appendComment, appendComment, appendKLVData, countAttributes, countComments, countKLVData, getAttributes, getComments, getDataDefinition, getKLVData, getLength, removeAttribute, removeComment, removeKLVData, setDataDefinition, setLength |
Methods inherited from interface tv.amwa.maj.iface.InterchangeObject |
---|
countProperties, createOptionalPropertyValue, disableGenerationTracking, enableGenerationTracking, getDefinition, getGeneration, getGenerationAUID, getProperties, getPropertyValue, isGenerationTracked, isPropertyPresent, omitOpionalProperty, setPropertyValue |
Methods inherited from interface tv.amwa.maj.entity.MAJCommon |
---|
clone, toString |
Constructor Detail |
---|
public TimecodeStream()
Method Detail |
---|
public final void setPropertiesFromInterface(TimecodeStream castFrom)
@AAFProperty(uuid1=67371265, uuid2=513, uuid3=0, uuid4={6,14,43,52,1,1,1,2}, definedName="SampleRate", typeName="Rational", optional=false, uniqueIdentifier=false, pid=5633) public Rational getSampleRate()
TimecodeStream
Returns the sample rate of the timecode stream, which specifies the sample rate of the timecode data contained in the source property.
getSampleRate
in interface TimecodeStream
public void setSampleRate(Rational sampleRate) throws NullPointerException
TimecodeStream
Sets the sample rate of this timecode stream, which specifies the sample rate of the timecode data contained in the source property.
setSampleRate
in interface TimecodeStream
sampleRate
- Sample rate of this timecode stream.
NullPointerException
public abstract int getSampleSize()
TimecodeStream
Returns the size of one sample of the timecode data of this timecode stream, measured in bytes.
getSampleSize
in interface TimecodeStream
@AAFProperty(uuid1=67568384, uuid2=0, uuid3=0, uuid4={6,14,43,52,1,1,1,2}, definedName="Source", typeName="Stream", optional=false, uniqueIdentifier=false, pid=5634) public byte[] getSource()
TimecodeStream
Returns the data buffer containing the stream of timecode data of this timecode stream.
getSource
in interface TimecodeStream
TimecodeStream.getSampleRate()
public void setSource(byte[] value) throws NullPointerException
TimecodeStream
Sets the data buffer containing the stream of timecode data of this timecode stream.
setSource
in interface TimecodeStream
value
- Stream of timecode data to store in this timecode stream.
NullPointerException
- The given timecode stream source property
is null
.TimecodeStream.setSampleRate(Rational)
public int getSourceBufferLength()
TimecodeStream
Returns the length of the timecode stream buffer contained within the timecode stream object. This is the size of the buffer and not the number of timecode entries in the stream.
getSourceBufferLength
in interface TimecodeStream
TimecodeStream.getSource()
@AAFProperty(uuid1=67371521, uuid2=0, uuid3=0, uuid4={6,14,43,52,1,1,1,1}, definedName="SourceType", typeName="TCSource", optional=false, uniqueIdentifier=false, pid=5635) public TCSource getSourceType()
TimecodeStream
Returns the kind of timecode of this timecode stream, which is one of LTC or VITC.
getSourceType
in interface TimecodeStream
public void setSourceType(TCSource sourceType) throws NullPointerException
TimecodeStream
Sets the kind of timecode of this timecode stream, which is one of LTC or VITC.
setSourceType
in interface TimecodeStream
sourceType
- Kind of timecode of this timecode stream.
NullPointerException
public byte[] getUserDataAtPosition(long position) throws PositionOutOfRangeException
TimecodeStream
Returns the user data (user-bits) for a particular frame of this timecode stream.
getUserDataAtPosition
in interface TimecodeStream
position
- Zero-based index to the frame to get the user bits
from.
PositionOutOfRangeException
- The given user data is outside the
acceptable range for this timecode stream.TimecodeStream.getUserDataLength()
public void setUserDataAtPosition(long position, byte[] buffer) throws NullPointerException, PositionOutOfRangeException
TimecodeStream
Sets the user data (userbits) for a particular frame of the timecode stream.
setUserDataAtPosition
in interface TimecodeStream
position
- Zero-based offset to the userbits to set.buffer
- User data for the specified frame.
NullPointerException
- The given user data buffer is null
.
PositionOutOfRangeException
- The given user data is outside the
acceptable range for this timecode stream.public abstract int getUserDataLength()
TimecodeStream
Returns the length of user data for one frame of this timecode stream.
getUserDataLength
in interface TimecodeStream
TimecodeStream.getUserDataAtPosition(long)
public TimecodeValue getPositionTimecode(long position) throws PositionOutOfRangeException
TimecodeStream
Returns the timecode value for a given frame of this timecode stream. The frame index must be within the length of the stream.
getPositionTimecode
in interface TimecodeStream
position
- Frame to find the timecode value for from the timecode
stream.
PositionOutOfRangeException
- Frame index is outside the length
of this timecode stream.public void setPositionTimecode(long position, TimecodeValue timecode) throws NullPointerException, PositionOutOfRangeException
TimecodeStream
Sets the timecode value for a given frame of this timecode stream. The frame index must be within the length of the stream.
setPositionTimecode
in interface TimecodeStream
position
- Zero-based offset to set the timecode value at.timecode
- Timecode value to set at the given frame for the timecode
stream.
NullPointerException
- The given timecode value is null
.
PositionOutOfRangeException
- Frame index is outside the length
of the stream.public TimecodeValue segmentOffsetToTC(long offset) throws IllegalArgumentException
Segment
Converts the given segment offset to a timecode value.
segmentOffsetToTC
in interface Segment
segmentOffsetToTC
in class Segment
offset
- Segment offset to be converted to a timecode.
IllegalArgumentException
Segment.segmentTCToOffset(TimecodeValue, Rational)
public long segmentTCToOffset(TimecodeValue timecode, Rational editRate) throws NullPointerException, TimecodeNotFoundException, BadSampleOffsetException
Segment
Converts the given timecode and edit rate to a segment offset value.
segmentTCToOffset
in interface Segment
segmentTCToOffset
in class Segment
timecode
- Timecode to be converted to an offset.editRate
- Edit rate of the given timecode.
NullPointerException
- One or both of the given timecode and/or edit rate is/are
null
.
TimecodeNotFoundException
- The given timecode is not available
in this segment.
BadSampleOffsetException
- The given timecode is outside the bounds
of the timecode values represented by this segment.Segment.segmentOffsetToTC(long)
public abstract TimecodeValue unpackTimecode(byte[] buffer, short fps) throws NullPointerException, IllegalArgumentException
Unpack a timecode value from the given buffer for the given number of frames per second.
buffer
- Data buffer containing bytes representing one timecode value.fps
- Frames per second of the current timecode stream.
NullPointerException
- Argument is null.
IllegalArgumentException
- The given buffer does not contain sufficient data to unpack a timecode
value or the frame per second value is not a positive value.public abstract byte[] packTimecode(TimecodeValue timecode, byte[] packedBuffer) throws NullPointerException, IllegalArgumentException
Pack a given timecode value into a give byte array. Any user bits in the given packed buffer are preserved.
timecode
- Timecode value to serialize.packedBuffer
- Array of bytes into which the timecode should be packed.
NullPointerException
- One or more of the arguments is null.
IllegalArgumentException
- The given array of packed bytes is the wrong length to allow
the packing of a timecode value.public abstract byte[] unpackUserBits(byte[] buffer) throws NullPointerException, IllegalArgumentException
Unpack user data from the given sample of the timecode stream.
buffer
- Buffer to use to unpack user data from.
NullPointerException
- Argument is null.
IllegalArgumentException
- The given data buffer is too short to enable user bits to be
extracted.public abstract byte[] packUserBits(byte[] userBits, byte[] packedBuffer) throws NullPointerException, IllegalArgumentException
Pack user data from the given byte array into the given packed buffer.
userBits
- User bits to set for a timecode value.packedBuffer
- Buffer to pack user bits into.
NullPointerException
- One or more of the arguments is null.
IllegalArgumentException
- The packed buffer or array of user bits are of
the wrong length.public boolean equals(Object o)
MAJCommon
Tests to see if the given object is equal to this interchange object. To be equal, the given value must be not null, share the same interface to its value and each of the properties of the value must each be equal.
equals
in interface MAJCommon
equals
in class Component
o
- Object to test for equality with.
Object.equals(Object)
public int hashCode()
MAJCommon
Returns a hash code value for this interchange object.
hashCode
in interface MAJCommon
hashCode
in class Component
Object.hashCode()
public void appendXMLChildren(Node parent)
XMLSerializable
Append child elements to the given parent node to serialize the value of an object
to an XML fragment. Methods of the XMLBuilder
class are provided to help with this
process.
appendXMLChildren
in interface XMLSerializable
appendXMLChildren
in class Component
parent
- XML parent element to append child nodes to.
|
Media Authoring with Java API |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |