diff --git a/src/reception_flow.cc b/src/reception_flow.cc index fb9bae10..dc5314d9 100644 --- a/src/reception_flow.cc +++ b/src/reception_flow.cc @@ -148,10 +148,22 @@ rtp_error_t uvgrtp::reception_flow::start(std::shared_ptr socket pthread_setschedparam(receiver_->native_handle(), SCHED_FIFO, ¶ms); params.sched_priority = sched_get_priority_max(SCHED_FIFO) - 1; pthread_setschedparam(processor_->native_handle(), SCHED_FIFO, ¶ms); -#else - +#elif defined(_MSC_VER) SetThreadPriority(receiver_->native_handle(), REALTIME_PRIORITY_CLASS); SetThreadPriority(processor_->native_handle(), ABOVE_NORMAL_PRIORITY_CLASS); +#else + + HANDLE hReceiverThread = OpenThread(THREAD_SET_INFORMATION, FALSE, receiver_->native_handle()); + if (hReceiverThread) { + SetThreadPriority(hReceiverThread, THREAD_PRIORITY_TIME_CRITICAL); + CloseHandle(hReceiverThread); + } + + HANDLE hProcessorThread = OpenThread(THREAD_SET_INFORMATION, FALSE, processor_->native_handle()); + if (hProcessorThread) { + SetThreadPriority(hProcessorThread, THREAD_PRIORITY_ABOVE_NORMAL); + CloseHandle(hProcessorThread); + } #endif active_ = true; @@ -741,4 +753,4 @@ rtp_error_t uvgrtp::reception_flow::update_remote_ssrc(uint32_t old_remote_ssrc, hooks_.insert({new_remote_ssrc, hook}); } return RTP_OK; -} \ No newline at end of file +}