Ticket #6597: 6597-transcode-win32.2.patch
File 6597-transcode-win32.2.patch, 8.9 KB (added by , 15 years ago) |
---|
-
programs/programs.pro
18 18 SUBDIRS += mythtranscode 19 19 } 20 20 21 mingw: SUBDIRS -= mythtranscode mythtranscode/replex -
programs/mythtranscode/replex/replex.pro
23 23 LIBS += -lmythavcodec-$$LIBVERSION -lmythavformat-$$LIBVERSION -lmythavutil-$$LIBVERSION 24 24 LIBS += $$EXTRA_LIBS 25 25 26 mingw:LIBS += -lws2_32 27 26 28 isEmpty(QMAKE_EXTENSION_SHLIB) { 27 29 QMAKE_EXTENSION_SHLIB=so 28 30 } -
programs/mythtranscode/replex/replex.c
2390 2390 perror("Error opening output file"); 2391 2391 exit(1); 2392 2392 } 2393 #ifdef USING_MINGW 2394 _setmode(rx.fd_out, _O_BINARY); 2395 #endif 2393 2396 fprintf(stderr,"Output File is: %s\n", 2394 2397 filename); 2395 2398 } else { … … 2460 2463 perror("Error opening output file"); 2461 2464 exit(1); 2462 2465 } 2466 #ifdef USING_MINGW 2467 _setmode(rx.dmx_out[0], _O_BINARY); 2468 #endif 2463 2469 fprintf(stderr,"Video output File is: %s\n", 2464 2470 fname); 2465 2471 … … 2477 2483 perror("Error opening output file"); 2478 2484 exit(1); 2479 2485 } 2486 #ifdef USING_MINGW 2487 _setmode(rx.dmx_out[i+1], _O_BINARY); 2488 #endif 2480 2489 fprintf(stderr,"Audio%d output File is: %s\n",i,fname); 2481 2490 } 2482 2491 -
programs/mythtranscode/mythtranscode.pro
9 9 target.path = $${PREFIX}/bin 10 10 INSTALLS = target 11 11 12 mingw:LIBS += -lws2_32 13 12 14 QMAKE_CLEAN += $(TARGET) 13 15 14 16 # Input -
programs/mythtranscode/main.cpp
812 812 if (gContext->GetNumSetting("TruncateDeletesSlowly", 0)) 813 813 return slowDelete(filename); 814 814 815 return unlink(filename.toLocal8Bit().constData()); 815 QFile ftarget(filename.toLocal8Bit().constData()); 816 return !ftarget.remove(); 816 817 } 817 818 818 819 void CompleteJob(int jobID, ProgramInfo *pginfo, bool useCutlist, int &resultCode) … … 854 855 const QString newfile = cnf; 855 856 const QByteArray anewfile = newfile.toLocal8Bit(); 856 857 857 if (rename(fname.constData(), aoldfile.constData()) == -1) 858 QFile srcQFile(fname.constData()); 859 if (!srcQFile.rename(aoldfile.constData())) 858 860 { 859 861 VERBOSE(VB_IMPORTANT, 860 862 QString("mythtranscode: Error Renaming '%1' to '%2'") 861 863 .arg(filename).arg(oldfile) + ENO); 862 864 } 863 865 864 if (rename(atmpfile.constData(), anewfile.constData()) == -1) 866 QFile tmpQFile(atmpfile.constData()); 867 if (!tmpQFile.rename(anewfile.constData())) 865 868 { 866 869 VERBOSE(VB_IMPORTANT, 867 870 QString("mythtranscode: Error Renaming '%1' to '%2'") … … 966 969 QFile checkFile(oldfileprev); 967 970 968 971 if ((oldfileprev != newfileprev) && (checkFile.exists())) 969 rename(aoldfileprev.constData(),anewfileprev.constData());972 checkFile.rename(anewfileprev.constData()); 970 973 } 971 974 } 972 975 -
programs/mythtranscode/transcode.cpp
1201 1201 fifow->FIFODrain(); 1202 1202 } 1203 1203 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? 1204 1206 if (player_ctx) 1205 1207 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 1206 1215 return REENCODE_OK; 1207 1216 } 1208 1217 -
programs/mythtranscode/mpeg2fix.h
131 131 132 132 private: 133 133 multiplex_t *mplex; 134 int fd_out; 134 135 }; 135 136 136 137 class MPEG2fixup -
programs/mythtranscode/mpeg2fix.cpp
448 448 449 449 MPEG2replex::MPEG2replex() : 450 450 done(0), otype(0), 451 ext_count(0), mplex(0) 451 ext_count(0), mplex(0), fd_out(0) 452 452 { 453 453 memset(&vrbuf, 0, sizeof(vrbuf)); 454 454 memset(extrbuf, 0, sizeof(extrbuf)); … … 474 474 if (index_extrbuf[i].size) 475 475 ring_destroy(&index_extrbuf[i]); 476 476 } 477 if (fd_out) 478 close(fd_out); 477 479 } 478 480 479 481 int MPEG2replex::WaitBuffers() … … 530 532 531 533 532 534 int video_delay = 0, audio_delay = 0; 533 int fd_out;534 535 535 536 memset(&mx, 0, sizeof(mx)); 536 537 memset(ext_ok, 0, sizeof(ext_ok)); … … 538 539 mx.priv = (void *)this; 539 540 540 541 fd_out = open(outfile, O_WRONLY | O_CREAT | O_TRUNC | O_LARGEFILE, 0644); 542 #ifdef USING_MINGW 543 _setmode(fd_out, _O_BINARY); 544 #endif 541 545 542 546 //await buffer fill 543 547 pthread_mutex_lock(&mutex); … … 1010 1014 VERBOSE(MPF_IMPORTANT, QString("Couldn't open file %1").arg(filename)); 1011 1015 return; 1012 1016 } 1017 #ifdef USING_MINGW 1018 _setmode(fh, _O_BINARY); 1019 #endif 1013 1020 1014 1021 write(fh, info->display_fbuf->buf[0], 1015 1022 info->sequence->width * info->sequence->height); … … 1027 1034 VERBOSE(MPF_IMPORTANT, QString("Couldn't open file %1").arg(filename)); 1028 1035 return; 1029 1036 } 1037 #ifdef USING_MINGW 1038 _setmode(fh, _O_BINARY); 1039 #endif 1030 1040 1031 1041 write(fh, data, size); 1032 1042 close(fh); -
libs/libmythtv/NuppelVideoRecorder.cpp
10 10 #elif HAVE_SOUNDCARD_H 11 11 #include <soundcard.h> 12 12 #endif 13 #ifndef USING_MINGW 13 14 #include <sys/ioctl.h> 14 15 #include <sys/mman.h> 16 #endif 15 17 #include <cerrno> 16 18 #include <cmath> 17 19 … … 778 780 */ 779 781 bool NuppelVideoRecorder::MJPEGInit(void) 780 782 { 783 #ifndef USING_MINGW 781 784 bool we_opened_fd = false; 782 785 int init_fd = fd; 783 786 if (init_fd < 0) … … 819 822 hmjpg_maxw = 640; 820 823 return true; 821 824 } 822 825 #endif // !USING_MINGW 823 826 VERBOSE(VB_IMPORTANT, LOC_ERR + "MJPEG not supported by device"); 824 827 return false; 825 828 } … … 966 969 967 970 void NuppelVideoRecorder::ProbeV4L2(void) 968 971 { 972 #ifndef USING_MINGW 969 973 usingv4l2 = true; 970 974 971 975 struct v4l2_capability vcap; … … 995 999 QString driver = (char *)vcap.driver; 996 1000 if (driver == "go7007") 997 1001 go7007 = true; 1002 #endif // !USING_MINGW 998 1003 } 999 1004 1000 1005 void NuppelVideoRecorder::StartRecording(void) … … 1073 1078 1074 1079 void NuppelVideoRecorder::DoV4L(void) 1075 1080 { 1081 #ifndef USING_MINGW 1076 1082 struct video_capability vc; 1077 1083 struct video_mmap mm; 1078 1084 struct video_mbuf vm; … … 1255 1261 1256 1262 recording = false; 1257 1263 close(fd); 1264 #endif // !USING_MINGW 1258 1265 } 1259 1266 1260 1267 void NuppelVideoRecorder::DoV4L2(void) 1261 1268 { 1269 #ifndef USING_MINGW 1262 1270 struct v4l2_format vfmt; 1263 1271 struct v4l2_buffer vbuf; 1264 1272 struct v4l2_requestbuffers vrbuf; … … 1612 1620 recording = false; 1613 1621 close(fd); 1614 1622 close(channelfd); 1623 #endif // !USING_MINGW 1615 1624 } 1616 1625 1617 1626 void NuppelVideoRecorder::DoMJPEG(void) 1618 1627 { 1628 #ifndef USING_MINGW 1619 1629 struct mjpeg_params bparm; 1620 1630 1621 1631 if (ioctl(fd, MJPIOC_G_PARAMS, &bparm) < 0) … … 1748 1758 1749 1759 recording = false; 1750 1760 close(fd); 1761 #endif // !USING_MINGW 1751 1762 } 1752 1763 1753 1764 int NuppelVideoRecorder::SpawnChildren(void) … … 2647 2658 2648 2659 void NuppelVideoRecorder::doVbiThread(void) 2649 2660 { 2661 #ifndef USING_MINGW 2650 2662 //VERBOSE(VB_IMPORTANT, LOC + "vbi begin"); 2651 2663 struct VBIData vbicallbackdata; 2652 2664 struct vbi *pal_tt = NULL; … … 2793 2805 cc_close(ntsc_cc); 2794 2806 2795 2807 //VERBOSE(VB_RECORD, LOC + "vbi end"); 2808 #endif // !USING_MINGW 2796 2809 } 2797 2810 2798 2811 -
libs/libmythtv/libmythtv.pro
583 583 DEFINES += USING_D3D 584 584 585 585 HEADERS += videoout_d3d.h 586 SOURCES -= NuppelVideoRecorder.cpp587 586 SOURCES += videoout_d3d.cpp 588 587 589 588 LIBS += -lpthread