文档中心
互动直播 (Legacy)
API 参考
MediaPlayer Kit C++ API Reference
MediaPlayer Kit C++ API Reference
|
enum | VIDEO_PIXEL_FORMAT {
VIDEO_PIXEL_UNKNOWN = 0
, VIDEO_PIXEL_I420 = 1
, VIDEO_PIXEL_BGRA = 2
, VIDEO_PIXEL_NV21 = 3
,
VIDEO_PIXEL_RGBA = 4
, VIDEO_PIXEL_NV12 = 8
, VIDEO_TEXTURE_2D = 10
, VIDEO_TEXTURE_OES = 11
,
VIDEO_PIXEL_I422 = 16
} |
|
enum | RENDER_MODE_TYPE { RENDER_MODE_HIDDEN = 1
, RENDER_MODE_FIT = 2
, RENDER_MODE_ADAPTIVE = 3
} |
|
enum | MEDIA_PLAYER_STATE {
PLAYER_STATE_IDLE = 0
, PLAYER_STATE_OPENING
, PLAYER_STATE_OPEN_COMPLETED
, PLAYER_STATE_PLAYING
,
PLAYER_STATE_PAUSED
, PLAYER_STATE_PLAYBACK_COMPLETED
, PLAYER_STATE_PLAYBACK_ALL_LOOPS_COMPLETED
, PLAYER_STATE_STOPPED = PLAYER_STATE_IDLE
,
PLAYER_STATE_FAILED = 100
} |
|
enum | MEDIA_PLAYER_ERROR {
PLAYER_ERROR_NONE = 0
, PLAYER_ERROR_INVALID_ARGUMENTS = -1
, PLAYER_ERROR_INTERNAL = -2
, PLAYER_ERROR_NO_RESOURCE = -3
,
PLAYER_ERROR_INVALID_MEDIA_SOURCE = -4
, PLAYER_ERROR_UNKNOWN_STREAM_TYPE = -5
, PLAYER_ERROR_OBJ_NOT_INITIALIZED = -6
, PLAYER_ERROR_CODEC_NOT_SUPPORTED = -7
,
PLAYER_ERROR_VIDEO_RENDER_FAILED = -8
, PLAYER_ERROR_INVALID_STATE = -9
, PLAYER_ERROR_URL_NOT_FOUND = -10
, PLAYER_ERROR_INVALID_CONNECTION_STATE = -11
,
PLAYER_ERROR_SRC_BUFFER_UNDERFLOW = -12
} |
|
enum | MEDIA_PLAYER_PLAYBACK_SPEED {
PLAYBACK_SPEED_ORIGINAL = 100
, PLAYBACK_SPEED_50_PERCENT = 50
, PLAYBACK_SPEED_75_PERCENT = 75
, PLAYBACK_SPEED_125_PERCENT = 125
,
PLAYBACK_SPEED_150_PERCENT = 150
, PLAYBACK_SPEED_200_PERCENT = 200
} |
|
enum | MEDIA_STREAM_TYPE { STREAM_TYPE_UNKNOWN = 0
, STREAM_TYPE_VIDEO = 1
, STREAM_TYPE_AUDIO = 2
, STREAM_TYPE_SUBTITLE = 3
} |
|
enum | MEDIA_PLAYER_EVENT {
PLAYER_EVENT_SEEK_BEGIN = 0
, PLAYER_EVENT_SEEK_COMPLETE = 1
, PLAYER_EVENT_SEEK_ERROR = 2
, PLAYER_EVENT_AUDIO_TRACK_CHANGED = 5
,
PLAYER_EVENT_BUFFER_LOW = 6
, PLAYER_EVENT_BUFFER_RECOVER = 7
, PLAYER_EVENT_SWITCH_BEGIN = 8
, PLAYER_EVENT_SWITCH_COMPLETE = 9
,
PLAYER_EVENT_SWITCH_ERROR = 10
} |
|
enum | PLAYER_PRELOAD_EVENT { PLAYER_PRELOAD_EVENT_BEGIN = 0
, PLAYER_PRELOAD_EVENT_COMPLETE = 1
, PLAYER_PRELOAD_EVENT_ERROR = 2
} |
|
enum | MEDIA_PLAYER_METADATA_TYPE { PLAYER_METADATA_TYPE_UNKNOWN = 0
, PLAYER_METADATA_TYPE_SEI = 1
} |
|
◆ view_t
◆ user_id_t
◆ VIDEO_PIXEL_FORMAT
视频像素格式
枚举值 |
---|
VIDEO_PIXEL_UNKNOWN | 0 : 视频像素格式未知
|
VIDEO_PIXEL_I420 | 1 : I420 格式
|
VIDEO_PIXEL_BGRA | 2 : BGRA 格式
|
VIDEO_PIXEL_NV21 | 3 : Planar YUV422 格式
|
VIDEO_PIXEL_RGBA | 4 : RGBA 格式
|
VIDEO_PIXEL_NV12 | 8 : NV12 格式
|
VIDEO_TEXTURE_2D | 10 : TEXTURE_2D 格式
|
VIDEO_TEXTURE_OES | 11 : TEXTURE_OES 格式
|
VIDEO_PIXEL_I422 | 16 : I422 格式
|
◆ RENDER_MODE_TYPE
视频渲染模式
枚举值 |
---|
RENDER_MODE_HIDDEN | 1 : 视频尺寸等比缩放。优先保证视窗被填满。因视频尺寸与显示视窗尺寸不一致而多出的视频将被截掉。
|
RENDER_MODE_FIT | 2 : 视频尺寸等比缩放。优先保证视频内容全部显示。因视频尺寸与显示视窗尺寸不一致造成的视窗未被填满的区域填充黑色。
|
RENDER_MODE_ADAPTIVE | - 弃用:
- 该模式已废弃。
|
◆ MEDIA_PLAYER_STATE
播放器的状态
枚举值 |
---|
PLAYER_STATE_IDLE | 0 : 默认状态。播放器会在你打开媒体文件之前和结束播放之后返回该状态码。
|
PLAYER_STATE_OPENING | 正在打开媒体文件
|
PLAYER_STATE_OPEN_COMPLETED | 成功打开媒体文件
|
PLAYER_STATE_PLAYING | 正在播放
|
PLAYER_STATE_PAUSED | 暂停播放
|
PLAYER_STATE_PLAYBACK_COMPLETED | 播放完毕
|
PLAYER_STATE_PLAYBACK_ALL_LOOPS_COMPLETED | 循环播放已结束
|
PLAYER_STATE_STOPPED | 终止播放
|
PLAYER_STATE_FAILED | 100 : 播放失败
|
◆ MEDIA_PLAYER_ERROR
播放器的错误码
枚举值 |
---|
PLAYER_ERROR_NONE | 0 : 没有错误
|
PLAYER_ERROR_INVALID_ARGUMENTS | -1 : 不正确的参数
|
PLAYER_ERROR_INTERNAL | -2 : 内部错误
|
PLAYER_ERROR_NO_RESOURCE | -3 : 没有 resource
|
PLAYER_ERROR_INVALID_MEDIA_SOURCE | -4 : 无效的 resource
|
PLAYER_ERROR_UNKNOWN_STREAM_TYPE | -5 : 未知的媒体流类型
|
PLAYER_ERROR_OBJ_NOT_INITIALIZED | -6 : 对象没有初始化
|
PLAYER_ERROR_CODEC_NOT_SUPPORTED | -7 : 解码器不支持该 codec
|
PLAYER_ERROR_VIDEO_RENDER_FAILED | -8 : 无效的 renderer
|
PLAYER_ERROR_INVALID_STATE | -9 : 播放器内部状态错误
|
PLAYER_ERROR_URL_NOT_FOUND | -10 : 未找到该 URL
|
PLAYER_ERROR_INVALID_CONNECTION_STATE | -11 : 播放器与 Agora 服务器的连接无效
|
PLAYER_ERROR_SRC_BUFFER_UNDERFLOW | -12 : 播放缓冲区数据不足
|
◆ MEDIA_PLAYER_PLAYBACK_SPEED
播放速度
枚举值 |
---|
PLAYBACK_SPEED_ORIGINAL | 100 : 原始播放速度
|
PLAYBACK_SPEED_50_PERCENT | 50 : 播放速度为原始速度的 0.50 倍
|
PLAYBACK_SPEED_75_PERCENT | 75 : 播放速度为原始速度的 0.75 倍
|
PLAYBACK_SPEED_125_PERCENT | 125 : 播放速度为原始速度的 1.25 倍
|
PLAYBACK_SPEED_150_PERCENT | 150 : 播放速度为原始速度的 1.50 倍
|
PLAYBACK_SPEED_200_PERCENT | 200 : 播放速度为原始速度的 2.00 倍
|
◆ MEDIA_STREAM_TYPE
媒体流的类型
枚举值 |
---|
STREAM_TYPE_UNKNOWN | 0 : 未知类型
|
STREAM_TYPE_VIDEO | 1 : 视频流
|
STREAM_TYPE_AUDIO | 2 : 音频流
|
STREAM_TYPE_SUBTITLE | 3 : 字幕流
|
◆ MEDIA_PLAYER_EVENT
播放器的事件
枚举值 |
---|
PLAYER_EVENT_SEEK_BEGIN | 0 : 开始定位
|
PLAYER_EVENT_SEEK_COMPLETE | 1 : 完成定位
|
PLAYER_EVENT_SEEK_ERROR | 2 : 定位出错
|
PLAYER_EVENT_AUDIO_TRACK_CHANGED | 5 : 当前音轨已改变
|
PLAYER_EVENT_BUFFER_LOW | 6 : 当前缓冲的数据不足以支持播放
|
PLAYER_EVENT_BUFFER_RECOVER | 7 : 当前缓冲的数据刚好能支持播放
|
PLAYER_EVENT_SWITCH_BEGIN | 8 : 开始切换媒体资源
|
PLAYER_EVENT_SWITCH_COMPLETE | 9 : 媒体资源切换成功
|
PLAYER_EVENT_SWITCH_ERROR | 10 : 媒体资源切换错误
|
◆ PLAYER_PRELOAD_EVENT
预加载媒体资源事件
枚举值 |
---|
PLAYER_PRELOAD_EVENT_BEGIN | 开始预加载媒体资源
|
PLAYER_PRELOAD_EVENT_COMPLETE | 预加载媒体资源完成
|
PLAYER_PRELOAD_EVENT_ERROR | 预加载媒体资源错误
|
◆ MEDIA_PLAYER_METADATA_TYPE
媒体附属信息数据类型
枚举值 |
---|
PLAYER_METADATA_TYPE_UNKNOWN | 0 : 未知类型
|
PLAYER_METADATA_TYPE_SEI | 1 : SEI (补充增强信息)类型
|
◆ kMaxCodecNameLength
const uint8_t agora::media::base::kMaxCodecNameLength = 50 |
|
static |
◆ kMaxCharBufferLength
const uint8_t agora::media::base::kMaxCharBufferLength = 50 |
|
static |