@@ -104,6 +104,11 @@ static OfxStatus clipGetPropertySet(OfxImageClipHandle clip, OfxPropertySetHandl
104104 return kOfxStatOK ;
105105}
106106
107+ static OfxStatus propGetIntN (OfxPropertySetHandle properties ,
108+ const char * property ,
109+ int count ,
110+ int * value );
111+
107112static OfxStatus clipGetImage (OfxImageClipHandle clip ,
108113 OfxTime time ,
109114 const OfxRectD * region ,
@@ -112,7 +117,16 @@ static OfxStatus clipGetImage(OfxImageClipHandle clip,
112117 mlt_properties clip_temp = (mlt_properties ) clip ;
113118 * imageHandle = (OfxPropertySetHandle ) mlt_properties_get_data (clip_temp , "props" , NULL );
114119
115- /* WIP give him the default region if *region is not NULL */
120+ if (region != NULL ) {
121+ const OfxRectI rect = {0 , 0 , 0 , 0 };
122+ propGetIntN ((OfxPropertySetHandle ) * imageHandle , kOfxImagePropBounds , 4 , & rect .x1 );
123+
124+ OfxRectD * region2 = (OfxRectD * ) region ;
125+ region2 -> x1 = (double ) rect .x1 ;
126+ region2 -> x2 = (double ) rect .x2 ;
127+ region2 -> y1 = (double ) rect .y1 ;
128+ region2 -> y2 = (double ) rect .y2 ;
129+ }
116130
117131 return kOfxStatOK ;
118132}
@@ -488,10 +502,13 @@ static OfxStatus paramDefine(OfxParamSetHandle paramSet,
488502 them so plugins keep feeding use with parameters */
489503 mlt_properties pt = mlt_properties_new ();
490504 mlt_properties_set_string (pt , "t" , paramType );
505+
491506 mlt_properties param_props = mlt_properties_new ();
492507 mlt_properties_set_data (pt , "p" , param_props , 0 , (mlt_destructor ) mlt_properties_close , NULL );
493508 mlt_properties_set_data (params , name , pt , 0 , (mlt_destructor ) mlt_properties_close , NULL );
494509
510+ propSetString ((OfxPropertySetHandle ) param_props , kOfxParamPropType , 0 , paramType );
511+
495512 if (propertySet != NULL ) {
496513 * propertySet = (OfxPropertySetHandle ) param_props ;
497514 }
@@ -1633,10 +1650,17 @@ void mltofx_set_source_clip_data(OfxPlugin *plugin,
16331650 kOfxImageEffectPropPreMultiplication ,
16341651 0 ,
16351652 kOfxImageUnPreMultiplied );
1653+ propSetString ((OfxPropertySetHandle ) clip_prop , kOfxImagePropField , 0 , kOfxImageFieldBoth );
1654+
1655+ propSetString ((OfxPropertySetHandle ) clip_prop ,
1656+ kOfxImageClipPropFieldOrder ,
1657+ 0 ,
1658+ kOfxImageFieldBoth );
1659+
16361660 propSetString ((OfxPropertySetHandle ) clip_prop ,
1637- kOfxImagePropField ,
1661+ "OfxImageEffectPropRenderQuality" ,
16381662 0 ,
1639- kOfxImageFieldNone ); /* I'm not sure about this */
1663+ "OfxImageEffectPropRenderQualityBest" );
16401664
16411665 char * tstr = calloc (1 , strlen ("Source" ) + 11 );
16421666 sprintf (tstr , "%s%04d%04d" , "Source" , rand () % 9999 , rand () % 9999 ); /* WIP: do something better */
@@ -1734,10 +1758,16 @@ void mltofx_set_output_clip_data(OfxPlugin *plugin,
17341758 kOfxImageEffectPropPreMultiplication ,
17351759 0 ,
17361760 kOfxImageUnPreMultiplied );
1761+ propSetString ((OfxPropertySetHandle ) clip_prop , kOfxImagePropField , 0 , kOfxImageFieldBoth );
1762+ propSetString ((OfxPropertySetHandle ) clip_prop ,
1763+ kOfxImageClipPropFieldOrder ,
1764+ 0 ,
1765+ kOfxImageFieldBoth );
1766+
17371767 propSetString ((OfxPropertySetHandle ) clip_prop ,
1738- kOfxImagePropField ,
1768+ "OfxImageEffectPropRenderQuality" ,
17391769 0 ,
1740- kOfxImageFieldNone ); /* I'm not sure about this */
1770+ "OfxImageEffectPropRenderQualityBest" );
17411771
17421772 char * tstr = calloc (1 , strlen ("Output" ) + 11 );
17431773 sprintf (tstr , "%s%04d%04d" , "Output" , rand () % 9999 , rand () % 9999 ); /* WIP: do something better */
@@ -1871,11 +1901,9 @@ void *mltofx_fetch_params(OfxPlugin *plugin, mlt_properties params, mlt_properti
18711901 kOfxImageEffectContextGeneral );
18721902
18731903 plugin -> setHost (& MltOfxHost );
1874-
18751904 OfxStatus status_code = kOfxStatErrUnknown ;
18761905 status_code = plugin -> mainEntry (kOfxActionLoad , NULL , NULL , NULL );
18771906 mltofx_log_status_code (status_code , "kOfxActionLoad" );
1878-
18791907 status_code
18801908 = plugin -> mainEntry (kOfxActionDescribe , (OfxImageEffectHandle ) image_effect , NULL , NULL );
18811909 mltofx_log_status_code (status_code , "kOfxActionDescribe" );
@@ -1885,6 +1913,47 @@ void *mltofx_fetch_params(OfxPlugin *plugin, mlt_properties params, mlt_properti
18851913 (OfxPropertySetHandle ) MltOfxHost .host ,
18861914 NULL );
18871915
1916+ /* some plugins need to set some attributes at Source and Output before any other operation happen */
1917+ mlt_properties clip = NULL , clip_props = NULL ;
1918+ clipGetHandle ((OfxImageEffectHandle ) image_effect ,
1919+ "Source" ,
1920+ (OfxImageClipHandle * ) & clip ,
1921+ (OfxPropertySetHandle * ) & clip_props );
1922+
1923+ if (clip_props != NULL ) {
1924+ propSetString ((OfxPropertySetHandle ) clip_props ,
1925+ kOfxImageClipPropFieldOrder ,
1926+ 0 ,
1927+ kOfxImageFieldNone );
1928+
1929+ propSetString ((OfxPropertySetHandle ) clip_props ,
1930+ "OfxImageEffectPropRenderQuality" ,
1931+ 0 ,
1932+ "OfxImageEffectPropRenderQualityBest" );
1933+
1934+ propSetString ((OfxPropertySetHandle ) clip_props , kOfxImagePropField , 0 , kOfxImageFieldNone );
1935+ }
1936+
1937+ clip = NULL , clip_props = NULL ;
1938+ clipGetHandle ((OfxImageEffectHandle ) image_effect ,
1939+ "Source" ,
1940+ (OfxImageClipHandle * ) & clip ,
1941+ (OfxPropertySetHandle * ) & clip_props );
1942+
1943+ if (clip_props != NULL ) {
1944+ propSetString ((OfxPropertySetHandle ) clip_props ,
1945+ kOfxImageClipPropFieldOrder ,
1946+ 0 ,
1947+ kOfxImageFieldNone );
1948+
1949+ propSetString ((OfxPropertySetHandle ) clip_props ,
1950+ "OfxImageEffectPropRenderQuality" ,
1951+ 0 ,
1952+ "OfxImageEffectPropRenderQualityBest" );
1953+
1954+ propSetString ((OfxPropertySetHandle ) clip_props , kOfxImagePropField , 0 , kOfxImageFieldNone );
1955+ }
1956+
18881957 mltofx_log_status_code (status_code , "kOfxImageEffectActionDescribeInContext" );
18891958
18901959 if (mlt_metadata != NULL ) {
@@ -2358,6 +2427,11 @@ void mltofx_action_render(OfxPlugin *plugin, mlt_properties image_effect, int wi
23582427
23592428 propSetInt ((OfxPropertySetHandle ) render_in_args , kOfxImageEffectPropRenderQualityDraft , 0 , 0 );
23602429
2430+ propSetString ((OfxPropertySetHandle ) render_in_args ,
2431+ "OfxImageEffectPropRenderQuality" ,
2432+ 0 ,
2433+ "OfxImageEffectPropRenderQualityBest" );
2434+
23612435 OfxStatus status_code = plugin -> mainEntry (kOfxImageEffectActionRender ,
23622436 (OfxImageEffectHandle ) image_effect ,
23632437 (OfxPropertySetHandle ) render_in_args ,
0 commit comments