The article provides generalizations of the Fejér inequality. These include extensions, and refinements by inserting discrete and integral terms. The fundamental issue underlying this research is the barycenter of a nonnegative integrable function. Appropriate properties of the convexity related to the function barycenter are used in the construction of main results.