Frame.cpp 972 Bytes
Newer Older
1
/*
xiongziliang committed
2
 * Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
3 4 5
 *
 * This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
 *
xiongziliang committed
6 7 8
 * 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.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
 */

#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);
}

25
#define SWITCH_CASE(codec_id) case codec_id : return #codec_id
xiongziliang committed
26
const char *CodecInfo::getCodecName() {
27 28 29 30 31 32 33 34 35
    switch (getCodecId()) {
        SWITCH_CASE(CodecH264);
        SWITCH_CASE(CodecH265);
        SWITCH_CASE(CodecAAC);
        default:
            return "unknown codec";
    }
}

36 37
}//namespace mediakit