dvb: frontend: New linux dvb frontend Wrapper and sample. [1/1]
PD#OTT-12044
Problem:
Feature that wrapper linux dvb frontend interface.
Solution:
New linux dvb frontend Wrapper and sample.
Verify:
verified on u215
Change-Id: Ie3461effab69744ceaf44e8f9f643f27728422bc
Signed-off-by: Chuanzhi Wang <chuanzhi.wang@amlogic.com>
diff --git a/include/dvb_utils.h b/include/dvb_utils.h
index b0e1987..63e6ec6 100644
--- a/include/dvb_utils.h
+++ b/include/dvb_utils.h
@@ -5,41 +5,64 @@
#ifndef DVB_UTILS_H_
#define DVB_UTILS_H_
+#include <android/log.h>
#ifdef __cplusplus
extern "C" {
#endif
-/**Demux input source.*/
-typedef enum {
- DVB_DEMUX_SOURCE_TS0, /**< Hardware TS input port 0.*/
- DVB_DEMUX_SOURCE_TS1, /**< Hardware TS input port 1.*/
- DVB_DEMUX_SOURCE_TS2, /**< Hardware TS input port 2.*/
- DVB_DEMUX_SOURCE_TS3, /**< Hardware TS input port 3.*/
- DVB_DEMUX_SOURCE_TS4, /**< Hardware TS input port 4.*/
- DVB_DEMUX_SOURCE_TS5, /**< Hardware TS input port 5.*/
- DVB_DEMUX_SOURCE_TS6, /**< Hardware TS input port 6.*/
- DVB_DEMUX_SOURCE_TS7, /**< Hardware TS input port 7.*/
- DVB_DEMUX_SOURCE_DMA0, /**< DMA input port 0.*/
- DVB_DEMUX_SOURCE_DMA1, /**< DMA input port 1.*/
- DVB_DEMUX_SOURCE_DMA2, /**< DMA input port 2.*/
- DVB_DEMUX_SOURCE_DMA3, /**< DMA input port 3.*/
- DVB_DEMUX_SOURCE_DMA4, /**< DMA input port 4.*/
- DVB_DEMUX_SOURCE_DMA5, /**< DMA input port 5.*/
- DVB_DEMUX_SOURCE_DMA6, /**< DMA input port 6.*/
- DVB_DEMUX_SOURCE_DMA7 /**< DMA input port 7.*/
-} DVB_DemuxSource_t;
+ typedef enum
+ {
+ DVB_FAILURE = -1,
+ DVB_SUCCESS = 0
+ } DVB_RESULT;
-/**
+/**Logcat TAG of dvb*/
+#define DVB_LOG_TAG "dvb_debug"
+/**Default debug level*/
+#define DVB_DEBUG_LEVEL 1
+/**Log output*/
+#define dvb_log_print(...) __android_log_print(ANDROID_LOG_INFO, DVB_LOG_TAG, __VA_ARGS__)
+
+/**Output debug message.*/
+#define DVB_DEBUG(_level, _fmt...) \
+ do \
+ { \
+ if (_level <= DVB_DEBUG_LEVEL) \
+ dvb_log_print(_fmt); \
+ } while (0)
+
+ /**Demux input source.*/
+ typedef enum
+ {
+ DVB_DEMUX_SOURCE_TS0, /**< Hardware TS input port 0.*/
+ DVB_DEMUX_SOURCE_TS1, /**< Hardware TS input port 1.*/
+ DVB_DEMUX_SOURCE_TS2, /**< Hardware TS input port 2.*/
+ DVB_DEMUX_SOURCE_TS3, /**< Hardware TS input port 3.*/
+ DVB_DEMUX_SOURCE_TS4, /**< Hardware TS input port 4.*/
+ DVB_DEMUX_SOURCE_TS5, /**< Hardware TS input port 5.*/
+ DVB_DEMUX_SOURCE_TS6, /**< Hardware TS input port 6.*/
+ DVB_DEMUX_SOURCE_TS7, /**< Hardware TS input port 7.*/
+ DVB_DEMUX_SOURCE_DMA0, /**< DMA input port 0.*/
+ DVB_DEMUX_SOURCE_DMA1, /**< DMA input port 1.*/
+ DVB_DEMUX_SOURCE_DMA2, /**< DMA input port 2.*/
+ DVB_DEMUX_SOURCE_DMA3, /**< DMA input port 3.*/
+ DVB_DEMUX_SOURCE_DMA4, /**< DMA input port 4.*/
+ DVB_DEMUX_SOURCE_DMA5, /**< DMA input port 5.*/
+ DVB_DEMUX_SOURCE_DMA6, /**< DMA input port 6.*/
+ DVB_DEMUX_SOURCE_DMA7 /**< DMA input port 7.*/
+ } DVB_DemuxSource_t;
+
+ /**
* Set the demux's input source.
* \param dmx_idx Demux device's index.
* \param src The demux's input source.
* \retval 0 On success.
* \retval -1 On error.
*/
-int dvb_set_demux_source (int dmx_idx, DVB_DemuxSource_t src);
+ int dvb_set_demux_source(int dmx_idx, DVB_DemuxSource_t src);
-/**
+ /**
* Get the demux's input source.
* \param dmx_idx Demux device's index.
* \param point src that demux's input source.
@@ -47,6 +70,7 @@
* \retval -1 On error.
*/
int dvb_get_demux_source (int dmx_idx, DVB_DemuxSource_t *src);
+
/**
* check the demux's is new driver.
* \retval 0 On old.