Commit 12115d7b authored by smorlat's avatar smorlat

prevent mirroring of no webcam picture.



git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@58 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
parent f43e79b9
......@@ -74,8 +74,9 @@ void ms_queue_destroy(MSQueue *q);
#define mblk_set_rate(m,bits) (m)->reserved2=((m)->reserved2|(bits)<<1)
#define mblk_get_rate(m) (((m)->reserved2>>1)&0x3)
#define mblk_set_payload_type(m,bits) (m)->reserved2=((m)->reserved2|(bits<<3))
#define mblk_get_payload_type(m) (((m)->reserved2>>3)&0xFF)
#define mblk_get_payload_type(m) (((m)->reserved2>>3)&0x7F)
#define mblk_set_precious_flag(m,bit) (m)->reserved2=(m)->reserved2|((bit & 0x1)<<10) /*use to prevent mirroring*/
#define mblk_get_precious_flag(m) (((m)->reserved2)>>10 & 0x1)
struct _MSBufferizer{
queue_t q;
......
......@@ -911,7 +911,10 @@ static void v4l_process(MSFilter * obj){
om=dupmsg(v4l_make_mire(s));
}else {
mblk_t *tmpm=v4l_make_nowebcam(s);
if (tmpm) om=dupmsg(tmpm);
if (tmpm) {
om=dupmsg(tmpm);
mblk_set_precious_flag(om,1);
}
}
}
ms_mutex_unlock(&s->mutex);
......
......@@ -143,7 +143,12 @@ void static_image_process(MSFilter *f){
SIData *d=(SIData*)f->data;
/*output a frame every second*/
if ((f->ticker->time - d->lasttime>1000) || d->lasttime==0){
if (d->pic) ms_queue_put(f->outputs[0],dupb(d->pic));
if (d->pic) {
mblk_t *o=dupb(d->pic);
/*prevent mirroring at the output*/
mblk_set_precious_flag(o,1);
ms_queue_put(f->outputs[0],o);
}
d->lasttime=f->ticker->time;
}
}
......
......@@ -695,7 +695,7 @@ static void video_out_process(MSFilter *f){
src.h, obj->local_pic.planes, obj->local_pic.strides)<0){
ms_error("Error in sws_scale().");
}
yuv_buf_mirror(&obj->local_pic);
if (!mblk_get_precious_flag(inm)) yuv_buf_mirror(&obj->local_pic);
}
}
ms_queue_flush(f->inputs[1]);
......
......@@ -504,8 +504,10 @@ static void v4w_process(MSFilter * obj){
}
}else {
mblk_t *nowebcam = v4w_make_nowebcam(s);
if (nowebcam!=NULL)
if (nowebcam!=NULL){
om=dupmsg(nowebcam);
mblk_set_precious_flag(om,1);
}
}
ms_mutex_unlock(&s->mutex);
if (om!=NULL){
......
......@@ -1020,8 +1020,10 @@ static void v4w_process(MSFilter * obj){
}
}else {
mblk_t *nowebcam = v4w_make_nowebcam(s);
if (nowebcam!=NULL)
if (nowebcam!=NULL){
om=dupmsg(nowebcam);
mblk_set_precious_flag(om,1);
}
}
ms_mutex_unlock(&s->mutex);
if (om!=NULL){
......
......@@ -129,6 +129,8 @@ mblk_t *dupb(mblk_t *mp)
datab_ref(mp->b_datap);
newm=(mblk_t *) ortp_malloc(sizeof(mblk_t));
mblk_init(newm);
newm->reserved1=mp->reserved1;
newm->reserved2=mp->reserved2;
newm->b_datap=mp->b_datap;
newm->b_rptr=mp->b_rptr;
newm->b_wptr=mp->b_wptr;
......
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