Header refactor (#2115)

* 优化MultiMediaSourceMuxer头文件包含

* 将MediaSinkDelegate和Demux移到MediaSink中

* MediaSource头文件重构, 独立出PacketCache.h
精简Frame和Track的头文件

* Rtmp头文件重构

* Rtsp头文件重构

* webrtc头文件重构

* 规范.h头文件包含,并将其移到.cpp中:
- 尽量不包含Common\config.h
- Util\File.h
- Rtsp/RtspPlayer.h
- Rtmp/RtmpPlayer.h

* 删除多余的Stamp.h和Base64包含
This commit is contained in:
mtdxc
2022-11-29 11:07:13 +08:00
committed by GitHub
parent 59ecdd13e5
commit 754073918a
127 changed files with 1043 additions and 917 deletions

View File

@@ -13,6 +13,8 @@
#include "Util/util.h"
#include "Util/onceToken.h"
#include "Thread/ThreadPool.h"
#include "Common/Parser.h"
#include "Common/config.h"
using namespace std;
using namespace toolkit;
@@ -127,7 +129,7 @@ void RtmpPusher::onRecv(const Buffer::Ptr &buf){
}
}
inline void RtmpPusher::send_connect() {
void RtmpPusher::send_connect() {
AMFValue obj(AMF_OBJECT);
obj.set("app", _app);
obj.set("type", "nonprivate");
@@ -147,7 +149,7 @@ inline void RtmpPusher::send_connect() {
});
}
inline void RtmpPusher::send_createStream() {
void RtmpPusher::send_createStream() {
AMFValue obj(AMF_NULL);
sendInvoke("createStream", obj);
addOnResultCB([this](AMFDecoder &dec) {
@@ -159,7 +161,7 @@ inline void RtmpPusher::send_createStream() {
}
#define RTMP_STREAM_LIVE "live"
inline void RtmpPusher::send_publish() {
void RtmpPusher::send_publish() {
AMFEncoder enc;
enc << "publish" << ++_send_req_id << nullptr << _stream_id << RTMP_STREAM_LIVE;
sendRequest(MSG_CMD, enc.data());
@@ -175,7 +177,7 @@ inline void RtmpPusher::send_publish() {
});
}
inline void RtmpPusher::send_metaData(){
void RtmpPusher::send_metaData(){
auto src = _publish_src.lock();
if (!src) {
throw std::runtime_error("the media source was released");