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:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user