[svn] / branches / dev-api-4 / xvidcore / dshow / src / CXvidDecoder.cpp Repository:
ViewVC logotype

Diff of /branches/dev-api-4/xvidcore/dshow/src/CXvidDecoder.cpp

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

revision 1301, Fri Jan 2 13:18:28 2004 UTC revision 1307, Wed Jan 7 13:50:28 2004 UTC
# Line 19  Line 19 
19   *  along with this program ; if not, write to the Free Software   *  along with this program ; if not, write to the Free Software
20   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21   *   *
22   * $Id: CXvidDecoder.cpp,v 1.1.2.8 2004-01-02 13:18:28 syskin Exp $   * $Id: CXvidDecoder.cpp,v 1.1.2.9 2004-01-07 13:50:28 syskin Exp $
23   *   *
24   ****************************************************************************/   ****************************************************************************/
25    
# Line 212  Line 212 
212          memset(&init, 0, sizeof(init));          memset(&init, 0, sizeof(init));
213          init.version = XVID_VERSION;          init.version = XVID_VERSION;
214    
215            ar_x = ar_y = 0;
216    
217          m_hdll = LoadLibrary(XVID_DLL_NAME);          m_hdll = LoadLibrary(XVID_DLL_NAME);
218          if (m_hdll == NULL) {          if (m_hdll == NULL) {
219                  DPRINTF("dll load failed");                  DPRINTF("dll load failed");
# Line 337  Line 339 
339          {          {
340                  VIDEOINFOHEADER * vih = (VIDEOINFOHEADER *) mtIn->Format();                  VIDEOINFOHEADER * vih = (VIDEOINFOHEADER *) mtIn->Format();
341                  hdr = &vih->bmiHeader;                  hdr = &vih->bmiHeader;
342                    ar_x = vih->bmiHeader.biXPelsPerMeter*hdr->biWidth;
343                    ar_y = vih->bmiHeader.biYPelsPerMeter*hdr->biHeight;
344          }          }
345          else if (*mtIn->FormatType() == FORMAT_VideoInfo2)          else if (*mtIn->FormatType() == FORMAT_VideoInfo2)
346          {          {
347                  VIDEOINFOHEADER2 * vih2 = (VIDEOINFOHEADER2 *) mtIn->Format();                  VIDEOINFOHEADER2 * vih2 = (VIDEOINFOHEADER2 *) mtIn->Format();
348                  hdr = &vih2->bmiHeader;                  hdr = &vih2->bmiHeader;
349                    ar_x = vih2->dwPictAspectRatioX;
350                    ar_y = vih2->dwPictAspectRatioY;
351          }          }
352          else          else
353          {          {
# Line 390  Line 396 
396                  return E_UNEXPECTED;                  return E_UNEXPECTED;
397          }          }
398    
399          VIDEOINFOHEADER * vih = (VIDEOINFOHEADER *) mtOut->ReallocFormatBuffer(sizeof(VIDEOINFOHEADER));          VIDEOINFOHEADER2 * vih = (VIDEOINFOHEADER2 *) mtOut->ReallocFormatBuffer(sizeof(VIDEOINFOHEADER2));
400          if (vih == NULL)          if (vih == NULL)
401          {          {
402                  return E_OUTOFMEMORY;                  return E_OUTOFMEMORY;
# Line 409  Line 415 
415    
416          switch(iPosition)          switch(iPosition)
417          {          {
418    
419          case 0  :          case 0  :
 if ( USE_IYUV )  
 {  
                 vih->bmiHeader.biCompression = CLSID_MEDIASUBTYPE_IYUV.Data1;  
                 vih->bmiHeader.biBitCount = 12;  
                 mtOut->SetSubtype(&CLSID_MEDIASUBTYPE_IYUV);  
                 break;  
 }  
         case 1  :  
 if ( USE_YV12 )  
 {  
                 vih->bmiHeader.biCompression = MEDIASUBTYPE_YV12.Data1;  
                 vih->bmiHeader.biBitCount = 12;  
                 mtOut->SetSubtype(&MEDIASUBTYPE_YV12);  
                 break;  
 }  
         case 2:  
420  if ( USE_YUY2 )  if ( USE_YUY2 )
421  {  {
422                  vih->bmiHeader.biCompression = MEDIASUBTYPE_YUY2.Data1;                  vih->bmiHeader.biCompression = MEDIASUBTYPE_YUY2.Data1;
# Line 433  Line 424 
424                  mtOut->SetSubtype(&MEDIASUBTYPE_YUY2);                  mtOut->SetSubtype(&MEDIASUBTYPE_YUY2);
425                  break;                  break;
426  }  }
427          case 3 :          case 1 :
428  if ( USE_YVYU )  if ( USE_YVYU )
429  {  {
430                  vih->bmiHeader.biCompression = MEDIASUBTYPE_YVYU.Data1;                  vih->bmiHeader.biCompression = MEDIASUBTYPE_YVYU.Data1;
# Line 441  Line 432 
432                  mtOut->SetSubtype(&MEDIASUBTYPE_YVYU);                  mtOut->SetSubtype(&MEDIASUBTYPE_YVYU);
433                  break;                  break;
434  }  }
435          case 4 :          case 2 :
436  if ( USE_UYVY )  if ( USE_UYVY )
437  {  {
438                  vih->bmiHeader.biCompression = MEDIASUBTYPE_UYVY.Data1;                  vih->bmiHeader.biCompression = MEDIASUBTYPE_UYVY.Data1;
# Line 449  Line 440 
440                  mtOut->SetSubtype(&MEDIASUBTYPE_UYVY);                  mtOut->SetSubtype(&MEDIASUBTYPE_UYVY);
441                  break;                  break;
442  }  }
443            case 3  :
444                    if ( USE_IYUV )
445    {
446                    vih->bmiHeader.biCompression = CLSID_MEDIASUBTYPE_IYUV.Data1;
447                    vih->bmiHeader.biBitCount = 12;
448                    mtOut->SetSubtype(&CLSID_MEDIASUBTYPE_IYUV);
449                    break;
450    }
451            case 4  :
452    if ( USE_YV12 )
453    {
454                    vih->bmiHeader.biCompression = MEDIASUBTYPE_YV12.Data1;
455                    vih->bmiHeader.biBitCount = 12;
456                    mtOut->SetSubtype(&MEDIASUBTYPE_YV12);
457                    break;
458    }
459          case 5 :          case 5 :
460  if ( USE_RGB32 )  if ( USE_RGB32 )
461  {  {
# Line 487  Line 494 
494    
495          vih->bmiHeader.biSizeImage = GetBitmapSize(&vih->bmiHeader);          vih->bmiHeader.biSizeImage = GetBitmapSize(&vih->bmiHeader);
496    
497            if (ar_x != 0 && ar_y != 0) {
498                    vih->dwPictAspectRatioX = ar_x;
499                    vih->dwPictAspectRatioY = ar_y;
500            } else { // just to be safe
501                    vih->dwPictAspectRatioX = m_create.width;
502                    vih->dwPictAspectRatioY = m_create.height;
503            }
504    
505          mtOut->SetType(&MEDIATYPE_Video);          mtOut->SetType(&MEDIATYPE_Video);
506          mtOut->SetFormatType(&FORMAT_VideoInfo);          mtOut->SetFormatType(&FORMAT_VideoInfo2);
507          mtOut->SetTemporalCompression(FALSE);          mtOut->SetTemporalCompression(FALSE);
508          mtOut->SetSampleSize(vih->bmiHeader.biSizeImage);          mtOut->SetSampleSize(vih->bmiHeader.biSizeImage);
509    
# Line 699  Line 714 
714          if (PPSettings.bFilmEffect)          if (PPSettings.bFilmEffect)
715                  m_frame.general |= XVID_FILMEFFECT;                  m_frame.general |= XVID_FILMEFFECT;
716    
         if (PPSettings.bFlipVideo) {  
                 if (rgb_flip)  
717                          m_frame.output.csp &= ~XVID_CSP_VFLIP;                          m_frame.output.csp &= ~XVID_CSP_VFLIP;
718                  else          m_frame.output.csp |= rgb_flip^(PPSettings.bFlipVideo ? XVID_CSP_VFLIP : 0);
                         m_frame.output.csp |= XVID_CSP_VFLIP;  
         }  
         else {  
                 if (rgb_flip)  
                         m_frame.output.csp |= XVID_CSP_VFLIP;  
                 else  
                         m_frame.output.csp &= ~XVID_CSP_VFLIP;  
         }  
719    
720  repeat :  repeat :
721    

Legend:
Removed from v.1301  
changed lines
  Added in v.1307

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