public class DefaultResolutionModify extends java.lang.Object implements IResolutionModify
| Modifier and Type | Field and Description |
|---|---|
protected int |
mConfigCodeRate |
protected int |
mConfigFrameRate |
protected int |
mCurrentFrameRate |
protected int |
mIdx |
protected long |
mLastTimestampNanos |
protected java.util.List<ResolutionModifyConfig> |
mModifyConfigList |
protected int |
mNetworkCodeRate |
protected long |
mResolutionChangeInterval |
protected ResolutionModifyListener |
mResolutionModifyListener |
protected static long |
ONE_SECOND |
static java.lang.String |
TAG |
| Constructor and Description |
|---|
DefaultResolutionModify() |
| Modifier and Type | Method and Description |
|---|---|
protected int |
findBestConfigIdx(int networkCodeRate,
boolean isPlus,
int idx) |
protected ResolutionModifyConfig |
findConfigFromIdx(int idx) |
protected int |
findConfigIdx(int width,
int height,
int codeRate) |
long |
getLastTimestampNanos() |
void |
init(int configFrameRate,
int configCodeRate,
int width,
int height,
int resolutionChangeInterval,
java.util.List<ResolutionModifyConfig> modifyConfigList,
ResolutionModifyListener listener)
第一次编码的时候调用,后面改变分辨率后不能再调用
|
protected void |
notifyToListener(int idx,
int currentCodeRate) |
void |
publishCurrentFrameRate(int currentFrameRate)
当前帧率更新时调用
|
void |
publishNetworkCodeRate(int networkCodeRate)
网络码率通知时调用
|
void |
release()
开播结束/切换开播清晰度时调用
|
void |
setLastTimestampNanos() |
public static final java.lang.String TAG
protected static final long ONE_SECOND
protected long mLastTimestampNanos
protected int mConfigFrameRate
protected int mConfigCodeRate
protected int mCurrentFrameRate
protected int mNetworkCodeRate
protected int mIdx
protected long mResolutionChangeInterval
protected java.util.List<ResolutionModifyConfig> mModifyConfigList
protected ResolutionModifyListener mResolutionModifyListener
public void init(int configFrameRate,
int configCodeRate,
int width,
int height,
int resolutionChangeInterval,
java.util.List<ResolutionModifyConfig> modifyConfigList,
ResolutionModifyListener listener)
throws ResolutionModifyNotFoundException
configFrameRate - configCodeRate - width - height - resolutionChangeInterval - 分辨率切换的间隔时间,单位秒,如1秒modifyConfigList - 分辨率变更配置listener - ResolutionModifyNotFoundExceptionpublic void publishNetworkCodeRate(int networkCodeRate)
IResolutionModifypublishNetworkCodeRate in interface IResolutionModifyprotected void notifyToListener(int idx,
int currentCodeRate)
public void publishCurrentFrameRate(int currentFrameRate)
IResolutionModifypublishCurrentFrameRate in interface IResolutionModifyprotected int findBestConfigIdx(int networkCodeRate,
boolean isPlus,
int idx)
networkCodeRate - isPlus - idx - protected ResolutionModifyConfig findConfigFromIdx(int idx)
protected int findConfigIdx(int width,
int height,
int codeRate)
throws ResolutionModifyNotFoundException
public void release()
IResolutionModifyrelease in interface IResolutionModifypublic long getLastTimestampNanos()
public void setLastTimestampNanos()