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.15 2005-09-15 10:52:28 suxen_drol Exp $ |
* $Id: CXvidDecoder.cpp,v 1.16 2005-10-08 00:58:02 suxen_drol Exp $ |
23 |
* |
* |
24 |
****************************************************************************/ |
****************************************************************************/ |
25 |
|
|
82 |
{ &MEDIATYPE_Video, &CLSID_DX50 }, |
{ &MEDIATYPE_Video, &CLSID_DX50 }, |
83 |
{ &MEDIATYPE_Video, &CLSID_DX50_UC }, |
{ &MEDIATYPE_Video, &CLSID_DX50_UC }, |
84 |
{ &MEDIATYPE_Video, &CLSID_MP4V }, |
{ &MEDIATYPE_Video, &CLSID_MP4V }, |
85 |
|
{ &MEDIATYPE_Video, &CLSID_MP4V_UC }, |
86 |
}; |
}; |
87 |
|
|
88 |
const AMOVIESETUP_MEDIATYPE sudOutputPinTypes[] = |
const AMOVIESETUP_MEDIATYPE sudOutputPinTypes[] = |
396 |
} |
} |
397 |
DPRINTF("VIDEOINFOHEADER2 AR: %d:%d", ar_x, ar_y); |
DPRINTF("VIDEOINFOHEADER2 AR: %d:%d", ar_x, ar_y); |
398 |
} |
} |
399 |
|
else if (*mtIn->FormatType() == FORMAT_MPEG2Video) { |
400 |
|
MPEG2VIDEOINFO * mpgvi = (MPEG2VIDEOINFO*)mtIn->Format(); |
401 |
|
VIDEOINFOHEADER2 * vih2 = &mpgvi->hdr; |
402 |
|
hdr = &vih2->bmiHeader; |
403 |
|
if (g_config.aspect_ratio == 0 || g_config.aspect_ratio == 1) { |
404 |
|
ar_x = vih2->dwPictAspectRatioX; |
405 |
|
ar_y = vih2->dwPictAspectRatioY; |
406 |
|
} |
407 |
|
DPRINTF("VIDEOINFOHEADER2 AR: %d:%d", ar_x, ar_y); |
408 |
|
|
409 |
|
/* haali media splitter reports VOL information in the format header */ |
410 |
|
|
411 |
|
if (mpgvi->cbSequenceHeader>0) { |
412 |
|
|
413 |
|
xvid_dec_stats_t stats; |
414 |
|
memset(&stats, 0, sizeof(stats)); |
415 |
|
stats.version = XVID_VERSION; |
416 |
|
|
417 |
|
if (m_create.handle == NULL) { |
418 |
|
if (xvid_decore_func == NULL) |
419 |
|
return E_FAIL; |
420 |
|
if (xvid_decore_func(0, XVID_DEC_CREATE, &m_create, 0) < 0) { |
421 |
|
DPRINTF("*** XVID_DEC_CREATE error"); |
422 |
|
return S_FALSE; |
423 |
|
} |
424 |
|
} |
425 |
|
|
426 |
|
m_frame.general = 0; |
427 |
|
m_frame.bitstream = (void*)mpgvi->dwSequenceHeader; |
428 |
|
m_frame.length = mpgvi->cbSequenceHeader; |
429 |
|
m_frame.output.csp = XVID_CSP_NULL; |
430 |
|
|
431 |
|
if (xvid_decore_func(m_create.handle, XVID_DEC_DECODE, &m_frame, &stats) >= 0) { |
432 |
|
/* honour video dimensions reported in VOL header */ |
433 |
|
if (stats.type == XVID_TYPE_VOL) { |
434 |
|
hdr->biWidth = stats.data.vol.width; |
435 |
|
hdr->biHeight = stats.data.vol.height; |
436 |
|
} |
437 |
|
} |
438 |
|
|
439 |
|
} |
440 |
|
} |
441 |
else |
else |
442 |
{ |
{ |
443 |
DPRINTF("Error: Unknown FormatType"); |
DPRINTF("Error: Unknown FormatType"); |
455 |
|
|
456 |
switch(hdr->biCompression) |
switch(hdr->biCompression) |
457 |
{ |
{ |
458 |
|
case FOURCC_mp4v: |
459 |
case FOURCC_MP4V: |
case FOURCC_MP4V: |
460 |
if (!(g_config.supported_4cc & SUPPORT_MP4V)) { |
if (!(g_config.supported_4cc & SUPPORT_MP4V)) { |
461 |
CloseLib(); |
CloseLib(); |