io.humble.video.MediaSubtitle Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of humble-video-noarch Show documentation
Show all versions of humble-video-noarch Show documentation
This is the main Humble Video Java library. It contains no native code, but all Java runtime code.
It must be paired up with the correct humble-video-arch-*.jar library for your OS. For most
users, depending on humble-video-all will work better.
The newest version!
/* ----------------------------------------------------------------------------
* This file was automatically generated by SWIG (http://www.swig.org).
* Version 2.0.6
*
* Do not make changes to this file unless you know what you are doing--modify
* the SWIG interface file instead.
* ----------------------------------------------------------------------------- */
package io.humble.video;
import io.humble.ferry.*;
/**
* NOT CURRENTLY USED.
*/
public class MediaSubtitle extends MediaRaw {
// JNIHelper.swg: Start generated code
// >>>>>>>>>>>>>>>>>>>>>>>>>>>
/**
* This method is only here to use some references and remove
* a Eclipse compiler warning.
*/
@SuppressWarnings("unused")
private void noop()
{
Buffer.make(null, 1);
}
private volatile long swigCPtr;
/**
* Internal Only.
*/
protected MediaSubtitle(long cPtr, boolean cMemoryOwn) {
super(VideoJNI.MediaSubtitle_SWIGUpcast(cPtr), cMemoryOwn);
swigCPtr = cPtr;
}
/**
* Internal Only.
*/
protected MediaSubtitle(long cPtr, boolean cMemoryOwn,
java.util.concurrent.atomic.AtomicLong ref)
{
super(VideoJNI.MediaSubtitle_SWIGUpcast(cPtr),
cMemoryOwn, ref);
swigCPtr = cPtr;
}
/**
* Internal Only. Not part of public API.
*
* Get the raw value of the native object that obj is proxying for.
*
* @param obj The java proxy object for a native object.
* @return The raw pointer obj is proxying for.
*/
protected static long getCPtr(MediaSubtitle obj) {
if (obj == null) return 0;
return obj.getMyCPtr();
}
/**
* Internal Only. Not part of public API.
*
* Get the raw value of the native object that we're proxying for.
*
* @return The raw pointer we're proxying for.
*/
protected long getMyCPtr() {
if (swigCPtr == 0) throw new IllegalStateException("underlying native object already deleted");
return swigCPtr;
}
/**
* Create a new MediaSubtitle object that is actually referring to the
* exact same underlying native object.
*
* @return the new Java object.
*/
@Override
public MediaSubtitle copyReference() {
if (swigCPtr == 0)
return null;
else
return new MediaSubtitle(swigCPtr, swigCMemOwn, getJavaRefCount());
}
/**
* 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.
*
* @return True if the underlying native object is the same. False otherwise.
*/
public boolean equals(Object obj) {
boolean equal = false;
if (obj instanceof MediaSubtitle)
equal = (((MediaSubtitle)obj).swigCPtr == this.swigCPtr);
return equal;
}
/**
* Get a hashable value for this object.
*
* @return the hashable value.
*/
public int hashCode() {
return (int)swigCPtr;
}
// <<<<<<<<<<<<<<<<<<<<<<<<<<<
// JNIHelper.swg: End generated code
public int getFormat() {
return VideoJNI.MediaSubtitle_getFormat(swigCPtr, this);
}
/**
* Get the start display time in ms, relative to the #getTimeStamp().
*/
public long getStartDisplayTime() {
return VideoJNI.MediaSubtitle_getStartDisplayTime(swigCPtr, this);
}
/**
* Get the end display time in ms, relative to #getTimeStamp().
*/
public long getEndDisplayTime() {
return VideoJNI.MediaSubtitle_getEndDisplayTime(swigCPtr, this);
}
/**
* Get the number of rectangles this subtitle draws
*/
public int getNumRectangles() {
return VideoJNI.MediaSubtitle_getNumRectangles(swigCPtr, this);
}
/**
* Get the presentation timestamp of this subtitle
*/
public long getTimeStamp() {
return VideoJNI.MediaSubtitle_getTimeStamp(swigCPtr, this);
}
public MediaSubtitleRectangle getRectangle(int n) {
long cPtr = VideoJNI.MediaSubtitle_getRectangle(swigCPtr, this, n);
return (cPtr == 0) ? null : new MediaSubtitleRectangle(cPtr, false);
}
public void setTimeStamp(long timeStamp) {
VideoJNI.MediaSubtitle_setTimeStamp(swigCPtr, this, timeStamp);
}
public boolean isKey() {
return VideoJNI.MediaSubtitle_isKey(swigCPtr, this);
}
public long getPts() {
return VideoJNI.MediaSubtitle_getPts(swigCPtr, this);
}
public long getPacketPts() {
return VideoJNI.MediaSubtitle_getPacketPts(swigCPtr, this);
}
public long getPacketDts() {
return VideoJNI.MediaSubtitle_getPacketDts(swigCPtr, this);
}
public int getPacketSize() {
return VideoJNI.MediaSubtitle_getPacketSize(swigCPtr, this);
}
public long getPacketDuration() {
return VideoJNI.MediaSubtitle_getPacketDuration(swigCPtr, this);
}
public long getBestEffortTimeStamp() {
return VideoJNI.MediaSubtitle_getBestEffortTimeStamp(swigCPtr, this);
}
public boolean isComplete() {
return VideoJNI.MediaSubtitle_isComplete(swigCPtr, this);
}
/**
* Sets the subtitle to be complete.
*/
public void setComplete(boolean complete, long timestamp) {
VideoJNI.MediaSubtitle_setComplete__SWIG_0(swigCPtr, this, complete, timestamp);
}
public void setComplete(boolean complete) {
VideoJNI.MediaSubtitle_setComplete__SWIG_1(swigCPtr, this, complete);
}
public enum Type {
SUBTITLE_NONE,
/**
* A bitmap.
*/
SUBTITLE_BITMAP,
/**
* Plain text, the text field must be set by the decoder and is
* authoritative. ass and pict fields may contain approximations.
*/
SUBTITLE_TEXT,
/**
* Formatted text, the ass field must be set by the decoder and is
* authoritative. pict and text fields may contain approximations.
*/
SUBTITLE_ASS,
;
public final int swigValue() {
return swigValue;
}
public static Type swigToEnum(int swigValue) {
Type[] swigValues = Type.class.getEnumConstants();
if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
return swigValues[swigValue];
for (Type swigEnum : swigValues)
if (swigEnum.swigValue == swigValue)
return swigEnum;
throw new IllegalArgumentException("No enum " + Type.class + " with value " + swigValue);
}
@SuppressWarnings("unused")
private Type() {
this.swigValue = SwigNext.next++;
}
@SuppressWarnings("unused")
private Type(int swigValue) {
this.swigValue = swigValue;
SwigNext.next = swigValue+1;
}
@SuppressWarnings("unused")
private Type(Type swigEnum) {
this.swigValue = swigEnum.swigValue;
SwigNext.next = this.swigValue+1;
}
private final int swigValue;
private static class SwigNext {
private static int next = 0;
}
}
}