mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-03-03 14:21:42 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e61d7c55e | ||
|
|
4e42c42bae | ||
|
|
b53e3edef1 |
@@ -1,7 +1,7 @@
|
|||||||
[bumpversion]
|
[bumpversion]
|
||||||
commit = True
|
commit = True
|
||||||
tag = True
|
tag = True
|
||||||
current_version = 0.40
|
current_version = 0.41
|
||||||
parse = (?P<major>\d+)\.(?P<minor>\d+)(\.(?P<patch>\d+)(\-(?P<release>[a-z]+))?)?
|
parse = (?P<major>\d+)\.(?P<minor>\d+)(\.(?P<patch>\d+)(\-(?P<release>[a-z]+))?)?
|
||||||
serialize =
|
serialize =
|
||||||
{major}.{minor}
|
{major}.{minor}
|
||||||
|
|||||||
2
PKGBUILD
2
PKGBUILD
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
|
|
||||||
pkgname=ustreamer
|
pkgname=ustreamer
|
||||||
pkgver=0.40
|
pkgver=0.41
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Lightweight and fast MJPG-HTTP streamer"
|
pkgdesc="Lightweight and fast MJPG-HTTP streamer"
|
||||||
url="https://github.com/pi-kvm/ustreamer"
|
url="https://github.com/pi-kvm/ustreamer"
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ The recommended way of running µStreamer with [Auvidea B101](https://www.raspbe
|
|||||||
$ ./ustreamer \
|
$ ./ustreamer \
|
||||||
--format=uyvy \ # Device input format
|
--format=uyvy \ # Device input format
|
||||||
--encoder=omx \ # Hardware encoding with OpenMAX
|
--encoder=omx \ # Hardware encoding with OpenMAX
|
||||||
--dv-timings \ # use DV-timings
|
--dv-timings \ # Use DV-timings
|
||||||
--quality=20 \ # OpenMAX has a non-linear quality scale
|
--quality=20 \ # OpenMAX has a non-linear quality scale
|
||||||
--drop-same-frames=30 # Save that traffic
|
--drop-same-frames=30 # Save that traffic
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -21,4 +21,4 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define VERSION "0.40"
|
#define VERSION "0.41"
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ void encoder_prepare_live(struct encoder_t *encoder, struct device_t *dev) {
|
|||||||
# ifdef OMX_ENCODER
|
# ifdef OMX_ENCODER
|
||||||
if (encoder->type == ENCODER_TYPE_OMX) {
|
if (encoder->type == ENCODER_TYPE_OMX) {
|
||||||
for (unsigned index = 0; index < encoder->n_omxs; ++index) {
|
for (unsigned index = 0; index < encoder->n_omxs; ++index) {
|
||||||
if (omx_encoder_prepare_live(encoder->omxs[index], dev, encoder->quality, encoder->omx_use_ijg) < 0) {
|
if (omx_encoder_prepare_live(encoder->omxs[index], dev, encoder->quality) < 0) {
|
||||||
goto use_fallback;
|
goto use_fallback;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ struct encoder_t {
|
|||||||
enum encoder_type_t type;
|
enum encoder_type_t type;
|
||||||
unsigned quality;
|
unsigned quality;
|
||||||
#ifdef OMX_ENCODER
|
#ifdef OMX_ENCODER
|
||||||
bool omx_use_ijg;
|
|
||||||
unsigned n_omxs;
|
unsigned n_omxs;
|
||||||
struct omx_encoder_t **omxs;
|
struct omx_encoder_t **omxs;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
10
src/main.c
10
src/main.c
@@ -55,9 +55,6 @@ static const struct option _long_opts[] = {
|
|||||||
{"workers", required_argument, NULL, 'w'},
|
{"workers", required_argument, NULL, 'w'},
|
||||||
{"quality", required_argument, NULL, 'q'},
|
{"quality", required_argument, NULL, 'q'},
|
||||||
{"encoder", required_argument, NULL, 'c'},
|
{"encoder", required_argument, NULL, 'c'},
|
||||||
# ifdef OMX_ENCODER
|
|
||||||
{"encoder-omx-use-ijg", required_argument, NULL, 500},
|
|
||||||
# endif
|
|
||||||
{"device-timeout", required_argument, NULL, 1000},
|
{"device-timeout", required_argument, NULL, 1000},
|
||||||
{"device-persistent", no_argument, NULL, 1001},
|
{"device-persistent", no_argument, NULL, 1001},
|
||||||
{"device-error-delay", required_argument, NULL, 1002},
|
{"device-error-delay", required_argument, NULL, 1002},
|
||||||
@@ -117,10 +114,6 @@ static void _help(struct device_t *dev, struct encoder_t *encoder, struct http_s
|
|||||||
printf(" -q|--quality <N> -- Set quality of JPEG encoding from 1 to 100 (best). Default: %d.\n\n", encoder->quality);
|
printf(" -q|--quality <N> -- Set quality of JPEG encoding from 1 to 100 (best). Default: %d.\n\n", encoder->quality);
|
||||||
printf(" --encoder <type> -- Use specified encoder. It may affects to workers number.\n");
|
printf(" --encoder <type> -- Use specified encoder. It may affects to workers number.\n");
|
||||||
printf(" -- Available: %s; default: CPU.\n\n", ENCODER_TYPES_STR);
|
printf(" -- Available: %s; default: CPU.\n\n", ENCODER_TYPES_STR);
|
||||||
# ifdef OMX_ENCODER
|
|
||||||
printf(" --encoder-omx-use-ijg -- Use the standard IJG quality tables when encoding images using OMX.\n");
|
|
||||||
printf(" Default: disabled.\n\n");
|
|
||||||
# endif
|
|
||||||
printf(" --device-timeout <seconds> -- Timeout for device querying. Default: %d\n\n", dev->timeout);
|
printf(" --device-timeout <seconds> -- Timeout for device querying. Default: %d\n\n", dev->timeout);
|
||||||
printf(" --device-persistent -- Don't re-initialize device on timeout. Default: disabled.\n\n");
|
printf(" --device-persistent -- Don't re-initialize device on timeout. Default: disabled.\n\n");
|
||||||
printf(" --device-error-delay <seconds> -- Delay before trying to connect to the device again\n");
|
printf(" --device-error-delay <seconds> -- Delay before trying to connect to the device again\n");
|
||||||
@@ -185,9 +178,6 @@ static int _parse_options(int argc, char *argv[], struct device_t *dev, struct e
|
|||||||
case 'w': OPT_UNSIGNED(dev->n_workers, "--workers", 1, 32);
|
case 'w': OPT_UNSIGNED(dev->n_workers, "--workers", 1, 32);
|
||||||
case 'q': OPT_UNSIGNED(encoder->quality, "--quality", 1, 100);
|
case 'q': OPT_UNSIGNED(encoder->quality, "--quality", 1, 100);
|
||||||
case 'c': OPT_PARSE(encoder->type, encoder_parse_type, ENCODER_TYPE_UNKNOWN, "encoder type");
|
case 'c': OPT_PARSE(encoder->type, encoder_parse_type, ENCODER_TYPE_UNKNOWN, "encoder type");
|
||||||
# ifdef OMX_ENCODER
|
|
||||||
case 500: OPT_SET(encoder->omx_use_ijg, true);
|
|
||||||
# endif
|
|
||||||
case 1000: OPT_UNSIGNED(dev->timeout, "--device-timeout", 1, 60);
|
case 1000: OPT_UNSIGNED(dev->timeout, "--device-timeout", 1, 60);
|
||||||
case 1001: OPT_SET(dev->persistent, true);
|
case 1001: OPT_SET(dev->persistent, true);
|
||||||
case 1002: OPT_UNSIGNED(dev->error_delay, "--device-error-delay", 1, 60);
|
case 1002: OPT_UNSIGNED(dev->error_delay, "--device-error-delay", 1, 60);
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ static int _i_omx = 0;
|
|||||||
static int _omx_init_component(struct omx_encoder_t *omx);
|
static int _omx_init_component(struct omx_encoder_t *omx);
|
||||||
static int _omx_init_disable_ports(struct omx_encoder_t *omx);
|
static int _omx_init_disable_ports(struct omx_encoder_t *omx);
|
||||||
static int _omx_setup_input(struct omx_encoder_t *omx, struct device_t *dev);
|
static int _omx_setup_input(struct omx_encoder_t *omx, struct device_t *dev);
|
||||||
static int _omx_setup_output(struct omx_encoder_t *omx, const unsigned quality, const bool use_ijg);
|
static int _omx_setup_output(struct omx_encoder_t *omx, const unsigned quality);
|
||||||
static int _omx_encoder_clear_ports(struct omx_encoder_t *omx);
|
static int _omx_encoder_clear_ports(struct omx_encoder_t *omx);
|
||||||
|
|
||||||
static OMX_ERRORTYPE _omx_event_handler(UNUSED OMX_HANDLETYPE encoder,
|
static OMX_ERRORTYPE _omx_event_handler(UNUSED OMX_HANDLETYPE encoder,
|
||||||
@@ -148,7 +148,7 @@ void omx_encoder_destroy(struct omx_encoder_t *omx) {
|
|||||||
free(omx);
|
free(omx);
|
||||||
}
|
}
|
||||||
|
|
||||||
int omx_encoder_prepare_live(struct omx_encoder_t *omx, struct device_t *dev, const unsigned quality, const bool use_ijg) {
|
int omx_encoder_prepare_live(struct omx_encoder_t *omx, struct device_t *dev, const unsigned quality) {
|
||||||
if (component_set_state(&omx->encoder, OMX_StateIdle) < 0) {
|
if (component_set_state(&omx->encoder, OMX_StateIdle) < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -158,7 +158,7 @@ int omx_encoder_prepare_live(struct omx_encoder_t *omx, struct device_t *dev, co
|
|||||||
if (_omx_setup_input(omx, dev) < 0) {
|
if (_omx_setup_input(omx, dev) < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (_omx_setup_output(omx, quality, use_ijg) < 0) {
|
if (_omx_setup_output(omx, quality) < 0) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (component_set_state(&omx->encoder, OMX_StateExecuting) < 0) {
|
if (component_set_state(&omx->encoder, OMX_StateExecuting) < 0) {
|
||||||
@@ -329,7 +329,7 @@ static int _omx_setup_input(struct omx_encoder_t *omx, struct device_t *dev) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int _omx_setup_output(struct omx_encoder_t *omx, const unsigned quality, const bool use_ijg) {
|
static int _omx_setup_output(struct omx_encoder_t *omx, const unsigned quality) {
|
||||||
OMX_ERRORTYPE error;
|
OMX_ERRORTYPE error;
|
||||||
OMX_PARAM_PORTDEFINITIONTYPE portdef;
|
OMX_PARAM_PORTDEFINITIONTYPE portdef;
|
||||||
|
|
||||||
@@ -365,7 +365,7 @@ static int _omx_setup_output(struct omx_encoder_t *omx, const unsigned quality,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (use_ijg) {
|
{
|
||||||
OMX_PARAM_IJGSCALINGTYPE ijg;
|
OMX_PARAM_IJGSCALINGTYPE ijg;
|
||||||
|
|
||||||
OMX_INIT_STRUCTURE(ijg);
|
OMX_INIT_STRUCTURE(ijg);
|
||||||
|
|||||||
@@ -51,5 +51,5 @@ struct omx_encoder_t {
|
|||||||
struct omx_encoder_t *omx_encoder_init();
|
struct omx_encoder_t *omx_encoder_init();
|
||||||
void omx_encoder_destroy(struct omx_encoder_t *omx);
|
void omx_encoder_destroy(struct omx_encoder_t *omx);
|
||||||
|
|
||||||
int omx_encoder_prepare_live(struct omx_encoder_t *omx, struct device_t *dev, const unsigned quality, const bool use_ijg);
|
int omx_encoder_prepare_live(struct omx_encoder_t *omx, struct device_t *dev, const unsigned quality);
|
||||||
int omx_encoder_compress_buffer(struct omx_encoder_t *omx, struct device_t *dev, const unsigned index);
|
int omx_encoder_compress_buffer(struct omx_encoder_t *omx, struct device_t *dev, const unsigned index);
|
||||||
|
|||||||
Reference in New Issue
Block a user