Ticket #4270: mingw-svn15128.2.patch

File mingw-svn15128.2.patch, 20.6 KB (added by andrei@…, 16 years ago)
  • libs/libmythtv/videoout_d3d.cpp

     
    1010#include "videoout_d3d.h"
    1111#include "filtermanager.h"
    1212#include "fourcc.h"
     13#include "videodisplayprofile.h"
    1314
    1415#include "mmsystem.h"
    1516#include "tv.h"
  • libs/libmythtv/libmythtv.pro

     
    499499
    500500mingw {
    501501    DEFINES -= USING_OPENGL_VSYNC
    502     DEFINES += USING_D3D USING_MINGW
     502    DEFINES += USING_D3D
    503503
    504504    HEADERS -= util-opengl.h   openglcontext.h
    505505    HEADERS += videoout_d3d.h
    506     SOURCES -= util-opengl.cpp openglcontext.cpp
     506    SOURCES -= util-opengl.cpp openglcontext.cpp NuppelVideoRecorder.cpp
    507507    SOURCES += videoout_d3d.cpp
    508508
    509509    LIBS += -lpthread
  • libs/libmythtv/ThreadedFileWriter.cpp

     
    9292 */
    9393void *ThreadedFileWriter::boot_writer(void *wotsit)
    9494{
     95#ifndef USING_MINGW
    9596    signal(SIGXFSZ, SIG_IGN);
     97#endif
    9698    ThreadedFileWriter *fw = (ThreadedFileWriter *)wotsit;
    9799    fw->DiskLoop();
    98100    return NULL;
  • libs/libmythtv/videodev_myth.h

     
    33
    44#include "config.h"
    55
    6 #if defined(__FreeBSD__) || defined(CONFIG_DARWIN)
     6#if defined(__FreeBSD__) || defined(CONFIG_DARWIN) || defined(USING_MINGW)
    77#include <sys/types.h>
    88typedef uint32_t __u32;
    99typedef uint16_t __u16;
    1010typedef int32_t  __s32;
    1111typedef uint8_t  __u8;
    12 typedef uint32_t __u64; 
     12typedef uint32_t __u64;
    1313typedef int32_t  __s64;  // HACK. Non 64bit FreeBSD kernels require this for ioctls
    1414#else
    1515#include <linux/types.h>
  • libs/libmythtv/channelbase.cpp

     
    2727#include "compat.h"
    2828
    2929#define LOC QString("ChannelBase(%1): ").arg(GetCardID())
     30#define LOC_WARN QString("ChannelBase(%1) Warning: ").arg(GetCardID())
    3031#define LOC_ERR QString("ChannelBase(%1) Error: ").arg(GetCardID())
    3132
    3233ChannelBase::ChannelBase(TVRec *parent)
  • libs/libmythtv/RingBuffer.cpp

     
    12071207    else
    12081208    {
    12091209        if (whence == SEEK_SET)
     1210#ifdef USING_MINGW
     1211            ret = lseek64(fd2, pos, whence);
     1212#else
    12101213            ret = lseek(fd2, pos, whence);
     1214#endif
    12111215        else
    12121216        {
    12131217            long long realseek = readpos + pos;
     1218#ifdef USING_MINGW
     1219            ret = lseek64(fd2, realseek, SEEK_SET);
     1220#else
    12141221            ret = lseek(fd2, realseek, SEEK_SET);
     1222#endif
    12151223        }
    12161224    }
    12171225
  • libs/libmythtv/vsync.cpp

     
    7575{
    7676    VideoSync *trial = NULL;
    7777    tryingVideoSync  = true;
     78#ifndef _WIN32
    7879    bool tryOpenGL   = (gContext->GetNumSetting("UseOpenGLVSync", 1) &&
    7980                        (getenv("NO_OPENGL_VSYNC") == NULL));
     81#endif
    8082
    8183    // m_forceskip allows for skipping one sync method
    8284    // due to crash on the previous run.
     
    225227        OffsetTimeval(m_nexttrigger, -2000);
    226228}
    227229
     230#ifndef _WIN32
    228231#define DRM_VBLANK_RELATIVE 0x1;
    229232
    230233struct drm_wait_vblank_request {
     
    245248    struct drm_wait_vblank_reply reply;
    246249} drm_wait_vblank_t;
    247250
    248 #ifndef _WIN32
    249251#define DRM_IOCTL_BASE                  'd'
    250252#define DRM_IOWR(nr,type)               _IOWR(DRM_IOCTL_BASE,nr,type)
    251253
    252254#define DRM_IOCTL_WAIT_VBLANK           DRM_IOWR(0x3a, drm_wait_vblank_t)
    253 #endif
    254255
    255256static int drmWaitVBlank(int fd, drm_wait_vblank_t *vbl)
    256257{
    257258    int ret = -1;
    258259
    259 #ifndef _WIN32
    260260    do {
    261261       ret = ioctl(fd, DRM_IOCTL_WAIT_VBLANK, vbl);
    262262       vbl->request.type &= ~DRM_VBLANK_RELATIVE;
    263263    } while (ret && errno == EINTR);
    264 #endif
    265264
    266265    return ret;
    267266}
     
    707706    UpdateNexttrigger();
    708707#endif /* USING_OPENGL_VSYNC */
    709708}
     709#endif /* !_WIN32 */
    710710
    711711#ifdef __linux__
    712712#define RTCRATE 1024
     
    724724
    725725bool RTCVideoSync::TryInit(void)
    726726{
    727 #ifdef _WIN32
    728     return false;
    729 #else
    730727    m_rtcfd = open("/dev/rtc", O_RDONLY);
    731728    if (m_rtcfd < 0)
    732729    {
     
    751748    }
    752749   
    753750    return true;
    754 #endif
    755751}
    756752
    757753void RTCVideoSync::WaitForFrame(int sync_delay)
  • libs/libmythtv/vsync.h

     
    125125    static int m_forceskip;
    126126};
    127127
     128#ifndef _WIN32
    128129/** \brief Video synchronization class employing /dev/drm0
    129130 *
    130131 *   Polls /dev/drm0 to wait for retrace.  Phase-maintaining, meaning
     
    197198 *  \sa http://www.ac3.edu.au/SGI_Developer/books/OpenGLonSGI/sgi_html/ch10.html#id37188
    198199 *  \sa http://www.inb.mu-luebeck.de/~boehme/xvideo_sync.html
    199200 */
    200 #ifndef USING_MINGW
    201201class OpenGLVideoSync : public VideoSync
    202202{
    203203  public:
  • libs/libmythtv/videosource.cpp

     
    3636#include "frequencies.h"
    3737#include "diseqcsettings.h"
    3838#include "firewiredevice.h"
     39#include "compat.h"
    3940
    4041
    4142#ifdef USING_DVB
  • libs/libmythtv/videoout_dx.cpp

     
    88#include "videoout_dx.h"
    99#include "filtermanager.h"
    1010#include "fourcc.h"
     11#include "videodisplayprofile.h"
    1112
    1213#include "mmsystem.h"
    1314#include "tv.h"
  • libs/libmythui/mythmainwindow.cpp

     
    612612void MythMainWindow::attach(QWidget *child)
    613613{
    614614#ifdef USING_MINGW
    615 #warning TODO FIXME MythMainWindow::attach() not implemented on MS Windows!
     615#warning TODO FIXME MythMainWindow::attach() does not always work on MS Windows!
    616616    // if windows are created on different threads,
    617617    // or if setFocus() is called from a thread other than the main UI thread,
    618618    // setFocus() hangs the thread that called it
     
    15191519    float desired = 100.0;
    15201520
    15211521#ifdef USING_MINGW
    1522 #warning TODO FIXME DPI needs to be calculated on MS Windows systems..
     1522#warning TODO FIXME DPI needs to be calculated on MS Windows systems using QT..
     1523    // logicalDpiY not supported in QT3/win.
    15231524    int logicalDpiY = 100;
     1525    HDC hdc = GetDC(NULL);
     1526    if (hdc)
     1527    {
     1528        logicalDpiY = GetDeviceCaps(hdc, LOGPIXELSY);
     1529        ReleaseDC(NULL, hdc);
     1530    }
    15241531#else
    15251532    int logicalDpiY = pdm.logicalDpiY();
    15261533#endif
  • libs/libmythui/libmythui.def

     
     1LIBRARY 
     2EXPORTS 
     3;       GetMythMainWindow() 
     4        _Z17GetMythMainWindowv 
     5;       DestroyMythMainWindow() 
     6        _Z21DestroyMythMainWindowv
     7;       MythMainWindow::Init()
     8        _ZN14MythMainWindow4InitEv
     9;       MythMainWindow::NormalizeFontSize(int) 
     10        _ZN14MythMainWindow17NormalizeFontSizeEi 
     11;       MythMainWindow::TranslateKeyPress(QString const&, QKeyEvent*, QStringList&, bool) 
     12        _ZN14MythMainWindow17TranslateKeyPressERK7QStringP9QKeyEventR11QStringListb 
     13;       MythMainWindow::detach(QWidget*) 
     14        _ZN14MythMainWindow6detachEP7QWidget 
     15;       MythMainWindow::attach(QWidget*) 
     16        _ZN14MythMainWindow6attachEP7QWidget 
     17;       MythMainWindow::RegisterKey(QString const&, QString const&, QString const&, QString const&) 
     18        _ZN14MythMainWindow11RegisterKeyERK7QStringS2_S2_S2_ @ 737 
     19;       MythMainWindow::GetKey(QString const&, QString const&) const 
     20        _ZNK14MythMainWindow6GetKeyERK7QStringS2_ 
     21;       MythMainWindow::currentWidget() 
     22        _ZN14MythMainWindow13currentWidgetEv 
     23;       MythMainWindow::getMainWindow(bool)
     24        _ZN14MythMainWindow13getMainWindowEb
  • libs/libmythui/libmythui.pro

    Property changes on: libs/libmythui/libmythui.def
    ___________________________________________________________________
    Name: svn:executable
       + *
    
     
    7474cygwin:DEFINES += _WIN32
    7575
    7676mingw {
    77     DEFINES += USING_MINGW
    7877    target.path = $${PREFIX}/bin
    7978    using_opengl {
    8079        LIBS += -lopengl32
  • libs/libavformat/mpegts.c

     
    2121#include "avformat.h"
    2222#include "crc.h"
    2323#include <pthread.h>
     24#include "libmyth/compat.h"
    2425#include "mpegts.h"
    2526
    2627//#define DEBUG_SI
  • libs/libavformat/os_support.c

     
    2424#include <unistd.h>
    2525#include <fcntl.h>
    2626
     27#ifdef CONFIG_NETWORK
    2728#ifndef HAVE_SYS_POLL_H
    2829#ifdef HAVE_WINSOCK2_H
    2930#include <winsock2.h>
     
    3233#endif
    3334#endif
    3435
    35 #ifdef CONFIG_NETWORK
    3636#include "network.h"
    3737
    3838#if !defined(HAVE_INET_ATON)
  • libs/libmyth/audiooutputwin.cpp

     
    1010#include <mmsystem.h>
    1111
    1212// even number, 42 ~= 1.008 sec @ 48000 with 1152 samples per packet
    13 uint AudioOutputWin::kPacketCnt = 16;
     13const uint AudioOutputWin::kPacketCnt = 16;
    1414
    1515class AudioOutputWinPrivate
    1616{
     
    1818    AudioOutputWinPrivate() :
    1919        m_WaveHdrs(NULL), m_hEvent(NULL)
    2020    {
    21         m_WaveHdrs = new WAVEHDR[kPacketCnt];
    22         memset(m_WaveHdrs, 0, sizeof(WAVEHDR) * kPacketCnt);
     21        m_WaveHdrs = new WAVEHDR[AudioOutputWin::kPacketCnt];
     22        memset(m_WaveHdrs, 0, sizeof(WAVEHDR) * AudioOutputWin::kPacketCnt);
    2323        m_hEvent = CreateEvent(NULL, FALSE, TRUE, NULL);
    2424    }
    2525
     
    5757    HANDLE    m_hEvent;
    5858};
    5959
    60 void CALLBACK AudioOutputWinPriv::waveOutProc(
     60void CALLBACK AudioOutputWinPrivate::waveOutProc(
    6161    HWAVEOUT hwo, UINT uMsg, DWORD dwInstance, DWORD dwParam1, DWORD dwParam2)
    6262{
    6363    if (uMsg == WOM_DONE)
    6464    {
    6565        InterlockedDecrement(&((AudioOutputWin*)dwInstance)->m_nPkts);
    66         if (((AudioOutputWin*)dwInstance)->m_nPkts < kPacketCnt)
     66        if (((AudioOutputWin*)dwInstance)->m_nPkts < (int)AudioOutputWin::kPacketCnt)
    6767        {
    68             SetEvent(((AudioOutputWin*)dwInstance)->m_hEvent);
     68            SetEvent(((AudioOutputWin*)dwInstance)->m_priv->m_hEvent);
    6969        }
    7070    }
    7171}
     
    8787    Reconfigure(laudio_bits,       laudio_channels,
    8888                laudio_samplerate, laudio_passthru);
    8989
    90     m_OutPkts = calloc(kPacketCnt * sizeof(unsigned char*));
     90    m_OutPkts = (unsigned char **)calloc(kPacketCnt, sizeof(unsigned char*));
    9191}
    9292
    9393AudioOutputWin::~AudioOutputWin()
     
    102102
    103103    if (m_OutPkts)
    104104    {
    105         for (int i = 0; i < kPacketCnt; i++)
     105        for (uint i = 0; i < kPacketCnt; i++)
    106106        {
    107107            if (m_OutPkts[i])
    108108                free(m_OutPkts[i]);
     
    132132        &m_priv->m_hWaveOut,
    133133        WAVE_MAPPER,
    134134        &wf,
    135         (DWORD) waveOutProc,
     135        (DWORD) AudioOutputWinPrivate::waveOutProc,
    136136        (DWORD) this,
    137137        CALLBACK_FUNCTION);
    138138
  • libs/libmyth/util.cpp

     
    856856
    857857QString createTempFile(QString name_template, bool dir)
    858858{
     859    int ret = -1;
     860
    859861#ifdef USING_MINGW
    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    char temppath[MAX_PATH] = ".";
     863    char tempfilename[MAX_PATH] = "";
     864    // if GetTempPath fails, use current dir
     865    GetTempPathA(MAX_PATH, temppath);
     866    if (GetTempFileNameA(temppath, "mth", 0, tempfilename))
     867    {
     868        if (dir)
     869        {
     870            ret = mkdir(tempfilename);
     871        }
     872        else
     873        {
     874            ret = open(tempfilename, O_CREAT | O_RDWR, S_IREAD | S_IWRITE);
     875        }
     876    }
     877    QString tmpFileName(tempfilename);
    864878#else
    865879    const char *tmp = name_template.ascii();
    866880    char *ctemplate = strdup(tmp);
    867     int ret = -1;
    868881
    869882    if (dir)
    870883    {
     
    877890
    878891    QString tmpFileName(ctemplate);
    879892    free(ctemplate);
     893#endif
    880894
    881895    if (ret == -1)
    882896    {
     
    889903        close(ret);
    890904
    891905    return tmpFileName;
    892 #endif
    893906}
    894907
    895908double MythGetPixelAspectRatio(void)
  • libs/libmyth/compat.h

     
    66#define __COMPAT_H__
    77
    88// Turn off the visual studio warnings (identifier was truncated)
    9 #ifdef _WIN32
     9#ifdef _MSC_VER
    1010#pragma warning(disable:4786)
    1111#endif
    1212
     
    2929
    3030#ifdef _WIN32
    3131#undef DialogBox
     32#undef LoadImage
     33#undef LoadIcon
     34#undef GetObject
    3235#undef DrawText
     36#undef CreateFont
    3337#endif
    3438
    3539// Dealing with Microsoft min/max mess:
     
    6266#endif
    6367
    6468#ifdef USING_MINGW
    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)
    6869#define fsync(FD) 0
    69 #define signal(X,Y) 0
    7070//used in videodevice only - that code is not windows-compatible anyway
    7171#define minor(X) 0
    7272#endif
     
    8585#endif
    8686
    8787#if defined(__cplusplus) && defined(USING_MINGW)
    88 #include <pthread.h>
    89 inline bool operator==(const pthread_t& pt, const int n)
    90 {
    91     return *((int*)(&pt)) == n;
    92 }
    93 inline bool operator!=(const pthread_t& pt, const int n)
    94 {
    95     return *((int*)(&pt)) != n;
    96 }
    97 #endif // defined(__cplusplus) && defined(USING_MINGW)
    98 
    99 #if defined(__cplusplus) && defined(USING_MINGW)
    10088/* TODO: most small usleep's in MythTV are just a quick way to perform
    10189 * a yield() call, those should just be replaced with an actual yield().
    10290 * There is a known bug with Win32 yield(), it basically functions as
  • libs/libmyth/audiooutputwin.h

     
    1111
    1212class AudioOutputWin : public AudioOutputBase
    1313{
     14  friend class AudioOutputWinPrivate;
    1415  public:
    1516    AudioOutputWin(QString laudio_main_device,
    1617                   QString laudio_passthru_device,
     
    3233    virtual inline int getBufferedOnSoundcard(void);
    3334
    3435  protected:
     36    AudioOutputWinPrivate *m_priv;
    3537    static const uint      kPacketCnt;
    36     AudioOutputWinPrivate *m_priv;
    3738    long                   m_nPkts;
    3839    int                    m_CurrentPkt;
    3940    unsigned char        **m_OutPkts;
  • libs/libmyth/libmyth.pro

     
    8282}
    8383
    8484mingw {
    85     DEFINES += USING_WINAUDIO USING_MINGW
    8685    SOURCES += mediamonitor-windows.cpp audiooutputwin.cpp
    8786    HEADERS += mediamonitor-windows.h   audiooutputwin.h
    8887
  • libs/libmythfreemheg/libmythfreemheg.pro

     
    2424
    2525LIBS += $$EXTRA_LIBS
    2626
    27 mingw {
    28     DEFINES += USING_MINGW
    29     target.path = $${PREFIX}/bin
    30 }
     27mingw:  target.path = $${PREFIX}/bin
  • libs/libmythupnp/libmythupnp.def

     
     1LIBRARY
     2EXPORTS
     3;       MythXMLClient::MythXMLClient(QUrl const&, bool)
     4        _ZN13MythXMLClientC1ERK4QUrlb
     5;       MythXMLClient::GetConnectionInfo(QString const&, DatabaseParams*, QString&)
     6        _ZN13MythXMLClient17GetConnectionInfoERK7QStringP14DatabaseParamsRS0_
     7;       MythXMLClient::~MythXMLClient()
     8        _ZN13MythXMLClientD0Ev
     9;       MythXMLClient::~MythXMLClient()
     10        _ZN13MythXMLClientD1Ev
     11;       MythXMLClient::~MythXMLClient()
     12        _ZN13MythXMLClientD2Ev
     13;       SSDPCache::Find(QString const&)
     14        _ZN9SSDPCache4FindERK7QString
     15;       SSDPCache::Find(QString const&, QString const&)
     16        _ZN9SSDPCache4FindERK7QStringS2_
     17;       SSDP::PerformSearch(QString const&)
     18        _ZN4SSDP13PerformSearchERK7QString
     19;       HttpServer::HttpServer(int)
     20        _ZN10HttpServerC1Ei
     21;       XmlConfiguration::XmlConfiguration(QString const&)
     22        _ZN16XmlConfigurationC1ERK7QString
     23;       UPnp::Initialize(int, HttpServer*)
     24        _ZN4UPnp10InitializeEiP10HttpServer
     25;       UPnp::g_pSSDP
     26        _ZN4UPnp7g_pSSDPE
     27;       UPnp::g_pConfig
     28        _ZN4UPnp9g_pConfigE
     29;       UPnp::UPnp()
     30        _ZN4UPnpC1Ev
     31;       UPnp::g_SSDPCache
     32        _ZN4UPnp11g_SSDPCacheE
     33;       UPnp::SetConfiguration(Configuration*)
     34        _ZN4UPnp16SetConfigurationEP13Configuration
     35;       UPnp::g_UPnpDeviceDesc
     36        _ZN4UPnp16g_UPnpDeviceDescE
     37;       UPnpDeviceDesc::Retrieve(QString&, bool)
     38        _ZN14UPnpDeviceDesc8RetrieveER7QStringb
  • libs/libmythupnp/libmythupnp.pro

     
    4141TARGETDEPS += ../libmyth/libmyth-$${MYTH_SHLIB_EXT}
    4242
    4343mingw {
    44     DEFINES += USING_MINGW
    4544    HEADERS += darwin-sendfile.h
    4645    SOURCES += darwin-sendfile.c
    4746    target.path = $${PREFIX}/bin
  • libs/libmythupnp/upnptasknotify.h

     
    1313
    1414// POSIX headers
    1515#include <sys/types.h>
    16 #ifdef USING_MINGW
     16#ifndef USING_MINGW
    1717#include <netinet/in.h>
    1818#include <arpa/inet.h>
    1919#endif
  • libs/libmythupnp/httpserver.h

     
    1414
    1515// POSIX headers
    1616#include <sys/types.h>
    17 #ifdef USING_MINGW
     17#ifndef USING_MINGW
    1818#include <netinet/in.h>
    1919#include <arpa/inet.h>
    2020#endif
  • programs/mythbackend/main.cpp

     
    368368
    369369int main(int argc, char **argv)
    370370{
    371 #ifdef USING_MINGW
    372 #warning TODO FIXME plugins leave open file descriptors on MS Windows
    373 #else
     371#ifndef _WIN32
    374372    for (int i = 3; i < sysconf(_SC_OPEN_MAX) - 1; ++i)
    375373        close(i);
    376374#endif
  • programs/programs.pro

     
    1717using_frontend:using_backend {
    1818    SUBDIRS += mythtranscode
    1919}
     20
     21mingw: SUBDIRS -= mythtranscode mythtranscode/replex
  • settings.pro

     
    99
    1010isEmpty(TARGET_OS) : win32 {
    1111    CONFIG += mingw
     12    DEFINES += USING_MINGW USING_WINAUDIO USING_D3D USING_DIRECTX
    1213    DEFINES -= UNICODE
    1314    QMAKE_EXTENSION_SHLIB = dll
    1415    VERSION =
  • filters/postprocess/postprocess.pro

     
    1111macx:LIBS += -undefined define_a_way
    1212
    1313mingw {
    14   SOURCES += ../../libs/libpostproc/postprocess.c
     14  SOURCES -= filter_postprocess.c
    1515  TARGET = postprocess
    1616}