From c59576146b48ddc04533431452fcd926232ac4d1 Mon Sep 17 00:00:00 2001 From: winlin Date: Sat, 17 May 2014 14:59:33 +0800 Subject: [PATCH] rename struct to class. 0.9.100 --- trunk/src/app/srs_app_codec.hpp | 3 ++- trunk/src/app/srs_app_ingest.hpp | 3 ++- trunk/src/app/srs_app_utility.hpp | 18 ++++++++++++------ trunk/src/core/srs_core.hpp | 2 +- trunk/src/rtmp/srs_protocol_handshake.hpp | 12 ++++++++---- trunk/src/rtmp/srs_protocol_rtmp.hpp | 3 ++- trunk/src/rtmp/srs_protocol_rtmp_stack.hpp | 9 ++++++--- 7 files changed, 33 insertions(+), 17 deletions(-) diff --git a/trunk/src/app/srs_app_codec.hpp b/trunk/src/app/srs_app_codec.hpp index aef90b202..4067f864a 100644 --- a/trunk/src/app/srs_app_codec.hpp +++ b/trunk/src/app/srs_app_codec.hpp @@ -179,8 +179,9 @@ enum SrsCodecAudioSoundType /** * buffer indicates the position and size. */ -struct SrsCodecBuffer +class SrsCodecBuffer { +public: /** * @remark user must manage the bytes. */ diff --git a/trunk/src/app/srs_app_ingest.hpp b/trunk/src/app/srs_app_ingest.hpp index a56788455..1be01b538 100644 --- a/trunk/src/app/srs_app_ingest.hpp +++ b/trunk/src/app/srs_app_ingest.hpp @@ -43,8 +43,9 @@ class SrsPithyPrint; /** * ingester ffmpeg object. */ -struct SrsIngesterFFMPEG +class SrsIngesterFFMPEG { +public: std::string vhost; std::string id; SrsFFMPEG* ffmpeg; diff --git a/trunk/src/app/srs_app_utility.hpp b/trunk/src/app/srs_app_utility.hpp index f7b88e21a..2a221076d 100644 --- a/trunk/src/app/srs_app_utility.hpp +++ b/trunk/src/app/srs_app_utility.hpp @@ -39,8 +39,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. extern int srs_get_log_level(std::string level); // @see: man getrusage -struct SrsRusage +class SrsRusage { +public: // whether the data is ok. bool ok; // the time in ms when sample. @@ -57,8 +58,9 @@ extern SrsRusage* srs_get_system_rusage(); extern void srs_update_system_rusage(); // @see: man 5 proc, /proc/[pid]/stat -struct SrsProcSelfStat +class SrsProcSelfStat { +public: // whether the data is ok. bool ok; // the time in ms when sample. @@ -208,8 +210,9 @@ struct SrsProcSelfStat }; // @see: man 5 proc, /proc/stat -struct SrsProcSystemStat +class SrsProcSystemStat { +public: // whether the data is ok. bool ok; // the time in ms when sample. @@ -262,8 +265,9 @@ extern SrsProcSystemStat* srs_get_system_proc_stat(); extern void srs_update_proc_stat(); // @see: cat /proc/meminfo -struct SrsMemInfo +class SrsMemInfo { +public: // whether the data is ok. bool ok; // the time in ms when sample. @@ -298,8 +302,9 @@ extern SrsMemInfo* srs_get_meminfo(); extern void srs_update_meminfo(); // @see: cat /proc/cpuinfo -struct SrsCpuInfo +class SrsCpuInfo { +public: // whether the data is ok. bool ok; @@ -315,8 +320,9 @@ struct SrsCpuInfo extern SrsCpuInfo* srs_get_cpuinfo(); // platform(os, srs) summary -struct SrsPlatformInfo +class SrsPlatformInfo { +public: // whether the data is ok. bool ok; diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index 7b4fce56e..99e8b10c7 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // current release version #define VERSION_MAJOR "0" #define VERSION_MINOR "9" -#define VERSION_REVISION "99" +#define VERSION_REVISION "100" #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION // server info. #define RTMP_SIG_SRS_KEY "srs" diff --git a/trunk/src/rtmp/srs_protocol_handshake.hpp b/trunk/src/rtmp/srs_protocol_handshake.hpp index 2a445ace5..d4ed01cd9 100644 --- a/trunk/src/rtmp/srs_protocol_handshake.hpp +++ b/trunk/src/rtmp/srs_protocol_handshake.hpp @@ -56,8 +56,9 @@ namespace srs * offset: 4bytes * @see also: http://blog.csdn.net/win_lin/article/details/13006803 */ - struct key_block + class key_block { + public: // (offset)bytes char* random0; int random0_size; @@ -81,8 +82,9 @@ namespace srs * random-data: (764-4-offset-32)bytes * @see also: http://blog.csdn.net/win_lin/article/details/13006803 */ - struct digest_block + class digest_block { + public: // 4bytes int32_t offset; @@ -183,8 +185,9 @@ namespace srs * key: 764bytes * @see also: http://blog.csdn.net/win_lin/article/details/13006803 */ - struct c1s1 + class c1s1 { + public: union block { key_block key; digest_block digest; @@ -262,8 +265,9 @@ namespace srs * digest-data: 32bytes * @see also: http://blog.csdn.net/win_lin/article/details/13006803 */ - struct c2s2 + class c2s2 { + public: char random[1504]; char digest[32]; diff --git a/trunk/src/rtmp/srs_protocol_rtmp.hpp b/trunk/src/rtmp/srs_protocol_rtmp.hpp index 80c5d2edf..4bd55b5f0 100644 --- a/trunk/src/rtmp/srs_protocol_rtmp.hpp +++ b/trunk/src/rtmp/srs_protocol_rtmp.hpp @@ -97,8 +97,9 @@ public: /** * the response to client. */ -struct SrsResponse +class SrsResponse { +public: int stream_id; SrsResponse(); diff --git a/trunk/src/rtmp/srs_protocol_rtmp_stack.hpp b/trunk/src/rtmp/srs_protocol_rtmp_stack.hpp index 84a16f53c..4fccd3196 100644 --- a/trunk/src/rtmp/srs_protocol_rtmp_stack.hpp +++ b/trunk/src/rtmp/srs_protocol_rtmp_stack.hpp @@ -90,8 +90,9 @@ class SrsChunkStream; class SrsProtocol { private: - struct AckWindowSize + class AckWindowSize { + public: int ack_window_size; int64_t acked_size; @@ -221,8 +222,9 @@ private: /** * 4.1. Message Header */ -struct SrsMessageHeader +class SrsMessageHeader { +public: /** * One byte field to represent the message type. A range of type IDs * (1-7) are reserved for protocol control messages. @@ -370,8 +372,9 @@ public: class SrsSharedPtrMessage : public SrsMessage { private: - struct __SrsSharedPtr + class __SrsSharedPtr { + public: char* payload; int size; int shared_count;