Open-AVB AVTP Pipeline SDK  1.4
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
openavb_tl_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 : Talker Listener Public Interface
33 */
34 
35 #ifndef OPENAVB_TL_PUB_H
36 #define OPENAVB_TL_PUB_H 1
37 
38 #include "openavb_types_pub.h"
39 #include "openavb_mediaq_pub.h"
40 #include "openavb_map_pub.h"
41 #include "openavb_intf_pub.h"
42 #include "openavb_avtp_time_pub.h"
43 
48 typedef void *tl_handle_t;
50 
52 typedef enum {
69 } tl_stat_t;
70 
72 #define MAX_LIB_CFG_ITEMS 64
73 
74 
76 #define IFNAMSIZE 16
77 
79 typedef struct {
87  cfg_mac_t dest_addr;
89  cfg_mac_t stream_addr;
124  char ifname[IFNAMSIZE];
127 
133 
143 
144 
155 bool openavbTLInitialize(U32 maxTL);
156 
165 bool openavbTLCleanup(void);
166 
177 bool openavbGetVersion(U8 *major, U8 *minor, U8 *revision);
178 
186 
193 
206 
216 bool openavbTLRun(tl_handle_t handle);
217 
225 bool openavbTLStop(tl_handle_t handle);
226 
235 void openavbTLPauseStream(tl_handle_t handle, bool bPause);
236 
246 bool openavbTLClose(tl_handle_t handle);
247 
260 
272 void* openavbTLGetIntfHandle(tl_handle_t handle);
273 
282 bool openavbTLIsRunning(tl_handle_t handle);
283 
292 bool openavbTLIsConnected(tl_handle_t handle);
293 
301 bool openavbTLIsStreaming(tl_handle_t handle);
302 
311 
320 U64 openavbTLStat(tl_handle_t handle, tl_stat_t stat);
321 
336 bool openavbTLReadIniFileOsal(tl_handle_t TLhandle, const char *fileName, openavb_tl_cfg_t *pCfg, openavb_tl_cfg_name_value_t *pNVCfg);
337 
338 
342 #endif // OPENAVB_TL_PUB_H
bool openavbTLInitialize(U32 maxTL)
Initialize the talker listener library.
U32 report_seconds
Statistics reporting frequency.
Definition: openavb_tl_pub.h:110
#define IFNAMSIZE
Maximum size of interface name.
Definition: openavb_tl_pub.h:76
bool openavbTLConfigure(tl_handle_t handle, openavb_tl_cfg_t *pCfg, openavb_tl_cfg_name_value_t *pNVCfg)
Configure the talker / listener.
void * openavbTLGetIntfHandle(tl_handle_t handle)
Get a handle to the interface module data from this talker or listener.
cfg_mac_t dest_addr
MAC address of destination - multicast (talker only if SRP is enabled)
Definition: openavb_tl_pub.h:87
bool openavbTLIsStreaming(tl_handle_t handle)
Checks if a talker or listener has an open stream.
bool openavbTLStop(tl_handle_t handle)
Stop a single talker or listener.
Structure containing configuration of the host.
Definition: openavb_tl_pub.h:79
bool tx_blocking_in_intf
Is the interface module blocking in the TX CB.
Definition: openavb_tl_pub.h:122
uint8_t U8
Unsigned 8 bit type.
Definition: openavb_types_base_pub.h:77
U32 max_interval_frames
Maximum number of packets sent during one interval (talker only)
Definition: openavb_tl_pub.h:93
openavb_map_cb_t map_cb
Structure with callbacks to mapping.
Definition: openavb_tl_pub.h:83
U32 internal_latency
Specify manual an internal latency (talker only)
Definition: openavb_tl_pub.h:103
AVTP Time public interface.
U32 batch_factor
Number of intervals to handle at once (talker only)
Definition: openavb_tl_pub.h:108
tl_handle_t openavbTLOpen(void)
Open a talker or listener.
void openavbTLInitCfg(openavb_tl_cfg_t *pCfg)
Initialize the configuration to default values.
Common interface module public header.
NUmber of late TX frames.
Definition: openavb_tl_pub.h:58
#define MAX_LIB_CFG_ITEMS
Maximum number of configuration parameters inside INI file a host can have.
Definition: openavb_tl_pub.h:72
void openavbTLPauseStream(tl_handle_t handle, bool bPause)
Pause or resume as stream.
bool openavbTLIsConnected(tl_handle_t handle)
Checks if a talker or listener is connected to the endpoint.
U8 sr_class
Class in which host will operatea SRClassIdx_t (talker only)
Definition: openavb_tl_pub.h:114
char * libCfgNames[MAX_LIB_CFG_ITEMS]
Configuration parameters Names for interface and mapping modules.
Definition: openavb_tl_pub.h:137
Number of RX frames lost.
Definition: openavb_tl_pub.h:66
uint32_t U32
Unsigned 32 bit type.
Definition: openavb_types_base_pub.h:85
avb_role_t openavbTLGetRole(tl_handle_t handle)
Return the role of the current stream handle.
U8 sr_rank
Rank of the stream SR_RANK_REGULAR or SR_RANK_EMERGENCY (talker only)
Definition: openavb_tl_pub.h:116
Mapping callbacks structure.
Definition: openavb_map_pub.h:197
openavb_map_initialize_fn_t pMapInitFn
Initialization function in mapper.
Definition: openavb_tl_pub.h:129
Number of bytes received.
Definition: openavb_tl_pub.h:68
bool start_paused
Start paused.
Definition: openavb_tl_pub.h:112
uint64_t U64
Unsigned 64 bit type.
Definition: openavb_types_base_pub.h:89
void * tl_handle_t
Handle to a single talker or listener.
Definition: openavb_tl_pub.h:49
avb_role_t role
Role of the host.
Definition: openavb_tl_pub.h:81
bool(* openavb_intf_initialize_fn_t)(media_q_t *pMediaQ, openavb_intf_cb_t *pIntfCB)
Main initialization entry point into the interface module.
Definition: openavb_intf_pub.h:224
Interface callbacks structure.
Definition: openavb_intf_pub.h:175
openavb_intf_initialize_fn_t pIntfInitFn
Initialization function in interface.
Definition: openavb_tl_pub.h:131
bool openavbTLCleanup(void)
Final cleanup of the talker listener library.
openavb_intf_cb_t intf_cb
Structure with callbacks to inteface.
Definition: openavb_tl_pub.h:85
Number of bytes send.
Definition: openavb_tl_pub.h:60
bool openavbTLRun(tl_handle_t handle)
Run the talker or listener.
cfg_mac_t stream_addr
MAC address of the source.
Definition: openavb_tl_pub.h:89
int32_t S32
Signed 32 bit type.
Definition: openavb_types_base_pub.h:83
Common mapper module public interface.
Structure holding configuration of mapping and interface modules.
Definition: openavb_tl_pub.h:135
bool rx_signal_mode
When set incoming packets will trigger a signal to the stream task to wakeup.
Definition: openavb_tl_pub.h:126
U32 max_transmit_deficit_usec
Maximum transmit deficit in usec - should be set to expected buffer size on the listener side (talker...
Definition: openavb_tl_pub.h:101
Number of RX frames.
Definition: openavb_tl_pub.h:64
U32 nLibCfgItems
Number of configuration parameters defined.
Definition: openavb_tl_pub.h:141
avb_role_t
Describes role of the host.
Definition: openavb_types_base_pub.h:92
void * openavbTLGetIntfHostCBList(tl_handle_t handle)
Get a pointer to a list of interfaces module callbacks.
S32 stream_uid
Stream UID (has to be unique)
Definition: openavb_tl_pub.h:91
U32 raw_rx_buffers
Number of raw rx buffers (listener only)
Definition: openavb_tl_pub.h:120
bool openavbTLIsRunning(tl_handle_t handle)
Check if a talker or listener is running.
bool openavbGetVersion(U8 *major, U8 *minor, U8 *revision)
Get the version of the AVB stack.
U32 max_frame_size
Maximum size of the frame.
Definition: openavb_tl_pub.h:95
U64 openavbTLStat(tl_handle_t handle, tl_stat_t stat)
Allows pulling current stat counters for a running stream.
bool openavbTLClose(tl_handle_t handle)
Close the talker or listener.
char * libCfgValues[MAX_LIB_CFG_ITEMS]
Configuration parameters Values for interface and mapping modules.
Definition: openavb_tl_pub.h:139
Number of TX frames.
Definition: openavb_tl_pub.h:56
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
Number of RX calls.
Definition: openavb_tl_pub.h:62
tl_stat_t
Types of statistics gathered.
Definition: openavb_tl_pub.h:52
U32 raw_tx_buffers
Number of raw TX buffers that should be used (talker only)
Definition: openavb_tl_pub.h:118
bool openavbTLReadIniFileOsal(tl_handle_t TLhandle, const char *fileName, openavb_tl_cfg_t *pCfg, openavb_tl_cfg_name_value_t *pNVCfg)
Read an ini file.
U32 max_stale
Number of microseconds after which late MediaQItem will be purged as too old (listener only) ...
Definition: openavb_tl_pub.h:106
Number of TX calls.
Definition: openavb_tl_pub.h:54
U32 max_transit_usec
Setting maximum transit time, on talker value is added to PTP Walltime, on listener value is validate...
Definition: openavb_tl_pub.h:98