Ticket #6597: 6597-transcode-win32.patch

File 6597-transcode-win32.patch, 6.2 KB (added by Jeff Lu <jll544@…>, 16 years ago)
  • programs/programs.pro

     
    1818    SUBDIRS += mythtranscode
    1919}
    2020
    21 mingw: SUBDIRS -= mythtranscode mythtranscode/replex
  • programs/mythtranscode/replex/replex.pro

     
    2323LIBS += -lmythavcodec-$$LIBVERSION -lmythavformat-$$LIBVERSION -lmythavutil-$$LIBVERSION
    2424LIBS += $$EXTRA_LIBS
    2525
     26mingw:LIBS += -lws2_32
     27
    2628isEmpty(QMAKE_EXTENSION_SHLIB) {
    2729  QMAKE_EXTENSION_SHLIB=so
    2830}
  • programs/mythtranscode/mythtranscode.pro

     
    99target.path = $${PREFIX}/bin
    1010INSTALLS = target
    1111
     12mingw:LIBS += -lws2_32
     13
    1214QMAKE_CLEAN += $(TARGET)
    1315
    1416# Input
  • programs/mythtranscode/main.cpp

     
    812812    if (gContext->GetNumSetting("TruncateDeletesSlowly", 0))
    813813        return slowDelete(filename);
    814814
    815     return unlink(filename.toLocal8Bit().constData());
     815    QFile ftarget(filename.toLocal8Bit().constData());
     816    return !ftarget.remove();
    816817}
    817818
    818819void CompleteJob(int jobID, ProgramInfo *pginfo, bool useCutlist, int &resultCode)
     
    854855        const QString newfile = cnf;
    855856        const QByteArray anewfile = newfile.toLocal8Bit();
    856857
    857         if (rename(fname.constData(), aoldfile.constData()) == -1)
     858        QFile srcQFile(fname.constData());
     859        if (!srcQFile.rename(aoldfile.constData()))
    858860        {
    859861            VERBOSE(VB_IMPORTANT,
    860862                    QString("mythtranscode: Error Renaming '%1' to '%2'")
    861863                    .arg(filename).arg(oldfile) + ENO);
    862864        }
    863865
    864         if (rename(atmpfile.constData(), anewfile.constData()) == -1)
     866        QFile tmpQFile(atmpfile.constData());       
     867        if (!tmpQFile.rename(anewfile.constData()))
    865868        {
    866869            VERBOSE(VB_IMPORTANT,
    867870                    QString("mythtranscode: Error Renaming '%1' to '%2'")
     
    966969                QFile checkFile(oldfileprev);
    967970
    968971                if ((oldfileprev != newfileprev) && (checkFile.exists()))
    969                     rename(aoldfileprev.constData(), anewfileprev.constData());
     972                    checkFile.rename(anewfileprev.constData());
    970973            }
    971974        }
    972975
  • programs/mythtranscode/transcode.cpp

     
    12011201        fifow->FIFODrain();
    12021202    }
    12031203    delete newFrame;
     1204    // HACK? - destructor apparently never called (Qt3/Qt4 deleteLater issue?)
     1205    // Pointers not reset; shouldn't dtor segfault if it was working properly?
    12041206    if (player_ctx)
    12051207        delete player_ctx;
     1208    // HACK - delete ringbuffer else outfile is open when we try to rename it
     1209    // As before, destructor is supposed to take care of these deletes for us!
     1210    if (nvr)
     1211        delete nvr;
     1212    if (outRingBuffer)
     1213        delete outRingBuffer;
     1214
    12061215    return REENCODE_OK;
    12071216}
    12081217
  • libs/libmythtv/NuppelVideoRecorder.cpp

     
    1010#elif HAVE_SOUNDCARD_H
    1111    #include <soundcard.h>
    1212#endif
     13#ifndef USING_MINGW
    1314#include <sys/ioctl.h>
    1415#include <sys/mman.h>
     16#endif
    1517#include <cerrno>
    1618#include <cmath>
    1719
     
    778780 */
    779781bool NuppelVideoRecorder::MJPEGInit(void)
    780782{
     783#ifndef USING_MINGW
    781784    bool we_opened_fd = false;
    782785    int init_fd = fd;
    783786    if (init_fd < 0)
     
    819822            hmjpg_maxw = 640;
    820823        return true;
    821824    }
    822 
     825#endif // !USING_MINGW
    823826    VERBOSE(VB_IMPORTANT, LOC_ERR + "MJPEG not supported by device");
    824827    return false;
    825828}
     
    966969
    967970void NuppelVideoRecorder::ProbeV4L2(void)
    968971{
     972#ifndef USING_MINGW
    969973    usingv4l2 = true;
    970974
    971975    struct v4l2_capability vcap;
     
    995999    QString driver = (char *)vcap.driver;
    9961000    if (driver == "go7007")
    9971001        go7007 = true;
     1002#endif // !USING_MINGW   
    9981003}
    9991004
    10001005void NuppelVideoRecorder::StartRecording(void)
     
    10731078
    10741079void NuppelVideoRecorder::DoV4L(void)
    10751080{
     1081#ifndef USING_MINGW
    10761082    struct video_capability vc;
    10771083    struct video_mmap mm;
    10781084    struct video_mbuf vm;
     
    12551261
    12561262    recording = false;
    12571263    close(fd);
     1264#endif // !USING_MINGW   
    12581265}
    12591266
    12601267void NuppelVideoRecorder::DoV4L2(void)
    12611268{
     1269#ifndef USING_MINGW
    12621270    struct v4l2_format     vfmt;
    12631271    struct v4l2_buffer     vbuf;
    12641272    struct v4l2_requestbuffers vrbuf;
     
    16121620    recording = false;
    16131621    close(fd);
    16141622    close(channelfd);
     1623#endif // !USING_MINGW
    16151624}
    16161625
    16171626void NuppelVideoRecorder::DoMJPEG(void)
    16181627{
     1628#ifndef USING_MINGW
    16191629    struct mjpeg_params bparm;
    16201630
    16211631    if (ioctl(fd, MJPIOC_G_PARAMS, &bparm) < 0)
     
    17481758           
    17491759    recording = false;
    17501760    close(fd);
     1761#endif // !USING_MINGW   
    17511762}
    17521763
    17531764int NuppelVideoRecorder::SpawnChildren(void)
     
    26472658
    26482659void NuppelVideoRecorder::doVbiThread(void)
    26492660{
     2661#ifndef USING_MINGW   
    26502662    //VERBOSE(VB_IMPORTANT, LOC + "vbi begin");
    26512663    struct VBIData vbicallbackdata;
    26522664    struct vbi *pal_tt = NULL;
     
    27932805        cc_close(ntsc_cc);
    27942806
    27952807    //VERBOSE(VB_RECORD, LOC + "vbi end");
     2808#endif // !USING_MINGW
    27962809}
    27972810
    27982811
  • libs/libmythtv/libmythtv.pro

     
    581581    DEFINES += USING_D3D
    582582
    583583    HEADERS += videoout_d3d.h
    584     SOURCES -= NuppelVideoRecorder.cpp
    585584    SOURCES += videoout_d3d.cpp
    586585
    587586    LIBS += -lpthread