author | ke.gong <ke.gong@amlogic.com> | 2013-04-25 04:39:27 (GMT) |
---|---|---|
committer | ke.gong <ke.gong@amlogic.com> | 2013-04-25 04:39:27 (GMT) |
commit | 5bc99b22ab0191ed156c24b798ce4ddccdc7509f (patch) | |
tree | 79d971f93bce0a24a59168f70418e340d8962e70 | |
parent | b380423d9618e0c0a91e164e2ac5d57714b8c149 (diff) | |
parent | 1f1ca83351f33ae8033c78b0e9af508653d2fb15 (diff) | |
download | libzvbi-5bc99b22ab0191ed156c24b798ce4ddccdc7509f.zip libzvbi-5bc99b22ab0191ed156c24b798ce4ddccdc7509f.tar.gz libzvbi-5bc99b22ab0191ed156c24b798ce4ddccdc7509f.tar.bz2 |
Merge branch 'ics-amlogic' of git://10.68.11.59/platform/external/libzvbi into HEAD
-rwxr-xr-x | ntsc_decode/am_vbi.c | 43 | ||||
-rwxr-xr-x | ntsc_decode/include/am_vbi.h | 7 | ||||
-rwxr-xr-x | ntsc_decode/include/am_xds.h | 4 |
3 files changed, 51 insertions, 3 deletions
diff --git a/ntsc_decode/am_vbi.c b/ntsc_decode/am_vbi.c index ec6380c..257b172 100755 --- a/ntsc_decode/am_vbi.c +++ b/ntsc_decode/am_vbi.c @@ -13,7 +13,7 @@ #include "sliced_vbi.h" #include "am_vbi.h" #include "vbi_dmx.h" -#include "am_xds.h" + /********************define variable***************************/ @@ -395,6 +395,47 @@ vbi_bool AM_VBI_CC_Create(AM_VBI_Handle_t *handle, AM_VBI_CC_Para_t *para) return AM_SUCCESS; } + + + + +/********************************************************/ +AM_ErrorCode_t AM_VBI_CC_Stop(AM_VBI_Handle_t handle) +{ + AM_DEBUG("NTSC-------------------- ******************AM_VBI_CC_Stop \n"); + AM_VBI_Parser_t *parser = (AM_VBI_Parser_t*)handle; + vbi_bool ret = AM_SUCCESS; + + pthread_t th; + vbi_bool wait = AM_FALSE; + + if(!parser) + { + AM_DEBUG("NTSC-------------------- ******************AM_CC_ERR_INVALID_HANDLE \n"); + return AM_CC_ERR_INVALID_HANDLE; + } + + pthread_mutex_lock(&parser->lock); + + if(parser->running) + { + parser->running = AM_FALSE; + wait = AM_TRUE; + th = parser->thread; + } + + pthread_mutex_unlock(&parser->lock); + pthread_cond_signal(&parser->cond); + + if(wait) + { + pthread_join(th, NULL); + } + + return AM_SUCCESS; +} + + void* AM_VBI_CC_GetUserData(AM_VBI_Handle_t handle) { AM_VBI_Parser_t *parser = (AM_VBI_Parser_t*)handle; diff --git a/ntsc_decode/include/am_vbi.h b/ntsc_decode/include/am_vbi.h index 427a24d..7b19f62 100755 --- a/ntsc_decode/include/am_vbi.h +++ b/ntsc_decode/include/am_vbi.h @@ -23,7 +23,8 @@ #include "tables.h" #include "vbi.h" #include <android/log.h> -#include <am_xds.h> +#include <am_xds.h> +#include "vbi_dmx.h" #ifdef __cplusplus extern "C" { @@ -95,7 +96,9 @@ typedef enum { extern vbi_bool AM_VBI_CC_Create(AM_VBI_Handle_t *handle, AM_VBI_CC_Para_t *para); -extern vbi_bool AM_VBI_CC_Start(AM_VBI_Handle_t handle); +extern AM_ErrorCode_t AM_VBI_CC_Start(AM_VBI_Handle_t handle); + +extern AM_ErrorCode_t AM_VBI_CC_Stop(AM_VBI_Handle_t handle); extern vbi_bool decode_vbi (int dev_no, int fid, const uint8_t *data, int len, void *user_data); diff --git a/ntsc_decode/include/am_xds.h b/ntsc_decode/include/am_xds.h index c3358e7..16600a8 100755 --- a/ntsc_decode/include/am_xds.h +++ b/ntsc_decode/include/am_xds.h @@ -49,4 +49,8 @@ typedef enum { +#ifdef __cplusplus +} +#endif + #endif |