code: public boolean accepts(@NotNull MediaRequest mediaRequest) {
      // if an explicit media request is set check this first
      if (StringUtils.isNotEmpty(mediaRequest.getMediaRef())) {
        return accepts(mediaRequest.getMediaRef());
      }
      // otherwise check resource which contains media request properties
      ValueMap props = mediaRequest.getResourceProperties();
      // check for matching media source ID in media resource
      String mediaSourceId = props.get(MediaNameConstants.PN_MEDIA_SOURCE, String.class);
      if (StringUtils.isNotEmpty(mediaSourceId)) {
        return StringUtils.equals(mediaSourceId, getId());
      }
      // if no media source ID is set at all check if media ref attribute contains a valid reference
      else {
        String refProperty = StringUtils.defaultString(mediaRequest.getRefProperty(), getPrimaryMediaRefProperty());
        String mediaRef = props.get(refProperty, String.class);
        return accepts(mediaRef);
      }
    }
docs: Checks whether a media request can be handled by this media source
  @param mediaRequest Media request
  @return true if this media source can handle the given media request