+static void get_format_from_properties( mlt_properties properties, ImageFormat* image_format, YCbCrFormat* ycbcr_format )
+{
+ switch ( mlt_properties_get_int( properties, "colorspace" ) ) {
+ case 601:
+ ycbcr_format->luma_coefficients = YCBCR_REC_601;
+ break;
+ case 709:
+ default:
+ ycbcr_format->luma_coefficients = YCBCR_REC_709;
+ break;
+ }
+
+ switch ( mlt_properties_get_int( properties, "color_primaries" ) ) {
+ case 601625:
+ image_format->color_space = COLORSPACE_REC_601_625;
+ break;
+ case 601525:
+ image_format->color_space = COLORSPACE_REC_601_525;
+ break;
+ case 709:
+ default:
+ image_format->color_space = COLORSPACE_REC_709;
+ break;
+ }
+
+ image_format->gamma_curve = GAMMA_REC_709;
+
+ if ( mlt_properties_get_int( properties, "force_full_luma" ) ) {
+ ycbcr_format->full_range = true;
+ } else {
+ ycbcr_format->full_range = ( mlt_properties_get_int( properties, "full_luma" ) == 1 );
+ }
+
+ // TODO: make new frame properties set by producers
+ ycbcr_format->cb_x_position = ycbcr_format->cr_x_position = 0.0f;
+ ycbcr_format->cb_y_position = ycbcr_format->cr_y_position = 0.5f;
+}
+