Commit e568f54d authored by Ripinder Singh's avatar Ripinder Singh
Browse files

Introduce an ivas rtp api for pack/unpack



* Add support for pack/unpack of ivas and evs frames
* Support for pi data
* Support for remote requests and frame info

Signed-off-by: default avatarSingh, Ripinder <ripinder.singh@dolby.com>
parent ba624cf8
Loading
Loading
Loading
Loading
Loading
+470 −0
Original line number Diff line number Diff line
/******************************************************************************************************

   (C) 2022-2024 IVAS codec Public Collaboration with portions copyright Dolby International AB, Ericsson AB,
   Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
   Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
   Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
   contributors to this repository. All Rights Reserved.

   This software is protected by copyright law and by international treaties.
   The IVAS codec Public Collaboration consisting of Dolby International AB, Ericsson AB,
   Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e.V., Huawei Technologies Co. LTD.,
   Koninklijke Philips N.V., Nippon Telegraph and Telephone Corporation, Nokia Technologies Oy, Orange,
   Panasonic Holdings Corporation, Qualcomm Technologies, Inc., VoiceAge Corporation, and other
   contributors to this repository retain full ownership rights in their respective contributions in
   the software. This notice grants no license of any kind, including but not limited to patent
   license, nor is any license granted by implication, estoppel or otherwise.

   Contributors are required to enter into the IVAS codec Public Collaboration agreement before making
   contributions.

   This software is provided "AS IS", without any express or implied warranties. The software is in the
   development stage. It is intended exclusively for experts who have experience with such software and
   solely for the purpose of inspection. All implied warranties of non-infringement, merchantability
   and fitness for a particular purpose are hereby disclaimed and excluded.

   Any dispute, controversy or claim arising under or in relation to providing this software shall be
   submitted to and settled by the final, binding jurisdiction of the courts of Munich, Germany in
   accordance with the laws of the Federal Republic of Germany excluding its conflict of law rules and
   the United Nations Convention on Contracts on the International Sales of Goods.

*******************************************************************************************************/

#ifndef IVAS_RTP_API_H
#define IVAS_RTP_API_H

#pragma once
#include <stdbool.h>
#include <stdint.h>
#include "ivas_error.h"

#ifdef __cplusplus
extern "C"
{
#endif

/*
 * +-----------------------+---------------------+--------------------+----------+
 * | RTP Header (+ HDREXT) |    payload header   |     frame data     |  PI data |
 * +-----------------------+---------------------+--------------------+----------+
 *                         \--------------------\ /------------------------------/
 *                                          IVAS payload
 *
 * This api provides a mechanism to generate/unpack the IVAS payload. The RTP Header
 * and header extension fields must be handled by caller.
 *
 * IVAS General Payload structure
 * ===============================
 *
 *   0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
 *   H               H               H               H F             H
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *  |1|  T  |   D   |1| ET1 |x x x x|1| ET2 |x x x x|0|1|0 1|  BR   |1| ET3 |x x x x|…
 *  +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
 *  \--------------/\--------------/\--------------/\--------------/\--------------/
 *   Initial E byte  Subsqnt Ebyte1  Subsqnt Ebyte2      ToC1        Subsqnt Ebyte3
 *
 *   H F
 *  +-+-+-+-+-+-+-+-+-------------------------- ---+-------------------- ---+-------+
 * …|0|0|0 1|  BR   |      IVAS frame 1       ...  |   IVAS frame 2    ...  |PI data|
 *  +-+-+-+-+-+-+-+-+-------------------------- ---+-------------------- ---+-------+
 *  \--------------/
 *       ToC2
 *
 */

#define NO_BITRATE_REQ    ( 0u ) /* If no bitrate is requested from remote */

    /* IVAS Codec Types */
    typedef enum
    {
        IVAS_RTP_EVS, /* EVS  */
        IVAS_RTP_IVAS /* IVAS */
    } IVAS_RTP_CODECS;

    /* IVAS Bandwidth Requests */
    typedef enum
    {
        IVAS_BANDWIDTH_NB,     /* Narrowband */
        IVAS_BANDWIDTH_WB,     /* Wideband*/
        IVAS_BANDWIDTH_SWB,    /* SuperWideband*/
        IVAS_BANDWIDTH_FB,     /* Fullband */
        IVAS_BANDWIDTH_NO_REQ, /* No Preference */
    } IVAS_RTP_BANDWIDTH;

    /* Channel Aware Coding */
    typedef enum
    {
        IVAS_RTP_CA_LO_O2, /* FER=LO, OFFSET=2 */
        IVAS_RTP_CA_LO_O3, /* FER=LO, OFFSET=3 */
        IVAS_RTP_CA_LO_O5, /* FER=LO, OFFSET=5 */
        IVAS_RTP_CA_LO_O7, /* FER=LO, OFFSET=7 */
        IVAS_RTP_CA_HI_O2, /* FER=HI, OFFSET=2 */
        IVAS_RTP_CA_HI_O3, /* FER=HI, OFFSET=3 */
        IVAS_RTP_CA_HI_O5, /* FER=HI, OFFSET=5 */
        IVAS_RTP_CA_HI_O7, /* FER=HI, OFFSET=7 */
        IVAS_RTP_CA_NO_REQ /* No request       */
    } IVAS_RTP_CA_MODE;

    /* Coded Format Requests */
    typedef enum
    {
        IVAS_FMT_STEREO, /* Stereo */
        IVAS_FMT_SBA,    /* Scene Based Audio */
        IVAS_FMT_MASA,   /* Metadata Assisted Spatial Audio */
        IVAS_FMT_ISM,    /* Object Based Audio */
        IVAS_FMT_MC,     /* Multichannel Audio */
        IVAS_FMT_OMASA,  /* Object + MASA */
        IVAS_FMT_OSBA,   /* Object + SBA */
        IVAS_FMT_NO_REQ, /* No preference */
    } IVAS_RTP_FORMAT;

    /* Coded Subformat Requests */
    typedef enum
    {
        IVAS_SUBFMT_FOA_PLANAR,
        IVAS_SUBFMT_HOA2_PLANAR,
        IVAS_SUBFMT_HOA3_PLANAR,
        IVAS_SUBFMT_FOA,
        IVAS_SUBFMT_HOA2,
        IVAS_SUBFMT_HOA3,
        IVAS_SUBFMT_MASA1,
        IVAS_SUBFMT_MASA2,
        IVAS_SUBFMT_ISM1,
        IVAS_SUBFMT_ISM2,
        IVAS_SUBFMT_ISM3,
        IVAS_SUBFMT_ISM4,
        IVAS_SUBFMT_ISM1_EXTENDED_METADATA,
        IVAS_SUBFMT_ISM2_EXTENDED_METADATA,
        IVAS_SUBFMT_ISM3_EXTENDED_METADATA,
        IVAS_SUBFMT_ISM4_EXTENDED_METADATA,
        IVAS_SUBFMT_MC_5_1,
        IVAS_SUBFMT_MC_7_1,
        IVAS_SUBFMT_MC_5_1_2,
        IVAS_SUBFMT_MC_5_1_4,
        IVAS_SUBFMT_MC_7_1_4,
        IVAS_SUBFMT_RESERVED_21,
        IVAS_SUBFMT_RESERVED_22,
        IVAS_SUBFMT_RESERVED_23,
        IVAS_SUBFMT_RESERVED_24,
        IVAS_SUBFMT_RESERVED_25,
        IVAS_SUBFMT_RESERVED_26,
        IVAS_SUBFMT_RESERVED_27,
        IVAS_SUBFMT_RESERVED_28,
        IVAS_SUBFMT_RESERVED_29,
        IVAS_SUBFMT_RESERVED_30,
        IVAS_SUBFMT_RESERVED_31,
        IVAS_SUBFMT_OMASA_ISM1_1TC,
        IVAS_SUBFMT_OMASA_ISM2_1TC,
        IVAS_SUBFMT_OMASA_ISM3_1TC,
        IVAS_SUBFMT_OMASA_ISM4_1TC,
        IVAS_SUBFMT_OMASA_ISM1_2TC,
        IVAS_SUBFMT_OMASA_ISM2_2TC,
        IVAS_SUBFMT_OMASA_ISM3_2TC,
        IVAS_SUBFMT_OMASA_ISM4_2TC,
        IVAS_SUBFMT_OSBA_ISM1_FOA_PLANAR,
        IVAS_SUBFMT_OSBA_ISM2_FOA_PLANAR,
        IVAS_SUBFMT_OSBA_ISM3_FOA_PLANAR,
        IVAS_SUBFMT_OSBA_ISM4_FOA_PLANAR,
        IVAS_SUBFMT_OSBA_ISM1_FOA,
        IVAS_SUBFMT_OSBA_ISM2_FOA,
        IVAS_SUBFMT_OSBA_ISM3_FOA,
        IVAS_SUBFMT_OSBA_ISM4_FOA,
        IVAS_SUBFMT_OSBA_ISM1_HOA2_PLANAR,
        IVAS_SUBFMT_OSBA_ISM2_HOA2_PLANAR,
        IVAS_SUBFMT_OSBA_ISM3_HOA2_PLANAR,
        IVAS_SUBFMT_OSBA_ISM4_HOA2_PLANAR,
        IVAS_SUBFMT_OSBA_ISM1_HOA2,
        IVAS_SUBFMT_OSBA_ISM2_HOA2,
        IVAS_SUBFMT_OSBA_ISM3_HOA2,
        IVAS_SUBFMT_OSBA_ISM4_HOA2,
        IVAS_SUBFMT_OSBA_ISM1_HOA3_PLANAR,
        IVAS_SUBFMT_OSBA_ISM2_HOA3_PLANAR,
        IVAS_SUBFMT_OSBA_ISM3_HOA3_PLANAR,
        IVAS_SUBFMT_OSBA_ISM4_HOA3_PLANAR,
        IVAS_SUBFMT_OSBA_ISM1_HOA3,
        IVAS_SUBFMT_OSBA_ISM2_HOA3,
        IVAS_SUBFMT_OSBA_ISM3_HOA3,
        IVAS_SUBFMT_OSBA_ISM4_HOA3,
        IVAS_SUBFMT_NO_REQ
    } IVAS_RTP_SUBFORMAT;

    /* Split Rendering Requests */
    typedef struct {
        uint32_t diegetic : 1; /* enabling diegetic support for Split Rendering          */
        uint32_t yaw : 1;      /* transmission metadata for correction around yaw axis   */
        uint32_t pitch : 1;    /* transmission metadata for correction around pitch axis */
        uint32_t roll: 1;      /* transmission metadata for correction around roll axis  */
        uint32_t reserved: 28; /* reserved */
    } IVAS_RTP_SPLITRENDER;

    /* Remote Requests Types (Keys) */
    typedef enum
    {
        IVAS_REQUEST_CODEC,      /* Request codec type, value of type IVAS_RTP_CODECS          */
        IVAS_REQUEST_BITRATE,    /* Request bitrate, value of type uint32_t in kbps            */
        IVAS_REQUEST_BANDWIDTH,  /* Request bandwidth, value of type IVAS_RTP_BANDWIDTH        */
        IVAS_REQUEST_FORMAT,     /* Request format, value of type IVAS_RTP_FORMAT              */
        IVAS_REQUEST_SUBFORMAT,  /* Request subFormat, value of type IVAS_RTP_SUBFORMAT        */
        IVAS_REQUEST_CA_MODE,    /* Request channel awareness, value of type IVAS_RTP_CA_MODE  */
        IVAS_REQUEST_SR_CONFIG,  /* Request spit rendering, value of type IVAS_RTP_SPLITRENDER */
        IVAS_REQUEST_MAX         /* Max number of requests */
    } IVAS_RTP_REQUEST_TYPE;

    /* Remote Request Values */
    typedef union {
        uint32_t bitrate;                 /* bitrate in kbps when request type is IVAS_REQUEST_BITRATE          */
        IVAS_RTP_CODECS codec;            /* codec id when request type is IVAS_REQUEST_CODEC                   */
        IVAS_RTP_BANDWIDTH bandwidth;     /* badwidth when request type is IVAS_REQUEST_BANDWIDTH               */
        IVAS_RTP_FORMAT formatType;       /* format type when request type is IVAS_REQUEST_FORMAT               */
        IVAS_RTP_SUBFORMAT subFormatType; /* sub-format type when request type is IVAS_REQUEST_SUBFORMAT        */
        IVAS_RTP_CA_MODE caMode;          /* channel aware mode when request type is IVAS_REQUEST_CA_MODE       */
        IVAS_RTP_SPLITRENDER srConfig;    /* split rendering config when request type is IVAS_REQUEST_SR_CONFIG */
    } IVAS_RTP_REQUEST_VALUE;

    /* Template for pi data types, all defined pi data follow this template
     * for example scene orientation pi data can be represented as :-
     *
     *     typedef struct {
     *         uint32_t size;       // sizeof(IVAS_PIDATA_SCENE_ORIENTATION)
     *         uint32_t piDataType; // IVAS_PI_SCENE_ORIENTATION
     *         float w, x, y, z;    // pi data of scene orientation in quaternions
     *     } IVAS_PIDATA_SCENE_ORIENTATION;
     *
     */
    typedef struct
    {
        uint32_t size;       /* size of this structure */
        uint32_t piDataType; /* IVAS PI data type      */
        uint8_t data[1];     /* Variable length array (length calculated as size - 2*sizeof(uint32_t))*/
    } IVAS_PIDATA_GENERIC;

    /* Generic data buffer for sending/receiving coded frames / rtp packets
     * data buffer is owned and initialized by caller, rtp api will ensure
     * buffer write does not exceed allocSize.
     */
    typedef struct
    {
        uint32_t allocSize; /* allocated size of the data buffer            */
        uint32_t length;    /* length of the initialized data in the buffer */
        uint8_t *buffer;    /* pointer to the packet buffer                 */
    } IVAS_DATA_BUFFER;

    /**********************************************/
    /*           IVAS RTP PACKER API              */
    /**********************************************/

    /* Forward declaration of rtp pack/unpack handle types */
    typedef struct IVAS_RTP_PACK *IVAS_RTP_PACK_HANDLE;     /* rtp packer handle type */

    /* Initial configuration for rtp packer
     *  - maxFramesPerPacket is used to define if more than one frame should be packed
     *    in the same rtp packet.
     *
     * - piDataRepeatIntervalMs is used to define pi data repetition interval
     *
     */
    typedef struct
    {
        uint32_t maxFramesPerPacket;     /* maximum no of frame per packet desired during the session */
        uint32_t piDataRepeatIntervalMs; /* period for pi data repeat 0 = each frame, UINT_MAX=never  */
    } IVAS_RTP_PACK_CONFIG;

    /* Open an instance of the RTP packer and return a handle to rtp packer on success
     * error code is retured on failure and handle is set to NULL
     */
    ivas_error IVAS_RTP_PACK_Open(
        IVAS_RTP_PACK_HANDLE *phIvasPack,  /* i/o: pointer to an IVAS rtp packer handle to be opened */
        const IVAS_RTP_PACK_CONFIG *config /* i  : pointer to initial config for RTP Packer          */
    );

    /* Close and free an existing instance of rtp packer */
    void IVAS_RTP_PACK_Close(
        IVAS_RTP_PACK_HANDLE *phIvasPack /* i/o : pointer to an IVAS rtp packer handle to be closed */
    );

    /* Add requests for remote sender using a key value pair api
     * each key must be provided with a corresponding value type
     *
     * Cross validation of some key,value pairs will not be done
     * in this API. E.g. Codec ID and supported bitrates/bandwidths
     * will not be performed at this level.
     */
    ivas_error IVAS_RTP_PACK_RemoteRequest(
        IVAS_RTP_PACK_HANDLE hIvasPack, /* i/o : IVAS rtp packer handle      */
        IVAS_RTP_REQUEST_TYPE reqType,  /* i   : remote request type         */
        IVAS_RTP_REQUEST_VALUE reqValue /* i   : value of the requested type */
    );

    /* Push a single IVAS/EVS frame to rtp packer
     *
     * If multiple frames per RTP packet are desired, multiple frames must be explicitly
     * pushed before a call to IVAS_RTP_PACK_GetPacket to generate a rtp packet.
     *
     * It is possible to have variable frames per packet until maxFramesPerPacket frames
     * if IVAS_RTP_PACK_GetPacket is invoked asyncronously w.r.t this api.
     *
     */
    ivas_error IVAS_RTP_PACK_PushFrame(
        IVAS_RTP_PACK_HANDLE hIvasPack,     /* i/o : IVAS rtp packer handle              */
        IVAS_RTP_CODECS codecId,            /* i   : Codec type (IVAS/EVS)               */
        const IVAS_DATA_BUFFER *frameBuffer /* i   : packed frame bitstream for IVAS/EVS */
    );

    /* Push single PI data to rtp packer
     *
     * Provide PI data for a current RTP packet. All PI data is locally cached in the packer
     * and set to the rtp packet with policy defined in initial configuration during call to
     * IVAS_RTP_PACK_GetPacket.
     *
     */
    ivas_error IVAS_RTP_PACK_PushPiData(
        IVAS_RTP_PACK_HANDLE hIvasPack, /* i/o : IVAS rtp packer handle         */
        const IVAS_PIDATA_GENERIC *data /* i   : pointer to the PIData stucture */
    );

    /* Generate a rtp packet using available pushed frames
     *
     * Available remote requests, pi data and frames will be packed into a rtp packet. If no
     * frame is pushed before call to this api, NO_DATA_FRAME will be generated
     *
     */
    ivas_error IVAS_RTP_PACK_GetPacket(
        IVAS_RTP_PACK_HANDLE hIvasPack, /* i/o : IVAS rtp packer handle  */
        IVAS_DATA_BUFFER *packet        /* o   : encapsulated rtp packet */
    );


    /**********************************************/
    /*          IVAS RTP UNPACKER API             */
    /**********************************************/

    /* Forward declaration of rtp unpack handle types */
    typedef struct IVAS_RTP_UNPACK *IVAS_RTP_UNPACK_HANDLE; /* rtp unpacker handle type */

    /* Initial configuration for rtp unpacker */
    typedef struct
    {
        uint32_t maxNumberOfPacketInFifo; /* input packet fifo 's max length */
    } IVAS_RTP_UNPACK_CONFIG;

    /* Open an instance of the RTP unpacker and return a handle to rtp unpacker on success
     * error code is retured on failure and handle is set to NULL
     */
    ivas_error IVAS_RTP_UNPACK_Open(
        IVAS_RTP_UNPACK_HANDLE *phIvasUnpack, /* i/o : rtp unpacker handle                    */
        const IVAS_RTP_UNPACK_CONFIG *config  /* i   : initial configuration for rtp unpacker */
    );

    /* Close and free an existing instance of rtp unpacker */
    void IVAS_RTP_UNPACK_Close(
        IVAS_RTP_UNPACK_HANDLE *phIvasUnpack /* i/o : IVAS rtp unpacker handle */
    );

    /* Push a received rtp Ivas Payload to unpacker to extract number of frames, pi data and
     * any remote request present in the packet. Caller must extract RTP header and header
     * extension and feed Ivas Payload alongwith RTP Timestamp and sequence number.
     *
     * Example usage : -
     * ==================
     * err = IVAS_RTP_UNPACK_PushPacket(hIvasUnpack, payload, rtpTs, seqNum,
     *                                  &nFrames, &nPiData, &reqBitmap);
     * if (err != IVAS_ERR_OK) { return err; }
     *
     * // Read the frames in packet and feed to decoder
     * while (nFrames-- > 0) {
     *     err = IVAS_RTP_UNPACK_PullFrame(hIvasUnpack, &recCodecId, &frame, &frameTs, &seqNum);
     *     if (err != IVAS_ERR_OK) { return err; }
     *     err = IVAS_DEC_VoIP_FeedFrame(hIvasDec, frame.buffer, frame.length, seqNum, frameTs, rcvTime, isGoodFrame);
     *     if (err != IVAS_ERR_OK) { return err; }
     * }
     *
     * // Read PI Data
     * while (nPiData-- > 0) {
     *     err = IVAS_RTP_UNPACK_GetNextPiData(hIvasUnpack, &piData, &piTs);
     *     if (err != IVAS_ERR_OK) { return err; }
     *     // handle pi data based on fwd/rev pi data types
     *     handlePIData(&piData, piTs)
     * }
     *
     * // Read remote requests
     * for (req = 0; req < IVAS_REQUEST_MAX; req++) {
     *     if (reqBitmap & (1u << req)) {
     *         err = IVAS_RTP_UNPACK_GetRequest(hIvasUnpack, req, &value);
     *         if (err != IVAS_ERR_OK) { return err; }
     *        switch(req) {
     *            case IVAS_REQUEST_CODEC     : handleCodec(value.codec); break;
     *            case IVAS_REQUEST_BITRATE   : handleBitrate(value.bitrate); break;
     *            case IVAS_REQUEST_BANDWIDTH : handleBandwidth(value.bandwidth); break;
     *            case IVAS_REQUEST_FORMAT    : handleFormat(value.formatType); break;
     *            case IVAS_REQUEST_SUBFORMAT : handleSubFormat(value.subFormatType); break;
     *            case IVAS_REQUEST_CA_MODE   : handleCAModevalue.caMode); break;
     *            case IVAS_REQUEST_SR_CONFIG : handleSRConfig(value.srConfig); break;
     *        }
     *     }
     * }
     *
     */
    ivas_error IVAS_RTP_UNPACK_PushPacket(
        IVAS_RTP_UNPACK_HANDLE hIvasUnpack, /* i/o : IVAS rtp unpacker handle                        */
        const IVAS_DATA_BUFFER *packet,     /* i   : received rtp packet                             */
        uint32_t  timestamp,                /* i   : timestamp in RTP Clock @ 16KHz  from rtp header */
        uint16_t  sequenceNumbers,          /* i   : sequence number from rtp header                 */
        uint32_t *numFramesInPacket,        /* o   : number of IVAS/EVS frames in rtp packet         */
        uint32_t *numPiDataInPacket,        /* o   : number of PI data received in rtp packet        */
        uint32_t *remoteRequestBitmap       /* o   : bitmap of available request in this packet      */
    );

    /* Push a received rtp extension header to unpacker to extract pi data
     * Caller must feed rtp extension header alongwith RTP Timestamp and sequence number.
     */
    ivas_error IVAS_RTP_UNPACK_HeaderExtension (
        IVAS_RTP_UNPACK_HANDLE hIvasUnpack,    /* i/o : IVAS rtp unpacker handle                        */
        const IVAS_DATA_BUFFER *hdrExtnBuffer, /* i   : received rtp header extension buffer            */
        uint32_t  timestamp,                   /* i   : timestamp in RTP Clock @ 16KHz  from rtp header */
        uint16_t  sequenceNumbers,             /* i   : sequence number from rtp header                 */
        uint32_t *numPiDataInPacket            /* o   : number of PI data received in rtp packet        */
    );

    /* Fetch requests from sender using a key value pair api
     * each key must be provided with a corresponding value storage type
     *
     * On call to IVAS_RTP_UNPACK_PushPacket(), remoteRequestBitmap can be used
     * an indicator of new request available this frame
     *
     */
    ivas_error IVAS_RTP_UNPACK_GetRequest(
        IVAS_RTP_UNPACK_HANDLE hIvasUnpack, /* i/o : IVAS rtp packer handle        */
        IVAS_RTP_REQUEST_TYPE type,         /* i   : remote request type           */
        IVAS_RTP_REQUEST_VALUE *value       /* o   : pointer of the requested type */
    );

    /* Extract a single IVAS/EVS frame from provided rtp packet alongwith rtp timestamp
     * and sequence number
     *
     * If multiple frames per RTP packet are available, multiple calls to IVAS_RTP_UNPACK_PullFrame
     * are needed. A frameBuffer.length == 0 indicates NO_DATA_FRAME
     *
     */
    ivas_error IVAS_RTP_UNPACK_PullFrame(
        IVAS_RTP_UNPACK_HANDLE hIvasUnpack, /* i/o : IVAS rtp unpacker handle            */
        IVAS_RTP_CODECS *receivedCodecId,   /* i   : Codec type (IVAS/EVS)               */
        IVAS_DATA_BUFFER *frameBuffer,      /* o   : packed frame bitstream for IVAS/EVS */
        uint32_t *timestamp,                /* o   : timestamp in RTP Clock @ 16KHz      */
        uint16_t *sequenceNumbers           /* o   : sequence number from rtp header     */
    );

    /* Pull a single PI data from rtp unpacker instance for current packet
     * Each Pi data is accompanied with a corresponding timestamp
     */
    ivas_error IVAS_RTP_UNPACK_GetNextPiData(
        IVAS_RTP_UNPACK_HANDLE hIvasUnpack, /* i/o : IVAS rtp unpacker handle           */
        IVAS_PIDATA_GENERIC *data,          /* o   : output data buffer for the Pi data */
        uint32_t *timestamp                 /* o   : timestamp in RTP Clock @ 16KHz     */
    );

#ifdef __cplusplus
}
#endif

#endif /* IVAS_RTP_API_H */