首页 > 编程语言 >linphone-LinphoneCallParams.java文件分析

linphone-LinphoneCallParams.java文件分析

时间:2023-05-29 14:35:52浏览次数:38  
标签:LinphoneCallParams java void long nativePtr private linphone public native


说明

专门作为Audio和Video的参数

功能

  1. 设置视频的带宽
  2. 设置音频的带宽
  3. 设置媒体的加密数据(encryption)
  4. 设置是否允许低带宽
  5. 设置RecordFile
  6. 设置Sdp
  7. 设置会话名称等
  8. 是否允许多个rtp请求

UML类图

linphone-LinphoneCallParams.java文件分析_java

LinphoneCallParamsImpl.java

package org.linphone.core;

import org.linphone.core.LinphoneCore.MediaDirection;
import org.linphone.core.LinphoneCore.MediaEncryption;
import org.linphone.core.LinphoneCore.StreamType;

public class LinphoneCallParamsImpl implements LinphoneCallParams {
    protected final long nativePtr;

    public LinphoneCallParamsImpl(long nativePtr) {
        this.nativePtr = nativePtr;
    }

    private native void enableVideo(long nativePtr, boolean b);
    private native boolean getVideoEnabled(long nativePtr);
    private native void audioBandwidth(long nativePtr, int bw);
    private native void setMediaEncryption(long nativePtr, int menc);
    private native int getMediaEncryption(long nativePtr);
    private native long getUsedAudioCodec(long nativePtr);
    private native long getUsedVideoCodec(long nativePtr);
    private native void destroy(long nativePtr);
    private native void enableLowBandwidth(long nativePtr, boolean enable);
    private native boolean isLowBandwidthEnabled(long nativePtr);

    public boolean getVideoEnabled() {
        return getVideoEnabled(nativePtr);
    }

    public void setVideoEnabled(boolean b) {
        enableVideo(nativePtr, b);
    }

    @Override
    protected void finalize() throws Throwable {
        destroy(nativePtr);
        super.finalize();
    }

    public void setAudioBandwidth(int value) {
        audioBandwidth(nativePtr, value);
    }

    public MediaEncryption getMediaEncryption() {
        return MediaEncryption.fromInt(getMediaEncryption(nativePtr));
    }

    public void setMediaEnctyption(MediaEncryption menc) {
        setMediaEncryption(nativePtr, menc.mValue);
    }

    public PayloadType getUsedAudioCodec() {
        long ptr = getUsedAudioCodec(nativePtr);
        if (ptr == 0) return null;
        return new PayloadTypeImpl(ptr);
    }

    public PayloadType getUsedVideoCodec() {
        long ptr = getUsedVideoCodec(nativePtr);
        if (ptr == 0) return null;
        return new PayloadTypeImpl(ptr);
    }

    private native boolean localConferenceMode(long nativePtr);
    public boolean localConferenceMode() {
        return localConferenceMode(nativePtr);
    }

    public void enableLowBandwidth(boolean enable) {
        enableLowBandwidth(nativePtr, enable);
    }

    public boolean isLowBandwidthEnabled() {
        return isLowBandwidthEnabled(nativePtr);
    }

    private native void setRecordFile(long nativePtr, String path);
    @Override
    public void setRecordFile(String path) {
        setRecordFile(nativePtr,path);
    }

    private native void addCustomHeader(long nativePtr, String name, String value); 
    @Override
    public void addCustomHeader(String name, String value) {
        addCustomHeader(nativePtr,name,value);
    }

    private native String getCustomHeader(long nativePtr, String name);
    @Override
    public String getCustomHeader(String name) {
        return getCustomHeader(nativePtr,name);
    }

    private native void addCustomSdpAttribute(long nativePtr, String name, String value); 
    @Override
    public void addCustomSdpAttribute(String name, String value) {
        addCustomSdpAttribute(nativePtr, name, value);
    }

    private native void addCustomSdpMediaAttribute(long nativePtr, int type, String name, String value); 
    @Override
    public void addCustomSdpMediaAttribute(StreamType type, String name, String value) {
        addCustomSdpMediaAttribute(nativePtr, type.mValue, name, value);
    }

    private native String getCustomSdpAttribute(long nativePtr, String name);
    @Override
    public String getCustomSdpAttribute(String name) {
        return getCustomSdpAttribute(nativePtr, name);
    }

    private native String getCustomSdpMediaAttribute(long nativePtr, int type, String name);
    @Override
    public String getCustomSdpMediaAttribute(StreamType type, String name) {
        return getCustomSdpMediaAttribute(nativePtr, type.mValue, name);
    }

    private native void clearCustomSdpAttributes(long nativePtr);
    @Override
    public void clearCustomSdpAttributes() {
        clearCustomSdpAttributes(nativePtr);
    }

    private native void clearCustomSdpMediaAttributes(long nativePtr, int type);
    @Override
    public void clearCustomSdpMediaAttributes(StreamType type) {
        clearCustomSdpMediaAttributes(nativePtr, type.mValue);
    }

    private native void setPrivacy(long nativePtr, int mask);
    @Override
    public void setPrivacy(int privacy_mask) {
        setPrivacy(nativePtr,privacy_mask);
    }

    private native int getPrivacy(long nativePtr);
    @Override
    public int getPrivacy() {
        return getPrivacy(nativePtr);
    }

    private native void setSessionName(long nativePtr, String name);
    @Override
    public void setSessionName(String name) {
        setSessionName(nativePtr,name);
    }

    private native String getSessionName(long nativePtr);
    @Override
    public String getSessionName() {
        return getSessionName(nativePtr);
    }

    private native int[] getSentVideoSize(long nativePtr);
    @Override
    public VideoSize getSentVideoSize() {
        int[] nativeSize = getSentVideoSize(nativePtr);
        VideoSize vSize = new VideoSize();
        vSize.width = nativeSize[0];
        vSize.height = nativeSize[1];
        return vSize;
    }

    private native int[] getReceivedVideoSize(long nativePtr);
    @Override
    public VideoSize getReceivedVideoSize() {
        int[] nativeSize = getReceivedVideoSize(nativePtr);
        VideoSize vSize = new VideoSize();
        vSize.width = nativeSize[0];
        vSize.height = nativeSize[1];
        return vSize;
    }
    private native void enableAudioMulticast(long ptr,boolean yesno);
    @Override
    public void enableAudioMulticast(boolean yesno) {
        enableAudioMulticast(nativePtr,yesno);
    }
    private native boolean audioMulticastEnabled(long ptr);
    @Override
    public boolean audioMulticastEnabled() {
        return audioMulticastEnabled(nativePtr);
    }
    private native void enableVideoMulticast(long ptr,boolean yesno);

    @Override
    public void enableVideoMulticast(boolean yesno) {
        enableVideoMulticast(nativePtr,yesno);
    }
    private native boolean videoMulticastEnabled(long ptr);
    @Override
    public boolean videoMulticastEnabled() {
        return videoMulticastEnabled(nativePtr);
    }

    private native void enableRealTimeText(long nativePtr, boolean yesno);
    @Override
    public void enableRealTimeText(boolean yesno) {
        enableRealTimeText(nativePtr, yesno);
    }

    private native boolean realTimeTextEnabled(long nativePtr);
    @Override
    public boolean realTimeTextEnabled() {
        return realTimeTextEnabled(nativePtr);
    }

    private native int getAudioDirection(long nativePtr);
    @Override
    public MediaDirection getAudioDirection() {
        return MediaDirection.fromInt(getAudioDirection(nativePtr));
    }

    private native int getVideoDirection(long nativePtr);
    @Override
    public MediaDirection getVideoDirection() {
        return MediaDirection.fromInt(getVideoDirection(nativePtr));
    }

    private native void setAudioDirection(long nativePtr, int direction);
    @Override
    public void setAudioDirection(MediaDirection direction) {
        setAudioDirection(nativePtr, direction.mValue);
    }

    private native void setVideoDirection(long nativePtr, int direction);
    @Override
    public void setVideoDirection(MediaDirection direction) {
        setVideoDirection(nativePtr, direction.mValue);
    }
}


标签:LinphoneCallParams,java,void,long,nativePtr,private,linphone,public,native
From: https://blog.51cto.com/u_11797608/6370711

相关文章

  • linphone-CallManager.java文件分析
    说明进行会话的管理,重新加入会话等功能创建会话重新进入Video重新设置参数更新会话UML类图CallManger.javapackageorg.linphone;importorg.linphone.core.LinphoneAddress;importorg.linphone.core.LinphoneCall;importorg.linphone.core.LinphoneCallParams;importorg.l......
  • linphone-PayloadType.java文件分析
    说明这个类主要是设置一些类型的参数,如MIME,RATE,FMTP等功能设置MIME设置RATE设置FMTUML类图PayloadType.javapackageorg.linphone.core;publicinterfacePayloadType{/***Obtaintheregisteredmime-type(actuallysubmime)ofthePayloadType.Forexample:......
  • linphone-LinphoneProxyConfig.java文件分析
    说明这个是linphone的纯配置文件,可能需要保存到文件中,是长久的数据.如何保存c/c++分析.功能设置Identity设置Address设置Proxy设置register设置Domain设置Dial设置Route设置Route设置Expires设置AVPF设置Realm设置ContactParameters设置PublichExpiresUML类图LinphoneProxyConfi......
  • linphone-LinphonePreferences.java文件分析
    说明这个文件比较长,主要是对于linphone的配置文件等设置。对于前面文章中文件的调用。其中大多数是对底层的调用设置。功能设置用户信息设置端口号设置显示名称设置密码设置代理设置编码设置编码速率设置DMTF等设置加密解密设置是否使用ipv6设置tunnel设置相机等UML类图LinphonePre......
  • linphone-NetworkManger.java文件分析
    功能InterceptnetworkstatechangesandupdatelinphonecorethroughLinphoneManger翻译拦截网络状态的变化,并通过LinphoneManger更新linphone核心内容。NetworkManager.java/**......
  • 使用 Java 代码调用 openAI 的 ChatGPT API
    前提:在https://beta.openai.com/account/api-keys注册一个自己的APIkey.要在JavaSpringFramework中使用OpenAIAPI,您需要使用一个能够处理HTTP请求的库。其中一个流行的库是SpringRestTemplate库。RestTemplate是一个强大而灵活的库,可以轻松地发送HTTP请求并处理响应。首......
  • linphone-KeepAliveReceiver.java文件分析
    说明Purposeofthisreceiveristodisablekeepaliveswhenscreenisoff解释这个接收器的目的是屏幕关闭的时候进行保活。<—翻译的准确性,等更加深刻的分析源码时更正,或者读者自己在下面评论也可以。介绍此类为接收器,接收外部传来的广播。KeepAliveReceiver.java/**Purpos......
  • linphone-BootReceiver.java文件分析
    说明这是个在android发送开机广播的时候调用的类功能主要就是为了在开机的时候启动LinphoneService开启后台服务。其中有一个.linphonerc的文件,这个文件应该是LpConfig的对应的配置文件。如果有错请更正。BootReceiver.javapublicclassBootReceiverextendsBroadcastReceiver{......
  • linphone-PresenceNote.java文件分析
    说明这个没什么好说的,一个普通的的类。UML类图PresenceNoteImpl.javapackageorg.linphone.core;publicclassPresenceNoteImplimplementsPresenceNote{privatelongmNativePtr;protectedPresenceNoteImpl(longnativePtr){mNativePtr=nativePtr;......
  • linphone-Tunnelconfig.java文件分析
    说明此类的主要作用主要是配置Host,port等。功能设置获取Host设置获取Port设置获取RemoteUdpMirrorPort获取设置maximumamountoftimeUML类图TunnelConfig.javapackageorg.linphone.core;publicclassTunnelConfigImplimplementsTunnelConfig{longmNativePtr;pr......