mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-26 03:42:21 +08:00
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:
@@ -22,7 +22,9 @@
|
||||
#include "Opus.h"
|
||||
#include "G711.h"
|
||||
#include "L16.h"
|
||||
#include "Util/base64.h"
|
||||
#include "Common/Parser.h"
|
||||
#include "Common/config.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
#include "H264.h"
|
||||
#include "H265.h"
|
||||
#include "Common/Parser.h"
|
||||
#include "Common/Stamp.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace toolkit;
|
||||
|
||||
@@ -29,6 +31,13 @@ Frame::Ptr Frame::getCacheAbleFrame(const Frame::Ptr &frame){
|
||||
return std::make_shared<FrameCacheAble>(frame);
|
||||
}
|
||||
|
||||
FrameStamp::FrameStamp(Frame::Ptr frame, Stamp &stamp, bool modify_stamp)
|
||||
{
|
||||
_frame = std::move(frame);
|
||||
//覆盖时间戳
|
||||
stamp.revise(_frame->dts(), _frame->pts(), _dts, _pts, modify_stamp);
|
||||
}
|
||||
|
||||
TrackType getTrackType(CodecId codecId) {
|
||||
switch (codecId) {
|
||||
#define XX(name, type, value, str, mpeg_id) case name : return type;
|
||||
|
||||
@@ -11,14 +11,14 @@
|
||||
#ifndef ZLMEDIAKIT_FRAME_H
|
||||
#define ZLMEDIAKIT_FRAME_H
|
||||
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <functional>
|
||||
#include "Util/RingBuffer.h"
|
||||
#include "Network/Socket.h"
|
||||
#include "Common/Stamp.h"
|
||||
#include "Util/List.h"
|
||||
#include "Network/Buffer.h"
|
||||
|
||||
namespace mediakit {
|
||||
|
||||
class Stamp;
|
||||
typedef enum {
|
||||
TrackInvalid = -1,
|
||||
TrackVideo = 0,
|
||||
@@ -441,11 +441,7 @@ private:
|
||||
class FrameStamp : public Frame {
|
||||
public:
|
||||
using Ptr = std::shared_ptr<FrameStamp>;
|
||||
FrameStamp(Frame::Ptr frame, Stamp &stamp, bool modify_stamp) {
|
||||
_frame = std::move(frame);
|
||||
//覆盖时间戳
|
||||
stamp.revise(_frame->dts(), _frame->pts(), _dts, _pts, modify_stamp);
|
||||
}
|
||||
FrameStamp(Frame::Ptr frame, Stamp &stamp, bool modify_stamp);
|
||||
~FrameStamp() override {}
|
||||
|
||||
uint64_t dts() const override { return (uint64_t)_dts; }
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
#include "H264.h"
|
||||
#include "SPSParser.h"
|
||||
#include "Util/logger.h"
|
||||
#include "Util/base64.h"
|
||||
|
||||
using namespace toolkit;
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
|
||||
#include "Frame.h"
|
||||
#include "Track.h"
|
||||
#include "Util/base64.h"
|
||||
|
||||
#define H264_TYPE(v) ((uint8_t)(v) & 0x1F)
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
|
||||
#include "Rtmp/RtmpCodec.h"
|
||||
#include "Extension/Track.h"
|
||||
#include "Util/ResourcePool.h"
|
||||
#include "Extension/H264.h"
|
||||
|
||||
namespace mediakit{
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
|
||||
#include "H264Rtp.h"
|
||||
#include "Common/config.h"
|
||||
|
||||
namespace mediakit{
|
||||
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
#define ZLMEDIAKIT_H264RTPCODEC_H
|
||||
|
||||
#include "Rtsp/RtpCodec.h"
|
||||
#include "Util/ResourcePool.h"
|
||||
#include "Extension/H264.h"
|
||||
// for DtsGenerator
|
||||
#include "Common/Stamp.h"
|
||||
|
||||
namespace mediakit{
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include "H265.h"
|
||||
#include "SPSParser.h"
|
||||
#include "Util/base64.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace toolkit;
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
|
||||
#include "Frame.h"
|
||||
#include "Track.h"
|
||||
#include "Util/base64.h"
|
||||
#include "H264.h"
|
||||
|
||||
#define H265_TYPE(v) (((uint8_t)(v) >> 1) & 0x3f)
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
|
||||
#include "Rtmp/RtmpCodec.h"
|
||||
#include "Extension/Track.h"
|
||||
#include "Util/ResourcePool.h"
|
||||
#include "Extension/H265.h"
|
||||
|
||||
namespace mediakit{
|
||||
|
||||
@@ -12,8 +12,8 @@
|
||||
#define ZLMEDIAKIT_H265RTPCODEC_H
|
||||
|
||||
#include "Rtsp/RtpCodec.h"
|
||||
#include "Util/ResourcePool.h"
|
||||
#include "Extension/H265.h"
|
||||
// for DtsGenerator
|
||||
#include "Common/Stamp.h"
|
||||
|
||||
namespace mediakit{
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include "Frame.h"
|
||||
#include "Util/RingBuffer.h"
|
||||
#include "Rtsp/Rtsp.h"
|
||||
|
||||
namespace mediakit{
|
||||
|
||||
Reference in New Issue
Block a user