被 com.juphoon.cloud.JCMediaDeviceImpl 继承.
|
abstract boolean | isCameraOpen () |
|
abstract boolean | isSpeakerOn () |
|
abstract JCMediaDeviceCamera | getCamera () |
|
abstract List< JCMediaDeviceCamera > | getCameras () |
|
abstract JCMediaDeviceVideoCanvas | startCameraVideo (@RenderType int renderType) |
|
abstract JCMediaDeviceVideoCanvas | startVideo (String videoSource, @RenderType int renderType) |
|
abstract void | stopVideo (@NonNull JCMediaDeviceVideoCanvas canvas) |
|
abstract boolean | isAudioStart () |
|
abstract boolean | startAudio () |
|
abstract boolean | stopAudio () |
|
abstract boolean | startCamera () |
|
abstract boolean | stopCamera () |
|
abstract boolean | switchCamera () |
|
abstract boolean | switchCamera (JCMediaDeviceCamera camera) |
|
abstract void | setCameraProperty (int width, int height, int frameRate) |
|
abstract void | setScreenCaptureProperty (int width, int height, int frameRate) |
|
abstract int | getCameraType (int cameraIndex) |
|
abstract void | enableSpeaker (boolean enable) |
|
abstract boolean | isVideoFileOpen () |
|
abstract String | getVideoFileId () |
|
abstract boolean | startVideoFile () |
|
abstract void | setVideoFileFrame (byte[] data, @VideoPixelFormat int format, int width, int height, int angle, int mirror, boolean keyFrame) |
|
abstract boolean | stopVideoFile () |
|
abstract int | getAudioRouteType () |
|
abstract void | setVideoAngle (@VideoAngle int angle) |
|
abstract int | getVideoAngle () |
|
◆ create()
◆ destroy()
static void com.juphoon.cloud.JCMediaDevice.destroy |
( |
| ) |
|
|
inlinestatic |
◆ isCameraOpen()
abstract boolean com.juphoon.cloud.JCMediaDevice.isCameraOpen |
( |
| ) |
|
|
abstract |
◆ isSpeakerOn()
abstract boolean com.juphoon.cloud.JCMediaDevice.isSpeakerOn |
( |
| ) |
|
|
abstract |
◆ getCamera()
◆ getCameras()
◆ startCameraVideo()
◆ startVideo()
abstract JCMediaDeviceVideoCanvas com.juphoon.cloud.JCMediaDevice.startVideo |
( |
String |
videoSource, |
|
|
@RenderType int |
renderType |
|
) |
| |
|
abstract |
◆ stopVideo()
◆ isAudioStart()
abstract boolean com.juphoon.cloud.JCMediaDevice.isAudioStart |
( |
| ) |
|
|
abstract |
◆ startAudio()
abstract boolean com.juphoon.cloud.JCMediaDevice.startAudio |
( |
| ) |
|
|
abstract |
启动音频
在通话连接中或者加入频道成功时,内部会自动调用此方法来启动音频
- 返回
- 调用是否成功
◆ stopAudio()
abstract boolean com.juphoon.cloud.JCMediaDevice.stopAudio |
( |
| ) |
|
|
abstract |
停止音频
在通话挂断时或者离开频道时,内部会自动调用此方法来停止音频
- 返回
- 调用是否成功
◆ startCamera()
abstract boolean com.juphoon.cloud.JCMediaDevice.startCamera |
( |
| ) |
|
|
abstract |
开启摄像头
- 返回
- 调用是否成功
- true:正常执行调用流程,存在以下两种场景:
- false:调用失败,不会收到通知
◆ stopCamera()
abstract boolean com.juphoon.cloud.JCMediaDevice.stopCamera |
( |
| ) |
|
|
abstract |
关闭摄像头
- 返回
- 调用是否成功
- true:正常执行调用流程,存在以下两种场景:
- false:调用失败
◆ switchCamera() [1/2]
abstract boolean com.juphoon.cloud.JCMediaDevice.switchCamera |
( |
| ) |
|
|
abstract |
切换摄像头
内部会根据当前摄像头类型来进行切换
- 返回
- 调用是否成功
◆ switchCamera() [2/2]
切换摄像头
调用此方法时需要保证摄像头已打开并且摄像头数大于0,否则将直接返回 false
- 参数
-
- 返回
- 调用是否成功
- true:正常执行调用流程
- false:调用失败,不会收到回调
◆ setCameraProperty()
abstract void com.juphoon.cloud.JCMediaDevice.setCameraProperty |
( |
int |
width, |
|
|
int |
height, |
|
|
int |
frameRate |
|
) |
| |
|
abstract |
◆ setScreenCaptureProperty()
abstract void com.juphoon.cloud.JCMediaDevice.setScreenCaptureProperty |
( |
int |
width, |
|
|
int |
height, |
|
|
int |
frameRate |
|
) |
| |
|
abstract |
设置屏幕共享采集属性
在调用 enableScreenShare 方法开启屏幕共享前设置即可生效
- 参数
-
width | 采集宽度,默认1280 |
height | 采集高度,默认720 |
frameRate | 采集帧速率,默认10 |
◆ getCameraType()
abstract int com.juphoon.cloud.JCMediaDevice.getCameraType |
( |
int |
cameraIndex | ) |
|
|
abstract |
◆ enableSpeaker()
abstract void com.juphoon.cloud.JCMediaDevice.enableSpeaker |
( |
boolean |
enable | ) |
|
|
abstract |
开启/关闭扬声器
只有在音频已经启动的情况下调用才会生效
- 参数
-
◆ isVideoFileOpen()
abstract boolean com.juphoon.cloud.JCMediaDevice.isVideoFileOpen |
( |
| ) |
|
|
abstract |
◆ getVideoFileId()
abstract String com.juphoon.cloud.JCMediaDevice.getVideoFileId |
( |
| ) |
|
|
abstract |
◆ startVideoFile()
abstract boolean com.juphoon.cloud.JCMediaDevice.startVideoFile |
( |
| ) |
|
|
abstract |
开启视频文件作为视频输入源
- 注解
- 文件和摄像头作为视频输入源只能存在一种,如果当前摄像头已开启的话会关闭摄像头
- 返回
- 调用是否成功
- true:正常执行调用流程,存在以下两种场景:
- false:调用失败,不会收到回调
◆ setVideoFileFrame()
abstract void com.juphoon.cloud.JCMediaDevice.setVideoFileFrame |
( |
byte[] |
data, |
|
|
@VideoPixelFormat int |
format, |
|
|
int |
width, |
|
|
int |
height, |
|
|
int |
angle, |
|
|
int |
mirror, |
|
|
boolean |
keyFrame |
|
) |
| |
|
abstract |
逐帧采集视频画面
- 调用此方法时要保证文件视频源已开启
- 当 format 为 H264 格式并且是关键帧,则需要将 0x67 0x68 0x41 的数据作为一帧传入,并且关键帧要以固定间隔传入,例如5秒,否则一开始可能有几秒对端无法显示视频
- 参数
-
data | 画面二进制数据 |
format | 视频像素格式 |
width | 宽 |
height | 高 |
angle | 90 的倍数 |
mirror | 0 不镜像,1进行左右镜像 |
keyFrame | 是否为关键帧,针对 format 为 H264
|
◆ stopVideoFile()
abstract boolean com.juphoon.cloud.JCMediaDevice.stopVideoFile |
( |
| ) |
|
|
abstract |
关闭逐帧采集画面
- 返回
- 调用是否成功
- true:正常执行调用流程,存在以下两种场景:
- false:调用失败,不会收到回调
◆ getAudioRouteType()
abstract int com.juphoon.cloud.JCMediaDevice.getAudioRouteType |
( |
| ) |
|
|
abstract |
◆ setVideoAngle()
abstract void com.juphoon.cloud.JCMediaDevice.setVideoAngle |
( |
@VideoAngle int |
angle | ) |
|
|
abstract |
◆ getVideoAngle()
abstract int com.juphoon.cloud.JCMediaDevice.getVideoAngle |
( |
| ) |
|
|
abstract |
◆ RENDER_FULL_SCREEN
final int com.juphoon.cloud.JCMediaDevice.RENDER_FULL_SCREEN = 0 |
|
static |
◆ RENDER_FULL_CONTENT
final int com.juphoon.cloud.JCMediaDevice.RENDER_FULL_CONTENT = 1 |
|
static |
◆ RENDER_FULL_AUTO
final int com.juphoon.cloud.JCMediaDevice.RENDER_FULL_AUTO = 2 |
|
static |
◆ CAMERA_NONE
final int com.juphoon.cloud.JCMediaDevice.CAMERA_NONE = 0 |
|
static |
◆ CAMERA_FRONT
final int com.juphoon.cloud.JCMediaDevice.CAMERA_FRONT = 1 |
|
static |
◆ CAMERA_BACK
final int com.juphoon.cloud.JCMediaDevice.CAMERA_BACK = 2 |
|
static |
◆ CAMERA_UNKNOWN
final int com.juphoon.cloud.JCMediaDevice.CAMERA_UNKNOWN = 3 |
|
static |
◆ I420
final int com.juphoon.cloud.JCMediaDevice.I420 = 1 |
|
static |
◆ IYUV
final int com.juphoon.cloud.JCMediaDevice.IYUV = 2 |
|
static |
◆ RGB24
final int com.juphoon.cloud.JCMediaDevice.RGB24 = 3 |
|
static |
◆ ABGR
final int com.juphoon.cloud.JCMediaDevice.ABGR = 4 |
|
static |
◆ ARGB
final int com.juphoon.cloud.JCMediaDevice.ARGB = 5 |
|
static |
◆ ARGB444
final int com.juphoon.cloud.JCMediaDevice.ARGB444 = 6 |
|
static |
◆ RGB565
final int com.juphoon.cloud.JCMediaDevice.RGB565 = 7 |
|
static |
◆ ARGB1555
final int com.juphoon.cloud.JCMediaDevice.ARGB1555 = 8 |
|
static |
◆ YUY2
final int com.juphoon.cloud.JCMediaDevice.YUY2 = 9 |
|
static |
◆ YV12
final int com.juphoon.cloud.JCMediaDevice.YV12 = 10 |
|
static |
◆ UYVY
final int com.juphoon.cloud.JCMediaDevice.UYVY = 11 |
|
static |
◆ MJPG
final int com.juphoon.cloud.JCMediaDevice.MJPG = 12 |
|
static |
◆ NV21
final int com.juphoon.cloud.JCMediaDevice.NV21 = 13 |
|
static |
◆ NV12
final int com.juphoon.cloud.JCMediaDevice.NV12 = 14 |
|
static |
◆ BGRA
final int com.juphoon.cloud.JCMediaDevice.BGRA = 15 |
|
static |
◆ H264
final int com.juphoon.cloud.JCMediaDevice.H264 = 100 |
|
static |
◆ AUDIO_ROUTE_RECEIVER
final int com.juphoon.cloud.JCMediaDevice.AUDIO_ROUTE_RECEIVER = 0 |
|
static |
◆ AUDIO_ROUTE_SPEAKER
final int com.juphoon.cloud.JCMediaDevice.AUDIO_ROUTE_SPEAKER = 1 |
|
static |
◆ AUDIO_ROUTE_HEADSET
final int com.juphoon.cloud.JCMediaDevice.AUDIO_ROUTE_HEADSET = 2 |
|
static |
◆ AUDIO_ROUTE_BLUETOOTH
final int com.juphoon.cloud.JCMediaDevice.AUDIO_ROUTE_BLUETOOTH = 3 |
|
static |
◆ VIDEO_ANGLE_AUTO
final int com.juphoon.cloud.JCMediaDevice.VIDEO_ANGLE_AUTO = -1 |
|
static |
◆ VIDEO_ANGLE_0
final int com.juphoon.cloud.JCMediaDevice.VIDEO_ANGLE_0 = 0 |
|
static |
◆ VIDEO_ANGLE_90
final int com.juphoon.cloud.JCMediaDevice.VIDEO_ANGLE_90 = 90 |
|
static |
◆ VIDEO_ANGLE_180
final int com.juphoon.cloud.JCMediaDevice.VIDEO_ANGLE_180 = 180 |
|
static |
◆ VIDEO_ANGLE_270
final int com.juphoon.cloud.JCMediaDevice.VIDEO_ANGLE_270 = 270 |
|
static |
◆ defaultSpeakerOn
boolean com.juphoon.cloud.JCMediaDevice.defaultSpeakerOn = false |
没有插入耳机或外接蓝牙时是否默认开启扬声器,默认关闭
◆ useInternalAudioDeviceLogic
boolean com.juphoon.cloud.JCMediaDevice.useInternalAudioDeviceLogic = true |
是否使用内部音频设备逻辑,默认使用
内部音频设备逻辑如下:
1.打开扬声器 - 使用扬声器输出声音 2.连上蓝牙耳机 - 使用蓝牙耳机输出声音,如果扬声器开着则关闭扬声器 3.插入耳机 - 使用耳机输出声音,如果扬声器开着则关闭扬声器 4.蓝牙耳机和有线耳机以最后连上的作为输出 5.关闭扬声器 - (蓝牙耳机或有线耳机) 优于听筒
- true: 使用内部音频设备逻辑
- false: 不使用内部音频设备逻辑
◆ defaultCamera
◆ audioParam
音频参数
需要在调用 startAudio 方法前设置,即连接通话或加入频道前设置此参数。若不设置此参数,将使用默认值。
该类的文档由以下文件生成:
- cloud/src/main/common/com/juphoon/cloud/JCMediaDevice.java