Coder Social home page Coder Social logo

linphone-qt-demo's Introduction

Linephone Qt Demo

用于记录摘抄平时研究linphone库的问题和细节
sdk编译步骤和问题记录在这里

项目说明

desktop-demo

该项目是直接拿官网的linphone-desktop项目代码,只需要将编译好的sdk放在sdk路径即可编译运行
因为源项目过于庞大,代码过多,所以我删减了一下代码,只留音视频组件,可以更快了解音视频的流程

quick-demo

这个是我参考官网例子提取出来的部分音视频主要代码,下面我将讲解各个组件的作用

linphone组件说明

类名 作用
ProxyConfig 用于记录SIP用户信息,包含用户的登录,删除,更新等
Call 代表一个通话对象,通话之后就会生成一个该对象,通过该对象操作通话
CoreListener 监听器,core的所有回调都通过该类回调,重点是call状态更改时的回调(包含拨号和接听)
Core 该库核心,缺什么功能直接查看该类API
Factory 该类用于获取工厂类实例,然后设置参数和创建core实例

以上的几个类基本上可以通过封装实现音视频通话

demo组件说明

类名 作用
AccountSettings 摘抄于desktop-demo,用于增加SIP账号和删除账号,只要登录成功的账号,都会保存在config文件中,下次启动自动登录
CallCore 用于qml中控制Call类,实现了音视频拨号,截屏,启动摄像头,中断通话,接受通话功能,同时通过handleCallStateChanged来回调获取通话拨进状态
Camera 用于在qml中显示对方视频或者自己摄像头画面,需要注意的是,只有当通话状态为接通时,才可以实例化该类,否则会异常退出.还要注意需要先删除该对象才可以退出通话,否则也会异常退出
SafeFramebuffer 用于在Camera找不到渲染器时,生成的空白渲染器让Camera正常运行
CoreHandlers 继承CoreListener,用于监听Core的各种回调,目前主要关注core状态和call状态,core状态用于激活linphone事件循环计时器,call状态用于记录拨出,拨进和停止通话等情况
LinphoneCoreManager 核心管理器,提供对象给qml使用和core初始化操作,如果使用了Qt GL,则需要注意ms2的plugin动态库加载路径,需要在core创建前设置
LinphoneSettings 官方demo中的设置类,目前我用不上(没研究过),只是简单移植过来
MediastreamerUtils 也是官方demo中的类,用于采集音频,代码未作改动
Utils 目前用于转换linphone和qt的字符串编码,只用的上coreStringToAppString和appStringToCoreString

流程图

该流程图大致说明了linphone是如何工作的

core初始化流程图

音视频拨出流程

音视频拨进流程

linphone-qt-demo's People

Contributors

zhonghuarong avatar

Stargazers

 avatar SamwellHo avatar  avatar  avatar PerryH avatar  avatar ekxs avatar

Watchers

James Cloos avatar  avatar  avatar

linphone-qt-demo's Issues

想要一个联系方式

我是QT初学者,要基于linphone 做一个桌面程序,在mac下,linphone-desktop怎么也不能编译成功。能否进行指导

quick-demo incoming video call

For me when incoming video call is answered by quick-demo video is transmitted to the remote end (Android in this case) however the quick-demo application does not show either the remote end video or what is captured by the local camera.

If I add a button to toggle the state of loader1 I can get video by disabling loader1 and then re-enable it. This is done while call is in progress.

Button {
    text: loader1.active
    onClicked: loader1.active = !loader1.active
 }

Based on this it may be a timing issue. This does not occur with desktop-demo.

Any idea what this could be?

quick-demo exits after first call complete

For me quick-demo exits after the first call made or receive completes. I see this in the log after I select hang up button.

Is this the intended behavior? desktop-demo does not act this way (it stays open for another call).

If it should not operate this way here is what is on the console when hangup occurs:

2021-10-06 13:47:59:421 mediastreamer-warning-ms_filter_remove_notify_callback(filter=0x293c180): no registered callback with fn=0x7fc1792871a0 and ud=0x2615e50
0
13:48:00: The program has unexpectedly finished.
13:48:00: The process was ended forcefully.
13:48:00: /usr/local/src/LinPhone-Qt-Demo/Debug/quick-demo crashed.

sdk的版本

你好,在desktop-demo项目中,linphone-sdk的版本是多少?

Build Warnings

Hello,

Thanks for making this Linphone-Qt-Demo available. Once I get it running on linux it will help me quite a bit.

I can successfully build both desktop-demo and quick-demo. However, I cannot yet get video call to work. I do get around 19,000 compiler warnings. Here is one example:
/usr/local/src/LinPhone-Qt-Demo/desktop-demo/sdk/linux/linphone-sdk/desktop/include/linphone++/logging_service_listener.hh:52: warning: unused parameter ‘logService’ [-Wunused-parameter] In file included from ../desktop-demo/sdk/linux/linphone-sdk/desktop/include/linphone++/linphone.hh:24, from ../desktop-demo/src/app/paths/Paths.cpp:21: ../desktop-demo/sdk/linux/linphone-sdk/desktop/include/linphone++/logging_service_listener.hh: In member function ‘virtual void linphone::LoggingServiceListener::onLogMessageWritten(const std::shared_ptr<linphone::LoggingService>&, const string&, linphone::LogLevel, const string&)’: ../desktop-demo/sdk/linux/linphone-sdk/desktop/include/linphone++/logging_service_listener.hh:52:127: warning: unused parameter ‘logService’ [-Wunused-parameter] 52 | LINPHONECXX_PUBLIC virtual void onLogMessageWritten(const std::shared_ptr<linphone::LoggingService> & logService, const std::string & domain, linphone::LogLevel level, const std::string & message) {}; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
All of the 19,000 warnings are for other "unused parameters". Any idea what is causing this?

Thanks,

John

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.