SDK Version 2.0.1
AnsuR Technologies ASMIRA SDK
Loading...
Searching...
No Matches
asdk Namespace Reference

Classes

struct  frame_t
 A decoded video or photo frame, delivered by FrameFunc. More...
struct  video_options_t
 Encoder settings in effect on the sending client, delivered by VideoOptionsFunc. More...
struct  video_mode_t
 What the sending client is currently doing, delivered by VideoModeFunc. More...
struct  audio_options_t
 Audio encoder settings, see sdk_t::SetAudioOptions and sdk_t::AudioOptions. More...
struct  audio_frame_t
 Decoded room audio, delivered by DecodedAudioFrameFunc. More...
struct  position_klv_values_t
 Platform and sensor position decoded from MISB ST 0601 KLV. More...
struct  position_nmea_values_t
 Position decoded from an NMEA 0183 GNSS receiver. More...
struct  position_values_t
 Position reported by the sending client, delivered by PositionValuesFunc. More...
struct  bandwidth_statistics_t
 Full set of transport counters for one reporting period. More...
struct  bandwidth_statistics_simple_t
 Throughput of the active connection, delivered by BandwidthStatisticsFunc. More...
struct  certificate_t
 A server certificate, as filled in by sdk_t::RequestCertificate. More...
struct  sdk_t
 SDK Core. More...

Typedefs

typedef void * hsdk
typedef uint32_t RoomFlagValue
typedef uint32_t RoomStateValue
typedef uint8_t UserCapabilityValue
typedef int DeviceCapabilityValue
typedef uint8_t AudioFrameStateValue
typedef struct asdk::position_klv_values_t position_klv_values_t
typedef struct asdk::position_nmea_values_t position_nmea_values_t
typedef struct asdk::position_values_t position_values_t
typedef struct asdk::bandwidth_statistics_t bandwidth_statistics_t
using TimePoint = std::chrono::high_resolution_clock::time_point
using TimeMS = std::chrono::milliseconds
using TimePointSteady = std::chrono::steady_clock::time_point
typedef struct asdk::certificate_t certificate_t
typedef void(*) ServerStateFunc(const ServerState serverState, void *opaque)
 The connection to the server changed state.
typedef void(*) RoomAnnounceFunc(const char *roomName, const uint32_t roomID, const asdk::RoomStateValue state, const asdk::RoomFlagValue flags, void *opaque)
 A room was announced after RequestRoomListSubscribe, or an announced room changed.
typedef void(*) RoomResponseFunc(const Request request, const RoomResponse response, const void *optionalData, const uint32_t optionalDataSize, void *opaque)
 The server answered a request sent with SendRequest or SendRequestStr.
typedef void(*) RoomClientAddedFunc(const uint32_t clientID, const char *userName, const UserCapabilityValue userCapability, const DeviceCapabilityValue deviceCapability, void *opaque)
 A client joined the room, and once for each member already present when this client joined.
typedef void(*) RoomClientRemovedFunc(const uint32_t clientID, void *opaque)
 A client left the room, identified by the clientID given by RoomClientAdded.
typedef void(*) AuthenticateResponseFunc(const AuthenticationResponse authenticateResponse, void *opaque)
 The server answered the login, see AuthenticationResponse for the bits.
typedef void(*) FrameFunc(const frame_t *frame, void *opaque)
 A video or photo frame was decoded to RGB.
typedef void(*) EncodedStreamFunc(const StreamType type, const void *data, const uint32_t dataSize, void *opaque)
 An encoded frame or stream chunk arrived, before any decoding.
typedef void(*) EncodedAudioFrameFunc(const uint16_t srcID, const unsigned int timeStamp, const asdk::AudioFrameStateValue state, const unsigned char *audioEncoded, const size_t audioEncodedSize, void *opaque)
 An encoded audio frame arrived, before any decoding.
typedef void(*) VideoOptionsFunc(const video_options_t *videoOptions, void *opaque)
 The sending client reported its encoder settings, see video_options_t.
typedef void(*) VideoModeFunc(const video_mode_t *videoMode, void *opaque)
 The sending client switched photo mode, ROI or streaming on or off.
typedef void(*) PositionValuesFunc(const position_values_t *positionValues, void *opaque)
 The sending client reported a position, see position_values_t.
typedef void(*) BandwidthStatisticsFunc(const bandwidth_statistics_simple_t *bandwidthStatistics, void *opaque)
 Periodic throughput report for the active connection.
typedef void(*) RoomPreviewImageFunc(const uint32_t roomID, const uint64_t utc, const ImageFormat imageFormat, const uint8_t *data, const uint32_t size, void *opaque)
 A room preview image arrived for a room announced with RoomStatePreview.
typedef void(*) RoomFileAvailableFunc(const uint32_t roomID, const uint64_t hash, const char *fileName, const uint32_t fileSize, const uint32_t originClientID, const uint64_t utc, void *opaque)
 A room file became available to download (pull model).
typedef void(*) RoomFileDeletedFunc(const uint32_t roomID, const uint64_t hash, void *opaque)
 A room file (roomID, hash) was deleted for the whole room; drop any reference to it.
typedef void(*) RoomFileDownloadedFunc(const uint32_t roomID, const uint64_t hash, const char *fileName, const uint8_t *data, const uint32_t size, void *opaque)
 A requested room-file download finished and hash-verified: data/size hold the file bytes (valid only for the duration of the callback).
typedef void(*) RoomFileProgressFunc(const uint32_t roomID, const uint64_t hash, const char *fileName, const RoomFileDirection direction, const uint32_t transferred, const uint32_t total, void *opaque)
 Bytes moved for a transfer in either direction.
typedef void(*) RoomFileSentFunc(const uint32_t roomID, const uint64_t hash, const char *fileName, void *opaque)
 An upload reached the server, which now announces it to the other room members.
typedef void(*) RoomFileErrorFunc(const uint32_t roomID, const uint64_t hash, const char *fileName, const RoomFileError error, void *opaque)
 A transfer failed, anything already received for it has been discarded.
typedef void(*) ChatMessageFunc(const uint32_t clientID, const char *message, const uint32_t size, void *opaque)
 A chat message was received from the joined room.
typedef void(*) DecodedAudioFrameFunc(const audio_frame_t *audioFrame, void *opaque)
 A received audio frame was decoded to PCM.
typedef struct asdk::sdk_t sdk_t

Enumerations

enum  Status {
  StatusUndef ,
  StatusOK ,
  StatusDisconnected ,
  StatusError ,
  StatusErrorHandle ,
  StatusErrorVideoModule ,
  StatusErrorImageModule ,
  StatusErrorInitialized ,
  StatusErrorConnect ,
  StatusErrorTransmit ,
  StatusErrorAudioModule ,
  StatusErrorFile ,
  StatusErrorNotPermitted
}
 Result of an SDK call. More...
enum  ServerState {
  ServerStateUndef ,
  ServerStateDisconnected ,
  ServerStateConnected ,
  ServerStateConnectedAndAuthenticated ,
  ServerStateAuthenticateError
}
 State of the connection to the server, reported by ServerStateFunc. More...
enum  AuthenticationResponse {
  AuthenticationResponseUndef = 0 ,
  AuthenticationResponseSuccess = 1 << 0 ,
  AuthenticationResponseError = 1 << 1 ,
  AuthenticationResponseVersionError = 1 << 2 ,
  AuthenticationResponseVersionRecUpgrade = 1 << 3 ,
  AuthenticationResponseVersionMayUpgrade = 1 << 4 ,
  AuthenticationResponseLoggedInOther = 1 << 5 ,
  AuthenticationResponseKickedOther = 1 << 6 ,
  AuthenticationResponseWrongLoginType = 1 << 7 ,
  AuthenticationResponseTryAgainLater = 1 << 8 ,
  AuthenticationResponseFormatError = 1 << 9 ,
  AuthenticationResponseRequestedCapError = 1 << 10
}
 Outcome of a login attempt, reported by AuthenticateResponseFunc. More...
enum  Request {
  RequestUndef ,
  RequestRoomListSubscribe ,
  RequestRoomListUnsubscribe ,
  RequestRoomJoin ,
  RequestRoomLeave
}
 Request sent with sdk_t::SendRequest or sdk_t::SendRequestStr. More...
enum  RoomResponse {
  RoomResponseUndef ,
  RoomResponseSuccess ,
  RoomResponseError ,
  RoomResponseErrorAlreadyJoined ,
  RoomResponseErrorUnhandled
}
 Server answer to a Request, reported by RoomResponseFunc. More...
enum  RoomFlag {
  RoomFlagUndef ,
  RoomFlagIsPublic = 1 << 0 ,
  RoomFlagChatGuests = 1 << 1 ,
  RoomFlagChatViewers = 1 << 2 ,
  RoomFlagChatSenders = 1 << 3 ,
  RoomFlagAudioGuests = 1 << 4 ,
  RoomFlagAudioViewers = 1 << 5 ,
  RoomFlagAudioSenders = 1 << 6
}
 What a room permits, announced by RoomAnnounceFunc as a RoomFlagValue. More...
enum  RoomState {
  RoomStateUndef ,
  RoomStatePassword = 1 << 0 ,
  RoomStatePreview = 1 << 1
}
 State of a room, announced by RoomAnnounceFunc as a RoomStateValue. More...
enum  RoomFileDirection {
  RoomFileDirectionUndef ,
  RoomFileDirectionSend ,
  RoomFileDirectionReceive
}
 Room file transfer direction. More...
enum  RoomFileError {
  RoomFileErrorUndef ,
  RoomFileErrorCanceled ,
  RoomFileErrorHashMismatch ,
  RoomFileErrorFile
}
 Room file transfer failure reason. More...
enum  PositionSource {
  PositionSourceUndefined ,
  PositionSourceNMEA ,
  PositionSourceKLV
}
 Which member of position_values_t carries the position. More...
enum  StreamType {
  StreamTypeUnknown ,
  StreamType264Frame ,
  StreamType265Frame ,
  StreamTypeAV1Frame ,
  StreamTypeMPEGTS ,
  StreamTypeWEBP
}
 Kind of payload delivered by EncodedStreamFunc. More...
enum  ImageFormat {
  ImageFormatUndef ,
  ImageFormatJPEG ,
  ImageFormatWEBP ,
  ImageFormatHEIF ,
  ImageFormatAVIF ,
  ImageFormatAV1 ,
  ImageFormatH265
}
 Encoding of the image delivered by RoomPreviewImageFunc. More...
enum  UserCapability : uint8_t {
  UserCapabilityUndef = 0 ,
  UserCapabilitySender = 1 << 0 ,
  UserCapabilityController = 1 << 1 ,
  UserCapabilityViewer = 1 << 2 ,
  UserCapabilityGuest = 1 << 3 ,
  UserCapabilitySuper = 1 << 6 ,
  UserCapabilityUnsure = 1 << 7
}
 The role a client asks the server for on connect. More...
enum  DeviceCapability : int {
  DeviceCapabilityUndef = 0 ,
  DeviceCapabilityVideoAV1 = 1 << 1 ,
  DeviceCapabilityVideoH264 = 1 << 2 ,
  DeviceCapabilityVideoH265 = 1 << 3 ,
  DeviceCapabilityAudioOpus = 1 << 4 ,
  DeviceCapabilityAudioSpeex = 1 << 5 ,
  DeviceCapabilityAudioMIC = 1 << 6 ,
  DeviceCapabilityPhotoModeWEBP = 1 << 7 ,
  DeviceCapabilityPhotoModeHEIF = 1 << 8 ,
  DeviceCapabilityPhotoModeAVIF = 1 << 9 ,
  DeviceCapabilityPhotoROI = 1 << 10 ,
  DeviceCapabilityVideoROI = 1 << 11 ,
  DeviceCapabilityChat = 1 << 12 ,
  DeviceCapabilityDisplay = 1 << 13 ,
  DeviceCapabilityFileTransfer = 1 << 16 ,
  DeviceCapabilityASIGN = 1 << 31 ,
  DeviceCapabilityBasic ,
  DeviceCapabilityCore ,
  DeviceCapabilityFull ,
  DeviceCapabilityHeadless
}
 What a client announces it can do, as a DeviceCapabilityValue. More...
enum  AudioFrameState {
  AudioFrameStateUndef = 0 ,
  AudioFrameSpeex = 1 << 0 ,
  AudioFrameOpus = 1 << 1 ,
  AudioFrameServer = 1 << 2
}
 Codec and origin of an encoded audio frame, as an AudioFrameStateValue. More...
enum  AudioCodec {
  AudioCodecUndef ,
  AudioCodecOpus ,
  AudioCodecSpeex
}
 Audio codec enum, the encoder used by sdk_t::SendAudioFrame. More...
enum  CertificateState {
  CertificateStateUndef ,
  CertificateStateConnected ,
  CertificateStateReceived ,
  CertificateStateConnectError
}
 Outcome of sdk_t::RequestCertificate. More...

Functions

TimePoint TimeNow ()
 Current high resolution clock reading.
long long TimeSpent (const TimePoint &timeStart)
 Milliseconds elapsed since a TimeNow() reading.
TimePointSteady TimeNowSteady ()
 Current steady clock reading, unaffected by clock adjustments.
long long TimeSpentSteady (const TimePointSteady &time)
 Milliseconds elapsed since a TimeNowSteady() reading.
sdk_t * Initialize ()
 Loads the SDK shared library and creates an SDK handle.

Variables

static const uint8_t VERSION_MAJOR = 2
static const uint8_t VERSION_MINOR = 0
static const uint8_t VERSION_PATCH = 1
static const uint32_t CHAT_MESSAGE_LEN = 256
static const uint32_t AUDIO_SAMPLE_RATE = 16000
static const uint32_t AUDIO_CHANNELS = 1
static const uint32_t AUDIO_FRAME_SAMPLES = 320

Typedef Documentation

◆ position_klv_values_t

typedef struct asdk::position_klv_values_t asdk::position_klv_values_t

◆ position_nmea_values_t

typedef struct asdk::position_nmea_values_t asdk::position_nmea_values_t

◆ position_values_t

typedef struct asdk::position_values_t asdk::position_values_t

◆ bandwidth_statistics_t

typedef struct asdk::bandwidth_statistics_t asdk::bandwidth_statistics_t

◆ TimePoint

using asdk::TimePoint = std::chrono::high_resolution_clock::time_point

Definition at line 750 of file asmirasdk.h.

◆ TimeMS

using asdk::TimeMS = std::chrono::milliseconds

Definition at line 751 of file asmirasdk.h.

◆ TimePointSteady

using asdk::TimePointSteady = std::chrono::steady_clock::time_point
Examples
example_basic.cpp.

Definition at line 765 of file asmirasdk.h.

◆ certificate_t

typedef struct asdk::certificate_t asdk::certificate_t

◆ sdk_t

typedef struct asdk::sdk_t asdk::sdk_t