Skip to content

Commit

Permalink
dshow: print mode pName instead of ug name
Browse files Browse the repository at this point in the history
NV12 will be mapped to UYVY, so instead of NV12, there will be
misleadingly written UYVY.

Actually, the FourCC stored in &pSubtype->Data could be used, because
it mostly match. Chosen approach is, however, more conservative if the
name doesn't match, because the "old-style" init with the codec name
requires the mapping back from name to subtype and there doesn't seem
to be a way to find a subtype from FourCC in genral.
  • Loading branch information
MartinPulec committed Jan 19, 2024
1 parent 604bbf9 commit 0c0a403
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/video_capture/DirectShowGrabber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1307,13 +1307,8 @@ static const CHAR * GetSubtypeName(const GUID *pSubtype)
if (LocateSubtype(pSubtype) == sizeof BitCountMap / sizeof BitCountMap[0] - 1) {
memcpy(fourcc, &pSubtype->Data1, 4);
return fourcc;
} else {
if (BitCountMap[LocateSubtype(pSubtype)].ug_codec != VIDEO_CODEC_NONE) {
return get_codec_name(BitCountMap[LocateSubtype(pSubtype)].ug_codec);
} else { // not supported by UG
return GetSubtypeNameA(pSubtype);
}
}
return GetSubtypeNameA(pSubtype);
}

extern "C" const struct video_capture_info vidcap_dshow_info = {
Expand Down

0 comments on commit 0c0a403

Please sign in to comment.