~vcs-imports/alsa-plugins/trunk

Viewing all changes in revision 330.

  • Committer: Takashi Iwai
  • Author(s): Andre Guedes
  • Date: 2018-12-10 08:42:06 UTC
  • Revision ID: git-v1:45db57391f9206014b37c4f082951d00eae0d3a3
aaf: Refactor AVTPDU reception routines

This patch does some code refactoring in the AVTPDU reception
routines in order to prepare the code to support the transmission
offload mechanism that will be added by upcoming patches. No
functionality is added or removed by this patch.

In summary, the function aaf_rx_pdu() is broken down into smaller, new
functions and some code is moved to is_pdu_valid(). Below follows more
details about the code refactoring.

The function aaf_rx_pdu() was renamed to aaf_socket_new_data() which
reads the socket and dispatches the AVTPDU in case the PCM device isn't
in DRAIN state. Function aaf_dispatch_pdu() simply reads the subtype
field from the AVTPDU and dispatches it according. For now, only AAF
PDUs are supported. Finally, the aaf_dispatch_pdu_aaf() handles AAF
AVTPDUs which means to check if the AVTPDU is valid, copies the PCM
samples from the payload to the audio buffer, and start the media clock
in case it hasn't been started already.

The function is_pdu_valid() is moved around to avoid forward
declaration. Code to validate the sequence number and presentation time
from the AVTPDU which used to be in aaf_rx_pdu() is moved into
is_pdu_valid().

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: