Changed rocDecode API header variable naming to Google C++ style. (#196)

* * rocDecode: Changed rocDecode API header variable naming to Google C++ style.

* * rocDecode: Unified AVC/H264 naming to AVC. Minor naming changes on HEVC related names.

* * rocDecode: Minor comment fix based on code review.
Este commit está contenido en:
jeffqjiangNew
2024-01-24 18:03:46 -05:00
cometido por GitHub
padre f352cb7548
commit cd6401750e
Se han modificado 15 ficheros con 500 adiciones y 514 borrados
+3 -3
Ver fichero
@@ -29,16 +29,16 @@ RocDecoder::RocDecoder(RocDecoderCreateInfo& decoder_create_info): va_video_deco
rocDecStatus RocDecoder::InitializeDecoder() {
rocDecStatus rocdec_status = ROCDEC_SUCCESS;
rocdec_status = InitHIP(decoder_create_info_.deviceid);
rocdec_status = InitHIP(decoder_create_info_.device_id);
if (rocdec_status != ROCDEC_SUCCESS) {
ERR("ERROR: Failed to initilize the HIP! with rocDecStatus# " + TOSTR(rocdec_status));
return rocdec_status;
}
if (decoder_create_info_.ulNumDecodeSurfaces < 1) {
if (decoder_create_info_.num_decode_surfaces < 1) {
ERR("ERROR: invalid number of decode surfaces ");
return ROCDEC_INVALID_PARAMETER;
}
hip_ext_mem_.resize(decoder_create_info_.ulNumDecodeSurfaces);
hip_ext_mem_.resize(decoder_create_info_.num_decode_surfaces);
rocdec_status = va_video_decoder_.InitializeDecoder(hip_dev_prop_.gcnArchName);
if (rocdec_status != ROCDEC_SUCCESS) {
+21 -21
Ver fichero
@@ -61,19 +61,19 @@ public:
auto it = vcn_spec_table.find(gcn_arch_name_base);
if (it != vcn_spec_table.end()) {
const VcnCodecsSpec& vcn_spec = it->second;
auto it1 = vcn_spec.codecs_spec.find(pdc->eCodecType);
auto it1 = vcn_spec.codecs_spec.find(pdc->codec_type);
if (it1 != vcn_spec.codecs_spec.end()) {
const CodecSpec& codec_spec = it1->second;
auto it_chroma_format = std::find(codec_spec.chroma_format.begin(), codec_spec.chroma_format.end(), pdc->eChromaFormat);
auto it_bitdepth_minus8 = std::find(codec_spec.bitdepth_minus8.begin(), codec_spec.bitdepth_minus8.end(), pdc->nBitDepthMinus8);
auto it_chroma_format = std::find(codec_spec.chroma_format.begin(), codec_spec.chroma_format.end(), pdc->chroma_format);
auto it_bitdepth_minus8 = std::find(codec_spec.bitdepth_minus8.begin(), codec_spec.bitdepth_minus8.end(), pdc->bit_depth_minus_8);
if (it_chroma_format != codec_spec.chroma_format.end() && it_bitdepth_minus8 != codec_spec.bitdepth_minus8.end()) {
pdc->bIsSupported = 1;
pdc->nNumDecoders = vcn_spec.num_decoders;
pdc->nOutputFormatMask = codec_spec.output_format_mask;
pdc->nMaxWidth = codec_spec.max_width;
pdc->nMaxHeight = codec_spec.max_height;
pdc->nMinWidth = codec_spec.min_width;
pdc->nMinHeight = codec_spec.min_height;
pdc->is_supported = 1;
pdc->num_decoders = vcn_spec.num_decoders;
pdc->output_format_mask = codec_spec.output_format_mask;
pdc->max_width = codec_spec.max_width;
pdc->max_height = codec_spec.max_height;
pdc->min_width = codec_spec.min_width;
pdc->min_height = codec_spec.min_height;
return ROCDEC_SUCCESS;
} else {
return ROCDEC_NOT_SUPPORTED;
@@ -119,17 +119,17 @@ private:
// {codec2, {{chroma_format1_for_codec2, chroma_format2_for_codec2, ...}, {bit_depth1_minus8_for_codec2, bit_depth2_minus8_for_codec2, ...}, output_format_mask_for_codec2, max_width_for_codec2, max_height_for_codec2, min_width_for_codec2, min_height_for_codec2}}}
// , vcn_instances_for_gcn_arch_name1}},
vcn_spec_table = {
{"gfx908",{{{rocDecVideoCodec_HEVC, {{rocDecVideoChromaFormat_420}, {0, 2}, 3, 4096, 2176, 64, 64}}, {rocDecVideoCodec_H264, {{rocDecVideoChromaFormat_420}, {0}, 1, 4096, 2160, 64, 64}}}, 2}},
{"gfx90a",{{{rocDecVideoCodec_HEVC, {{rocDecVideoChromaFormat_420}, {0, 2}, 3, 4096, 2176, 64, 64}}, {rocDecVideoCodec_H264, {{rocDecVideoChromaFormat_420}, {0}, 1, 4096, 2160, 64, 64}}}, 2}},
{"gfx940",{{{rocDecVideoCodec_HEVC, {{rocDecVideoChromaFormat_420}, {0, 2}, 3, 7680, 4320, 64, 64}}, {rocDecVideoCodec_H264, {{rocDecVideoChromaFormat_420}, {0}, 1, 4096, 2176, 64, 64}}}, 3}},
{"gfx941",{{{rocDecVideoCodec_HEVC, {{rocDecVideoChromaFormat_420}, {0, 2}, 3, 7680, 4320, 64, 64}}, {rocDecVideoCodec_H264, {{rocDecVideoChromaFormat_420}, {0}, 1, 4096, 2176, 64, 64}}}, 4}},
{"gfx942",{{{rocDecVideoCodec_HEVC, {{rocDecVideoChromaFormat_420}, {0, 2}, 3, 7680, 4320, 64, 64}}, {rocDecVideoCodec_H264, {{rocDecVideoChromaFormat_420}, {0}, 1, 4096, 2176, 64, 64}}}, 3}},
{"gfx1030",{{{rocDecVideoCodec_HEVC, {{rocDecVideoChromaFormat_420}, {0, 2}, 3, 7680, 4320, 64, 64}}, {rocDecVideoCodec_H264, {{rocDecVideoChromaFormat_420}, {0}, 1, 4096, 2176, 64, 64}}}, 2}},
{"gfx1031",{{{rocDecVideoCodec_HEVC, {{rocDecVideoChromaFormat_420}, {0, 2}, 3, 7680, 4320, 64, 64}}, {rocDecVideoCodec_H264, {{rocDecVideoChromaFormat_420}, {0}, 1, 4096, 2176, 64, 64}}}, 2}},
{"gfx1032",{{{rocDecVideoCodec_HEVC, {{rocDecVideoChromaFormat_420}, {0, 2}, 3, 7680, 4320, 64, 64}}, {rocDecVideoCodec_H264, {{rocDecVideoChromaFormat_420}, {0}, 1, 4096, 2176, 64, 64}}}, 2}},
{"gfx1100",{{{rocDecVideoCodec_HEVC, {{rocDecVideoChromaFormat_420}, {0, 2}, 3, 7680, 4320, 64, 64}}, {rocDecVideoCodec_H264, {{rocDecVideoChromaFormat_420}, {0}, 1, 4096, 2176, 64, 64}}}, 2}},
{"gfx1101",{{{rocDecVideoCodec_HEVC, {{rocDecVideoChromaFormat_420}, {0, 2}, 3, 7680, 4320, 64, 64}}, {rocDecVideoCodec_H264, {{rocDecVideoChromaFormat_420}, {0}, 1, 4096, 2176, 64, 64}}}, 1}},
{"gfx1102",{{{rocDecVideoCodec_HEVC, {{rocDecVideoChromaFormat_420}, {0, 2}, 3, 7680, 4320, 64, 64}}, {rocDecVideoCodec_H264, {{rocDecVideoChromaFormat_420}, {0}, 1, 4096, 2176, 64, 64}}}, 2}},};
{"gfx908",{{{rocDecVideoCodec_HEVC, {{rocDecVideoChromaFormat_420}, {0, 2}, 3, 4096, 2176, 64, 64}}, {rocDecVideoCodec_AVC, {{rocDecVideoChromaFormat_420}, {0}, 1, 4096, 2160, 64, 64}}}, 2}},
{"gfx90a",{{{rocDecVideoCodec_HEVC, {{rocDecVideoChromaFormat_420}, {0, 2}, 3, 4096, 2176, 64, 64}}, {rocDecVideoCodec_AVC, {{rocDecVideoChromaFormat_420}, {0}, 1, 4096, 2160, 64, 64}}}, 2}},
{"gfx940",{{{rocDecVideoCodec_HEVC, {{rocDecVideoChromaFormat_420}, {0, 2}, 3, 7680, 4320, 64, 64}}, {rocDecVideoCodec_AVC, {{rocDecVideoChromaFormat_420}, {0}, 1, 4096, 2176, 64, 64}}}, 3}},
{"gfx941",{{{rocDecVideoCodec_HEVC, {{rocDecVideoChromaFormat_420}, {0, 2}, 3, 7680, 4320, 64, 64}}, {rocDecVideoCodec_AVC, {{rocDecVideoChromaFormat_420}, {0}, 1, 4096, 2176, 64, 64}}}, 4}},
{"gfx942",{{{rocDecVideoCodec_HEVC, {{rocDecVideoChromaFormat_420}, {0, 2}, 3, 7680, 4320, 64, 64}}, {rocDecVideoCodec_AVC, {{rocDecVideoChromaFormat_420}, {0}, 1, 4096, 2176, 64, 64}}}, 3}},
{"gfx1030",{{{rocDecVideoCodec_HEVC, {{rocDecVideoChromaFormat_420}, {0, 2}, 3, 7680, 4320, 64, 64}}, {rocDecVideoCodec_AVC, {{rocDecVideoChromaFormat_420}, {0}, 1, 4096, 2176, 64, 64}}}, 2}},
{"gfx1031",{{{rocDecVideoCodec_HEVC, {{rocDecVideoChromaFormat_420}, {0, 2}, 3, 7680, 4320, 64, 64}}, {rocDecVideoCodec_AVC, {{rocDecVideoChromaFormat_420}, {0}, 1, 4096, 2176, 64, 64}}}, 2}},
{"gfx1032",{{{rocDecVideoCodec_HEVC, {{rocDecVideoChromaFormat_420}, {0, 2}, 3, 7680, 4320, 64, 64}}, {rocDecVideoCodec_AVC, {{rocDecVideoChromaFormat_420}, {0}, 1, 4096, 2176, 64, 64}}}, 2}},
{"gfx1100",{{{rocDecVideoCodec_HEVC, {{rocDecVideoChromaFormat_420}, {0, 2}, 3, 7680, 4320, 64, 64}}, {rocDecVideoCodec_AVC, {{rocDecVideoChromaFormat_420}, {0}, 1, 4096, 2176, 64, 64}}}, 2}},
{"gfx1101",{{{rocDecVideoCodec_HEVC, {{rocDecVideoChromaFormat_420}, {0, 2}, 3, 7680, 4320, 64, 64}}, {rocDecVideoCodec_AVC, {{rocDecVideoChromaFormat_420}, {0}, 1, 4096, 2176, 64, 64}}}, 1}},
{"gfx1102",{{{rocDecVideoCodec_HEVC, {{rocDecVideoChromaFormat_420}, {0, 2}, 3, 7680, 4320, 64, 64}}, {rocDecVideoCodec_AVC, {{rocDecVideoChromaFormat_420}, {0}, 1, 4096, 2176, 64, 64}}}, 2}},};
}
RocDecVcnCodecSpec(const RocDecVcnCodecSpec&) = delete;
RocDecVcnCodecSpec& operator = (const RocDecVcnCodecSpec) = delete;
+6 -6
Ver fichero
@@ -62,8 +62,8 @@ rocDecDestroyDecoder(rocDecDecoderHandle decoder_handle) {
/**********************************************************************************************************************/
//! \fn rocDecStatus ROCDECAPI rocdecGetDecoderCaps(rocDecDecoderHandle decoder_handle, RocdecDecodeCaps *pdc)
//! Queries decode capabilities of AMD's VCN decoder based on CodecType, ChromaFormat and BitDepthMinus8 parameters.
//! 1. Application fills IN parameters CodecType, ChromaFormat and BitDepthMinus8 of RocdecDecodeCaps structure
//! Queries decode capabilities of AMD's VCN decoder based on codec type, chroma_format and BitDepthMinus8 parameters.
//! 1. Application fills IN parameters codec_type, chroma_format and BitDepthMinus8 of RocdecDecodeCaps structure
//! 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.
/**********************************************************************************************************************/
@@ -84,13 +84,13 @@ rocDecGetDecoderCaps(RocdecDecodeCaps *pdc) {
ERR("ERROR: didn't find any GPU!");
return ROCDEC_DEVICE_INVALID;
}
if (pdc->deviceid >= num_devices) {
if (pdc->device_id >= num_devices) {
ERR("ERROR: the requested device_id is not found! ");
return ROCDEC_DEVICE_INVALID;
}
hip_status = hipGetDeviceProperties(&hip_dev_prop, pdc->deviceid);
hip_status = hipGetDeviceProperties(&hip_dev_prop, pdc->device_id);
if (hip_status != hipSuccess) {
ERR("ERROR: hipGetDeviceProperties for device (" +TOSTR(pdc->deviceid) + " ) failed! (" + TOSTR(hip_status) + ")" );
ERR("ERROR: hipGetDeviceProperties for device (" +TOSTR(pdc->device_id) + " ) failed! (" + TOSTR(hip_status) + ")" );
return ROCDEC_DEVICE_INVALID;
}
@@ -148,7 +148,7 @@ rocDecGetDecodeStatus(rocDecDecoderHandle decoder_handle, int pic_idx, RocdecDec
/*********************************************************************************************************/
//! \fn rocDecStatus ROCDECAPI rocDecReconfigureDecoder(rocDecDecoderHandle decoder_handle, RocdecReconfigureDecoderInfo *reconfig_params)
//! Used to reuse single decoder for multiple clips. Currently supports resolution change, resize params
//! params, target area params change for same codec. Must be called during RocdecParserParams::pfnSequenceCallback
//! params, target area params change for same codec. Must be called during RocdecParserParams::pfn_sequence_callback
/*********************************************************************************************************/
rocDecStatus ROCDECAPI
rocDecReconfigureDecoder(rocDecDecoderHandle decoder_handle, RocdecReconfigureDecoderInfo *reconfig_params) {
+36 -36
Ver fichero
@@ -63,8 +63,8 @@ rocDecStatus VaapiVideoDecoder::InitializeDecoder(std::string gcn_arch_name) {
//Before initializing the VAAPI, first check to see if the requested codec config is supported
RocDecVcnCodecSpec& vcn_codec_spec = RocDecVcnCodecSpec::GetInstance();
if (!vcn_codec_spec.IsCodecConfigSupported(gcn_arch_name, decoder_create_info_.CodecType, decoder_create_info_.ChromaFormat,
decoder_create_info_.bitDepthMinus8, decoder_create_info_.OutputFormat)) {
if (!vcn_codec_spec.IsCodecConfigSupported(gcn_arch_name, decoder_create_info_.codec_type, decoder_create_info_.chroma_format,
decoder_create_info_.bit_depth_minus_8, decoder_create_info_.output_format)) {
ERR("ERROR: the codec config combination is not supported!");
return ROCDEC_NOT_SUPPORTED;
}
@@ -76,7 +76,7 @@ rocDecStatus VaapiVideoDecoder::InitializeDecoder(std::string gcn_arch_name) {
int num_render_cards_per_device = ((gcn_arch_name_base.compare("gfx940") == 0) ||
(gcn_arch_name_base.compare("gfx941") == 0) ||
(gcn_arch_name_base.compare("gfx942") == 0)) ? 8 : 1;
std::string drm_node = "/dev/dri/renderD" + std::to_string(128 + decoder_create_info_.deviceid * num_render_cards_per_device);
std::string drm_node = "/dev/dri/renderD" + std::to_string(128 + decoder_create_info_.device_id * num_render_cards_per_device);
rocdec_status = InitVAAPI(drm_node);
if (rocdec_status != ROCDEC_SUCCESS) {
ERR("ERROR: Failed to initilize the VAAPI!" + TOSTR(rocdec_status));
@@ -118,15 +118,15 @@ rocDecStatus VaapiVideoDecoder::InitVAAPI(std::string drm_node) {
}
rocDecStatus VaapiVideoDecoder::CreateDecoderConfig() {
switch (decoder_create_info_.CodecType) {
switch (decoder_create_info_.codec_type) {
case rocDecVideoCodec_HEVC:
if (decoder_create_info_.bitDepthMinus8 == 0) {
if (decoder_create_info_.bit_depth_minus_8 == 0) {
va_profile_ = VAProfileHEVCMain;
} else if (decoder_create_info_.bitDepthMinus8 == 2) {
} else if (decoder_create_info_.bit_depth_minus_8 == 2) {
va_profile_ = VAProfileHEVCMain10;
}
break;
case rocDecVideoCodec_H264:
case rocDecVideoCodec_AVC:
va_profile_ = VAProfileH264Main;
break;
default:
@@ -140,13 +140,13 @@ rocDecStatus VaapiVideoDecoder::CreateDecoderConfig() {
}
rocDecStatus VaapiVideoDecoder::CreateSurfaces() {
if (decoder_create_info_.ulNumDecodeSurfaces < 1) {
if (decoder_create_info_.num_decode_surfaces < 1) {
ERR("ERROR: invalid number of decode surfaces ");
return ROCDEC_INVALID_PARAMETER;
}
va_surface_ids_.resize(decoder_create_info_.ulNumDecodeSurfaces);
va_surface_ids_.resize(decoder_create_info_.num_decode_surfaces);
uint8_t surface_format;
switch (decoder_create_info_.ChromaFormat) {
switch (decoder_create_info_.chroma_format) {
case rocDecVideoChromaFormat_Monochrome:
surface_format = VA_RT_FORMAT_YUV400;
break;
@@ -164,14 +164,14 @@ rocDecStatus VaapiVideoDecoder::CreateSurfaces() {
return ROCDEC_NOT_SUPPORTED;
}
CHECK_VAAPI(vaCreateSurfaces(va_display_, surface_format, decoder_create_info_.ulWidth,
decoder_create_info_.ulHeight, va_surface_ids_.data(), va_surface_ids_.size(), nullptr, 0));
CHECK_VAAPI(vaCreateSurfaces(va_display_, surface_format, decoder_create_info_.width,
decoder_create_info_.height, va_surface_ids_.data(), va_surface_ids_.size(), nullptr, 0));
return ROCDEC_SUCCESS;
}
rocDecStatus VaapiVideoDecoder::CreateContext() {
CHECK_VAAPI(vaCreateContext(va_display_, va_config_id_, decoder_create_info_.ulWidth, decoder_create_info_.ulHeight,
CHECK_VAAPI(vaCreateContext(va_display_, va_config_id_, decoder_create_info_.width, decoder_create_info_.height,
VA_PROGRESSIVE, va_surface_ids_.data(), va_surface_ids_.size(), &va_context_id_));
return ROCDEC_SUCCESS;
}
@@ -203,23 +203,23 @@ rocDecStatus VaapiVideoDecoder::SubmitDecode(RocdecPicParams *pPicParams) {
VASurfaceID curr_surface_id;
// Get the surface id for the current picture, assuming 1:1 mapping between DPB and VAAPI decoded surfaces.
if (pPicParams->CurrPicIdx >= va_surface_ids_.size() || pPicParams->CurrPicIdx < 0) {
ERR("CurrPicIdx exceeded the VAAPI surface pool limit.");
if (pPicParams->curr_pic_idx >= va_surface_ids_.size() || pPicParams->curr_pic_idx < 0) {
ERR("curr_pic_idx exceeded the VAAPI surface pool limit.");
return ROCDEC_INVALID_PARAMETER;
}
curr_surface_id = va_surface_ids_[pPicParams->CurrPicIdx];
curr_surface_id = va_surface_ids_[pPicParams->curr_pic_idx];
// Upload data buffers
switch (decoder_create_info_.CodecType) {
switch (decoder_create_info_.codec_type) {
case rocDecVideoCodec_HEVC: {
pPicParams->pic_params.hevc.curr_pic.PicIdx = curr_surface_id;
pPicParams->pic_params.hevc.curr_pic.pic_idx = curr_surface_id;
for (int i = 0; i < 15; i++) {
if (pPicParams->pic_params.hevc.ref_frames[i].PicIdx != 0xFF) {
if (pPicParams->pic_params.hevc.ref_frames[i].PicIdx >= va_surface_ids_.size() || pPicParams->pic_params.hevc.ref_frames[i].PicIdx < 0) {
if (pPicParams->pic_params.hevc.ref_frames[i].pic_idx != 0xFF) {
if (pPicParams->pic_params.hevc.ref_frames[i].pic_idx >= va_surface_ids_.size() || pPicParams->pic_params.hevc.ref_frames[i].pic_idx < 0) {
ERR("Reference frame index exceeded the VAAPI surface pool limit.");
return ROCDEC_INVALID_PARAMETER;
}
pPicParams->pic_params.hevc.ref_frames[i].PicIdx = va_surface_ids_[pPicParams->pic_params.hevc.ref_frames[i].PicIdx];
pPicParams->pic_params.hevc.ref_frames[i].pic_idx = va_surface_ids_[pPicParams->pic_params.hevc.ref_frames[i].pic_idx];
}
}
pic_params_ptr = (void*)&pPicParams->pic_params.hevc;
@@ -242,15 +242,15 @@ rocDecStatus VaapiVideoDecoder::SubmitDecode(RocdecPicParams *pPicParams) {
break;
}
case rocDecVideoCodec_H264: {
pPicParams->pic_params.avc.curr_pic.PicIdx = curr_surface_id;
case rocDecVideoCodec_AVC: {
pPicParams->pic_params.avc.curr_pic.pic_idx = curr_surface_id;
for (int i = 0; i < 16; i++) {
if (pPicParams->pic_params.avc.ref_frames[i].PicIdx != 0xFF) {
if (pPicParams->pic_params.avc.ref_frames[i].PicIdx >= va_surface_ids_.size() || pPicParams->pic_params.avc.ref_frames[i].PicIdx < 0) {
if (pPicParams->pic_params.avc.ref_frames[i].pic_idx != 0xFF) {
if (pPicParams->pic_params.avc.ref_frames[i].pic_idx >= va_surface_ids_.size() || pPicParams->pic_params.avc.ref_frames[i].pic_idx < 0) {
ERR("Reference frame index exceeded the VAAPI surface pool limit.");
return ROCDEC_INVALID_PARAMETER;
}
pPicParams->pic_params.avc.ref_frames[i].PicIdx = va_surface_ids_[pPicParams->pic_params.avc.ref_frames[i].PicIdx];
pPicParams->pic_params.avc.ref_frames[i].pic_idx = va_surface_ids_[pPicParams->pic_params.avc.ref_frames[i].pic_idx];
}
}
pic_params_ptr = (void*)&pPicParams->pic_params.avc;
@@ -286,7 +286,7 @@ rocDecStatus VaapiVideoDecoder::SubmitDecode(RocdecPicParams *pPicParams) {
CHECK_VAAPI(vaCreateBuffer(va_display_, va_context_id_, VAIQMatrixBufferType, iq_matrix_size, 1, iq_matrix_ptr, &iq_matrix_buf_id_));
}
CHECK_VAAPI(vaCreateBuffer(va_display_, va_context_id_, VASliceParameterBufferType, slice_params_size, 1, slice_params_ptr, &slice_params_buf_id_));
CHECK_VAAPI(vaCreateBuffer(va_display_, va_context_id_, VASliceDataBufferType, pPicParams->nBitstreamDataLen, 1, (void*)pPicParams->pBitstreamData, &slice_data_buf_id_));
CHECK_VAAPI(vaCreateBuffer(va_display_, va_context_id_, VASliceDataBufferType, pPicParams->bitstream_data_len, 1, (void*)pPicParams->bitstream_data, &slice_data_buf_id_));
// Sumbmit buffers to VAAPI driver
CHECK_VAAPI(vaBeginPicture(va_display_, va_context_id_, curr_surface_id));
@@ -309,16 +309,16 @@ rocDecStatus VaapiVideoDecoder::GetDecodeStatus(int pic_idx, RocdecDecodeStatus
CHECK_VAAPI(vaQuerySurfaceStatus(va_display_, va_surface_ids_[pic_idx], &va_surface_status));
switch (va_surface_status) {
case VASurfaceRendering:
decode_status->decodeStatus = rocDecodeStatus_InProgress;
decode_status->decode_status = rocDecodeStatus_InProgress;
break;
case VASurfaceReady:
decode_status->decodeStatus = rocDecodeStatus_Success;
decode_status->decode_status = rocDecodeStatus_Success;
break;
case VASurfaceDisplaying:
decode_status->decodeStatus = rocDecodeStatus_Displaying;
decode_status->decode_status = rocDecodeStatus_Displaying;
break;
default:
decode_status->decodeStatus = rocDecodeStatus_Invalid;
decode_status->decode_status = rocDecodeStatus_Invalid;
}
return ROCDEC_SUCCESS;
}
@@ -348,11 +348,11 @@ rocDecStatus VaapiVideoDecoder::ReconfigureDecoder(RocdecReconfigureDecoderInfo
CHECK_VAAPI(vaDestroyContext(va_display_, va_context_id_));
va_surface_ids_.clear();
decoder_create_info_.ulWidth = reconfig_params->ulWidth;
decoder_create_info_.ulHeight = reconfig_params->ulHeight;
decoder_create_info_.ulNumDecodeSurfaces = reconfig_params->ulNumDecodeSurfaces;
decoder_create_info_.ulTargetHeight = reconfig_params->ulTargetHeight;
decoder_create_info_.ulTargetWidth = reconfig_params->ulTargetWidth;
decoder_create_info_.width = reconfig_params->width;
decoder_create_info_.height = reconfig_params->height;
decoder_create_info_.num_decode_surfaces = reconfig_params->num_decode_surfaces;
decoder_create_info_.target_height = reconfig_params->target_height;
decoder_create_info_.target_width = reconfig_params->target_width;
rocDecStatus rocdec_status = CreateSurfaces();
if (rocdec_status != ROCDEC_SUCCESS) {