Media Authoring
with Java API

tv.amwa.maj.argument
Class MultiXferItem

java.lang.Object
  extended by tv.amwa.maj.argument.MultiXferItem
All Implemented Interfaces:
Serializable, Cloneable, MultiXferItem

public class MultiXferItem
extends Object
implements MultiXferItem, Serializable, Cloneable

Implementation of an element of a transfer array that is used when reading or writing one or more channels from an interleaved data stream.

Interleaved-essence: An essence format that combines two or more channels of audio or video data into a single essence stream.

Author:
Richard Cartwright
See Also:
MultiXferItem, EssenceMultiAccess, EssenceMultiAccess.readMultiSamples(tv.amwa.maj.record.MultiXferItem[]), EssenceMultiAccess.writeMultiSamples(tv.amwa.maj.record.MultiXferItem[]), Serialized Form

Constructor Summary
MultiXferItem(AUID mediaKind, short subTrackNum, int numSamples, byte[] buffer)
          Create a new multiple-transfer item.
 
Method Summary
 MultiXferItem clone()
           
 boolean equals(Object o)
           
 byte[] getBuffer()
          Returns the data buffer of this item.
 int getBuflen()
          Deprecated. 
 AUID getMediaKind()
          Returns the type of essence of this data item.
 int getNumSamples()
          Returns the number of samples of this data item to transfer.
 short getSubTrackNum()
          Returns the physical input-output track number of this data item, also known as "physical".
 int hashCode()
           
 void setBuffer(byte[] buffer)
          Sets the data buffer of this item.
 void setBuflen(int buflen)
          Deprecated. 
 void setMediaKind(AUID mediaKind)
          Sets the essence type definition of this data item.
 void setNumSamples(int numSamples)
          Sets the number of samples of this data item to transfer.
 void setSubTrackNum(short subTrackNum)
          Sets the physical input-output track number of this data item, also known as "physical".
 String toString()
          Creates a pseudo-XML representation of the metadata part of this multi-transfer item.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultiXferItem

public MultiXferItem(AUID mediaKind,
                     @Int16
                     short subTrackNum,
                     @UInt32
                     int numSamples,
                     byte[] buffer)
              throws NullPointerException,
                     IllegalArgumentException

Create a new multiple-transfer item.

Parameters:
mediaKind - The essence type definition, also known as "essenceDef".
subTrackNum - The physical input-output channel number, also known as "physical".
numSamples - The number of samples to transfer.
buffer - The buffer of un-interleaved stream data.
Throws:
NullPointerException - One or both of the given media kind or data buffer is null.
IllegalArgumentException - The given number of samples is negative.
Method Detail

getBuffer

@DataBuffer
public byte[] getBuffer()
Description copied from interface: MultiXferItem

Returns the data buffer of this item.

Specified by:
getBuffer in interface MultiXferItem
Returns:
Data buffer of this item.

setBuffer

public void setBuffer(@DataBuffer
                      byte[] buffer)
               throws NullPointerException
Description copied from interface: MultiXferItem

Sets the data buffer of this item.

Specified by:
setBuffer in interface MultiXferItem
Parameters:
buffer - Data buffer of this item.
Throws:
NullPointerException - The given data buffer is null.

getBuflen

@Deprecated
@UInt32
public int getBuflen()
Deprecated. 

Description copied from interface: MultiXferItem

Returns the length of the data buffer of this item.

Specified by:
getBuflen in interface MultiXferItem
Returns:
Length of the data buffer of this item.

setBuflen

@Deprecated
public void setBuflen(@UInt32
                                 int buflen)
Deprecated. 

Description copied from interface: MultiXferItem

Provided to set the length of the data buffer of this item but this feature is unnecessary with Java's class-based representation of arrays. This method does nothing.

Specified by:
setBuflen in interface MultiXferItem
Parameters:
buflen - Value is ignored.

getMediaKind

public AUID getMediaKind()
Description copied from interface: MultiXferItem

Returns the type of essence of this data item.

Specified by:
getMediaKind in interface MultiXferItem
Returns:
Type of essence represented by this item.

setMediaKind

public void setMediaKind(AUID mediaKind)
                  throws NullPointerException
Description copied from interface: MultiXferItem

Sets the essence type definition of this data item.

Specified by:
setMediaKind in interface MultiXferItem
Parameters:
mediaKind - Type of essence represented by this item.
Throws:
NullPointerException - The given media kind is null.

getNumSamples

@UInt32
public int getNumSamples()
Description copied from interface: MultiXferItem

Returns the number of samples of this data item to transfer.

Specified by:
getNumSamples in interface MultiXferItem
Returns:
Number of samples of this data item to transfer.

setNumSamples

public void setNumSamples(@UInt32
                          int numSamples)
                   throws IllegalArgumentException
Description copied from interface: MultiXferItem

Sets the number of samples of this data item to transfer.

Specified by:
setNumSamples in interface MultiXferItem
Parameters:
numSamples - Number of samples of this data item to transfer.
Throws:
IllegalArgumentException - The given number of samples is negative.

getSubTrackNum

@Int16
public short getSubTrackNum()
Description copied from interface: MultiXferItem

Returns the physical input-output track number of this data item, also known as "physical".

Specified by:
getSubTrackNum in interface MultiXferItem
Returns:
Physical input-output track number of this data item.

setSubTrackNum

public void setSubTrackNum(@Int16
                           short subTrackNum)
Description copied from interface: MultiXferItem

Sets the physical input-output track number of this data item, also known as "physical".

Specified by:
setSubTrackNum in interface MultiXferItem
Parameters:
subTrackNum - Physical input-output track number of this data item.

equals

public boolean equals(Object o)
Overrides:
equals in class Object

toString

public String toString()

Creates a pseudo-XML representation of the metadata part of this multi-transfer item. No XML schema or DTD defines this element. For example:

 <MultiTransferItem bufferLength="65536">
   <MediaKind>urn:x-ul:060e2b34.0401.0101.01030202.01000000</MediaKind>
   <NumSamples>42</NumSamples>
   <SubTrackNum>7</SubTrackNum>
 </MultiTransferItem>
 

Overrides:
toString in class Object
Returns:
XML representation of the metadata of this multi-transfer item.

clone

public MultiXferItem clone()
                    throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

hashCode

public int hashCode()
Overrides:
hashCode in class Object

Media Authoring
with Java API

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