Commit 90dbad37 authored by Éloi Bail's avatar Éloi Bail

media: tune decoder jitter buffer

This patchset allows ring application to tune 2 parameters of
libav jitter buffer:
- buffer size: maximal amount of packets to be queued
- packet delay: maximal amount of time a packet can be queued

Tuning those values allows correct handling of packet reordering issues
and network jitter.
Notice that for the moment default libav values are set.

Issue: #80311
Change-Id: Ife4be65a12a01e381bc952b07741104f9a969213
parent bc8615c0
......@@ -88,8 +88,9 @@ int MediaDecoder::openInput(const DeviceParams& params)
av_dict_set(&options_, "loop", params.loop.c_str(), 0);
av_dict_set(&options_, "sdp_flags", params.sdp_flags.c_str(), 0);
// force jitter buffer queue size to 30 instead of 10
av_dict_set(&options_, "reorder_queue_size", "30", 0);
// Set jitter buffer options
av_dict_set(&options_, "reorder_queue_size",ring::to_string(jitterBufferMaxSize_).c_str(), 0);
av_dict_set(&options_, "max_delay",ring::to_string(jitterBufferMaxDelay_).c_str(), 0);
RING_DBG("Trying to open device %s with format %s", params.input.c_str(),
......@@ -124,6 +124,12 @@ class MediaDecoder {
void extract(const std::map<std::string, std::string>& map, const std::string& key);
// Jitter buffer options: they are default values set in libav
// maximum of packet jitter buffer can queue
const unsigned jitterBufferMaxSize_ {500};
// maximum time a packet can be queued (in ms)
const unsigned jitterBufferMaxDelay_ {100000};
AVDictionary *options_ = nullptr;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment