ffmpegの構造体

たぶんVC側とgcc側で構造体メンバのアラインが違うか、型サイズが違うかで構造のメンバがずれてる気がするのでそのへんを調べる……。

#ifdef __ICC
    #define DECLARE_ALIGNED(n,t,v)      t v __attribute__ ((aligned (n)))
    #define DECLARE_ASM_CONST(n,t,v)    const t __attribute__ ((aligned (n))) v
#elif defined(__GNUC__)
    #define DECLARE_ALIGNED(n,t,v)      t v __attribute__ ((aligned (n)))
    #define DECLARE_ASM_CONST(n,t,v)    static const t v attribute_used __attribute__ ((aligned (n)))
#elif defined(_MSC_VER)
    #define DECLARE_ALIGNED(n,t,v)      __declspec(align(n)) t v
    #define DECLARE_ASM_CONST(n,t,v)    __declspec(align(n)) static const t v
#elif defined(HAVE_INLINE_ASM)
    #error The asm code needs alignment, but we do not know how to do it for this compiler.
#else
    #define DECLARE_ALIGNED(n,t,v)      t v
    #define DECLARE_ASM_CONST(n,t,v)    static const t v
#endif

こうなってるけど、__attribute__*1は、VCだと#pragma packで、__declspec(align(n))とは意味が違ったような。
ググる

追記

いくつかsizeofをとったら一緒だった。上のはインターフェースとしては使われてなかった。
stdint.hが別ファイルだったけど構造体にint64_tなんかを含んでも同じサイズだった。

追記

 --enable-shared --enable-memalign-hackでコンパイルしても動くようになった。同時にいろいろ触りすぎて謎になってしまったけど、ffopencvのコードが悪かったようです。

おわり。

*1: aligned(n