Can you make a small test :

nmake webcam-test-visu-c

...

launch webcam-test-visu-c.exe

Is it the same result ?

Laurent

张源 a écrit :
>
>
> 2009/7/1 Laurent Tarrisse <laur...@mbdsys.com <mailto:laur...@mbdsys.com>>
>
>     Laurent Tarrisse a écrit :
>     > 张源 a écrit :
>     >
>     >> I have built qutecom-2-2-3faed9597730(debug),with vs 2005 on
>     windows
>     >> xp Chinese simplified but there are some problems with Qutecom when
>     >> making a webcam preview or a video call .
>     >>
>     >> The problems are as follows: when entering Video settings ,then
>     click
>     >> Webcam Preview button ,after a while ,the Label on the right
>     side just
>     >> shows a gray rectangle. The Video call is also just shows a gray
>     >> rectangle,and after a while it crashed .
>     >> Webcam Preview.png (/image/png/) 5K
>     >>
>     <?ui=2&ik=ab85a7e087&view=att&th=1223455e9356b51f&attid=0.1&disp=attd>
>     >> The piximage has been sucessfully catched by WebcamDriver.
>     >> I found the problem may lie in this code section:
>     >> pixertool.cpp
>     >>
>     >> *...*
>     >> pixerrorcode* pix_convert*(int flags, piximage * img_dst,
>     piximage *
>     >> img_src) {
>     >> *...*
>     >> if (*img_convert*(&avp_target, pix_fmt_target,
>     >> &avp_tmp_target, pix_fmt_source,
>     >> img_dst->width, img_dst->height) *== -1*) {
>     >> av_free(buf_tmp_target);
>     >> return PIX_NOK;
>     >> }
>     >> * ...*
>     >> }
>     >>
>     > Can you give me img_src->palette and img_src->dst ?
>     >
>     Oups,
>
>     it is img_src->palette and img_dst->palette.
>
>     Laurent
>     >> *...*
>     >> when calling * pix_convert*() ,the function *img_convert()* allways
>     >> return -1 which means the image conversion fails.
>     >>
>     >> Has anyone face the same problem ,please help me
>     >>
>     >>
>     ------------------------------------------------------------------------
>     >>
>     >>
>     ------------------------------------------------------------------------
>     >>
>     >> _______________________________________________
>     >> QuteCom-dev mailing list
>     >> QuteCom-dev@lists.qutecom.org
>     <mailto:QuteCom-dev@lists.qutecom.org>
>     >> http://lists.qutecom.org/mailman/listinfo/qutecom-dev
>     >>
>     >>
>     >
>     > _______________________________________________
>     > QuteCom-dev mailing list
>     > QuteCom-dev@lists.qutecom.org <mailto:QuteCom-dev@lists.qutecom.org>
>     > http://lists.qutecom.org/mailman/listinfo/qutecom-dev
>     >
>
>     _______________________________________________
>     QuteCom-dev mailing list
>     QuteCom-dev@lists.qutecom.org <mailto:QuteCom-dev@lists.qutecom.org>
>     http://lists.qutecom.org/mailman/listinfo/qutecom-dev
>
>
> Thank you !
> the functions are called as follows:1――>2――>3
> *1 *void QtVideoSettings::frameCapturedEventHandler (IWebcamDriver *
> sender, piximage * image) {//重要函数
>
>     * ...*
>     QSize qs(_ui->webcamPreviewLabel->width(),
>     _ui->webcamPreviewLabel->height());
>     QImage tmpRgbImage(qs, QImage::Format_RGB32);
>     *QtVideoQt::convertPixImageToQImage(image, qs, &tmpRgbImage);*
>     QPixmap tmp = QPixmap::fromImage(tmpRgbImage);
>     * ...*
>
> }
> *2 * void QtVideoQt::convertPixImageToQImage(piximage* pixImage, const
> QSize& size, QImage* image) {
> * ...*
> piximage resizedPixImage;
> resizedPixImage.palette = PIX_OSI_RGB32;
> resizedPixImage.width = image->width();
> resizedPixImage.height = image->height();
> resizedPixImage.data = image->bits();
>
> * pix_convert(PIX_NO_FLAG, &resizedPixImage, pixImage);
> * //测试//
> }
>
> * so the img_dst->palette == PIX_OSI_RGB32 img_src->palette ==
> PIX_OSI_YUV420P*
> *3* pixerrorcode pix_convert(int flags, piximage * img_dst, piximage *
> img_src) {
>
> * ...*
> enum PixelFormat pix_fmt_source
> =(PixelFormat)pix_ffmpeg_from_pix_osi(img_src->palette);
> enum PixelFormat pix_fmt_target =
> (PixelFormat)pix_ffmpeg_from_pix_osi(img_dst->palette);
>
>
> *...*
>
>
> #ifndef HAVE_SWSCALE
> //TODO optimize this part but will need the preparation of contexts
> ImgReSampleContext * resample_context =
> img_resample_init(img_dst->width, img_dst->height,
> img_src->width, img_src->height);
>
> if (!resample_context) {
> return PIX_NOK;
> }
>
> AVPicture avp_tmp_target;
>
> //we need to prepare a tmp buffer
> uint8_t * buf_tmp_target = (uint8_t
> *)av_malloc(avpicture_get_size(pix_fmt_source, img_dst->width,
> img_dst->height) * sizeof(uint8_t));
> avpicture_fill(&avp_tmp_target, buf_tmp_target, pix_fmt_source,
> img_dst->width, img_dst->height);
> //
>
> //do the resampling
> img_resample(resample_context, &avp_tmp_target, &avp_source);
> img_resample_close(resample_context);
> //
>
> //do the conversion
> if (*img_convert*(&avp_target, pix_fmt_target,
> &avp_tmp_target, pix_fmt_source,
> img_dst->width, img_dst->height) == -1) {
> av_free(buf_tmp_target);
> return PIX_NOK;//转换没有成功
> }
> * ...*
> }
> *img_dst->palette : PIX_OSI_RGB32*
> * img_src->palette : PIX_OSI_YUV420P*
> pix_fmt_target : *PIX_FMT_BGR32*
> pix_fmt_source : *PIX_FMT_YUV420P*
> img_convert()is a function in ffmpeg library,so the problems might be
> in parameters passed into it .It involves encoding and decoding which
> I totally don't know how to deal with .
> Thanks again !
>
>

_______________________________________________
QuteCom-dev mailing list
QuteCom-dev@lists.qutecom.org
http://lists.qutecom.org/mailman/listinfo/qutecom-dev

Reply via email to