jami test update

This commit is contained in:
ace
2026-02-27 18:08:19 +03:00
parent 5db1b4a362
commit cabd3d8bfa
37 changed files with 13031 additions and 66 deletions

View File

@@ -1,6 +1,8 @@
AUX cmake.patch 572 BLAKE2B 7b35c9a654bdbcacb7c8742d6a82601ce5807c7efa08f9b05c81d5af6a439f4e7acb3bc2154dcb824701bd36cb52769001788646eeb7d0e38aa613057d95fdb0 SHA512 2092cd36a856bdb4a7a1645c637de371fe6a366cb40c2de255fbdb9388e52950400ad47bd6b6b7fa7282316561b04530883c26d99221d80b1597db6e4d39e536
AUX ffmpeg-7-20260206.patch 3738 BLAKE2B 30087efee4481041df25d666753bd174ac5d86f07137b783ec92c582106d1251f51a3f8aa44a8f95d987e8f1a255ac571164652606b14214033f0b899fd1faa1 SHA512 f4c9bd89aaa67896ab3b6c9a0a965c6aec5b53144e74b157ed5c7ce5cc109008be44a06be4b14daf8d3acca56c3ae9464ddb8355edc536d059c7e7e22162d440
AUX ffmpeg-7.patch 2958 BLAKE2B 1eb36112b4611b606f0e6d7d5bb17920c4bfa064aed6720baebf77696675eb768e5b2e67650ab8adceaa53e89439009949920140915a85ead78c631d3161a3e6 SHA512 ddfc55f32664c505a3816c152a2de124000b34e9b7da650ee82fbdaab179976fe28a17a2add30c493494a4f7da384a456fc8a5541bdbfb41c7d590ca5190ceb8
AUX ffmpeg-8-20260206.patch 4566 BLAKE2B 1f4b13588709d69e70b227f8abd25d3e32e615cee7f3bbcd2604d2c02e0a67aef9df08be9c6ce31da64128d8487b9e8ae83e87ca76bf6eb10434bd7e2a7c488f SHA512 50feb8097cc91f7ee52d12e760324fbd47c95b4191d04f80ecdbdc88b39e7d578f448c747be22b6095ca884aed0c418bd9690ed8c986a39c913d5d923c59cc37
AUX ffmpeg-8.patch 4547 BLAKE2B edc96dc3b3837168bc6e56d8978d70ed5a3cc3a0de8fbfb42dc15d46d6056be6d586b67a123486a2dfc18154adade39f85c65637dc10ca2c9145b3768fc96d9f SHA512 6c87677936a5dcc6134ebd8a60a542b90573bddb5896731cde4f681cf06bff2fdcbc779b4f691a90a55d528c28621328862664a62a693e02805a6f0a3141c084
AUX fmt-12.patch 1811 BLAKE2B 8654397ac8d140ec339df9029ae5e610a6061dda0944d3cd3890cc7ad9d47d65a6ae9d6744bf07f9b7ad223241fe58d372ecd24b6f5f2fd866689673467eaf81 SHA512 b645545120608e70f70ee664d43de03fa07ebc5b2af9a6515a40220aabfe057d4f69034b15781a21c5e8ff6f2fbb353b7dea69d840cb299f9dbf58eeaf082a40
EBUILD jami-daemon-20250929.ebuild 2620 BLAKE2B 9c942fd3d02bf302f7dd090d70b0b5ce3dfd3b87dffc95a21993ba5f54f8098b6b123d5e54c954bf3494809a9f406d440041a5abdc016e1b9c1d47b9f4c9af02 SHA512 a18794e2c603b54495d8164206c709beccd01fb95ab15efe2d29b4a36f45d47d0eae50234a6e0a3b6c0993bab99bef101fe1877570894c26ff931e98e992722f
EBUILD jami-daemon-20250929.ebuild 2290 BLAKE2B 4e4963f7b9984eab9656502b92f42e194fe3c92456c6c24906098e1280d47dec91008c0ea28ab528564cd0a7d0228a63f69183b472f6f7241ab9cfc9f04b3695 SHA512 535bccaf5a4de6ac4bc904040396ff5453643a4360c89afc1c57b7feaceeaea16162cf53111a54c39baee7b1e163dbaa69881cabbf7fb824a84ff689936f13c6
EBUILD jami-daemon-20260206.ebuild 2284 BLAKE2B 0a0c77dc624bbb2d20f5356284f348949a6be56fe83eefdc1e0714725f54ee2d52ff878d81b2a10ab5a5dec18e15e3d54859ca091a14ad1f62b83110461f039b SHA512 82e67863419fb029905d1a714b3bcb7e9aa829f8a4f585dee901d7013c42ef7798f5f5ec9c17a7b1cec94a4528d646b63c221ef19774d9591a25236409e1e71a
EBUILD jami-daemon-9999.ebuild 2608 BLAKE2B eee77be68b41ba2b6341df6ca2887812d6129f7ff8d4ac9cf7f2000f80e95dd8f8e59822154a5290506c96a433afb2cdb00ef36f9a9e1e4df16302c515c73765 SHA512 cd5d0f9bae1d02d0afffdfb94fa83902507eeffb29c94f0459a32df808cf49ff95802a722ef86e81a2fcea440c608af9ae2ee0c6aced13fab2f301135de81a6c

View File

@@ -0,0 +1,74 @@
diff --git a/src/media/audio/resampler.cpp b/src/media/audio/resampler.cpp
index fe0c80a2c..8eebe42d0 100644
--- a/src/media/audio/resampler.cpp
+++ b/src/media/audio/resampler.cpp
@@ -225,7 +225,7 @@ Resampler::resample(const AVFrame* input, AVFrame* output)
newOutput->format = output->format;
newOutput->nb_samples = static_cast<int>(targetOutputLength);
newOutput->ch_layout = output->ch_layout;
- newOutput->channel_layout = output->channel_layout;
+ newOutput->ch_layout.u.mask = output->ch_layout.u.mask;
newOutput->sample_rate = output->sample_rate;
int bufferRet = av_frame_get_buffer(newOutput, 0);
if (bufferRet < 0) {
diff --git a/src/media/audio/sound/dtmfgenerator.cpp b/src/media/audio/sound/dtmfgenerator.cpp
index c05435f66..5b9eca18a 100644
--- a/src/media/audio/sound/dtmfgenerator.cpp
+++ b/src/media/audio/sound/dtmfgenerator.cpp
@@ -115,7 +115,7 @@ DTMFGenerator::fillToneBuffer(int index)
ptr->nb_samples = sampleRate_;
ptr->format = tone_.getFormat().sampleFormat;
ptr->sample_rate = sampleRate_;
- ptr->channel_layout = AV_CH_LAYOUT_MONO;
+ ptr->ch_layout.u.mask = AV_CH_LAYOUT_MONO;
av_channel_layout_from_mask(&ptr->ch_layout, AV_CH_LAYOUT_MONO);
av_frame_get_buffer(ptr.get(), 0);
tone_.genSin(ptr.get(), 0, ptr->nb_samples, tones_[index].higher, tones_[index].lower);
diff --git a/src/media/media_decoder.cpp b/src/media/media_decoder.cpp
index ceaa036c6..0cbeae5be 100644
--- a/src/media/media_decoder.cpp
+++ b/src/media/media_decoder.cpp
@@ -375,11 +375,11 @@ MediaDemuxer::Status
MediaDemuxer::decode()
{
if (inputParams_.format == "x11grab" || inputParams_.format == "dxgigrab") {
- auto ret = inputCtx_->iformat->read_header(inputCtx_);
- if (ret == AVERROR_EXTERNAL) {
- JAMI_ERR("Unable to read frame: %s\n", libav_utils::getError(ret).c_str());
- return Status::ReadError;
- }
+ // auto ret = inputCtx_->iformat->read_header(inputCtx_);
+ // if (ret == AVERROR_EXTERNAL) {
+ // JAMI_ERR("Unable to read frame: %s\n", libav_utils::getError(ret).c_str());
+ // return Status::ReadError;
+ // }
auto codecpar = inputCtx_->streams[0]->codecpar;
if (baseHeight_ != codecpar->height || baseWidth_ != codecpar->width) {
baseHeight_ = codecpar->height;
diff --git a/src/media/media_io_handle.h b/src/media/media_io_handle.h
index 7a64b85a7..a668e73c0 100644
--- a/src/media/media_io_handle.h
+++ b/src/media/media_io_handle.h
@@ -32,7 +32,7 @@ struct AVIOContext;
#endif
typedef int (*io_readcallback)(void* opaque, uint8_t* buf, int buf_size);
-typedef int (*io_writecallback)(void* opaque, uint8_t* buf, int buf_size);
+typedef int (*io_writecallback)(void* opaque, const uint8_t* buf, int buf_size);
typedef int64_t (*io_seekcallback)(void* opaque, int64_t offset, int whence);
namespace jami {
diff --git a/src/media/socket_pair.cpp b/src/media/socket_pair.cpp
index 0589affd5..f0005f6b0 100644
--- a/src/media/socket_pair.cpp
+++ b/src/media/socket_pair.cpp
@@ -382,8 +382,8 @@ SocketPair::createIOContext(const uint16_t mtu)
mtu - (srtpContext_ ? SRTP_OVERHEAD : 0) - UDP_HEADER_SIZE - ip_header_size,
true,
[](void* sp, uint8_t* buf, int len) { return static_cast<SocketPair*>(sp)->readCallback(buf, len); },
- [](void* sp, uint8_t* buf, int len) { return static_cast<SocketPair*>(sp)->writeCallback(buf, len); },
+ [](void* sp, const uint8_t* buf, int len) { return static_cast<SocketPair*>(sp)->writeCallback((uint8_t*)buf, len); },
0,
reinterpret_cast<void*>(this));
}

View File

@@ -0,0 +1,110 @@
diff --git a/src/media/media_encoder.cpp b/src/media/media_encoder.cpp
index f999ffe42..eae622d48 100644
--- a/src/media/media_encoder.cpp
+++ b/src/media/media_encoder.cpp
@@ -72,11 +72,7 @@ MediaEncoder::~MediaEncoder()
}
for (auto encoderCtx : encoders_) {
if (encoderCtx) {
-#ifndef _MSC_VER
avcodec_free_context(&encoderCtx);
-#else
- avcodec_close(encoderCtx);
-#endif
}
}
avformat_free_context(outputCtx_);
@@ -354,7 +350,7 @@ MediaEncoder::initStream(const SystemCodecInfo& systemCodecInfo, AVBufferRef* fr
if (scaledFrameBufferSize_ < 0)
throw MediaEncoderException(
("Unable to compute buffer size: " + libav_utils::getError(scaledFrameBufferSize_)).c_str());
- else if (scaledFrameBufferSize_ <= AV_INPUT_BUFFER_MIN_SIZE)
+ else if (scaledFrameBufferSize_ <= 16384)
throw MediaEncoderException("buffer too small");
scaledFrameBuffer_.resize(scaledFrameBufferSize_);
@@ -448,10 +444,10 @@ MediaEncoder::encode(const std::shared_ptr<VideoFrame>& input,
if (is_keyframe) {
avframe->pict_type = AV_PICTURE_TYPE_I;
- avframe->key_frame = 1;
+ avframe->flags |= AV_FRAME_FLAG_KEY;
} else {
avframe->pict_type = AV_PICTURE_TYPE_NONE;
- avframe->key_frame = 0;
+ avframe->flags &= ~AV_FRAME_FLAG_KEY;
}
return encode(avframe, currentStreamIdx_);
@@ -690,7 +686,7 @@ MediaEncoder::extractProfileLevelID(const std::string& parameters, AVCodecContex
// From RFC3984:
// If no profile-level-id is present, the Baseline Profile without
// additional constraints at Level 1 MUST be implied.
- ctx->profile = FF_PROFILE_H264_CONSTRAINED_BASELINE;
+ ctx->profile = AV_PROFILE_H264_CONSTRAINED_BASELINE;
ctx->level = 0x0d;
// ctx->level = 0x0d; // => 13 aka 1.3
if (parameters.empty())
@@ -716,17 +712,17 @@ MediaEncoder::extractProfileLevelID(const std::string& parameters, AVCodecContex
const unsigned char profile_iop = ((result >> 8) & 0xff); // xx80xx -> 80
ctx->level = result & 0xff; // xxxx0d -> 0d
switch (profile_idc) {
- case FF_PROFILE_H264_BASELINE:
+ case AV_PROFILE_H264_BASELINE:
// check constraint_set_1_flag
if ((profile_iop & 0x40) >> 6)
- ctx->profile |= FF_PROFILE_H264_CONSTRAINED;
+ ctx->profile |= AV_PROFILE_H264_CONSTRAINED;
break;
- case FF_PROFILE_H264_HIGH_10:
- case FF_PROFILE_H264_HIGH_422:
- case FF_PROFILE_H264_HIGH_444_PREDICTIVE:
+ case AV_PROFILE_H264_HIGH_10:
+ case AV_PROFILE_H264_HIGH_422:
+ case AV_PROFILE_H264_HIGH_444_PREDICTIVE:
// check constraint_set_3_flag
if ((profile_iop & 0x10) >> 4)
- ctx->profile |= FF_PROFILE_H264_INTRA;
+ ctx->profile |= AV_PROFILE_H264_INTRA;
break;
}
JAMI_DBG("Using profile %s (%x) and level %d",
@@ -837,7 +833,7 @@ MediaEncoder::initCodec(AVMediaType mediaType, AVCodecID avcodecId, uint64_t br)
encoderCtx->flags2 |= AV_CODEC_FLAG2_LOCAL_HEADER;
initH264(encoderCtx, br);
} else if (avcodecId == AV_CODEC_ID_HEVC) {
- encoderCtx->profile = FF_PROFILE_HEVC_MAIN;
+ encoderCtx->profile = AV_PROFILE_HEVC_MAIN;
forcePresetX2645(encoderCtx);
initH265(encoderCtx, br);
av_opt_set_int(encoderCtx, "b_ref_mode", 0, AV_OPT_SEARCH_CHILDREN);
@@ -1108,7 +1104,6 @@ MediaEncoder::stopEncoder()
}
}
AVCodecContext* encoderCtx = getCurrentVideoAVCtx();
- avcodec_close(encoderCtx);
avcodec_free_context(&encoderCtx);
av_free(encoderCtx);
}
@@ -1212,7 +1207,7 @@ MediaEncoder::testH265Accel()
framerate.den = 1;
encoderCtx->time_base = av_inv_q(framerate);
encoderCtx->pix_fmt = accel->getFormat();
- encoderCtx->profile = FF_PROFILE_HEVC_MAIN;
+ encoderCtx->profile = AV_PROFILE_HEVC_MAIN;
encoderCtx->opaque = accel.get();
auto br = SystemCodecInfo::DEFAULT_VIDEO_BITRATE;
@@ -1349,11 +1344,7 @@ MediaEncoder::resetStreams(int width, int height)
if (outputCtx_) {
for (auto encoderCtx : encoders_) {
if (encoderCtx) {
-#ifndef _MSC_VER
avcodec_free_context(&encoderCtx);
-#else
- avcodec_close(encoderCtx);
-#endif
}
}
encoders_.clear();

View File

@@ -1,32 +0,0 @@
diff -ru dhtnet.orig/src/upnp/upnp_context.cpp dhtnet/src/upnp/upnp_context.cpp
--- dhtnet.orig/src/upnp/upnp_context.cpp 2025-10-04 15:51:40.889482196 +0200
+++ dhtnet/src/upnp/upnp_context.cpp 2025-10-04 16:09:31.538008243 +0200
@@ -734,9 +734,12 @@
}
if (toRenewLaterCount > 0) {
nextRenewalTime += MAPPING_RENEWAL_THROTTLING_DELAY;
- if (logger_) logger_->debug("{} mapping(s) didn't need to be renewed (next renewal scheduled for {:%Y-%m-%d %H:%M:%S})",
+ if (logger_) {
+ std::time_t t = sys_clock::to_time_t(nextRenewalTime);
+ logger_->debug("{} mapping(s) didn't need to be renewed (next renewal scheduled for {:%Y-%m-%d %H:%M:%S})",
toRenewLaterCount,
- fmt::localtime(sys_clock::to_time_t(nextRenewalTime)));
+ *std::localtime(&t));
+ }
mappingRenewalTimer_.expires_at(nextRenewalTime);
mappingRenewalTimer_.async_wait([this](asio::error_code const& ec) {
if (ec != asio::error::operation_aborted)
@@ -783,8 +786,11 @@
if (nextRenewalTime == mappingRenewalTimer_.expiry())
return;
- if (logger_) logger_->debug("Scheduling next port mapping renewal for {:%Y-%m-%d %H:%M:%S}",
- fmt::localtime(sys_clock::to_time_t(nextRenewalTime)));
+ if (logger_) {
+ std::time_t t = sys_clock::to_time_t(nextRenewalTime);
+ logger_->debug("Scheduling next port mapping renewal for {:%Y-%m-%d %H:%M:%S}",
+ *std::localtime(&t));
+ }
mappingRenewalTimer_.expires_at(nextRenewalTime);
mappingRenewalTimer_.async_wait([this](asio::error_code const& ec) {
if (ec != asio::error::operation_aborted)

View File

@@ -80,26 +80,9 @@ src_prepare() {
eapply "${FILESDIR}"/cmake.patch
eapply "${FILESDIR}"/ffmpeg-7.patch
eapply "${FILESDIR}"/ffmpeg-8.patch
#cmake_src_prepare
#eautoreconf
}
#src_configure() {
# mkdir build
# cd build
# cmake .. -DBUILD_CONTRIB=OFF -DJAMI_DBUS=ON
#}
src_configure() {
#local mycmakeargs=(
# -DJAMI_DBUS=ON
# -DBUILD_CONTRIB=OFF
# -DJAMI_VIDEO=ON
# -DENABLE_COVERAGE=OFF
# -DBUILD_TESTING=OFF
# -DBUILD_EXTRA_TOOLS=ON
#)
#cmake_src_configure
local emesonargs=(
-Dinterfaces=library,dbus
-Dopensl=disabled
@@ -109,6 +92,5 @@ src_configure() {
}
src_install() {
#cmake_src_install
meson_src_install
}

View File

@@ -0,0 +1,96 @@
# Copyright 2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit meson git-r3
if [[ ${PV} == *9999* ]]; then
EGIT_REPO_URI="https://git.jami.net/savoirfairelinux/jami-daemon"
SRC_URI=""
IUSE="+alsa +dbus doc graph +gsm +hwaccel ipv6 jack -libav +libilbc +nat-pmp +opus pipewire portaudio pulseaudio +sdes +speex +speexdsp +upnp +vaapi vdpau +video +vpx +x264"
KEYWORDS=""
else
EGIT_REPO_URI="https://git.jami.net/savoirfairelinux/jami-daemon"
SRC_URI=""
EGIT_COMMIT="55dd53736b9e6cd7204cc17e01d10d8a9276618f"
IUSE="+alsa +dbus doc graph +gsm +hwaccel ipv6 jack -libav +libilbc +nat-pmp +opus pipewire portaudio pulseaudio +sdes +speex +speexdsp +upnp +vaapi vdpau +video +vpx +x264"
KEYWORDS=""
fi
DESCRIPTION="Jami (formerly Ring) daemon"
HOMEPAGE="https://jami.net/"
LICENSE="GPL-3"
SLOT="0"
RDEPEND="
>=dev-cpp/yaml-cpp-0.5.3
>=dev-libs/boost-1.61.0
>=dev-libs/crypto++-5.6.5
>=dev-libs/jsoncpp-1.7.2
>=media-video/ffmpeg-3.4[gsm?,libilbc?,opus?,speex?,v4l,vaapi?,vdpau?,vpx?,x264?,zlib]
libilbc? ( media-libs/libilbc )
speex? ( >=media-libs/speex-1.2.0 )
speexdsp? ( >=media-libs/speexdsp-1.2_rc3 )
>=net-libs/gnutls-3.4.14
>=net-libs/opendht-1.10.1
>=sys-libs/zlib-1.2.8
media-libs/libva
dev-libs/libsecp256k1
net-libs/restinio
net-libs/dhtnet
net-libs/http-parser
dev-libs/libgit2
dev-cpp/sdbus-c++[tools(+)]
<=media-libs/webrtc-audio-processing-1.0.0
dev-libs/msgpack
alsa? ( media-libs/alsa-lib )
jack? ( virtual/jack )
portaudio? ( >=media-libs/portaudio-19_pre20140130 )
pulseaudio? ( media-libs/libpulse )
dbus? ( dev-libs/dbus-c++ )
sdes? ( >=dev-libs/libpcre-8.40 )
video? ( virtual/libudev )
nat-pmp? ( net-libs/libnatpmp )
pipewire? ( media-video/pipewire )
"
DEPEND="${RDEPEND}
doc? (
graph? ( app-doc/doxygen[dot] )
!graph? ( app-doc/doxygen )
)"
REQUIRED_USE="dbus? ( sdes )
graph? ( doc )
hwaccel? ( video )
vaapi? ( hwaccel )
?? ( dbus )"
src_prepare() {
default
eapply "${FILESDIR}"/cmake.patch
eapply "${FILESDIR}"/ffmpeg-7.patch
eapply "${FILESDIR}"/ffmpeg-8.patch
}
src_configure() {
local emesonargs=(
-Dinterfaces=library,dbus
-Dopensl=disabled
-Dportaudio=disabled
)
meson_src_configure
}
src_install() {
meson_src_install
}