Twitch SDK (Internal)
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
ttv Namespace Reference

JSON (JavaScript Object Notation). More...

Namespaces

 ads
 
 assertion
 
 binding
 
 broadcast
 
 chat
 
 experiment
 
 GfxDeviceEventType
 
 json
 
 pubsub
 
 social
 
 trace
 
 tracking
 
 xml
 

Classes

class  AndroidTracer
 
struct  AudioConvertContext
 
class  AudioConverter
 
struct  AudioConvertOptionsDefaulter
 
class  AudioConvertPipeline
 
class  AutoMutex
 
class  AutoTracer
 
class  BindingFrameCapturer
 
class  BufferedSocket
 
struct  BufferFormat
 
class  Cache
 
class  CallbackQueue
 
class  CfHttpRequest
 
class  CFSocket
 
class  ChangeFloatingPointDepthOperator
 
struct  ChannelInfo
 
class  ChannelListenerProxy
 
class  ChannelRepository
 
class  ChannelStatus
 
struct  ClientServerValue
 
class  Cloneable
 
class  COMObjectDeleter
 
class  Component
 
class  ComponentContainer
 
class  ConcurrentQueue
 
class  ConvertToFloatingPointOperator
 
class  ConvertToIntegralTypeOperator
 
class  ConvertToSignedOperator
 
class  ConvertToUnsignedOperator
 
class  CoreAPI
 
struct  CyclingGenerator
 
class  DecreaseBitDepthOperator
 
struct  DefaultAudioConvertOptions
 
struct  EnumValue
 
class  EventSource
 
class  GetChannelTask
 
class  GetProfileImageUrlTask
 
class  GetStreamTask
 
class  GetUserTask
 
class  GetVodTask
 
struct  HttpParam
 
class  HttpRequest
 
class  HttpTask
 
class  IAudioConverter
 
class  IChannelListener
 
class  IChannelStatus
 
class  IComponent
 
class  IConditionMutex
 
class  ICoreApiClient
 
class  ICoreAPIListener
 
class  IEventTracker
 
class  IModule
 
class  IModuleListener
 
class  IMutex
 
class  IMutexFactory
 
class  IncreaseBitDepthOperator
 
class  ISocket
 
class  ISocketFactory
 
class  ISystemClock
 
class  IThread
 
class  IThreadApi
 
class  IThreadFactory
 
class  IThreadSync
 
class  IThreadSyncFactory
 
class  ITracer
 
class  IUserListener
 
class  IWebSocket
 
class  IWebSocketFactory
 
class  IXhr2HttpRequest
 
struct  KaiserBesselWindowFunctionGenerator
 
class  LambdaTask
 
class  LookupTable
 
struct  MakeVoid
 
struct  ManagedBroadcastAPIListener
 
struct  ManagedStatsListener
 
class  ModuleBase
 
class  OAuthToken
 
class  OpenSslSocket
 
class  OpenSslSocketFactory
 
struct  OperatorChainBuilder
 
struct  OperatorChainTupleBuilder
 
struct  OperatorChainTupleBuilder< ContextType, InputBufferFormat, OutputBufferFormat, 0, CurrentChannels... >
 
class  PagedRequestFetcher
 
class  PCMBufferAudioSource
 
struct  PreviewImages
 
struct  ProductGenerator
 
struct  ProfileImage
 
class  ProfileImageStatus
 
class  PubSubClient
 
class  PubSubClientConnection
 
class  PubSubComponent
 
class  PubSubComponentBase
 
class  PubSubTopicListenerHelper
 
class  RawCFSocketFactory
 
struct  RectangularDitherer
 
class  ResampleOperator
 
class  ResourceFactoryChain
 
class  RetryBackoffTable
 
class  RetryTimer
 
struct  RoundingDitherer
 
class  SampleCache
 
struct  SampleRange
 
class  SecureCFSocketFactory
 
class  SettingRepository
 
class  SHA1
 
class  SimpleJsonHttpTask
 
struct  SincFunctionGenerator
 
class  SocketTracker
 
class  StandardConditionMutex
 
class  StandardFileSocket
 
class  StandardFileSocketFactory
 
class  StandardMutex
 
class  StandardMutexFactory
 
class  StandardSocket
 
class  StandardSocketFactory
 
class  StandardSystemClock
 
class  StandardThread
 
class  StandardThreadApi
 
class  StandardThreadFactory
 
class  StandardThreadSync
 
class  StandardThreadSyncFactory
 
class  StandardTracer
 
class  StandardWebSocket
 
class  StandardWebSocketFactory
 
struct  StreamInfo
 
class  Task
 
class  TaskRunner
 
class  TracerBase
 
class  TrackingContext
 
class  TrackingValue
 
struct  TriangularDitherer
 
class  UploadProfileImageTask
 
class  Uri
 
class  User
 
class  UserComponent
 
struct  UserInfo
 
class  UserRepository
 
class  ValidateOAuthTask
 
class  WaitForEventWithTimeout
 
class  WaitForExpiry
 
struct  WatchPartyUpdate
 
class  WinAppSocket
 
class  WinAppSocketFactory
 
class  WinConditionMutex
 
class  WinInetHttpRequest
 
class  WinMutex
 
class  WinMutexFactory
 
class  WinSocket
 
class  WinSocketFactory
 
class  WinSystemClock
 
class  WinThread
 
class  WinThreadFactory
 
class  WinThreadSync
 
class  WinThreadSyncFactory
 
class  WinTracer
 

Typedefs

template<typename ContextType , typename InputBufferFormat , typename OutputBufferFormat , size_t SelectedChannelIndex>
using BuildOperatorChain = typename OperatorChainBuilder< ContextType, InputBufferFormat, OutputBufferFormat, SelectedChannelIndex >::Type
 
template<typename ContextType , typename InputBufferFormat , typename OutputBufferFormat >
using BuildOperatorChainTuple = typename OperatorChainTupleBuilder< ContextType, InputBufferFormat, OutputBufferFormat, InputBufferFormat::ChannelCount >::Type
 
template<typename Arg >
using VoidType = typename MakeVoid< Arg >::Type
 
typedef std::function< bool(uint statusCode, const std::map< std::string, std::string > &headers, void *userData)> HttpRequestHeadersCallback
 
typedef std::function< void(uint statusCode, const std::vector< char > &body, void *userData)> HttpRequestCallback
 
typedef std::function< void()> ThreadProc
 
using UserId = uint32_t
 
using ChannelId = uint32_t
 
using GameId = uint32_t
 
using Timestamp = uint32_t
 
using Color = uint32_t
 
using BroadcastId = uint32_t
 
typedef const char *(* ErrorToStringFunction) (TTV_ErrorCode ec)
 
typedef void(* ErrorCodeValueFunction) (std::vector< EnumValue > &result)
 
typedef void *(* TTV_AllocCallback) (size_t size, size_t alignment)
 
typedef void(* TTV_FreeCallback) (void *ptr)
 

Enumerations

enum  FilterTypeEnum { FilterTypeEnum::Kaiser }
 
enum  HttpRequestType {
  HTTP_INVALID_REQUEST = -1, HTTP_GET_REQUEST, HTTP_PUT_REQUEST, HTTP_POST_REQUEST,
  HTTP_DELETE_REQUEST, HTTP_REQUEST_COUNT
}
 
enum  { kHttpStatusCode_Success = 200 }
 
enum  BroadcasterType { BroadcasterType::Partner, BroadcasterType::Affiliate, BroadcasterType::None, BroadcasterType::Unknown }
 
enum  BroadcastPlatform {
  BroadcastPlatform::WatchParty, BroadcastPlatform::Premiere, BroadcastPlatform::Rerun, BroadcastPlatform::Playlist,
  BroadcastPlatform::Mobile, BroadcastPlatform::Xbox, BroadcastPlatform::PS4, BroadcastPlatform::Live,
  BroadcastPlatform::Unknown
}
 
enum  StreamType {
  StreamType::WatchParty, StreamType::Premiere, StreamType::Rerun, StreamType::Playlist,
  StreamType::Live, StreamType::Unknown
}
 
enum  PubSubState { PubSubState::Disconnected, PubSubState::Connecting, PubSubState::Connected, PubSubState::Disconnecting }
 
enum  VodStatus { VodStatus::Recording, VodStatus::Recorded, VodStatus::Unknown }
 
enum  VodType { VodType::Highlight, VodType::Archive, VodType::Upload, VodType::Unknown }
 

Functions

template<typename InputBufferFormat , typename OutputBufferFormat , typename ContextType >
auto MakeAudioConvertPipeline (ContextType &context)
 
SampleRange IntersectSampleRanges (SampleRange firstRange, SampleRange secondRange)
 
SampleRange ExtendSampleRange (SampleRange range, SampleRange extension)
 
template<typename IntegralType >
constexpr size_t BisectRange ()
 
template<typename SampleType >
std::enable_if_t< std::is_floating_point< SampleType >::value, SampleType > ClampAndCastSample (double input)
 
template<typename SampleType >
std::enable_if_t< std::is_integral< SampleType >::value, SampleType > ClampAndCastSample (double input)
 
TTV_ErrorCode TTV_CSharp_Broadcast_FreeAuthToken (const TTV_AuthToken *authToken)
 
TTV_ErrorCode TTV_CSharp_Broadcast_FreeIngestList (TTV_IngestList *ingestList)
 
TTV_ErrorCode TTV_CSharp_Broadcast_FreeChannelInfo (const TTV_ChannelInfo *channelInfo)
 
TTV_ErrorCode TTV_CSharp_Broadcast_FreeStreamInfo (const TTV_StreamInfo *streamInfo)
 
TTV_ErrorCode TTV_CSharp_Broadcast_FreeGameNameList (const TTV_GameInfoList *gameList)
 
TTV_ErrorCode TTV_CSharp_Broadcast_GetStreamTime (uint64_t *timeMs)
 
TTV_ErrorCode TTV_CSharp_Broadcast_FreeUserInfo (const TTV_UserInfo___ *userInfo)
 
TTV_ErrorCode TTV_CSharp_Broadcast_FreeArchivingState (const TTV_ArchivingState *state)
 
bool LookupOpenAlCaptureFunctions ()
 
ALvoid alcOutputCapturerPrepareProc (ALCuint frequency, ALCenum format, ALCsizei maxsamplecount)
 
ALvoid alcOutputCapturerStartProc ()
 
ALvoid alcOutputCapturerStopProc ()
 
ALint alcOutputCapturerAvailableSamplesProc ()
 
ALvoid alcOutputCapturerSamplesProc (ALCvoid *buffer, ALCsizei samplecount)
 
std::string Base64Encode (unsigned char const *, unsigned int len)
 
std::string Base64Decode (std::string const &s)
 
TTV_ErrorCode SetClientId (const std::string &clientId)
 
TTV_ErrorCode GetClientId (std::string &clientId)
 
template<typename T >
void AddFlag (T &x, T flag)
 
template<typename T >
void RemoveFlag (T &x, T flag)
 
template<typename T >
void SetFlag (T &x, T flag, bool value)
 
template<typename T , typename F >
bool HasFlag (T &x, F flag)
 
void SetEventTracker (const std::shared_ptr< IEventTracker > &eventTracker)
 
std::shared_ptr< IEventTrackerGetEventTracker ()
 
TTV_ErrorCode TrackEvent (const std::string &eventName, const std::map< std::string, TrackingValue > &properties)
 
void SetHttpRequest (const std::shared_ptr< HttpRequest > &http)
 
std::shared_ptr< HttpRequestGetHttpRequest ()
 
TTV_ErrorCode HttpThreadInit ()
 
TTV_ErrorCode SendHttpRequest (const std::string &url, const std::vector< HttpParam > &requestHeaders, const uint8_t *requestBody, size_t requestBodySize, HttpRequestType httpReqType, uint timeOutInSecs, HttpRequestHeadersCallback headersCallback, HttpRequestCallback responseCallback, void *userData)
 
TTV_ErrorCode SendHttpRequest (const std::string &url, const std::vector< HttpParam > &requestHeaders, const uint8_t *requestBody, size_t requestBodySize, HttpRequestType httpReqType, uint timeOutInSecs, uint numRetries, HttpRequestHeadersCallback headersCallback, HttpRequestCallback responseCallback, void *userData)
 
TTV_ErrorCode SendHttpRequest (const std::string &url, const std::vector< HttpParam > &urlParams, const std::vector< HttpParam > &requestHeaders, const uint8_t *requestBody, size_t requestBodySize, HttpRequestType httpReqType, uint timeOutInSecs, uint numRetries, HttpRequestHeadersCallback headersCallback, HttpRequestCallback responseCallback, void *userData)
 
TTV_ErrorCode HttpThreadShutdown ()
 
bool IsTwitchEndpoint (const std::string &url)
 
std::string BuildUrlEncodedRequestParams (const std::vector< std::pair< std::string, std::string >> &requestParams)
 
std::string BuildUrlEncodedRequestParams (const std::vector< HttpParam > &requestParams)
 
std::string BuildUrlEncodedRequestParams (const std::map< std::string, std::string > &requestParams)
 
std::string BuildHttpHeader (const std::vector< ttv::HttpParam > &headerParams)
 
bool ContainsHttpParameter (const std::vector< HttpParam > &headers, const std::string &name)
 
void UrlEncode (const std::string &inputString, std::stringstream &outputStream)
 
std::string UrlEncode (const std::string &inputString)
 
void UrlDecode (const std::string &inputString, std::stringstream &outputStream)
 
void UrlDecode (const std::string &input, std::string &result)
 
std::string UrlDecode (const std::string &inputString)
 
TTV_ErrorCode SplitHttpParameters (const std::string &parameterString, std::vector< std::pair< std::string, std::string >> &result)
 
TTV_ErrorCode SplitHttpParameters (const std::string &parameterString, std::map< std::string, std::string > &result)
 
TTV_ErrorCode GenerateSslVerificationHosts (const std::string &originalHost, std::vector< std::string > &result)
 
bool IsHostAnIpAddress (const std::string &hostName)
 
bool ParseString (const ttv::json::Value &root, const char *key, std::string &result)
 
bool ParseString (const ttv::json::Value &root, const std::string &key, std::string &result, const char *defaultValue)
 
bool ParseBool (const ttv::json::Value &root, const char *key, bool &result)
 
bool ParseBool (const ttv::json::Value &root, const char *key, bool &result, bool defaultValue)
 
bool ParseUInt (const ttv::json::Value &root, const char *key, uint64_t &result)
 
bool ParseUInt (const ttv::json::Value &root, const char *key, uint32_t &result)
 
bool ParseUInt (const ttv::json::Value &root, const char *key, uint64_t &result, uint64_t defaultValue)
 
bool ParseInt (const ttv::json::Value &root, const char *key, int64_t &result)
 
bool ParseInt (const ttv::json::Value &root, const char *key, int64_t &result, int64_t defaultValue)
 
bool ParseDouble (const ttv::json::Value &root, const char *key, double &result)
 
bool ParseDouble (const ttv::json::Value &root, const char *key, double &result, double defaultValue)
 
bool ParseDocument (const std::string &body, ttv::json::Value &result)
 
bool ParseDocument (const char *begin, const char *end, ttv::json::Value &result)
 
bool ParseDocument (const uint8_t *begin, const uint8_t *end, ttv::json::Value &result)
 
bool ParseDocument (const std::vector< char > &body, ttv::json::Value &result)
 
bool JsonArrayToVector (const ttv::json::Value &jArray, std::vector< float > &result)
 
bool JsonArrayToVector (const ttv::json::Value &jArray, std::vector< std::string > &result)
 
bool ParseUserId (const json::Value &jId, UserId &result)
 
bool ParseChannelId (const json::Value &jId, ChannelId &result)
 
bool ParseGameId (const json::Value &jId, GameId &result)
 
bool ParseTimestamp (const json::Value &jTimestamp, Timestamp &result)
 
bool ParseTimestamp (const ttv::json::Value &root, const char *key, Timestamp &result)
 
bool ParseColor (const std::string &str, Color &result)
 
bool ParseColor (const ttv::json::Value &root, const char *key, Color &result)
 
bool ParseColor (const ttv::json::Value &root, const char *key, Color &result, Color defaultValue)
 
bool GenerateColorString (Color color, std::string &colorString)
 
bool ParseUInt32 (const json::Value &jValue, uint32_t &result)
 
bool ParseFloat (const json::Value &jValue, float &result)
 
bool ParseChannelInfo (const ttv::json::Value &root, ChannelInfo &model)
 
bool ParseStreamInfo (const ttv::json::Value &root, StreamInfo &model)
 
void * AlignedAlloc (size_t size, size_t alignment)
 
void AlignedFree (void *p)
 
TTV_ErrorCode SetMemoryAllocationCallbacks (TTV_AllocCallback allocCallback, TTV_FreeCallback freeCallback)
 
void ShutdownModulesSync (const std::vector< std::shared_ptr< ttv::IModule >> &modules)
 
void SetMutexFactory (std::shared_ptr< IMutexFactory > factory)
 
TTV_ErrorCode CreateMutex (std::shared_ptr< IMutex > &result)
 
TTV_ErrorCode CreateConditionMutex (std::shared_ptr< IConditionMutex > &result)
 
TTV_ErrorCode InitializeSocketLibrary ()
 
TTV_ErrorCode ShutdownSocketLibrary ()
 
TTV_ErrorCode RegisterSocketFactory (const std::shared_ptr< ISocketFactory > &factory)
 
TTV_ErrorCode UnregisterSocketFactory (const std::shared_ptr< ISocketFactory > &factory)
 
TTV_ErrorCode RegisterWebSocketFactory (const std::shared_ptr< IWebSocketFactory > &factory)
 
TTV_ErrorCode UnregisterWebSocketFactory (const std::shared_ptr< IWebSocketFactory > &factory)
 
TTV_ErrorCode IsSocketProtocolSupported (const std::string &protocol)
 
TTV_ErrorCode IsWebSocketProtocolSupported (const std::string &protocol)
 
TTV_ErrorCode CreateSocket (const std::string &uri, std::shared_ptr< ISocket > &result)
 
TTV_ErrorCode CreateWebSocket (const std::string &uri, std::shared_ptr< IWebSocket > &result)
 
bool IsValidChannelName (const std::string &channelName)
 
bool IsValidUserName (const std::string &userName)
 
bool IsValidOAuthToken (const std::string &oauthToken)
 
int IsWhitespace (int ch)
 
std::string ToLowerCase (const std::string &str)
 
void Trim (std::string &str)
 
void Split (const std::string &str, std::vector< std::string > &result, char sep, bool includeEmpty)
 
void Split (const std::string &str, const std::string &delim, std::vector< std::string > &result)
 
bool StartsWith (const std::string &str, const std::string &prefix)
 
bool EndsWith (const std::string &str, const std::string &suffix)
 
bool RFC3339TimeToUnixTimestamp (const std::string &str, Timestamp &result)
 
std::string UnixTimestampToRFC3339String (Timestamp timestamp)
 
void SafeStringCopy (char *dst, const char *src, size_t maxLen)
 
std::string GetGuid ()
 
std::vector< std::string > ParseArguments (std::string args)
 
bool ParseNum (const std::string &str, int &out)
 
bool ParseNum (const std::string &str, signed char &out)
 
bool ParseNum (const std::string &str, short int &out)
 
bool ParseNum (const std::string &str, long int &out)
 
bool ParseNum (const std::string &str, long long int &out)
 
bool ParseNum (const std::string &str, unsigned int &out)
 
bool ParseNum (const std::string &str, unsigned char &out)
 
bool ParseNum (const std::string &str, unsigned short int &out)
 
bool ParseNum (const std::string &str, unsigned long int &out)
 
bool ParseNum (const std::string &str, unsigned long long int &out)
 
bool ParseNum (const std::string &str, float &out)
 
bool ParseNum (const std::string &str, double &out)
 
bool ParseNum (const std::string &str, long double &out)
 
bool ParseNum (const std::string &str, char &out)
 
void SetSystemClock (const std::shared_ptr< ISystemClock > &clock)
 
std::shared_ptr< ISystemClockGetSystemClock ()
 
uint64_t GetSystemClockFrequency ()
 
uint64_t GetSystemClockTime ()
 
uint64_t GetSystemTimeMilliseconds ()
 
uint64_t SystemTimeToMs (uint64_t sysTime)
 
uint64_t MsToSystemTime (uint64_t msTime)
 
Timestamp GetCurrentTimeAsUnixTimestamp ()
 
TTV_ErrorCode SetThreadFactory (std::shared_ptr< IThreadFactory > factory)
 
TTV_ErrorCode SetThreadApi (std::shared_ptr< IThreadApi > api)
 
void Sleep (uint64_t milliseconds)
 
TTV_ErrorCode CreateThread (ThreadProc threadProc, const std::string &name, std::shared_ptr< IThread > &result)
 
void SetThreadSyncFactory (std::shared_ptr< IThreadSyncFactory > factory)
 
TTV_ErrorCode CreateThreadSync (std::shared_ptr< IThreadSync > &result)
 
uint64_t JitterTime (uint64_t baseMs, uint64_t width)
 
void SetTracer (std::shared_ptr< ITracer > tracer)
 
void RegisterErrorToStringFunction (ErrorToStringFunction func)
 
void UnregisterErrorToStringFunction (ErrorToStringFunction func)
 
void RegisterErrorCodeValueFunction (ErrorCodeValueFunction func)
 
void UnregisterErrorCodeValueFunction (ErrorCodeValueFunction func)
 
const char * ErrorToString (TTV_ErrorCode ec)
 
const char * CoreErrorToString (TTV_ErrorCode ec)
 
void GetCoreErrorCodeValues (std::vector< EnumValue > &result)
 
void GetAllErrorCodes (std::vector< EnumValue > &result)
 
bool IsUtf8StartByte (char b)
 
bool IsUtf8SequenceByte (char b)
 
const char * AdvanceToNextUtf8Character (const char *cur, int &sequenceLength)
 
int CountUtf8Bytes (const char *start, int numCharacters)
 
bool IsValidUtf8 (const char *str, bool &hasFourByteChars)
 
TTV_ErrorCode SetVersionString (const std::string &clientId)
 
TTV_ErrorCode GetVersionString (std::string &clientId)
 

Variables

constexpr double kPi = 3.14159265358979323846
 
ManagedBroadcastAPIListener gManagedBroadcastAPIListener
 
ManagedStatsListener gManagedStatsListener
 
bool gBroadcastInitialized
 

Detailed Description

JSON (JavaScript Object Notation).


Class Documentation

◆ ttv::AudioConvertContext

struct ttv::AudioConvertContext

template<typename PassedOptions = void>
struct ttv::AudioConvertContext< PassedOptions >

Class Members
typedef FilterOptionsProvider
< Options >
FilterOptions
typedef
AudioConvertOptionsDefaulter
< PassedOptions >
Options

◆ ttv::MakeVoid

struct ttv::MakeVoid

template<typename Arg>
struct ttv::MakeVoid< Arg >

Class Members
typedef void Type

◆ ttv::OperatorChainBuilder

struct ttv::OperatorChainBuilder

template<typename ContextType, typename InputBufferFormat, typename OutputBufferFormat, size_t SelectedChannelIndex>
struct ttv::OperatorChainBuilder< ContextType, InputBufferFormat, OutputBufferFormat, SelectedChannelIndex >

This class builds a chain of operators to convert audio from a given input buffer format to an output buffer format.

Template Parameters
ContextTypeThe type of AudioConvertContext for the operators to use. See audioconvertcontext.h
InputBufferFormatThe input buffer format. See BufferFormat in dsputilities.h
OutputBufferFormatThe output buffer format. See BufferFormat in dsputilities.h
SelectedChannelIndexWhich input audio channel this chain will process.
Class Members
typedef conditional_t
< is_floating_point
< OutputSampleType >::value,
ChangeFloatingPointDepthWrapper
< Input, OutputSampleType >
, MatchSignedness
< ConvertToIntegralTypeWrapper
< Input, MakeSignedIfIntegral
< OutputSampleType >
>, OutputSampleType > >
ConvertFloatingToSampleType
typedef conditional_t
< SampleRate==SampleRate,
MatchSampleType< Input,
typename SampleType >
, ConvertSampleRateAndType
< Input, Output > >
ConvertFormat
typedef conditional_t< sizeof(typename
SampleType)< sizeof(OutputSampleType),
IncreaseBitDepthWrapper< Input,
OutputSampleType >
, DecreaseBitDepthWrapper
< Input, OutputSampleType > >
ConvertIntegralDepth
typedef conditional_t
< is_floating_point
< OutputSampleType >::value,
ConvertToFloatingTypeWrapper
< MatchSignedness< Input,
OutputSampleType >
, OutputSampleType >
, MatchIntegralDepth
< MatchSignedness< Input,
OutputSampleType >
, OutputSampleType > >
ConvertIntegralToSampleType
typedef conditional_t<(sizeof(typename
SampleType)< sizeof(typename
SampleType)), MatchSignedness
< ResampleWrapper
< MatchSampleType< Input,
MakeSignedIfIntegral< typename
SampleType > >, SampleRate >
, typename SampleType >
, MatchSampleType
< ResampleWrapper< MakeSigned
< Input >, SampleRate >
, typename SampleType > >
ConvertSampleRateAndType
typedef conditional_t
< is_floating_point< typename
SampleType >::value,
ConvertFloatingToSampleType
< Input, OutputSampleType >
, ConvertIntegralToSampleType
< Input, OutputSampleType > >
ConvertSampleType
typedef conditional_t
< is_signed< typename
SampleType >::value,
ConvertToUnsignedWrapper
< Input >
, ConvertToSignedWrapper
< Input > >
FlipSignedness
typedef conditional_t
< is_unsigned< typename
SampleType >::value,
ConvertToSignedWrapper< Input >
, Input >
MakeSigned
typedef typename
MakeSignedIfIntegralSelector
< ScalarType >::Type
MakeSignedIfIntegral
typedef conditional_t< sizeof(typename
SampleType)==sizeof(OutputSampleType),
Input, ConvertIntegralDepth
< Input, OutputSampleType > >
MatchIntegralDepth
typedef conditional_t< is_same
< typename SampleType,
OutputSampleType >::value,
Input, ConvertSampleType
< Input, OutputSampleType > >
MatchSampleType
typedef conditional_t
< is_signed< typename
SampleType >::value==is_signed
< OutputSampleType >::value,
Input, FlipSignedness< Input > >
MatchSignedness
typedef typename template Unwrap<> Type
typedef ConvertFormat
< InputSourceWrapper,
OutputBufferFormat >
WrappedType

◆ ttv::OperatorChainTupleBuilder

struct ttv::OperatorChainTupleBuilder

template<typename ContextType, typename InputBufferFormat, typename OutputBufferFormat, size_t RemainingChannelCount, typename ... CurrentChannels>
struct ttv::OperatorChainTupleBuilder< ContextType, InputBufferFormat, OutputBufferFormat, RemainingChannelCount, CurrentChannels >

Class Members
typedef BuildOperatorChain
< ContextType,
InputBufferFormat,
OutputBufferFormat,
RemainingChannelCount - 1 >
AppendedOperatorChain
Type

◆ ttv::OperatorChainTupleBuilder< ContextType, InputBufferFormat, OutputBufferFormat, 0, CurrentChannels... >

struct ttv::OperatorChainTupleBuilder< ContextType, InputBufferFormat, OutputBufferFormat, 0, CurrentChannels... >

template<typename ContextType, typename InputBufferFormat, typename OutputBufferFormat, typename ... CurrentChannels>
struct ttv::OperatorChainTupleBuilder< ContextType, InputBufferFormat, OutputBufferFormat, 0, CurrentChannels... >

Class Members
Type

◆ ttv::PreviewImages

struct ttv::PreviewImages

PreviewImages - URLs for preview images (of different sizes).

Class Members
string largeUrl
string mediumUrl
string smallUrl
string templateUrl

◆ ttv::ProfileImage

struct ttv::ProfileImage

ProfileImage - Info about a new profile image.

Class Members
string format The filetype/format of the profile image.
uint32_t height Height of the profile image.
string url The URL of the profile image.
uint32_t width Width of the profile image.

Typedef Documentation

◆ BroadcastId

using ttv::BroadcastId = typedef uint32_t

◆ BuildOperatorChain

template<typename ContextType , typename InputBufferFormat , typename OutputBufferFormat , size_t SelectedChannelIndex>
using ttv::BuildOperatorChain = typedef typename OperatorChainBuilder<ContextType, InputBufferFormat, OutputBufferFormat, SelectedChannelIndex>::Type

◆ BuildOperatorChainTuple

template<typename ContextType , typename InputBufferFormat , typename OutputBufferFormat >
using ttv::BuildOperatorChainTuple = typedef typename OperatorChainTupleBuilder<ContextType, InputBufferFormat, OutputBufferFormat, InputBufferFormat::ChannelCount>::Type

◆ ChannelId

using ttv::ChannelId = typedef uint32_t

◆ Color

using ttv::Color = typedef uint32_t

◆ ErrorCodeValueFunction

typedef void(* ttv::ErrorCodeValueFunction) (std::vector< EnumValue > &result)

Function signature for getting available error codes.

◆ ErrorToStringFunction

typedef const char*(* ttv::ErrorToStringFunction) (TTV_ErrorCode ec)

Function signature for getting a human readable string value for an error code.

◆ GameId

using ttv::GameId = typedef uint32_t

◆ HttpRequestCallback

typedef std::function<void (uint statusCode, const std::vector<char>& body, void* userData)> ttv::HttpRequestCallback

◆ HttpRequestHeadersCallback

typedef std::function<bool (uint statusCode, const std::map<std::string, std::string>& headers, void* userData)> ttv::HttpRequestHeadersCallback

◆ ThreadProc

typedef std::function<void()> ttv::ThreadProc

◆ Timestamp

using ttv::Timestamp = typedef uint32_t

◆ TTV_AllocCallback

typedef void*(* ttv::TTV_AllocCallback) (size_t size, size_t alignment)

Signature for memory allocating.

◆ TTV_FreeCallback

typedef void(* ttv::TTV_FreeCallback) (void *ptr)

Signature for freeing a memory allocation.

◆ UserId

using ttv::UserId = typedef uint32_t

◆ VoidType

template<typename Arg >
using ttv::VoidType = typedef typename MakeVoid<Arg>::Type

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kHttpStatusCode_Success 

◆ BroadcasterType

enum ttv::BroadcasterType
strong
Enumerator
Partner 
Affiliate 
None 

If neither Partner nor Affiliate.

Unknown 

◆ BroadcastPlatform

BroadcastPlaform - Broadcast platform of a given stream.

Enumerator
WatchParty 
Premiere 
Rerun 
Playlist 
Mobile 
Xbox 
PS4 
Live 
Unknown 

◆ FilterTypeEnum

enum ttv::FilterTypeEnum
strong

The following is the concept for the structure the user can provide containing the configuration options for audio conversion. Any non-specified options will be filled by default values (see DefaultAudioConvertOptions below).

struct AudioConvertOptions { // The ditherer to use when quantizing the bit depth of data. See ditherers.h for the available // ditherers. using Ditherer = ...;

// The filter cutoff to use when downsampling audio, represented as the ratio between the desired // cutoff frequency and the output sample rate. The Nyquist frequency of a digital signal (that is, // the highest frequency that can be represented at the signal's sample rate without aliasing) is // is 0.5 times the sample rate. Since the low-pass filter's frequency response function is // slightly tapered rather than a perfect rectangular function, this is usually set slightly below // 0.5. static constexpr double FilterCutoff = ...;

// The type of low-pass filter to use when resampling. See descriptions in FilterTypeEnum below. static constexpr FilterTypeEnum FilterType = ...;

// The beta factor to use when using the Kaiser-Bessel Window function. static constexpr double KaiserBeta = ...;

// The width of the window when using a finite impulse response low-pass filter, in input samples. static constexpr size_t FilterTapCount = ...; } The type of low pass filter to use when resampling audio.

Enumerator
Kaiser 

Finite impulse response filter with a Kaiser-Bessel window function.

◆ HttpRequestType

Enumerator
HTTP_INVALID_REQUEST 
HTTP_GET_REQUEST 
HTTP_PUT_REQUEST 
HTTP_POST_REQUEST 
HTTP_DELETE_REQUEST 
HTTP_REQUEST_COUNT 

◆ PubSubState

enum ttv::PubSubState
strong
Enumerator
Disconnected 
Connecting 
Connected 
Disconnecting 

◆ StreamType

enum ttv::StreamType
strong

StreamType - Type of a given stream. Is deprecated in favor of BroadcastPlatform on the back-end.

Enumerator
WatchParty 
Premiere 
Rerun 
Playlist 
Live 
Unknown 

◆ VodStatus

enum ttv::VodStatus
strong

VodStatus - The current status for a VOD object on the backend.

Enumerator
Recording 
Recorded 

The VOD is still being recorded and the stream is live.

Unknown 

The VOD has finished being recorded and is available.

◆ VodType

enum ttv::VodType
strong

VodType - The type of VOD represented.

Enumerator
Highlight 
Archive 
Upload 
Unknown 

Function Documentation

◆ AddFlag()

template<typename T >
void ttv::AddFlag ( T &  x,
flag 
)

◆ AdvanceToNextUtf8Character()

const char* ttv::AdvanceToNextUtf8Character ( const char *  cur,
int &  sequenceLength 
)
inline

◆ alcOutputCapturerAvailableSamplesProc()

ALint ttv::alcOutputCapturerAvailableSamplesProc ( )

◆ alcOutputCapturerPrepareProc()

ALvoid ttv::alcOutputCapturerPrepareProc ( ALCuint  frequency,
ALCenum  format,
ALCsizei  maxsamplecount 
)

◆ alcOutputCapturerSamplesProc()

ALvoid ttv::alcOutputCapturerSamplesProc ( ALCvoid *  buffer,
ALCsizei  samplecount 
)

◆ alcOutputCapturerStartProc()

ALvoid ttv::alcOutputCapturerStartProc ( )

◆ alcOutputCapturerStopProc()

ALvoid ttv::alcOutputCapturerStopProc ( )

◆ AlignedAlloc()

void* ttv::AlignedAlloc ( size_t  size,
size_t  alignment 
)

Performs an aligned allocation using the registered allocator.

◆ AlignedFree()

void ttv::AlignedFree ( void *  p)

Fres an allocation previously allocated via AlignedAlloc().

◆ Base64Decode()

std::string ttv::Base64Decode ( std::string const &  s)

◆ Base64Encode()

std::string ttv::Base64Encode ( unsigned char const *  ,
unsigned int  len 
)

◆ BisectRange()

template<typename IntegralType >
constexpr size_t ttv::BisectRange ( )

This function takes an integral type and returns a value equal to half the cardinality of that type, basically 2^(number of bits of the type) / 2. This is useful in a few DSP situations. In particular, it represents the centerpoint of a signal for an unsigned type. It also represents the distance from the centerpoint to the maximum value of the signal for both signed and unsigned types.

◆ BuildHttpHeader()

std::string ttv::BuildHttpHeader ( const std::vector< ttv::HttpParam > &  headerParams)

◆ BuildUrlEncodedRequestParams() [1/3]

std::string ttv::BuildUrlEncodedRequestParams ( const std::vector< std::pair< std::string, std::string >> &  requestParams)

◆ BuildUrlEncodedRequestParams() [2/3]

std::string ttv::BuildUrlEncodedRequestParams ( const std::vector< HttpParam > &  requestParams)

◆ BuildUrlEncodedRequestParams() [3/3]

std::string ttv::BuildUrlEncodedRequestParams ( const std::map< std::string, std::string > &  requestParams)

◆ ClampAndCastSample() [1/2]

template<typename SampleType >
std::enable_if_t<std::is_floating_point<SampleType>::value, SampleType> ttv::ClampAndCastSample ( double  input)

Converts a double precision floating point value to the specified type and clamps it to the expected bounds. This overload is for floating point types, which should have values between -1.0 and 1.0.

Template Parameters
SampleTypeThe sample type to convert to.

◆ ClampAndCastSample() [2/2]

template<typename SampleType >
std::enable_if_t<std::is_integral<SampleType>::value, SampleType> ttv::ClampAndCastSample ( double  input)

Converts a double precision floating point value to the specified type and clamps it to the expected bounds. This overload is for integral point types, which should have values between their maximum and minimum representable values.

Template Parameters
SampleTypeThe sample type to convert to.

◆ ContainsHttpParameter()

bool ttv::ContainsHttpParameter ( const std::vector< HttpParam > &  headers,
const std::string &  name 
)

◆ CoreErrorToString()

const char* ttv::CoreErrorToString ( TTV_ErrorCode  ec)

The error code string lookup for core. This is not normally used directly by clients. Use ttv::ErrorToString() instead.

◆ CountUtf8Bytes()

int ttv::CountUtf8Bytes ( const char *  start,
int  numCharacters 
)
inline

◆ CreateConditionMutex()

TTV_ErrorCode ttv::CreateConditionMutex ( std::shared_ptr< IConditionMutex > &  result)

◆ CreateMutex()

TTV_ErrorCode ttv::CreateMutex ( std::shared_ptr< IMutex > &  result)

◆ CreateSocket()

TTV_ErrorCode ttv::CreateSocket ( const std::string &  uri,
std::shared_ptr< ISocket > &  result 
)

Attempts to create an ISocket instance that supports the given URI.

When creating a new ISocket the registered factories will be visited in order of newest to oldest registration until one is found that supports the requested protocol.

See also
RegisterSocketFactory
Parameters
[in]uriThe full uri to create the socket for.
[out]resultThe resulting ISocket instance if it was able to be created.
Returns
  • TTV_EC_SUCCESS: The result has been populated with an ISocket instance to use.
  • TTV_EC_NOT_INITIALIZED: The socket library has not yet been initialized.
  • TTV_EC_NO_FACTORIES_REGISTERED: There are no registed factories.
  • TTV_EC_UNIMPLEMENTED: There are factories registered but none of them support the protocol.

◆ CreateThread()

TTV_ErrorCode ttv::CreateThread ( ThreadProc  threadProc,
const std::string &  name,
std::shared_ptr< IThread > &  result 
)

◆ CreateThreadSync()

TTV_ErrorCode ttv::CreateThreadSync ( std::shared_ptr< IThreadSync > &  result)

◆ CreateWebSocket()

TTV_ErrorCode ttv::CreateWebSocket ( const std::string &  uri,
std::shared_ptr< IWebSocket > &  result 
)

Attempts to create an IWebSocket instance that supports the given URI.

When creating a new IWebSocket the registered factories will be visited in order of newest to oldest registration until one is found that supports the requested protocol.

See also
RegisterWebSocketFactory
Parameters
[in]uriThe full uri to create the socket for.
[out]resultThe resulting IWebSocket instance if it was able to be created.
Returns
  • TTV_EC_SUCCESS: The result has been populated with an IWebSocket instance to use.
  • TTV_EC_NOT_INITIALIZED: The socket library has not yet been initialized.
  • TTV_EC_NO_FACTORIES_REGISTERED: There are no registed factories.
  • TTV_EC_UNIMPLEMENTED: There are factories registered but none of them support the protocol.

◆ EndsWith()

bool ttv::EndsWith ( const std::string &  str,
const std::string &  suffix 
)

◆ ErrorToString()

const char* ttv::ErrorToString ( TTV_ErrorCode  ec)

The central error code string lookup function to be used by clients which want a human readable string from a generic error code.

◆ ExtendSampleRange()

SampleRange ttv::ExtendSampleRange ( SampleRange  range,
SampleRange  extension 
)

Performs a union of the sample ranges if and only if the ranges overlap or are contiguous. If they are not, just returns the first range.

◆ GenerateColorString()

bool ttv::GenerateColorString ( Color  color,
std::string &  colorString 
)

◆ GenerateSslVerificationHosts()

TTV_ErrorCode ttv::GenerateSslVerificationHosts ( const std::string &  originalHost,
std::vector< std::string > &  result 
)

Generate all possible hosts (i.e. by removing subdomains) for a given hostname. Example: chat.twitch.tv -> {chat.twitch.tv, *.twitch.tv, twitch.tv}.

◆ GetAllErrorCodes()

void ttv::GetAllErrorCodes ( std::vector< EnumValue > &  result)

◆ GetClientId()

TTV_ErrorCode ttv::GetClientId ( std::string &  clientId)

Retrieves the currently set client-id.

◆ GetCoreErrorCodeValues()

void ttv::GetCoreErrorCodeValues ( std::vector< EnumValue > &  result)

◆ GetCurrentTimeAsUnixTimestamp()

Timestamp ttv::GetCurrentTimeAsUnixTimestamp ( )

Gets the absolute current time as seconds since epoch.

◆ GetEventTracker()

std::shared_ptr<IEventTracker> ttv::GetEventTracker ( )

Gets the currently registered event handler.

◆ GetGuid()

std::string ttv::GetGuid ( )

Generates a 32 character random string.

◆ GetHttpRequest()

std::shared_ptr<HttpRequest> ttv::GetHttpRequest ( )

Retrieves the currently configured HttpRequest instance.

◆ GetSystemClock()

std::shared_ptr<ISystemClock> ttv::GetSystemClock ( )

Retrieves the registered global system clock implementation for the entire SDK.

◆ GetSystemClockFrequency()

uint64_t ttv::GetSystemClockFrequency ( )

Retrieves the reported value of ISystemClock::GetFrequency() from the registered system clock.

◆ GetSystemClockTime()

uint64_t ttv::GetSystemClockTime ( )

Retrieves the reported value of ISystemClock::GetTime() from the registered system clock. The reported time may not have a consitent base value so it is only useful for relative measurements.

◆ GetSystemTimeMilliseconds()

uint64_t ttv::GetSystemTimeMilliseconds ( )

Retrieves the current system time in milliseconds. The reported time may not have a consitent base value so it is only useful for relative measurements.

◆ GetVersionString()

TTV_ErrorCode ttv::GetVersionString ( std::string &  clientId)

Retrieves the version string for the sdk.

◆ HasFlag()

template<typename T , typename F >
bool ttv::HasFlag ( T &  x,
flag 
)

◆ HttpThreadInit()

TTV_ErrorCode ttv::HttpThreadInit ( )

◆ HttpThreadShutdown()

TTV_ErrorCode ttv::HttpThreadShutdown ( )

◆ InitializeSocketLibrary()

TTV_ErrorCode ttv::InitializeSocketLibrary ( )

Initializes the socket library subsystem. This must be done once before any socket factories are registered.

See also
ShutdownSocketLibrary
Returns
  • TTV_EC_SUCCESS: There is at least one factory registered that supports the given protocol.
  • TTV_EC_NOT_INITIALIZED: The socket library has not yet been initialized.
  • TTV_EC_ALREADY_INITIALIZED: The socket library subsystem has already been initialized.

◆ IntersectSampleRanges()

SampleRange ttv::IntersectSampleRanges ( SampleRange  firstRange,
SampleRange  secondRange 
)

Returns the intersection of two sample ranges. If the ranges do not intersect, returns {0, 0}

◆ IsHostAnIpAddress()

bool ttv::IsHostAnIpAddress ( const std::string &  hostName)

Returns whether or not a given hostname is in the format of a 32-bit IPv4 address. Checks for dotted decimal representation (a.b.c.d). Does not check if the IP address is valid (will still return true even if numbers > 255).

◆ IsSocketProtocolSupported()

TTV_ErrorCode ttv::IsSocketProtocolSupported ( const std::string &  protocol)

Determines if there is a registered ISocketFactory that supports the named protocol.

See also
RegisterSocketFactory
Parameters
[in]protocolThe protocol to check. It is the short protocol name, such as "http".
Returns
  • TTV_EC_SUCCESS: There is at least one factory registered that supports the given protocol.
  • TTV_EC_NOT_INITIALIZED: The socket library has not yet been initialized.
  • TTV_EC_NO_FACTORIES_REGISTERED: There are no registed factories.
  • TTV_EC_UNIMPLEMENTED: There are factories registered but none of them support the protocol.

◆ IsTwitchEndpoint()

bool ttv::IsTwitchEndpoint ( const std::string &  url)

Determines if the given url represents a Twitch endpoint.

◆ IsUtf8SequenceByte()

bool ttv::IsUtf8SequenceByte ( char  b)
inline

◆ IsUtf8StartByte()

bool ttv::IsUtf8StartByte ( char  b)
inline

◆ IsValidChannelName()

bool ttv::IsValidChannelName ( const std::string &  channelName)

◆ IsValidOAuthToken()

bool ttv::IsValidOAuthToken ( const std::string &  oauthToken)

◆ IsValidUserName()

bool ttv::IsValidUserName ( const std::string &  userName)

◆ IsValidUtf8()

bool ttv::IsValidUtf8 ( const char *  str,
bool &  hasFourByteChars 
)
inline

This function validates if the input string is in valid UTF-8 format

References:

Parameters
[in]strThe string (of char* type) to validate
[out]hasFourByteCharsReturns if the string has any four byte characters

Valid UTF-8 Code Units: 0b00000000-0b01111111 (0x00-0x7F): Single-byte code unit (ASCII) 0b10000000-0b10111111 (0x80-0xBF): Continuation byte code unit 0b11000010-0b11011111 (0xC2-0xDF): Two byte starting code unit 0b11100000-0b11101111 (0xE0-0xEF): Three byte starting code unit Some continutation code units after 0xE0-0xEF are not valid For 0b11100000 (0xE0): Second byte must be 0b10100000-0b10111111 (0xA0-0xBF) For 0b11101101 (0xED): Second byte must be 0b10000000-0b10011111 (0x80-0x9F) 0b11110000-0b11110100 (0xF0-0xF4): Four byte starting code unit Some continuation code units after 0xF0-0xF4 are not valid For 0b11110000 (0xF0): Second byte must be 0b10010000-0b10111111 (0x90-0xBF) For 0b11110100 (0xF4): Second byte must be 0b10000000-0b10001111 (0x80-0x8F)

Invalid UTF-8 Code Units: 0b11000000-0b11000001 (0xC0-0xC1) 0b11110101-0b11111111 (0xF5-0xFF)

◆ IsWebSocketProtocolSupported()

TTV_ErrorCode ttv::IsWebSocketProtocolSupported ( const std::string &  protocol)

Determines if there is a registered IWebSocketFactory that supports the named protocol.

See also
RegisterWebSocketFactory
Parameters
[in]protocolThe protocol to check. It is the short protocol name, such as "ws".
Returns
  • TTV_EC_SUCCESS: There is at least one factory registered that supports the given protocol.
  • TTV_EC_NOT_INITIALIZED: The socket library has not yet been initialized.
  • TTV_EC_NO_FACTORIES_REGISTERED: There are no registed factories.
  • TTV_EC_UNIMPLEMENTED: There are factories registered but none of them support the protocol.

◆ IsWhitespace()

int ttv::IsWhitespace ( int  ch)

◆ JitterTime()

uint64_t ttv::JitterTime ( uint64_t  baseMs,
uint64_t  width 
)

◆ JsonArrayToVector() [1/2]

bool ttv::JsonArrayToVector ( const ttv::json::Value jArray,
std::vector< float > &  result 
)

◆ JsonArrayToVector() [2/2]

bool ttv::JsonArrayToVector ( const ttv::json::Value jArray,
std::vector< std::string > &  result 
)

◆ LookupOpenAlCaptureFunctions()

bool ttv::LookupOpenAlCaptureFunctions ( )

◆ MakeAudioConvertPipeline()

template<typename InputBufferFormat , typename OutputBufferFormat , typename ContextType >
auto ttv::MakeAudioConvertPipeline ( ContextType &  context)

◆ MsToSystemTime()

uint64_t ttv::MsToSystemTime ( uint64_t  msTime)

Converts milliseconds to system time.

◆ ParseArguments()

std::vector<std::string> ttv::ParseArguments ( std::string  args)

◆ ParseBool() [1/2]

bool ttv::ParseBool ( const ttv::json::Value root,
const char *  key,
bool &  result 
)

Parse a bool from the given Json object. Returns false if the object does not contain the given key.

◆ ParseBool() [2/2]

bool ttv::ParseBool ( const ttv::json::Value root,
const char *  key,
bool &  result,
bool  defaultValue 
)

Parse a bool from the given Json object. In case of errors or a null value, assigns 'defaultValue' to 'result'. Returns true if the value is null. Returns false if the value is missing or not a string.

◆ ParseChannelId()

bool ttv::ParseChannelId ( const json::Value jId,
ChannelId result 
)

◆ ParseChannelInfo()

bool ttv::ParseChannelInfo ( const ttv::json::Value root,
ChannelInfo model 
)

Parses the standard user object returned from Kraken.

◆ ParseColor() [1/3]

bool ttv::ParseColor ( const std::string &  str,
Color result 
)

◆ ParseColor() [2/3]

bool ttv::ParseColor ( const ttv::json::Value root,
const char *  key,
Color result 
)

◆ ParseColor() [3/3]

bool ttv::ParseColor ( const ttv::json::Value root,
const char *  key,
Color result,
Color  defaultValue 
)

◆ ParseDocument() [1/4]

bool ttv::ParseDocument ( const std::string &  body,
ttv::json::Value result 
)

Attempts to parse the given string as json and will return the parsed document if possible.

◆ ParseDocument() [2/4]

bool ttv::ParseDocument ( const char *  begin,
const char *  end,
ttv::json::Value result 
)

Attempts to parse the given byte array as json and will return the parsed document if possible.

◆ ParseDocument() [3/4]

bool ttv::ParseDocument ( const uint8_t *  begin,
const uint8_t *  end,
ttv::json::Value result 
)

Attempts to parse the given byte array as json and will return the parsed document if possible.

◆ ParseDocument() [4/4]

bool ttv::ParseDocument ( const std::vector< char > &  body,
ttv::json::Value result 
)

Attempts to parse the given byte array as json and will return the parsed document if possible.

◆ ParseDouble() [1/2]

bool ttv::ParseDouble ( const ttv::json::Value root,
const char *  key,
double &  result 
)

Parse a Double from the given Json object. Returns false if the object does not contain the given key.

◆ ParseDouble() [2/2]

bool ttv::ParseDouble ( const ttv::json::Value root,
const char *  key,
double &  result,
double  defaultValue 
)

Parse a Double from the given Json object. In case of errors or a null value, assigns 'defaultValue' to 'result'. Returns true if the value is null. Returns false if the value is missing or not a string.

◆ ParseFloat()

bool ttv::ParseFloat ( const json::Value jValue,
float &  result 
)

◆ ParseGameId()

bool ttv::ParseGameId ( const json::Value jId,
GameId result 
)

◆ ParseInt() [1/2]

bool ttv::ParseInt ( const ttv::json::Value root,
const char *  key,
int64_t &  result 
)

Parse a Int64_t from the given Json object. Returns false if the object does not contain the given key.

◆ ParseInt() [2/2]

bool ttv::ParseInt ( const ttv::json::Value root,
const char *  key,
int64_t &  result,
int64_t  defaultValue 
)

Parse a Int64_t from the given Json object. In case of errors or a null value, assigns 'defaultValue' to 'result'. Returns true if the value is null. Returns false if the value is missing or not a string.

◆ ParseNum() [1/14]

bool ttv::ParseNum ( const std::string &  str,
int &  out 
)

Overloaded helper function to parse a numerical value from a string. Uses sscanf from <stdio> http://en.cppreference.com/w/c/io/fscanf http://www.cplusplus.com/reference/cstdio/scanf

Returns
true if number was parsed correctly.

◆ ParseNum() [2/14]

bool ttv::ParseNum ( const std::string &  str,
signed char &  out 
)

◆ ParseNum() [3/14]

bool ttv::ParseNum ( const std::string &  str,
short int &  out 
)

◆ ParseNum() [4/14]

bool ttv::ParseNum ( const std::string &  str,
long int &  out 
)

◆ ParseNum() [5/14]

bool ttv::ParseNum ( const std::string &  str,
long long int &  out 
)

◆ ParseNum() [6/14]

bool ttv::ParseNum ( const std::string &  str,
unsigned int &  out 
)

◆ ParseNum() [7/14]

bool ttv::ParseNum ( const std::string &  str,
unsigned char &  out 
)

◆ ParseNum() [8/14]

bool ttv::ParseNum ( const std::string &  str,
unsigned short int &  out 
)

◆ ParseNum() [9/14]

bool ttv::ParseNum ( const std::string &  str,
unsigned long int &  out 
)

◆ ParseNum() [10/14]

bool ttv::ParseNum ( const std::string &  str,
unsigned long long int &  out 
)

◆ ParseNum() [11/14]

bool ttv::ParseNum ( const std::string &  str,
float &  out 
)

◆ ParseNum() [12/14]

bool ttv::ParseNum ( const std::string &  str,
double &  out 
)

◆ ParseNum() [13/14]

bool ttv::ParseNum ( const std::string &  str,
long double &  out 
)

◆ ParseNum() [14/14]

bool ttv::ParseNum ( const std::string &  str,
char &  out 
)

◆ ParseStreamInfo()

bool ttv::ParseStreamInfo ( const ttv::json::Value root,
StreamInfo model 
)

◆ ParseString() [1/2]

bool ttv::ParseString ( const ttv::json::Value root,
const char *  key,
std::string &  result 
)

Parse a string from the given Json object. Returns false if the object does not contain the given key.

◆ ParseString() [2/2]

bool ttv::ParseString ( const ttv::json::Value root,
const std::string &  key,
std::string &  result,
const char *  defaultValue 
)

Parse a string from the given Json object. In case of errors or a null value, assigns 'defaultValue' to 'result'. Returns true if the value is null. Returns false if the value is missing or not a string.

◆ ParseTimestamp() [1/2]

bool ttv::ParseTimestamp ( const json::Value jTimestamp,
Timestamp result 
)

◆ ParseTimestamp() [2/2]

bool ttv::ParseTimestamp ( const ttv::json::Value root,
const char *  key,
Timestamp result 
)

◆ ParseUInt() [1/3]

bool ttv::ParseUInt ( const ttv::json::Value root,
const char *  key,
uint64_t &  result 
)

Parse a uint64_t from the given Json object. Returns false if the object does not contain the given key.

◆ ParseUInt() [2/3]

bool ttv::ParseUInt ( const ttv::json::Value root,
const char *  key,
uint32_t &  result 
)

Parse a uint32_t from the given Json object. Returns false if the object does not contain the given key.

◆ ParseUInt() [3/3]

bool ttv::ParseUInt ( const ttv::json::Value root,
const char *  key,
uint64_t &  result,
uint64_t  defaultValue 
)

Parse a UInt64_t from the given Json object. In case of errors or a null value, assigns 'defaultValue' to 'result'. Returns true if the value is null. Returns false if the value is missing or not a string.

◆ ParseUInt32()

bool ttv::ParseUInt32 ( const json::Value jValue,
uint32_t &  result 
)

◆ ParseUserId()

bool ttv::ParseUserId ( const json::Value jId,
UserId result 
)

◆ RegisterErrorCodeValueFunction()

void ttv::RegisterErrorCodeValueFunction ( ErrorCodeValueFunction  func)

Registers a function which will populate error code values.

◆ RegisterErrorToStringFunction()

void ttv::RegisterErrorToStringFunction ( ErrorToStringFunction  func)

Registers an error code to string function. Each module should register a function for its error codes.

◆ RegisterSocketFactory()

TTV_ErrorCode ttv::RegisterSocketFactory ( const std::shared_ptr< ISocketFactory > &  factory)

Registers an ISocketFactory to be used when creating ISocket instances.

See also
CreateSocket
UnregisterSocketFactory
Parameters
[in]factoryThe factory to register. Cannot be null or already registered.
Returns
  • TTV_EC_SUCCESS: The factory was successfully registered.
  • TTV_EC_NOT_INITIALIZED: The socket library has not yet been initialized.
  • TTV_EC_INVALID_ARG: The factory is null or was already registered.

◆ RegisterWebSocketFactory()

TTV_ErrorCode ttv::RegisterWebSocketFactory ( const std::shared_ptr< IWebSocketFactory > &  factory)

Registers an IWebSocketFactory to be used when creating IWebSocket instances.

See also
CreateWebSocket
UnregisterWebSocketFactory
Parameters
[in]factoryThe factory to register. Cannot be null or already registered.
Returns
  • TTV_EC_SUCCESS: The factory was successfully registered.
  • TTV_EC_NOT_INITIALIZED: The socket library has not yet been initialized.
  • TTV_EC_INVALID_ARG: The factory is null or was already registered.

◆ RemoveFlag()

template<typename T >
void ttv::RemoveFlag ( T &  x,
flag 
)

◆ RFC3339TimeToUnixTimestamp()

bool ttv::RFC3339TimeToUnixTimestamp ( const std::string &  str,
Timestamp result 
)

◆ SafeStringCopy()

void ttv::SafeStringCopy ( char *  dst,
const char *  src,
size_t  maxLen 
)

A better string copying function which guarantees null termination of the destination. Some platform versions of snprintf don't handle all cases as expected.

◆ SendHttpRequest() [1/3]

TTV_ErrorCode ttv::SendHttpRequest ( const std::string &  url,
const std::vector< HttpParam > &  requestHeaders,
const uint8_t *  requestBody,
size_t  requestBodySize,
HttpRequestType  httpReqType,
uint  timeOutInSecs,
HttpRequestHeadersCallback  headersCallback,
HttpRequestCallback  responseCallback,
void *  userData 
)

◆ SendHttpRequest() [2/3]

TTV_ErrorCode ttv::SendHttpRequest ( const std::string &  url,
const std::vector< HttpParam > &  requestHeaders,
const uint8_t *  requestBody,
size_t  requestBodySize,
HttpRequestType  httpReqType,
uint  timeOutInSecs,
uint  numRetries,
HttpRequestHeadersCallback  headersCallback,
HttpRequestCallback  responseCallback,
void *  userData 
)

◆ SendHttpRequest() [3/3]

TTV_ErrorCode ttv::SendHttpRequest ( const std::string &  url,
const std::vector< HttpParam > &  urlParams,
const std::vector< HttpParam > &  requestHeaders,
const uint8_t *  requestBody,
size_t  requestBodySize,
HttpRequestType  httpReqType,
uint  timeOutInSecs,
uint  numRetries,
HttpRequestHeadersCallback  headersCallback,
HttpRequestCallback  responseCallback,
void *  userData 
)

◆ SetClientId()

TTV_ErrorCode ttv::SetClientId ( const std::string &  clientId)

Sets the Twitch client-id to be used in the system. This must be set before initializing any modules and must not be set again until all modules are fully shut down.

◆ SetEventTracker()

void ttv::SetEventTracker ( const std::shared_ptr< IEventTracker > &  eventTracker)

Registers the tracking event handler for the whole SDK.

◆ SetFlag()

template<typename T >
void ttv::SetFlag ( T &  x,
flag,
bool  value 
)

◆ SetHttpRequest()

void ttv::SetHttpRequest ( const std::shared_ptr< HttpRequest > &  http)

◆ SetMemoryAllocationCallbacks()

TTV_ErrorCode ttv::SetMemoryAllocationCallbacks ( TTV_AllocCallback  allocCallback,
TTV_FreeCallback  freeCallback 
)

This will set custom memory allocation callbacks to be used by all Twitch SDK code.

◆ SetMutexFactory()

void ttv::SetMutexFactory ( std::shared_ptr< IMutexFactory factory)

◆ SetSystemClock()

void ttv::SetSystemClock ( const std::shared_ptr< ISystemClock > &  clock)

Registers the global system clock implementation for the entire SDK.

◆ SetThreadApi()

TTV_ErrorCode ttv::SetThreadApi ( std::shared_ptr< IThreadApi api)

◆ SetThreadFactory()

TTV_ErrorCode ttv::SetThreadFactory ( std::shared_ptr< IThreadFactory factory)

◆ SetThreadSyncFactory()

void ttv::SetThreadSyncFactory ( std::shared_ptr< IThreadSyncFactory factory)

◆ SetTracer()

void ttv::SetTracer ( std::shared_ptr< ITracer tracer)

◆ SetVersionString()

TTV_ErrorCode ttv::SetVersionString ( const std::string &  clientId)

Sets the version string for the sdk. This should be called be the glue code generated by the generator scripts.

◆ ShutdownModulesSync()

void ttv::ShutdownModulesSync ( const std::vector< std::shared_ptr< ttv::IModule >> &  modules)

Allows clients to quickly shut down all modules in the SDK synchronously. The list of modules must be given in order of shutdown. Thus, CoreAPI must appear last in the list if it is to be shut down.

◆ ShutdownSocketLibrary()

TTV_ErrorCode ttv::ShutdownSocketLibrary ( )

Shuts down the socket library subsystem. This should only be done after all modules are shut down and no more clients are using sockets. It is intended to be called some time after InitializeSocketLibrary() is called but it is safe to call ShutdownSocketLibrary() even if the library is already shut down or was never initialized.

See also
InitializeSocketLibrary
Returns
  • TTV_EC_SUCCESS: There is at least one factory registered that supports the given protocol.
  • TTV_EC_NOT_INITIALIZED: The socket library has not yet been initialized.

◆ Sleep()

void ttv::Sleep ( uint64_t  milliseconds)

Calls Sleep() on the registered ttv::IThreadApi.

◆ Split() [1/2]

void ttv::Split ( const std::string &  str,
std::vector< std::string > &  result,
char  sep,
bool  includeEmpty 
)

◆ Split() [2/2]

void ttv::Split ( const std::string &  str,
const std::string &  delim,
std::vector< std::string > &  result 
)

◆ SplitHttpParameters() [1/2]

TTV_ErrorCode ttv::SplitHttpParameters ( const std::string &  parameterString,
std::vector< std::pair< std::string, std::string >> &  result 
)

◆ SplitHttpParameters() [2/2]

TTV_ErrorCode ttv::SplitHttpParameters ( const std::string &  parameterString,
std::map< std::string, std::string > &  result 
)

◆ StartsWith()

bool ttv::StartsWith ( const std::string &  str,
const std::string &  prefix 
)

◆ SystemTimeToMs()

uint64_t ttv::SystemTimeToMs ( uint64_t  sysTime)

Converts system time to milliseconds.

◆ ToLowerCase()

std::string ttv::ToLowerCase ( const std::string &  str)

◆ TrackEvent()

TTV_ErrorCode ttv::TrackEvent ( const std::string &  eventName,
const std::map< std::string, TrackingValue > &  properties 
)

Sends a tracking event to the globally registered event handler.

Parameters
[in]eventNameThe name of the event to send.
[in]propertiesA map of the event properties to send with the event.
Returns
An error code indicating the result of sending the tracking event. TTV_EC_SUCCESS - Sending the event succeeded TTV_EC_NOT_AVAILABLE - No event tracker is registered. TTV_EC_HTTPREQUEST_ERROR - The event failed to send due to an HTTP error.

◆ Trim()

void ttv::Trim ( std::string &  str)

◆ TTV_CSharp_Broadcast_FreeArchivingState()

TTV_ErrorCode ttv::TTV_CSharp_Broadcast_FreeArchivingState ( const TTV_ArchivingState *  state)

◆ TTV_CSharp_Broadcast_FreeAuthToken()

TTV_ErrorCode ttv::TTV_CSharp_Broadcast_FreeAuthToken ( const TTV_AuthToken *  authToken)

◆ TTV_CSharp_Broadcast_FreeChannelInfo()

TTV_ErrorCode ttv::TTV_CSharp_Broadcast_FreeChannelInfo ( const TTV_ChannelInfo *  channelInfo)

◆ TTV_CSharp_Broadcast_FreeGameNameList()

TTV_ErrorCode ttv::TTV_CSharp_Broadcast_FreeGameNameList ( const TTV_GameInfoList *  gameList)

◆ TTV_CSharp_Broadcast_FreeIngestList()

TTV_ErrorCode ttv::TTV_CSharp_Broadcast_FreeIngestList ( TTV_IngestList *  ingestList)

◆ TTV_CSharp_Broadcast_FreeStreamInfo()

TTV_ErrorCode ttv::TTV_CSharp_Broadcast_FreeStreamInfo ( const TTV_StreamInfo *  streamInfo)

◆ TTV_CSharp_Broadcast_FreeUserInfo()

TTV_ErrorCode ttv::TTV_CSharp_Broadcast_FreeUserInfo ( const TTV_UserInfo___ *  userInfo)

◆ TTV_CSharp_Broadcast_GetStreamTime()

TTV_ErrorCode ttv::TTV_CSharp_Broadcast_GetStreamTime ( uint64_t *  timeMs)

◆ UnixTimestampToRFC3339String()

std::string ttv::UnixTimestampToRFC3339String ( Timestamp  timestamp)

◆ UnregisterErrorCodeValueFunction()

void ttv::UnregisterErrorCodeValueFunction ( ErrorCodeValueFunction  func)

Unregisters a function which will populate error code values.

◆ UnregisterErrorToStringFunction()

void ttv::UnregisterErrorToStringFunction ( ErrorToStringFunction  func)

Unregisters a function previously registered via UnregisterErrorToStringFunction().

◆ UnregisterSocketFactory()

TTV_ErrorCode ttv::UnregisterSocketFactory ( const std::shared_ptr< ISocketFactory > &  factory)

Unregisters an ISocketFactory previously registered via RegisterSocketFactory().

See also
RegisterSocketFactory
Parameters
[in]factoryThe factory to unregister. Cannot be null and must be previously registered.
Returns
  • TTV_EC_SUCCESS: The factory was successfully unregistered.
  • TTV_EC_INVALID_ARG: The factory is null or was not previously registered.

◆ UnregisterWebSocketFactory()

TTV_ErrorCode ttv::UnregisterWebSocketFactory ( const std::shared_ptr< IWebSocketFactory > &  factory)

Unregisters an IWebSocketFactory previously registered via RegisterWebSocketFactory().

See also
RegisterWebSocketFactory
Parameters
[in]factoryThe factory to unregister. Cannot be null and must be previously registered.
Returns
  • TTV_EC_SUCCESS: The factory was successfully unregistered.
  • TTV_EC_INVALID_ARG: The factory is null or was not previously registered.

◆ UrlDecode() [1/3]

void ttv::UrlDecode ( const std::string &  inputString,
std::stringstream &  outputStream 
)

◆ UrlDecode() [2/3]

void ttv::UrlDecode ( const std::string &  input,
std::string &  result 
)

◆ UrlDecode() [3/3]

std::string ttv::UrlDecode ( const std::string &  inputString)

◆ UrlEncode() [1/2]

void ttv::UrlEncode ( const std::string &  inputString,
std::stringstream &  outputStream 
)

◆ UrlEncode() [2/2]

std::string ttv::UrlEncode ( const std::string &  inputString)

Variable Documentation

◆ gBroadcastInitialized

bool ttv::gBroadcastInitialized

◆ gManagedBroadcastAPIListener

ManagedBroadcastAPIListener ttv::gManagedBroadcastAPIListener

◆ gManagedStatsListener

ManagedStatsListener ttv::gManagedStatsListener

◆ kPi

constexpr double ttv::kPi = 3.14159265358979323846