winlin

refine librtmp, add example to api.

@@ -209,6 +209,8 @@ extern const char* srs_type2string(int type); @@ -209,6 +209,8 @@ extern const char* srs_type2string(int type);
209 * 209 *
210 * @remark: for read, user must free the data. 210 * @remark: for read, user must free the data.
211 * @remark: for write, user should never free the data, even if error. 211 * @remark: for write, user should never free the data, even if error.
  212 +* @example /trunk/research/librtmp/srs_play.c
  213 +* @example /trunk/research/librtmp/srs_publish.c
212 * 214 *
213 * @return 0, success; otherswise, failed. 215 * @return 0, success; otherswise, failed.
214 */ 216 */
@@ -237,6 +239,10 @@ extern int64_t srs_get_nrecv_bytes(srs_rtmp_t rtmp); @@ -237,6 +239,10 @@ extern int64_t srs_get_nrecv_bytes(srs_rtmp_t rtmp);
237 /************************************************************* 239 /*************************************************************
238 ************************************************************** 240 **************************************************************
239 * flv codec 241 * flv codec
  242 +* @example /trunk/research/librtmp/srs_flv_injecter.c
  243 +* @example /trunk/research/librtmp/srs_flv_parser.c
  244 +* @example /trunk/research/librtmp/srs_ingest_flv.c
  245 +* @example /trunk/research/librtmp/srs_ingest_rtmp.c
240 ************************************************************** 246 **************************************************************
241 *************************************************************/ 247 *************************************************************/
242 typedef void* srs_flv_t; 248 typedef void* srs_flv_t;
@@ -276,6 +282,8 @@ extern flv_bool srs_flv_is_keyframe(char* data, int32_t size); @@ -276,6 +282,8 @@ extern flv_bool srs_flv_is_keyframe(char* data, int32_t size);
276 /************************************************************* 282 /*************************************************************
277 ************************************************************** 283 **************************************************************
278 * amf0 codec 284 * amf0 codec
  285 +* @example /trunk/research/librtmp/srs_ingest_flv.c
  286 +* @example /trunk/research/librtmp/srs_ingest_rtmp.c
279 ************************************************************** 287 **************************************************************
280 *************************************************************/ 288 *************************************************************/
281 /* the output handler. */ 289 /* the output handler. */
@@ -351,6 +359,8 @@ extern char* srs_amf0_human_print(srs_amf0_t amf0, char** pdata, int* psize); @@ -351,6 +359,8 @@ extern char* srs_amf0_human_print(srs_amf0_t amf0, char** pdata, int* psize);
351 * @remark, user should free the frames. 359 * @remark, user should free the frames.
352 * @remark, the tbn of dts/pts is 1/1000 for RTMP, that is, in ms. 360 * @remark, the tbn of dts/pts is 1/1000 for RTMP, that is, in ms.
353 * @remark, cts = pts - dts 361 * @remark, cts = pts - dts
  362 +* @remark, use srs_h264_startswith_annexb to check whether frame is annexb format.
  363 +* @example /trunk/research/librtmp/srs_h264_raw_publish.c
354 * 364 *
355 * @return 0, success; otherswise, failed. 365 * @return 0, success; otherswise, failed.
356 */ 366 */
@@ -394,6 +404,9 @@ extern int srs_write_h264_raw_frames(srs_rtmp_t rtmp, @@ -394,6 +404,9 @@ extern int srs_write_h264_raw_frames(srs_rtmp_t rtmp,
394 * @param pnb_start_code output the size of start code, must >=3. 404 * @param pnb_start_code output the size of start code, must >=3.
395 * NULL to ignore. 405 * NULL to ignore.
396 * 406 *
  407 +* @reamrk used to check whether current frame is in annexb format.
  408 +* @example /trunk/research/librtmp/srs_h264_raw_publish.c
  409 +*
397 * @return 0 false; otherwise, true. 410 * @return 0 false; otherwise, true.
398 */ 411 */
399 extern int srs_h264_startswith_annexb( 412 extern int srs_h264_startswith_annexb(