20#include <emscripten/emscripten.h>
30#define MOOSEFRAME_SIZE (MOOSEPIC_W * MOOSEPIC_H)
31#define MOOSEFRAMES_COUNT 10
163 SDL_Log(
"Usage: %s [arg] [arg] [arg] ...\n", argv0);
165 SDL_Log(
"Where 'arg' is any of the following options:\n");
167 SDL_Log(
" -fps <frames per second>\n");
169 SDL_Log(
" -format <fmt> (one of the: YV12, IYUV, YUY2, UYVY, YVYU)\n");
170 SDL_Log(
" -scale <scale factor> (initial scale of the overlay)\n");
171 SDL_Log(
" -help (shows this help)\n");
173 SDL_Log(
"Press ESC to exit, or SPACE to freeze the movie while application running.\n");
183 switch (
event.type) {
196 if (
event.motion.state) {
215#ifndef __EMSCRIPTEN__
230 emscripten_cancel_main_loop();
260 "The -fps option requires an argument [from 1 to 1000], default is 12.\n");
263 if ((fps < 0) || (fps > 1000)) {
265 "The -fps option must be in range from 1 to 1000, default is 12.\n");
272 "The -fps option requires an argument [from 1 to 1000], default is 12.\n");
275 }
else if (
SDL_strcmp(argv[1],
"-nodelay") == 0) {
279 }
else if (
SDL_strcmp(argv[1],
"-scale") == 0) {
284 "The -scale option requires an argument [from 1 to 50], default is 5.\n");
289 "The -scale option must be in range from 1 to 50, default is 5.\n");
296 "The -fps option requires an argument [from 1 to 1000], default is 12.\n");
299 }
else if ((
SDL_strcmp(argv[1],
"-help") == 0)
311 if (RawMooseData ==
NULL) {
396 emscripten_set_main_loop(
loop, nodelay ? 0 : fps, 1);
#define SDL_RenderPresent
#define SDL_DestroyRenderer
#define SDL_CreateTexture
#define SDL_GetYUVConversionModeForResolution
#define SDL_CreateRenderer
#define SDL_UpdateTexture
#define SDL_LogSetPriority
#define SDL_RenderSetViewport
@ SDL_LOG_CATEGORY_APPLICATION
GLenum GLenum GLenum GLenum GLenum scale
@ SDL_TEXTUREACCESS_STREAMING
#define SDL_WINDOWPOS_UNDEFINED
@ SDL_WINDOWEVENT_RESIZED
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int int in j)
EGLImageKHR EGLint EGLint * handle
EGLSurface EGLNativeWindowType * window
A rectangle, with the origin at the upper left (integer).
The type used to identify a window.
#define MOOSEFRAMES_COUNT
static void PrintUsage(char *argv0)
int main(int argc, char **argv)
Uint8 MooseFrame[MOOSEFRAMES_COUNT][MOOSEFRAME_SIZE *2]
SDL_Texture * MooseTexture
SDL_Color MooseColors[84]
SDL_bool ConvertRGBtoYUV(Uint32 format, Uint8 *src, int pitch, Uint8 *out, int w, int h, SDL_YUV_CONVERSION_MODE mode, int monochrome, int luminance)