|
Cogs.Core
|
Classes | |
| struct | CaseInsensitiveCompare |
| struct | MediaDescription |
| struct | Message |
Public Types | |
| using | MediaList = std::vector< MediaDescription > |
Public Member Functions | |
| RTSP (std::string_view url, std::string_view userAgent="Cogs/1.0") | |
| bool | sendSetup (MediaDescription &mediaDescription, const std::string &mediaURL, uint16_t client_port_a, uint16_t client_port_b) |
| bool | sendPlay () |
| bool | sendPause () |
| bool | sendTeardown () |
| bool | isActive () const |
| const std::string & | getOriginalURL () const |
| const MediaList & | getMediaDescriptions () const |
Public Member Functions inherited from Cogs::Network::ConnectionTCP | |
| ConnectionTCP (Socket socket, const SockaddrIn &addr) | |
| Constructs a connection that is attached to the specified socket. | |
| virtual | ~ConnectionTCP () |
| Destroys this connection. | |
| SocketType | type () const override |
| IPProto | proto () const override |
| void | enableAutoReconnect () |
| void | disableAutoReconnect () |
| virtual bool | isAutoConnectEnabled () const override |
| virtual bool | isConnected () const override |
| void | setConnectTimeout (int64_t milliseconds) |
| void | setNoDelay (bool val=true) |
| Set the TCP_NODELAY flag (Enable / Disables Nagles algorithm). | |
| void | shutdown () |
| Shutdown this connection. | |
| virtual bool | connect (const SockaddrIn &addr) |
| Sets up this connection ready to connect to the specified remote address and port. | |
| virtual bool | reconnect () override |
| Reconnects this connection to the remote host previously specified through a call to connect. | |
| virtual bool | disconnect () override |
| Disconnects this connection. | |
| bool | listen (uint16_t port) |
| bool | listen (AddrIn ip, uint16_t port) |
| Sets this connection up as a listener that will listen for and respond to incoming connection requests on the specified port. | |
| virtual bool | processIncoming () override |
| Manages accepting incoming connections when this connection is a listener. | |
| virtual ConnectionTCP * | accept (Socket, const SockaddrIn &) |
Public Member Functions inherited from Cogs::Network::ConnectionBase | |
| Family | family () const |
| virtual SocketType | type () const =0 |
| virtual IPProto | proto () const =0 |
| Socket | getSocket () const |
| void | remove () |
| void | removeAndDelete () |
| const SockaddrIn & | getAddress () const |
| int64_t | getReconnectTime () const |
| virtual bool | isAutoConnectEnabled () const |
| virtual bool | isConnected () const |
| bool | shouldRemove () const |
| bool | shouldDelete () const |
| void | setNonblocking (bool val=true) |
| Sets socket non-blocking mode to val. | |
| void | setDoNotProcess () |
| virtual bool | reconnect () |
| virtual bool | disconnect ()=0 |
| bool | bind (uint16_t port) |
| virtual bool | bind (AddrIn ip, uint16_t port) |
| Sets this connection up as a listener that will listen for and respond to incoming connection requests on the specified port. | |
| bool | send (const void *data, uint64_t byteCount, uint64_t &bytesSent) |
| Attempts to send as much of the specified data as possible. | |
| bool | receive (void *buffer, uint64_t byteCount, uint64_t &bytesReceived) |
| Attempts to read the specified number of bytes from the network socket this connection represents. | |
| bool | sendTo (const void *data, uint64_t byteCount, uint64_t &bytesSent, const SockaddrIn &addr) |
| Attempts to send as much of the specified data as possible. | |
| bool | recvFrom (void *buffer, uint64_t byteCount, uint64_t &bytesReceived, SockaddrIn &addr) |
| Attempts to read the specified number of bytes from the network socket this connection represents. | |
| virtual bool | processOutgoing () |
| virtual bool | processIncoming () |
Protected Member Functions | |
| virtual bool | processOutgoing () override |
| virtual bool | processIncoming () override |
| Manages accepting incoming connections when this connection is a listener. | |
| virtual void | processIncomingMessage (Message &message) |
| virtual void | receivedMediaDescriptions ()=0 |
| virtual void | receivedStreamSetup (MediaDescription &md)=0 |
| void | queueMessage (Message *message) |
Protected Member Functions inherited from Cogs::Network::ConnectionBase | |
| void | create () |
| Internal wrapper for the socket() call. | |
| void | close () |
| Internal wrapper for closing the socket. | |
Protected Attributes | |
| MediaList | mediaDescriptions |
| List of media descriptions. | |
| bool | has_describe: 1 |
| bool | has_setup: 1 |
| bool | has_play: 1 |
| bool | has_pause: 1 |
| bool | has_teardown: 1 |
| bool | has_set_parameter: 1 |
| bool | has_get_parameter: 1 |
| bool | is_active: 1 |
| bool | has_video: 1 |
| bool | has_audio: 1 |
Protected Attributes inherited from Cogs::Network::ConnectionBase | |
| Cogs::Atomic< uint32_t > | flags = 0 |
| int64_t | reconnectTime = 0 |
| Socket | socket = InvalidSocket |
| SockaddrIn | sockAddr = {} |
Private Member Functions | |
| void | addStandardHeaders (Message &message) |
| bool | breakdownURL (std::string_view uri) |
| std::string | buildURL (std::string_view method) |
| void | parseSDP (const std::string &sdp) |
| void | sendOptions () |
| void | sendDescribe () |
Private Attributes | |
| std::deque< Message * > | queuedMessages |
| List of messages waiting to be sent. | |
| Cogs::Mutex | queueMutex |
| Mutex protecting the message queue. | |
| Memory::MemoryBuffer | outgoingBuffer |
| Memory buffer used when sending data. | |
| Message * | outgoingMessage = nullptr |
| The message currently being sent. | |
| std::deque< Message * > | sentMessages |
| List of sent messages. | |
| Memory::MemoryBuffer | incomingBuffer |
| Memory buffer used when receiving data. | |
| Message | incomingMessage |
| The message currently being received. | |
| std::string | originalURL |
| URL with which this RTSP object was constructed. | |
| std::string | userInfo |
| user:pass part of the URL. | |
| std::string | hostname |
| Hostname of the RTSP server. | |
| std::string | resourcePath |
| Path on the server to the resource we are accessing. | |
| uint16_t | hostPort = 554 |
| Port we should use when connecting to the server. | |
| std::string | agentString |
| User agent string passed in requests. | |
| int | sequenceNumber = 0 |
| Our sequence number that will be used when sending requests. | |
| std::string | sessionID |
| Server generated session identifier. | |
| int64_t | timeout = 60000 |
| Session timeout in millisesonds. | |
| int64_t | keepAliveTime = 0 |
| Millisecond timestamp when we should ping the server to prevent the session from timing out. | |
Additional Inherited Members | |
Static Protected Attributes inherited from Cogs::Network::ConnectionBase | |
| static constexpr uint32_t | cRemove = 0x00000001 |
| static constexpr uint32_t | cDelete = 0x00000002 |
| static constexpr uint32_t | cDoNotProcess = 0x00000004 |
| using Cogs::RTSP::MediaList = std::vector<MediaDescription> |
| Cogs::RTSP::RTSP | ( | std::string_view | url, |
| std::string_view | userAgent = "Cogs/1.0" |
||
| ) |
|
private |
|
private |
|
private |
|
inline |
|
inline |
|
private |
|
overrideprotectedvirtual |
Manages accepting incoming connections when this connection is a listener.
Reimplemented from Cogs::Network::ConnectionTCP.
|
protectedvirtual |
|
overrideprotectedvirtual |
Reimplemented from Cogs::Network::ConnectionBase.
|
protected |
| bool Cogs::RTSP::sendSetup | ( | MediaDescription & | mediaDescription, |
| const std::string & | mediaURL, | ||
| uint16_t | client_port_a, | ||
| uint16_t | client_port_b | ||
| ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
protected |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |