winlin

add srs_rtmp_free_packet for srs-librtmp

@@ -1116,6 +1116,11 @@ int srs_rtmp_write_packet(srs_rtmp_t rtmp, char type, u_int32_t timestamp, char* @@ -1116,6 +1116,11 @@ int srs_rtmp_write_packet(srs_rtmp_t rtmp, char type, u_int32_t timestamp, char*
1116 return ret; 1116 return ret;
1117 } 1117 }
1118 1118
  1119 +void srs_rtmp_free_packet(char* data)
  1120 +{
  1121 + srs_freepa(data);
  1122 +}
  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 {
1121 int ret = ERROR_SUCCESS; 1126 int ret = ERROR_SUCCESS;
@@ -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 *
@@ -303,6 +304,11 @@ extern int srs_rtmp_write_packet(srs_rtmp_t rtmp, @@ -303,6 +304,11 @@ extern int srs_rtmp_write_packet(srs_rtmp_t rtmp,
303 ); 304 );
304 305
305 /** 306 /**
  307 + * Free the packet allocated by srs_rtmp_read_packet.
  308 + */
  309 +extern void srs_rtmp_free_packet(char* data);
  310 +
  311 +/**
306 * whether type is script data and the data is onMetaData. 312 * whether type is script data and the data is onMetaData.
307 */ 313 */
308 extern srs_bool srs_rtmp_is_onMetaData(char type, char* data, int size); 314 extern srs_bool srs_rtmp_is_onMetaData(char type, char* data, int size);