On Windows 10 build 10.1607.14393.10 (aka Anniversary edition) I am unable to get MJPG capture streams anymore. Used to be both MJPG and YUY2 resolutions, now I am getting only YUY2 in DirectShow (Kernel Streaming) and in Media Foundation MJPG converted media types into NV12 way before IBaseFilter source is connected to anything. Tried on multiple systems with different cameras. Any ideas what might be wrong?
640x480 @30 YUY2
...
640x480 @30 MJPG <- gone
...
DirectShow:
com_t<IAMStreamConfig> sc;
if_failed_return_result(camera_output_pin->QueryInterface(&sc));
int number_of_capabilities = 0;
int capability_size = 0;
if_failed_return(sc->GetNumberOfCapabilities(&number_of_capabilities, &capability_size), -1);
for (int i = 0; i < number_of_capabilities && k < count; i++) {
VIDEO_STREAM_CONFIG_CAPS scc;
assert(sizeof(scc) == capability_size);
AM_MEDIA_TYPE* mt = null;
if_failed_return(sc->GetStreamCaps(i, &mt, (BYTE*)&scc), -1);
...
In MMF:
640x480 @30 YUY2
...
640x480 @30 NV12 // camera reports MJPG 4cc in USBView and KsStudio
for (int i = 0; k < count; i++) {
com_t<IMFMediaType> type;
if (d->reader->GetNativeMediaType(VIDEO_STREAM, i, &type) != 0) {
break;
}
GUID guid_major_type = {0};
if_failed_return_result(type->GetMajorType(&guid_major_type));
if (guid_major_type == MFMediaType_Video) {
GUID guid_subtype = {0};
if_failed_return_result(type->GetGUID(MF_MT_SUBTYPE, &guid_subtype));
AM_MEDIA_TYPE* amMediaType = null;
if_failed_return_result(type->GetRepresentation(FORMAT_MFVideoFormat, (void**)&amMediaType));
assert(amMediaType->cbFormat == sizeof(MFVIDEOFORMAT));
const MFVIDEOFORMAT* mi = (const MFVIDEOFORMAT*)amMediaType->pbFormat;