Source
800
800
H5O_pline_t pline; /* Filter pipeline */
801
801
htri_t filter_avail; /* Filter availability */
802
802
herr_t ret_value = SUCCEED; /* Return value */
803
803
804
804
FUNC_ENTER_STATIC
805
805
806
806
/* Check if filter is already available */
807
807
if((filter_avail = H5Z_filter_avail(filter)) < 0)
808
808
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't check filter availability")
809
809
810
-
/* If filter is not available, try to dynamically load it */
811
-
if(!filter_avail) {
812
-
const H5Z_class2_t *filter_info;
813
-
814
-
if(NULL == (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)filter)))
815
-
HGOTO_ERROR(H5E_PLINE, H5E_CANTLOAD, FAIL, "failed to load dynamically loaded plugin")
816
-
if(H5Z_register(filter_info) < 0)
817
-
HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register dynamic filter")
818
-
} /* end if */
819
-
820
810
/* Get the pipeline property to append to */
821
811
if(H5P_get(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0)
822
812
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get pipeline")
823
813
824
814
/* Add the filter to the I/O pipeline */
825
815
if(H5Z_append(&pline, filter, flags, cd_nelmts, cd_values) < 0)
826
816
HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to add filter to pipeline")
827
817
828
818
/* Put the I/O pipeline information back into the property list */
829
819
if(H5P_set(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0)