Files
ZLMediaKit/ext-codec/Opus.h

40 lines
1.0 KiB
C++
Raw Normal View History

/*
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帧音频通道
* Opus frame audio channel
2020-05-12 11:48:15 +08:00
*/
class OpusTrack : public AudioTrackImp {
2020-05-12 11:48:15 +08:00
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:
// Clone this 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
}
toolkit::Buffer::Ptr getExtraData() const override;
void setExtraData(const uint8_t *data, size_t size) override;
2020-05-12 11:48:15 +08:00
};
}//namespace mediakit
#endif //ZLMEDIAKIT_OPUS_H