• <xmp id="om0om">
  • <table id="om0om"><noscript id="om0om"></noscript></table>
  • NVIDIA DRIVE OS Linux SDK API Reference

    6.0.9 Release
    All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages

    Detailed Description

    The NvMediaIJPD object takes a JPEG bitstream and decompress it to image data.

    6

    Data Structures

    struct  NVMEDIAJPEGDecAttributes
     Holds image JPEG decoder attributes. More...
     
    struct  NvMediaJPEGAppMarkerInfo
     Holds image JPEG decoder marker Info. More...
     
    struct  NVMEDIAJPEGDecInfo
     Holds image JPEG decoder stream information. More...
     

    Macros

    #define NVMEDIA_IJPD_VERSION_MAJOR   1
     Major version number. More...
     
    #define NVMEDIA_IJPD_VERSION_MINOR   0
     Minor version number. More...
     
    #define NVMEDIA_IJPD_VERSION_PATCH   0
     Patch version number. More...
     
    #define NVMEDIA_IJPD_MAX_PRENVSCISYNCFENCES   (16U)
     Specifies the maximum number of times NvMediaIJPDInsertPreNvSciSyncFence() can be called before each call to NvMediaIJPDFeedFrame(). More...
     
    #define NVMEDIA_JPEG_DEC_ATTRIBUTE_ALPHA_VALUE
     JPEG decode set alpha. More...
     
    #define NVMEDIA_JPEG_DEC_ATTRIBUTE_COLOR_STANDARD
     JPEG decode set color standard. More...
     
    #define NVMEDIA_IJPD_RENDER_FLAG_ROTATE_0
     JPEG decode render flag rotate 0. More...
     
    #define NVMEDIA_IJPD_RENDER_FLAG_ROTATE_90
     JPEG decode render flag rotate 90. More...
     
    #define NVMEDIA_IJPD_RENDER_FLAG_ROTATE_180
     JPEG decode render flag rotate 180. More...
     
    #define NVMEDIA_IJPD_RENDER_FLAG_ROTATE_270
     JPEG decode render flag rotate 270. More...
     
    #define NVMEDIA_IJPD_RENDER_FLAG_FLIP_HORIZONTAL
     JPEG decode render flag flip horizontal. More...
     
    #define NVMEDIA_IJPD_RENDER_FLAG_FLIP_VERTICAL
     JPEG decode render flag flip vertical. More...
     
    #define NVMEDIA_MAX_JPEG_APP_MARKERS
     JPEG decode max number of app markers supported. More...
     

    Typedefs

    typedef struct NvMediaIJPD NvMediaIJPD
     An opaque NvMediaIJPD object created by NvMediaIJPDCreate. More...
     

    Enumerations

    enum  NvMediaIJPDColorStandard {
      NVMEDIA_IJPD_COLOR_STANDARD_ITUR_BT_601,
      NVMEDIA_IJPD_COLOR_STANDARD_ITUR_BT_709,
      NVMEDIA_IJPD_COLOR_STANDARD_SMPTE_240M,
      NVMEDIA_IJPD_COLOR_STANDARD_ITUR_BT_601_ER,
      NVMEDIA_IJPD_COLOR_STANDARD_ITUR_BT_709_ER
    }
     Defines color standards. More...
     

    Functions

    NvMediaStatus NvMediaIJPDGetVersion (NvMediaVersion *version)
     Retrieves the version information for the NvMedia IJPD library. More...
     
    NvMediaIJPDNvMediaIJPDCreate (uint16_t maxWidth, uint16_t maxHeight, uint32_t maxBitstreamBytes, bool supportPartialAccel, NvMediaJPEGInstanceId instanceId)
     Creates a JPEG decoder object capable of decoding a JPEG stream into an image surface. More...
     
    void NvMediaIJPDDestroy (NvMediaIJPD *decoder)
     Destroys an NvMedia image JPEG decoder. More...
     
    NvMediaStatus NvMediaIJPDResize (NvMediaIJPD *decoder, uint16_t maxWidth, uint16_t maxHeight, uint32_t maxBitstreamBytes)
     Resizes an existing image JPEG decoder. More...
     
    NvMediaStatus NvMediaIJPDSetAttributes (const NvMediaIJPD *decoder, uint32_t attributeMask, const void *attributes)
     Sets attributes of an existing image JPEG decoder. More...
     
    NvMediaStatus NvMediaIJPDGetInfo (NVMEDIAJPEGDecInfo *info, uint32_t numBitstreamBuffers, const NvMediaBitstreamBuffer *bitstreams)
     A helper function that determines whether the JPEG decoder HW engine can decode the input JPEG stream. More...
     
    NvMediaStatus NvMediaIJPDRender (const NvMediaIJPD *decoder, NvSciBufObj target, const NvMediaRect *srcRect, const NvMediaRect *dstRect, uint8_t downscaleLog2, uint32_t numBitstreamBuffers, const NvMediaBitstreamBuffer *bitstreams, uint32_t flags, NvMediaJPEGInstanceId instanceId)
     Decodes a JPEG image. More...
     
    NvMediaStatus NvMediaIJPDRenderYUV (const NvMediaIJPD *decoder, NvSciBufObj target, uint8_t downscaleLog2, uint32_t numBitstreamBuffers, const NvMediaBitstreamBuffer *bitstreams, uint32_t flags, NvMediaJPEGInstanceId instanceId)
     Decodes a JPEG image into YUV format. More...
     
    NvMediaStatus NvMediaIJPDRegisterNvSciBufObj (const NvMediaIJPD *decoder, NvSciBufObj bufObj)
     Registers NvSciBufObj for use with a NvMediaIJPD handle. More...
     
    NvMediaStatus NvMediaIJPDUnregisterNvSciBufObj (const NvMediaIJPD *decoder, NvSciBufObj bufObj)
     Un-registers NvSciBufObj which was previously registered with NvMediaIJPD using NvMediaIJPDRegisterNvSciBufObj(). More...
     
    NvMediaStatus NvMediaIJPDFillNvSciBufAttrList (NvMediaJPEGInstanceId instanceId, NvSciBufAttrList attrlist)
     Fills the NvMediaIJPD specific NvSciBuf attributes which than then be used to allocate an NvSciBufObj that NvMediaIJPD can consume. More...
     
    NvMediaStatus NvMediaIJPDFillNvSciSyncAttrList (const NvMediaIJPD *decoder, NvSciSyncAttrList attrlist, NvMediaNvSciSyncClientType clienttype)
     Fills the NvMediaIJPD specific NvSciSync attributes. More...
     
    NvMediaStatus NvMediaIJPDRegisterNvSciSyncObj (const NvMediaIJPD *decoder, NvMediaNvSciSyncObjType syncobjtype, NvSciSyncObj nvscisync)
     Registers an NvSciSyncObj with NvMediaIJPD. More...
     
    NvMediaStatus NvMediaIJPDUnregisterNvSciSyncObj (const NvMediaIJPD *decoder, NvSciSyncObj nvscisync)
     Unregisters an NvSciSyncObj with NvMediaIJPD. More...
     
    NvMediaStatus NvMediaIJPDSetNvSciSyncObjforEOF (const NvMediaIJPD *decoder, NvSciSyncObj nvscisyncEOF)
     Specifies the NvSciSyncObj to be used for an EOF NvSciSyncFence. More...
     
    NvMediaStatus NvMediaIJPDInsertPreNvSciSyncFence (const NvMediaIJPD *decoder, const NvSciSyncFence *prenvscisyncfence)
     Sets an NvSciSyncFence as a prefence for an NvMediaIJPDRender() NvSciSyncFence operation. More...
     
    NvMediaStatus NvMediaIJPDGetEOFNvSciSyncFence (const NvMediaIJPD *decoder, NvSciSyncObj eofnvscisyncobj, NvSciSyncFence *eofnvscisyncfence)
     Gets EOF NvSciSyncFence for an NvMediaIJPDRender() operation. More...
     

    Macro Definition Documentation

    ◆ NVMEDIA_IJPD_MAX_PRENVSCISYNCFENCES

    #define NVMEDIA_IJPD_MAX_PRENVSCISYNCFENCES   (16U)

    Specifies the maximum number of times NvMediaIJPDInsertPreNvSciSyncFence() can be called before each call to NvMediaIJPDFeedFrame().

    Definition at line 55 of file nvmedia_ijpd.h.

    ◆ NVMEDIA_IJPD_RENDER_FLAG_FLIP_HORIZONTAL

    #define NVMEDIA_IJPD_RENDER_FLAG_FLIP_HORIZONTAL

    JPEG decode render flag flip horizontal.

    Definition at line 91 of file nvmedia_ijpd.h.

    ◆ NVMEDIA_IJPD_RENDER_FLAG_FLIP_VERTICAL

    #define NVMEDIA_IJPD_RENDER_FLAG_FLIP_VERTICAL

    JPEG decode render flag flip vertical.

    Definition at line 96 of file nvmedia_ijpd.h.

    ◆ NVMEDIA_IJPD_RENDER_FLAG_ROTATE_0

    #define NVMEDIA_IJPD_RENDER_FLAG_ROTATE_0

    JPEG decode render flag rotate 0.

    Definition at line 71 of file nvmedia_ijpd.h.

    ◆ NVMEDIA_IJPD_RENDER_FLAG_ROTATE_180

    #define NVMEDIA_IJPD_RENDER_FLAG_ROTATE_180

    JPEG decode render flag rotate 180.

    Definition at line 81 of file nvmedia_ijpd.h.

    ◆ NVMEDIA_IJPD_RENDER_FLAG_ROTATE_270

    #define NVMEDIA_IJPD_RENDER_FLAG_ROTATE_270

    JPEG decode render flag rotate 270.

    Definition at line 86 of file nvmedia_ijpd.h.

    ◆ NVMEDIA_IJPD_RENDER_FLAG_ROTATE_90

    #define NVMEDIA_IJPD_RENDER_FLAG_ROTATE_90

    JPEG decode render flag rotate 90.

    Definition at line 76 of file nvmedia_ijpd.h.

    ◆ NVMEDIA_IJPD_VERSION_MAJOR

    #define NVMEDIA_IJPD_VERSION_MAJOR   1

    Major version number.

    Definition at line 45 of file nvmedia_ijpd.h.

    ◆ NVMEDIA_IJPD_VERSION_MINOR

    #define NVMEDIA_IJPD_VERSION_MINOR   0

    Minor version number.

    Definition at line 47 of file nvmedia_ijpd.h.

    ◆ NVMEDIA_IJPD_VERSION_PATCH

    #define NVMEDIA_IJPD_VERSION_PATCH   0

    Patch version number.

    Definition at line 49 of file nvmedia_ijpd.h.

    ◆ NVMEDIA_JPEG_DEC_ATTRIBUTE_ALPHA_VALUE

    #define NVMEDIA_JPEG_DEC_ATTRIBUTE_ALPHA_VALUE

    JPEG decode set alpha.

    Definition at line 61 of file nvmedia_ijpd.h.

    ◆ NVMEDIA_JPEG_DEC_ATTRIBUTE_COLOR_STANDARD

    #define NVMEDIA_JPEG_DEC_ATTRIBUTE_COLOR_STANDARD

    JPEG decode set color standard.

    Definition at line 66 of file nvmedia_ijpd.h.

    ◆ NVMEDIA_MAX_JPEG_APP_MARKERS

    #define NVMEDIA_MAX_JPEG_APP_MARKERS

    JPEG decode max number of app markers supported.

    Definition at line 101 of file nvmedia_ijpd.h.

    Typedef Documentation

    ◆ NvMediaIJPD

    typedef struct NvMediaIJPD NvMediaIJPD

    An opaque NvMediaIJPD object created by NvMediaIJPDCreate.

    Definition at line 174 of file nvmedia_ijpd.h.

    Enumeration Type Documentation

    ◆ NvMediaIJPDColorStandard

    Defines color standards.

    Enumerator
    NVMEDIA_IJPD_COLOR_STANDARD_ITUR_BT_601 

    Specifies ITU BT.601 color standard.

    NVMEDIA_IJPD_COLOR_STANDARD_ITUR_BT_709 

    Specifies ITU BT.709 color standard.

    NVMEDIA_IJPD_COLOR_STANDARD_SMPTE_240M 

    Specifies SMTE 240M color standard.

    NVMEDIA_IJPD_COLOR_STANDARD_ITUR_BT_601_ER 

    Specifies ITU BT.601 color standard extended range.

    NVMEDIA_IJPD_COLOR_STANDARD_ITUR_BT_709_ER 

    Specifies ITU BT.709 color standard extended range.

    Definition at line 105 of file nvmedia_ijpd.h.

    Function Documentation

    ◆ NvMediaIJPDCreate()

    NvMediaIJPD* NvMediaIJPDCreate ( uint16_t  maxWidth,
    uint16_t  maxHeight,
    uint32_t  maxBitstreamBytes,
    bool  supportPartialAccel,
    NvMediaJPEGInstanceId  instanceId 
    )

    Creates a JPEG decoder object capable of decoding a JPEG stream into an image surface.

    Precondition
    NvMediaIJPDGetVersion()
    NvMediaIJPDFillNvSciBufAttrList()
    Postcondition
    NvMediaIJPD object is created


    Usage considerations

    • Allowed context for the API call
      • Interrupt handler: No
      • Signal handler: No
      • Thread-safe: Yes
      • Re-entrant: No
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: Yes
      • Runtime: No
      • De-Init: No
    Parameters
    [in]maxWidthThe maximum width of output surface to support. you can use NvMediaIJPDResize() to enlarge this limit for an existing decoder.
    [in]maxHeightThe maximum height of output surface to support. You can use NvMediaIJPDResize() to enlarge this limit for an existing decoder.
    [in]maxBitstreamBytesThe maximum JPEG bitstream size in bytes to support. Use NvMediaIJPDResize() to enlarge this limit for an existing decoder.
    [in]supportPartialAccelIndicates that the JPEG decode object supports partial acceleration.
    If it does, set this argument to the character '1' (true).
    If it does not, set this argument to the character '0' (false).
    [in]instanceIdThe ID of the engine instance. The following instances are supported:
    Return values
    NvMediaIJPDThe new image JPEG decoder handle or NULL if unsuccessful.

    ◆ NvMediaIJPDDestroy()

    void NvMediaIJPDDestroy ( NvMediaIJPD decoder)

    Destroys an NvMedia image JPEG decoder.

    Precondition
    NvMediaIJPDUnregisterNvSciBufObj()
    NvMediaIJPDUnregisterNvSciSyncObj()
    Postcondition
    NvMediaIJPD object is destroyed


    Usage considerations

    • Allowed context for the API call
      • Interrupt handler: No
      • Signal handler: No
      • Thread-safe: Yes, with the following conditions
        • Every thread should be invoked with relevant NvMediaIJPD object.
      • Re-entrant: No
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: No
      • De-Init: Yes
    Parameters
    [in]decoderA pointer to the JPEG decoder to destroy.

    ◆ NvMediaIJPDFillNvSciBufAttrList()

    NvMediaStatus NvMediaIJPDFillNvSciBufAttrList ( NvMediaJPEGInstanceId  instanceId,
    NvSciBufAttrList  attrlist 
    )

    Fills the NvMediaIJPD specific NvSciBuf attributes which than then be used to allocate an NvSciBufObj that NvMediaIJPD can consume.

    This function updates the input NvSciBufAttrList with values equivalent to the following public attribute key-values: NvSciBufGeneralAttrKey_PeerHwEngineArray set to

    • NvSciBufHwEngName: NvSciBufHwEngName_NVJPG
    • NvSciBufPlatformName: The platform this API is used on

    This function assumes that attrlist is a valid NvSciBufAttrList created by the caller by a call to NvSciBufAttrListCreate.

    Precondition
    NvMediaIJPDGetVersion()
    Postcondition
    NvSciBufAttrList populated with NvMediaIJPD specific NvSciBuf attributes. The caller can then set attributes specific to the type of surface, reconcile attribute lists and allocate an NvSciBufObj.


    Usage considerations

    • Allowed context for the API call
      • Interrupt handler: No
      • Signal handler: No
      • Thread-safe: Yes
      • Re-entrant: No
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: Yes
      • Runtime: No
      • De-Init: No
    Parameters
    [in]instanceIdThe ID of the engine instance.
    Input range: The following instances are supported:
    [out]attrlistAn NvSciBufAttrList where NvMediaIJPD places the NvSciBuf attributes.
    Returns
    NvMediaStatus The status of the operation. Possible values are:

    ◆ NvMediaIJPDFillNvSciSyncAttrList()

    NvMediaStatus NvMediaIJPDFillNvSciSyncAttrList ( const NvMediaIJPD decoder,
    NvSciSyncAttrList  attrlist,
    NvMediaNvSciSyncClientType  clienttype 
    )

    Fills the NvMediaIJPD specific NvSciSync attributes.

    This function assumes that attrlist is a valid NvSciSyncAttrList.

    This function updates the input NvSciSyncAttrList with values equivalent to the following public attribute key-values: NvSciSyncAttrKey_RequiredPerm set to

    • NvSciSyncAccessPerm_WaitOnly for clienttype NVMEDIA_WAITER
    • NvSciSyncAccessPerm_SignalOnly for clienttype NVMEDIA_SIGNALER
    • NvSciSyncAccessPerm_WaitSignal for clienttype NVMEDIA_SIGNALER_WAITER NvSciSyncAttrKey_PrimitiveInfo set to
    • NvSciSyncAttrValPrimitiveType_Syncpoint

    The application must not set these attributes in the NvSciSyncAttrList passed as an input to this function.

    Precondition
    NvMediaIJPDCreate()
    Postcondition
    NvSciSyncAttrList populated with NvMediaIJPD specific NvSciSync attributes


    Usage considerations

    • Allowed context for the API call
      • Interrupt handler: No
      • Signal handler: No
      • Thread-safe: Yes, with the following conditions
        • Every thread should be invoked with relevant NvMediaIJPD object.
      • Re-entrant: No
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: Yes
      • Runtime: No
      • De-Init: No
    Note
    This API is mandatory when multiple engines are pipelined in order to achieve synchronization between the engines
    Parameters
    [in]decoderA pointer to the NvMediaIJPD object.
    Input range: Non-NULL - valid pointer address
    [out]attrlistA pointer to an NvSciSyncAttrList structure where NvMedia places NvSciSync attributes.
    [in]clienttypeIndicates whether the NvSciSyncAttrList requested for an NvMediaIJPD signaler or an NvMediaIJPD waiter.
    Input range: Entries in NvMediaNvSciSyncClientType enumeration
    Returns
    NvMediaStatus The status of the operation. Possible values are:

    ◆ NvMediaIJPDGetEOFNvSciSyncFence()

    NvMediaStatus NvMediaIJPDGetEOFNvSciSyncFence ( const NvMediaIJPD decoder,
    NvSciSyncObj  eofnvscisyncobj,
    NvSciSyncFence eofnvscisyncfence 
    )

    Gets EOF NvSciSyncFence for an NvMediaIJPDRender() operation.

    The EOF NvSciSyncFence associated with an NvMediaIJPDRender() operation is an NvSciSyncFence. Its expiry indicates that the corresponding NvMediaIJPDRender() operation has finished.

    This function returns the EOF NvSciSyncFence associated with the last NvMediaIJPDRender() call. NvMediaIJPDGetEOFNvSciSyncFence() must be called after an NvMediaIJPDRender() call.

    For example, in this sequence of code:

    nvmstatus = NvMediaIJPDRender(handle, arg2, arg3, ...);
    nvmstatus = NvMediaIJPDGetEOFNvSciSyncFence(handle, nvscisyncEOF, eofnvscisyncfence);

    expiry of eofnvscisyncfence indicates that the preceding NvMediaIJPDRender() operation has finished.

    Precondition
    NvMediaIJPDSetNvSciSyncObjforEOF()
    NvMediaIJPDRender()
    Postcondition
    EOF NvSciSync fence for a submitted task is obtained


    Usage considerations

    • Allowed context for the API call
      • Interrupt handler: No
      • Signal handler: No
      • Thread-safe: Yes, with the following conditions
        • Every thread should be invoked with relevant NvMediaIJPD object.
      • Re-entrant: No
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: Yes
      • De-Init: No
    Note
    This API is mandatory when multiple engines are pipelined in order to achieve synchronization between the engines
    Parameters
    [in]decoderA pointer to the NvMediaIJPD object.
    Input range: Non-NULL - valid pointer address
    [in]eofnvscisyncobjAn EOF NvSciSyncObj associated with the NvSciSyncFence which is being requested.
    Input range: A valid NvSciSyncObj
    [out]eofnvscisyncfenceA pointer to the EOF NvSciSyncFence.
    Returns
    NvMediaStatus The status of the operation. Possible values are:

    ◆ NvMediaIJPDGetInfo()

    NvMediaStatus NvMediaIJPDGetInfo ( NVMEDIAJPEGDecInfo info,
    uint32_t  numBitstreamBuffers,
    const NvMediaBitstreamBuffer bitstreams 
    )

    A helper function that determines whether the JPEG decoder HW engine can decode the input JPEG stream.

    Possible outcomes are:

    • Decode possible. If JPEG decoder supports decode of this stream, this function returns NVMEDIA_STATUS_OK and the NVMEDIAJPEGDecInfo info will be filled out. This function also determines whether you must allocate the NvMediaIJPD object when you call NvMediaIJPDCreate(). You specify that object with the NvMediaIJPDCreate() supportPartialAccel parameter.
    • Decode not possible. If JPEG decoder cannot decode this stream, this function returns NVMEDIA_STATUS_NOT_SUPPORTED.
    Precondition
    NvMediaIJPDCreate()
    Postcondition
    NVMEDIAJPEGDecInfo is populated with required information


    Usage considerations

    • Allowed context for the API call
      • Interrupt handler: No
      • Signal handler: No
      • Thread-safe: Yes
      • Re-entrant: No
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: Yes
      • Runtime: No
      • De-Init: No
    Parameters
    [in,out]infoA pointer to the information to be filled.
    [in]numBitstreamBuffersThe number of bitstream buffers.
    [in]bitstreamsThe bitstream buffer.
    Returns
    NvMediaStatus The completion status of the operation. Possible values are:

    ◆ NvMediaIJPDGetVersion()

    NvMediaStatus NvMediaIJPDGetVersion ( NvMediaVersion version)

    Retrieves the version information for the NvMedia IJPD library.

    Precondition
    None
    Postcondition
    None


    Usage considerations

    • Allowed context for the API call
      • Interrupt handler: No
      • Signal handler: No
      • Thread-safe: Yes
      • Re-entrant: No
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: Yes
      • Runtime: No
      • De-Init: No
    Parameters
    [in]versionA pointer to a NvMediaVersion structure of the client.
    Returns
    NvMediaStatus The status of the operation.

    Possible values are:

    ◆ NvMediaIJPDInsertPreNvSciSyncFence()

    NvMediaStatus NvMediaIJPDInsertPreNvSciSyncFence ( const NvMediaIJPD decoder,
    const NvSciSyncFence prenvscisyncfence 
    )

    Sets an NvSciSyncFence as a prefence for an NvMediaIJPDRender() NvSciSyncFence operation.

    You must call NvMediaIJPDInsertPreNvSciSyncFence() before you call NvMediaIJPDRender(). The NvMediaIJPDRender() operation is started only after the expiry of the prenvscisyncfence.

    For example, in this sequence of code:

    nvmstatus = NvMediaIJPDInsertPreNvSciSyncFence(handle, prenvscisyncfence);
    nvmstatus = NvMediaIJPDRender(handle, arg2, arg3, ...);

    the NvMediaIJPDRender() operation is assured to start only after the expiry of prenvscisyncfence.

    You can set a maximum of NVMEDIA_IJPD_MAX_PRENVSCISYNCFENCES prefences by calling NvMediaIJPDInsertPreNvSciSyncFence() before NvMediaIJPDRender(). After the call to NvMediaIJPDRender(), all NvSciSyncFences previously inserted by NvMediaIJPDInsertPreNvSciSyncFence() are removed, and they are not reused for the subsequent NvMediaIJPDRender() calls.

    Precondition
    Pre-NvSciSync fence obtained from previous engine in the pipeline
    Postcondition
    Pre-NvSciSync fence is set


    Usage considerations

    • Allowed context for the API call
      • Interrupt handler: No
      • Signal handler: No
      • Thread-safe: Yes, with the following conditions
        • Every thread should be invoked with relevant NvMediaIJPD object.
      • Re-entrant: No
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: Yes
      • De-Init: No
    Note
    This API is mandatory when multiple engines are pipelined in order to achieve synchronization between the engines
    Parameters
    [in]decoderA pointer to the NvMediaIJPD object.
    Input range: Non-NULL - valid pointer address
    [in]prenvscisyncfenceA pointer to NvSciSyncFence.
    Input range: Non-NULL - valid pointer address
    Returns
    NvMediaStatus The status of the operation. Possible values are:

    ◆ NvMediaIJPDRegisterNvSciBufObj()

    NvMediaStatus NvMediaIJPDRegisterNvSciBufObj ( const NvMediaIJPD decoder,
    NvSciBufObj  bufObj 
    )

    Registers NvSciBufObj for use with a NvMediaIJPD handle.

    NvMediaIJPD handle maintains a record of all the objects registered using this API and only the registered NvSciBufObj handles are accepted when submitted for decoding via NvMediaIJPDRender. Even duplicated NvSciBufObj objects need to be registered using this API prior.

    This needs to be used in tandem with NvMediaIJPDUnregisterNvSciBufObj(). The pair of APIs for registering and unregistering NvSciBufObj are optional, but it is highly recommended to use them as they ensure deterministic execution of NvMediaIJPDRender().

    To ensure deterministic execution time of NvMediaIJPDRender API:

    Registration of the buffer (output) is always with read-write permissions.

    Maximum of 32 NvSciBufObj handles can be registered.

    Note
    This API is currently not supported and can be ignored
    Precondition
    NvMediaIJPDCreate()
    NvMediaIJPDRegisterNvSciSyncObj()
    Postcondition
    NvSciBufObj is registered with NvMediaIJPD object


    Usage considerations

    • Allowed context for the API call
      • Interrupt handler: No
      • Signal handler: No
      • Thread-safe: Yes, with the following conditions
        • Every thread should be invoked with relevant NvMediaIJPD object.
      • Re-entrant: No
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: Yes
      • Runtime: No
      • De-Init: No
    Parameters
    [in]decoderA pointer to the NvMediaIJPD object.
    Input range: Non-NULL - valid pointer address
    [in]bufObjNvSciBufObj object
    Input range: A valid NvSciBufObj
    Returns
    NvMediaStatus, the completion status of operation:

    ◆ NvMediaIJPDRegisterNvSciSyncObj()

    NvMediaStatus NvMediaIJPDRegisterNvSciSyncObj ( const NvMediaIJPD decoder,
    NvMediaNvSciSyncObjType  syncobjtype,
    NvSciSyncObj  nvscisync 
    )

    Registers an NvSciSyncObj with NvMediaIJPD.

    Every NvSciSyncObj (even duplicate objects) used by NvMediaIJPD must be registered by a call to this function before it is used. Only the exact same registered NvSciSyncObj can be passed to NvMediaIJPDSetNvSciSyncObjforEOF(), NvMediaIJPDGetEOFNvSciSyncFence(), or NvMediaIJPDUnregisterNvSciSyncObj().

    For a given NvMediaIJPD handle, one NvSciSyncObj can be registered as one NvMediaNvSciSyncObjType only. For each NvMediaNvSciSyncObjType, a maximum of 16 NvSciSyncObjs can be registered.

    Precondition
    NvMediaIJPDFillNvSciSyncAttrList()
    Postcondition
    NvSciSyncObj registered with NvMediaIJPD


    Usage considerations

    • Allowed context for the API call
      • Interrupt handler: No
      • Signal handler: No
      • Thread-safe: Yes, with the following conditions
        • Every thread should be invoked with relevant NvMediaIJPD object.
      • Re-entrant: No
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: Yes
      • Runtime: No
      • De-Init: No
    Note
    This API is mandatory when multiple engines are pipelined in order to achieve synchronization between the engines
    Parameters
    [in]decoderA pointer to the NvMediaIJPD object.
    Input range: Non-NULL - valid pointer address
    [in]syncobjtypeDetermines how nvscisync is used by decoder.
    Input range: Entries in NvMediaNvSciSyncObjType enumeration
    [in]nvscisyncThe NvSciSyncObj to be registered with decoder.
    Input range: A valid NvSciSyncObj
    Returns
    NvMediaStatus The status of the operation. Possible values are:
    • NVMEDIA_STATUS_OK if the function is successful.
    • NVMEDIA_STATUS_BAD_PARAMETER if decoder is NULL or syncobjtype is not a valid NvMediaNvSciSyncObjType.
    • NVMEDIA_STATUS_NOT_SUPPORTED if nvscisync is not a compatible NvSciSyncObj which NvMediaIJPD can support.
    • NVMEDIA_STATUS_ERROR if the maximum number of NvSciScynObjs are already registered for the given syncobjtype, or if nvscisync is already registered with the same decoder handle for a different syncobjtype.

    ◆ NvMediaIJPDRender()

    NvMediaStatus NvMediaIJPDRender ( const NvMediaIJPD decoder,
    NvSciBufObj  target,
    const NvMediaRect srcRect,
    const NvMediaRect dstRect,
    uint8_t  downscaleLog2,
    uint32_t  numBitstreamBuffers,
    const NvMediaBitstreamBuffer bitstreams,
    uint32_t  flags,
    NvMediaJPEGInstanceId  instanceId 
    )

    Decodes a JPEG image.

    The decode pipeline produces a result equivalent to the following sequence:

    1. Decodes the full JPEG image.
    2. Downscales the 8x8 block padded image by the downscaleLog2 factor. That is, a "width" by "height" JPEG is downscaled to:

      ((width + 7) & ~7) >> downscaleLog2
      

      by

      ((height + 7) & ~7) >> downscaleLog2
      
    3. From the downscaled image, removes the rectangle described by srcRect and optionally (a) mirrors the image horizontally and/or vertically and/or (b) rotates the image.
    4. Scales the transformed source rectangle to the dstRect on the output surface.
    Specifying Dimensions

    The JPEG decoder object must have maxWidth and maxHeight values that are greater than or equal to the post-downscale JPEG image. Additionally, it must have a maxBitstreamBytes value that is greater than or equal to the total number of bytes in the bitstream buffers. You set these values when you create the JPEG decoder object with NvMediaIJPDCreate(). Alternatively, you can user NvMediaIJPDResize() to change the dimensions of an existing JPEG decoder object.

    If the JPEG decoder object has inadequate dimensions, NvMediaIJPDRender() returns NVMEDIA_STATUS_INSUFFICIENT_BUFFERING.

    Supporting Partial Acceleration

    If the JPEG stream requires partial acceleration, created the JPEG decoder object with supportPartialAccel set to '1'. Otherwise, the function returns NVMEDIA_STATUS_BAD_PARAMETER.

    Use NvMediaIJPDGetInfo() to determine whether a stream requires paritialAccel.

    Determining Supported JPEG Streams

    If the JPEG stream is not supported, the function returns NVMEDIA_STATUS_NOT_SUPPORTED.

    Use NvMediaIJPDGetInfo() to determine whether a stream is unsupported.

    Note
    NvMediaIJPDRender() with the NVJPG 1.0 codec does not support rotation.
    Precondition
    NvMediaIJPDRegisterNvSciBufObj()
    NvMediaIJPDRegisterNvSciSyncObj()
    NvMediaIJPDSetNvSciSyncObjforEOF()
    NvMediaIJPDInsertPreNvSciSyncFence()
    Postcondition
    JPEG decoding task is submitted


    Usage considerations

    • Allowed context for the API call
      • Interrupt handler: No
      • Signal handler: No
      • Thread-safe: Yes, with the following conditions
        • Every thread should be invoked with relevant NvMediaIJPD object.
      • Re-entrant: No
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: Yes
      • De-Init: No
    Parameters
    [in]decoderA pointer to the JPEG decoder to use.
    [out]targetNvSciBufObj that contains the decoded content, allocated with a call to NvSciBufObjAlloc. Supported surface format attributes:
    Buffer Type: NvSciBufType_Image
    Surface Type: RGBA
    Bit Depth: 8
    Layout: NvSciBufImage_PitchLinearType
    Scan Type: NvSciBufScan_ProgressiveType
    Plane base address alignment: 256
    [in]srcRectThe source rectangle. The rectangle from the post-downscaled image to be transformed and scaled to the dstRect. You can achieve horizontal and/or vertical mirroring by swapping the left-right and/or top-bottom coordinates. If NULL, the full post-downscaled surface is implied.
    [in]dstRectThe destination rectangle on the output surface. If NULL, a rectangle the full size of the output surface is implied.
    [in]downscaleLog2A value clamped between 0 and 3 inclusive, gives downscale factors of 1 to 8.
    [in]numBitstreamBuffersThe number of bitstream buffers.
    [in]bitstreamsThe bitstream buffer. NvMediaIJPDRender() copies the data out of these buffers so the caller is free to reuse them as soon as NvMediaIJPDRender() returns.
    [in]flagsFlags that specify a clockwise rotation of the source in degrees and horizontal and vertical flipping. If both are specified, the image is flipped before it is rotated. You can set the flags argument to any one of the following:
    • NVMEDIA_RENDER_FLAG_ROTATE_0
    • NVMEDIA_RENDER_FLAG_ROTATE_90
    • NVMEDIA_RENDER_FLAG_ROTATE_180
    • NVMEDIA_RENDER_FLAG_ROTATE_270
    Additionally, you can use the bitwise OR operation to apply either or both of the following:
    • NVMEDIA_RENDER_FLAG_FLIP_HORIZONTAL
    • NVMEDIA_RENDER_FLAG_FLIP_VERTICAL
    [in]instanceIdThe ID of the engine instance. The following instances are supported:
    Returns
    NvMediaStatus The completion status of the operation. Possible values are:

    ◆ NvMediaIJPDRenderYUV()

    NvMediaStatus NvMediaIJPDRenderYUV ( const NvMediaIJPD decoder,
    NvSciBufObj  target,
    uint8_t  downscaleLog2,
    uint32_t  numBitstreamBuffers,
    const NvMediaBitstreamBuffer bitstreams,
    uint32_t  flags,
    NvMediaJPEGInstanceId  instanceId 
    )

    Decodes a JPEG image into YUV format.

    This function is similar to NvMediaIJPDRender() except that the output surface is in YUV format, not RGBA format. Also, clipping and scaling (other than downscaleLog2 scaling) are not supported, so there are no source or destination rectangle parameters.

    Note
    NvMediaIJPDRenderYUV() with the NVJPG 1.0 codec has the following limitations:
    • It supports chroma subsample conversion to 420 and 420H from any input format except 400.
    • It does not simultaneously support downscaleLog2 and subsample conversion.
    Precondition
    NvMediaIJPDRegisterNvSciBufObj()
    NvMediaIJPDRegisterNvSciSyncObj()
    NvMediaIJPDSetNvSciSyncObjforEOF()
    NvMediaIJPDInsertPreNvSciSyncFence()
    Postcondition
    JPEG decoding task is submitted


    Usage considerations

    • Allowed context for the API call
      • Interrupt handler: No
      • Signal handler: No
      • Thread-safe: Yes, with the following conditions
        • Every thread should be invoked with relevant NvMediaIJPD object.
      • Re-entrant: No
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: Yes
      • De-Init: No
    Parameters
    [in]decoderA pointer to the JPEG decoder to use.
    [out]targetNvSciBufObj that contains the decoded content, allocated with a call to NvSciBufObjAlloc. Supported surface format attributes:
    Buffer Type: NvSciBufType_Image
    Sub-sampling type: YUV420, YUV422, YUV444 (planar and semi-planar)
    Bit Depth: 8
    Layout: NvSciBufImage_PitchLinearType
    Scan Type: NvSciBufScan_ProgressiveType
    Plane base address alignment: 256
    [in]downscaleLog2A value between 0 and 3 inclusive that gives downscale factors of 1 to 8.
    [in]numBitstreamBuffersThe number of bitstream buffers.
    [in]bitstreamsThe bitstream buffer. NvMediaIJPDRenderYUV() copies the data out of these buffers so the caller is free to reuse them as soon as NvMediaIJPDRenderYUV() returns.
    [in]flagsFlags that specify a clockwise rotation of the source in degrees and horizontal and vertical flipping. If both are specified, flipping is performed before rotating. You can set the flags argument to any one of the following:
    • NVMEDIA_RENDER_FLAG_ROTATE_0
    • NVMEDIA_RENDER_FLAG_ROTATE_90
    • NVMEDIA_RENDER_FLAG_ROTATE_180
    • NVMEDIA_RENDER_FLAG_ROTATE_270
    Additionally, you can use the bitwise OR operation to apply either or both of the following:
    • NVMEDIA_RENDER_FLAG_FLIP_HORIZONTAL
    • NVMEDIA_RENDER_FLAG_FLIP_VERTICAL
    [in]instanceIdThe ID of the engine instance. The following instances are supported:
    Returns
    NvMediaStatus The completion status of the operation. Possible values are:

    ◆ NvMediaIJPDResize()

    NvMediaStatus NvMediaIJPDResize ( NvMediaIJPD decoder,
    uint16_t  maxWidth,
    uint16_t  maxHeight,
    uint32_t  maxBitstreamBytes 
    )

    Resizes an existing image JPEG decoder.

    Precondition
    NvMediaIJPDCreate()
    Postcondition
    NvMediaIJPD object is updated as specified


    Usage considerations

    • Allowed context for the API call
      • Interrupt handler: No
      • Signal handler: No
      • Thread-safe: Yes, with the following conditions
        • Every thread should be invoked with relevant NvMediaIJPD object.
      • Re-entrant: No
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: Yes
      • Runtime: No
      • De-Init: No
    Parameters
    [in]decoderA pointer to the JPEG decoder to use.
    [in]maxWidthThe new maximum width of output surface to support.
    [in]maxHeightThe new maximum height of output surface to support.
    [in]maxBitstreamBytesThe new maximum JPEG bitstream size in bytes to support.
    Returns
    NvMediaStatus The completion status of the operation. Possible values are:

    ◆ NvMediaIJPDSetAttributes()

    NvMediaStatus NvMediaIJPDSetAttributes ( const NvMediaIJPD decoder,
    uint32_t  attributeMask,
    const void *  attributes 
    )

    Sets attributes of an existing image JPEG decoder.

    Precondition
    NvMediaIJPDCreate()
    Postcondition
    Specified attribute is set


    Usage considerations

    • Allowed context for the API call
      • Interrupt handler: No
      • Signal handler: No
      • Thread-safe: Yes, with the following conditions
        • Every thread should be invoked with relevant NvMediaIJPD object.
      • Re-entrant: No
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: Yes
      • Runtime: No
      • De-Init: No
    Parameters
    [in]decoderA pointer to the JPEG decoder to use.
    [in]attributeMaskAn attribute mask. Supported mask are:
    [in]attributesAttributes data. Supported attribute structures:
    Returns
    NvMediaStatus The completion status of the operation. Possible values are:

    ◆ NvMediaIJPDSetNvSciSyncObjforEOF()

    NvMediaStatus NvMediaIJPDSetNvSciSyncObjforEOF ( const NvMediaIJPD decoder,
    NvSciSyncObj  nvscisyncEOF 
    )

    Specifies the NvSciSyncObj to be used for an EOF NvSciSyncFence.

    To use NvMediaIJPDGetEOFNvSciSyncFence(), the application must call NvMediaIJPDSetNvSciSyncObjforEOF() before it calls NvMediaIJPDRender().

    NvMediaIJPDSetNvSciSyncObjforEOF() currently may be called only once before each call to NvMediaIJPDRender(). The application may choose to call this function only once before the first call to NvMediaIJPDRender().

    Precondition
    NvMediaIJPDRegisterNvSciSyncObj()
    Postcondition
    NvSciSyncObj to be used as EOF NvSciSyncFence is set


    Usage considerations

    • Allowed context for the API call
      • Interrupt handler: No
      • Signal handler: No
      • Thread-safe: Yes, with the following conditions
        • Every thread should be invoked with relevant NvMediaIJPD object.
      • Re-entrant: No
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: Yes
      • De-Init: No
    Note
    This API is mandatory when multiple engines are pipelined in order to achieve synchronization between the engines
    Parameters
    [in]decoderA pointer to the NvMediaIJPD object.
    Input range: Non-NULL - valid pointer address
    [in]nvscisyncEOFA registered NvSciSyncObj which is to be associated with EOF NvSciSyncFence.
    Input range: A valid NvSciSyncObj
    Returns
    NvMediaStatus The status of the operation. Possible values are:

    ◆ NvMediaIJPDUnregisterNvSciBufObj()

    NvMediaStatus NvMediaIJPDUnregisterNvSciBufObj ( const NvMediaIJPD decoder,
    NvSciBufObj  bufObj 
    )

    Un-registers NvSciBufObj which was previously registered with NvMediaIJPD using NvMediaIJPDRegisterNvSciBufObj().

    For all NvSciBufObj handles registered with NvMediaIJPD using NvMediaIJPDRegisterNvSciBufObj API, NvMediaIJPDUnregisterNvSciBufObj must be called before calling NvMediaIJPDDestroy API. For unregistration to succeed, it should be ensured that none of the submitted tasks on the bufObj are pending prior to calling NvMediaIJPDUnregisterNvSciBufObj(). In order to ensure this, NvMediaIJPDUnregisterNvSciSyncObj() should be called prior to this API on all registered NvSciSyncObj. Post this NvMediaIJPDUnregisterNvSciBufObj() can be successfully called on a valid NvSciBufObj.

    This needs to be used in tandem with NvMediaIJPDRegisterNvSciBufObj(). The pair of APIs for registering and unregistering NvSciBufObj are optional, but it is highly recommended to use them as they ensure deterministic execution of NvMediaIJPDRender().

    To ensure deterministic execution time of NvMediaIJPDRender API:

    Note
    This API is currently not supported and can be ignored
    Precondition
    NvMediaIJPDUnregisterNvSciSyncObj() [verify that processing is complete]
    Postcondition
    NvSciBufObj is un-registered from NvMediaIJPD object


    Usage considerations

    • Allowed context for the API call
      • Interrupt handler: No
      • Signal handler: No
      • Thread-safe: Yes, with the following conditions
        • Every thread should be invoked with relevant NvMediaIJPD object.
      • Re-entrant: No
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: No
      • De-Init: Yes
    Parameters
    [in]decoderA pointer to the NvMediaIJPD object.
    Input range: Non-NULL - valid pointer address
    [in]bufObjNvSciBufObj object
    Input range: A valid NvSciBufObj
    Returns
    NvMediaStatus, the completion status of operation:

    ◆ NvMediaIJPDUnregisterNvSciSyncObj()

    NvMediaStatus NvMediaIJPDUnregisterNvSciSyncObj ( const NvMediaIJPD decoder,
    NvSciSyncObj  nvscisync 
    )

    Unregisters an NvSciSyncObj with NvMediaIJPD.

    Every NvSciSyncObj registered with NvMediaIJPD by NvMediaIJPDRegisterNvSciSyncObj() must be unregistered before calling NvMediaIJPDUnregisterNvSciBufObj() to unregister the NvSciBufObjs.

    Before the application calls this function, it must ensure that any NvMediaIJPDRender() operation that uses the NvSciSyncObj has completed. If this function is called while NvSciSyncObj is still in use by any NvMediaIJPDRender() operation, the API returns NVMEDIA_STATUS_PENDING to indicate the same. NvSciSyncFenceWait() API can be called on the EOF NvSciSyncFence obtained post the last call to NvMediaIJPDRender() to wait for the associated tasks to complete. The EOF NvSciSyncFence would have been previously obtained via a call to NvMediaIJPDGetEOFNvSciSyncFence(). The other option would be to call NvMediaIJPDGetBits() till there is no more output to retrieve.

    Precondition
    NvMediaIJPDRender()
    NvMediaIJPDGetBits() or NvSciSyncFenceWait() [verify that processing is complete]
    Postcondition
    NvSciSyncObj un-registered with NvMediaIJPD


    Usage considerations

    • Allowed context for the API call
      • Interrupt handler: No
      • Signal handler: No
      • Thread-safe: Yes, with the following conditions
        • Every thread should be invoked with relevant NvMediaIJPD object.
      • Re-entrant: No
      • Async/Sync: Sync
    • Required privileges: None
    • API group
      • Init: No
      • Runtime: No
      • De-Init: Yes
    Note
    This API is mandatory when multiple engines are pipelined in order to achieve synchronization between the engines
    Parameters
    [in]decoderA pointer to the NvMediaIJPD object.
    Input range: Non-NULL - valid pointer address
    [in]nvscisyncAn NvSciSyncObj to be unregistered with decoder.
    Input range: A valid NvSciSyncObj
    Returns
    NvMediaStatus The status of the operation. Possible values are:
    NvMediaIJPDInsertPreNvSciSyncFence
    NvMediaStatus NvMediaIJPDInsertPreNvSciSyncFence(const NvMediaIJPD *decoder, const NvSciSyncFence *prenvscisyncfence)
    Sets an NvSciSyncFence as a prefence for an NvMediaIJPDRender() NvSciSyncFence operation.
    NvMediaIJPDRender
    NvMediaStatus NvMediaIJPDRender(const NvMediaIJPD *decoder, NvSciBufObj target, const NvMediaRect *srcRect, const NvMediaRect *dstRect, uint8_t downscaleLog2, uint32_t numBitstreamBuffers, const NvMediaBitstreamBuffer *bitstreams, uint32_t flags, NvMediaJPEGInstanceId instanceId)
    Decodes a JPEG image.
    NvMediaIJPDGetEOFNvSciSyncFence
    NvMediaStatus NvMediaIJPDGetEOFNvSciSyncFence(const NvMediaIJPD *decoder, NvSciSyncObj eofnvscisyncobj, NvSciSyncFence *eofnvscisyncfence)
    Gets EOF NvSciSyncFence for an NvMediaIJPDRender() operation.
    人人超碰97caoporen国产