Merge remote-tracking branch 'mjbudd77/master'

This commit is contained in:
mjbudd77 2021-09-17 22:27:25 -04:00
commit fd2560a283
7 changed files with 1273 additions and 66 deletions

View File

@ -22,18 +22,24 @@ cd build
mkdir bin
curl -s -LO http://www.libsdl.org/release/SDL2-devel-2.0.14-VC.zip
curl -s -LO https://github.com/GyanD/codexffmpeg/releases/download/4.4/ffmpeg-4.4-full_build-shared.zip
REM rmdir /q /s SDL2
powershell -command "Expand-Archive" SDL2-devel-2.0.14-VC.zip .
powershell -command "Expand-Archive" ffmpeg-4.4-full_build-shared.zip
rename SDL2-2.0.14 SDL2
move ffmpeg-4.4-full_build-shared\ffmpeg-4.4-full_build-shared ffmpeg
rmdir ffmpeg-4.4-full_build-shared
del ffmpeg-4.4-full_build-shared.zip
set SDL_INSTALL_PREFIX=%CD%
set FFMPEG_INSTALL_PREFIX=%CD%
REM cmake -h
REM cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release -DSDL_INSTALL_PREFIX=%SDL_INSTALL_PREFIX% ..
cmake -DQT6=0 -DSDL_INSTALL_PREFIX=%SDL_INSTALL_PREFIX% ..
cmake -DQT6=0 -DSDL_INSTALL_PREFIX=%SDL_INSTALL_PREFIX% -DUSE_LIBAV=1 -DFFMPEG_INSTALL_PREFIX=%FFMPEG_INSTALL_PREFIX% ..
REM nmake
msbuild /m fceux.sln /p:Configuration=Release
@ -41,6 +47,7 @@ msbuild /m fceux.sln /p:Configuration=Release
copy src\Release\fceux.exe bin\qfceux.exe
copy %SDL_INSTALL_PREFIX%\SDL2\lib\x64\SDL2.dll bin\.
copy %FFMPEG_INSTALL_PREFIX%\ffmpeg\bin\*.dll bin\.
windeployqt --no-compiler-runtime bin\qfceux.exe

View File

@ -36,6 +36,17 @@ if(WIN32)
set( SDL2_LDFLAGS ${SDL_INSTALL_PREFIX}/SDL2/lib/x64/SDL2.lib )
set( SYS_LIBS wsock32 ws2_32 vfw32 Htmlhelp )
set(APP_ICON_RESOURCES_WINDOWS ${CMAKE_SOURCE_DIR}/icons/fceux.rc )
if ( ${USE_LIBAV} )
add_definitions( -D_USE_LIBAV ${LIBAV_CFLAGS} )
include_directories( ${FFMPEG_INSTALL_PREFIX}/ffmpeg/include )
set( LIBAV_LDFLAGS ${FFMPEG_INSTALL_PREFIX}/ffmpeg/lib/avcodec.lib
${FFMPEG_INSTALL_PREFIX}/ffmpeg/lib/avformat.lib
${FFMPEG_INSTALL_PREFIX}/ffmpeg/lib/avutil.lib
${FFMPEG_INSTALL_PREFIX}/ffmpeg/lib/swscale.lib
${FFMPEG_INSTALL_PREFIX}/ffmpeg/lib/swresample.lib )
endif()
else(WIN32)
# Non Windows System
# UNIX (Linux or Mac OSX)
@ -90,6 +101,13 @@ else(WIN32)
add_definitions( -D_USE_X265 ${X265_CFLAGS} )
endif()
pkg_check_modules( LIBAV libavcodec libavformat libavutil libswresample libswscale)
if ( ${LIBAV_FOUND} )
message( STATUS "Using System Libav Library ${LIBAV_VERSION}" )
add_definitions( -D_USE_LIBAV ${LIBAV_CFLAGS} )
endif()
#pkg_check_modules( GL gl) # Use built in find package instead for OpenGL
# Check for OpenGL
@ -547,7 +565,7 @@ target_link_libraries( ${APP_NAME}
${OPENGL_LDFLAGS}
${SDL2_LDFLAGS}
${MINIZIP_LDFLAGS} ${ZLIB_LIBRARIES}
${LUA_LDFLAGS} ${X264_LDFLAGS} ${X265_LDFLAGS}
${LUA_LDFLAGS} ${X264_LDFLAGS} ${X265_LDFLAGS} ${LIBAV_LDFLAGS}
${SYS_LIBS}
)

File diff suppressed because it is too large Load Diff

View File

@ -10,6 +10,9 @@
#include <list>
#include <QThread>
#include <QLabel>
#include <QComboBox>
#include <QGroupBox>
enum aviEncoderList
{
@ -21,6 +24,9 @@ enum aviEncoderList
#ifdef _USE_X265
AVI_X265,
#endif
#ifdef _USE_LIBAV
AVI_LIBAV,
#endif
#ifdef WIN32
AVI_VFW,
#endif
@ -65,4 +71,30 @@ class AviRecordDiskThread_t : public QThread
signals:
void finished(void);
};
#ifdef _USE_LIBAV
class LibavOptionsPage : public QWidget
{
Q_OBJECT
public:
LibavOptionsPage(QWidget *parent = nullptr);
~LibavOptionsPage(void);
protected:
QComboBox *videoEncSel;
QComboBox *audioEncSel;
QGroupBox *videoGbox;
QGroupBox *audioGbox;
void initCodecLists(void);
void initPixelFormatSelect(const char *codec_name);
private slots:
void videoCodecChanged(int idx);
void audioCodecChanged(int idx);
};
#endif
#endif

View File

@ -35,21 +35,29 @@
#include "Qt/input.h"
#include "Qt/config.h"
#include "Qt/keyscan.h"
#include "Qt/AviRecord.h"
#include "Qt/fceuWrapper.h"
#include "Qt/MovieOptions.h"
//----------------------------------------------------------------------------
MovieOptionsDialog_t::MovieOptionsDialog_t(QWidget *parent)
: QDialog(parent)
: QDialog(parent, Qt::Window)
{
QLabel *lbl;
QVBoxLayout *mainLayout;
QGroupBox *gbox;
QHBoxLayout *mainLayout;
QHBoxLayout *hbox;
QVBoxLayout *vbox1, *vbox2;
QPushButton *closeButton;
std::vector <std::string> aviDriverList;
setWindowTitle("Movie Options");
mainLayout = new QVBoxLayout();
mainLayout = new QHBoxLayout();
vbox1 = new QVBoxLayout();
vbox2 = new QVBoxLayout();
mainLayout->addLayout(vbox1);
readOnlyReplay = new QCheckBox(tr("Always Suggest Read-Only Replay"));
pauseAfterPlay = new QCheckBox(tr("Pause After Playback"));
@ -63,15 +71,15 @@ MovieOptionsDialog_t::MovieOptionsDialog_t(QWidget *parent)
lbl = new QLabel(tr("Loading states in record mode will not immediately truncate movie, next frame input will. (VBA-rr and SNES9x style)"));
lbl->setWordWrap(true);
mainLayout->addWidget(readOnlyReplay);
mainLayout->addWidget(pauseAfterPlay);
mainLayout->addWidget(closeAfterPlay);
mainLayout->addWidget(bindSaveStates);
mainLayout->addWidget(dpySubTitles);
mainLayout->addWidget(putSubTitlesAvi);
mainLayout->addWidget(autoBackUp);
mainLayout->addWidget(loadFullStates);
mainLayout->addWidget(lbl);
vbox1->addWidget(readOnlyReplay);
vbox1->addWidget(pauseAfterPlay);
vbox1->addWidget(closeAfterPlay);
vbox1->addWidget(bindSaveStates);
vbox1->addWidget(dpySubTitles);
vbox1->addWidget(putSubTitlesAvi);
vbox1->addWidget(autoBackUp);
vbox1->addWidget(loadFullStates);
vbox1->addWidget(lbl);
readOnlyReplay->setChecked(suggestReadOnlyReplay);
pauseAfterPlay->setChecked(pauseAfterPlayback);
@ -89,8 +97,46 @@ MovieOptionsDialog_t::MovieOptionsDialog_t(QWidget *parent)
hbox = new QHBoxLayout();
hbox->addStretch(5);
hbox->addWidget( closeButton, 1 );
mainLayout->addLayout( hbox );
vbox1->addLayout( hbox );
FCEUD_AviGetFormatOpts( aviDriverList );
gbox = new QGroupBox( tr("AVI Recording Options") );
gbox->setLayout(vbox2);
mainLayout->addWidget(gbox);
hbox = new QHBoxLayout();
aviBackend = new QComboBox();
aviPageStack = new QStackedWidget();
lbl = new QLabel(tr("AVI Backend Driver:"));
hbox->addWidget( lbl );
hbox->addWidget( aviBackend );
vbox2->addLayout( hbox );
vbox2->addWidget( aviPageStack );
for (size_t i=0; i<aviDriverList.size(); i++)
{
aviBackend->addItem(tr(aviDriverList[i].c_str()), (unsigned int)i);
switch (i)
{
#ifdef _USE_LIBAV
case AVI_LIBAV:
{
aviPageStack->addWidget( new LibavOptionsPage() );
}
break;
#endif
default:
aviPageStack->addWidget( new QWidget() );
break;
}
if ( i == aviGetSelVideoFormat() )
{
aviBackend->setCurrentIndex(i);
aviPageStack->setCurrentIndex(i);
}
}
setLayout(mainLayout);
connect(readOnlyReplay, SIGNAL(stateChanged(int)), this, SLOT(readOnlyReplayChanged(int)));
@ -101,6 +147,9 @@ MovieOptionsDialog_t::MovieOptionsDialog_t(QWidget *parent)
connect(putSubTitlesAvi, SIGNAL(stateChanged(int)), this, SLOT(putSubTitlesAviChanged(int)));
connect(autoBackUp, SIGNAL(stateChanged(int)), this, SLOT(autoBackUpChanged(int)));
connect(loadFullStates, SIGNAL(stateChanged(int)), this, SLOT(loadFullStatesChanged(int)));
connect(aviBackend, SIGNAL(currentIndexChanged(int)), this, SLOT(aviBackendChanged(int)));
}
//----------------------------------------------------------------------------
MovieOptionsDialog_t::~MovieOptionsDialog_t(void)
@ -165,3 +214,8 @@ void MovieOptionsDialog_t::loadFullStatesChanged(int state)
fullSaveStateLoads = (state != Qt::Unchecked);
}
//----------------------------------------------------------------------------
void MovieOptionsDialog_t::aviBackendChanged(int idx)
{
aviPageStack->setCurrentIndex(idx);
}
//----------------------------------------------------------------------------

View File

@ -15,6 +15,7 @@
#include <QGroupBox>
#include <QTreeView>
#include <QTreeWidget>
#include <QStackedWidget>
#include "Qt/main.h"
@ -37,6 +38,8 @@ protected:
QCheckBox *putSubTitlesAvi;
QCheckBox *autoBackUp;
QCheckBox *loadFullStates;
QComboBox *aviBackend;
QStackedWidget *aviPageStack;
private:
public slots:
@ -50,4 +53,5 @@ private slots:
void putSubTitlesAviChanged(int state);
void autoBackUpChanged(int state);
void loadFullStatesChanged(int state);
void aviBackendChanged(int idx);
};

View File

@ -595,14 +595,20 @@ InitConfig()
config->addOption("recordhud", "SDL.RecordHUD", 0);
config->addOption("moviemsg", "SDL.MovieMsg", 0);
#ifdef _USE_X264
config->addOption("SDL.AviVideoFormat", AVI_X264);
#ifdef _USE_LIBAV
config->addOption("SDL.AviVideoFormat", AVI_LIBAV);
#elif WIN32
config->addOption("SDL.AviVideoFormat", AVI_VFW);
#elif _USE_X264
config->addOption("SDL.AviVideoFormat", AVI_X264);
#else
config->addOption("SDL.AviVideoFormat", AVI_RGB24);
#endif
#ifdef _USE_LIBAV
config->addOption("SDL.AviFFmpegVideoCodec", "");
config->addOption("SDL.AviFFmpegAudioCodec", "");
#endif
#ifdef WIN32
config->addOption("SDL.AviVfwFccHandler", "");
#endif