mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-03-01 05:06:32 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c848756d53 | ||
|
|
2a8aaabe48 | ||
|
|
239db92a85 | ||
|
|
740e09c70d | ||
|
|
e030479aae | ||
|
|
4db730abd9 | ||
|
|
79020143c7 |
@@ -1,7 +1,7 @@
|
|||||||
[bumpversion]
|
[bumpversion]
|
||||||
commit = True
|
commit = True
|
||||||
tag = True
|
tag = True
|
||||||
current_version = 6.16
|
current_version = 6.18
|
||||||
parse = (?P<major>\d+)\.(?P<minor>\d+)
|
parse = (?P<major>\d+)\.(?P<minor>\d+)
|
||||||
serialize =
|
serialize =
|
||||||
{major}.{minor}
|
{major}.{minor}
|
||||||
|
|||||||
@@ -406,17 +406,13 @@ static void _plugin_hangup_media(janus_plugin_session *session) { _set_transmit(
|
|||||||
static struct janus_plugin_result *_plugin_handle_message(
|
static struct janus_plugin_result *_plugin_handle_message(
|
||||||
janus_plugin_session *session, char *transaction, json_t *msg, json_t *jsep) {
|
janus_plugin_session *session, char *transaction, json_t *msg, json_t *jsep) {
|
||||||
|
|
||||||
assert(transaction != NULL);
|
janus_plugin_result_type result_type = JANUS_PLUGIN_OK;
|
||||||
|
char *result_msg = NULL;
|
||||||
# define FREE_MSG_JSEP { \
|
|
||||||
US_DELETE(msg, json_decref); \
|
|
||||||
US_DELETE(jsep, json_decref); \
|
|
||||||
}
|
|
||||||
|
|
||||||
if (session == NULL || msg == NULL) {
|
if (session == NULL || msg == NULL) {
|
||||||
free(transaction);
|
result_type = JANUS_PLUGIN_ERROR;
|
||||||
FREE_MSG_JSEP;
|
result_msg = (msg ? "No session" : "No message");
|
||||||
return janus_plugin_result_new(JANUS_PLUGIN_ERROR, (msg ? "No session" : "No message"), NULL);
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
# define PUSH_ERROR(x_error, x_reason) { \
|
# define PUSH_ERROR(x_error, x_reason) { \
|
||||||
@@ -425,20 +421,20 @@ static struct janus_plugin_result *_plugin_handle_message(
|
|||||||
json_object_set_new(m_event, "ustreamer", json_string("event")); \
|
json_object_set_new(m_event, "ustreamer", json_string("event")); \
|
||||||
json_object_set_new(m_event, "error_code", json_integer(x_error)); \
|
json_object_set_new(m_event, "error_code", json_integer(x_error)); \
|
||||||
json_object_set_new(m_event, "error", json_string(x_reason)); \
|
json_object_set_new(m_event, "error", json_string(x_reason)); \
|
||||||
_g_gw->push_event(session, create(), transaction, m_event, NULL); \
|
_g_gw->push_event(session, create(), NULL, m_event, NULL); \
|
||||||
json_decref(m_event); \
|
json_decref(m_event); \
|
||||||
}
|
}
|
||||||
|
|
||||||
json_t *const request = json_object_get(msg, "request");
|
json_t *const request = json_object_get(msg, "request");
|
||||||
if (request == NULL) {
|
if (request == NULL) {
|
||||||
PUSH_ERROR(400, "Request missing");
|
PUSH_ERROR(400, "Request missing");
|
||||||
goto ok_wait;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *const request_str = json_string_value(request);
|
const char *const request_str = json_string_value(request);
|
||||||
if (request_str == NULL) {
|
if (request_str == NULL) {
|
||||||
PUSH_ERROR(400, "Request not a string");
|
PUSH_ERROR(400, "Request not a string");
|
||||||
goto ok_wait;
|
goto done;
|
||||||
}
|
}
|
||||||
// US_JLOG_INFO("main", "Message: %s", request_str);
|
// US_JLOG_INFO("main", "Message: %s", request_str);
|
||||||
|
|
||||||
@@ -448,10 +444,10 @@ static struct janus_plugin_result *_plugin_handle_message(
|
|||||||
json_t *const m_result = json_object(); \
|
json_t *const m_result = json_object(); \
|
||||||
json_object_set_new(m_result, "status", json_string(x_status)); \
|
json_object_set_new(m_result, "status", json_string(x_status)); \
|
||||||
if (x_payload != NULL) { \
|
if (x_payload != NULL) { \
|
||||||
json_object_set_new(m_result, x_status, x_payload); \
|
json_object_set(m_result, x_status, x_payload); \
|
||||||
} \
|
} \
|
||||||
json_object_set_new(m_event, "result", m_result); \
|
json_object_set_new(m_event, "result", m_result); \
|
||||||
_g_gw->push_event(session, create(), transaction, m_event, x_jsep); \
|
_g_gw->push_event(session, create(), NULL, m_event, x_jsep); \
|
||||||
json_decref(m_event); \
|
json_decref(m_event); \
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -542,13 +538,17 @@ static struct janus_plugin_result *_plugin_handle_message(
|
|||||||
PUSH_ERROR(405, "Not implemented");
|
PUSH_ERROR(405, "Not implemented");
|
||||||
}
|
}
|
||||||
|
|
||||||
ok_wait:
|
done:
|
||||||
FREE_MSG_JSEP;
|
US_DELETE(transaction, free);
|
||||||
return janus_plugin_result_new(JANUS_PLUGIN_OK_WAIT, NULL, NULL);
|
US_DELETE(msg, json_decref);
|
||||||
|
US_DELETE(jsep, json_decref);
|
||||||
|
|
||||||
|
return janus_plugin_result_new(
|
||||||
|
result_type, result_msg,
|
||||||
|
(result_type == JANUS_PLUGIN_OK ? json_pack("{sb}", "ok", 1) : NULL));
|
||||||
|
|
||||||
# undef PUSH_STATUS
|
# undef PUSH_STATUS
|
||||||
# undef PUSH_ERROR
|
# undef PUSH_ERROR
|
||||||
# undef FREE_MSG_JSEP
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _plugin_incoming_rtcp(janus_plugin_session *handle, janus_plugin_rtcp *packet) {
|
static void _plugin_incoming_rtcp(janus_plugin_session *handle, janus_plugin_rtcp *packet) {
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ commands = cppcheck \
|
|||||||
--check-level=exhaustive \
|
--check-level=exhaustive \
|
||||||
--enable=warning,portability,performance,style \
|
--enable=warning,portability,performance,style \
|
||||||
--suppress=assignmentInAssert \
|
--suppress=assignmentInAssert \
|
||||||
|
--suppress=assertWithSideEffect \
|
||||||
--suppress=variableScope \
|
--suppress=variableScope \
|
||||||
--inline-suppr \
|
--inline-suppr \
|
||||||
--library=python \
|
--library=python \
|
||||||
|
|||||||
@@ -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 6.16" "January 2021"
|
.TH USTREAMER-DUMP 1 "version 6.18" "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 6.16" "November 2020"
|
.TH USTREAMER 1 "version 6.18" "November 2020"
|
||||||
|
|
||||||
.SH NAME
|
.SH NAME
|
||||||
ustreamer \- stream MJPEG video from any V4L2 device to the network
|
ustreamer \- stream MJPEG video from any V4L2 device to the network
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
|
|
||||||
pkgname=ustreamer
|
pkgname=ustreamer
|
||||||
pkgver=6.16
|
pkgver=6.18
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc="Lightweight and fast MJPEG-HTTP streamer"
|
pkgdesc="Lightweight and fast MJPEG-HTTP streamer"
|
||||||
url="https://github.com/pikvm/ustreamer"
|
url="https://github.com/pikvm/ustreamer"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=ustreamer
|
PKG_NAME:=ustreamer
|
||||||
PKG_VERSION:=6.16
|
PKG_VERSION:=6.18
|
||||||
PKG_RELEASE:=1
|
PKG_RELEASE:=1
|
||||||
PKG_MAINTAINER:=Maxim Devaev <mdevaev@gmail.com>
|
PKG_MAINTAINER:=Maxim Devaev <mdevaev@gmail.com>
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ def _find_sources(suffix: str) -> list[str]:
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
setup(
|
setup(
|
||||||
name="ustreamer",
|
name="ustreamer",
|
||||||
version="6.16",
|
version="6.18",
|
||||||
description="uStreamer tools",
|
description="uStreamer tools",
|
||||||
author="Maxim Devaev",
|
author="Maxim Devaev",
|
||||||
author_email="mdevaev@gmail.com",
|
author_email="mdevaev@gmail.com",
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
|
|
||||||
#define US_VERSION_MAJOR 6
|
#define US_VERSION_MAJOR 6
|
||||||
#define US_VERSION_MINOR 16
|
#define US_VERSION_MINOR 18
|
||||||
|
|
||||||
#define US_MAKE_VERSION2(_major, _minor) #_major "." #_minor
|
#define US_MAKE_VERSION2(_major, _minor) #_major "." #_minor
|
||||||
#define US_MAKE_VERSION1(_major, _minor) US_MAKE_VERSION2(_major, _minor)
|
#define US_MAKE_VERSION1(_major, _minor) US_MAKE_VERSION2(_major, _minor)
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ int main(int argc, char *argv[]) {
|
|||||||
_g_server = us_server_init(_g_stream);
|
_g_server = us_server_init(_g_stream);
|
||||||
|
|
||||||
if ((exit_code = options_parse(options, cap, enc, _g_stream, _g_server)) == 0) {
|
if ((exit_code = options_parse(options, cap, enc, _g_stream, _g_server)) == 0) {
|
||||||
|
us_stream_update_blank(_g_stream, cap);
|
||||||
# ifdef WITH_GPIO
|
# ifdef WITH_GPIO
|
||||||
us_gpio_init();
|
us_gpio_init();
|
||||||
# endif
|
# endif
|
||||||
|
|||||||
@@ -129,6 +129,10 @@ us_stream_s *us_stream_init(us_capture_s *cap, us_encoder_s *enc) {
|
|||||||
return stream;
|
return stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void us_stream_update_blank(us_stream_s *stream, const us_capture_s *cap) {
|
||||||
|
us_blank_draw(stream->run->blank, "< NO SIGNAL >", cap->width, cap->height);
|
||||||
|
}
|
||||||
|
|
||||||
void us_stream_destroy(us_stream_s *stream) {
|
void us_stream_destroy(us_stream_s *stream) {
|
||||||
us_fpsi_destroy(stream->run->http->captured_fpsi);
|
us_fpsi_destroy(stream->run->http->captured_fpsi);
|
||||||
US_RING_DELETE_WITH_ITEMS(stream->run->http->jpeg_ring, us_frame_destroy);
|
US_RING_DELETE_WITH_ITEMS(stream->run->http->jpeg_ring, us_frame_destroy);
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ typedef struct {
|
|||||||
|
|
||||||
|
|
||||||
us_stream_s *us_stream_init(us_capture_s *cap, us_encoder_s *enc);
|
us_stream_s *us_stream_init(us_capture_s *cap, us_encoder_s *enc);
|
||||||
|
void us_stream_update_blank(us_stream_s *stream, const us_capture_s *cap);
|
||||||
void us_stream_destroy(us_stream_s *stream);
|
void us_stream_destroy(us_stream_s *stream);
|
||||||
|
|
||||||
void us_stream_loop(us_stream_s *stream);
|
void us_stream_loop(us_stream_s *stream);
|
||||||
|
|||||||
Reference in New Issue
Block a user