deprecated noop jpeg encoder

This commit is contained in:
Maxim Devaev
2024-04-03 20:23:35 +03:00
parent 9ec59143dd
commit 0a639eabca
4 changed files with 4 additions and 21 deletions

View File

@@ -96,8 +96,6 @@ HW ─ Use pre-encoded MJPEG frames directly from camera hardware.
M2M-VIDEO ─ GPU-accelerated MJPEG encoding. M2M-VIDEO ─ GPU-accelerated MJPEG encoding.
M2M-IMAGE ─ GPU-accelerated JPEG encoding. M2M-IMAGE ─ GPU-accelerated JPEG encoding.
NOOP ─ Don't compress MJPEG stream (do nothing).
.TP .TP
.BR \-g\ \fIWxH,... ", " \-\-glitched\-resolutions\ \fIWxH,... .BR \-g\ \fIWxH,... ", " \-\-glitched\-resolutions\ \fIWxH,...
It doesn't do anything. Still here for compatibility. It doesn't do anything. Still here for compatibility.

View File

@@ -34,7 +34,7 @@ static const struct {
{"M2M-MJPEG", US_ENCODER_TYPE_M2M_VIDEO}, {"M2M-MJPEG", US_ENCODER_TYPE_M2M_VIDEO},
{"M2M-JPEG", US_ENCODER_TYPE_M2M_IMAGE}, {"M2M-JPEG", US_ENCODER_TYPE_M2M_IMAGE},
{"OMX", US_ENCODER_TYPE_M2M_IMAGE}, {"OMX", US_ENCODER_TYPE_M2M_IMAGE},
{"NOOP", US_ENCODER_TYPE_NOOP}, {"NOOP", US_ENCODER_TYPE_CPU},
}; };
@@ -129,10 +129,6 @@ void us_encoder_open(us_encoder_s *enc, us_capture_s *cap) {
_ER(m2ms[_ER(n_m2ms)]) = us_m2m_jpeg_encoder_init(name, enc->m2m_path, quality); _ER(m2ms[_ER(n_m2ms)]) = us_m2m_jpeg_encoder_init(name, enc->m2m_path, quality);
} }
} }
} else if (type == US_ENCODER_TYPE_NOOP) {
n_workers = 1;
quality = 0;
} }
goto ok; goto ok;
@@ -142,9 +138,7 @@ void us_encoder_open(us_encoder_s *enc, us_capture_s *cap) {
quality = cap->jpeg_quality; quality = cap->jpeg_quality;
ok: ok:
if (type == US_ENCODER_TYPE_NOOP) { if (quality == 0) {
US_LOG_INFO("Using JPEG NOOP encoder");
} else if (quality == 0) {
US_LOG_INFO("Using JPEG quality: encoder default"); US_LOG_INFO("Using JPEG quality: encoder default");
} else { } else {
US_LOG_INFO("Using JPEG quality: %u%%", quality); US_LOG_INFO("Using JPEG quality: %u%%", quality);
@@ -222,13 +216,6 @@ static bool _worker_run_job(us_worker_s *wr) {
goto error; goto error;
} }
} else if (_ER(type) == US_ENCODER_TYPE_NOOP) {
US_LOG_VERBOSE("Compressing JPEG using NOOP (do nothing): worker=%s, buffer=%u",
wr->name, job->hw->buf.index);
us_frame_encoding_begin(src, dest, V4L2_PIX_FMT_JPEG);
usleep(5000); // Просто чтобы работала логика desired_fps
dest->encode_end_ts = us_get_now_monotonic(); // us_frame_encoding_end()
} else { } else {
assert(0 && "Unknown encoder type"); assert(0 && "Unknown encoder type");
} }

View File

@@ -44,14 +44,13 @@
#include "encoders/hw/encoder.h" #include "encoders/hw/encoder.h"
#define ENCODER_TYPES_STR "CPU, HW, M2M-VIDEO, M2M-IMAGE, NOOP" #define ENCODER_TYPES_STR "CPU, HW, M2M-VIDEO, M2M-IMAGE"
typedef enum { typedef enum {
US_ENCODER_TYPE_CPU, US_ENCODER_TYPE_CPU,
US_ENCODER_TYPE_HW, US_ENCODER_TYPE_HW,
US_ENCODER_TYPE_M2M_VIDEO, US_ENCODER_TYPE_M2M_VIDEO,
US_ENCODER_TYPE_M2M_IMAGE, US_ENCODER_TYPE_M2M_IMAGE,
US_ENCODER_TYPE_NOOP,
} us_encoder_type_e; } us_encoder_type_e;
typedef struct { typedef struct {

View File

@@ -651,8 +651,7 @@ static void _help(FILE *fp, const us_capture_s *cap, const us_encoder_s *enc, co
SAY(" * CPU ──────── Software MJPEG encoding (default);"); SAY(" * CPU ──────── Software MJPEG encoding (default);");
SAY(" * HW ───────── Use pre-encoded MJPEG frames directly from camera hardware;"); SAY(" * HW ───────── Use pre-encoded MJPEG frames directly from camera hardware;");
SAY(" * M2M-VIDEO ── GPU-accelerated MJPEG encoding using V4L2 M2M video interface;"); SAY(" * M2M-VIDEO ── GPU-accelerated MJPEG encoding using V4L2 M2M video interface;");
SAY(" * M2M-IMAGE ── GPU-accelerated JPEG encoding using V4L2 M2M image interface;"); SAY(" * M2M-IMAGE ── GPU-accelerated JPEG encoding using V4L2 M2M image interface.\n");
SAY(" * NOOP ─────── Don't compress MJPEG stream (do nothing).\n");
SAY(" -g|--glitched-resolutions <WxH,...> ─ It doesn't do anything. Still here for compatibility.\n"); SAY(" -g|--glitched-resolutions <WxH,...> ─ It doesn't do anything. Still here for compatibility.\n");
SAY(" -k|--blank <path> ─────────────────── It doesn't do anything. Still here for compatibility.\n"); SAY(" -k|--blank <path> ─────────────────── It doesn't do anything. Still here for compatibility.\n");
SAY(" -K|--last-as-blank <sec> ──────────── It doesn't do anything. Still here for compatibility.\n"); SAY(" -K|--last-as-blank <sec> ──────────── It doesn't do anything. Still here for compatibility.\n");