mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-02-19 08:16:31 +00:00
raw sink
This commit is contained in:
@@ -89,6 +89,7 @@ enum _OPT_VALUES {
|
||||
_O_##_prefix##_CLIENT_TTL, \
|
||||
_O_##_prefix##_TIMEOUT,
|
||||
ADD_SINK(SINK)
|
||||
ADD_SINK(RAW_SINK)
|
||||
# ifdef WITH_OMX
|
||||
ADD_SINK(H264_SINK)
|
||||
_O_H264_BITRATE,
|
||||
@@ -181,6 +182,7 @@ static const struct option _LONG_OPTS[] = {
|
||||
{_opt "sink-client-ttl", required_argument, NULL, _O_##_prefix##_CLIENT_TTL}, \
|
||||
{_opt "sink-timeout", required_argument, NULL, _O_##_prefix##_TIMEOUT},
|
||||
ADD_SINK("", SINK)
|
||||
ADD_SINK("raw-", RAW_SINK)
|
||||
# ifdef WITH_OMX
|
||||
ADD_SINK("h264-", H264_SINK)
|
||||
{"h264-bitrate", required_argument, NULL, _O_H264_BITRATE},
|
||||
@@ -245,6 +247,7 @@ void options_destroy(options_s *options) {
|
||||
} \
|
||||
}
|
||||
ADD_SINK(sink);
|
||||
ADD_SINK(raw_sink);
|
||||
# ifdef WITH_OMX
|
||||
ADD_SINK(h264_sink);
|
||||
# endif
|
||||
@@ -339,6 +342,7 @@ int options_parse(options_s *options, device_s *dev, encoder_s *enc, stream_s *s
|
||||
unsigned _prefix##_client_ttl = 10; \
|
||||
unsigned _prefix##_timeout = 1;
|
||||
ADD_SINK(sink);
|
||||
ADD_SINK(raw_sink);
|
||||
# ifdef WITH_OMX
|
||||
ADD_SINK(h264_sink);
|
||||
# endif
|
||||
@@ -427,6 +431,7 @@ int options_parse(options_s *options, device_s *dev, encoder_s *enc, stream_s *s
|
||||
case _O_##_up##_CLIENT_TTL: OPT_NUMBER("--" #_opt "sink-client-ttl", _lp##_client_ttl, 1, 60, 0); \
|
||||
case _O_##_up##_TIMEOUT: OPT_NUMBER("--" #_opt "sink-timeout", _lp##_timeout, 1, 60, 0);
|
||||
ADD_SINK("", sink, SINK)
|
||||
ADD_SINK("raw-", raw_sink, RAW_SINK)
|
||||
# ifdef WITH_OMX
|
||||
ADD_SINK("h264-", h264_sink, H264_SINK)
|
||||
case _O_H264_BITRATE: OPT_NUMBER("--h264-bitrate", stream->h264_bitrate, 100, 16000, 0);
|
||||
@@ -488,6 +493,7 @@ int options_parse(options_s *options, device_s *dev, encoder_s *enc, stream_s *s
|
||||
stream->_prefix = options->_prefix; \
|
||||
}
|
||||
ADD_SINK("JPEG", sink);
|
||||
ADD_SINK("RAW", raw_sink);
|
||||
# ifdef WITH_OMX
|
||||
ADD_SINK("H264", h264_sink);
|
||||
# endif
|
||||
@@ -662,6 +668,7 @@ static void _help(FILE *fp, device_s *dev, encoder_s *enc, stream_s *stream, ser
|
||||
SAY(" --" _opt "sink-client-ttl <sec> ─ Client TTL. Default: 10.\n"); \
|
||||
SAY(" --" _opt "sink-timeout <sec> ──── Timeout for lock. Default: 1.\n");
|
||||
ADD_SINK("JPEG", "")
|
||||
ADD_SINK("RAW", "raw-")
|
||||
# ifdef WITH_OMX
|
||||
ADD_SINK("H264", "h264-")
|
||||
SAY(" --h264-bitrate <kbps> ──────── H264 bitrate in Kbps. Default: %u.\n", stream->h264_bitrate);
|
||||
|
||||
@@ -55,6 +55,7 @@ typedef struct {
|
||||
char **argv_copy;
|
||||
frame_s *blank;
|
||||
memsink_s *sink;
|
||||
memsink_s *raw_sink;
|
||||
# ifdef WITH_OMX
|
||||
memsink_s *h264_sink;
|
||||
# endif
|
||||
|
||||
@@ -194,6 +194,12 @@ void stream_loop(stream_s *stream) {
|
||||
workers_pool_assign(pool, ready_wr);
|
||||
LOG_DEBUG("Assigned new frame in buffer %d to worker %s", buf_index, ready_wr->name);
|
||||
|
||||
if (stream->raw_sink) {
|
||||
if (memsink_server_check_clients(stream->raw_sink) == 0 && stream->raw_sink->has_clients) {
|
||||
memsink_server_put(stream->raw_sink, &hw->raw);
|
||||
}
|
||||
}
|
||||
|
||||
# ifdef WITH_OMX
|
||||
if (RUN(h264)) {
|
||||
h264_stream_process(RUN(h264), &hw->raw, hw->vcsm_handle, h264_force_key);
|
||||
|
||||
@@ -80,6 +80,7 @@ typedef struct {
|
||||
unsigned error_delay;
|
||||
|
||||
memsink_s *sink;
|
||||
memsink_s *raw_sink;
|
||||
|
||||
# ifdef WITH_OMX
|
||||
memsink_s *h264_sink;
|
||||
|
||||
Reference in New Issue
Block a user