You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mk_h264_splitter.h 1.5KB

8 months ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. * Copyright (c) 2016 The ZLMediaKit project authors. All Rights Reserved.
  3. *
  4. * This file is part of ZLMediaKit(https://github.com/xia-chu/ZLMediaKit).
  5. *
  6. * Use of this source code is governed by MIT license that can be found in the
  7. * LICENSE file in the root of the source tree. All contributing project authors
  8. * may be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef ZLMEDIAKIT_MK_H264_SPLITTER_H
  11. #define ZLMEDIAKIT_MK_H264_SPLITTER_H
  12. #include "mk_common.h"
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. typedef void *mk_h264_splitter;
  17. /**
  18. * h264 分帧器输出回调函数
  19. * @param user_data 设置回调时的用户数据指针
  20. * @param splitter 对象
  21. * @param frame 帧数据
  22. * @param size 帧数据长度
  23. */
  24. typedef void(API_CALL *on_mk_h264_splitter_frame)(void *user_data, mk_h264_splitter splitter, const char *frame, int size);
  25. /**
  26. * 创建h264分帧器
  27. * @param cb 分帧回调函数
  28. * @param user_data 回调用户数据指针
  29. * @return 分帧器对象
  30. */
  31. API_EXPORT mk_h264_splitter API_CALL mk_h264_splitter_create(on_mk_h264_splitter_frame cb, void *user_data);
  32. /**
  33. * 删除h264分帧器
  34. * @param ctx 分帧器
  35. */
  36. API_EXPORT void API_CALL mk_h264_splitter_release(mk_h264_splitter ctx);
  37. /**
  38. * 输入数据并分帧
  39. * @param ctx 分帧器
  40. * @param data h264/h265数据
  41. * @param size 数据长度
  42. */
  43. API_EXPORT void API_CALL mk_h264_splitter_input_data(mk_h264_splitter ctx, const char *data, int size);
  44. #ifdef __cplusplus
  45. }
  46. #endif
  47. #endif //ZLMEDIAKIT_MK_H264_SPLITTER_H