@@ -1896,50 +1896,57 @@ display_gl_get_property(void *state, int property, void *val, size_t *len)
1896
1896
int rgb_shift[] = {0 , 8 , 16 };
1897
1897
1898
1898
switch (property) {
1899
- case DISPLAY_PROPERTY_CODECS:
1900
- if (sizeof gl_supp_codecs <= *len) {
1901
- auto filter_codecs = [s](codec_t c) {
1902
- if (get_bits_per_component (c) > 8 && commandline_params.find (GL_DISABLE_10B_OPT_PARAM_NAME) != commandline_params.end ()) { // option to disable 10-bit processing
1903
- return false ;
1904
- }
1905
- if (glsl_programs.find (c) != glsl_programs.end () && s->PHandles .find (c) == s->PHandles .end ()) { // GLSL shader needed but compilation failed
1906
- return false ;
1907
- }
1908
- if (c == HW_VDPAU && !s->vdp_interop ) {
1909
- return false ;
1910
- }
1911
- return true ;
1912
- };
1913
- copy_if (gl_supp_codecs.begin (), gl_supp_codecs.end (), (codec_t *) val, filter_codecs);
1914
- } else {
1899
+ case DISPLAY_PROPERTY_CODECS: {
1900
+ if (sizeof gl_supp_codecs > *len) {
1901
+ return false ;
1902
+ }
1903
+ auto filter_codecs = [s](codec_t c) {
1904
+ if (get_bits_per_component (c) > DEPTH8 &&
1905
+ commandline_params.find (
1906
+ GL_DISABLE_10B_OPT_PARAM_NAME) !=
1907
+ commandline_params.end ()) { // option to disable
1908
+ // 10-bit processing
1915
1909
return false ;
1916
1910
}
1917
-
1918
- *len = sizeof gl_supp_codecs;
1919
- break ;
1920
- case DISPLAY_PROPERTY_RGB_SHIFT:
1921
- if (sizeof (rgb_shift) > *len) {
1911
+ if (glsl_programs.find (c) != glsl_programs.end () &&
1912
+ s->PHandles .find (c) ==
1913
+ s->PHandles .end ()) { // GLSL shader needed but
1914
+ // compilation failed
1922
1915
return false ;
1923
1916
}
1924
- memcpy (val, rgb_shift, sizeof (rgb_shift));
1925
- *len = sizeof (rgb_shift);
1926
- break ;
1927
- case DISPLAY_PROPERTY_BUF_PITCH:
1928
- *(int *) val = PITCH_DEFAULT;
1929
- *len = sizeof (int );
1930
- break ;
1931
- case DISPLAY_PROPERTY_SUPPORTED_IL_MODES:
1932
- if (sizeof (supported_il_modes) <= *len) {
1933
- memcpy (val, supported_il_modes, sizeof (supported_il_modes));
1934
- } else {
1917
+ if (c == HW_VDPAU && !s->vdp_interop ) {
1935
1918
return false ;
1936
1919
}
1937
- *len = sizeof (supported_il_modes);
1938
- break ;
1939
- default :
1920
+ return true ;
1921
+ };
1922
+ copy_if (gl_supp_codecs.begin (), gl_supp_codecs.end (),
1923
+ (codec_t *) val, filter_codecs);
1924
+ *len = sizeof gl_supp_codecs;
1925
+ return true ;
1926
+ }
1927
+ case DISPLAY_PROPERTY_RGB_SHIFT:
1928
+ if (sizeof (rgb_shift) > *len) {
1929
+ return false ;
1930
+ }
1931
+ memcpy (val, rgb_shift, sizeof (rgb_shift));
1932
+ *len = sizeof (rgb_shift);
1933
+ return true ;
1934
+ case DISPLAY_PROPERTY_BUF_PITCH:
1935
+ *(int *) val = PITCH_DEFAULT;
1936
+ *len = sizeof (int );
1937
+ return true ;
1938
+ case DISPLAY_PROPERTY_SUPPORTED_IL_MODES:
1939
+ if (sizeof (supported_il_modes) <= *len) {
1940
+ memcpy (val, supported_il_modes,
1941
+ sizeof (supported_il_modes));
1942
+ } else {
1940
1943
return false ;
1944
+ }
1945
+ *len = sizeof (supported_il_modes);
1946
+ return true ;
1947
+ default :
1948
+ return false ;
1941
1949
}
1942
- return true ;
1943
1950
}
1944
1951
1945
1952
static void display_gl_done (void *state)
0 commit comments