Lines Matching defs:sdl

100     SDLContext *sdl = s->priv_data;
103 SDL_Rect *texture_rect = &sdl->texture_rect;
110 if (sdl->window_width && sdl->window_height) {
112 if (av_cmp_q(dar, (AVRational){ sdl->window_width, sdl->window_height }) > 0) {
114 texture_rect->w = sdl->window_width;
118 texture_rect->h = sdl->window_height;
129 sdl->window_width = texture_rect->w;
130 sdl->window_height = texture_rect->h;
133 texture_rect->x = (sdl->window_width - texture_rect->w) / 2;
134 texture_rect->y = (sdl->window_height - texture_rect->h) / 2;
139 SDLContext *sdl = s->priv_data;
141 if (sdl->texture)
142 SDL_DestroyTexture(sdl->texture);
143 sdl->texture = NULL;
145 if (sdl->renderer)
146 SDL_DestroyRenderer(sdl->renderer);
147 sdl->renderer = NULL;
149 if (sdl->window)
150 SDL_DestroyWindow(sdl->window);
151 sdl->window = NULL;
153 if (!sdl->inited)
161 SDLContext *sdl = s->priv_data;
167 if (!sdl->window_title)
168 sdl->window_title = av_strdup(s->url);
173 sdl->inited = 1;
185 sdl->texture_fmt = sdl_texture_format_map[i].texture_fmt;
190 if (!sdl->texture_fmt) {
199 (sdl->window_fullscreen ? SDL_WINDOW_FULLSCREEN : 0) |
200 (sdl->window_borderless ? SDL_WINDOW_BORDERLESS : SDL_WINDOW_RESIZABLE);
203 if (!sdl->inited){
212 if (SDL_CreateWindowAndRenderer(sdl->window_width, sdl->window_height,
213 flags, &sdl->window, &sdl->renderer) != 0){
214 av_log(sdl, AV_LOG_ERROR, "Couldn't create window and renderer: %s\n", SDL_GetError());
218 SDL_SetWindowTitle(sdl->window, sdl->window_title);
219 SDL_SetWindowPosition(sdl->window, sdl->window_x, sdl->window_y);
220 SDL_ShowWindow(sdl->window);
222 sdl->texture = SDL_CreateTexture(sdl->renderer, sdl->texture_fmt, SDL_TEXTUREACCESS_STREAMING,
225 if (!sdl->texture) {
226 av_log(sdl, AV_LOG_ERROR, "Unable to set create mode: %s\n", SDL_GetError());
232 sdl->window_width, sdl->window_height);
234 sdl->inited = 1;
245 SDLContext *sdl = s->priv_data;
270 sdl->window_width = event.window.data1;
271 sdl->window_height = event.window.data2;
283 if (quit && sdl->enable_quit_action) {
289 switch (sdl->texture_fmt) {
303 ret = SDL_UpdateYUVTexture(sdl->texture, NULL,
324 ret = SDL_UpdateTexture(sdl->texture, NULL, data[0], linesize[0]);
331 SDL_RenderClear(sdl->renderer);
332 SDL_RenderCopy(sdl->renderer, sdl->texture, NULL, &sdl->texture_rect);
333 SDL_RenderPresent(sdl->renderer);
359 .name = "sdl,sdl2",