Initial setup for CLion
This commit is contained in:
79
MediaClient/libsrt/include/srt/access_control.h
Normal file
79
MediaClient/libsrt/include/srt/access_control.h
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* SRT - Secure, Reliable, Transport
|
||||
* Copyright (c) 2020 Haivision Systems Inc.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
written by
|
||||
Haivision Systems Inc.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef INC_F_ACCESS_CONTROL_H
|
||||
#define INC_F_ACCESS_CONTROL_H
|
||||
|
||||
// A list of rejection codes that are SRT specific.
|
||||
|
||||
#define SRT_REJX_FALLBACK 1000 // A code used in case when the application wants to report some problem, but can't precisely specify it.
|
||||
#define SRT_REJX_KEY_NOTSUP 1001 // The key used in the StreamID keyed string is not supported by the service.
|
||||
#define SRT_REJX_FILEPATH 1002 // The resource type designates a file and the path is either wrong syntax or not found
|
||||
#define SRT_REJX_HOSTNOTFOUND 1003 // The `h` host specification was not recognized by the service
|
||||
|
||||
// The list of http codes adopted for SRT.
|
||||
// An example C++ header for HTTP codes can be found at:
|
||||
// https://github.com/j-ulrich/http-status-codes-cpp
|
||||
|
||||
// Some of the unused code can be revived in the future, if there
|
||||
// happens to be a good reason for it.
|
||||
|
||||
#define SRT_REJX_BAD_REQUEST 1400 // General syntax error in the SocketID specification (also a fallback code for undefined cases)
|
||||
#define SRT_REJX_UNAUTHORIZED 1401 // Authentication failed, provided that the user was correctly identified and access to the required resource would be granted
|
||||
#define SRT_REJX_OVERLOAD 1402 // The server is too heavily loaded, or you have exceeded credits for accessing the service and the resource.
|
||||
#define SRT_REJX_FORBIDDEN 1403 // Access denied to the resource by any kind of reason.
|
||||
#define SRT_REJX_NOTFOUND 1404 // Resource not found at this time.
|
||||
#define SRT_REJX_BAD_MODE 1405 // The mode specified in `m` key in StreamID is not supported for this request.
|
||||
#define SRT_REJX_UNACCEPTABLE 1406 // The requested parameters specified in SocketID cannot be satisfied for the requested resource. Also when m=publish and the data format is not acceptable.
|
||||
// CODE NOT IN USE 407: unused: proxy functionality not predicted
|
||||
// CODE NOT IN USE 408: unused: no timeout predicted for listener callback
|
||||
#define SRT_REJX_CONFLICT 1409 // The resource being accessed is already locked for modification. This is in case of m=publish and the specified resource is currently read-only.
|
||||
// CODE NOT IN USE 410: unused: treated as a specific case of 404
|
||||
// CODE NOT IN USE 411: unused: no reason to include lenght in the protocol
|
||||
// CODE NOT IN USE 412: unused: preconditions not predicted in AC
|
||||
// CODE NOT IN USE 413: unused: AC size is already defined as 512
|
||||
// CODE NOT IN USE 414: unused: AC size is already defined as 512
|
||||
#define SRT_REJX_NOTSUP_MEDIA 1415 // The media type is not supported by the application. This is the `t` key that specifies the media type as stream, file and auth, possibly extended by the application.
|
||||
// CODE NOT IN USE 416: unused: no detailed specification defined
|
||||
// CODE NOT IN USE 417: unused: expectations not supported
|
||||
// CODE NOT IN USE 418: unused: sharks do not drink tea
|
||||
// CODE NOT IN USE 419: not defined in HTTP
|
||||
// CODE NOT IN USE 420: not defined in HTTP
|
||||
// CODE NOT IN USE 421: unused: misdirection not supported
|
||||
// CODE NOT IN USE 422: unused: aligned to general 400
|
||||
#define SRT_REJX_LOCKED 1423 // The resource being accessed is locked for any access.
|
||||
#define SRT_REJX_FAILED_DEPEND 1424 // The request failed because it specified a dependent session ID that has been disconnected.
|
||||
// CODE NOT IN USE 425: unused: replaying not supported
|
||||
// CODE NOT IN USE 426: unused: tempting, but it requires resend in connected
|
||||
// CODE NOT IN USE 427: not defined in HTTP
|
||||
// CODE NOT IN USE 428: unused: renders to 409
|
||||
// CODE NOT IN USE 429: unused: renders to 402
|
||||
// CODE NOT IN USE 451: unused: renders to 403
|
||||
#define SRT_REJX_ISE 1500 // Unexpected internal server error
|
||||
#define SRT_REJX_UNIMPLEMENTED 1501 // The request was recognized, but the current version doesn't support it.
|
||||
#define SRT_REJX_GW 1502 // The server acts as a gateway and the target endpoint rejected the connection.
|
||||
#define SRT_REJX_DOWN 1503 // The service has been temporarily taken over by a stub reporting this error. The real service can be down for maintenance or crashed.
|
||||
// CODE NOT IN USE 504: unused: timeout not supported
|
||||
#define SRT_REJX_VERSION 1505 // SRT version not supported. This might be either unsupported backward compatibility, or an upper value of a version.
|
||||
// CODE NOT IN USE 506: unused: negotiation and references not supported
|
||||
#define SRT_REJX_NOROOM 1507 // The data stream cannot be archived due to lacking storage space. This is in case when the request type was to send a file or the live stream to be archived.
|
||||
// CODE NOT IN USE 508: unused: no redirection supported
|
||||
// CODE NOT IN USE 509: not defined in HTTP
|
||||
// CODE NOT IN USE 510: unused: extensions not supported
|
||||
// CODE NOT IN USE 511: unused: intercepting proxies not supported
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
107
MediaClient/libsrt/include/srt/logging_api.h
Normal file
107
MediaClient/libsrt/include/srt/logging_api.h
Normal file
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* SRT - Secure, Reliable, Transport
|
||||
* Copyright (c) 2018 Haivision Systems Inc.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
written by
|
||||
Haivision Systems Inc.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef INC_SRT_LOGGING_API_H
|
||||
#define INC_SRT_LOGGING_API_H
|
||||
|
||||
// These are required for access functions:
|
||||
// - adding FA (requires set)
|
||||
// - setting a log stream (requires iostream)
|
||||
#ifdef __cplusplus
|
||||
#include <set>
|
||||
#include <iostream>
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "win/syslog_defs.h"
|
||||
#else
|
||||
#include <syslog.h>
|
||||
#endif
|
||||
|
||||
// Syslog is included so that it provides log level names.
|
||||
// Haivision log standard requires the same names plus extra one:
|
||||
#ifndef LOG_DEBUG_TRACE
|
||||
#define LOG_DEBUG_TRACE 8
|
||||
#endif
|
||||
// It's unused anyway, just for the record.
|
||||
#define SRT_LOG_LEVEL_MIN LOG_CRIT
|
||||
#define SRT_LOG_LEVEL_MAX LOG_DEBUG
|
||||
|
||||
// Flags
|
||||
#define SRT_LOGF_DISABLE_TIME 1
|
||||
#define SRT_LOGF_DISABLE_THREADNAME 2
|
||||
#define SRT_LOGF_DISABLE_SEVERITY 4
|
||||
#define SRT_LOGF_DISABLE_EOL 8
|
||||
|
||||
// Handler type.
|
||||
typedef void SRT_LOG_HANDLER_FN(void* opaque, int level, const char* file, int line, const char* area, const char* message);
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace srt_logging
|
||||
{
|
||||
|
||||
|
||||
struct LogFA
|
||||
{
|
||||
private:
|
||||
int value;
|
||||
public:
|
||||
operator int() const { return value; }
|
||||
|
||||
LogFA(int v): value(v)
|
||||
{
|
||||
// Generally this was what it has to be used for.
|
||||
// Unfortunately it couldn't be agreed with the
|
||||
//logging_fa_all.insert(v);
|
||||
}
|
||||
};
|
||||
|
||||
const LogFA LOGFA_GENERAL = 0;
|
||||
|
||||
|
||||
|
||||
namespace LogLevel
|
||||
{
|
||||
// There are 3 general levels:
|
||||
|
||||
// A. fatal - this means the application WILL crash.
|
||||
// B. unexpected:
|
||||
// - error: this was unexpected for the library
|
||||
// - warning: this was expected by the library, but may be harmful for the application
|
||||
// C. expected:
|
||||
// - note: a significant, but rarely occurring event
|
||||
// - debug: may occur even very often and enabling it can harm performance
|
||||
|
||||
enum type
|
||||
{
|
||||
fatal = LOG_CRIT,
|
||||
// Fatal vs. Error: with Error, you can still continue.
|
||||
error = LOG_ERR,
|
||||
// Error vs. Warning: Warning isn't considered a problem for the library.
|
||||
warning = LOG_WARNING,
|
||||
// Warning vs. Note: Note means something unusual, but completely correct behavior.
|
||||
note = LOG_NOTICE,
|
||||
// Note vs. Debug: Debug may occur even multiple times in a millisecond.
|
||||
// (Well, worth noting that Error and Warning potentially also can).
|
||||
debug = LOG_DEBUG
|
||||
};
|
||||
}
|
||||
|
||||
class Logger;
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
123
MediaClient/libsrt/include/srt/platform_sys.h
Normal file
123
MediaClient/libsrt/include/srt/platform_sys.h
Normal file
@@ -0,0 +1,123 @@
|
||||
/*
|
||||
* SRT - Secure, Reliable, Transport
|
||||
* Copyright (c) 2018 Haivision Systems Inc.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
*/
|
||||
#ifndef INC_SRT_PLATFORM_SYS_H
|
||||
#define INC_SRT_PLATFORM_SYS_H
|
||||
|
||||
// INFORMATION
|
||||
//
|
||||
// This file collects all required platform-specific declarations
|
||||
// required to provide everything that the SRT library needs from system.
|
||||
//
|
||||
// There's also semi-modular system implemented using SRT_IMPORT_* macros.
|
||||
// To require a module to be imported, #define SRT_IMPORT_* where * is
|
||||
// the module name. Currently handled module macros:
|
||||
//
|
||||
// SRT_IMPORT_TIME (mach time on Mac, portability gettimeofday on WIN32)
|
||||
// SRT_IMPORT_EVENT (includes kevent on Mac)
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
#define _CRT_SECURE_NO_WARNINGS 1 // silences windows complaints for sscanf
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#include <ws2ipdef.h>
|
||||
#include <windows.h>
|
||||
|
||||
#ifndef __MINGW32__
|
||||
#include <intrin.h>
|
||||
#endif
|
||||
|
||||
#ifdef SRT_IMPORT_TIME
|
||||
#include <win/wintime.h>
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
#if defined(_MSC_VER)
|
||||
#pragma warning(disable: 4251 26812)
|
||||
#endif
|
||||
#else
|
||||
|
||||
#if defined(__APPLE__) && __APPLE__
|
||||
// Warning: please keep this test as it is, do not make it
|
||||
// "#if __APPLE__" or "#ifdef __APPLE__". In applications with
|
||||
// a strict "no warning policy", "#if __APPLE__" triggers an "undef"
|
||||
// error. With GCC, an old & never fixed bug prevents muting this
|
||||
// warning (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431).
|
||||
// Before this fix, the solution was to "#define __APPLE__ 0" before
|
||||
// including srt.h. So, don't use "#ifdef __APPLE__" either.
|
||||
|
||||
// XXX Check if this condition doesn't require checking of
|
||||
// also other macros, like TARGET_OS_IOS etc.
|
||||
|
||||
#include "TargetConditionals.h"
|
||||
#define __APPLE_USE_RFC_3542 /* IPV6_PKTINFO */
|
||||
|
||||
#ifdef SRT_IMPORT_TIME
|
||||
#include <mach/mach_time.h>
|
||||
#endif
|
||||
|
||||
#ifdef SRT_IMPORT_EVENT
|
||||
#include <sys/types.h>
|
||||
#include <sys/event.h>
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef BSD
|
||||
#ifdef SRT_IMPORT_EVENT
|
||||
#include <sys/types.h>
|
||||
#include <sys/event.h>
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef LINUX
|
||||
|
||||
#ifdef SRT_IMPORT_EVENT
|
||||
#include <sys/epoll.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __ANDROID__
|
||||
|
||||
#ifdef SRT_IMPORT_EVENT
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/time.h>
|
||||
#include <netdb.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
// Headers for errno, string and stdlib are
|
||||
// included indirectly correct C++ way.
|
||||
#else
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
1001
MediaClient/libsrt/include/srt/srt.h
Normal file
1001
MediaClient/libsrt/include/srt/srt.h
Normal file
File diff suppressed because it is too large
Load Diff
274
MediaClient/libsrt/include/srt/udt.h
Normal file
274
MediaClient/libsrt/include/srt/udt.h
Normal file
@@ -0,0 +1,274 @@
|
||||
/*
|
||||
* SRT - Secure, Reliable, Transport
|
||||
* Copyright (c) 2018 Haivision Systems Inc.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
Copyright (c) 2001 - 2011, The Board of Trustees of the University of Illinois.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
* Redistributions of source code must retain the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the
|
||||
above copyright notice, this list of conditions
|
||||
and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of the University of Illinois
|
||||
nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
written by
|
||||
Yunhong Gu, last updated 01/18/2011
|
||||
modified by
|
||||
Haivision Systems Inc.
|
||||
*****************************************************************************/
|
||||
|
||||
/* WARNING!!!
|
||||
* Since now this file is a "C and C++ header".
|
||||
* It should be then able to be interpreted by C compiler, so
|
||||
* all C++-oriented things must be ifdef'd-out by __cplusplus.
|
||||
*
|
||||
* Mind also comments - to prevent any portability problems,
|
||||
* B/C++ comments (// -> EOL) should not be used unless the
|
||||
* area is under __cplusplus condition already.
|
||||
*
|
||||
* NOTE: this file contains _STRUCTURES_ that are common to C and C++,
|
||||
* plus some functions and other functionalities ONLY FOR C++. This
|
||||
* file doesn't contain _FUNCTIONS_ predicted to be used in C - see udtc.h
|
||||
*/
|
||||
|
||||
#ifndef INC_SRT_UDT_H
|
||||
#define INC_SRT_UDT_H
|
||||
|
||||
#include "srt.h"
|
||||
|
||||
/*
|
||||
* SRT_ENABLE_THREADCHECK IS SET IN MAKEFILE, NOT HERE
|
||||
*/
|
||||
#if defined(SRT_ENABLE_THREADCHECK)
|
||||
#include "threadcheck.h"
|
||||
#else
|
||||
#define THREAD_STATE_INIT(name)
|
||||
#define THREAD_EXIT()
|
||||
#define THREAD_PAUSED()
|
||||
#define THREAD_RESUMED()
|
||||
#define INCREMENT_THREAD_ITERATIONS()
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <fstream>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//if compiling on VC6.0 or pre-WindowsXP systems
|
||||
//use -DLEGACY_WIN32
|
||||
|
||||
//if compiling with MinGW, it only works on XP or above
|
||||
//use -D_WIN32_WINNT=0x0501
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
struct CPerfMon
|
||||
{
|
||||
// global measurements
|
||||
int64_t msTimeStamp; // time since the UDT entity is started, in milliseconds
|
||||
int64_t pktSentTotal; // total number of sent data packets, including retransmissions
|
||||
int64_t pktRecvTotal; // total number of received packets
|
||||
int pktSndLossTotal; // total number of lost packets (sender side)
|
||||
int pktRcvLossTotal; // total number of lost packets (receiver side)
|
||||
int pktRetransTotal; // total number of retransmitted packets
|
||||
int pktRcvRetransTotal; // total number of retransmitted packets received
|
||||
int pktSentACKTotal; // total number of sent ACK packets
|
||||
int pktRecvACKTotal; // total number of received ACK packets
|
||||
int pktSentNAKTotal; // total number of sent NAK packets
|
||||
int pktRecvNAKTotal; // total number of received NAK packets
|
||||
int64_t usSndDurationTotal; // total time duration when UDT is sending data (idle time exclusive)
|
||||
|
||||
// local measurements
|
||||
int64_t pktSent; // number of sent data packets, including retransmissions
|
||||
int64_t pktRecv; // number of received packets
|
||||
int pktSndLoss; // number of lost packets (sender side)
|
||||
int pktRcvLoss; // number of lost packets (receiver side)
|
||||
int pktRetrans; // number of retransmitted packets
|
||||
int pktRcvRetrans; // number of retransmitted packets received
|
||||
int pktSentACK; // number of sent ACK packets
|
||||
int pktRecvACK; // number of received ACK packets
|
||||
int pktSentNAK; // number of sent NAK packets
|
||||
int pktRecvNAK; // number of received NAK packets
|
||||
double mbpsSendRate; // sending rate in Mb/s
|
||||
double mbpsRecvRate; // receiving rate in Mb/s
|
||||
int64_t usSndDuration; // busy sending time (i.e., idle time exclusive)
|
||||
int pktReorderDistance; // size of order discrepancy in received sequences
|
||||
double pktRcvAvgBelatedTime; // average time of packet delay for belated packets (packets with sequence past the ACK)
|
||||
int64_t pktRcvBelated; // number of received AND IGNORED packets due to having come too late
|
||||
|
||||
// instant measurements
|
||||
double usPktSndPeriod; // packet sending period, in microseconds
|
||||
int pktFlowWindow; // flow window size, in number of packets
|
||||
int pktCongestionWindow; // congestion window size, in number of packets
|
||||
int pktFlightSize; // number of packets on flight
|
||||
double msRTT; // RTT, in milliseconds
|
||||
double mbpsBandwidth; // estimated bandwidth, in Mb/s
|
||||
int byteAvailSndBuf; // available UDT sender buffer size
|
||||
int byteAvailRcvBuf; // available UDT receiver buffer size
|
||||
};
|
||||
|
||||
typedef SRTSOCKET UDTSOCKET; //legacy alias
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
namespace srt { class CUDTException; }
|
||||
|
||||
namespace UDT
|
||||
{
|
||||
|
||||
typedef srt::CUDTException ERRORINFO;
|
||||
typedef CPerfMon TRACEINFO;
|
||||
|
||||
// This facility is used only for select() function.
|
||||
// This is considered obsolete and the epoll() functionality rather should be used.
|
||||
typedef std::set<SRTSOCKET> UDSET;
|
||||
#define UD_CLR(u, uset) ((uset)->erase(u))
|
||||
#define UD_ISSET(u, uset) ((uset)->find(u) != (uset)->end())
|
||||
#define UD_SET(u, uset) ((uset)->insert(u))
|
||||
#define UD_ZERO(uset) ((uset)->clear())
|
||||
|
||||
SRT_API extern const SRTSOCKET INVALID_SOCK;
|
||||
#undef ERROR
|
||||
SRT_API extern const int ERROR;
|
||||
|
||||
SRT_API int startup();
|
||||
SRT_API int cleanup();
|
||||
SRT_API SRTSOCKET socket();
|
||||
inline SRTSOCKET socket(int , int , int ) { return socket(); }
|
||||
SRT_API int bind(SRTSOCKET u, const struct sockaddr* name, int namelen);
|
||||
SRT_API int bind2(SRTSOCKET u, UDPSOCKET udpsock);
|
||||
SRT_API int listen(SRTSOCKET u, int backlog);
|
||||
SRT_API SRTSOCKET accept(SRTSOCKET u, struct sockaddr* addr, int* addrlen);
|
||||
SRT_API int connect(SRTSOCKET u, const struct sockaddr* name, int namelen);
|
||||
SRT_API int close(SRTSOCKET u);
|
||||
SRT_API int getpeername(SRTSOCKET u, struct sockaddr* name, int* namelen);
|
||||
SRT_API int getsockname(SRTSOCKET u, struct sockaddr* name, int* namelen);
|
||||
SRT_API int getsockopt(SRTSOCKET u, int level, SRT_SOCKOPT optname, void* optval, int* optlen);
|
||||
SRT_API int setsockopt(SRTSOCKET u, int level, SRT_SOCKOPT optname, const void* optval, int optlen);
|
||||
SRT_API int send(SRTSOCKET u, const char* buf, int len, int flags);
|
||||
SRT_API int recv(SRTSOCKET u, char* buf, int len, int flags);
|
||||
|
||||
SRT_API int sendmsg(SRTSOCKET u, const char* buf, int len, int ttl = -1, bool inorder = false, int64_t srctime = 0);
|
||||
SRT_API int recvmsg(SRTSOCKET u, char* buf, int len, uint64_t& srctime);
|
||||
SRT_API int recvmsg(SRTSOCKET u, char* buf, int len);
|
||||
|
||||
SRT_API int64_t sendfile(SRTSOCKET u, std::fstream& ifs, int64_t& offset, int64_t size, int block = 364000);
|
||||
SRT_API int64_t recvfile(SRTSOCKET u, std::fstream& ofs, int64_t& offset, int64_t size, int block = 7280000);
|
||||
SRT_API int64_t sendfile2(SRTSOCKET u, const char* path, int64_t* offset, int64_t size, int block = 364000);
|
||||
SRT_API int64_t recvfile2(SRTSOCKET u, const char* path, int64_t* offset, int64_t size, int block = 7280000);
|
||||
|
||||
// select and selectEX are DEPRECATED; please use epoll.
|
||||
SRT_API int select(int nfds, UDSET* readfds, UDSET* writefds, UDSET* exceptfds, const struct timeval* timeout);
|
||||
SRT_API int selectEx(const std::vector<SRTSOCKET>& fds, std::vector<SRTSOCKET>* readfds,
|
||||
std::vector<SRTSOCKET>* writefds, std::vector<SRTSOCKET>* exceptfds, int64_t msTimeOut);
|
||||
|
||||
SRT_API int epoll_create();
|
||||
SRT_API int epoll_add_usock(int eid, SRTSOCKET u, const int* events = NULL);
|
||||
SRT_API int epoll_add_ssock(int eid, SYSSOCKET s, const int* events = NULL);
|
||||
SRT_API int epoll_remove_usock(int eid, SRTSOCKET u);
|
||||
SRT_API int epoll_remove_ssock(int eid, SYSSOCKET s);
|
||||
SRT_API int epoll_update_usock(int eid, SRTSOCKET u, const int* events = NULL);
|
||||
SRT_API int epoll_update_ssock(int eid, SYSSOCKET s, const int* events = NULL);
|
||||
SRT_API int epoll_wait(int eid, std::set<SRTSOCKET>* readfds, std::set<SRTSOCKET>* writefds, int64_t msTimeOut,
|
||||
std::set<SYSSOCKET>* lrfds = NULL, std::set<SYSSOCKET>* wrfds = NULL);
|
||||
SRT_API int epoll_wait2(int eid, SRTSOCKET* readfds, int* rnum, SRTSOCKET* writefds, int* wnum, int64_t msTimeOut,
|
||||
SYSSOCKET* lrfds = NULL, int* lrnum = NULL, SYSSOCKET* lwfds = NULL, int* lwnum = NULL);
|
||||
SRT_API int epoll_uwait(const int eid, SRT_EPOLL_EVENT* fdsSet, int fdsSize, int64_t msTimeOut);
|
||||
SRT_API int epoll_release(int eid);
|
||||
SRT_API ERRORINFO& getlasterror();
|
||||
SRT_API int getlasterror_code();
|
||||
SRT_API const char* getlasterror_desc();
|
||||
SRT_API int bstats(SRTSOCKET u, SRT_TRACEBSTATS* perf, bool clear = true);
|
||||
SRT_API SRT_SOCKSTATUS getsockstate(SRTSOCKET u);
|
||||
|
||||
} // namespace UDT
|
||||
|
||||
// This is a log configuration used inside SRT.
|
||||
// Applications using SRT, if they want to use the logging mechanism
|
||||
// are free to create their own logger configuration objects for their
|
||||
// own logger FA objects, or create their own. The object of this type
|
||||
// is required to initialize the logger FA object.
|
||||
namespace srt_logging { struct LogConfig; }
|
||||
SRT_API extern srt_logging::LogConfig srt_logger_config;
|
||||
|
||||
namespace srt
|
||||
{
|
||||
|
||||
// This is a C++ SRT API extension. This is not a part of legacy UDT API.
|
||||
SRT_API void setloglevel(srt_logging::LogLevel::type ll);
|
||||
SRT_API void addlogfa(srt_logging::LogFA fa);
|
||||
SRT_API void dellogfa(srt_logging::LogFA fa);
|
||||
SRT_API void resetlogfa(std::set<srt_logging::LogFA> fas);
|
||||
SRT_API void resetlogfa(const int* fara, size_t fara_size);
|
||||
SRT_API void setlogstream(std::ostream& stream);
|
||||
SRT_API void setloghandler(void* opaque, SRT_LOG_HANDLER_FN* handler);
|
||||
SRT_API void setlogflags(int flags);
|
||||
|
||||
SRT_API bool setstreamid(SRTSOCKET u, const std::string& sid);
|
||||
SRT_API std::string getstreamid(SRTSOCKET u);
|
||||
|
||||
// Namespace alias
|
||||
namespace logging {
|
||||
using namespace srt_logging;
|
||||
}
|
||||
|
||||
} // namespace srt
|
||||
|
||||
// Planned deprecated removal: rel1.6.0
|
||||
// There's also no portable way possible to enforce a deprecation
|
||||
// compiler warning, so leaving as is.
|
||||
namespace UDT
|
||||
{
|
||||
// Backward-compatible aliases, just for a case someone was using it.
|
||||
using srt::setloglevel;
|
||||
using srt::addlogfa;
|
||||
using srt::dellogfa;
|
||||
using srt::resetlogfa;
|
||||
using srt::setlogstream;
|
||||
using srt::setloghandler;
|
||||
using srt::setlogflags;
|
||||
using srt::setstreamid;
|
||||
using srt::getstreamid;
|
||||
}
|
||||
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif
|
||||
34
MediaClient/libsrt/include/srt/version.h
Normal file
34
MediaClient/libsrt/include/srt/version.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* SRT - Secure, Reliable, Transport
|
||||
* Copyright (c) 2018 Haivision Systems Inc.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
written by
|
||||
Haivision Systems Inc.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef INC_SRT_VERSION_H
|
||||
#define INC_SRT_VERSION_H
|
||||
|
||||
// To construct version value
|
||||
#define SRT_MAKE_VERSION(major, minor, patch) \
|
||||
((patch) + ((minor)*0x100) + ((major)*0x10000))
|
||||
#define SRT_MAKE_VERSION_VALUE SRT_MAKE_VERSION
|
||||
|
||||
#define SRT_VERSION_MAJOR 1
|
||||
#define SRT_VERSION_MINOR 5
|
||||
#define SRT_VERSION_PATCH 0
|
||||
/* #undef SRT_VERSION_BUILD */
|
||||
|
||||
#define SRT_VERSION_STRING "1.5.0"
|
||||
#define SRT_VERSION_VALUE \
|
||||
SRT_MAKE_VERSION_VALUE( \
|
||||
SRT_VERSION_MAJOR, SRT_VERSION_MINOR, SRT_VERSION_PATCH )
|
||||
|
||||
#endif // INC_SRT_VERSION_H
|
||||
45
MediaClient/libsrt/include/srt/win/syslog_defs.h
Normal file
45
MediaClient/libsrt/include/srt/win/syslog_defs.h
Normal file
@@ -0,0 +1,45 @@
|
||||
#ifndef INC_SRT_WINDOWS_SYSLOG_DEFS_H
|
||||
#define INC_SRT_WINDOWS_SYSLOG_DEFS_H
|
||||
|
||||
#define LOG_EMERG 0
|
||||
#define LOG_ALERT 1
|
||||
#define LOG_CRIT 2
|
||||
#define LOG_ERR 3
|
||||
#define LOG_WARNING 4
|
||||
#define LOG_NOTICE 5
|
||||
#define LOG_INFO 6
|
||||
#define LOG_DEBUG 7
|
||||
|
||||
#define LOG_PRIMASK 0x07
|
||||
|
||||
#define LOG_PRI(p) ((p) & LOG_PRIMASK)
|
||||
#define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri))
|
||||
|
||||
#define LOG_KERN (0<<3)
|
||||
#define LOG_USER (1<<3)
|
||||
#define LOG_MAIL (2<<3)
|
||||
#define LOG_DAEMON (3<<3)
|
||||
#define LOG_AUTH (4<<3)
|
||||
#define LOG_SYSLOG (5<<3)
|
||||
#define LOG_LPR (6<<3)
|
||||
#define LOG_NEWS (7<<3)
|
||||
#define LOG_UUCP (8<<3)
|
||||
#define LOG_CRON (9<<3)
|
||||
#define LOG_AUTHPRIV (10<<3)
|
||||
#define LOG_FTP (11<<3)
|
||||
|
||||
/* Codes through 15 are reserved for system use */
|
||||
#define LOG_LOCAL0 (16<<3)
|
||||
#define LOG_LOCAL1 (17<<3)
|
||||
#define LOG_LOCAL2 (18<<3)
|
||||
#define LOG_LOCAL3 (19<<3)
|
||||
#define LOG_LOCAL4 (20<<3)
|
||||
#define LOG_LOCAL5 (21<<3)
|
||||
#define LOG_LOCAL6 (22<<3)
|
||||
#define LOG_LOCAL7 (23<<3)
|
||||
|
||||
#define LOG_NFACILITIES 24
|
||||
#define LOG_FACMASK 0x03f8
|
||||
#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3)
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user