[Hdrflow-svn] SF.net SVN: hdrflow: [115] lib/openlibraries/src/openmedialib/plugins/ofx/ ofx_plugin
Status: Pre-Alpha
Brought to you by:
glslang
|
From: <gl...@us...> - 2007-05-09 22:07:08
|
Revision: 115
http://hdrflow.svn.sourceforge.net/hdrflow/?rev=115&view=rev
Author: glslang
Date: 2007-05-09 15:07:06 -0700 (Wed, 09 May 2007)
Log Message:
-----------
+ OFX bindings M3
Modified Paths:
--------------
lib/openlibraries/src/openmedialib/plugins/ofx/ofx_plugin.cpp
Modified: lib/openlibraries/src/openmedialib/plugins/ofx/ofx_plugin.cpp
===================================================================
--- lib/openlibraries/src/openmedialib/plugins/ofx/ofx_plugin.cpp 2007-05-09 00:29:07 UTC (rev 114)
+++ lib/openlibraries/src/openmedialib/plugins/ofx/ofx_plugin.cpp 2007-05-09 22:07:06 UTC (rev 115)
@@ -38,6 +38,8 @@
namespace
{
+ enum ofx_context { FILTER, TRANSITION, GENERATOR, GENERAL };
+
void set_property_suite( OfxPropertySuiteV1& );
void set_image_effect_suite( OfxImageEffectSuiteV1& );
void set_parameter_suite( OfxParameterSuiteV1& );
@@ -49,7 +51,7 @@
// typedefs
typedef pcos::property_container* property_container_ptr;
- // forward declaration
+ // forward declarations
class param;
class param_set;
class clip_instance;
@@ -372,7 +374,9 @@
, double2D_param_descriptor_param_prop_display_min_( pcos::key::from_string( kOfxParamPropDisplayMin ) )
, double2D_param_descriptor_param_prop_display_max_( pcos::key::from_string( kOfxParamPropDisplayMax ) )
, double2D_param_descriptor_param_prop_dimension_label_( pcos::key::from_string( kOfxParamPropDimensionLabel ) )
- { }
+ {
+ set_double2D_param_descriptor_properties( );
+ }
private:
void set_double2D_param_descriptor_properties( )
@@ -1053,7 +1057,7 @@
// they have shallow copy semantics and clone will cause a leak.
// therefore extract all the values and assign those. descriptors and instances are
// meant to be separate entities and values should not be shared.
- void set_double2D_param_properties( base_double_param_descriptor& vpd )
+ void set_double2D_param_properties( double2D_param_descriptor& vpd )
{
property_container_ptr param_props_ = get_property_set( );
@@ -1064,7 +1068,7 @@
pcos::double_vec max = vpd_set->get_property_with_key( pcos::key::from_string( kOfxParamPropMax ) ).value<pcos::double_vec>( );
pcos::double_vec display_min = vpd_set->get_property_with_key( pcos::key::from_string( kOfxParamPropDisplayMin ) ).value<pcos::double_vec>( );
pcos::double_vec display_max = vpd_set->get_property_with_key( pcos::key::from_string( kOfxParamPropDisplayMax ) ).value<pcos::double_vec>( );
- pl::string_vec dimension_label = vpd_set->get_property_with_key( pcos::key::from_string( kOfxParamPropDisplayMax ) ).value<pl::string_vec>( );
+ pl::string_vec dimension_label = vpd_set->get_property_with_key( pcos::key::from_string( kOfxParamPropDimensionLabel ) ).value<pl::string_vec>( );
param_props_->append( double2D_param_value_ = def );
param_props_->append( double2D_param_prop_default_ = def );
@@ -1120,7 +1124,7 @@
pcos::double_vec max = vpd_set->get_property_with_key( pcos::key::from_string( kOfxParamPropMax ) ).value<pcos::double_vec>( );
pcos::double_vec display_min = vpd_set->get_property_with_key( pcos::key::from_string( kOfxParamPropDisplayMin ) ).value<pcos::double_vec>( );
pcos::double_vec display_max = vpd_set->get_property_with_key( pcos::key::from_string( kOfxParamPropDisplayMax ) ).value<pcos::double_vec>( );
- pl::string_vec dimension_label = vpd_set->get_property_with_key( pcos::key::from_string( kOfxParamPropDisplayMax ) ).value<pl::string_vec>( );
+ pl::string_vec dimension_label = vpd_set->get_property_with_key( pcos::key::from_string( kOfxParamPropDimensionLabel ) ).value<pl::string_vec>( );
param_props_->append( double3D_param_value_ = def );
param_props_->append( double3D_param_prop_default_ = def );
@@ -1495,8 +1499,8 @@
set_interact_descriptor_properties( );
}
- virtual property_container_ptr get_property_set( ) { return &interact_descriptor_props_; }
-
+ virtual property_container_ptr get_property_set( ) { return &interact_descriptor_props_; }
+
private:
void set_interact_descriptor_properties( )
{
@@ -1567,6 +1571,14 @@
const_iterator clip_begin( ) const { return clip_desc_.begin( ); }
const_iterator clip_end( ) const { return clip_desc_.end( ); }
+
+ OfxPluginEntryPoint* overlay_interact( ) const
+ {
+ OfxPluginEntryPoint* interact_main =
+ ( OfxPluginEntryPoint* ) effect_descriptor_props_.get_property_with_key( pcos::key::from_string( kOfxImageEffectPluginPropOverlayInteractV1 ) ).value<void*>( );
+
+ return interact_main;
+ }
private:
void set_image_effect_descriptor_properties( )
@@ -1656,8 +1668,9 @@
virtual property_container_ptr get_property_set( ) { return &clip_instance_props_; }
- void set_image( il::image_type_ptr im ) { im_.set_image( im ); }
- property_container_ptr get_image( ) { return im_.get_property_set( ); }
+ void set_image( il::image_type_ptr im ) { im_.set_image( im ), img_ = im; }
+ property_container_ptr get_image_property_set( ) { return im_.get_property_set( ); }
+ il::image_type_ptr get_image( ) { return img_; }
private:
void set_clip_instance_properties( clip_descriptor& cd )
@@ -1672,13 +1685,13 @@
clip_instance_props_.append( clip_instance_prop_optional_ = 0 );
clip_instance_props_.append( clip_instance_prop_field_extraction_ = pl::string( kOfxImageFieldDoubled ) );
clip_instance_props_.append( clip_instance_prop_is_mask_ = 0 );
- clip_instance_props_.append( clip_instance_prop_supports_tiles_ = 1 );
+ clip_instance_props_.append( clip_instance_prop_supports_tiles_ = 0 );
clip_instance_props_.append( clip_instance_prop_pixel_depth_ = pl::string( kOfxBitDepthNone ) );
clip_instance_props_.append( clip_instance_prop_components_ = pl::string( kOfxImageComponentNone ) );
clip_instance_props_.append( clip_instance_prop_unmapped_pixel_depth_ = pl::string( kOfxBitDepthNone ) );
clip_instance_props_.append( clip_instance_prop_unmapped_components_ = pl::string( kOfxImageComponentNone ) );
clip_instance_props_.append( clip_instance_prop_premultiplication_ = pl::string( kOfxImageOpaque ) );
- clip_instance_props_.append( clip_instance_prop_pixel_aspect_ratio_ = 0.0 );
+ clip_instance_props_.append( clip_instance_prop_pixel_aspect_ratio_ = 1.0 );
clip_instance_props_.append( clip_instance_prop_frame_rate_ = 0.0 );
clip_instance_props_.append( clip_instance_prop_frame_range_ = pcos::double_vec( 2 ) );
clip_instance_props_.append( clip_instance_prop_field_order_ = pl::string( kOfxImageFieldNone ) );
@@ -1718,50 +1731,8 @@
private:
image im_;
+ il::image_type_ptr img_;
};
-
- class interact_instance : public Ofx_base
- {
- public:
- explicit interact_instance( )
- : interact_instance_prop_effect_instance_( pcos::key::from_string( kOfxPropEffectInstance ) )
- , interact_instance_prop_instance_data_( pcos::key::from_string( kOfxPropInstanceData ) )
- , interact_instance_prop_pixel_scale_( pcos::key::from_string( kOfxInteractPropPixelScale ) )
- , interact_instance_prop_background_colour_( pcos::key::from_string( kOfxInteractPropBackgroundColour ) )
- , interact_instance_prop_viewport_size_( pcos::key::from_string( kOfxInteractPropViewportSize ) )
- , interact_instance_prop_has_alpha_( pcos::key::from_string( kOfxInteractPropHasAlpha ) )
- , interact_instance_prop_bit_depth_( pcos::key::from_string( kOfxInteractPropBitDepth ) )
- , interact_instance_prop_slave_to_param_( pcos::key::from_string( kOfxInteractPropSlaveToParam ) )
- {
- set_interact_instance_properties( );
- }
-
- virtual property_container_ptr get_property_set( ) { return &interact_instance_props_; }
-
- private:
- void set_interact_instance_properties( )
- {
- interact_instance_props_.append( interact_instance_prop_effect_instance_ = ( void* ) 0 );
- interact_instance_props_.append( interact_instance_prop_instance_data_ = ( void* ) 0 );
- interact_instance_props_.append( interact_instance_prop_pixel_scale_ = pcos::double_vec( 2, 0.0 ) );
- interact_instance_props_.append( interact_instance_prop_background_colour_ = pcos::double_vec( 3, 0.0 ) );
- interact_instance_props_.append( interact_instance_prop_viewport_size_ = pcos::int_vec( 2, 0 ) ); // deprecated
- interact_instance_props_.append( interact_instance_prop_has_alpha_ = 1 );
- interact_instance_props_.append( interact_instance_prop_bit_depth_ = 8 );
- interact_instance_props_.append( interact_instance_prop_slave_to_param_ = pl::string_vec( ) );
- }
-
- private:
- pcos::property_container interact_instance_props_;
- pcos::property interact_instance_prop_effect_instance_;
- pcos::property interact_instance_prop_instance_data_;
- pcos::property interact_instance_prop_pixel_scale_;
- pcos::property interact_instance_prop_background_colour_;
- pcos::property interact_instance_prop_viewport_size_;
- pcos::property interact_instance_prop_has_alpha_;
- pcos::property interact_instance_prop_bit_depth_;
- pcos::property interact_instance_prop_slave_to_param_;
- };
class image_effect_instance : public param_set_base
{
@@ -1865,7 +1836,49 @@
container clip_instance_;
param_set_ptr param_set_;
};
+
+ class interact_instance : public Ofx_base
+ {
+ public:
+ explicit interact_instance( )
+ : interact_instance_prop_effect_instance_( pcos::key::from_string( kOfxPropEffectInstance ) )
+ , interact_instance_prop_instance_data_( pcos::key::from_string( kOfxPropInstanceData ) )
+ , interact_instance_prop_pixel_scale_( pcos::key::from_string( kOfxInteractPropPixelScale ) )
+ , interact_instance_prop_background_colour_( pcos::key::from_string( kOfxInteractPropBackgroundColour ) )
+ , interact_instance_prop_viewport_size_( pcos::key::from_string( kOfxInteractPropViewportSize ) )
+ , interact_instance_prop_has_alpha_( pcos::key::from_string( kOfxInteractPropHasAlpha ) )
+ , interact_instance_prop_bit_depth_( pcos::key::from_string( kOfxInteractPropBitDepth ) )
+ , interact_instance_prop_slave_to_param_( pcos::key::from_string( kOfxInteractPropSlaveToParam ) )
+ { }
+
+ void init( interact_descriptor& id, image_effect_instance& effect ) { set_interact_instance_properties( id, effect ); }
+ virtual property_container_ptr get_property_set( ) { return &interact_instance_props_; }
+ private:
+ void set_interact_instance_properties( interact_descriptor&, image_effect_instance& effect )
+ {
+ interact_instance_props_.append( interact_instance_prop_effect_instance_ = ( void* ) &effect );
+ interact_instance_props_.append( interact_instance_prop_instance_data_ = ( void* ) 0 );
+ interact_instance_props_.append( interact_instance_prop_pixel_scale_ = pcos::double_vec( 2, 0.0 ) );
+ interact_instance_props_.append( interact_instance_prop_background_colour_ = pcos::double_vec( 3, 0.0 ) );
+ interact_instance_props_.append( interact_instance_prop_viewport_size_ = pcos::int_vec( 2, 0 ) ); // deprecated
+ interact_instance_props_.append( interact_instance_prop_has_alpha_ = 1 );
+ interact_instance_props_.append( interact_instance_prop_bit_depth_ = 8 );
+ interact_instance_props_.append( interact_instance_prop_slave_to_param_ = pl::string_vec( ) );
+ }
+
+ private:
+ pcos::property_container interact_instance_props_;
+ pcos::property interact_instance_prop_effect_instance_;
+ pcos::property interact_instance_prop_instance_data_;
+ pcos::property interact_instance_prop_pixel_scale_;
+ pcos::property interact_instance_prop_background_colour_;
+ pcos::property interact_instance_prop_viewport_size_;
+ pcos::property interact_instance_prop_has_alpha_;
+ pcos::property interact_instance_prop_bit_depth_;
+ pcos::property interact_instance_prop_slave_to_param_;
+ };
+
OfxStatus param_set_descriptor::define( const pl::string& param_type, const pl::string& name )
{
typedef container::const_iterator const_iterator;
@@ -1942,30 +1955,31 @@
return kOfxStatOK;
}
- param* string_param_descriptor::create_instance( ) { return new string_param( *this ); }
- param* int_param_descriptor::create_instance( ) { return new int_param( *this ); }
- param* int2D_param_descriptor::create_instance( ) { return new int2D_param( *this ); }
- param* int3D_param_descriptor::create_instance( ) { return new int3D_param( *this ); }
- param* double_param_descriptor::create_instance( ) { return new double_param( *this ); }
- param* double2D_param_descriptor::create_instance( ) { return new double2D_param( *this ); }
- param* double3D_param_descriptor::create_instance( ) { return new double3D_param( *this ); }
- param* rgb_param_descriptor::create_instance( ) { return new rgb_param( *this ); }
- param* rgba_param_descriptor::create_instance( ) { return new rgba_param( *this ); }
- param* boolean_param_descriptor::create_instance( ) { return new boolean_param( *this ); }
- param* choice_param_descriptor::create_instance( ) { return new choice_param( *this ); }
- param* group_param_descriptor::create_instance( ) { return new group_param( *this ); }
- param* page_param_descriptor::create_instance( ) { return new page_param( *this ); }
- param* push_button_param_descriptor::create_instance( ) { return new push_button_param( *this ); }
- param* custom_param_descriptor::create_instance( ) { return new custom_param( *this ); }
- param_set* param_set_descriptor::create_instance( ) { return new param_set( *this ); }
- clip_instance* clip_descriptor::create_instance( ) { return new clip_instance( *this ); }
+ param* string_param_descriptor::create_instance( ) { return new string_param( *this ); }
+ param* int_param_descriptor::create_instance( ) { return new int_param( *this ); }
+ param* int2D_param_descriptor::create_instance( ) { return new int2D_param( *this ); }
+ param* int3D_param_descriptor::create_instance( ) { return new int3D_param( *this ); }
+ param* double_param_descriptor::create_instance( ) { return new double_param( *this ); }
+ param* double2D_param_descriptor::create_instance( ) { return new double2D_param( *this ); }
+ param* double3D_param_descriptor::create_instance( ) { return new double3D_param( *this ); }
+ param* rgb_param_descriptor::create_instance( ) { return new rgb_param( *this ); }
+ param* rgba_param_descriptor::create_instance( ) { return new rgba_param( *this ); }
+ param* boolean_param_descriptor::create_instance( ) { return new boolean_param( *this ); }
+ param* choice_param_descriptor::create_instance( ) { return new choice_param( *this ); }
+ param* group_param_descriptor::create_instance( ) { return new group_param( *this ); }
+ param* page_param_descriptor::create_instance( ) { return new page_param( *this ); }
+ param* push_button_param_descriptor::create_instance( ) { return new push_button_param( *this ); }
+ param* custom_param_descriptor::create_instance( ) { return new custom_param( *this ); }
+ param_set* param_set_descriptor::create_instance( ) { return new param_set( *this ); }
+ clip_instance* clip_descriptor::create_instance( ) { return new clip_instance( *this ); }
}
class ML_PLUGIN_DECLSPEC ofx_filter : public filter_type, public OfxHost
{
public:
- explicit ofx_filter( OfxPlugin* plug )
+ explicit ofx_filter( OfxPlugin* plug, ofx_context context )
: plug_( plug )
+ , context_( context )
, host_prop_type_( pcos::key::from_string( kOfxPropType ) )
, host_prop_name_( pcos::key::from_string( kOfxPropName ) )
, host_prop_label_( pcos::key::from_string( kOfxPropLabel ) )
@@ -1990,6 +2004,7 @@
, host_prop_max_pages_( pcos::key::from_string( kOfxParamHostPropMaxPages ) )
, host_prop_page_row_column_count_( pcos::key::from_string( kOfxParamHostPropPageRowColumnCount ) )
, host_prop_this_pointer_( pcos::key::from_string( "this_pointer" ) )
+ , interact_main_( 0 )
, render_prop_name_( pcos::key::from_string( kOfxPropName ) )
, render_prop_time_( pcos::key::from_string( kOfxPropTime ) )
, render_prop_field_to_render_( pcos::key::from_string( kOfxImageEffectPropFieldToRender ) )
@@ -2023,14 +2038,25 @@
// create instance from descriptor
image_effect_instance_.init( image_effect_descriptor_ );
+ if( ( interact_main_ = image_effect_descriptor_.overlay_interact( ) ) != 0 )
+ {
+ interact_main_( kOfxActionDescribe, &overlay_interact_descriptor_, 0, 0 );
+ overlay_interact_instance_.init( overlay_interact_descriptor_, image_effect_instance_ );
+ }
+
plug_->mainEntry( kOfxActionCreateInstance, &image_effect_instance_, 0, 0 );
+ if( interact_main_ )
+ interact_main_( kOfxActionCreateInstance, &overlay_interact_instance_, 0, 0 );
- set_clip_prefs_filter_ctx( );
+ set_clip_prefs_ctx( );
plug_->mainEntry( kOfxImageEffectActionGetClipPreferences, &image_effect_instance_, 0, ( OfxPropertySetHandle ) &clip_preferences_props_filter_ );
}
virtual ~ofx_filter( )
{
+ if( interact_main_ )
+ interact_main_( kOfxActionDestroyInstance, &overlay_interact_instance_, 0, 0 );
+
plug_->mainEntry( kOfxActionDestroyInstance, &image_effect_instance_, 0, 0 );
plug_->mainEntry( kOfxActionUnload, 0, 0, 0 );
}
@@ -2062,16 +2088,17 @@
render_in_args.append( render_prop_render_scale_ = render_scale );
render_out_args.append( render_prop_name_ );
- render_out_args.append( render_prop_time_ );
+ render_out_args.append( render_prop_time_ = 0.0 );
+ src = il::convert( result->get_image( ), L"r8g8b8a8" );
+ image_effect_instance_.set_source( src );
+
OfxStatus is_identity = plug_->mainEntry( kOfxImageEffectActionIsIdentity, &image_effect_instance_,
( OfxPropertySetHandle ) &render_in_args, ( OfxPropertySetHandle ) &render_out_args );
if( is_identity == kOfxStatReplyDefault )
{
- src = il::convert( result->get_image( ), L"r8g8b8a8" );
il::image_type_ptr dst = il::allocate( src->pf( ), src->width( ), src->height( ) );
-
- image_effect_instance_.set_source( src );
+
image_effect_instance_.set_output( dst );
pcos::property_container sequence_in_args;
@@ -2089,6 +2116,13 @@
else if( is_identity == kOfxStatOK )
{
// select the appropriate clip from the out_args.
+ pl::string out_clip = render_out_args.get_property_with_key( pcos::key::from_string( kOfxPropName ) ).value<pl::string>( );
+ if( !out_clip.empty( ) )
+ {
+ clip_instance* out_instance = image_effect_instance_.clip_get_handle( out_clip );
+ if( out_instance )
+ result->set_image( out_instance->get_image( ) );
+ }
}
}
@@ -2138,6 +2172,16 @@
pixel_depths[ 1 ] = pl::string( kOfxBitDepthShort );
pixel_depths[ 2 ] = pl::string( kOfxBitDepthFloat );
+ pl::string_vec supported_components( 2 );
+ supported_components[ 0 ] = kOfxImageComponentRGBA;
+ supported_components[ 1 ] = kOfxImageComponentAlpha;
+
+ pl::string_vec supported_contexts( 4 );
+ supported_contexts[ 0 ] = kOfxImageEffectContextFilter;
+ supported_contexts[ 1 ] = kOfxImageEffectContextTransition;
+ supported_contexts[ 2 ] = kOfxImageEffectContextGenerator;
+ supported_contexts[ 3 ] = kOfxImageEffectContextGeneral;
+
host_props_.append( host_prop_type_ = pl::string( kOfxTypeImageEffectHost ) );
host_props_.append( host_prop_name_ = pl::string( "org.openlibraries.ofx_host" ) );
host_props_.append( host_prop_label_ = pl::string( "OpenLibraries OFX host" ) );
@@ -2147,13 +2191,13 @@
host_props_.append( host_prop_supports_multiresolution_ = 1 );
host_props_.append( host_prop_supports_tiles_ = 0 );
host_props_.append( host_prop_temporal_clip_access_ = 0 );
- host_props_.append( host_prop_supported_components_ = pl::string( kOfxImageComponentRGBA ) );
- host_props_.append( host_prop_supported_contexts_ = pl::string( kOfxImageEffectContextFilter ) );
+ host_props_.append( host_prop_supported_components_ = supported_components );
+ host_props_.append( host_prop_supported_contexts_ = supported_contexts );
host_props_.append( host_prop_supports_multiple_clip_depths_ = 1 );
host_props_.append( host_prop_supports_multiple_clip_pars_ = 1 );
host_props_.append( host_prop_setable_frame_rate_ = 1 );
host_props_.append( host_prop_setable_fielding_ = 1 );
- host_props_.append( host_prop_supports_custom_interact_ = 0 );
+ host_props_.append( host_prop_supports_custom_interact_ = 1 );
host_props_.append( host_prop_supports_string_animation_ = 0 );
host_props_.append( host_prop_supports_choice_animation_ = 0 );
host_props_.append( host_prop_supports_boolean_animation_ = 0 );
@@ -2176,28 +2220,20 @@
}
// For each of the contexts create a description of the effect.
- void describe_in_context( )
+ bool describe_in_context( )
{
- // Introduce support for multiple contexts but
- // constrain the actual executed code to filters.
- typedef pl::string_vec::const_iterator const_iterator;
-
- property_container_ptr property_set = image_effect_descriptor_.get_property_set( );
- pl::string_vec contexts = property_set->get_property_with_key( pcos::key::from_string( kOfxImageEffectPropSupportedContexts ) ).value<pl::string_vec>( );
+ pl::string context_str;
+ if( context_ == FILTER )
+ context_str = kOfxImageEffectContextFilter;
- for( const_iterator I = contexts.begin( ); I != contexts.end( ); ++I )
- {
- if( *I != kOfxImageEffectContextFilter ) continue;
+ pcos::property_container in_args;
+ pcos::property context( pcos::key::from_string( kOfxImageEffectPropContext ) );
- pcos::property_container in_args;
- pcos::property context( pcos::key::from_string( kOfxImageEffectPropContext ) );
+ in_args.append( context = context_str );
- in_args.append( context = *I );
-
- plug_->mainEntry( kOfxImageEffectActionDescribeInContext, &image_effect_descriptor_, ( OfxPropertySetHandle ) &in_args, 0 );
- }
+ return plug_->mainEntry( kOfxImageEffectActionDescribeInContext, &image_effect_descriptor_, ( OfxPropertySetHandle ) &in_args, 0 ) == kOfxStatOK;
}
-
+
void set_clip_prefs_filter_ctx( )
{
clip_preferences_props_filter_.append( clip_preferences_prop_components_source_ );
@@ -2213,8 +2249,19 @@
clip_preferences_props_filter_.append( clip_preferences_prop_frame_varying_ );
}
+ void set_clip_prefs_generator_ctx( )
+ {
+ }
+
+ void set_clip_prefs_ctx( )
+ {
+ if( context_ == FILTER ) set_clip_prefs_filter_ctx( );
+ else if( context_ == GENERATOR ) set_clip_prefs_generator_ctx( );
+ }
+
private:
OfxPlugin* plug_;
+ ofx_context context_;
private:
OfxPropertySuiteV1 property_suite_;
@@ -2256,10 +2303,13 @@
// Effect descriptor.
private:
image_effect_descriptor image_effect_descriptor_;
+ interact_descriptor overlay_interact_descriptor_;
// Effect instance.
private:
image_effect_instance image_effect_instance_;
+ interact_instance overlay_interact_instance_;
+ OfxPluginEntryPoint* interact_main_;
// Render action properties.
private:
@@ -2306,12 +2356,12 @@
if( index >= static_cast<int>( val.size( ) ) )
val.resize( index + 1 );
- val[ index ] = T( value );
+ val[ index ] = value;
dst = val;
}
else
{
- dst = T( value );
+ dst = value;
}
return kOfxStatOK;
@@ -2579,8 +2629,12 @@
return kOfxStatOK;
}
- OfxStatus interact_get_property_set( OfxInteractHandle interact_instance, OfxPropertySetHandle* property )
+ OfxStatus interact_get_property_set( OfxInteractHandle interact_inst, OfxPropertySetHandle* property_set )
{
+ interact_instance* instance = ( interact_instance* ) interact_inst;
+
+ *property_set = ( OfxPropertySetHandle ) instance->get_property_set( );
+
return kOfxStatOK;
}
@@ -2985,7 +3039,7 @@
if( !instance )
return kOfxStatErrBadHandle;
- *image_handle = ( OfxPropertySetHandle ) instance->get_image( );
+ *image_handle = ( OfxPropertySetHandle ) instance->get_image_property_set( );
return kOfxStatOK;
}
@@ -3001,7 +3055,7 @@
if( !instance )
return kOfxStatErrBadHandle;
- property_container_ptr image = instance->get_image( );
+ property_container_ptr image = instance->get_image_property_set( );
pcos::int_vec b = image->get_property_with_string( kOfxImagePropBounds ).value<pcos::int_vec>( );
bounds->x1 = b[ 0 ];
@@ -3156,17 +3210,21 @@
class ML_PLUGIN_DECLSPEC ofx_plugin : public openmedialib_plugin
{
public:
- virtual filter_type_ptr filter( const opl::wstring& request )
+ virtual input_type_ptr input( const pl::wstring& request ) { return discover( request, GENERATOR ); }
+ virtual filter_type_ptr filter( const pl::wstring& request ) { return discover( request, FILTER ); }
+
+private:
+ filter_type_ptr discover( const pl::wstring& request, ofx_context context )
{
typedef pl::discovery<ofx_query_traits> discovery;
ofx_query_traits query( request );
discovery plugins( query );
if( plugins.size( ) == 0 ) return filter_type_ptr( );
-
+
discovery::const_iterator i = plugins.begin( );
-
- return filter_type_ptr( new ofx_filter( ( OfxPlugin* ) i->context( ) ) );
+
+ return filter_type_ptr( new ofx_filter( ( OfxPlugin* ) i->context( ), context ) );
}
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|