Skip to content

Commit

Permalink
Merge pull request COVESA#11 from boschglobal/remove/platform_specific
Browse files Browse the repository at this point in the history
Remove/platform specific
  • Loading branch information
nayakned authored Jul 16, 2024
2 parents 98d7121 + 7e737d7 commit cb6e035
Show file tree
Hide file tree
Showing 20 changed files with 78 additions and 939 deletions.
1 change: 0 additions & 1 deletion examples/aaf/aaf-listener.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
#include <unistd.h>
#include <inttypes.h>

#include "avtp.h"
#include "avtp/aaf/PcmStream.h"
#include "common.h"
#include "avtp/CommonHeader.h"
Expand Down
1 change: 0 additions & 1 deletion examples/aaf/aaf-talker.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
#include <string.h>
#include <unistd.h>

#include "avtp.h"
#include "avtp/aaf/PcmStream.h"
#include "common.h"
#include "avtp/CommonHeader.h"
Expand Down
1 change: 0 additions & 1 deletion examples/crf/crf-listener.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@
#include <math.h>
#include <inttypes.h>

#include "avtp.h"
#include "avtp/Crf.h"
#include "avtp/aaf/PcmStream.h"
#include "common.h"
Expand Down
1 change: 0 additions & 1 deletion examples/crf/crf-talker.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
#include <unistd.h>
#include <math.h>

#include "avtp.h"
#include "avtp/Crf.h"
#include "common.h"
#include "avtp/CommonHeader.h"
Expand Down
1 change: 0 additions & 1 deletion examples/cvf/cvf-listener.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
#include <unistd.h>
#include <inttypes.h>

#include "avtp.h"
#include "avtp/cvf/Cvf.h"
#include "avtp/cvf/H264.h"
#include "avtp/CommonHeader.h"
Expand Down
1 change: 0 additions & 1 deletion examples/cvf/cvf-talker.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
#include <string.h>
#include <unistd.h>

#include "avtp.h"
#include "avtp/cvf/Cvf.h"
#include "avtp/cvf/H264.h"
#include "common.h"
Expand Down
90 changes: 0 additions & 90 deletions include/avtp.h

This file was deleted.

50 changes: 48 additions & 2 deletions include/avtp/CommonHeader.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ typedef struct {
* Enumeration over all IEEE 1722 header fields. The naming convention used is
* AVTP_<MSG_TYPE>_FIELD_<FIEL_NAME>.
*/
typedef enum {
typedef enum Avtp_CommonHeaderField{
/* Common AVTP header fields */
AVTP_COMMON_HEADER_FIELD_SUBTYPE = 0,
AVTP_COMMON_HEADER_FIELD_H,
Expand Down Expand Up @@ -104,4 +104,50 @@ int Avtp_CommonHeader_GetField(Avtp_CommonHeader_t* avtp_pdu, Avtp_CommonHeaderF
* @returns This function returns 0 if the data field was successfully set in
* the 1722 AVTP PDU.
*/
int Avtp_CommonHeader_SetField(Avtp_CommonHeader_t* avtp_pdu, Avtp_CommonHeaderField_t field, uint64_t value);
int Avtp_CommonHeader_SetField(Avtp_CommonHeader_t* avtp_pdu, Avtp_CommonHeaderField_t field, uint64_t value);

/******************************************************************************
* Legacy API (deprecated)
*****************************************************************************/

struct avtp_common_pdu {
uint32_t subtype_data;
uint8_t pdu_specific[0];
} __attribute__ ((__packed__));

struct avtp_stream_pdu {
uint32_t subtype_data;
uint64_t stream_id;
uint32_t avtp_time;
uint32_t format_specific;
uint32_t packet_info;
uint8_t avtp_payload[0];
} __attribute__ ((__packed__));

#define AVTP_FIELD_SUBTYPE (AVTP_COMMON_HEADER_FIELD_SUBTYPE)
#define AVTP_FIELD_VERSION (AVTP_COMMON_HEADER_FIELD_VERSION)
#define AVTP_FIELD_MAX (AVTP_COMMON_HEADER_FIELD_MAX)

/* Get value from Common AVTPDU field.
* @pdu: Pointer to PDU struct.
* @field: PDU field to be retrieved.
* @val: Pointer to variable which the retrieved value should be saved.
*
* Returns:
* 0: Success.
* -EINVAL: If any argument is invalid.
*/
int avtp_pdu_get(const struct avtp_common_pdu *pdu, Avtp_CommonHeaderField_t field,
uint32_t *val);

/* Set value from Common AVTPDU field.
* @pdu: Pointer to PDU struct.
* @field: PDU field to be set.
* @val: Value to be set.
*
* Returns:
* 0: Success.
* -EINVAL: If any argument is invalid.
*/
int avtp_pdu_set(struct avtp_common_pdu *pdu, Avtp_CommonHeaderField_t field,
uint32_t val);
100 changes: 0 additions & 100 deletions include/avtp_stream.h

This file was deleted.

14 changes: 0 additions & 14 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ project(
avtp_lib = library(
'open1722',
[
'src/avtp.c',
'src/avtp_stream.c',

'src/avtp/Utils.c',
'src/avtp/acf/Ntscf.c',
'src/avtp/acf/Tscf.c',
Expand Down Expand Up @@ -127,16 +124,6 @@ if cmocka.found()
build_by_default: false,
)

test_stream = executable(
'test-stream',
'unit/test-stream.c',
'src/avtp_stream.c',
include_directories: include_directories('include', 'src'),
link_with: avtp_lib,
dependencies: cmocka,
build_by_default: false,
)

test_cvf = executable(
'test-cvf',
'unit/test-cvf.c',
Expand All @@ -157,7 +144,6 @@ if cmocka.found()


test('AVTP API', test_avtp)
test('Stream API', test_stream)
test('AAF API', test_aaf)
test('CRF API', test_crf)
test('CVF API', test_cvf)
Expand Down
Loading

0 comments on commit cb6e035

Please sign in to comment.