Unified code style (#2137)

This commit is contained in:
老衲不出家
2022-12-02 14:43:06 +08:00
committed by GitHub
parent a12b7c8021
commit f05a9501fa
62 changed files with 166 additions and 149 deletions

View File

@@ -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);

View File

@@ -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() {};

View File

@@ -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 */

View File

@@ -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;
};

View File

@@ -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,

View File

@@ -20,7 +20,7 @@ namespace mediakit{
class RtmpMuxer : public MediaSinkInterface {
public:
typedef std::shared_ptr<RtmpMuxer> Ptr;
using Ptr = std::shared_ptr<RtmpMuxer>;
/**
* 构造函数

View File

@@ -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;

View File

@@ -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;
};

View File

@@ -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;