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.3 2004-04-01 11:11:28 suxen_drol Exp $ |
* $Id: CXvidDecoder.cpp,v 1.6 2004-04-15 19:44:05 edgomez Exp $ |
23 |
* |
* |
24 |
****************************************************************************/ |
****************************************************************************/ |
25 |
|
|
287 |
} |
} |
288 |
} |
} |
289 |
|
|
290 |
|
void CXvidDecoder::CloseLib() |
|
|
|
|
/* destructor */ |
|
|
|
|
|
CXvidDecoder::~CXvidDecoder() |
|
291 |
{ |
{ |
292 |
DPRINTF("Destructor"); |
DPRINTF("Destructor"); |
293 |
|
|
294 |
if (m_create.handle != NULL) |
if (m_create.handle != NULL) { |
|
{ |
|
295 |
xvid_decore_func(m_create.handle, XVID_DEC_DESTROY, 0, 0); |
xvid_decore_func(m_create.handle, XVID_DEC_DESTROY, 0, 0); |
296 |
m_create.handle = NULL; |
m_create.handle = NULL; |
297 |
} |
} |
298 |
|
|
299 |
if (m_hdll != NULL) |
if (m_hdll != NULL) { |
|
{ |
|
300 |
FreeLibrary(m_hdll); |
FreeLibrary(m_hdll); |
301 |
m_hdll = NULL; |
m_hdll = NULL; |
302 |
} |
} |
303 |
} |
} |
304 |
|
|
305 |
|
/* destructor */ |
306 |
|
|
307 |
|
CXvidDecoder::~CXvidDecoder() |
308 |
|
{ |
309 |
|
CloseLib(); |
310 |
|
} |
311 |
|
|
312 |
|
|
313 |
|
|
314 |
/* check input type */ |
/* check input type */ |
321 |
if (*mtIn->Type() != MEDIATYPE_Video) |
if (*mtIn->Type() != MEDIATYPE_Video) |
322 |
{ |
{ |
323 |
DPRINTF("Error: Unknown Type"); |
DPRINTF("Error: Unknown Type"); |
324 |
|
CloseLib(); |
325 |
return VFW_E_TYPE_NOT_ACCEPTED; |
return VFW_E_TYPE_NOT_ACCEPTED; |
326 |
} |
} |
327 |
|
|
347 |
else |
else |
348 |
{ |
{ |
349 |
DPRINTF("Error: Unknown FormatType"); |
DPRINTF("Error: Unknown FormatType"); |
350 |
|
CloseLib(); |
351 |
return VFW_E_TYPE_NOT_ACCEPTED; |
return VFW_E_TYPE_NOT_ACCEPTED; |
352 |
} |
} |
353 |
|
|
363 |
{ |
{ |
364 |
|
|
365 |
case FOURCC_MP4V: |
case FOURCC_MP4V: |
366 |
if (!(g_config.supported_4cc & SUPPORT_MP4V)) return VFW_E_TYPE_NOT_ACCEPTED; |
if (!(g_config.supported_4cc & SUPPORT_MP4V)) { |
367 |
|
CloseLib(); |
368 |
|
return VFW_E_TYPE_NOT_ACCEPTED; |
369 |
|
} |
370 |
break; |
break; |
371 |
case FOURCC_DIVX : |
case FOURCC_DIVX : |
372 |
if (!(g_config.supported_4cc & SUPPORT_DIVX)) return VFW_E_TYPE_NOT_ACCEPTED; |
if (!(g_config.supported_4cc & SUPPORT_DIVX)) { |
373 |
|
CloseLib(); |
374 |
|
return VFW_E_TYPE_NOT_ACCEPTED; |
375 |
|
} |
376 |
break; |
break; |
377 |
case FOURCC_DX50 : |
case FOURCC_DX50 : |
378 |
if (!(g_config.supported_4cc & SUPPORT_DX50)) return VFW_E_TYPE_NOT_ACCEPTED; |
if (!(g_config.supported_4cc & SUPPORT_DX50)) { |
379 |
|
CloseLib(); |
380 |
|
return VFW_E_TYPE_NOT_ACCEPTED; |
381 |
|
} |
382 |
case FOURCC_XVID : |
case FOURCC_XVID : |
383 |
break; |
break; |
384 |
|
|
390 |
(hdr->biCompression>>8)&0xff, |
(hdr->biCompression>>8)&0xff, |
391 |
(hdr->biCompression>>16)&0xff, |
(hdr->biCompression>>16)&0xff, |
392 |
(hdr->biCompression>>24)&0xff); |
(hdr->biCompression>>24)&0xff); |
393 |
|
CloseLib(); |
394 |
return VFW_E_TYPE_NOT_ACCEPTED; |
return VFW_E_TYPE_NOT_ACCEPTED; |
395 |
} |
} |
396 |
return S_OK; |
return S_OK; |
726 |
m_frame.general = XVID_LOWDELAY; |
m_frame.general = XVID_LOWDELAY; |
727 |
|
|
728 |
if (pIn->IsDiscontinuity() == S_OK) |
if (pIn->IsDiscontinuity() == S_OK) |
729 |
m_frame.general = XVID_DISCONTINUITY; |
m_frame.general |= XVID_DISCONTINUITY; |
730 |
|
|
731 |
if (g_config.nDeblock_Y) |
if (g_config.nDeblock_Y) |
732 |
m_frame.general |= XVID_DEBLOCKY; |
m_frame.general |= XVID_DEBLOCKY; |