ficdecoder.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. /*****************************************************************************
  2. Copyright(c) 2009 FCI Inc. All Rights Reserved
  3. File name : ficdecoder.h
  4. Description : fic parser
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  16. History :
  17. ----------------------------------------------------------------------
  18. *******************************************************************************/
  19. #ifndef __ficdecodera_h__
  20. #define __ficdecodera_h__
  21. #include "fci_types.h"
  22. #define MAX_ESB_NUM 1
  23. #define MAX_SVC_NUM 128
  24. #define MAX_SC_NUM 128
  25. #define MAX_SUBCH_NUM 64
  26. #define MAX_DIDP_NUM 8
  27. #define MAX_USER_APPL_NUM 15
  28. #define MAX_USER_APPL_DATA_SIZE 24
  29. struct fig {
  30. u8 head;
  31. u8 data[29];
  32. };
  33. struct fib {
  34. u8 data[30];
  35. u16 crc;
  36. };
  37. struct fic {
  38. /* Fib fib[12]; */
  39. struct fib fib[32];
  40. };
  41. struct figdata {
  42. u8 head;
  43. u8 data[28];
  44. };
  45. struct esbinfo_t {
  46. u8 flag;
  47. u16 eid;
  48. u8 label[32];
  49. u8 ecc;
  50. };
  51. struct service_info_t {
  52. u8 flag;
  53. u32 sid;
  54. u16 scid;
  55. u8 ascty;
  56. u8 dscty;
  57. u8 fidc_id;
  58. u8 addrType; /* PD */
  59. u8 tmid;
  60. u8 sub_channel_id;
  61. u8 nscps;
  62. u8 label[32];
  63. u8 scids;
  64. u8 num_of_user_appl;
  65. u16 user_appl_type[MAX_USER_APPL_NUM];
  66. u8 user_appl_length[MAX_USER_APPL_NUM];
  67. u8 user_appl_data[MAX_USER_APPL_NUM][MAX_USER_APPL_DATA_SIZE];
  68. };
  69. struct scInfo_t {
  70. u8 flag;
  71. u16 scid;
  72. u8 dscty;
  73. u8 sub_channel_id;
  74. u8 scca_flag;
  75. u8 dg_flag;
  76. u16 packet_address;
  77. u16 scca;
  78. u8 label[32];
  79. };
  80. struct subch_info_t {
  81. u8 flag;
  82. u8 subchannel_id;
  83. u16 start_address;
  84. u8 form_type;
  85. u8 table_index;
  86. u8 table_switch;
  87. u8 option;
  88. u8 protect_level;
  89. u16 subch_size;
  90. u32 sid;
  91. u8 service_channel_id;
  92. u8 re_config;
  93. /* T-MMB */
  94. u8 mode; /* 0 T-DMB, 1 T-MMB */
  95. u8 mod_type;
  96. u8 enc_type;
  97. u8 intv_depth;
  98. u8 pl;
  99. /* T-MMB */
  100. /* FEC */
  101. u8 fec_schem;
  102. };
  103. struct didp_info_t {
  104. u8 flag;
  105. u8 reconfig_offset;
  106. u8 subchannel_id;
  107. u16 start_address;
  108. u8 form_type;
  109. u16 subch_size;
  110. u16 speed; /* kbsp */
  111. u16 l1;
  112. u8 p1;
  113. u16 l2;
  114. u8 p2;
  115. u16 l3;
  116. u8 p3;
  117. u16 l4;
  118. u8 p4;
  119. u8 pad;
  120. /* T-MMB */
  121. u8 mode; /* 0 T-DMB, 1 T-MMB */
  122. u8 mod_type;
  123. u8 enc_type;
  124. u8 intv_depth;
  125. u8 pl;
  126. u16 mi; /* kies use */
  127. /* T-MMB */
  128. };
  129. #ifdef __cplusplus
  130. extern "C" {
  131. #endif
  132. extern struct esbinfo_t ensemble_info[MAX_ESB_NUM];
  133. extern struct service_info_t service_info[MAX_SVC_NUM];
  134. extern struct subch_info_t subchannel_info[MAX_SUBCH_NUM];
  135. extern struct didp_info_t didpInfo[MAX_DIDP_NUM];
  136. extern int fic_decoder(struct fic *pfic, u16 length);
  137. extern int fib_decoder(struct fib *pfib);
  138. extern struct esbinfo_t *get_emsemble_info(void);
  139. extern struct subch_info_t *get_subchannel_info(u8 subchannel_id);
  140. extern struct service_info_t *get_service_info(u32 sid);
  141. extern struct scInfo_t *get_sc_info(u16 scid);
  142. extern struct service_info_t *get_service_info_list(u8 service_index);
  143. extern void subchannel_org_clean(void);
  144. extern void subchannel_org_prn(int subchannel_id);
  145. extern int found_all_labels(void);
  146. extern void didp_prn(struct didp_info_t *pdidp);
  147. extern int set_didp_reg(int service_channel_id, struct didp_info_t *pdidp);
  148. extern int subchannel_org_to_didp(
  149. struct subch_info_t *sub_ch_info, struct didp_info_t *pdidp);
  150. extern void subchannel_org_prn(int subchannel_id);
  151. extern int dummy_decoder(u8 *fibBuffer, int figLength);
  152. #ifdef __cplusplus
  153. } /* extern "C" {*/
  154. #endif
  155. #endif /* __ficdecoder_h__ */