Media Authoring
with Java API

tv.amwa.maj.iface
Interface TimecodeStream

All Superinterfaces:
Component, InterchangeObject, Segment
All Known Subinterfaces:
TimecodeStream12M
All Known Implementing Classes:
TimecodeStream, TimecodeStream12M

public interface TimecodeStream
extends Segment

Specifies a stream of timecode data.

In contrast to a timecode stream, a timecode specifies timecode by specifying the single starting timecode value; other timecode values are calculated from the starting timecode and the time offset.

Author:
Richard Cartwright
See Also:
Segment.segmentOffsetToTC(long), Segment.segmentTCToOffset(TimecodeValue, Rational)

Method Summary
 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.
 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.
 int getUserDataLength()
          Returns the length of user data for one frame of this timecode stream.
 void setPositionTimecode(long position, TimecodeValue timecode)
          Sets the timecode value for a given frame of this timecode stream.
 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[] source)
          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.
 
Methods inherited from interface tv.amwa.maj.iface.Segment
segmentOffsetToTC, segmentTCToOffset
 
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
 

Method Detail

getPositionTimecode

TimecodeValue getPositionTimecode(@PositionType
                                  long position)
                                  throws PositionOutOfRangeException

Returns the timecode value for a given frame of this timecode stream. The frame index must be within the length of the stream.

Parameters:
position - Frame to find the timecode value for from the timecode stream.
Returns:
Timecode value at the given frame from the timecode stream.
Throws:
PositionOutOfRangeException - Frame index is outside the length of this timecode stream.

setPositionTimecode

void setPositionTimecode(@PositionType
                         long position,
                         TimecodeValue timecode)
                         throws NullPointerException,
                                PositionOutOfRangeException

Sets the timecode value for a given frame of this timecode stream. The frame index must be within the length of the stream.

Parameters:
position - Zero-based offset to set the timecode value at.
timecode - Timecode value to set at the given frame for the timecode stream.
Throws:
NullPointerException - The given timecode value is null.
PositionOutOfRangeException - Frame index is outside the length of the stream.

getUserDataLength

@Int32
int getUserDataLength()

Returns the length of user data for one frame of this timecode stream.

Returns:
Length of user data for one frame of this timecode stream.
See Also:
getUserDataAtPosition(long)

getUserDataAtPosition

@DataBuffer
byte[] getUserDataAtPosition(@PositionType
                                        long position)
                             throws PositionOutOfRangeException

Returns the user data (user-bits) for a particular frame of this timecode stream.

Parameters:
position - Zero-based index to the frame to get the user bits from.
Returns:
User-bits from the timecode data for this given frame.
Throws:
PositionOutOfRangeException - The given user data is outside the acceptable range for this timecode stream.
See Also:
getUserDataLength()

setUserDataAtPosition

void setUserDataAtPosition(@PositionType
                           long position,
                           @DataBuffer
                           byte[] buffer)
                           throws NullPointerException,
                                  PositionOutOfRangeException

Sets the user data (userbits) for a particular frame of the timecode stream.

Parameters:
position - Zero-based offset to the userbits to set.
buffer - User data for the specified frame.
Throws:
NullPointerException - The given user data buffer is null.
PositionOutOfRangeException - The given user data is outside the acceptable range for this timecode stream.

setSampleRate

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.

Parameters:
sampleRate - Sample rate of this timecode stream.

getSampleRate

Rational getSampleRate()

Returns the sample rate of the timecode stream, which specifies the sample rate of the timecode data contained in the source property.

Returns:
Sample rate of this timecode stream.

setSourceType

void setSourceType(TCSource sourceType)

Sets the kind of timecode of this timecode stream, which is one of LTC or VITC.

Parameters:
sourceType - Kind of timecode of this timecode stream.

getSourceType

TCSource getSourceType()

Returns the kind of timecode of this timecode stream, which is one of LTC or VITC.

Returns:
Kind of timecode of this timecode stream.

getSampleSize

@UInt32
int getSampleSize()

Returns the size of one sample of the timecode data of this timecode stream, measured in bytes.

Returns:
Size of one sample of the timecode data of this timecode stream.

getSource

@DataBuffer
byte[] getSource()

Returns the data buffer containing the stream of timecode data of this timecode stream.

Returns:
Stream of timecode data stored in this timecode stream.
See Also:
getSampleRate()

getSourceBufferLength

@UInt32
int getSourceBufferLength()

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.

Returns:
Length of the timecode stream buffer contained within the timecode stream object.
See Also:
getSource()

setSource

void setSource(@DataBuffer
               byte[] source)
               throws NullPointerException

Sets the data buffer containing the stream of timecode data of this timecode stream.

Parameters:
source - Stream of timecode data to store in this timecode stream.
Throws:
NullPointerException - The given timecode stream source property is null.
See Also:
setSampleRate(Rational)

Media Authoring
with Java API

(c) 2007-2008 Richard Cartwright, all rights reserved. Subject to the terms of the AAF SDK Public Source License.