@@ -157,7 +157,7 @@ static bool COREMEDIA_WaitDevice(SDL_Camera *device)
157157 return true ; // this isn't used atm, since we run our own thread out of Grand Central Dispatch.
158158}
159159
160- static SDL_CameraFrameResult COREMEDIA_AcquireFrame (SDL_Camera *device, SDL_Surface *frame, Uint64 *timestampNS, int *rotation)
160+ static SDL_CameraFrameResult COREMEDIA_AcquireFrame (SDL_Camera *device, SDL_Surface *frame, Uint64 *timestampNS, float *rotation)
161161{
162162 SDL_CameraFrameResult result = SDL_CAMERA_FRAME_READY;
163163 SDLPrivateCameraData *hidden = (__bridge SDLPrivateCameraData *) device->hidden ;
@@ -243,21 +243,21 @@ static SDL_CameraFrameResult COREMEDIA_AcquireFrame(SDL_Camera *device, SDL_Surf
243243 // there is probably math for this, but this is easy to slap into a table.
244244 // rotation = rotations[uiorientation-1][devorientation-1];
245245 if (device->position == SDL_CAMERA_POSITION_BACK_FACING) {
246- static const int back_rotations[4 ][4 ] = {
246+ static const Uint16 back_rotations[4 ][4 ] = {
247247 { 90 , 90 , 90 , 90 }, // ui portrait
248248 { 270 , 270 , 270 , 270 }, // ui portait upside down
249249 { 0 , 0 , 0 , 0 }, // ui landscape left
250250 { 180 , 180 , 180 , 180 } // ui landscape right
251251 };
252- *rotation = back_rotations[ui_orientation - 1 ][device_orientation - 1 ];
252+ *rotation = ( float ) back_rotations[ui_orientation - 1 ][device_orientation - 1 ];
253253 } else {
254- static const int front_rotations[4 ][4 ] = {
254+ static const Uint16 front_rotations[4 ][4 ] = {
255255 { 90 , 90 , 270 , 270 }, // ui portrait
256256 { 270 , 270 , 90 , 90 }, // ui portait upside down
257257 { 0 , 0 , 180 , 180 }, // ui landscape left
258258 { 180 , 180 , 0 , 0 } // ui landscape right
259259 };
260- *rotation = front_rotations[ui_orientation - 1 ][device_orientation - 1 ];
260+ *rotation = ( float ) front_rotations[ui_orientation - 1 ][device_orientation - 1 ];
261261 }
262262 #endif
263263
0 commit comments