[mythtv] RE: compiling mythtv frontend for cygwin

Mario L superm1 at gmail.com
Mon Sep 27 14:09:12 EDT 2004


I have come to a better understanding what the problem that people
were having when compiling for directx.  There is a qnetwork.h
included for directx as well as for QT.  Explicitly you have to tell
the compiler which one you want, otherwise it will follow the order of
the include path.  Windows.h & initguid.h SHOULD NOT be included in
directx's qnetwork.h.  This makes for more issues later on when
compiling libmythtv, as well as QT missing some of its references. 
Also, when you run into issues with DialogBoxA, put a #undef DialogBox
in that source file and then it will reference the correct dialogbox. 
The one it is trying to reference is for windows, somewhere along the
line including I believe winusers.h (but i may be wrong - it might be
somewhere else).  Here is a list of the notes that i have found to
work all the way up to issues compiling libmythtv (due to references
to _IOWR - see my other thread):

/start with ./configure --disable-audio-oss

//mythCVS/settings.pro
# X11 support
CONFIG += using_x11

# Default Xv support
CONFIG += using_xv
EXTRA_LIBS += -L/usr/X11R6/lib -lXinerama -lXv -lX11 -lXext -lXxf86vm

# IVTV (PVR-x50) support.  Disable if building on Windows.
CONFIG += using_ivtv
DEFINES += USING_IVTV

# Default audio output, OSS
CONFIG += using_oss
DEFINES += USING_OSS

# Windows support
#CONFIG += win32
#DEFINES += _WIN32

# DirectX support
#CONFIG += using_directx
#DEFINES += USING_DIRECTX

/*TO*/
# X11 support
#CONFIG += using_x11

# Default Xv support
#CONFIG += using_xv
#EXTRA_LIBS += -L/usr/X11R6/lib -lXinerama -lXv -lX11 -lXext -lXxf86vm

# IVTV (PVR-x50) support.  Disable if building on Windows.
#CONFIG += using_ivtv
#DEFINES += USING_IVTV

# Default audio output, OSS
#CONFIG += using_oss
#DEFINES += USING_OSS

# Windows support
CONFIG += win32
DEFINES += _WIN32

# DirectX support
CONFIG += using_directx
DEFINES += USING_DIRECTX

//mythCVS/libs/libavformat/libavformat.pro
LIBS += -L../libavcodec -lmythavcodec-$$LIBVERSION

/*TO*/

!win32{
       LIBS += -L../libavcodec -lmythavcodec-$$LIBVERSION
}

win32{
       LIBS += -L../libavcodec -l ../libavcodec/cygmythavcodec-$${LIBVERSION}-0
}

//mythCVS/libs/libmyth/mythcontext.h
#include <qnetwork.h>

TO

#if defined(USING_DIRECTX)
#include </opt/qt/3.2/qt-x11-free-3.2.3/include/qnetwork.h>
#endif
#if !defined(USING_DIRECTX)
#include <qtnetwork.h>
#endif

//mythCVS/libs/libmyth/util.cpp && mythCVS/libs/libmyth/util.h &&
mythCVS/libs/libmyth/mythcontext.cpp
/*ADD - to anywhere asking for Q_WS_X11 */
#if !defined(_WIN32)
..
..
..
#endif

AND

#include <qnetwork.h>

TO

#if defined(USING_DIRECTX)
#include </opt/qt/3.2/qt-x11-free-3.2.3/include/qnetwork.h>
#endif
#if !defined(USING_DIRECTX)
#include <qtnetwork.h>
#endif

//mthCVS/libs/libmyth/mythmediamonitor.h
/*ADD - to area including fstab.h */
#if !defined(_WIN32)
#include <fstab>
#endif

//mythCVS/libs/libmyth/mythmediamonitor.cpp
/*entire file */

Lots of changes - mostly commented out with defines, i'm not going to
list them here unless someone requests

//mythCVS/libs/libmyth/mythdialogs.cpp
/*ADD around area detecting mythmedia events */
#if !defined(_WIN32)
   else if (ce->type() == kMediaEventType)
   {
       MediaEvent *media_event = (MediaEvent*)ce;
       // Let's see which of our jump points are configured to handle this
       // type of media...  If there's more than one we'll want to show some
       // UI to allow the user to select which jump point to use. But for
       // now we're going to just use the first one.
       QMap<QString, MHData>::Iterator itr = d->mediaHandlerMap.begin();
       MythMediaDevice *pDev = media_event->getDevice();

       if (pDev)
       {
           QWidget * activewidget = qApp->focusWidget();
           MythDialog * activedialog = NULL;
           bool iscatched = false;
           while (activewidget && !activedialog)
           {
               activedialog = dynamic_cast<MythDialog*>(activewidget);
               if (!activedialog)
                      activewidget = activewidget->parentWidget();
           }
           if (activedialog)
               iscatched = activedialog->onMediaEvent(pDev);
           if (!iscatched)
           {
               while (itr != d->mediaHandlerMap.end())
               {
                  if ((itr.data().MediaType & (int)pDev->getMediaType()))
                  {
                      VERBOSE(VB_ALL, "Found a handler");
                      d->exitingtomain = true;
                      d->exitmenumediadevicecallback = itr.data().callback;
                      d->mediadeviceforcallback = pDev;
                      QApplication::postEvent(this, new ExitToMainMenuEvent());
                      break;
                  }
                  itr++;
               }
           }
       }
   }
#endif

//mythCVS/libs/libmythtv/libmythtv.pro
TARGETDEPS += ../libmyth/libmyth-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
TARGETDEPS += ../libavcodec/libmythavcodec-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}
TARGETDEPS += ../libavformat/libmythavformat-$${LIBVERSION}.$${QMAKE_EXTENSION_SHLIB}

/*to*/

TARGETDEPS += ../libmyth/libmyth-$${LIBVERSION}-0.$${QMAKE_EXTENSION_SHLIB}
TARGETDEPS += ../libavcodec/libmythavcodec-$${LIBVERSION}-0.$${QMAKE_EXTENSION_SHLIB}
TARGETDEPS += ../libavformat/libmythavformat-$${LIBVERSION}-0.$${QMAKE_EXTENSION_SHLIB}

/*add*/
win32{
       QMAKE_EXTENSION_SHLIB=dll
}

//mythCVS/libs/libmythtv/NuppleVideoPlayer.cpp
#ifdef USING_DIRECTX
#include "videoout_dx.h"
#undef GetFreeSpace
#undef GetFileSize
#endif

to

#ifdef USING_DIRECTX
#include "videoout_dx.h"
#undef GetFreeSpace
#undef GetFileSize
#undef DialogBox
#endif


More information about the mythtv-dev mailing list