I'm trying to learn how 360 degree videos currently available inside VR headsets such as Oculus or Samsung Gear VR work. Apparently they are using the notion of panoramic videos (360 degree video). I was doing some tests, and noticed the raw video is larger in resolution, and inside VR a special region (which is forward facing the eyes) is initially showed which is inside the viewport. User can also change the view as desired.
Here is a sample of the raw 360 panoramic video:
And here how inside a VR headset such as Gear VR it is seen (the major viewport):
Now my question is that if there is any ways to detect which part of the raw video is in fact currently inside the viewport? I mean, can we detect (almost) what part of a 360 video is now being seen? Are there any API that VR headsets such as Gear VR, Oculus, Unity3D, or any other VR-related tool provide to know that, maybe using some sensors or other info?
I have limited information, so any kind of information in this regard is useful for me.