mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-02-27 04:06:30 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b746bc307c | ||
|
|
3fd3aab909 | ||
|
|
2f1afb6044 | ||
|
|
a016c1040e | ||
|
|
d4e9948220 | ||
|
|
5d1183f5c6 | ||
|
|
c75863d4bd | ||
|
|
5576cbb3b8 | ||
|
|
4a156a692a | ||
|
|
1a8dfb1f1b |
@@ -1,7 +1,7 @@
|
|||||||
[bumpversion]
|
[bumpversion]
|
||||||
commit = True
|
commit = True
|
||||||
tag = True
|
tag = True
|
||||||
current_version = 3.0
|
current_version = 3.4
|
||||||
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}
|
||||||
|
|||||||
9
Makefile
9
Makefile
@@ -82,10 +82,11 @@ all: $(USTR) $(DUMP)
|
|||||||
|
|
||||||
|
|
||||||
install: $(USTR) $(DUMP)
|
install: $(USTR) $(DUMP)
|
||||||
install -Dm755 $(USTR) $(DESTDIR)$(PREFIX)/bin/$(USTR)
|
mkdir -p $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(MANPREFIX)/man1
|
||||||
install -Dm755 $(DUMP) $(DESTDIR)$(PREFIX)/bin/$(DUMP)
|
install -m755 $(USTR) $(DESTDIR)$(PREFIX)/bin/$(USTR)
|
||||||
install -Dm644 man/$(USTR).1 $(DESTDIR)$(MANPREFIX)/man1/$(USTR).1
|
install -m755 $(DUMP) $(DESTDIR)$(PREFIX)/bin/$(DUMP)
|
||||||
install -Dm644 man/$(DUMP).1 $(DESTDIR)$(MANPREFIX)/man1/$(DUMP).1
|
install -m644 man/$(USTR).1 $(DESTDIR)$(MANPREFIX)/man1/$(USTR).1
|
||||||
|
install -m644 man/$(DUMP).1 $(DESTDIR)$(MANPREFIX)/man1/$(DUMP).1
|
||||||
gzip $(DESTDIR)$(MANPREFIX)/man1/$(USTR).1
|
gzip $(DESTDIR)$(MANPREFIX)/man1/$(USTR).1
|
||||||
gzip $(DESTDIR)$(MANPREFIX)/man1/$(DUMP).1
|
gzip $(DESTDIR)$(MANPREFIX)/man1/$(DUMP).1
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
.\" Manpage for ustreamer-dump.
|
.\" Manpage for ustreamer-dump.
|
||||||
.\" Open an issue or pull request to https://github.com/pikvm/ustreamer to correct errors or typos
|
.\" Open an issue or pull request to https://github.com/pikvm/ustreamer to correct errors or typos
|
||||||
.TH USTREAMER-DUMP 1 "version 3.0" "January 2021"
|
.TH USTREAMER-DUMP 1 "version 3.4" "January 2021"
|
||||||
|
|
||||||
.SH NAME
|
.SH NAME
|
||||||
ustreamer-dump \- Dump uStreamer's memory sink to file
|
ustreamer-dump \- Dump uStreamer's memory sink to file
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
.\" Manpage for ustreamer.
|
.\" Manpage for ustreamer.
|
||||||
.\" Open an issue or pull request to https://github.com/pikvm/ustreamer to correct errors or typos
|
.\" Open an issue or pull request to https://github.com/pikvm/ustreamer to correct errors or typos
|
||||||
.TH USTREAMER 1 "version 3.0" "November 2020"
|
.TH USTREAMER 1 "version 3.4" "November 2020"
|
||||||
|
|
||||||
.SH NAME
|
.SH NAME
|
||||||
ustreamer \- stream MJPG video from any V4L2 device to the network
|
ustreamer \- stream MJPG video from any V4L2 device to the network
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
|
|
||||||
pkgname=ustreamer
|
pkgname=ustreamer
|
||||||
pkgver=3.0
|
pkgver=3.4
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Lightweight and fast MJPG-HTTP streamer"
|
pkgdesc="Lightweight and fast MJPG-HTTP streamer"
|
||||||
url="https://github.com/pikvm/ustreamer"
|
url="https://github.com/pikvm/ustreamer"
|
||||||
@@ -25,6 +25,10 @@ build() {
|
|||||||
local _options="WITH_GPIO=1"
|
local _options="WITH_GPIO=1"
|
||||||
[ -e /opt/vc/include/IL/OMX_Core.h ] && _options="$_options WITH_OMX=1"
|
[ -e /opt/vc/include/IL/OMX_Core.h ] && _options="$_options WITH_OMX=1"
|
||||||
|
|
||||||
|
# LD does not link mmal with this option
|
||||||
|
LDFLAGS="${LDFLAGS//--as-needed/}"
|
||||||
|
LDFLAGS="${LDFLAGS//,,/,}"
|
||||||
|
|
||||||
make $_options CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" $MAKEFLAGS
|
make $_options CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" $MAKEFLAGS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=ustreamer
|
PKG_NAME:=ustreamer
|
||||||
PKG_VERSION:=3.0
|
PKG_VERSION:=3.4
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
PKG_MAINTAINER:=Maxim Devaev <mdevaev@gmail.com>
|
PKG_MAINTAINER:=Maxim Devaev <mdevaev@gmail.com>
|
||||||
|
|
||||||
|
|||||||
@@ -23,5 +23,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#ifndef VERSION
|
#ifndef VERSION
|
||||||
# define VERSION "3.0"
|
# define VERSION "3.4"
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -50,6 +50,11 @@
|
|||||||
Without this option, when the frame series is completed, WebKit-based browsers<br>
|
Without this option, when the frame series is completed, WebKit-based browsers<br>
|
||||||
renders the last frame with a delay.
|
renders the last frame with a delay.
|
||||||
</li>
|
</li>
|
||||||
|
<br>
|
||||||
|
<li>
|
||||||
|
<b>zero_data=1</b><br>
|
||||||
|
Disables the actual sending of JPEG data and leaves only response headers.
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
<br>
|
<br>
|
||||||
|
|||||||
@@ -75,6 +75,11 @@ const char *const HTML_INDEX_PAGE = " \
|
|||||||
Without this option, when the frame series is completed, WebKit-based browsers<br> \
|
Without this option, when the frame series is completed, WebKit-based browsers<br> \
|
||||||
renders the last frame with a delay. \
|
renders the last frame with a delay. \
|
||||||
</li> \
|
</li> \
|
||||||
|
<br> \
|
||||||
|
<li> \
|
||||||
|
<b>zero_data=1</b><br> \
|
||||||
|
Disables the actual sending of JPEG data and leaves only response headers. \
|
||||||
|
</li> \
|
||||||
</ul> \
|
</ul> \
|
||||||
</li> \
|
</li> \
|
||||||
<br> \
|
<br> \
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ h264_stream_s *h264_stream_init(memsink_s *sink, unsigned bitrate, unsigned gop)
|
|||||||
h264->sink = sink;
|
h264->sink = sink;
|
||||||
h264->tmp_src = frame_init("h264_tmp_src");
|
h264->tmp_src = frame_init("h264_tmp_src");
|
||||||
h264->dest = frame_init("h264_dest");
|
h264->dest = frame_init("h264_dest");
|
||||||
|
atomic_init(&h264->online, false);
|
||||||
|
|
||||||
// FIXME: 30 or 0? https://github.com/6by9/yavta/blob/master/yavta.c#L210
|
// FIXME: 30 or 0? https://github.com/6by9/yavta/blob/master/yavta.c#L210
|
||||||
if ((h264->enc = h264_encoder_init(bitrate, gop, 0)) == NULL) {
|
if ((h264->enc = h264_encoder_init(bitrate, gop, 0)) == NULL) {
|
||||||
@@ -73,13 +74,17 @@ void h264_stream_process(h264_stream_s *h264, const frame_s *frame, int vcsm_han
|
|||||||
LOG_VERBOSE("H264: Source copied; time=%.3Lf", get_now_monotonic() - now);
|
LOG_VERBOSE("H264: Source copied; time=%.3Lf", get_now_monotonic() - now);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool online = false;
|
||||||
|
|
||||||
if (!h264_encoder_is_prepared_for(h264->enc, frame, zero_copy)) {
|
if (!h264_encoder_is_prepared_for(h264->enc, frame, zero_copy)) {
|
||||||
h264_encoder_prepare(h264->enc, frame, zero_copy);
|
h264_encoder_prepare(h264->enc, frame, zero_copy);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (h264->enc->ready) {
|
if (h264->enc->ready) {
|
||||||
if (h264_encoder_compress(h264->enc, frame, vcsm_handle, h264->dest, force_key) == 0) {
|
if (h264_encoder_compress(h264->enc, frame, vcsm_handle, h264->dest, force_key) == 0) {
|
||||||
memsink_server_put(h264->sink, h264->dest);
|
online = !memsink_server_put(h264->sink, h264->dest);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
atomic_store(&h264->online, online);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <stdatomic.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include "../../libs/tools.h"
|
#include "../../libs/tools.h"
|
||||||
@@ -39,6 +40,7 @@ typedef struct {
|
|||||||
frame_s *tmp_src;
|
frame_s *tmp_src;
|
||||||
frame_s *dest;
|
frame_s *dest;
|
||||||
h264_encoder_s *enc;
|
h264_encoder_s *enc;
|
||||||
|
atomic_bool online;
|
||||||
} h264_stream_s;
|
} h264_stream_s;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ int server_listen(server_s *server) {
|
|||||||
char *raw_token;
|
char *raw_token;
|
||||||
char *encoded_token = NULL;
|
char *encoded_token = NULL;
|
||||||
|
|
||||||
A_CALLOC(raw_token, strlen(server->user) + strlen(server->passwd) + 2);
|
A_CALLOC(raw_token, strlen(server->user) + strlen(server->passwd) + 16);
|
||||||
sprintf(raw_token, "%s:%s", server->user, server->passwd);
|
sprintf(raw_token, "%s:%s", server->user, server->passwd);
|
||||||
base64_encode((uint8_t *)raw_token, strlen(raw_token), &encoded_token, NULL);
|
base64_encode((uint8_t *)raw_token, strlen(raw_token), &encoded_token, NULL);
|
||||||
free(raw_token);
|
free(raw_token);
|
||||||
@@ -339,12 +339,24 @@ static void _http_callback_state(struct evhttp_request *request, void *v_server)
|
|||||||
|
|
||||||
assert(evbuffer_add_printf(buf,
|
assert(evbuffer_add_printf(buf,
|
||||||
"{\"ok\": true, \"result\": {"
|
"{\"ok\": true, \"result\": {"
|
||||||
" \"encoder\": {\"type\": \"%s\", \"quality\": %u},"
|
" \"encoder\": {\"type\": \"%s\", \"quality\": %u},",
|
||||||
|
encoder_type_to_string(enc_type),
|
||||||
|
enc_quality
|
||||||
|
));
|
||||||
|
# ifdef WITH_OMX
|
||||||
|
if (STREAM(run->h264)) {
|
||||||
|
assert(evbuffer_add_printf(buf,
|
||||||
|
" \"h264\": {\"bitrate\": %u, \"gop\": %u, \"online\": %s},",
|
||||||
|
STREAM(h264_bitrate),
|
||||||
|
STREAM(h264_gop),
|
||||||
|
bool_to_string(atomic_load(&STREAM(run->h264->online)))
|
||||||
|
));
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
assert(evbuffer_add_printf(buf,
|
||||||
" \"source\": {\"resolution\": {\"width\": %u, \"height\": %u},"
|
" \"source\": {\"resolution\": {\"width\": %u, \"height\": %u},"
|
||||||
" \"online\": %s, \"desired_fps\": %u, \"captured_fps\": %u},"
|
" \"online\": %s, \"desired_fps\": %u, \"captured_fps\": %u},"
|
||||||
" \"stream\": {\"queued_fps\": %u, \"clients\": %u, \"clients_stat\": {",
|
" \"stream\": {\"queued_fps\": %u, \"clients\": %u, \"clients_stat\": {",
|
||||||
encoder_type_to_string(enc_type),
|
|
||||||
enc_quality,
|
|
||||||
(server->fake_width ? server->fake_width : EX(frame->width)),
|
(server->fake_width ? server->fake_width : EX(frame->width)),
|
||||||
(server->fake_height ? server->fake_height : EX(frame->height)),
|
(server->fake_height ? server->fake_height : EX(frame->height)),
|
||||||
bool_to_string(EX(frame->online)),
|
bool_to_string(EX(frame->online)),
|
||||||
@@ -356,12 +368,14 @@ static void _http_callback_state(struct evhttp_request *request, void *v_server)
|
|||||||
|
|
||||||
for (stream_client_s * client = RUN(stream_clients); client != NULL; client = client->next) {
|
for (stream_client_s * client = RUN(stream_clients); client != NULL; client = client->next) {
|
||||||
assert(evbuffer_add_printf(buf,
|
assert(evbuffer_add_printf(buf,
|
||||||
"\"%s\": {\"fps\": %u, \"extra_headers\": %s, \"advance_headers\": %s, \"dual_final_frames\": %s}%s",
|
"\"%s\": {\"fps\": %u, \"extra_headers\": %s, \"advance_headers\": %s,"
|
||||||
|
" \"dual_final_frames\": %s, \"zero_data\": %s}%s",
|
||||||
client->id,
|
client->id,
|
||||||
client->fps,
|
client->fps,
|
||||||
bool_to_string(client->extra_headers),
|
bool_to_string(client->extra_headers),
|
||||||
bool_to_string(client->advance_headers),
|
bool_to_string(client->advance_headers),
|
||||||
bool_to_string(client->dual_final_frames),
|
bool_to_string(client->dual_final_frames),
|
||||||
|
bool_to_string(client->zero_data),
|
||||||
(client->next ? ", " : "")
|
(client->next ? ", " : "")
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@@ -392,12 +406,12 @@ static void _http_callback_snapshot(struct evhttp_request *request, void *v_serv
|
|||||||
char header_buf[256];
|
char header_buf[256];
|
||||||
|
|
||||||
# define ADD_TIME_HEADER(_key, _value) { \
|
# define ADD_TIME_HEADER(_key, _value) { \
|
||||||
sprintf(header_buf, "%.06Lf", _value); \
|
snprintf(header_buf, 255, "%.06Lf", _value); \
|
||||||
ADD_HEADER(_key, header_buf); \
|
ADD_HEADER(_key, header_buf); \
|
||||||
}
|
}
|
||||||
|
|
||||||
# define ADD_UNSIGNED_HEADER(_key, _value) { \
|
# define ADD_UNSIGNED_HEADER(_key, _value) { \
|
||||||
sprintf(header_buf, "%u", _value); \
|
snprintf(header_buf, 255, "%u", _value); \
|
||||||
ADD_HEADER(_key, header_buf); \
|
ADD_HEADER(_key, header_buf); \
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -450,10 +464,13 @@ static void _http_callback_stream(struct evhttp_request *request, void *v_server
|
|||||||
|
|
||||||
struct evkeyvalq params;
|
struct evkeyvalq params;
|
||||||
evhttp_parse_query(evhttp_request_get_uri(request), ¶ms);
|
evhttp_parse_query(evhttp_request_get_uri(request), ¶ms);
|
||||||
client->key = uri_get_string(¶ms, "key");
|
# define PARSE_PARAM(_type, _name) client->_name = uri_get_##_type(¶ms, #_name)
|
||||||
client->extra_headers = uri_get_true(¶ms, "extra_headers");
|
PARSE_PARAM(string, key);
|
||||||
client->advance_headers = uri_get_true(¶ms, "advance_headers");
|
PARSE_PARAM(true, extra_headers);
|
||||||
client->dual_final_frames = uri_get_true(¶ms, "dual_final_frames");
|
PARSE_PARAM(true, advance_headers);
|
||||||
|
PARSE_PARAM(true, dual_final_frames);
|
||||||
|
PARSE_PARAM(true, zero_data);
|
||||||
|
# undef PARSE_PARAM
|
||||||
evhttp_clear_headers(¶ms);
|
evhttp_clear_headers(¶ms);
|
||||||
|
|
||||||
uuid_t uuid;
|
uuid_t uuid;
|
||||||
@@ -580,7 +597,7 @@ static void _http_callback_stream_write(struct bufferevent *buf_event, void *v_c
|
|||||||
"Content-Length: %zu" RN
|
"Content-Length: %zu" RN
|
||||||
"X-Timestamp: %.06Lf" RN
|
"X-Timestamp: %.06Lf" RN
|
||||||
"%s",
|
"%s",
|
||||||
EX(frame->used),
|
(!client->zero_data ? EX(frame->used) : 0),
|
||||||
get_now_real(),
|
get_now_real(),
|
||||||
(client->extra_headers ? "" : RN)
|
(client->extra_headers ? "" : RN)
|
||||||
));
|
));
|
||||||
@@ -598,6 +615,7 @@ static void _http_callback_stream_write(struct bufferevent *buf_event, void *v_c
|
|||||||
"X-UStreamer-Expose-Cmp-Time: %.06Lf" RN
|
"X-UStreamer-Expose-Cmp-Time: %.06Lf" RN
|
||||||
"X-UStreamer-Expose-End-Time: %.06Lf" RN
|
"X-UStreamer-Expose-End-Time: %.06Lf" RN
|
||||||
"X-UStreamer-Send-Time: %.06Lf" RN
|
"X-UStreamer-Send-Time: %.06Lf" RN
|
||||||
|
"X-UStreamer-Latency: %.06Lf" RN
|
||||||
RN,
|
RN,
|
||||||
bool_to_string(EX(frame->online)),
|
bool_to_string(EX(frame->online)),
|
||||||
EX(dropped),
|
EX(dropped),
|
||||||
@@ -610,12 +628,15 @@ static void _http_callback_stream_write(struct bufferevent *buf_event, void *v_c
|
|||||||
EX(expose_begin_ts),
|
EX(expose_begin_ts),
|
||||||
EX(expose_cmp_ts),
|
EX(expose_cmp_ts),
|
||||||
EX(expose_end_ts),
|
EX(expose_end_ts),
|
||||||
now
|
now,
|
||||||
|
now - EX(frame->grab_ts)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(!evbuffer_add(buf, (void *)EX(frame->data), EX(frame->used)));
|
if (!client->zero_data) {
|
||||||
|
assert(!evbuffer_add(buf, (void *)EX(frame->data), EX(frame->used)));
|
||||||
|
}
|
||||||
assert(evbuffer_add_printf(buf, RN "--" BOUNDARY RN));
|
assert(evbuffer_add_printf(buf, RN "--" BOUNDARY RN));
|
||||||
|
|
||||||
if (client->advance_headers) {
|
if (client->advance_headers) {
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ typedef struct stream_client_sx {
|
|||||||
bool extra_headers;
|
bool extra_headers;
|
||||||
bool advance_headers;
|
bool advance_headers;
|
||||||
bool dual_final_frames;
|
bool dual_final_frames;
|
||||||
|
bool zero_data;
|
||||||
|
|
||||||
char id[37]; // ex. "1b4e28ba-2fa1-11d2-883f-0016d3cca427" + "\0"
|
char id[37]; // ex. "1b4e28ba-2fa1-11d2-883f-0016d3cca427" + "\0"
|
||||||
bool need_initial;
|
bool need_initial;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ char *find_static_file_path(const char *root_path, const char *request_path) {
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
A_CALLOC(path, strlen(root_path) + strlen(simplified_path) + 32);
|
A_CALLOC(path, strlen(root_path) + strlen(simplified_path) + 16);
|
||||||
sprintf(path, "%s/%s", root_path, simplified_path);
|
sprintf(path, "%s/%s", root_path, simplified_path);
|
||||||
|
|
||||||
struct stat st;
|
struct stat st;
|
||||||
|
|||||||
@@ -119,23 +119,31 @@ int main(int argc, char *argv[]) {
|
|||||||
LOGGING_INIT;
|
LOGGING_INIT;
|
||||||
A_THREAD_RENAME("main");
|
A_THREAD_RENAME("main");
|
||||||
|
|
||||||
# ifdef WITH_OMX
|
|
||||||
bcm_host_init();
|
|
||||||
OMX_ERRORTYPE omx_error;
|
|
||||||
if ((omx_error = OMX_Init()) != OMX_ErrorNone) {
|
|
||||||
LOG_ERROR_OMX(omx_error, "Can't initialize OMX Core");
|
|
||||||
exit_code = -1;
|
|
||||||
goto omx_error;
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
|
|
||||||
options_s *options = options_init(argc, argv);
|
options_s *options = options_init(argc, argv);
|
||||||
device_s *dev = device_init();
|
device_s *dev = device_init();
|
||||||
encoder_s *enc = encoder_init();
|
encoder_s *enc = encoder_init();
|
||||||
stream_s *stream = stream_init(dev, enc);
|
stream_s *stream = stream_init(dev, enc);
|
||||||
server_s *server = server_init(stream);
|
server_s *server = server_init(stream);
|
||||||
|
|
||||||
|
# ifdef WITH_OMX
|
||||||
|
bool i_bcm_host = false;
|
||||||
|
OMX_ERRORTYPE omx_error = OMX_ErrorUndefined;
|
||||||
|
# endif
|
||||||
|
|
||||||
if ((exit_code = options_parse(options, dev, enc, stream, server)) == 0) {
|
if ((exit_code = options_parse(options, dev, enc, stream, server)) == 0) {
|
||||||
|
# ifdef WITH_OMX
|
||||||
|
if (enc->type == ENCODER_TYPE_OMX || stream->h264_sink) {
|
||||||
|
bcm_host_init();
|
||||||
|
i_bcm_host = true;
|
||||||
|
}
|
||||||
|
if (enc->type == ENCODER_TYPE_OMX) {
|
||||||
|
if ((omx_error = OMX_Init()) != OMX_ErrorNone) {
|
||||||
|
LOG_ERROR_OMX(omx_error, "Can't initialize OMX Core; forced CPU encoder");
|
||||||
|
enc->type = ENCODER_TYPE_CPU;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
# ifdef WITH_GPIO
|
# ifdef WITH_GPIO
|
||||||
gpio_init();
|
gpio_init();
|
||||||
# endif
|
# endif
|
||||||
@@ -173,9 +181,12 @@ int main(int argc, char *argv[]) {
|
|||||||
options_destroy(options);
|
options_destroy(options);
|
||||||
|
|
||||||
# ifdef WITH_OMX
|
# ifdef WITH_OMX
|
||||||
OMX_Deinit();
|
if (omx_error == OMX_ErrorNone) {
|
||||||
omx_error:
|
OMX_Deinit();
|
||||||
bcm_host_deinit();
|
}
|
||||||
|
if (i_bcm_host) {
|
||||||
|
bcm_host_deinit();
|
||||||
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
if (exit_code == 0) {
|
if (exit_code == 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user