001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 4.0.2 004 * 005 * Do not make changes to this file unless you know what you are doing--modify 006 * the SWIG interface file instead. 007 * ----------------------------------------------------------------------------- */ 008 009package com.avpkit.core; 010import com.avpkit.ferry.*; 011public class IBufferSource extends IMediaFilter { 012 // JNIHelper.swg: Start generated code 013 // >>>>>>>>>>>>>>>>>>>>>>>>>>> 014 /** 015 * This method is only here to use some references and remove 016 * a Eclipse compiler warning. 017 */ 018 @SuppressWarnings("unused") 019 private void noop() 020 { 021 IBuffer.make(null, 1); 022 } 023 024 private volatile long swigCPtr; 025 026 /** 027 * Internal Only. 028 */ 029 protected IBufferSource(long cPtr, boolean cMemoryOwn) { 030 super(AVPKitJNI.IBufferSource_SWIGUpcast(cPtr), cMemoryOwn); 031 swigCPtr = cPtr; 032 } 033 034 /** 035 * Internal Only. 036 */ 037 protected IBufferSource(long cPtr, boolean cMemoryOwn, 038 java.util.concurrent.atomic.AtomicLong ref) 039 { 040 super(AVPKitJNI.IBufferSource_SWIGUpcast(cPtr), 041 cMemoryOwn, ref); 042 swigCPtr = cPtr; 043 } 044 045 /** 046 * Internal Only. Not part of public API. 047 * 048 * Get the raw value of the native object that obj is proxying for. 049 * 050 * @param obj The java proxy object for a native object. 051 * @return The raw pointer obj is proxying for. 052 */ 053 public static long getCPtr(IBufferSource obj) { 054 if (obj == null) return 0; 055 return obj.getMyCPtr(); 056 } 057 058 /** 059 * Internal Only. Not part of public API. 060 * 061 * Get the raw value of the native object that we're proxying for. 062 * 063 * @return The raw pointer we're proxying for. 064 */ 065 public long getMyCPtr() { 066 if (swigCPtr == 0) throw new IllegalStateException("underlying native object already deleted"); 067 return swigCPtr; 068 } 069 070 /** 071 * Create a new IBufferSource object that is actually referring to the 072 * exact same underlying native object. 073 * 074 * @return the new Java object. 075 */ 076 @Override 077 public IBufferSource copyReference() { 078 if (swigCPtr == 0) 079 return null; 080 else 081 return new IBufferSource(swigCPtr, swigCMemOwn, getJavaRefCount()); 082 } 083 084 /** 085 * Compares two values, returning true if the underlying objects in native code are the same object. 086 * 087 * That means you can have two different Java objects, but when you do a comparison, you'll find out 088 * they are the EXACT same object. 089 * 090 * @return True if the underlying native object is the same. False otherwise. 091 */ 092 public boolean equals(Object obj) { 093 boolean equal = false; 094 if (obj instanceof IBufferSource) 095 equal = (((IBufferSource)obj).swigCPtr == this.swigCPtr); 096 return equal; 097 } 098 099 /** 100 * Get a hashable value for this object. 101 * 102 * @return the hashable value. 103 */ 104 public int hashCode() { 105 return (int)swigCPtr; 106 } 107 108 // <<<<<<<<<<<<<<<<<<<<<<<<<<< 109 // JNIHelper.swg: End generated code 110 111 /** 112 * Adds audio samples to this filter<br> 113 * <br> 114 * @param samples the audio samples to add<br> 115 * @return 0 on success or <0 if an error occurs 116 */ 117 public int addAudioSamples(IAudioSamples samples) { 118 return AVPKitJNI.IBufferSource_addAudioSamples(swigCPtr, this, IAudioSamples.getCPtr(samples), samples); 119 } 120 121 /** 122 * Adds picture to this filter<br> 123 * <br> 124 * @param picture the picture to add<br> 125 * @return 0 on success or <0 if an error occurs 126 */ 127 public int addVideoPicture(IVideoPicture picture) { 128 return AVPKitJNI.IBufferSource_addVideoPicture(swigCPtr, this, IVideoPicture.getCPtr(picture), picture); 129 } 130 131}