001/* ----------------------------------------------------------------------------
002 * This file was automatically generated by SWIG (http://www.swig.org).
003 * Version 4.0.2
004 *
005 * Do not make changes to this file unless you know what you are doing--modify
006 * the SWIG interface file instead.
007 * ----------------------------------------------------------------------------- */
008
009package com.avpkit.core;
010import com.avpkit.ferry.*;
011/**
012 * A collection of static functions that refer to the entire package (like version getters).
013 */
014public class Global extends RefCounted {
015  // JNIHelper.swg: Start generated code
016  // >>>>>>>>>>>>>>>>>>>>>>>>>>>
017  /**
018   * This method is only here to use some references and remove
019   * a Eclipse compiler warning.
020   */
021  @SuppressWarnings("unused")
022  private void noop()
023  {
024    IBuffer.make(null, 1);
025  }
026   
027  private volatile long swigCPtr;
028
029  /**
030   * Internal Only.
031   */
032  protected Global(long cPtr, boolean cMemoryOwn) {
033    super(AVPKitJNI.Global_SWIGUpcast(cPtr), cMemoryOwn);
034    swigCPtr = cPtr;
035  }
036  
037  /**
038   * Internal Only.
039   */
040  protected Global(long cPtr, boolean cMemoryOwn,
041      java.util.concurrent.atomic.AtomicLong ref)
042  {
043    super(AVPKitJNI.Global_SWIGUpcast(cPtr),
044     cMemoryOwn, ref);
045    swigCPtr = cPtr;
046  }
047    
048  /**
049   * Internal Only.  Not part of public API.
050   *
051   * Get the raw value of the native object that obj is proxying for.
052   *   
053   * @param obj The java proxy object for a native object.
054   * @return The raw pointer obj is proxying for.
055   */
056  public static long getCPtr(Global obj) {
057    if (obj == null) return 0;
058    return obj.getMyCPtr();
059  }
060
061  /**
062   * Internal Only.  Not part of public API.
063   *
064   * Get the raw value of the native object that we're proxying for.
065   *   
066   * @return The raw pointer we're proxying for.
067   */  
068  public long getMyCPtr() {
069    if (swigCPtr == 0) throw new IllegalStateException("underlying native object already deleted");
070    return swigCPtr;
071  }
072  
073  /**
074   * Create a new Global object that is actually referring to the
075   * exact same underlying native object.
076   *
077   * @return the new Java object.
078   */
079  @Override
080  public Global copyReference() {
081    if (swigCPtr == 0)
082      return null;
083    else
084      return new Global(swigCPtr, swigCMemOwn, getJavaRefCount());
085  }
086
087  /**
088   * Compares two values, returning true if the underlying objects in native code are the same object.
089   *
090   * That means you can have two different Java objects, but when you do a comparison, you'll find out
091   * they are the EXACT same object.
092   *
093   * @return True if the underlying native object is the same.  False otherwise.
094   */
095  public boolean equals(Object obj) {
096    boolean equal = false;
097    if (obj instanceof Global)
098      equal = (((Global)obj).swigCPtr == this.swigCPtr);
099    return equal;
100  }
101  
102  /**
103   * Get a hashable value for this object.
104   *
105   * @return the hashable value.
106   */
107  public int hashCode() {
108     return (int)swigCPtr;
109  }
110  
111  // <<<<<<<<<<<<<<<<<<<<<<<<<<<
112  // JNIHelper.swg: End generated code
113  
114
115  /**
116   * The default unit of time that {@link IAudioSamples} and
117   * {@link IVideoPicture} time stamps are represented in.
118   */
119  public static final java.util.concurrent.TimeUnit DEFAULT_TIME_UNIT =
120    java.util.concurrent.TimeUnit.MICROSECONDS;
121
122  /**
123   * Returns a 64 bit version number for this library.<br>
124   * <br>
125   * @return a 64-bit integer version number for this library.  The top 16 bits is<br>
126   * the {#getVersionMajor()} value.  The next 16-bits are the {#getVersionMinor()}<br>
127   * value, and the last 32-bits are the {#getVersionRevision()} value.
128   */
129  public static long getVersion() {
130    return AVPKitJNI.Global_getVersion();
131  }
132
133  /**
134   * Get the major version number of this library.<br>
135   * @return the major version number of this library or 0 if unknown.
136   */
137  public static int getVersionMajor() {
138    return AVPKitJNI.Global_getVersionMajor();
139  }
140
141  /**
142   * Get the minor version number of this library.<br>
143   * @return the minor version number of this library or 0 if unknown.
144   */
145  public static int getVersionMinor() {
146    return AVPKitJNI.Global_getVersionMinor();
147  }
148
149  /**
150   * Get the revision number of this library.<br>
151   * @return the revision number of this library, or 0 if unknown.
152   */
153  public static int getVersionRevision() {
154    return AVPKitJNI.Global_getVersionRevision();
155  }
156
157  /**
158   * Get a string representation of the version of this library.<br>
159   * @return the version of this library in string form.
160   */
161  public static String getVersionStr() {
162    return AVPKitJNI.Global_getVersionStr();
163  }
164
165  /**
166   * Get the version of the FFMPEG libavformat library we are compiled against.<br>
167   * @return the version.
168   */
169  public static int getAVFormatVersion() {
170    return AVPKitJNI.Global_getAVFormatVersion();
171  }
172
173  /**
174   * Get the version of the FFMPEG libavformat library we are compiled against.<br>
175   * @return the version.
176   */
177  public static String getAVFormatVersionStr() {
178    return AVPKitJNI.Global_getAVFormatVersionStr();
179  }
180
181  /**
182   * Get the version of the FFMPEG libavcodec library we are compiled against.<br>
183   * @return the version.
184   */
185  public static int getAVCodecVersion() {
186    return AVPKitJNI.Global_getAVCodecVersion();
187  }
188
189  /**
190   * Get the version of the FFMPEG libavcodec library we are compiled against.<br>
191   * @return the version.
192   */
193  public static String getAVCodecVersionStr() {
194    return AVPKitJNI.Global_getAVCodecVersionStr();
195  }
196
197  /**
198   * Internal Only.  Do not call.<br>
199   * Methods using the C++ interface that will not necessarily<br>
200   * create other Global object should call this.  In general,<br>
201   * unless you're extending core directly yourself, ordinary<br>
202   * users of this library don't need to call this.<br>
203   * <p><br>
204   * It's main purpose is to ensure any FFmpeg required environment<br>
205   * initialization functions are called, and any AVPKit required<br>
206   * environmental contexts are set up.<br>
207   * </p>
208   */
209  public static void init() {
210    AVPKitJNI.Global_init();
211  }
212
213  /**
214   * Internal Only.  This method can be used to turn up or<br>
215   * down FFmpeg's logging level.<br>
216   * @param level An integer value for level.  Lower numbers<br>
217   *   mean less logging.  A negative number tells FFmpeg to<br>
218   *   shut up.
219   */
220  public static void setFFmpegLoggingLevel(int level) {
221    AVPKitJNI.Global_setFFmpegLoggingLevel(level);
222  }
223
224  /**
225   * A value that means no time stamp is set for a given object.<br>
226   * if the {IMediaData#getTimeStamp()} method of an<br>
227   * object returns this value it means the time stamp wasn't set.
228   */
229  public final static long NO_PTS = AVPKitJNI.Global_NO_PTS_get();
230  /**
231   * The default time units per second that we use for decoded<br>
232   * {IAudioSamples} and {IVideoPicture} objects. <br>
233   * <br>
234   * This means that 1 tick of a time stamp is 1 Microsecond.
235   */
236  public final static long DEFAULT_PTS_PER_SECOND = AVPKitJNI.Global_DEFAULT_PTS_PER_SECOND_get();
237}