Start adding support for non-MJPEG frame types.

Not yet supported by MJPEGServer.
This commit is contained in:
Peter Johnson
2016-11-10 00:00:20 -08:00
parent 41dd9e4f06
commit 254b88bdbe
7 changed files with 64 additions and 13 deletions

View File

@@ -59,12 +59,10 @@ static VideoMode::PixelFormat ToPixelFormat(__u32 pixelformat) {
switch (pixelformat) {
case V4L2_PIX_FMT_MJPEG:
return VideoMode::kMJPEG;
#if 0
case V4L2_PIX_FMT_YUYV:
return VideoMode::kYUYV;
case V4L2_PIX_FMT_RGB565:
return VideoMode::kRGB565;
#endif
default:
return VideoMode::kUnknown;
}
@@ -557,6 +555,7 @@ void USBCameraImpl::CameraThreadMain() {
}
PutFrame(static_cast<VideoMode::PixelFormat>(m_mode.pixelFormat),
m_mode.width, m_mode.height,
llvm::StringRef(
static_cast<const char*>(m_buffers[buf.index].m_data),
static_cast<std::size_t>(buf.bytesused)),