/** YUV 4:2:0 planar, 16bit/component.
*/
#define MMAL_ENCODING_I420_16 MMAL_FOURCC('i','4','2','0')
+/** YUV 4:2:0 planar, 10bit/component as least sig 10bits of 16 bit words.
+*/
+#define MMAL_ENCODING_I420_10 MMAL_FOURCC('i','4','1','0')
//Bayer formats
//FourCC values copied from V4L2 where defined.
* of YUV_UV_16 video.
*/
#define MMAL_ENCODING_YUVUV64_16 MMAL_FOURCC('S','A','1','6')
+/** 10 bit SAND Video format, packed as least sig 10 bits of 16 bit words.
+ */
+#define MMAL_ENCODING_YUVUV64_10 MMAL_FOURCC('S','A','1','0')
/** VideoCore opaque image format, image handles are returned to
* the host but not the actual image data.
{MMAL_ENCODING_OPAQUE, OMX_COLOR_FormatBRCMOpaque},
{MMAL_ENCODING_I420_16, OMX_COLOR_FormatYUV420_16PackedPlanar},
{MMAL_ENCODING_YUVUV64_16, OMX_COLOR_FormatYUVUV64_16},
+ {MMAL_ENCODING_I420_10, OMX_COLOR_FormatYUV420_10PackedPlanar},
+ {MMAL_ENCODING_YUVUV64_10, OMX_COLOR_FormatYUVUV64_10},
{MMAL_ENCODING_UNKNOWN, OMX_COLOR_FormatUnused}
};
{MMAL_ENCODING_BGR16, 2, 1, 1},
{MMAL_ENCODING_BGR24, 3, 1, 1},
{MMAL_ENCODING_I420_16, 2, 1, 1},
+ {MMAL_ENCODING_I420_10, 2, 1, 1},
{MMAL_ENCODING_I420_SLICE, 1, 1, 1},
{MMAL_ENCODING_I422_SLICE, 1, 1, 1},
/* {MMAL_ENCODING_YUVUV128, 1, 1}, That's a special case which must not be included */
/* {MMAL_ENCODING_YUVUV64_16, 1, 1}, That's a special case which must not be included */
+ /* {MMAL_ENCODING_YUVUV64_10, 1, 1}, That's a special case which must not be included */
{MMAL_ENCODING_UNKNOWN, 0, 0}
};
return buf;
}
-#define MAX_ENCODINGS_NUM 20
+#define MAX_ENCODINGS_NUM 25
typedef struct {
MMAL_PARAMETER_HEADER_T header;
MMAL_FOURCC_T encodings[MAX_ENCODINGS_NUM];
int mmal_util_rgb_order_fixed(MMAL_PORT_T *port)
{
int new_fw = 0;
+ MMAL_STATUS_T ret;
//Firmware support of RGB24 vs BGR24 colour ordering from camera
//and video splitter components has been corrected as of June 2016.
//New firmwares always report MMAL_ENCODING_RGB24 before BGR24, and
//the still port on querying MMAL_PARAMETER_SUPPORTED_ENCODINGS.
MMAL_SUPPORTED_ENCODINGS_T sup_encodings = {{MMAL_PARAMETER_SUPPORTED_ENCODINGS, sizeof(sup_encodings)}, {0}};
- if (mmal_port_parameter_get(port, &sup_encodings.header) == MMAL_SUCCESS)
+ ret = mmal_port_parameter_get(port, &sup_encodings.header);
+ if (ret == MMAL_SUCCESS || ret == MMAL_ENOSPC)
{
+ //Allow ENOSPC error and hope that the desired formats are in the first
+ //MAX_ENCODINGS_NUM entries.
int i;
int num_encodings = (sup_encodings.header.size - sizeof(sup_encodings.header)) /
sizeof(sup_encodings.encodings[0]);
+ if(num_encodings > MAX_ENCODINGS_NUM)
+ num_encodings = MAX_ENCODINGS_NUM;
for (i=0; i<num_encodings; i++)
{
if (sup_encodings.encodings[i] == MMAL_ENCODING_BGR24)
OMX_COLOR_FormatYVU420PackedPlanar,
OMX_COLOR_FormatYVU420PackedSemiPlanar,
OMX_COLOR_FormatRawBayer16bit,
- OMX_COLOR_FormatYUV420_16PackedPlanar,
- OMX_COLOR_FormatYUVUV64_16,
+ OMX_COLOR_FormatYUV420_16PackedPlanar, /**< YUV420, 16bit/component */
+ OMX_COLOR_FormatYUVUV64_16, /**< YUVUV, 16bit/component */
+ OMX_COLOR_FormatYUV420_10PackedPlanar, /**< YUV420, 10bit/component as least sig 10bits of 16 bit words */
+ OMX_COLOR_FormatYUVUV64_10, /**< YUVUV, 10bit/component as least sig 10bits of 16 bit words */
OMX_COLOR_FormatMax = 0x7FFFFFFF
} OMX_COLOR_FORMATTYPE;