@MediaClass(uuid1=218169601, uuid2=257, uuid3=5632, uuid4={6,14,43,52,2,6,1,1}, definedName="TimecodeStream12M", description="The TimecodeStream12M class specifies a stream of timecode data in the SMPTE 12M format.", symbol="TimecodeStream12M") public class TimecodeStream12MImpl extends TimecodeStreamImpl implements TimecodeStream12M, Serializable, Cloneable
Implements a representation of a stream of timecode data in the SMPTE 12M format.
THE COMMENTS FOR THIS CLASS ARE INCOMPLETE.
The byte stream is laid out as a sequence of bits numbered 0-79 with bit 0 being the first bit. The data is stored as a 10-byte array, and bit 0 is the MSB of the first byte.
The bit definitions are as follows:
| bits | description | extraction expression |
| 0-3 | units of frames | (foo[bits0_7] >> 4) & 0x0F |
| 4-7 | first binary group | foo[bits0_7] & 0x0F |
| 8-9 | tens of frames | (foo[bits8_15] >> 6) & 0x03 |
| 10 | drop frame | (foo[bits8_15] >> 5) & 0x01 |
| 11 | color frame | (foo[bits8_15] >> 4) & 0x01 |
| 12-15 | second binary group | foo[bits8_15] & 0x0F |
| 16-19 | units of seconds | (foo[bits16_23] >> 4) & 0x0F |
| 20-23 | third binary group | foo[bits16_23] & 0x0F |
| 24-26 | tens of seconds | (foo[bits24_31] >> 5) & 0x07 |
| 27 | bi-phase mark phase correction bit | (foo[bits24_31] >> 7) & 0x01 |
| 28-31 | fourth binary group | foo[bits24_31] & 0x0F |
| 32-35 | units of minutes | (foo[bits32_39] >> 4) & 0x0F |
| 36-39 | fifth binary group | foo[bits32_39] & 0x0F |
| 40-42 | tens of minutes | (foo[bits40_47] >> 5) & 0x07 |
| 43 | binary group flag bit | (foo[bits40_47] >> 4) & 0x01 |
| 44-47 | sixth binary group | foo[bits40_47] & 0x0F |
| 48-51 | units of hours | (foo[bits48_55] >> 4) & 0x0F |
| 52-55 | seventh binary group | foo[bits48_55] & 0x0F |
| 56-57 | tens of hours | (foo[bits56_63] >> 6) & 0x03 |
| 58 | unassigned address bit | (foo[bits56_63] >> 5) & 0x01 |
| 59 | binary group flag bit | (foo[bits56_63] >> 4) & 0x01 |
| 60-63 | eighth binary group | foo[bits56_63] & 0x0F |
| 64-71 | synch word (fixed 0x3F) | |
| 72-79 | synch word (fixed 0xFD) |
Timecode streams are useful to store user bits that were specified in the timecode on the videotape.
ObjectClassPropertyIDINCLUDESYNC_DEFAULT| Constructor and Description |
|---|
TimecodeStream12MImpl() |
TimecodeStream12MImpl(Rational sampleRate,
Stream source,
TCSource sourceType)
Creates and initializes a new SMPTE 12M-compliant timecode stream, which specifies a
stream of timecode data in the SMPTE 12M format.
|
| Modifier and Type | Method and Description |
|---|---|
TimecodeStream12M |
clone()
Create a cloned copy of this interchange object.
|
boolean |
getIncludeSync()
Returns
true if the synchronization data is included in the
timecode stream; otherwise false if the synchronization data has a
fixed value and is omitted from the timecode stream. |
int |
getSampleSize()
Returns the size of one sample of the timecode data of this
timecode stream, measured in bytes.
|
int |
getUserDataLength()
Returns the length of user data for one frame of this timecode
stream.
|
static boolean |
initializeIncludeSync() |
ByteBuffer |
packTimecode(TimecodeValue timecode,
ByteBuffer packedBuffer)
Pack a given timecode value into a give byte array.
|
ByteBuffer |
packUserBits(ByteBuffer userBitsBuffer,
ByteBuffer packedBuffer)
Pack user data from the given byte array into the given packed buffer.
|
void |
setIncludeSync(Boolean includeSync)
Sets
true if synchronization data is included in this
timecode stream and false if the synchronization data has a
fixed value and is omitted from the timecode stream. |
TimecodeValue |
unpackTimecode(ByteBuffer timecodeBuffer,
short fps)
Unpack a timecode value from the given buffer for the given number of frames per second.
|
ByteBuffer |
unpackUserBits(ByteBuffer buffer)
Unpack user data from the given sample of the timecode stream.
|
getPositionTimecode, getSourceBufferLength, getTimecodeSource, getTimecodeStreamData, getTimecodeStreamSampleRate, getTimecodeStreamSampleRateString, getUserDataAtPosition, initializeTimecodeSource, initializeTimecodeStreamData, initializeTimecodeStreamSampleRate, segmentOffsetToTC, segmentTCToOffset, setPositionTimecode, setTimecodeSource, setTimecodeStreamData, setTimecodeStreamSampleRate, setTimecodeStreamSampleRateString, setUserDataAtPositiongenerateSequence, getCutPoint, getKeyOffset, getPackLayerKeyIndicator, getSegmentBlob, getTrackBlob, getTrackKeyRenderSequence, getTrackName, getTrackRenderSequence, setCutPoint, setKeyOffset, setPackLayerKeyIndicator, setSegmentBlob, setTrackBlob, setTrackKeyRenderSequence, setTrackName, setTrackRenderSequenceappendComponentAttribute, appendComponentAttribute, appendComponentKLVData, appendComponentUserComment, appendComponentUserComment, clearComponentAttributes, clearComponentKLVData, clearComponentUserComments, countComponentAttributes, countComponentKLVData, countComponentUserComments, getComment, getComponentAttributes, getComponentDataDefinition, getComponentKLVData, getComponentLength, getComponentUserComments, getEditName, getJupiterClipOffset, getJupiterID, getLengthPresent, initializeComponentDataDefinition, prependComponentAttribute, prependComponentKLVData, prependComponentUserComment, removeComponentAttribute, removeComponentKLVData, removeComponentUserComment, setComponentDataDefinition, setComponentLength, setComponentLengthFromStream, setEditName, setJupiterClipOffset, setJupiterID, setLengthPresentaddApplicationPlugin, appendXMLChildren, clearApplicationPlugins, containsApplicationPlugin, containsApplicationPlugin, countApplicationPlugins, deepEquals, disableGenerationTracking, enableGenerationTracking, equals, getApplicationPlugins, getGeneration, getLinkedGenerationID, getLinkedGenerationIDString, getObjectClass, getPersistentID, getPersistentIndex, hashCode, isGenerationTracked, removeApplicationPlugin, removeApplicationPlugin, setLinkedGenerationID, setLinkedGenerationIDString, setObjectClass, setPersistentID, setPersistentIndex, toStringgetPositionTimecode, getSourceBufferLength, getTimecodeSource, getTimecodeStreamData, getTimecodeStreamSampleRate, getUserDataAtPosition, setPositionTimecode, setTimecodeSource, setTimecodeStreamData, setTimecodeStreamSampleRate, setUserDataAtPositiongenerateSequence, segmentOffsetToTC, segmentTCToOffsetappendComponentAttribute, appendComponentAttribute, appendComponentKLVData, appendComponentUserComment, appendComponentUserComment, clearComponentAttributes, clearComponentKLVData, clearComponentUserComments, countComponentAttributes, countComponentKLVData, countComponentUserComments, getComponentAttributes, getComponentDataDefinition, getComponentKLVData, getComponentLength, getComponentUserComments, getLengthPresent, removeComponentAttribute, removeComponentKLVData, removeComponentUserComment, setComponentDataDefinition, setComponentLength, setLengthPresentaddApplicationPlugin, clearApplicationPlugins, containsApplicationPlugin, containsApplicationPlugin, countApplicationPlugins, deepEquals, disableGenerationTracking, enableGenerationTracking, equals, getApplicationPlugins, getGeneration, getLinkedGenerationID, getObjectClass, isGenerationTracked, removeApplicationPlugin, removeApplicationPlugin, setLinkedGenerationID, setObjectClass, toStringgetPersistentID, setPersistentIndexpublic TimecodeStream12MImpl()
public TimecodeStream12MImpl(Rational sampleRate, @DataBuffer Stream source, TCSource sourceType) throws NullPointerException, IllegalArgumentException
Creates and initializes a new SMPTE 12M-compliant timecode stream, which specifies a stream of timecode data in the SMPTE 12M format.
sampleRate - Sample rate of the timecode data contained in the source property.source - The timecode data.sourceType - Kind of timecode data.NullPointerException - One or more of the arguments is null and all
are required.IllegalArgumentException@MediaProperty(uuid1=67371265, uuid2=1024, uuid3=0, uuid4={6,14,43,52,1,1,1,1}, definedName="IncludeSync", typeName="Boolean", optional=false, uniqueIdentifier=false, pid=5889, symbol="IncludeSync") public boolean getIncludeSync()
TimecodeStream12MReturns true if the synchronization data is included in the
timecode stream; otherwise false if the synchronization data has a
fixed value and is omitted from the timecode stream.
If this optional property is omitted, the default value of false is returned.
getIncludeSync in interface TimecodeStream12MTimecodeStream12M.INCLUDESYNC_DEFAULT@MediaPropertySetter(value="IncludeSync") public void setIncludeSync(Boolean includeSync)
TimecodeStream12MSets true if synchronization data is included in this
timecode stream and false if the synchronization data has a
fixed value and is omitted from the timecode stream.
The default value for this optional property is false.
Set this optional property to null to omit it.
setIncludeSync in interface TimecodeStream12MincludeSync - Is synchronization data included in the timecode
stream?TimecodeStream12M.INCLUDESYNC_DEFAULTpublic static final boolean initializeIncludeSync()
public int getSampleSize()
TimecodeStreamReturns the size of one sample of the timecode data of this timecode stream, measured in bytes.
getSampleSize in interface TimecodeStreamgetSampleSize in class TimecodeStreamImplpublic int getUserDataLength()
TimecodeStreamReturns the length of user data for one frame of this timecode stream.
getUserDataLength in interface TimecodeStreamgetUserDataLength in class TimecodeStreamImplTimecodeStream.getUserDataAtPosition(long)public ByteBuffer packTimecode(TimecodeValue timecode, ByteBuffer packedBuffer) throws NullPointerException, IllegalArgumentException
TimecodeStreamImplPack a given timecode value into a give byte array. Any user bits in the given packed buffer are preserved.
packTimecode in class TimecodeStreamImpltimecode - 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 ByteBuffer packUserBits(ByteBuffer userBitsBuffer, ByteBuffer packedBuffer) throws NullPointerException, IllegalArgumentException
TimecodeStreamImplPack user data from the given byte array into the given packed buffer.
packUserBits in class TimecodeStreamImpluserBitsBuffer - 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 TimecodeValue unpackTimecode(ByteBuffer timecodeBuffer, short fps) throws NullPointerException, IllegalArgumentException
TimecodeStreamImplUnpack a timecode value from the given buffer for the given number of frames per second.
unpackTimecode in class TimecodeStreamImpltimecodeBuffer - 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 ByteBuffer unpackUserBits(ByteBuffer buffer) throws NullPointerException, IllegalArgumentException
TimecodeStreamImplUnpack user data from the given sample of the timecode stream.
unpackUserBits in class TimecodeStreamImplbuffer - 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 TimecodeStream12M clone()
InterchangeObjectCreate a cloned copy of this interchange object.
clone in interface MediaEntityclone in interface Componentclone in interface InterchangeObjectclone in interface Segmentclone in interface TimecodeStreamclone in interface TimecodeStream12Mclone in class TimecodeStreamImpl(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.