Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some DTMF injection fixes #1809

Closed
wants to merge 7 commits into from

Commits on Mar 20, 2024

  1. MT#55283 packet_encoded_tx: add a ts delay when transmitting DTMF eve…

    …nt packets
    
    when DTMF is being transmitted using codec_output_rtp, the scheduled
    time to send the packet is calculated using the timestamp difference
    from the last transmitted applied on top of the realtime time the
    last packet was sent. However, the timestamp is only updated on the
    first event packet so a delay needs to be passed in to codec_output_rtp
    to ensure the subsequent packets are scheduled based on the event
    duration of the event packets
    
    Change-Id: I5a2f6cf67b5f570f6099d201592d9a6fc01d60a5
    tombriden committed Mar 20, 2024
    Copy the full SHA
    ddf1051 View commit details
    Browse the repository at this point in the history
  2. MT#55283 dtmf_event_payload: canonicalise DTMF end event ts if start …

    …packet send was delayed
    
    in some scenarios the start event ts can be before the *pts value, which
    will result in a shortened DTMF event being transmitted than expected during
    injection as the end event ts is calculated based on that initial dtmf start
    value.
    This change updates the end event ts by the amount the start ts was
    behind, so that the resulting event has the right duration
    
    Change-Id: Ia637d1e1c5d92de8b35317ec552c22eae23c0645
    tombriden committed Mar 20, 2024
    Copy the full SHA
    0567f76 View commit details
    Browse the repository at this point in the history
  3. MT#55283 fix DTMF end event sequencing

    Change-Id: Ia16ffefc0791d01575248ac5d8025eb30ccaec67
    rfuchs authored and tombriden committed Mar 20, 2024
    Copy the full SHA
    c7de036 View commit details
    Browse the repository at this point in the history
  4. MT#55283 dtmf_inject: fix generating one too many event packets

    the num_samples was added to the start_pts, which is the first event
    packet timestamp, which has already increased its ts by its event
    duration. so, the total duration of events ends up being one packet
    more than intended.
    
    Change-Id: I423bb222a81c5bd78e570ff2026c72dd4dd1b100
    tombriden committed Mar 20, 2024
    Copy the full SHA
    9e1bd4c View commit details
    Browse the repository at this point in the history
  5. MT#55283 codec_last_dtmf_event: return ts of dtmf_state if handler qu…

    …eue is empty
    
    this function is used to determine if a pause is needed on a new
    injected DTMF's start ts to ensure a gap between the events. However,
    if an inject request comes in after the end of the previous event
    but before it would have been offset due to pause, no pause is added
    
    This change returns the ts value from dtmf_state if the queue is
    empty as that will always be the ts of the last DTMF transmitted
    
    Change-Id: I4f3cf5115d1a8e26c0ca1bc9570c46e29391e0d0
    tombriden committed Mar 20, 2024
    Copy the full SHA
    3742bfc View commit details
    Browse the repository at this point in the history
  6. MT#55283 dtmf_inject: adjust start_pts if last_event + pause is later…

    … than it
    
    now that the returned last_event_ts is always that of the previous
    DTMF, we can ensure that the next one isn't transmitted until that
    time plus the required pause.
    Like the num_samples calculation, the actual time needs to be
    increased by 1 packets worth of samples so tha pause lasts the
    full duration required
    
    Change-Id: I6da1dd7cbcf49f7f0431a5123df2cdc382fe3dba
    tombriden committed Mar 20, 2024
    Copy the full SHA
    b2fc4bd View commit details
    Browse the repository at this point in the history
  7. MT#55283 dtmf: only update recv list if not injected and send list if…

    … injected, delayed or not blocked
    
    having injected events on the recv list can cause out of order TS
    values which results in is_in_dtmf incorrectly returning NULL and
    letting the transcoded PCM frames through.
    It also doesn't make sense to add DTMF to the send list unless they're
    actually being sent, so injected delayed or unblocked
    
    Change-Id: I07e2a35e27142715a5257f199326b7a3d133e2a8
    tombriden committed Mar 20, 2024
    Copy the full SHA
    e484a17 View commit details
    Browse the repository at this point in the history