nagyistoce / jnaerator

Automatically exported from code.google.com/p/jnaerator
0 stars 0 forks source link

Problems with ffmpeg/avformat.dll #35

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I am trying to run the latest (v0.9.1) jnaerator against the latest ffmpeg
Windows libraries.

The result are quite impressing as most dll are handled correctly, but
handling of avformat.dll is partial (stops midway...).

The command line I am running is:
java -jar jnaerator-0.9.1 FFMPEG.jnaerator

I have attached the FFMPEG.jnaerator file and the resulting out.errors.txt
file. I also attached out.txt which captures the stdout/stderr outputs.

Basically, jnaerator is reporting some errors in libavformat/avformat.h and
will not generate all the structs and methods found in this header.

The two offending lines in avformat.h are:
1) a member declaration in AVOutputFormat struct
    int (*interleave_packet)(struct AVFormatContext *, AVPacket *out,
                             AVPacket *in, int flush);
2) a method declaration
    int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out,
                                 AVPacket *pkt, int flush);

Strangely, if in both cases I remove the "AVPacket *out, AVPacket *pkt,"
part, the jnaerator works fine and completes successfully.

I don't expect a quick fix ;-) as I am well aware that the information I am
providing might not be enough to understand and fix the issue.
I am ready to provide more information and try things out should you ask
for it...

Regards and thanks in advance.

Original issue reported on code.google.com by parisjoi...@yahoo.fr on 1 Oct 2009 at 10:40

Attachments:

GoogleCodeExporter commented 9 years ago
Hi,

Thanks a lot for your detailed bug report !

This bug is most likely caused by the wrong parsing of the "out" (and maybe 
"in") 
argument, which is a known severe limitation of the parser.

Issue #22 was opened a while ago for this and is now scheduled for version 1.0 
or 
earlier (your report will likely make the fix arrive quicker :-))

There are two possible workarounds for now:
- edit the offending header and rename the arguments "out", "in" and any other 
that 
match a C/C++/ObjectiveC modifier (full list available here : 
http://code.google.com/p/jnaerator/source/browse/trunk/jnaerator/src/main/java/c
om/oc
hafik/lang/jnaerator/parser/Modifier.java)
- edit JNAerator's sources in Modifier.java to comment out the ObjectiveC 
modifiers 
that block your file from being parsed correctly

Cheers

Original comment by olivier.chafik@gmail.com on 1 Oct 2009 at 12:28

GoogleCodeExporter commented 9 years ago
Hi,

Renaming "out" and "in" did the trick! Renaming "out" alone is not enough.
I also understand all the errors about "__declspec" now ;-)

Thanks a lot for the quick answer and workaround.

I'll be watching for the next release and will test it as soons as it is 
available.

Regards

Original comment by parisjoi...@yahoo.fr on 1 Oct 2009 at 1:09

GoogleCodeExporter commented 9 years ago
Issue was fixed in revision #861 and latest jnaerator-0.9.2-SNAPSHOT.jar
Looking forward to getting more bug reports (along with success reports ;-))
Cheers

Original comment by olivier.chafik@gmail.com on 1 Oct 2009 at 11:35

GoogleCodeExporter commented 9 years ago
jnaerator-0.9.2-SNAPSHOT.jar fixes the issues reported here.
Thanks!

The following struct is not handled because of "native", but I can live with it 
and
will wait for Issue #22 to be resolved.

struct AVMetadataConv{
    const char *native;
    const char *generic;
};

Original comment by parisjoi...@yahoo.fr on 2 Oct 2009 at 10:11