[Mono-dev] InterOp problems with 1.2.6pre2

Robert Jordan robertj at gmx.net
Fri Nov 30 15:38:37 EST 2007


Prakash Punnoor wrote:
>> Aften's context does not declare a float array at this position.
> 
> But it has a void* and to my understanding float[] can be marshalled to void*. 
> It works with the methods, as well, which have void* as parameters.

Here is the end of your C# struct declaration:

		public int SampleRate;
		internal A52SampleFormat SampleFormat;
  		public float[] InitialSamples; // the trouble maker
  		private IntPtr m_Context;


And this is the C declaration:


     /**
      * Audio sample rate in Hz
      */
     int samplerate;

     /**
      * Audio sample format
      * default: A52_SAMPLE_FMT_S16
      */
     A52SampleFormat sample_format;

     /**
      * Used internally by the encoder. The user should leave this alone.
      * It is allocated in aften_encode_init and free'd in 
aften_encode_close.
      */
     void *private_context;


The layouts don't match, since declaring a field "private" won't
magically subtract it from struct layout.

Robert




More information about the Mono-devel-list mailing list