2020-05-18 15:31:49 +08:00
|
|
|
|
/*
|
2023-12-09 16:23:51 +08:00
|
|
|
|
* Copyright (c) 2016-present The ZLMediaKit project authors. All Rights Reserved.
|
2020-05-12 11:48:15 +08:00
|
|
|
|
*
|
2023-12-09 16:23:51 +08:00
|
|
|
|
* This file is part of ZLMediaKit(https://github.com/ZLMediaKit/ZLMediaKit).
|
2020-05-12 11:48:15 +08:00
|
|
|
|
*
|
2023-12-09 16:23:51 +08:00
|
|
|
|
* Use of this source code is governed by MIT-like license that can be found in the
|
2020-05-12 11:48:15 +08:00
|
|
|
|
* 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.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef ZLMEDIAKIT_OPUS_H
|
|
|
|
|
#define ZLMEDIAKIT_OPUS_H
|
|
|
|
|
|
2023-12-10 10:21:40 +08:00
|
|
|
|
#include "Extension/Frame.h"
|
|
|
|
|
#include "Extension/Track.h"
|
2020-05-12 11:48:15 +08:00
|
|
|
|
|
2023-12-10 10:21:40 +08:00
|
|
|
|
namespace mediakit {
|
2020-05-12 11:48:15 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Opus帧音频通道
|
|
|
|
|
*/
|
|
|
|
|
class OpusTrack : public AudioTrackImp{
|
|
|
|
|
public:
|
2022-12-02 14:43:06 +08:00
|
|
|
|
using Ptr = std::shared_ptr<OpusTrack>;
|
2020-08-01 10:22:12 +08:00
|
|
|
|
OpusTrack() : AudioTrackImp(CodecOpus,48000,2,16){}
|
2020-05-12 11:48:15 +08:00
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
//克隆该Track
|
2023-12-09 16:23:51 +08:00
|
|
|
|
Track::Ptr clone() const override {
|
|
|
|
|
return std::make_shared<OpusTrack>(*this);
|
2020-05-12 11:48:15 +08:00
|
|
|
|
}
|
|
|
|
|
//生成sdp
|
2023-12-09 16:23:51 +08:00
|
|
|
|
Sdp::Ptr getSdp(uint8_t payload_type) const override ;
|
2020-05-12 11:48:15 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}//namespace mediakit
|
|
|
|
|
#endif //ZLMEDIAKIT_OPUS_H
|