Commit ae7dfdca authored by Simon Morlat's avatar Simon Morlat

Merge branch 'master' of belledonne-communications.com:mediastreamer2

parents b122cd21 f7003dab
......@@ -42,7 +42,7 @@ typedef struct _MSDisplayDesc{
bool_t (*init)(struct _MSDisplay *, struct _MSFilter *f, MSPicture *frame_buffer, MSPicture *selfview_buffer);
void (*lock)(struct _MSDisplay *);/*lock before writing to the framebuffer*/
void (*unlock)(struct _MSDisplay *);/*unlock after writing to the framebuffer*/
void (*update)(struct _MSDisplay *); /*display the picture to the screen*/
void (*update)(struct _MSDisplay *, int new_image, int new_selfview); /*display the picture to the screen*/
void (*uninit)(struct _MSDisplay *);
bool_t (*pollevent)(struct _MSDisplay *, MSDisplayEvent *ev);
long default_window_id;
......@@ -59,7 +59,8 @@ typedef struct _MSDisplay{
#define ms_display_init(d,f,fbuf,fbuf_selfview) (d)->desc->init(d,f,fbuf,fbuf_selfview)
#define ms_display_lock(d) if ((d)->desc->lock) (d)->desc->lock(d)
#define ms_display_unlock(d) if ((d)->desc->unlock) (d)->desc->unlock(d)
#define ms_display_update(d) if ((d)->desc->update) (d)->desc->update(d)
#define ms_display_update(d, A, B) if ((d)->desc->update) (d)->desc->update(d, A, B)
bool_t ms_display_poll_event(MSDisplay *d, MSDisplayEvent *ev);
extern MSDisplayDesc ms_sdl_display_desc;
......
......@@ -199,7 +199,7 @@ static void sdl_display_unlock(MSDisplay *obj){
ms_mutex_unlock(&wd->sdl_mutex);
}
static void sdl_display_update(MSDisplay *obj){
static void sdl_display_update(MSDisplay *obj, int new_image, int new_selfview){
SdlDisplay *wd = (SdlDisplay*)obj->data;
SDL_Rect rect;
rect.x=0;
......@@ -531,7 +531,7 @@ static void reduce(int *num, int *denom)
*denom /= divisor;
}
static void win_display_update(MSDisplay *obj){
static void win_display_update(MSDisplay *obj, int new_image, int new_selfview){
WinDisplay *wd=(WinDisplay*)obj->data;
HDC hdc;
BITMAPINFOHEADER bi;
......@@ -555,7 +555,8 @@ static void win_display_update(MSDisplay *obj){
ms_error("Could not get window dc");
return;
}
yuv420p_to_rgb(wd, &wd->fb, wd->rgb);
if (new_image>0)
yuv420p_to_rgb(wd, &wd->fb, wd->rgb);
memset(&bi,0,sizeof(bi));
bi.biSize=sizeof(bi);
GetClientRect(wd->window,&rect);
......@@ -656,7 +657,8 @@ static void win_display_update(MSDisplay *obj){
{
int x_sv;
int y_sv;
yuv420p_to_rgb_selfview(wd, &wd->fb_selfview, wd->rgb_selfview);
if (new_selfview>0)
yuv420p_to_rgb_selfview(wd, &wd->fb_selfview, wd->rgb_selfview);
//HPEN hpenDot;
//hpenDot = CreatePen(PS_SOLID, 1, RGB(10, 10, 10));
......@@ -709,7 +711,8 @@ static void win_display_update(MSDisplay *obj){
ratioh=wd->fb_selfview.h;
reduce(&ratiow, &ratioh);
yuv420p_to_rgb_selfview(wd, &wd->fb_selfview, wd->rgb_selfview);
if (new_selfview>0)
yuv420p_to_rgb_selfview(wd, &wd->fb_selfview, wd->rgb_selfview);
if (w_selfview >= w/sv_scalefactor)
{
w_selfview = w_selfview/ratiow*ratiow;
......@@ -1024,6 +1027,8 @@ static void video_out_preprocess(MSFilter *f){
static void video_out_process(MSFilter *f){
VideoOut *obj=(VideoOut*)f->data;
mblk_t *inm;
int update=0;
int update_selfview=0;
ms_filter_lock(f);
if (!obj->ready) video_out_prepare(f);
......@@ -1058,6 +1063,7 @@ static void video_out_process(MSFilter *f){
}
if (!mblk_get_precious_flag(inm)) yuv_buf_mirror(&obj->fbuf_selfview);
ms_display_unlock(obj->display);
update_selfview=1;
}
}else{
MSPicture src;
......@@ -1079,6 +1085,7 @@ static void video_out_process(MSFilter *f){
ms_error("Error in sws_scale().");
}
if (!mblk_get_precious_flag(inm)) yuv_buf_mirror(&obj->local_pic);
update=1;
}
}
}
......@@ -1123,6 +1130,7 @@ static void video_out_process(MSFilter *f){
if (obj->mirror && !mblk_get_precious_flag(inm)) yuv_buf_mirror(&obj->fbuf);
ms_display_unlock(obj->display);
}
update=1;
ms_queue_flush(f->inputs[0]);
}
......@@ -1144,7 +1152,7 @@ static void video_out_process(MSFilter *f){
ms_display_unlock(obj->display);
}
ms_display_update(obj->display);
ms_display_update(obj->display, update, update_selfview);
ms_filter_unlock(f);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment