TVGAPI.c
上传用户:super_houu
上传日期:2008-09-21
资源大小:4099k
文件大小:3k
源码类别:

DVD

开发平台:

Others

  1. #include "Config.h" // Global Configuration - do not remove!
  2. #ifdef TV_GUARDIAN_ENABLE
  3. #include "Playcoretvgtvgapi.h"
  4. #include "playcorepsps.h"
  5. #include "decoderdecoder.h"
  6. #include "kerneleventdef.h"
  7. #include "playcorecoremaincoregdef.h"
  8. #include "playcorescpadscmgr.h"
  9. extern BYTE gLine21MuteQueue_Read, gLine21MuteQueue_Write;
  10. extern LINE21MUTEENTRY Line21MuteQueue[LINE21MUTEQUEUESIZE];
  11. extern BYTE gLine21DataBufferPool_Read, gLine21DataBufferPool_Write;
  12. extern LINE21DATA_BUFFER_POOL Line21DataBufferPool[NUM_OF_LINE21DATA_BUFFER_POOL];
  13. extern NV_SETTINGS *gps;
  14. //extern BYTE mute_sem;
  15. #ifdef _DEBUG
  16. extern BYTE datain_session_id;
  17. #endif
  18. const char tvg_message_array1[] = {"TVG"};
  19. const char tvg_message_array2[] = {"NOTVG"};
  20. const char tvg_message_array3[] = {"TV GUARDIAN ACTIVATED"};
  21. const char tvg_message_array4[] = {"TVG-DVD DICT V1.05"};
  22. uchar GetTVGMode( void ) {
  23. //  return(unsigned char)(gps->tvg_mode);
  24. return PS_Get_TVG_Mode_Value();
  25. }
  26. uchar GetTVGCCOperation( void ) {
  27. //  return((unsigned char)(gps->tvg_cc));
  28. return PS_Get_TVG_CC_Value();
  29. }
  30. uchar GetCCShiftValue( void ) {
  31. //  return((BYTE)(gps->tvg_cc_channel));
  32. return PS_Get_TVG_CC_Channel_Value();
  33. }
  34. void DisplayOperationalMessage(uchar message_index) {
  35. switch ( message_index ){
  36. case BUG_TVG:
  37. //   ie_send_ex(IE_UI_TVG_MSG_DISPLAY, (void *)(tvg_message_array1));
  38.   break;
  39. case BUG_NOTVG:
  40. //   ie_send_ex(IE_UI_TVG_MSG_DISPLAY, (void *)(tvg_message_array2));
  41.   break;
  42. case BUG_TVG_ACTIVE:
  43. //   ie_send_ex(IE_UI_TVG_MSG_DISPLAY, (void *)(tvg_message_array3));
  44.   break;
  45. case BUG_TVG_VERSION:
  46. //   ie_send_ex(IE_UI_TVG_MSG_DISPLAY, (void *)(tvg_message_array4));
  47.   break;
  48. }
  49.   return;
  50. }
  51. void HostDispalyTVGMsg(void)
  52. {
  53.  ie_send_ex(IE_UI_TVG_MSG_DISPLAY, (void *)(tvg_message_array1));
  54. }
  55. void MuteAudio( uchar enable, uchar *offset) {
  56. BYTE index;
  57. // if ( gps->tvg_cc != TVG_CC_ONCUSS )
  58. // return;
  59. index = ( gLine21MuteQueue_Write + 1 ) % LINE21MUTEQUEUESIZE;
  60. #ifdef _DEBUG
  61. //rtouts("Mute command: ");debug_out_bx(enable); rtouts(" Offset: "); debug_out_bx(*offset); rtouts(" GOP is: ");
  62.     //debug_out_bx(Line21DataBufferPool[gLine21DataBufferPool_Write].GopCounter); 
  63. //rtouts("Session ID: "); debug_out_bx(datain_session_id); rtouts("n");
  64. #endif
  65. if (index != gLine21MuteQueue_Read){
  66. Line21MuteQueue[index].mGOP = Line21DataBufferPool[gLine21DataBufferPool_Write].GopCounter;
  67. Line21MuteQueue[index].mCmd = (enable == 1 ) ? 1: 0;
  68. Line21MuteQueue[index].mOffset = (BYTE)((*offset) >> 1);
  69. gLine21MuteQueue_Write = index;
  70. #if 0
  71. if ( enable ){
  72. Line21MuteQueue[index].mMute = (BYTE)((*offset)<<1);
  73. Line21MuteQueue[index].mGOP = Line21DataBufferPool[gLine21DataBufferPool_Write].GopCounter;
  74. // mute_sem ++;
  75. gLine21MuteQueue_Write = index;
  76. }
  77. else{
  78. // if ( mute_sem){
  79. Line21MuteQueue[index].mUNMute = (BYTE)((*offset)<<1);
  80. Line21MuteQueue[index].mGOP = Line21DataBufferPool[gLine21DataBufferPool_Write].GopCounter;
  81. // mute_sem --;
  82. gLine21MuteQueue_Write = index;
  83. // }
  84. // else
  85. //dbouts("Ignore unmute commandn");
  86. }
  87. #endif
  88. }
  89. else
  90. dbg_printf(("Not enough Mute Queue!n"));
  91.   return;
  92. }
  93. #endif //TV_GUARDIAN_ENABLE