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