ImxVpuEncReturnCodes imx_vpu_jpeg_enc_close(ImxVpuJPEGEncoder *jpeg_encoder) { assert(jpeg_encoder != NULL); imx_vpu_jpeg_enc_close_internal(jpeg_encoder); if (jpeg_encoder->bitstream_buffer != NULL) imx_vpu_dma_buffer_deallocate(jpeg_encoder->bitstream_buffer); imx_vpu_enc_unload(); IMX_VPU_FREE(jpeg_encoder, sizeof(ImxVpuJPEGEncoder)); return IMX_VPU_ENC_RETURN_CODE_OK; }
void shutdown(Context *ctx) { unsigned int i; imx_vpu_enc_close(ctx->vpuenc); imx_vpu_dma_buffer_deallocate(ctx->input_fb_dmabuffer); imx_vpu_dma_buffer_deallocate(ctx->output_dmabuffer); free(ctx->framebuffers); for (i = 0; i < ctx->num_framebuffers; ++i) imx_vpu_dma_buffer_deallocate(ctx->fb_dmabuffers[i]); free(ctx->fb_dmabuffers); imx_vpu_dma_buffer_deallocate(ctx->bitstream_buffer); imx_vpu_enc_unload(); free(ctx); }
void shutdown(Context *ctx) { unsigned int i; /* Close the previously opened encoder instance */ imx_vpu_enc_close(ctx->vpuenc); /* Free all allocated memory (both regular and DMA memory) */ imx_vpu_dma_buffer_deallocate(ctx->input_fb_dmabuffer); free(ctx->framebuffers); for (i = 0; i < ctx->num_framebuffers; ++i) imx_vpu_dma_buffer_deallocate(ctx->fb_dmabuffers[i]); free(ctx->fb_dmabuffers); imx_vpu_dma_buffer_deallocate(ctx->bitstream_buffer); /* Unload the VPU firmware */ imx_vpu_enc_unload(); free(ctx); }
void gst_imx_vpu_encoder_unload() { g_mutex_lock(&load_mutex); imx_vpu_enc_unload(); g_mutex_unlock(&load_mutex); }