Motama GmbH

Forum for users and developers of NMM
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

registration Of nodes with "required" Methods

 
Post new topic   Reply to topic     Forum Index -> Serverregistry
View previous topic :: View next topic  
Author Message
DjRAST



Joined: 09 Mar 2009
Posts: 22

PostPosted: Tue May 19, 2009 5:42 pm    Post subject: registration Of nodes with "required" Methods Reply with quote

Hello again,
I created an Interface with a "required" method and used it within a Plugin-Node. When I run "serverregistry.exe -s", this Node is "not Available" and I can not start my Application any more! This seems to occur because the Node can not leave State "CONSTRUCTED" without calling the "required" method...

What can I do about that?

The only working solution for me at the moment is to register the Node without the Interface, adding the Interface afterwards and not running "serverregistry.exe -s" again. But this, of course, is not a good solution...
Back to top
View user's profile Send private message
mlohse
NMM Team


Joined: 12 Apr 2007
Posts: 122

PostPosted: Wed May 20, 2009 8:51 am    Post subject: Reply with quote

Added a required node is a bit tricky: During the process initiated by 'serverregistry -s' all nodes are initialized (i.e. init and doInit are called) in order to determine the generally supported input and output formats.

If your node requires a method to be called to reach state INITIALIZED from state CONSTRUCTED (i.e. a required method), the NMM registry has no generic mechanism of calling this required method with the 'correct' parameters.

Therefore, required methods are mainly useful for methods that are called in further states, for example ./nmm/plugins/video/converter/ICrop.idl

Code:

void setCrop(in nmm_int32 xOffset, in nmm_int32 yOffset, in nmm_int32 xRange, in nmm_int32 yRange) required(INode::INITIALIZED, INode::OUTPUT_INITIALIZED) limited(INode::INITIALIZED);


If, however, you really require settings to be done to reach state INITIALIZED from state CONSTRUCTED, you will have to write some custom code for registering your node, please have a look at
./nmm/multimedia/Plugin.hpp and the usage of NMM_REGISTER_SPECIAL_PLUGIN within nodes such as ./nmm/plugins/audio/oss/PlaybackNode.cpp

Have fun, Marco
Back to top
View user's profile Send private message
DjRAST



Joined: 09 Mar 2009
Posts: 22

PostPosted: Wed May 20, 2009 11:10 am    Post subject: Reply with quote

Thanks for the quick reply!
Indeed, it is not necessary for my Node that the required Method is called to reach State "INITIALIZED". I changed the limitation of the method to
Code:

required(INode::ACTIVATED, INode::STARTED)

and now I can register the Node within the serverregistry.

But some other questions now came up:

1. Why can I not call the required method in State CONSTRUCTED any more? I get the NMM error, that the Method that is needed to change states was not called. If I call the method in State INITIALIZED, it works.

2. If the states that are given to the required-modifier are not successors, the modyfier seems to have no effect any more. Is this a normal behaviour?
Back to top
View user's profile Send private message
mlohse
NMM Team


Joined: 12 Apr 2007
Posts: 122

PostPosted: Fri May 22, 2009 8:22 am    Post subject: Reply with quote

DjRAST wrote:

1. Why can I not call the required method in State CONSTRUCTED any more? I get the NMM error, that the Method that is needed to change states was not called. If I call the method in State INITIALIZED, it works.


Please take a closer look at the "limited" modifiers that you added.

If you think it is a bug in NMM, please post a complete description, including the IDL file.

DjRAST wrote:

2. If the states that are given to the required-modifier are not successors, the modyfier seems to have no effect any more. Is this a normal behaviour?


Yes, the states given by "required" need to be successing states in the NMM state machine of nodes.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Serverregistry All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Editorial | Impressum  © Copyright Motama GmbH