Ticket #1842: cn400-mythtv-vid-video.patch
File cn400-mythtv-vid-video.patch, 4.5 KB (added by , 18 years ago) |
---|
-
libs/libmythtv/videoout_xv.h
170 170 171 171 bool CreateXvMCBuffers(void); 172 172 bool CreateBuffers(VOSType subtype); 173 vector<void*> CreateXvMCSurfaces(uint num, bool create_xvmc_blocks);173 vector<void*> CreateXvMCSurfaces(uint num, bool surface_has_vld); 174 174 vector<unsigned char*> CreateShmImages(uint num, bool use_xv); 175 175 void CreatePauseFrame(VOSType subtype); 176 176 void CopyFrame(VideoFrame *to, const VideoFrame *from); -
libs/libmythtv/util-opengl.cpp
67 67 { 68 68 int ret, errbase, eventbase, gl_major, gl_minor; 69 69 70 // this crashes my Unichrome-based system if it is run more than once. 71 static bool has_run = false; 72 static int static_major = 0; 73 static int static_minor = 0; 74 static int static_ret = false; 75 76 if( has_run ) 77 { 78 major = static_major; 79 minor = static_minor; 80 return static_ret; 81 } 82 70 83 major = minor = 0; 84 has_run = true; 71 85 72 86 X11S(ret = glXQueryExtension(XJ_disp, &errbase, &eventbase)); 73 87 if (!ret) … … 86 100 if (!ret) 87 101 return false; 88 102 89 major = gl_major; 90 minor = gl_minor; 103 static_major = major = gl_major; 104 static_minor = minor = gl_minor; 105 static_ret = true; 91 106 92 107 return true; 93 108 } -
libs/libmythtv/videoout_xv.cpp
1785 1785 if (!xvmc_ctx) 1786 1786 return false; 1787 1787 1788 bool createBlocks = !(XVMC_VLD == (xvmc_surf_info.mc_type & XVMC_VLD)); 1789 xvmc_surfs = CreateXvMCSurfaces(xvmc_buf_attr->GetMaxSurf(), createBlocks); 1788 bool surface_has_vld = (XVMC_VLD == (xvmc_surf_info.mc_type & XVMC_VLD)); 1789 xvmc_surfs = CreateXvMCSurfaces(xvmc_buf_attr->GetMaxSurf(), 1790 surface_has_vld); 1791 1790 1792 if (xvmc_surfs.size() < xvmc_buf_attr->GetMinSurf()) 1791 1793 { 1792 1794 VERBOSE(VB_IMPORTANT, LOC_ERR + "Unable to create XvMC Surfaces"); … … 1825 1827 #endif // USING_XVMC 1826 1828 } 1827 1829 1828 vector<void*> VideoOutputXv::CreateXvMCSurfaces(uint num, bool create_xvmc_blocks)1830 vector<void*> VideoOutputXv::CreateXvMCSurfaces(uint num, bool surface_has_vld) 1829 1831 { 1830 1832 (void)num; 1831 (void) create_xvmc_blocks;1833 (void)surface_has_vld; 1832 1834 1833 1835 vector<void*> surfaces; 1834 1836 #ifdef USING_XVMC … … 1837 1839 ((video_dim.height() + 15) / 16)); 1838 1840 uint num_data_blocks = num_mv_blocks * blocks_per_macroblock; 1839 1841 1842 // need the equivalent of 5 extra surfaces for VLD decoding 1843 if( surface_has_vld ) 1844 num += 5; 1845 1840 1846 // create needed XvMC stuff 1841 1847 bool ok = true; 1842 1848 for (uint i = 0; i < num; i++) … … 1849 1855 int ret = XvMCCreateSurface(XJ_disp, xvmc_ctx, &(surf->surface)); 1850 1856 ok &= (Success == ret); 1851 1857 1852 if ( create_xvmc_blocks && ok)1858 if (ok && !surface_has_vld) 1853 1859 { 1854 1860 ret = XvMCCreateBlocks(XJ_disp, xvmc_ctx, num_data_blocks, 1855 1861 &(surf->blocks)); … … 1860 1866 } 1861 1867 } 1862 1868 1863 if ( create_xvmc_blocks && ok)1869 if (ok && !surface_has_vld) 1864 1870 { 1865 1871 ret = XvMCCreateMacroBlocks(XJ_disp, xvmc_ctx, num_mv_blocks, 1866 1872 &(surf->macro_blocks)); … … 1881 1887 } 1882 1888 surfaces.push_back(surf); 1883 1889 } 1890 1891 // for VLD decoding: the last 5 surface were allocated just to make 1892 // sure we had enough space. now, deallocate/destroy them. 1893 1894 if( surface_has_vld ) 1895 { 1896 VERBOSE(VB_PLAYBACK, LOC + QString("VLD - Allocated %1 surfaces, now destroying 5 of them.").arg(surfaces.size())); 1897 1898 for( uint i = 0; i < 5; i++ ) 1899 { 1900 xvmc_vo_surf_t *surf = (xvmc_vo_surf_t*)surfaces.back(); 1901 surfaces.pop_back(); 1902 XvMCDestroySurface(XJ_disp, &(surf->surface)); 1903 delete surf; 1904 } 1905 } 1884 1906 #endif // USING_XVMC 1885 1907 return surfaces; 1886 1908 } … … 4144 4166 SetFromEnv(vld, idct, mc, xv, shm, opengl); 4145 4167 SetFromHW(XJ_disp, mc, xv, shm, xvmc_opengl, opengl); 4146 4168 4147 vld &= mc;4148 4169 idct &= mc; 4149 4170 4150 4171 QStringList list;