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

@@ -20,9 +20,9 @@ namespace mediakit {
class Decoder {
public:
typedef std::shared_ptr<Decoder> Ptr;
typedef std::function<void(int stream, int codecid, int flags, int64_t pts, int64_t dts, const void *data, size_t bytes)> onDecode;
typedef std::function<void(int stream, int codecid, const void *extra, size_t bytes, int finish)> onStream;
using Ptr = std::shared_ptr<Decoder>;
using onDecode = std::function<void(int stream, int codecid, int flags, int64_t pts, int64_t dts, const void *data, size_t bytes)>;
using onStream = std::function<void(int stream, int codecid, const void *extra, size_t bytes, int finish)>;
virtual ssize_t input(const uint8_t *data, size_t bytes) = 0;
void setOnDecode(onDecode cb);
@@ -41,7 +41,7 @@ class DecoderImp{
public:
typedef enum { decoder_ts = 0, decoder_ps } Type;
typedef std::shared_ptr<DecoderImp> Ptr;
using Ptr = std::shared_ptr<DecoderImp>;
~DecoderImp() = default;
static Ptr createDecoder(Type type, MediaSinkInterface *sink);

View File

@@ -16,15 +16,16 @@
#include "Decoder.h"
#include "ProcessInterface.h"
#include "Http/HttpRequestSplitter.h"
// for MediaInfo
#include "Rtsp/RtpCodec.h"
#include "Common/MediaSource.h"
namespace mediakit{
class RtpCodec;
class RtpReceiverImp;
class GB28181Process : public ProcessInterface {
public:
typedef std::shared_ptr<GB28181Process> Ptr;
using Ptr = std::shared_ptr<GB28181Process>;
GB28181Process(const MediaInfo &media_info, MediaSinkInterface *sink);
~GB28181Process() override = default;
@@ -52,7 +53,7 @@ private:
DecoderImp::Ptr _decoder;
MediaSinkInterface *_interface;
std::shared_ptr<FILE> _save_file_ps;
std::unordered_map<uint8_t, std::shared_ptr<RtpCodec> > _rtp_decoder;
std::unordered_map<uint8_t, RtpCodec::Ptr> _rtp_decoder;
std::unordered_map<uint8_t, std::shared_ptr<RtpReceiverImp> > _rtp_receiver;
};

View File

@@ -14,9 +14,10 @@
#if defined(ENABLE_RTPPROXY)
#include "Common/MediaSink.h"
#include "Rtsp/RtpCodec.h"
namespace mediakit {
class RtpCodec;
class RawEncoderImp : public MediaSinkInterface {
public:
RawEncoderImp(uint32_t ssrc, uint8_t payload_type = 96, bool send_audio = true);
@@ -48,7 +49,7 @@ private:
bool _send_audio;
uint8_t _payload_type;
uint32_t _ssrc;
std::shared_ptr<RtpCodec> _rtp_encoder;
RtpCodec::Ptr _rtp_encoder;
};
} // namespace mediakit

View File

@@ -20,7 +20,7 @@ namespace mediakit {
class RtpProcess final : public RtcpContextForRecv, public toolkit::SockInfo, public MediaSinkInterface, public MediaSourceEventInterceptor, public std::enable_shared_from_this<RtpProcess>{
public:
typedef std::shared_ptr<RtpProcess> Ptr;
using Ptr = std::shared_ptr<RtpProcess>;
friend class RtpProcessHelper;
RtpProcess(const std::string &stream_id);
~RtpProcess();

View File

@@ -23,7 +23,7 @@ namespace mediakit{
class RtpSelector;
class RtpProcessHelper : public MediaSourceEvent , public std::enable_shared_from_this<RtpProcessHelper> {
public:
typedef std::shared_ptr<RtpProcessHelper> Ptr;
using Ptr = std::shared_ptr<RtpProcessHelper>;
RtpProcessHelper(const std::string &stream_id, const std::weak_ptr<RtpSelector > &parent);
~RtpProcessHelper();
void attachEvent();

View File

@@ -22,7 +22,7 @@ namespace mediakit{
//rtp发送客户端支持发送GB28181协议
class RtpSender final : public MediaSinkInterface, public std::enable_shared_from_this<RtpSender>{
public:
typedef std::shared_ptr<RtpSender> Ptr;
using Ptr = std::shared_ptr<RtpSender>;
RtpSender(toolkit::EventPoller::Ptr poller = nullptr);
~RtpSender() override;