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.24 2010-12-18 10:16:46 Isibaar Exp $ |
* $Id: CXvidDecoder.cpp,v 1.25 2010-12-22 15:21:13 Isibaar Exp $ |
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 |
#define XVID_USE_MFT |
40 |
// #define XVID_USE_TRAYICON |
#define XVID_USE_TRAYICON |
41 |
|
|
42 |
#include <windows.h> |
#include <windows.h> |
43 |
|
|
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; |
xvid_gbl_info_t info; |
336 |
memset(&info, 0, sizeof(info)); |
memset(&info, 0, sizeof(info)); |
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 |
m_create.num_threads = (!g_config.num_threads) ? info.num_threads : g_config.num_threads; |
/* 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; |
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 |
{ |
{ |
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); |