mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-30 23:02:24 +08:00
release 8.0
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
|
||||
* Copyright (c) 2016-present The ZLMediaKit project authors. All Rights Reserved.
|
||||
*
|
||||
* This file is part of ZLMediaKit(https://github.com/xia-chu/ZLMediaKit).
|
||||
* This file is part of ZLMediaKit(https://github.com/ZLMediaKit/ZLMediaKit).
|
||||
*
|
||||
* Use of this source code is governed by MIT license that can be found in the
|
||||
* Use of this source code is governed by MIT-like license that can be found in the
|
||||
* LICENSE file in the root of the source tree. All contributing project authors
|
||||
* may be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
@@ -21,8 +21,7 @@ class AACRtpDecoder : public RtpCodec {
|
||||
public:
|
||||
using Ptr = std::shared_ptr<AACRtpDecoder>;
|
||||
|
||||
AACRtpDecoder(const Track::Ptr &track);
|
||||
~AACRtpDecoder() {}
|
||||
AACRtpDecoder();
|
||||
|
||||
/**
|
||||
* 输入rtp并解码
|
||||
@@ -31,20 +30,12 @@ public:
|
||||
*/
|
||||
bool inputRtp(const RtpPacket::Ptr &rtp, bool key_pos = false) override;
|
||||
|
||||
CodecId getCodecId() const override {
|
||||
return CodecAAC;
|
||||
}
|
||||
|
||||
protected:
|
||||
AACRtpDecoder();
|
||||
|
||||
private:
|
||||
void obtainFrame();
|
||||
void flushData();
|
||||
|
||||
private:
|
||||
uint64_t _last_dts = 0;
|
||||
std::string _aac_cfg;
|
||||
FrameImp::Ptr _frame;
|
||||
};
|
||||
|
||||
@@ -52,24 +43,10 @@ private:
|
||||
/**
|
||||
* aac adts转rtp类
|
||||
*/
|
||||
class AACRtpEncoder : public AACRtpDecoder , public RtpInfo {
|
||||
class AACRtpEncoder : public RtpCodec {
|
||||
public:
|
||||
using Ptr = std::shared_ptr<AACRtpEncoder>;
|
||||
|
||||
/**
|
||||
* @param ui32Ssrc ssrc
|
||||
* @param ui32MtuSize mtu 大小
|
||||
* @param ui32SampleRate 采样率
|
||||
* @param ui8PayloadType pt类型
|
||||
* @param ui8Interleaved rtsp interleaved 值
|
||||
*/
|
||||
AACRtpEncoder(uint32_t ui32Ssrc,
|
||||
uint32_t ui32MtuSize,
|
||||
uint32_t ui32SampleRate,
|
||||
uint8_t ui8PayloadType = 97,
|
||||
uint8_t ui8Interleaved = TrackAudio * 2);
|
||||
~AACRtpEncoder() {}
|
||||
|
||||
/**
|
||||
* 输入aac 数据,必须带dats头
|
||||
* @param frame 带dats头的aac数据
|
||||
@@ -77,10 +54,8 @@ public:
|
||||
bool inputFrame(const Frame::Ptr &frame) override;
|
||||
|
||||
private:
|
||||
void makeAACRtp(const void *data, size_t len, bool mark, uint64_t stamp);
|
||||
void outputRtp(const char *data, size_t len, size_t total_len, bool mark, uint64_t stamp);
|
||||
|
||||
private:
|
||||
unsigned char _section_buf[1600];
|
||||
};
|
||||
|
||||
}//namespace mediakit
|
||||
|
||||
Reference in New Issue
Block a user