Ticket #4270: 4270-mythtv-v1.patch
File 4270-mythtv-v1.patch, 110.8 KB (added by , 16 years ago) |
---|
-
libs/libmythtv/NuppelVideoPlayer.cpp
13 13 #include <fcntl.h> 14 14 #include <sched.h> 15 15 #include <sys/time.h> 16 #include <sys/ioctl.h>17 16 18 17 // C++ headers 19 18 #include <algorithm> … … 6609 6608 6610 6609 OSDTypeImage* image = new OSDTypeImage(); 6611 6610 image->SetPosition(QPoint(rect->x, rect->y), hmult, vmult); 6612 image->Load FromQImage(qImage);6611 image->Load(qImage); 6613 6612 6614 6613 subtitleOSD->AddType(image); 6615 6614 … … 6924 6923 6925 6924 OSDTypeImage* image = new OSDTypeImage(); 6926 6925 image->SetPosition(QPoint(btnX, btnY), hmult, vmult); 6927 image->Load FromQImage(hl_button);6926 image->Load(hl_button); 6928 6927 image->SetDontRoundPosition(true); 6929 6928 6930 6929 subtitleOSD->AddType(image); -
libs/libmythtv/osdlistbtntype.cpp
709 709 QImage img(data, width, height, 32, NULL, 65536 * 65536, 710 710 QImage::LittleEndian); 711 711 img.setAlphaBuffer(alpha<255); 712 osdImg.Load FromQImage(img);712 osdImg.Load(img); 713 713 } 714 714 delete[] data; 715 715 } … … 717 717 void OSDListBtnType::LoadPixmap(OSDTypeImage& pix, const QString& fileName) 718 718 { 719 719 QString path = gContext->GetThemesParentDir() + "default/lb-"; 720 pix.Load Image(path + fileName + ".png", m_wmult, m_hmult);720 pix.Load(path + fileName + ".png", m_wmult, m_hmult); 721 721 } 722 722 723 723 ///////////////////////////////////////////////////////////////////////////// -
libs/libmythtv/videoout_d3d.cpp
1 // -*- Mode: c++ -*- 2 3 #include <map> 4 #include <iostream> 5 #include <algorithm> 6 using namespace std; 7 8 #define _WIN32_WINNT 0x500 9 #include "mythcontext.h" 10 #include "videoout_d3d.h" 11 #include "filtermanager.h" 12 #include "fourcc.h" 13 14 #include "mmsystem.h" 15 #include "tv.h" 16 17 #include <qapplication.h> 18 19 #undef UNICODE 20 21 extern "C" { 22 #include "../libavcodec/avcodec.h" 23 } 24 25 typedef struct 26 { 27 FLOAT x; // vertex untransformed x position 28 FLOAT y; // vertex untransformed y position 29 FLOAT z; // vertex untransformed z position 30 FLOAT rhw; // eye distance 31 D3DCOLOR diffuse; // diffuse color 32 FLOAT tu; // texture u coordinate 33 FLOAT tv; // texture v coordinate 34 } CUSTOMVERTEX; 35 36 #define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZRHW|D3DFVF_DIFFUSE|D3DFVF_TEX1) 37 38 const int kNumBuffers = 31; 39 const int kNeedFreeFrames = 1; 40 const int kPrebufferFramesNormal = 10; 41 const int kPrebufferFramesSmall = 4; 42 const int kKeepPrebuffer = 2; 43 44 #define LOC QString("VideoOutputD3D: ") 45 #define LOC_WARN QString("VideoOutputD3D Warning: ") 46 #define LOC_ERR QString("VideoOutputD3D Error: ") 47 48 VideoOutputD3D::VideoOutputD3D(void) 49 : VideoOutput(), m_InputCX(0), m_InputCY(0), 50 m_lock(true), m_RefreshRate(60), m_hWnd(NULL), 51 m_ddFormat(D3DFMT_UNKNOWN), m_pD3D(NULL), m_pd3dDevice(NULL), 52 m_pSurface(NULL), m_pTexture(NULL), m_pVertexBuffer(NULL) 53 { 54 VERBOSE(VB_PLAYBACK, LOC + "ctor"); 55 m_pauseFrame.buf = NULL; 56 } 57 58 VideoOutputD3D::~VideoOutputD3D() 59 { 60 Exit(); 61 } 62 63 void VideoOutputD3D::Exit(void) 64 { 65 VERBOSE(VB_PLAYBACK, LOC + "Exit()"); 66 QMutexLocker locker(&m_lock); 67 vbuffers.DeleteBuffers(); 68 if (m_pauseFrame.buf) 69 { 70 delete [] m_pauseFrame.buf; 71 m_pauseFrame.buf = NULL; 72 } 73 UnInitD3D(); 74 } 75 76 void VideoOutputD3D::UnInitD3D(void) 77 { 78 QMutexLocker locker(&m_lock); 79 80 if (m_pVertexBuffer) 81 { 82 m_pVertexBuffer->Release(); 83 m_pVertexBuffer = NULL; 84 } 85 86 if (m_pTexture) 87 { 88 m_pTexture->Release(); 89 m_pTexture = NULL; 90 } 91 92 if (m_pSurface) 93 { 94 m_pSurface->Release(); 95 m_pSurface = NULL; 96 } 97 98 if (m_pd3dDevice) 99 { 100 m_pd3dDevice->Release(); 101 m_pd3dDevice = NULL; 102 } 103 104 if (m_pD3D) 105 { 106 m_pD3D->Release(); 107 m_pD3D = NULL; 108 } 109 } 110 111 bool VideoOutputD3D::InputChanged(const QSize &input_size, 112 float aspect, 113 MythCodecID av_codec_id, 114 void *codec_private) 115 { 116 QMutexLocker locker(&m_lock); 117 VideoOutput::InputChanged(input_size, aspect, av_codec_id, codec_private); 118 db_vdisp_profile->SetVideoRenderer("didect3d"); 119 120 if (input_size.width() == m_InputCX && 121 input_size.height() == m_InputCY) 122 { 123 MoveResize(); 124 return true; 125 } 126 127 m_InputCX = input_size.width(); 128 m_InputCY = input_size.height(); 129 VERBOSE(VB_PLAYBACK, LOC + "InputChanged, x="<< m_InputCX 130 << ", y=" << m_InputCY); 131 132 video_dim = input_size; 133 vbuffers.DeleteBuffers(); 134 135 MoveResize(); 136 137 if (!vbuffers.CreateBuffers(m_InputCX, m_InputCY)) 138 { 139 VERBOSE(VB_IMPORTANT, LOC + "InputChanged(): " 140 "Failed to recreate buffers"); 141 errored = true; 142 } 143 144 if (!InitD3D()) 145 UnInitD3D(); 146 147 if (m_pauseFrame.buf) 148 { 149 delete [] m_pauseFrame.buf; 150 m_pauseFrame.buf = NULL; 151 } 152 153 m_pauseFrame.height = vbuffers.GetScratchFrame()->height; 154 m_pauseFrame.width = vbuffers.GetScratchFrame()->width; 155 m_pauseFrame.bpp = vbuffers.GetScratchFrame()->bpp; 156 m_pauseFrame.size = vbuffers.GetScratchFrame()->size; 157 m_pauseFrame.buf = new unsigned char[m_pauseFrame.size + 128]; 158 m_pauseFrame.frameNumber = vbuffers.GetScratchFrame()->frameNumber; 159 160 return true; 161 } 162 163 bool VideoOutputD3D::InitD3D() 164 { 165 VERBOSE(VB_PLAYBACK, LOC + QString("InitD3D start (x=%1, y=%2)") 166 .arg(m_InputCX).arg(m_InputCY)); 167 168 QMutexLocker locker(&m_lock); 169 D3DCAPS9 d3dCaps; 170 171 typedef LPDIRECT3D9 (WINAPI *LPFND3DC)(UINT SDKVersion); 172 static LPFND3DC OurDirect3DCreate9 = NULL; 173 static HINSTANCE hD3DLib = NULL; 174 175 if (!hD3DLib) 176 { 177 hD3DLib = LoadLibrary(TEXT("D3D9.DLL")); 178 if (!hD3DLib) 179 { 180 VERBOSE(VB_IMPORTANT, LOC_ERR + "Cannot load d3d9.dll (Direct3D)"); 181 return false; 182 } 183 } 184 185 if (!OurDirect3DCreate9) 186 { 187 OurDirect3DCreate9 = (LPFND3DC) GetProcAddress( 188 hD3DLib, TEXT("Direct3DCreate9")); 189 190 if (!OurDirect3DCreate9) 191 { 192 VERBOSE(VB_IMPORTANT, LOC_ERR + "Cannot locate reference to " 193 "Direct3DCreate9 ABI in DLL"); 194 195 return false; 196 } 197 } 198 199 /* Create the D3D object. */ 200 m_pD3D = OurDirect3DCreate9(D3D_SDK_VERSION); 201 if (!m_pD3D) 202 { 203 VERBOSE(VB_IMPORTANT, LOC_ERR + 204 "Could not create Direct3D9 instance."); 205 206 return false; 207 } 208 209 // Get device capabilities 210 ZeroMemory(&d3dCaps, sizeof(d3dCaps)); 211 212 if (D3D_OK != m_pD3D->GetDeviceCaps( 213 D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &d3dCaps)) 214 { 215 VERBOSE(VB_IMPORTANT, LOC_ERR + 216 "Could not read adapter capabilities."); 217 218 return false; 219 } 220 221 D3DDISPLAYMODE d3ddm; 222 // Get the current desktop display mode, so we can set up a back 223 // buffer of the same format 224 if (D3D_OK != m_pD3D->GetAdapterDisplayMode(D3DADAPTER_DEFAULT, &d3ddm)) 225 { 226 VERBOSE(VB_IMPORTANT, LOC_ERR + 227 "Could not read adapter display mode."); 228 229 return false; 230 } 231 m_RefreshRate = d3ddm.RefreshRate; 232 233 m_ddFormat = d3ddm.Format; 234 D3DPRESENT_PARAMETERS d3dpp; 235 236 /* Set up the structure used to create the D3DDevice. */ 237 ZeroMemory(&d3dpp, sizeof(D3DPRESENT_PARAMETERS)); 238 d3dpp.Flags = D3DPRESENTFLAG_VIDEO; 239 d3dpp.Windowed = TRUE; 240 d3dpp.hDeviceWindow = m_hWnd; 241 d3dpp.BackBufferWidth = m_InputCX; 242 d3dpp.BackBufferHeight = m_InputCY; 243 d3dpp.SwapEffect = D3DSWAPEFFECT_COPY; 244 d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE; 245 d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_ONE; 246 d3dpp.BackBufferFormat = d3ddm.Format; 247 d3dpp.BackBufferCount = 1; 248 d3dpp.EnableAutoDepthStencil = FALSE; 249 250 // Create the D3DDevice 251 if (D3D_OK != m_pD3D->CreateDevice(D3DADAPTER_DEFAULT, 252 D3DDEVTYPE_HAL, m_hWnd, 253 D3DCREATE_SOFTWARE_VERTEXPROCESSING, 254 &d3dpp, &m_pd3dDevice)) 255 { 256 VERBOSE(VB_IMPORTANT, LOC_ERR + "Could not create the D3D device!"); 257 return false; 258 } 259 260 //input seems to always be PIX_FMT_YUV420P 261 //MAKEFOURCC('I','4','2','0'); 262 //D3DFMT_G8R8_G8B8??? 263 264 D3DFORMAT format = D3DFMT_X8R8G8B8; 265 /* test whether device can create a surface of that format */ 266 HRESULT hr = m_pD3D->CheckDeviceFormat( 267 D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, m_ddFormat, 0, 268 D3DRTYPE_SURFACE, format); 269 270 if (SUCCEEDED(hr)) 271 { 272 /* test whether device can perform color-conversion 273 ** from that format to target format 274 */ 275 hr = m_pD3D->CheckDeviceFormatConversion( 276 D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, 277 format, m_ddFormat); 278 279 if (FAILED(hr)) 280 { 281 VERBOSE(VB_IMPORTANT, LOC_ERR + 282 "CheckDeviceFormatConversion failed"); 283 284 return false; 285 } 286 } 287 else 288 { 289 VERBOSE(VB_IMPORTANT, LOC_ERR + "CheckDeviceFormat failed"); 290 return false; 291 } 292 293 hr = m_pd3dDevice->CreateOffscreenPlainSurface( 294 m_InputCX, 295 m_InputCY, 296 format, 297 D3DPOOL_DEFAULT, 298 &m_pSurface, 299 NULL); 300 301 if (FAILED(hr)) 302 { 303 VERBOSE(VB_IMPORTANT, LOC_ERR + "Failed to create picture surface"); 304 return false; 305 } 306 307 /* fill surface with black color */ 308 m_pd3dDevice->ColorFill(m_pSurface, NULL, D3DCOLOR_ARGB(0xFF, 0, 0, 0) ); 309 310 /* 311 ** Create a texture for use when rendering a scene 312 ** for performance reason, texture format is identical to backbuffer 313 ** which would usually be a RGB format 314 */ 315 hr = m_pd3dDevice->CreateTexture( 316 m_InputCX, 317 m_InputCY, 318 1, 319 D3DUSAGE_RENDERTARGET, 320 m_ddFormat, 321 D3DPOOL_DEFAULT, 322 &m_pTexture, 323 NULL); 324 325 if (FAILED(hr)) 326 { 327 VERBOSE(VB_IMPORTANT, LOC_ERR + "Failed to create texture"); 328 return false; 329 } 330 331 /* 332 ** Create a vertex buffer for use when rendering scene 333 */ 334 hr = m_pd3dDevice->CreateVertexBuffer( 335 sizeof(CUSTOMVERTEX)*4, 336 D3DUSAGE_DYNAMIC|D3DUSAGE_WRITEONLY, 337 D3DFVF_CUSTOMVERTEX, 338 D3DPOOL_DEFAULT, 339 &m_pVertexBuffer, 340 NULL); 341 if (FAILED(hr)) 342 { 343 VERBOSE(VB_IMPORTANT, LOC_ERR + "Failed to create vertex buffer"); 344 return false; 345 } 346 347 /* Update the vertex buffer */ 348 CUSTOMVERTEX *p_vertices; 349 hr = m_pVertexBuffer->Lock(0, 0, (VOID **)(&p_vertices), D3DLOCK_DISCARD); 350 351 if (FAILED(hr)) 352 { 353 VERBOSE(VB_IMPORTANT, LOC_ERR + "Failed to lock vertex buffer"); 354 return false; 355 } 356 357 /* Setup vertices */ 358 p_vertices[0].x = 0.0f; // left 359 p_vertices[0].y = 0.0f; // top 360 p_vertices[0].z = 0.0f; 361 p_vertices[0].diffuse = D3DCOLOR_ARGB(255, 255, 255, 255); 362 p_vertices[0].rhw = 1.0f; 363 p_vertices[0].tu = 0.0f; 364 p_vertices[0].tv = 0.0f; 365 366 p_vertices[1].x = (float)m_InputCX; // right 367 p_vertices[1].y = 0.0f; // top 368 p_vertices[1].z = 0.0f; 369 p_vertices[1].diffuse = D3DCOLOR_ARGB(255, 255, 255, 255); 370 p_vertices[1].rhw = 1.0f; 371 p_vertices[1].tu = 1.0f; 372 p_vertices[1].tv = 0.0f; 373 374 p_vertices[2].x = (float)m_InputCX; // right 375 p_vertices[2].y = (float)m_InputCY; // bottom 376 p_vertices[2].z = 0.0f; 377 p_vertices[2].diffuse = D3DCOLOR_ARGB(255, 255, 255, 255); 378 p_vertices[2].rhw = 1.0f; 379 p_vertices[2].tu = 1.0f; 380 p_vertices[2].tv = 1.0f; 381 382 p_vertices[3].x = 0.0f; // left 383 p_vertices[3].y = (float)m_InputCY; // bottom 384 p_vertices[3].z = 0.0f; 385 p_vertices[3].diffuse = D3DCOLOR_ARGB(255, 255, 255, 255); 386 p_vertices[3].rhw = 1.0f; 387 p_vertices[3].tu = 0.0f; 388 p_vertices[3].tv = 1.0f; 389 390 hr = m_pVertexBuffer->Unlock(); 391 if (FAILED(hr)) 392 { 393 VERBOSE(VB_IMPORTANT, LOC_ERR + "Failed to unlock vertex buffer"); 394 return false; 395 } 396 397 // Texture coordinates outside the range [0.0, 1.0] are set 398 // to the texture color at 0.0 or 1.0, respectively. 399 m_pd3dDevice->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP); 400 m_pd3dDevice->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP); 401 402 // Set linear filtering quality 403 m_pd3dDevice->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR); 404 m_pd3dDevice->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); 405 406 // set maximum ambient light 407 m_pd3dDevice->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_XRGB(255,255,255)); 408 409 // Turn off culling 410 m_pd3dDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE); 411 412 // Turn off the zbuffer 413 m_pd3dDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE); 414 415 // Turn off lights 416 m_pd3dDevice->SetRenderState(D3DRS_LIGHTING, FALSE); 417 418 // Enable dithering 419 m_pd3dDevice->SetRenderState(D3DRS_DITHERENABLE, TRUE); 420 421 // disable stencil 422 m_pd3dDevice->SetRenderState(D3DRS_STENCILENABLE, FALSE); 423 424 // manage blending 425 m_pd3dDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); 426 m_pd3dDevice->SetRenderState(D3DRS_SRCBLEND,D3DBLEND_SRCALPHA); 427 m_pd3dDevice->SetRenderState(D3DRS_DESTBLEND,D3DBLEND_INVSRCALPHA); 428 m_pd3dDevice->SetRenderState(D3DRS_ALPHATESTENABLE,TRUE); 429 m_pd3dDevice->SetRenderState(D3DRS_ALPHAREF, 0x10); 430 m_pd3dDevice->SetRenderState(D3DRS_ALPHAFUNC,D3DCMP_GREATER); 431 432 // Set texture states 433 m_pd3dDevice->SetTextureStageState(0, D3DTSS_COLOROP,D3DTOP_MODULATE); 434 m_pd3dDevice->SetTextureStageState(0, D3DTSS_COLORARG1,D3DTA_TEXTURE); 435 m_pd3dDevice->SetTextureStageState(0, D3DTSS_COLORARG2,D3DTA_DIFFUSE); 436 437 // turn off alpha operation 438 m_pd3dDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_DISABLE); 439 440 VERBOSE(VB_GENERAL, LOC + 441 "Direct3D device adapter successfully initialized"); 442 443 return true; 444 } 445 446 int VideoOutputD3D::GetRefreshRate(void) 447 { 448 return 1000000 / m_RefreshRate; 449 } 450 451 bool VideoOutputD3D::Init(int width, int height, float aspect, 452 WId winid, int winx, int winy, int winw, 453 int winh, WId embedid) 454 { 455 VERBOSE(VB_PLAYBACK, LOC_ERR + 456 "Init w=" << width << " h=" << height); 457 458 db_vdisp_profile->SetVideoRenderer("direct3d"); 459 460 vbuffers.Init(kNumBuffers, true, kNeedFreeFrames, 461 kPrebufferFramesNormal, kPrebufferFramesSmall, 462 kKeepPrebuffer); 463 464 VideoOutput::Init(width, height, aspect, winid, 465 winx, winy, winw, winh, embedid); 466 467 m_hWnd = winid; 468 469 m_InputCX = width; 470 m_InputCY = height; 471 472 if (!vbuffers.CreateBuffers(width, height)) 473 return false; 474 475 if (!InitD3D()) 476 { 477 UnInitD3D(); 478 return false; 479 } 480 481 m_pauseFrame.height = vbuffers.GetScratchFrame()->height; 482 m_pauseFrame.width = vbuffers.GetScratchFrame()->width; 483 m_pauseFrame.bpp = vbuffers.GetScratchFrame()->bpp; 484 m_pauseFrame.size = vbuffers.GetScratchFrame()->size; 485 m_pauseFrame.buf = new unsigned char[m_pauseFrame.size + 128]; 486 m_pauseFrame.frameNumber = vbuffers.GetScratchFrame()->frameNumber; 487 488 MoveResize(); 489 490 return true; 491 } 492 493 void VideoOutputD3D::PrepareFrame(VideoFrame *buffer, FrameScanType t) 494 { 495 if (IsErrored()) 496 { 497 VERBOSE(VB_IMPORTANT, LOC_ERR + 498 "PrepareFrame() called while IsErrored is true."); 499 return; 500 } 501 502 if (!buffer) 503 buffer = vbuffers.GetScratchFrame(); 504 505 framesPlayed = buffer->frameNumber + 1; 506 AVPicture image_in, image_out; 507 508 D3DLOCKED_RECT d3drect; 509 /* Lock the surface to get a valid pointer to the picture buffer */ 510 HRESULT hr = m_pSurface->LockRect(&d3drect, NULL, 0); 511 if (FAILED(hr)) 512 { 513 VERBOSE(VB_IMPORTANT, LOC_ERR + "Failed to lock picture surface"); 514 return; 515 } 516 517 avpicture_fill(&image_out, (uint8_t*) d3drect.pBits, 518 PIX_FMT_RGBA32, m_InputCX, m_InputCY); 519 image_out.linesize[0] = d3drect.Pitch; 520 avpicture_fill(&image_in, buffer->buf, 521 PIX_FMT_YUV420P, m_InputCX, m_InputCY); 522 img_convert(&image_out, PIX_FMT_RGBA32, &image_in, 523 PIX_FMT_YUV420P, m_InputCX, m_InputCY); 524 525 #if 0 526 static int c = 0; 527 for (int y = 0; y < m_InputCY; y++) 528 { 529 for (int x = 0; x < m_InputCX; x++) 530 { 531 ((int*)d3drect.pBits)[y * d3drect.Pitch / 4 + x] = 532 ((x + c) & 0xff) << 8; 533 } 534 } 535 c += 5; 536 #endif 537 538 hr = m_pSurface->UnlockRect(); 539 if (FAILED(hr)) 540 { 541 VERBOSE(VB_IMPORTANT, LOC_ERR + "Failed to unlock picture surface"); 542 return; 543 } 544 } 545 546 void VideoOutputD3D::Show(FrameScanType ) 547 { 548 if (IsErrored()) 549 { 550 VERBOSE(VB_IMPORTANT, LOC_ERR + 551 "Show() called while IsErrored is true."); 552 553 return; 554 } 555 556 if (m_pd3dDevice) 557 { 558 LPDIRECT3DSURFACE9 p_d3ddest; 559 HRESULT hr; 560 561 // check if device is still available 562 hr = m_pd3dDevice->TestCooperativeLevel(); 563 if (FAILED(hr)) 564 { 565 if (D3DERR_DEVICENOTRESET != hr) 566 { 567 // device is not usable at present 568 // (lost device, out of video mem ?) 569 goto RenderError; 570 } 571 } 572 573 /* Clear the backbuffer and the zbuffer */ 574 hr = m_pd3dDevice->Clear(0, NULL, D3DCLEAR_TARGET, 575 D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0); 576 if (FAILED(hr)) 577 goto RenderError; 578 579 /* retrieve texture top-level surface */ 580 hr = m_pTexture->GetSurfaceLevel(0, &p_d3ddest); 581 if (FAILED(hr)) 582 goto RenderError; 583 584 /* Copy picture surface into texture surface, 585 color space conversion happens here */ 586 hr = m_pd3dDevice->StretchRect(m_pSurface, NULL, p_d3ddest, 587 NULL, D3DTEXF_NONE); 588 p_d3ddest->Release(); 589 if (FAILED(hr)) 590 goto RenderError; 591 592 // Begin the scene 593 hr = m_pd3dDevice->BeginScene(); 594 if (FAILED(hr)) 595 goto RenderError; 596 597 // Setup our texture. Using textures introduces the texture 598 // stage states, which govern how textures get blended together 599 // (in the case of multiple textures) and lighting information. 600 // In this case, we are modulating (blending) our texture with 601 // the diffuse color of the vertices. 602 hr = m_pd3dDevice->SetTexture(0, (LPDIRECT3DBASETEXTURE9)m_pTexture); 603 if (FAILED(hr)) 604 { 605 m_pd3dDevice->EndScene(); 606 goto RenderError; 607 } 608 609 // Render the vertex buffer contents 610 hr = m_pd3dDevice->SetStreamSource(0, m_pVertexBuffer, 611 0, sizeof(CUSTOMVERTEX)); 612 if (FAILED(hr)) 613 { 614 m_pd3dDevice->EndScene(); 615 goto RenderError; 616 } 617 618 // we use FVF instead of vertex shader 619 hr = m_pd3dDevice->SetVertexShader(NULL); 620 if (FAILED(hr)) 621 { 622 m_pd3dDevice->EndScene(); 623 goto RenderError; 624 } 625 626 hr = m_pd3dDevice->SetFVF(D3DFVF_CUSTOMVERTEX); 627 if (FAILED(hr)) 628 { 629 m_pd3dDevice->EndScene(); 630 goto RenderError; 631 } 632 633 // draw rectangle 634 hr = m_pd3dDevice->DrawPrimitive(D3DPT_TRIANGLEFAN, 0, 2); 635 if (FAILED(hr)) 636 { 637 m_pd3dDevice->EndScene(); 638 goto RenderError; 639 } 640 641 // End the scene 642 hr = m_pd3dDevice->EndScene(); 643 if (FAILED(hr)) 644 { 645 goto RenderError; 646 } 647 648 { 649 RECT rc_dest; 650 if (!embedding) 651 { 652 ::GetClientRect(m_hWnd, &rc_dest); 653 rc_dest.right--; 654 rc_dest.bottom--; 655 } 656 else 657 { 658 rc_dest.left = display_visible_rect.left(); 659 rc_dest.top = display_visible_rect.top(); 660 rc_dest.right = display_visible_rect.right(); 661 rc_dest.bottom = display_visible_rect.bottom(); 662 } 663 664 RECT rc_src = 665 {0, 0, m_InputCX-1, m_InputCY-1}; 666 667 // A 668 if (display_video_rect.height() < rc_dest.bottom - rc_dest.top) 669 { 670 rc_dest.top = display_video_rect.top(); 671 rc_dest.bottom = display_video_rect.bottom(); 672 rc_src.left = (display_video_rect.width() - 673 (rc_dest.right - rc_dest.left)) / 2; 674 rc_src.right -= rc_src.left; 675 } 676 // B 677 if (display_video_rect.width() < rc_dest.right - rc_dest.left) 678 { 679 rc_dest.left = display_video_rect.left(); 680 rc_dest.right = display_video_rect.right(); 681 rc_src.top = (display_video_rect.height() - 682 (rc_dest.bottom - rc_dest.top)) / 2; 683 rc_src.bottom -= rc_src.top; 684 } 685 686 m_rcDest = rc_dest; 687 hr = m_pd3dDevice->Present(&rc_src, &rc_dest, NULL, NULL); 688 } 689 690 if (FAILED(hr)) 691 RenderError: 692 693 VERBOSE(VB_IMPORTANT, LOC_ERR + "Video rendering failed"); 694 695 qApp->wakeUpGuiThread(); 696 } 697 else 698 { 699 VERBOSE(VB_IMPORTANT, LOC_ERR + "Direct3D device not initialized"); 700 } 701 } 702 703 void VideoOutputD3D::Zoom(ZoomDirection direction) 704 { 705 RECT rc; 706 ::GetClientRect(m_hWnd, &rc); 707 708 HDC hdc = ::GetDC(m_hWnd); 709 if (hdc) 710 { 711 ::FillRect(hdc, &rc, (HBRUSH)::GetStockObject(BLACK_BRUSH)); 712 ::ReleaseDC(m_hWnd, hdc); 713 } 714 } 715 716 void VideoOutputD3D::UpdatePauseFrame(void) 717 { 718 QMutexLocker locker(&m_lock); 719 VideoFrame *used_frame = vbuffers.head(kVideoBuffer_used); 720 if (!used_frame) 721 used_frame = vbuffers.GetScratchFrame(); 722 723 CopyFrame(&m_pauseFrame, used_frame); 724 } 725 726 void VideoOutputD3D::ProcessFrame(VideoFrame *frame, OSD *osd, 727 FilterChain *filterList, 728 NuppelVideoPlayer *pipPlayer) 729 { 730 QMutexLocker locker(&m_lock); 731 if (IsErrored()) 732 { 733 VERBOSE(VB_IMPORTANT, LOC_ERR + 734 "ProcessFrame() called while IsErrored is true."); 735 return; 736 } 737 738 if (!frame) 739 { 740 frame = vbuffers.GetScratchFrame(); 741 CopyFrame(vbuffers.GetScratchFrame(), &m_pauseFrame); 742 } 743 744 if (m_deinterlacing && m_deintFilter != NULL) 745 m_deintFilter->ProcessFrame(frame); 746 747 if (filterList) 748 filterList->ProcessFrame(frame); 749 750 ShowPip(frame, pipPlayer); 751 DisplayOSD(frame, osd); 752 } 753 754 float VideoOutputD3D::GetDisplayAspect(void) const 755 { 756 VERBOSE(VB_PLAYBACK, LOC + "GetDisplayAspect"); 757 758 float width = display_visible_rect.width(); 759 float height = display_visible_rect.height(); 760 761 if (height <= 0.0001f) 762 return 16.0f / 9.0f; 763 764 return width / height; 765 } 766 767 QStringList VideoOutputD3D::GetAllowedRenderers( 768 MythCodecID myth_codec_id, const QSize &video_dim) 769 { 770 QStringList list; 771 list += "direct3d"; 772 return list; 773 } -
libs/libmythtv/osdtypes.cpp
1299 1299 m_dontround = false; 1300 1300 m_cacheitem = NULL; 1301 1301 1302 Load Image(filename, wmult, hmult, scalew, scaleh);1302 Load(filename, wmult, hmult, scalew, scaleh); 1303 1303 } 1304 1304 1305 1305 OSDTypeImage::OSDTypeImage(const OSDTypeImage &other) … … 1417 1417 QPoint((int)round(m_unbiasedpos.x() * wmult), 1418 1418 (int)round(m_unbiasedpos.y() * hmult)); 1419 1419 1420 Load Image(m_filename, wmult, hmult, m_scalew, m_scaleh);1420 Load(m_filename, wmult, hmult, m_scalew, m_scaleh); 1421 1421 } 1422 1422 1423 void OSDTypeImage::Load Image(const QString &filename, float wmult, float hmult,1424 1423 void OSDTypeImage::Load(const QString &filename, float wmult, float hmult, 1424 int scalew, int scaleh, bool usecache) 1425 1425 { 1426 1426 QString ckey; 1427 1427 … … 1535 1535 } 1536 1536 } 1537 1537 1538 void OSDTypeImage::Load FromQImage(const QImage &img)1538 void OSDTypeImage::Load(const QImage &img) 1539 1539 { 1540 1540 // this method is not cached 1541 1541 … … 1835 1835 m_scaleh = scaleh; 1836 1836 m_cacheitem = NULL; 1837 1837 1838 Load Image(m_redname, wmult, hmult, scalew, scaleh, false);1838 Load(m_redname, wmult, hmult, scalew, scaleh, false); 1839 1839 if (m_isvalid) 1840 1840 { 1841 1841 m_risvalid = m_isvalid; … … 1850 1850 m_alpha = m_yuv = NULL; 1851 1851 } 1852 1852 1853 Load Image(m_bluename, wmult, hmult, scalew, scaleh, false);1853 Load(m_bluename, wmult, hmult, scalew, scaleh, false); 1854 1854 } 1855 1855 1856 1856 OSDTypeEditSlider::~OSDTypeEditSlider() … … 1871 1871 1872 1872 m_displaypos = m_displayrect.topLeft(); 1873 1873 1874 Load Image(m_redname, wmult, hmult, m_scalew, m_scaleh, false);1874 Load(m_redname, wmult, hmult, m_scalew, m_scaleh, false); 1875 1875 if (m_isvalid) 1876 1876 { 1877 1877 m_risvalid = m_isvalid; … … 1886 1886 m_alpha = m_yuv = NULL; 1887 1887 } 1888 1888 1889 Load Image(m_bluename, wmult, hmult, m_scalew, m_scaleh, false);1889 Load(m_bluename, wmult, hmult, m_scalew, m_scaleh, false); 1890 1890 } 1891 1891 1892 1892 void OSDTypeEditSlider::ClearAll(void) -
libs/libmythtv/jobqueue.cpp
8 8 9 9 #include <sys/types.h> 10 10 #include <sys/stat.h> 11 #include <sys/wait.h>12 #include <sys/resource.h>13 11 14 12 #include <iostream> 15 13 #include <cstdlib> … … 23 21 #include "NuppelVideoPlayer.h" 24 22 #include "mythdbcon.h" 25 23 #include "previewgenerator.h" 24 #include "compat.h" 26 25 27 26 #define LOC QString("JobQueue: ") 28 27 #define LOC_ERR QString("JobQueue Error: ") -
libs/libmythtv/DVDRingBuffer.cpp
7 7 #include "iso639.h" 8 8 9 9 #include "NuppelVideoPlayer.h" 10 #include "compat.h" 10 11 11 12 #define LOC QString("DVDRB: ") 12 13 #define LOC_ERR QString("DVDRB, Error: ") -
libs/libmythtv/libmythtv.pro
7 7 target.path = $${LIBDIR} 8 8 INSTALLS = target 9 9 10 INCLUDEPATH += ../.. .. 10 INCLUDEPATH += ../.. .. . 11 11 INCLUDEPATH += ../libmyth ../libavcodec ../libavutil ../libmythmpeg2 12 12 INCLUDEPATH += ./dvbdev ./mpeg ./iptv 13 13 INCLUDEPATH += ../libmythlivemedia/BasicUsageEnvironment/include … … 43 43 TARGETDEPS += ../libmythmpeg2/libmythmpeg2-$${MYTH_LIB_EXT} 44 44 TARGETDEPS += ../libmythdvdnav/libmythdvdnav-$${MYTH_LIB_EXT} 45 45 TARGETDEPS += ../libmythfreemheg/libmythfreemheg-$${MYTH_SHLIB_EXT} 46 TARGETDEPS += ../libmythlivemedia/libmythlivemedia-$${MYTH_SHLIB_EXT}46 using_live: TARGETDEPS += ../libmythlivemedia/libmythlivemedia-$${MYTH_SHLIB_EXT} 47 47 48 48 49 49 DEFINES += _LARGEFILE_SOURCE … … 114 114 115 115 # Headers needed by frontend & backend 116 116 HEADERS += filter.h format.h 117 HEADERS += frame.h 117 HEADERS += frame.h compat.h 118 118 119 119 # LZO / RTjpegN, used by NuppelDecoder & NuppelVideoRecorder 120 120 HEADERS += lzoconf.h … … 497 497 QMAKE_CXXFLAGS += -fvisibility=hidden 498 498 } 499 499 500 mingw { 501 DEFINES -= USING_OPENGL_VSYNC 502 DEFINES += USING_D3D USING_MINGW 503 504 HEADERS -= util-opengl.h openglcontext.h 505 HEADERS += videoout_d3d.h 506 SOURCES -= util-opengl.cpp openglcontext.cpp 507 SOURCES += videoout_d3d.cpp 508 509 LIBS += -lpthread 510 LIBS += -L../libmythfreemheg -lmythfreemheg-$${LIBVERSION} 511 LIBS += -L. -lmythui-bootstrap 512 513 target.path = $${PREFIX}/bin 514 implib.target = libmythui-bootstrap.a 515 implib.commands = test -e libmythui-bootstrap.a || dlltool --input-def ../libmythui/libmythui.def --dllname libmythui-$${LIBVERSION}.dll --output-lib libmythui-bootstrap.a -k 516 QMAKE_EXTRA_WIN_TARGETS += implib 517 POST_TARGETDEPS += libmythui-bootstrap.a 518 } 519 500 520 # install headers required by mytharchive 501 521 inc.path = $${PREFIX}/include/mythtv/libmythtv/ 502 522 inc.files = programinfo.h remoteutil.h recordingtypes.h -
libs/libmythtv/osdtypeteletext.h
21 21 class OSDTypeTeletext; 22 22 class TV; 23 23 24 class TTColor 24 typedef enum 25 25 { 26 public: 27 static const uint BLACK = 0; 28 static const uint RED = 1; 29 static const uint GREEN = 2; 30 static const uint YELLOW = 3; 31 static const uint BLUE = 4; 32 static const uint MAGENTA = 5; 33 static const uint CYAN = 6; 34 static const uint WHITE = 7; 35 static const uint TRANSPARENT = 8; 36 }; 26 kTTColorBlack = 0, 27 kTTColorRed = 1, 28 kTTColorGreen = 2, 29 kTTColorYellow = 3, 30 kTTColorBlue = 4, 31 kTTColorMagenta = 5, 32 kTTColorCyan = 6, 33 kTTColorWhite = 7, 34 kTTColorTransparent = 8, 35 } TTColor; 37 36 38 37 class TTKey 39 38 { -
libs/libmythtv/ThreadedFileWriter.cpp
13 13 // MythTV headers 14 14 #include "ThreadedFileWriter.h" 15 15 #include "mythcontext.h" 16 #include "compat.h" 16 17 17 18 #if defined(_POSIX_SYNCHRONIZED_IO) && _POSIX_SYNCHRONIZED_IO > 0 18 19 #define HAVE_FDATASYNC -
libs/libmythtv/osdtypes.h
310 310 void SetName(const QString &name); 311 311 void Reinit(float wmult, float hmult); 312 312 313 void Load Image(const QString &filename, float wmult, float hmult,314 315 void Load FromQImage(const QImage &img);313 void Load(const QString &filename, float wmult, float hmult, 314 int scalew = -1, int scaleh = -1, bool usecache = true); 315 void Load(const QImage &img); 316 316 317 317 void SetStaticSize(int scalew, int scaleh) { m_scalew = scalew; 318 318 m_scaleh = scaleh; } -
libs/libmythtv/dsmcccache.h
106 106 void SetGateway(const DSMCCCacheReference &ref); 107 107 108 108 // Return the contents. 109 int Get Object(QStringList &objectPath, QByteArray &result);109 int GetDSMObject(QStringList &objectPath, QByteArray &result); 110 110 111 111 protected: 112 112 // Find File, Directory or Gateway by reference. -
libs/libmythtv/guidegrid.cpp
1167 1167 else if (type) 1168 1168 iconsize = type->GetSize(); 1169 1169 if (!chinfo->iconload) 1170 chinfo->Load Icon(iconsize);1170 chinfo->LoadChannelIcon(iconsize); 1171 1171 if (chinfo->iconload) 1172 1172 { 1173 1173 if (itype) … … 1195 1195 else if (type) 1196 1196 iconsize = type->GetSize(); 1197 1197 if (!chinfo->iconload) 1198 chinfo->Load Icon(iconsize);1198 chinfo->LoadChannelIcon(iconsize); 1199 1199 if (chinfo->iconload) 1200 1200 type->SetIcon(y, chinfo->icon); 1201 1201 else … … 1316 1316 int iconsize = 0; 1317 1317 iconsize = itype->GetSize().width(); 1318 1318 if (!chinfo->iconload) 1319 chinfo->Load Icon(iconsize);1319 chinfo->LoadChannelIcon(iconsize); 1320 1320 if (chinfo->iconload) 1321 1321 itype->SetImage(chinfo->icon); 1322 1322 else -
libs/libmythtv/siscan.cpp
30 30 #include "dvbchannel.h" 31 31 #include "hdhrchannel.h" 32 32 #include "channel.h" 33 #include "compat.h" 33 34 34 35 QString SIScan::loc(const SIScan *siscan) 35 36 { -
libs/libmythtv/fifowriter.cpp
12 12 13 13 #include "fifowriter.h" 14 14 #include "mythcontext.h" 15 #include "compat.h" 15 16 16 17 #include "config.h" 17 18 #ifdef CONFIG_DARWIN -
libs/libmythtv/videoout_d3d.h
1 // -*- Mode: c++ -*- 2 3 #ifndef VIDEOOUT_D3D_H_ 4 #define VIDEOOUT_D3D_H_ 5 6 /* ACK! <windows.h> and <d3d3.h> should only be in cpp's compiled in 7 * windows only. Some of the variables in VideoOutputDX need to be 8 * moved to a private class before removing these includes though. 9 */ 10 #include <windows.h> // HACK HACK HACK 11 #include <d3d9.h> // HACK HACK HACK 12 13 // MythTV headers 14 #include "videooutbase.h" 15 16 class VideoOutputD3D : public VideoOutput 17 { 18 public: 19 VideoOutputD3D(); 20 ~VideoOutputD3D(); 21 22 bool Init(int width, int height, float aspect, WId winid, 23 int winx, int winy, int winw, int winh, WId embedid = 0); 24 25 bool InitD3D(); 26 void UnInitD3D(); 27 void PrepareFrame(VideoFrame *buffer, FrameScanType); 28 void ProcessFrame(VideoFrame *frame, OSD *osd, 29 FilterChain *filterList, 30 NuppelVideoPlayer *pipPlayer); 31 void Show(FrameScanType ); 32 33 bool InputChanged(const QSize &input_size, 34 float aspect, 35 MythCodecID av_codec_id, 36 void *codec_private); 37 int GetRefreshRate(void); 38 void UpdatePauseFrame(void); 39 void DrawUnusedRects(bool) {}; 40 void Zoom(ZoomDirection direction); 41 42 float GetDisplayAspect(void) const; 43 44 static QStringList GetAllowedRenderers(MythCodecID myth_codec_id, 45 const QSize &video_dim); 46 47 private: 48 void Exit(void); 49 50 private: 51 int m_InputCX; 52 int m_InputCY; 53 RECT m_rcDest; 54 55 VideoFrame m_pauseFrame; 56 QMutex m_lock; 57 58 int m_RefreshRate; 59 HWND m_hWnd; 60 D3DFORMAT m_ddFormat; 61 IDirect3D9 *m_pD3D; 62 IDirect3DDevice9 *m_pd3dDevice; 63 IDirect3DSurface9 *m_pSurface; 64 IDirect3DTexture9 *m_pTexture; 65 IDirect3DVertexBuffer9 *m_pVertexBuffer; 66 }; 67 68 #endif -
libs/libmythtv/channelbase.cpp
7 7 #include <unistd.h> 8 8 #include <fcntl.h> 9 9 #include <signal.h> 10 #include <sys/ ioctl.h>10 #include <sys/stat.h> 11 11 #include <sys/types.h> 12 #include <sys/stat.h>13 #include <sys/wait.h>14 12 15 13 // C++ headers 16 14 #include <iostream> … … 26 24 #include "mythdbcon.h" 27 25 #include "cardutil.h" 28 26 #include "channelutil.h" 27 #include "compat.h" 29 28 30 29 #define LOC QString("ChannelBase(%1): ").arg(GetCardID()) 31 30 #define LOC_ERR QString("ChannelBase(%1) Error: ").arg(GetCardID()) … … 225 224 226 225 bool ChannelBase::ChangeExternalChannel(const QString &channum) 227 226 { 227 #ifdef USING_MINGW 228 VERBOSE(VB_IMPORTANT, LOC_WARN + 229 QString("ChangeExternalChannel is not implemented in MinGW.")); 230 return false; 231 #else 228 232 InputMap::const_iterator it = inputs.find(currentInputID); 229 233 QString changer = (*it)->externalChanger; 230 234 … … 312 316 } 313 317 314 318 return true; 319 #endif // !USING_MINGW 315 320 } 316 321 317 322 /** \fn ChannelBase::GetCardID(void) const -
libs/libmythtv/cc708decoder.h
9 9 #include <qstringlist.h> 10 10 11 11 #include "format.h" 12 #include "compat.h" 12 13 13 14 #ifndef __CC_CALLBACKS_H__ 14 15 /** EIA-708-A closed caption packet */ -
libs/libmythtv/vbitext/vbi.c
1 // POSIX headers 2 #include <unistd.h> 3 #include <fcntl.h> 4 5 #ifndef _WIN32 6 #include <sys/ioctl.h> 7 #endif 8 9 // ANSI C headers 1 10 #include <stdlib.h> 2 11 #include <string.h> 3 #include <unistd.h>4 #include <fcntl.h>5 12 #include <stdio.h> 6 #include <sys/ioctl.h>7 13 #include <stdarg.h> 8 //#include "os.h" 14 15 // vbitext headers 9 16 #include "vt.h" 10 17 #include "vbi.h" 11 18 #include "hamm.h" 12 //#include "lang.h"13 19 14 20 #define FAC (1<<16) // factor for fix-point arithmetic 15 21 -
libs/libmythtv/vbitext/cc.cpp
20 20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 21 */ 22 22 23 #include <cstdio>24 23 #include <cstdlib> 25 24 #include <cstdarg> 26 25 #include <unistd.h> … … 28 27 #include <cctype> 29 28 #include <cerrno> 30 29 #include <fcntl.h> 31 #include <sys/ioctl.h>32 30 #include <sys/types.h> 33 31 #ifdef HAVE_GETOPT_H 34 32 # include <getopt.h> -
libs/libmythtv/dsmcccache.cpp
271 271 // Returns zero for success, -1 if we know the object does not 272 272 // currently exist and +1 if the carousel has not so far loaded 273 273 // the object or one of the parent files. 274 int DSMCCCache::Get Object(QStringList &objectPath, QByteArray &result)274 int DSMCCCache::GetDSMObject(QStringList &objectPath, QByteArray &result) 275 275 { 276 276 DSMCCCacheDir *dir = FindGateway(m_GatewayRef); 277 277 if (dir == NULL) -
libs/libmythtv/filtermanager.cpp
1 1 // POSIX headers 2 #ifndef USING_MINGW // dlfcn for mingw defined in compat.h 2 3 #include <dlfcn.h> // needed for dlopen(), dlerror(), dlsym(), and dlclose() 4 #else 5 #include "compat.h" 6 #endif 3 7 4 8 // Qt headers 5 9 #include <qdir.h> -
libs/libmythtv/infostructs.h
5 5 6 6 #include "mythexp.h" 7 7 8 #ifdef USING_MINGW 9 #undef LoadIcon 10 #endif 11 8 12 class QPixmap; 9 13 10 14 class MPUBLIC ChannelInfo … … 13 17 ChannelInfo() {} 14 18 ~ChannelInfo() {} 15 19 16 void Load Icon(int width, int height=0);20 void LoadChannelIcon(int width, int height = 0); 17 21 QString Text(QString format); 18 22 19 23 QString callsign; -
libs/libmythtv/previewgenerator.cpp
6 6 #include <sys/stat.h> // for stat 7 7 #include <unistd.h> // for stat 8 8 #include <sys/time.h> 9 #include <sys/resource.h>10 9 #include <sys/types.h> 11 10 #include <sys/stat.h> 12 11 #include <fcntl.h> … … 25 24 #include "mythsocket.h" 26 25 #include "remotefile.h" 27 26 #include "storagegroup.h" 27 #include "util.h" 28 28 29 29 #define LOC QString("Preview: ") 30 30 #define LOC_ERR QString("Preview Error: ") … … 606 606 if (!invalid) 607 607 { 608 608 // Check size too, QFileInfo can not handle large files 609 struct stat status; 610 stat(filename.ascii(), &status); 611 // Using off_t requires a lot of 32/64 bit checking. 612 // So just get the size in blocks. 613 unsigned long long bsize = status.st_blksize; 614 unsigned long long nblk = status.st_blocks; 615 unsigned long long approx_size = nblk * bsize; 616 invalid = (approx_size < 8*1024); 609 unsigned long long fsize = 610 myth_get_approximate_large_file_size(filename); 611 invalid = (fsize < 8*1024); 617 612 } 618 613 if (invalid) 619 614 { -
libs/libmythtv/DeviceReadBuffer.h
6 6 7 7 #include <unistd.h> 8 8 #include <pthread.h> 9 #include <sys/poll.h>10 9 11 10 #include <qmutex.h> 12 11 #include <qwaitcondition.h> -
libs/libmythtv/infostructs.cpp
9 9 #include "infostructs.h" 10 10 #include "mythcontext.h" 11 11 12 void ChannelInfo::Load Icon(int width, int height)12 void ChannelInfo::LoadChannelIcon(int width, int height) 13 13 { 14 14 QImage tempimage(iconpath); 15 15 -
libs/libmythtv/signalmonitor.cpp
9 9 // MythTV headers 10 10 #include "mythcontext.h" 11 11 #include "signalmonitor.h" 12 #include "compat.h" 12 13 13 14 extern "C" { 14 15 #include "../libavcodec/avcodec.h" -
libs/libmythtv/dsmcc.cpp
479 479 // Can we actually have more than one carousel? 480 480 for (; (car = it.current()) != NULL; ++it) 481 481 { 482 int res = car->filecache.Get Object(objectPath, result);482 int res = car->filecache.GetDSMObject(objectPath, result); 483 483 if (res != -1) 484 484 return res; 485 485 } -
libs/libmythtv/RingBuffer.cpp
31 31 #include "livetvchain.h" 32 32 #include "DVDRingBuffer.h" 33 33 #include "util.h" 34 #include "compat.h" 34 35 35 36 #ifndef O_STREAMING 36 37 #define O_STREAMING 0 -
libs/libmythtv/vsync.cpp
22 22 #include <unistd.h> 23 23 #include <fcntl.h> 24 24 25 #include <sys/ioctl.h>26 25 #include <sys/types.h> 27 26 #include <sys/stat.h> 27 #include "compat.h" 28 29 #ifndef _WIN32 30 #include <sys/ioctl.h> 28 31 #include <sys/poll.h> 32 #endif 29 33 30 34 #include <mythcontext.h> 31 35 #include "mythdialogs.h" // for OpenGL VSync … … 86 90 m_forceskip = 0; 87 91 } 88 92 93 #ifndef _WIN32 89 94 TESTVIDEOSYNC(nVidiaVideoSync); 90 95 TESTVIDEOSYNC(DRMVideoSync); 91 96 if (tryOpenGL) 92 97 TESTVIDEOSYNC(OpenGLVideoSync); 98 #endif // _WIN32 93 99 #ifdef __linux__ 94 100 TESTVIDEOSYNC(RTCVideoSync); 95 #endif 101 #endif // __linux__ 102 96 103 TESTVIDEOSYNC(BusyWaitVideoSync); 97 104 98 105 tryingVideoSync=false; … … 238 245 struct drm_wait_vblank_reply reply; 239 246 } drm_wait_vblank_t; 240 247 248 #ifndef _WIN32 241 249 #define DRM_IOCTL_BASE 'd' 242 250 #define DRM_IOWR(nr,type) _IOWR(DRM_IOCTL_BASE,nr,type) 243 251 244 252 #define DRM_IOCTL_WAIT_VBLANK DRM_IOWR(0x3a, drm_wait_vblank_t) 253 #endif 245 254 246 255 static int drmWaitVBlank(int fd, drm_wait_vblank_t *vbl) 247 256 { … … 363 372 364 373 bool nVidiaVideoSync::dopoll() const 365 374 { 375 #ifdef _WIN32 376 return false; 377 #else 366 378 int ret; 367 379 struct pollfd polldata; 368 380 polldata.fd = m_nvidia_fd; … … 377 389 return false; 378 390 } 379 391 return true; 392 #endif 380 393 } 381 394 382 395 bool nVidiaVideoSync::TryInit(void) … … 711 724 712 725 bool RTCVideoSync::TryInit(void) 713 726 { 727 #ifdef _WIN32 728 return false; 729 #else 714 730 m_rtcfd = open("/dev/rtc", O_RDONLY); 715 731 if (m_rtcfd < 0) 716 732 { … … 735 751 } 736 752 737 753 return true; 754 #endif 738 755 } 739 756 740 757 void RTCVideoSync::WaitForFrame(int sync_delay) -
libs/libmythtv/osdtypeteletext.cpp
684 684 { 685 685 QColor color; 686 686 687 switch (ttcolor & ~ TTColor::TRANSPARENT)687 switch (ttcolor & ~kTTColorTransparent) 688 688 { 689 case TTColor::BLACK: color = OSDTypeTeletext::kColorBlack; break;690 case TTColor::RED: color = OSDTypeTeletext::kColorRed; break;691 case TTColor::GREEN: color = OSDTypeTeletext::kColorGreen; break;692 case TTColor::YELLOW: color = OSDTypeTeletext::kColorYellow; break;693 case TTColor::BLUE: color = OSDTypeTeletext::kColorBlue; break;694 case TTColor::MAGENTA: color = OSDTypeTeletext::kColorMagenta; break;695 case TTColor::CYAN: color = OSDTypeTeletext::kColorCyan; break;696 case TTColor::WHITE: color = OSDTypeTeletext::kColorWhite; break;689 case kTTColorBlack: color = OSDTypeTeletext::kColorBlack; break; 690 case kTTColorRed: color = OSDTypeTeletext::kColorRed; break; 691 case kTTColorGreen: color = OSDTypeTeletext::kColorGreen; break; 692 case kTTColorYellow: color = OSDTypeTeletext::kColorYellow; break; 693 case kTTColorBlue: color = OSDTypeTeletext::kColorBlue; break; 694 case kTTColorMagenta: color = OSDTypeTeletext::kColorMagenta; break; 695 case kTTColorCyan: color = OSDTypeTeletext::kColorCyan; break; 696 case kTTColorWhite: color = OSDTypeTeletext::kColorWhite; break; 697 697 } 698 698 699 699 return color; … … 702 702 /** \fn OSDTypeTeletext::SetForegroundColor(int) const 703 703 * \brief Set the font color to the given color. 704 704 * 705 * NOTE: TTColor::TRANSPARENTdoes not do anything!705 * NOTE: kTTColorTransparent does not do anything! 706 706 * \sa TTColor 707 707 */ 708 708 void OSDTypeTeletext::SetForegroundColor(int ttcolor) const … … 732 732 m_bgcolor_y = (uint8_t)(y); 733 733 m_bgcolor_u = (uint8_t)(127 + u); 734 734 m_bgcolor_v = (uint8_t)(127 + v); 735 m_bgcolor_a = (ttcolor & TTColor::TRANSPARENT) ? 0x00 : 0xff;735 m_bgcolor_a = (ttcolor & kTTColorTransparent) ? 0x00 : 0xff; 736 736 } 737 737 738 738 /** \fn OSDTypeTeletext::DrawBackground(OSDSurface*,int,int) const … … 890 890 char last_ch = ' '; 891 891 char ch; 892 892 893 uint fgcolor = TTColor::WHITE;894 uint bgcolor = TTColor::BLACK;895 uint newfgcolor = TTColor::WHITE;896 uint newbgcolor = TTColor::BLACK;893 uint fgcolor = kTTColorWhite; 894 uint bgcolor = kTTColorBlack; 895 uint newfgcolor = kTTColorWhite; 896 uint newbgcolor = kTTColorBlack; 897 897 898 898 if (m_curpage_issubtitle || m_transparent) 899 899 { 900 bgcolor = TTColor::TRANSPARENT;901 newbgcolor = TTColor::TRANSPARENT;900 bgcolor = kTTColorTransparent; 901 newbgcolor = kTTColorTransparent; 902 902 } 903 903 904 904 SetForegroundColor(fgcolor); … … 925 925 { 926 926 if (startbox) 927 927 { 928 bgcolor = TTColor::BLACK;928 bgcolor = kTTColorBlack; 929 929 startbox = false; 930 930 } 931 931 932 932 if (endbox) 933 933 { 934 bgcolor = TTColor::TRANSPARENT;934 bgcolor = kTTColorTransparent; 935 935 endbox = false; 936 936 } 937 937 … … 982 982 seperation = true; 983 983 goto ctrl; 984 984 case 0x1c: // black background 985 bgcolor = TTColor::BLACK;985 bgcolor = kTTColorBlack; 986 986 goto ctrl; 987 987 case 0x1d: // new background 988 988 bgcolor = fgcolor; … … 1034 1034 if ((row != 0) || (x > 7)) 1035 1035 { 1036 1036 if (m_transparent) 1037 SetBackgroundColor( TTColor::TRANSPARENT);1037 SetBackgroundColor(kTTColorTransparent); 1038 1038 1039 1039 DrawBackground(surface, x, row); 1040 1040 if (doubleheight && row < (uint)kTeletextRows) … … 1128 1128 1129 1129 void OSDTypeTeletext::DrawStatus(OSDSurface *surface) const 1130 1130 { 1131 SetForegroundColor( TTColor::WHITE);1132 SetBackgroundColor( TTColor::BLACK);1131 SetForegroundColor(kTTColorWhite); 1132 SetBackgroundColor(kTTColorBlack); 1133 1133 1134 1134 if (!m_transparent) 1135 1135 for (int i = 0; i < 40; ++i) … … 1144 1144 1145 1145 if (!ttpage) 1146 1146 { 1147 SetBackgroundColor( TTColor::BLACK);1148 SetForegroundColor( TTColor::WHITE);1147 SetBackgroundColor(kTTColorBlack); 1148 SetForegroundColor(kTTColorWhite); 1149 1149 1150 1150 if (!m_transparent) 1151 1151 for (int i = 7; i < 40; i++) … … 1208 1208 str = " <" + str.mid(startPos * 3, 27) + " > "; 1209 1209 } 1210 1210 1211 SetForegroundColor( TTColor::WHITE);1211 SetForegroundColor(kTTColorWhite); 1212 1212 for (int x = 0; x < 11; x++) 1213 1213 { 1214 1214 if (m_transparent) 1215 SetBackgroundColor( TTColor::TRANSPARENT);1215 SetBackgroundColor(kTTColorTransparent); 1216 1216 else 1217 SetBackgroundColor( TTColor::BLACK);1217 SetBackgroundColor(kTTColorBlack); 1218 1218 1219 1219 DrawBackground(surface, x * 3 + 7, 0); 1220 1220 1221 1221 if (str[x * 3] == '*') 1222 1222 { 1223 1223 str[x * 3] = ' '; 1224 SetBackgroundColor( TTColor::RED);1224 SetBackgroundColor(kTTColorRed); 1225 1225 } 1226 1226 1227 1227 DrawBackground(surface, x * 3 + 8, 0); -
libs/libmythtv/tv_play.cpp
41 41 #include "datadirect.h" 42 42 #include "sourceutil.h" 43 43 #include "util-osx-cocoa.h" 44 #include "compat.h" 44 45 45 46 #ifndef HAVE_ROUND 46 47 #define round(x) ((int) ((x) + 0.5)) -
libs/libmythtv/videooutbase.cpp
25 25 #include "videoout_dx.h" 26 26 #endif 27 27 28 #ifdef USING_D3D 29 #include "videoout_d3d.h" 30 #endif 31 28 32 #ifdef Q_OS_MACX 29 33 #include "videoout_quartz.h" 30 34 #endif … … 70 74 renderers += VideoOutputDirectfb::GetAllowedRenderers(codec_id, video_dim); 71 75 #endif // USING_DIRECTFB 72 76 77 #ifdef USING_D3D 78 renderers += VideoOutputD3D::GetAllowedRenderers(codec_id, video_dim); 79 #endif 80 73 81 #ifdef USING_DIRECTX 74 renderers += VideoOutputDX::GetAllowedRenderers(code d_id, video_dim);82 renderers += VideoOutputDX::GetAllowedRenderers(codec_id, video_dim); 75 83 #endif // USING_DIRECTX 76 84 77 85 #ifdef USING_XV … … 129 137 vo = new VideoOutputDirectfb(); 130 138 #endif // USING_DIRECTFB 131 139 140 #ifdef USING_D3D 141 if (renderer == "direct3d") 142 vo = new VideoOutputD3D(); 143 #endif // USING_D3D 144 132 145 #ifdef USING_DIRECTX 133 146 if (renderer == "directx") 134 147 vo = new VideoOutputDX(); -
libs/libmythtv/vsync.h
197 197 * \sa http://www.ac3.edu.au/SGI_Developer/books/OpenGLonSGI/sgi_html/ch10.html#id37188 198 198 * \sa http://www.inb.mu-luebeck.de/~boehme/xvideo_sync.html 199 199 */ 200 #ifndef USING_MINGW 200 201 class OpenGLVideoSync : public VideoSync 201 202 { 202 203 public: … … 217 218 private: 218 219 QMutex m_lock; 219 220 }; 221 #endif // USING_MINGW 220 222 221 223 #ifdef __linux__ 222 224 /** \brief Video synchronization class employing /dev/rtc -
libs/libmythtv/cardutil.cpp
1 1 // Standard UNIX C headers 2 2 #include <fcntl.h> 3 #include <sys/ioctl.h>4 3 #include <unistd.h> 5 4 5 #if defined(USING_V4L) || defined(USING_DVB) 6 #include <sys/ioctl.h> 7 #endif 8 6 9 // MythTV headers 7 10 #include "cardutil.h" 8 11 #include "videosource.h" -
libs/libmythtv/fifowriter.h
1 1 #ifndef FIFOWRITER 2 2 #define FIFOWRITER 3 3 4 #include <vector> 4 // POSIX headers 5 #include <pthread.h> 6 7 // Qt headers 5 8 #include <qstring.h> 6 9 #include <qmutex.h> 7 10 #include <qptrqueue.h> 8 11 12 // MythTV headers 9 13 #include "mythexp.h" 10 14 11 15 using namespace std; -
libs/libmythtv/videosource.cpp
3 3 // Standard UNIX C headers 4 4 #include <unistd.h> 5 5 #include <fcntl.h> 6 #include <sys/ioctl.h>7 6 #include <sys/types.h> 8 7 #include <sys/stat.h> 9 8 -
libs/libmythtv/frequencytables.cpp
1 1 #include "frequencies.h" 2 2 #include "frequencytables.h" 3 3 #include "channelutil.h" 4 #include "compat.h" 4 5 5 6 freq_table_map_t frequencies; 6 7 -
libs/libmythtv/udpnotify.cpp
25 25 match they will be ignored. 26 26 */ 27 27 28 29 28 #include <cstdio> 30 29 #include <cstdlib> 31 30 #include <cstring> 32 31 #include <unistd.h> 33 32 #include <pthread.h> 34 33 #include <sys/types.h> 35 #include <sys/socket.h>36 34 37 35 #include <qapplication.h> 38 36 #include <qsocketdevice.h> 39 37 #include <qsocketnotifier.h> 40 38 #include <qhostaddress.h> 41 39 42 #include <iostream>43 using namespace std;44 45 40 #include "udpnotify.h" 46 41 #include "mythcontext.h" 47 42 #include "osd.h" 48 43 #include "tv_play.h" 44 #include "compat.h" 49 45 50 46 UDPNotifyOSDSet::UDPNotifyOSDSet(const QString &name) 51 47 { -
libs/libmythtv/DeviceReadBuffer.cpp
4 4 #include "DeviceReadBuffer.h" 5 5 #include "mythcontext.h" 6 6 #include "tspacket.h" 7 #include "compat.h" 7 8 9 #ifndef USING_MINGW 10 #include <sys/poll.h> 11 #endif 12 8 13 /// Set this to 1 to report on statistics 9 14 #define REPORT_RING_STATS 0 10 15 … … 282 287 283 288 bool DeviceReadBuffer::Poll(void) const 284 289 { 290 #ifdef USING_MINGW 291 #warning mingw DeviceReadBuffer::Poll 292 VERBOSE(VB_IMPORTANT, LOC_ERR + 293 "mingw DeviceReadBuffer::Poll is not implemented"); 294 return false; 295 #else 285 296 bool retval = true; 286 297 while (true) 287 298 { … … 310 321 usleep(2500); 311 322 } 312 323 return retval; 324 #endif //!USING_MINGW 313 325 } 314 326 315 327 bool DeviceReadBuffer::CheckForErrors(ssize_t len, uint &errcnt) 316 328 { 329 #ifdef USING_MINGW 330 #warning mingw DeviceReadBuffer::CheckForErrors 331 VERBOSE(VB_IMPORTANT, LOC_ERR + 332 "mingw DeviceReadBuffer::CheckForErrors is not implemented"); 333 return false; 334 #else 317 335 if (len < 0) 318 336 { 319 337 if (EINTR == errno) … … 360 378 return false; 361 379 } 362 380 return true; 381 #endif 363 382 } 364 383 365 384 /** \fn DeviceReadBuffer::Read(unsigned char*, const uint) -
libs/libmythtv/filtermanager.h
9 9 #include <qdict.h> 10 10 #include <qptrlist.h> 11 11 #include <qstring.h> 12 #include <cstdlib>13 #include <dlfcn.h>14 12 15 13 using namespace std; 16 14 -
libs/libmythtv/eitscanner.cpp
2 2 3 3 // POSIX headers 4 4 #include <sys/time.h> 5 #include <sys/resource.h>5 #include "compat.h" 6 6 7 7 #include <cstdlib> 8 8 -
libs/libmythtv/osdsurface.cpp
1 1 #include "osdsurface.h" 2 2 #include "dithertable.h" 3 3 #include "mythcontext.h" 4 #include "compat.h" 4 5 5 6 #include <algorithm> 6 7 using namespace std; -
libs/libmythtv/dtvsignalmonitor.cpp
7 7 #include "mpegtables.h" 8 8 #include "atsctables.h" 9 9 #include "dvbtables.h" 10 #include "compat.h" 10 11 11 12 #undef DBG_SM 12 13 #define DBG_SM(FUNC, MSG) VERBOSE(VB_CHANNEL, \ -
libs/libmythtv/osd.cpp
26 26 #include "textsubtitleparser.h" 27 27 #include "libmyth/oldsettings.h" 28 28 #include "udpnotify.h" 29 #include "compat.h" 29 30 30 31 #include "osdtypeteletext.h" 31 32 #include "osdlistbtntype.h" … … 1244 1245 filename = themepath + filename; 1245 1246 1246 1247 image->SetStaticSize(scale.x(), scale.y()); 1247 image->Load Image(filename, wmult, hmult, scale.x(), scale.y());1248 image->Load(filename, wmult, hmult, scale.x(), scale.y()); 1248 1249 1249 1250 container->AddType(image); 1250 1251 } … … 1646 1647 if (cs) 1647 1648 { 1648 1649 if ((infoMap.contains("iconpath")) && (infoMap["iconpath"] != "")) 1649 cs->Load Image(infoMap["iconpath"], wmult, hmult, 30, 30);1650 cs->Load(infoMap["iconpath"], wmult, hmult, 30, 30); 1650 1651 else 1651 cs->Load Image(" ", wmult, hmult, 30, 30);1652 cs->Load(" ", wmult, hmult, 30, 30); 1652 1653 } 1653 1654 1654 1655 m_setsvisible = true; … … 1669 1670 if (cs) 1670 1671 { 1671 1672 if ((infoMap.contains("iconpath")) && (infoMap["iconpath"] != "")) 1672 cs->Load Image(infoMap["iconpath"], wmult, hmult, 30, 30);1673 cs->Load(infoMap["iconpath"], wmult, hmult, 30, 30); 1673 1674 else 1674 cs->Load Image(" ", wmult, hmult, 30, 30);1675 cs->Load(" ", wmult, hmult, 30, 30); 1675 1676 } 1676 1677 1677 1678 container->DisplayFor(length * 1000000); … … 1725 1726 type->SetText(callsign.left(5)); 1726 1727 OSDTypeImage *cs = (OSDTypeImage *)container->GetType("channelicon"); 1727 1728 if (cs) 1728 cs->Load Image(iconpath, wmult, hmult, 30, 30);1729 cs->Load(iconpath, wmult, hmult, 30, 30); 1729 1730 1730 1731 container->DisplayFor(length * 1000000); 1731 1732 m_setsvisible = true; -
libs/libmythtv/diseqc.cpp
17 17 #include "mythdbcon.h" 18 18 #include "diseqc.h" 19 19 #include "dtvmultiplex.h" 20 #include "compat.h" 20 21 21 22 #ifdef USING_DVB 22 23 # include "dvbtypes.h" -
libs/libmythtv/mhi.cpp
424 424 { 425 425 OSDTypeImage* image = new OSDTypeImage(); 426 426 image->SetPosition(QPoint(data->m_x, data->m_y), 1.0, 1.0); 427 image->Load FromQImage(data->m_image);427 image->Load(data->m_image); 428 428 osdSet->AddType(image); 429 429 } 430 430 } -
libs/libmythtv/videodisplayprofile.cpp
1282 1282 safe_custom += "xshm"; 1283 1283 safe_custom += "directfb"; 1284 1284 safe_custom += "directx"; 1285 safe_custom += "direct3d"; 1285 1286 safe_custom += "quartz-blit"; 1286 1287 safe_custom += "xv-blit"; 1287 1288 safe_custom += "opengl"; … … 1344 1345 safe_renderer[*it2] += "xshm"; 1345 1346 safe_renderer[*it2] += "directfb"; 1346 1347 safe_renderer[*it2] += "directx"; 1348 safe_renderer[*it2] += "direct3d"; 1347 1349 safe_renderer[*it2] += "quartz-blit"; 1348 1350 safe_renderer[*it2] += "xv-blit"; 1349 1351 safe_renderer[*it2] += "opengl"; … … 1367 1369 safe_renderer_priority["xvmc-opengl"] = 100; 1368 1370 safe_renderer_priority["directfb"] = 60; 1369 1371 safe_renderer_priority["directx"] = 50; 1372 safe_renderer_priority["direct3d"] = 55; 1370 1373 safe_renderer_priority["quartz-blit"] = 70; 1371 1374 safe_renderer_priority["quartz-accel"] = 80; 1372 1375 safe_renderer_priority["ivtv"] = 40; -
libs/libmythtv/videobuffers.cpp
8 8 #include "../libavcodec/avcodec.h" 9 9 } 10 10 #include "fourcc.h" 11 #include "compat.h" 11 12 12 13 #ifdef USING_XVMC 13 14 #include "videoout_xv.h" // for xvmc stuff -
libs/libmythtv/videoout_dx.cpp
10 10 #include "fourcc.h" 11 11 12 12 #include "mmsystem.h" 13 #ifdef CONFIG_CYGWIN14 13 #include "tv.h" 15 #endif16 14 15 #undef UNICODE 16 17 17 extern "C" { 18 18 #include "../libavcodec/avcodec.h" 19 19 } … … 201 201 202 202 MoveResize(); 203 203 204 #ifndef CONFIG_CYGWIN205 if (!CreateVideoBuffers())206 return false;207 #endif208 209 204 pauseFrame.height = vbuffers.GetScratchFrame()->height; 210 205 pauseFrame.width = vbuffers.GetScratchFrame()->width; 211 206 pauseFrame.bpp = vbuffers.GetScratchFrame()->bpp; … … 1174 1169 1175 1170 outputpictures = 1; 1176 1171 1177 VERBOSE(VB_IMPORTANT, "created plain surface of chroma: " << PRINT_FOURCC(chroma));1172 VERBOSE(VB_IMPORTANT, "created plain surface"); 1178 1173 } 1179 1174 } 1180 1175 … … 1360 1355 int diff_x = display_visible_rect.left(); 1361 1356 diff_x -= display_video_rect.left(); 1362 1357 int diff_w = display_video_rect.width(); 1363 diff_x -= display_visible_rect.width() 1358 diff_x -= display_visible_rect.width(); 1364 1359 1365 1360 rect_src.left += (XJ_width * diff_x) / display_video_rect.width(); 1366 1361 rect_src.right -= ((XJ_width * (diff_w - diff_x)) / … … 1383 1378 int diff_h = display_video_rect.height(); 1384 1379 diff_h -= display_visible_rect.height(); 1385 1380 1386 rect_src.top += ((video_rect.width() * diff_ x) /1381 rect_src.top += ((video_rect.width() * diff_y) / 1387 1382 display_video_rect.height()); 1388 1383 1389 1384 rect_src.bottom -= (video_rect.height() * (diff_h - diff_y) / -
libs/libavcodec/libavcodec.pro
7 7 target.path = $${LIBDIR} 8 8 INSTALLS = target 9 9 10 INCLUDEPATH = . ./ ../../ ../libavutil ../libswscale10 INCLUDEPATH = ./ ../ ../../ ../libavutil ../libswscale 11 11 12 12 # remove MMX define since it clashes with a libmp3lame enum 13 13 DEFINES -= MMX … … 28 28 } 29 29 30 30 cygwin:LIBS += -lz 31 mingw:target.path = $${PREFIX}/bin 31 32 32 33 !profile:QMAKE_CFLAGS_DEBUG += -O 33 34 -
libs/libavcodec/rtjpeg.h
23 23 #define FFMPEG_RTJPEG_H 24 24 25 25 #include <stdint.h> 26 #include <dsputil.h>26 #include "dsputil.h" 27 27 28 28 typedef struct { 29 29 int w, h; -
libs/libavutil/libavutil.pro
52 52 QMAKE_LFLAGS_SHLIB += -single_module 53 53 QMAKE_LFLAGS_SHLIB += -seg1addr 0xC2000000 54 54 } 55 56 mingw: target.path = $${PREFIX}/bin -
libs/libavformat/utils.c
26 26 #include <sys/time.h> 27 27 #include <time.h> 28 28 29 #ifdef _WIN32 30 #define gmtime_r(X, Y) (memcpy(Y, gmtime(X), sizeof(struct tm)), Y) 31 #define localtime_r(X, Y) (memcpy(Y, localtime(X), sizeof(struct tm)), Y) 32 #endif 33 29 34 #undef NDEBUG 30 35 #include <assert.h> 31 36 -
libs/libavformat/libavformat.pro
15 15 16 16 cygwin :LIBS += -lz 17 17 18 mingw: target.path = $${PREFIX}/bin 19 18 20 QMAKE_CLEAN += $(TARGET) $(TARGETA) $(TARGETD) $(TARGET0) $(TARGET1) $(TARGET2) 19 21 20 22 # Input … … 197 199 # SOURCES += audio-darwin.c 198 200 } 199 201 202 mingw:SOURCES -= audio.c -
libs/libmythui/mythpainter_qt.cpp
4 4 #include "mythpainter_qt.h" 5 5 #include "mythfontproperties.h" 6 6 #include "mythmainwindow.h" 7 #include "compat.h" 7 8 8 9 class MythQtImage : public MythImage 9 10 { -
libs/libmythui/mythmainwindow.cpp
611 611 /* FIXME compatability only */ 612 612 void MythMainWindow::attach(QWidget *child) 613 613 { 614 #ifdef USING_MINGW 615 #warning TODO FIXME MythMainWindow::attach() not implemented on MS Windows! 616 // if windows are created on different threads, 617 // or if setFocus() is called from a thread other than the main UI thread, 618 // setFocus() hangs the thread that called it 619 // currently, it's impossible to switch to program guide from livetv 620 VERBOSE(VB_IMPORTANT, 621 QString("MythMainWindow::attach old: %1, new: %2, thread: %3") 622 .arg(currentWidget() ? currentWidget()->name() : "none") 623 .arg(child->name()) 624 .arg(::GetCurrentThreadId())); 625 #endif 614 626 if (currentWidget()) 615 627 currentWidget()->setEnabled(false); 616 628 … … 1506 1518 float floatSize = pointSize; 1507 1519 float desired = 100.0; 1508 1520 1521 #ifdef USING_MINGW 1522 #warning TODO FIXME DPI needs to be calculated on MS Windows systems.. 1523 int logicalDpiY = 100; 1524 #else 1525 int logicalDpiY = pdm.logicalDpiY(); 1526 #endif 1527 1509 1528 // adjust for screen resolution relative to 100 dpi 1510 floatSize = floatSize * desired / pdm.logicalDpiY();1529 floatSize = floatSize * desired / logicalDpiY; 1511 1530 // adjust for myth GUI size relative to 800x600 1512 1531 floatSize = floatSize * d->hmult; 1513 1532 // adjust by the configurable fine tuning percentage … … 1518 1537 return pointSize; 1519 1538 } 1520 1539 1521 QFont MythMainWindow::Create Font(const QString &face, int pointSize,1522 int weight, bool italic)1540 QFont MythMainWindow::CreateQFont(const QString &face, int pointSize, 1541 int weight, bool italic) 1523 1542 { 1524 1543 QFont font = QFont(face); 1525 1544 if (!font.exactMatch()) -
libs/libmythui/mythuitype.cpp
471 471 (*it)->AddFocusableChildrenToList(focusList); 472 472 } 473 473 474 QFont MythUIType::Create Font(const QString &face, int pointSize,475 int weight, bool italic)474 QFont MythUIType::CreateQFont(const QString &face, int pointSize, 475 int weight, bool italic) 476 476 { 477 return GetMythMainWindow()->Create Font(face, pointSize, weight, italic);477 return GetMythMainWindow()->CreateQFont(face, pointSize, weight, italic); 478 478 } 479 479 480 480 QRect MythUIType::NormRect(const QRect &rect) -
libs/libmythui/mythuitext.cpp
6 6 #include "mythfontproperties.h" 7 7 8 8 #include "mythcontext.h" 9 #include "compat.h" 9 10 10 11 MythUIText::MythUIText(MythUIType *parent, const char *name) 11 12 : MythUIType(parent, name) -
libs/libmythui/myththemedmenu.cpp
687 687 } 688 688 } 689 689 690 QFont font = GetMythMainWindow()->Create Font(fontname, fontsize,691 690 QFont font = GetMythMainWindow()->CreateQFont( 691 fontname, fontsize, weight, italic); 692 692 693 693 attributes.font.SetFace(font); 694 694 -
libs/libmythui/mythpainter.h
7 7 8 8 // #include "mythfontproperties.h" 9 9 10 #include "compat.h" 10 11 11 12 class MythFontProperties; 12 13 class MythImage; -
libs/libmythui/mythpainter_qt.h
3 3 4 4 #include "mythpainter.h" 5 5 #include "mythimage.h" 6 #include "compat.h" 6 7 7 8 class QPainter; 8 9 class QPixmap; -
libs/libmythui/mythmainwindow.h
105 105 QRect GetUIScreenRect(); 106 106 107 107 int NormalizeFontSize(int pointSize); 108 QFont Create Font(const QString &face, int pointSize = 12,109 int weight = QFont::Normal, bool italic = FALSE);108 QFont CreateQFont(const QString &face, int pointSize = 12, 109 int weight = QFont::Normal, bool italic = FALSE); 110 110 QRect NormRect(const QRect &rect); 111 111 QPoint NormPoint(const QPoint &point); 112 112 QSize NormSize(const QSize &size); -
libs/libmythui/libmythui.pro
72 72 } 73 73 74 74 cygwin:DEFINES += _WIN32 75 76 mingw { 77 DEFINES += USING_MINGW 78 target.path = $${PREFIX}/bin 79 using_opengl { 80 LIBS += -lopengl32 81 DEFINES += USE_OPENGL_PAINTER 82 SOURCES += mythpainter_ogl.cpp 83 HEADERS += mythpainter_ogl.h 84 inc.files += mythpainter_ogl.h 85 } 86 } -
libs/libmythui/mythuitype.h
109 109 110 110 int CalcAlpha(int alphamod); 111 111 112 QFont Create Font(const QString &face, int pointSize = 12,113 int weight = QFont::Normal, bool italic = FALSE);112 QFont CreateQFont(const QString &face, int pointSize = 12, 113 int weight = QFont::Normal, bool italic = FALSE); 114 114 QRect NormRect(const QRect &rect); 115 115 QPoint NormPoint(const QPoint &point); 116 116 int NormX(const int width); -
libs/libmyth/lcddevice.cpp
7 7 (c) 2002, 2003 Thor Sigvaldason, Dan Morphis and Isaac Richards 8 8 */ 9 9 10 #include "lcddevice.h" 11 #include "mythcontext.h"12 #include "mythdialogs.h"10 // ANSI C headers 11 #include <cstdlib> 12 #include <cmath> 13 13 14 #include "libmythui/mythmainwindow.h" 15 14 // POSIX headers 16 15 #include <unistd.h> 17 #ifndef USING_MINGW18 #include <stdlib.h>19 #include <sys/wait.h> // For WIFEXITED on Mac OS X20 #else21 #include "compat.h"22 #endif23 #include <cmath>24 16 17 // Qt headers 25 18 #include <qapplication.h> 26 19 #include <qregexp.h> 27 20 21 // MythTV headers 22 #include "libmythui/mythmainwindow.h" 23 #include "lcddevice.h" 24 #include "mythcontext.h" 25 #include "mythdialogs.h" 26 #include "compat.h" 28 27 29 28 /* 30 29 LCD_DEVICE_DEBUG control how much debug info we get -
libs/libmyth/util.cpp
9 9 #include <fcntl.h> 10 10 11 11 // System specific C headers 12 #include "compat.h" 12 13 #ifdef USING_MINGW 13 14 # include <sys/types.h> 14 15 # include <sys/stat.h> 15 16 # include <sys/param.h> 16 # include "compat.h"17 17 #else 18 18 # include <sys/types.h> 19 19 # include <sys/wait.h> … … 857 857 QString createTempFile(QString name_template, bool dir) 858 858 { 859 859 #ifdef USING_MINGW 860 #warning Implement createTempFile 861 return ""; 860 char *tmp = new char[MAX_PATH+1]; 861 QFileInfo fi(name_template); 862 ::GetTempFileNameA(fi.filePath(), fi.baseName(), 0, tmp); 863 return QString(tmp); 862 864 #else 863 865 const char *tmp = name_template.ascii(); 864 866 char *ctemplate = strdup(tmp); … … 898 900 #endif // USING_X11 899 901 return pixelAspect; 900 902 } 903 904 unsigned long long myth_get_approximate_large_file_size(const QString &fname) 905 { 906 // .local8Bit() not thread-safe.. even with Qt4, make a deep copy first.. 907 QString filename = QDeepCopy<QString>(fname); 908 #ifdef USING_MINGW 909 struct _stati64 status; 910 _stati64(filename.local8Bit(), &status); 911 return status.st_size; 912 #else 913 struct stat status; 914 stat(filename.local8Bit(), &status); 915 // Using off_t requires a lot of 32/64 bit checking. 916 // So just get the size in blocks. 917 unsigned long long bsize = status.st_blksize; 918 unsigned long long nblk = status.st_blocks; 919 unsigned long long approx_size = nblk * bsize; 920 return approx_size; 921 #endif 922 } -
libs/libmyth/compat.h
13 13 #ifdef _WIN32 14 14 #define close wsock_close 15 15 #include <windows.h> 16 #include <winsock2.h> 17 #include <ws2tcpip.h> 18 #define setsockopt(a, b, c, d, e) setsockopt(a, b, c, (const char*)(d), e) 16 19 #undef close 20 #else 21 #include <sys/resource.h> // for setpriority 22 #include <sys/socket.h> 23 #include <sys/wait.h> // For WIFEXITED on Mac OS X 17 24 #endif 18 25 19 26 #ifdef _WIN32 … … 22 29 23 30 #ifdef _WIN32 24 31 #undef DialogBox 32 #undef DrawText 25 33 #endif 26 34 27 35 // Dealing with Microsoft min/max mess: … … 54 62 #endif 55 63 56 64 #ifdef USING_MINGW 57 #define gmtime_r(x, y) gmtime((x)) 58 #define localtime_r(x, y) localtime((x)) 65 #define gmtime_r(X, Y) (memcpy(Y, gmtime(X), sizeof(struct tm)), Y) 66 #define localtime_r(X, Y) (memcpy(Y, localtime(X), sizeof(struct tm)), Y) 67 #define lseek(X,Y,Z) lseek64(X,Y,Z) 68 #define fsync(FD) 0 69 #define signal(X,Y) 0 59 70 //used in videodevice only - that code is not windows-compatible anyway 60 #define minor( x) 071 #define minor(X) 0 61 72 #endif 62 73 63 74 #if defined(__cplusplus) && defined(USING_MINGW) … … 69 80 #endif // USING_MINGW 70 81 71 82 #if defined(__cplusplus) && defined(USING_MINGW) 83 #define setenv(x, y, z) ::SetEnvironmentVariableA(x, y) 84 #define unsetenv(x) 0 85 #endif 86 87 #if defined(__cplusplus) && defined(USING_MINGW) 72 88 #include <pthread.h> 73 89 inline bool operator==(const pthread_t& pt, const int n) 74 90 { -
libs/libmyth/util.h
77 77 MPUBLIC long long copy(QFile &dst, QFile &src, uint block_size = 0); 78 78 MPUBLIC QString createTempFile(QString name_template = "/tmp/mythtv_XXXXXX", 79 79 bool dir = false); 80 MPUBLIC unsigned long long myth_get_approximate_large_file_size( 81 const QString &fname); 80 82 81 83 MPUBLIC double MythGetPixelAspectRatio(void); 82 84 -
libs/libmythfreemheg/libmythfreemheg.pro
24 24 25 25 LIBS += $$EXTRA_LIBS 26 26 27 mingw { 28 DEFINES += USING_MINGW 29 target.path = $${PREFIX}/bin 30 } -
libs/libmythupnp/upnptasknotify.cpp
8 8 // 9 9 ////////////////////////////////////////////////////////////////////////////// 10 10 11 #include "upnp.h" 12 #include "multicast.h" 13 #include "broadcast.h" 11 // ANSI C headers 12 #include <cstdlib> 14 13 14 // POSIX headers 15 15 #include <unistd.h> 16 #include <stdlib.h> 16 #include <sys/time.h> 17 18 // Qt headers 17 19 #include <qstringlist.h> 18 20 #include <quuid.h> 19 21 #include <qdom.h> 20 22 #include <qfile.h> 21 #include <sys/time.h>22 23 24 // MythTV headers 25 #include "upnp.h" 26 #include "multicast.h" 27 #include "broadcast.h" 28 #include "compat.h" 23 29 24 30 ///////////////////////////////////////////////////////////////////////////// 25 31 ///////////////////////////////////////////////////////////////////////////// -
libs/libmythupnp/httpserver.cpp
9 9 // 10 10 ////////////////////////////////////////////////////////////////////////////// 11 11 12 // ANSI C headers 13 #include <cmath> 14 15 // POSIX headers 12 16 #include <unistd.h> 17 #include <sys/time.h> 18 #ifndef USING_MINGW 19 #include <sys/utsname.h> 20 #endif 13 21 22 // Qt headers 14 23 #include <qregexp.h> 15 24 #include <qstringlist.h> 16 25 #include <qtextstream.h> 17 26 #include <qdatetime.h> 18 #include <math.h>19 #include <sys/time.h>20 27 21 #include <sys/utsname.h> 22 28 // MythTV headers 23 29 #include "httpserver.h" 24 30 #include "upnputil.h" 31 #include "upnp.h" // only needed for Config... remove once config is moved. 32 #include "compat.h" 25 33 26 #include "upnp.h" // only needed for Config... remove once config is moved.27 28 34 ///////////////////////////////////////////////////////////////////////////// 29 35 ///////////////////////////////////////////////////////////////////////////// 30 36 // … … 51 57 // Build Platform String 52 58 // ---------------------------------------------------------------------- 53 59 60 #ifdef USING_MINGW 61 g_sPlatform = QString( "Windows %1.%1" ) 62 .arg(LOBYTE(LOWORD(GetVersion()))) 63 .arg(HIBYTE(LOWORD(GetVersion()))); 64 #else 54 65 struct utsname uname_info; 55 66 56 67 uname( &uname_info ); 57 68 58 69 g_sPlatform = QString( "%1 %2" ).arg( uname_info.sysname ) 59 70 .arg( uname_info.release ); 71 #endif 60 72 61 73 // -=>TODO: Load Config XML 62 74 // -=>TODO: Load & initialize - HttpServerExtensions -
libs/libmythupnp/multicast.h
11 11 #ifndef __MULTICAST_H__ 12 12 #define __MULTICAST_H__ 13 13 14 // Qt headers 14 15 #include <qsocketdevice.h> 15 16 17 // MythTV headers 18 #include "compat.h" 19 16 20 ///////////////////////////////////////////////////////////////////////////// 17 21 ///////////////////////////////////////////////////////////////////////////// 18 22 // -
libs/libmythupnp/upnputil.cpp
8 8 // 9 9 ////////////////////////////////////////////////////////////////////////////// 10 10 11 #include "mythconfig.h" 12 #include "upnputil.h"13 #include "upnp.h"11 // POSIX headers 12 #include <sys/types.h> 13 #include <sys/time.h> 14 14 15 #include <quuid.h> 16 #include <sys/types.h> 17 #include <sys/socket.h> 18 #include <sys/ioctl.h> 15 #ifndef USING_MINGW 19 16 #include <net/if.h> 20 #include <netinet/in.h> 21 #include <arpa/inet.h> 22 #include <sys/utsname.h> 23 #include <sys/time.h> 17 #endif // USING_MINGW 18 19 #include "mythconfig.h" // for HAVE_GETIFADDRS 24 20 #ifdef HAVE_GETIFADDRS 25 21 #include <ifaddrs.h> 26 22 #endif 27 23 24 // Qt headers 25 #include <quuid.h> 26 27 // MythTV headers 28 #include "upnputil.h" 29 #include "upnp.h" 30 #include "compat.h" 31 28 32 ///////////////////////////////////////////////////////////////////////////// 29 33 // 30 34 ///////////////////////////////////////////////////////////////////////////// … … 117 121 118 122 long GetIPAddressList( QStringList &sStrList ) 119 123 { 124 #ifdef USING_MINGW 125 VERBOSE(VB_UPNP, QString("GetIPAddressList() not implemented in MinGW")); 126 return 0; 127 #else 128 120 129 sStrList.clear(); 121 130 122 131 QSocketDevice socket( QSocketDevice::Datagram ); … … 179 188 } 180 189 181 190 return( sStrList.count() ); 191 #endif // !USING_MINGW 182 192 } 183 193 184 194 #endif // HAVE_GETIFADDRS -
libs/libmythupnp/bufferedsocketdevice.h
11 11 #ifndef __BUFFEREDSOCKETDEVICE_H__ 12 12 #define __BUFFEREDSOCKETDEVICE_H__ 13 13 14 // Qt headers 14 15 #include <qsocketdevice.h> 15 #include <sys/socket.h>16 16 17 // MythTV headers 17 18 #include "private/qinternal_p.h" 19 #include "compat.h" 18 20 19 21 ///////////////////////////////////////////////////////////////////////////// 20 22 ///////////////////////////////////////////////////////////////////////////// -
libs/libmythupnp/httprequest.cpp
18 18 #include <qfileinfo.h> 19 19 20 20 #include "mythconfig.h" 21 #if defined CONFIG_DARWIN || defined CONFIG_CYGWIN || defined(__FreeBSD__) 21 #if defined CONFIG_DARWIN || defined CONFIG_CYGWIN || defined(__FreeBSD__) || defined(USING_MINGW) 22 22 #include "darwin-sendfile.h" 23 23 #else 24 24 #define USE_SETSOCKOPT 25 25 #include <sys/sendfile.h> 26 26 #endif 27 #include <sys/socket.h>28 27 #include <sys/types.h> 29 28 #include <sys/stat.h> 30 #include <netinet/tcp.h>31 29 #include <unistd.h> 32 30 #include <stdlib.h> 33 31 #include <fcntl.h> 34 32 33 #ifndef USING_MINGW 34 #include <netinet/tcp.h> 35 #endif 36 35 37 #include "util.h" 36 38 #include "mythcontext.h" // for VERBOSE 37 39 #include "upnp.h" 40 #include "compat.h" 38 41 39 42 #ifndef O_LARGEFILE 40 43 #define O_LARGEFILE 0 -
libs/libmythupnp/libmythupnp.pro
40 40 41 41 TARGETDEPS += ../libmyth/libmyth-$${MYTH_SHLIB_EXT} 42 42 43 mingw { 44 DEFINES += USING_MINGW 45 HEADERS += darwin-sendfile.h 46 SOURCES += darwin-sendfile.c 47 target.path = $${PREFIX}/bin 48 } 49 43 50 inc.path = $${PREFIX}/include/mythtv/upnp/ 44 51 45 52 inc.files = httprequest.h upnp.h ssdp.h taskqueue.h bufferedsocketdevice.h -
libs/libmythupnp/upnptasksearch.h
11 11 #ifndef __UPNPTASKSEARCH_H__ 12 12 #define __UPNPTASKSEARCH_H__ 13 13 14 #include <qsocketdevice.h> 15 14 // POSIX headers 16 15 #include <sys/types.h> 17 #i nclude <sys/socket.h>16 #ifndef USING_MINGW 18 17 #include <netinet/in.h> 19 18 #include <arpa/inet.h> 19 #endif 20 20 21 // Qt headers 22 #include <qsocketdevice.h> 23 24 // MythTV headers 21 25 #include "upnp.h" 26 #include "compat.h" 22 27 23 28 ///////////////////////////////////////////////////////////////////////////// 24 29 ///////////////////////////////////////////////////////////////////////////// -
libs/libmythupnp/upnptasknotify.h
11 11 #ifndef __UPNPTASKNOTIFY_H__ 12 12 #define __UPNPTASKNOTIFY_H__ 13 13 14 #include <qsocketdevice.h> 15 14 // POSIX headers 16 15 #include <sys/types.h> 17 #i nclude <sys/socket.h>16 #ifdef USING_MINGW 18 17 #include <netinet/in.h> 19 18 #include <arpa/inet.h> 19 #endif 20 20 21 // Qt headers 22 #include <qsocketdevice.h> 23 24 // MythTV headers 21 25 #include "upnp.h" 22 26 #include "multicast.h" 27 #include "compat.h" 23 28 24 29 ///////////////////////////////////////////////////////////////////////////// 25 30 // Typedefs -
libs/libmythupnp/httpserver.h
12 12 #ifndef __HTTPSERVER_H__ 13 13 #define __HTTPSERVER_H__ 14 14 15 // POSIX headers 16 #include <sys/types.h> 17 #ifdef USING_MINGW 18 #include <netinet/in.h> 19 #include <arpa/inet.h> 20 #endif 21 22 // Qt headers 15 23 #include <qthread.h> 16 24 #include <qserversocket.h> 17 25 #include <qsocketdevice.h> … … 21 29 #include <qtimer.h> 22 30 #include <qptrlist.h> 23 31 24 #include <sys/types.h> 25 #include <sys/socket.h> 26 #include <netinet/in.h> 27 #include <arpa/inet.h> 28 32 // MythTV headers 29 33 #include "upnputil.h" 30 34 #include "httprequest.h" 31 35 #include "threadpool.h" 32 36 #include "refcounted.h" 37 #include "compat.h" 33 38 34 35 39 typedef struct timeval TaskTime; 36 40 37 41 class HttpWorkerThread; -
libs/libmythupnp/taskqueue.h
11 11 #ifndef __TASKQUEUE_H__ 12 12 #define __TASKQUEUE_H__ 13 13 14 #include <qthread.h> 15 #include <qsocketdevice.h> 16 14 // POSIX headers 17 15 #include <sys/types.h> 16 #ifndef USING_MINGW 18 17 #include <sys/socket.h> 19 18 #include <netinet/in.h> 20 19 #include <arpa/inet.h> 20 #endif // USING_MINGW 21 22 // C++ headers 21 23 #include <map> 22 24 25 // Qt headers 26 #include <qthread.h> 27 #include <qsocketdevice.h> 28 29 // MythTV headers 23 30 #include "upnputil.h" 24 31 #include "refcounted.h" 25 32 -
libs/libmythupnp/upnptasksearch.cpp
10 10 11 11 #include "upnp.h" 12 12 #include "upnptasksearch.h" 13 #include "compat.h" 13 14 14 15 #include <unistd.h> 15 16 #include <stdlib.h> -
libs/libmythdvdnav/decoder.h
26 26 #define DECODER_H_INCLUDED 27 27 28 28 #include <inttypes.h> 29 30 #ifndef USING_MINGW 29 31 #include <sys/time.h> 32 #endif 30 33 31 34 #include "ifo_types.h" /* vm_cmd_t */ 32 35 #include "dvdnav_internal.h" -
libs/libmythdvdnav/dvdnav_internal.h
24 24 #ifndef DVDNAV_INTERNAL_H_INCLUDED 25 25 #define DVDNAV_INTERNAL_H_INCLUDED 26 26 27 #include "config.h"28 29 27 #include <stdlib.h> 30 28 #include <stdio.h> 31 29 #include <unistd.h> 32 30 #include <limits.h> 33 31 #include <string.h> 34 32 33 // MythTV headers 34 #include "mythconfig.h" 35 #include "compat.h" 36 35 37 #ifdef WIN32 36 38 37 39 /* pthread_mutex_* wrapper for win32 */ -
libs/libmythdvdnav/libmythdvdnav.pro
6 6 CONFIG += thread staticlib warn_off 7 7 target.path = $${LIBDIR} 8 8 9 INCLUDEPATH += ../ ../../ 9 INCLUDEPATH += ../ ../../ ../libmyth 10 10 11 11 #build position independent code since the library is linked into a shared library 12 12 QMAKE_CFLAGS += -fPIC -DPIC … … 36 36 # Globals in static libraries need special treatment on OS X 37 37 QMAKE_CFLAGS += -fno-common 38 38 } 39 40 mingw:DEFINES += STDC_HEADERS -
libs/libmythdvdnav/dvd_input.c
48 48 #else 49 49 50 50 /* dlopening libdvdcss */ 51 #include "compat.h" 52 #ifndef USING_MINGW 51 53 #include <dlfcn.h> 54 #endif 52 55 53 56 typedef struct dvdcss_s *dvdcss_handle; 54 57 static dvdcss_handle (*DVDcss_open) (const char *); … … 288 291 #ifdef CONFIG_DARWIN 289 292 dvdcss_library = dlopen("libdvdcss.2.dylib", RTLD_LAZY); 290 293 #endif 291 #ifdef WIN32294 #ifdef _WIN32 292 295 dvdcss_library = dlopen("libdvdcss.dll", RTLD_LAZY); 293 296 #endif 294 297 -
libs/libmythdvdnav/read_cache.c
29 29 30 30 #include "config.h" 31 31 32 #include "dvdnav_internal.h" 32 33 #include "dvdnav.h" 33 #include "dvdnav_internal.h"34 34 #include "read_cache.h" 35 36 #include <time.h> 37 #ifndef _WIN32 35 38 #include <sys/time.h> 36 # include <time.h>39 #endif 37 40 38 41 #define READ_CACHE_CHUNKS 10 39 42 -
libs/libmythdvdnav/dvdnav.c
33 33 34 34 #include <stdlib.h> 35 35 #include <stdio.h> 36 37 // POSIX headers 38 #ifndef _WIN32 36 39 #include <sys/time.h> 40 #endif 37 41 38 42 #include "remap.h" 39 43 -
programs/mythuitest/btnlisttest.cpp
46 46 vbuttons = new MythListButton(this, "vlist", r, true, true); 47 47 48 48 MythFontProperties fontProp; 49 fontProp.SetFace(Create Font("Arial", 24, QFont::Bold));49 fontProp.SetFace(CreateQFont("Arial", 24, QFont::Bold)); 50 50 fontProp.SetColor(QColor(Qt::white)); 51 51 fontProp.SetShadow(true, NormPoint(QPoint(4, 4)), QColor(Qt::black), 64); 52 52 … … 71 71 hbuttons = new MythHorizListButton(this,"hlist",r,true,true, 3); 72 72 73 73 MythFontProperties fontProp; 74 fontProp.SetFace(Create Font("Arial", 24, QFont::Bold));74 fontProp.SetFace(CreateQFont("Arial", 24, QFont::Bold)); 75 75 fontProp.SetColor(QColor(Qt::white)); 76 76 fontProp.SetShadow(true, NormPoint(QPoint(4, 4)), QColor(Qt::black), 64); 77 77 -
programs/mythuitest/test1.cpp
15 15 : MythScreenType(parent, name) 16 16 { 17 17 MythFontProperties fontProp1; 18 fontProp1.SetFace(Create Font("Arial", 48, QFont::Bold));18 fontProp1.SetFace(CreateQFont("Arial", 48, QFont::Bold)); 19 19 fontProp1.SetColor(QColor(Qt::white)); 20 20 fontProp1.SetShadow(true, NormPoint(QPoint(4, 4)), QColor(Qt::black), 64); 21 21 … … 25 25 main->SetJustification(Qt::AlignCenter); 26 26 27 27 MythFontProperties fontProp; 28 fontProp.SetFace(Create Font("Arial", 14));28 fontProp.SetFace(CreateQFont("Arial", 14)); 29 29 fontProp.SetColor(QColor(Qt::white)); 30 30 fontProp.SetShadow(true, NormPoint(QPoint(1, 1)), QColor(Qt::black), 64); 31 31 … … 280 280 image->SetPosition(NormPoint(QPoint(30, 30))); 281 281 image->Load(); 282 282 283 QFont fontFace = Create Font("Arial", 28, QFont::Bold);283 QFont fontFace = CreateQFont("Arial", 28, QFont::Bold); 284 284 285 285 MythFontProperties fontProp; 286 286 fontProp.SetFace(fontFace); -
programs/programs-libs.pro
16 16 LIBS += -lmythupnp-$$LIBVERSION 17 17 LIBS += -lmythlivemedia-$$LIBVERSION 18 18 LIBS += -lmyth-$$LIBVERSION -lmythui-$$LIBVERSION $$EXTRA_LIBS 19 mingw { 20 LIBS += -lpthread 21 CONFIG += console 22 } 19 23 20 24 TARGETDEPS += ../../libs/libmythui/libmythui-$${MYTH_SHLIB_EXT} 21 25 TARGETDEPS += ../../libs/libmyth/libmyth-$${MYTH_SHLIB_EXT} … … 24 28 TARGETDEPS += ../../libs/libavcodec/libmythavcodec-$${MYTH_SHLIB_EXT} 25 29 TARGETDEPS += ../../libs/libavformat/libmythavformat-$${MYTH_SHLIB_EXT} 26 30 TARGETDEPS += ../../libs/libmythupnp/libmythupnp-$${MYTH_SHLIB_EXT} 27 TARGETDEPS += ../../libs/libmythlivemedia/libmythlivemedia-$${MYTH_SHLIB_EXT}31 using_live: TARGETDEPS += ../../libs/libmythlivemedia/libmythlivemedia-$${MYTH_SHLIB_EXT} 28 32 29 33 DEPENDPATH += ../.. ../../libs ../../libs/libmyth ../../libs/libmythtv 30 34 DEPENDPATH += ../../libs/libavutil ../../libs/libavformat ../../libs/libsavcodec -
programs/mythfrontend/channelrecpriority.cpp
665 665 if (curitem->iconpath == "none" || curitem->iconpath == "") 666 666 curitem->iconpath = "blankicon.jpg"; 667 667 if (!curitem->iconload) 668 curitem->Load Icon(iconwidth, iconheight);668 curitem->LoadChannelIcon(iconwidth, iconheight); 669 669 if (curitem->iconload) 670 670 itype->SetImage(curitem->icon); 671 671 } -
programs/mythfrontend/mediarenderer.cpp
9 9 ///////////////////////////////////////////////////////////////////////////// 10 10 11 11 #include "mediarenderer.h" 12 #include "compat.h" 12 13 13 14 ///////////////////////////////////////////////////////////////////////////// 14 15 ///////////////////////////////////////////////////////////////////////////// -
programs/mythfrontend/globalsettings.cpp
3 3 // Standard UNIX C headers 4 4 #include <unistd.h> 5 5 #include <fcntl.h> 6 #include <sys/ioctl.h>7 6 #include <sys/types.h> 8 7 #include <sys/stat.h> 9 8 … … 68 67 #ifdef USING_COREAUDIO 69 68 gc->addSelection("CoreAudio:", "CoreAudio:"); 70 69 #endif 70 #ifdef USING_DIRECTX 71 gc->addSelection("DirectX:"); 72 #endif 73 #ifdef USING_MINGW 74 gc->addSelection("Windows:"); 75 #endif 71 76 gc->addSelection("NULL", "NULL"); 72 77 73 78 return gc; … … 79 84 80 85 gc->setLabel(QObject::tr("Passthrough output device")); 81 86 gc->addSelection(QObject::tr("Default"), "Default"); 87 #ifndef USING_MINGW 82 88 gc->addSelection("ALSA:iec958:{ AES0 0x02 }", "ALSA:iec958:{ AES0 0x02 }"); 89 #endif 83 90 84 91 gc->setHelpText(QObject::tr("Audio output device to use for AC3 and " 85 92 "DTS passthrough. Default is the same as Audio output " … … 117 124 #ifdef USING_ALSA 118 125 gc->addSelection("ALSA:default", "ALSA:default"); 119 126 #endif 127 #ifdef USING_DIRECTX 128 gc->addSelection("DirectX:", "DirectX:"); 129 #endif 130 #ifdef USING_WINAUDIO 131 gc->addSelection("Windows:", "Windows:"); 132 #endif 120 133 121 134 return gc; 122 135 } … … 4637 4650 4638 4651 theme->addChild(new ThemeSelector("Theme")); 4639 4652 4640 HorizontalConfigurationGroup * grp1 =4653 HorizontalConfigurationGroup *hgrp1 = 4641 4654 new HorizontalConfigurationGroup(false, false, false, false); 4642 grp1->addChild(RandomTheme());4643 grp1->addChild(ThemeCacheSize());4644 theme->addChild( grp1);4655 hgrp1->addChild(RandomTheme()); 4656 hgrp1->addChild(ThemeCacheSize()); 4657 theme->addChild(hgrp1); 4645 4658 4646 4659 theme->addChild(ThemePainter()); 4647 4660 theme->addChild(new StyleSetting()); -
programs/mythfrontend/networkcontrol.cpp
14 14 #include "programinfo.h" 15 15 #include "remoteutil.h" 16 16 #include "previewgenerator.h" 17 #include "compat.h" 17 18 18 19 #define LOC QString("NetworkControl: ") 19 20 #define LOC_ERR QString("NetworkControl Error: ") -
programs/mythtranscode/replex/replex.c
42 42 #include "avcodec.h" 43 43 #include "avformat.h" 44 44 45 #ifdef USING_MINGW 46 # define S_IRGRP 0 47 # define S_IWGRP 0 48 # define S_IROTH 0 49 # define S_IWOTH 0 50 #endif 51 45 52 #ifndef O_LARGEFILE 46 53 #define O_LARGEFILE 0 47 54 #endif -
programs/mythtranscode/replex/ts.c
28 28 #include <stdint.h> 29 29 #include <string.h> 30 30 #include <stdio.h> 31 32 #ifdef USING_MINGW 33 #include <winsock2.h> 34 #else 31 35 #include <netinet/in.h> 36 #endif 32 37 33 38 #include "ts.h" 34 39 #include "element.h" -
programs/mythtranscode/replex/pes.c
26 26 27 27 #include <stdlib.h> 28 28 #include <stdio.h> 29 #include <netinet/in.h>30 29 #include <string.h> 31 30 31 #ifdef USING_MINGW 32 #include <winsock2.h> 33 #else 34 #include <netinet/in.h> 35 #endif 36 32 37 #include "pes.h" 33 38 void printpts(int64_t pts) 34 39 { -
programs/mythtranscode/mpeg2fix.cpp
11 11 #include <sys/stat.h> 12 12 #include <fcntl.h> 13 13 #include <unistd.h> 14 #include <netinet/in.h>15 14 #include <getopt.h> 16 15 #include <stdint.h> 17 16 17 #ifdef USING_MINGW 18 #include <winsock2.h> 19 #else 20 #include <netinet/in.h> 21 #endif 22 18 23 #ifndef O_LARGEFILE 19 24 #define O_LARGEFILE 0 20 25 #endif -
programs/mythcommflag/BorderDetector.cpp
4 4 #include "avcodec.h" /* AVPicture */ 5 5 } 6 6 #include "mythcontext.h" /* gContext */ 7 #include "compat.h" 7 8 8 9 #include "CommDetector2.h" 9 10 #include "FrameAnalyzer.h" -
programs/mythcommflag/CommDetector2.cpp
4 4 #include <unistd.h> 5 5 6 6 #include "NuppelVideoPlayer.h" 7 #include "compat.h" 7 8 8 9 #include "CommDetector.h" 9 10 #include "CommDetector2.h" -
programs/mythtv-setup/main.cpp
12 12 #include <cstdio> 13 13 #include <fcntl.h> 14 14 #include <cstdlib> 15 #include <sys/ioctl.h>16 15 #include <sys/types.h> 17 16 18 17 #include <iostream> -
programs/mythbackend/main.cpp
1 1 // POSIX headers 2 2 #include <sys/time.h> // for setpriority 3 #include <sys/resource.h> // for setpriority4 3 5 4 #include <qapplication.h> 6 5 #include <qsqldatabase.h> … … 36 35 #include "libmyth/mythcontext.h" 37 36 #include "libmyth/mythdbcon.h" 38 37 #include "libmyth/exitcodes.h" 38 #include "libmyth/compat.h" 39 39 #include "libmythtv/programinfo.h" 40 40 #include "libmythtv/dbcheck.h" 41 41 #include "libmythtv/jobqueue.h" … … 368 368 369 369 int main(int argc, char **argv) 370 370 { 371 for(int i = 3; i < sysconf(_SC_OPEN_MAX) - 1; ++i) 371 #ifdef USING_MINGW 372 #warning TODO FIXME plugins leave open file descriptors on MS Windows 373 #else 374 for (int i = 3; i < sysconf(_SC_OPEN_MAX) - 1; ++i) 372 375 close(i); 376 #endif 373 377 374 378 QApplication a(argc, argv, false); 375 379 -
programs/mythbackend/mainserver.cpp
19 19 #elif HAVE_SOUNDCARD_H 20 20 #include <soundcard.h> 21 21 #endif 22 #ifndef USING_MINGW 22 23 #include <sys/ioctl.h> 24 #endif 23 25 24 26 #include <list> 25 27 #include <iostream> 26 28 using namespace std; 27 29 28 30 #include <sys/stat.h> 29 #ifdef linux 30 #include <sys/vfs.h> 31 #else 32 #include <sys/param.h> 33 #include <sys/mount.h> 34 #endif 31 #ifdef __linux__ 32 # include <sys/vfs.h> 33 #else // if !__linux__ 34 # include <sys/param.h> 35 # ifndef USING_MINGW 36 # include <sys/mount.h> 37 # endif // USING_MINGW 38 #endif // !__linux__ 35 39 36 40 #include "libmyth/exitcodes.h" 37 41 #include "libmyth/mythcontext.h" … … 46 50 #include "autoexpire.h" 47 51 #include "previewgenerator.h" 48 52 #include "storagegroup.h" 53 #include "compat.h" 49 54 50 55 /** Milliseconds to wait for an existing thread from 51 56 * process request thread pool. -
programs/mythbackend/scheduler.cpp
9 9 #include <algorithm> 10 10 using namespace std; 11 11 12 #ifdef linux 13 #include <sys/vfs.h> 14 #else 15 #include <sys/param.h> 16 #include <sys/mount.h> 17 #include <sys/resource.h> 18 #endif 12 #ifdef __linux__ 13 # include <sys/vfs.h> 14 #else // if !__linux__ 15 # include <sys/param.h> 16 # ifndef USING_MINGW 17 # include <sys/mount.h> 18 # endif // USING_MINGW 19 #endif // !__linux__ 19 20 20 21 #include <sys/stat.h> 21 22 #include <sys/time.h> 22 23 #include <sys/types.h> 23 #include <sys/wait.h>24 24 25 25 #include "scheduler.h" 26 26 #include "encoderlink.h" … … 31 31 #include "libmyth/exitcodes.h" 32 32 #include "libmyth/mythcontext.h" 33 33 #include "libmyth/mythdbcon.h" 34 #include "libmyth/compat.h" 34 35 #include "libmythtv/programinfo.h" 35 36 #include "libmythtv/scheduledrecording.h" 36 37 #include "libmythtv/storagegroup.h" -
programs/mythbackend/housekeeper.cpp
1 1 #include <unistd.h> 2 2 #include <sys/types.h> 3 #include <sys/wait.h>4 3 #include <unistd.h> 5 4 #include <qsqldatabase.h> 6 5 #include <qsqlquery.h> … … 19 18 #include "libmyth/mythcontext.h" 20 19 #include "libmyth/mythdbcon.h" 21 20 #include "libmyth/util.h" 21 #include "libmyth/compat.h" 22 22 23 23 #include "programinfo.h" 24 24 -
programs/mythbackend/httpstatus.cpp
15 15 #include "libmyth/mythcontext.h" 16 16 #include "libmyth/util.h" 17 17 #include "libmyth/mythdbcon.h" 18 #include "libmyth/compat.h" 18 19 19 20 #include <qtextstream.h> 20 21 #include <qdir.h> -
programs/mythbackend/backendutil.cpp
18 18 #include "libmyth/mythcontext.h" 19 19 #include "libmyth/mythdbcon.h" 20 20 #include "libmyth/util.h" 21 #include "libmyth/compat.h" 21 22 22 23 static QMap<int, int> fsID_cache; 23 24 static QMutex cache_lock; -
programs/mythbackend/autoexpire.cpp
15 15 using namespace std; 16 16 17 17 #include <sys/stat.h> 18 #ifdef linux 19 #include <sys/vfs.h> 20 #else 21 #include <sys/param.h> 22 #include <sys/mount.h> 23 #endif 18 #ifdef __linux__ 19 # include <sys/vfs.h> 20 #else // if !__linux__ 21 # include <sys/param.h> 22 # ifndef USING_MINGW 23 # include <sys/mount.h> 24 # endif // USING_MINGW 25 #endif // !__linux__ 24 26 25 27 #include "autoexpire.h" 26 28 #include "programinfo.h" … … 32 34 #include "libmythtv/storagegroup.h" 33 35 #include "encoderlink.h" 34 36 #include "backendutil.h" 37 #include "compat.h" 35 38 36 39 #define LOC QString("AutoExpire: ") 37 40 -
programs/mythbackend/encoderlink.cpp
15 15 #include "previewgenerator.h" 16 16 #include "storagegroup.h" 17 17 #include "backendutil.h" 18 #include "compat.h" 18 19 19 20 /** 20 21 * \class EncoderLink -
programs/mythtv/main.cpp
13 13 #include "libmyth/mythcontext.h" 14 14 #include "libmyth/mythdbcon.h" 15 15 #include "libmyth/mythdialogs.h" 16 #include "libmyth/compat.h" 16 17 17 18 #include <iostream> 18 19 using namespace std; -
programs/mythlcdserver/main.cpp
20 20 #include "mythcontext.h" 21 21 #include "mythdbcon.h" 22 22 #include "tv_play.h" 23 #include "compat.h" 23 24 24 25 #include "lcdserver.h" 25 26 -
programs/mythlcdserver/lcdprocclient.cpp
19 19 #include "tv.h" 20 20 #include "lcdserver.h" 21 21 #include "lcddevice.h" 22 #include "compat.h" 22 23 23 24 24 #define LCD_START_COL 3 25 25 26 26 #define LCD_VERSION_4 1 -
programs/mythwelcome/welcomedialog.cpp
1 // ANSI C 2 #include <cstdlib> 3 4 // POSIX 1 5 #include <unistd.h> 2 #include <stdlib.h>3 #include <sys/wait.h> // For WIFEXITED on Mac OS X4 6 5 7 // qt 6 8 #include <qapplication.h> … … 13 15 #include "programinfo.h" 14 16 #include "uitypes.h" 15 17 #include "remoteutil.h" 18 #include "compat.h" 16 19 17 20 #include "welcomedialog.h" 18 21 #include "welcomesettings.h" -
programs/mythtvosd/main.cpp
1 // ANSI C headers 1 2 #include <cstdlib> 3 4 // POSIX headers 2 5 #include <sys/types.h> 3 #include <sys/socket.h>4 6 7 // C++ headers 5 8 #include <iostream> 6 #include <cstdlib> 9 using namespace std; 7 10 11 // Qt headers 8 12 #include <qapplication.h> 9 13 #include <qsocketdevice.h> 10 14 #include <qstring.h> … … 12 16 #include <qfile.h> 13 17 #include <qhostaddress.h> 14 18 19 // MythTV headers 15 20 #include "exitcodes.h" 21 #include "compat.h" 16 22 17 using namespace std;18 19 23 const QString kalert = 20 24 "<mythnotify version=\"1\">\n" 21 25 " <container name=\"notify_alert_text\">\n" -
programs/mythshutdown/main.cpp
7 7 using namespace std; 8 8 #include <unistd.h> 9 9 10 #include <sys/wait.h> // For WIFEXITED on Mac OS X11 12 10 #include <exitcodes.h> 13 11 #include <mythcontext.h> 14 12 #include <mythdbcon.h> 15 13 #include "libmythtv/programinfo.h" 16 14 #include "libmythtv/jobqueue.h" 17 15 #include "tv.h" 16 #include "compat.h" 18 17 19 18 void setGlobalSetting(const QString &key, const QString &value) 20 19 { -
programs/mythfilldatabase/filldata.cpp
1 1 // POSIX headers 2 2 #include <unistd.h> 3 3 #include <signal.h> 4 #include <sys/wait.h>5 4 6 5 // Std C headers 7 6 #include <cstdlib> … … 22 21 #include "exitcodes.h" 23 22 #include "mythcontext.h" 24 23 #include "mythdbcon.h" 24 #include "compat.h" 25 25 26 26 // libmythtv headers 27 27 #include "videosource.h" // for is_grabber.. … … 299 299 if (xmltv_grabber == "schedulesdirect1") 300 300 return grabDDData(source, offset, *qCurrentDate, DD_SCHEDULES_DIRECT); 301 301 302 #ifdef USING_MINGW 303 char tempfilename[MAX_PATH] = ""; 304 if (GetTempFileNameA("%TEMP%", "mth", 0, tempfilename) == 0) 305 #else 302 306 char tempfilename[] = "/tmp/mythXXXXXX"; 303 307 if (mkstemp(tempfilename) == -1) 308 #endif 304 309 { 305 310 VERBOSE(VB_IMPORTANT, 306 311 QString("Error creating temporary file in /tmp, %1") -
programs/mythfilldatabase/icondata.cpp
1 1 // POSIX headers 2 2 #include <unistd.h> 3 3 #include <signal.h> 4 #include <sys/wait.h>5 4 6 5 // Qt headers 7 6 #include <qdom.h> -
settings.pro
7 7 LIBVERSION = 0.20 8 8 VERSION = 0.20.0 9 9 10 isEmpty(TARGET_OS) : win32 { 11 CONFIG += mingw 12 DEFINES -= UNICODE 13 QMAKE_EXTENSION_SHLIB = dll 14 VERSION = 15 CONFIG_OPENGL_LIBS = 16 } 17 10 18 # if CYGWIN compile, set up flag in CONFIG 11 19 contains(TARGET_OS, CYGWIN) { 12 20 CONFIG += cygwin -
filters/postprocess/postprocess.pro
9 9 # Lots of symbols like pp_free_context, pp_free_mode, pp_get_context, pp_help 10 10 # are used but not defined, which sometimes prevents linking on OS X. 11 11 macx:LIBS += -undefined define_a_way 12 13 mingw { 14 SOURCES += ../../libs/libpostproc/postprocess.c 15 TARGET = postprocess 16 } -
filters/greedyhdeint/greedyh.asm
17 17 ///////////////////////////////////////////////////////////////////////////// 18 18 19 19 #include "x86-64_macros.inc" 20 #include <mangle.h>20 #include "mangle.h" 21 21 22 22 #if !defined(MASKS_DEFINED) 23 23 #define MASKS_DEFINED