mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-07-03 08:57:32 +08:00
Unified code style (#2137)
This commit is contained in:
@@ -205,7 +205,7 @@ private:
|
||||
*/
|
||||
class Metadata : public CodecInfo{
|
||||
public:
|
||||
typedef std::shared_ptr<Metadata> Ptr;
|
||||
using Ptr = std::shared_ptr<Metadata>;
|
||||
|
||||
Metadata():_metadata(AMF_OBJECT){}
|
||||
virtual ~Metadata(){}
|
||||
@@ -223,7 +223,7 @@ protected:
|
||||
*/
|
||||
class TitleMeta : public Metadata{
|
||||
public:
|
||||
typedef std::shared_ptr<TitleMeta> Ptr;
|
||||
using Ptr = std::shared_ptr<TitleMeta>;
|
||||
|
||||
TitleMeta(float dur_sec = 0,
|
||||
size_t fileSize = 0,
|
||||
@@ -236,7 +236,7 @@ public:
|
||||
|
||||
class VideoMeta : public Metadata{
|
||||
public:
|
||||
typedef std::shared_ptr<VideoMeta> Ptr;
|
||||
using Ptr = std::shared_ptr<VideoMeta>;
|
||||
|
||||
VideoMeta(const VideoTrack::Ptr &video);
|
||||
virtual ~VideoMeta(){}
|
||||
@@ -250,7 +250,7 @@ private:
|
||||
|
||||
class AudioMeta : public Metadata{
|
||||
public:
|
||||
typedef std::shared_ptr<AudioMeta> Ptr;
|
||||
using Ptr = std::shared_ptr<AudioMeta>;
|
||||
|
||||
AudioMeta(const AudioTrack::Ptr &audio);
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ protected:
|
||||
|
||||
class RtmpCodec : public RtmpRing, public FrameDispatcher, public CodecInfo {
|
||||
public:
|
||||
typedef std::shared_ptr<RtmpCodec> Ptr;
|
||||
using Ptr = std::shared_ptr<RtmpCodec>;
|
||||
RtmpCodec() = default;
|
||||
~RtmpCodec() override = default;
|
||||
virtual void makeConfigPacket() {};
|
||||
|
||||
@@ -16,9 +16,10 @@
|
||||
#include "Rtmp/amf.h"
|
||||
#include "Rtmp/Rtmp.h"
|
||||
#include "Common/MediaSink.h"
|
||||
#include "RtmpCodec.h"
|
||||
|
||||
namespace mediakit {
|
||||
class RtmpCodec;
|
||||
|
||||
class RtmpDemuxer : public Demuxer {
|
||||
public:
|
||||
using Ptr = std::shared_ptr<RtmpDemuxer>;
|
||||
@@ -52,8 +53,8 @@ private:
|
||||
float _duration = 0;
|
||||
AudioTrack::Ptr _audio_track;
|
||||
VideoTrack::Ptr _video_track;
|
||||
std::shared_ptr<RtmpCodec> _audio_rtmp_decoder;
|
||||
std::shared_ptr<RtmpCodec> _video_rtmp_decoder;
|
||||
RtmpCodec::Ptr _audio_rtmp_decoder;
|
||||
RtmpCodec::Ptr _video_rtmp_decoder;
|
||||
};
|
||||
|
||||
} /* namespace mediakit */
|
||||
|
||||
@@ -18,11 +18,12 @@
|
||||
#include <unordered_map>
|
||||
#include "amf.h"
|
||||
#include "Rtmp.h"
|
||||
#include "RtmpDemuxer.h"
|
||||
#include "RtmpMediaSource.h"
|
||||
#include "Common/MultiMediaSourceMuxer.h"
|
||||
|
||||
namespace mediakit {
|
||||
class RtmpDemuxer;
|
||||
|
||||
class RtmpMediaSourceImp final : public RtmpMediaSource, private TrackListener, public MultiMediaSourceMuxer::Listener {
|
||||
public:
|
||||
using Ptr = std::shared_ptr<RtmpMediaSourceImp>;
|
||||
@@ -90,7 +91,7 @@ private:
|
||||
bool _recreate_metadata = false;
|
||||
ProtocolOption _option;
|
||||
AMFValue _metadata;
|
||||
std::shared_ptr<RtmpDemuxer> _demuxer;
|
||||
RtmpDemuxer::Ptr _demuxer;
|
||||
MultiMediaSourceMuxer::Ptr _muxer;
|
||||
|
||||
};
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace mediakit {
|
||||
class RtmpMediaSourceMuxer final : public RtmpMuxer, public MediaSourceEventInterceptor,
|
||||
public std::enable_shared_from_this<RtmpMediaSourceMuxer> {
|
||||
public:
|
||||
typedef std::shared_ptr<RtmpMediaSourceMuxer> Ptr;
|
||||
using Ptr = std::shared_ptr<RtmpMediaSourceMuxer>;
|
||||
|
||||
RtmpMediaSourceMuxer(const std::string &vhost,
|
||||
const std::string &strApp,
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace mediakit{
|
||||
|
||||
class RtmpMuxer : public MediaSinkInterface {
|
||||
public:
|
||||
typedef std::shared_ptr<RtmpMuxer> Ptr;
|
||||
using Ptr = std::shared_ptr<RtmpMuxer>;
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace mediakit {
|
||||
//实现了rtmp播放器协议部分的功能,及数据接收功能
|
||||
class RtmpPlayer : public PlayerBase, public toolkit::TcpClient, public RtmpProtocol {
|
||||
public:
|
||||
typedef std::shared_ptr<RtmpPlayer> Ptr;
|
||||
using Ptr = std::shared_ptr<RtmpPlayer>;
|
||||
RtmpPlayer(const toolkit::EventPoller::Ptr &poller);
|
||||
~RtmpPlayer() override;
|
||||
|
||||
|
||||
@@ -14,10 +14,11 @@
|
||||
#include <memory>
|
||||
#include <functional>
|
||||
#include "RtmpPlayer.h"
|
||||
#include "RtmpDemuxer.h"
|
||||
#include "RtmpMediaSource.h"
|
||||
|
||||
namespace mediakit {
|
||||
class RtmpDemuxer;
|
||||
|
||||
class RtmpPlayerImp: public PlayerImp<RtmpPlayer,PlayerBase>, private TrackListener {
|
||||
public:
|
||||
using Ptr = std::shared_ptr<RtmpPlayerImp>;
|
||||
@@ -76,7 +77,7 @@ private:
|
||||
|
||||
private:
|
||||
bool _wait_track_ready = true;
|
||||
std::shared_ptr<RtmpDemuxer> _demuxer;
|
||||
RtmpDemuxer::Ptr _demuxer;
|
||||
RtmpMediaSource::Ptr _rtmp_src;
|
||||
};
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace mediakit {
|
||||
|
||||
class RtmpPusher : public RtmpProtocol, public toolkit::TcpClient, public PusherBase {
|
||||
public:
|
||||
typedef std::shared_ptr<RtmpPusher> Ptr;
|
||||
using Ptr = std::shared_ptr<RtmpPusher>;
|
||||
RtmpPusher(const toolkit::EventPoller::Ptr &poller,const RtmpMediaSource::Ptr &src);
|
||||
~RtmpPusher() override;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user