addTrack/inputFrame接口支持返回值;新增全局添加静音音频接口

This commit is contained in:
ziyue
2021-09-27 13:12:53 +08:00
parent 1f99708548
commit e9008afca0
63 changed files with 447 additions and 357 deletions

View File

@@ -77,10 +77,11 @@ public:
//播放成功,添加事件回调
weak_ptr<MediaPlayerForC> weak_self = shared_from_this();
auto delegate = std::make_shared<FrameWriterInterfaceHelper>([weak_self](const Frame::Ptr &frame) {
auto strong_self = weak_self.lock();
if (strong_self) {
if (auto strong_self = weak_self.lock()) {
strong_self->onData(frame);
return true;
}
return false;
});
for (auto &track : _player->getTracks(false)) {
track->addDelegate(delegate);