[svn] / branches / dev-api-3 / vfw / src / codec.c Repository:
ViewVC logotype

Diff of /branches/dev-api-3/vfw/src/codec.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 633, Thu Nov 7 15:21:31 2002 UTC revision 634, Fri Nov 8 10:11:48 2002 UTC
# Line 172  Line 172 
172          }          }
173    
174          if (inhdr->biWidth != outhdr->biWidth || inhdr->biHeight != outhdr->biHeight ||          if (inhdr->biWidth != outhdr->biWidth || inhdr->biHeight != outhdr->biHeight ||
175                  (outhdr->biCompression != FOURCC_XVID && outhdr->biCompression != FOURCC_DIVX))                  (outhdr->biCompression != FOURCC_XVID && outhdr->biCompression != FOURCC_DIVX && outhdr->biCompression != FOURCC_DX50))
176          {          {
177                  return ICERR_BADFORMAT;                  return ICERR_BADFORMAT;
178          }          }
# Line 610  Line 610 
610          {          {
611                  return ICERR_ERROR;                  return ICERR_ERROR;
612          }          }
 /* --- yv12 --- */  
         if (inhdr->biCompression == FOURCC_YV12) {  
                 return ICERR_OK;  
         }  
 /* --- yv12 --- */  
613    
614          if (inhdr->biCompression != FOURCC_XVID && inhdr->biCompression != FOURCC_DIVX)          if (inhdr->biCompression != FOURCC_XVID &&
615                    inhdr->biCompression != FOURCC_DIVX &&
616                    inhdr->biCompression != FOURCC_DX50 &&
617                    get_colorspace(inhdr) == XVID_CSP_NULL)
618          {          {
619                  return ICERR_BADFORMAT;                  return ICERR_BADFORMAT;
620          }          }
# Line 649  Line 647 
647          }          }
648    
649          /* --- yv12 --- */          /* --- yv12 --- */
650            if (get_colorspace(inhdr) != XVID_CSP_NULL) {
         if (lpbiInput->bmiHeader.biCompression == FOURCC_YV12) {  
651                  memcpy(outhdr, inhdr, sizeof(BITMAPINFOHEADER));                  memcpy(outhdr, inhdr, sizeof(BITMAPINFOHEADER));
652                    // XXX: should we set outhdr->biSize ??
653                  return ICERR_OK;                  return ICERR_OK;
654          }          }
655          /* --- yv12 --- */          /* --- yv12 --- */
# Line 732  Line 730 
730          frame.stride = (((icd->lpbiOutput->biWidth * icd->lpbiOutput->biBitCount) + 31) & ~31) >> 3;          frame.stride = (((icd->lpbiOutput->biWidth * icd->lpbiOutput->biBitCount) + 31) & ~31) >> 3;
731    
732          /* --- yv12 --- */          /* --- yv12 --- */
733          if (icd->lpbiInput->biCompression == FOURCC_YV12) {          if (icd->lpbiInput->biCompression != FOURCC_XVID &&
734                    icd->lpbiInput->biCompression != FOURCC_DIVX &&
735                    icd->lpbiInput->biCompression != FOURCC_DX50)
736            {
737                    XVID_INIT_CONVERTINFO convert;
738    
739                    DEBUGFOURCC("input", icd->lpbiInput->biCompression);
740                  DEBUGFOURCC("output", icd->lpbiOutput->biCompression);                  DEBUGFOURCC("output", icd->lpbiOutput->biCompression);
741                  if (icd->lpbiOutput->biCompression == FOURCC_YV12) {  
742                          memcpy(frame.image,codec->dhandle,icd->lpbiInput->biSizeImage);                  convert.input.colorspace = get_colorspace(icd->lpbiInput);
743                    convert.input.y = icd->lpInput;
744                    convert.input.y_stride = (((icd->lpbiInput->biWidth * icd->lpbiInput->biBitCount) + 31) & ~31) >> 3;
745    
746                    convert.output.colorspace = get_colorspace(icd->lpbiOutput);
747                    convert.output.y = icd->lpOutput;
748                    convert.output.y_stride = (((icd->lpbiOutput->biWidth * icd->lpbiOutput->biBitCount) + 31) & ~31) >> 3;
749    
750                    convert.width = icd->lpbiInput->biWidth;
751                    convert.height = icd->lpbiInput->biHeight;
752                    convert.interlacing = 0;
753    
754                    if (convert.input.colorspace == XVID_CSP_NULL ||
755                            convert.output.colorspace == XVID_CSP_NULL ||
756                            xvid_init(NULL, XVID_INIT_CONVERT, &convert, NULL) != XVID_ERR_OK)
757                    {
758                            return ICERR_BADFORMAT;
759                  }                  }
760    
761                  return ICERR_OK;                  return ICERR_OK;
762          }          }
763          /* --- yv12 --- */          /* --- yv12 --- */

Legend:
Removed from v.633  
changed lines
  Added in v.634

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4