test/testoverlay2.c
changeset 886 05c551e5bc64
parent 753 b14fdadd8311
child 1030 6b8f0543337c
equal deleted inserted replaced
885:9f6ad2286011 886:05c551e5bc64
   252 }
   252 }
   253 
   253 
   254 static void PrintUsage(char *argv0)
   254 static void PrintUsage(char *argv0)
   255 {
   255 {
   256     fprintf(stderr, "Usage: %s [arg] [arg] [arg] ...\n", argv0);
   256     fprintf(stderr, "Usage: %s [arg] [arg] [arg] ...\n", argv0);
   257     fprintf(stderr, "Where 'arg' is one of:\n");
   257     fprintf(stderr, "\n");
       
   258     fprintf(stderr, "Where 'arg' is any of the following options:\n");
       
   259     fprintf(stderr, "\n");
   258     fprintf(stderr, "	-fps <frames per second>\n");
   260     fprintf(stderr, "	-fps <frames per second>\n");
   259     fprintf(stderr, "	-format <fmt> (one of the: YV12, IYUV, YUY2, UYVY, YVYU)\n");
   261     fprintf(stderr, "	-format <fmt> (one of the: YV12, IYUV, YUY2, UYVY, YVYU)\n");
   260     fprintf(stderr, "	-scale <scale factor> (initial scale of the overlay)\n");
   262     fprintf(stderr, "	-scale <scale factor> (initial scale of the overlay)\n");
   261     fprintf(stderr, "	-help (shows this help)\n");
   263     fprintf(stderr, "	-help (shows this help)\n");
   262     fprintf(stderr, "\n");
   264     fprintf(stderr, "\n");
   263     fprintf(stderr, "	Press ESC to exit, or SPACE to freeze the movie while application running.\n");
   265     fprintf(stderr, "Press ESC to exit, or SPACE to freeze the movie while application running.\n");
   264     fprintf(stderr, "\n");
   266     fprintf(stderr, "\n");
   265 }
   267 }
   266 
   268 
   267 int main(int argc, char **argv)
   269 int main(int argc, char **argv)
   268 {
   270 {
   464     }
   466     }
   465 
   467 
   466     free(RawMooseData);
   468     free(RawMooseData);
   467 
   469 
   468     overlay=SDL_CreateYUVOverlay(MOOSEPIC_W, MOOSEPIC_H, overlay_format, screen);
   470     overlay=SDL_CreateYUVOverlay(MOOSEPIC_W, MOOSEPIC_H, overlay_format, screen);
       
   471     if (!overlay)
       
   472     {
       
   473         fprintf(stderr, "Couldn't create overlay: %s\n", SDL_GetError());
       
   474         return 7;
       
   475     }
   469 
   476 
   470     printf("Created %dx%dx%d %s %s overlay\n",overlay->w,overlay->h,overlay->planes,
   477     printf("Created %dx%dx%d %s %s overlay\n",overlay->w,overlay->h,overlay->planes,
   471            overlay->hw_overlay?"hardware":"software",
   478            overlay->hw_overlay?"hardware":"software",
   472            overlay->format==SDL_YV12_OVERLAY?"YV12":
   479            overlay->format==SDL_YV12_OVERLAY?"YV12":
   473            overlay->format==SDL_IYUV_OVERLAY?"IYUV":
   480            overlay->format==SDL_IYUV_OVERLAY?"IYUV":