Changeset 875:df84c755d2d3 in mediastreamer2


Ignore:
Timestamp:
Feb 8, 2010 6:13:21 PM (3 years ago)
Author:
Aymeric Moizard <jack@…>
Branch:
default
Children:
876:90fbe2af7437, 878:192a99c1b51e, 884:599504ee6fa1
Message:

improve performance for msdisplay with selfview

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • include/mediastreamer2/msvideoout.h

    r869 r875  
    4343        void (*lock)(struct _MSDisplay *);/*lock before writing to the framebuffer*/ 
    4444        void (*unlock)(struct _MSDisplay *);/*unlock after writing to the framebuffer*/ 
    45         void (*update)(struct _MSDisplay *); /*display the picture to the screen*/ 
     45        void (*update)(struct _MSDisplay *, int new_image, int new_selfview); /*display the picture to the screen*/ 
    4646        void (*uninit)(struct _MSDisplay *); 
    4747        bool_t (*pollevent)(struct _MSDisplay *, MSDisplayEvent *ev); 
     
    6060#define ms_display_lock(d)      if ((d)->desc->lock) (d)->desc->lock(d) 
    6161#define ms_display_unlock(d)    if ((d)->desc->unlock) (d)->desc->unlock(d) 
    62 #define ms_display_update(d)    if ((d)->desc->update) (d)->desc->update(d) 
     62#define ms_display_update(d, A, B)      if ((d)->desc->update) (d)->desc->update(d, A, B) 
     63 
    6364bool_t ms_display_poll_event(MSDisplay *d, MSDisplayEvent *ev); 
    6465 
  • src/videoout.c

    r869 r875  
    201201} 
    202202 
    203 static void sdl_display_update(MSDisplay *obj){ 
     203static void sdl_display_update(MSDisplay *obj, int new_image, int new_selfview){ 
    204204        SdlDisplay *wd = (SdlDisplay*)obj->data; 
    205205        SDL_Rect rect; 
     
    531531} 
    532532 
    533 static void win_display_update(MSDisplay *obj){ 
     533static void win_display_update(MSDisplay *obj, int new_image, int new_selfview){ 
    534534        WinDisplay *wd=(WinDisplay*)obj->data; 
    535535        HDC hdc; 
     
    555555                return; 
    556556        } 
    557         yuv420p_to_rgb(wd, &wd->fb, wd->rgb); 
     557        if (new_image>0) 
     558                yuv420p_to_rgb(wd, &wd->fb, wd->rgb); 
    558559        memset(&bi,0,sizeof(bi)); 
    559560        bi.biSize=sizeof(bi); 
     
    656657                                int x_sv; 
    657658                                int y_sv; 
    658                                 yuv420p_to_rgb_selfview(wd, &wd->fb_selfview, wd->rgb_selfview); 
     659                                if (new_selfview>0) 
     660                                        yuv420p_to_rgb_selfview(wd, &wd->fb_selfview, wd->rgb_selfview); 
    659661 
    660662                                //HPEN hpenDot; 
     
    709711                        reduce(&ratiow, &ratioh); 
    710712 
    711                         yuv420p_to_rgb_selfview(wd, &wd->fb_selfview, wd->rgb_selfview); 
     713                        if (new_selfview>0) 
     714                                yuv420p_to_rgb_selfview(wd, &wd->fb_selfview, wd->rgb_selfview); 
    712715                        if (w_selfview >= w/sv_scalefactor) 
    713716                        { 
     
    10241027        VideoOut *obj=(VideoOut*)f->data; 
    10251028        mblk_t *inm; 
     1029        int update=0; 
     1030        int update_selfview=0; 
    10261031 
    10271032        ms_filter_lock(f); 
     
    10581063                                if (!mblk_get_precious_flag(inm)) yuv_buf_mirror(&obj->fbuf_selfview); 
    10591064                                ms_display_unlock(obj->display); 
     1065                                update_selfview=1; 
    10601066                        } 
    10611067                }else{ 
     
    10791085                                        } 
    10801086                                        if (!mblk_get_precious_flag(inm)) yuv_buf_mirror(&obj->local_pic); 
     1087                                        update=1; 
    10811088                                } 
    10821089                        } 
     
    11231130                        ms_display_unlock(obj->display); 
    11241131                } 
     1132                update=1; 
    11251133                ms_queue_flush(f->inputs[0]); 
    11261134        } 
     
    11441152        } 
    11451153 
    1146         ms_display_update(obj->display); 
     1154        ms_display_update(obj->display, update, update_selfview); 
    11471155        ms_filter_unlock(f); 
    11481156} 
Note: See TracChangeset for help on using the changeset viewer.