Ticket #5324: mythtv-vid-26.diff
File mythtv-vid-26.diff, 4.7 KB (added by , 16 years ago) |
---|
-
libs/libmythtv/openglvideo.cpp
Only in mythtv-vid-26/bindings/perl: Makefile.perl.old diff -ur -X excl mythtv-vid-25/libs/libmythtv/openglvideo.cpp mythtv-vid-26/libs/libmythtv/openglvideo.cpp
old new 44 44 inputTextureSize(0,0), currentFrameNum(0), 45 45 inputUpdated(false), 46 46 textureRects(false), textureType(GL_TEXTURE_2D), 47 helperTexture(0), default Resize(kGLFilterResize),47 helperTexture(0), defaultUpsize(kGLFilterResize), 48 48 convertSize(0,0), convertBuf(NULL), 49 49 videoResize(false), videoResizeRect(0,0,0,0), 50 50 gl_features(0), … … 122 122 gl_context->SetFeatures(gl_features); 123 123 124 124 if (options.contains("openglbicubic")) 125 default Resize = kGLFilterBicubic;125 defaultUpsize = kGLFilterBicubic; 126 126 127 if ((default Resize != kGLFilterBicubic) && (gl_features & kGLExtRect))127 if ((defaultUpsize != kGLFilterBicubic) && (gl_features & kGLExtRect)) 128 128 gl_context->GetTextureType(textureType, textureRects); 129 129 130 130 SetViewPort(display_visible_rect.size()); … … 196 196 bool mmx = false; 197 197 #endif 198 198 199 CheckResize(false); 200 199 201 VERBOSE(VB_PLAYBACK, LOC + 200 202 QString("Using packed textures with%1 mmx and with%2 PBOs") 201 203 .arg(mmx ? "" : "out").arg(use_pbo ? "" : "out")); … … 203 205 return true; 204 206 } 205 207 206 bool OpenGLVideo::OptimiseFilters(void)208 void OpenGLVideo::CheckResize(bool deinterlacing) 207 209 { 208 bool resize = ((video_dim.height() < display_video_rect.height()) || 209 (video_dim.width() < display_video_rect.width())); 210 resize &= !filters.count(kGLFilterResize); 211 resize &= !filters.count(kGLFilterBicubic); 210 // to improve performance on slower cards 211 bool resize_up = (video_dim.height() < display_video_rect.height()) || 212 (video_dim.width() < display_video_rect.width()); 213 214 // to ensure deinterlacing works correctly 215 bool resize_down = (video_dim.height() > display_video_rect.height()) && 216 deinterlacing; 217 218 if (resize_up && (defaultUpsize == kGLFilterBicubic)) 219 { 220 RemoveFilter(kGLFilterResize); 221 filters.erase(kGLFilterResize); 222 AddFilter(kGLFilterBicubic); 223 return; 224 } 225 226 if ((resize_up && (defaultUpsize == kGLFilterResize)) || resize_down) 227 { 228 RemoveFilter(kGLFilterBicubic); 229 filters.erase(kGLFilterBicubic); 230 AddFilter(kGLFilterResize); 231 return; 232 } 233 234 if (!filters.count(kGLFilterYUV2RGBA)) 235 { 236 RemoveFilter(kGLFilterResize); 237 filters.erase(kGLFilterResize); 238 } 239 240 RemoveFilter(kGLFilterBicubic); 241 filters.erase(kGLFilterBicubic); 212 242 213 if (resize)214 AddFilter(defaultResize); 243 OptimiseFilters(); 244 } 215 245 246 bool OpenGLVideo::OptimiseFilters(void) 247 { 216 248 glfilt_map_t::reverse_iterator it; 217 249 218 250 // add/remove required frame buffer objects … … 464 496 465 497 if (success) 466 498 { 499 CheckResize(hardwareDeinterlacing); 467 500 hardwareDeinterlacer = deinterlacer; 468 501 return true; 469 502 } … … 727 760 return; 728 761 729 762 hardwareDeinterlacing = deinterlacing; 763 764 OpenGLContextLocker ctx_lock(gl_context); 765 CheckResize(hardwareDeinterlacing); 730 766 } 731 767 732 768 // locking ok -
libs/libmythtv/openglvideo.h
diff -ur -X excl mythtv-vid-25/libs/libmythtv/openglvideo.h mythtv-vid-26/libs/libmythtv/openglvideo.h
old new 82 82 void SetViewPort(const QSize &new_viewport_size); 83 83 bool AddFilter(OpenGLFilterType filter); 84 84 bool RemoveFilter(OpenGLFilterType filter); 85 void CheckResize(bool deinterlacing); 85 86 bool OptimiseFilters(void); 86 87 bool AddFrameBuffer(uint &framebuffer, QSize fb_size, 87 88 uint &texture, QSize vid_size); … … 130 131 bool textureRects; 131 132 uint textureType; 132 133 uint helperTexture; 133 OpenGLFilterType default Resize;134 OpenGLFilterType defaultUpsize; 134 135 135 136 QSize convertSize; 136 137 unsigned char *convertBuf;