|
From: Rob C. <ro...@ti...> - 2010-03-09 04:16:02
|
On Mar 8, 2010, at 10:09 AM, Felipe Contreras wrote: > On Mon, Mar 08, 2010 at 12:14:50AM +0100, Rob Clark wrote: >> A method for GOmxCore object which can be called at any time to access >> OMX component handle. If the OMX component is not yet instantiated, >> this will trigger OMX_GetHandle(). This makes it safe to use in >> places like get/set_property methods which could be called before the >> OMX component would otherwise be instantiated. >> --- > > NAK! I like self-documenting code, and a g_omx_core_get_handle() that > also initializes stuff is not really a 'get'; if anything it's > g_omx_core_get_and_initialize_if_not_initialized_handle(), and nedless > to say, that doesn't look nice. > > I think I already said this before; if the core needs to be initialized > before; it should be initialized before, manually, and visibly. I think > that was the point of the config stuff; so that we can initialize the > core sooner. hmm, I didn't think a lazy initializer getter function was such a strange design pattern. but, that said, we could do GetHandle() when GOmxCore is constructed, and FreeHandle() when it is free'd.. but I have some worries that this would make things more prone to problems if the application (or playbin, etc) doesn't release the reference to the element. BR, -R |