//rk_codec_node.h添加USB Camera YUV422转YUV420(YYYYUVUV)的转换函数定义
device/board/hihope/rk3568/camera/pipeline_core/src/node/rk_codec_node.h
void YUYV422ToYuv420(u_char* dst, u_char* src, int width, int height);
//rk_codec_node.cpp添加USB Camera YUV422转YUV420(YYYYUVUV)的转换函数
void RKCodecNode::YUYV422ToYuv420(u_char* dst, u_char* src, int width, int height)
{
int size = width * height;
int pos = 0;
int n = 0;
for(int j = 0;j < height; j++) {
pos = j * width * 2;
for(int i = 0;i < width * 2; i += 2) {
dst[n] = src[pos + i];
n++;
}
}
for(int j = 0;j < height; j += 2) {
pos = j * width * 2;
for(int i = 1;i < width * 2; i += 4) {
dst[n] = src[pos + i];
n++;
dst[n] = src[pos + i + 2];
n++;
}
}
}
```
drivers/interface/camera/v1_0/Types.idl
......
/**
* @brief Enumerates camera device statuses.
*/
enum CameraStatus {
/**
* The new camera device is APPER.
*/
APPEAR = 0,
/**
* The camera device is DISAPPEAR.
*/
DISAPPEAR = 1,
/**
* The camera device is available.
*/
AVAILABLE = 2,
/**
* The camera device is not in position or is unavailable.
*/
UN_AVAILABLE = 3,
};
......
```