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.2.1 2010-12-28 19:19:57 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 |
|
|
36 |
C:\DX90SDK\Samples\C++\DirectShow\BaseClasses\Debug |
C:\DX90SDK\Samples\C++\DirectShow\BaseClasses\Debug |
37 |
*/ |
*/ |
38 |
|
|
39 |
// #define XVID_USE_MFT |
/* |
40 |
// #define XVID_USE_TRAYICON |
#define XVID_USE_MFT |
41 |
|
#define XVID_USE_TRAYICON |
42 |
|
*/ |
43 |
|
|
44 |
#include <windows.h> |
#include <windows.h> |
45 |
|
|
332 |
xvid_gbl_init_t init; |
xvid_gbl_init_t init; |
333 |
memset(&init, 0, sizeof(init)); |
memset(&init, 0, sizeof(init)); |
334 |
init.version = XVID_VERSION; |
init.version = XVID_VERSION; |
335 |
|
init.cpu_flags = g_config.cpu; |
336 |
|
|
337 |
|
xvid_gbl_info_t info; |
338 |
|
memset(&info, 0, sizeof(info)); |
339 |
|
info.version = XVID_VERSION; |
340 |
|
|
341 |
m_hdll = LoadLibrary(XVID_DLL_NAME); |
m_hdll = LoadLibrary(XVID_DLL_NAME); |
342 |
if (m_hdll == NULL) { |
if (m_hdll == NULL) { |
372 |
return E_FAIL; |
return E_FAIL; |
373 |
} |
} |
374 |
|
|
375 |
|
if (xvid_global_func(0, XVID_GBL_INFO, &info, NULL) < 0) |
376 |
|
{ |
377 |
|
xvid_global_func = NULL; |
378 |
|
xvid_decore_func = NULL; |
379 |
|
FreeLibrary(m_hdll); |
380 |
|
m_hdll = NULL; |
381 |
|
MessageBox(0, "xvid_global() failed", "Error", MB_TOPMOST); |
382 |
|
return E_FAIL; |
383 |
|
} |
384 |
|
|
385 |
memset(&m_create, 0, sizeof(m_create)); |
memset(&m_create, 0, sizeof(m_create)); |
386 |
m_create.version = XVID_VERSION; |
m_create.version = XVID_VERSION; |
387 |
m_create.handle = NULL; |
m_create.handle = NULL; |
388 |
|
/* Decoder threads */ |
389 |
|
if (g_config.cpu & XVID_CPU_FORCE) { |
390 |
|
m_create.num_threads = g_config.num_threads; |
391 |
|
} |
392 |
|
else { |
393 |
|
m_create.num_threads = info.num_threads; /* Autodetect */ |
394 |
|
g_config.num_threads = info.num_threads; |
395 |
|
} |
396 |
|
|
397 |
memset(&m_frame, 0, sizeof(m_frame)); |
memset(&m_frame, 0, sizeof(m_frame)); |
398 |
m_frame.version = XVID_VERSION; |
m_frame.version = XVID_VERSION; |
1595 |
hr = OnSetOutputType(pType); |
hr = OnSetOutputType(pType); |
1596 |
} |
} |
1597 |
} |
} |
|
|
|
1598 |
#ifdef XVID_USE_TRAYICON |
#ifdef XVID_USE_TRAYICON |
1599 |
if (SUCCEEDED(hr) && Tray_Icon == 0) /* Create message passing window */ |
if (SUCCEEDED(hr) && Tray_Icon == 0) /* Create message passing window */ |
1600 |
{ |
{ |
1965 |
if (FAILED(pSample->GetSampleDuration(&m_timelength))) { |
if (FAILED(pSample->GetSampleDuration(&m_timelength))) { |
1966 |
m_timelength = INVALID_TIME; |
m_timelength = INVALID_TIME; |
1967 |
} |
} |
1968 |
|
if (m_timestamp != INVALID_TIME && stats.type == XVID_TYPE_IVOP) { |
1969 |
|
m_rtFrame = m_timestamp; |
1970 |
|
} |
1971 |
} |
} |
1972 |
|
|
1973 |
LeaveCriticalSection(&m_mft_lock); |
LeaveCriticalSection(&m_mft_lock); |