public interface com.ss.avframework.live.VeLivePusherDef.VeLiveVideoFrameFilter
自定义的视频处理回调。
| 返回 | 名称 |
|---|---|
| default int | onVideoProcess |
default int com.ss.avframework.live.VeLivePusherDef.VeLiveVideoFrameFilter.onVideoProcess( VeLiveVideoFrame srcFrame, VeLiveVideoFrame dstFrame )
自定义的视频处理方法。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| srcFrame | VeLiveVideoFrame | 源视频帧,详情请参见 VeLiveVideoFrame。 |
| dstFrame | VeLiveVideoFrame | 处理后的视频帧,详情请参见 VeLiveVideoFrame。 |
返回值
public interface com.ss.avframework.live.VeLivePusherDef.VeLiveVideoFrameListener
视频帧订阅回调。
| 返回 | 名称 |
|---|---|
| default VeLiveVideoFrameSource | getObservedVideoFrameSource |
| default void | onCaptureVideoFrame |
| default void | onPreEncodeVideoFrame |
default VeLiveVideoFrameSource com.ss.avframework.live.VeLivePusherDef.VeLiveVideoFrameListener.getObservedVideoFrameSource()
设置当前 Listener 需要的视频帧来源。
返回值
您所要订阅的视频数据的位置信息,详情请参见 VeLiveVideoFrameSource。
default void com.ss.avframework.live.VeLivePusherDef.VeLiveVideoFrameListener.onCaptureVideoFrame(VeLiveVideoFrame frame)
采集视频帧回调。只有当您通过 getObservedVideoFrameSource 返回 VeLiveVideoFrameSourceCapture 时,才会触发该回调。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| frame | VeLiveVideoFrame | 视频帧数据,详情请参见 VeLiveVideoFrame。 |
default void com.ss.avframework.live.VeLivePusherDef.VeLiveVideoFrameListener.onPreEncodeVideoFrame(VeLiveVideoFrame frame)
编码前视频帧回调。只有当您通过 getObservedVideoFrameSource 返回 VeLiveVideoFrameSourcePreEncode 时,才会触发该回调。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| frame | VeLiveVideoFrame | 视频帧数据,详情请参见 VeLiveVideoFrame。 |
public interface com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEffectCallback
视频特效回调。
| 返回 | 名称 |
|---|---|
| default void | onResult |
default void com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEffectCallback.onResult( int result, String msg )
视频特效处理结果回调。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| result | int | 处理结果 |
| msg | String | 消息 |
public interface com.ss.avframework.live.VeLivePusherDef.VeLiveMediaPlayerListener
播放器播放回调。通过该回调,您可以获取与播放相关的事件和通知。
| 类型 | 默认值 | 名称 |
|---|---|---|
| String | "has_video_stream" | KEY_HAS_VIDEO_STREAM |
| String | "has_audio_stream" | KEY_HAS_AUDIO_STREAM |
| String | "duration" | KEY_DURATION |
| String | "video_width" | KEY_VIDEO_WIDTH |
| String | "video_height" | KEY_VIDEO_HEIGHT |
| 返回 | 名称 |
|---|---|
| default void | onStart |
| default void | onProgress |
| default void | onStop |
| default void | onError |
public String com.ss.avframework.live.VeLivePusherDef.VeLiveMediaPlayerListener.KEY_HAS_VIDEO_STREAM = "has_video_stream"
是否有视频流。
public String com.ss.avframework.live.VeLivePusherDef.VeLiveMediaPlayerListener.KEY_HAS_AUDIO_STREAM = "has_audio_stream"
是否有音频流。
public String com.ss.avframework.live.VeLivePusherDef.VeLiveMediaPlayerListener.KEY_DURATION = "duration"
音视频总时长,单位为 ms。
public String com.ss.avframework.live.VeLivePusherDef.VeLiveMediaPlayerListener.KEY_VIDEO_WIDTH = "video_width"
视频的宽度。
public String com.ss.avframework.live.VeLivePusherDef.VeLiveMediaPlayerListener.KEY_VIDEO_HEIGHT = "video_height"
视频的高度。
default void com.ss.avframework.live.VeLivePusherDef.VeLiveMediaPlayerListener.onStart(Bundle info)
开始播放的回调。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| info | Bundle | - |
default void com.ss.avframework.live.VeLivePusherDef.VeLiveMediaPlayerListener.onProgress(long timeMs)
播放进度的回调,每 100ms 触发一次。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| timeMs | long | 播放进度,单位为 ms。 |
default void com.ss.avframework.live.VeLivePusherDef.VeLiveMediaPlayerListener.onStop()
停止播放的回调。
default void com.ss.avframework.live.VeLivePusherDef.VeLiveMediaPlayerListener.onError( int code, String msg )
返错误状态的回调。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| code | int | 错误码,详情请参见 VeLivePusherErrorCode。 |
| msg | String | 错误消息。 |
public interface com.ss.avframework.live.VeLivePusherDef.VeLiveAudioFrameListener
音频帧订阅回调。
| 返回 | 名称 |
|---|---|
| default VeLiveAudioFrameSource | getObservedAudioFrameSource |
| default void | onCaptureAudioFrame |
| default void | onPreEncodeAudioFrame |
default VeLiveAudioFrameSource com.ss.avframework.live.VeLivePusherDef.VeLiveAudioFrameListener.getObservedAudioFrameSource()
设置当前 Listener 需要的音频帧来源。
返回值
订阅的音频帧位置信息,详情请参见 VeLiveAudioFrameSource。
default void com.ss.avframework.live.VeLivePusherDef.VeLiveAudioFrameListener.onCaptureAudioFrame(VeLiveAudioFrame frame)
采集音频帧回调。只有当您通过 getObservedAudioFrameSource 返回 VeLiveAudioFrameSourceCapture 时,才会触发该回调。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| frame | VeLiveAudioFrame | 音频帧数据,详情请参见 VeLiveAudioFrame。 |
default void com.ss.avframework.live.VeLivePusherDef.VeLiveAudioFrameListener.onPreEncodeAudioFrame(VeLiveAudioFrame frame)
编码前音频帧回调。只有当您通过 getObservedAudioFrameSource 返回 VeLiveAudioFrameSourcePreEncode 时,才会触发该回调。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| frame | VeLiveAudioFrame | 音频帧数据,详情请参见 VeLiveAudioFrame。 |
public interface com.ss.avframework.live.VeLivePusherDef.VeLiveMediaPlayerFrameListener
播放器音视频帧回调。通过该回调,您可以获取音频和视频帧的数据。
| 返回 | 名称 |
|---|---|
| default void | onAudioFrame |
| default void | onVideoFrame |
default void com.ss.avframework.live.VeLivePusherDef.VeLiveMediaPlayerFrameListener.onAudioFrame(VeLiveAudioFrame frame)
播放器音频帧回调。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| frame | VeLiveAudioFrame | 音频帧,详情请参见 VeLiveAudioFrame。 |
default void com.ss.avframework.live.VeLivePusherDef.VeLiveMediaPlayerFrameListener.onVideoFrame(VeLiveVideoFrame frame)
播放器视频帧回调。当完成一个新的视频帧的解码后,触发该回调。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| frame | VeLiveVideoFrame | 视频帧数据,包含了帧的时间戳和格式等信息,详情请参见 VeLiveVideoFrame。 |
public interface com.ss.avframework.live.VeLivePusherDef.VeLiveSnapshotListener
直播截图回调。
| 返回 | 名称 |
|---|---|
| default void | onSnapshotComplete |
default void com.ss.avframework.live.VeLivePusherDef.VeLiveSnapshotListener.onSnapshotComplete(Bitmap image)
截图成功回调。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| image | Bitmap | 视频的截图。 |
注意
调用 snapshot 截图成功后,会收到这个回调。
public interface com.ss.avframework.live.VeLivePusherDef.VeLiveAudioFrameFilter
自定义的音频处理回调。
| 返回 | 名称 |
|---|---|
| default int | onAudioProcess |
default int com.ss.avframework.live.VeLivePusherDef.VeLiveAudioFrameFilter.onAudioProcess( VeLiveAudioFrame srcFrame, VeLiveAudioFrame dstFrame )
自定义的音频处理方法。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| srcFrame | VeLiveAudioFrame | 源音频帧,详情请参见 VeLiveAudioFrame。 |
| dstFrame | VeLiveAudioFrame | 处理后的音频帧,详情请参见 VeLiveAudioFrame。
|
public interface com.ss.avframework.live.VeLivePusherObserver
回调协议,用于监听推流器的推流错误、状态、网络质量、设备、首帧等回调事件等。
| 返回 | 名称 |
|---|---|
| default void | onError |
| default void | onStatusChange |
| default void | onFirstVideoFrame |
| default void | onFirstAudioFrame |
| default void | onCameraOpened |
| default void | onMicrophoneOpened |
| default void | onScreenRecording |
| default void | onNetworkQuality |
| default void | onAudioPowerQuality |
default void com.ss.avframework.live.VeLivePusherObserver.onError( int code, int subCode, String msg )
推流错误回调。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| code | int | 错误码。详情请参见 VeLivePusherErrorCode。 |
| subCode | int | 子错误码。 |
| msg | String | 错误信息。 |
default void com.ss.avframework.live.VeLivePusherObserver.onStatusChange(VeLivePusherStatus status)
推流状态变化回调。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| status | VeLivePusherStatus | 变化后的推流状态。详情请参见 VeLivePusherStatus。 |
default void com.ss.avframework.live.VeLivePusherObserver.onFirstVideoFrame( VeLiveFirstFrameType type, long timestampMs )
首帧视频回调,当推流器发送出第一帧视频时,触发该回调。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| type | VeLiveFirstFrameType | 首帧的类型,详情请参见 VeLiveFirstFrameType。 |
| timestampMs | long | 时间戳,单位为 ms。 |
default void com.ss.avframework.live.VeLivePusherObserver.onFirstAudioFrame( VeLiveFirstFrameType type, long timestampMs )
首帧音频回调,当推流器发送出第一帧音频时,触发该回调。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| type | VeLiveFirstFrameType | 首帧的类型,详情请参见 VeLiveFirstFrameType。 |
| timestampMs | long | 时间戳,单位为 ms。 |
default void com.ss.avframework.live.VeLivePusherObserver.onCameraOpened(boolean open)
摄像头开启/关闭回调,当推流器的摄像头开启或关闭时,触发该回调。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| open | boolean | 摄像头的新状态是否为开启。
|
default void com.ss.avframework.live.VeLivePusherObserver.onMicrophoneOpened(boolean open)
麦克风开启/关闭回调,当推流器的麦克风开启或关闭时,触发该回调。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| open | boolean | 麦克风的新状态是否为开启。
|
default void com.ss.avframework.live.VeLivePusherObserver.onScreenRecording(boolean open)
屏幕采集开启/关闭回调,当推流器的屏幕采集开启或关闭时,触发该回调。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| open | boolean | 屏幕采集的新状态是否为开启。
|
default void com.ss.avframework.live.VeLivePusherObserver.onNetworkQuality(VeLiveNetworkQuality quality)
网络质量状态回调,当推流器检测到网络质量发生变化时,触发该回调。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| quality | VeLiveNetworkQuality | 变化后的网络质量。详情请参见 VeLiveNetworkQuality。 |
default void com.ss.avframework.live.VeLivePusherObserver.onAudioPowerQuality( VeLiveAudioPowerLevel level, float value )
音量等级回调,当推流器的音频音量等级发生变化时,触发该回调。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| level | VeLiveAudioPowerLevel | 变化后的音量等级。详情请参见 VeLiveAudioPowerLevel。 |
| value | float | 当前音量的分贝值(dB)。
|
public interface com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatisticsObserver
推流器周期性回调。
| 返回 | 名称 |
|---|---|
| default void | onStatistics |
| default void | onLogMonitor |
default void com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatisticsObserver.onStatistics(VeLivePusherStatistics statistics)
推流周期性统计信息回调,每 5s 回调一次,您可以调用 setStatisticsObserver 修改回调时间间隔。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| statistics | VeLivePusherStatistics | 周期性统计信息,详情请参见 VeLivePusherStatistics。 |
default void com.ss.avframework.live.VeLivePusherDef.VeLivePusherStatisticsObserver.onLogMonitor(JSONObject logInfo)
周期性日志信息回调。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| logInfo | JSONObject | 周期性日志信息。 |
public class com.ss.avframework.live.VeLivePusherDef
类型定义。
public interface com.ss.avframework.live.VeLivePusherDef.VeLiveFileRecordingListener
直播录制回调。
| 返回 | 名称 |
|---|---|
| default void | onFileRecordingStarted |
| default void | onFileRecordingStopped |
| default void | onFileRecordingError |
default void com.ss.avframework.live.VeLivePusherDef.VeLiveFileRecordingListener.onFileRecordingStarted()
直播录制开始回调。
default void com.ss.avframework.live.VeLivePusherDef.VeLiveFileRecordingListener.onFileRecordingStopped()
直播录制停止回调。
default void com.ss.avframework.live.VeLivePusherDef.VeLiveFileRecordingListener.onFileRecordingError( int errorCode, String message )
直播录制错误回调。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| errorCode | int | 错误码,详情请参见 VeLivePusherErrorCode。 |
| message | String | 错误信息。 |
public interface com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEffectHandleCallback
视频特效对象回调。
| 返回 | 名称 |
|---|---|
| default void | onEffectHandle |
default void com.ss.avframework.live.VeLivePusherDef.VeLiveVideoEffectHandleCallback.onEffectHandle(Object handle)
视频特效对象回调,调用 setAdvancedFeature 接口时触发此回调,如需使用请联系技术支持。
传入参数
| 参数名 | 类型 | 说明 |
|---|---|---|
| handle | Object | 视频特效对象。 |