fyf_demux.h
上传用户:sunhongbo
上传日期:2022-01-25
资源大小:3010k
文件大小:8k
源码类别:

数据库系统

开发平台:

C/C++

  1. /******************************************************************************/
  2. /*    Copyright (c) 2008 Embedded Internet Solutions, Inc                     */
  3. /*    All rights reserved. You are not allowed to copy or distribute          */
  4. /*    the code without permission.                                            */
  5. /*    This is the demo implenment of the Porting APIs needed by            */
  6. /*    MiddleWare.                                                             */
  7. /*    Maybe you should modify it accorrding to Platform.                      */
  8. /*                                                                            */
  9. /*    $author szhy 2008/09/18                                              */
  10. /******************************************************************************/ 
  11. #ifndef __FYF_DEMUX_H__
  12. #define __FYF_DEMUX_H__
  13. typedef void (*FYF_DEMUX_NOTIFY_FUNC)(BU32 ch, BU32 filter, BU08 *buf, BS32 len); 
  14. /* demux channel types */
  15. typedef enum {
  16. FYF_DEMUX_DATA_PSI_CHANNEL = 0,
  17. FYF_DEMUX_DATA_PES_CHANNEL,
  18. FYF_DEMUX_VIDEO_CHANNEL,
  19. FYF_DEMUX_AUDIO_CHANNEL,
  20. FYF_DEMUX_PCR_CHANNEL
  21. } FYF_DEMUX_CHANNEL_TYPE_e; 
  22. typedef struct
  23. {
  24. BS32 (*FYF_CPI_demux_set_notify)(FYF_DEMUX_NOTIFY_FUNC func);
  25. BU32 (*FYF_CPI_demux_create_channel)(BS32 poolsize, FYF_DEMUX_CHANNEL_TYPE_e type);
  26. BS32 (*FYF_CPI_demux_set_channel_pid)(BU32 channel, BS16 pid);
  27. BS32 (*FYF_CPI_demux_destroy_channel)(BU32 channel);
  28. BS32 (*FYF_CPI_demux_start_channel)(BU32 channel);
  29. BS32 (*FYF_CPI_demux_stop_channel)(BU32 channel); 
  30. BU32 (*FYF_CPI_demux_create_filter)(BU32 channel);
  31. BS32 (*FYF_CPI_demux_set_filter)(BU32 channel, BU32 filter, BU32 wide, BU08 coef[], BU08 mask[], BU08 excl[]);
  32. BS32 (*FYF_CPI_demux_destroy_filter)(BU32 channel, BU32 filter);
  33. BS32 (*FYF_CPI_demux_enable_filter)(BU32 channel, BU32 filter);
  34. BS32 (*FYF_CPI_demux_disable_filter)(BU32 channel, BU32 filter);
  35. }FYF_DEMUX_PORTING;
  36. /******************************************************************************/
  37. /*Description: register demux                                                 */
  38. /*Input      : porting   */
  39. /*Output     : no                                                             */
  40. /*Return     : no                                           */
  41. /******************************************************************************/
  42. void FYF_API_demux_register(FYF_DEMUX_PORTING *porting);
  43. /******************************************************************************/
  44. /*Description: set notify func                                                */
  45. /*Input      : func       */
  46. /*Output     : no                                                             */
  47. /*Return     : 0 success, -1 failure                                          */
  48. /******************************************************************************/
  49. BS32 FYF_API_demux_set_notify(FYF_DEMUX_NOTIFY_FUNC func);
  50. /******************************************************************************/
  51. /*Description: create channel                                                 */
  52. /*Input      : poolsize,type           */
  53. /*Output     : no                                                             */
  54. /*Return     : >0 success, 0 failure                                          */
  55. /******************************************************************************/
  56. BU32 FYF_API_demux_create_channel(BS32 poolsize, FYF_DEMUX_CHANNEL_TYPE_e type);
  57. /******************************************************************************/
  58. /*Description: set channel pid                                                */
  59. /*Input      : channel,pid              */
  60. /*Output     : no                                                             */
  61. /*Return     : 0 success, -1 failure                                          */
  62. /******************************************************************************/
  63. BS32 FYF_API_demux_set_channel_pid(BU32 channel, BS16 pid);
  64. /******************************************************************************/
  65. /*Description: set channel pid                                                */
  66. /*Input      : channel,pid              */
  67. /*Output     : no                                                             */
  68. /*Return     : 0 success, -1 failure                                          */
  69. /******************************************************************************/
  70. BS32 FYF_API_demux_destroy_channel(BU32 channel);
  71. /******************************************************************************/
  72. /*Description: start channel                                                */
  73. /*Input      : channel              */
  74. /*Output     : no                                                             */
  75. /*Return     : 0 success, -1 failure                                          */
  76. /******************************************************************************/
  77. BS32 FYF_API_demux_start_channel(BU32 channel);
  78. /******************************************************************************/
  79. /*Description: stop channel                                                */
  80. /*Input      : channel              */
  81. /*Output     : no                                                             */
  82. /*Return     : 0 success, -1 failure                                          */
  83. /******************************************************************************/
  84. BS32 FYF_API_demux_stop_channel(BU32 channel);
  85. /******************************************************************************/
  86. /*Description: create filter                                                */
  87. /*Input      : channel              */
  88. /*Output     : no                                                             */
  89. /*Return     : >0 success, 0 failure                                          */
  90. /******************************************************************************/
  91. BU32 FYF_API_demux_create_filter(BU32 channel);
  92. /******************************************************************************/
  93. /*Description: set filter                                                  */
  94. /*Input      : channel,filter,wide,coef,mask,excl       */
  95. /*Output     : no                                                             */
  96. /*Return     : 0 success, -1 failure                                          */
  97. /******************************************************************************/
  98. BS32 FYF_API_demux_set_filter(BU32 channel, BU32 filter, BU32 wide, BU08 coef[], BU08 mask[], BU08 excl[]);
  99. /******************************************************************************/
  100. /*Description: destroy filter                                                 */
  101. /*Input      : channel,filter       */
  102. /*Output     : no                                                             */
  103. /*Return     : 0 success, -1 failure                                          */
  104. /******************************************************************************/
  105. BS32 FYF_API_demux_destroy_filter(BU32 channel, BU32 filter);
  106. /******************************************************************************/
  107. /*Description: enable filter                                                 */
  108. /*Input      : channel,filter       */
  109. /*Output     : no                                                             */
  110. /*Return     : 0 success, -1 failure                                          */
  111. /******************************************************************************/  
  112. BS32 FYF_API_demux_enable_filter(BU32 channel, BU32 filter);
  113. /******************************************************************************/
  114. /*Description: disable filter                                                 */
  115. /*Input      : channel,filter       */
  116. /*Output     : no                                                             */
  117. /*Return     : 0 success, -1 failure                                          */
  118. /******************************************************************************/
  119. BS32 FYF_API_demux_disable_filter(BU32 channel, BU32 filter);
  120. #endif