scan.h
上传用户:kjfoods
上传日期:2020-07-06
资源大小:29949k
文件大小:4k
源码类别:

midi

开发平台:

Unix_Linux

  1. /*****************************************************************************
  2.  * scan.h : functions to ease DVB scanning
  3.  *****************************************************************************
  4.  * Copyright (C) 2008 the VideoLAN team
  5.  *
  6.  * Authors: Laurent Aimar <fenrir@videolan.org>
  7.  *
  8.  * This program is free software; you can redistribute it and/or modify
  9.  * it under the terms of the GNU General Public License as published by
  10.  * the Free Software Foundation; either version 2 of the License, or
  11.  * (at your option) any later version.
  12.  *
  13.  * This program is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.    See the
  16.  * GNU General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU General Public License
  19.  * along with this program; if not, write to the Free Software
  20.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA    02111, USA.
  21.  *****************************************************************************/
  22. #ifdef HAVE_DVBPSI_DR_H
  23. #ifdef _DVBPSI_DR_43_H_
  24. #   define DVBPSI_USE_NIT 1
  25. #   include <dvbpsi/nit.h>
  26. #endif
  27. #else
  28. #ifdef _DVBPSI_DR_43_H_
  29. #   define DVBPSI_USE_NIT 1
  30. #   include "nit.h"
  31. #endif
  32. #endif
  33. #ifndef DVBPSI_USE_NIT
  34. #   warning NIT is not supported by your libdvbpsi version
  35. #endif
  36. typedef enum
  37. {
  38.     SCAN_NONE,
  39.     SCAN_DVB_T,
  40.     SCAN_DVB_S,
  41.     SCAN_DVB_C,
  42. } scan_type_t;
  43. typedef struct
  44. {
  45.     scan_type_t type;
  46.     bool b_exhaustive;
  47.     struct
  48.     {
  49.         int i_min;
  50.         int i_max;
  51.         int i_step;
  52.         int i_count;    /* Number of frequency test to do */
  53.     } frequency;
  54.     struct
  55.     {
  56.         /* Bandwidth should be 6, 7 or 8 */
  57.         int i_min;
  58.         int i_max;
  59.         int i_step;
  60.         int i_count;
  61.     } bandwidth;
  62. } scan_parameter_t;
  63. typedef struct
  64. {
  65.     int i_frequency;
  66.     int i_bandwidth;
  67. } scan_configuration_t;
  68. typedef enum
  69. {
  70.     SERVICE_UNKNOWN = 0,
  71.     SERVICE_DIGITAL_RADIO,
  72.     SERVICE_DIGITAL_TELEVISION,
  73.     SERVICE_DIGITAL_TELEVISION_AC_SD,
  74.     SERVICE_DIGITAL_TELEVISION_AC_HD,
  75. } scan_service_type_t;
  76. typedef struct
  77. {
  78.     int  i_program;     /* program number (service id) */
  79.     scan_configuration_t cfg;
  80.     int i_snr;
  81.     scan_service_type_t type;
  82.     char *psz_name;     /* channel name in utf8 or NULL */
  83.     int  i_channel;     /* -1 if unknown */
  84.     bool b_crypted;     /* True if potentially crypted */
  85.     int i_network_id;
  86.     int i_nit_version;
  87.     int i_sdt_version;
  88. } scan_service_t;
  89. typedef struct
  90. {
  91.     vlc_object_t *p_obj;
  92.     scan_configuration_t cfg;
  93.     int i_snr;
  94.     dvbpsi_handle pat;
  95.     dvbpsi_pat_t *p_pat;
  96.     int i_nit_pid;
  97.     dvbpsi_handle sdt;
  98.     dvbpsi_sdt_t *p_sdt;
  99. #ifdef DVBPSI_USE_NIT
  100.     dvbpsi_handle nit;
  101.     dvbpsi_nit_t *p_nit;
  102. #endif
  103. } scan_session_t;
  104. typedef struct
  105. {
  106.     vlc_object_t *p_obj;
  107.     struct dialog_progress_bar_t *p_dialog;
  108.     int64_t i_index;
  109.     scan_parameter_t parameter;
  110.     int64_t i_time_start;
  111.     int            i_service;
  112.     scan_service_t **pp_service;
  113. } scan_t;
  114. scan_service_t *scan_service_New( int i_program, const scan_configuration_t *p_cfg  );
  115. void scan_service_Delete( scan_service_t *p_srv );
  116. int  scan_Init( vlc_object_t *p_obj, scan_t *p_scan, const scan_parameter_t *p_parameter );
  117. void scan_Clean( scan_t *p_scan );
  118. int scan_Next( scan_t *p_scan, scan_configuration_t *p_cfg );
  119. block_t *scan_GetM3U( scan_t *p_scan );
  120. bool scan_IsCancelled( scan_t *p_scan );
  121. int  scan_session_Init( vlc_object_t *p_obj, scan_session_t *p_session, const scan_configuration_t *p_cfg );
  122. void scan_session_Clean( scan_t *p_scan, scan_session_t *p_session );
  123. bool scan_session_Push( scan_session_t *p_scan, block_t *p_block );
  124. void scan_service_SetSNR( scan_session_t *p_scan, int i_snr );