添加MIT协议,完善代码

This commit is contained in:
xiongziliang
2018-10-25 10:00:17 +08:00
parent d70d9bca21
commit b3f3c854f0
26 changed files with 625 additions and 105 deletions

View File

@@ -1,6 +1,28 @@
//
// Created by xzl on 2018/10/24.
//
/*
* MIT License
*
* Copyright (c) 2016 xiongziliang <771730766@qq.com>
*
* This file is part of ZLMediaKit(https://github.com/xiongziliang/ZLMediaKit).
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include "Factory.h"
#include "RtmpMuxer/H264RtmpCodec.h"
@@ -99,6 +121,7 @@ CodecId Factory::getCodecIdByAmf(const AMFValue &val){
if(str == "mp4a"){
return CodecAAC;
}
WarnL << "暂不支持该Amf:" << str;
return CodecInvalid;
}
@@ -112,9 +135,11 @@ CodecId Factory::getCodecIdByAmf(const AMFValue &val){
return CodecAAC;
}
default:
WarnL << "暂不支持该Amf:" << type_id;
return CodecInvalid;
}
}
WarnL << "暂不支持该Amf:" << val.type();
return CodecInvalid;
}
@@ -136,7 +161,6 @@ Track::Ptr Factory::getTrackByCodecId(CodecId codecId) {
Track::Ptr Factory::getTrackByAmf(const AMFValue &amf) {
CodecId codecId = getCodecIdByAmf(amf);
if(codecId == CodecInvalid){
WarnL << "暂不支持该Amf:" << amf.type();
return nullptr;
}
return getTrackByCodecId(codecId);