Fix the performance issue introduced after PR#192 (#220)

* Fix the performance issue introduced after PR#192

* Destroy the current interop memories before reconfiguration

* initialize the interop to 0 after unmapping a surface

* code clean up

* check the mapped device mem/ext mem to be valid before destrying them

* code cleanup - add some comments

* make changes based on the reviewer comments
Этот коммит содержится в:
Aryan Salmanpour
2024-02-05 17:12:39 -05:00
коммит произвёл GitHub
родитель d4e3dac5e6
Коммит 929123abff
5 изменённых файлов: 124 добавлений и 62 удалений
+11 -1
Просмотреть файл
@@ -42,6 +42,16 @@ THE SOFTWARE.
}\
}
struct HipInteropDeviceMem {
hipExternalMemory_t hip_ext_mem; // Interface to the vaapi-hip interop
uint8_t* hip_mapped_device_mem; // Mapped device memory for the YUV plane
uint32_t width; // Width of the surface in pixels.
uint32_t height; // Height of the surface in pixels.
uint32_t offset[3]; // Offset of each plane
uint32_t pitch[3]; // Pitch of each plane
uint32_t num_layers; // Number of layers making up the surface
};
class RocDecoder {
public:
RocDecoder(RocDecoderCreateInfo &decoder_create_info);
@@ -59,5 +69,5 @@ private:
RocDecoderCreateInfo decoder_create_info_;
VaapiVideoDecoder va_video_decoder_;
hipDeviceProp_t hip_dev_prop_;
std::vector<hipExternalMemory_t> hip_ext_mem_;
std::vector<HipInteropDeviceMem> hip_interop_;
};