diff -ur -X excl mythtv-vid-22/libs/libmythtv/filtermanager.cpp mythtv-vid-23/libs/libmythtv/filtermanager.cpp
old
|
new
|
|
233 | 233 | { |
234 | 234 | QString FiltName = (*i).section('=', 0, 0); |
235 | 235 | QString FiltOpts = (*i).section('=', 1); |
| 236 | |
| 237 | if (FiltName.contains("opengl")) |
| 238 | continue; |
| 239 | |
236 | 240 | FI = GetFilterInfo(FiltName); |
237 | 241 | |
238 | 242 | if (FI) |
diff -ur -X excl mythtv-vid-22/libs/libmythtv/openglcontext.cpp mythtv-vid-23/libs/libmythtv/openglcontext.cpp
old
|
new
|
|
82 | 82 | m_display(NULL), m_screen_num(0), |
83 | 83 | m_major_ver(1), m_minor_ver(2), |
84 | 84 | m_extensions(QString::null), m_ext_supported(0), |
| 85 | m_ext_used(0), |
85 | 86 | m_max_tex_size(0), m_viewport(0,0), |
86 | 87 | m_lock(lock), m_lock_level(0), |
87 | 88 | m_colour_control(false) |
… |
… |
|
106 | 107 | Flush(true); |
107 | 108 | |
108 | 109 | if (m_priv->m_fence && |
109 | | IsFeatureSupported(kGLNVFence)) |
| 110 | (m_ext_supported & kGLNVFence)) |
110 | 111 | { |
111 | 112 | gMythGLDeleteFencesNV(1, &(m_priv->m_fence)); |
112 | 113 | } |
… |
… |
|
299 | 300 | kGLExtPBufObj : 0) | |
300 | 301 | ((has_gl_fbuffer_object_support(m_extensions)) ? kGLExtFBufObj : 0) | |
301 | 302 | ((has_gl_nvfence_support(m_extensions)) ? kGLNVFence : 0) | |
302 | | ((minor >= 3) ? kGLXPBuffer : 0); |
| 303 | ((minor >= 3) ? kGLXPBuffer : 0) | kGLFinish; |
| 304 | |
| 305 | m_ext_used = m_ext_supported; |
303 | 306 | |
304 | 307 | MakeCurrent(true); |
305 | 308 | |
306 | | if (IsFeatureSupported(kGLNVFence)) |
| 309 | if (m_ext_used & kGLNVFence) |
307 | 310 | { |
308 | 311 | gMythGLGenFencesNV(1, &(m_priv->m_fence)); |
309 | 312 | if (m_priv->m_fence) |
… |
… |
|
374 | 377 | { |
375 | 378 | MakeCurrent(true); |
376 | 379 | |
377 | | glFinish(); |
| 380 | if (m_ext_used & kGLFinish) |
| 381 | glFinish(); |
| 382 | |
378 | 383 | if (IsGLXSupported(1,3)) |
379 | 384 | X11S(glXSwapBuffers(m_display, m_priv->m_glx_window)); |
380 | 385 | else |
… |
… |
|
388 | 393 | { |
389 | 394 | MakeCurrent(true); |
390 | 395 | |
391 | | if (IsFeatureSupported(kGLNVFence) && |
| 396 | if ((m_ext_used & kGLNVFence) && |
392 | 397 | m_priv->m_fence && use_fence) |
393 | 398 | { |
394 | 399 | gMythGLSetFenceNV(m_priv->m_fence, GL_ALL_COMPLETED_NV); |
… |
… |
|
732 | 737 | bool OpenGLContext::CreateFragmentProgram(const QString &program, uint &fp) |
733 | 738 | { |
734 | 739 | bool success = true; |
| 740 | |
| 741 | if (!(m_ext_used & kGLExtFragProg)) |
| 742 | return false; |
| 743 | |
735 | 744 | GLint error; |
736 | 745 | |
737 | 746 | MakeCurrent(true); |
… |
… |
|
831 | 840 | // locking ok |
832 | 841 | bool OpenGLContext::CreateFrameBuffer(uint &fb, uint tex) |
833 | 842 | { |
| 843 | if (!(m_ext_used & kGLExtFBufObj)) |
| 844 | return false; |
| 845 | |
834 | 846 | if (!m_priv->m_textures.count(tex)) |
835 | 847 | return false; |
836 | 848 | |
… |
… |
|
1016 | 1028 | |
1017 | 1029 | uint OpenGLContext::CreatePBO(uint tex) |
1018 | 1030 | { |
| 1031 | if (!(m_ext_used & kGLExtPBufObj)) |
| 1032 | return 0; |
| 1033 | |
1019 | 1034 | if (!m_priv->m_textures.count(tex)) |
1020 | 1035 | return 0; |
1021 | 1036 | |
… |
… |
|
1139 | 1154 | |
1140 | 1155 | MakeCurrent(false); |
1141 | 1156 | } |
| 1157 | |
diff -ur -X excl mythtv-vid-22/libs/libmythtv/openglcontext.h mythtv-vid-23/libs/libmythtv/openglcontext.h
old
|
new
|
|
41 | 41 | kGLXPBuffer = 0x08, |
42 | 42 | kGLExtPBufObj = 0x10, |
43 | 43 | kGLNVFence = 0x20, |
| 44 | kGLFinish = 0x40, |
| 45 | kGLMaxFeat = 0x80, |
44 | 46 | } GLFeatures; |
45 | 47 | |
46 | 48 | class OpenGLContext; |
… |
… |
|
101 | 103 | bool CreateFrameBuffer(uint &fb, uint tex); |
102 | 104 | void DeleteFrameBuffer(uint fb); |
103 | 105 | void BindFramebuffer(uint fb); |
104 | | |
105 | | bool IsFeatureSupported(GLFeatures feature) const |
106 | | { return m_ext_supported & feature; } |
| 106 | uint GetFeatures(void) { return m_ext_supported; } |
| 107 | void SetFeatures(uint features) { m_ext_used = features; } |
107 | 108 | |
108 | 109 | static bool IsGLXSupported(Display *display, uint major, uint minor); |
109 | 110 | |
… |
… |
|
136 | 137 | uint m_minor_ver; |
137 | 138 | QString m_extensions; |
138 | 139 | uint m_ext_supported; |
| 140 | uint m_ext_used; |
139 | 141 | uint m_max_tex_size; |
140 | 142 | QSize m_viewport; |
141 | 143 | QMutex *m_lock; |
… |
… |
|
186 | 188 | void DeleteFrameBuffer(uint); |
187 | 189 | void BindFramebuffer(uint); |
188 | 190 | |
189 | | bool IsFeatureSupported(GLFeatures) const { return false; } |
| 191 | uint GetFeatures(void) { return 0; } |
| 192 | void SetFeatures(uint) { } |
190 | 193 | static bool IsGLXSupported(Display*, uint, uint) { return false; } |
191 | 194 | |
192 | 195 | int SetPictureAttribute(PictureAttribute, int) { return -1; } |
diff -ur -X excl mythtv-vid-22/libs/libmythtv/openglvideo.cpp mythtv-vid-23/libs/libmythtv/openglvideo.cpp
old
|
new
|
|
46 | 46 | textureRects(false), textureType(GL_TEXTURE_2D), |
47 | 47 | helperTexture(0), defaultResize(kGLFilterResize), |
48 | 48 | convertSize(0,0), convertBuf(NULL), |
49 | | |
50 | 49 | videoResize(false), videoResizeRect(0,0,0,0), |
| 50 | gl_features(0), |
51 | 51 | gl_letterbox_colour(kLetterBoxColour_Black) |
52 | 52 | { |
53 | 53 | } |
… |
… |
|
85 | 85 | bool OpenGLVideo::Init(OpenGLContext *glcontext, bool colour_control, |
86 | 86 | QSize videoDim, QRect displayVisibleRect, |
87 | 87 | QRect displayVideoRect, QRect videoRect, |
88 | | bool viewport_control, bool osd, |
| 88 | bool viewport_control, QString options, bool osd, |
89 | 89 | LetterBoxColour letterbox_colour) |
90 | 90 | { |
91 | 91 | gl_context = glcontext; |
… |
… |
|
115 | 115 | inputUpdated = false; |
116 | 116 | gl_letterbox_colour = letterbox_colour; |
117 | 117 | |
118 | | if (defaultResize != kGLFilterBicubic) |
| 118 | gl_features = ParseOptions(options) & |
| 119 | gl_context->GetFeatures(); |
| 120 | |
| 121 | if (viewportControl) |
| 122 | gl_context->SetFeatures(gl_features); |
| 123 | |
| 124 | if (options.contains("openglbicubic")) |
| 125 | defaultResize = kGLFilterBicubic; |
| 126 | |
| 127 | if ((defaultResize != kGLFilterBicubic) && (gl_features & kGLExtRect)) |
119 | 128 | gl_context->GetTextureType(textureType, textureRects); |
120 | 129 | |
121 | 130 | SetViewPort(display_visible_rect.size()); |
122 | 131 | |
123 | | bool use_pbo = gl_context->IsFeatureSupported(kGLExtPBufObj); |
| 132 | bool use_pbo = gl_features & kGLExtPBufObj; |
124 | 133 | |
125 | 134 | if (osd) |
126 | 135 | { |
… |
… |
|
422 | 431 | |
423 | 432 | if (ref_size > 0) |
424 | 433 | { |
425 | | bool use_pbo = gl_context->IsFeatureSupported(kGLExtPBufObj); |
| 434 | bool use_pbo = gl_features & kGLExtPBufObj; |
426 | 435 | |
427 | 436 | for (; ref_size > 0; ref_size--) |
428 | 437 | { |
… |
… |
|
469 | 478 | uint OpenGLVideo::AddFragmentProgram(OpenGLFilterType name, |
470 | 479 | QString deint, FrameScanType field) |
471 | 480 | { |
472 | | if (!gl_context->IsFeatureSupported(kGLExtFragProg)) |
| 481 | if (!(gl_features & kGLExtFragProg)) |
473 | 482 | { |
474 | 483 | VERBOSE(VB_PLAYBACK, LOC_ERR + "Fragment programs not supported"); |
475 | 484 | return 0; |
… |
… |
|
488 | 497 | bool OpenGLVideo::AddFrameBuffer(uint &framebuffer, QSize fb_size, |
489 | 498 | uint &texture, QSize vid_size) |
490 | 499 | { |
491 | | if (!gl_context->IsFeatureSupported(kGLExtFBufObj)) |
| 500 | if (!(gl_features & kGLExtFBufObj)) |
492 | 501 | { |
493 | 502 | VERBOSE(VB_PLAYBACK, LOC_ERR + "Framebuffer binding not supported."); |
494 | 503 | return false; |
… |
… |
|
800 | 809 | } |
801 | 810 | |
802 | 811 | // vertex coordinates |
803 | | QRect display = (filter->frameBuffers.empty() || |
804 | | filter->outputBuffer == kDefaultBuffer) ? |
805 | | display_video_rect : frameBufferRect; |
806 | | QRect visible = (filter->frameBuffers.empty() || |
| 812 | QRect display = (filter->frameBuffers.empty() || |
807 | 813 | filter->outputBuffer == kDefaultBuffer) ? |
808 | | display_visible_rect : frameBufferRect; |
| 814 | display_video_rect : frameBufferRect; |
809 | 815 | |
810 | 816 | float vleft = display.left(); |
811 | 817 | float vright = display.right(); |
… |
… |
|
1570 | 1576 | |
1571 | 1577 | return ret; |
1572 | 1578 | } |
| 1579 | |
| 1580 | uint OpenGLVideo::ParseOptions(QString options) |
| 1581 | { |
| 1582 | uint ret = kGLMaxFeat - 1; |
| 1583 | |
| 1584 | QStringList list = QStringList::split(",", options); |
| 1585 | |
| 1586 | if (list.empty()) |
| 1587 | return ret; |
| 1588 | |
| 1589 | for (QStringList::Iterator i = list.begin(); |
| 1590 | i != list.end(); ++i) |
| 1591 | { |
| 1592 | QString name = (*i).section('=', 0, 0); |
| 1593 | QString opts = (*i).section('=', 1); |
| 1594 | |
| 1595 | if (name == "opengloptions") |
| 1596 | { |
| 1597 | if (opts.contains("nofinish")) |
| 1598 | ret -= kGLFinish; |
| 1599 | if (opts.contains("nofence")) |
| 1600 | ret -= kGLNVFence; |
| 1601 | if (opts.contains("nopbo")) |
| 1602 | ret -= kGLExtPBufObj; |
| 1603 | if (opts.contains("nopbuf")) |
| 1604 | ret -= kGLXPBuffer; |
| 1605 | if (opts.contains("nofbo")) |
| 1606 | ret -= kGLExtFBufObj; |
| 1607 | if (opts.contains("nofrag")) |
| 1608 | ret -= kGLExtFragProg; |
| 1609 | if (opts.contains("norect")) |
| 1610 | ret -= kGLExtRect; |
| 1611 | return ret; |
| 1612 | } |
| 1613 | } |
| 1614 | |
| 1615 | return ret; |
| 1616 | } |
| 1617 | |
diff -ur -X excl mythtv-vid-22/libs/libmythtv/openglvideo.h mythtv-vid-23/libs/libmythtv/openglvideo.h
old
|
new
|
|
46 | 46 | bool Init(OpenGLContext *glcontext, bool colour_control, |
47 | 47 | QSize videoDim, QRect displayVisibleRect, |
48 | 48 | QRect displayVideoRect, QRect videoRect, |
49 | | bool viewport_control, bool osd = FALSE, |
| 49 | bool viewport_control, QString options, bool osd = FALSE, |
50 | 50 | LetterBoxColour letterbox_colour = kLetterBoxColour_Black); |
51 | 51 | |
52 | 52 | void UpdateInputFrame(const VideoFrame *frame, bool soft_bob = FALSE); |
… |
… |
|
105 | 105 | void SetTextureFilters(vector<uint> *textures, int filt, int clamp); |
106 | 106 | void DeleteTextures(vector<uint> *textures); |
107 | 107 | void TearDownDeinterlacer(void); |
| 108 | uint ParseOptions(QString options); |
108 | 109 | |
109 | 110 | OpenGLContext *gl_context; |
110 | 111 | QSize video_dim; |
… |
… |
|
131 | 132 | uint helperTexture; |
132 | 133 | OpenGLFilterType defaultResize; |
133 | 134 | |
134 | | QSize convertSize; |
135 | | unsigned char *convertBuf; |
136 | | |
137 | | bool videoResize; |
138 | | QRect videoResizeRect; |
| 135 | QSize convertSize; |
| 136 | unsigned char *convertBuf; |
139 | 137 | |
| 138 | bool videoResize; |
| 139 | QRect videoResizeRect; |
| 140 | |
| 141 | uint gl_features; |
140 | 142 | LetterBoxColour gl_letterbox_colour; |
141 | 143 | }; |
142 | 144 | |
… |
… |
|
149 | 151 | ~OpenGLVideo() { } |
150 | 152 | |
151 | 153 | bool Init(OpenGLContext*, bool, QSize, QRect, |
152 | | QRect, QRect, bool, bool osd = false, |
| 154 | QRect, QRect, bool, QString, bool osd = false, |
153 | 155 | LetterBoxColour letterbox = kLetterBoxColour_Black) |
154 | 156 | { (void) osd; return false; } |
155 | 157 | |
diff -ur -X excl mythtv-vid-22/libs/libmythtv/videoout_xv.cpp mythtv-vid-23/libs/libmythtv/videoout_xv.cpp
old
|
new
|
|
1010 | 1010 | ok = gl_videochain->Init(gl_context, db_use_picture_controls, |
1011 | 1011 | video_dim, GetTotalVisibleRect(), |
1012 | 1012 | display_visible_rect, |
1013 | | video_rect, true, |
| 1013 | video_rect, true, GetFilters(), |
1014 | 1014 | false, db_letterbox_colour); |
1015 | 1015 | } |
1016 | 1016 | |
… |
… |
|
1470 | 1470 | gl_context, db_use_picture_controls, |
1471 | 1471 | GetTotalOSDBounds().size(), |
1472 | 1472 | GetTotalOSDBounds(), GetTotalVisibleRect(), |
1473 | | QRect(QPoint(0, 0), GetTotalOSDBounds().size()), false, true)) |
| 1473 | QRect(QPoint(0, 0), GetTotalOSDBounds().size()), |
| 1474 | false, GetFilters(), true)) |
1474 | 1475 | { |
1475 | 1476 | VERBOSE(VB_PLAYBACK, LOC_ERR + |
1476 | 1477 | "InitOSD(): Failed to create OpenGL2 OSD"); |
… |
… |
|
3206 | 3207 | bool success = gl_pipchain->Init(gl_context, db_use_picture_controls, |
3207 | 3208 | QSize(pipVideoWidth, pipVideoHeight), |
3208 | 3209 | dvr, position, |
3209 | | QRect(0, 0, pipVideoWidth, pipVideoHeight), false); |
| 3210 | QRect(0, 0, pipVideoWidth, pipVideoHeight), |
| 3211 | false, GetFilters()); |
3210 | 3212 | gl_pipchain->SetMasterViewport(gl_videochain->GetViewPort()); |
3211 | 3213 | if (!success) |
3212 | 3214 | { |
… |
… |
|
3226 | 3228 | gl_context, db_use_picture_controls, |
3227 | 3229 | QSize(pipVideoWidth, pipVideoHeight), |
3228 | 3230 | dvr, position, |
3229 | | QRect(0, 0, pipVideoWidth, pipVideoHeight), false); |
| 3231 | QRect(0, 0, pipVideoWidth, pipVideoHeight), |
| 3232 | false, GetFilters()); |
3230 | 3233 | |
3231 | 3234 | gl_pipchain->SetMasterViewport(gl_videochain->GetViewPort()); |
3232 | 3235 | if (!success) |