mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-03-19 05:53:42 +00:00
noop encoder
This commit is contained in:
@@ -46,10 +46,13 @@ static const struct {
|
|||||||
const char *name;
|
const char *name;
|
||||||
const enum encoder_type_t type;
|
const enum encoder_type_t type;
|
||||||
} _ENCODER_TYPES[] = {
|
} _ENCODER_TYPES[] = {
|
||||||
{"CPU", ENCODER_TYPE_CPU},
|
{"CPU", ENCODER_TYPE_CPU},
|
||||||
{"HW", ENCODER_TYPE_HW},
|
{"HW", ENCODER_TYPE_HW},
|
||||||
# ifdef WITH_OMX
|
# ifdef WITH_OMX
|
||||||
{"OMX", ENCODER_TYPE_OMX},
|
{"OMX", ENCODER_TYPE_OMX},
|
||||||
|
# endif
|
||||||
|
# ifdef WITH_RAWSINK
|
||||||
|
{"NOOP", ENCODER_TYPE_NOOP},
|
||||||
# endif
|
# endif
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -183,6 +186,10 @@ void encoder_prepare(struct encoder_t *encoder, struct device_t *dev) {
|
|||||||
ok:
|
ok:
|
||||||
if (quality == 0) {
|
if (quality == 0) {
|
||||||
LOG_INFO("Using JPEG quality: encoder default");
|
LOG_INFO("Using JPEG quality: encoder default");
|
||||||
|
# ifdef WITH_RAWSINK
|
||||||
|
} else if (type == ENCODER_TYPE_NOOP) {
|
||||||
|
LOG_INFO("Using JPEG NOOP encoder");
|
||||||
|
# endif
|
||||||
} else {
|
} else {
|
||||||
LOG_INFO("Using JPEG quality: %u%%", quality);
|
LOG_INFO("Using JPEG quality: %u%%", quality);
|
||||||
}
|
}
|
||||||
@@ -221,6 +228,12 @@ int encoder_compress_buffer(struct encoder_t *encoder, struct device_t *dev, uns
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
# ifdef WITH_RAWSINK
|
||||||
|
else if (encoder->run->type == ENCODER_TYPE_NOOP) {
|
||||||
|
LOG_VERBOSE("Compressing buffer %u using NOOP (do nothing)", buf_index);
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
|
|
||||||
dev->run->pictures[buf_index]->encode_end_ts = get_now_monotonic();
|
dev->run->pictures[buf_index]->encode_end_ts = get_now_monotonic();
|
||||||
|
|
||||||
|
|||||||
@@ -41,10 +41,17 @@
|
|||||||
# define ENCODER_TYPES_OMX_HINT ""
|
# define ENCODER_TYPES_OMX_HINT ""
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef WITH_RAWSINK
|
||||||
|
# define ENCODER_TYPES_NOOP_HINT ", NOOP"
|
||||||
|
#else
|
||||||
|
# define ENCODER_TYPES_NOOP_HINT ""
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define ENCODER_TYPES_STR \
|
#define ENCODER_TYPES_STR \
|
||||||
"CPU, HW" \
|
"CPU, HW" \
|
||||||
ENCODER_TYPES_OMX_HINT
|
ENCODER_TYPES_OMX_HINT \
|
||||||
|
ENCODER_TYPES_NOOP_HINT
|
||||||
|
|
||||||
enum encoder_type_t {
|
enum encoder_type_t {
|
||||||
ENCODER_TYPE_UNKNOWN, // Only for encoder_parse_type() and main()
|
ENCODER_TYPE_UNKNOWN, // Only for encoder_parse_type() and main()
|
||||||
@@ -53,6 +60,9 @@ enum encoder_type_t {
|
|||||||
# ifdef WITH_OMX
|
# ifdef WITH_OMX
|
||||||
ENCODER_TYPE_OMX,
|
ENCODER_TYPE_OMX,
|
||||||
# endif
|
# endif
|
||||||
|
# ifdef WITH_RAWSINK
|
||||||
|
ENCODER_TYPE_NOOP,
|
||||||
|
# endif
|
||||||
};
|
};
|
||||||
|
|
||||||
struct encoder_runtime_t {
|
struct encoder_runtime_t {
|
||||||
|
|||||||
@@ -619,11 +619,14 @@ static void _help(struct device_t *dev, struct encoder_t *encoder, struct http_s
|
|||||||
printf(" for sources that already output MJPG.\n\n");
|
printf(" for sources that already output MJPG.\n\n");
|
||||||
printf(" -c|--encoder <type> ───────────────── Use specified encoder. It may affect the number of workers.\n");
|
printf(" -c|--encoder <type> ───────────────── Use specified encoder. It may affect the number of workers.\n");
|
||||||
printf(" Available:\n");
|
printf(" Available:\n");
|
||||||
printf(" * CPU ─ Software MJPG encoding (default);\n");
|
printf(" * CPU ── Software MJPG encoding (default);\n");
|
||||||
# ifdef WITH_OMX
|
# ifdef WITH_OMX
|
||||||
printf(" * OMX ─ GPU hardware accelerated MJPG encoding with OpenMax;\n");
|
printf(" * OMX ── GPU hardware accelerated MJPG encoding with OpenMax;\n");
|
||||||
|
# endif
|
||||||
|
printf(" * HW ─── Use pre-encoded MJPG frames directly from camera hardware.\n");
|
||||||
|
# ifdef WITH_RAWSINK
|
||||||
|
printf(" * NOOP ─ Don't compress stream. Useful for the RAW sink.\n\n");
|
||||||
# endif
|
# endif
|
||||||
printf(" * HW ── Use pre-encoded MJPG frames directly from camera hardware.\n\n");
|
|
||||||
# ifdef WITH_OMX
|
# ifdef WITH_OMX
|
||||||
printf(" -g|--glitched-resolutions <WxH,...> ─ Comma-separated list of resolutions that require forced\n");
|
printf(" -g|--glitched-resolutions <WxH,...> ─ Comma-separated list of resolutions that require forced\n");
|
||||||
printf(" encoding on CPU instead of OMX. Default: disabled.\n\n");
|
printf(" encoding on CPU instead of OMX. Default: disabled.\n\n");
|
||||||
|
|||||||
@@ -93,6 +93,8 @@ CPU ─ Software MJPG encoding (default).
|
|||||||
OMX ─ GPU hardware accelerated MJPG encoding with OpenMax (required \fBWITH_OMX\fR feature).
|
OMX ─ GPU hardware accelerated MJPG encoding with OpenMax (required \fBWITH_OMX\fR feature).
|
||||||
|
|
||||||
HW ─ Use pre-encoded MJPG frames directly from camera hardware.
|
HW ─ Use pre-encoded MJPG frames directly from camera hardware.
|
||||||
|
|
||||||
|
NOOP ─ Don't compress stream. Useful for the RAW sink.
|
||||||
.TP
|
.TP
|
||||||
.BR \-g\ \fIWxH,... ", " \-\-glitched\-resolutions\ \fIWxH,...
|
.BR \-g\ \fIWxH,... ", " \-\-glitched\-resolutions\ \fIWxH,...
|
||||||
Comma-separated list of resolutions that require forced
|
Comma-separated list of resolutions that require forced
|
||||||
|
|||||||
Reference in New Issue
Block a user