Open-AVB AVTP Pipeline SDK  1.4
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
openavb_map_pub.h
Go to the documentation of this file.
1 /*************************************************************************************************************
2 Copyright (c) 2012-2015, Symphony Teleca Corporation, a Harman International Industries, Incorporated company
3 All rights reserved.
4 
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are met:
7 
8 1. Redistributions of source code must retain the above copyright notice, this
9  list of conditions and the following disclaimer.
10 2. Redistributions in binary form must reproduce the above copyright notice,
11  this list of conditions and the following disclaimer in the documentation
12  and/or other materials provided with the distribution.
13 
14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS LISTED "AS IS" AND
15 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS LISTED BE LIABLE FOR
18 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 
25 Attributions: The inih library portion of the source code is licensed from
26 Brush Technology and Ben Hoyt - Copyright (c) 2009, Brush Technology and Copyright (c) 2009, Ben Hoyt.
27 Complete license and copyright information can be found at
28 https://github.com/benhoyt/inih/commit/74d2ca064fb293bc60a77b0bd068075b293cf175.
29 *************************************************************************************************************/
30 
31 /*
32 * HEADER SUMMARY : Common mapper module public interface
33 */
34 
35 #ifndef OPENAVB_MAP_PUB_H
36 #define OPENAVB_MAP_PUB_H 1
37 
38 #include "openavb_types_pub.h"
39 #include "openavb_mediaq_pub.h"
40 
45 #define MAP_NULL_OPENAVB_FORMAT 0x00
47 
49 #define MAP_PIPE_OPENAVB_FORMAT 0x01
50 
52 #define MAP_CTRL_OPENAVB_FORMAT 0x00
53 
56 typedef enum {
60 } tx_cb_ret_t;
61 
70 typedef void (*openavb_map_cfg_cb_t)(media_q_t *pMediaQ, const char *name, const char *value);
71 
77 
83 
90 
98 
104 typedef void (*openavb_map_gen_init_cb_t)(media_q_t *pMediaQ);
105 
120 typedef void (*openavb_map_avdecc_init_cb_t)(media_q_t *pMediaQ, U16 configIdx, U16 descriptorType, U16 descriptorIdx);
121 
127 typedef void (*openavb_map_tx_init_cb_t)(media_q_t *pMediaQ);
128 
136 typedef tx_cb_ret_t(*openavb_map_tx_cb_t)(media_q_t *pMediaQ, U8 *pData, U32 *datalen);
137 
144 typedef void (*openavb_map_rx_init_cb_t)(media_q_t *pMediaQ);
145 
152 typedef bool (*openavb_map_rx_cb_t)(media_q_t *pMediaQ, U8 *pData, U32 datalen);
153 
158 typedef void (*openavb_map_end_cb_t)(media_q_t *pMediaQ);
159 
165 typedef void (*openavb_map_gen_end_cb_t)(media_q_t *pMediaQ);
166 
178 typedef void (*openavb_map_set_src_bitrate_cb_t)(media_q_t *pMediaQ, unsigned int bitrate);
179 
193 typedef unsigned int (*openavb_map_get_max_interval_frames_cb_t)(media_q_t *pMediaQ, SRClassIdx_t sr_class);
194 
197 typedef struct {
229 
237 typedef bool (*openavb_map_initialize_fn_t)(media_q_t *pMediaQ, openavb_map_cb_t *pMapCB, U32 inMaxTransitUsec);
238 
239 #endif // OPENAVB_MAP_PUB_H
240 
openavb_map_cfg_cb_t map_cfg_cb
Configuration callback.
Definition: openavb_map_pub.h:199
openavb_map_subtype_cb_t map_subtype_cb
AVB subtype callback.
Definition: openavb_map_pub.h:201
openavb_map_rx_init_cb_t map_rx_init_cb
Initialize receive callback.
Definition: openavb_map_pub.h:217
bool(* openavb_map_rx_cb_t)(media_q_t *pMediaQ, U8 *pData, U32 datalen)
This callback occurs when running as a listener and data is available.
Definition: openavb_map_pub.h:152
Media Queue structure.
Definition: openavb_mediaq_pub.h:87
void(* openavb_map_gen_init_cb_t)(media_q_t *pMediaQ)
General initialize callback regardless if a talker or listener.
Definition: openavb_map_pub.h:104
void(* openavb_map_end_cb_t)(media_q_t *pMediaQ)
This callback will be called when the stream is closing.
Definition: openavb_map_pub.h:158
void(* openavb_map_tx_init_cb_t)(media_q_t *pMediaQ)
A call to this callback indicates that this mapping module will be a talker.
Definition: openavb_map_pub.h:127
openavb_map_gen_init_cb_t map_gen_init_cb
General initialize callback.
Definition: openavb_map_pub.h:209
unsigned int(* openavb_map_get_max_interval_frames_cb_t)(media_q_t *pMediaQ, SRClassIdx_t sr_class)
Get max interval frames.
Definition: openavb_map_pub.h:193
tx_cb_ret_t(* openavb_map_tx_cb_t)(media_q_t *pMediaQ, U8 *pData, U32 *datalen)
This talker callback will be called for each AVB observation interval.
Definition: openavb_map_pub.h:136
U16(* openavb_map_max_data_size_cb_t)(media_q_t *pMediaQ)
Maximum data size callback.
Definition: openavb_map_pub.h:89
uint8_t U8
Unsigned 8 bit type.
Definition: openavb_types_base_pub.h:77
U8(* openavb_map_subtype_cb_t)()
AVB subtype callback.
Definition: openavb_map_pub.h:76
openavb_map_get_max_interval_frames_cb_t map_get_max_interval_frames_cb
Max interval frames callback.
Definition: openavb_map_pub.h:227
void(* openavb_map_gen_end_cb_t)(media_q_t *pMediaQ)
General shutdown callback regardless if a talker or listener.
Definition: openavb_map_pub.h:165
openavb_map_tx_init_cb_t map_tx_init_cb
Initialize transmit callback.
Definition: openavb_map_pub.h:213
void(* openavb_map_cfg_cb_t)(media_q_t *pMediaQ, const char *name, const char *value)
Configuration callback.
Definition: openavb_map_pub.h:70
openavb_map_gen_end_cb_t map_gen_end_cb
General shutdown callback.
Definition: openavb_map_pub.h:223
Packet will be sent on this callback interal.
Definition: openavb_map_pub.h:58
tx_cb_ret_t
Return value of talker callback.
Definition: openavb_map_pub.h:56
openavb_map_transmit_interval_cb_t map_transmit_interval_cb
Transmit interval callback.
Definition: openavb_map_pub.h:207
uint32_t U32
Unsigned 32 bit type.
Definition: openavb_types_base_pub.h:85
void(* openavb_map_avdecc_init_cb_t)(media_q_t *pMediaQ, U16 configIdx, U16 descriptorType, U16 descriptorIdx)
AVDECC initialize callback for both a talker or listener.
Definition: openavb_map_pub.h:120
Packet will be sent and the callback called immediately again.
Definition: openavb_map_pub.h:59
Mapping callbacks structure.
Definition: openavb_map_pub.h:197
U32(* openavb_map_transmit_interval_cb_t)(media_q_t *pMediaQ)
Transmit interval callback.
Definition: openavb_map_pub.h:97
openavb_map_set_src_bitrate_cb_t map_set_src_bitrate_cb
Set source bit rate callback.
Definition: openavb_map_pub.h:225
void(* openavb_map_rx_init_cb_t)(media_q_t *pMediaQ)
A call to this callback indicates that this mapping module will be a listener.
Definition: openavb_map_pub.h:144
openavb_map_tx_cb_t map_tx_cb
Transmit callback.
Definition: openavb_map_pub.h:215
openavb_map_avtp_version_cb_t map_avtp_version_cb
AVTP version callback.
Definition: openavb_map_pub.h:203
void(* openavb_map_set_src_bitrate_cb_t)(media_q_t *pMediaQ, unsigned int bitrate)
Set source bitrate callback.
Definition: openavb_map_pub.h:178
openavb_map_end_cb_t map_end_cb
Stream end callback.
Definition: openavb_map_pub.h:221
uint16_t U16
Unsigned 16 bit type.
Definition: openavb_types_base_pub.h:81
openavb_map_avdecc_init_cb_t map_avdecc_init_cb
AVDECC initialize callback.
Definition: openavb_map_pub.h:211
openavb_map_rx_cb_t map_rx_cb
Receive callback.
Definition: openavb_map_pub.h:219
bool(* openavb_map_initialize_fn_t)(media_q_t *pMediaQ, openavb_map_cb_t *pMapCB, U32 inMaxTransitUsec)
Main initialization entry point into the mapping module.
Definition: openavb_map_pub.h:237
openavb_map_max_data_size_cb_t map_max_data_size_cb
Maximum data size callback.
Definition: openavb_map_pub.h:205
SRClassIdx_t
Supported AVB classes.
Definition: openavb_types_base_pub.h:104
U8(* openavb_map_avtp_version_cb_t)()
AVTP version callback.
Definition: openavb_map_pub.h:82
Packet will not be sent on this callback interval.
Definition: openavb_map_pub.h:57