8 messages in net.java.dev.jna.usersgetting at a structure with unknown s...
FromSent OnAttachments
Paul LoyJan 23, 2008 10:34 am 
Timothy WallJan 23, 2008 11:04 am 
Paul LoyJan 24, 2008 5:29 am 
Paul LoyJan 24, 2008 5:30 am 
Timothy WallJan 24, 2008 5:38 am 
Paul LoyJan 25, 2008 5:24 am 
Timothy WallJan 25, 2008 5:58 am 
Paul LoyJan 25, 2008 6:50 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:getting at a structure with unknown structure sizeActions...
From:Paul Loy (pa@keteracel.com)
Date:Jan 23, 2008 10:34:09 am
List:net.java.dev.jna.users

Hi All,

I am wanting to use the QT native call:

void GetMediaSampleDescription(Media theMedia, long index, SampleDescriptionHandle descH);

Media is basically an int (it's actually a the native pointer for a QTJ object, which we obtain be using the static QTObject.ID(QTObject object))

SampleDescritionHandle is a SampleDescriptionPtr *

SampleDescriptionPtr is a SampleDescription *

and Sample Description is:

struct SampleDescription { long descSize; long dataFormat; long resvd1; short resvd2; short dataRefIndex; }

So, essentially our native call boils down to:

void GetMediaSampleDescription(int mediaObjectId, long index, SampleDescription ** desc);

The descSize field tells us the actual size of the structure as this depends upon the media that it is describing. So, at the time this function is called, we have no idea of the size of the structure (or a narrow range of different sized structures based on the media type if we know that).

My question is: How does one map this function in Java with JNA?

Paul.