static gboolean
gst_vdp_vpp_stop (GstVdpVideoPostProcess * vpp)
{
  gst_vdp_vpp_flush (vpp);

  if (vpp->vpool)
    g_object_unref (vpp->vpool);

  if (vpp->mixer != VDP_INVALID_HANDLE) {
    GstVdpDevice *device = vpp->device;
    VdpStatus status;

    status = device->vdp_video_mixer_destroy (vpp->mixer);
    if (status != VDP_STATUS_OK) {
      GST_ELEMENT_ERROR (vpp, RESOURCE, READ,
          ("Could not destroy vdpau decoder"),
          ("Error returned from vdpau was: %s",
              device->vdp_get_error_string (status)));
      return FALSE;
    }
  }

  return TRUE;
}