Add support for the rocDecUnMapVideoFrame API (#58)
Αυτή η υποβολή περιλαμβάνεται σε:
υποβλήθηκε από
GitHub
γονέας
ddded3a6d2
υποβολή
eb5614d250
@@ -123,10 +123,14 @@ rocDecStatus RocDecoder::mapVideoFrame(int pic_idx, void *dev_mem_ptr[3],
|
||||
return rocdec_status;
|
||||
}
|
||||
|
||||
rocDecStatus RocDecoder::unMapVideoFrame(void *pMappedDevPtr) {
|
||||
// todo:: return appropriate decStatus
|
||||
// Unmap a previously mapped video frame with the associated mapped raw pointer (pMappedDevPtr)
|
||||
return ROCDEC_NOT_IMPLEMENTED;
|
||||
rocDecStatus RocDecoder::unMapVideoFrame(int pic_idx) {
|
||||
if (pic_idx >= hip_ext_mem_.size()) {
|
||||
return ROCDEC_INVALID_PARAMETER;
|
||||
}
|
||||
|
||||
CHECK_HIP(hipDestroyExternalMemory(hip_ext_mem_[pic_idx]));
|
||||
|
||||
return ROCDEC_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
rocDecStatus getDecodeStatus(int nPicIdx, RocdecDecodeStatus* pDecodeStatus);
|
||||
rocDecStatus reconfigureDecoder(RocdecReconfigureDecoderInfo *pDecReconfigParams);
|
||||
rocDecStatus mapVideoFrame(int pic_idx, void *dev_mem_ptr[3], unsigned int horizontal_pitch[3], RocdecProcParams *vid_postproc_params);
|
||||
rocDecStatus unMapVideoFrame(void *pMappedDevPtr);
|
||||
rocDecStatus unMapVideoFrame(int pic_idx);
|
||||
|
||||
private:
|
||||
rocDecStatus InitHIP(int device_id);
|
||||
|
||||
@@ -180,15 +180,15 @@ rocDecMapVideoFrame(rocDecDecoderHandle hDecoder, int nPicIdx,
|
||||
}
|
||||
|
||||
/*****************************************************************************************************/
|
||||
//! \fn rocDecStatus ROCDECAPI rocDecUnMapVideoFrame(rocDecDecoderHandle hDecoder, void *pMappedDevPtr)
|
||||
//! Unmap a previously mapped video frame with the associated mapped raw pointer (pMappedDevPtr)
|
||||
//! \fn rocDecStatus ROCDECAPI rocDecUnMapVideoFrame(rocDecDecoderHandle hDecoder, int nPicIdx)
|
||||
//! Unmap a previously mapped video frame with the associated nPicIdx
|
||||
/*****************************************************************************************************/
|
||||
rocDecStatus ROCDECAPI
|
||||
rocDecUnMapVideoFrame(rocDecDecoderHandle hDecoder, void *pMappedDevPtr) {
|
||||
rocDecUnMapVideoFrame(rocDecDecoderHandle hDecoder, int pic_idx) {
|
||||
auto handle = static_cast<DecHandle *> (hDecoder);
|
||||
rocDecStatus ret;
|
||||
try {
|
||||
ret = handle->roc_decoder->unMapVideoFrame(pMappedDevPtr);
|
||||
ret = handle->roc_decoder->unMapVideoFrame(pic_idx);
|
||||
}
|
||||
catch(const std::exception& e) {
|
||||
handle->capture_error(e.what());
|
||||
|
||||
Αναφορά σε νέο ζήτημα
Block a user