ProxyVideoConsumerCallback.cs 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /* ----------------------------------------------------------------------------
  2. * This file was automatically generated by SWIG (http://www.swig.org).
  3. * Version 2.0.9
  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. namespace org.doubango.tinyWRAP {
  9. using System;
  10. using System.Runtime.InteropServices;
  11. public class ProxyVideoConsumerCallback : IDisposable {
  12. private HandleRef swigCPtr;
  13. protected bool swigCMemOwn;
  14. internal ProxyVideoConsumerCallback(IntPtr cPtr, bool cMemoryOwn) {
  15. swigCMemOwn = cMemoryOwn;
  16. swigCPtr = new HandleRef(this, cPtr);
  17. }
  18. internal static HandleRef getCPtr(ProxyVideoConsumerCallback obj) {
  19. return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
  20. }
  21. ~ProxyVideoConsumerCallback() {
  22. Dispose();
  23. }
  24. public virtual void Dispose() {
  25. lock(this) {
  26. if (swigCPtr.Handle != IntPtr.Zero) {
  27. if (swigCMemOwn) {
  28. swigCMemOwn = false;
  29. tinyWRAPPINVOKE.delete_ProxyVideoConsumerCallback(swigCPtr);
  30. }
  31. swigCPtr = new HandleRef(null, IntPtr.Zero);
  32. }
  33. GC.SuppressFinalize(this);
  34. }
  35. }
  36. public ProxyVideoConsumerCallback() : this(tinyWRAPPINVOKE.new_ProxyVideoConsumerCallback(), true) {
  37. SwigDirectorConnect();
  38. }
  39. public virtual int prepare(int nWidth, int nHeight, int nFps) {
  40. int ret = (SwigDerivedClassHasMethod("prepare", swigMethodTypes0) ? tinyWRAPPINVOKE.ProxyVideoConsumerCallback_prepareSwigExplicitProxyVideoConsumerCallback(swigCPtr, nWidth, nHeight, nFps) : tinyWRAPPINVOKE.ProxyVideoConsumerCallback_prepare(swigCPtr, nWidth, nHeight, nFps));
  41. return ret;
  42. }
  43. public virtual int consume(ProxyVideoFrame frame) {
  44. int ret = (SwigDerivedClassHasMethod("consume", swigMethodTypes1) ? tinyWRAPPINVOKE.ProxyVideoConsumerCallback_consumeSwigExplicitProxyVideoConsumerCallback(swigCPtr, ProxyVideoFrame.getCPtr(frame)) : tinyWRAPPINVOKE.ProxyVideoConsumerCallback_consume(swigCPtr, ProxyVideoFrame.getCPtr(frame)));
  45. return ret;
  46. }
  47. public virtual int bufferCopied(uint nCopiedSize, uint nAvailableSize) {
  48. int ret = (SwigDerivedClassHasMethod("bufferCopied", swigMethodTypes2) ? tinyWRAPPINVOKE.ProxyVideoConsumerCallback_bufferCopiedSwigExplicitProxyVideoConsumerCallback(swigCPtr, nCopiedSize, nAvailableSize) : tinyWRAPPINVOKE.ProxyVideoConsumerCallback_bufferCopied(swigCPtr, nCopiedSize, nAvailableSize));
  49. return ret;
  50. }
  51. public virtual int start() {
  52. int ret = (SwigDerivedClassHasMethod("start", swigMethodTypes3) ? tinyWRAPPINVOKE.ProxyVideoConsumerCallback_startSwigExplicitProxyVideoConsumerCallback(swigCPtr) : tinyWRAPPINVOKE.ProxyVideoConsumerCallback_start(swigCPtr));
  53. return ret;
  54. }
  55. public virtual int pause() {
  56. int ret = (SwigDerivedClassHasMethod("pause", swigMethodTypes4) ? tinyWRAPPINVOKE.ProxyVideoConsumerCallback_pauseSwigExplicitProxyVideoConsumerCallback(swigCPtr) : tinyWRAPPINVOKE.ProxyVideoConsumerCallback_pause(swigCPtr));
  57. return ret;
  58. }
  59. public virtual int stop() {
  60. int ret = (SwigDerivedClassHasMethod("stop", swigMethodTypes5) ? tinyWRAPPINVOKE.ProxyVideoConsumerCallback_stopSwigExplicitProxyVideoConsumerCallback(swigCPtr) : tinyWRAPPINVOKE.ProxyVideoConsumerCallback_stop(swigCPtr));
  61. return ret;
  62. }
  63. private void SwigDirectorConnect() {
  64. if (SwigDerivedClassHasMethod("prepare", swigMethodTypes0))
  65. swigDelegate0 = new SwigDelegateProxyVideoConsumerCallback_0(SwigDirectorprepare);
  66. if (SwigDerivedClassHasMethod("consume", swigMethodTypes1))
  67. swigDelegate1 = new SwigDelegateProxyVideoConsumerCallback_1(SwigDirectorconsume);
  68. if (SwigDerivedClassHasMethod("bufferCopied", swigMethodTypes2))
  69. swigDelegate2 = new SwigDelegateProxyVideoConsumerCallback_2(SwigDirectorbufferCopied);
  70. if (SwigDerivedClassHasMethod("start", swigMethodTypes3))
  71. swigDelegate3 = new SwigDelegateProxyVideoConsumerCallback_3(SwigDirectorstart);
  72. if (SwigDerivedClassHasMethod("pause", swigMethodTypes4))
  73. swigDelegate4 = new SwigDelegateProxyVideoConsumerCallback_4(SwigDirectorpause);
  74. if (SwigDerivedClassHasMethod("stop", swigMethodTypes5))
  75. swigDelegate5 = new SwigDelegateProxyVideoConsumerCallback_5(SwigDirectorstop);
  76. tinyWRAPPINVOKE.ProxyVideoConsumerCallback_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4, swigDelegate5);
  77. }
  78. private bool SwigDerivedClassHasMethod(string methodName, Type[] methodTypes) {
  79. System.Reflection.MethodInfo methodInfo = this.GetType().GetMethod(methodName, System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance, null, methodTypes, null);
  80. bool hasDerivedMethod = methodInfo.DeclaringType.IsSubclassOf(typeof(ProxyVideoConsumerCallback));
  81. return hasDerivedMethod;
  82. }
  83. private int SwigDirectorprepare(int nWidth, int nHeight, int nFps) {
  84. return prepare(nWidth, nHeight, nFps);
  85. }
  86. private int SwigDirectorconsume(IntPtr frame) {
  87. return consume((frame == IntPtr.Zero) ? null : new ProxyVideoFrame(frame, false));
  88. }
  89. private int SwigDirectorbufferCopied(uint nCopiedSize, uint nAvailableSize) {
  90. return bufferCopied(nCopiedSize, nAvailableSize);
  91. }
  92. private int SwigDirectorstart() {
  93. return start();
  94. }
  95. private int SwigDirectorpause() {
  96. return pause();
  97. }
  98. private int SwigDirectorstop() {
  99. return stop();
  100. }
  101. public delegate int SwigDelegateProxyVideoConsumerCallback_0(int nWidth, int nHeight, int nFps);
  102. public delegate int SwigDelegateProxyVideoConsumerCallback_1(IntPtr frame);
  103. public delegate int SwigDelegateProxyVideoConsumerCallback_2(uint nCopiedSize, uint nAvailableSize);
  104. public delegate int SwigDelegateProxyVideoConsumerCallback_3();
  105. public delegate int SwigDelegateProxyVideoConsumerCallback_4();
  106. public delegate int SwigDelegateProxyVideoConsumerCallback_5();
  107. private SwigDelegateProxyVideoConsumerCallback_0 swigDelegate0;
  108. private SwigDelegateProxyVideoConsumerCallback_1 swigDelegate1;
  109. private SwigDelegateProxyVideoConsumerCallback_2 swigDelegate2;
  110. private SwigDelegateProxyVideoConsumerCallback_3 swigDelegate3;
  111. private SwigDelegateProxyVideoConsumerCallback_4 swigDelegate4;
  112. private SwigDelegateProxyVideoConsumerCallback_5 swigDelegate5;
  113. private static Type[] swigMethodTypes0 = new Type[] { typeof(int), typeof(int), typeof(int) };
  114. private static Type[] swigMethodTypes1 = new Type[] { typeof(ProxyVideoFrame) };
  115. private static Type[] swigMethodTypes2 = new Type[] { typeof(uint), typeof(uint) };
  116. private static Type[] swigMethodTypes3 = new Type[] { };
  117. private static Type[] swigMethodTypes4 = new Type[] { };
  118. private static Type[] swigMethodTypes5 = new Type[] { };
  119. }
  120. }