A small, affordable computer with free resources to help people learn, make things, and have fun
https://forums.raspberrypi.com/
If you wish to change the format, then do so after the MMAL_EVENT_FORMAT_CHANGED event.longo92 wrote: ↑Mon Jul 13, 2020 11:48 amHi,
Is there a way to force the image decoder to use the pixel format on output port chosen by the user when enbaling the port, instead of being modified by MMAL_EVENT_FORMAT_CHANGED.
I'm writing my own c++ image decoder class (wrapper around mmal decoder, based on this: https://github.com/6by9/userland/blob/h ... peg/jpeg.c).
More precisely, the output port supports the following formats:
image decoder port vc.ril.image_decode:out:0 supported encodings: RGB2 //aka RGB_5_6_5
image decoder port vc.ril.image_decode:out:0 supported encodings: I420
image decoder port vc.ril.image_decode:out:0 supported encodings: I422
image decoder port vc.ril.image_decode:out:0 supported encodings: RGBA
image decoder port vc.ril.image_decode:out:0 supported encodings: BGRA
I set RGB2, in the setup phase, but when i decode :
-in a PNG image the MMAL_EVENT_FORMAT_CHANGED switches to RGBA.
-in a JPEG image the MMAL_EVENT_FORMAT_CHANGED switches to I420.
Is there a way to avoid that and force the decoder to use the format chosen by the user ?
OPAQUE means pass a reference to the internal image pool which is used for reference frames and similar.longo92 wrote:Another question: the MMAL_ENCODING_OPAQUE is not listed, is it correct? I'm using firmware of 12/02/2020. (There was a similar problem with the video decoder viewtopic.php?f=67&t=226416&p=1390005#p1390005).
Or Do you gather them using OpenMax calls?GIF supports RGB565
BMP, PNG, PPM, and TGA support RGBA.
JPEG supports I420 or I422.
Do you mean that if i set RGBA will be a conversion stage (performed by isp) ?However there are restrictions in that the decoders are decoding directly into the provided output buffer, therefore the codec has to natively support decode into that format.
I don't know of any docs or functional calls to retrieve that. I referred back to the firmware source as I knnew there was a table of codecs and compatible formats towards the top of the file.
No, I mean you can swap between I420 and I422 for JPEG. I thought some of the other codecs supported a number of output bit depths, but seemingly not. I'm slightly surprised as for encode the codecs are more accepting on formats.longo92 wrote:Do you mean that if i set RGBA will be a conversion stage (performed by isp) ?However there are restrictions in that the decoders are decoding directly into the provided output buffer, therefore the codec has to natively support decode into that format.