added md5 checksum with changes that Aryan and Rajy requested (#333)

Co-authored-by: Aryan Salmanpour <aryan.salmanpour@amd.com>
This commit is contained in:
Pavel Tcherniaev
2024-05-02 05:49:46 -07:00
committed by GitHub
parent 0f905f527c
commit 12fa766973
3 changed files with 86 additions and 3 deletions
+16
View File
@@ -989,6 +989,22 @@ void RocVideoDecoder::InitMd5() {
av_md5_init(md5_ctx_);
}
void RocVideoDecoder::UpdateMd5ForDataBuffer(void *pDevMem, int rgb_image_size){
uint8_t *hstPtr = nullptr;
hstPtr = new uint8_t [rgb_image_size];
hipError_t hip_status = hipSuccess;
hip_status = hipMemcpyDtoH((void *)hstPtr, pDevMem, rgb_image_size);
if (hip_status != hipSuccess) {
std::cout << "ERROR: hipMemcpyDtoH failed! (" << hip_status << ")" << std::endl;
delete [] hstPtr;
return;
}
av_md5_update(md5_ctx_, hstPtr, rgb_image_size);
if(hstPtr){
delete [] hstPtr;
}
}
void RocVideoDecoder::UpdateMd5ForFrame(void *surf_mem, OutputSurfaceInfo *surf_info) {
int i;
uint8_t *hst_ptr = nullptr;
+2
View File
@@ -332,6 +332,8 @@ class RocVideoDecoder {
*/
void InitMd5();
void UpdateMd5ForDataBuffer(void *pDevMem, int rgb_image_size);
/**
* @brief Helper function to dump decoded output surface to file
*