正在显示
7 个修改的文件
包含
33 行增加
和
17 行删除
| @@ -179,8 +179,9 @@ enum SrsCodecAudioSoundType | @@ -179,8 +179,9 @@ enum SrsCodecAudioSoundType | ||
| 179 | /** | 179 | /** |
| 180 | * buffer indicates the position and size. | 180 | * buffer indicates the position and size. |
| 181 | */ | 181 | */ |
| 182 | -struct SrsCodecBuffer | 182 | +class SrsCodecBuffer |
| 183 | { | 183 | { |
| 184 | +public: | ||
| 184 | /** | 185 | /** |
| 185 | * @remark user must manage the bytes. | 186 | * @remark user must manage the bytes. |
| 186 | */ | 187 | */ |
| @@ -43,8 +43,9 @@ class SrsPithyPrint; | @@ -43,8 +43,9 @@ class SrsPithyPrint; | ||
| 43 | /** | 43 | /** |
| 44 | * ingester ffmpeg object. | 44 | * ingester ffmpeg object. |
| 45 | */ | 45 | */ |
| 46 | -struct SrsIngesterFFMPEG | 46 | +class SrsIngesterFFMPEG |
| 47 | { | 47 | { |
| 48 | +public: | ||
| 48 | std::string vhost; | 49 | std::string vhost; |
| 49 | std::string id; | 50 | std::string id; |
| 50 | SrsFFMPEG* ffmpeg; | 51 | SrsFFMPEG* ffmpeg; |
| @@ -39,8 +39,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -39,8 +39,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 39 | extern int srs_get_log_level(std::string level); | 39 | extern int srs_get_log_level(std::string level); |
| 40 | 40 | ||
| 41 | // @see: man getrusage | 41 | // @see: man getrusage |
| 42 | -struct SrsRusage | 42 | +class SrsRusage |
| 43 | { | 43 | { |
| 44 | +public: | ||
| 44 | // whether the data is ok. | 45 | // whether the data is ok. |
| 45 | bool ok; | 46 | bool ok; |
| 46 | // the time in ms when sample. | 47 | // the time in ms when sample. |
| @@ -57,8 +58,9 @@ extern SrsRusage* srs_get_system_rusage(); | @@ -57,8 +58,9 @@ extern SrsRusage* srs_get_system_rusage(); | ||
| 57 | extern void srs_update_system_rusage(); | 58 | extern void srs_update_system_rusage(); |
| 58 | 59 | ||
| 59 | // @see: man 5 proc, /proc/[pid]/stat | 60 | // @see: man 5 proc, /proc/[pid]/stat |
| 60 | -struct SrsProcSelfStat | 61 | +class SrsProcSelfStat |
| 61 | { | 62 | { |
| 63 | +public: | ||
| 62 | // whether the data is ok. | 64 | // whether the data is ok. |
| 63 | bool ok; | 65 | bool ok; |
| 64 | // the time in ms when sample. | 66 | // the time in ms when sample. |
| @@ -208,8 +210,9 @@ struct SrsProcSelfStat | @@ -208,8 +210,9 @@ struct SrsProcSelfStat | ||
| 208 | }; | 210 | }; |
| 209 | 211 | ||
| 210 | // @see: man 5 proc, /proc/stat | 212 | // @see: man 5 proc, /proc/stat |
| 211 | -struct SrsProcSystemStat | 213 | +class SrsProcSystemStat |
| 212 | { | 214 | { |
| 215 | +public: | ||
| 213 | // whether the data is ok. | 216 | // whether the data is ok. |
| 214 | bool ok; | 217 | bool ok; |
| 215 | // the time in ms when sample. | 218 | // the time in ms when sample. |
| @@ -262,8 +265,9 @@ extern SrsProcSystemStat* srs_get_system_proc_stat(); | @@ -262,8 +265,9 @@ extern SrsProcSystemStat* srs_get_system_proc_stat(); | ||
| 262 | extern void srs_update_proc_stat(); | 265 | extern void srs_update_proc_stat(); |
| 263 | 266 | ||
| 264 | // @see: cat /proc/meminfo | 267 | // @see: cat /proc/meminfo |
| 265 | -struct SrsMemInfo | 268 | +class SrsMemInfo |
| 266 | { | 269 | { |
| 270 | +public: | ||
| 267 | // whether the data is ok. | 271 | // whether the data is ok. |
| 268 | bool ok; | 272 | bool ok; |
| 269 | // the time in ms when sample. | 273 | // the time in ms when sample. |
| @@ -298,8 +302,9 @@ extern SrsMemInfo* srs_get_meminfo(); | @@ -298,8 +302,9 @@ extern SrsMemInfo* srs_get_meminfo(); | ||
| 298 | extern void srs_update_meminfo(); | 302 | extern void srs_update_meminfo(); |
| 299 | 303 | ||
| 300 | // @see: cat /proc/cpuinfo | 304 | // @see: cat /proc/cpuinfo |
| 301 | -struct SrsCpuInfo | 305 | +class SrsCpuInfo |
| 302 | { | 306 | { |
| 307 | +public: | ||
| 303 | // whether the data is ok. | 308 | // whether the data is ok. |
| 304 | bool ok; | 309 | bool ok; |
| 305 | 310 | ||
| @@ -315,8 +320,9 @@ struct SrsCpuInfo | @@ -315,8 +320,9 @@ struct SrsCpuInfo | ||
| 315 | extern SrsCpuInfo* srs_get_cpuinfo(); | 320 | extern SrsCpuInfo* srs_get_cpuinfo(); |
| 316 | 321 | ||
| 317 | // platform(os, srs) summary | 322 | // platform(os, srs) summary |
| 318 | -struct SrsPlatformInfo | 323 | +class SrsPlatformInfo |
| 319 | { | 324 | { |
| 325 | +public: | ||
| 320 | // whether the data is ok. | 326 | // whether the data is ok. |
| 321 | bool ok; | 327 | bool ok; |
| 322 | 328 |
| @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
| 31 | // current release version | 31 | // current release version |
| 32 | #define VERSION_MAJOR "0" | 32 | #define VERSION_MAJOR "0" |
| 33 | #define VERSION_MINOR "9" | 33 | #define VERSION_MINOR "9" |
| 34 | -#define VERSION_REVISION "99" | 34 | +#define VERSION_REVISION "100" |
| 35 | #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION | 35 | #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION |
| 36 | // server info. | 36 | // server info. |
| 37 | #define RTMP_SIG_SRS_KEY "srs" | 37 | #define RTMP_SIG_SRS_KEY "srs" |
| @@ -56,8 +56,9 @@ namespace srs | @@ -56,8 +56,9 @@ namespace srs | ||
| 56 | * offset: 4bytes | 56 | * offset: 4bytes |
| 57 | * @see also: http://blog.csdn.net/win_lin/article/details/13006803 | 57 | * @see also: http://blog.csdn.net/win_lin/article/details/13006803 |
| 58 | */ | 58 | */ |
| 59 | - struct key_block | 59 | + class key_block |
| 60 | { | 60 | { |
| 61 | + public: | ||
| 61 | // (offset)bytes | 62 | // (offset)bytes |
| 62 | char* random0; | 63 | char* random0; |
| 63 | int random0_size; | 64 | int random0_size; |
| @@ -81,8 +82,9 @@ namespace srs | @@ -81,8 +82,9 @@ namespace srs | ||
| 81 | * random-data: (764-4-offset-32)bytes | 82 | * random-data: (764-4-offset-32)bytes |
| 82 | * @see also: http://blog.csdn.net/win_lin/article/details/13006803 | 83 | * @see also: http://blog.csdn.net/win_lin/article/details/13006803 |
| 83 | */ | 84 | */ |
| 84 | - struct digest_block | 85 | + class digest_block |
| 85 | { | 86 | { |
| 87 | + public: | ||
| 86 | // 4bytes | 88 | // 4bytes |
| 87 | int32_t offset; | 89 | int32_t offset; |
| 88 | 90 | ||
| @@ -183,8 +185,9 @@ namespace srs | @@ -183,8 +185,9 @@ namespace srs | ||
| 183 | * key: 764bytes | 185 | * key: 764bytes |
| 184 | * @see also: http://blog.csdn.net/win_lin/article/details/13006803 | 186 | * @see also: http://blog.csdn.net/win_lin/article/details/13006803 |
| 185 | */ | 187 | */ |
| 186 | - struct c1s1 | 188 | + class c1s1 |
| 187 | { | 189 | { |
| 190 | + public: | ||
| 188 | union block { | 191 | union block { |
| 189 | key_block key; | 192 | key_block key; |
| 190 | digest_block digest; | 193 | digest_block digest; |
| @@ -262,8 +265,9 @@ namespace srs | @@ -262,8 +265,9 @@ namespace srs | ||
| 262 | * digest-data: 32bytes | 265 | * digest-data: 32bytes |
| 263 | * @see also: http://blog.csdn.net/win_lin/article/details/13006803 | 266 | * @see also: http://blog.csdn.net/win_lin/article/details/13006803 |
| 264 | */ | 267 | */ |
| 265 | - struct c2s2 | 268 | + class c2s2 |
| 266 | { | 269 | { |
| 270 | + public: | ||
| 267 | char random[1504]; | 271 | char random[1504]; |
| 268 | char digest[32]; | 272 | char digest[32]; |
| 269 | 273 |
| @@ -90,8 +90,9 @@ class SrsChunkStream; | @@ -90,8 +90,9 @@ class SrsChunkStream; | ||
| 90 | class SrsProtocol | 90 | class SrsProtocol |
| 91 | { | 91 | { |
| 92 | private: | 92 | private: |
| 93 | - struct AckWindowSize | 93 | + class AckWindowSize |
| 94 | { | 94 | { |
| 95 | + public: | ||
| 95 | int ack_window_size; | 96 | int ack_window_size; |
| 96 | int64_t acked_size; | 97 | int64_t acked_size; |
| 97 | 98 | ||
| @@ -221,8 +222,9 @@ private: | @@ -221,8 +222,9 @@ private: | ||
| 221 | /** | 222 | /** |
| 222 | * 4.1. Message Header | 223 | * 4.1. Message Header |
| 223 | */ | 224 | */ |
| 224 | -struct SrsMessageHeader | 225 | +class SrsMessageHeader |
| 225 | { | 226 | { |
| 227 | +public: | ||
| 226 | /** | 228 | /** |
| 227 | * One byte field to represent the message type. A range of type IDs | 229 | * One byte field to represent the message type. A range of type IDs |
| 228 | * (1-7) are reserved for protocol control messages. | 230 | * (1-7) are reserved for protocol control messages. |
| @@ -370,8 +372,9 @@ public: | @@ -370,8 +372,9 @@ public: | ||
| 370 | class SrsSharedPtrMessage : public SrsMessage | 372 | class SrsSharedPtrMessage : public SrsMessage |
| 371 | { | 373 | { |
| 372 | private: | 374 | private: |
| 373 | - struct __SrsSharedPtr | 375 | + class __SrsSharedPtr |
| 374 | { | 376 | { |
| 377 | + public: | ||
| 375 | char* payload; | 378 | char* payload; |
| 376 | int size; | 379 | int size; |
| 377 | int shared_count; | 380 | int shared_count; |
-
请 注册 或 登录 后发表评论