According to naïve and direct realism, humans perceive directly while brains perform processing. According to indirect realism and dualism, brains contain data obtained by processing but what people perceive is a mental model or state appearing to overlay physical things as a result of projective geometry (such as the point observation in Rene Descartes' dualism). Which of these approaches to consciousness is correct is fiercely debated.
Direct perception problematically requires a new physical theory allowing conscious experience to supervene directly on the world outside the brain. But if people perceive indirectly through a world model in the brain, then a new physical phenomenon, other than the endless further flow of data, would be needed to explain how the model becomes experience.
If people perceive directly, self-awareness is difficult to explain because one of the principle reason for proposing direct perception is to avoid Ryle's regress where internal processing recurses infinitely. Direct perception also demands that one cannot really be aware of dreams, imagination, mental images or any inner life because these would involve recursion.
Self awareness is less problematic for entities that perceive indirectly because, by definition, they are perceiving their own state. However, as mentioned above, proponents of indirect perception must suggest some phenomenon, either physical or dualist to prevent Ryle's regress. If people perceive indirectly then self awareness might result from the extension of experience in time described by Immanuel Kant, William James and Descartes. Unfortunately this extension in time may not be consistent with our current understanding of physics.