rivermax media_sender demo: send 190X1080 50p video
When the task starts, the rmx_output_media_commit_chunk function always returns RMX_HW_SEND_QUEUE_IS_FULL for a long time at the 619th chunk of the 8th frame. What is the reason for this and how can I solve this problem?
do {
uint64_t timeout = RMX_OUTPUT_DELTA_TIME;
if (!(chunk_num % m_set.chunks_num_per_frame_field) ||
((m_set.stream_type == AUDIO_2110_30_31_STREAM) && m_send_data[stream].first_send) ||
(m_set.stream_type == ANCILLARY_2110_40_STREAM)) {
m_send_data[stream].first_send = false;
timeout = send_time_ns.integer();
// verify windows is at least 600 nano away
if (likely(get_tai_time_ns() < (timeout - 600))) {
/*
* When timer handler callback is not used we have a mismatch between
* media_sender clock (TAI) and rivermax clock (UTC).
* To fix this we are calling to align_to_rmax_time function to convert
* @time from TAI to UTC
*/
timeout = align_to_rmax_time(timeout);
}
else {
// std::cout << "calling with timeout " << timeout << " delta "
// << timeout << " now "
// << get_tai_time_ns() << std::endl;
timeout = 0;
data.use_0_timeout++;
}
}
if (unlikely(!apply_schedule(m_send_data[stream].stream_id, now - start_time))) {
std::cout << "Failed to apply scheduled attribute change" << std::endl;
return;
}
// //test pdf
// {
// status = rmx_output_media_poll_for_completion(&chunk_handle);
// int a = 0;
// }
status = rmx_output_media_commit_chunk(&chunk_handle, timeout);
if (status == RMX_OK) {
data.commit_runs++;
break;
}
if (unlikely(status == RMX_SIGNAL)) {
std::cout << "Received CTRL-C, exiting..." << std::endl;
return;
}
if (status == RMX_HW_SEND_QUEUE_IS_FULL) {
// if (LogFlag)
// TXLogOut(LogLevel_KeyInfo, -1, "%s", "[run_internal] warning RMX HW send queue is full");
// LogFlag = 0;
printf("RMX_HW_SEND_QUEUE_IS_FULL: sendFrame[%d], chunk_num[%d] \n", dumpFrame, chunk_num);
//std::this_thread::sleep_for(std::chrono::milliseconds(5));
if (m_set.use_rmax_event) {
m_send_data[stream].event_mgr.request_notification(static_cast<rmx_stream_id>(m_send_data[stream].stream_id));
data.commit_waits++;
}
else {
data.commit_retries++;
}
}
else {
data.rmax_errors++;
}
if (status == RMX_HW_COMPLETION_ISSUE) {
std::cout << "got completion issue exiting" << std::endl;
printf(" RMX_HW_COMPLETION_ISSUE \n");
return;
}
} while (status != RMX_OK);