mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-06-21 16:32:22 +08:00
新增媒体流flush机制:#1996
This commit is contained in:
@@ -25,6 +25,10 @@ RtpSender::RtpSender(EventPoller::Ptr poller) {
|
||||
_socket_rtp = Socket::createSocket(_poller, false);
|
||||
}
|
||||
|
||||
RtpSender::~RtpSender() {
|
||||
flush();
|
||||
}
|
||||
|
||||
void RtpSender::startSend(const MediaSourceEvent::SendRtpArgs &args, const function<void(uint16_t local_port, const SockException &ex)> &cb){
|
||||
_args = args;
|
||||
if (!_interface) {
|
||||
@@ -231,6 +235,12 @@ void RtpSender::resetTracks(){
|
||||
_interface->resetTracks();
|
||||
}
|
||||
|
||||
void RtpSender::flush() {
|
||||
if (_interface) {
|
||||
_interface->flush();
|
||||
}
|
||||
}
|
||||
|
||||
//此函数在其他线程执行
|
||||
bool RtpSender::inputFrame(const Frame::Ptr &frame) {
|
||||
//连接成功后才做实质操作(节省cpu资源)
|
||||
|
||||
Reference in New Issue
Block a user