cleanup_pipe_state(c);
}
-void
+bool
vl_compositor_set_csc_matrix(struct vl_compositor_state *s,
vl_csc_matrix const *matrix,
float luma_min, float luma_max)
PIPE_TRANSFER_WRITE | PIPE_TRANSFER_DISCARD_RANGE,
&buf_transfer);
+ if (!ptr)
+ return false;
+
memcpy(ptr, matrix, sizeof(vl_csc_matrix));
ptr += sizeof(vl_csc_matrix)/sizeof(float);
ptr[1] = luma_max;
pipe_buffer_unmap(s->pipe, buf_transfer);
+
+ return true;
}
void
sizeof(csc_matrix) + 2*sizeof(float)
);
+ if (!s->csc_matrix)
+ return false;
+
vl_compositor_clear_layers(s);
vl_csc_get_matrix(VL_CSC_COLOR_STANDARD_IDENTITY, NULL, true, &csc_matrix);
- vl_compositor_set_csc_matrix(s, (const vl_csc_matrix *)&csc_matrix, 1.0f, 0.0f);
+ if (!vl_compositor_set_csc_matrix(s, (const vl_csc_matrix *)&csc_matrix, 1.0f, 0.0f))
+ return false;
return true;
}
/**
* set yuv -> rgba conversion matrix
*/
-void
+bool
vl_compositor_set_csc_matrix(struct vl_compositor_state *settings,
const vl_csc_matrix *matrix,
float luma_min, float luma_max);