am_ca: fix am_ca_key_test CL type check [1/1]

PD#SWPL-135053

Problem:
fix am_ca_key_test CL type check

Solution:
fix am_ca_key_test CL type check

Verify:
verified at t5d

Change-Id: I4463bc2ab9c9001d95d513d5c470d38d9ca622c6
Signed-off-by: chuangcheng peng <chuangcheng.peng@amlogic.com>
diff --git a/test/am_ca_key_test/inject_record_t5d/am_av/am_av.c b/test/am_ca_key_test/inject_record_t5d/am_av/am_av.c
index 2a53a93..8eab7ff 100644
--- a/test/am_ca_key_test/inject_record_t5d/am_av/am_av.c
+++ b/test/am_ca_key_test/inject_record_t5d/am_av/am_av.c
@@ -77,13 +77,13 @@
 }
 
 /**\brief 根据设备号取得设备结构并检查设备是否已经打开*/
-static AM_INLINE AM_ErrorCode_t av_get_openned_dev(int dev_no, AM_AV_Device_t **dev)
+static AM_INLINE AM_ErrorCode_t av_get_opened_dev(int dev_no, AM_AV_Device_t **dev)
 {
 	AM_TRY(av_get_dev(dev_no, dev));
 
-	if (!(*dev)->openned)
+	if (!(*dev)->opened)
 	{
-		AM_DEBUG(1, "AV device %d has not been openned", dev_no);
+		AM_DEBUG(1, "AV device %d has not been opened", dev_no);
 		return AM_AV_ERR_INVALID_DEV_NO;
 	}
 
@@ -426,16 +426,16 @@
 
 	pthread_mutex_lock(&am_gAdpLock);
 
-	if (dev->openned)
+	if (dev->opened)
 	{
-		AM_DEBUG(1, "AV device %d has already been openned", dev_no);
+		AM_DEBUG(1, "AV device %d has already been opened", dev_no);
 		ret = AM_AV_ERR_BUSY;
 		goto final;
 	}
 
 	dev->dev_no  = dev_no;
 	pthread_mutex_init(&dev->lock, NULL);
-	dev->openned = AM_TRUE;
+	dev->opened = AM_TRUE;
 	dev->mode    = 0;
 	dev->video_x = 0;
 	dev->video_y = 0;
@@ -488,7 +488,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&am_gAdpLock);
 
@@ -504,7 +504,7 @@
 	/*释放资源*/
 	pthread_mutex_destroy(&dev->lock);
 
-	dev->openned = AM_FALSE;
+	dev->opened = AM_FALSE;
 
 	pthread_mutex_unlock(&am_gAdpLock);
 
@@ -523,7 +523,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -550,7 +550,7 @@
 {
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 	if (dev->drv->set_fe_status) {
 		ret = dev->drv->set_fe_status(dev,value);
 	}
@@ -574,7 +574,7 @@
 	AM_ErrorCode_t ret = AM_SUCCESS;
 	AV_TSPlayPara_t para;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -621,7 +621,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -649,7 +649,7 @@
 
 	assert(fname);
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -691,7 +691,7 @@
 
 	assert(fname);
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -727,7 +727,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -765,7 +765,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -787,7 +787,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -824,7 +824,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -861,7 +861,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -898,7 +898,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -938,7 +938,7 @@
 	AM_ErrorCode_t ret = AM_SUCCESS;
 	AV_FileSeekPara_t para;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -981,7 +981,7 @@
 		return AM_AV_ERR_INVAL_ARG;
 	}
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -1028,7 +1028,7 @@
 		return AM_AV_ERR_INVAL_ARG;
 	}
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -1071,7 +1071,7 @@
 
 	assert(info);
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -1108,7 +1108,7 @@
 
 	assert(status);
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -1151,7 +1151,7 @@
 
 	assert(para);
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -1182,7 +1182,7 @@
 
 	//assert(para);
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -1211,7 +1211,7 @@
 
 	assert(data && size);
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -1243,7 +1243,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -1274,7 +1274,7 @@
 
 	assert(fname && info);
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	fd = open(fname, O_RDONLY);
 	if (fd == -1)
@@ -1339,7 +1339,7 @@
 
 	assert(data && info);
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	para.data  = data;
 	para.len   = len;
@@ -1395,7 +1395,7 @@
 		s_para.option = 0;
 	}
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	fd = open(fname, O_RDONLY);
 	if (fd == -1)
@@ -1477,7 +1477,7 @@
 		s_para.option = 0;
 	}
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	d_para.data  = data;
 	d_para.len   = len;
@@ -1525,7 +1525,7 @@
 
 	assert(fname);
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	fd = open(fname, O_RDONLY);
 	if (fd == -1)
@@ -1590,7 +1590,7 @@
 
 	assert(data);
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	para.data  = data;
 	para.len   = len;
@@ -1635,7 +1635,7 @@
 
 	assert(fname);
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	fd = open(fname, O_RDONLY);
 	if (fd == -1)
@@ -1701,7 +1701,7 @@
 
 	assert(data);
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	para.data  = data;
 	para.len   = len;
@@ -1736,7 +1736,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -1758,7 +1758,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -1785,7 +1785,7 @@
 	AM_ErrorCode_t ret = AM_SUCCESS;
 	AV_VideoWindow_t win;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	win.x = x;
 	win.y = y;
@@ -1840,7 +1840,7 @@
 	AM_ErrorCode_t ret = AM_SUCCESS;
 	AV_VideoWindow_t win;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	win.x = Voffset0;
 	win.y = Hoffset0;
@@ -1888,7 +1888,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -1918,7 +1918,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	val = AM_MAX(val, AM_AV_VIDEO_CONTRAST_MIN);
 	val = AM_MIN(val, AM_AV_VIDEO_CONTRAST_MAX);
@@ -1956,7 +1956,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -1980,7 +1980,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	val = AM_MAX(val, AM_AV_VIDEO_SATURATION_MIN);
 	val = AM_MIN(val, AM_AV_VIDEO_SATURATION_MAX);
@@ -2018,7 +2018,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2042,7 +2042,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	val = AM_MAX(val, AM_AV_VIDEO_BRIGHTNESS_MIN);
 	val = AM_MIN(val, AM_AV_VIDEO_BRIGHTNESS_MAX);
@@ -2080,7 +2080,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2103,7 +2103,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2137,7 +2137,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2172,7 +2172,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2204,7 +2204,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2228,7 +2228,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2259,7 +2259,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2282,7 +2282,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2312,7 +2312,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2343,7 +2343,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2378,7 +2378,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2401,7 +2401,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2437,7 +2437,7 @@
 		para = &real_para;
 	}
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2464,7 +2464,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2490,7 +2490,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2518,7 +2518,7 @@
 
 	assert(para);
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2551,7 +2551,7 @@
 
 	assert(data && size);
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2583,7 +2583,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2605,7 +2605,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2642,7 +2642,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2679,7 +2679,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2719,7 +2719,7 @@
 	AM_ErrorCode_t ret = AM_SUCCESS;
 	AV_FileSeekPara_t para;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2762,7 +2762,7 @@
 		return AM_AV_ERR_INVAL_ARG;
 	}
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2806,7 +2806,7 @@
 		return AM_AV_ERR_INVAL_ARG;
 	}
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2846,7 +2846,7 @@
 	AM_ErrorCode_t ret = AM_SUCCESS;
 	AV_TSPlayPara_t para;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2884,7 +2884,7 @@
 	AM_ErrorCode_t ret = AM_SUCCESS;
 	AV_TSPlayPara_t para;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2913,7 +2913,7 @@
 	AM_ErrorCode_t ret = AM_SUCCESS;
 	AV_TSPlayPara_t para;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2948,7 +2948,7 @@
 	UNUSED(dev_no);
 	UNUSED(di);
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2973,7 +2973,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -2990,7 +2990,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -3015,7 +3015,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -3034,7 +3034,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -3051,7 +3051,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -3068,7 +3068,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -3086,7 +3086,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -3104,7 +3104,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -3123,7 +3123,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -3142,7 +3142,7 @@
 	AM_AV_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(av_get_openned_dev(dev_no, &dev));
+	AM_TRY(av_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
diff --git a/test/am_ca_key_test/inject_record_t5d/am_av/am_av.h b/test/am_ca_key_test/inject_record_t5d/am_av/am_av.h
index 9d35902..408a92b 100644
--- a/test/am_ca_key_test/inject_record_t5d/am_av/am_av.h
+++ b/test/am_ca_key_test/inject_record_t5d/am_av/am_av.h
@@ -67,7 +67,7 @@
 {
 	AM_AV_ERROR_BASE=AM_ERROR_BASE(AM_MOD_AV),
 	AM_AV_ERR_INVALID_DEV_NO,          /**< Invalid decoder device number*/
-	AM_AV_ERR_BUSY,                    /**< The device has already been openned*/
+	AM_AV_ERR_BUSY,                    /**< The device has already been opened*/
 	AM_AV_ERR_ILLEGAL_OP,              /**< Illegal operation*/
 	AM_AV_ERR_INVAL_ARG,               /**< Invalid argument*/
 	AM_AV_ERR_NOT_ALLOCATED,           /**< The device has not been allocated*/
@@ -131,8 +131,8 @@
 {
 	AM_AV_MP_STATE_UNKNOWN = 0,        /**< Unknown*/
 	AM_AV_MP_STATE_INITING,            /**< Initializing*/
-	AM_AV_MP_STATE_NORMALERROR,        /**< Error occured*/
-	AM_AV_MP_STATE_FATALERROR,         /**< Fatal error occured*/
+	AM_AV_MP_STATE_NORMALERROR,        /**< Error occurred*/
+	AM_AV_MP_STATE_FATALERROR,         /**< Fatal error occurred*/
 	AM_AV_MP_STATE_PARSERED,           /**< The file's header has been parsed*/
 	AM_AV_MP_STATE_STARTED,            /**< Start playing*/
 	AM_AV_MP_STATE_PLAYING,            /**< Playing*/
@@ -204,7 +204,7 @@
  *
  * detail definition in "linux/amlogic/amports/aformat.h"
  */
-typedef aformat_t AM_AV_AFormat_t;
+typedef enum aformat_e AM_AV_AFormat_t;
 #endif
 
 #if 0
@@ -228,7 +228,7 @@
  *
  * detail definition in "linux/amlogic/amports/vformat.h"
  */
-typedef vformat_t AM_AV_VFormat_t;
+typedef enum vformat_e AM_AV_VFormat_t;
 #endif
 
 /**\brief AV stream package format*/
@@ -251,7 +251,7 @@
 /**\brief Video aspect ratio match mode*/
 typedef enum
 {
-	AM_AV_VIDEO_ASPECT_MATCH_IGNORE,     /**< Ignoring orignal aspect ratio*/
+	AM_AV_VIDEO_ASPECT_MATCH_IGNORE,     /**< Ignoring original aspect ratio*/
 	AM_AV_VIDEO_ASPECT_MATCH_LETTER_BOX, /**< Letter box match mode*/
 	AM_AV_VIDEO_ASPECT_MATCH_PAN_SCAN,   /**< Pan scan match mode*/
 	AM_AV_VIDEO_ASPECT_MATCH_COMBINED    /**< Combined letter box/pan scan match mode*/
@@ -347,16 +347,16 @@
 typedef enum
 {
 	AM_AV_JPEG_OPT_THUMBNAIL_ONLY     = 1, /**< Decode in thumbnail only mode*/
-	AM_AV_JPEG_OPT_THUMBNAIL_PREFERED = 2, /**< Decode in thumbnail prefered mode*/
+	AM_AV_JPEG_OPT_THUMBNAIL_PREFERRED = 2, /**< Decode in thumbnail PREFERRED mode*/
 	AM_AV_JPEG_OPT_FULLRANGE          = 4  /**< Normal*/
 } AM_AV_JPEGOption_t;
 
 /**\brief Image surface parameters (used in JPEG decoder)*/
 typedef struct
 {
-	int    width;                 /**< Image width, <=0 means use orignal size*/
-	int    height;                /**< Image height, <=0 means use orignal size*/
-	AM_AV_JPEGAngle_t  angle;     /**< JPEG image ratation parameter*/
+	int    width;                 /**< Image width, <=0 means use original size*/
+	int    height;                /**< Image height, <=0 means use original size*/
+	AM_AV_JPEGAngle_t  angle;     /**< JPEG image rotation parameter*/
 	AM_AV_JPEGOption_t option;    /**< JPEG decoder options*/
 } AM_AV_SurfacePara_t;
 
@@ -446,7 +446,7 @@
 	{
 		int pid; /**< Audio PID*/
 		int fmt; /**< Audio format*/
-		char lang[4]; /**< Lanuguage descripton*/
+		char lang[4]; /**< Language description*/
 	}audios[8]; /**< Audio information array*/
 
 	int sub_cnt; /**< Subtitle number*/
@@ -761,7 +761,7 @@
  */
 extern AM_ErrorCode_t AM_AV_StopAudioES(int dev_no);
 
-/**\brief Enable/diable decoder's DRM mode
+/**\brief Enable/disable decoder's DRM mode
  * \param dev_no AV decoder device number
  * \param[in] enable enable or disable DRM mode
  * \retval AM_SUCCESS On success
diff --git a/test/am_ca_key_test/inject_record_t5d/am_av/am_av_internal.h b/test/am_ca_key_test/inject_record_t5d/am_av/am_av_internal.h
index 527ef36..7ea0dc8 100644
--- a/test/am_ca_key_test/inject_record_t5d/am_av/am_av_internal.h
+++ b/test/am_ca_key_test/inject_record_t5d/am_av/am_av_internal.h
@@ -267,7 +267,7 @@
 	AV_InjectPlayer_t inject_player; /**< 数据注入播放器*/
 	AV_TimeshiftPlayer_t timeshift_player;	/**< Timeshift 播放器*/
 	pthread_mutex_t  lock;           /**< 设备资源保护互斥体*/
-	AM_Bool_t        openned;        /**< 设备是否已经打开*/
+	AM_Bool_t        opened;        /**< 设备是否已经打开*/
 	AV_PlayMode_t    mode;           /**< 当前播放模式*/
 	int              video_x;        /**< 当前视频窗口左上角X坐标*/
 	int              video_y;        /**< 当前视频窗口左上角Y坐标*/
diff --git a/test/am_ca_key_test/inject_record_t5d/am_av/aml/aml.c b/test/am_ca_key_test/inject_record_t5d/am_av/aml/aml.c
index 8e4948c..50cdaf6 100644
--- a/test/am_ca_key_test/inject_record_t5d/am_av/aml/aml.c
+++ b/test/am_ca_key_test/inject_record_t5d/am_av/aml/aml.c
@@ -326,7 +326,7 @@
 #endif
 
 /*
- * As not inlude "adec-external-ctrl.h", so we need declare
+ * As not include "adec-external-ctrl.h", so we need declare
  * audio_decode_set_volume. Otherwise it will lost the value of the second
  * param, AKA volume.
  */
@@ -1072,7 +1072,7 @@
 
 //	AM_AOUT_SetDriver(AOUT_DEV_NO, &adec_aout_drv_cb, NULL);
 
-	// just for compatile with native decoder.
+	// just for compatible with native decoder.
 	*padec = (void *)1;
 	adec_handle = (void *) 1;
 }
@@ -1646,7 +1646,7 @@
         break;
 
     default:
-        AM_DEBUG(1,"Unknow mode %d!", mode);
+        AM_DEBUG(1,"unknown mode %d!", mode);
         break;
 
     };
@@ -2250,7 +2250,7 @@
 			AM_DEBUG(1, "set AMSTREAM_IOC_SYSINFO");
 			return AM_AV_ERR_SYS;
 		}
-		/*configure double wirte mode*/
+		/*configure double write mode*/
 		memset(vdec_info, 0, sizeof(vdec_info));
 		if (para->vid_fmt == VFORMAT_HEVC) {
 			sprintf(vdec_info, "hevc_double_write_mode:%d", double_write_mode);
@@ -2376,10 +2376,10 @@
 }
 void aml_term_signal_handler(int signo)
 {
-	AM_DEBUG(1,"PVR_DEBUG recive a signal:%d", signo);
+	AM_DEBUG(1,"PVR_DEBUG receive a signal:%d", signo);
 	if (signo == SIGTERM)
 	{
-		AM_DEBUG(1,"PVR_DEBUG recive SIGTERM");
+		AM_DEBUG(1,"PVR_DEBUG receive SIGTERM");
 		if (m_tshift == NULL)
 			return;
 		AM_TFile_t tfile = m_tshift->file;
@@ -2683,7 +2683,7 @@
 	/*patch dec control*/
 	set_dec_control(has_video);
 
-	AM_DEBUG(1, "Openning demux%d",para->dmx_id);
+	AM_DEBUG(1, "opening demux%d",para->dmx_id);
 	snprintf(buf, sizeof(buf), "/dev/dvb0.demux%d", para->dmx_id);
 	tshift->dmxfd = open(buf, O_RDWR);
 	if (tshift->dmxfd == -1)
@@ -2709,7 +2709,7 @@
 
 	if (check_vfmt_support_sched(tp->vfmt) == AM_FALSE)
 	{
-		AM_DEBUG(1, "Openning mpts");
+		AM_DEBUG(1, "opening mpts");
 		ts->fd = open(STREAM_TS_FILE, O_RDWR);
 		if (ts->fd == -1)
 		{
@@ -2719,7 +2719,7 @@
 	}
 	else
 	{
-		AM_DEBUG(1, "Openning mpts_sched");
+		AM_DEBUG(1, "opening mpts_sched");
 		ts->fd = open(STREAM_TS_SCHED_FILE, O_RDWR);
 		if (ts->fd == -1)
 		{
@@ -2729,7 +2729,7 @@
 	}
 
 	if (has_video) {
-		AM_DEBUG(1, "Openning video");
+		AM_DEBUG(1, "opening video");
 		ts->vid_fd = open(AMVIDEO_FILE, O_RDWR);
 		if (ts->vid_fd == -1)
 		{
@@ -2965,7 +2965,7 @@
 	if (mon->av_thread_running) {
 		mon->av_thread_running = AM_FALSE;
 		pthread_cond_broadcast(&gAVMonCond);
-		AM_DEBUG(1, "[avmon] stop av monitor ---broardcast end join start\r\n");
+		AM_DEBUG(1, "[avmon] stop av monitor ---broadcast end join start\r\n");
 		pthread_join(mon->av_mon_thread, NULL);
 		AM_DEBUG(1, "[avmon] stop av monitor ---join end\r\n");
 	}
@@ -3187,7 +3187,7 @@
 static int aml_timeshift_do_cmd_start(AV_TimeshiftData_t *tshift)
 {
 	loff_t offset;
-	int seeked = 0;
+	int sought = 0;
 
         AV_TimeshiftState_t last_stat =  tshift->state;
 	tshift->inject_size = 64*1024;
@@ -3197,7 +3197,7 @@
 	if (tshift->para.para.mode == AM_AV_TIMESHIFT_MODE_TIMESHIFTING) {
 		if (AM_TFile_TimeGetReadNow(tshift->file) != tshift->current) {
 			AM_TFile_TimeSeek(tshift->file, tshift->current);
-			seeked = 1;
+			sought = 1;
 		}
 	} else {//rec play
 		loff_t off = AM_TFile_Tell(tshift->file);
@@ -3206,13 +3206,13 @@
 		if (current != tshift->current) {
 			offset = (loff_t)tshift->current / 1000 * (loff_t)tshift->rate;
 			AM_TFile_Seek(tshift->file, offset);
-			seeked = 1;
+			sought = 1;
 		}
 	}
 	if (VALID_VIDEO(tshift->tp.vpid, tshift->tp.vfmt))
 		ioctl(tshift->ts.vid_fd, AMSTREAM_IOC_TRICKMODE, TRICKMODE_NONE);
 
-	if (seeked || last_stat == AV_TIMESHIFT_STAT_FFFB)
+	if (sought || last_stat == AV_TIMESHIFT_STAT_FFFB)
 		am_timeshift_reset(tshift, 2, AM_TRUE);
 
 	//if (tshift->last_cmd == AV_PLAY_FF || tshift->last_cmd == AV_PLAY_FB)
@@ -4070,14 +4070,14 @@
 				if ((now - tshift->rtime) >= 3000)
 				{
 					tshift->rtotal += size;
-					/*Calcaulate the rate*/
+					/*calculate the rate*/
 					tshift->rate = (tshift->rtotal*1000)/(now - tshift->rtime);
 					if (tshift->rate && tshift->file->loop)
 					{
 						/*Calculate the file size*/
 						tshift->file->size = (loff_t)tshift->rate * (loff_t)(tshift->duration / 1000);
 						pthread_cond_signal(&tshift->cond);
-						AM_DEBUG(1, "zzz @@@wirte record data %lld bytes in %d ms,so the rate is assumed to %d Bps, ring file size %lld",
+						AM_DEBUG(1, "zzz @@@write record data %lld bytes in %d ms,so the rate is assumed to %d Bps, ring file size %lld",
 							tshift->rtotal, now - tshift->rtime, tshift->rate, tshift->file->size);
 					}
 					else
@@ -4945,7 +4945,7 @@
 			AM_DEBUG(1, "set AMSTREAM_IOC_SYSINFO");
 			return AM_AV_ERR_SYS;
 		}
-		/*configure double wirte mode*/
+		/*configure double write mode*/
 		memset(vdec_info, 0, sizeof(vdec_info));
 		if (tp->vfmt == VFORMAT_HEVC) {
 			sprintf(vdec_info, "hevc_double_write_mode:%d", double_write_mode);
@@ -6794,7 +6794,7 @@
 
 	if (fd == -1)
 	{
-		AM_DEBUG(1, "device is not openned");
+		AM_DEBUG(1, "device is not opened");
 		return AM_AV_ERR_NOT_ALLOCATED;
 	}
 
@@ -7153,31 +7153,31 @@
     {
     case AM_AV_PPMGR_MODE3D_DISABLE:
         arg = MODE_3D_DISABLE;
-        AM_DEBUG(1,"3D fucntion (0: Disalbe!)\n");
+        AM_DEBUG(1,"3D function (0: Disable!)\n");
         break;
     case AM_AV_PPMGR_MODE3D_AUTO:
         arg = MODE_3D_ENABLE|MODE_AUTO;
-        AM_DEBUG(1,"3D fucntion (1: Auto!)\n");
+        AM_DEBUG(1,"3D function (1: Auto!)\n");
         break;
     case AM_AV_PPMGR_MODE3D_2D_TO_3D:
         arg = MODE_3D_ENABLE|MODE_2D_TO_3D;
-        AM_DEBUG(1,"3D fucntion (2: 2D->3D!)\n");
+        AM_DEBUG(1,"3D function (2: 2D->3D!)\n");
         break;
     case AM_AV_PPMGR_MODE3D_LR:
         arg = MODE_3D_ENABLE|MODE_LR;
-        AM_DEBUG(1,"3D fucntion (3: L/R!)\n");
+        AM_DEBUG(1,"3D function (3: L/R!)\n");
         break;
     case AM_AV_PPMGR_MODE3D_BT:
         arg = MODE_3D_ENABLE|MODE_BT;
-        AM_DEBUG(1,"3D fucntion (4: B/T!)\n");
+        AM_DEBUG(1,"3D function (4: B/T!)\n");
         break;
     case AM_AV_PPMGR_MODE3D_OFF_LR_SWITCH:
         arg = MODE_3D_ENABLE|MODE_LR;
-        AM_DEBUG(1,"3D fucntion (5: LR SWITCH OFF!)\n");
+        AM_DEBUG(1,"3D function (5: LR SWITCH OFF!)\n");
         break;
     case AM_AV_PPMGR_MODE3D_ON_LR_SWITCH:
         arg = MODE_3D_ENABLE|MODE_LR_SWITCH;
-        AM_DEBUG(1,"3D fucntion (6: LR SWITCH!)\n");
+        AM_DEBUG(1,"3D function (6: LR SWITCH!)\n");
         break;
     case AM_AV_PPMGR_MODE3D_FIELD_DEPTH:
         arg = MODE_3D_ENABLE|MODE_FIELD_DEPTH;
@@ -7185,7 +7185,7 @@
         break;
     case AM_AV_PPMGR_MODE3D_OFF_3D_TO_2D:
         arg = MODE_3D_ENABLE|MODE_LR;
-        AM_DEBUG(1,"3D fucntion (8: 3D_TO_2D_TURN_OFF!)\n");
+        AM_DEBUG(1,"3D function (8: 3D_TO_2D_TURN_OFF!)\n");
         break;
     case AM_AV_PPMGR_MODE3D_L_3D_TO_2D:
         arg = MODE_3D_ENABLE|MODE_3D_TO_2D_L;
@@ -7201,11 +7201,11 @@
         break;
     case AM_AV_PPMGR_MODE3D_ON_LR_SWITCH_BT:
         arg = MODE_3D_ENABLE|MODE_LR_SWITCH|BT_FORMAT_INDICATOR;
-        AM_DEBUG(1,"3D fucntion (12: BT SWITCH!)\n");
+        AM_DEBUG(1,"3D function (12: BT SWITCH!)\n");
         break;
     case AM_AV_PPMGR_MODE3D_OFF_3D_TO_2D_BT:
         arg = MODE_3D_ENABLE|MODE_BT;
-        AM_DEBUG(1,"3D fucntion (13: 3D_TO_2D_TURN_OFF_BT!)\n");
+        AM_DEBUG(1,"3D function (13: 3D_TO_2D_TURN_OFF_BT!)\n");
         break;
     case AM_AV_PPMGR_MODE3D_L_3D_TO_2D_BT:
         arg = MODE_3D_ENABLE|MODE_3D_TO_2D_L|BT_FORMAT_INDICATOR;
@@ -7216,7 +7216,7 @@
         AM_DEBUG(1,"3D function (15: 3D TO 2D R BT!)\n");
         break;
     default:
-    	AM_DEBUG(1, "Unkown set 3D cmd %d", cmd);
+        AM_DEBUG(1, "unknown set 3D cmd %d", cmd);
     	arg = -1;
     	break;
     }
diff --git a/test/am_ca_key_test/inject_record_t5d/am_dmx/am_dmx.c b/test/am_ca_key_test/inject_record_t5d/am_dmx/am_dmx.c
index ffea075..13bd2c6 100644
--- a/test/am_ca_key_test/inject_record_t5d/am_dmx/am_dmx.c
+++ b/test/am_ca_key_test/inject_record_t5d/am_dmx/am_dmx.c
@@ -111,13 +111,13 @@
 }
 
 /**\brief 根据设备号取得设备结构并检查设备是否已经打开*/
-static AM_INLINE AM_ErrorCode_t dmx_get_openned_dev(int dev_no, AM_DMX_Device_t **dev)
+static AM_INLINE AM_ErrorCode_t dmx_get_opened_dev(int dev_no, AM_DMX_Device_t **dev)
 {
 	AM_TRY(dmx_get_dev(dev_no, dev));
 	
 	if((*dev)->open_count <= 0)
 	{
-		AM_DEBUG(1, "demux device %d has not been openned", dev_no);
+		AM_DEBUG(1, "demux device %d has not been opened", dev_no);
 		return AM_DMX_ERR_INVALID_DEV_NO;
 	}
 	
@@ -343,7 +343,7 @@
 	
 	if(dev->open_count > 0)
 	{
-		AM_DEBUG(1, "demux device %d has already been openned", dev_no);
+		AM_DEBUG(1, "demux device %d has already been opened", dev_no);
 		dev->open_count++;
 		ret = AM_SUCCESS;
 		goto final;
@@ -399,7 +399,7 @@
 	AM_ErrorCode_t ret = AM_SUCCESS;
 	int i;
 	
-	AM_TRY(dmx_get_openned_dev(dev_no, &dev));
+	AM_TRY(dmx_get_opened_dev(dev_no, &dev));
 	
 	pthread_mutex_lock(&am_gAdpLock);
 
@@ -443,7 +443,7 @@
 	
 	assert(fhandle);
 	
-	AM_TRY(dmx_get_openned_dev(dev_no, &dev));
+	AM_TRY(dmx_get_opened_dev(dev_no, &dev));
 	
 	pthread_mutex_lock(&dev->lock);
 	
@@ -497,7 +497,7 @@
 	
 	assert(params);
 	
-	AM_TRY(dmx_get_openned_dev(dev_no, &dev));
+	AM_TRY(dmx_get_opened_dev(dev_no, &dev));
 	
 	if(!dev->drv->set_sec_filter)
 	{
@@ -551,7 +551,7 @@
 	
 	assert(params);
 	
-	AM_TRY(dmx_get_openned_dev(dev_no, &dev));
+	AM_TRY(dmx_get_opened_dev(dev_no, &dev));
 	
 	if(!dev->drv->set_pes_filter)
 	{
@@ -593,7 +593,7 @@
 	AM_DMX_Filter_t *filter;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 	
-	AM_TRY(dmx_get_openned_dev(dev_no, &dev));
+	AM_TRY(dmx_get_opened_dev(dev_no, &dev));
 	
 	pthread_mutex_lock(&dev->lock);
 	
@@ -623,7 +623,7 @@
 	AM_DMX_Filter_t *filter = NULL;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 	
-	AM_TRY(dmx_get_openned_dev(dev_no, &dev));
+	AM_TRY(dmx_get_opened_dev(dev_no, &dev));
 	
 	pthread_mutex_lock(&dev->lock);
 	
@@ -663,7 +663,7 @@
 	AM_DMX_Filter_t *filter = NULL;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 	
-	AM_TRY(dmx_get_openned_dev(dev_no, &dev));
+	AM_TRY(dmx_get_opened_dev(dev_no, &dev));
 	
 	pthread_mutex_lock(&dev->lock);
 	
@@ -697,7 +697,7 @@
 	AM_DMX_Filter_t *filter;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 	
-	AM_TRY(dmx_get_openned_dev(dev_no, &dev));
+	AM_TRY(dmx_get_opened_dev(dev_no, &dev));
 	
 	pthread_mutex_lock(&dev->lock);
 	
@@ -733,7 +733,7 @@
 	AM_DMX_Filter_t *filter;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 	
-	AM_TRY(dmx_get_openned_dev(dev_no, &dev));
+	AM_TRY(dmx_get_opened_dev(dev_no, &dev));
 	
 	pthread_mutex_lock(&dev->lock);
 	
@@ -768,7 +768,7 @@
 	AM_DMX_Filter_t *filter;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 	
-	AM_TRY(dmx_get_openned_dev(dev_no, &dev));
+	AM_TRY(dmx_get_opened_dev(dev_no, &dev));
 	
 	pthread_mutex_lock(&dev->lock);
 	
@@ -799,7 +799,7 @@
 	AM_DMX_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 	
-	AM_TRY(dmx_get_openned_dev(dev_no, &dev));
+	AM_TRY(dmx_get_opened_dev(dev_no, &dev));
 	
 	pthread_mutex_lock(&dev->lock);
 	if(!dev->drv->set_source)
@@ -836,7 +836,7 @@
 	AM_DMX_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 	
-	AM_TRY(dmx_get_openned_dev(dev_no, &dev));
+	AM_TRY(dmx_get_opened_dev(dev_no, &dev));
 	
 	pthread_mutex_lock(&dev->lock);
 	if(dev->thread!=pthread_self())
@@ -867,7 +867,7 @@
 				dev_status[0] = vflag ? AM_TRUE : AM_FALSE;
 			if (!dev_status[1])
 				dev_status[1] = aflag ? AM_TRUE : AM_FALSE;
-			//AM_DEBUG(1, "AM_DMX_GetScrambleStatus video scamble %d, audio scamble %d\n", vflag, aflag);
+			//AM_DEBUG(1, "AM_DMX_GetScrambleStatus video scramble %d, audio scramble %d\n", vflag, aflag);
 			if (dev_status[0] && dev_status[1])
 			{
 				return AM_SUCCESS;
@@ -876,7 +876,7 @@
 		}
 		else
 		{
-			AM_DEBUG(1, "AM_DMX_GetScrambleStatus read scamble status failed\n");
+			AM_DEBUG(1, "AM_DMX_GetScrambleStatus read scramble status failed\n");
 			return AM_FAILURE;
 		}
 	}
diff --git a/test/am_ca_key_test/inject_record_t5d/am_dmx/am_dmx.h b/test/am_ca_key_test/inject_record_t5d/am_dmx/am_dmx.h
index 8c8ba3b..b7559bf 100644
--- a/test/am_ca_key_test/inject_record_t5d/am_dmx/am_dmx.h
+++ b/test/am_ca_key_test/inject_record_t5d/am_dmx/am_dmx.h
@@ -16,7 +16,7 @@
 /**\file
  * \brief Demux module
  *
- * Basic data strucutres definition in "linux/dvb/dmx.h"
+ * Basic data structures definition in "linux/dvb/dmx.h"
  *
  * \author Gong Ke <ke.gong@amlogic.com>
  * \date 2010-05-21: create the document
@@ -49,7 +49,7 @@
 	AM_DMX_ERROR_BASE=AM_ERROR_BASE(AM_MOD_DMX),
 	AM_DMX_ERR_INVALID_DEV_NO,          /**< Invalid device number*/
 	AM_DMX_ERR_INVALID_ID,              /**< Invalid filer handle*/
-	AM_DMX_ERR_BUSY,                    /**< The device has already been openned*/
+	AM_DMX_ERR_BUSY,                    /**< The device has already been opened*/
 	AM_DMX_ERR_NOT_ALLOCATED,           /**< The device has not been allocated*/
 	AM_DMX_ERR_CANNOT_CREATE_THREAD,    /**< Cannot create new thread*/
 	AM_DMX_ERR_CANNOT_OPEN_DEV,         /**< Cannot open device*/
@@ -74,7 +74,19 @@
 	AM_DMX_SRC_TS2,                    /**< TS input port 2*/
 	AM_DMX_SRC_TS3,                    /**< TS input port 3*/
 	AM_DMX_SRC_HIU,                     /**< HIU input (memory)*/
-	AM_DMX_SRC_HIU1
+	AM_DMX_SRC_HIU1,
+	AM_DMX_SRC_TS4,
+	AM_DMX_SRC_TS5,
+	AM_DMX_SRC_TS6,
+	AM_DMX_SRC_TS7,
+	AM_DMX_SRC_DMA0,
+	AM_DMX_SRC_DMA1,
+	AM_DMX_SRC_DMA2,
+	AM_DMX_SRC_DMA3,
+	AM_DMX_SRC_DMA4,
+	AM_DMX_SRC_DMA5,
+	AM_DMX_SRC_DMA6,
+	AM_DMX_SRC_DMA7,
 } AM_DMX_Source_t;
 
 /**\brief Demux device open parameters*/
diff --git a/test/am_ca_key_test/inject_record_t5d/am_dvr/am_dvr.c b/test/am_ca_key_test/inject_record_t5d/am_dvr/am_dvr.c
index 049c249..6fedc11 100644
--- a/test/am_ca_key_test/inject_record_t5d/am_dvr/am_dvr.c
+++ b/test/am_ca_key_test/inject_record_t5d/am_dvr/am_dvr.c
@@ -33,7 +33,7 @@
 #include <am_debug.h>
 #include "am_dvr_internal.h"
 #include <am_dmx.h>
-#include <am_fend.h>
+//#include <am_fend.h>
 #include <am_time.h>
 #include <am_mem.h>
 
@@ -108,13 +108,13 @@
 }
 
 /**\brief 根据设备号取得设备结构并检查设备是否已经打开*/
-static AM_INLINE AM_ErrorCode_t dvr_get_openned_dev(int dev_no, AM_DVR_Device_t **dev)
+static AM_INLINE AM_ErrorCode_t dvr_get_opened_dev(int dev_no, AM_DVR_Device_t **dev)
 {
 	AM_TRY(dvr_get_dev(dev_no, dev));
 	
 	if(!(*dev)->open_cnt)
 	{
-		AM_DEBUG(1, "dvr device %d has not been openned", dev_no);
+		AM_DEBUG(1, "dvr device %d has not been opened", dev_no);
 		return AM_DVR_ERR_INVALID_DEV_NO;
 	}
 	
@@ -221,7 +221,7 @@
 	
 	if(dev->open_cnt)
 	{
-		AM_DEBUG(1, "dvr device %d has already been openned", dev_no);
+		AM_DEBUG(1, "dvr device %d has already been opened", dev_no);
 		dev->open_cnt++;
 		goto final;
 	}
@@ -301,7 +301,7 @@
 	AM_DVR_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 	
-	AM_TRY(dvr_get_openned_dev(dev_no, &dev));
+	AM_TRY(dvr_get_opened_dev(dev_no, &dev));
 	
 	pthread_mutex_lock(&dev->lock);
 	
@@ -342,7 +342,7 @@
 	if (pid_cnt > AM_DVR_MAX_PID_COUNT)
 		pid_cnt = AM_DVR_MAX_PID_COUNT;
 		
-	AM_TRY(dvr_get_openned_dev(dev_no, &dev));
+	AM_TRY(dvr_get_opened_dev(dev_no, &dev));
 	
 	pthread_mutex_lock(&dev->lock);
 	if (dev->record)
@@ -380,7 +380,7 @@
 	AM_DVR_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 	
-	AM_TRY(dvr_get_openned_dev(dev_no, &dev));
+	AM_TRY(dvr_get_opened_dev(dev_no, &dev));
 	
 	pthread_mutex_lock(&dev->lock);
 	if (dev->record)
@@ -409,7 +409,7 @@
 	AM_ErrorCode_t ret;
 	int cnt = -1;
 
-	AM_TRY(dvr_get_openned_dev(dev_no, &dev));
+	AM_TRY(dvr_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 	if(!dev->drv->read)
@@ -444,7 +444,7 @@
 	AM_DVR_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 	
-	AM_TRY(dvr_get_openned_dev(dev_no, &dev));
+	AM_TRY(dvr_get_opened_dev(dev_no, &dev));
 	
 	pthread_mutex_lock(&dev->lock);
 	if(!dev->drv->set_source)
diff --git a/test/am_ca_key_test/inject_record_t5d/am_dvr/am_dvr.h b/test/am_ca_key_test/inject_record_t5d/am_dvr/am_dvr.h
index cf5a3f3..0c0bcb0 100644
--- a/test/am_ca_key_test/inject_record_t5d/am_dvr/am_dvr.h
+++ b/test/am_ca_key_test/inject_record_t5d/am_dvr/am_dvr.h
@@ -44,7 +44,7 @@
 	AM_DVR_ERROR_BASE=AM_ERROR_BASE(AM_MOD_DVR),
 	AM_DVR_ERR_INVALID_ARG,			/**< Invalid argument*/
 	AM_DVR_ERR_INVALID_DEV_NO,		/**< Invalid decide number*/
-	AM_DVR_ERR_BUSY,                        /**< The device has already been openned*/
+	AM_DVR_ERR_BUSY,                        /**< The device has already been opened*/
 	AM_DVR_ERR_NOT_ALLOCATED,           /**< The device has not been allocated*/
 	AM_DVR_ERR_CANNOT_CREATE_THREAD,    /**< Cannot create a new thread*/
 	AM_DVR_ERR_CANNOT_OPEN_DEV,         /**< Cannot open the device*/
@@ -88,14 +88,14 @@
 /**\brief Open a DVR device
  * \param dev_no DVR device number
  * \param[in] para DVR device open parameters
- * \retval AM_SUCCESS On succes
+ * \retval AM_SUCCESS On success
  * \return Error code
  */
 extern AM_ErrorCode_t AM_DVR_Open(int dev_no, const AM_DVR_OpenPara_t *para);
 
 /**\brief Close an unused DVR device
  * \param dev_no DVR device number
- * \retval AM_SUCCESS On succes
+ * \retval AM_SUCCESS On success
  * \return Error code
  */
 extern AM_ErrorCode_t AM_DVR_Close(int dev_no);
@@ -103,7 +103,7 @@
 /**\brief Set the DVR device's ring queue buffer size.
  * \param dev_no DVR device number
  * \param size Ring queue buffer size
- * \retval AM_SUCCESS On succes
+ * \retval AM_SUCCESS On success
  * \return Error code
  */
 extern AM_ErrorCode_t AM_DVR_SetBufferSize(int dev_no, int size);
@@ -111,14 +111,14 @@
 /**\brief Start recording
  * \param dev_no DVR device number
  * \param [in] para Recording parameters
- * \retval AM_SUCCESS On succes
+ * \retval AM_SUCCESS On success
  * \return Error code
  */
 extern AM_ErrorCode_t AM_DVR_StartRecord(int dev_no, const AM_DVR_StartRecPara_t *para);
 
 /**\brief Stop recording
  * \param dev_no DVR device number
- * \retval AM_SUCCESS On succes
+ * \retval AM_SUCCESS On success
  * \return Error code
  */
 extern AM_ErrorCode_t AM_DVR_StopRecord(int dev_no);
@@ -126,7 +126,7 @@
 /**\brief Set the DVR input source
  * \param dev_no DVR device number
  * \param	src DVR input source
- * \retval AM_SUCCESS On succes
+ * \retval AM_SUCCESS On success
  * \return Error code
  */
 extern AM_ErrorCode_t AM_DVR_SetSource(int dev_no, AM_DVR_Source_t src);
diff --git a/test/am_ca_key_test/inject_record_t5d/am_inject_record.c b/test/am_ca_key_test/inject_record_t5d/am_inject_record.c
index c36668f..a2752a0 100644
--- a/test/am_ca_key_test/inject_record_t5d/am_inject_record.c
+++ b/test/am_ca_key_test/inject_record_t5d/am_inject_record.c
@@ -300,11 +300,11 @@
 	av_para.vid_id  = pids[0];
 	av_para.aud_id  = pids[1];
 
-	AM_DEBUG(1, "Openning DMX%d...", 0);
+	AM_DEBUG(1, "opening DMX%d...", 0);
 	memset(&para, 0, sizeof(para));
 	AM_TRY(AM_DMX_Open(DMX_DEV_NO, &para));
 	AM_DMX_SetSource(DMX_DEV_NO, AM_DMX_SRC_HIU);
-	AM_DEBUG(1, "Openning DVR%d...", 0);
+	AM_DEBUG(1, "opening DVR%d...", 0);
 	memset(&dpara, 0, sizeof(dpara));
 	AM_TRY(AM_DVR_Open(DVR_DEV_NO, &dpara));
 
diff --git a/test/am_ca_key_test/inject_record_t5d/am_tfile/am_tfile.c b/test/am_ca_key_test/inject_record_t5d/am_tfile/am_tfile.c
index 3dc295d..17d3685 100644
--- a/test/am_ca_key_test/inject_record_t5d/am_tfile/am_tfile.c
+++ b/test/am_ca_key_test/inject_record_t5d/am_tfile/am_tfile.c
@@ -337,7 +337,7 @@
 	}
 	else
 	{
-		AM_DEBUG(1, "openning %s\n", fname);
+		AM_DEBUG(1, "opening %s\n", fname);
 		sub_file->wfd = open(fname, flags, 0666);
 		sub_file->rfd = open(fname, O_RDONLY, 0666);
 	}
@@ -1128,7 +1128,7 @@
 		} else {
 			tfile->wtotal += size;
 			if ((now - tfile->wlast) >= 3000) {
-				/*Calcaulate the rate*/
+				/*calculate the rate*/
 				tfile->rate = (tfile->wtotal*1000)/(now - tfile->wlast);
 				AM_DEBUG(1, "[tfile] got rate:%dBps", tfile->rate);
 				if (tfile->rate) {
diff --git a/test/am_ca_key_test/inject_record_t5d/am_userdata/am_userdata.c b/test/am_ca_key_test/inject_record_t5d/am_userdata/am_userdata.c
index ba3e222..42bd4ee 100644
--- a/test/am_ca_key_test/inject_record_t5d/am_userdata/am_userdata.c
+++ b/test/am_ca_key_test/inject_record_t5d/am_userdata/am_userdata.c
@@ -90,13 +90,13 @@
 }
 
 /**\brief 根据设备号取得设备结构并检查设备是否已经打开*/
-static AM_INLINE AM_ErrorCode_t userdata_get_openned_dev(int dev_no, AM_USERDATA_Device_t **dev)
+static AM_INLINE AM_ErrorCode_t userdata_get_opened_dev(int dev_no, AM_USERDATA_Device_t **dev)
 {
 	AM_TRY(userdata_get_dev(dev_no, dev));
 	
 	if (!(*dev)->open_cnt)
 	{
-		AM_DEBUG(1, "userdata device %d has not been openned", dev_no);
+		AM_DEBUG(1, "userdata device %d has not been opened", dev_no);
 		return AM_USERDATA_ERR_INVALID_DEV_NO;
 	}
 	
@@ -352,7 +352,7 @@
 	
 	if (dev->open_cnt)
 	{
-		AM_DEBUG(1, "userdata device %d has already been openned", dev_no);
+		AM_DEBUG(1, "userdata device %d has already been opened", dev_no);
 		dev->open_cnt++;
 		goto final;
 	}
@@ -433,7 +433,7 @@
 	AM_ErrorCode_t ret;
 	int cnt = -1;
 
-	AM_TRY(userdata_get_openned_dev(dev_no, &dev));
+	AM_TRY(userdata_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 	ret = userdata_package_poll(dev, timeout_ms);
@@ -451,7 +451,7 @@
 	AM_USERDATA_Device_t *dev;
 	AM_ErrorCode_t ret = AM_SUCCESS;
 
-	AM_TRY(userdata_get_openned_dev(dev_no, &dev));
+	AM_TRY(userdata_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
@@ -471,7 +471,7 @@
 	if (!mode)
 		return AM_USERDATA_ERR_INVALID_ARG;
 
-	AM_TRY(userdata_get_openned_dev(dev_no, &dev));
+	AM_TRY(userdata_get_opened_dev(dev_no, &dev));
 
 	pthread_mutex_lock(&dev->lock);
 
diff --git a/test/am_ca_key_test/inject_record_t5d/am_userdata/aml/aml.c b/test/am_ca_key_test/inject_record_t5d/am_userdata/aml/aml.c
index afc9567..9b1e996 100644
--- a/test/am_ca_key_test/inject_record_t5d/am_userdata/aml/aml.c
+++ b/test/am_ca_key_test/inject_record_t5d/am_userdata/aml/aml.c
@@ -49,7 +49,7 @@
 #define AMSTREAM_IOC_UD_POC _IOR(AMSTREAM_IOC_MAGIC, 0x55, int)
 #define AMSTREAM_IOC_UD_FLUSH_USERDATA _IOR(AMSTREAM_IOC_MAGIC, 0x56, int)
 #define AMSTREAM_IOC_UD_BUF_READ _IOR(AMSTREAM_IOC_MAGIC, 0x57, int)
-#define AMSTREAM_IOC_UD_AVAIBLE_VDEC      _IOR(AMSTREAM_IOC_MAGIC, 0x5c, unsigned int)
+#define AMSTREAM_IOC_UD_AVAILABLE_VDEC      _IOR(AMSTREAM_IOC_MAGIC, 0x5c, unsigned int)
 
 /****************************************************************************
  * Type definitions
@@ -82,7 +82,7 @@
 
 struct userdata_meta_info_t {
 	uint32_t poc_number;
-	/************ flags bit defination ***********
+	/************ flags bit definition ***********
 	bit 0:		//used for mpeg2
 		1, group start
 		0, not group start
@@ -125,7 +125,7 @@
 	uint32_t flags;
 	uint32_t vpts;			/*video frame pts*/
 	/******************************************
-	0: pts is invalid, please use duration to calcuate
+	0: pts is invalid, please use duration to calculate
 	1: pts is valid
 	******************************************/
 	uint32_t vpts_valid;
@@ -887,11 +887,11 @@
 		//For multi-instances support
 		vdec_ids = 0;
 
-		if (-1 == ioctl(fd, AMSTREAM_IOC_UD_AVAIBLE_VDEC, &vdec_ids)) {
-			AM_DEBUG(AM_DEBUG_LEVEL, "get avaible vdec failed");
+		if (-1 == ioctl(fd, AMSTREAM_IOC_UD_AVAILABLE_VDEC, &vdec_ids)) {
+			AM_DEBUG(AM_DEBUG_LEVEL, "get AVAILABLE vdec failed");
 			continue;
 		} else {
-			AM_DEBUG(AM_DEBUG_LEVEL, "get avaible vdec OK: 0x%x\n", vdec_ids);
+			AM_DEBUG(AM_DEBUG_LEVEL, "get AVAILABLE vdec OK: 0x%x\n", vdec_ids);
 		}
 
 		read_vdec_id = ffs(vdec_ids) - 1;
diff --git a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_aout.h b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_aout.h
index 8e41d0f..46c5983 100644
--- a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_aout.h
+++ b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_aout.h
@@ -40,7 +40,7 @@
 {
 	AM_AOUT_ERROR_BASE=AM_ERROR_BASE(AM_MOD_AOUT),
 	AM_AOUT_ERR_INVALID_DEV_NO,          /**< Invalid audio output device number */
-	AM_AOUT_ERR_BUSY,                    /**< The device has already been openned */
+	AM_AOUT_ERR_BUSY,                    /**< The device has already been opened */
 	AM_AOUT_ERR_ILLEGAL_OP,              /**< Illegal operation */
 	AM_AOUT_ERR_INVAL_ARG,               /**< Invalid argument */
 	AM_AOUT_ERR_NOT_ALLOCATED,           /**< The device has not been allocated */
diff --git a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_aout_internal.h b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_aout_internal.h
index 831f73c..2f6f3c3 100644
--- a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_aout_internal.h
+++ b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_aout_internal.h
@@ -55,7 +55,7 @@
 	pthread_mutex_t         lock;      /**< 设备数据保护互斥体*/
 	int                     volume;    /**< 当前音量*/
 	AM_Bool_t               mute;      /**< 当前静音状态*/
-	AM_Bool_t               openned;   /**< 设备是否打开*/
+	AM_Bool_t               opened;   /**< 设备是否打开*/
 	AM_AOUT_OutputMode_t    mode;      /**< 当前输出模式*/
 	AM_AOUT_OpenPara_t      open_para; /**< 开启参数*/
 	float                   pre_gain;  /**< 当前预增益*/
diff --git a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_av.h b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_av.h
index 0aba7bd..408a92b 100644
--- a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_av.h
+++ b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_av.h
@@ -67,7 +67,7 @@
 {
 	AM_AV_ERROR_BASE=AM_ERROR_BASE(AM_MOD_AV),
 	AM_AV_ERR_INVALID_DEV_NO,          /**< Invalid decoder device number*/
-	AM_AV_ERR_BUSY,                    /**< The device has already been openned*/
+	AM_AV_ERR_BUSY,                    /**< The device has already been opened*/
 	AM_AV_ERR_ILLEGAL_OP,              /**< Illegal operation*/
 	AM_AV_ERR_INVAL_ARG,               /**< Invalid argument*/
 	AM_AV_ERR_NOT_ALLOCATED,           /**< The device has not been allocated*/
@@ -131,8 +131,8 @@
 {
 	AM_AV_MP_STATE_UNKNOWN = 0,        /**< Unknown*/
 	AM_AV_MP_STATE_INITING,            /**< Initializing*/
-	AM_AV_MP_STATE_NORMALERROR,        /**< Error occured*/
-	AM_AV_MP_STATE_FATALERROR,         /**< Fatal error occured*/
+	AM_AV_MP_STATE_NORMALERROR,        /**< Error occurred*/
+	AM_AV_MP_STATE_FATALERROR,         /**< Fatal error occurred*/
 	AM_AV_MP_STATE_PARSERED,           /**< The file's header has been parsed*/
 	AM_AV_MP_STATE_STARTED,            /**< Start playing*/
 	AM_AV_MP_STATE_PLAYING,            /**< Playing*/
@@ -251,7 +251,7 @@
 /**\brief Video aspect ratio match mode*/
 typedef enum
 {
-	AM_AV_VIDEO_ASPECT_MATCH_IGNORE,     /**< Ignoring orignal aspect ratio*/
+	AM_AV_VIDEO_ASPECT_MATCH_IGNORE,     /**< Ignoring original aspect ratio*/
 	AM_AV_VIDEO_ASPECT_MATCH_LETTER_BOX, /**< Letter box match mode*/
 	AM_AV_VIDEO_ASPECT_MATCH_PAN_SCAN,   /**< Pan scan match mode*/
 	AM_AV_VIDEO_ASPECT_MATCH_COMBINED    /**< Combined letter box/pan scan match mode*/
@@ -347,16 +347,16 @@
 typedef enum
 {
 	AM_AV_JPEG_OPT_THUMBNAIL_ONLY     = 1, /**< Decode in thumbnail only mode*/
-	AM_AV_JPEG_OPT_THUMBNAIL_PREFERED = 2, /**< Decode in thumbnail prefered mode*/
+	AM_AV_JPEG_OPT_THUMBNAIL_PREFERRED = 2, /**< Decode in thumbnail PREFERRED mode*/
 	AM_AV_JPEG_OPT_FULLRANGE          = 4  /**< Normal*/
 } AM_AV_JPEGOption_t;
 
 /**\brief Image surface parameters (used in JPEG decoder)*/
 typedef struct
 {
-	int    width;                 /**< Image width, <=0 means use orignal size*/
-	int    height;                /**< Image height, <=0 means use orignal size*/
-	AM_AV_JPEGAngle_t  angle;     /**< JPEG image ratation parameter*/
+	int    width;                 /**< Image width, <=0 means use original size*/
+	int    height;                /**< Image height, <=0 means use original size*/
+	AM_AV_JPEGAngle_t  angle;     /**< JPEG image rotation parameter*/
 	AM_AV_JPEGOption_t option;    /**< JPEG decoder options*/
 } AM_AV_SurfacePara_t;
 
@@ -446,7 +446,7 @@
 	{
 		int pid; /**< Audio PID*/
 		int fmt; /**< Audio format*/
-		char lang[4]; /**< Lanuguage descripton*/
+		char lang[4]; /**< Language description*/
 	}audios[8]; /**< Audio information array*/
 
 	int sub_cnt; /**< Subtitle number*/
@@ -761,7 +761,7 @@
  */
 extern AM_ErrorCode_t AM_AV_StopAudioES(int dev_no);
 
-/**\brief Enable/diable decoder's DRM mode
+/**\brief Enable/disable decoder's DRM mode
  * \param dev_no AV decoder device number
  * \param[in] enable enable or disable DRM mode
  * \retval AM_SUCCESS On success
diff --git a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_ci.h b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_ci.h
deleted file mode 100644
index b58c6a2..0000000
--- a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_ci.h
+++ /dev/null
@@ -1,329 +0,0 @@
-/***************************************************************************
- * Copyright (C) 2017 Amlogic, Inc. All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * Description:
- */
-/**\file
- * \brief am ci module
- *
- *
- * \author Gong Ke <ke.gong@amlogic.com>
- * \date 2010-08-06: create the document
- ***************************************************************************/
-
-#ifndef _AM_CI_H_
-#define _AM_CI_H_
-
-#include "am_caman.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-/**\brief Error code of the ci module*/
-enum AM_CI_ErrorCode
-{
-	AM_CI_ERROR_BASE=AM_ERROR_BASE(AM_MOD_CI),
-	AM_CI_ERROR_INVALID_DEV_NO, 							/**< Invalid device number*/
-	AM_CI_ERROR_BAD_PARAM,										/**< Invalid parameter*/
-	AM_CI_ERROR_NOT_OPEN,											/**< The device is not yet open */
-	AM_CI_ERROR_NOT_START,										/**< The device is already start*/
-	AM_CI_ERROR_ALREADY_OPEN,									/**< The device is not yet open*/
-	AM_CI_ERROR_ALREADY_START,								/**< The device is already start*/
-	AM_CI_ERROR_CANNOT_CREATE_THREAD,					/**< Cannot creat thread*/
-	AM_CI_ERROR_USED_BY_CAMAN,								/**< CAMAN error */
-	AM_CI_ERROR_PROTOCOL,											/**< Protocol error*/
-	AM_CI_ERROR_BAD_PMT,											/**< PMT is bad error*/
-	AM_CI_ERROR_MAX_DEV,											/**< already open max device,need close other device*/
-	AM_CI_ERROR_BAD_CAM,											/**< Cam card is bad*/
-	AM_CI_ERROR_UNAVAILABLE,									/**< ci unavailable error*/
-	AM_CI_ERROR_UNKOWN,												/**< Unkown error*/
-};
-/**\brief callback id of the ci module*/
-enum AM_CI_CBID
-{
-	CBID_AI_CALLBACK,											/**< ai callback ID*/
-	CBID_CA_INFO_CALLBACK ,								/**< ca info callback ID*/
-	CBID_MMI_CLOSE_CALLBACK ,							/**< mmi close callback ID*/
-	CBID_MMI_DISPLAY_CONTROL_CALLBACK ,		/**< mmi display control callback ID*/
-	CBID_MMI_ENQ_CALLBACK ,								/**< mmi enquiry callback ID*/
-	CBID_MMI_MENU_CALLBACK ,							/**< mmi menu callback ID*/
-	CBID_MMI_LIST_CALLBACK ,							/**< mmi list callback ID*/
-};
-/**\brief mmi answer id */
-enum AM_CI_MMI_ANSWER_ID
-{
-	AM_CI_MMI_ANSW_CANCEL = 0x00,	/**< mmi cancel*/
-	AM_CI_MMI_ANSW_ANSWER = 0x01, /**< mmi answer*/
-};
-/**\brief close mmi cmd id */
-enum AM_CI_MMI_CLOSE_MMI_CMD_ID
-{
-	AM_CI_MMI_CLOSE_MMI_CMD_ID_IMMEDIATE = 0x00, /**< send mmi close cmd immediately*/
-	AM_CI_MMI_CLOSE_MMI_CMD_ID_DELAY = 0x01,		 /**< send mmi close cmd delay*/
-};
-/**\brief ca pmt list management */
-enum AM_CI_CA_LIST_MANAGEMENT
-{
-	AM_CI_CA_LIST_MANAGEMENT_MORE =    0x00,	/**< has more pmt*/
-	AM_CI_CA_LIST_MANAGEMENT_FIRST =   0x01,	/**< the first one pmt*/
-	AM_CI_CA_LIST_MANAGEMENT_LAST =    0x02,	/**< the last one pmt*/
-	AM_CI_CA_LIST_MANAGEMENT_ONLY =    0x03,	/**< only for single ca pmt*/
-	AM_CI_CA_LIST_MANAGEMENT_ADD =     0x04,	/**< add for already existing programme */
-	AM_CI_CA_LIST_MANAGEMENT_UPDATE =  0x05,	/**< update means that ca pmt already existing,is sent again*/
-};
-/**\brief ca pmt cmd id */
-enum AM_CI_CA_PMT_CMD_ID
-{
-	AM_CI_CA_PMT_CMD_ID_OK_DESCRAMBLING =  0x01,	/**< application can start descrambling*/
-	AM_CI_CA_PMT_CMD_ID_OK_MMI =           0x02,	/**< application can send mmi dialogue but shall not satrt descrambling*/
-	AM_CI_CA_PMT_CMD_ID_QUERY =            0x03,	/**< host expect to receive ca pmt reply,the application is not allowen to start des and mmi dialogue*/
-	AM_CI_CA_PMT_CMD_ID_NOT_SELECTED =     0x04,	/**< host no longer requires that ca applition to descramble the service*/
-};
-/**\brief CI handle type*/
-typedef void* AM_CI_Handle_t;
-/**\brief CI open  parameter*/
-typedef struct
-{
-	int foo;
-} AM_CI_OpenPara_t;
-/**\brief ci mmi text info struct*/
-typedef struct  {
-	uint8_t *text;			/**< mmi text content*/
-	uint32_t text_size;	/**< mmi text content length*/
-} app_mmi_text_t;
-/**\brief ci application info callback
- * \param[in] arg callback used private data
- * \param[in] slot_id ci slot id
- * \param[in] session_number	ci session number
- * \param[in] application_type	application type
- * \param[in] application_manufacturer application manufacturer
- * \param[in] menu_string_length	menu string length
- * \param[in] menu_string menu string
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-typedef int (*ai_callback)(void *arg, uint8_t slot_id, uint16_t session_number,
-			     uint8_t application_type, uint16_t application_manufacturer,
-			     uint16_t manufacturer_code, uint8_t menu_string_length,
-			     uint8_t *menu_string);
-/**\brief ci info callback
- * \param[in] arg callback used private data
- * \param[in] slot_id ci slot id
- * \param[in] session_number	ci session number
- * \param[in] ca_id_count	ca id count number
- * \param[in] ca_ids ca id array
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-typedef int (*ca_info_callback)(void *arg, uint8_t slot_id, uint16_t session_number, uint32_t ca_id_count, uint16_t *ca_ids);
-/**\brief mmi close callback
- * \param[in] arg callback used private data
- * \param[in] slot_id ci slot id
- * \param[in] session_number	ci session number
- * \param[in] cmd_id	see AM_CI_MMI_CLOSE_MMI_CMD_ID
- * \param[in] delay delay time
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-typedef int (*mmi_close_callback)(void *arg, uint8_t slot_id, uint16_t session_number, uint8_t cmd_id, uint8_t delay);
-/**\brief mmi display control callback
- * \param[in] arg callback used private data
- * \param[in] slot_id ci slot id
- * \param[in] session_number	ci session number
- * \param[in] cmd_id	see MMI_DISPLAY_CONTROL_CMD_ID* in en50221_app_mmi.h
- * \param[in] mmi_mode see MMI_MODE_* in en50221_app_mmi.h
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-typedef int (*mmi_display_control_callback)(void *arg, uint8_t slot_id, uint16_t session_number,
-					      uint8_t cmd_id, uint8_t mmi_mode);
-/**\brief mmi enq callback
- * \param[in] arg callback used private data
- * \param[in] slot_id ci slot id
- * \param[in] session_number	ci session number
- * \param[in] blind_answer	set to 1 menus that user input has not to be displayed
- * \param[in] expected_answer_length expected length,if set to FF if unkown
- * \param[in] text	input text string
- * \param[in] text_size input text length
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-typedef int (*mmi_enq_callback)(void *arg, uint8_t slot_id, uint16_t session_number,
-				  uint8_t blind_answer, uint8_t expected_answer_length,
-				  uint8_t *text, uint32_t text_size);
-/**\brief mmi menu callback
- * \param[in] arg callback used private data
- * \param[in] slot_id ci slot id
- * \param[in] session_number	ci session number
- * \param[in] title	menu title string
- * \param[in] sub_title menu subtitle string
- * \param[in] bottom	menu bottom string
- * \param[in] item_count menu list item count
- * \param[in] items menu items string
- * \param[in] item_raw_length menu item raw string length
- * \param[in] items_raw menu item raw string
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-typedef int (*mmi_menu_callback)(void *arg, uint8_t slot_id, uint16_t session_number,
-				   app_mmi_text_t *title,
-				   app_mmi_text_t *sub_title,
-				   app_mmi_text_t *bottom,
-				   uint32_t item_count, app_mmi_text_t *items,
-				   uint32_t item_raw_length, uint8_t *items_raw);
-
-/**\brief ca callback struct */
-typedef struct {
-	union{
-		ai_callback ai_cb;																		/**< ai callback*/
-		ca_info_callback ca_info_cb;													/**< ca info callback*/
-		mmi_close_callback mmi_close_cb;											/**< mmi close callback*/
-		mmi_display_control_callback mmi_display_control_cb;	/**< mmi display callback*/
-		mmi_enq_callback mmi_enq_cb;													/**< mmi enq callback*/
-		mmi_menu_callback mmi_menu_cb;												/**< mmi menu callback*/
-		mmi_menu_callback mmi_list_cb;												/**< mmi list callback*/
-	}u;
-}AM_CI_CB_t;
-/**\brief Open ci device
- * \param [in] dev_no ci device number
- * \param [in] slot_no Serviceid
- * \param [in] para ci open parameter
- * \param [out] handle ci open handle
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_CI_Open(int dev_no, int slot_no, const AM_CI_OpenPara_t *para, AM_CI_Handle_t *handle);
-/**\brief Close ci device
- * \param [in] handle ci opened handle
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_CI_Close(AM_CI_Handle_t handle);
-/**\brief start ci
- * \param [in] handle ci opened handle
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_CI_Start(AM_CI_Handle_t handle);
-/**\brief stop ci
- * \param [in] handle ci opened handle
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_CI_Stop(AM_CI_Handle_t handle);
-
-/*set callbacks before start() or you may miss callbacks*/
-/**\brief set ci callback
- * \param [in] handle ci opened handle
- * \param [in] cbid callback id,see AM_CI_CBID enum
- * \param [in] cb ci callback function
- * \param [in] arg ci callback private data
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_CI_SetCallback(AM_CI_Handle_t handle, int cbid, AM_CI_CB_t *cb, void *arg);
-
-/**\brief seen pmt to cam card
- * \param [in] handle ci opened handle
- * \param [in] capmt pmt data buffer
- * \param [in] size pmt buffer length
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_CI_App_ca_pmt(AM_CI_Handle_t handle, unsigned char *capmt, unsigned int size);
-/**\brief ci enter menu
- * \param [in] handle ci opened handle
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_CI_App_ai_entermenu(AM_CI_Handle_t handle);
-/*answer_id see:AM_CI_MMI_ANSWER_ID*/
-
-/**\brief ci mmi answer
- * \param [in] handle ci opened handle
- * \param [in] answer_id ci answer id
- * \param [in] answer ci answer string
- * \param [in] size ci answer size
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_CI_App_mmi_answ(AM_CI_Handle_t handle, int answer_id, char *answer, int size);
-/**\brief ci mmi slect menu
- * \param [in] handle ci opened handle
- * \param [in] select ci selected menu item index
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_CI_App_mmi_menu_answ(AM_CI_Handle_t handle, int select);
-/**\brief ci mmi close
- * \param [in] handle ci opened handle
- * \param [in] cmd_id mmi close cmd id,see AM_CI_MMI_CLOSE_MMI_CMD_ID
- * \param [in] delay delay time
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_CI_App_mmi_close(AM_CI_Handle_t handle, int cmd_id, int delay);
-
-/*infomations enquired will be repled in the callback*/
-
-/**\brief ci enquie ca info
- * \param [in] handle ci opened handle
- * \return Error code
- */
-extern AM_ErrorCode_t AM_CI_App_ca_info_enq(AM_CI_Handle_t handle);
-/**\brief ci enquie ai
- * \param [in] handle ci opened handle
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_CI_App_ai_enquiry(AM_CI_Handle_t handle);
-
-/*user need to free the generated capmt with free() in the end */
-/**\brief ci generate ca pmt
- * \param [in] pmt CA modue recivered pmt
- * \param [in] pmt_size pmt length
- * \param [out] capmt generated ca pmt
- * \param [out] capmt_size capmt length
- * \param [in] ca_list_management see AM_CI_CA_LIST_MANAGEMENT
- * \param [in] ca_pmt_cmd_id see AM_CI_CA_PMT_CMD_ID
- * \param [in] moveca Whether to delete ca descriptors
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_CI_GenerateCAPMT(unsigned char *pmt, unsigned int pmt_size,
-											unsigned char **capmt, unsigned int *capmt_size,
-											int ca_list_management, int ca_pmt_cmd_id,
-											int moveca);
-/**\brief ci match ca by caid
- * \param [in] handle ci opened handle
- * \param [in] caid CA id
- * \param [out] match 1:match 0: unmatch.
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_CI_MatchCAID(AM_CI_Handle_t handle, unsigned int caid, int *match);
-/**\brief ci get ca by handle
- * \param [in] handle ci opened handle
- * \param [out] ca AM_CA_t pointer of pointer
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_CI_CAMAN_getCA(AM_CI_Handle_t handle, AM_CA_t **ca);
-
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif/*_AM_CI_H_*/
diff --git a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_dmx.h b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_dmx.h
index 7deee60..b7559bf 100644
--- a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_dmx.h
+++ b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_dmx.h
@@ -16,7 +16,7 @@
 /**\file
  * \brief Demux module
  *
- * Basic data strucutres definition in "linux/dvb/dmx.h"
+ * Basic data structures definition in "linux/dvb/dmx.h"
  *
  * \author Gong Ke <ke.gong@amlogic.com>
  * \date 2010-05-21: create the document
@@ -49,7 +49,7 @@
 	AM_DMX_ERROR_BASE=AM_ERROR_BASE(AM_MOD_DMX),
 	AM_DMX_ERR_INVALID_DEV_NO,          /**< Invalid device number*/
 	AM_DMX_ERR_INVALID_ID,              /**< Invalid filer handle*/
-	AM_DMX_ERR_BUSY,                    /**< The device has already been openned*/
+	AM_DMX_ERR_BUSY,                    /**< The device has already been opened*/
 	AM_DMX_ERR_NOT_ALLOCATED,           /**< The device has not been allocated*/
 	AM_DMX_ERR_CANNOT_CREATE_THREAD,    /**< Cannot create new thread*/
 	AM_DMX_ERR_CANNOT_OPEN_DEV,         /**< Cannot open device*/
diff --git a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_dsc.h b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_dsc.h
index a7b8a6c..55e3c9f 100644
--- a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_dsc.h
+++ b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_dsc.h
@@ -61,7 +61,7 @@
 	int  foo;
 } AM_DSC_OpenPara_t;
 
-/**\brief Work enviorment, tee/kernel */
+/**\brief Work environment, tee/kernel */
 typedef enum _work_mode_e{
 	DSC_MODE_NORMAL,
 	DSC_MODE_SEC,
@@ -74,7 +74,7 @@
 	DSC_KEY_EVEN
 }AM_DSC_KeyParity_e;
 
-/**\brief Video encrypt algoritm */
+/**\brief Video encrypt algorithm */
 typedef enum {
 	CW_ALGO_AES = 0,
 	CW_ALGO_DVBCSA = 1,
diff --git a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_dvr.h b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_dvr.h
index cf5a3f3..0c0bcb0 100644
--- a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_dvr.h
+++ b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_dvr.h
@@ -44,7 +44,7 @@
 	AM_DVR_ERROR_BASE=AM_ERROR_BASE(AM_MOD_DVR),
 	AM_DVR_ERR_INVALID_ARG,			/**< Invalid argument*/
 	AM_DVR_ERR_INVALID_DEV_NO,		/**< Invalid decide number*/
-	AM_DVR_ERR_BUSY,                        /**< The device has already been openned*/
+	AM_DVR_ERR_BUSY,                        /**< The device has already been opened*/
 	AM_DVR_ERR_NOT_ALLOCATED,           /**< The device has not been allocated*/
 	AM_DVR_ERR_CANNOT_CREATE_THREAD,    /**< Cannot create a new thread*/
 	AM_DVR_ERR_CANNOT_OPEN_DEV,         /**< Cannot open the device*/
@@ -88,14 +88,14 @@
 /**\brief Open a DVR device
  * \param dev_no DVR device number
  * \param[in] para DVR device open parameters
- * \retval AM_SUCCESS On succes
+ * \retval AM_SUCCESS On success
  * \return Error code
  */
 extern AM_ErrorCode_t AM_DVR_Open(int dev_no, const AM_DVR_OpenPara_t *para);
 
 /**\brief Close an unused DVR device
  * \param dev_no DVR device number
- * \retval AM_SUCCESS On succes
+ * \retval AM_SUCCESS On success
  * \return Error code
  */
 extern AM_ErrorCode_t AM_DVR_Close(int dev_no);
@@ -103,7 +103,7 @@
 /**\brief Set the DVR device's ring queue buffer size.
  * \param dev_no DVR device number
  * \param size Ring queue buffer size
- * \retval AM_SUCCESS On succes
+ * \retval AM_SUCCESS On success
  * \return Error code
  */
 extern AM_ErrorCode_t AM_DVR_SetBufferSize(int dev_no, int size);
@@ -111,14 +111,14 @@
 /**\brief Start recording
  * \param dev_no DVR device number
  * \param [in] para Recording parameters
- * \retval AM_SUCCESS On succes
+ * \retval AM_SUCCESS On success
  * \return Error code
  */
 extern AM_ErrorCode_t AM_DVR_StartRecord(int dev_no, const AM_DVR_StartRecPara_t *para);
 
 /**\brief Stop recording
  * \param dev_no DVR device number
- * \retval AM_SUCCESS On succes
+ * \retval AM_SUCCESS On success
  * \return Error code
  */
 extern AM_ErrorCode_t AM_DVR_StopRecord(int dev_no);
@@ -126,7 +126,7 @@
 /**\brief Set the DVR input source
  * \param dev_no DVR device number
  * \param	src DVR input source
- * \retval AM_SUCCESS On succes
+ * \retval AM_SUCCESS On success
  * \return Error code
  */
 extern AM_ErrorCode_t AM_DVR_SetSource(int dev_no, AM_DVR_Source_t src);
diff --git a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_evt.h b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_evt.h
index 4cf42c4..3ad59bd 100644
--- a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_evt.h
+++ b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_evt.h
@@ -81,7 +81,7 @@
  */
 extern AM_ErrorCode_t AM_EVT_Unsubscribe(long dev_no, int event_type, AM_EVT_Callback_t cb, void *data);
 
-/**\brief Signal an event occured
+/**\brief Signal an event occurred
  * \param dev_no The device number generate the event
  * \param event_type Event type
  * \param[in] param Parameter of the event
@@ -89,7 +89,7 @@
 extern AM_ErrorCode_t AM_EVT_Signal(long dev_no, int event_type, void *param);
 
 extern AM_ErrorCode_t AM_EVT_Init();
-extern AM_ErrorCode_t AM_EVT_Destory();
+extern AM_ErrorCode_t AM_EVT_Destroy();
 
 #ifdef __cplusplus
 }
diff --git a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_fend.h b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_fend.h
deleted file mode 100644
index 14f5653..0000000
--- a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_fend.h
+++ /dev/null
@@ -1,472 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2014 Amlogic, Inc. All rights reserved.
- *
- * This source code is subject to the terms and conditions defined in the
- * file 'LICENSE' which is part of this source code package.
- *
- * Description:
- */
-/**\file
- * \brief DVB Frontend Module
- *
- * Basic data structures definition in "linux/dvb/frontend.h"
- *
- * \author Gong Ke <ke.gong@amlogic.com>
- * \date 2010-06-07: create the document
- ***************************************************************************/
-
-#ifndef _AM_FEND_H
-#define _AM_FEND_H
-
-#include "am_types.h"
-#include "am_evt.h"
-#include "am_dmx.h"
-/*add for config define for linux dvb *.h*/
-#include "am_config.h"
-#include <linux/dvb/frontend.h>
-
-// #ifdef FE_SET_FRONTEND
-// #undef FE_SET_FRONTEND
-// #define FE_SET_FRONTEND FE_SET_FRONTEND_EX
-// #endif
-
-// #ifdef FE_GET_FRONTEND
-// #undef FE_GET_FRONTEND
-// #define FE_GET_FRONTEND FE_GET_FRONTEND_EX
-// #endif
-
-//#define dvb_frontend_parameters dvb_frontend_parameters_ex
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/****************************************************************************
- * Macro definitions
- ***************************************************************************/
-
-/****************************************************************************
- * Error code definitions
- ****************************************************************************/
-
-/**\brief Error code of the fend module*/
-enum AM_FEND_ErrorCode
-{
-	AM_FEND_ERROR_BASE=AM_ERROR_BASE(AM_MOD_FEND),
-	AM_FEND_ERR_NO_MEM,                   /**< Not enough memory*/
-	AM_FEND_ERR_BUSY,                     /**< The device has already been openned*/
-	AM_FEND_ERR_INVALID_DEV_NO,           /**< Invalid device numbe*/
-	AM_FEND_ERR_NOT_OPENNED,              /**< The device not open*/
-	AM_FEND_ERR_CANNOT_CREATE_THREAD,     /**< Cannot create new thread*/
-	AM_FEND_ERR_NOT_SUPPORTED,            /**< Not supported*/
-	AM_FEND_ERR_CANNOT_OPEN,              /**< Cannot open device*/
-	AM_FEND_ERR_TIMEOUT,                  /**< Timeout*/
-	AM_FEND_ERR_INVOKE_IN_CB,             /**< Invoke in callback function*/
-	AM_FEND_ERR_IO,                       /**< IO error*/
-	AM_FEND_ERR_BLINDSCAN, 				  /**< Blindscan error*/
-	AM_FEND_ERR_BLINDSCAN_INRUNNING, 	  /**< In Blindscan*/
-	AM_FEND_ERR_END
-};
-
-/****************************************************************************
- * Event type definitions
- ****************************************************************************/
-
-/**\brief DVB frontend event type*/
-enum AM_FEND_EventType
-{
-	AM_FEND_EVT_BASE=AM_EVT_TYPE_BASE(AM_MOD_FEND),
-	AM_FEND_EVT_STATUS_CHANGED,    /**< Frontend status changed, argument's type: struct dvb_frontend_event*/
-	AM_FEND_EVT_ROTOR_MOVING,    /**< Rotor moving*/
-	AM_FEND_EVT_ROTOR_STOP,    /**< Rotor stop*/
-	AM_FEND_EVT_SHORT_CIRCUIT, /**< Frontend circuit*/
-	AM_FEND_EVT_SHORT_CIRCUIT_REPAIR, /**< Frontend circuit repair*/
-	AM_VLFEND_EVT_STATUS_CHANGED,
-	AM_FEND_EVT_END
-};
-
-/****************************************************************************
- * Type definitions
- ***************************************************************************/
-
-/**\brief frontend open parameter*/
-typedef struct
-{
-	int mode;
-	#define FE_AUTO (-1)    /**< Do not care the mode*/
-	#define FE_UNKNOWN (-2) /**< Set mode to unknown, something like reset*/
-} AM_FEND_OpenPara_t;
-
-/**\brief frontend callback function*/
-typedef void (*AM_FEND_Callback_t) (int dev_no, struct dvb_frontend_event *evt, void *user_data);
-
-/**\brief Frontend blindscan status*/
-typedef enum
-{
-	AM_FEND_BLIND_START,			/**< Blindscan start*/
-	AM_FEND_BLIND_UPDATEPROCESS,	/**< Blindscan update process*/
-	AM_FEND_BLIND_UPDATETP			/**< Blindscan update transport program*/
-} AM_FEND_BlindStatus_t;
-
-/**\brief Blindscan event*/
-typedef struct
-{
-	AM_FEND_BlindStatus_t    status; /**< Blindscan status*/
-	union
-	{
-		unsigned int freq;
-		unsigned int process;
-	};
-} AM_FEND_BlindEvent_t;
-
-/**\brief Blindscan callback function*/
-typedef void (*AM_FEND_BlindCallback_t) (int dev_no, AM_FEND_BlindEvent_t *evt, void *user_data);
-
-
-/****************************************************************************
- * Function prototypes  
- ***************************************************************************/
-
-/**\brief open a frontend device
- * \param dev_no frontend device number
- * \param[in] para frontend's device open parameters
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Open(int dev_no, const AM_FEND_OpenPara_t *para);
-
-/**\brief close a frontend device
- * \param dev_no frontend device number
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_OpenEx(int dev_no, const AM_FEND_OpenPara_t *para, int *fe_fd);
-extern AM_ErrorCode_t AM_FEND_Close(int dev_no);
-extern AM_ErrorCode_t AM_FEND_CloseEx(int dev_no, AM_Bool_t reset);
-
-
-/**\brief set frontend deivce mode
- * \param dev_no frontend device number
- * \param mode frontend demod mode
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_SetMode(int dev_no, int mode);
-
-/**\brief get frontend device infomation
- * \param dev_no frontend device number
- * \param[out] info return frontend infomation struct
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_GetInfo(int dev_no, struct dvb_frontend_info *info);
-
-/**\brief get a frontend device's ts source
- * \param dev_no frontend device number
- * \param[out] src retrun device's ts source
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_GetTSSource(int dev_no, AM_DMX_Source_t *src);
-
-/**\brief set frontend parameter
- * \param dev_no frontend device number
- * \param[in] para frontend parameter
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_SetPara(int dev_no, const struct dvb_frontend_parameters *para);
-
-/**
- * \brief set frontend property
- * \param dev_no frontend device number
- * \param[in] prop frontend device property
- * \return
- *   - AM_SUCCESS onSuccess
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_SetProp(int dev_no, const struct dtv_properties *prop);
-
-/**\brief get frontend parameter
- * \param dev_no frontend device number
- * \param[out] para return frontend parameter
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_GetPara(int dev_no, struct dvb_frontend_parameters *para);
-
-/**
- * \brief get frontend property
- * \param dev_no frontend device number
- * \param[out] prop return frontend device property
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_GetProp(int dev_no, struct dtv_properties *prop);
-
-/**\brief get frontend lock status
- * \param dev_no frontend device number
- * \param[out] status return frontend lock status
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_GetStatus(int dev_no, fe_status_t *status);
-
-/**\brief get frontend device's SNR
- * \param dev_no frontend device number
- * \param[out] snr return SNR
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_GetSNR(int dev_no, int *snr);
-
-/**\brief get frontend device's BER
- * \param dev_no frontend device number
- * \param[out] ber return frontend's BER
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_GetBER(int dev_no, int *ber);
-
-/**\brief get frontend device's signal strength
- * \param dev_no frontend device number
- * \param[out] strength return signal strength
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_GetStrength(int dev_no, int *strength);
-
-/**\brief get frontend device's callback function
- * \param dev_no frontend device number
- * \param[out] cb return callback function
- * \param[out] user_data callback function's parameters
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_GetCallback(int dev_no, AM_FEND_Callback_t *cb, void **user_data);
-
-/**\brief register the frontend callback function
- * \param dev_no frontend device function
- * \param[in] cb callback function
- * \param[in] user_data callback function's parameter
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_SetCallback(int dev_no, AM_FEND_Callback_t cb, void *user_data);
-
-/**\brief enable or disable frontend callback
- * \param dev_no frontend device number
- * \param[in] enable_cb enable or disable
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_SetActionCallback(int dev_no, AM_Bool_t enable_cb);
-
-/**\brief try to lock frontend and wait lock status
- * \param dev_no device frontend number
- * \param[in] para frontend parameters
- * \param[out] status return frontend lock status
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Lock(int dev_no, const struct dvb_frontend_parameters *para, fe_status_t *status);
-
-/**\brief set frontend thread delay time
- * \param dev_no frontend device number
- * \param delay time value in millisecond,  0 means no time interval and frontend thread will stop
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_SetThreadDelay(int dev_no, int delay);
-
-/**\brief reset digital satellite equipment control
- * \param dev_no frontend device number
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_DiseqcResetOverload(int dev_no); 
-
-/**\brief send digital satellite command
- * \param dev_no frontend device number
- * \param[in] cmd control command
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_DiseqcSendMasterCmd(int dev_no, struct dvb_diseqc_master_cmd* cmd); 
-
-/**\brief recv digital satellite command's reply
- * \param dev_no frontend device number
- * \param[out] reply digital satellite's reply
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_DiseqcRecvSlaveReply(int dev_no, struct dvb_diseqc_slave_reply* reply); 
-
-/**\brief sent command to control tone burst
- * \param dev_no frontend device number
- * \param minicmd tone burst command
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_DiseqcSendBurst(int dev_no, fe_sec_mini_cmd_t minicmd); 
-
-/**\brief set tone mode
- * \param dev_no frontend device number
- * \param tone device tone mode
- * \return
- *   - AM_SUCCESS On Success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_SetTone(int dev_no, fe_sec_tone_mode_t tone); 
-
-/**\brief set device voltage
- * \param dev_no frontend device number
- * \param voltage device voltage
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_SetVoltage(int dev_no, fe_sec_voltage_t voltage); 
-
-/**\brief enable device High Lnb Voltage
- * \param dev_no frontend device number
- * \param arg 0 means disable, !=0 means enable
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_EnableHighLnbVoltage(int dev_no, long arg);                          
-                                                                           
-/**\brief start satellite blind scan
- * \param dev_no frontend device number
- * \param[in] cb blind scan callback function
- * \param[in] user_data callback function parameter
- * \param start_freq start frequency unit HZ
- * \param stop_freq stop frequency unit HZ
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_BlindScan(int dev_no, AM_FEND_BlindCallback_t cb, void *user_data, unsigned int start_freq, unsigned int stop_freq);
-
-/**\brief exit blind scan
- * \param dev_no frontend device number
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_BlindExit(int dev_no); 
-
-/**\brief get blind scan process
- * \param dev_no frontend device number
- * \param[out] process blind scan process 0-100
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_BlindGetProcess(int dev_no, unsigned int *process);
-
-/**\brief 卫星盲扫信息
- * \param dev_no 前端设备号
- * \param[in out] para in 盲扫频点信息缓存区大小,out 盲扫频点个数
- * \return
- *   - AM_SUCCESS 成功
- *   - 其他值 错误代码(见am_fend.h)
- */
-AM_ErrorCode_t AM_FEND_BlindGetTPCount(int dev_no, unsigned int *count);
-
-
-/**\brief get blind scan TP infomation
- * \param dev_no frontend device number
- * \param[out] para blindscan parameters
- * \param[out] count parameters's count
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_BlindGetTPInfo(int dev_no, struct dvb_frontend_parameters *para, unsigned int count);
-
-/**\brief try to tune
- *\param dev_no frontend device number
- *\param freq frequency unit Hz
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_FineTune(int dev_no, unsigned int freq);
-
-/**\brief set CVBS AMP OUT
- *\param dev_no frontend device number
- *\param amp AMP
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_SetCvbsAmpOut(int dev_no, unsigned int amp);
-
-/**\brief get atv status
- *\param dev_no frontend device number
- *\param[out] atv_status return atv status struct
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-AM_ErrorCode_t AM_FEND_GetAtvStatus(int dev_no,  atv_status_t *atv_status);
-
-/**\brief try to set AFC
- *\param dev_no frontend device number
- *\param afc AFC
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-AM_ErrorCode_t AM_FEND_SetAfc(int dev_no, unsigned int afc);
-
-
-/**\brief try to set sub sys
- *\param dev_no frontend device number
- *\param sub_sys fend type,T or T2,C-A C-B OR C-A
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-AM_ErrorCode_t AM_FEND_SetSubSystem(int dev_no, unsigned int sub_sys);
-
-
-/**\brief try to get sub sys
- *\param dev_no frontend device number
- *\param sub_sys fend type,use to indentify T or T2,C-A C-B OR C-C
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-AM_ErrorCode_t AM_FEND_GetSubSystem(int dev_no, unsigned int *sub_sys);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_fend_diseqc_cmd.h b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_fend_diseqc_cmd.h
deleted file mode 100644
index eca6a99..0000000
--- a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_fend_diseqc_cmd.h
+++ /dev/null
@@ -1,428 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2014 Amlogic, Inc. All rights reserved.
- *
- * This source code is subject to the terms and conditions defined in the
- * file 'LICENSE' which is part of this source code package.
- *
- * Description:
- */
-/**\file
- * \brief Diseqc protocol command
- *
- * \author jiang zhongming <zhongming.jiang@amlogic.com>
- * \date 2012-03-20: create the document
- ***************************************************************************/
-
-#ifndef _AM_FEND_DISEQC_CMD_H
-#define _AM_FEND_DISEQC_CMD_H
-
-#include "am_types.h"
-#include "am_evt.h"
-/*add for config define for linux dvb *.h*/
-#include <am_config.h>
-#include <linux/dvb/frontend.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/****************************************************************************
- * Macro definitions
- ***************************************************************************/
-
-/****************************************************************************
- * Error code definitions
- ****************************************************************************/
-
-/**\brief Diseqc error code*/
-enum AM_FEND_DISEQCCMD_ErrorCode
-{
-	AM_FEND_DISEQCCMD_ERROR_BASE=AM_ERROR_BASE(AM_MOD_FEND_DISEQCCMD),
-	AM_FEND_DISEQCCMD_ERR_END
-};
-
-/****************************************************************************
- * Event type definitions
- ****************************************************************************/
-
-
-/****************************************************************************
- * Type definitions
- ***************************************************************************/
-
-/**\brief DVB-S/S2 frontend switch input type*/
-typedef enum AM_FEND_SWITCHINPUT
-{
-	AM_FEND_SWITCH1INPUTA,
-	AM_FEND_SWITCH2INPUTA, 
-	AM_FEND_SWITCH3INPUTA,
-	AM_FEND_SWITCH4INPUTA,
-	AM_FEND_SWITCH1INPUTB,
-	AM_FEND_SWITCH2INPUTB,
-	AM_FEND_SWITCH3INPUTB,
-	AM_FEND_SWITCH4INPUTB	
-}AM_FEND_Switchinput_t; 
-
-/**\brief DVB-S/S2 frontend polraisation*/
-typedef enum AM_FEND_POLARISATION
-{
-	AM_FEND_POLARISATION_H,
-	AM_FEND_POLARISATION_V,
-	AM_FEND_POLARISATION_NOSET
-}AM_FEND_Polarisation_t; 
-
-/**\brief DVB-S/S2 frontend local oscillator frequency*/
-typedef enum AM_FEND_LOCALOSCILLATORFREQ
-{
-	AM_FEND_LOCALOSCILLATORFREQ_L,
-	AM_FEND_LOCALOSCILLATORFREQ_H,
-	AM_FEND_LOCALOSCILLATORFREQ_NOSET
-}AM_FEND_Localoscollatorfreq_t;
-
-/**\brief 22Khz parameter, match AM_SEC_22khz_Signal*/
-typedef enum {	AM_FEND_ON=0, AM_FEND_OFF=1 }AM_FEND_22khz_Signal; // 22 Khz
-
-/**\brief voltage parameter, match AM_SEC_Voltage_Mode*/
-typedef enum {	AM_FEND_13V=0, AM_FEND_18V=1 }AM_FEND_Voltage_Mode; // 13/18 V
-
-/**\brief DVB-S/S2 Frontend LOCAL OSCILLATOR FREQ TABLE*/
-typedef enum AM_FEND_LOT
-{
-	AM_FEND_LOT_STANDARD_NONE = 0x00,
-	AM_FEND_LOT_STANDARD_UNKNOWN,
-	AM_FEND_LOT_STANDARD_9750MHZ,
-	AM_FEND_LOT_STANDARD_10000MHZ,
-	AM_FEND_LOT_STANDARD_10600MHZ,
-	AM_FEND_LOT_STANDARD_10750MHZ,
-	AM_FEND_LOT_STANDARD_11000MHZ,
-	AM_FEND_LOT_STANDARD_11250MHZ,	
-	AM_FEND_LOT_STANDARD_11475MHZ,
-	AM_FEND_LOT_STANDARD_20250MHZ,
-	AM_FEND_LOT_STANDARD_5150MHZ,	
-	AM_FEND_LOT_STANDARD_1585MHZ,
-	AM_FEND_LOT_STANDARD_13850MHZ,
-	AM_FEND_LOT_WIDEBAND_NONE = 0x10,
-	AM_FEND_LOT_WIDEBAND_10000MHZ,
-	AM_FEND_LOT_WIDEBAND_10200MHZ,
-	AM_FEND_LOT_WIDEBAND_13250MHZ,
-	AM_FEND_LOT_WIDEBAND_13450MHZ
-}AM_FEND_LOT_t;
-                
-/**\brief DVB-S/S2 Frontend RF type*/
-typedef enum AM_FEND_RFType
-{
-	AM_FEND_RFTYPE_STANDARD,
-	AM_FEND_RFTYPE_WIDEBAND
-}AM_FEND_RFType_t;
-                
-
-/****************************************************************************
- * Function prototypes  
- ***************************************************************************/
-
-/**\brief reset Diseqc micro controller(Diseqc1.0 M*R)
- * \param dev_no frontend device number
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_ResetDiseqcMicro(int dev_no);
-
-/**\brief standby the switch Diseqc(Diseqc1.0 R)
- * \param dev_no frontend device number
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_StandbySwitch(int dev_no);
-
-/**\brief poweron the switch Diseqc(Diseqc1.0 R)
- * \param dev_no frontend device number
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_PoweronSwitch(int dev_no);
-
-/**\brief Set Low Local Oscillator Freq(Diseqc1.0 R)
- * \param dev_no frontend device number
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_SetLo(int dev_no);
-
-/**\brief set polarisation(Diseqc1.0 R)
- * \param dev_no forntend device number
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_SetVR(int dev_no); 
-
-/**\brief choose satellite A (Diseqc1.0 R)
- * \param dev_no frontend device number
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_SetSatellitePositionA(int dev_no); 
-
-/**\brief choose Switch Option A (Diseqc1.0 R)
- * \param dev_no frontend device number
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_SetSwitchOptionA(int dev_no);
-
-/**\brief set High Local Oscillator Frequency(Diseqc1.0 R)
- * \param dev_no frontend device number
- * \return
- *   - AM_SUCCESS On Success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_SetHi(int dev_no);
-
-/**\brief set horizontal polarisation(Diseqc1.0 R)
- * \param dev_no frontend device number
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_SetHL(int dev_no);
-
-/**\brief set satellite B (Diseqc1.0 R)
- * \param dev_no frontend device number
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_SetSatellitePositionB(int dev_no); 
-
-/**\brief set Switch Option B (Diseqc1.0 R)
- * \param dev_no frontend device number
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_SetSwitchOptionB(int dev_no); 
-
-/**\brief set Switch input (Diseqc1.1 R)
- * \param dev_no frontend device number
- * \param switch_input switch input parameter
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_SetSwitchInput(int dev_no, AM_FEND_Switchinput_t switch_input);
-
-/**\brief set LNB1-LNB4/polarisation/local oscillator (Diseqc1.0 M)
- * \param dev_no frontend device number
- * \param lnbport LNB1-LNB4/LNBPort:AA=0, AB=1, BA=2, BB=3, SENDNO=4
- * \param polarisation H/V
- * \param local_oscillator_freq H/L
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_SetLNBPort4(int dev_no, int lnbport, 
-			AM_FEND_Polarisation_t polarisation,
-			AM_FEND_Localoscollatorfreq_t local_oscillator_freq);
-                                                                 
-/**\brief set LNB Port LNB1-LNB16 (Diseqc1.1 M)
- * \param dev_no frontend device number
- * \param lnbport LNB1-LNB16,LNBPort In 0xF0 .. 0xFF
- * \param polarisation H/V
- * \param local_oscillator_freq H/L
- * \return
- *   - AM_SUCCESS On Success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_SetLNBPort16(int dev_no, int lnbport,
-			AM_FEND_Polarisation_t polarisation,
-			AM_FEND_Localoscollatorfreq_t local_oscillator_freq);
-                                                                  
-/**\brief set channel frequency (Diseqc1.1 M)
- * \param dev_no frontend device number
- * \param freq unit KHZ 
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_SetChannelFreq(int dev_no, int freq);
-
-/**\brief set ositioner halt (Diseqc1.2 M)
- * \param dev_no frontend device number
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_SetPositionerHalt(int dev_no);
-
-/**\brief enable positioner limit (Diseqc1.2 M)
- * \param dev_no frontend deivce number
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_EnablePositionerLimit(int dev_no);
-																  
-/**\brief disable positioner limit (Diseqc1.2 M)
- * \param dev_no frontend device number
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_DisablePositionerLimit(int dev_no);
-
-/**\brief enable positioner limit and store east limit (Diseqc1.2 M)
- * \param dev_no frontend device number
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_SetPositionerELimit(int dev_no);
-
-/**\brief enable positioner limit and store west limit(Diseqc1.2 M)
- * \param dev_no frontend device number
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_SetPositionerWLimit(int dev_no);
-
-/**\brief set positioner to go to east (Diseqc1.2 M)
- * \param dev_no frontend device number
- * \param unit 00 continuously 01-7F(unit second, e.g 01-one second 02-two second) 80-FF (unit step,e.g FF-one step FE-two step)
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_PositionerGoE(int dev_no, unsigned char unit);
-
-/**\brief set positioner to go to west (Diseqc1.2 M)
- * \param dev_no frontend device number
- * \param unit 00 continuously 01-7F(unit second, e.g 01-one second 02-two second) 80-FF (unit step,e.g FF-one step FE-two step)
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_PositionerGoW(int dev_no, unsigned char unit);
-
-/**\brief store position (Diseqc1.2 M)
- * \param dev_no frontend device number
- * \param position (e.g 1,2...)0 for reference.  actually it's not store ?
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_StorePosition(int dev_no, unsigned char position);
-
-/**\brief set positioner to last position (Diseqc1.2 M)
- * \param dev_no frontend device number
- * \param position (e.g 1,2...) 0 for reference
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_GotoPositioner(int dev_no, unsigned char position); 
-
-/**\brief position satellite with angular (longitude/latitude)
- * \param dev_no frontend device number
- * \param local_longitude
- * \param local_latitude
- * \param satellite_longitude
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_GotoxxAngularPositioner(int dev_no, double local_longitude, double local_latitude, double satellite_longitude);
-
-/**\brief position satellite with angular (USALS(another name Diseqc1.3) Diseqc extention)
- * \param dev_no frontend device number
- * \param local_longitude
- * \param local_latitude
- * \param satellite_longitude
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_GotoAngularPositioner(int dev_no, double local_longitude, double local_latitude, double satellite_longitude);
-                                                                       
-/**\brief set ODU channel (Diseqc extention)
- * \param dev_no frontend device number
- * \param ub_number user band number(0-7)
- * \param inputbank_number input bank number (0-7)
- * \param transponder_freq unit KHZ
- * \param oscillator_freq unit KHZ
- * \param ub_freq unit KHZ    
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_SetODUChannel(int dev_no, unsigned char ub_number, unsigned char inputbank_number,
-																int transponder_freq, int oscillator_freq, int ub_freq);
-       
-/**\brief set ODU UB to power off (Diseqc extention)
- * \param dev_no frontend device numner
- * \param ub_number user band number(0-7)  
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_SetODUPowerOff(int dev_no, unsigned char ub_number); 
-
-/**\brief set ODU UB to signal on (Diseqc extention)
- * \param dev_no frontend device number
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_SetODUUbxSignalOn(int dev_no);
-                                                                 
-/**\brief set ODU config(Diseqc extention)
- * \param dev_no frontend device number
- * \param ub_number user band number(0-7)
- * \param satellite_position_count
- * \param input_bank_count input bank count
- * \param rf_type frontend rf type
- * \param ub_count user band count
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_SetODUConfig(int dev_no, unsigned char ub_number, 
-																unsigned char satellite_position_count,
-																unsigned char input_bank_count,
-																AM_FEND_RFType_t rf_type,
-																unsigned char ub_count);
-                                                                  
-/**\brief se ODU local oscillator (Diseqc extention)
- * \param dev_no frontend device number
- * \param ub_number user band number(0-7)    
- * \param lot parameter in local oscillator table
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_FEND_Diseqccmd_SetODULoFreq(int dev_no, unsigned char ub_number, AM_FEND_LOT_t lot);                                                                  
-                                                                               
-
-/**\brief produce satellite angular (USALS(another name Diseqc1.3) Diseqc extention)
- * \param dev_no frontend device number
- * \param local_longitude
- * \param local_latitude
- * \param satellite_longitude
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern int AM_ProduceAngularPositioner(int dev_no, double local_longitude, double local_latitude, double satellite_longitude);
-																		
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_inp.h b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_inp.h
deleted file mode 100644
index 15a208b..0000000
--- a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_inp.h
+++ /dev/null
@@ -1,198 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2014 Amlogic, Inc. All rights reserved.
- *
- * This source code is subject to the terms and conditions defined in the
- * file 'LICENSE' which is part of this source code package.
- *
- * Description:
- */
-/**\file
- * \brief 输入设备模块
- *
- * \author Gong Ke <ke.gong@amlogic.com>
- * \date 2010-05-19: create the document
- ***************************************************************************/
-
-#ifndef _AM_INP_H
-#define _AM_INP_H
-
-#include "am_types.h"
-#include <linux/input.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/****************************************************************************
- * Macro definitions
- ***************************************************************************/
-
-/****************************************************************************
- * Error code definitions
- ****************************************************************************/
-
-/**\brief 输入模块错误代码*/
-enum AM_INP_ErrorCode
-{
-	AM_INP_ERROR_BASE=AM_ERROR_BASE(AM_MOD_INP),
-	AM_INP_ERR_INVALID_DEV_NO,           /**< 无效的设备号*/
-	AM_INP_ERR_BUSY,                     /**< 设备已经打开*/
-	AM_INP_ERR_NOT_OPENNED,              /**< 设备还没有打开*/
-	AM_INP_ERR_CANNOT_OPEN_DEV,          /**< 打开设备失败*/
-	AM_INP_ERR_CANNOT_CREATE_THREAD,     /**< 无法创建线程*/
-	AM_INP_ERR_TIMEOUT,                  /**< 等待输入事件超时*/
-	AM_INP_ERR_NOT_SUPPORTED,            /**< 设备不支持此功能*/
-	AM_INP_ERR_READ_FAILED,              /**< 读取设备文件出错*/
-	AM_INP_ERR_UNKNOWN_KEY,              /**< 无效按键*/
-	AM_INP_ERR_END
-};
-
-/****************************************************************************
- * Type definitions
- ***************************************************************************/
-
-/**\brief 输入设备开启参数*/
-typedef struct
-{
-	AM_Bool_t    enable_thread;          /**< 始能输入事件检测线程*/
-} AM_INP_OpenPara_t;
-
-/**\brief 按键名*/
-typedef enum
-{
-	AM_INP_KEY_UNKNOWN,
-	AM_INP_KEY_UP,                       /**< 上*/
-	AM_INP_KEY_DOWN,                     /**< 下*/
-	AM_INP_KEY_LEFT,                     /**< 左*/
-	AM_INP_KEY_RIGHT,                    /**< 右*/
-	AM_INP_KEY_PGUP,                     /**< 上翻页*/
-	AM_INP_KEY_PGDOWN,                   /**< 下翻页*/
-	AM_INP_KEY_0,                        /**< 数字0*/
-	AM_INP_KEY_1,                        /**< 数字1*/
-	AM_INP_KEY_2,                        /**< 数字2*/
-	AM_INP_KEY_3,                        /**< 数字3*/
-	AM_INP_KEY_4,                        /**< 数字4*/
-	AM_INP_KEY_5,                        /**< 数字5*/
-	AM_INP_KEY_6,                        /**< 数字6*/
-	AM_INP_KEY_7,                        /**< 数字7*/
-	AM_INP_KEY_8,                        /**< 数字8*/
-	AM_INP_KEY_9,                        /**< 数字9*/
-	AM_INP_KEY_MUTE,                     /**< 静音*/
-	AM_INP_KEY_VOLUP,                    /**< 音量+*/
-	AM_INP_KEY_VOLDOWN,                  /**< 音量-*/
-	AM_INP_KEY_CHUP,                     /**< 频道+*/
-	AM_INP_KEY_CHDOWN,                   /**< 频道-*/
-	AM_INP_KEY_OK,                       /**< 确定*/
-	AM_INP_KEY_CANCEL,                   /**< 取消*/
-	AM_INP_KEY_MENU,                     /**< 菜单*/
-	AM_INP_KEY_EXIT,                     /**< 退出*/
-	AM_INP_KEY_BACK,                     /**< 返回*/
-	AM_INP_KEY_PLAY,                     /**< 播放*/
-	AM_INP_KEY_PAUSE,                    /**< 暂停*/
-	AM_INP_KEY_STOP,                     /**< 停止*/
-	AM_INP_KEY_REC,                      /**< 图像*/
-	AM_INP_KEY_SKIP,                     /**< 跳至下一个*/
-	AM_INP_KEY_REWIND,                   /**< 重新播放当前*/
-	AM_INP_KEY_POWER,                    /**< 电源*/
-	AM_INP_KEY_RED,                      /**< 红*/
-	AM_INP_KEY_YELLOW,                   /**< 黄*/
-	AM_INP_KEY_BLUE,                     /**< 蓝*/
-	AM_INP_KEY_GREEN,                    /**< 绿*/
-	AM_INP_KEY_COUNT
-} AM_INP_Key_t;
-
-/**\brief 键值映射表*/
-typedef struct
-{
-	int codes[AM_INP_KEY_COUNT];         /**< 存放每个按键的键码值*/
-} AM_INP_KeyMap_t;
-
-/**\brief 输入设备回调函数*/
-typedef void (*AM_INP_EventCb_t) (int dev_no, struct input_event *evt, void *user_data);
-
-/****************************************************************************
- * Function prototypes  
- ***************************************************************************/
-
-/**\brief 打开一个输入设备
- * \param dev_no 输入设备号
- * \param[in] para 设备开启参数
- * \return
- *   - AM_SUCCESS 成功
- *   - 其他值 错误代码(见am_inp.h)
- */
-extern AM_ErrorCode_t AM_INP_Open(int dev_no, const AM_INP_OpenPara_t *para);
-
-/**\brief 关闭一个输入设备
- * \param dev_no 输入设备号
- * \return
- *   - AM_SUCCESS 成功
- *   - 其他值 错误代码(见am_inp.h)
- */
-extern AM_ErrorCode_t AM_INP_Close(int dev_no);
-
-/**\brief 使能输入设备,之后输入设备产生的输入事件可以被读取
- * \param dev_no 输入设备号
- * \return
- *   - AM_SUCCESS 成功
- *   - 其他值 错误代码(见am_inp.h)
- */
-extern AM_ErrorCode_t AM_INP_Enable(int dev_no);
-
-/**\brief 禁止输入设备,禁止之后,设备不会返回输入事件
- * \param dev_no 输入设备号
- * \return
- *   - AM_SUCCESS 成功
- *   - 其他值 错误代码(见am_inp.h)
- */
-extern AM_ErrorCode_t AM_INP_Disable(int dev_no);
-
-/**\brief 等待一个输入事件
- *挂起调用线程直到输入设备产生一个输入事件。如果超过超时时间没有事件,返回AM_INP_ERR_TIMEOUT。
- * \param dev_no 输入设备号
- * \param[out] evt 返回输入事件
- * \param timeout 以毫秒为单位的超时时间,<0表示永远等待,=0表示检查后不等待立即返回
- * \return
- *   - AM_SUCCESS 成功
- *   - 其他值 错误代码(见am_inp.h)
- */
-extern AM_ErrorCode_t AM_INP_WaitEvent(int dev_no, struct input_event *evt, int timeout);
-
-/**\brief 向输入设备注册一个事件回调函数
- *输入设备将创建一个线程,检查输入输入事件,如果有输入事件,线程调用回调函数。
- *如果回调函数为NULL,表示取消回调函数,输入设备将结束事件检测线程。
- * \param dev_no 输入设备号
- * \param[in] cb 新注册的回调函数
- * \param[in] user_data 回调函数的用户参数
- * \return
- *   - AM_SUCCESS 成功
- *   - 其他值 错误代码(见am_inp.h)
- */
-extern AM_ErrorCode_t AM_INP_SetCallback(int dev_no, AM_INP_EventCb_t cb, void *user_data);
-
-/**\brief 取得输入设备已经注册事件回调函数及参数
- * \param dev_no 输入设备号
- * \param[out] cb 返回回调函数指针
- * \param[out] user_data 返回回调函数的用户参数
- * \return
- *   - AM_SUCCESS 成功
- *   - 其他值 错误代码(见am_inp.h)
- */
-extern AM_ErrorCode_t AM_INP_GetCallback(int dev_no, AM_INP_EventCb_t *cb, void **user_data);
-
-/**\brief 设定输入设备的键码映射表
- * \param dev_no 输入设备号
- * \param[in] map 新的键码映射表,如果为NULL表示不使用映射表,直接返回键值
- * \return
- *   - AM_SUCCESS 成功
- *   - 其他值 错误代码(见am_inp.h)
- */
-extern AM_ErrorCode_t AM_INP_SetKeyMap(int dev_no, const AM_INP_KeyMap_t *map);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_mem.h b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_mem.h
index be91002..c79f903 100644
--- a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_mem.h
+++ b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_mem.h
@@ -18,7 +18,7 @@
 
 #include <string.h>
 #include "am_util.h"
-#include <memwatch.h>
+//#include <memwatch.h>
 
 #ifdef __cplusplus
 extern "C"
diff --git a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_osd.h b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_osd.h
index e60e06a..9fc0a81 100644
--- a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_osd.h
+++ b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_osd.h
@@ -39,7 +39,7 @@
 	AM_OSD_ERR_NO_MEM,                   /**< 内存不足*/
 	AM_OSD_ERR_BUSY,                     /**< 设备已经打开*/
 	AM_OSD_ERR_INVALID_DEV_NO,           /**< 无效的设备号*/
-	AM_OSD_ERR_NOT_OPENNED,              /**< 设备还没有打开*/
+	AM_OSD_ERR_NOT_OPENED,              /**< 设备还没有打开*/
 	AM_OSD_ERR_CANNOT_CREATE_THREAD,     /**< 无法创建线程*/
 	AM_OSD_ERR_NOT_SUPPORTED,            /**< 设备不支持此功能*/
 	AM_OSD_ERR_CANNOT_OPEN,              /**< 无法打开设备*/
diff --git a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_pes.h b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_pes.h
index 9389de9..15f1f85 100644
--- a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_pes.h
+++ b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_pes.h
@@ -54,7 +54,7 @@
 {
 	AM_PES_PacketCb_t packet;       /**< PES packet callback function*/
 	AM_Bool_t         payload_only; /**< Only read PES payload*/
-	void             *user_data;    /**< User dafined data*/
+	void             *user_data;    /**< User defined data*/
 	int				  afmt;			/**< audio fmt*/
 }AM_PES_Para_t;
 
diff --git a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_smc.h b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_smc.h
deleted file mode 100644
index 1a545b2..0000000
--- a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_smc.h
+++ /dev/null
@@ -1,289 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2014 Amlogic, Inc. All rights reserved.
- *
- * This source code is subject to the terms and conditions defined in the
- * file 'LICENSE' which is part of this source code package.
- *
- * Description:
- */
-/**\file
- * \brief smart card communication module
- *
- * \author Gong Ke <ke.gong@amlogic.com>
- * \date 2010-06-29: create the document
- ***************************************************************************/
-
-#ifndef _AM_SMC_H
-#define _AM_SMC_H
-
-#include "am_types.h"
-#include "am_evt.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/****************************************************************************
- * Macro definitions
- ***************************************************************************/
-
-#define AM_SMC_MAX_ATR_LEN    (33)
-
-/****************************************************************************
- * Error code definitions
- ****************************************************************************/
-/**\brief Error code of the Smart card module*/
-enum AM_SMC_ErrorCode
-{
-	AM_SMC_ERROR_BASE=AM_ERROR_BASE(AM_MOD_SMC),
-	AM_SMC_ERR_INVALID_DEV_NO,           /**< Invalid device number*/
-	AM_SMC_ERR_BUSY,                     /**< The device has already been openned*/
-	AM_SMC_ERR_NOT_OPENNED,              /**< The device is not yet open*/
-	AM_SMC_ERR_CANNOT_OPEN_DEV,          /**< Failed to open device*/
-	AM_SMC_ERR_CANNOT_CREATE_THREAD,     /**< Creating device failure*/
-	AM_SMC_ERR_TIMEOUT,                  /**< Timeout*/
-	AM_SMC_ERR_NOT_SUPPORTED,            /**< The device does not support this function*/
-	AM_SMC_ERR_IO,                       /**< Device input or output errors*/
-	AM_SMC_ERR_BUF_TOO_SMALL,            /**< Buffer too small*/
-	AM_SMC_ERR_NO_CARD,                  /**< Smart card not inserted*/
-	AM_SMC_ERR_END
-};
-
-/****************************************************************************
- * Event type definitions
- ****************************************************************************/
-
-/**\brief Event type of Smart card module*/
-enum AM_SMC_EventType
-{
-	AM_SMC_EVT_BASE=AM_EVT_TYPE_BASE(AM_MOD_SMC),
-	AM_SMC_EVT_CARD_IN,                  /**< Smart card insert*/
-	AM_SMC_EVT_CARD_OUT,                 /**< Smart card pull out*/
-	AM_SMC_EVT_END
-};
-
-
-/****************************************************************************
- * Type definitions
- ***************************************************************************/
-
-/**\brief Smart card device enable parameter*/
-typedef struct
-{
-	int  enable_thread;                  /**< check the thread of check smart card status is enable*/
-} AM_SMC_OpenPara_t;
-
-/**\brief Insert Status type of smart card */
-typedef enum
-{
-	AM_SMC_CARD_OUT, /**< Smart card pull out*/
-	AM_SMC_CARD_IN   /**< Smart card insert*/
-} AM_SMC_CardStatus_t;
-
-/**\brief Smart card status callback*/
-typedef void (*AM_SMC_StatusCb_t) (int dev_no, AM_SMC_CardStatus_t status, void *data);
-
-/** brief Smart card device parameter*/
-typedef struct
-{
-	int     f;                 /**<Clock frequency conversion coefficient*/
-	int     d;                 /**<baud rate coefficient*/
-	int     n;                 /**<the N parameter is used to provide extra guard time between characters.*/
-	int     bwi;               /**<The BWI is used to define the Block Wait Time*/
-	int     cwi;               /**<The CWT is defined as the wait time between characters*/
-	int     bgt;               /**<Block Guard Time*/
-	int     freq;              /**<clock frequency*/
-	int     recv_invert;       /**<1:invert the data bits (excluding the parity) during receiving*/
-	int     recv_lsb_msb;      /**<1:Swap MSBits / Lsbits during receiving*/
-	int     recv_no_parity;    /**<Ignore parity,This is useful during debug*/
-	int     recv_parity;			 /**< 1:Invert Parity during receiving*/
-	int     xmit_invert;       /**<1:invert the data bits (excluding the parity)*/
-	int     xmit_lsb_msb;      /**<1:Swap MSBits / LSbits*/
-	int     xmit_retries;      /**<Number of attempts to make sending a character.*/
-	int     xmit_repeat_dis;   /**<Set this bit to 1 to disable character repeats when an error is detected.*/
-	int     xmit_parity;			 /**<1:Invert Parity*/
-}AM_SMC_Param_t;
-
-/****************************************************************************
- * Function prototypes  
- ***************************************************************************/
-
-/**\brief Open smart card device
- * \param dev_no Smart card device number
- * \param[in] para Smart card device open parameter
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_SMC_Open(int dev_no, const AM_SMC_OpenPara_t *para);
-
-/**\brief Close smart cart device
- * \param dev_no Smart card device number
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_SMC_Close(int dev_no);
-
-/**\brief Get smart card insert status
- * \param dev_no Smart card device number
- * \param[out] status inert status of smart card device
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_SMC_GetCardStatus(int dev_no, AM_SMC_CardStatus_t *status);
-
-/**\brief Reset smart card
- * \param dev_no Smart card device number
- * \param[out] atr Smart card attribute data
- * \param[in,out] len input attribute len,out the actual attribute length
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_SMC_Reset(int dev_no, uint8_t *atr, int *len);
-
-/**\brief Read data from Smart card device
- * Read data directly from the smart card device,
- * The thread that calls the function will block,
- * Until the expiration of the expected number of data read
- * Or timeout.
- * \param dev_no Smart card device number
- * \param[out] data Read data buffer
- * \param[in] len want read Data length
- * \param timeout Read timeout in milliseconds, <0 said the permanent wait.
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_SMC_Read(int dev_no, uint8_t *data, int len, int timeout);
-
-/**\brief write data to smard card device
- * Write data to the smart card device,
- * The thread that calls the function will block,
- * Until the expiration of the expected number of data write
- * Or timeout.
- * \param dev_no Smart card device number
- * \param[in] data Write data buffer
- * \param[in] len want write Data length
- * \param timeout Write timeout in milliseconds, <0 said the permanent wait.
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_SMC_Write(int dev_no, const uint8_t *data, int len, int timeout);
-
-/**\brief Read data from Smart card device
- * Read data directly from the smart card device,
- * The thread that calls the function will block,
- * Until the expiration of the expected number of data read
- * Or timeout.
-  * \param dev_no Smart card device number
- * \param[out] data Read data buffer
- * \param[out] act_len Actual read data length
- * \param[in] len len want read Data length
- * \param timeout Read timeout in milliseconds, <0 said the permanent wait.
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_SMC_ReadEx(int dev_no, uint8_t *data, int *act_len, int len, int timeout);
-
-/**\brief write data to smard card device
- * Write data to the smart card device,
- * The thread that calls the function will block,
- * Until the expiration of the expected number of data write
- * Or timeout.
- * \param dev_no Smart card device number
- * \param[in] data Write data buffer
- * \param[out] act_len Actual Write data length
- * \param[in] len len want write Data length
- * \param timeout Write timeout in milliseconds, <0 said the permanent wait.
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_SMC_WriteEx(int dev_no, const uint8_t *data, int *act_len, int len, int timeout);
-
-/**\brief Transmit data by T0 protocol
- * \param dev_no Smart card device number
- * \param[in] send send data buffer
- * \param[in] slen send data length
- * \param[out] recv Receive data buffer
- * \param[out] rlen Receive data length
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_SMC_TransferT0(int dev_no, const uint8_t *send, int slen, uint8_t *recv, int *rlen);
-
-/**\brief Transmit data by T1 protocol
- * \param dev_no Smart card device number
- * \param[in] send send data buffer
- * \param[in] slen send data length
- * \param[out] recv Receive data buffer
- * \param[out] rlen Receive data length
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_SMC_TransferT1(int dev_no, const uint8_t *send, int slen, uint8_t *recv, int *rlen);
-
-/**\brief Transmit data by T14 protocol
- * \param dev_no Smart card device number
- * \param[in] send send data buffer
- * \param[in] slen send data length
- * \param[out] recv Receive data buffer
- * \param[out] rlen Receive data length
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_SMC_TransferT14(int dev_no, const uint8_t *send, int slen, uint8_t *recv, int *rlen);
-
-/**\brief Get callback function of the smart card status
- * \param dev_no Smart card device number
- * \param[out] cb The pointer of callback function
- * \param[out] data user data
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_SMC_GetCallback(int dev_no, AM_SMC_StatusCb_t *cb, void **data);
-
-/**\brief Set callback function of the smart card status
- * \param dev_no Smart card device number
- * \param[in] cb The pointer of callback function
- * \param[in] data user data
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_SMC_SetCallback(int dev_no, AM_SMC_StatusCb_t cb, void *data);
-
-/**\brief Activate smart card device
- * \param dev_no Smart card device number
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_SMC_Active(int dev_no);
-
-/**\brief Deactivate smart card device
- * \param dev_no Smart card device number
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_SMC_Deactive(int dev_no);
-
-/**\brief Get smart card parameters
- * \param dev_no Smart card device number
- * \param[out] para smart card parameters
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_SMC_GetParam(int dev_no, AM_SMC_Param_t *para);
-
-/**\brief Set smart card parameters
- * \param dev_no Smart card device number
- * \param[in] para smart card parameters
- * \retval AM_SUCCESS On success
- * \return Error code
- */
-extern AM_ErrorCode_t AM_SMC_SetParam(int dev_no, const AM_SMC_Param_t *para);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_vlfend.h b/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_vlfend.h
deleted file mode 100644
index 01d42f5..0000000
--- a/test/am_ca_key_test/inject_record_t5d/include/am_adp/am_vlfend.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/***************************************************************************
- * Copyright (c) 2014 Amlogic, Inc. All rights reserved.
- *
- * This source code is subject to the terms and conditions defined in the
- * file 'LICENSE' which is part of this source code package.
- *
- * Description:
- */
-/**\file
- * \brief DVB Frontend Module
- *
- * Basic data structures definition in "linux/dvb/frontend.h"
- *
- * \author nengwen.chen <nengwen.chen@amlogic.com>
- * \date 2018-04-16: create the document
- ***************************************************************************/
-
-#ifndef _AM_VFFEND_H_
-#define _AM_VFFEND_H_
-
-#include "am_types.h"
-#include "am_evt.h"
-#include "am_dmx.h"
-/*add for config define for linux dvb *.h*/
-#include <am_config.h>
-#include <linux/dvb/frontend.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-#define VLFEND_FL_RUN_CB        (1)
-#define VLFEND_FL_LOCK          (2)
-
-/****************************************************************************
- * Function prototypes
- ***************************************************************************/
-
-/**\brief open a frontend device
- * \param dev_no frontend device number
- * \param[in] para frontend's device open parameters
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_VLFEND_Open(int dev_no, const AM_FEND_OpenPara_t *para);
-
-/**\brief close a frontend device
- * \param dev_no frontend device number
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_VLFEND_Close(int dev_no);
-extern AM_ErrorCode_t AM_VLFEND_CloseEx(int dev_no, AM_Bool_t reset);
-
-
-/**\brief set frontend deivce mode
- * \param dev_no frontend device number
- * \param mode frontend demod mode
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_VLFEND_SetMode(int dev_no, int mode);
-
-/**\brief set frontend parameter
- * \param dev_no frontend device number
- * \param[in] para frontend parameter
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_VLFEND_SetPara(int dev_no, const struct dvb_frontend_parameters *para);
-
-/**\brief get frontend parameter
- * \param dev_no frontend device number
- * \param[out] para return frontend parameter
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_VLFEND_GetPara(int dev_no, struct dvb_frontend_parameters *para);
-
-/**
- * \brief set frontend property
- * \param dev_no frontend device number
- * \param[in] prop frontend device property
- * \return
- *   - AM_SUCCESS onSuccess
- *   - or error code
- */
-extern AM_ErrorCode_t AM_VLFEND_SetProp(int dev_no, const struct dtv_properties *prop);
-
-/**
- * \brief get frontend property
- * \param dev_no frontend device number
- * \param[out] prop return frontend device property
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_VLFEND_GetProp(int dev_no, struct dtv_properties *prop);
-
-/**\brief get frontend lock status
- * \param dev_no frontend device number
- * \param[out] status return frontend lock status
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_VLFEND_GetStatus(int dev_no, fe_status_t *status);
-
-/**\brief get frontend frequency afc
- * \param dev_no frontend device number
- * \param[out] status return frontend frequency afc
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_VLFEND_GetAFC(int dev_no, int *afc);
-
-/**\brief get frontend device's callback function
- * \param dev_no frontend device number
- * \param[out] cb return callback function
- * \param[out] user_data callback function's parameters
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_VLFEND_GetCallback(int dev_no, AM_FEND_Callback_t *cb, void **user_data);
-
-/**\brief register the frontend callback function
- * \param dev_no frontend device function
- * \param[in] cb callback function
- * \param[in] user_data callback function's parameter
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_VLFEND_SetCallback(int dev_no, AM_FEND_Callback_t cb, void *user_data);
-
-/**\brief enable or disable frontend callback
- * \param dev_no frontend device number
- * \param[in] enable_cb enable or disable
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_VLFEND_SetActionCallback(int dev_no, AM_Bool_t enable_cb);
-
-/**\brief try to lock frontend and wait lock status
- * \param dev_no device frontend number
- * \param[in] para frontend parameters
- * \param[out] status return frontend lock status
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_VLFEND_Lock(int dev_no, const struct dvb_frontend_parameters *para, fe_status_t *status);
-
-/**\brief set frontend thread delay time
- * \param dev_no frontend device number
- * \param delay time value in millisecond,  0 means no time interval and frontend thread will stop
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_VLFEND_SetThreadDelay(int dev_no, int delay);
-
-/**\brief get frontend atv tune status
- * \param dev_no frontend device number
- * \param atv_status tune status value
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_VLFEND_GetAtvStatus(int dev_no, atv_status_t *atv_status);
-
-/**\brief start frontend detect standard
- * \param dev_no frontend device number
- * \return
- *   - AM_SUCCESS On success
- *   - or error code
- */
-extern AM_ErrorCode_t AM_VLFEND_DetectStandard(int dev_no);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
diff --git a/test/am_ca_key_test/inject_record_t5d/include/am_adp/codec_type.h b/test/am_ca_key_test/inject_record_t5d/include/am_adp/codec_type.h
index 25ce908..1beb074 100644
--- a/test/am_ca_key_test/inject_record_t5d/include/am_adp/codec_type.h
+++ b/test/am_ca_key_test/inject_record_t5d/include/am_adp/codec_type.h
@@ -31,7 +31,7 @@
 typedef int CODEC_HANDLE;
 
 typedef enum {
-    STREAM_TYPE_UNKNOW,
+    STREAM_TYPE_UNKNOWN,
     STREAM_TYPE_ES_VIDEO,
     STREAM_TYPE_ES_AUDIO,
     STREAM_TYPE_ES_SUB,
@@ -98,7 +98,7 @@
     int audio_pid;              ///< stream audio pid
     int sub_pid;                ///< stream subtitle pid
     int audio_channels;         ///< stream audio channel number
-    int audio_samplerate;       ///< steram audio sample rate
+    int audio_samplerate;       ///< stream audio sample rate
     int vbuf_size;              ///< video buffer size of codec device
     int abuf_size;              ///< audio buffer size of codec device
     dec_sysinfo_t am_sysinfo;   ///< system information for video
diff --git a/test/am_ca_key_test/inject_record_t5d/include/am_adp/memwatch.h b/test/am_ca_key_test/inject_record_t5d/include/am_adp/memwatch.h
deleted file mode 100644
index d63fd76..0000000
--- a/test/am_ca_key_test/inject_record_t5d/include/am_adp/memwatch.h
+++ /dev/null
@@ -1,707 +0,0 @@
-/*
-** MEMWATCH.H
-** Nonintrusive ANSI C memory leak / overwrite detection
-** Copyright (C) 1992-2002 Johan Lindh
-** All rights reserved.
-** Version 2.71
-**
-************************************************************************
-**
-** PURPOSE:
-**
-**  MEMWATCH has been written to allow guys and gals that like to
-**  program in C a public-domain memory error control product.
-**  I hope you'll find it's as advanced as most commercial packages.
-**  The idea is that you use it during the development phase and
-**  then remove the MEMWATCH define to produce your final product.
-**  MEMWATCH is distributed in source code form in order to allow
-**  you to compile it for your platform with your own compiler.
-**  It's aim is to be 100% ANSI C, but some compilers are more stingy
-**  than others. If it doesn't compile without warnings, please mail
-**  me the configuration of operating system and compiler you are using
-**  along with a description of how to modify the source, and the version
-**  number of MEMWATCH that you are using.
-**
-************************************************************************
-
-	This file is part of MEMWATCH.
-
-    MEMWATCH is free software; you can redistribute it and/or modify
-    it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    MEMWATCH is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with MEMWATCH; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-************************************************************************
-**
-** REVISION HISTORY:
-**
-** 920810 JLI   [1.00]
-** 920830 JLI   [1.10 double-free detection]
-** 920912 JLI   [1.15 mwPuts, mwGrab/Drop, mwLimit]
-** 921022 JLI   [1.20 ASSERT and VERIFY]
-** 921105 JLI   [1.30 C++ support and TRACE]
-** 921116 JLI   [1.40 mwSetOutFunc]
-** 930215 JLI   [1.50 modified ASSERT/VERIFY]
-** 930327 JLI   [1.51 better auto-init & PC-lint support]
-** 930506 JLI   [1.55 MemWatch class, improved C++ support]
-** 930507 JLI   [1.60 mwTest & CHECK()]
-** 930809 JLI   [1.65 Abort/Retry/Ignore]
-** 930820 JLI   [1.70 data dump when unfreed]
-** 931016 JLI   [1.72 modified C++ new/delete handling]
-** 931108 JLI   [1.77 mwSetAssertAction() & some small changes]
-** 940110 JLI   [1.80 no-mans-land alloc/checking]
-** 940328 JLI   [2.00 version 2.0 rewrite]
-**              Improved NML (no-mans-land) support.
-**              Improved performance (especially for free()ing!).
-**              Support for 'read-only' buffers (checksums)
-**              ^^ NOTE: I never did this... maybe I should?
-**              FBI (free'd block info) tagged before freed blocks
-**              Exporting of the mwCounter variable
-**              mwBreakOut() localizes debugger support
-**              Allocation statistics (global, per-module, per-line)
-**              Self-repair ability with relinking
-** 950913 JLI   [2.10 improved garbage handling]
-** 951201 JLI   [2.11 improved auto-free in emergencies]
-** 960125 JLI   [X.01 implemented auto-checking using mwAutoCheck()]
-** 960514 JLI   [2.12 undefining of existing macros]
-** 960515 JLI   [2.13 possibility to use default new() & delete()]
-** 960516 JLI   [2.20 suppression of file flushing on unfreed msgs]
-** 960516 JLI   [2.21 better support for using MEMWATCH with DLL's]
-** 960710 JLI   [X.02 multiple logs and mwFlushNow()]
-** 960801 JLI   [2.22 merged X.01 version with current]
-** 960805 JLI   [2.30 mwIsXXXXAddr() to avoid unneeded GP's]
-** 960805 JLI   [2.31 merged X.02 version with current]
-** 961002 JLI   [2.32 support for realloc() + fixed STDERR bug]
-** 961222 JLI   [2.40 added mwMark() & mwUnmark()]
-** 970101 JLI   [2.41 added over/underflow checking after failed ASSERT/VERIFY]
-** 970113 JLI   [2.42 added support for PC-Lint 7.00g]
-** 970207 JLI   [2.43 added support for strdup()]
-** 970209 JLI   [2.44 changed default filename to lowercase]
-** 970405 JLI   [2.45 fixed bug related with atexit() and some C++ compilers]
-** 970723 JLI   [2.46 added MW_ARI_NULLREAD flag]
-** 970813 JLI   [2.47 stabilized marker handling]
-** 980317 JLI   [2.48 ripped out C++ support; wasn't working good anyway]
-** 980318 JLI   [2.50 improved self-repair facilities & SIGSEGV support]
-** 980417 JLI	[2.51 more checks for invalid addresses]
-** 980512 JLI	[2.52 moved MW_ARI_NULLREAD to occur before aborting]
-** 990112 JLI	[2.53 added check for empty heap to mwIsOwned]
-** 990217 JLI	[2.55 improved the emergency repairs diagnostics and NML]
-** 990224 JLI	[2.56 changed ordering of members in structures]
-** 990303 JLI	[2.57 first maybe-fixit-for-hpux test]
-** 990516 JLI	[2.58 added 'static' to the definition of mwAutoInit]
-** 990517 JLI	[2.59 fixed some high-sensitivity warnings]
-** 990610 JLI	[2.60 fixed some more high-sensitivity warnings]
-** 990715 JLI	[2.61 changed TRACE/ASSERT/VERIFY macro names]
-** 991001 JLI	[2.62 added CHECK_BUFFER() and mwTestBuffer()]
-** 991007 JLI	[2.63 first shot at a 64-bit compatible version]
-** 991009 JLI	[2.64 undef's strdup() if defined, mwStrdup made const]
-** 000704 JLI	[2.65 added some more detection for 64-bits]
-** 010502 JLI   [2.66 incorporated some user fixes]
-**              [mwRelink() could print out garbage pointer (thanks mac@phobos.ca)]
-**				[added array destructor for C++ (thanks rdasilva@connecttel.com)]
-**				[added mutex support (thanks rdasilva@connecttel.com)]
-** 010531 JLI	[2.67 fix: mwMutexXXX() was declared even if MW_HAVE_MUTEX was not defined]
-** 010619 JLI	[2.68 fix: mwRealloc() could leave the mutex locked]
-** 020918 JLI	[2.69 changed to GPL, added C++ array allocation by Howard Cohen]
-** 030212 JLI	[2.70 mwMalloc() bug for very large allocations (4GB on 32bits)]
-** 030520 JLI	[2.71 added ULONG_LONG_MAX as a 64-bit detector (thanks Sami Salonen)]
-**
-** To use, simply include 'MEMWATCH.H' as a header file,
-** and add MEMWATCH.C to your list of files, and define the macro
-** 'MEMWATCH'. If this is not defined, MEMWATCH will disable itself.
-**
-** To call the standard C malloc / realloc / calloc / free; use mwMalloc_(),
-** mwCalloc_() and mwFree_(). Note that mwFree_() will correctly
-** free both malloc()'d memory as well as mwMalloc()'d.
-**
-** 980317: C++ support has been disabled.
-**         The code remains, but is not compiled.
-**
-**         For use with C++, which allows use of inlining in header files
-**         and class specific new/delete, you must also define 'new' as
-**         'mwNew' and 'delete' as 'mwDelete'. Do this *after* you include
-**         C++ header files from libraries, otherwise you can mess up their
-**         class definitions. If you don't define these, the C++ allocations
-**         will not have source file and line number information. Also note,
-**         most C++ class libraries implement their own C++ memory management,
-**         and don't allow anyone to override them. MFC belongs to this crew.
-**         In these cases, the only thing to do is to use MEMWATCH_NOCPP.
-**
-** You can capture output from MEMWATCH using mwSetOutFunc().
-** Just give it the adress of a "void myOutFunc(int c)" function,
-** and all characters to be output will be redirected there.
-**
-** A failing ASSERT() or VERIFY() will normally always abort your
-** program. This can be changed using mwSetAriFunc(). Give it a
-** pointer to a "int myAriFunc(const char *)" function. Your function
-** must ask the user whether to Abort, Retry or Ignore the trap.
-** Return 2 to Abort, 1 to Retry or 0 to Ignore. Beware retry; it
-** causes the expression to be evaluated again! MEMWATCH has a
-** default ARI handler. It's disabled by default, but you can enable
-** it by calling 'mwDefaultAri()'. Note that this will STILL abort
-** your program unless you define MEMWATCH_STDIO to allow MEMWATCH
-** to use the standard C I/O streams. Also, setting the ARI function
-** will cause MEMWATCH *NOT* to write the ARI error to stderr. The
-** error string is passed to the ARI function instead, as the
-** 'const char *' parameter.
-**
-** You can disable MEMWATCH's ASSERT/VERIFY and/or TRACE implementations.
-** This can be useful if you're using a debug terminal or smart debugger.
-** Disable them by defining MW_NOASSERT, MW_NOVERIFY or MW_NOTRACE.
-**
-** MEMWATCH fills all allocated memory with the byte 0xFE, so if
-** you're looking at erroneous data which are all 0xFE:s, the
-** data probably was not initialized by you. The exception is
-** calloc(), which will fill with zero's. All freed buffers are
-** zapped with 0xFD. If this is what you look at, you're using
-** data that has been freed. If this is the case, be aware that
-** MEMWATCH places a 'free'd block info' structure immediately
-** before the freed data. This block contains info about where
-** the block was freed. The information is in readable text,
-** in the format "FBI<counter>filename(line)", for example:
-** "FBI<267>test.c(12)". Using FBI's slows down free(), so it's
-** disabled by default. Use mwFreeBufferInfo(1) to enable it.
-**
-** To aid in tracking down wild pointer writes, MEMWATCH can perform
-** no-mans-land allocations. No-mans-land will contain the byte 0xFC.
-** MEMWATCH will, when this is enabled, convert recently free'd memory
-** into NML allocations.
-**
-** MEMWATCH protects it's own data buffers with checksums. If you
-** get an internal error, it means you're overwriting wildly,
-** or using an uninitialized pointer.
-**
-************************************************************************
-**
-** Note when compiling with Microsoft C:
-**  -   MSC ignores fflush() by default. This is overridden, so that
-**      the disk log will always be current.
-**
-** This utility has been tested with:
-**  PC-lint 7.0k, passed as 100% ANSI C compatible
-**  Microsoft Visual C++ on Win16 and Win32
-**  Microsoft C on DOS
-**  SAS C on an Amiga 500
-**  Gnu C on a PC running Red Hat Linux
-**  ...and using an (to me) unknown compiler on an Atari machine.
-**
-************************************************************************
-**
-** Format of error messages in MEMWATCH.LOG:
-**  message: <sequence-number> filename(linenumber), information
-**
-** Errors caught by MemWatch, when they are detected, and any
-** actions taken besides writing to the log file MEMWATCH.LOG:
-**
-**  Double-freeing:
-**      A pointer that was recently freed and has not since been
-**      reused was freed again. The place where the previous free()
-**      was executed is displayed.
-**      Detect: delete or free() using the offending pointer.
-**      Action: The delete or free() is cancelled, execution continues.
-**  Underflow:
-**      You have written just ahead of the allocated memory.
-**      The size and place of the allocation is displayed.
-**      Detect: delete or free() of the damaged buffer.
-**      Action: The buffer is freed, but there may be secondary damage.
-**  Overflow:
-**      Like underflow, but you've written after the end of the buffer.
-**      Detect: see Underflow.
-**      Action: see Underflow.
-**  WILD free:
-**      An unrecognized pointer was passed to delete or free().
-**      The pointer may have been returned from a library function;
-**      in that case, use mwFree_() to force free() of it.
-**      Also, this may be a double-free, but the previous free was
-**      too long ago, causing MEMWATCH to 'forget' it.
-**      Detect: delete or free() of the offending pointer.
-**      Action: The delete or free() is cancelled, execution continues.
-**  NULL free:
-**      It's unclear to me whether or not freeing of NULL pointers
-**      is legal in ANSI C, therefore a warning is written to the log file,
-**      but the error counter remains the same. This is legal using C++,
-**      so the warning does not appear with delete.
-**      Detect: When you free(NULL).
-**      Action: The free() is cancelled.
-**  Failed:
-**      A request to allocate memory failed. If the allocation is
-**      small, this may be due to memory depletion, but is more likely
-**      to be memory fragmentation problems. The amount of memory
-**      allocated so far is displayed also.
-**      Detect: When you new, malloc(), realloc() or calloc() memory.
-**      Action: NULL is returned.
-**  Realloc:
-**      A request to re-allocate a memory buffer failed for reasons
-**      other than out-of-memory. The specific reason is shown.
-**      Detect: When you realloc()
-**      Action: realloc() is cancelled, NULL is returned
-**  Limit fail:
-**      A request to allocate memory failed since it would violate
-**      the limit set using mwLimit(). mwLimit() is used to stress-test
-**      your code under simulated low memory conditions.
-**      Detect: At new, malloc(), realloc() or calloc().
-**      Action: NULL is returned.
-**  Assert trap:
-**      An ASSERT() failed. The ASSERT() macro works like C's assert()
-**      macro/function, except that it's interactive. See your C manual.
-**      Detect: On the ASSERT().
-**      Action: Program ends with an advisory message to stderr, OR
-**              Program writes the ASSERT to the log and continues, OR
-**              Program asks Abort/Retry/Ignore? and takes that action.
-**  Verify trap:
-**      A VERIFY() failed. The VERIFY() macro works like ASSERT(),
-**      but if MEMWATCH is not defined, it still evaluates the
-**      expression, but it does not act upon the result.
-**      Detect: On the VERIFY().
-**      Action: Program ends with an advisory message to stderr, OR
-**              Program writes the VERIFY to the log and continues, OR
-**              Program asks Abort/Retry/Ignore? and takes that action.
-**  Wild pointer:
-**      A no-mans-land buffer has been written into. MEMWATCH can
-**      allocate and distribute chunks of memory solely for the
-**      purpose of trying to catch random writes into memory.
-**      Detect: Always on CHECK(), but can be detected in several places.
-**      Action: The error is logged, and if an ARI handler is installed,
-**              it is executed, otherwise, execution continues.
-**  Unfreed:
-**      A memory buffer you allocated has not been freed.
-**      You are informed where it was allocated, and whether any
-**      over or underflow has occured. MemWatch also displays up to
-**      16 bytes of the data, as much as it can, in hex and text.
-**      Detect: When MemWatch terminates.
-**      Action: The buffer is freed.
-**  Check:
-**      An error was detected during a CHECK() operation.
-**      The associated pointer is displayed along with
-**      the file and line where the CHECK() was executed.
-**      Followed immediately by a normal error message.
-**      Detect: When you CHECK()
-**      Action: Depends on the error
-**  Relink:
-**      After a MEMWATCH internal control block has been trashed,
-**      MEMWATCH tries to repair the damage. If successful, program
-**      execution will continue instead of aborting. Some information
-**      about the block may be gone permanently, though.
-**      Detect: N/A
-**      Action: Relink successful: program continues.
-**              Relink fails: program aborts.
-**  Internal:
-**      An internal error is flagged by MEMWATCH when it's control
-**      structures have been damaged. You are likely using an uninitialized
-**      pointer somewhere in your program, or are zapping memory all over.
-**      The message may give you additional diagnostic information.
-**      If possible, MEMWATCH will recover and continue execution.
-**      Detect: Various actions.
-**      Action: Whatever is needed
-**  Mark:
-**      The program terminated without umarking all marked pointers. Marking
-**      can be used to track resources other than memory. mwMark(pointer,text,...)
-**      when the resource is allocated, and mwUnmark(pointer) when it's freed.
-**      The 'text' is displayed for still marked pointers when the program
-**      ends.
-**      Detect: When MemWatch terminates.
-**      Action: The error is logged.
-**
-**
-************************************************************************
-**
-**  The author may be reached by e-mail at the address below. If you
-**  mail me about source code changes in MEMWATCH, remember to include
-**  MW's version number.
-**
-**      Johan Lindh
-**      johan@linkdata.se
-**
-** The latest version of MEMWATCH may be downloaded from
-** http://www.linkdata.se/
-*/
-
-#ifndef __MEMWATCH_H
-#define __MEMWATCH_H
-
-/* Make sure that malloc(), realloc(), calloc() and free() are declared. */
-/*lint -save -e537 */
-#include <stdlib.h>
-/*lint -restore */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/*
-** Constants used
-**  All MEMWATCH constants start with the prefix MW_, followed by
-**  a short mnemonic which indicates where the constant is used,
-**  followed by a descriptive text about it.
-*/
-
-#define MW_ARI_NULLREAD 0x10    /* Null read (to start debugger) */
-#define MW_ARI_ABORT    0x04    /* ARI handler says: abort program! */
-#define MW_ARI_RETRY    0x02    /* ARI handler says: retry action! */
-#define MW_ARI_IGNORE   0x01    /* ARI handler says: ignore error! */
-
-#define MW_VAL_NEW      0xFE    /* value in newly allocated memory */
-#define MW_VAL_DEL      0xFD    /* value in newly deleted memory */
-#define MW_VAL_NML      0xFC    /* value in no-mans-land */
-#define MW_VAL_GRB      0xFB    /* value in grabbed memory */
-
-#define MW_TEST_ALL     0xFFFF  /* perform all tests */
-#define MW_TEST_CHAIN   0x0001  /* walk the heap chain */
-#define MW_TEST_ALLOC   0x0002  /* test allocations & NML guards */
-#define MW_TEST_NML     0x0004  /* test all-NML areas for modifications */
-
-#define MW_NML_NONE     0       /* no NML */
-#define MW_NML_FREE     1       /* turn FREE'd memory into NML */
-#define MW_NML_ALL      2       /* all unused memory is NML */
-#define MW_NML_DEFAULT  0       /* the default NML setting */
-
-#define MW_STAT_GLOBAL  0       /* only global statistics collected */
-#define MW_STAT_MODULE  1       /* collect statistics on a module basis */
-#define MW_STAT_LINE    2       /* collect statistics on a line basis */
-#define MW_STAT_DEFAULT 0       /* the default statistics setting */
-
-/*
-** MemWatch internal constants
-**  You may change these and recompile MemWatch to change the limits
-**  of some parameters. Respect the recommended minimums!
-*/
-#define MW_TRACE_BUFFER 2048    /* (min 160) size of TRACE()'s output buffer */
-#define MW_FREE_LIST    64      /* (min 4) number of free()'s to track */
-
-/*
-** Exported variables
-**  In case you have to remove the 'const' keyword because your compiler
-**  doesn't support it, be aware that changing the values may cause
-**  unpredictable behaviour.
-**  - mwCounter contains the current action count. You can use this to
-**      place breakpoints using a debugger, if you want.
-*/
-#ifndef __MEMWATCH_C
-extern const unsigned long mwCounter;
-#endif
-
-/*
-** System functions
-**  Normally, it is not nessecary to call any of these. MEMWATCH will
-**  automatically initialize itself on the first MEMWATCH function call,
-**  and set up a call to mwAbort() using atexit(). Some C++ implementations
-**  run the atexit() chain before the program has terminated, so you
-**  may have to use mwInit() or the MemWatch C++ class to get good
-**  behaviour.
-**  - mwInit() can be called to disable the atexit() usage. If mwInit()
-**      is called directly, you must call mwTerm() to end MemWatch, or
-**      mwAbort().
-**  - mwTerm() is usually not nessecary to call; but if called, it will
-**      call mwAbort() if it finds that it is cancelling the 'topmost'
-**      mwInit() call.
-**  - mwAbort() cleans up after MEMWATCH, reports unfreed buffers, etc.
-*/
-void  mwInit( void );
-void  mwTerm( void );
-void  mwAbort( void );
-
-/*
-** Setup functions
-**  These functions control the operation of MEMWATCH's protective features.
-**  - mwFlushNow() causes MEMWATCH to flush it's buffers.
-**  - mwDoFlush() controls whether MEMWATCH flushes the disk buffers after
-**      writes. The default is smart flushing: MEMWATCH will not flush buffers
-**      explicitly until memory errors are detected. Then, all writes are
-**      flushed until program end or mwDoFlush(0) is called.
-**  - mwLimit() sets the allocation limit, an arbitrary limit on how much
-**      memory your program may allocate in bytes. Used to stress-test app.
-**      Also, in virtual-memory or multitasking environs, puts a limit on
-**      how much MW_NML_ALL can eat up.
-**  - mwGrab() grabs up X kilobytes of memory. Allocates actual memory,
-**      can be used to stress test app & OS both.
-**  - mwDrop() drops X kilobytes of grabbed memory.
-**  - mwNoMansLand() sets the behaviour of the NML logic. See the
-**      MW_NML_xxx for more information. The default is MW_NML_DEFAULT.
-**  - mwStatistics() sets the behaviour of the statistics collector. See
-**      the MW_STAT_xxx defines for more information. Default MW_STAT_DEFAULT.
-**  - mwFreeBufferInfo() enables or disables the tagging of free'd buffers
-**      with freeing information. This information is written in text form,
-**      using sprintf(), so it's pretty slow. Disabled by default.
-**  - mwAutoCheck() performs a CHECK() operation whenever a MemWatch function
-**      is used. Slows down performance, of course.
-**  - mwCalcCheck() calculates checksums for all data buffers. Slow!
-**  - mwDumpCheck() logs buffers where stored & calc'd checksums differ. Slow!!
-**  - mwMark() sets a generic marker. Returns the pointer given.
-**  - mwUnmark() removes a generic marker. If, at the end of execution, some
-**      markers are still in existence, these will be reported as leakage.
-**      returns the pointer given.
-*/
-void        mwFlushNow( void );
-void        mwDoFlush( int onoff );
-void        mwLimit( long bytes );
-unsigned    mwGrab( unsigned kilobytes );
-unsigned    mwDrop( unsigned kilobytes );
-void        mwNoMansLand( int mw_nml_level );
-void        mwStatistics( int level );
-void        mwFreeBufferInfo( int onoff );
-void        mwAutoCheck( int onoff );
-void        mwCalcCheck( void );
-void        mwDumpCheck( void );
-void *      mwMark( void *p, const char *description, const char *file, unsigned line );
-void *      mwUnmark( void *p, const char *file, unsigned line );
-
-/*
-** Testing/verification/tracing
-**  All of these macros except VERIFY() evaluates to a null statement
-**  if MEMWATCH is not defined during compilation.
-**  - mwIsReadAddr() checks a memory area for read privilige.
-**  - mwIsSafeAddr() checks a memory area for both read & write privilige.
-**      This function and mwIsReadAddr() is highly system-specific and
-**      may not be implemented. If this is the case, they will default
-**      to returning nonzero for any non-NULL pointer.
-**  - CHECK() does a complete memory integrity test. Slow!
-**  - CHECK_THIS() checks only selected components.
-**  - CHECK_BUFFER() checks the indicated buffer for errors.
-**  - mwASSERT() or ASSERT() If the expression evaluates to nonzero, execution continues.
-**      Otherwise, the ARI handler is called, if present. If not present,
-**      the default ARI action is taken (set with mwSetAriAction()).
-**      ASSERT() can be disabled by defining MW_NOASSERT.
-**  - mwVERIFY() or VERIFY() works just like ASSERT(), but when compiling without
-**      MEMWATCH the macro evaluates to the expression.
-**      VERIFY() can be disabled by defining MW_NOVERIFY.
-**  - mwTRACE() or TRACE() writes some text and data to the log. Use like printf().
-**      TRACE() can be disabled by defining MW_NOTRACE.
-*/
-int   mwIsReadAddr( const void *p, unsigned len );
-int   mwIsSafeAddr( void *p, unsigned len );
-int   mwTest( const char *file, int line, int mw_test_flags );
-int   mwTestBuffer( const char *file, int line, void *p );
-int   mwAssert( int, const char*, const char*, int );
-int   mwVerify( int, const char*, const char*, int );
-
-/*
-** User I/O functions
-**  - mwTrace() works like printf(), but dumps output either to the
-**      function specified with mwSetOutFunc(), or the log file.
-**  - mwPuts() works like puts(), dumps output like mwTrace().
-**  - mwSetOutFunc() allows you to give the adress of a function
-**      where all user output will go. (exeption: see mwSetAriFunc)
-**      Specifying NULL will direct output to the log file.
-**  - mwSetAriFunc() gives MEMWATCH the adress of a function to call
-**      when an 'Abort, Retry, Ignore' question is called for. The
-**      actual error message is NOT printed when you've set this adress,
-**      but instead it is passed as an argument. If you call with NULL
-**      for an argument, the ARI handler is disabled again. When the
-**      handler is disabled, MEMWATCH will automatically take the
-**      action specified by mwSetAriAction().
-**  - mwSetAriAction() sets the default ARI return value MEMWATCH should
-**      use if no ARI handler is specified. Defaults to MW_ARI_ABORT.
-**  - mwAriHandler() is an ANSI ARI handler you can use if you like. It
-**      dumps output to stderr, and expects input from stdin.
-**  - mwBreakOut() is called in certain cases when MEMWATCH feels it would
-**      be nice to break into a debugger. If you feel like MEMWATCH, place
-**      an execution breakpoint on this function.
-*/
-void  mwTrace( const char* format_string, ... );
-void  mwPuts( const char* text );
-void  mwSetOutFunc( void (*func)(int) );
-void  mwSetAriFunc( int (*func)(const char*) );
-void  mwSetAriAction( int mw_ari_value );
-int   mwAriHandler( const char* cause );
-void  mwBreakOut( const char* cause );
-
-/*
-** Allocation/deallocation functions
-**  These functions are the ones actually to perform allocations
-**  when running MEMWATCH, for both C and C++ calls.
-**  - mwMalloc() debugging allocator
-**  - mwMalloc_() always resolves to a clean call of malloc()
-**  - mwRealloc() debugging re-allocator
-**  - mwRealloc_() always resolves to a clean call of realloc()
-**  - mwCalloc() debugging allocator, fills with zeros
-**  - mwCalloc_() always resolves to a clean call of calloc()
-**  - mwFree() debugging free. Can only free memory which has
-**      been allocated by MEMWATCH.
-**  - mwFree_() resolves to a) normal free() or b) debugging free.
-**      Can free memory allocated by MEMWATCH and malloc() both.
-**      Does not generate any runtime errors.
-*/
-void* mwMalloc( size_t, const char*, int );
-void* mwMalloc_( size_t );
-void* mwRealloc( void *, size_t, const char*, int );
-void* mwRealloc_( void *, size_t );
-void* mwCalloc( size_t, size_t, const char*, int );
-void* mwCalloc_( size_t, size_t );
-void  mwFree( void*, const char*, int );
-void  mwFree_( void* );
-char* mwStrdup( const char *, const char*, int );
-
-/*
-** Enable/disable precompiler block
-**  This block of defines and if(n)defs make sure that references
-**  to MEMWATCH is completely removed from the code if the MEMWATCH
-**  manifest constant is not defined.
-*/
-#ifndef __MEMWATCH_C
-#ifdef MEMWATCH
-
-#define mwASSERT(exp)   while(mwAssert((int)(exp),#exp,__FILE__,__LINE__))
-#ifndef MW_NOASSERT
-#ifndef ASSERT
-#define ASSERT          mwASSERT
-#endif /* !ASSERT */
-#endif /* !MW_NOASSERT */
-#define mwVERIFY(exp)   while(mwVerify((int)(exp),#exp,__FILE__,__LINE__))
-#ifndef MW_NOVERIFY
-#ifndef VERIFY
-#define VERIFY          mwVERIFY
-#endif /* !VERIFY */
-#endif /* !MW_NOVERIFY */
-#define mwTRACE         mwTrace
-#ifndef MW_NOTRACE
-#ifndef TRACE
-#define TRACE           mwTRACE
-#endif /* !TRACE */
-#endif /* !MW_NOTRACE */
-
-/* some compilers use a define and not a function */
-/* for strdup(). */
-#ifdef strdup
-#undef strdup
-#endif
-
-#define malloc(n)       mwMalloc(n,__FILE__,__LINE__)
-#define strdup(p)       mwStrdup(p,__FILE__,__LINE__)
-#define realloc(p,n)    mwRealloc(p,n,__FILE__,__LINE__)
-#define calloc(n,m)     mwCalloc(n,m,__FILE__,__LINE__)
-#define free(p)         mwFree(p,__FILE__,__LINE__)
-#define CHECK()         mwTest(__FILE__,__LINE__,MW_TEST_ALL)
-#define CHECK_THIS(n)   mwTest(__FILE__,__LINE__,n)
-#define CHECK_BUFFER(b) mwTestBuffer(__FILE__,__LINE__,b)
-#define MARK(p)         mwMark(p,#p,__FILE__,__LINE__)
-#define UNMARK(p)       mwUnmark(p,__FILE__,__LINE__)
-
-#else /* MEMWATCH */
-
-#define mwASSERT(exp)
-#ifndef MW_NOASSERT
-#ifndef ASSERT
-#define ASSERT          mwASSERT
-#endif /* !ASSERT */
-#endif /* !MW_NOASSERT */
-
-#define mwVERIFY(exp)    exp
-#ifndef MW_NOVERIFY
-#ifndef VERIFY
-#define VERIFY          mwVERIFY
-#endif /* !VERIFY */
-#endif /* !MW_NOVERIFY */
-
-/*lint -esym(773,mwTRACE) */
-#define mwTRACE         /*lint -save -e506 */ 1?(void)0:mwDummyTraceFunction /*lint -restore */
-#ifndef MW_NOTRACE
-#ifndef TRACE
-/*lint -esym(773,TRACE) */
-#define TRACE           mwTRACE
-#endif /* !TRACE */
-#endif /* !MW_NOTRACE */
-
-extern void mwDummyTraceFunction(const char *,...);
-/*lint -save -e652 */
-#define mwDoFlush(n)
-#define mwPuts(s)
-#define mwInit()
-#define mwGrab(n)
-#define mwDrop(n)
-#define mwLimit(n)
-#define mwTest(f,l)
-#define mwSetOutFunc(f)
-#define mwSetAriFunc(f)
-#define mwDefaultAri()
-#define mwNomansland()
-#define mwStatistics(f)
-#define mwMark(p,t,f,n)     (p)
-#define mwUnmark(p,f,n)     (p)
-#define mwMalloc(n,f,l)     malloc(n)
-#define mwStrdup(p,f,l)     strdup(p)
-#define mwRealloc(p,n,f,l)  realloc(p,n)
-#define mwCalloc(n,m,f,l)   calloc(n,m)
-#define mwFree(p)           free(p)
-#define mwMalloc_(n)        malloc(n)
-#define mwRealloc_(p,n)     realloc(p,n)
-#define mwCalloc_(n,m)      calloc(n,m)
-#define mwFree_(p)          free(p)
-#define mwAssert(e,es,f,l)
-#define mwVerify(e,es,f,l)  (e)
-#define mwTrace             mwDummyTrace
-#define mwTestBuffer(f,l,b) (0)
-#define CHECK()
-#define CHECK_THIS(n)
-#define CHECK_BUFFER(b)
-#define MARK(p)             (p)
-#define UNMARK(p)           (p)
-/*lint -restore */
-
-#endif /* MEMWATCH */
-#endif /* !__MEMWATCH_C */
-
-#ifdef __cplusplus
-    }
-#endif
-
-#if 0 /* 980317: disabled C++ */
-
-/*
-** C++ support section
-**  Implements the C++ support. Please note that in order to avoid
-**  messing up library classes, C++ support is disabled by default.
-**  You must NOT enable it until AFTER the inclusion of all header
-**  files belonging to code that are not compiled with MEMWATCH, and
-**  possibly for some that are! The reason for this is that a C++
-**  class may implement it's own new() function, and the preprocessor
-**  would substitute this crucial declaration for MEMWATCH new().
-**  You can forcibly deny C++ support by defining MEMWATCH_NOCPP.
-**  To enble C++ support, you must be compiling C++, MEMWATCH must
-**  be defined, MEMWATCH_NOCPP must not be defined, and finally,
-**  you must define 'new' to be 'mwNew', and 'delete' to be 'mwDelete'.
-**  Unlike C, C++ code can begin executing *way* before main(), for
-**  example if a global variable is created. For this reason, you can
-**  declare a global variable of the class 'MemWatch'. If this is
-**  is the first variable created, it will then check ALL C++ allocations
-**  and deallocations. Unfortunately, this evaluation order is not
-**  guaranteed by C++, though the compilers I've tried evaluates them
-**  in the order encountered.
-*/
-#ifdef __cplusplus
-#ifndef __MEMWATCH_C
-#ifdef MEMWATCH
-#ifndef MEMWATCH_NOCPP
-extern int mwNCur;
-extern const char *mwNFile;
-extern int mwNLine;
-class MemWatch {
-public:
-    MemWatch();
-    ~MemWatch();
-    };
-void * operator new(size_t);
-void * operator new(size_t,const char *,int);
-void * operator new[] (size_t,const char *,int);	// hjc 07/16/02
-void operator delete(void *);
-#define mwNew new(__FILE__,__LINE__)
-#define mwDelete (mwNCur=1,mwNFile=__FILE__,mwNLine=__LINE__),delete
-#endif /* MEMWATCH_NOCPP */
-#endif /* MEMWATCH */
-#endif /* !__MEMWATCH_C */
-#endif /* __cplusplus */
-
-#endif /* 980317: disabled C++ */
-
-#endif /* __MEMWATCH_H */
-
-/* EOF MEMWATCH.H */
diff --git a/test/am_ca_key_test/inject_record_t5d/include/ndk/include/amsmc.h b/test/am_ca_key_test/inject_record_t5d/include/ndk/include/amsmc.h
deleted file mode 100644
index 85bfcea..0000000
--- a/test/am_ca_key_test/inject_record_t5d/include/ndk/include/amsmc.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * AMLOGIC Smart card driver.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the named License,
- * or any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
- */
-
-#ifndef _AMSMC_H
-#define _AMSMC_H
-
-#include <asm/types.h>
-
-#define AMSMC_MAX_ATR_LEN    33
-
-enum {
-	AMSMC_CARDOUT = 0,
-	AMSMC_CARDIN = 1
-};
-
-struct am_smc_atr {
-	char    atr[AMSMC_MAX_ATR_LEN];
-	int     atr_len;
-};
-
-struct am_smc_param {
-	int     f;
-	int     d;
-	int     n;
-	int     bwi;
-	int     cwi;
-	int     bgt;
-	int     freq;
-	int     recv_invert;
-	int     recv_lsb_msb;
-	int     recv_no_parity;
-	int     recv_parity;
-	int     xmit_invert;
-	int     xmit_lsb_msb;
-	int     xmit_retries;
-	int     xmit_repeat_dis;
-	int     xmit_parity;
-};
-
-#define AMSMC_IOC_MAGIC  'C'
-
-#define AMSMC_IOC_RESET        _IOR(AMSMC_IOC_MAGIC, 0x00, struct am_smc_atr)
-#define AMSMC_IOC_GET_STATUS   _IOR(AMSMC_IOC_MAGIC, 0x01, int)
-#define AMSMC_IOC_ACTIVE       _IO(AMSMC_IOC_MAGIC, 0x02)
-#define AMSMC_IOC_DEACTIVE     _IO(AMSMC_IOC_MAGIC, 0x03)
-#define AMSMC_IOC_GET_PARAM    _IOR(AMSMC_IOC_MAGIC, 0x04, struct am_smc_param)
-#define AMSMC_IOC_SET_PARAM    _IOW(AMSMC_IOC_MAGIC, 0x05, struct am_smc_param)
-
-#endif
-
diff --git a/test/am_ca_key_test/inject_record_t5d/include/ndk/include/linux/amports/amstream.h b/test/am_ca_key_test/inject_record_t5d/include/ndk/include/linux/amports/amstream.h
index d607224..02cd9f0 100644
--- a/test/am_ca_key_test/inject_record_t5d/include/ndk/include/linux/amports/amstream.h
+++ b/test/am_ca_key_test/inject_record_t5d/include/ndk/include/linux/amports/amstream.h
@@ -510,7 +510,7 @@
 
 struct userdata_meta_info_t {
 	uint32_t poc_number;
-	/************ flags bit defination ***********/
+	/************ flags bit definition ***********/
 	/*
 	 * bit 0:		//used for mpeg2
 	 *	1, group start
@@ -549,7 +549,7 @@
 	uint32_t flags;
 	uint32_t vpts;			/*video frame pts*/
 	/*
-	 * 0: pts is invalid, please use duration to calcuate
+	 * 0: pts is invalid, please use duration to calculate
 	 * 1: pts is valid
 	 */
 	uint32_t vpts_valid;
@@ -831,7 +831,7 @@
 };
 
 struct av_info_t {
-	/*auido info*/
+	/*audio info*/
 	int sample_rate;
 	int channels;
 	int aformat_type;
diff --git a/test/am_ca_key_test/inject_record_t5d/include/ndk/include/linux/amports/jpegdec.h b/test/am_ca_key_test/inject_record_t5d/include/ndk/include/linux/amports/jpegdec.h
deleted file mode 100644
index 7387d9f..0000000
--- a/test/am_ca_key_test/inject_record_t5d/include/ndk/include/linux/amports/jpegdec.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*

- * AMLOGIC HW Jpeg decoder driver.

- *

- * This program is free software; you can redistribute it and/or modify

- * it under the terms of the GNU General Public License as published by

- * the Free Software Foundation; either version 2 of the named License,

- * or any later version.

- *

- * This program is distributed in the hope that it will be useful,

- * but WITHOUT ANY WARRANTY; without even the implied warranty of

- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

- * GNU General Public License for more details.

- *

- * You should have received a copy of the GNU General Public License

- * along with this program; if not, write to the Free Software

- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA

- *

- * Author:  Tim Yao <timyao@amlogic.com>

- *

- */

-

-#ifndef JPEGDEC_H

-#define JPEGDEC_H

-

-#define JPEGDEC_IOC_MAGIC  'J'

-

-#define JPEGDEC_IOC_INFOCONFIG	_IOW(JPEGDEC_IOC_MAGIC, 0x00, unsigned int)

-#define JPEGDEC_IOC_DECCONFIG	_IOW(JPEGDEC_IOC_MAGIC, 0x01, unsigned int)

-#define JPEGDEC_IOC_INFO		_IOW(JPEGDEC_IOC_MAGIC, 0x02, unsigned int)

-#define JPEGDEC_IOC_STAT		_IOW(JPEGDEC_IOC_MAGIC, 0x03, unsigned int)

-#define JPEGDEC_G_MEM_INFO		_IOW(JPEGDEC_IOC_MAGIC, 0x04, unsigned int)

-

-#define JPEGDEC_OPT_THUMBNAIL_ONLY		0x01

-#define JPEGDEC_OPT_THUMBNAIL_PREFERED	0x02

-#define JPEGDEC_OPT_FULLRANGE			0x04

-#define JPEGDEC_OPT_SRC_CROP			0x08

-

-#define JPEGINFO_TYPE_PROGRESSIVE		0x01

-#define JPEGINFO_TYPE_MULTISCAN			0x02

-#define JPEGINFO_TYPE_GRAYSCALE			0x04

-

-#define JPEGDEC_STAT_WAIT_DATA			0x01

-#define JPEGDEC_STAT_WAIT_INFOCONFIG	0x02

-#define JPEGDEC_STAT_WAIT_DECCONFIG		0x04

-#define JPEGDEC_STAT_ERROR				0x08

-#define JPEGDEC_STAT_UNSUPPORT			0x10

-#define JPEGDEC_STAT_INFO_READY			0x20

-#define JPEGDEC_STAT_DONE				0x40

-

-typedef enum {

-	CLKWISE_0    = 0,

-	CLKWISE_90   = 1,

-	CLKWISE_180  = 2,

-	CLKWISE_270  = 3,

-} jpegdec_angle_t;

-

-typedef struct {

-	unsigned long	addr_y;

-	unsigned long	addr_u;

-	unsigned long	addr_v;

-	unsigned 		canvas_width;

-

-	unsigned		opt;

-

-	unsigned		src_crop_x;

-	unsigned		src_crop_y;

-	unsigned		src_crop_w;

-	unsigned		src_crop_h;

-	

-	unsigned		dec_x;

-	unsigned		dec_y;

-	unsigned		dec_w;

-	unsigned		dec_h;	

-	jpegdec_angle_t	angle;

-} jpegdec_config_t;

-

-typedef struct {

-	unsigned width;

-	unsigned height;

-	unsigned comp_num;

-	unsigned type;

-} jpegdec_info_t;

-

-typedef struct {

-	jpegdec_angle_t	angle;

-	unsigned	dec_w;

-	unsigned	dec_h;

-	unsigned canv_addr;

-	unsigned canv_len;

-}  jpegdec_mem_info_t;

-

-#endif /* JPEGDEC_H */

-

diff --git a/test/am_ca_key_test/inject_record_t5d/include/ndk/include/linux/amports/tsync.h b/test/am_ca_key_test/inject_record_t5d/include/ndk/include/linux/amports/tsync.h
index f8e341a..69b634d 100644
--- a/test/am_ca_key_test/inject_record_t5d/include/ndk/include/linux/amports/tsync.h
+++ b/test/am_ca_key_test/inject_record_t5d/include/ndk/include/linux/amports/tsync.h
@@ -24,7 +24,7 @@
 
 #define TIME_UNIT90K    (90000)
 #define VIDEO_HOLD_THRESHOLD        (TIME_UNIT90K * 3)
-#define AV_DISCONTINUE_THREDHOLD    (TIME_UNIT90K * 30)
+#define AV_DISCONTINUE_THRESHOLD    (TIME_UNIT90K * 30)
 
 typedef enum {
     VIDEO_START,
@@ -70,7 +70,7 @@
 
 static inline u32 tsync_vpts_discontinuity_margin(void)
 {
-    return AV_DISCONTINUE_THREDHOLD;
+    return AV_DISCONTINUE_THRESHOLD;
 }
 extern int register_tync_func(enum tysnc_func_type_e ntype, void *pfunc);
 
diff --git a/test/am_ca_key_test/inject_record_t5d/include/ndk/include/linux/dvb/aml_demod.h b/test/am_ca_key_test/inject_record_t5d/include/ndk/include/linux/dvb/aml_demod.h
deleted file mode 100644
index 673a716..0000000
--- a/test/am_ca_key_test/inject_record_t5d/include/ndk/include/linux/dvb/aml_demod.h
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
-* Copyright (c) 2014 Amlogic, Inc. All rights reserved.
-*
-* This source code is subject to the terms and conditions defined in the
-* file 'LICENSE' which is part of this source code package. *
-* Description:
-*/
-#ifndef AML_DEMOD_H
-#define AML_DEMOD_H
-#ifndef CONFIG_AM_DEMOD_FPGA_VER
-#define CONFIG_AM_DEMOD_FPGA_VER
-#endif				/*CONFIG_AM_DEMOD_FPGA_VER */
-
-/*#include <linux/types.h>*/
-#define u8_t u8
-#define u16_t u16
-#define u32_t u32
-#define u64_t u64
-
-struct aml_demod_i2c {
-	u8_t tuner;		/*type */
-	u8_t addr;		/*slave addr */
-	u32_t scl_oe;
-	u32_t scl_out;
-	u32_t scl_in;
-	u8_t scl_bit;
-	u32_t sda_oe;
-	u32_t sda_out;
-	u32_t sda_in;
-	u8_t sda_bit;
-	u8_t udelay;		/*us */
-	u8_t retries;
-	u8_t debug;		/*1:debug */
-	u8_t tmp;		/*spare */
-	u8_t i2c_id;
-	void *i2c_priv;
-};
-
-struct aml_tuner_sys {
-	u8_t mode;
-	u8_t amp;
-	u8_t if_agc_speed;
-	u32_t ch_freq;
-	u32_t if_freq;
-	u32_t rssi;
-	u32_t delay;
-	u8_t bandwith;
-};
-
-struct aml_demod_sys {
-	u8_t clk_en;		/* 1:on */
-	u8_t clk_src;		/*2 bits */
-	u8_t clk_div;		/*7 bits */
-	u8_t pll_n;		/*5 bits */
-	u16_t pll_m;		/*9 bits */
-	u8_t pll_od;		/*7 bits */
-	u8_t pll_sys_xd;	/*5 bits */
-	u8_t pll_adc_xd;	/*5 bits */
-	u8_t agc_sel;		/*pin mux */
-	u8_t adc_en;		/*1:on */
-	u8_t debug;		/*1:debug */
-	u32_t i2c;		/*pointer */
-	u32_t adc_clk;
-	u32_t demod_clk;
-};
-
-struct aml_demod_sts {
-	u32_t ch_sts;
-	u32_t freq_off;		/*Hz */
-	u32_t ch_pow;
-	u32_t ch_snr;
-	u32_t ch_ber;
-	u32_t ch_per;
-	u32_t symb_rate;
-	u32_t dat0;
-	u32_t dat1;
-};
-
-struct aml_demod_sta {
-	u8_t clk_en;		/*on/off */
-	u8_t adc_en;		/*on/off */
-	u32_t clk_freq;		/*kHz */
-	u32_t adc_freq;		/*kHz */
-	u8_t dvb_mode;		/*dvb-t/c mode */
-	u8_t ch_mode;		/* 16,32,..,256QAM or 2K,4K,8K */
-	u8_t agc_mode;		/*if, rf or both. */
-	u8_t tuner;		/*type */
-	u32_t ch_freq;		/*kHz */
-	u16_t ch_if;		/*kHz */
-	u16_t ch_bw;		/*kHz */
-	u16_t symb_rate;	/*kHz */
-	u8_t debug;
-	u8_t tmp;
-	u32_t sts;		/*pointer */
-	u8_t spectrum;
-};
-
-struct aml_demod_dvbc {
-	u8_t mode;
-	u8_t tmp;
-	u16_t symb_rate;
-	u32_t ch_freq;
-	u32_t dat0;
-	u32_t dat1;
-};
-
-struct aml_demod_dvbt {
-	u8_t bw;
-	u8_t sr;
-	u8_t ifreq;
-	u8_t agc_mode;
-	u32_t ch_freq;
-	u32_t dat0;
-	u32_t dat1;
-	u32_t layer;
-
-};
-
-struct aml_demod_dtmb {
-	u8_t bw;
-	u8_t sr;
-	u8_t ifreq;
-	u8_t agc_mode;
-	u32_t ch_freq;
-	u32_t dat0;
-	u32_t dat1;
-	u32_t mode;
-
-};
-
-struct aml_demod_atsc {
-	u8_t bw;
-	u8_t sr;
-	u8_t ifreq;
-	u8_t agc_mode;
-	u32_t ch_freq;
-	u32_t dat0;
-	u32_t dat1;
-	u32_t mode;
-
-};
-
-struct aml_demod_mem {
-	u32_t addr;
-	u32_t dat;
-
-};
-
-struct aml_cap_data {
-	u32_t cap_addr;
-	u32_t cap_size;
-	u32_t cap_afifo;
-	char  *cap_dev_name;
-};
-
-struct aml_demod_reg {
-	u8_t mode;
-	u8_t rw;		/* 0: read, 1: write. */
-	u32_t addr;
-	u32_t val;
-/*	u32_t val_high;*/
-};
-
-struct aml_demod_regs {
-	u8_t mode;
-	u8_t rw;		/* 0: read, 1: write. */
-	u32_t addr;
-	u32_t addr_len;
-	u32_t n;
-	u32_t vals[1];		/*[mode i2c]: write:n*u32_t, read:n*u8_t */
-};
-struct fpga_m1_sdio {
-	unsigned long addr;
-	unsigned long byte_count;
-	unsigned char *data_buf;
-};
-
-#define AML_DEMOD_SET_SYS        _IOW('D',  0, struct aml_demod_sys)
-#define AML_DEMOD_GET_SYS        _IOR('D',  1, struct aml_demod_sys)
-#define AML_DEMOD_TEST           _IOR('D',  2, u32_t)
-#define AML_DEMOD_TURN_ON        _IOR('D',  3, u32_t)
-#define AML_DEMOD_TURN_OFF       _IOR('D',  4, u32_t)
-#define AML_DEMOD_SET_TUNER      _IOW('D',  5, struct aml_tuner_sys)
-#define AML_DEMOD_GET_RSSI       _IOR('D',  6, struct aml_tuner_sys)
-
-#define AML_DEMOD_DVBC_SET_CH    _IOW('D', 10, struct aml_demod_dvbc)
-#define AML_DEMOD_DVBC_GET_CH    _IOR('D', 11, struct aml_demod_dvbc)
-#define AML_DEMOD_DVBC_TEST      _IOR('D', 12, u32_t)
-
-#define AML_DEMOD_DVBT_SET_CH    _IOW('D', 20, struct aml_demod_dvbt)
-#define AML_DEMOD_DVBT_GET_CH    _IOR('D', 21, struct aml_demod_dvbt)
-#define AML_DEMOD_DVBT_TEST      _IOR('D', 22, u32_t)
-
-#define AML_DEMOD_DTMB_SET_CH    _IOW('D', 50, struct aml_demod_dtmb)
-#define AML_DEMOD_DTMB_GET_CH    _IOR('D', 51, struct aml_demod_dtmb)
-#define AML_DEMOD_DTMB_TEST      _IOR('D', 52, u32_t)
-
-#define AML_DEMOD_ATSC_SET_CH    _IOW('D', 60, struct aml_demod_atsc)
-#define AML_DEMOD_ATSC_GET_CH    _IOR('D', 61, struct aml_demod_atsc)
-#define AML_DEMOD_ATSC_TEST      _IOR('D', 62, u32_t)
-#define AML_DEMOD_ATSC_IRQ       _IOR('D', 63, u32_t)
-
-#define AML_DEMOD_RESET_MEM		  _IOR('D', 70, u32_t)
-#define	AML_DEMOD_READ_MEM		  _IOR('D', 71, u32_t)
-#define AML_DEMOD_SET_MEM		  _IOR('D', 72, struct aml_demod_mem)
-
-#define AML_DEMOD_SET_REG        _IOW('D', 30, struct aml_demod_reg)
-#define AML_DEMOD_GET_REG        _IOR('D', 31, struct aml_demod_reg)
-/* #define AML_DEMOD_SET_REGS        _IOW('D', 32, struct aml_demod_regs)*/
-/*#define AML_DEMOD_GET_REGS        _IOR('D', 33, struct aml_demod_regs)*/
-#define FPGA2M1_SDIO_WR_DDR      _IOW('D', 40, struct fpga_m1_sdio)
-#define FPGA2M1_SDIO_RD_DDR      _IOR('D', 41, struct fpga_m1_sdio)
-#define FPGA2M1_SDIO_INIT        _IO('D', 42)
-#define FPGA2M1_SDIO_EXIT        _IO('D', 43)
-
-int read_memory_to_file(struct aml_cap_data *cap);
-int read_reg(int addr);
-void wait_capture(int cap_cur_addr, int depth_MB, int start);
-int cap_adc_data(struct aml_cap_data *cap);
-
-#endif				/* AML_DEMOD_H */
diff --git a/test/am_ca_key_test/inject_record_t5d/include/ndk/include/linux/dvb/frontend.h b/test/am_ca_key_test/inject_record_t5d/include/ndk/include/linux/dvb/frontend.h
index 96a954f..34d69a9 100644
--- a/test/am_ca_key_test/inject_record_t5d/include/ndk/include/linux/dvb/frontend.h
+++ b/test/am_ca_key_test/inject_record_t5d/include/ndk/include/linux/dvb/frontend.h
@@ -660,7 +660,7 @@
 		struct dvb_ofdm_parameters ofdm;	/* DVB-T */
 		struct dvb_vsb_parameters vsb;		/* ATSC */
 		struct dvb_analog_parameters analog;
-		/* Add extenstion data here */
+		/* Add extension data here */
 	} u;
 };
 
diff --git a/test/am_ca_key_test/inject_record_t5d/include/ndk/include/tvin_vbi.h b/test/am_ca_key_test/inject_record_t5d/include/ndk/include/tvin_vbi.h
deleted file mode 100644
index e9cd6cd..0000000
--- a/test/am_ca_key_test/inject_record_t5d/include/ndk/include/tvin_vbi.h
+++ /dev/null
@@ -1,238 +0,0 @@
-/*******************************************************************
-* Copyright (c) 2014 Amlogic, Inc. All rights reserved.
-*
-* This source code is subject to the terms and conditions defined in the
-* file 'LICENSE' which is part of this source code package.
-*
-*  File name: tvin_vbi.h
-*  Description: IO function, structure,
-enum, used in TVIN vbi sub-module processing
-*  VBI in M6TV IC only support CC format
-*******************************************************************/
-
-#ifndef TVIN_VBI_H_
-#define TVIN_VBI_H_
-
-#include <linux/types.h>
-
-/* *************************************************** */
-/* *** macro definitions ********************************************* */
-/* ****************************************************** */
-/* defines for vbi spec */
-/* vbi type id */
-#define VBI_ID_CC                  0
-#define VBI_ID_TT                  3
-#define VBI_ID_WSS625              4
-#define VBI_ID_WSSJ                5
-#define VBI_ID_VPS                 6
-#define MAX_PACKET_TYPE            VBI_ID_VPS
-
-/* vbi package data bytes */
-#define VBI_PCNT_USCC              2
-#define VBI_PCNT_WSS625            2
-#define VBI_PCNT_WSSJ              3
-#define VBI_PCNT_VPS               8
-
-/* teletext package data bytes */
-#define VBI_PCNT_TT_625A           37
-#define VBI_PCNT_TT_625B           42
-#define VBI_PCNT_TT_625C           33
-#define VBI_PCNT_TT_625D           34
-#define VBI_PCNT_TT_525B           34
-#define VBI_PCNT_TT_525C           33
-#define VBI_PCNT_TT_525D           34
-
-/* Teletext system type */
-#define VBI_SYS_TT_625A            0
-#define VBI_SYS_TT_625B            1
-#define VBI_SYS_TT_625C            2
-#define VBI_SYS_TT_625D            3
-#define VBI_SYS_TT_525B            5
-#define VBI_SYS_TT_525C            6
-#define VBI_SYS_TT_525D            7
-
-
-/* vbi data type setting */
-#define VBI_DATA_TYPE_NULL         0x00
-#define VBI_DATA_TYPE_USCC         0x11
-#define VBI_DATA_TYPE_EUROCC       0x22
-#define VBI_DATA_TYPE_VPS          0x33
-#define VBI_DATA_TYPE_TT_625A      0x55
-#define VBI_DATA_TYPE_TT_625B      0x66
-#define VBI_DATA_TYPE_TT_625C      0x77
-#define VBI_DATA_TYPE_TT_625D      0x88
-#define VBI_DATA_TYPE_TT_525B      0x99
-#define VBI_DATA_TYPE_TT_525C      0xaa
-#define VBI_DATA_TYPE_TT_525D      0xbb
-#define VBI_DATA_TYPE_WSS625       0xcc
-#define VBI_DATA_TYPE_WSSJ         0xdd
-
-/* vbi start line: unit is hcount value */
-#define VBI_START_CC		0x54
-#define VBI_START_WSS		0x54
-#define VBI_START_TT		0x82
-#define VBI_START_VPS		0x82
-
-
-/* vbi start code,TT start code is programmable by software,
-but our ic use the programmable value as reverse!!
-so wo should use the reverse value */
-#define VBI_START_CODE_USCC         0x01
-#define VBI_START_CODE_EUROCC       0x01
-#define VBI_START_CODE_VPS          0x8a99
-#define VBI_START_CODE_TT_625A      0xe7
-#define VBI_START_CODE_TT_625A_REVERSE      0xe7
-#define VBI_START_CODE_TT_625B      0xe4
-#define VBI_START_CODE_TT_625B_REVERSE      0x27
-#define VBI_START_CODE_TT_625C      0xe7
-#define VBI_START_CODE_TT_625C_REVERSE      0xe7
-#define VBI_START_CODE_TT_625D      0xe5
-#define VBI_START_CODE_TT_625D_REVERSE      0xa7
-#define VBI_START_CODE_TT_525B      0xe4
-#define VBI_START_CODE_TT_525B_REVERSE      0x27
-#define VBI_START_CODE_TT_525C      0xe7
-#define VBI_START_CODE_TT_525C_REVERSE      0xe7
-#define VBI_START_CODE_TT_525D      0xe5
-#define VBI_START_CODE_TT_525D_REVERSE      0xa7
-#define VBI_START_CODE_WSS625       0x1e3c1f
-#define VBI_START_CODE_WSSJ         0x02
-
-/*
-DTO calculation method:
-For WSSJ:
-DTO_Value = output_sampling_rate/(3.579545)*(2^11)
-For WSS625
-DTO_Value = output_sampling_rate*3/10 * (2^11)
-For CLOSE CAPTION
-DTO_Value = output_sampling_rate/(4*vbi_data_rate) * (2^11)
-Otherwise
-DTO_Value = input_sampling_rate/(2*vbi_data_rate) * (2^11)
-!!!Note: DTO_Value should be round!!!
-output_sampling_rate = 13.5M;
-input_sampling_rate= 24M;
-vbi_data_rate reference to vbi document.
-*/
-#define VBI_DTO_USCC		0x35a0
-#define VBI_DTO_EURCC		0x3600
-#define VBI_DTO_TT625A		0x0f7a
-#define VBI_DTO_TT625B		0x0dd6
-#define VBI_DTO_TT625C		0x10be
-#define VBI_DTO_TT625D		0x1103
-#define VBI_DTO_TT525B		0x10c3
-#define VBI_DTO_TT525C		0x10c3
-#define VBI_DTO_TT525D		0x10c3
-#define VBI_DTO_WSS625		0x2066
-#define VBI_DTO_WSSJ		0x1e2c
-#define VBI_DTO_VPS		0x1333
-
-
-#define VBI_LINE_MIN               6
-#define VBI_LINE_MAX               25
-
-enum vbi_package_type_e {
-	VBI_PACKAGE_CC1 = 1,
-	VBI_PACKAGE_CC2 = 2,
-	VBI_PACKAGE_CC3 = 4,
-	VBI_PACKAGE_CC4 = 8,
-	VBI_PACKAGE_TT1 = 16,
-	VBI_PACKAGE_TT2 = 32,
-	VBI_PACKAGE_TT3 = 64,
-	VBI_PACKAGE_TT4 = 128,
-	VBI_PACKAGE_XDS = 256
-};
-
-#define VBI_PACKAGE_FILTER_MAX     3
-
-#define VBI_IOC_MAGIC 'X'
-
-#define VBI_IOC_CC_EN              _IO(VBI_IOC_MAGIC, 0x01)
-#define VBI_IOC_CC_DISABLE         _IO(VBI_IOC_MAGIC, 0x02)
-#define VBI_IOC_SET_TYPE           _IOW(VBI_IOC_MAGIC, 0x03, int)
-#define VBI_IOC_S_BUF_SIZE         _IOW(VBI_IOC_MAGIC, 0x04, int)
-#define VBI_IOC_START              _IO(VBI_IOC_MAGIC, 0x05)
-#define VBI_IOC_STOP               _IO(VBI_IOC_MAGIC, 0x06)
-
-
-#define VBI_MEM_SIZE               0x80000
-/* 0x8000   // 32768 hw address with 8bit not 64bit */
-/* #define VBI_SLICED_MAX            64
-// 32768 hw address with 8bit not 64bit */
-/* before m6tvd vbi_write_burst_byte = 8;
-*  after g9tv vbi_write_burst_byte = 16*/
-#define VBI_WRITE_BURST_BYTE        16
-
-/* debug defines */
-#define VBI_CC_SUPPORT
-#define VBI_TT_SUPPORT
-#define VBI_WSS_SUPPORT
-#define VBI_VPS_SUPPORT
-
-#define VBI_DATA_TYPE_LEN          16
-#define VBI_DATA_TYPE_MASK         0xf0000
-
-#define VBI_PAC_TYPE_LEN           0
-#define VBI_PAC_TYPE_MASK          0x0ffff
-
-#define VBI_PAC_CC_FIELD_LEN       4
-#define VBI_PAC_CC_FIELD_MASK      0xf0
-#define VBI_PAC_CC_FIELD1          0
-#define VBI_PAC_CC_FIELD2          1
-
-/* vbi_slicer type */
-enum vbi_slicer_e {
-	VBI_TYPE_NULL = 0,
-	VBI_TYPE_USCC = 0x00001,
-	VBI_TYPE_EUROCC = 0x00020,
-	VBI_TYPE_VPS = 0x00040,
-	/* Germany, Austria and Switzerland. */
-	VBI_TYPE_TT_625A = 0x00080,
-	VBI_TYPE_TT_625B  = 0x00100,
-	VBI_TYPE_TT_625C = 0x00200,
-	VBI_TYPE_TT_625D  = 0x00400,
-	VBI_TYPE_TT_525B  = 0x00800,
-	VBI_TYPE_TT_525C = 0x01000,
-	VBI_TYPE_TT_525D  = 0x02000,
-	VBI_TYPE_WSS625 = 0x04000,
-	VBI_TYPE_WSSJ = 0x08000
-};
-
-#define VBI_DEFAULT_BUFFER_SIZE 8192 /*set default buffer size--8KByte*/
-#define VBI_DEFAULT_BUFFER_PACKEGE_NUM 100 /* default buffer size */
-
-/* ********************
-********************* */
-/* *** enum definitions ********************************************* */
-/* ****************************
-***************** */
-
-enum field_id_e {
-	VBI_FIELD_1 = 0,
-	VBI_FIELD_2 = 1,
-};
-
-enum vbi_state_e {
-	VBI_STATE_FREE      = 0,
-	VBI_STATE_ALLOCATED = 1,
-	VBI_STATE_SET       = 2,
-	VBI_STATE_GO        = 3,
-	VBI_STATE_DONE      = 4,
-	VBI_STATE_TIMEDOUT  = 5
-} vbi_state_t;
-
-/* ********************
-************************** */
-/* *** structure definitions *************
-******* */
-/* *******************************
-***************** */
-
-struct vbi_data_s {
-	unsigned int vbi_type:8;
-	unsigned int field_id:8;
-	unsigned int tt_sys:8;/*tt*/
-	unsigned int nbytes:16;
-	unsigned int line_num:16;
-	unsigned char b[42];         /* 42 for TT-625B */
-};
-
-#endif /* TVIN_VBI_H_ */