Rr/roc video decode class (#20)
* WIP: class implementation * add more definitions * rocvideodecode implementation * formatting fixes * address review comments
This commit is contained in:
@@ -42,13 +42,6 @@ RocDecoder::RocDecoder(int device_id):device_id_ {device_id}, num_devices_{0} {
|
||||
}
|
||||
}
|
||||
}
|
||||
rocDecStatus RocDecoder::getDecoderCaps(RocdecDecodeCaps *pdc) {
|
||||
// todo:: return appropriate decStatus if fails
|
||||
//vaQueryConfigProfiles
|
||||
// fill the RocdecDecodeCaps struct
|
||||
// return status
|
||||
return ROCDEC_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
rocDecStatus RocDecoder::decodeFrame(RocdecPicParams *pPicParams) {
|
||||
// todo:: return appropriate decStatus if fails
|
||||
@@ -73,7 +66,7 @@ rocDecStatus RocDecoder::reconfigureDecoder(RocdecReconfigureDecoderInfo *pDecRe
|
||||
}
|
||||
|
||||
rocDecStatus RocDecoder::mapVideoFrame(int nPicIdx, void *pDevMemPtr[3],
|
||||
unsigned int *pHorizontalPitch[3], RocdecProcParams *pVidPostprocParams) {
|
||||
unsigned int pHorizontalPitch[3], RocdecProcParams *pVidPostprocParams) {
|
||||
// todo:: return appropriate decStatus
|
||||
// Post-process and map video frame corresponding to nPicIdx for use in HIP. Returns HIP device pointer and associated
|
||||
// pitch(horizontal stride) of the video frame. Returns device memory pointers for each plane (Y, U and V) seperately
|
||||
|
||||
@@ -38,11 +38,10 @@ class RocDecoder {
|
||||
public:
|
||||
RocDecoder(int device_id = 0);
|
||||
~RocDecoder();
|
||||
rocDecStatus getDecoderCaps(RocdecDecodeCaps *pdc);
|
||||
rocDecStatus decodeFrame(RocdecPicParams *pPicParams);
|
||||
rocDecStatus getDecodeStatus(int nPicIdx, RocdecDecodeStatus* pDecodeStatus);
|
||||
rocDecStatus reconfigureDecoder(RocdecReconfigureDecoderInfo *pDecReconfigParams);
|
||||
rocDecStatus mapVideoFrame(int nPicIdx, void *pDevMemPtr[3], unsigned int *pHorizontalPitch[3], RocdecProcParams *pVidPostprocParams);
|
||||
rocDecStatus mapVideoFrame(int nPicIdx, void *pDevMemPtr[3], unsigned int pHorizontalPitch[3], RocdecProcParams *pVidPostprocParams);
|
||||
rocDecStatus unMapVideoFrame(void *pMappedDevPtr);
|
||||
|
||||
private:
|
||||
|
||||
@@ -58,19 +58,9 @@ rocDecDestroyDecoder(rocDecDecoderHandle hDecoder) {
|
||||
//! 2. On calling rocdecGetDecoderCaps, driver fills OUT parameters if the IN parameters are supported
|
||||
//! If IN parameters passed to the driver are not supported by AMD-VCN-HW, then all OUT params are set to 0.
|
||||
/**********************************************************************************************************************/
|
||||
rocDecStatus ROCDECAPI
|
||||
rocDecGetDecoderCaps(rocDecDecoderHandle hDecoder, RocdecDecodeCaps *pdc) {
|
||||
auto handle = static_cast<DecHandle *> (hDecoder);
|
||||
rocDecStatus ret;
|
||||
try {
|
||||
ret = handle->roc_decoder->getDecoderCaps(pdc);
|
||||
}
|
||||
catch(const std::exception& e) {
|
||||
handle->capture_error(e.what());
|
||||
ERR(e.what())
|
||||
return ROCDEC_RUNTIME_ERROR;
|
||||
}
|
||||
return ret;
|
||||
rocDecStatus ROCDECAPI
|
||||
rocDecGetDecoderCaps(RocdecDecodeCaps *pdc) {
|
||||
return ROCDEC_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/*****************************************************************************************************/
|
||||
@@ -100,7 +90,7 @@ rocDecDecodeFrame(rocDecDecoderHandle hDecoder, RocdecPicParams *pPicParams) {
|
||||
//! API returns CUDA_ERROR_NOT_SUPPORTED error code for unsupported GPU or codec.
|
||||
/************************************************************************************************************/
|
||||
rocDecStatus ROCDECAPI
|
||||
RocdecGetDecodeStatus(rocDecDecoderHandle hDecoder, int nPicIdx, RocdecDecodeStatus* pDecodeStatus) {
|
||||
rocDecGetDecodeStatus(rocDecDecoderHandle hDecoder, int nPicIdx, RocdecDecodeStatus* pDecodeStatus) {
|
||||
auto handle = static_cast<DecHandle *> (hDecoder);
|
||||
rocDecStatus ret;
|
||||
try {
|
||||
@@ -143,7 +133,7 @@ rocDecReconfigureDecoder(rocDecDecoderHandle hDecoder, RocdecReconfigureDecoderI
|
||||
/************************************************************************************************************************/
|
||||
rocDecStatus ROCDECAPI
|
||||
rocDecMapVideoFrame(rocDecDecoderHandle hDecoder, int nPicIdx,
|
||||
void *pDevMemPtr[3], unsigned int *pHorizontalPitch[3], RocdecProcParams *pVidPostprocParams) {
|
||||
void *pDevMemPtr[3], uint32_t (&pHorizontalPitch)[3], RocdecProcParams *pVidPostprocParams) {
|
||||
auto handle = static_cast<DecHandle *> (hDecoder);
|
||||
rocDecStatus ret;
|
||||
try {
|
||||
|
||||
Fai riferimento in un nuovo problema
Block a user