de.humatic.dsj
Class JSampleBuffer

java.lang.Object
  extended by de.humatic.dsj.SampleBuffer
      extended by de.humatic.dsj.JSampleBuffer

public class JSampleBuffer
extends SampleBuffer

JSampleBuffer is a typed structure holding a block of data - usually a video- or audioframe - and some related attributes. Unlike DSSampleBuffer JSampleBuffer has no fix association with a Filtergraph and can be kept around over longer times. dsj uses it in the de.humatic.dsj.src.Source derived classes to feed the native source filters with data from the java side.


Field Summary
 
Fields inherited from class de.humatic.dsj.SampleBuffer
SF_CODECSPECIFIC, SF_DISCONTINUITY, SF_EOS, SF_FLUSH, SF_FRAMEREORDERED, SF_KEYFRAME, SF_NOSTAMP, SF_PREROLL
 
Constructor Summary
JSampleBuffer(byte[] d, int offset, int last, int time, int sequenceNumber, int inputDelta, int flags)
          Constructs a JSampleBuffer by copying data from indices %offset to %last of %d (so that the resulting sample length as returned by getSampleLength() = last-offset) into a newly allocated byte[].
JSampleBuffer(DSMediaType mtype, byte[] d)
          Constructs a JSampleBuffer referencing all data in the given byte array.
JSampleBuffer(DSMediaType mtype, byte[] headers, byte[] d, int offset, int last, int time, int sequenceNumber, int inputDelta, int flags)
           
JSampleBuffer(DSMediaType mtype, byte[] d, int length, int time, int sequenceNumber, int inputDelta, int flags)
          Constructs a JSampleBuffer referencing the data in the given byte array between indices 0 and %length.
JSampleBuffer(DSMediaType mtype, byte[] d, int offset, int last, int time, int sequenceNumber, int inputDelta, int flags)
          Constructs a JSampleBuffer with the given media type by copying data from indices %offset to %last of %d (so that the resulting sample length as returned by getSampleLength() = last-offset) into a newly allocated byte[].
 
Method Summary
 JSampleBuffer copy()
           
protected  void finalize()
           
 byte[] getSample()
          Returns the actual sample data.
 void setMaxInMemorySize(int kb)
           
 void setMediaType(DSMediaType mt)
           
 void setSample(byte[] d)
           
 void setSampleFlags(int f)
           
 void setSampleTime(int t)
           
 void setUserData(int iUser)
           
 
Methods inherited from class de.humatic.dsj.SampleBuffer
getDeltaTime, getMediaType, getSampleFlags, getSampleLength, getSampleTime, getSequenceNumber, getUserData, setDeltaTime, setSampleLength
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSampleBuffer

public JSampleBuffer(byte[] d,
                     int offset,
                     int last,
                     int time,
                     int sequenceNumber,
                     int inputDelta,
                     int flags)
Constructs a JSampleBuffer by copying data from indices %offset to %last of %d (so that the resulting sample length as returned by getSampleLength() = last-offset) into a newly allocated byte[]. Samples larger than the set maximum in memory size (def.: 128k) will be written to temp files.


JSampleBuffer

public JSampleBuffer(DSMediaType mtype,
                     byte[] d,
                     int offset,
                     int last,
                     int time,
                     int sequenceNumber,
                     int inputDelta,
                     int flags)
Constructs a JSampleBuffer with the given media type by copying data from indices %offset to %last of %d (so that the resulting sample length as returned by getSampleLength() = last-offset) into a newly allocated byte[]. Samples larger than the set maximum in memory size (def.: 128k) will be written to temp files.


JSampleBuffer

public JSampleBuffer(DSMediaType mtype,
                     byte[] headers,
                     byte[] d,
                     int offset,
                     int last,
                     int time,
                     int sequenceNumber,
                     int inputDelta,
                     int flags)

JSampleBuffer

public JSampleBuffer(DSMediaType mtype,
                     byte[] d,
                     int length,
                     int time,
                     int sequenceNumber,
                     int inputDelta,
                     int flags)
Constructs a JSampleBuffer referencing the data in the given byte array between indices 0 and %length. No data will be copied.


JSampleBuffer

public JSampleBuffer(DSMediaType mtype,
                     byte[] d)
Constructs a JSampleBuffer referencing all data in the given byte array. No data will be copied.

Method Detail

getSample

public byte[] getSample()
Description copied from class: SampleBuffer
Returns the actual sample data.

Overrides:
getSample in class SampleBuffer

setSample

public void setSample(byte[] d)

setSampleTime

public void setSampleTime(int t)

setSampleFlags

public void setSampleFlags(int f)

setMediaType

public void setMediaType(DSMediaType mt)

setUserData

public void setUserData(int iUser)

setMaxInMemorySize

public void setMaxInMemorySize(int kb)

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

copy

public JSampleBuffer copy()