mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-03 08:57:32 +08:00
优化音视频同步
This commit is contained in:
@@ -76,8 +76,8 @@ Frame::Ptr Frame::getCacheAbleFrame(const Frame::Ptr &frame){
|
||||
}
|
||||
|
||||
#define SWITCH_CASE(codec_id) case codec_id : return #codec_id
|
||||
const char *CodecInfo::getCodecName() {
|
||||
switch (getCodecId()) {
|
||||
const char *getCodecName(CodecId codecId) {
|
||||
switch (codecId) {
|
||||
SWITCH_CASE(CodecH264);
|
||||
SWITCH_CASE(CodecH265);
|
||||
SWITCH_CASE(CodecAAC);
|
||||
@@ -88,8 +88,8 @@ const char *CodecInfo::getCodecName() {
|
||||
}
|
||||
}
|
||||
|
||||
TrackType CodecInfo::getTrackType(){
|
||||
switch (getCodecId()){
|
||||
TrackType getTrackType(CodecId codecId){
|
||||
switch (codecId){
|
||||
case CodecH264:
|
||||
case CodecH265: return TrackVideo;
|
||||
case CodecAAC:
|
||||
@@ -100,4 +100,11 @@ TrackType CodecInfo::getTrackType(){
|
||||
}
|
||||
}
|
||||
|
||||
const char *CodecInfo::getCodecName() {
|
||||
return mediakit::getCodecName(getCodecId());
|
||||
}
|
||||
|
||||
TrackType CodecInfo::getTrackType() {
|
||||
return mediakit::getTrackType(getCodecId());
|
||||
}
|
||||
}//namespace mediakit
|
||||
|
||||
@@ -40,6 +40,16 @@ typedef enum {
|
||||
TrackMax = 3
|
||||
} TrackType;
|
||||
|
||||
/**
|
||||
* 获取编码器名称
|
||||
*/
|
||||
const char *getCodecName(CodecId codecId);
|
||||
|
||||
/**
|
||||
* 获取音视频类型
|
||||
*/
|
||||
TrackType getTrackType(CodecId codecId);
|
||||
|
||||
/**
|
||||
* 编码信息的抽象接口
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user