mirror of
https://github.com/pikvm/ustreamer.git
synced 2026-11-05 20:44:14 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
864aac077e | ||
|
|
6952aff31d | ||
|
|
58e517b306 | ||
|
|
f6025267f6 | ||
|
|
3af6bfac0f |
@@ -36,7 +36,7 @@
|
||||
#include "rtpc.h"
|
||||
|
||||
|
||||
typedef struct {
|
||||
typedef struct us_janus_client_sx {
|
||||
janus_callbacks *gw;
|
||||
janus_plugin_session *session;
|
||||
|
||||
@@ -66,7 +66,7 @@ typedef struct {
|
||||
|
||||
ldf last_key_req_ts;
|
||||
|
||||
US_LIST_DECLARE;
|
||||
US_LIST_DECLARE(struct us_janus_client_sx);
|
||||
} us_janus_client_s;
|
||||
|
||||
|
||||
|
||||
@@ -43,7 +43,9 @@ enum {
|
||||
};
|
||||
|
||||
enum {
|
||||
_NALU_SPS = 7
|
||||
_NALU_IDR = 5,
|
||||
_NALU_SPS = 7,
|
||||
_NALU_PPS = 8,
|
||||
};
|
||||
|
||||
|
||||
@@ -92,6 +94,7 @@ us_rtpc_unwrap_result_e us_rtpc_unwrap(
|
||||
if (rtpc->fu && (rtpc->fu_rts != rts || fragment_type != _FR_FU_A)) {
|
||||
rtpc->fu = false;
|
||||
if (!rtpc->fu_is_bad) { // Not reported yet
|
||||
rtpc->skip_until_key = true;
|
||||
return US_RUR_DEPACKETIZATION_FAILED_RETRY;
|
||||
}
|
||||
}
|
||||
@@ -156,6 +159,7 @@ us_rtpc_unwrap_result_e us_rtpc_unwrap(
|
||||
if (!first_fragment) {
|
||||
// US_LOG_INFO("Ignoring FU without a first fragment: seq=%u, rts=%u", seq, rts);
|
||||
rtpc->fu_is_bad = true;
|
||||
rtpc->skip_until_key = true;
|
||||
return US_RUR_DEPACKETIZATION_FAILED;
|
||||
}
|
||||
rtpc->fu_is_bad = false;
|
||||
@@ -181,6 +185,7 @@ us_rtpc_unwrap_result_e us_rtpc_unwrap(
|
||||
} else {
|
||||
// US_LOG_ERROR("Something went wrong with FU processing: seq=%u, rts=%u", seq, rts);
|
||||
rtpc->fu_is_bad = true;
|
||||
rtpc->skip_until_key = true;
|
||||
return US_RUR_DEPACKETIZATION_FAILED;
|
||||
}
|
||||
|
||||
@@ -282,6 +287,19 @@ static void _unwrapping_begin(us_rtpc_s *rtpc) {
|
||||
|
||||
static void _unwrapping_end(us_rtpc_s *rtpc) {
|
||||
us_frame_s *const frame = rtpc->frame;
|
||||
|
||||
US_A(frame->used > 4); // NAL unit start code
|
||||
|
||||
const u8 nalu_type = (frame->data[4] & 0x1F);
|
||||
if (rtpc->skip_until_key && nalu_type != _NALU_SPS && nalu_type != _NALU_PPS) {
|
||||
if (nalu_type != _NALU_IDR) {
|
||||
frame->used = 0;
|
||||
return;
|
||||
} else {
|
||||
rtpc->skip_until_key = false;
|
||||
}
|
||||
}
|
||||
|
||||
frame->format = V4L2_PIX_FMT_H264;
|
||||
frame->width = rtpc->frame_width;
|
||||
frame->height = rtpc->frame_height;
|
||||
|
||||
@@ -52,6 +52,8 @@ typedef struct { // *_rts == [R]TP [T]ime[S]tamp
|
||||
u32 fu_rts;
|
||||
bool fu_is_bad;
|
||||
|
||||
bool skip_until_key;
|
||||
|
||||
us_frame_s *frame;
|
||||
uint frame_width;
|
||||
uint frame_height;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.\" Manpage for ustreamer-dump.
|
||||
.\" Open an issue or pull request to https://github.com/pikvm/ustreamer to correct errors or typos
|
||||
.TH USTREAMER-DUMP 1 "version 6.65" "January 2021"
|
||||
.TH USTREAMER-DUMP 1 "version 6.66" "January 2021"
|
||||
|
||||
.SH NAME
|
||||
ustreamer-dump \- Dump uStreamer's memory sink to file
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
.\" Manpage for ustreamer.
|
||||
.\" Open an issue or pull request to https://github.com/pikvm/ustreamer to correct errors or typos
|
||||
.TH USTREAMER 1 "version 6.65" "November 2020"
|
||||
.TH USTREAMER 1 "version 6.66" "November 2020"
|
||||
|
||||
.SH NAME
|
||||
ustreamer \- stream MJPEG video from any V4L2 device to the network
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
# Contributor: Maxim Devaev <mdevaev@gmail.com>
|
||||
# Author: Maxim Devaev <mdevaev@gmail.com>
|
||||
# Maintainer: Maxim Devaev <mdevaev@gmail.com> [Software author]
|
||||
|
||||
|
||||
pkgname=ustreamer
|
||||
pkgver=6.65
|
||||
pkgver=6.66
|
||||
pkgrel=1
|
||||
pkgdesc="Lightweight and fast MJPEG-HTTP streamer"
|
||||
url="https://github.com/pikvm/ustreamer"
|
||||
license=(GPL)
|
||||
license=(GPL-3.0-or-later)
|
||||
arch=(i686 x86_64 armv6h armv7h aarch64)
|
||||
depends=(libjpeg-turbo libevent libbsd libgpiod systemd)
|
||||
makedepends=(gcc make pkgconf systemd)
|
||||
makedepends=(git)
|
||||
source=(${pkgname}::"git+https://github.com/pikvm/ustreamer#commit=v${pkgver}")
|
||||
md5sums=(SKIP)
|
||||
|
||||
@@ -19,7 +18,7 @@ _options="WITH_GPIO=1 WITH_SYSTEMD=1"
|
||||
if [ -e /usr/bin/python3 ]; then
|
||||
_options="$_options WITH_PYTHON=1"
|
||||
depends+=("python>=3.14" "python<3.15")
|
||||
makedepends+=(python-setuptools python-pip python-build python-wheel python-installer)
|
||||
makedepends+=(python-setuptools python-build python-wheel python-installer)
|
||||
fi
|
||||
if [ -e /usr/include/janus/plugins/plugin.h ];then
|
||||
depends+=(janus-gateway alsa-lib opus)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ustreamer
|
||||
PKG_VERSION:=6.65
|
||||
PKG_VERSION:=6.66
|
||||
PKG_RELEASE:=1
|
||||
PKG_MAINTAINER:=Maxim Devaev <mdevaev@gmail.com>
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ def main() -> None:
|
||||
flags = _find_flags()
|
||||
setup(
|
||||
name="ustreamer",
|
||||
version="6.65",
|
||||
version="6.66",
|
||||
description="uStreamer tools",
|
||||
author="Maxim Devaev",
|
||||
author_email="mdevaev@gmail.com",
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
|
||||
#define US_VERSION_MAJOR 6
|
||||
#define US_VERSION_MINOR 65
|
||||
#define US_VERSION_MINOR 66
|
||||
|
||||
#define US_MAKE_VERSION2(_major, _minor) #_major "." #_minor
|
||||
#define US_MAKE_VERSION1(_major, _minor) US_MAKE_VERSION2(_major, _minor)
|
||||
|
||||
@@ -25,9 +25,9 @@
|
||||
#include "tools.h"
|
||||
|
||||
|
||||
#define US_LIST_DECLARE \
|
||||
void *prev; \
|
||||
void *next;
|
||||
#define US_LIST_DECLARE(x_type) \
|
||||
x_type *prev; \
|
||||
x_type *next;
|
||||
|
||||
#define US_LIST_ITERATE(x_first, x_item, ...) { \
|
||||
for (__typeof__(x_first) x_item = x_first; x_item;) { \
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "../stream.h"
|
||||
|
||||
|
||||
typedef struct {
|
||||
typedef struct us_stream_client_sx {
|
||||
struct us_server_sx *server;
|
||||
struct evhttp_request *req;
|
||||
|
||||
@@ -54,15 +54,15 @@ typedef struct {
|
||||
|
||||
us_fpsi_s *fpsi;
|
||||
|
||||
US_LIST_DECLARE;
|
||||
US_LIST_DECLARE(struct us_stream_client_sx);
|
||||
} us_stream_client_s;
|
||||
|
||||
typedef struct {
|
||||
typedef struct us_snapshot_client_sx {
|
||||
struct us_server_sx *server;
|
||||
struct evhttp_request *req;
|
||||
ldf req_ts;
|
||||
|
||||
US_LIST_DECLARE;
|
||||
US_LIST_DECLARE(struct us_snapshot_client_sx);
|
||||
} us_snapshot_client_s;
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -47,7 +47,7 @@ typedef struct us_worker_sx {
|
||||
|
||||
struct us_workers_pool_sx *pool;
|
||||
|
||||
US_LIST_DECLARE;
|
||||
US_LIST_DECLARE(struct us_worker_sx);
|
||||
} us_worker_s;
|
||||
|
||||
typedef void *(*us_workers_pool_job_init_f)(void *arg);
|
||||
|
||||
Reference in New Issue
Block a user