Changeset 152:994ae61ef42c in mediastreamer2 for linphone/mediastreamer2/src/videoout.c
- Timestamp:
- Nov 3, 2008 10:30:27 PM (5 years ago)
- Branch:
- default
- File:
-
- 1 edited
-
linphone/mediastreamer2/src/videoout.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
linphone/mediastreamer2/src/videoout.c
r121 r152 220 220 uint8_t *rgb; 221 221 int rgb_len; 222 struct SwsContext *sws; 222 223 bool_t new_ev; 223 224 }WinDisplay; … … 310 311 wd->rgb=NULL; 311 312 wd->rgb_len=0; 313 sws_freeContext(wd->sws); 314 wd->sws=NULL; 312 315 } 313 316 else … … 367 370 368 371 369 static void yuv420p_to_rgb(MSPicture *src, uint8_t *rgb){ 370 struct SwsContext *sws; 372 static void yuv420p_to_rgb(WinDisplay *wd, MSPicture *src, uint8_t *rgb){ 371 373 int rgb_stride=-src->w*3; 372 374 uint8_t *p; 373 375 374 376 p=rgb+(src->w*3*(src->h-1)); 375 sws=sws_getContext(src->w,src->h,PIX_FMT_YUV420P, 377 if (wd->sws==NULL){ 378 wd->sws=sws_getContext(src->w,src->h,PIX_FMT_YUV420P, 376 379 src->w,src->h,PIX_FMT_BGR24, 377 380 0, NULL, NULL, NULL); 378 if (sws_scale(sws,src->planes,src->strides, 0,379 0, &p, &rgb_stride)<0){ 380 ms_error("Error in 420->rgb sws_scale()."); 381 }382 sws_freeContext(sws);381 } 382 if (sws_scale(wd->sws,src->planes,src->strides, 0, 383 src->h, &p, &rgb_stride)<0){ 384 ms_error("Error in 420->rgb sws_scale()."); 385 } 383 386 } 384 387 … … 443 446 if (wd->fb.planes[0]) ms_free(wd->fb.planes[0]); 444 447 if (wd->rgb) ms_free(wd->rgb); 448 if (wd->sws) sws_freeContext(wd->sws); 445 449 ms_free(wd); 446 450 }
Note: See TracChangeset
for help on using the changeset viewer.
