mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2026-08-11 17:18:01 +00:00
support nv12 capture pixel format on linux
This commit is contained in:
@@ -6,6 +6,7 @@ public enum WebcamPixelFormat {
|
||||
//Only V4L2 formats defined in linux/videodev2.h are required here, declared in order of priority for supported formats
|
||||
PIX_FMT_RGB24("RGB3", true),
|
||||
PIX_FMT_YUYV("YUYV", true),
|
||||
PIX_FMT_NV12("NV12", true),
|
||||
PIX_FMT_MJPG("MJPG", true);
|
||||
|
||||
private final String name;
|
||||
|
||||
@@ -182,9 +182,9 @@ public class WebcamService extends ScheduledService<Image> {
|
||||
}
|
||||
}
|
||||
|
||||
//On Linux, formats not defined in WebcamPixelFormat are unsupported so ask for RGB3
|
||||
//On Linux, formats not defined in WebcamPixelFormat are unsupported
|
||||
if(OsType.getCurrent() == OsType.UNIX && WebcamPixelFormat.fromFourCC(format.getFormatInfo().fourcc) == null) {
|
||||
format.getFormatInfo().fourcc = WebcamPixelFormat.PIX_FMT_RGB24.getFourCC();
|
||||
log.warn("Unsupported camera pixel format " + WebcamPixelFormat.fourCCToString(format.getFormatInfo().fourcc));
|
||||
}
|
||||
|
||||
if(log.isDebugEnabled()) {
|
||||
|
||||
Reference in New Issue
Block a user