• Dima Zavin's avatar
    libhardware: add concept of module classes · 54921de4
    Dima Zavin authored
    
    
    Needed for things like audio and audio effects. Provides a
    new interface to loading modules named 'hw_get_module_by_class'.
    This takes two parameters: 'class_id' and 'instance' which are
    used to construct the filename for the module to be loaded. If
    instance is NULL, then this function acts identically to
    hw_get_module where 'class_id' == 'id' (and in fact the latter
    implemented exactly this way).
    
    For audio, this new mechanism allows us to load multiple audio
    interfaces by doing:
    
    hw_get_module_by_class("audio", "primary", &module);
    hw_get_module_by_class("audio", "a2dp", &module);
    hw_get_module_by_class("audio", "usb", &module);
    ...
    
    In the future we will likely want to add the ability to load a set of
    module instances based on a config file, which will have a standard
    syntax and the mechanism will be provided by libhardware.
    
    Change-Id: I9976cc6d59a85a414b18e7b398a36edfbce4abd8
    Signed-off-by: default avatarDima Zavin <dima@android.com>
    54921de4
hardware.c 4.83 KB