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

@@ -21,7 +21,7 @@ namespace mediakit{
*/
class AACRtmpDecoder : public RtmpCodec{
public:
typedef std::shared_ptr<AACRtmpDecoder> Ptr;
using Ptr = std::shared_ptr<AACRtmpDecoder>;
AACRtmpDecoder() {}
~AACRtmpDecoder() {}
@@ -49,7 +49,7 @@ private:
*/
class AACRtmpEncoder : public AACRtmpDecoder{
public:
typedef std::shared_ptr<AACRtmpEncoder> Ptr;
using Ptr = std::shared_ptr<AACRtmpEncoder>;
/**
* 构造函数track可以为空此时则在inputFrame时输入adts头

View File

@@ -19,7 +19,7 @@ namespace mediakit{
*/
class AACRtpDecoder : public RtpCodec {
public:
typedef std::shared_ptr<AACRtpDecoder> Ptr;
using Ptr = std::shared_ptr<AACRtpDecoder>;
AACRtpDecoder(const Track::Ptr &track);
~AACRtpDecoder() {}
@@ -54,7 +54,7 @@ private:
*/
class AACRtpEncoder : public AACRtpDecoder , public RtpInfo {
public:
typedef std::shared_ptr<AACRtpEncoder> Ptr;
using Ptr = std::shared_ptr<AACRtpEncoder>;
/**
* @param ui32Ssrc ssrc

View File

@@ -21,7 +21,7 @@ namespace mediakit{
*/
class CommonRtmpDecoder : public RtmpCodec {
public:
typedef std::shared_ptr<CommonRtmpDecoder> Ptr;
using Ptr = std::shared_ptr<CommonRtmpDecoder>;
~CommonRtmpDecoder() override {}
@@ -55,7 +55,7 @@ private:
*/
class CommonRtmpEncoder : public CommonRtmpDecoder {
public:
typedef std::shared_ptr<CommonRtmpEncoder> Ptr;
using Ptr = std::shared_ptr<CommonRtmpEncoder>;
CommonRtmpEncoder(const Track::Ptr &track);
~CommonRtmpEncoder() override{}

View File

@@ -21,7 +21,7 @@ namespace mediakit{
*/
class CommonRtpDecoder : public RtpCodec {
public:
typedef std::shared_ptr <CommonRtpDecoder> Ptr;
using Ptr = std::shared_ptr <CommonRtpDecoder>;
~CommonRtpDecoder() override {}
@@ -60,7 +60,7 @@ private:
*/
class CommonRtpEncoder : public CommonRtpDecoder, public RtpInfo {
public:
typedef std::shared_ptr <CommonRtpEncoder> Ptr;
using Ptr = std::shared_ptr <CommonRtpEncoder>;
~CommonRtpEncoder() override {}

View File

@@ -80,7 +80,7 @@ TrackType getTrackType(CodecId codecId);
*/
class CodecInfo {
public:
typedef std::shared_ptr<CodecInfo> Ptr;
using Ptr = std::shared_ptr<CodecInfo>;
CodecInfo() = default;
virtual ~CodecInfo() = default;
@@ -226,7 +226,7 @@ protected:
template <typename Parent>
class FrameInternal : public Parent {
public:
typedef std::shared_ptr<FrameInternal> Ptr;
using Ptr = std::shared_ptr<FrameInternal>;
FrameInternal(const Frame::Ptr &parent_frame, char *ptr, size_t size, size_t prefix_size)
: Parent(ptr, size, parent_frame->dts(), parent_frame->pts(), prefix_size) {
_parent_frame = parent_frame;
@@ -246,7 +246,7 @@ private:
template <typename Parent>
class FrameTSInternal : public Parent {
public:
typedef std::shared_ptr<FrameTSInternal> Ptr;
using Ptr = std::shared_ptr<FrameTSInternal>;
FrameTSInternal(
const Frame::Ptr &parent_frame, char *ptr, size_t size, size_t prefix_size, uint64_t dts, uint64_t pts)
: Parent(ptr, size, dts, pts, prefix_size) {
@@ -263,7 +263,7 @@ private:
*/
class FrameWriterInterface {
public:
typedef std::shared_ptr<FrameWriterInterface> Ptr;
using Ptr = std::shared_ptr<FrameWriterInterface>;
FrameWriterInterface() = default;
virtual ~FrameWriterInterface() = default;
@@ -342,7 +342,7 @@ private:
*/
class FrameFromPtr : public Frame {
public:
typedef std::shared_ptr<FrameFromPtr> Ptr;
using Ptr = std::shared_ptr<FrameFromPtr>;
FrameFromPtr(
CodecId codec_id, char *ptr, size_t size, uint64_t dts, uint64_t pts = 0, size_t prefix_size = 0,
@@ -395,7 +395,7 @@ protected:
*/
class FrameCacheAble : public FrameFromPtr {
public:
typedef std::shared_ptr<FrameCacheAble> Ptr;
using Ptr = std::shared_ptr<FrameCacheAble>;
FrameCacheAble(const Frame::Ptr &frame, bool force_key_frame = false) {
if (frame->cacheAble()) {

View File

@@ -22,7 +22,7 @@ namespace mediakit{
*/
class H264RtmpDecoder : public RtmpCodec {
public:
typedef std::shared_ptr<H264RtmpDecoder> Ptr;
using Ptr = std::shared_ptr<H264RtmpDecoder>;
H264RtmpDecoder();
~H264RtmpDecoder() {}
@@ -52,7 +52,7 @@ protected:
*/
class H264RtmpEncoder : public H264RtmpDecoder{
public:
typedef std::shared_ptr<H264RtmpEncoder> Ptr;
using Ptr = std::shared_ptr<H264RtmpEncoder>;
/**
* 构造函数track可以为空此时则在inputFrame时输入sps pps

View File

@@ -25,7 +25,7 @@ namespace mediakit{
*/
class H264RtpDecoder : public RtpCodec{
public:
typedef std::shared_ptr<H264RtpDecoder> Ptr;
using Ptr = std::shared_ptr<H264RtpDecoder>;
H264RtpDecoder();
~H264RtpDecoder() {}
@@ -63,7 +63,7 @@ private:
*/
class H264RtpEncoder : public H264RtpDecoder ,public RtpInfo{
public:
typedef std::shared_ptr<H264RtpEncoder> Ptr;
using Ptr = std::shared_ptr<H264RtpEncoder>;
/**
* @param ssrc ssrc

View File

@@ -22,7 +22,7 @@ namespace mediakit{
*/
class H265RtmpDecoder : public RtmpCodec {
public:
typedef std::shared_ptr<H265RtmpDecoder> Ptr;
using Ptr = std::shared_ptr<H265RtmpDecoder>;
H265RtmpDecoder();
~H265RtmpDecoder() {}
@@ -50,7 +50,7 @@ protected:
*/
class H265RtmpEncoder : public H265RtmpDecoder{
public:
typedef std::shared_ptr<H265RtmpEncoder> Ptr;
using Ptr = std::shared_ptr<H265RtmpEncoder>;
/**
* 构造函数track可以为空此时则在inputFrame时输入sps pps

View File

@@ -25,7 +25,7 @@ namespace mediakit{
*/
class H265RtpDecoder : public RtpCodec {
public:
typedef std::shared_ptr<H265RtpDecoder> Ptr;
using Ptr = std::shared_ptr<H265RtpDecoder>;
H265RtpDecoder();
~H265RtpDecoder() {}
@@ -64,7 +64,7 @@ private:
*/
class H265RtpEncoder : public H265RtpDecoder ,public RtpInfo{
public:
typedef std::shared_ptr<H265RtpEncoder> Ptr;
using Ptr = std::shared_ptr<H265RtpEncoder>;
/**
* @param ui32Ssrc ssrc

View File

@@ -21,7 +21,7 @@ namespace mediakit{
*/
class OpusTrack : public AudioTrackImp{
public:
typedef std::shared_ptr<OpusTrack> Ptr;
using Ptr = std::shared_ptr<OpusTrack>;
OpusTrack() : AudioTrackImp(CodecOpus,48000,2,16){}
private:

View File

@@ -23,7 +23,7 @@ namespace mediakit{
*/
class Track : public FrameDispatcher , public CodecInfo{
public:
typedef std::shared_ptr<Track> Ptr;
using Ptr = std::shared_ptr<Track>;
Track(){}
virtual ~Track(){}
@@ -75,7 +75,7 @@ private:
*/
class VideoTrack : public Track {
public:
typedef std::shared_ptr<VideoTrack> Ptr;
using Ptr = std::shared_ptr<VideoTrack>;
/**
* 返回视频高度
@@ -98,7 +98,7 @@ public:
*/
class AudioTrack : public Track {
public:
typedef std::shared_ptr<AudioTrack> Ptr;
using Ptr = std::shared_ptr<AudioTrack>;
/**
* 返回音频采样率
@@ -118,7 +118,7 @@ public:
class AudioTrackImp : public AudioTrack{
public:
typedef std::shared_ptr<AudioTrackImp> Ptr;
using Ptr = std::shared_ptr<AudioTrackImp>;
/**
* 构造函数