blob: ed44f5d10b0a7ac743db2a8c5ea5b1c0e3c7addd [file] [log] [blame]
Gong Ked869dd72020-07-20 09:00:25 +08001/**
2 * \file
3 * \brief DVB utility functions
4 */
5
6#ifndef DVB_UTILS_H_
7#define DVB_UTILS_H_
Gong Ke2a0ebbe2021-05-25 15:22:50 +08008
Chuanzhi Wang742ba112020-09-15 11:43:55 +08009#include <android/log.h>
Gong Ke2a0ebbe2021-05-25 15:22:50 +080010#include <stdio.h>
11#include <inttypes.h>
Gong Ked869dd72020-07-20 09:00:25 +080012
13#ifdef __cplusplus
14extern "C" {
15#endif
16
Chuanzhi Wang742ba112020-09-15 11:43:55 +080017 typedef enum
18 {
19 DVB_FAILURE = -1,
20 DVB_SUCCESS = 0
21 } DVB_RESULT;
Gong Ked869dd72020-07-20 09:00:25 +080022
Chuanzhi Wang742ba112020-09-15 11:43:55 +080023/**Logcat TAG of dvb*/
24#define DVB_LOG_TAG "dvb_debug"
25/**Default debug level*/
26#define DVB_DEBUG_LEVEL 1
Gong Ke2a0ebbe2021-05-25 15:22:50 +080027
Chuanzhi Wang742ba112020-09-15 11:43:55 +080028/**Log output*/
29#define dvb_log_print(...) __android_log_print(ANDROID_LOG_INFO, DVB_LOG_TAG, __VA_ARGS__)
30
Gong Ke2a0ebbe2021-05-25 15:22:50 +080031#ifndef __ANDROID_API__
32typedef unsigned int uint_t;
33#endif
34
Chuanzhi Wang742ba112020-09-15 11:43:55 +080035/**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.*/
61 DVB_DEMUX_SOURCE_DMA7 /**< DMA input port 7.*/
62 } DVB_DemuxSource_t;
63
64 /**
Gong Ked869dd72020-07-20 09:00:25 +080065 * Set the demux's input source.
66 * \param dmx_idx Demux device's index.
67 * \param src The demux's input source.
68 * \retval 0 On success.
69 * \retval -1 On error.
70 */
Chuanzhi Wang742ba112020-09-15 11:43:55 +080071 int dvb_set_demux_source(int dmx_idx, DVB_DemuxSource_t src);
Gong Ked869dd72020-07-20 09:00:25 +080072
Chuanzhi Wang742ba112020-09-15 11:43:55 +080073 /**
Chuanzhi Wang41bc0672020-07-29 15:58:56 +080074 * Get the demux's input source.
75 * \param dmx_idx Demux device's index.
76 * \param point src that demux's input source.
77 * \retval 0 On success.
78 * \retval -1 On error.
79 */
80int dvb_get_demux_source (int dmx_idx, DVB_DemuxSource_t *src);
Chuanzhi Wang742ba112020-09-15 11:43:55 +080081
hualing chenf9867402020-09-23 17:06:20 +080082/**
83 * check the demux's is new driver.
84 * \retval 0 On old.
85 * \retval 1 On new.
86 */
87int dvr_check_dmx_isNew(void);
Chuanzhi Wang41bc0672020-07-29 15:58:56 +080088
89
Gong Ked869dd72020-07-20 09:00:25 +080090#ifdef __cplusplus
91}
92#endif
93
94#endif /*DVB_UTILS_H_*/
95