From e7680ddaa636c70bbd3407e3dd55b91f3070e840 Mon Sep 17 00:00:00 2001 From: smorlat Date: Mon, 3 Nov 2008 13:42:53 +0000 Subject: [PATCH] fix tabs git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@152 3f6dc0c8-ddfe-455d-9043-3cd528dc4637 --- linphone/mediastreamer2/src/msv4l2.c | 2 + linphone/mediastreamer2/src/nowebcam.c | 47 +++++++++++------------ linphone/mediastreamer2/tests/Makefile.am | 2 +- 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/linphone/mediastreamer2/src/msv4l2.c b/linphone/mediastreamer2/src/msv4l2.c index 2a25d125b..e23eedb5f 100644 --- a/linphone/mediastreamer2/src/msv4l2.c +++ b/linphone/mediastreamer2/src/msv4l2.c @@ -129,6 +129,8 @@ static int v4l2_configure(V4l2State *s){ return -1; } + ms_message("Driver is %s",cap.driver); + if (v4lv2_try_format(s,V4L2_PIX_FMT_YUV420)){ s->pix_fmt=MS_YUV420P; s->int_pix_fmt=V4L2_PIX_FMT_YUV420; diff --git a/linphone/mediastreamer2/src/nowebcam.c b/linphone/mediastreamer2/src/nowebcam.c index b65c32c3d..ec2e6c53c 100644 --- a/linphone/mediastreamer2/src/nowebcam.c +++ b/linphone/mediastreamer2/src/nowebcam.c @@ -125,7 +125,7 @@ void static_image_init(MSFilter *f){ SIData *d=(SIData*)ms_new(SIData,1); d->vsize.width=MS_VIDEO_SIZE_CIF_W; d->vsize.height=MS_VIDEO_SIZE_CIF_H; - memset(d->nowebcamimage, 0, sizeof(d->nowebcamimage)); + memset(d->nowebcamimage, 0, sizeof(d->nowebcamimage)); d->index=-1; d->lasttime=0; d->pic=NULL; @@ -138,27 +138,26 @@ void static_image_uninit(MSFilter *f){ void static_image_preprocess(MSFilter *f){ SIData *d=(SIData*)f->data; - if (d->pic==NULL) - { - if (d->nowebcamimage[0] != '\0') - d->pic=ms_load_jpeg_as_yuv(d->nowebcamimage,&d->vsize); - else - d->pic=ms_load_nowebcam(&d->vsize,d->index); - } + if (d->pic==NULL){ + if (d->nowebcamimage[0] != '\0') + d->pic=ms_load_jpeg_as_yuv(d->nowebcamimage,&d->vsize); + else + d->pic=ms_load_nowebcam(&d->vsize,d->index); + } } 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){ - ms_mutex_lock(&f->lock); + ms_mutex_lock(&f->lock); 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); } - ms_mutex_unlock(&f->lock); + ms_mutex_unlock(&f->lock); d->lasttime=f->ticker->time; } } @@ -190,24 +189,24 @@ int static_image_get_pix_fmt(MSFilter *f, void *data){ return 0; } -static int static_image_set_image(MSFilter *f, void *arg){ - SIData *d=(SIData*)f->data; - char *image = (char *)arg; - ms_mutex_lock(&f->lock); - if (image!=NULL && image[0]!='\0') - snprintf(d->nowebcamimage, sizeof(d->nowebcamimage), "%s", image); - else - d->nowebcamimage[0] = '\0'; - - if (d->pic!=NULL) - freemsg(d->pic); - +static int static_image_set_image(MSFilter *f, void *arg){ + SIData *d=(SIData*)f->data; + char *image = (char *)arg; + ms_mutex_lock(&f->lock); + if (image!=NULL && image[0]!='\0') + snprintf(d->nowebcamimage, sizeof(d->nowebcamimage), "%s", image); + else + d->nowebcamimage[0] = '\0'; + + if (d->pic!=NULL) + freemsg(d->pic); + //if (d->nowebcamimage[0] != '\0') // d->pic=ms_load_jpeg_as_yuv(d->nowebcamimage,&d->vsize); //else // d->pic=ms_load_nowebcam(&d->vsize,d->index); - ms_mutex_unlock(&f->lock); - return 0; + ms_mutex_unlock(&f->lock); + return 0; } MSFilterMethod static_image_methods[]={ diff --git a/linphone/mediastreamer2/tests/Makefile.am b/linphone/mediastreamer2/tests/Makefile.am index ee8638e46..fe6dd8584 100644 --- a/linphone/mediastreamer2/tests/Makefile.am +++ b/linphone/mediastreamer2/tests/Makefile.am @@ -22,7 +22,7 @@ LDADD= $(top_builddir)/src/libmediastreamer.la \ $(SPEEX_LIBS) \ $(GSM_LIBS) \ $(THEORA_LIBS) \ - $(FFMPEG_LIBS) + $(VIDEO_LIBS)