[core] Rework metadata key system
One of the initial goals of Grilo was that metadata keys should be dynamic: besides having a pre-defined set of keys, both users and plugin's developers should be able to add their own keys. So far, this goal was not addressed properly. The aim of this patch is that users/developers can add their own keys while keeping one of the key features of current system: comparing keys must be quick (this is how string-based keys were discarded). In previously system, GrlKeyID were just numbers; in the new one, GrlKeyID are pointers to GParamSpec. Being pointers, means that comparison can be done quickly. What are the main changes? - No need for GRLKEYID_TO_POINTER / POINTER_TO_GRLKEYID: keys can be added directly to GLists. - grl_plugin_registry_lookup_metadata_key() changed: returns the GrlKeyID with name specified. - GRL_METADATA_KEY_FOO are still kept, but now they are variables instead of definitions. - No need for GrlMetadataKey: GrlKeyID has the required data. Thus GRL_METADATA-KEY_GET_{NAME/ID/DESC} require a GrlKeyID. - Added grl_plugin_registry_register_metadata_key (): registers a new key in the system. Key is built as a GParamSpec.
parent
596aac25
Please register or sign in to comment