![]() |
Open-AVB AVTP Pipeline SDK
1.4
|
AVTP Time public interface. More...
#include "openavb_platform_pub.h"#include "openavb_types_pub.h"Go to the source code of this file.
Data Structures | |
| struct | avtp_time_t |
| AVTP time structure. More... | |
Typedefs | |
| typedef struct timespec | timespec_t |
| standard timespec type. | |
Functions | |
| avtp_time_t * | openavbAvtpTimeCreate (U32 maxLatencyUsec) |
| Create a avtp_time_t structure. More... | |
| void | openavbAvtpTimeDelete (avtp_time_t *pAvtpTime) |
| Delete the time struct. More... | |
| void | openavbAvtpTimeSetToWallTime (avtp_time_t *pAvtpTime) |
| Set to wall time (gPTP time). More... | |
| void | openavbAvtpTimeSetToSystemTime (avtp_time_t *pAvtpTime) |
| Set to system time. More... | |
| void | openavbAvtpTimeSetToTimestamp (avtp_time_t *pAvtpTime, U32 timestamp) |
| Set to timestamp. More... | |
| void | openavbAvtpTimeSetToTimespec (avtp_time_t *pAvtpTime, timespec_t *timestamp) |
| Set to timestamp. More... | |
| void | openavbAvtpTimePushMCR (avtp_time_t *pAvtpTime, U32 timestamp) |
| Push a timestamp, for use in Media Clock Recovery (MCR). More... | |
| void | openavbAvtpTimeSetTimestampValid (avtp_time_t *pAvtpTime, bool validFlag) |
| Set the AVTP timestamp valid indicator. More... | |
| void | openavbAvtpTimeSetTimestampUncertain (avtp_time_t *pAvtpTime, bool uncertainFlag) |
| Set the AVTP timestamp uncertain indicator. More... | |
| void | openavbAvtpTimeAddUSec (avtp_time_t *pAvtpTime, long uSec) |
| Add microseconds to the time. More... | |
| void | openavbAvtpTimeAddNSec (avtp_time_t *pAvtpTime, long nSec) |
| Add nanoseconds to the time. More... | |
| void | openavbAvtpTimeSubUSec (avtp_time_t *pAvtpTime, long uSec) |
| Subtract microseconds from the time. More... | |
| void | openavbAvtpTimeSubNSec (avtp_time_t *pAvtpTime, long nSec) |
| Subtract nanoseconds from the time. More... | |
| U32 | openavbAvtpTimeGetAvtpTimestamp (avtp_time_t *pAvtpTime) |
| Get AVTP timestamp. More... | |
| U64 | openavbAvtpTimeGetAvtpTimeNS (avtp_time_t *pAvtpTime) |
| Get AVTP timestamp in nanoseconds. More... | |
| bool | openavbAvtpTimeTimestampIsValid (avtp_time_t *pAvtpTime) |
| Get the AVTP timestamp valid indicator. More... | |
| bool | openavbAvtpTimeTimestampIsUncertain (avtp_time_t *pAvtpTime) |
| Get the AVTP timestamp uncertain indicator. More... | |
| bool | openavbAvtpTimeIsPast (avtp_time_t *pAvtpTime) |
| Check if time is in the past. More... | |
| bool | openavbAvtpTimeIsPastTime (avtp_time_t *pAvtpTime, U64 nSecTime) |
| Check if time is in the past a specific time (PTP time) More... | |
| bool | openavbAvtpTimeUsecTill (avtp_time_t *pAvtpTime, U32 *pUsecTill) |
| Determines microseconds until PTP time. More... | |
| S32 | openavbAvtpTimeUsecDelta (avtp_time_t *pAvtpTime) |
| Returns delta from timestamp and now. More... | |
AVTP Time public interface.
| avtp_time_t* openavbAvtpTimeCreate | ( | U32 | maxLatencyUsec | ) |
Create a avtp_time_t structure.
Allocate storage for a avtp_time_t structure. When a media queue items are created an avtp_time_t structure is allocated for each item. Interface modules do not need to be concerned with doing this.
| maxLatencyUsec | Maximum Latency (in usec) for the avtp_time_t structure. Timestamps greater than now + maximum latency are considered uncertain. |
| void openavbAvtpTimeDelete | ( | avtp_time_t * | pAvtpTime | ) |
Delete the time struct.
Delete the avtp_time_t structure and any additional allocations it owns.
| pAvtpTime | A pointer to the avtp_time_t structure. |
| void openavbAvtpTimeSetToWallTime | ( | avtp_time_t * | pAvtpTime | ) |
Set to wall time (gPTP time).
Set the time in the avtp_time_t structure to that of the synchronized PTP time. An interface module will normally use this function to set the time that media data was placed into the media queue.
| pAvtpTime | A pointer to the avtp_time_t structure. |
| void openavbAvtpTimeSetToSystemTime | ( | avtp_time_t * | pAvtpTime | ) |
Set to system time.
Set the time in the avtp_time_t structure to that of the system time on the device.
| pAvtpTime | A pointer to the avtp_time_t structure. |
| void openavbAvtpTimeSetToTimestamp | ( | avtp_time_t * | pAvtpTime, |
| U32 | timestamp | ||
| ) |
Set to timestamp.
Set the time in the avtp_time_t structure to the value of the timestamp parameter which is in the same format as an AVTP timestamp.
| pAvtpTime | A pointer to the avtp_time_t structure. |
| timestamp | A timestamp in the same format as the 1722 AVTP timestamp. |
| void openavbAvtpTimeSetToTimespec | ( | avtp_time_t * | pAvtpTime, |
| timespec_t * | timestamp | ||
| ) |
Set to timestamp.
Set the time in the avtp_time_t structure to the value of timespec_t *timestamp.
| pAvtpTime | A pointer to the avtp_time_t structure. |
| timestamp | A timestamp in the timespec_t format. |
| void openavbAvtpTimePushMCR | ( | avtp_time_t * | pAvtpTime, |
| U32 | timestamp | ||
| ) |
Push a timestamp, for use in Media Clock Recovery (MCR).
Push a timestamp, for use in Media Clock Recover (MCR). *pAvtpTime is not modified.
| pAvtpTime | A pointer to the avtp_time_t structure. |
| timestamp | A timestamp in the same format as the 1722 AVTP timestamp. |
| void openavbAvtpTimeSetTimestampValid | ( | avtp_time_t * | pAvtpTime, |
| bool | validFlag | ||
| ) |
Set the AVTP timestamp valid indicator.
Sets the indicator for AVTP timestamp is valid or not.
| pAvtpTime | A pointer to the avtp_time_t structure. |
| validFlag | Flag indicating is timestamp is valid. |
| void openavbAvtpTimeSetTimestampUncertain | ( | avtp_time_t * | pAvtpTime, |
| bool | uncertainFlag | ||
| ) |
Set the AVTP timestamp uncertain indicator.
Sets the indicator for AVTP timestamp is uncertain or not.
| pAvtpTime | A pointer to the avtp_time_t structure. |
| uncertainFlag | Flag indicating is timestamp is uncertain. |
| void openavbAvtpTimeAddUSec | ( | avtp_time_t * | pAvtpTime, |
| long | uSec | ||
| ) |
Add microseconds to the time.
Add the number of microseconds passed in to the time stored in avtp_time_t.
| pAvtpTime | A pointer to the avtp_time_t structure. |
| uSec | Number of microseconds to add to the stored time. |
| void openavbAvtpTimeAddNSec | ( | avtp_time_t * | pAvtpTime, |
| long | nSec | ||
| ) |
Add nanoseconds to the time.
Add the number of nanoseconds passed in to the time stored in avtp_time_t.
| pAvtpTime | A pointer to the avtp_time_t structure. |
| nSec | Number of nanoseconds to add to the stored time. |
| void openavbAvtpTimeSubUSec | ( | avtp_time_t * | pAvtpTime, |
| long | uSec | ||
| ) |
Subtract microseconds from the time.
Subtract the number of microseconds passed in from the time stored in avtp_time_t.
| pAvtpTime | A pointer to the avtp_time_t structure. |
| uSec | Number of microseconds to subtract from the stored time. |
| void openavbAvtpTimeSubNSec | ( | avtp_time_t * | pAvtpTime, |
| long | nSec | ||
| ) |
Subtract nanoseconds from the time.
Subtract the number of nanoseconds passed in from the time stored in avtp_time_t.
| pAvtpTime | A pointer to the avtp_time_t structure. |
| nSec | Number of nanoseconds to subtract from the stored time. |
| U32 openavbAvtpTimeGetAvtpTimestamp | ( | avtp_time_t * | pAvtpTime | ) |
Get AVTP timestamp.
Get the time stored in avtp_time_t and return it in an AVTP timestamp format
| pAvtpTime | A pointer to the avtp_time_t structure. |
| U64 openavbAvtpTimeGetAvtpTimeNS | ( | avtp_time_t * | pAvtpTime | ) |
Get AVTP timestamp in nanoseconds.
Get the time stored in avtp_time_t and return it as a full time value in nanoseconds
| pAvtpTime | A pointer to the avtp_time_t structure. |
| bool openavbAvtpTimeTimestampIsValid | ( | avtp_time_t * | pAvtpTime | ) |
Get the AVTP timestamp valid indicator.
Gets the indicator for AVTP timestamp is valid or not.
| pAvtpTime | A pointer to the avtp_time_t structure. |
| bool openavbAvtpTimeTimestampIsUncertain | ( | avtp_time_t * | pAvtpTime | ) |
Get the AVTP timestamp uncertain indicator.
Gets the indicator for AVTP timestamp is uncertain or not.
| pAvtpTime | A pointer to the avtp_time_t structure. |
| bool openavbAvtpTimeIsPast | ( | avtp_time_t * | pAvtpTime | ) |
Check if time is in the past.
Checks if the time stored in avtp_time_t is past the PTP wall time.
| pAvtpTime | A pointer to the avtp_time_t structure. |
| bool openavbAvtpTimeIsPastTime | ( | avtp_time_t * | pAvtpTime, |
| U64 | nSecTime | ||
| ) |
Check if time is in the past a specific time (PTP time)
Checks if the time stored in avtp_time_t is past the time passed in.
| pAvtpTime | A pointer to the avtp_time_t structure. |
| nSecTime | Time in nanoseconds to compare against. |
| bool openavbAvtpTimeUsecTill | ( | avtp_time_t * | pAvtpTime, |
| U32 * | pUsecTill | ||
| ) |
Determines microseconds until PTP time.
Returns the number of microseconds until the time stored in avtp_time_t reaches the PTP time.
| pAvtpTime | A pointer to the avtp_time_t structure. |
| pUsecTill | An output parameter that is set with the number of microseconds until the time is reached. |
| S32 openavbAvtpTimeUsecDelta | ( | avtp_time_t * | pAvtpTime | ) |
Returns delta from timestamp and now.
Returns difference between timestamp and current time.
| pAvtpTime | A pointer to the avtp_time_t structure. |
1.8.6