Compare commits

...

3 Commits
v6.17 ... v6.18

Author SHA1 Message Date
Maxim Devaev
c848756d53 Bump version: 6.17 → 6.18 2024-11-29 22:26:02 +02:00
Maxim Devaev
2a8aaabe48 janus: Fixed return value of message handler + memory leak with transaction 2024-11-29 22:03:49 +02:00
Maxim Devaev
239db92a85 Issue #295: Fixed double json_decref() 2024-11-27 16:08:29 +02:00
8 changed files with 25 additions and 25 deletions

View File

@@ -1,7 +1,7 @@
[bumpversion] [bumpversion]
commit = True commit = True
tag = True tag = True
current_version = 6.17 current_version = 6.18
parse = (?P<major>\d+)\.(?P<minor>\d+) parse = (?P<major>\d+)\.(?P<minor>\d+)
serialize = serialize =
{major}.{minor} {major}.{minor}

View File

@@ -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) {

View File

@@ -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.17" "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

View 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.17" "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

View File

@@ -3,7 +3,7 @@
pkgname=ustreamer pkgname=ustreamer
pkgver=6.17 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"

View File

@@ -6,7 +6,7 @@
include $(TOPDIR)/rules.mk include $(TOPDIR)/rules.mk
PKG_NAME:=ustreamer PKG_NAME:=ustreamer
PKG_VERSION:=6.17 PKG_VERSION:=6.18
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_MAINTAINER:=Maxim Devaev <mdevaev@gmail.com> PKG_MAINTAINER:=Maxim Devaev <mdevaev@gmail.com>

View File

@@ -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.17", 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",

View File

@@ -26,7 +26,7 @@
#define US_VERSION_MAJOR 6 #define US_VERSION_MAJOR 6
#define US_VERSION_MINOR 17 #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)