mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-13 03:31:45 +08:00
增加rtmp/rtsp对音频G711A,G711U的支持
This commit is contained in:
@@ -105,6 +105,12 @@ API_EXPORT void API_CALL mk_player_set_on_shutdown(mk_player ctx, on_mk_play_eve
|
||||
*/
|
||||
API_EXPORT void API_CALL mk_player_set_on_data(mk_player ctx, on_mk_play_data cb, void *user_data);
|
||||
|
||||
/**
|
||||
* 获取视频codec_id -1:不存在 0:H264,1:H265,2:AAC 3.G711A 4.G711U
|
||||
* @param ctx 播放器指针
|
||||
*/
|
||||
API_EXPORT int API_CALL mk_player_video_codecId(mk_player ctx);
|
||||
|
||||
/**
|
||||
* 获取视频宽度
|
||||
*/
|
||||
@@ -120,6 +126,12 @@ API_EXPORT int API_CALL mk_player_video_height(mk_player ctx);
|
||||
*/
|
||||
API_EXPORT int API_CALL mk_player_video_fps(mk_player ctx);
|
||||
|
||||
/**
|
||||
* 获取音频codec_id -1:不存在 0:H264,1:H265,2:AAC 3.G711A 4.G711U
|
||||
* @param ctx 播放器指针
|
||||
*/
|
||||
API_EXPORT int API_CALL mk_player_audio_codecId(mk_player ctx);
|
||||
|
||||
/**
|
||||
* 获取音频采样率
|
||||
*/
|
||||
|
||||
@@ -101,6 +101,15 @@ API_EXPORT void API_CALL mk_player_set_on_data(mk_player ctx, on_mk_play_data cb
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
API_EXPORT int API_CALL mk_player_video_codecId(mk_player ctx)
|
||||
{
|
||||
assert(ctx);
|
||||
MediaPlayer::Ptr& player = *((MediaPlayer::Ptr*)ctx);
|
||||
auto track = dynamic_pointer_cast<VideoTrack>(player->getTrack(TrackVideo));
|
||||
return track ? track->getCodecId() : CodecInvalid;
|
||||
}
|
||||
|
||||
API_EXPORT int API_CALL mk_player_video_width(mk_player ctx) {
|
||||
assert(ctx);
|
||||
MediaPlayer::Ptr &player = *((MediaPlayer::Ptr *)ctx);
|
||||
@@ -122,6 +131,15 @@ API_EXPORT int API_CALL mk_player_video_fps(mk_player ctx) {
|
||||
return track ? track->getVideoFps() : 0;
|
||||
}
|
||||
|
||||
|
||||
API_EXPORT int API_CALL mk_player_audio_codecId(mk_player ctx)
|
||||
{
|
||||
assert(ctx);
|
||||
MediaPlayer::Ptr& player = *((MediaPlayer::Ptr*)ctx);
|
||||
auto track = dynamic_pointer_cast<AudioTrack>(player->getTrack(TrackAudio));
|
||||
return track ? track->getCodecId() : CodecInvalid;
|
||||
}
|
||||
|
||||
API_EXPORT int API_CALL mk_player_audio_samplerate(mk_player ctx) {
|
||||
assert(ctx);
|
||||
MediaPlayer::Ptr &player = *((MediaPlayer::Ptr *)ctx);
|
||||
|
||||
Reference in New Issue
Block a user