/usr/include/crtmpserver/thelib/application/baseclientapplication.h is in crtmpserver-dev 1.0~dfsg-5.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | /*
* Copyright (c) 2010,
* Gavriloaie Eugen-Andrei (shiretu@gmail.com)
*
* This file is part of crtmpserver.
* crtmpserver is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* crtmpserver is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with crtmpserver. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _BASECLIENTAPPLICATION_H
#define _BASECLIENTAPPLICATION_H
#include "common.h"
#include "streaming/streamsmanager.h"
#include "netio/netio.h"
class BaseProtocol;
class BaseAppProtocolHandler;
class BaseStream;
class IOHandler;
/*!
@brief
*/
class DLLEXP BaseClientApplication {
private:
static uint32_t _idGenerator;
uint32_t _id;
string _name;
vector<string> _aliases;
map<uint64_t, BaseAppProtocolHandler *> _protocolsHandlers;
StreamsManager _streamsManager;
bool _allowDuplicateInboundNetworkStreams;
protected:
Variant _configuration;
bool _isDefault;
Variant _authSettings;
public:
BaseClientApplication(Variant &configuration);
virtual ~BaseClientApplication();
/*!
@brief Returns the application's id. The id is auto-generated in the constructor
*/
uint32_t GetId();
/*!
@brief Returns the name of the application, taken from the configuration file.
*/
string GetName();
/*!
@brief Returns the variant that contains the configuration information about the application.
*/
Variant &GetConfiguration();
/*!
@brief Returns the alias of the application from the configuration file
*/
vector<string> GetAliases();
/*!
@brief Returns the boolean that tells if the application is the default application.
*/
bool IsDefault();
StreamsManager *GetStreamsManager();
virtual bool Initialize();
virtual bool ActivateAcceptors(vector<IOHandler *> &acceptors);
virtual bool ActivateAcceptor(IOHandler *pIOHandler);
string GetServicesInfo();
virtual bool AcceptTCPConnection(TCPAcceptor *pTCPAcceptor);
/*!
@brief Registers this application to the BaseAppProtocolHandler.
@protocolType - Type of protocol
@pAppProtocolHandler
*/
void RegisterAppProtocolHandler(uint64_t protocolType,
BaseAppProtocolHandler *pAppProtocolHandler);
/*!
@brief Erases this application to the BaseAppProtocolHandler by setting it to NULL.
@param protocolType - Type of protocol
*/
void UnRegisterAppProtocolHandler(uint64_t protocolType);
/*!
@brief Get the ability to handle duplicate inbound network streams
*/
bool GetAllowDuplicateInboundNetworkStreams();
/*!
@brief Checks and see if the duplicate inbound network streams are available. Always returns true if allowDuplicateNetworkStreams is set to true inside the config file
@param streamName - The stream name we want to see is free or not
@param pProtocol - The protocol associated with this request (can be NULL)
*/
virtual bool StreamNameAvailable(string streamName, BaseProtocol *pProtocol);
template<class T>
T *GetProtocolHandler(BaseProtocol *pProtocol) {
return (T *) GetProtocolHandler(pProtocol);
}
BaseAppProtocolHandler *GetProtocolHandler(BaseProtocol *pProtocol);
BaseAppProtocolHandler *GetProtocolHandler(uint64_t protocolType);
template<class T>
T *GetProtocolHandler(string &scheme) {
return (T *) GetProtocolHandler(scheme);
}
virtual BaseAppProtocolHandler *GetProtocolHandler(string &scheme);
/*!
@brief This is called bt the framework when an outbound connection failed to connect
@param customParameters
*/
virtual bool OutboundConnectionFailed(Variant &customParameters);
/*!
@brief Registers the protocol to the client application
@param pProtocol
*/
virtual void RegisterProtocol(BaseProtocol *pProtocol);
/*!
@brief Erases the protocol to the client application
@param pProtocol
*/
virtual void UnRegisterProtocol(BaseProtocol *pProtocol);
/*!
@brief Displays the registered stream's ID, type, and name in the logs
@param pStream
*/
virtual void SignalStreamRegistered(BaseStream *pStream);
/*!
@brief Displays the unregistered stream's ID, type, and name in the logs
@param pStream
*/
virtual void SignalStreamUnRegistered(BaseStream *pStream);
virtual bool PullExternalStreams();
virtual bool PullExternalStream(Variant streamConfig);
virtual bool PushLocalStream(Variant streamConfig);
bool ParseAuthentication();
/*!
@brief Deletes all active protocols and IOHandlers bound to the application.
@param pApplication
*/
static void Shutdown(BaseClientApplication *pApplication);
private:
string GetServiceInfo(IOHandler *pIOHander);
};
#endif /* _BASECLIENTAPPLICATION_H */
|