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

@@ -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));
}