Media Player Kit v1.3.0 API Reference for Windows
Classes | Typedefs | Enumerations | Variables
agora::media::base Namespace Reference

Classes

struct  AudioPcmFrame
 
class  IAudioFrameObserver
 
struct  VideoFrame
 
class  IVideoFrameObserver
 
struct  MediaStreamInfo
 

Typedefs

typedef void * view_t
 
typedef const char * user_id_t
 

Enumerations

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_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 }
 

Variables

static const uint8_t kMaxCodecNameLength = 50
 
static const uint8_t kMaxCharBufferLength = 50
 

Typedef Documentation

◆ view_t

◆ user_id_t

typedef const char* agora::media::base::user_id_t

Enumeration Type Documentation

◆ VIDEO_PIXEL_FORMAT

The pixel format of the video frame.

Enumerator
VIDEO_PIXEL_UNKNOWN 

0: The format is known.

VIDEO_PIXEL_I420 

1: The format is I420.

VIDEO_PIXEL_BGRA 

2: The format is BGRA.

VIDEO_PIXEL_NV21 

3: The format is NV21.

VIDEO_PIXEL_RGBA 

4: The format is RGBA.

VIDEO_PIXEL_NV12 

8: The format is NV12.

VIDEO_TEXTURE_2D 

10: The format is GL_TEXTURE_2D.

VIDEO_TEXTURE_OES 

11: The format is GL_TEXTURE_OES.

VIDEO_PIXEL_I422 

16: The format is I422.

◆ RENDER_MODE_TYPE

The render mode of the player.

Enumerator
RENDER_MODE_HIDDEN 

1: Uniformly scale the video until it fills the visible boundaries (cropped). One dimension of the video may have clipped contents.

RENDER_MODE_FIT 

2: Uniformly scale the video until one of its dimension fits the boundary (zoomed to fit). Areas that are not filled due to disparity in the aspect ratio are filled with black.

RENDER_MODE_ADAPTIVE 
Deprecated:
This mode is deprecated.

◆ MEDIA_PLAYER_STATE

The playback state.

Enumerator
PLAYER_STATE_IDLE 

0: Default state. MediaPlayer Kit returns this state code before you open the media resource or after you stop the playback.

PLAYER_STATE_OPENING 

Opening the media resource.

PLAYER_STATE_OPEN_COMPLETED 

Opened the media resource successfully.

PLAYER_STATE_PLAYING 

Playing the media resource.

PLAYER_STATE_PAUSED 

Pauses the playback.

PLAYER_STATE_PLAYBACK_COMPLETED 

The playback is completed.

PLAYER_STATE_PLAYBACK_ALL_LOOPS_COMPLETED 

The loop playback is completed.

PLAYER_STATE_FAILED 

100: Fails to play the media resource.

◆ MEDIA_PLAYER_ERROR

The error code.

Enumerator
PLAYER_ERROR_NONE 

0: No error.

PLAYER_ERROR_INVALID_ARGUMENTS 

-1: Invalid arguments.

PLAYER_ERROR_INTERNAL 

-2: Internal error.

PLAYER_ERROR_NO_RESOURCE 

-3: No resource.

PLAYER_ERROR_INVALID_MEDIA_SOURCE 

-4: Invalid media resource.

PLAYER_ERROR_UNKNOWN_STREAM_TYPE 

-5: The type of the media stream is unknown.

PLAYER_ERROR_OBJ_NOT_INITIALIZED 

-6: The object is not initialized.

PLAYER_ERROR_CODEC_NOT_SUPPORTED 

-7: The codec is not supported.

PLAYER_ERROR_VIDEO_RENDER_FAILED 

-8: Invalid renderer.

PLAYER_ERROR_INVALID_STATE 

-9: Error occurs in the internal state of the player.

PLAYER_ERROR_URL_NOT_FOUND 

-10: The URL of the media resource can not be found.

PLAYER_ERROR_INVALID_CONNECTION_STATE 

-11: Invalid connection between the player and Agora's Server.

PLAYER_ERROR_SRC_BUFFER_UNDERFLOW 

-12: The playback buffer is insufficient.

◆ MEDIA_PLAYER_PLAYBACK_SPEED

Report the playback speed.

Enumerator
PLAYBACK_SPEED_ORIGINAL 

100: The original playback speed.

PLAYBACK_SPEED_50_PERCENT 

50: The playback speed is 0.50 times the original speed.

PLAYBACK_SPEED_75_PERCENT 

75: The playback speed is 0.75 times the original speed.

PLAYBACK_SPEED_125_PERCENT 

125: The playback speed is 1.25 times the original speed.

PLAYBACK_SPEED_150_PERCENT 

150: The playback speed is 1.50 times the original speed.

PLAYBACK_SPEED_200_PERCENT 

200: The playback speed is 2.00 times the original speed.

◆ MEDIA_STREAM_TYPE

The type of the media stream.

Enumerator
STREAM_TYPE_UNKNOWN 

0: The type is unknown.

STREAM_TYPE_VIDEO 

1: The video stream.

STREAM_TYPE_AUDIO 

2: The audio stream.

STREAM_TYPE_SUBTITLE 

3: The subtitle stream.

◆ MEDIA_PLAYER_EVENT

The playback event.

Enumerator
PLAYER_EVENT_SEEK_BEGIN 

0: Begins to seek to the new playback position.

PLAYER_EVENT_SEEK_COMPLETE 

1: Finishes seeking to the new playback position.

PLAYER_EVENT_SEEK_ERROR 

2: Error occurs when seeking to the new playback position.

PLAYER_EVENT_AUDIO_TRACK_CHANGED 

5: The audio track used by the player has been changed.

PLAYER_EVENT_BUFFER_LOW 

6: The currently buffered data is not enough to support playback.

PLAYER_EVENT_BUFFER_RECOVER 

7: The currently buffered data is just enough to support playback.

PLAYER_EVENT_SWITCH_BEGIN 

8: Starts switching the media resource

PLAYER_EVENT_SWITCH_COMPLETE 

9: Media resource switching is complete

PLAYER_EVENT_SWITCH_ERROR 

10: Media resource switching error

◆ PLAYER_PRELOAD_EVENT

Preloading events

Enumerator
PLAYER_PRELOAD_EVENT_BEGIN 

Starts preloading media resources

PLAYER_PRELOAD_EVENT_COMPLETE 

Preloading media resources is complete

PLAYER_PRELOAD_EVENT_ERROR 

Media resource preloading error

◆ MEDIA_PLAYER_METADATA_TYPE

The type of the media metadata.

Enumerator
PLAYER_METADATA_TYPE_UNKNOWN 

0: The type is unknown.

PLAYER_METADATA_TYPE_SEI 

1: The type is SEI.

Variable Documentation

◆ kMaxCodecNameLength

const uint8_t agora::media::base::kMaxCodecNameLength = 50
static

The max length (bytes).

◆ kMaxCharBufferLength

const uint8_t agora::media::base::kMaxCharBufferLength = 50
static