-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libtizonia: allow registration of different egl validation hooks for different component roles #350
Comments
A component may have multiple roles, and the component can be instantiated multiple times. The IL core should provide a different component handle each time a component handle is requested. I have not tried this in a long time, but I think it should work. Let me know if not the case. |
The components I'm trying to instantiate here are OMX.mesa.video_decoder.avc and OMX.mesa.video_encoder.avc i.e. one decoder and encoder. I tried something similar to this which didn't quite work.
Also I would like to have control over what hooks to register for the component. For example, register egl_validation_hook only for the decoder and not for the encoder, all in the same function. |
Hi Juan, I think the question behind is does Tizonia support to have multiple component name in one shared library ? For example with bellagio, mycomps.so can register compA and compB, where the il client will retrieve them by calling: With Tizonia, it looks like we can only register only "compA" in one shared lib. Which has been registered by calling tiz_comp_init(hdl, "compA");. Unless we can call tiz_comp_init multiple times in one OMX_ComponentInit ? I wonder if this is covered by the specs (1.1.2, 1.2.0) or if the choice is left to the implementation/target. That said, we can workaround this by putting a more generic name for the component: "OMX.mesa.video" and then using the roles. Though it looks like there is a bug, see below: When running tizonia --comp-list it does not list all roles, only the first one registered. Same with gst-omx, I can only access the first role in the array (rf_list[]). Thx a lot |
Hi guys, Tizonia does not support loading multiple component "names" from a single shared object. This use case is effectively supported by the spec in both 1.1.2 and 1.2 with the "roles" functionality. I.e. The component "name" is just a unique "id",
which does not necessarily need to display the component's functionality (although it typically does), and the "roles" are the various "forms" or "functions" that the component (i.e. the shared object or dll) actually support: For example, with tizonia, you can use the --comp-list and the --roles-of-comp flags to display "shared objects" and "roles"
So the only standard way of instantiating components is with the OMX_GetHandle macro, which does not allow you to "refer" to any specific plugin/shared object. You can only pass the component's name:
Bellagio's IL Core implementation is split in two parts. One part is the cross-platform bits and pieces that would not depend (in theory) on any OS-specific apis, and another part, the "loaders", that would allow the Bellagio IL Core to be ported to multiple platforms. These "loaders" are platform specific and contain the parts that would call the platform mechanisms responsible of initializing hardware functions, component discovery and loading. So I believe that the APIs you are referring to in the initial question belong to the "loader" api, which is specific of Bellagio and hence non-standard. So the option that IL provides to this problem really is to give a more generic name to the component (as you already noticed), e.g. "OMX.mesa.video.avc" with two roles "video_decoder.avc" and "video_encoder.avc". Regarding registering an egl hook per role, this is an interesting use case that I did not envisioned. So it looks like you are wanting to register a hook per each of those two roles, which would possibly require two of these structs (i.e. possibly with different port indexes and different validation hook function)
If the hook's port index is the same in both cases, then a possible workaround would be to use the same hook function and query the port for its domain to understand whether the active role is one or the other. This solution is ugly; Note that it is not possible to query the currently active "role" since roles can only be set with SetParameter(OMX_IndexParamStandardComponentRole) but GetParameter(OMX_IndexParamStandardComponentRole) would fail (the spec does not support this query). So it looks like the best solution going forward is to introduce an additional egl hook registration API that would allow the registration of "per role" hooks. Would this be the best option for your use cases? |
Thanks for the explanation. "per role" egl hook registration API should do the work. |
Thx Juan for the detailed answer! Regarding the non eglimage part, our bug was that we were using: tiz_comp_init ("OMX.mesa.video.all") Then the listed component name with: tizonia --comp-list was "OMX.mesa.video_decoder.avc" instead of "OMX.mesa.video.all". So the first call to factory_new I guess. Using the same name for all I could fixed the pb: (well I just looked at how you do for other components that have multiple roles) tiz_comp_init ("OMX.mesa.video.all") Now "tizonia --roles-of-comp OMX.mesa.video.all" prints: So all good ! :) Also I noticed a crash in tizscheduler.c::set_thread_name: /* Let's skip the 'OMX.Company.' part */ If I set : tiz_comp_init ("OMX.mesa.video") . so omitting the .all. Maybe like you said in the spec there is at least a third '.' but I guess it should not crash and should returns an error from tiz_comp_init. Thx! |
Julien, Gurkirpal, I'm not sure I got this point, could you point me to the code repo where you are hosting the avc component? Regarding the component name, I believe the spec assumes two dots only, so that code in tizscheduler.c needs some fixing. I'm creating another issue for that, see #353 |
I meant like https://github.com/tizonia/tizonia-openmax-il/blob/master/plugins/file_reader/src/fr.c#L139 static OMX_PTR We were putting the role name when calling factory_new, instead of the component name. But it looks like instantiate_h264d_config_port and instantiate_h264e_config_port are just the same so we should refactor that. Thx for openning #353 |
I've pushed a new API (921af2d):
I still want to do some more testing and code review, so the implementation might not be final yet. But you guys can try and give it a go to see if this is what we need. |
Works with the H.264 dec. Thanks! |
Hi,
I was looking for a single entrypoint function similar to omx_component_library_Setup in bellagio http://maemo.org/api_refs/5.0/beta/libomxil-bellagio/alsa_2library__entry__point_8c.html
Currently the code I have is this
Then I realised it only allows me to add a single component at a time since attaching two components to a single handle doesn't make sense.
So is there a way to accomplish this without having to separating them?
The text was updated successfully, but these errors were encountered: