/* ----------------------------------------------------------------------------
 * 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.*;
/**
 * A codec that can be used either to encode raw data into compressed bitstreams,

 * or decode compressed data into raw data, or both!
 */
public class Codec extends RefCounted {
  // 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 Codec(long cPtr, boolean cMemoryOwn) {
    super(VideoJNI.Codec_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  /**
   * Internal Only.
   */
  protected Codec(long cPtr, boolean cMemoryOwn,
      java.util.concurrent.atomic.AtomicLong ref)
  {
    super(VideoJNI.Codec_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(Codec 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 Codec object that is actually referring to the
   * exact same underlying native object.
   *
   * @return the new Java object.
   */
  @Override
  public Codec copyReference() {
    if (swigCPtr == 0)
      return null;
    else
      return new Codec(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 Codec)
      equal = (((Codec)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

  /**
   * Prints the type and id of this codec
   * @return the type and id
   */

  @Override
  public String toString()
  {
    StringBuilder result = new StringBuilder();

    result.append(this.getClass().getName()+"@"+hashCode()+"[");
    result.append("type="+getType()+";");
    result.append("id="+getID()+";");
    result.append("name="+getName()+";");
    result.append("]");
    return result.toString();
  }

  /**
   * Gets a collection of ALL codecs installed on this
   * system.
   *
   * @return A collection of all installed codecs.
   */

  public static java.util.Collection<Codec>
  getInstalledCodecs()
  {
    java.util.Collection<Codec> retval = new java.util.HashSet<Codec>();
    int count = getNumInstalledCodecs();
    for(int i=0;i<count;i++)
    {
      Codec codec = getInstalledCodec(i);
      if (codec != null)
        retval.add(codec);
    }
    return retval;
  }

  /**
   * Returns a list of supported frame-rates this codec can encode
   * video to.
   *
   *

   *
   * Not all codecs support reporting this, in which case the returned list
   * will be empty.
   *
   *

   *
   * @return a list
   */

  public java.util.Collection<Rational>
  getSupportedVideoFrameRates()
  {
    java.util.List<Rational> retval =
      new java.util.LinkedList<Rational>();
    int count = getNumSupportedVideoFrameRates();
    for(int i=0;i<count;i++)
    {
      Rational rate = getSupportedVideoFrameRate(i);
      if (rate != null)
        retval.add(rate);
    }
    return retval;
  }

  /**
   * Returns a list of supported pixel formats this codec can encode
   * video in.
   *
   *

   *
   * Not all codecs support reporting this, in which case the returned list
   * will be empty.
   *
   *

   *
   * @return a list
   */

  public java.util.Collection<PixelFormat.Type>
  getSupportedVideoPixelFormats()
  {
    java.util.List<PixelFormat.Type> retval =
      new java.util.LinkedList<PixelFormat.Type>();
    int count = getNumSupportedVideoPixelFormats();
    for(int i=0;i<count;i++)
    {
      PixelFormat.Type type = getSupportedVideoPixelFormat(i);
      if (type != null && type != PixelFormat.Type.PIX_FMT_NONE)
        retval.add(type);
    }
    return retval;
  }

  /**
   * Returns a list of supported audio sample rates this codec can encode
   * audio in.
   *
   *

   *
   * Not all codecs support reporting this, in which case the returned list
   * will be empty.
   *
   *

   *
   * @return a list
   */

  public java.util.Collection<Integer>
  getSupportedAudioSampleRates()
  {
    java.util.List<Integer> retval =
      new java.util.LinkedList<Integer>();
    int count = getNumSupportedAudioSampleRates();
    for(int i=0;i<count;i++)
    {
      int rate = getSupportedAudioSampleRate(i);
      if (rate != 0)
        retval.add(rate);
    }
    return retval;
  }

  /**
   * Returns a list of supported audio sample formats this codec can encode
   * audio in.
   *
   *

   *
   * Not all codecs support reporting this, in which case the returned list
   * will be empty.
   *
   *

   *
   * @return a list
   */

  public java.util.Collection<AudioFormat.Type>
  getSupportedAudioFormats()
  {
    java.util.List<AudioFormat.Type> retval =
      new java.util.LinkedList<AudioFormat.Type>();
    int count = getNumSupportedAudioFormats();
    for(int i=0;i<count;i++)
    {
      AudioFormat.Type fmt = getSupportedAudioFormat(i);
      if (fmt != null && fmt != AudioFormat.Type.SAMPLE_FMT_NONE)
        retval.add(fmt);
    }
    return retval;
  }

  /**
   * Returns a list of supported audio channel layouts this codec can encode
   * audio in.
   *
   *

   *
   * Not all codecs support reporting this, in which case the returned list
   * will be empty.
   *
   *

   *
   * @return a list
   */

  public java.util.Collection<AudioChannel.Layout>
  getSupportedAudioChannelLayouts()
  {
    java.util.List<AudioChannel.Layout> retval =
      new java.util.LinkedList<AudioChannel.Layout>();
    int count = getNumSupportedAudioChannelLayouts();
    for(int i=0;i<count;i++)
    {
      AudioChannel.Layout layout = getSupportedAudioChannelLayout(i);
      if (layout != AudioChannel.Layout.CH_LAYOUT_UNKNOWN)
        retval.add(layout);
    }
    return retval;
  }

/**
 * Checks if this codec has the given capability.

 * @param c Capability to check.
 */
  public boolean hasCapability(Codec.CodecCapability c) {
    return VideoJNI.Codec_hasCapability(swigCPtr, this, c.swigValue());
  }

/**
 * Get a bitmask of the supported CodecCapability flags.
 */
  public int getCapabilities() {
    return VideoJNI.Codec_getCapabilities(swigCPtr, this);
  }

/**
 * Get the name of the codec.

 * @return The name of this Codec.
 */
  public String getName() {
    return VideoJNI.Codec_getName(swigCPtr, this);
  }

/**
 * Get the ID of this codec, as an integer.

 * @return the ID of this codec, as an integer.
 */
  public int getIDAsInt() {
    return VideoJNI.Codec_getIDAsInt(swigCPtr, this);
  }

/**
 * Get the ID of this codec as an enumeration.

 * @return the ID of this codec, an enum ID
 */
  public Codec.ID getID() {
    return Codec.ID.swigToEnum(VideoJNI.Codec_getID(swigCPtr, this));
  }

/**
 * Get the type of this codec.

 * @return The type of this Codec, as a enum Type
 */
  public MediaDescriptor.Type getType() {
    return MediaDescriptor.Type.swigToEnum(VideoJNI.Codec_getType(swigCPtr, this));
  }

/**
 * Can this codec be used for decoding?

 * @return Can this Codec decode?
 */
  public boolean canDecode() {
    return VideoJNI.Codec_canDecode(swigCPtr, this);
  }

/**
 * Can this codec be used for encoding?

 * @return Can this Codec encode?
 */
  public boolean canEncode() {
    return VideoJNI.Codec_canEncode(swigCPtr, this);
  }

/**
 * Find a codec that can be used for encoding.

 * @param id The id of the codec

 * @return the codec, or null if we can't find it.
 */
  public static Codec findEncodingCodec(Codec.ID id) {
    long cPtr = VideoJNI.Codec_findEncodingCodec(id.swigValue());
    return (cPtr == 0) ? null : new Codec(cPtr, false);
  }

/**
 * Find a codec that can be used for encoding.

 * @param id The id of the codec, as an integer.

 * @return the codec, or null if we can't find it.
 */
  public static Codec findEncodingCodecByIntID(int id) {
    long cPtr = VideoJNI.Codec_findEncodingCodecByIntID(id);
    return (cPtr == 0) ? null : new Codec(cPtr, false);
  }

/**
 * Find a codec that can be used for encoding.

 * @param id The id of the codec, as a FFMPEG short-name string

 *   (for example, "mpeg4").

 * @return the codec, or null if we can't find it.
 */
  public static Codec findEncodingCodecByName(String id) {
    long cPtr = VideoJNI.Codec_findEncodingCodecByName(id);
    return (cPtr == 0) ? null : new Codec(cPtr, false);
  }

/**
 * Find a codec that can be used for decoding.

 * @param id The id of the codec

 * @return the codec, or null if we can't find it.
 */
  public static Codec findDecodingCodec(Codec.ID id) {
    long cPtr = VideoJNI.Codec_findDecodingCodec(id.swigValue());
    return (cPtr == 0) ? null : new Codec(cPtr, false);
  }

/**
 * Find a codec that can be used for decoding.

 * @param id The id of the codec, as an integer

 * @return the codec, or null if we can't find it.
 */
  public static Codec findDecodingCodecByIntID(int id) {
    long cPtr = VideoJNI.Codec_findDecodingCodecByIntID(id);
    return (cPtr == 0) ? null : new Codec(cPtr, false);
  }

/**
 * Find a codec that can be used for decoding.

 * @param id The id of the codec, as a FFMPEG short-name string

 *   (for example, "mpeg4")

 * @return the codec, or null if we can't find it.
 */
  public static Codec findDecodingCodecByName(String id) {
    long cPtr = VideoJNI.Codec_findDecodingCodecByName(id);
    return (cPtr == 0) ? null : new Codec(cPtr, false);
  }

/**
 * Ask us to guess an encoding codec based on the inputs

 * passed in.

 *

 * You must pass in at least one non null fmt, shortName,

 * url or mime_type.

 *

 * @param fmt A SinkFormat for the container you'll want to encode into.

 * @param shortName The FFMPEG short name of the codec (e.g. "mpeg4").

 * @param url The URL you'll be writing packets to.

 * @param mimeType The mime type of the container.

 * @param type The codec type.

 * @return the codec, or null if we can't find it.
 */
  public static Codec guessEncodingCodec(MuxerFormat fmt, String shortName, String url, String mimeType, MediaDescriptor.Type type) {
    long cPtr = VideoJNI.Codec_guessEncodingCodec(MuxerFormat.getCPtr(fmt), fmt, shortName, url, mimeType, type.swigValue());
    return (cPtr == 0) ? null : new Codec(cPtr, false);
  }

/**
 * Get the long name for this codec.

 *

 * @return the long name.
 */
  public String getLongName() {
    return VideoJNI.Codec_getLongName(swigCPtr, this);
  }

/**
 * Capability flags

 *

 * Get the number of installed codecs on this system.

 * @return the number of installed codecs.
 */
  public static int getNumInstalledCodecs() {
    return VideoJNI.Codec_getNumInstalledCodecs();
  }

/**
 * Get the ICodec at the given index.

 *

 * @param index the index in our list

 *

 * @return the codec, or null if index < 0 or index >=

 *   #getNumInstalledCodecs()
 */
  public static Codec getInstalledCodec(int index) {
    long cPtr = VideoJNI.Codec_getInstalledCodec(index);
    return (cPtr == 0) ? null : new Codec(cPtr, false);
  }

/**
 * Get the number of frame rates this codec supports for encoding.

 * Not all codecs will report this number.

 * @return the number or 0 if we don't know.
 */
  public int getNumSupportedVideoFrameRates() {
    return VideoJNI.Codec_getNumSupportedVideoFrameRates(swigCPtr, this);
  }

/**
 * Return the supported frame rate at the given index.

 *

 * @param index the index in our list.

 *

 * @return the frame rate, or null if unknown, if index <0 or

 *   if index >= #getNumSupportedVideoFrameRates()
 */
  public Rational getSupportedVideoFrameRate(int index) {
    long cPtr = VideoJNI.Codec_getSupportedVideoFrameRate(swigCPtr, this, index);
    return (cPtr == 0) ? null : new Rational(cPtr, false);
  }

/**
 * Get the number of supported video pixel formats this codec supports

 * for encoding.  Not all codecs will report this.

 *

 * @return the number or 0 if we don't know.
 */
  public int getNumSupportedVideoPixelFormats() {
    return VideoJNI.Codec_getNumSupportedVideoPixelFormats(swigCPtr, this);
  }

/**
 * Return the supported video pixel format at the given index.

 *

 * @param index the index in our list.

 *

 * @return the pixel format, or IPixelFormat.Type#NONE if unknown,

 *   if index <0 or

 *   if index >= #getNumSupportedVideoPixelFormats()
 */
  public PixelFormat.Type getSupportedVideoPixelFormat(int index) {
    return PixelFormat.Type.swigToEnum(VideoJNI.Codec_getSupportedVideoPixelFormat(swigCPtr, this, index));
  }

/**
 * Get the number of different audio sample rates this codec supports

 * for encoding.  Not all codecs will report this.

 *

 * @return the number or 0 if we don't know.
 */
  public int getNumSupportedAudioSampleRates() {
    return VideoJNI.Codec_getNumSupportedAudioSampleRates(swigCPtr, this);
  }

/**
 * Return the support audio sample rate at the given index.

 *

 * @param index the index in our list.

 *

 * @return the sample rate, or 0 if unknown, index < 0 or

 *   index >= #getNumSupportedAudioSampleRates()
 */
  public int getSupportedAudioSampleRate(int index) {
    return VideoJNI.Codec_getSupportedAudioSampleRate(swigCPtr, this, index);
  }

/**
 * Get the number of different audio sample formats this codec supports

 * for encoding.  Not all codecs will report this.

 *

 * @return the number or 0 if we don't know.
 */
  public int getNumSupportedAudioFormats() {
    return VideoJNI.Codec_getNumSupportedAudioFormats(swigCPtr, this);
  }

/**
 * Get the supported sample format at this index.

 *

 * @param index the index in our list.

 *

 * @return the format, or AudioFormat.Type.SAMPLE_FMT_NONE if

 *   unknown, index < 0 or index >=

 *   #getNumSupportedAudioSampleFormats().
 */
  public AudioFormat.Type getSupportedAudioFormat(int index) {
    return AudioFormat.Type.swigToEnum(VideoJNI.Codec_getSupportedAudioFormat(swigCPtr, this, index));
  }

/**
 * Get the number of different audio channel layouts this codec supports

 * for encoding.  Not all codecs will report this.

 *

 *

 * @return the number or 0 if we don't know.
 */
  public int getNumSupportedAudioChannelLayouts() {
    return VideoJNI.Codec_getNumSupportedAudioChannelLayouts(swigCPtr, this);
  }

/**
 * Get the supported audio channel layout at this index.

 *

 * The value returned is a bit flag representing the different

 * types of audio layout this codec can support.  Test the values

 * by bit-comparing them to the AudioChannel.Layout

 * enum types.

 *

 * @param index the index

 *

 * @return the channel layout, or 0 if unknown, index < 0 or

 *   index >= #getNumSupportedAudioChannelLayouts.
 */
  public AudioChannel.Layout getSupportedAudioChannelLayout(int index) {
    return AudioChannel.Layout.swigToEnum(VideoJNI.Codec_getSupportedAudioChannelLayout(swigCPtr, this, index));
  }

/**
 * Get the number of supported CodecProfiles this codec

 * supports.
 */
  public int getNumSupportedProfiles() {
    return VideoJNI.Codec_getNumSupportedProfiles(swigCPtr, this);
  }

/**
 * Get the supported CodecProfile at this index.

 *

 * @param index the index

 * @return A CodecProfile, or null if unknown, index < 0

 *   or lindex >= #getNumSupportedProfiles.
 */
  public CodecProfile getSupportedProfile(int index) {
    long cPtr = VideoJNI.Codec_getSupportedProfile(swigCPtr, this, index);
    return (cPtr == 0) ? null : new CodecProfile(cPtr, false);
  }

  /**
   * When decoding, you can instruct streams to discard some

   * packets. The following table specifies which one.

   * Each subsequent enum value drops more packets than the prior.
   */
  public enum DiscardFlag {
  /**
   * Discard nothing.
   */
    DISCARD_NONE(VideoJNI.Codec_DISCARD_NONE_get()),
  /**
   * Discard useless packets like 0 size packets in avi.
   */
    DISCARD_DEFAULT(VideoJNI.Codec_DISCARD_DEFAULT_get()),
  /**
   * Discard all non reference
   */
    DISCARD_NONREF(VideoJNI.Codec_DISCARD_NONREF_get()),
  /**
   * Discard all bidirectional frames
   */
    DISCARD_BIDIR(VideoJNI.Codec_DISCARD_BIDIR_get()),
  /**
   * Discard all frames except keyframes
   */
    DISCARD_NONKEY(VideoJNI.Codec_DISCARD_NONKEY_get()),
  /**
   * discard all
   */
    DISCARD_ALL(VideoJNI.Codec_DISCARD_ALL_get()),
  ;

    public final int swigValue() {
      return swigValue;
    }

    public static DiscardFlag swigToEnum(int swigValue) {
      DiscardFlag[] swigValues = DiscardFlag.class.getEnumConstants();
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (DiscardFlag swigEnum : swigValues)
        if (swigEnum.swigValue == swigValue)
          return swigEnum;
      throw new IllegalArgumentException("No enum " + DiscardFlag.class + " with value " + swigValue);
    }

    @SuppressWarnings("unused")
    private DiscardFlag() {
      this.swigValue = SwigNext.next++;
    }

    @SuppressWarnings("unused")
    private DiscardFlag(int swigValue) {
      this.swigValue = swigValue;
      SwigNext.next = swigValue+1;
    }

    @SuppressWarnings("unused")
    private DiscardFlag(DiscardFlag swigEnum) {
      this.swigValue = swigEnum.swigValue;
      SwigNext.next = this.swigValue+1;
    }

    private final int swigValue;

    private static class SwigNext {
      private static int next = 0;
    }
  }

  /**
   * Identify the syntax and semantics of an audio or video encoded bitstream.

   * The principle is roughly:

   * Two decoders with the same ID can decode the same streams.

   * Two encoders with the same ID can encode compatible streams.

   * There may be slight deviations from the principle due to implementation

   * details.

   *

   * From Ffmpeg 2.8
   */
  public enum ID {
    CODEC_ID_NONE(VideoJNI.Codec_CODEC_ID_NONE_get()),
    CODEC_ID_MPEG1VIDEO(VideoJNI.Codec_CODEC_ID_MPEG1VIDEO_get()),
  /**
   * preferred ID for MPEG-1/2 video decoding
   */
    CODEC_ID_MPEG2VIDEO(VideoJNI.Codec_CODEC_ID_MPEG2VIDEO_get()),
    CODEC_ID_H261(VideoJNI.Codec_CODEC_ID_H261_get()),
    CODEC_ID_H263(VideoJNI.Codec_CODEC_ID_H263_get()),
    CODEC_ID_RV10(VideoJNI.Codec_CODEC_ID_RV10_get()),
    CODEC_ID_RV20(VideoJNI.Codec_CODEC_ID_RV20_get()),
    CODEC_ID_MJPEG(VideoJNI.Codec_CODEC_ID_MJPEG_get()),
    CODEC_ID_MJPEGB(VideoJNI.Codec_CODEC_ID_MJPEGB_get()),
    CODEC_ID_LJPEG(VideoJNI.Codec_CODEC_ID_LJPEG_get()),
    CODEC_ID_SP5X(VideoJNI.Codec_CODEC_ID_SP5X_get()),
    CODEC_ID_JPEGLS(VideoJNI.Codec_CODEC_ID_JPEGLS_get()),
    CODEC_ID_MPEG4(VideoJNI.Codec_CODEC_ID_MPEG4_get()),
    CODEC_ID_RAWVIDEO(VideoJNI.Codec_CODEC_ID_RAWVIDEO_get()),
    CODEC_ID_MSMPEG4V1(VideoJNI.Codec_CODEC_ID_MSMPEG4V1_get()),
    CODEC_ID_MSMPEG4V2(VideoJNI.Codec_CODEC_ID_MSMPEG4V2_get()),
    CODEC_ID_MSMPEG4V3(VideoJNI.Codec_CODEC_ID_MSMPEG4V3_get()),
    CODEC_ID_WMV1(VideoJNI.Codec_CODEC_ID_WMV1_get()),
    CODEC_ID_WMV2(VideoJNI.Codec_CODEC_ID_WMV2_get()),
    CODEC_ID_H263P(VideoJNI.Codec_CODEC_ID_H263P_get()),
    CODEC_ID_H263I(VideoJNI.Codec_CODEC_ID_H263I_get()),
    CODEC_ID_FLV1(VideoJNI.Codec_CODEC_ID_FLV1_get()),
    CODEC_ID_SVQ1(VideoJNI.Codec_CODEC_ID_SVQ1_get()),
    CODEC_ID_SVQ3(VideoJNI.Codec_CODEC_ID_SVQ3_get()),
    CODEC_ID_DVVIDEO(VideoJNI.Codec_CODEC_ID_DVVIDEO_get()),
    CODEC_ID_HUFFYUV(VideoJNI.Codec_CODEC_ID_HUFFYUV_get()),
    CODEC_ID_CYUV(VideoJNI.Codec_CODEC_ID_CYUV_get()),
    CODEC_ID_H264(VideoJNI.Codec_CODEC_ID_H264_get()),
    CODEC_ID_INDEO3(VideoJNI.Codec_CODEC_ID_INDEO3_get()),
    CODEC_ID_VP3(VideoJNI.Codec_CODEC_ID_VP3_get()),
    CODEC_ID_THEORA(VideoJNI.Codec_CODEC_ID_THEORA_get()),
    CODEC_ID_ASV1(VideoJNI.Codec_CODEC_ID_ASV1_get()),
    CODEC_ID_ASV2(VideoJNI.Codec_CODEC_ID_ASV2_get()),
    CODEC_ID_FFV1(VideoJNI.Codec_CODEC_ID_FFV1_get()),
    CODEC_ID_4XM(VideoJNI.Codec_CODEC_ID_4XM_get()),
    CODEC_ID_VCR1(VideoJNI.Codec_CODEC_ID_VCR1_get()),
    CODEC_ID_CLJR(VideoJNI.Codec_CODEC_ID_CLJR_get()),
    CODEC_ID_MDEC(VideoJNI.Codec_CODEC_ID_MDEC_get()),
    CODEC_ID_ROQ(VideoJNI.Codec_CODEC_ID_ROQ_get()),
    CODEC_ID_INTERPLAY_VIDEO(VideoJNI.Codec_CODEC_ID_INTERPLAY_VIDEO_get()),
    CODEC_ID_XAN_WC3(VideoJNI.Codec_CODEC_ID_XAN_WC3_get()),
    CODEC_ID_XAN_WC4(VideoJNI.Codec_CODEC_ID_XAN_WC4_get()),
    CODEC_ID_RPZA(VideoJNI.Codec_CODEC_ID_RPZA_get()),
    CODEC_ID_CINEPAK(VideoJNI.Codec_CODEC_ID_CINEPAK_get()),
    CODEC_ID_WS_VQA(VideoJNI.Codec_CODEC_ID_WS_VQA_get()),
    CODEC_ID_MSRLE(VideoJNI.Codec_CODEC_ID_MSRLE_get()),
    CODEC_ID_MSVIDEO1(VideoJNI.Codec_CODEC_ID_MSVIDEO1_get()),
    CODEC_ID_IDCIN(VideoJNI.Codec_CODEC_ID_IDCIN_get()),
    CODEC_ID_8BPS(VideoJNI.Codec_CODEC_ID_8BPS_get()),
    CODEC_ID_SMC(VideoJNI.Codec_CODEC_ID_SMC_get()),
    CODEC_ID_FLIC(VideoJNI.Codec_CODEC_ID_FLIC_get()),
    CODEC_ID_TRUEMOTION1(VideoJNI.Codec_CODEC_ID_TRUEMOTION1_get()),
    CODEC_ID_VMDVIDEO(VideoJNI.Codec_CODEC_ID_VMDVIDEO_get()),
    CODEC_ID_MSZH(VideoJNI.Codec_CODEC_ID_MSZH_get()),
    CODEC_ID_ZLIB(VideoJNI.Codec_CODEC_ID_ZLIB_get()),
    CODEC_ID_QTRLE(VideoJNI.Codec_CODEC_ID_QTRLE_get()),
    CODEC_ID_TSCC(VideoJNI.Codec_CODEC_ID_TSCC_get()),
    CODEC_ID_ULTI(VideoJNI.Codec_CODEC_ID_ULTI_get()),
    CODEC_ID_QDRAW(VideoJNI.Codec_CODEC_ID_QDRAW_get()),
    CODEC_ID_VIXL(VideoJNI.Codec_CODEC_ID_VIXL_get()),
    CODEC_ID_QPEG(VideoJNI.Codec_CODEC_ID_QPEG_get()),
    CODEC_ID_PNG(VideoJNI.Codec_CODEC_ID_PNG_get()),
    CODEC_ID_PPM(VideoJNI.Codec_CODEC_ID_PPM_get()),
    CODEC_ID_PBM(VideoJNI.Codec_CODEC_ID_PBM_get()),
    CODEC_ID_PGM(VideoJNI.Codec_CODEC_ID_PGM_get()),
    CODEC_ID_PGMYUV(VideoJNI.Codec_CODEC_ID_PGMYUV_get()),
    CODEC_ID_PAM(VideoJNI.Codec_CODEC_ID_PAM_get()),
    CODEC_ID_FFVHUFF(VideoJNI.Codec_CODEC_ID_FFVHUFF_get()),
    CODEC_ID_RV30(VideoJNI.Codec_CODEC_ID_RV30_get()),
    CODEC_ID_RV40(VideoJNI.Codec_CODEC_ID_RV40_get()),
    CODEC_ID_VC1(VideoJNI.Codec_CODEC_ID_VC1_get()),
    CODEC_ID_WMV3(VideoJNI.Codec_CODEC_ID_WMV3_get()),
    CODEC_ID_LOCO(VideoJNI.Codec_CODEC_ID_LOCO_get()),
    CODEC_ID_WNV1(VideoJNI.Codec_CODEC_ID_WNV1_get()),
    CODEC_ID_AASC(VideoJNI.Codec_CODEC_ID_AASC_get()),
    CODEC_ID_INDEO2(VideoJNI.Codec_CODEC_ID_INDEO2_get()),
    CODEC_ID_FRAPS(VideoJNI.Codec_CODEC_ID_FRAPS_get()),
    CODEC_ID_TRUEMOTION2(VideoJNI.Codec_CODEC_ID_TRUEMOTION2_get()),
    CODEC_ID_BMP(VideoJNI.Codec_CODEC_ID_BMP_get()),
    CODEC_ID_CSCD(VideoJNI.Codec_CODEC_ID_CSCD_get()),
    CODEC_ID_MMVIDEO(VideoJNI.Codec_CODEC_ID_MMVIDEO_get()),
    CODEC_ID_ZMBV(VideoJNI.Codec_CODEC_ID_ZMBV_get()),
    CODEC_ID_AVS(VideoJNI.Codec_CODEC_ID_AVS_get()),
    CODEC_ID_SMACKVIDEO(VideoJNI.Codec_CODEC_ID_SMACKVIDEO_get()),
    CODEC_ID_NUV(VideoJNI.Codec_CODEC_ID_NUV_get()),
    CODEC_ID_KMVC(VideoJNI.Codec_CODEC_ID_KMVC_get()),
    CODEC_ID_FLASHSV(VideoJNI.Codec_CODEC_ID_FLASHSV_get()),
    CODEC_ID_CAVS(VideoJNI.Codec_CODEC_ID_CAVS_get()),
    CODEC_ID_JPEG2000(VideoJNI.Codec_CODEC_ID_JPEG2000_get()),
    CODEC_ID_VMNC(VideoJNI.Codec_CODEC_ID_VMNC_get()),
    CODEC_ID_VP5(VideoJNI.Codec_CODEC_ID_VP5_get()),
    CODEC_ID_VP6(VideoJNI.Codec_CODEC_ID_VP6_get()),
    CODEC_ID_VP6F(VideoJNI.Codec_CODEC_ID_VP6F_get()),
    CODEC_ID_TARGA(VideoJNI.Codec_CODEC_ID_TARGA_get()),
    CODEC_ID_DSICINVIDEO(VideoJNI.Codec_CODEC_ID_DSICINVIDEO_get()),
    CODEC_ID_TIERTEXSEQVIDEO(VideoJNI.Codec_CODEC_ID_TIERTEXSEQVIDEO_get()),
    CODEC_ID_TIFF(VideoJNI.Codec_CODEC_ID_TIFF_get()),
    CODEC_ID_GIF(VideoJNI.Codec_CODEC_ID_GIF_get()),
    CODEC_ID_DXA(VideoJNI.Codec_CODEC_ID_DXA_get()),
    CODEC_ID_DNXHD(VideoJNI.Codec_CODEC_ID_DNXHD_get()),
    CODEC_ID_THP(VideoJNI.Codec_CODEC_ID_THP_get()),
    CODEC_ID_SGI(VideoJNI.Codec_CODEC_ID_SGI_get()),
    CODEC_ID_C93(VideoJNI.Codec_CODEC_ID_C93_get()),
    CODEC_ID_BETHSOFTVID(VideoJNI.Codec_CODEC_ID_BETHSOFTVID_get()),
    CODEC_ID_PTX(VideoJNI.Codec_CODEC_ID_PTX_get()),
    CODEC_ID_TXD(VideoJNI.Codec_CODEC_ID_TXD_get()),
    CODEC_ID_VP6A(VideoJNI.Codec_CODEC_ID_VP6A_get()),
    CODEC_ID_AMV(VideoJNI.Codec_CODEC_ID_AMV_get()),
    CODEC_ID_VB(VideoJNI.Codec_CODEC_ID_VB_get()),
    CODEC_ID_PCX(VideoJNI.Codec_CODEC_ID_PCX_get()),
    CODEC_ID_SUNRAST(VideoJNI.Codec_CODEC_ID_SUNRAST_get()),
    CODEC_ID_INDEO4(VideoJNI.Codec_CODEC_ID_INDEO4_get()),
    CODEC_ID_INDEO5(VideoJNI.Codec_CODEC_ID_INDEO5_get()),
    CODEC_ID_MIMIC(VideoJNI.Codec_CODEC_ID_MIMIC_get()),
    CODEC_ID_RL2(VideoJNI.Codec_CODEC_ID_RL2_get()),
    CODEC_ID_ESCAPE124(VideoJNI.Codec_CODEC_ID_ESCAPE124_get()),
    CODEC_ID_DIRAC(VideoJNI.Codec_CODEC_ID_DIRAC_get()),
    CODEC_ID_BFI(VideoJNI.Codec_CODEC_ID_BFI_get()),
    CODEC_ID_CMV(VideoJNI.Codec_CODEC_ID_CMV_get()),
    CODEC_ID_MOTIONPIXELS(VideoJNI.Codec_CODEC_ID_MOTIONPIXELS_get()),
    CODEC_ID_TGV(VideoJNI.Codec_CODEC_ID_TGV_get()),
    CODEC_ID_TGQ(VideoJNI.Codec_CODEC_ID_TGQ_get()),
    CODEC_ID_TQI(VideoJNI.Codec_CODEC_ID_TQI_get()),
    CODEC_ID_AURA(VideoJNI.Codec_CODEC_ID_AURA_get()),
    CODEC_ID_AURA2(VideoJNI.Codec_CODEC_ID_AURA2_get()),
    CODEC_ID_V210X(VideoJNI.Codec_CODEC_ID_V210X_get()),
    CODEC_ID_TMV(VideoJNI.Codec_CODEC_ID_TMV_get()),
    CODEC_ID_V210(VideoJNI.Codec_CODEC_ID_V210_get()),
    CODEC_ID_DPX(VideoJNI.Codec_CODEC_ID_DPX_get()),
    CODEC_ID_MAD(VideoJNI.Codec_CODEC_ID_MAD_get()),
    CODEC_ID_FRWU(VideoJNI.Codec_CODEC_ID_FRWU_get()),
    CODEC_ID_FLASHSV2(VideoJNI.Codec_CODEC_ID_FLASHSV2_get()),
    CODEC_ID_CDGRAPHICS(VideoJNI.Codec_CODEC_ID_CDGRAPHICS_get()),
    CODEC_ID_R210(VideoJNI.Codec_CODEC_ID_R210_get()),
    CODEC_ID_ANM(VideoJNI.Codec_CODEC_ID_ANM_get()),
    CODEC_ID_BINKVIDEO(VideoJNI.Codec_CODEC_ID_BINKVIDEO_get()),
    CODEC_ID_IFF_ILBM(VideoJNI.Codec_CODEC_ID_IFF_ILBM_get()),
    CODEC_ID_IFF_BYTERUN1(VideoJNI.Codec_CODEC_ID_IFF_BYTERUN1_get()),
    CODEC_ID_KGV1(VideoJNI.Codec_CODEC_ID_KGV1_get()),
    CODEC_ID_YOP(VideoJNI.Codec_CODEC_ID_YOP_get()),
    CODEC_ID_VP8(VideoJNI.Codec_CODEC_ID_VP8_get()),
    CODEC_ID_PICTOR(VideoJNI.Codec_CODEC_ID_PICTOR_get()),
    CODEC_ID_ANSI(VideoJNI.Codec_CODEC_ID_ANSI_get()),
    CODEC_ID_A64_MULTI(VideoJNI.Codec_CODEC_ID_A64_MULTI_get()),
    CODEC_ID_A64_MULTI5(VideoJNI.Codec_CODEC_ID_A64_MULTI5_get()),
    CODEC_ID_R10K(VideoJNI.Codec_CODEC_ID_R10K_get()),
    CODEC_ID_MXPEG(VideoJNI.Codec_CODEC_ID_MXPEG_get()),
    CODEC_ID_LAGARITH(VideoJNI.Codec_CODEC_ID_LAGARITH_get()),
    CODEC_ID_PRORES(VideoJNI.Codec_CODEC_ID_PRORES_get()),
    CODEC_ID_JV(VideoJNI.Codec_CODEC_ID_JV_get()),
    CODEC_ID_DFA(VideoJNI.Codec_CODEC_ID_DFA_get()),
    CODEC_ID_WMV3IMAGE(VideoJNI.Codec_CODEC_ID_WMV3IMAGE_get()),
    CODEC_ID_VC1IMAGE(VideoJNI.Codec_CODEC_ID_VC1IMAGE_get()),
    CODEC_ID_UTVIDEO(VideoJNI.Codec_CODEC_ID_UTVIDEO_get()),
    CODEC_ID_BMV_VIDEO(VideoJNI.Codec_CODEC_ID_BMV_VIDEO_get()),
    CODEC_ID_VBLE(VideoJNI.Codec_CODEC_ID_VBLE_get()),
    CODEC_ID_DXTORY(VideoJNI.Codec_CODEC_ID_DXTORY_get()),
    CODEC_ID_V410(VideoJNI.Codec_CODEC_ID_V410_get()),
    CODEC_ID_XWD(VideoJNI.Codec_CODEC_ID_XWD_get()),
    CODEC_ID_CDXL(VideoJNI.Codec_CODEC_ID_CDXL_get()),
    CODEC_ID_XBM(VideoJNI.Codec_CODEC_ID_XBM_get()),
    CODEC_ID_ZEROCODEC(VideoJNI.Codec_CODEC_ID_ZEROCODEC_get()),
    CODEC_ID_MSS1(VideoJNI.Codec_CODEC_ID_MSS1_get()),
    CODEC_ID_MSA1(VideoJNI.Codec_CODEC_ID_MSA1_get()),
    CODEC_ID_TSCC2(VideoJNI.Codec_CODEC_ID_TSCC2_get()),
    CODEC_ID_MTS2(VideoJNI.Codec_CODEC_ID_MTS2_get()),
    CODEC_ID_CLLC(VideoJNI.Codec_CODEC_ID_CLLC_get()),
    CODEC_ID_MSS2(VideoJNI.Codec_CODEC_ID_MSS2_get()),
    CODEC_ID_VP9(VideoJNI.Codec_CODEC_ID_VP9_get()),
    CODEC_ID_AIC(VideoJNI.Codec_CODEC_ID_AIC_get()),
    CODEC_ID_ESCAPE130_DEPRECATED(VideoJNI.Codec_CODEC_ID_ESCAPE130_DEPRECATED_get()),
    CODEC_ID_G2M_DEPRECATED(VideoJNI.Codec_CODEC_ID_G2M_DEPRECATED_get()),
    CODEC_ID_WEBP_DEPRECATED(VideoJNI.Codec_CODEC_ID_WEBP_DEPRECATED_get()),
    CODEC_ID_HNM4_VIDEO(VideoJNI.Codec_CODEC_ID_HNM4_VIDEO_get()),
    CODEC_ID_HEVC_DEPRECATED(VideoJNI.Codec_CODEC_ID_HEVC_DEPRECATED_get()),
    CODEC_ID_FIC(VideoJNI.Codec_CODEC_ID_FIC_get()),
    CODEC_ID_ALIAS_PIX(VideoJNI.Codec_CODEC_ID_ALIAS_PIX_get()),
    CODEC_ID_BRENDER_PIX_DEPRECATED(VideoJNI.Codec_CODEC_ID_BRENDER_PIX_DEPRECATED_get()),
    CODEC_ID_PAF_VIDEO_DEPRECATED(VideoJNI.Codec_CODEC_ID_PAF_VIDEO_DEPRECATED_get()),
    CODEC_ID_EXR_DEPRECATED(VideoJNI.Codec_CODEC_ID_EXR_DEPRECATED_get()),
    CODEC_ID_VP7_DEPRECATED(VideoJNI.Codec_CODEC_ID_VP7_DEPRECATED_get()),
    CODEC_ID_SANM_DEPRECATED(VideoJNI.Codec_CODEC_ID_SANM_DEPRECATED_get()),
    CODEC_ID_SGIRLE_DEPRECATED(VideoJNI.Codec_CODEC_ID_SGIRLE_DEPRECATED_get()),
    CODEC_ID_MVC1_DEPRECATED(VideoJNI.Codec_CODEC_ID_MVC1_DEPRECATED_get()),
    CODEC_ID_MVC2_DEPRECATED(VideoJNI.Codec_CODEC_ID_MVC2_DEPRECATED_get()),
    CODEC_ID_HQX(VideoJNI.Codec_CODEC_ID_HQX_get()),
    CODEC_ID_TDSC(VideoJNI.Codec_CODEC_ID_TDSC_get()),
    CODEC_ID_HQ_HQA(VideoJNI.Codec_CODEC_ID_HQ_HQA_get()),
    CODEC_ID_HAP(VideoJNI.Codec_CODEC_ID_HAP_get()),
    CODEC_ID_DDS(VideoJNI.Codec_CODEC_ID_DDS_get()),
    CODEC_ID_BRENDER_PIX(VideoJNI.Codec_CODEC_ID_BRENDER_PIX_get()),
    CODEC_ID_Y41P(VideoJNI.Codec_CODEC_ID_Y41P_get()),
    CODEC_ID_ESCAPE130(VideoJNI.Codec_CODEC_ID_ESCAPE130_get()),
    CODEC_ID_EXR(VideoJNI.Codec_CODEC_ID_EXR_get()),
    CODEC_ID_AVRP(VideoJNI.Codec_CODEC_ID_AVRP_get()),
    CODEC_ID_012V(VideoJNI.Codec_CODEC_ID_012V_get()),
    CODEC_ID_G2M(VideoJNI.Codec_CODEC_ID_G2M_get()),
    CODEC_ID_AVUI(VideoJNI.Codec_CODEC_ID_AVUI_get()),
    CODEC_ID_AYUV(VideoJNI.Codec_CODEC_ID_AYUV_get()),
    CODEC_ID_TARGA_Y216(VideoJNI.Codec_CODEC_ID_TARGA_Y216_get()),
    CODEC_ID_V308(VideoJNI.Codec_CODEC_ID_V308_get()),
    CODEC_ID_V408(VideoJNI.Codec_CODEC_ID_V408_get()),
    CODEC_ID_YUV4(VideoJNI.Codec_CODEC_ID_YUV4_get()),
    CODEC_ID_SANM(VideoJNI.Codec_CODEC_ID_SANM_get()),
    CODEC_ID_PAF_VIDEO(VideoJNI.Codec_CODEC_ID_PAF_VIDEO_get()),
    CODEC_ID_AVRN(VideoJNI.Codec_CODEC_ID_AVRN_get()),
    CODEC_ID_CPIA(VideoJNI.Codec_CODEC_ID_CPIA_get()),
    CODEC_ID_XFACE(VideoJNI.Codec_CODEC_ID_XFACE_get()),
    CODEC_ID_SGIRLE(VideoJNI.Codec_CODEC_ID_SGIRLE_get()),
    CODEC_ID_MVC1(VideoJNI.Codec_CODEC_ID_MVC1_get()),
    CODEC_ID_MVC2(VideoJNI.Codec_CODEC_ID_MVC2_get()),
    CODEC_ID_SNOW(VideoJNI.Codec_CODEC_ID_SNOW_get()),
    CODEC_ID_WEBP(VideoJNI.Codec_CODEC_ID_WEBP_get()),
    CODEC_ID_SMVJPEG(VideoJNI.Codec_CODEC_ID_SMVJPEG_get()),
    CODEC_ID_HEVC(VideoJNI.Codec_CODEC_ID_HEVC_get()),
    CODEC_ID_VP7(VideoJNI.Codec_CODEC_ID_VP7_get()),
    CODEC_ID_APNG(VideoJNI.Codec_CODEC_ID_APNG_get()),
  /**
   * A dummy id pointing at the start of audio codecs
   */
    CODEC_ID_FIRST_AUDIO(VideoJNI.Codec_CODEC_ID_FIRST_AUDIO_get()),
    CODEC_ID_PCM_S16LE(VideoJNI.Codec_CODEC_ID_PCM_S16LE_get()),
    CODEC_ID_PCM_S16BE(VideoJNI.Codec_CODEC_ID_PCM_S16BE_get()),
    CODEC_ID_PCM_U16LE(VideoJNI.Codec_CODEC_ID_PCM_U16LE_get()),
    CODEC_ID_PCM_U16BE(VideoJNI.Codec_CODEC_ID_PCM_U16BE_get()),
    CODEC_ID_PCM_S8(VideoJNI.Codec_CODEC_ID_PCM_S8_get()),
    CODEC_ID_PCM_U8(VideoJNI.Codec_CODEC_ID_PCM_U8_get()),
    CODEC_ID_PCM_MULAW(VideoJNI.Codec_CODEC_ID_PCM_MULAW_get()),
    CODEC_ID_PCM_ALAW(VideoJNI.Codec_CODEC_ID_PCM_ALAW_get()),
    CODEC_ID_PCM_S32LE(VideoJNI.Codec_CODEC_ID_PCM_S32LE_get()),
    CODEC_ID_PCM_S32BE(VideoJNI.Codec_CODEC_ID_PCM_S32BE_get()),
    CODEC_ID_PCM_U32LE(VideoJNI.Codec_CODEC_ID_PCM_U32LE_get()),
    CODEC_ID_PCM_U32BE(VideoJNI.Codec_CODEC_ID_PCM_U32BE_get()),
    CODEC_ID_PCM_S24LE(VideoJNI.Codec_CODEC_ID_PCM_S24LE_get()),
    CODEC_ID_PCM_S24BE(VideoJNI.Codec_CODEC_ID_PCM_S24BE_get()),
    CODEC_ID_PCM_U24LE(VideoJNI.Codec_CODEC_ID_PCM_U24LE_get()),
    CODEC_ID_PCM_U24BE(VideoJNI.Codec_CODEC_ID_PCM_U24BE_get()),
    CODEC_ID_PCM_S24DAUD(VideoJNI.Codec_CODEC_ID_PCM_S24DAUD_get()),
    CODEC_ID_PCM_ZORK(VideoJNI.Codec_CODEC_ID_PCM_ZORK_get()),
    CODEC_ID_PCM_S16LE_PLANAR(VideoJNI.Codec_CODEC_ID_PCM_S16LE_PLANAR_get()),
    CODEC_ID_PCM_DVD(VideoJNI.Codec_CODEC_ID_PCM_DVD_get()),
    CODEC_ID_PCM_F32BE(VideoJNI.Codec_CODEC_ID_PCM_F32BE_get()),
    CODEC_ID_PCM_F32LE(VideoJNI.Codec_CODEC_ID_PCM_F32LE_get()),
    CODEC_ID_PCM_F64BE(VideoJNI.Codec_CODEC_ID_PCM_F64BE_get()),
    CODEC_ID_PCM_F64LE(VideoJNI.Codec_CODEC_ID_PCM_F64LE_get()),
    CODEC_ID_PCM_BLURAY(VideoJNI.Codec_CODEC_ID_PCM_BLURAY_get()),
    CODEC_ID_PCM_LXF(VideoJNI.Codec_CODEC_ID_PCM_LXF_get()),
    CODEC_ID_S302M(VideoJNI.Codec_CODEC_ID_S302M_get()),
    CODEC_ID_PCM_S8_PLANAR(VideoJNI.Codec_CODEC_ID_PCM_S8_PLANAR_get()),
    CODEC_ID_PCM_S24LE_PLANAR_DEPRECATED(VideoJNI.Codec_CODEC_ID_PCM_S24LE_PLANAR_DEPRECATED_get()),
    CODEC_ID_PCM_S32LE_PLANAR_DEPRECATED(VideoJNI.Codec_CODEC_ID_PCM_S32LE_PLANAR_DEPRECATED_get()),
    CODEC_ID_PCM_S16BE_PLANAR_DEPRECATED(VideoJNI.Codec_CODEC_ID_PCM_S16BE_PLANAR_DEPRECATED_get()),
    CODEC_ID_PCM_S24LE_PLANAR(VideoJNI.Codec_CODEC_ID_PCM_S24LE_PLANAR_get()),
    CODEC_ID_PCM_S32LE_PLANAR(VideoJNI.Codec_CODEC_ID_PCM_S32LE_PLANAR_get()),
    CODEC_ID_PCM_S16BE_PLANAR(VideoJNI.Codec_CODEC_ID_PCM_S16BE_PLANAR_get()),
    CODEC_ID_ADPCM_IMA_QT(VideoJNI.Codec_CODEC_ID_ADPCM_IMA_QT_get()),
    CODEC_ID_ADPCM_IMA_WAV(VideoJNI.Codec_CODEC_ID_ADPCM_IMA_WAV_get()),
    CODEC_ID_ADPCM_IMA_DK3(VideoJNI.Codec_CODEC_ID_ADPCM_IMA_DK3_get()),
    CODEC_ID_ADPCM_IMA_DK4(VideoJNI.Codec_CODEC_ID_ADPCM_IMA_DK4_get()),
    CODEC_ID_ADPCM_IMA_WS(VideoJNI.Codec_CODEC_ID_ADPCM_IMA_WS_get()),
    CODEC_ID_ADPCM_IMA_SMJPEG(VideoJNI.Codec_CODEC_ID_ADPCM_IMA_SMJPEG_get()),
    CODEC_ID_ADPCM_MS(VideoJNI.Codec_CODEC_ID_ADPCM_MS_get()),
    CODEC_ID_ADPCM_4XM(VideoJNI.Codec_CODEC_ID_ADPCM_4XM_get()),
    CODEC_ID_ADPCM_XA(VideoJNI.Codec_CODEC_ID_ADPCM_XA_get()),
    CODEC_ID_ADPCM_ADX(VideoJNI.Codec_CODEC_ID_ADPCM_ADX_get()),
    CODEC_ID_ADPCM_EA(VideoJNI.Codec_CODEC_ID_ADPCM_EA_get()),
    CODEC_ID_ADPCM_G726(VideoJNI.Codec_CODEC_ID_ADPCM_G726_get()),
    CODEC_ID_ADPCM_CT(VideoJNI.Codec_CODEC_ID_ADPCM_CT_get()),
    CODEC_ID_ADPCM_SWF(VideoJNI.Codec_CODEC_ID_ADPCM_SWF_get()),
    CODEC_ID_ADPCM_YAMAHA(VideoJNI.Codec_CODEC_ID_ADPCM_YAMAHA_get()),
    CODEC_ID_ADPCM_SBPRO_4(VideoJNI.Codec_CODEC_ID_ADPCM_SBPRO_4_get()),
    CODEC_ID_ADPCM_SBPRO_3(VideoJNI.Codec_CODEC_ID_ADPCM_SBPRO_3_get()),
    CODEC_ID_ADPCM_SBPRO_2(VideoJNI.Codec_CODEC_ID_ADPCM_SBPRO_2_get()),
    CODEC_ID_ADPCM_THP(VideoJNI.Codec_CODEC_ID_ADPCM_THP_get()),
    CODEC_ID_ADPCM_IMA_AMV(VideoJNI.Codec_CODEC_ID_ADPCM_IMA_AMV_get()),
    CODEC_ID_ADPCM_EA_R1(VideoJNI.Codec_CODEC_ID_ADPCM_EA_R1_get()),
    CODEC_ID_ADPCM_EA_R3(VideoJNI.Codec_CODEC_ID_ADPCM_EA_R3_get()),
    CODEC_ID_ADPCM_EA_R2(VideoJNI.Codec_CODEC_ID_ADPCM_EA_R2_get()),
    CODEC_ID_ADPCM_IMA_EA_SEAD(VideoJNI.Codec_CODEC_ID_ADPCM_IMA_EA_SEAD_get()),
    CODEC_ID_ADPCM_IMA_EA_EACS(VideoJNI.Codec_CODEC_ID_ADPCM_IMA_EA_EACS_get()),
    CODEC_ID_ADPCM_EA_XAS(VideoJNI.Codec_CODEC_ID_ADPCM_EA_XAS_get()),
    CODEC_ID_ADPCM_EA_MAXIS_XA(VideoJNI.Codec_CODEC_ID_ADPCM_EA_MAXIS_XA_get()),
    CODEC_ID_ADPCM_IMA_ISS(VideoJNI.Codec_CODEC_ID_ADPCM_IMA_ISS_get()),
    CODEC_ID_ADPCM_G722(VideoJNI.Codec_CODEC_ID_ADPCM_G722_get()),
    CODEC_ID_ADPCM_IMA_APC(VideoJNI.Codec_CODEC_ID_ADPCM_IMA_APC_get()),
    CODEC_ID_ADPCM_VIMA_DEPRECATED(VideoJNI.Codec_CODEC_ID_ADPCM_VIMA_DEPRECATED_get()),
    CODEC_ID_ADPCM_VIMA(VideoJNI.Codec_CODEC_ID_ADPCM_VIMA_get()),
    CODEC_ID_ADPCM_AFC(VideoJNI.Codec_CODEC_ID_ADPCM_AFC_get()),
    CODEC_ID_ADPCM_IMA_OKI(VideoJNI.Codec_CODEC_ID_ADPCM_IMA_OKI_get()),
    CODEC_ID_ADPCM_DTK(VideoJNI.Codec_CODEC_ID_ADPCM_DTK_get()),
    CODEC_ID_ADPCM_IMA_RAD(VideoJNI.Codec_CODEC_ID_ADPCM_IMA_RAD_get()),
    CODEC_ID_ADPCM_G726LE(VideoJNI.Codec_CODEC_ID_ADPCM_G726LE_get()),
    CODEC_ID_ADPCM_THP_LE(VideoJNI.Codec_CODEC_ID_ADPCM_THP_LE_get()),
    CODEC_ID_AMR_NB(VideoJNI.Codec_CODEC_ID_AMR_NB_get()),
    CODEC_ID_AMR_WB(VideoJNI.Codec_CODEC_ID_AMR_WB_get()),
    CODEC_ID_RA_144(VideoJNI.Codec_CODEC_ID_RA_144_get()),
    CODEC_ID_RA_288(VideoJNI.Codec_CODEC_ID_RA_288_get()),
    CODEC_ID_ROQ_DPCM(VideoJNI.Codec_CODEC_ID_ROQ_DPCM_get()),
    CODEC_ID_INTERPLAY_DPCM(VideoJNI.Codec_CODEC_ID_INTERPLAY_DPCM_get()),
    CODEC_ID_XAN_DPCM(VideoJNI.Codec_CODEC_ID_XAN_DPCM_get()),
    CODEC_ID_SOL_DPCM(VideoJNI.Codec_CODEC_ID_SOL_DPCM_get()),
    CODEC_ID_MP2(VideoJNI.Codec_CODEC_ID_MP2_get()),
  /**
   * preferred ID for decoding MPEG audio layer 1, 2 or 3
   */
    CODEC_ID_MP3(VideoJNI.Codec_CODEC_ID_MP3_get()),
    CODEC_ID_AAC(VideoJNI.Codec_CODEC_ID_AAC_get()),
    CODEC_ID_AC3(VideoJNI.Codec_CODEC_ID_AC3_get()),
    CODEC_ID_DTS(VideoJNI.Codec_CODEC_ID_DTS_get()),
    CODEC_ID_VORBIS(VideoJNI.Codec_CODEC_ID_VORBIS_get()),
    CODEC_ID_DVAUDIO(VideoJNI.Codec_CODEC_ID_DVAUDIO_get()),
    CODEC_ID_WMAV1(VideoJNI.Codec_CODEC_ID_WMAV1_get()),
    CODEC_ID_WMAV2(VideoJNI.Codec_CODEC_ID_WMAV2_get()),
    CODEC_ID_MACE3(VideoJNI.Codec_CODEC_ID_MACE3_get()),
    CODEC_ID_MACE6(VideoJNI.Codec_CODEC_ID_MACE6_get()),
    CODEC_ID_VMDAUDIO(VideoJNI.Codec_CODEC_ID_VMDAUDIO_get()),
    CODEC_ID_FLAC(VideoJNI.Codec_CODEC_ID_FLAC_get()),
    CODEC_ID_MP3ADU(VideoJNI.Codec_CODEC_ID_MP3ADU_get()),
    CODEC_ID_MP3ON4(VideoJNI.Codec_CODEC_ID_MP3ON4_get()),
    CODEC_ID_SHORTEN(VideoJNI.Codec_CODEC_ID_SHORTEN_get()),
    CODEC_ID_ALAC(VideoJNI.Codec_CODEC_ID_ALAC_get()),
    CODEC_ID_WESTWOOD_SND1(VideoJNI.Codec_CODEC_ID_WESTWOOD_SND1_get()),
  /**
   * as in Berlin toast format
   */
    CODEC_ID_GSM(VideoJNI.Codec_CODEC_ID_GSM_get()),
    CODEC_ID_QDM2(VideoJNI.Codec_CODEC_ID_QDM2_get()),
    CODEC_ID_COOK(VideoJNI.Codec_CODEC_ID_COOK_get()),
    CODEC_ID_TRUESPEECH(VideoJNI.Codec_CODEC_ID_TRUESPEECH_get()),
    CODEC_ID_TTA(VideoJNI.Codec_CODEC_ID_TTA_get()),
    CODEC_ID_SMACKAUDIO(VideoJNI.Codec_CODEC_ID_SMACKAUDIO_get()),
    CODEC_ID_QCELP(VideoJNI.Codec_CODEC_ID_QCELP_get()),
    CODEC_ID_WAVPACK(VideoJNI.Codec_CODEC_ID_WAVPACK_get()),
    CODEC_ID_DSICINAUDIO(VideoJNI.Codec_CODEC_ID_DSICINAUDIO_get()),
    CODEC_ID_IMC(VideoJNI.Codec_CODEC_ID_IMC_get()),
    CODEC_ID_MUSEPACK7(VideoJNI.Codec_CODEC_ID_MUSEPACK7_get()),
    CODEC_ID_MLP(VideoJNI.Codec_CODEC_ID_MLP_get()),
    CODEC_ID_GSM_MS(VideoJNI.Codec_CODEC_ID_GSM_MS_get()),
    CODEC_ID_ATRAC3(VideoJNI.Codec_CODEC_ID_ATRAC3_get()),
    CODEC_ID_APE(VideoJNI.Codec_CODEC_ID_APE_get()),
    CODEC_ID_NELLYMOSER(VideoJNI.Codec_CODEC_ID_NELLYMOSER_get()),
    CODEC_ID_MUSEPACK8(VideoJNI.Codec_CODEC_ID_MUSEPACK8_get()),
    CODEC_ID_SPEEX(VideoJNI.Codec_CODEC_ID_SPEEX_get()),
    CODEC_ID_WMAVOICE(VideoJNI.Codec_CODEC_ID_WMAVOICE_get()),
    CODEC_ID_WMAPRO(VideoJNI.Codec_CODEC_ID_WMAPRO_get()),
    CODEC_ID_WMALOSSLESS(VideoJNI.Codec_CODEC_ID_WMALOSSLESS_get()),
    CODEC_ID_ATRAC3P(VideoJNI.Codec_CODEC_ID_ATRAC3P_get()),
    CODEC_ID_EAC3(VideoJNI.Codec_CODEC_ID_EAC3_get()),
    CODEC_ID_SIPR(VideoJNI.Codec_CODEC_ID_SIPR_get()),
    CODEC_ID_MP1(VideoJNI.Codec_CODEC_ID_MP1_get()),
    CODEC_ID_TWINVQ(VideoJNI.Codec_CODEC_ID_TWINVQ_get()),
    CODEC_ID_TRUEHD(VideoJNI.Codec_CODEC_ID_TRUEHD_get()),
    CODEC_ID_MP4ALS(VideoJNI.Codec_CODEC_ID_MP4ALS_get()),
    CODEC_ID_ATRAC1(VideoJNI.Codec_CODEC_ID_ATRAC1_get()),
    CODEC_ID_BINKAUDIO_RDFT(VideoJNI.Codec_CODEC_ID_BINKAUDIO_RDFT_get()),
    CODEC_ID_BINKAUDIO_DCT(VideoJNI.Codec_CODEC_ID_BINKAUDIO_DCT_get()),
    CODEC_ID_AAC_LATM(VideoJNI.Codec_CODEC_ID_AAC_LATM_get()),
    CODEC_ID_QDMC(VideoJNI.Codec_CODEC_ID_QDMC_get()),
    CODEC_ID_CELT(VideoJNI.Codec_CODEC_ID_CELT_get()),
    CODEC_ID_G723_1(VideoJNI.Codec_CODEC_ID_G723_1_get()),
    CODEC_ID_G729(VideoJNI.Codec_CODEC_ID_G729_get()),
    CODEC_ID_8SVX_EXP(VideoJNI.Codec_CODEC_ID_8SVX_EXP_get()),
    CODEC_ID_8SVX_FIB(VideoJNI.Codec_CODEC_ID_8SVX_FIB_get()),
    CODEC_ID_BMV_AUDIO(VideoJNI.Codec_CODEC_ID_BMV_AUDIO_get()),
    CODEC_ID_RALF(VideoJNI.Codec_CODEC_ID_RALF_get()),
    CODEC_ID_IAC(VideoJNI.Codec_CODEC_ID_IAC_get()),
    CODEC_ID_ILBC(VideoJNI.Codec_CODEC_ID_ILBC_get()),
    CODEC_ID_OPUS_DEPRECATED(VideoJNI.Codec_CODEC_ID_OPUS_DEPRECATED_get()),
    CODEC_ID_COMFORT_NOISE(VideoJNI.Codec_CODEC_ID_COMFORT_NOISE_get()),
    CODEC_ID_TAK_DEPRECATED(VideoJNI.Codec_CODEC_ID_TAK_DEPRECATED_get()),
    CODEC_ID_METASOUND(VideoJNI.Codec_CODEC_ID_METASOUND_get()),
    CODEC_ID_PAF_AUDIO_DEPRECATED(VideoJNI.Codec_CODEC_ID_PAF_AUDIO_DEPRECATED_get()),
    CODEC_ID_ON2AVC(VideoJNI.Codec_CODEC_ID_ON2AVC_get()),
    CODEC_ID_DSS_SP(VideoJNI.Codec_CODEC_ID_DSS_SP_get()),
    CODEC_ID_FFWAVESYNTH(VideoJNI.Codec_CODEC_ID_FFWAVESYNTH_get()),
    CODEC_ID_SONIC(VideoJNI.Codec_CODEC_ID_SONIC_get()),
    CODEC_ID_SONIC_LS(VideoJNI.Codec_CODEC_ID_SONIC_LS_get()),
    CODEC_ID_PAF_AUDIO(VideoJNI.Codec_CODEC_ID_PAF_AUDIO_get()),
    CODEC_ID_OPUS(VideoJNI.Codec_CODEC_ID_OPUS_get()),
    CODEC_ID_TAK(VideoJNI.Codec_CODEC_ID_TAK_get()),
    CODEC_ID_EVRC(VideoJNI.Codec_CODEC_ID_EVRC_get()),
    CODEC_ID_SMV(VideoJNI.Codec_CODEC_ID_SMV_get()),
    CODEC_ID_DSD_LSBF(VideoJNI.Codec_CODEC_ID_DSD_LSBF_get()),
    CODEC_ID_DSD_MSBF(VideoJNI.Codec_CODEC_ID_DSD_MSBF_get()),
    CODEC_ID_DSD_LSBF_PLANAR(VideoJNI.Codec_CODEC_ID_DSD_LSBF_PLANAR_get()),
    CODEC_ID_DSD_MSBF_PLANAR(VideoJNI.Codec_CODEC_ID_DSD_MSBF_PLANAR_get()),
    CODEC_ID_4GV(VideoJNI.Codec_CODEC_ID_4GV_get()),
  /**
   * A dummy ID pointing at the start of subtitle codecs.
   */
    CODEC_ID_FIRST_SUBTITLE(VideoJNI.Codec_CODEC_ID_FIRST_SUBTITLE_get()),
    CODEC_ID_DVD_SUBTITLE(VideoJNI.Codec_CODEC_ID_DVD_SUBTITLE_get()),
    CODEC_ID_DVB_SUBTITLE(VideoJNI.Codec_CODEC_ID_DVB_SUBTITLE_get()),
  /**
   * raw UTF-8 text
   */
    CODEC_ID_TEXT(VideoJNI.Codec_CODEC_ID_TEXT_get()),
    CODEC_ID_XSUB(VideoJNI.Codec_CODEC_ID_XSUB_get()),
    CODEC_ID_SSA(VideoJNI.Codec_CODEC_ID_SSA_get()),
    CODEC_ID_MOV_TEXT(VideoJNI.Codec_CODEC_ID_MOV_TEXT_get()),
    CODEC_ID_HDMV_PGS_SUBTITLE(VideoJNI.Codec_CODEC_ID_HDMV_PGS_SUBTITLE_get()),
    CODEC_ID_DVB_TELETEXT(VideoJNI.Codec_CODEC_ID_DVB_TELETEXT_get()),
    CODEC_ID_SRT(VideoJNI.Codec_CODEC_ID_SRT_get()),
    CODEC_ID_MICRODVD(VideoJNI.Codec_CODEC_ID_MICRODVD_get()),
    CODEC_ID_EIA_608(VideoJNI.Codec_CODEC_ID_EIA_608_get()),
    CODEC_ID_JACOSUB(VideoJNI.Codec_CODEC_ID_JACOSUB_get()),
    CODEC_ID_SAMI(VideoJNI.Codec_CODEC_ID_SAMI_get()),
    CODEC_ID_REALTEXT(VideoJNI.Codec_CODEC_ID_REALTEXT_get()),
    CODEC_ID_STL(VideoJNI.Codec_CODEC_ID_STL_get()),
    CODEC_ID_SUBVIEWER1(VideoJNI.Codec_CODEC_ID_SUBVIEWER1_get()),
    CODEC_ID_SUBVIEWER(VideoJNI.Codec_CODEC_ID_SUBVIEWER_get()),
    CODEC_ID_SUBRIP(VideoJNI.Codec_CODEC_ID_SUBRIP_get()),
    CODEC_ID_WEBVTT(VideoJNI.Codec_CODEC_ID_WEBVTT_get()),
    CODEC_ID_MPL2(VideoJNI.Codec_CODEC_ID_MPL2_get()),
    CODEC_ID_VPLAYER(VideoJNI.Codec_CODEC_ID_VPLAYER_get()),
    CODEC_ID_PJS(VideoJNI.Codec_CODEC_ID_PJS_get()),
    CODEC_ID_ASS(VideoJNI.Codec_CODEC_ID_ASS_get()),
    CODEC_ID_HDMV_TEXT_SUBTITLE(VideoJNI.Codec_CODEC_ID_HDMV_TEXT_SUBTITLE_get()),
  /**
   * A dummy ID pointing at the start of various fake codecs.
   */
    CODEC_ID_FIRST_UNKNOWN(VideoJNI.Codec_CODEC_ID_FIRST_UNKNOWN_get()),
    CODEC_ID_TTF(VideoJNI.Codec_CODEC_ID_TTF_get()),
    CODEC_ID_BINTEXT(VideoJNI.Codec_CODEC_ID_BINTEXT_get()),
    CODEC_ID_XBIN(VideoJNI.Codec_CODEC_ID_XBIN_get()),
    CODEC_ID_IDF(VideoJNI.Codec_CODEC_ID_IDF_get()),
    CODEC_ID_OTF(VideoJNI.Codec_CODEC_ID_OTF_get()),
    CODEC_ID_SMPTE_KLV(VideoJNI.Codec_CODEC_ID_SMPTE_KLV_get()),
    CODEC_ID_DVD_NAV(VideoJNI.Codec_CODEC_ID_DVD_NAV_get()),
    CODEC_ID_TIMED_ID3(VideoJNI.Codec_CODEC_ID_TIMED_ID3_get()),
    CODEC_ID_BIN_DATA(VideoJNI.Codec_CODEC_ID_BIN_DATA_get()),
  /**
   * codec_id is not known (like CODEC_ID_NONE = AV_CODEC_ID_NONE) but lavf should attempt to identify it
   */
    CODEC_ID_PROBE(VideoJNI.Codec_CODEC_ID_PROBE_get()),
  /**
   * _FAKE_ codec to indicate a raw MPEG-2 TS

   * stream (only used by libavformat)
   */
    CODEC_ID_MPEG2TS(VideoJNI.Codec_CODEC_ID_MPEG2TS_get()),
  /**
   * _FAKE_ codec to indicate a MPEG-4 Systems

   * stream (only used by libavformat)
   */
    CODEC_ID_MPEG4SYSTEMS(VideoJNI.Codec_CODEC_ID_MPEG4SYSTEMS_get()),
  /**
   * Dummy codec for streams containing only metadata information.
   */
    CODEC_ID_FFMETADATA(VideoJNI.Codec_CODEC_ID_FFMETADATA_get()),
  ;

    public final int swigValue() {
      return swigValue;
    }

    public static ID swigToEnum(int swigValue) {
      ID[] swigValues = ID.class.getEnumConstants();
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (ID swigEnum : swigValues)
        if (swigEnum.swigValue == swigValue)
          return swigEnum;
      throw new IllegalArgumentException("No enum " + ID.class + " with value " + swigValue);
    }

    @SuppressWarnings("unused")
    private ID() {
      this.swigValue = SwigNext.next++;
    }

    @SuppressWarnings("unused")
    private ID(int swigValue) {
      this.swigValue = swigValue;
      SwigNext.next = swigValue+1;
    }

    @SuppressWarnings("unused")
    private ID(ID swigEnum) {
      this.swigValue = swigEnum.swigValue;
      SwigNext.next = this.swigValue+1;
    }

    private final int swigValue;

    private static class SwigNext {
      private static int next = 0;
    }
  }

  /**
   * Capabilities supported by a codec.
   */
  public enum CodecCapability {
  /**
   * Decoder can use draw_horiz_band callback.
   */
    CAP_DRAW_HORIZ_BAND(VideoJNI.Codec_CAP_DRAW_HORIZ_BAND_get()),
  /**
   * Codec uses get_buffer() for allocating buffers and supports custom allocators.

   * If not set, it might not use get_buffer() at all or use operations that

   * assume the buffer was allocated by avcodec_default_get_buffer.
   */
    CAP_DR1(VideoJNI.Codec_CAP_DR1_get()),
    CAP_TRUNCATED(VideoJNI.Codec_CAP_TRUNCATED_get()),
    CAP_HWACCEL(VideoJNI.Codec_CAP_HWACCEL_get()),
  /**
   * Encoder or decoder requires flushing with NULL input at the end in order to

   * give the complete and correct output.

   *

   * NOTE: If this flag is not set, the codec is guaranteed to never be fed with

   *       with NULL data. The user can still send NULL data to the public encode

   *       or decode function, but libavcodec will not pass it along to the codec

   *       unless this flag is set.

   *

   * Decoders:

   * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL,

   * avpkt->size=0 at the end to get the delayed data until the decoder no longer

   * returns frames.

   *

   * Encoders:

   * The encoder needs to be fed with NULL data at the end of encoding until the

   * encoder no longer returns data.

   *

   * NOTE: Setting this

   *       flag also means that the encoder must set the pts and duration for

   *       each output packet. If this flag is not set, the pts and duration will

   *       be determined by libavcodec from the input frame.
   */
    CAP_DELAY(VideoJNI.Codec_CAP_DELAY_get()),
  /**
   * Codec can be fed a final frame with a smaller size.

   * This can be used to prevent truncation of the last audio samples.
   */
    CAP_SMALL_LAST_FRAME(VideoJNI.Codec_CAP_SMALL_LAST_FRAME_get()),
  /**
   * Codec can export data for HW decoding (VDPAU).
   */
    CAP_HWACCEL_VDPAU(VideoJNI.Codec_CAP_HWACCEL_VDPAU_get()),
  /**
   * Codec can output multiple frames per AVPacket

   * Normally demuxers return one frame at a time, demuxers which do not do

   * are connected to a parser to split what they return into proper frames.

   * This flag is reserved to the very rare category of codecs which have a

   * bitstream that cannot be split into frames without timeconsuming

   * operations like full decoding. Demuxers carring such bitstreams thus

   * may return multiple frames in a packet. This has many disadvantages like

   * prohibiting stream copy in many cases thus it should only be considered

   * as a last resort.
   */
    CAP_SUBFRAMES(VideoJNI.Codec_CAP_SUBFRAMES_get()),
  /**
   * Codec is experimental and is thus avoided in favor of non experimental

   * encoders
   */
    CAP_EXPERIMENTAL(VideoJNI.Codec_CAP_EXPERIMENTAL_get()),
  /**
   * Codec should fill in channel configuration and samplerate instead of container
   */
    CAP_CHANNEL_CONF(VideoJNI.Codec_CAP_CHANNEL_CONF_get()),
  /**
   * Codec is able to deal with negative linesizes
   */
    CAP_NEG_LINESIZES(VideoJNI.Codec_CAP_NEG_LINESIZES_get()),
  /**
   * Codec supports frame-level multithreading.
   */
    CAP_FRAME_THREADS(VideoJNI.Codec_CAP_FRAME_THREADS_get()),
  /**
   * Codec supports slice-based (or partition-based) multithreading.
   */
    CAP_SLICE_THREADS(VideoJNI.Codec_CAP_SLICE_THREADS_get()),
  /**
   * Codec supports changed parameters at any point.
   */
    CAP_PARAM_CHANGE(VideoJNI.Codec_CAP_PARAM_CHANGE_get()),
  /**
   * Codec supports avctx->thread_count == 0 (auto).
   */
    CAP_AUTO_THREADS(VideoJNI.Codec_CAP_AUTO_THREADS_get()),
  /**
   * Audio encoder supports receiving a different number of samples in each call.
   */
    CAP_VARIABLE_FRAME_SIZE(VideoJNI.Codec_CAP_VARIABLE_FRAME_SIZE_get()),
  /**
   * Codec is intra only.
   */
    CAP_INTRA_ONLY(VideoJNI.Codec_CAP_INTRA_ONLY_get()),
  /**
   * Codec is lossless.
   */
    CAP_LOSSLESS(VideoJNI.Codec_CAP_LOSSLESS_get()),
  ;

    public final int swigValue() {
      return swigValue;
    }

    public static CodecCapability swigToEnum(int swigValue) {
      CodecCapability[] swigValues = CodecCapability.class.getEnumConstants();
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (CodecCapability swigEnum : swigValues)
        if (swigEnum.swigValue == swigValue)
          return swigEnum;
      throw new IllegalArgumentException("No enum " + CodecCapability.class + " with value " + swigValue);
    }

    @SuppressWarnings("unused")
    private CodecCapability() {
      this.swigValue = SwigNext.next++;
    }

    @SuppressWarnings("unused")
    private CodecCapability(int swigValue) {
      this.swigValue = swigValue;
      SwigNext.next = swigValue+1;
    }

    @SuppressWarnings("unused")
    private CodecCapability(CodecCapability swigEnum) {
      this.swigValue = swigEnum.swigValue;
      SwigNext.next = this.swigValue+1;
    }

    private final int swigValue;

    private static class SwigNext {
      private static int next = 0;
    }
  }

}


/* ----------------------------------------------------------------------------
 * 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.*;
/**
 * Converts MediaPicture objects of a given width, height and format to a new

 * width, height or format.
 */
public class MediaPictureResampler extends MediaResampler {
  // 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 MediaPictureResampler(long cPtr, boolean cMemoryOwn) {
    super(VideoJNI.MediaPictureResampler_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  /**
   * Internal Only.
   */
  protected MediaPictureResampler(long cPtr, boolean cMemoryOwn,
      java.util.concurrent.atomic.AtomicLong ref)
  {
    super(VideoJNI.MediaPictureResampler_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(MediaPictureResampler 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 MediaPictureResampler object that is actually referring to the
   * exact same underlying native object.
   *
   * @return the new Java object.
   */
  @Override
  public MediaPictureResampler copyReference() {
    if (swigCPtr == 0)
      return null;
    else
      return new MediaPictureResampler(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 MediaPictureResampler)
      equal = (((MediaPictureResampler)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

  @Override
  public String toString()
  {
    StringBuilder result = new StringBuilder();

    result.append(this.getClass().getName()+"@"+hashCode()+"[");
    result.append("input width:"+getInputWidth()+";");
    result.append("input height:"+getInputHeight()+";");
    result.append("input format:"+getInputFormat()+";");
    result.append("output width:"+getOutputWidth()+";");
    result.append("output height:"+getOutputHeight()+";");
    result.append("output format:"+getOutputFormat()+";");
    result.append("]");
    return result.toString();
  }

/**
 * Get the width in pixels we expect on the input frame to the resampler.

 * @return The width we expect on the input frame to the resampler.
 */
  public int getInputWidth() {
    return VideoJNI.MediaPictureResampler_getInputWidth(swigCPtr, this);
  }

/**
 * Get the height in pixels we expect on the input frame to the resampler.

 * @return The height we expect on the input frame to the resampler.
 */
  public int getInputHeight() {
    return VideoJNI.MediaPictureResampler_getInputHeight(swigCPtr, this);
  }

/**
 * Get the input pixel format.

 * @return The pixel format we expect on the input frame to the resampler.
 */
  public PixelFormat.Type getInputFormat() {
    return PixelFormat.Type.swigToEnum(VideoJNI.MediaPictureResampler_getInputFormat(swigCPtr, this));
  }

/**
 * Get the output width, in pixels.

 * @return The width we will resample the output frame to
 */
  public int getOutputWidth() {
    return VideoJNI.MediaPictureResampler_getOutputWidth(swigCPtr, this);
  }

/**
 * Get the output height, in pixels.

 * @return The height we will resample the output frame to
 */
  public int getOutputHeight() {
    return VideoJNI.MediaPictureResampler_getOutputHeight(swigCPtr, this);
  }

/**
 * Get the output pixel format.

 * @return The pixel format we will resample the output frame to
 */
  public PixelFormat.Type getOutputFormat() {
    return PixelFormat.Type.swigToEnum(VideoJNI.MediaPictureResampler_getOutputFormat(swigCPtr, this));
  }

/**
 * Opens the resampler so it can be ready for resampling.

 * You should NOT set options after you open this object.
 */
  public void open() {
    VideoJNI.MediaPictureResampler_open(swigCPtr, this);
  }

/**
 * Resample in to out based on the resampler parameters.

 *

 * Resamples the in picture based on the parameters set when

 * this resampler was constructed.

 *

 * @param out The picture we'll resample to.  Check

 *     MediaPicture#isComplete() after the call.

 * @param in The picture we'll resample from.

 *

 * @throws InvalidArgument if in our out does not match the parameters this

 *         resampler was set with.
 */
  public int resample(MediaSampled out, MediaSampled in) {
    return VideoJNI.MediaPictureResampler_resample(swigCPtr, this, MediaSampled.getCPtr(out), out, MediaSampled.getCPtr(in), in);
  }

/**
 * A more precisely typed way to call #resample
 */
  public int resamplePicture(MediaPicture out, MediaPicture in) {
    return VideoJNI.MediaPictureResampler_resamplePicture(swigCPtr, this, MediaPicture.getCPtr(out), out, MediaPicture.getCPtr(in), in);
  }

/**
 * Get a new picture resampler.

 *

 * @param outputWidth The width in pixels you want to output frame to have.

 * @param outputHeight The height in pixels you want to output frame to have.

 * @param outputFmt The pixel format of the output frame.

 * @param inputWidth The width in pixels the input frame will be in.

 * @param inputHeight The height in pixels the input frame will be in.

 * @param inputFmt The pixel format of the input frame.

 * @return a new object, or null if we cannot allocate one.
 */
  public static MediaPictureResampler make(int outputWidth, int outputHeight, PixelFormat.Type outputFmt, int inputWidth, int inputHeight, PixelFormat.Type inputFmt, int flags) {
    long cPtr = VideoJNI.MediaPictureResampler_make(outputWidth, outputHeight, outputFmt.swigValue(), inputWidth, inputHeight, inputFmt.swigValue(), flags);
    return (cPtr == 0) ? null : new MediaPictureResampler(cPtr, false);
  }

  public enum Flag {
    FLAG_FAST_BILINEAR(VideoJNI.MediaPictureResampler_FLAG_FAST_BILINEAR_get()),
    FLAG_BILINEAR(VideoJNI.MediaPictureResampler_FLAG_BILINEAR_get()),
    FLAG_BICUBIC(VideoJNI.MediaPictureResampler_FLAG_BICUBIC_get()),
    FLAG_X(VideoJNI.MediaPictureResampler_FLAG_X_get()),
    FLAG_POINT(VideoJNI.MediaPictureResampler_FLAG_POINT_get()),
    FLAG_AREA(VideoJNI.MediaPictureResampler_FLAG_AREA_get()),
    FLAG_BICUBLIN(VideoJNI.MediaPictureResampler_FLAG_BICUBLIN_get()),
    FLAG_GAUSS(VideoJNI.MediaPictureResampler_FLAG_GAUSS_get()),
    FLAG_SINC(VideoJNI.MediaPictureResampler_FLAG_SINC_get()),
    FLAG_LANCZOS(VideoJNI.MediaPictureResampler_FLAG_LANCZOS_get()),
    FLAG_SPLINE(VideoJNI.MediaPictureResampler_FLAG_SPLINE_get()),
    FLAG_SRC_V_CHR_DROP_MASK(VideoJNI.MediaPictureResampler_FLAG_SRC_V_CHR_DROP_MASK_get()),
    FLAG_SRC_V_CHR_DROP_SHIFT(VideoJNI.MediaPictureResampler_FLAG_SRC_V_CHR_DROP_SHIFT_get()),
    FLAG_PARAM_DEFAULT(VideoJNI.MediaPictureResampler_FLAG_PARAM_DEFAULT_get()),
    FLAG_FULL_CHR_H_INT(VideoJNI.MediaPictureResampler_FLAG_FULL_CHR_H_INT_get()),
    FLAG_FULL_CHR_H_INP(VideoJNI.MediaPictureResampler_FLAG_FULL_CHR_H_INP_get()),
    FLAG_DIRECT_BGR(VideoJNI.MediaPictureResampler_FLAG_DIRECT_BGR_get()),
    FLAG_ACCURATE_RND(VideoJNI.MediaPictureResampler_FLAG_ACCURATE_RND_get()),
    FLAG_BITEXACT(VideoJNI.MediaPictureResampler_FLAG_BITEXACT_get()),
    FLAG_ERROR_DIFFUSION(VideoJNI.MediaPictureResampler_FLAG_ERROR_DIFFUSION_get()),
  ;

    public final int swigValue() {
      return swigValue;
    }

    public static Flag swigToEnum(int swigValue) {
      Flag[] swigValues = Flag.class.getEnumConstants();
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (Flag swigEnum : swigValues)
        if (swigEnum.swigValue == swigValue)
          return swigEnum;
      throw new IllegalArgumentException("No enum " + Flag.class + " with value " + swigValue);
    }

    @SuppressWarnings("unused")
    private Flag() {
      this.swigValue = SwigNext.next++;
    }

    @SuppressWarnings("unused")
    private Flag(int swigValue) {
      this.swigValue = swigValue;
      SwigNext.next = swigValue+1;
    }

    @SuppressWarnings("unused")
    private Flag(Flag swigEnum) {
      this.swigValue = swigEnum.swigValue;
      SwigNext.next = this.swigValue+1;
    }

    private final int swigValue;

    private static class SwigNext {
      private static int next = 0;
    }
  }

}


/*******************************************************************************
 * Copyright (c) 2013, Art Clarke.  All rights reserved.
 *
 * This file is part of Humble-Video.
 *
 * Humble-Video is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Humble-Video is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Humble-Video.  If not, see <http://www.gnu.org/licenses/>.
 *******************************************************************************/
package io.humble.video.customio;

import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Implementation of URLProtocolHandler that can read from {@link InputStream}
 * objects or write to {@link OutputStream} objects.
 *
 *

 *
 * The {@link IURLProtocolHandler#URL_RDWR} mode is not supported, and
 * {@link #isStreamed(String, int)} will always return true.
 *
 *

 *
 * @author aclarke
 *
 */

public class InputOutputStreamHandler implements IURLProtocolHandler
{
  private final Logger log = LoggerFactory.getLogger(this.getClass());

  /**
   * Whether or not this class will default calling
   * {@link Closeable#close()} on a stream when
   * {@link #close()} is called on this method.  Can be
   * overriden in constructors.
   */
  public final static boolean CLOSE_STREAM_ON_CLOSE=true;

  private final InputStream mInputStream;
  private final OutputStream mOutputStream;
  private final boolean mCloseStreamOnClose;
  private Closeable mOpenStream = null;

  /**
   * Create a handler that can only be opened for reading.
   * @param stream an input stream
   *
   * @throws IllegalArgumentException if stream is null
   */
  public InputOutputStreamHandler(InputStream stream)
  {
    this(stream, null, CLOSE_STREAM_ON_CLOSE);
  }

  /**
   * Create a handler that can only be opened for writing.
   * @param stream an output stream
   * @throws IllegalArgumentException if stream is null
   */
  public InputOutputStreamHandler(OutputStream stream)
  {
    this(null, stream, CLOSE_STREAM_ON_CLOSE);
  }

  /**
   * Creates a new handler.  If you pass in non null arguments
   * for both in and out, the handler may be opened in either
   * {@link IURLProtocolHandler#URL_RDONLY_MODE} or
   * {@link IURLProtocolHandler#URL_WRONLY_MODE}, but not at
   * the same time.
   *

   * {@link IURLProtocolHandler#URL_RDWR} mode is not supported
   * by this handler.
   *

   * @param in The stream to read from if asked to.
   * @param out The stream to write from if asked to.
   * @param closeStreamOnClose Whether or not to automatically
   *   call {@link Closeable#close()} on the given stream
   *   when {@link #close()} is called.
   * @throws IllegalArgumentException if both in and out are null
   */
  public InputOutputStreamHandler(InputStream in, OutputStream out,
      boolean closeStreamOnClose)
  {
    if (in == null && out == null)
      throw new IllegalArgumentException("must pass one non null stream");
    mInputStream = in;
    mOutputStream = out;
    mCloseStreamOnClose = closeStreamOnClose;
  }

  /**
   * {@inheritDoc}
   */

  public int close()
  {
    int retval = 0;
    try
    {
      if (mOpenStream != null && mCloseStreamOnClose)
      {
        mOpenStream.close();
      }
    }
    catch (IOException e)
    {
      log.error("could not close stream {}: {}", mOpenStream, e);
      retval = -1;
    }
    mOpenStream = null;
    return retval;
  }

  /**
   * {@inheritDoc}
   */

  public int open(String url, int flags)
  {
    if (mOpenStream != null)
    {
      log.debug("attempting to open already open handler: {}",
          mOpenStream);
      return -1;
    }
    switch (flags)
    {
      case URL_RDWR:
        log.debug("do not support read/write mode for Java IO Handlers");
        return -1;
      case URL_WRONLY_MODE:
        mOpenStream = mOutputStream;
        if (mOpenStream == null)
        {
          log.error("No OutputStream specified for writing: {}",url);
          return -1;
        }
        break;
      case URL_RDONLY_MODE:
        mOpenStream = mInputStream;
        if (mOpenStream == null)
        {
          log.error("No InputStream specified for reading: {}", url);
          return -1;
        }
        break;
      default:
        log.error("Invalid flag passed to open: {}", url);
        return -1;
    }

    return 0;
  }

  /**
   * {@inheritDoc}
   */

  public int read(byte[] buf, int size)
  {
    int ret = -1;
    if (mOpenStream == null || !(mOpenStream instanceof InputStream))
      return -1;

    try
    {
      InputStream stream = (InputStream) mOpenStream;
      ret = stream.read(buf, 0, size);
      return ret;
    }
    catch (IOException e)
    {
      log.error("Got IO exception reading from stream: {}; {}",
          mOpenStream, e);
      return -1;
    }
  }

  /**
   * {@inheritDoc}
   *
   * This method is not supported on this class and always return -1;
   */

  public long seek(long offset, int whence)
  {
    return -1;
  }

  /**
   * {@inheritDoc}
   */

  public int write(byte[] buf, int size)
  {
    if (mOpenStream == null ||
        !(mOpenStream instanceof OutputStream))
      return -1;

    try
    {
      OutputStream stream = (OutputStream) mOpenStream;
      stream.write(buf, 0, size);
      return size;
    }
    catch (IOException e)
    {
      log.error("Got error writing to file: {}; {}", mOpenStream, e);
      return -1;
    }
  }

  /**
   * {@inheritDoc}
   * Always true for this class.
   */

  public boolean isStreamed(String url, int flags)
  {
    return true;
  }
  /**
   * Returns the stream we'd input from if asked.
   * @return the inputStream
   */
  public InputStream getInputStream()
  {
    return mInputStream;
  }
  /**
   * Returns the stream we'd output to if asked.
   * @return the outputStream
   */
  public OutputStream getOutputStream()
  {
    return mOutputStream;
  }
  /**
   * Returns the stream currently {@link #open(String, int)}.
   * @return the openStream
   */
  public Closeable getOpenStream()
  {
    return mOpenStream;
  }

  /**
   * Will this handler call {@link Closeable#close()} automatically
   * when its {@link #close()} method is called by Humble Video?
   *
   * @return the closeStreamOnClose setting
   */
  public boolean isCloseStreamOnClose()
  {
    return mCloseStreamOnClose;
  }

}


/* ----------------------------------------------------------------------------
 * 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.*;
/**
 * KeyValueBag is a bag of key/value pairs that can be embedded

 * in some Container or some Stream

 * in an Container, and are then written to

 * or read from a media file.  Keys must be unique, and

 * any attempt to set a key value replaces any previous values.

 *

 *

 * An example is the "title" meta-data item in an MP3 file.

 *

 *

 * Support for KeyValueBag differs depending upon the

 * Container format you're using and the implementation

 * in FFmpeg.  For example,

 * MP3 meta-data reading and writing is supported, but

 * (as of the writing of this comment) FLV meta-data writing

 * is not supported.

 *

 */
public class KeyValueBag extends RefCounted {
  // 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 KeyValueBag(long cPtr, boolean cMemoryOwn) {
    super(VideoJNI.KeyValueBag_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  /**
   * Internal Only.
   */
  protected KeyValueBag(long cPtr, boolean cMemoryOwn,
      java.util.concurrent.atomic.AtomicLong ref)
  {
    super(VideoJNI.KeyValueBag_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(KeyValueBag 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 KeyValueBag object that is actually referring to the
   * exact same underlying native object.
   *
   * @return the new Java object.
   */
  @Override
  public KeyValueBag copyReference() {
    if (swigCPtr == 0)
      return null;
    else
      return new KeyValueBag(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 KeyValueBag)
      equal = (((KeyValueBag)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

  /**
   * Return the meta-data, with all values expanded.
   */
  @Override
  public String toString()
  {
    StringBuilder result = new StringBuilder();
    result.append(this.getClass().getName()).append("@").append(hashCode());
    result.append("[");
    java.util.Collection<String> keys = getKeys();
    for(String key: keys)
    {
      String value = getValue(key, KeyValueBag.Flags.KVB_NONE);
      result.append(key).append("=").append(value).append(";");
    }
    result.append("]");
    return result.toString();
  }

  /**
   * Get the set of keys currently in this {@link KeyValueBag} object
   * as an unordered collection.
   * @return the keys.
   */
  public java.util.Collection<String> getKeys()
  {
    int numKeys = getNumKeys();

    java.util.List<String> retval = new java.util.ArrayList<String>(numKeys);
    for(int i = 0; i < getNumKeys(); i++)
    {
      String key = getKey(i);
      if (key != null && key.length() > 0)
        retval.add(key);
    }
    return retval;
  }

  /**
   * Return the value for this key, comparing case insensitively.
   * @param key the key
   * @return the value.
   */
  public String getValue(String key)
  {
    return getValue(key, KeyValueBag.Flags.KVB_NONE);
  }

/**
 * Get the total number of keys currently in this

 * KeyValueBag object.

 *

 * @return the number of keys.
 */
  public int getNumKeys() {
    return VideoJNI.KeyValueBag_getNumKeys(swigCPtr, this);
  }

/**
 * Get the key at the given position, or null if no such

 * key at that position.

 *

 *

 * Note: positions of keys may change between

 * calls to #setValue(String, String) and

 * should be requiried.

 *

 *

 * @param position The position.  Must be >=0 and <

 * #getNumKeys().

 *

 * @return the key, or null if not found.
 */
  private String getKey(int position) {
    return VideoJNI.KeyValueBag_getKey(swigCPtr, this, position);
  }

/**
 * Get the value for the given key.

 *

 * @param key The key

 * @param flag A flag for how to search

 *

 * @return The value, or null if none.
 */
  public String getValue(String key, KeyValueBag.Flags flag) {
    return VideoJNI.KeyValueBag_getValue(swigCPtr, this, key, flag.swigValue());
  }

/**
 * Sets the value for the given key to value.  This overrides

 * any prior setting for key, or adds key to the meta-data

 * if appropriate.

 *

 * @param key The key to set.

 * @param value The value to set.
 */
  public int setValue(String key, String value) {
    return VideoJNI.KeyValueBag_setValue__SWIG_0(swigCPtr, this, key, value);
  }

/**
 * Create a new KeyValueBag bag of properties with

 * no values set.
 */
  public static KeyValueBag make() {
    long cPtr = VideoJNI.KeyValueBag_make();
    return (cPtr == 0) ? null : new KeyValueBag(cPtr, false);
  }

/**
 * Sets the value for the given key to value.  This overrides

 * any prior setting for key, or adds key to the meta-data

 * if appropriate.

 *

 * @param key The key to set.

 * @param value The value to set.

 * @param flag A flag on how this should be set.

 *

 * @since 5.0
 */
  public int setValue(String key, String value, KeyValueBag.Flags flag) {
    return VideoJNI.KeyValueBag_setValue__SWIG_1(swigCPtr, this, key, value, flag.swigValue());
  }

  /**
   * Different types of flags that can be passed to KeyValueBag#getValue
   */
  public enum Flags {
  /**
   * For #getValue(String) case-insensitive match of key.
   */
    KVB_NONE(VideoJNI.KeyValueBag_KVB_NONE_get()),
  /**
   * For #getValue(String) case-sensitive match of key.
   */
    KVB_MATCH_CASE(VideoJNI.KeyValueBag_KVB_MATCH_CASE_get()),
  /**
   * For #setValue(String,String,Flags) do not overwrite existing value -- append another key/value pair.
   */
    KVB_DONT_OVERWRITE(VideoJNI.KeyValueBag_KVB_DONT_OVERWRITE_get()),
  /**
   * For #setValue(String,String,Flags) append to the existing value in a key (string append).
   */
    KVB_APPEND(VideoJNI.KeyValueBag_KVB_APPEND_get()),
  ;

    public final int swigValue() {
      return swigValue;
    }

    public static Flags swigToEnum(int swigValue) {
      Flags[] swigValues = Flags.class.getEnumConstants();
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (Flags swigEnum : swigValues)
        if (swigEnum.swigValue == swigValue)
          return swigEnum;
      throw new IllegalArgumentException("No enum " + Flags.class + " with value " + swigValue);
    }

    @SuppressWarnings("unused")
    private Flags() {
      this.swigValue = SwigNext.next++;
    }

    @SuppressWarnings("unused")
    private Flags(int swigValue) {
      this.swigValue = swigValue;
      SwigNext.next = swigValue+1;
    }

    @SuppressWarnings("unused")
    private Flags(Flags swigEnum) {
      this.swigValue = swigEnum.swigValue;
      SwigNext.next = this.swigValue+1;
    }

    private final int swigValue;

    private static class SwigNext {
      private static int next = 0;
    }
  }

}


/* ----------------------------------------------------------------------------
 * 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.*;
/**
 * An object that either converts MediaRaw objects into MediaEncoded

 * objects (called an Encoder), or converts in the reverse direction (called

 * a Decoder).

 *

 * Although this object might seem very sparse, use the methods on Configurable

 * to see the vast array of options that can be get/set on it.
 */
public class Coder extends Configurable {
  // 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 Coder(long cPtr, boolean cMemoryOwn) {
    super(VideoJNI.Coder_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  /**
   * Internal Only.
   */
  protected Coder(long cPtr, boolean cMemoryOwn,
      java.util.concurrent.atomic.AtomicLong ref)
  {
    super(VideoJNI.Coder_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(Coder 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 Coder object that is actually referring to the
   * exact same underlying native object.
   *
   * @return the new Java object.
   */
  @Override
  public Coder copyReference() {
    if (swigCPtr == 0)
      return null;
    else
      return new Coder(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 Coder)
      equal = (((Coder)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

  @Override
  public String toString()
  {
    StringBuilder result = new StringBuilder();
    MediaDescriptor.Type type = getCodecType();

    result.append(this.getClass().getName()+"@"+hashCode()+"[");
    result.append("codec="+getCodec()+";");
    result.append("time base="+getTimeBase()+";");
    switch(type)
    {
      case MEDIA_VIDEO:
        result.append("width="+getWidth()+";");
        result.append("height="+getHeight()+";");
        result.append("pixel format="+getPixelFormat()+";");
        break;
      case MEDIA_AUDIO:
        result.append("sample rate="+getSampleRate()+";");
        result.append("channels="+getChannels()+";");
        result.append("sample format="+getSampleFormat()+";");
        break;
      default:
        break;
    }
    result.append("frame size="+getFrameSize()+";");
    result.append("frame count="+getFrameCount()+";");

    result.append("]");
    return result.toString();
  }

/**
 * Open this Coder, using the given bag of Codec-specific options.

 *

 * @param inputOptions If non-null, a bag of codec-specific options.

 * @param unsetOptions If non-null, the bag will be emptied and then filled with

 *                     the options in inputOptions that were not set.
 */
  public void open(KeyValueBag inputOptions, KeyValueBag unsetOptions) {
    VideoJNI.Coder_open(swigCPtr, this, KeyValueBag.getCPtr(inputOptions), inputOptions, KeyValueBag.getCPtr(unsetOptions), unsetOptions);
  }

/**
 * The Codec this StreamCoder will use.

 *

 * @return The Codec used by this StreamCoder, or 0 (null) if none.
 */
  public Codec getCodec() {
    long cPtr = VideoJNI.Coder_getCodec(swigCPtr, this);
    return (cPtr == 0) ? null : new Codec(cPtr, false);
  }

/**
 * A short hand for getCodec().getType().

 *

 * @return The Type of the Codec we'll use.
 */
  public MediaDescriptor.Type getCodecType() {
    return MediaDescriptor.Type.swigToEnum(VideoJNI.Coder_getCodecType(swigCPtr, this));
  }

/**
 * A short hand for getCodec().getID().

 *

 * @return The ID of the Codec we'll use.
 */
  public Codec.ID getCodecID() {
    return Codec.ID.swigToEnum(VideoJNI.Coder_getCodecID(swigCPtr, this));
  }

/**
 * The height, in pixels.

 *

 * @return The height of the video frames in the attached stream

 *   or -1 if an audio stream, or we cannot determine the height.
 */
  public int getHeight() {
    return VideoJNI.Coder_getHeight(swigCPtr, this);
  }

/**
 * Set the height, in pixels.

 *

 * @see #getHeight()

 *

 * @param height Sets the height of video frames we'll encode.  No-op when DECODING.
 */
  public void setHeight(int height) {
    VideoJNI.Coder_setHeight(swigCPtr, this, height);
  }

/**
 * The width, in pixels.

 *

 * @return The width of the video frames in the attached stream

 *   or -1 if an audio stream, or we cannot determine the width.
 */
  public int getWidth() {
    return VideoJNI.Coder_getWidth(swigCPtr, this);
  }

/**
 * Set the width, in pixels

 *

 * @see #getWidth()

 *

 * @param width Sets the width of video frames we'll encode.  No-op when DECODING.
 */
  public void setWidth(int width) {
    VideoJNI.Coder_setWidth(swigCPtr, this, width);
  }

/**
 * For Video streams, get the Pixel Format in use by the stream.

 *

 * @return the Pixel format, or PixelFormat::PIX_FMT_NONE if audio.
 */
  public PixelFormat.Type getPixelFormat() {
    return PixelFormat.Type.swigToEnum(VideoJNI.Coder_getPixelFormat(swigCPtr, this));
  }

/**
 * Set the pixel format to ENCODE with.  Ignored if audio or

 * DECODING.

 *

 * @param pixelFmt Pixel format to use.
 */
  public void setPixelFormat(PixelFormat.Type pixelFmt) {
    VideoJNI.Coder_setPixelFormat(swigCPtr, this, pixelFmt.swigValue());
  }

/**
 * Get the sample rate we use for this coder.

 *

 * @return The sample rate (in Hz) we use for this stream, or -1 if unknown or video.
 */
  public int getSampleRate() {
    return VideoJNI.Coder_getSampleRate(swigCPtr, this);
  }

/**
 * Set the sample rate to use when ENCODING.  Ignored if DECODING

 * or a non-audio stream.

 *

 * @param sampleRate New sample rate (in Hz) to use.
 */
  public void setSampleRate(int sampleRate) {
    VideoJNI.Coder_setSampleRate(swigCPtr, this, sampleRate);
  }

/**
 * Get the audio sample format.

 *

 * @return The sample format of samples for encoding/decoding.
 */
  public AudioFormat.Type getSampleFormat() {
    return AudioFormat.Type.swigToEnum(VideoJNI.Coder_getSampleFormat(swigCPtr, this));
  }

/**
 * Set the sample format when ENCODING.  Ignored if DECODING

 * or if the coder is already open.

 *

 * @param format The sample format.
 */
  public void setSampleFormat(AudioFormat.Type format) {
    VideoJNI.Coder_setSampleFormat(swigCPtr, this, format.swigValue());
  }

/**
 * Get the number of channels in this audio stream

 *

 * @return The sample rate (in Hz) we use for this stream, or 0 if unknown.
 */
  public int getChannels() {
    return VideoJNI.Coder_getChannels(swigCPtr, this);
  }

/**
 * Set the number of channels to use when ENCODING.  Ignored if a

 * non audio stream, or if DECODING.

 *

 * @param channels The number of channels we'll encode with.
 */
  public void setChannels(int channels) {
    VideoJNI.Coder_setChannels(swigCPtr, this, channels);
  }

/**
 * Get the channel layout.
 */
  public AudioChannel.Layout getChannelLayout() {
    return AudioChannel.Layout.swigToEnum(VideoJNI.Coder_getChannelLayout(swigCPtr, this));
  }

/**
 * Set the channel layout
 */
  public void setChannelLayout(AudioChannel.Layout layout) {
    VideoJNI.Coder_setChannelLayout(swigCPtr, this, layout.swigValue());
  }

/**
 * Get the time base this stream will ENCODE in, or the time base we

 * detect while DECODING.

 *

 * @return The time base this StreamCoder is using.
 */
  public Rational getTimeBase() {
    long cPtr = VideoJNI.Coder_getTimeBase(swigCPtr, this);
    return (cPtr == 0) ? null : new Rational(cPtr, false);
  }

/**
 * Set the time base we'll use to ENCODE with.  A no-op when DECODING.

 *

 * As a convenience, we forward this call to the Stream#setTimeBase()

 * method.

 *

 * @see #getTimeBase()

 *

 * @param newTimeBase The new time base to use.
 */
  public void setTimeBase(Rational newTimeBase) {
    VideoJNI.Coder_setTimeBase(swigCPtr, this, Rational.getCPtr(newTimeBase), newTimeBase);
  }

/**
 * Get the state of this coder.
 */
  public Coder.State getState() {
    return Coder.State.swigToEnum(VideoJNI.Coder_getState(swigCPtr, this));
  }

/**
 * Get the number of frames encoded/decoded so far.

 * If encoding or decoding has an error, this count is not incremented.
 */
  public int getFrameCount() {
    return VideoJNI.Coder_getFrameCount(swigCPtr, this);
  }

/**
 * Number of samples per channel in an audio frame.

 *

 * - encoding: Each submitted frame

 *   except the last must contain exactly frame_size samples per channel.

 *   May be 0 when the codec has CODEC_CAP_VARIABLE_FRAME_SIZE set, then the

 *   frame size is not restricted.

 * - decoding: may be set by some decoders to indicate constant frame size

 *

 * @return number of samples per channel.
 */
  public int getFrameSize() {
    return VideoJNI.Coder_getFrameSize(swigCPtr, this);
  }

/**
 * Get the 32-bit compliment of all flags.
 */
  public int getFlags() {
    return VideoJNI.Coder_getFlags(swigCPtr, this);
  }

/**
 * Check if a given flag is set.
 */
  public int getFlag(Coder.Flag flag) {
    return VideoJNI.Coder_getFlag(swigCPtr, this, flag.swigValue());
  }

/**
 * Get the 32-bit compliment of all flags 2 flags
 */
  public int getFlags2() {
    return VideoJNI.Coder_getFlags2(swigCPtr, this);
  }

/**
 * Check if a given flag2 flag is set.
 */
  public int getFlag2(Coder.Flag2 flag) {
    return VideoJNI.Coder_getFlag2(swigCPtr, this, flag.swigValue());
  }

/**
 * Set a new bitmask of all Flag values (bit xored together).
 */
  public void setFlags(int newVal) {
    VideoJNI.Coder_setFlags(swigCPtr, this, newVal);
  }

/**
 * Set a flag to true or false.
 */
  public void setFlag(Coder.Flag flag, boolean value) {
    VideoJNI.Coder_setFlag(swigCPtr, this, flag.swigValue(), value);
  }

/**
 * Set a new bitmask of all Flag2 values (bit xored together).
 */
  public void setFlags2(int newVal) {
    VideoJNI.Coder_setFlags2(swigCPtr, this, newVal);
  }

/**
 * Set a flag2 to true or false.
 */
  public void setFlag2(Coder.Flag2 flag, boolean value) {
    VideoJNI.Coder_setFlag2(swigCPtr, this, flag.swigValue(), value);
  }

  /**
   * The state that a Coder can be in.
   */
  public enum State {
    STATE_INITED,
    STATE_OPENED,
    STATE_FLUSHING,
    STATE_ERROR,
  ;

    public final int swigValue() {
      return swigValue;
    }

    public static State swigToEnum(int swigValue) {
      State[] swigValues = State.class.getEnumConstants();
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (State swigEnum : swigValues)
        if (swigEnum.swigValue == swigValue)
          return swigEnum;
      throw new IllegalArgumentException("No enum " + State.class + " with value " + swigValue);
    }

    @SuppressWarnings("unused")
    private State() {
      this.swigValue = SwigNext.next++;
    }

    @SuppressWarnings("unused")
    private State(int swigValue) {
      this.swigValue = swigValue;
      SwigNext.next = swigValue+1;
    }

    @SuppressWarnings("unused")
    private State(State swigEnum) {
      this.swigValue = swigEnum.swigValue;
      SwigNext.next = this.swigValue+1;
    }

    private final int swigValue;

    private static class SwigNext {
      private static int next = 0;
    }
  }

  public enum Flag {
    FLAG_UNALIGNED(VideoJNI.Coder_FLAG_UNALIGNED_get()),
  /**
   * Use fixed qscale.
   */
    FLAG_QSCALE(VideoJNI.Coder_FLAG_QSCALE_get()),
  /**
   * 4 MV per MB allowed / advanced prediction for H.263.
   */
    FLAG_4MV(VideoJNI.Coder_FLAG_4MV_get()),
  /**
   * Use qpel MC.
   */
    FLAG_QPEL(VideoJNI.Coder_FLAG_QPEL_get()),
  /**
   * Use GMC.
   */
    FLAG_GMC(VideoJNI.Coder_FLAG_GMC_get()),
  /**
   * Always try a MB with MV=<0,0>.
   */
    FLAG_MV0(VideoJNI.Coder_FLAG_MV0_get()),
  /**
   * The parent program guarantees that the input for B-frames containing

   * streams is not written to for at least s->max_b_frames+1 frames, if

   * this is not set the input will be copied.
   */
    FLAG_INPUT_PRESERVED(VideoJNI.Coder_FLAG_INPUT_PRESERVED_get()),
  /**
   * Use internal 2pass ratecontrol in first pass mode.
   */
    FLAG_PASS1(VideoJNI.Coder_FLAG_PASS1_get()),
  /**
   * Use internal 2pass ratecontrol in second pass mode.
   */
    FLAG_PASS2(VideoJNI.Coder_FLAG_PASS2_get()),
  /**
   * Only decode/encode grayscale.
   */
    FLAG_GRAY(VideoJNI.Coder_FLAG_GRAY_get()),
  /**
   * Don't draw edges.
   */
    FLAG_EMU_EDGE(VideoJNI.Coder_FLAG_EMU_EDGE_get()),
  /**
   * error[?] variables will be set during encoding.
   */
    FLAG_PSNR(VideoJNI.Coder_FLAG_PSNR_get()),
  /**
   * Input bitstream might be truncated at a random

   * location instead of only at frame boundaries.
   */
    FLAG_TRUNCATED(VideoJNI.Coder_FLAG_TRUNCATED_get()),
  /**
   * Normalize adaptive quantization.
   */
    FLAG_NORMALIZE_AQP(VideoJNI.Coder_FLAG_NORMALIZE_AQP_get()),
  /**
   * Use interlaced DCT.
   */
    FLAG_INTERLACED_DCT(VideoJNI.Coder_FLAG_INTERLACED_DCT_get()),
  /**
   * Force low delay.
   */
    FLAG_LOW_DELAY(VideoJNI.Coder_FLAG_LOW_DELAY_get()),
  /**
   * Place global headers in extradata instead of every keyframe.
   */
    FLAG_GLOBAL_HEADER(VideoJNI.Coder_FLAG_GLOBAL_HEADER_get()),
  /**
   * Use only bitexact stuff (except (I)DCT).
   */
    FLAG_BITEXACT(VideoJNI.Coder_FLAG_BITEXACT_get()),
  /**
   * H.263 advanced intra coding / MPEG-4 AC prediction
   */
    FLAG_AC_PRED(VideoJNI.Coder_FLAG_AC_PRED_get()),
  /**
   * loop filter
   */
    FLAG_LOOP_FILTER(VideoJNI.Coder_FLAG_LOOP_FILTER_get()),
  /**
   * interlaced motion estimation
   */
    FLAG_INTERLACED_ME(VideoJNI.Coder_FLAG_INTERLACED_ME_get()),
    FLAG_CLOSED_GOP(VideoJNI.Coder_FLAG_CLOSED_GOP_get()),
  ;

    public final int swigValue() {
      return swigValue;
    }

    public static Flag swigToEnum(int swigValue) {
      Flag[] swigValues = Flag.class.getEnumConstants();
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (Flag swigEnum : swigValues)
        if (swigEnum.swigValue == swigValue)
          return swigEnum;
      throw new IllegalArgumentException("No enum " + Flag.class + " with value " + swigValue);
    }

    @SuppressWarnings("unused")
    private Flag() {
      this.swigValue = SwigNext.next++;
    }

    @SuppressWarnings("unused")
    private Flag(int swigValue) {
      this.swigValue = swigValue;
      SwigNext.next = swigValue+1;
    }

    @SuppressWarnings("unused")
    private Flag(Flag swigEnum) {
      this.swigValue = swigEnum.swigValue;
      SwigNext.next = this.swigValue+1;
    }

    private final int swigValue;

    private static class SwigNext {
      private static int next = 0;
    }
  }

  public enum Flag2 {
  /**
   * Allow non spec compliant speedup tricks.
   */
    FLAG2_FAST(VideoJNI.Coder_FLAG2_FAST_get()),
  /**
   * Skip bitstream encoding.
   */
    FLAG2_NO_OUTPUT(VideoJNI.Coder_FLAG2_NO_OUTPUT_get()),
  /**
   * Place global headers at every keyframe instead of in extradata.
   */
    FLAG2_LOCAL_HEADER(VideoJNI.Coder_FLAG2_LOCAL_HEADER_get()),
  /**
   * timecode is in drop frame format. DEPRECATED!!!!
   */
    FLAG2_DROP_FRAME_TIMECODE(VideoJNI.Coder_FLAG2_DROP_FRAME_TIMECODE_get()),
  /**
   * Discard cropping information from SPS.
   */
    FLAG2_IGNORE_CROP(VideoJNI.Coder_FLAG2_IGNORE_CROP_get()),
  /**
   * Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries.
   */
    FLAG2_CHUNKS(VideoJNI.Coder_FLAG2_CHUNKS_get()),
  /**
   * Show all frames before the first keyframe
   */
    FLAG2_SHOW_ALL(VideoJNI.Coder_FLAG2_SHOW_ALL_get()),
  /**
   * Export motion vectors through frame side data
   */
    FLAG2_EXPORT_MVS(VideoJNI.Coder_FLAG2_EXPORT_MVS_get()),
  ;

    public final int swigValue() {
      return swigValue;
    }

    public static Flag2 swigToEnum(int swigValue) {
      Flag2[] swigValues = Flag2.class.getEnumConstants();
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (Flag2 swigEnum : swigValues)
        if (swigEnum.swigValue == swigValue)
          return swigEnum;
      throw new IllegalArgumentException("No enum " + Flag2.class + " with value " + swigValue);
    }

    @SuppressWarnings("unused")
    private Flag2() {
      this.swigValue = SwigNext.next++;
    }

    @SuppressWarnings("unused")
    private Flag2(int swigValue) {
      this.swigValue = swigValue;
      SwigNext.next = swigValue+1;
    }

    @SuppressWarnings("unused")
    private Flag2(Flag2 swigEnum) {
      this.swigValue = swigEnum.swigValue;
      SwigNext.next = this.swigValue+1;
    }

    private final int swigValue;

    private static class SwigNext {
      private static int next = 0;
    }
  }

}


/* ----------------------------------------------------------------------------
 * 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.*;
/**
 * A ContainerStream object representing a stream contained in a readable Container.
 */
public class DemuxerStream extends ContainerStream {
  // 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 DemuxerStream(long cPtr, boolean cMemoryOwn) {
    super(VideoJNI.DemuxerStream_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  /**
   * Internal Only.
   */
  protected DemuxerStream(long cPtr, boolean cMemoryOwn,
      java.util.concurrent.atomic.AtomicLong ref)
  {
    super(VideoJNI.DemuxerStream_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(DemuxerStream 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 DemuxerStream object that is actually referring to the
   * exact same underlying native object.
   *
   * @return the new Java object.
   */
  @Override
  public DemuxerStream copyReference() {
    if (swigCPtr == 0)
      return null;
    else
      return new DemuxerStream(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 DemuxerStream)
      equal = (((DemuxerStream)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

  /**
   * info about this stream
   * @return information about this stream
   */

  @Override
  public String toString()
  {
    StringBuilder result = new StringBuilder();

    result.append(this.getClass().getName()+"@"+hashCode()+"[");
    result.append("index:"+getIndex()+";");
    result.append("id:"+getId()+";");
    //result.append("streamcoder:"+getStreamCoder()+";");
    result.append("framerate:"+getFrameRate()+";");
    result.append("timebase:"+getTimeBase()+";");
    result.append("]");
    return result.toString();
  }

/**
 * Get the decoder that can decode the information in this Demuxer stream.
 */
  public Decoder getDecoder() {
    long cPtr = VideoJNI.DemuxerStream_getDecoder(swigCPtr, this);
    return (cPtr == 0) ? null : new Decoder(cPtr, false);
  }

/**
 * Get the Demuxer this DemuxerStream belongs to.
 */
  public Demuxer getDemuxer() {
    long cPtr = VideoJNI.DemuxerStream_getDemuxer(swigCPtr, this);
    return (cPtr == 0) ? null : new Demuxer(cPtr, false);
  }

}