ZLMediaKit/src/Extension/Frame.cpp

38 lines
972 B
C++
Raw Normal View History

/*
2020-04-04 20:30:09 +08:00
* Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
*
* 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.
*/
#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";
}
}
}//namespace mediakit