Skip to content

Commit

Permalink
dshow: capabilities: Hint RGB conversion only when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
mpiatka committed Jul 9, 2024
1 parent 08fe0e0 commit bd77321
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/video_capture/DirectShowGrabber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,9 +503,14 @@ vidcap_dshow_probe_internal(device_info **available_cards, int *count,
continue;
}

codec_t ug_codec = get_ug_codec(&mediaType->subtype);
bool force_rgb = is_codec_opaque(ug_codec) || codec_is_planar(ug_codec) || ug_codec == VIDEO_CODEC_NONE;

snprintf(cards[card_count - 1].modes[mode_idx].id,
sizeof cards[card_count - 1].modes[mode_idx].id,
"{\"mode\":\"%d\"}", i);
"{\"mode\":\"%d\", "
"\"force_rgb\":\"%c\"}",
i, force_rgb ? 't' : 'f');
snprintf(cards[card_count - 1].modes[mode_idx].name,
sizeof cards[card_count - 1].modes[mode_idx].name,
"%s %ux%u @%0.2lf%s %s%s", GetSubtypeName(&mediaType->subtype),
Expand Down

0 comments on commit bd77321

Please sign in to comment.