Mercurial > mplayer.hg
comparison libvo/vo_gl.c @ 13206:6e8d1ac141fc
Using updated colorspace specifications from colorspaces.txt.
All by manyfmts suboption supported formats should display correctly now.
author | reimar |
---|---|
date | Mon, 30 Aug 2004 21:06:52 +0000 |
parents | f60bc2314146 |
children | f85c105bfeaa |
comparison
equal
deleted
inserted
replaced
13205:08bb01a9905a | 13206:6e8d1ac141fc |
---|---|
75 switch (format) { | 75 switch (format) { |
76 case IMGFMT_RGB24: | 76 case IMGFMT_RGB24: |
77 gl_format = GL_RGB; | 77 gl_format = GL_RGB; |
78 gl_type = GL_UNSIGNED_BYTE; | 78 gl_type = GL_UNSIGNED_BYTE; |
79 break; | 79 break; |
80 case IMGFMT_RGB32: | 80 case IMGFMT_RGBA: |
81 gl_texfmt = 4; | 81 gl_texfmt = 4; |
82 gl_format = GL_RGBA; | 82 gl_format = GL_RGBA; |
83 gl_type = GL_UNSIGNED_BYTE; | 83 gl_type = GL_UNSIGNED_BYTE; |
84 break; | 84 break; |
85 case IMGFMT_Y800: | 85 case IMGFMT_Y800: |
90 gl_type = GL_UNSIGNED_BYTE; | 90 gl_type = GL_UNSIGNED_BYTE; |
91 break; | 91 break; |
92 #ifdef GL_VERSION_1_2 | 92 #ifdef GL_VERSION_1_2 |
93 case IMGFMT_RGB8: | 93 case IMGFMT_RGB8: |
94 gl_format = GL_RGB; | 94 gl_format = GL_RGB; |
95 gl_type = GL_UNSIGNED_BYTE_3_3_2; | 95 gl_type = GL_UNSIGNED_BYTE_2_3_3_REV; |
96 break; | 96 break; |
97 case IMGFMT_RGB15: | 97 case IMGFMT_RGB15: |
98 gl_format = GL_RGBA; | 98 gl_format = GL_RGBA; |
99 gl_type = GL_UNSIGNED_SHORT_5_5_5_1; | 99 gl_type = GL_UNSIGNED_SHORT_1_5_5_5_REV; |
100 break; | 100 break; |
101 case IMGFMT_RGB16: | 101 case IMGFMT_RGB16: |
102 gl_format = GL_RGB; | 102 gl_format = GL_RGB; |
103 gl_type = GL_UNSIGNED_SHORT_5_6_5; | 103 gl_type = GL_UNSIGNED_SHORT_5_6_5_REV; |
104 break; | 104 break; |
105 case IMGFMT_BGR8: | 105 case IMGFMT_BGR8: |
106 // special case as red and blue have a differen number of bits. | 106 // special case as red and blue have a differen number of bits. |
107 // GL_BGR and GL_UNSIGNED_BYTE_3_3_2 isn't supported at least | 107 // GL_BGR and GL_UNSIGNED_BYTE_3_3_2 isn't supported at least |
108 // by nVidia drivers, and in addition would give more bits to | 108 // by nVidia drivers, and in addition would give more bits to |
109 // blue than to red, which isn't wanted | 109 // blue than to red, which isn't wanted |
110 gl_format = GL_RGB; | 110 gl_format = GL_RGB; |
111 gl_type = GL_UNSIGNED_BYTE_2_3_3_REV; | 111 gl_type = GL_UNSIGNED_BYTE_3_3_2; |
112 break; | 112 break; |
113 case IMGFMT_BGR15: | 113 case IMGFMT_BGR15: |
114 gl_format = GL_BGRA; | 114 gl_format = GL_BGRA; |
115 gl_type = GL_UNSIGNED_SHORT_5_5_5_1; | 115 gl_type = GL_UNSIGNED_SHORT_1_5_5_5_REV; |
116 break; | 116 break; |
117 case IMGFMT_BGR16: | 117 case IMGFMT_BGR16: |
118 gl_format = GL_RGB; | 118 gl_format = GL_RGB; |
119 gl_type = GL_UNSIGNED_SHORT_5_6_5_REV; | 119 gl_type = GL_UNSIGNED_SHORT_5_6_5; |
120 break; | 120 break; |
121 case IMGFMT_BGR24: | 121 case IMGFMT_BGR24: |
122 gl_format = GL_BGR; | 122 gl_format = GL_BGR; |
123 gl_type = GL_UNSIGNED_BYTE; | 123 gl_type = GL_UNSIGNED_BYTE; |
124 break; | 124 break; |
125 case IMGFMT_BGR32: | 125 case IMGFMT_BGRA: |
126 gl_texfmt = 4; | 126 gl_texfmt = 4; |
127 gl_format = GL_BGRA; | 127 gl_format = GL_BGRA; |
128 gl_type = GL_UNSIGNED_BYTE; | 128 gl_type = GL_UNSIGNED_BYTE; |
129 break; | 129 break; |
130 #endif | 130 #endif |
338 } | 338 } |
339 | 339 |
340 static uint32_t | 340 static uint32_t |
341 query_format(uint32_t format) | 341 query_format(uint32_t format) |
342 { | 342 { |
343 if ((format == IMGFMT_RGB24) || (format == IMGFMT_RGB32)) | 343 if ((format == IMGFMT_RGB24) || (format == IMGFMT_RGBA)) |
344 return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW; | 344 return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW; |
345 if (many_fmts && find_gl_format(format)) | 345 if (many_fmts && find_gl_format(format)) |
346 return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW; | 346 return VFCAP_CSP_SUPPORTED | VFCAP_CSP_SUPPORTED_BY_HW; |
347 return 0; | 347 return 0; |
348 } | 348 } |