PageRenderTime 45ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/java/xuggle-xuggler/generated/java/com/xuggle/xuggler/IVideoResampler.java

http://xuggle.googlecode.com/
Java | 409 lines | 161 code | 43 blank | 205 comment | 20 complexity | 725357a1ffcaf3879a8e60275cccd4d1 MD5 | raw file
Possible License(s): CC-BY-SA-3.0, LGPL-2.0, BSD-3-Clause, Apache-2.0, LGPL-2.1, GPL-3.0, LGPL-3.0, GPL-2.0
  1. /* ----------------------------------------------------------------------------
  2. * This file was automatically generated by SWIG (http://www.swig.org).
  3. * Version 2.0.0
  4. *
  5. * Do not make changes to this file unless you know what you are doing--modify
  6. * the SWIG interface file instead.
  7. * ----------------------------------------------------------------------------- */
  8. package com.xuggle.xuggler;
  9. import com.xuggle.ferry.*;
  10. /**
  11. * Converts {@link IVideoPicture} objects of a given width, height and
  12. * format to a new
  13. * width, height or format.
  14. */
  15. public class IVideoResampler extends RefCounted implements com.xuggle.xuggler.IConfigurable {
  16. // JNIHelper.swg: Start generated code
  17. // >>>>>>>>>>>>>>>>>>>>>>>>>>>
  18. /**
  19. * This method is only here to use some references and remove
  20. * a Eclipse compiler warning.
  21. */
  22. @SuppressWarnings("unused")
  23. private void noop()
  24. {
  25. IBuffer.make(null, 1);
  26. }
  27. private volatile long swigCPtr;
  28. /**
  29. * Internal Only.
  30. */
  31. protected IVideoResampler(long cPtr, boolean cMemoryOwn) {
  32. super(XugglerJNI.SWIGIVideoResamplerUpcast(cPtr), cMemoryOwn);
  33. swigCPtr = cPtr;
  34. }
  35. /**
  36. * Internal Only.
  37. */
  38. protected IVideoResampler(long cPtr, boolean cMemoryOwn,
  39. java.util.concurrent.atomic.AtomicLong ref)
  40. {
  41. super(XugglerJNI.SWIGIVideoResamplerUpcast(cPtr),
  42. cMemoryOwn, ref);
  43. swigCPtr = cPtr;
  44. }
  45. /**
  46. * Internal Only. Not part of public API.
  47. *
  48. * Get the raw value of the native object that obj is proxying for.
  49. *
  50. * @param obj The java proxy object for a native object.
  51. * @return The raw pointer obj is proxying for.
  52. */
  53. public static long getCPtr(IVideoResampler obj) {
  54. if (obj == null) return 0;
  55. return obj.getMyCPtr();
  56. }
  57. /**
  58. * Internal Only. Not part of public API.
  59. *
  60. * Get the raw value of the native object that we're proxying for.
  61. *
  62. * @return The raw pointer we're proxying for.
  63. */
  64. public long getMyCPtr() {
  65. if (swigCPtr == 0) throw new IllegalStateException("underlying native object already deleted");
  66. return swigCPtr;
  67. }
  68. /**
  69. * Create a new IVideoResampler object that is actually referring to the
  70. * exact same underlying native object.
  71. *
  72. * @return the new Java object.
  73. */
  74. @Override
  75. public IVideoResampler copyReference() {
  76. if (swigCPtr == 0)
  77. return null;
  78. else
  79. return new IVideoResampler(swigCPtr, swigCMemOwn, getJavaRefCount());
  80. }
  81. /**
  82. * Compares two values, returning true if the underlying objects in native code are the same object.
  83. *
  84. * That means you can have two different Java objects, but when you do a comparison, you'll find out
  85. * they are the EXACT same object.
  86. *
  87. * @return True if the underlying native object is the same. False otherwise.
  88. */
  89. public boolean equals(Object obj) {
  90. boolean equal = false;
  91. if (obj instanceof IVideoResampler)
  92. equal = (((IVideoResampler)obj).swigCPtr == this.swigCPtr);
  93. return equal;
  94. }
  95. /**
  96. * Get a hashable value for this object.
  97. *
  98. * @return the hashable value.
  99. */
  100. public int hashCode() {
  101. return (int)swigCPtr;
  102. }
  103. // <<<<<<<<<<<<<<<<<<<<<<<<<<<
  104. // JNIHelper.swg: End generated code
  105. /**
  106. * {@inheritDoc}
  107. */
  108. public java.util.Collection<String> getPropertyNames()
  109. {
  110. java.util.Collection<String> retval = new java.util.LinkedList<String>();
  111. int numProperties = this.getNumProperties();
  112. for(int i = 0; i < numProperties; i++)
  113. {
  114. IProperty property = this.getPropertyMetaData(i);
  115. String name = property.getName();
  116. retval.add(name);
  117. }
  118. return retval;
  119. }
  120. /**
  121. * Get the width in pixels we expect on the input frame to the resampler.
  122. *
  123. * @return The width we expect on the input frame to the resampler.
  124. *
  125. */
  126. public int getInputWidth() {
  127. return XugglerJNI.IVideoResampler_getInputWidth(swigCPtr, this);
  128. }
  129. /**
  130. * Get the height in pixels we expect on the input frame to the resampler.
  131. *
  132. * @return The height we expect on the input frame to the resampler.
  133. *
  134. */
  135. public int getInputHeight() {
  136. return XugglerJNI.IVideoResampler_getInputHeight(swigCPtr, this);
  137. }
  138. /**
  139. * Get the input pixel format.
  140. * @return The pixel format we expect on the input frame to the resampler.
  141. *
  142. */
  143. public IPixelFormat.Type getInputPixelFormat() {
  144. return IPixelFormat.Type.swigToEnum(XugglerJNI.IVideoResampler_getInputPixelFormat(swigCPtr, this));
  145. }
  146. /**
  147. * Get the output width, in pixels.
  148. * @return The width we will resample the output frame to
  149. */
  150. public int getOutputWidth() {
  151. return XugglerJNI.IVideoResampler_getOutputWidth(swigCPtr, this);
  152. }
  153. /**
  154. * Get the output height, in pixels.
  155. * @return The height we will resample the output frame to
  156. */
  157. public int getOutputHeight() {
  158. return XugglerJNI.IVideoResampler_getOutputHeight(swigCPtr, this);
  159. }
  160. /**
  161. * Get the output pixel format.
  162. * @return The pixel format we will resample the output frame to
  163. */
  164. public IPixelFormat.Type getOutputPixelFormat() {
  165. return IPixelFormat.Type.swigToEnum(XugglerJNI.IVideoResampler_getOutputPixelFormat(swigCPtr, this));
  166. }
  167. /**
  168. * Resample in to out based on the resampler parameters.
  169. * Resamples the in picture based on the parameters set when
  170. * this resampler was constructed.
  171. * @param out The picture we'll resample to. Check
  172. * {@link IVideoPicture#isComplete()} after the call.
  173. * @param in The picture we'll resample from.
  174. * @return >= 0 on success; <0 on error.
  175. */
  176. public int resample(IVideoPicture out, IVideoPicture in) {
  177. return XugglerJNI.IVideoResampler_resample(swigCPtr, this, IVideoPicture.getCPtr(out), out, IVideoPicture.getCPtr(in), in);
  178. }
  179. /**
  180. * Returns the total number of settable properties on this object
  181. * @return total number of options (not including constant definitions)
  182. *
  183. */
  184. public int getNumProperties() {
  185. return XugglerJNI.IVideoResampler_getNumProperties(swigCPtr, this);
  186. }
  187. /**
  188. * Returns the name of the numbered property.
  189. * @param propertyNo The property number in the options list.
  190. * @return an IProperty value for this properties meta-data
  191. */
  192. public IProperty getPropertyMetaData(int propertyNo) {
  193. long cPtr = XugglerJNI.IVideoResampler_getPropertyMetaData__SWIG_0(swigCPtr, this, propertyNo);
  194. return (cPtr == 0) ? null : new IProperty(cPtr, false);
  195. }
  196. /**
  197. * Returns the name of the numbered property.
  198. * @param name The property name.
  199. * @return an IProperty value for this properties meta-data
  200. */
  201. public IProperty getPropertyMetaData(String name) {
  202. long cPtr = XugglerJNI.IVideoResampler_getPropertyMetaData__SWIG_1(swigCPtr, this, name);
  203. return (cPtr == 0) ? null : new IProperty(cPtr, false);
  204. }
  205. /**
  206. * Sets a property on this Object.
  207. * All AVOptions supported by the underlying AVClass are supported.
  208. *
  209. * @param name The property name. For example "b" for bit-rate.
  210. * @param value The value of the property.
  211. * @return >= 0 if the property was successfully set; <0 on error
  212. */
  213. public int setProperty(String name, String value) {
  214. return XugglerJNI.IVideoResampler_setProperty__SWIG_0(swigCPtr, this, name, value);
  215. }
  216. /**
  217. * Looks up the property 'name' and sets the
  218. * value of the property to 'value'.
  219. * @param name name of option
  220. * @param value Value of option
  221. * @return >= 0 on success; <0 on error.
  222. */
  223. public int setProperty(String name, double value) {
  224. return XugglerJNI.IVideoResampler_setProperty__SWIG_1(swigCPtr, this, name, value);
  225. }
  226. /**
  227. * Looks up the property 'name' and sets the
  228. * value of the property to 'value'.
  229. * @param name name of option
  230. * @param value Value of option
  231. * @return >= 0 on success; <0 on error.
  232. */
  233. public int setProperty(String name, long value) {
  234. return XugglerJNI.IVideoResampler_setProperty__SWIG_2(swigCPtr, this, name, value);
  235. }
  236. /**
  237. * Looks up the property 'name' and sets the
  238. * value of the property to 'value'.
  239. * @param name name of option
  240. * @param value Value of option
  241. * @return >= 0 on success; <0 on error.
  242. */
  243. public int setProperty(String name, boolean value) {
  244. return XugglerJNI.IVideoResampler_setProperty__SWIG_3(swigCPtr, this, name, value);
  245. }
  246. /**
  247. * Looks up the property 'name' and sets the
  248. * value of the property to 'value'.
  249. * @param name name of option
  250. * @param value Value of option
  251. * @return >= 0 on success; <0 on error.
  252. */
  253. public int setProperty(String name, IRational value) {
  254. return XugglerJNI.IVideoResampler_setProperty__SWIG_4(swigCPtr, this, name, IRational.getCPtr(value), value);
  255. }
  256. /**
  257. * Gets a property on this Object.
  258. * Note for C++ callers; you must free the returned array with
  259. * delete[] in order to avoid a memory leak. Other language
  260. * folks need not worry.
  261. * @param name property name
  262. * @return an string copy of the option value, or null if the option
  263. * doesn't exist.
  264. */
  265. public String getPropertyAsString(String name) {
  266. return XugglerJNI.IVideoResampler_getPropertyAsString(swigCPtr, this, name);
  267. }
  268. /**
  269. * Gets the value of this property, and returns as a double;
  270. * @param name name of option
  271. * @return double value of property, or 0 on error.
  272. */
  273. public double getPropertyAsDouble(String name) {
  274. return XugglerJNI.IVideoResampler_getPropertyAsDouble(swigCPtr, this, name);
  275. }
  276. /**
  277. * Gets the value of this property, and returns as an long;
  278. * @param name name of option
  279. * @return long value of property, or 0 on error.
  280. */
  281. public long getPropertyAsLong(String name) {
  282. return XugglerJNI.IVideoResampler_getPropertyAsLong(swigCPtr, this, name);
  283. }
  284. /**
  285. * Gets the value of this property, and returns as an IRational;
  286. * @param name name of option
  287. * @return long value of property, or 0 on error.
  288. */
  289. public IRational getPropertyAsRational(String name) {
  290. long cPtr = XugglerJNI.IVideoResampler_getPropertyAsRational(swigCPtr, this, name);
  291. return (cPtr == 0) ? null : new IRational(cPtr, false);
  292. }
  293. /**
  294. * Gets the value of this property, and returns as a boolean
  295. * @param name name of option
  296. * @return boolean value of property, or false on error.
  297. */
  298. public boolean getPropertyAsBoolean(String name) {
  299. return XugglerJNI.IVideoResampler_getPropertyAsBoolean(swigCPtr, this, name);
  300. }
  301. /**
  302. * Get a new video resampler. Returns null if {@link #isSupported(Feature)}
  303. * returns false.
  304. * @param outputWidth The width in pixels you want to output frame to
  305. * have.
  306. * @param outputHeight The height in pixels you want to output frame
  307. * to have.
  308. * @param outputFmt The pixel format of the output frame.
  309. * @param inputWidth The width in pixels the input frame will be in.
  310. *
  311. * @param inputHeight The height in pixels the input frame will be in.
  312. *
  313. * @param inputFmt The pixel format of the input frame.
  314. * @return a new object, or null if we cannot allocate one.
  315. */
  316. public static IVideoResampler make(int outputWidth, int outputHeight, IPixelFormat.Type outputFmt, int inputWidth, int inputHeight, IPixelFormat.Type inputFmt) {
  317. long cPtr = XugglerJNI.IVideoResampler_make(outputWidth, outputHeight, outputFmt.swigValue(), inputWidth, inputHeight, inputFmt.swigValue());
  318. return (cPtr == 0) ? null : new IVideoResampler(cPtr, false);
  319. }
  320. /**
  321. * Returns true if the asked for feature is supported.
  322. * @param feature The feature you want to find out is supported.
  323. * @return true if the IVideoResampler supports this feature; false
  324. * otherwise.
  325. */
  326. public static boolean isSupported(IVideoResampler.Feature feature) {
  327. return XugglerJNI.IVideoResampler_isSupported(feature.swigValue());
  328. }
  329. public enum Feature {
  330. /**
  331. * Features that the VideoResampler may optionally support.
  332. */
  333. FEATURE_IMAGERESCALING,
  334. FEATURE_COLORSPACECONVERSION;
  335. public final int swigValue() {
  336. return swigValue;
  337. }
  338. public static Feature swigToEnum(int swigValue) {
  339. Feature[] swigValues = Feature.class.getEnumConstants();
  340. if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
  341. return swigValues[swigValue];
  342. for (Feature swigEnum : swigValues)
  343. if (swigEnum.swigValue == swigValue)
  344. return swigEnum;
  345. throw new IllegalArgumentException("No enum " + Feature.class + " with value " + swigValue);
  346. }
  347. @SuppressWarnings("unused")
  348. private Feature() {
  349. this.swigValue = SwigNext.next++;
  350. }
  351. @SuppressWarnings("unused")
  352. private Feature(int swigValue) {
  353. this.swigValue = swigValue;
  354. SwigNext.next = swigValue+1;
  355. }
  356. @SuppressWarnings("unused")
  357. private Feature(Feature swigEnum) {
  358. this.swigValue = swigEnum.swigValue;
  359. SwigNext.next = this.swigValue+1;
  360. }
  361. private final int swigValue;
  362. private static class SwigNext {
  363. private static int next = 0;
  364. }
  365. }
  366. }