mjpeg_decoder_t::~mjpeg_decoder_t(void) {
	if(startedDecode_){
		vpu_WaitForInt(0);
	}
	debugPrint( "vpu_DecClose\n" );
	RetCode ret = vpu_DecClose(handle_);
	if (ret == RETCODE_FRAME_NOT_COMPLETE) {
		debugPrint("close with stale decode data\n");
		DecOutputInfo outinfo = {0};
		vpu_DecGetOutputInfo(handle_, &outinfo);
		ret = vpu_DecClose(handle_);
		if (ret != RETCODE_SUCCESS)
			fprintf(stderr,"vpu_DecClose failed\n");
	} else if( RETCODE_SUCCESS != ret ) {
		fprintf(stderr, "Error %d closing decoder\n",ret );
	}
}
Пример #2
0
VpuDec::~VpuDec()
{
	RetCode ret;
	ret = vpu_DecClose(handle);
	if (ret == RETCODE_FRAME_NOT_COMPLETE) {
		vpu_SWReset(handle, 0);
		ret = vpu_DecClose(handle);
		if (ret != RETCODE_SUCCESS)
			printf("vpu_DecClose failed\n");
	}
	printf("vpu_DecClose success\n");


	for (int i = 0; i < regfbcount; i++) {
		framebuf_free(&fbpool[i]);
	}


	if(dec_format == STD_AVC){
		IOFreePhyMem(&slice_mem_desc);
		IOFreePhyMem(&ps_mem_desc);
	}

	freeHwBuffer(&Dec_bufZone);

	if (dec_fb) {
		free(dec_fb);
		dec_fb = NULL;
	}

	if (dec_pfbpool) {
		free(dec_pfbpool);
		dec_pfbpool = NULL;
	}

}