正在显示
2 个修改的文件
包含
11 行增加
和
0 行删除
| @@ -1115,6 +1115,11 @@ int srs_rtmp_write_packet(srs_rtmp_t rtmp, char type, u_int32_t timestamp, char* | @@ -1115,6 +1115,11 @@ int srs_rtmp_write_packet(srs_rtmp_t rtmp, char type, u_int32_t timestamp, char* | ||
| 1115 | 1115 | ||
| 1116 | return ret; | 1116 | return ret; |
| 1117 | } | 1117 | } |
| 1118 | + | ||
| 1119 | +void srs_rtmp_free_packet(char* data) | ||
| 1120 | +{ | ||
| 1121 | + srs_freepa(data); | ||
| 1122 | +} | ||
| 1118 | 1123 | ||
| 1119 | srs_bool srs_rtmp_is_onMetaData(char type, char* data, int size) | 1124 | srs_bool srs_rtmp_is_onMetaData(char type, char* data, int size) |
| 1120 | { | 1125 | { |
| @@ -285,6 +285,7 @@ extern int srs_rtmp_bandwidth_check(srs_rtmp_t rtmp, | @@ -285,6 +285,7 @@ extern int srs_rtmp_bandwidth_check(srs_rtmp_t rtmp, | ||
| 285 | * FlvTagAudio, @see "E.4.2.1 AUDIODATA" | 285 | * FlvTagAudio, @see "E.4.2.1 AUDIODATA" |
| 286 | * FlvTagVideo, @see "E.4.3.1 VIDEODATA" | 286 | * FlvTagVideo, @see "E.4.3.1 VIDEODATA" |
| 287 | * FlvTagScript, @see "E.4.4.1 SCRIPTDATA" | 287 | * FlvTagScript, @see "E.4.4.1 SCRIPTDATA" |
| 288 | +* User can free the packet by srs_rtmp_free_packet. | ||
| 288 | * @param size, size of packet. | 289 | * @param size, size of packet. |
| 289 | * @return the error code. 0 for success; otherwise, error. | 290 | * @return the error code. 0 for success; otherwise, error. |
| 290 | * | 291 | * |
| @@ -301,6 +302,11 @@ extern int srs_rtmp_read_packet(srs_rtmp_t rtmp, | @@ -301,6 +302,11 @@ extern int srs_rtmp_read_packet(srs_rtmp_t rtmp, | ||
| 301 | extern int srs_rtmp_write_packet(srs_rtmp_t rtmp, | 302 | extern int srs_rtmp_write_packet(srs_rtmp_t rtmp, |
| 302 | char type, u_int32_t timestamp, char* data, int size | 303 | char type, u_int32_t timestamp, char* data, int size |
| 303 | ); | 304 | ); |
| 305 | + | ||
| 306 | +/** | ||
| 307 | + * Free the packet allocated by srs_rtmp_read_packet. | ||
| 308 | + */ | ||
| 309 | +extern void srs_rtmp_free_packet(char* data); | ||
| 304 | 310 | ||
| 305 | /** | 311 | /** |
| 306 | * whether type is script data and the data is onMetaData. | 312 | * whether type is script data and the data is onMetaData. |
-
请 注册 或 登录 后发表评论