- Timestamp:
- May 16, 2013 11:32:07 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-videodev/sdl_dev.c
r4414 r4520 23 23 24 24 #if defined(PJMEDIA_VIDEO_DEV_HAS_SDL) && PJMEDIA_VIDEO_DEV_HAS_SDL != 0 25 26 25 #include <SDL.h> 27 26 #include <SDL_syswm.h> … … 262 261 }; 263 262 263 /* 264 * Util 265 */ 266 static void sdl_log_err(const char *op) 267 { 268 PJ_LOG(1,(THIS_FILE, "%s error: %s", op, SDL_GetError())); 269 } 264 270 265 271 /**************************************************************************** … … 288 294 289 295 if (SDL_Init(SDL_INIT_VIDEO)) { 290 PJ_LOG(3, (THIS_FILE, "Failed initializing SDL"));296 sdl_log_err("SDL_Init()"); 291 297 return PJMEDIA_EVID_INIT; 292 298 } … … 734 740 strm->window = SDL_CreateWindowFrom( 735 741 strm->param.window.info.window); 742 if (!strm->window) { 743 sdl_log_err("SDL_CreateWindowFrom()"); 744 return PJMEDIA_EVID_SYSERR; 745 } 736 746 } else { 737 747 int x, y; … … 749 759 strm->param.disp_size.h, 750 760 flags); 761 if (!strm->window) { 762 sdl_log_err("SDL_CreateWindow()"); 763 return PJMEDIA_EVID_SYSERR; 764 } 751 765 } 752 if (!strm->window)753 return PJMEDIA_EVID_SYSERR;754 766 } 755 767 … … 759 771 */ 760 772 strm->renderer = SDL_CreateRenderer(strm->window, -1, 0); 761 if (!strm->renderer) 773 if (!strm->renderer) { 774 sdl_log_err("SDL_CreateRenderer()"); 762 775 return PJMEDIA_EVID_SYSERR; 776 } 763 777 764 778 #if PJMEDIA_VIDEO_DEV_SDL_HAS_OPENGL 765 779 if (strm->param.rend_id == OPENGL_DEV_IDX) { 766 780 strm->gl_context = SDL_GL_CreateContext(strm->window); 767 if (!strm->gl_context) 781 if (!strm->gl_context) { 782 sdl_log_err("SDL_GL_CreateContext()"); 768 783 return PJMEDIA_EVID_SYSERR; 784 } 769 785 SDL_GL_MakeCurrent(strm->window, strm->gl_context); 770 786 … … 797 813 SDL_TEXTUREACCESS_STREAMING, 798 814 strm->rect.w, strm->rect.h); 799 if (strm->scr_tex == NULL) 815 if (strm->scr_tex == NULL) { 816 sdl_log_err("SDL_CreateTexture()"); 800 817 return PJMEDIA_EVID_SYSERR; 818 } 801 819 802 820 strm->pitch = strm->rect.w * SDL_BYTESPERPIXEL(sdl_info->sdl_format);
Note: See TracChangeset
for help on using the changeset viewer.