diff options
-rw-r--r-- | dce_rpc.h | 3 | ||||
-rw-r--r-- | libdce.c | 38 | ||||
-rw-r--r-- | libdce.h | 15 |
3 files changed, 55 insertions, 1 deletions
@@ -60,7 +60,8 @@ typedef enum dce_rpc_call { | |||
60 | DCE_RPC_CODEC_CONTROL, | 60 | DCE_RPC_CODEC_CONTROL, |
61 | DCE_RPC_CODEC_GET_VERSION, | 61 | DCE_RPC_CODEC_GET_VERSION, |
62 | DCE_RPC_CODEC_PROCESS, | 62 | DCE_RPC_CODEC_PROCESS, |
63 | DCE_RPC_CODEC_DELETE | 63 | DCE_RPC_CODEC_DELETE, |
64 | DCE_RPC_GET_INFO | ||
64 | } dce_rpc_call; | 65 | } dce_rpc_call; |
65 | 66 | ||
66 | //Enumeration for dce function callback | 67 | //Enumeration for dce function callback |
@@ -565,6 +565,44 @@ EXIT: | |||
565 | return; | 565 | return; |
566 | } | 566 | } |
567 | 567 | ||
568 | /*===============================================================*/ | ||
569 | /** get_rproc_info : Get Information from the Remote proc. | ||
570 | * | ||
571 | * @ param engine [in] : Engine Handle obtained in Engine_open() call. | ||
572 | * @ param info_type [in] : Information type as defined in the rproc_info_type | ||
573 | + */ | ||
574 | int32_t get_rproc_info(Engine_Handle engine, rproc_info_type info_type) | ||
575 | { | ||
576 | MmRpc_FxnCtx fxnCtx; | ||
577 | int32_t fxnRet; | ||
578 | dce_error_status eError = DCE_EOK; | ||
579 | int32_t coreIdx = INVALID_CORE; | ||
580 | int tableIdx = -1; | ||
581 | |||
582 | /*Acquire permission to use IPC*/ | ||
583 | pthread_mutex_lock(&ipc_mutex); | ||
584 | |||
585 | _ASSERT(engine != NULL, DCE_EINVALID_INPUT); | ||
586 | |||
587 | /* Marshall function arguments into the send buffer */ | ||
588 | Fill_MmRpc_fxnCtx(&fxnCtx, DCE_RPC_GET_INFO, 1, 0, NULL); | ||
589 | Fill_MmRpc_fxnCtx_Scalar_Params(&(fxnCtx.params[0]), sizeof(rproc_info_type), (int32_t)info_type); | ||
590 | |||
591 | coreIdx = getCoreIndexFromEngine(engine, &tableIdx); | ||
592 | _ASSERT(coreIdx != INVALID_CORE,DCE_EINVALID_INPUT); | ||
593 | |||
594 | /* Invoke the Remote function through MmRpc */ | ||
595 | eError = MmRpc_call(MmRpcHandle[coreIdx], &fxnCtx, &fxnRet); | ||
596 | _ASSERT(eError == DCE_EOK, DCE_EIPC_CALL_FAIL); | ||
597 | |||
598 | EXIT: | ||
599 | /*Relinquish IPC*/ | ||
600 | pthread_mutex_unlock(&ipc_mutex); | ||
601 | |||
602 | return fxnRet; | ||
603 | } | ||
604 | |||
605 | |||
568 | /*===============================================================*/ | 606 | /*===============================================================*/ |
569 | /** Functions create(), control(), get_version(), process(), delete() are common codec | 607 | /** Functions create(), control(), get_version(), process(), delete() are common codec |
570 | * glue function signatures which are same for both encoder and decoder | 608 | * glue function signatures which are same for both encoder and decoder |
@@ -58,6 +58,13 @@ typedef enum dce_error_status { | |||
58 | DCE_EOMAPDRM_FAIL = -7 | 58 | DCE_EOMAPDRM_FAIL = -7 |
59 | } dce_error_status; | 59 | } dce_error_status; |
60 | 60 | ||
61 | |||
62 | typedef enum rproc_info_type { | ||
63 | RPROC_CPU_LOAD = 0, | ||
64 | RPROC_TOTAL_HEAP_SIZE = 1, | ||
65 | RPROC_AVAILABLE_HEAP_SIZE = 2 | ||
66 | } rproc_info_type; | ||
67 | |||
61 | /***************************** Memory Allocation/Free APIs *****************************/ | 68 | /***************************** Memory Allocation/Free APIs *****************************/ |
62 | /*=====================================================================================*/ | 69 | /*=====================================================================================*/ |
63 | /** dce_alloc : Allocate the Data structures passed to codec-engine APIs | 70 | /** dce_alloc : Allocate the Data structures passed to codec-engine APIs |
@@ -183,5 +190,13 @@ int dce_get_fd(); | |||
183 | void dce_set_fd(int fd); | 190 | void dce_set_fd(int fd); |
184 | 191 | ||
185 | 192 | ||
193 | /*===============================================================*/ | ||
194 | /** get_rproc_info : Get Information from the Remote proc. | ||
195 | * | ||
196 | * @ param engine [in] : Engine Handle obtained in Engine_open() call. | ||
197 | * @ param info_type [in] : Information type as defined in the rproc_info_type | ||
198 | + */ | ||
199 | int32_t get_rproc_info(Engine_Handle engine, rproc_info_type info_type); | ||
200 | |||
186 | #endif /* __LIBDCE_H__ */ | 201 | #endif /* __LIBDCE_H__ */ |
187 | 202 | ||