[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 1300, Sat Dec 27 14:33:13 2003 UTC revision 1301, Fri Jan 2 13:18: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.7 2003-12-27 14:33:13 Isibaar Exp $   * $Id: CXvidDecoder.cpp,v 1.1.2.8 2004-01-02 13:18:28 syskin Exp $
23   *   *
24   ****************************************************************************/   ****************************************************************************/
25    
# Line 201  Line 201 
201    
202  /* constructor */  /* constructor */
203    
204    #define XVID_DLL_NAME "xvidcore.dll"
205    
206  CXvidDecoder::CXvidDecoder(LPUNKNOWN punk, HRESULT *phr) :  CXvidDecoder::CXvidDecoder(LPUNKNOWN punk, HRESULT *phr) :
207      CVideoTransformFilter(NAME("CXvidDecoder"), punk, CLSID_XVID)      CVideoTransformFilter(NAME("CXvidDecoder"), punk, CLSID_XVID)
208  {  {
# Line 209  Line 211 
211          xvid_gbl_init_t init;          xvid_gbl_init_t init;
212          memset(&init, 0, sizeof(init));          memset(&init, 0, sizeof(init));
213          init.version = XVID_VERSION;          init.version = XVID_VERSION;
214          if (xvid_global(0, XVID_GBL_INIT, &init, NULL) < 0)  
215            m_hdll = LoadLibrary(XVID_DLL_NAME);
216            if (m_hdll == NULL) {
217                    DPRINTF("dll load failed");
218                    MessageBox(0, XVID_DLL_NAME " not found","Error", 0);
219                    return;
220            }
221    
222            xvid_global_func = (int (__cdecl *)(void *, int, void *, void *))GetProcAddress(m_hdll, "xvid_global");
223            if (xvid_global_func == NULL) {
224                    MessageBox(0, "xvid_global() not found", "Error", 0);
225                    return;
226            }
227    
228            xvid_decore_func = (int (__cdecl *)(void *, int, void *, void *))GetProcAddress(m_hdll, "xvid_decore");
229            if (xvid_decore_func == NULL) {
230                    MessageBox(0, "xvid_decore() not found", "Error", 0);
231                    return;
232            }
233    
234            if (xvid_global_func(0, XVID_GBL_INIT, &init, NULL) < 0)
235          {          {
236                  MessageBox(0, "xvid_global() failed", "Error", 0);                  MessageBox(0, "xvid_global() failed", "Error", 0);
237                  return;                  return;
# Line 285  Line 307 
307    
308          if (m_create.handle != NULL)          if (m_create.handle != NULL)
309          {          {
310                  xvid_decore(m_create.handle, XVID_DEC_DESTROY, 0, 0);                  xvid_decore_func(m_create.handle, XVID_DEC_DESTROY, 0, 0);
311                  m_create.handle = NULL;                  m_create.handle = NULL;
312          }          }
313    
314            if (m_hdll != NULL)
315            {
316                    FreeLibrary(m_hdll);
317                    m_hdll = NULL;
318            }
319  }  }
320    
321    
# Line 620  Line 648 
648    
649          if (m_create.handle == NULL)          if (m_create.handle == NULL)
650          {          {
651                  if (xvid_decore(0, XVID_DEC_CREATE, &m_create, 0) < 0)                  if (xvid_decore_func(0, XVID_DEC_CREATE, &m_create, 0) < 0)
652                  {                  {
653              DPRINTF("*** XVID_DEC_CREATE error");              DPRINTF("*** XVID_DEC_CREATE error");
654                          return S_FALSE;                          return S_FALSE;
# Line 688  Line 716 
716    
717          if (pIn->IsPreroll() != S_OK)          if (pIn->IsPreroll() != S_OK)
718          {          {
719                  length = xvid_decore(m_create.handle, XVID_DEC_DECODE, &m_frame, &stats);                  length = xvid_decore_func(m_create.handle, XVID_DEC_DECODE, &m_frame, &stats);
720    
721                  if (length < 0)                  if (length < 0)
722                  {                  {
# Line 709  Line 737 
737  /*              m_frame.general &= ~XVID_DERING; */  /*              m_frame.general &= ~XVID_DERING; */
738                  m_frame.general &= ~XVID_FILMEFFECT;                  m_frame.general &= ~XVID_FILMEFFECT;
739    
740                  length = xvid_decore(m_create.handle, XVID_DEC_DECODE, &m_frame, &stats);                  length = xvid_decore_func(m_create.handle, XVID_DEC_DECODE, &m_frame, &stats);
741                  if (length < 0)                  if (length < 0)
742                  {                  {
743              DPRINTF("*** XVID_DEC_DECODE");              DPRINTF("*** XVID_DEC_DECODE");

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

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