正在显示
2 个修改的文件
包含
14 行增加
和
14 行删除
@@ -1112,7 +1112,7 @@ int SrsCommonMessage::encode_packet() | @@ -1112,7 +1112,7 @@ int SrsCommonMessage::encode_packet() | ||
1112 | return packet->encode(size, (char*&)payload); | 1112 | return packet->encode(size, (char*&)payload); |
1113 | } | 1113 | } |
1114 | 1114 | ||
1115 | -SrsSharedMessage::SrsSharedPtr::SrsSharedPtr() | 1115 | +SrsSharedPtrMessage::SrsSharedPtr::SrsSharedPtr() |
1116 | { | 1116 | { |
1117 | payload = NULL; | 1117 | payload = NULL; |
1118 | size = 0; | 1118 | size = 0; |
@@ -1120,21 +1120,21 @@ SrsSharedMessage::SrsSharedPtr::SrsSharedPtr() | @@ -1120,21 +1120,21 @@ SrsSharedMessage::SrsSharedPtr::SrsSharedPtr() | ||
1120 | shared_count = 0; | 1120 | shared_count = 0; |
1121 | } | 1121 | } |
1122 | 1122 | ||
1123 | -SrsSharedMessage::SrsSharedPtr::~SrsSharedPtr() | 1123 | +SrsSharedPtrMessage::SrsSharedPtr::~SrsSharedPtr() |
1124 | { | 1124 | { |
1125 | srs_freepa(payload); | 1125 | srs_freepa(payload); |
1126 | } | 1126 | } |
1127 | 1127 | ||
1128 | -SrsSharedMessage::SrsSharedMessage() | 1128 | +SrsSharedPtrMessage::SrsSharedPtrMessage() |
1129 | { | 1129 | { |
1130 | ptr = NULL; | 1130 | ptr = NULL; |
1131 | } | 1131 | } |
1132 | 1132 | ||
1133 | -SrsSharedMessage::~SrsSharedMessage() | 1133 | +SrsSharedPtrMessage::~SrsSharedPtrMessage() |
1134 | { | 1134 | { |
1135 | } | 1135 | } |
1136 | 1136 | ||
1137 | -void SrsSharedMessage::free_payload() | 1137 | +void SrsSharedPtrMessage::free_payload() |
1138 | { | 1138 | { |
1139 | if (ptr) { | 1139 | if (ptr) { |
1140 | if (ptr->shared_count == 0) { | 1140 | if (ptr->shared_count == 0) { |
@@ -1145,7 +1145,7 @@ void SrsSharedMessage::free_payload() | @@ -1145,7 +1145,7 @@ void SrsSharedMessage::free_payload() | ||
1145 | } | 1145 | } |
1146 | } | 1146 | } |
1147 | 1147 | ||
1148 | -int SrsSharedMessage::initialize(SrsMessageHeader* header, char* payload, int size, int perfer_cid) | 1148 | +int SrsSharedPtrMessage::initialize(SrsMessageHeader* header, char* payload, int size, int perfer_cid) |
1149 | { | 1149 | { |
1150 | int ret = ERROR_SUCCESS; | 1150 | int ret = ERROR_SUCCESS; |
1151 | 1151 | ||
@@ -1170,7 +1170,7 @@ int SrsSharedMessage::initialize(SrsMessageHeader* header, char* payload, int si | @@ -1170,7 +1170,7 @@ int SrsSharedMessage::initialize(SrsMessageHeader* header, char* payload, int si | ||
1170 | return ret; | 1170 | return ret; |
1171 | } | 1171 | } |
1172 | 1172 | ||
1173 | -SrsSharedMessage* SrsSharedMessage::copy() | 1173 | +SrsSharedPtrMessage* SrsSharedPtrMessage::copy() |
1174 | { | 1174 | { |
1175 | if (!ptr) { | 1175 | if (!ptr) { |
1176 | srs_error("invoke initialize to initialize the ptr."); | 1176 | srs_error("invoke initialize to initialize the ptr."); |
@@ -1178,7 +1178,7 @@ SrsSharedMessage* SrsSharedMessage::copy() | @@ -1178,7 +1178,7 @@ SrsSharedMessage* SrsSharedMessage::copy() | ||
1178 | return NULL; | 1178 | return NULL; |
1179 | } | 1179 | } |
1180 | 1180 | ||
1181 | - SrsSharedMessage* copy = new SrsSharedMessage(); | 1181 | + SrsSharedPtrMessage* copy = new SrsSharedPtrMessage(); |
1182 | copy->ptr = ptr; | 1182 | copy->ptr = ptr; |
1183 | ptr->shared_count++; | 1183 | ptr->shared_count++; |
1184 | 1184 | ||
@@ -1188,7 +1188,7 @@ SrsSharedMessage* SrsSharedMessage::copy() | @@ -1188,7 +1188,7 @@ SrsSharedMessage* SrsSharedMessage::copy() | ||
1188 | return copy; | 1188 | return copy; |
1189 | } | 1189 | } |
1190 | 1190 | ||
1191 | -int SrsSharedMessage::get_perfer_cid() | 1191 | +int SrsSharedPtrMessage::get_perfer_cid() |
1192 | { | 1192 | { |
1193 | if (!ptr) { | 1193 | if (!ptr) { |
1194 | return 0; | 1194 | return 0; |
@@ -1197,7 +1197,7 @@ int SrsSharedMessage::get_perfer_cid() | @@ -1197,7 +1197,7 @@ int SrsSharedMessage::get_perfer_cid() | ||
1197 | return ptr->perfer_cid; | 1197 | return ptr->perfer_cid; |
1198 | } | 1198 | } |
1199 | 1199 | ||
1200 | -int SrsSharedMessage::encode_packet() | 1200 | +int SrsSharedPtrMessage::encode_packet() |
1201 | { | 1201 | { |
1202 | srs_verbose("shared message ignore the encode method."); | 1202 | srs_verbose("shared message ignore the encode method."); |
1203 | return ERROR_SUCCESS; | 1203 | return ERROR_SUCCESS; |
@@ -324,7 +324,7 @@ public: | @@ -324,7 +324,7 @@ public: | ||
324 | * for audio/video/data message that need less memory copy. | 324 | * for audio/video/data message that need less memory copy. |
325 | * and only for output. | 325 | * and only for output. |
326 | */ | 326 | */ |
327 | -class SrsSharedMessage : public SrsOutputableMessage | 327 | +class SrsSharedPtrMessage : public SrsOutputableMessage |
328 | { | 328 | { |
329 | private: | 329 | private: |
330 | typedef SrsOutputableMessage super; | 330 | typedef SrsOutputableMessage super; |
@@ -341,8 +341,8 @@ private: | @@ -341,8 +341,8 @@ private: | ||
341 | }; | 341 | }; |
342 | SrsSharedPtr* ptr; | 342 | SrsSharedPtr* ptr; |
343 | public: | 343 | public: |
344 | - SrsSharedMessage(); | ||
345 | - virtual ~SrsSharedMessage(); | 344 | + SrsSharedPtrMessage(); |
345 | + virtual ~SrsSharedPtrMessage(); | ||
346 | protected: | 346 | protected: |
347 | virtual void free_payload(); | 347 | virtual void free_payload(); |
348 | public: | 348 | public: |
@@ -350,7 +350,7 @@ public: | @@ -350,7 +350,7 @@ public: | ||
350 | * set the shared payload. | 350 | * set the shared payload. |
351 | */ | 351 | */ |
352 | virtual int initialize(SrsMessageHeader* header, char* payload, int size, int perfer_cid); | 352 | virtual int initialize(SrsMessageHeader* header, char* payload, int size, int perfer_cid); |
353 | - virtual SrsSharedMessage* copy(); | 353 | + virtual SrsSharedPtrMessage* copy(); |
354 | public: | 354 | public: |
355 | /** | 355 | /** |
356 | * get the perfered cid(chunk stream id) which sendout over. | 356 | * get the perfered cid(chunk stream id) which sendout over. |
-
请 注册 或 登录 后发表评论