Extractor Plugins
[Cataloger]

Cataloger extractor plugins export simple C functions that look like this:


For the basic extractor:

 extern "C" alp_status_t alp_extractor_process_file(AlpDmlH handle, const char* file);

Note 1: Extractors should be as fast as possible, as they may be invoked hundreds or even thousands of times per card insertion.

Note 2: Extractors should return 0 (ALP_STATUS_OK) unless they encounter some severe failure, like a non-zero result from alp_ms_dml_commit_item: mediacatd creates a process for each extension and, within this process, calls the extractor entrypoint for each file with that extension. If any extractor returns an error code, mediacatd kills the process; starts a new process; and "re-extracts" all files (of the same type) to the 'left' of the file that failed. (After all, if the process is hosed, we have no guarantee that any of their data got written.) This allows us to handle media files that crash an extractor, but is comparatively expensive. In particular, extractors should not return a failure code just because they encounter a 'malformed' media file that they cannot read: It is perfectly all right for an extractor to 'ignore' a media file and not post any metadata for it.


For the generation of a thumbnail:

 extern "C" alp_status_t alp_extractor_generate_thumbnail(const char* file, const char* savepath, int32_t width, int32_t height);

For a complete code example, see the samples/mp3_extractor sources.


Generated on Wed Jul 30 07:06:42 2008 by Doxygen 1.4.6 for ALP SDK + Hiker Documentation

Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.