Gong Ke | d869dd7 | 2020-07-20 09:00:25 +0800 | [diff] [blame] | 1 | /** |
| 2 | * \file |
| 3 | * \brief DVB utility functions |
| 4 | */ |
| 5 | |
| 6 | #ifndef DVB_UTILS_H_ |
| 7 | #define DVB_UTILS_H_ |
Chuanzhi Wang | 742ba11 | 2020-09-15 11:43:55 +0800 | [diff] [blame^] | 8 | #include <android/log.h> |
Gong Ke | d869dd7 | 2020-07-20 09:00:25 +0800 | [diff] [blame] | 9 | |
| 10 | #ifdef __cplusplus |
| 11 | extern "C" { |
| 12 | #endif |
| 13 | |
Chuanzhi Wang | 742ba11 | 2020-09-15 11:43:55 +0800 | [diff] [blame^] | 14 | typedef enum |
| 15 | { |
| 16 | DVB_FAILURE = -1, |
| 17 | DVB_SUCCESS = 0 |
| 18 | } DVB_RESULT; |
Gong Ke | d869dd7 | 2020-07-20 09:00:25 +0800 | [diff] [blame] | 19 | |
Chuanzhi Wang | 742ba11 | 2020-09-15 11:43:55 +0800 | [diff] [blame^] | 20 | /**Logcat TAG of dvb*/ |
| 21 | #define DVB_LOG_TAG "dvb_debug" |
| 22 | /**Default debug level*/ |
| 23 | #define DVB_DEBUG_LEVEL 1 |
| 24 | /**Log output*/ |
| 25 | #define dvb_log_print(...) __android_log_print(ANDROID_LOG_INFO, DVB_LOG_TAG, __VA_ARGS__) |
| 26 | |
| 27 | /**Output debug message.*/ |
| 28 | #define DVB_DEBUG(_level, _fmt...) \ |
| 29 | do \ |
| 30 | { \ |
| 31 | if (_level <= DVB_DEBUG_LEVEL) \ |
| 32 | dvb_log_print(_fmt); \ |
| 33 | } while (0) |
| 34 | |
| 35 | /**Demux input source.*/ |
| 36 | typedef enum |
| 37 | { |
| 38 | DVB_DEMUX_SOURCE_TS0, /**< Hardware TS input port 0.*/ |
| 39 | DVB_DEMUX_SOURCE_TS1, /**< Hardware TS input port 1.*/ |
| 40 | DVB_DEMUX_SOURCE_TS2, /**< Hardware TS input port 2.*/ |
| 41 | DVB_DEMUX_SOURCE_TS3, /**< Hardware TS input port 3.*/ |
| 42 | DVB_DEMUX_SOURCE_TS4, /**< Hardware TS input port 4.*/ |
| 43 | DVB_DEMUX_SOURCE_TS5, /**< Hardware TS input port 5.*/ |
| 44 | DVB_DEMUX_SOURCE_TS6, /**< Hardware TS input port 6.*/ |
| 45 | DVB_DEMUX_SOURCE_TS7, /**< Hardware TS input port 7.*/ |
| 46 | DVB_DEMUX_SOURCE_DMA0, /**< DMA input port 0.*/ |
| 47 | DVB_DEMUX_SOURCE_DMA1, /**< DMA input port 1.*/ |
| 48 | DVB_DEMUX_SOURCE_DMA2, /**< DMA input port 2.*/ |
| 49 | DVB_DEMUX_SOURCE_DMA3, /**< DMA input port 3.*/ |
| 50 | DVB_DEMUX_SOURCE_DMA4, /**< DMA input port 4.*/ |
| 51 | DVB_DEMUX_SOURCE_DMA5, /**< DMA input port 5.*/ |
| 52 | DVB_DEMUX_SOURCE_DMA6, /**< DMA input port 6.*/ |
| 53 | DVB_DEMUX_SOURCE_DMA7 /**< DMA input port 7.*/ |
| 54 | } DVB_DemuxSource_t; |
| 55 | |
| 56 | /** |
Gong Ke | d869dd7 | 2020-07-20 09:00:25 +0800 | [diff] [blame] | 57 | * Set the demux's input source. |
| 58 | * \param dmx_idx Demux device's index. |
| 59 | * \param src The demux's input source. |
| 60 | * \retval 0 On success. |
| 61 | * \retval -1 On error. |
| 62 | */ |
Chuanzhi Wang | 742ba11 | 2020-09-15 11:43:55 +0800 | [diff] [blame^] | 63 | int dvb_set_demux_source(int dmx_idx, DVB_DemuxSource_t src); |
Gong Ke | d869dd7 | 2020-07-20 09:00:25 +0800 | [diff] [blame] | 64 | |
Chuanzhi Wang | 742ba11 | 2020-09-15 11:43:55 +0800 | [diff] [blame^] | 65 | /** |
Chuanzhi Wang | 41bc067 | 2020-07-29 15:58:56 +0800 | [diff] [blame] | 66 | * Get the demux's input source. |
| 67 | * \param dmx_idx Demux device's index. |
| 68 | * \param point src that demux's input source. |
| 69 | * \retval 0 On success. |
| 70 | * \retval -1 On error. |
| 71 | */ |
| 72 | int dvb_get_demux_source (int dmx_idx, DVB_DemuxSource_t *src); |
Chuanzhi Wang | 742ba11 | 2020-09-15 11:43:55 +0800 | [diff] [blame^] | 73 | |
hualing chen | f986740 | 2020-09-23 17:06:20 +0800 | [diff] [blame] | 74 | /** |
| 75 | * check the demux's is new driver. |
| 76 | * \retval 0 On old. |
| 77 | * \retval 1 On new. |
| 78 | */ |
| 79 | int dvr_check_dmx_isNew(void); |
Chuanzhi Wang | 41bc067 | 2020-07-29 15:58:56 +0800 | [diff] [blame] | 80 | |
| 81 | |
Gong Ke | d869dd7 | 2020-07-20 09:00:25 +0800 | [diff] [blame] | 82 | #ifdef __cplusplus |
| 83 | } |
| 84 | #endif |
| 85 | |
| 86 | #endif /*DVB_UTILS_H_*/ |
| 87 | |