diff --git a/platform/Apple/source/CicadaDef.h b/platform/Apple/source/CicadaDef.h index ea25a1320..050985212 100644 --- a/platform/Apple/source/CicadaDef.h +++ b/platform/Apple/source/CicadaDef.h @@ -156,6 +156,16 @@ typedef enum CicadaPropertyKey: NSUInteger { CICADA_KEY_CONNECT_INFO = 1, } CicadaPropertyKey; +typedef enum CicadaOption: NSUInteger { + /** + * @brief 渲染的fps。类型为Float + */ + /**** + * @brief render fps. Return value type is Float + */ + CICADA_OPTION_RENDER_FPS = 0, +} CicadaOption; + /** @brief CicadaErrorModel为播放错误信息描述 */ diff --git a/platform/Apple/source/CicadaPlayer.h b/platform/Apple/source/CicadaPlayer.h index 4f97f3df8..41f5ed585 100644 --- a/platform/Apple/source/CicadaPlayer.h +++ b/platform/Apple/source/CicadaPlayer.h @@ -285,6 +285,20 @@ OBJC_EXPORT */ -(void) setDefaultBandWidth:(int)bandWidth; +/** + * @brief 获取播放器的参数 + * + * @param key 参数值 + * @return 相关信息 + */ +/**** + * @brief Get player information + * + * @param key The key + * @return The information + */ +-(NSString *) getOption:(CicadaOption)key; + /** @brief 获取SDK版本号信息 */ diff --git a/platform/Apple/source/CicadaPlayer.mm b/platform/Apple/source/CicadaPlayer.mm index 0ed83bcbc..8dbc2a625 100644 --- a/platform/Apple/source/CicadaPlayer.mm +++ b/platform/Apple/source/CicadaPlayer.mm @@ -835,6 +835,25 @@ -(void) setDefaultBandWidth:(int)bandWidth } } +-(NSString *) getOption:(CicadaOption)key +{ + if (nullptr == self.player) { + return @""; + } + + char value[256] = {0}; + + switch (key) { + case CICADA_OPTION_RENDER_FPS: + self.player->GetOption("renderFps", value); + break; + default: + break; + } + + return [NSString stringWithUTF8String:value]; +} + + (NSString *) getSDKVersion { string version = MediaPlayer::GetSdkVersion();