/usr/include/crtmpserver/thelib/streaming/basestream.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 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | /*
* 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 _BASESTREAM_H
#define _BASESTREAM_H
#include "common.h"
#include "streaming/streamcapabilities.h"
class StreamsManager;
class BaseProtocol;
/*!
@class BaseStream
*/
class DLLEXP BaseStream {
protected:
StreamsManager *_pStreamsManager;
uint64_t _type;
uint32_t _uniqueId;
BaseProtocol *_pProtocol;
string _name;
double _creationTimestamp;
public:
BaseStream(BaseProtocol *pProtocol, StreamsManager *pStreamsManager,
uint64_t type, string name);
virtual ~BaseStream();
/*!
@brief Returns the stream manager. This is read-only
*/
StreamsManager * GetStreamsManager();
/*!
@brief Returns the stream capabilities. Specifically, codec and codec related info
*/
virtual StreamCapabilities * GetCapabilities() = 0;
/*!
@brief Returns the type of this stream. This is read-only
*/
uint64_t GetType();
/*!
@brief Returns the unique id of this stream. This is read-only
*/
uint32_t GetUniqueId();
/*!
@brief returns the creation timestamp expressed in milliseconds for 1970 epoch
*/
double GetSpawnTimestamp();
/*!
@brief Returns the name of this stream. This is setup-once
*/
string GetName();
/*!
@brief Sets the name of the stream
@param name - Name of stream in string format
*/
void SetName(string name);
/*!
@brief This will return information about the stream
@param info
*/
virtual void GetStats(Variant &info, uint32_t namespaceId = 0);
/*!
@brief Returns the protocol that owns this stream.
*/
BaseProtocol * GetProtocol();
/*!
@brief Tells if this stream is enqueued for delete or not based on the pProtocol
*/
virtual bool IsEnqueueForDelete();
/*!
@brief Will enqueue this stream for delete along with his protocol
*/
virtual void EnqueueForDelete();
/*!
@brief This will start the feeding process
@param absoluteTimestamp - the timestamp where we want to see before start the feeding process
@param length - time limit
*/
virtual bool Play(double absoluteTimestamp, double length) = 0;
/*!
@brief This will pause the feeding process
*/
virtual bool Pause() = 0;
/*!
@brief This will resume the feeding process
*/
virtual bool Resume() = 0;
/*!
@brief will seek to the specified point in time.
@param absoluteTimestamp
*/
virtual bool Seek(double absoluteTimestamp) = 0;
/*!
@brief This will stop the feeding process
*/
virtual bool Stop() = 0;
/*!
@brief Called when a play command was issued
@param absoluteTimestamp - the timestamp where we want to seek before start the feeding process
@param length
*/
virtual bool SignalPlay(double &absoluteTimestamp, double &length) = 0;
/*!
@brief Called when a pasue command was issued
*/
virtual bool SignalPause() = 0;
/*!
@brief Called when a resume command was issued
*/
virtual bool SignalResume() = 0;
/*!
@brief Called when a seek command was issued
@param absoluteTimestamp
*/
virtual bool SignalSeek(double &absoluteTimestamp) = 0;
/*!
@brief Called when a stop command was issued
*/
virtual bool SignalStop() = 0;
/*!
@param pData - the buffer containing the data
@param dataLength - the size of pData in bytes
@param processedLength - if pData is only partial data, this shows the numbers of bytes processed so far, excluding pData
@param totalLength - if pData is only partial data, this shows the total number of bytes inside the current packet
@param isAudio - true if pData is audio data, false if pData is video data
@discussion Rules:
dataLength+processedLength<=totalLength
dataLength<=totalLength
processedLength<=totalLength
dataLength!=0
*/
virtual bool FeedData(uint8_t *pData, uint32_t dataLength,
uint32_t processedLength, uint32_t totalLength,
double absoluteTimestamp, bool isAudio) = 0;
/*!
@brief The networking layer signaled the availability for sending data
*/
virtual void ReadyForSend() = 0;
/*!
@brief This is called to ensure that the linking process can be done
@param type - the target type to which this strem must be linked against
*/
virtual bool IsCompatibleWithType(uint64_t type) = 0;
};
#endif /* _BASESTREAM_H */
|