2019-07-24 18:40:18 +08:00
|
|
|
|
/*
|
2020-04-04 20:30:09 +08:00
|
|
|
|
* Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
|
2019-07-24 18:40:18 +08:00
|
|
|
|
*
|
|
|
|
|
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
|
|
|
|
|
*
|
2020-04-04 20:30:09 +08:00
|
|
|
|
* Use of this source code is governed by MIT license that can be found in the
|
|
|
|
|
* LICENSE file in the root of the source tree. All contributing project authors
|
|
|
|
|
* may be found in the AUTHORS file in the root of the source tree.
|
2019-07-24 18:40:18 +08:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "Frame.h"
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
using namespace toolkit;
|
|
|
|
|
|
|
|
|
|
namespace mediakit{
|
|
|
|
|
|
|
|
|
|
Frame::Ptr Frame::getCacheAbleFrame(const Frame::Ptr &frame){
|
|
|
|
|
if(frame->cacheAble()){
|
|
|
|
|
return frame;
|
|
|
|
|
}
|
|
|
|
|
return std::make_shared<FrameCacheAble>(frame);
|
|
|
|
|
}
|
|
|
|
|
|
2020-03-08 21:19:20 +08:00
|
|
|
|
#define SWITCH_CASE(codec_id) case codec_id : return #codec_id
|
2020-03-09 16:04:34 +08:00
|
|
|
|
const char *CodecInfo::getCodecName() {
|
2020-03-08 21:19:20 +08:00
|
|
|
|
switch (getCodecId()) {
|
|
|
|
|
SWITCH_CASE(CodecH264);
|
|
|
|
|
SWITCH_CASE(CodecH265);
|
|
|
|
|
SWITCH_CASE(CodecAAC);
|
|
|
|
|
default:
|
|
|
|
|
return "unknown codec";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-07-24 18:40:18 +08:00
|
|
|
|
}//namespace mediakit
|
|
|
|
|
|