Use Windows system default audio device and upgrade SimpleCaptureGraph with callbacks.

Upgrade SDK to master.
This commit is contained in:
Julien Wadel 2023-08-21 09:47:26 +02:00
parent f285ce68de
commit e960490220
8 changed files with 24 additions and 5 deletions

View file

@ -26,7 +26,7 @@ variables:
DEBIAN_9_QT_IMAGE_VERSION: 20230417_qtopen_gstreamer
DEBIAN_10_IMAGE_VERSION: 20210217_python3
UBUNTU_ROLLING_IMAGE_VERSION: 20211012_add_qtwebview
UBUNTU_1804_IMAGE_VERSION: 20230315_qt
UBUNTU_1804_IMAGE_VERSION: 20230706_add_deps_for_av1
workflow:

View file

@ -185,7 +185,7 @@ QString ConferenceInfoModel::displayNamesToString()const{
QString ConferenceInfoModel::getUri() const{
auto address = mConferenceInfo->getUri();
return address->isValid() && !address->getDomain().empty() ? QString::fromStdString(address->asStringUriOnly()) : "";
return address && address->isValid() && !address->getDomain().empty() ? QString::fromStdString(address->asStringUriOnly()) : "";
}
bool ConferenceInfoModel::isScheduled() const{

View file

@ -25,6 +25,7 @@
#include "components/contact/VcardModel.hpp"
#include "components/core/CoreManager.hpp"
#include "components/friend/FriendListListener.hpp"
#include "utils/Utils.hpp"
#include "ContactsListModel.hpp"

View file

@ -96,7 +96,7 @@ shared_ptr<linphone::Address> AccountSettingsModel::getUsedSipAddress () const {
return nullptr;
}
void AccountSettingsModel::setUsedSipAddress (const shared_ptr<const linphone::Address> &address) {
void AccountSettingsModel::setUsedSipAddress (const shared_ptr<linphone::Address> &address) {
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
shared_ptr<linphone::Account> account = core->getDefaultAccount();
if( account){

View file

@ -68,6 +68,7 @@ public:
std::shared_ptr<linphone::Account> findAccount(std::shared_ptr<const linphone::Address> address) const ;
QString getUsedSipAddressAsStringUriOnly () const;
QString getUsedSipAddressAsString () const;

View file

@ -50,13 +50,30 @@ SimpleCaptureGraph::~SimpleCaptureGraph()
{
destroy();
}
static void device_notify_cb(void *user_data, MSFilter *f, unsigned int event, void *eventdata) {
if (event == MS_FILTER_OUTPUT_FMT_CHANGED) {
SimpleCaptureGraph * graph = (SimpleCaptureGraph *)user_data;
int captureRate, playbackRate, captureChannels, playbackChannels;
ms_filter_call_method(graph->audioCapture,MS_FILTER_GET_SAMPLE_RATE,&captureRate);
ms_filter_call_method(graph->audioSink,MS_FILTER_GET_SAMPLE_RATE,&playbackRate);
ms_filter_call_method(graph->audioCapture,MS_FILTER_GET_NCHANNELS,&captureChannels);
ms_filter_call_method(graph->audioSink,MS_FILTER_GET_NCHANNELS,&playbackChannels);
ms_filter_call_method(graph->resamplerFilter,MS_FILTER_SET_SAMPLE_RATE,&captureRate);
ms_filter_call_method(graph->resamplerFilter,MS_FILTER_SET_OUTPUT_SAMPLE_RATE,&playbackRate);
ms_filter_call_method(graph->resamplerFilter,MS_FILTER_SET_NCHANNELS,&captureChannels);
ms_filter_call_method(graph->resamplerFilter,MS_FILTER_SET_OUTPUT_NCHANNELS,&playbackChannels);
}
}
void SimpleCaptureGraph::init() {
if (!audioCapture) {
audioCapture = ms_snd_card_create_reader(captureCard);
ms_filter_add_notify_callback(audioCapture, device_notify_cb,this,FALSE);
}
if (!audioSink) {
audioSink = ms_snd_card_create_writer(playbackCard);
ms_filter_add_notify_callback(audioSink, device_notify_cb,this,FALSE);
}
if (!captureVolumeFilter) {
captureVolumeFilter = ms_factory_create_filter(msFactory, MS_VOLUME_ID);

View file

@ -78,7 +78,7 @@ namespace MediastreamerUtils {
bool isRunning() const {
return running;
}
protected:
void init();
void destroy();

@ -1 +1 @@
Subproject commit 88c727d0c8cd2d93d8ddcca1a4bff4a2e2fd7e89
Subproject commit 6b6f905377c2a07c3086be3049d8bb227848eed3