Minor graph updates in FVID2
[keystone-rtos/fvid2.git] / include / fvid2_drvMgr.h
index 90a62ea6fdbdc3c1c3b9311353696711120e5639..0bf2cc86cd556ed1c43cdc3771b09d3676e3b795 100644 (file)
@@ -1,5 +1,5 @@
-/* =============================================================================
- *   Copyright (c) Texas Instruments Incorporated 2012-2018
+/*
+ *  Copyright (c) Texas Instruments Incorporated 2018
  *
  *  Redistribution and use in source and binary forms, with or without
  *  modification, are permitted provided that the following conditions
@@ -48,9 +48,7 @@
 /*                             Include Files                                  */
 /* ========================================================================== */
 
-#include <fvid2.h>
-/* This is needed for memset/memcpy */
-#include <string.h>
+#include <ti/drv/fvid2/include/fvid2_api.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -61,18 +59,16 @@ extern "C" {
 /* ========================================================================== */
 
 /** \brief Number of driver object to allocate in FVID2 library. */
-#define FVID2_CFG_FDM_NUM_DRV_OBJS          (40U)
+#define FVID2_CFG_FDM_NUM_DRV_OBJS      (40U)
 
 /** \brief Number of channel object to allocate in FVID2 library. */
-#define FVID2_CFG_FDM_NUM_CH_OBJS           (80U)
-
-
+#define FVID2_CFG_FDM_NUM_CH_OBJS       (80U)
 
 /** \brief FVID2 driver handle returned by individual drivers. */
-typedef Ptr Fdrv_Handle;
+typedef void *Fdrv_Handle;
 
 /** \brief Typedef for callback function parameters. */
-typedef struct Fvid2_DrvCbParams_t Fvid2_DrvCbParams;
+typedef struct Fvid2_DrvCbParams_t      Fvid2_DrvCbParams;
 
 /**
  *  \brief Typedef for FVID2 driver callback function prototype. This will be
@@ -81,10 +77,8 @@ typedef struct Fvid2_DrvCbParams_t Fvid2_DrvCbParams;
  *
  *  fdmData: FVID2 driver manager internal data passed to driver during create
  *  call.
- *
- *  reserved: For future use. Not used currently. This will be set to NULL.
  */
-typedef Int32 (*Fdm_CbFxn)(Ptr fdmData, Ptr reserved);
+typedef int32_t (*Fdm_CbFxn)(void *fdmData);
 
 /**
  *  \brief Typedef for FVID2 driver error callback function prototype.
@@ -96,48 +90,46 @@ typedef Int32 (*Fdm_CbFxn)(Ptr fdmData, Ptr reserved);
  *
  *  errList: Error data passed to the application.
  *
- *  reserved: For future use. Not used currently. This will be set to NULL.
  */
-typedef Int32 (*Fdm_ErrCbFxn)(Ptr fdmData, void *errList, Ptr reserved);
+typedef int32_t (*Fdm_ErrCbFxn)(void *fdmData, void *errList);
 
 /** \brief Typedef for FVID2 create function pointer. */
-typedef Fdrv_Handle (*Fvid2_DrvCreate)(UInt32                   drvId,
-                                       UInt32                   instanceId,
-                                       Ptr                      createArgs,
-                                       Ptr
-                                       createStatusArgs,
+typedef Fdrv_Handle (*Fvid2_DrvCreate)(uint32_t      drvId,
+                                       uint32_t      instanceId,
+                                       void        *createArgs,
+                                       void        *createStatusArgs,
                                        const Fvid2_DrvCbParams *fdmCbParams);
 
 /** \brief Typedef for FVID2 delete function pointer. */
-typedef Int32 (*Fvid2_DrvDelete)(Fdrv_Handle handle, Ptr deleteArgs);
+typedef int32_t (*Fvid2_DrvDelete)(Fdrv_Handle handle, void *deleteArgs);
 
 /** \brief Typedef for FVID2 control function pointer. */
-typedef Int32 (*Fvid2_DrvControl)(Fdrv_Handle handle,
-                                  UInt32      cmd,
-                                  Ptr         cmdArgs,
-                                  Ptr         cmdStatusArgs);
+typedef int32_t (*Fvid2_DrvControl)(Fdrv_Handle handle,
+                                    uint32_t    cmd,
+                                    void       *cmdArgs,
+                                    void       *cmdStatusArgs);
 
 /** \brief Typedef for FVID2 queue function pointer. */
-typedef Int32 (*Fvid2_DrvQueue)(Fdrv_Handle      handle,
-                                Fvid2_FrameList *frameList,
-                                UInt32           streamId);
+typedef int32_t (*Fvid2_DrvQueue)(Fdrv_Handle       handle,
+                                  Fvid2_FrameList  *frameList,
+                                  uint32_t          streamId);
 
 /** \brief Typedef for FVID2 dequeue function pointer. */
-typedef Int32 (*Fvid2_DrvDequeue)(Fdrv_Handle      handle,
-                                  Fvid2_FrameList *frameList,
-                                  UInt32           streamId,
-                                  UInt32           timeout);
+typedef int32_t (*Fvid2_DrvDequeue)(Fdrv_Handle     handle,
+                                    Fvid2_FrameList *frameList,
+                                    uint32_t        streamId,
+                                    uint32_t        timeout);
 
 /** \brief Typedef for FVID2 process frames function pointer. */
-typedef Int32 (*Fvid2_DrvProcessRequest)(Fdrv_Handle        handle,
-                                         Fvid2_FrameList   *inProcessList,
-                                         Fvid2_FrameList   *outProcessList);
+typedef int32_t (*Fvid2_DrvProcessRequest)(Fdrv_Handle      handle,
+                                           Fvid2_FrameList *inProcessList,
+                                           Fvid2_FrameList *outProcessList);
 
 /** \brief Typedef for FVID2 get processed frames function pointer. */
-typedef Int32 (*Fvid2_DrvGetProcessedRequest)(Fdrv_Handle        handle,
-                                              Fvid2_FrameList   *inProcessList,
-                                              Fvid2_FrameList   *outProcessList,
-                                              UInt32             timeout);
+typedef int32_t (*Fvid2_DrvGetProcessedRequest)(Fdrv_Handle     handle,
+                                                Fvid2_FrameList *inProcessList,
+                                                Fvid2_FrameList *outProcessList,
+                                                uint32_t        timeout);
 
 
 /* ========================================================================== */
@@ -163,11 +155,9 @@ struct Fvid2_DrvCbParams_t
     void        *errList;
     /**< Pointer to a valid framelist or processlist where the driver
      *   copies the aborted/error packet. */
-    Ptr          fdmData;
+    void        *fdmData;
     /**< FDM specific data which is returned in the callback function
      *   as it is. */
-    Ptr          reserved;
-    /**< For future use. Not used currently. Set this to NULL. */
 };
 
 /**
@@ -176,7 +166,7 @@ struct Fvid2_DrvCbParams_t
  */
 typedef struct
 {
-    UInt32                      drvId;
+    uint32_t                    drvId;
     /**< Unique driver Id. */
     Fvid2_DrvCreate             createFxn;
     /**< FVID2 create function pointer. */
@@ -211,7 +201,7 @@ typedef struct
  *
  *  \return             Returns 0 on success else returns error value.
  */
-Int32 Fvid2_registerDriver(const Fvid2_DrvOps *drvOps);
+int32_t Fvid2_registerDriver(const Fvid2_DrvOps *drvOps);
 
 /**
  *  Fvid2_unRegisterDriver
@@ -224,7 +214,7 @@ Int32 Fvid2_registerDriver(const Fvid2_DrvOps *drvOps);
  *
  *  \return             Returns 0 on success else returns error value.
  */
-Int32 Fvid2_unRegisterDriver(const Fvid2_DrvOps *drvOps);
+int32_t Fvid2_unRegisterDriver(const Fvid2_DrvOps *drvOps);
 
 /**
  *  Fvid2_checkFrameList
@@ -238,7 +228,8 @@ Int32 Fvid2_unRegisterDriver(const Fvid2_DrvOps *drvOps);
  *
  *  \return             Returns 0 on success else returns error value.
  */
-Int32 Fvid2_checkFrameList(const Fvid2_FrameList *frameList, UInt32 maxFrames);
+int32_t Fvid2_checkFrameList(const Fvid2_FrameList *frameList,
+                             uint32_t maxFrames);
 
 /**
  *  Fvid2_checkDqFrameList
@@ -254,8 +245,8 @@ Int32 Fvid2_checkFrameList(const Fvid2_FrameList *frameList, UInt32 maxFrames);
  *
  *  \return             Returns 0 on success else returns error value.
  */
-Int32 Fvid2_checkDqFrameList(const Fvid2_FrameList *frameList,
-                             UInt32                 maxFrames);
+int32_t Fvid2_checkDqFrameList(const Fvid2_FrameList   *frameList,
+                               uint32_t                 maxFrames);
 
 /**
  *  Fvid2_copyFrameList