<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="../QMatroska;../QTheora;../QVorbis"
+ AdditionalIncludeDirectories="../QMatroska;../QTheoraEx;../QVorbis"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
MinimalRebuild="true"
BasicRuntimeChecks="3"
Name="VCCLCompilerTool"
Optimization="2"
EnableIntrinsicFunctions="true"
- AdditionalIncludeDirectories="../QMatroska;../QTheora;../QVorbis"
+ AdditionalIncludeDirectories="../QMatroska;../QTheoraEx;../QVorbis"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
const QM_Track_t* vtrack = m_Reader.GetVideoTrack();
if (vtrack != 0) {
- const QM_TrackVideo_t* v = vtrack->Video;
+ const QT_Format_t* v = m_Reader.GetVideoFormat();
m_pPinVideo->SetupVideoFormat(
- v->PixelWidth,
- v->PixelHeight,
+ v,
vtrack->TrackDuration);
}
hRslt = m_pStreamer->SetupVideo(
m_pPinVideo->GetMemInputPin(),
m_pPinVideo->GetMemAllocator(),
- m_pPinVideo->GetVideoHeader());
+ m_pPinVideo->GetVideoHeader(),
+ m_Reader.GetVideoFormat());
if (FAILED(hRslt)) {
return hRslt;
}
}
void Setup(
- QIType type,
- INT32 stride,
- INT32 rasters,
- const RECT* rc)
+ QIType type,
+ INT32 stride,
+ INT32 rasters,
+ const QT_Format_t* fmt)
{
m_Type = type;
m_Stride = stride;
m_Rasters = (rasters >= 0) ? rasters : -rasters;
- m_x = rc->left;
- m_y = rc->top;
+ m_x = fmt->PX;
+ m_y = fmt->PY;
- m_cx = rc->right - rc->left;
- m_cy = rc->bottom - rc->top;
+ m_cx = fmt->PW;
+ m_cy = fmt->PH;
switch (type) {
case IT_YUY2:
VID_Count
};
- void SetVideo(INT32 id, INT32 cx, INT32 cy, INT64 rate)
+ void SetVideo(INT32 id, const QT_Format_t* fmt, INT64 rate)
{
majortype = MEDIATYPE_Video;
v.AvgTimePerFrame = rate;
+ INT32 cx = fmt->PW;
+ INT32 cy = fmt->PH;
+
INT32 g = gcd(cx, cy);
v.dwPictAspectRatioX = cx / g;
/* */
void SetupVideoFormat(
- INT32 cx,
- INT32 cy,
- INT64 rate)
+ const QT_Format_t* fmt,
+ INT64 rate)
{
SetupMediaTypes(MTYPES);
QMediaType* mt = MediaTypes();
- mt[MI_YUY2].SetVideo(QMediaType::VID_YUY2, cx, cy, rate);
- mt[MI_YV12].SetVideo(QMediaType::VID_YV12, cx, cy, rate);
+ mt[MI_YUY2].SetVideo(QMediaType::VID_YUY2, fmt, rate);
+ mt[MI_YV12].SetVideo(QMediaType::VID_YV12, fmt, rate);
}
const VIDEOINFOHEADER2* GetVideoHeader()
const BITMAPINFOHEADER* bmi = &(v->bmiHeader);
ATLTRACE("SIZE: %d, %d\n", bmi->biWidth, bmi->biHeight);
+ ATLTRACE("SRCR: %d, %d - %d, %d\n", v->rcSource.left, v->rcSource.top, v->rcSource.right, v->rcSource.bottom);
memcpy(&m_VideoHeader, v, sizeof(VIDEOINFOHEADER2));
QVorbisDecoder_t* m_adecoder;
+ QT_Format_t m_vf;
+
INT64 m_scale;
INT64 m_vrate;
m_bVideoEOS(false), m_bAudioEOS(false),
m_StartPos(0), m_EndPos(-1)
{
+ memset(&m_vf, 0, sizeof(m_vf));
}
~QReader()
return m_atrack;
}
+ const QT_Format_t* GetVideoFormat()
+ {
+ return &m_vf;
+ }
+
/* */
bool Open(LPCWSTR path)
return false;
}
+ if (!QT_GetFormatSetup(m_vsetup, &m_vf)) {
+ return false;
+ }
+
m_vdecoder = QT_CreateDecoder();
if (m_vdecoder == 0) {
return false;
HRESULT SetupVideo(
IMemInputPin* pin,
IMemAllocator* alloc,
- const VIDEOINFOHEADER2* v)
+ const VIDEOINFOHEADER2* v,
+ const QT_Format_t* fmt)
{
if (pin == 0) {
return S_OK;
const BITMAPINFOHEADER* bmi = &(v->bmiHeader);
- RECT rc = v->rcSource;
- if (rc.right == 0 && rc.bottom == 0 &&
- rc.left == 0 && rc.top == 0) {
- rc.right = bmi->biWidth;
- rc.bottom = bmi->biHeight;
-
- if (rc.bottom < 0) rc.bottom = -rc.bottom;
- }
-
if (bmi->biCompression == MAKEFOURCC('Y', 'U', 'Y', '2')) {
m_Converter.Setup(
IT_YUY2,
bmi->biWidth * 2,
bmi->biHeight,
- &rc);
+ fmt);
} else if (bmi->biCompression == MAKEFOURCC('Y', 'V', '1', '2')) {
m_Converter.Setup(
IT_YV12,
bmi->biWidth,
bmi->biHeight,
- &rc);
+ fmt);
}
return S_OK;