Hello,

I was wondering if there's a way to tell the height of picture in a plane in
arbitrary pixel format.

I need to convert data in arbitrary pixel format into continuous memory
area, transfer to other place in my application and recreate the original
planes.
I can 'planarize' the data using avpicture_layout, but I can't find a way,
how to tell the offsets of individual planes in the newly created memory
area. I can, of course, write big switch() to tell which format it is and
have it hardcoded in the code (ie. for YUV420P make the first plane at
picture's height and for 2 subsequent planes it's half of this value.) But I
would like to have more universal method, is there any? I noticed PixFmtInfo
in imgconvert.c, but it is not exported as part of API, AFAIK.
Information from PixFmtInfo would be enough. Or function like:
make_planes(uint8_t *, int width, int heigh, PixelFormat, AVPicture) that
just sets the appropriate pointers and values in AVPicture.

Thanks for any hints, I'm sure I just overlooked an obvious solution and
doing things in unnecessarily complicated way ;)

Sincerely
Zdenek Travnicek
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to