Package com.avpkit.core
Class IMediaDataWrapper
- java.lang.Object
-
- com.avpkit.ferry.RefCounted
-
- com.avpkit.core.IMediaData
-
- com.avpkit.core.IMediaDataWrapper
-
public class IMediaDataWrapper extends IMediaData
This class wraps an IMediaData object, but then allows you to set
new TimeStamps and TimeBases.
The underlying wrapped object's time stamps and time bases do not change. This
can be useful when you need to use a IMediaObject in a time space that has
different time bases than the frame originally expected, and you don't
want to change the actual object.
-
-
Field Summary
-
Fields inherited from class com.avpkit.core.IMediaData
DEFAULT_TIME_STAMP_FORMAT
-
Fields inherited from class com.avpkit.ferry.RefCounted
swigCMemOwn
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedIMediaDataWrapper(long cPtr, boolean cMemoryOwn)Internal Only.protectedIMediaDataWrapper(long cPtr, boolean cMemoryOwn, java.util.concurrent.atomic.AtomicLong ref)Internal Only.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IMediaDataWrappercopyReference()Create a new IMediaDataWrapper object that is actually referring to the exact same underlying native object.booleanequals(java.lang.Object obj)Compares two values, returning true if the underlying objects in native code are the same object.IMediaDataget()Return the object being wrappedprotected IAudioSamplesgetAudioSamples()static longgetCPtr(IMediaDataWrapper obj)Internal Only.protected IMediaDataWrappergetMediaDataWrapper()longgetMyCPtr()Internal Only.protected IPacketgetPacket()protected IVideoPicturegetVideoPicture()inthashCode()Get a hashable value for this object.static IMediaDataWrappermake(IMediaData obj)Create a new IMediaDataWrapper object that wraps the given obj.
voidsetKey(boolean aIsKey)Allows you to reset whether the wrapper things this is key or not.
Note the underlying wrapped object will continue to keep it's prior setting.
IMediaDataunwrap()Gets the non IMediaDataWrapper object ultimately wrapped in this wrapper, or null if there isn't one.protected IAudioSamplesunwrapAudioSamples()protected IMediaDataWrapperunwrapMediaDataWrapper()protected IPacketunwrapPacket()protected IVideoPictureunwrapVideoPicture()voidwrap(IMediaData aObj)Set an object to wrap, or null to release the old object.
-
Methods inherited from class com.avpkit.core.IMediaData
delete, get, get, get, get, get, get, get, getByteBuffer, getByteBuffer, getCPtr, getData, getData_internal, getDataCached, getFormattedTimeStamp, getFormattedTimeStamp, getSize, getTimeBase, getTimeStamp, isKey, put, put, put, put, put, put, put, setData, setData_internal, setTimeBase, setTimeStamp
-
Methods inherited from class com.avpkit.ferry.RefCounted
acquire, getCPtr, getCurrentRefCount, getJavaRefCount, release
-
-
-
-
Constructor Detail
-
IMediaDataWrapper
protected IMediaDataWrapper(long cPtr, boolean cMemoryOwn)
Internal Only.
-
IMediaDataWrapper
protected IMediaDataWrapper(long cPtr, boolean cMemoryOwn, java.util.concurrent.atomic.AtomicLong ref)
Internal Only.
-
-
Method Detail
-
getCPtr
public static long getCPtr(IMediaDataWrapper obj)
Internal Only. Not part of public API. Get the raw value of the native object that obj is proxying for.- Parameters:
obj- The java proxy object for a native object.- Returns:
- The raw pointer obj is proxying for.
-
getMyCPtr
public long getMyCPtr()
Internal Only. Not part of public API. Get the raw value of the native object that we're proxying for.- Overrides:
getMyCPtrin classIMediaData- Returns:
- The raw pointer we're proxying for.
-
copyReference
public IMediaDataWrapper copyReference()
Create a new IMediaDataWrapper object that is actually referring to the exact same underlying native object.- Overrides:
copyReferencein classIMediaData- Returns:
- the new Java object.
-
equals
public boolean equals(java.lang.Object obj)
Compares two values, returning true if the underlying objects in native code are the same object. That means you can have two different Java objects, but when you do a comparison, you'll find out they are the EXACT same object.- Overrides:
equalsin classIMediaData- Returns:
- True if the underlying native object is the same. False otherwise.
-
hashCode
public int hashCode()
Get a hashable value for this object.- Overrides:
hashCodein classIMediaData- Returns:
- the hashable value.
-
get
public IMediaData get()
Return the object being wrapped- Returns:
- the wrapped object
-
unwrap
public IMediaData unwrap()
Gets the non IMediaDataWrapper object ultimately wrapped in this wrapper, or null if there isn't one.- Returns:
- The non IMediaDataWrapper object ultimately wrapped
-
wrap
public void wrap(IMediaData aObj)
Set an object to wrap, or null to release the old object.
- Parameters:
aObj- The object to wrap; null just releases the last object
-
setKey
public void setKey(boolean aIsKey)
Allows you to reset whether the wrapper things this is key or not.
Note the underlying wrapped object will continue to keep it's prior setting.
- Parameters:
aIsKey- The new key value.
-
make
public static IMediaDataWrapper make(IMediaData obj)
Create a new IMediaDataWrapper object that wraps the given obj.
- Parameters:
obj- The object to wrap.- Returns:
- a new object or null on error.
-
getAudioSamples
protected IAudioSamples getAudioSamples()
-
getVideoPicture
protected IVideoPicture getVideoPicture()
-
getMediaDataWrapper
protected IMediaDataWrapper getMediaDataWrapper()
-
unwrapPacket
protected IPacket unwrapPacket()
-
unwrapAudioSamples
protected IAudioSamples unwrapAudioSamples()
-
unwrapVideoPicture
protected IVideoPicture unwrapVideoPicture()
-
unwrapMediaDataWrapper
protected IMediaDataWrapper unwrapMediaDataWrapper()
-
-