/** mm_jpegdec_intf_abort_job:
 *
 *  Arguments:
 *    @jobId: job id
 *
 *  Return:
 *       0 success, failure otherwise
 *
 *  Description:
 *       Abort the jpeg job
 *
 **/
static int32_t mm_jpegdec_intf_abort_job(uint32_t job_id)
{
  int32_t rc = -1;

  if (0 == job_id) {
    LOGE("invalid jobId");
    return rc;
  }

  pthread_mutex_lock(&g_dec_intf_lock);
  if (NULL == g_jpegdec_obj) {
    /* mm_jpeg obj not exists, return error */
    LOGE("mm_jpeg is not opened yet");
    pthread_mutex_unlock(&g_dec_intf_lock);
    return rc;
  }

  rc = mm_jpegdec_abort_job(g_jpegdec_obj, job_id);
  pthread_mutex_unlock(&g_dec_intf_lock);
  return rc;
}
/** mm_jpegdec_intf_abort_job:
 *
 *  Arguments:
 *    @jobId: job id
 *
 *  Return:
 *       0 success, failure otherwise
 *
 *  Description:
 *       Abort the jpeg job
 *
 **/
static int32_t mm_jpegdec_intf_abort_job(uint32_t job_id)
{
  int32_t rc = -1;

  if (0 == job_id) {
    CDBG_ERROR("%s:%d] invalid jobId", __func__, __LINE__);
    return rc;
  }

  pthread_mutex_lock(&g_dec_intf_lock);
  if (NULL == g_jpegdec_obj) {
    /* mm_jpeg obj not exists, return error */
    CDBG_ERROR("%s:%d] mm_jpeg is not opened yet", __func__, __LINE__);
    pthread_mutex_unlock(&g_dec_intf_lock);
    return rc;
  }

  rc = mm_jpegdec_abort_job(g_jpegdec_obj, job_id);
  pthread_mutex_unlock(&g_dec_intf_lock);
  return rc;
}