17HRESULT qt_evr_getFourCC(IMFMediaType *type, DWORD *fourCC)
23 GUID guidSubType = GUID_NULL;
26 hr = type->GetGUID(MF_MT_SUBTYPE, &guidSubType);
29 *fourCC = guidSubType.Data1;
49 float fOffsetX = qt_evr_MFOffsetToFloat(area.OffsetX);
50 float fOffsetY = qt_evr_MFOffsetToFloat(area.OffsetY);
52 if ( ((LONG)fOffsetX + area.Area.cx > (LONG)width) ||
53 ((LONG)fOffsetY + area.Area.cy > (LONG)height) ) {
54 return MF_E_INVALIDMEDIATYPE;
61 if (!sample || !clock)
65 MFTIME hnsTimeNow = 0;
66 MFTIME hnsSystemTime = 0;
67 MFTIME hnsSampleStart = 0;
68 MFTIME hnsSampleDuration = 0;
70 hr = clock->GetCorrelatedTime(0, &hnsTimeNow, &hnsSystemTime);
73 hr = sample->GetSampleTime(&hnsSampleStart);
76 hr = sample->GetSampleDuration(&hnsSampleDuration);
79 if (hnsSampleStart + hnsSampleDuration < hnsTimeNow)
90 return QVideoFrameFormat::Format_BGRA8888;
92 return QVideoFrameFormat::Format_BGRX8888;
94 return QVideoFrameFormat::Format_Y8;
96 return QVideoFrameFormat::Format_RGBA8888;
98 return QVideoFrameFormat::Format_RGBX8888;
100 return QVideoFrameFormat::Format_UYVY;
102 return QVideoFrameFormat::Format_YUYV;
104 return QVideoFrameFormat::Format_NV12;
106 return QVideoFrameFormat::Format_YV12;
109 return QVideoFrameFormat::Format_Invalid;
116 case QVideoFrameFormat::Format_ARGB8888:
117 return D3DFMT_A8B8G8R8;
118 case QVideoFrameFormat::Format_BGRA8888:
119 return D3DFMT_A8R8G8B8;
120 case QVideoFrameFormat::Format_BGRX8888:
121 return D3DFMT_X8R8G8B8;
122 case QVideoFrameFormat::Format_Y8:
124 case QVideoFrameFormat::Format_RGBA8888:
125 return D3DFMT_A8B8G8R8;
126 case QVideoFrameFormat::Format_RGBX8888:
127 return D3DFMT_X8B8G8R8;
128 case QVideoFrameFormat::Format_UYVY:
130 case QVideoFrameFormat::Format_YUYV:
132 case QVideoFrameFormat::Format_NV12:
134 case QVideoFrameFormat::Format_YV12:
136 case QVideoFrameFormat::Format_Invalid:
138 return D3DFMT_UNKNOWN;