[svn] / branches / release-1_3-branch / xvidcore / dshow / src / CXvidDecoder.cpp Repository:
ViewVC logotype

Diff of /branches/release-1_3-branch/xvidcore/dshow/src/CXvidDecoder.cpp

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

trunk/xvidcore/dshow/src/CXvidDecoder.cpp revision 1902, Fri Oct 29 16:39:07 2010 UTC branches/release-1_3-branch/xvidcore/dshow/src/CXvidDecoder.cpp revision 1925, Mon Dec 27 16:39:33 2010 UTC
# Line 20  Line 20 
20   *  along with this program ; if not, write to the Free Software   *  along with this program ; if not, write to the Free Software
21   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
22   *   *
23   * $Id: CXvidDecoder.cpp,v 1.23 2010-10-29 16:39:07 Isibaar Exp $   * $Id: CXvidDecoder.cpp,v 1.25 2010-12-22 15:21:13 Isibaar Exp $
  *  
  ****************************************************************************/  
   
 /****************************************************************************  
  *  
  * 2003/12/11 - added some additional options, mainly to make the deblocking  
  *              code from xvidcore available. Most of the new code is taken  
  *              from Nic's dshow filter, (C) Nic, http://nic.dnsalias.com  
24   *   *
25   ****************************************************************************/   ****************************************************************************/
26    
# Line 44  Line 36 
36          C:\DX90SDK\Samples\C++\DirectShow\BaseClasses\Debug          C:\DX90SDK\Samples\C++\DirectShow\BaseClasses\Debug
37  */  */
38    
39  // #define XVID_USE_MFT  #define XVID_USE_MFT
40  // #define XVID_USE_TRAYICON  #define XVID_USE_TRAYICON
41    
42  #include <windows.h>  #include <windows.h>
43    
# Line 338  Line 330 
330          xvid_gbl_init_t init;          xvid_gbl_init_t init;
331          memset(&init, 0, sizeof(init));          memset(&init, 0, sizeof(init));
332          init.version = XVID_VERSION;          init.version = XVID_VERSION;
333            init.cpu_flags = g_config.cpu;
334    
335            xvid_gbl_info_t info;
336            memset(&info, 0, sizeof(info));
337            info.version = XVID_VERSION;
338    
339          m_hdll = LoadLibrary(XVID_DLL_NAME);          m_hdll = LoadLibrary(XVID_DLL_NAME);
340          if (m_hdll == NULL) {          if (m_hdll == NULL) {
# Line 373  Line 370 
370                  return E_FAIL;                  return E_FAIL;
371          }          }
372    
373            if (xvid_global_func(0, XVID_GBL_INFO, &info, NULL) < 0)
374            {
375            xvid_global_func = NULL;
376            xvid_decore_func = NULL;
377            FreeLibrary(m_hdll);
378            m_hdll = NULL;
379                    MessageBox(0, "xvid_global() failed", "Error", MB_TOPMOST);
380                    return E_FAIL;
381            }
382    
383          memset(&m_create, 0, sizeof(m_create));          memset(&m_create, 0, sizeof(m_create));
384          m_create.version = XVID_VERSION;          m_create.version = XVID_VERSION;
385          m_create.handle = NULL;          m_create.handle = NULL;
386        /* Decoder threads */
387        if (g_config.cpu & XVID_CPU_FORCE) {
388                    m_create.num_threads = g_config.num_threads;
389            }
390            else {
391            m_create.num_threads = info.num_threads; /* Autodetect */
392                    g_config.num_threads = info.num_threads;
393            }
394    
395          memset(&m_frame, 0, sizeof(m_frame));          memset(&m_frame, 0, sizeof(m_frame));
396          m_frame.version = XVID_VERSION;          m_frame.version = XVID_VERSION;
# Line 1578  Line 1593 
1593                          hr = OnSetOutputType(pType);                          hr = OnSetOutputType(pType);
1594                  }                  }
1595          }          }
   
1596  #ifdef XVID_USE_TRAYICON  #ifdef XVID_USE_TRAYICON
1597          if (SUCCEEDED(hr) && Tray_Icon == 0) /* Create message passing window */          if (SUCCEEDED(hr) && Tray_Icon == 0) /* Create message passing window */
1598          {          {
# Line 1949  Line 1963 
1963                  if (FAILED(pSample->GetSampleDuration(&m_timelength))) {                  if (FAILED(pSample->GetSampleDuration(&m_timelength))) {
1964                          m_timelength = INVALID_TIME;                          m_timelength = INVALID_TIME;
1965                  }                  }
1966                    if (m_timestamp != INVALID_TIME && stats.type == XVID_TYPE_IVOP) {
1967                            m_rtFrame = m_timestamp;
1968                    }
1969          }          }
1970    
1971          LeaveCriticalSection(&m_mft_lock);          LeaveCriticalSection(&m_mft_lock);

Legend:
Removed from v.1902  
changed lines
  Added in v.1925

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