JRTC Java API Reference for Android 4.0.3
| Public 成员函数 | 静态 Public 属性 | 所有成员列表
com.juphoon.cloud.jrtc.JRTCAdvanced类 参考abstract

被 com.juphoon.cloud.jrtc.JRTCAdvancedImpl 继承.

enum  RenderMirrorType
 

Public 成员函数

abstract int enableVideoFile (boolean enable)
 
abstract int inputVideoFileFrame (byte[] data, @VideoPixelFormat int format, int width, int height, int angle, int mirror, boolean keyFrame)
 
abstract int inputCustomAudioData (int sampleRateHz, int channels, ByteBuffer byteBuffer, int playDelayMS, int recDelayMS, int clockDrift)
 
abstract int getAudioOutputData (int sampleRateHz, int channels, ByteBuffer byteBuffer)
 
abstract int setLocalCaptureAngle (int angle)
 
abstract int setRenderMirror (JRTCVideoCanvas videoCanvas, RenderMirrorType renderMirror)
 
abstract int setRenderEffect (JRTCVideoCanvas videoCanvas, @RenderEffectType String enEffectType, String strJson, Object[] extraObjs)
 
abstract int freezeRenderEffect (JRTCVideoCanvas videoCanvas, boolean enable)
 
abstract int takeOnceSnapshot (JRTCVideoCanvas videoCanvas, int width, int height, String filePath)
 
abstract int setRenderAngle (JRTCVideoCanvas jrtcVideoCanvas, @VideoAngle int angle)
 
abstract int getMinExposureCompensation ()
 
abstract int getMaxExposureCompensation ()
 
abstract float getExposureCompensationStep ()
 

静态 Public 属性

static final int I420 = 1
 
static final int IYUV = 2
 
static final int RGB24 = 3
 
static final int ABGR = 4
 
static final int ARGB = 5
 
static final int ARGB444 = 6
 
static final int RGB565 = 7
 
static final int ARGB1555 = 8
 
static final int YUY2 = 9
 
static final int YV12 = 10
 
static final int UYVY = 11
 
static final int MJPG = 12
 
static final int NV21 = 13
 
static final int NV12 = 14
 
static final int BGRA = 15
 
static final int H264 = 100
 
static final int H264_SVC = 101
 
static final int VIDEO_ANGLE_AUTO = ZmfVideo.ROTATION_FIXED_SCREEN
 
static final int VIDEO_ANGLE_0 = ZmfVideo.ROTATION_ANGLE_0
 
static final int VIDEO_ANGLE_90 = ZmfVideo.ROTATION_ANGLE_90
 
static final int VIDEO_ANGLE_180 = ZmfVideo.ROTATION_ANGLE_180
 
static final int VIDEO_ANGLE_270 = ZmfVideo.ROTATION_ANGLE_270
 
static final int VIDEO_SOURCE_PEER = 0
 
static final int VIDEO_SOURCE_CAPTURE = 1
 
static final int VIDEO_SOURCE_FILE = 2
 
static final String RENDER_EFFECT_NONE = "None"
 
static final String RENDER_EFFECT_BLUR = "Blur"
 
static final String RENDER_EFFECT_GREY = "Grey"
 
static final String RENDER_EFFECT_MASK = "Mask"
 
static final String RENDER_EFFECT_MAGNIFIER = "Magnifier"
 

详细描述

用于媒体高级功能

成员函数说明

◆ enableVideoFile()

abstract int com.juphoon.cloud.jrtc.JRTCAdvanced.enableVideoFile ( boolean  enable)
abstract

启动视频文件输入源

  • 作用是关闭原camera采集,内部状态设置成文件视频源开启状态
  • 若调用此方法时文件视频源已开启,则不会收到回调
  • 若调用此方法时文件视频源还未开启,则会收到 onCameraUpdate 回调
  • 文件和摄像头作为视频输入源只能存在一种,如果当前摄像头已开启的话会关闭摄像头
参数
enable是否启动视频文件输入
  • true: 启动
  • false: 不启动
返回
调用是否成功
  • 0:调用成功
  • >0:调用失败,参见:JRTCErrorCode 错误码

◆ inputVideoFileFrame()

abstract int com.juphoon.cloud.jrtc.JRTCAdvanced.inputVideoFileFrame ( byte[]  data,
@VideoPixelFormat int  format,
int  width,
int  height,
int  angle,
int  mirror,
boolean  keyFrame 
)
abstract

将视频输入数据输入到媒体层

调用此方法时要保证文件视频源已开启

参数
data画面二进制数据
format视频像素格式
width
height
angle旋转角度,要求是 90 的倍数
mirror是否水平镜像
  • 0 :不镜像
  • 1 :水平镜像
keyFrame是否为关键帧,针对 format 为 H264 格式 或者 H264_SVC 格式
  • true: 关键帧
  • false: 不是关键帧
返回
调用是否成功
  • 0:调用成功
  • >0:调用失败,参见:JRTCErrorCode 错误码
注解
当 format 为 H264 格式 或者 H264_SVC 格式, 并且是关键帧时:
  • 第一帧一定要包含关键帧,并且需要将 0x67 0x68 0x65 的数据作为完整一帧传入,其中0x67,0x68为pps,0x65为关键帧标识
  • 后续P帧以 0x41 数据形式传入
  • 关键帧要以固定间隔传入,例如5秒,否则一开始可能有几秒对端无法显示视频

◆ inputCustomAudioData()

abstract int com.juphoon.cloud.jrtc.JRTCAdvanced.inputCustomAudioData ( int  sampleRateHz,
int  channels,
ByteBuffer  byteBuffer,
int  playDelayMS,
int  recDelayMS,
int  clockDrift 
)
abstract

将音频输入数据输入到媒体层

autoStartAudioInputDevice 为 false 时才可以将音频输入数据输入到媒体层。 建议在成功加入频道后,在子线程不断的调用此方法传入音频数据

参数
sampleRateHz外部输入源的采样频率,取值范围:8000,16000,32000,44100,48000
channels外部输入源的采样通道数,取值范围:1或2
byteBuffer外部采集数据源,需要传入 DirectByteBuffer 对象。格式为PCM
playDelayMS播放延时 一般设为0
recDelayMS采集延时 一般设为0
clockDrift时钟漂移 一般设为0
返回
调用是否成功
  • 0:调用成功
  • >0:调用失败,参见:JRTCErrorCode 错误码

◆ getAudioOutputData()

abstract int com.juphoon.cloud.jrtc.JRTCAdvanced.getAudioOutputData ( int  sampleRateHz,
int  channels,
ByteBuffer  byteBuffer 
)
abstract

获取音频输出数据

autoStartAudioOutputDevice 为 false 时才可以获取到音频输出数据。 建议在成功加入频道后,在子线程不断的调用此方法获取音频输出数据

参数
sampleRateHz输出源的采集频率,取值范围:8000,16000,32000,44100,48000
channels输出源的采样通道数,取值范围:1或2
byteBuffer字节缓冲区,从媒体层获取的音频输出数据将被存入此缓冲区,需要传入 DirectByteBuffer 对象。缓冲区的容量为(采样频率*采样通道数/100)。格式为PCM
返回
调用是否成功
  • 0:调用成功
  • >0:调用失败,参见:JRTCErrorCode 错误码

◆ setLocalCaptureAngle()

abstract int com.juphoon.cloud.jrtc.JRTCAdvanced.setLocalCaptureAngle ( int  angle)
abstract

设置本地视频采集窗体角度–设置本地采集的视频角度

参数
angle视频旋转角度:
返回
调用是否成功
  • 0:调用成功
  • >0:调用失败,参见:JRTCErrorCode 错误码

◆ setRenderMirror()

abstract int com.juphoon.cloud.jrtc.JRTCAdvanced.setRenderMirror ( JRTCVideoCanvas  videoCanvas,
RenderMirrorType  renderMirror 
)
abstract

设置本地渲染的画面镜像

参数
videoCanvas渲染对象
renderMirror镜像类型枚举对象
返回
调用是否成功
  • 0:调用成功
  • >0:调用失败,参见:JRTCErrorCode 错误码

◆ setRenderEffect()

abstract int com.juphoon.cloud.jrtc.JRTCAdvanced.setRenderEffect ( JRTCVideoCanvas  videoCanvas,
@RenderEffectType String  enEffectType,
String  strJson,
Object[]  extraObjs 
)
abstract

设置渲染特效

参数
videoCanvas渲染对象
enEffectType渲染特效类型: RENDER_EFFECT_NONE : 无特效 RENDER_EFFECT_BLUR : 模糊 RENDER_EFFECT_GREY : 灰度 RENDER_EFFECT_MASK : 掩饰 RENDER_EFFECT_MAGNIFIER : 放大
strJson特效参数,json字符串格式
extraObjs字符串格式中由格式说明符引用的参数
返回
调用是否成功
  • 0:调用成功
  • >0:调用失败,参见:JRTCErrorCode 错误码

◆ freezeRenderEffect()

abstract int com.juphoon.cloud.jrtc.JRTCAdvanced.freezeRenderEffect ( JRTCVideoCanvas  videoCanvas,
boolean  enable 
)
abstract

是否冻结渲染

渲染特效后的静态展示(某一帧画面)

参数
videoCanvas渲染对象
enable是否冻结渲染
返回
调用是否成功
  • 0:调用成功
  • >0:调用失败,参见:JRTCErrorCode 错误码

◆ takeOnceSnapshot()

abstract int com.juphoon.cloud.jrtc.JRTCAdvanced.takeOnceSnapshot ( JRTCVideoCanvas  videoCanvas,
int  width,
int  height,
String  filePath 
)
abstract

视频通话截图

调用此方法时需要保证该视频对象正在渲染,否则将调用失败

参数
videoCanvas渲染对象
width截屏宽度像素,-1为视频源像素
height截屏高度像素,-1为视频源像素
filePath文件路径,需精确到文件名及格式,例如:/sdcard/emulated/0/picture.png。请确保目录存在且可写。推荐格式: jpg 或者 png
返回
调用是否成功
  • 0:调用成功
  • >0:调用失败,参见:JRTCErrorCode 错误码

◆ setRenderAngle()

abstract int com.juphoon.cloud.jrtc.JRTCAdvanced.setRenderAngle ( JRTCVideoCanvas  jrtcVideoCanvas,
@VideoAngle int  angle 
)
abstract

旋转角度,必须是90的倍数,该角度表示与屏幕正方向旋转后的夹角

参数
jrtcVideoCanvas渲染对象
angle视频旋转角度:
返回
调用是否成功
  • 0:调用成功
  • >0:调用失败,参见:JRTCErrorCode 错误码

◆ getMinExposureCompensation()

abstract int com.juphoon.cloud.jrtc.JRTCAdvanced.getMinExposureCompensation ( )
abstract

获取摄像头曝光补偿最小值,单位EV

返回
最小曝光补偿:

◆ getMaxExposureCompensation()

abstract int com.juphoon.cloud.jrtc.JRTCAdvanced.getMaxExposureCompensation ( )
abstract

获取摄像头曝光补偿值,单位EV

返回
最大曝光补偿:

◆ getExposureCompensationStep()

abstract float com.juphoon.cloud.jrtc.JRTCAdvanced.getExposureCompensationStep ( )
abstract

获取摄像头曝光补偿步长

返回
获取曝光补偿步长:

类成员变量说明

◆ I420

final int com.juphoon.cloud.jrtc.JRTCAdvanced.I420 = 1
static

I420

◆ IYUV

final int com.juphoon.cloud.jrtc.JRTCAdvanced.IYUV = 2
static

IYUV

◆ RGB24

final int com.juphoon.cloud.jrtc.JRTCAdvanced.RGB24 = 3
static

RGB24

◆ ABGR

final int com.juphoon.cloud.jrtc.JRTCAdvanced.ABGR = 4
static

ABGR

◆ ARGB

final int com.juphoon.cloud.jrtc.JRTCAdvanced.ARGB = 5
static

ARGB

◆ ARGB444

final int com.juphoon.cloud.jrtc.JRTCAdvanced.ARGB444 = 6
static

ARGB444

◆ RGB565

final int com.juphoon.cloud.jrtc.JRTCAdvanced.RGB565 = 7
static

RGB565

◆ ARGB1555

final int com.juphoon.cloud.jrtc.JRTCAdvanced.ARGB1555 = 8
static

ARGB1555

◆ YUY2

final int com.juphoon.cloud.jrtc.JRTCAdvanced.YUY2 = 9
static

YUY2

◆ YV12

final int com.juphoon.cloud.jrtc.JRTCAdvanced.YV12 = 10
static

YV12

◆ UYVY

final int com.juphoon.cloud.jrtc.JRTCAdvanced.UYVY = 11
static

UYVY

◆ MJPG

final int com.juphoon.cloud.jrtc.JRTCAdvanced.MJPG = 12
static

MJPG

◆ NV21

final int com.juphoon.cloud.jrtc.JRTCAdvanced.NV21 = 13
static

NV21

◆ NV12

final int com.juphoon.cloud.jrtc.JRTCAdvanced.NV12 = 14
static

NV12

◆ BGRA

final int com.juphoon.cloud.jrtc.JRTCAdvanced.BGRA = 15
static

BGRA

◆ H264

final int com.juphoon.cloud.jrtc.JRTCAdvanced.H264 = 100
static

H264

◆ H264_SVC

final int com.juphoon.cloud.jrtc.JRTCAdvanced.H264_SVC = 101
static

H264-SVC

◆ VIDEO_ANGLE_AUTO

final int com.juphoon.cloud.jrtc.JRTCAdvanced.VIDEO_ANGLE_AUTO = ZmfVideo.ROTATION_FIXED_SCREEN
static

自动

◆ VIDEO_ANGLE_0

final int com.juphoon.cloud.jrtc.JRTCAdvanced.VIDEO_ANGLE_0 = ZmfVideo.ROTATION_ANGLE_0
static

0度

◆ VIDEO_ANGLE_90

final int com.juphoon.cloud.jrtc.JRTCAdvanced.VIDEO_ANGLE_90 = ZmfVideo.ROTATION_ANGLE_90
static

90度

◆ VIDEO_ANGLE_180

final int com.juphoon.cloud.jrtc.JRTCAdvanced.VIDEO_ANGLE_180 = ZmfVideo.ROTATION_ANGLE_180
static

180度

◆ VIDEO_ANGLE_270

final int com.juphoon.cloud.jrtc.JRTCAdvanced.VIDEO_ANGLE_270 = ZmfVideo.ROTATION_ANGLE_270
static

270度

◆ VIDEO_SOURCE_PEER

final int com.juphoon.cloud.jrtc.JRTCAdvanced.VIDEO_SOURCE_PEER = 0
static

用户

◆ VIDEO_SOURCE_CAPTURE

final int com.juphoon.cloud.jrtc.JRTCAdvanced.VIDEO_SOURCE_CAPTURE = 1
static

采集设备

◆ VIDEO_SOURCE_FILE

final int com.juphoon.cloud.jrtc.JRTCAdvanced.VIDEO_SOURCE_FILE = 2
static

文件

◆ RENDER_EFFECT_NONE

final String com.juphoon.cloud.jrtc.JRTCAdvanced.RENDER_EFFECT_NONE = "None"
static

无特效

◆ RENDER_EFFECT_BLUR

final String com.juphoon.cloud.jrtc.JRTCAdvanced.RENDER_EFFECT_BLUR = "Blur"
static

模糊

◆ RENDER_EFFECT_GREY

final String com.juphoon.cloud.jrtc.JRTCAdvanced.RENDER_EFFECT_GREY = "Grey"
static

灰度

◆ RENDER_EFFECT_MASK

final String com.juphoon.cloud.jrtc.JRTCAdvanced.RENDER_EFFECT_MASK = "Mask"
static

掩饰

◆ RENDER_EFFECT_MAGNIFIER

final String com.juphoon.cloud.jrtc.JRTCAdvanced.RENDER_EFFECT_MAGNIFIER = "Magnifier"
static

放大


该类的文档由以下文件生成: