vice-emu-commit Mailing List for VICE (Page 15)
Versatile Commodore Emulator
Brought to you by:
blackystardust,
gpz
You can subscribe to this list here.
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
(38) |
May
(60) |
Jun
(122) |
Jul
(148) |
Aug
(178) |
Sep
(151) |
Oct
(131) |
Nov
(208) |
Dec
(129) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2009 |
Jan
(193) |
Feb
(209) |
Mar
(221) |
Apr
(243) |
May
(165) |
Jun
(168) |
Jul
(198) |
Aug
(161) |
Sep
(103) |
Oct
(98) |
Nov
(168) |
Dec
(99) |
| 2010 |
Jan
(263) |
Feb
(156) |
Mar
(57) |
Apr
(93) |
May
(85) |
Jun
(124) |
Jul
(57) |
Aug
(58) |
Sep
(113) |
Oct
(148) |
Nov
(114) |
Dec
(193) |
| 2011 |
Jan
(200) |
Feb
(207) |
Mar
(91) |
Apr
(91) |
May
(142) |
Jun
(104) |
Jul
(115) |
Aug
(137) |
Sep
(266) |
Oct
(91) |
Nov
(85) |
Dec
(186) |
| 2012 |
Jan
(98) |
Feb
(146) |
Mar
(160) |
Apr
(99) |
May
(59) |
Jun
(257) |
Jul
(84) |
Aug
(103) |
Sep
(169) |
Oct
(206) |
Nov
(90) |
Dec
(296) |
| 2013 |
Jan
(294) |
Feb
(130) |
Mar
(36) |
Apr
(14) |
May
(51) |
Jun
(74) |
Jul
(180) |
Aug
(85) |
Sep
(26) |
Oct
(45) |
Nov
(29) |
Dec
(21) |
| 2014 |
Jan
(56) |
Feb
(40) |
Mar
(57) |
Apr
(30) |
May
(31) |
Jun
(11) |
Jul
(107) |
Aug
(135) |
Sep
(142) |
Oct
(195) |
Nov
(139) |
Dec
(133) |
| 2015 |
Jan
(293) |
Feb
(161) |
Mar
(146) |
Apr
(85) |
May
(139) |
Jun
(51) |
Jul
(21) |
Aug
(24) |
Sep
(29) |
Oct
(136) |
Nov
(212) |
Dec
(118) |
| 2016 |
Jan
(119) |
Feb
(165) |
Mar
(229) |
Apr
(219) |
May
(134) |
Jun
(119) |
Jul
(134) |
Aug
(236) |
Sep
(203) |
Oct
(215) |
Nov
(300) |
Dec
(140) |
| 2017 |
Jan
(188) |
Feb
(20) |
Mar
(147) |
Apr
(198) |
May
(26) |
Jun
(21) |
Jul
(67) |
Aug
(219) |
Sep
(209) |
Oct
(194) |
Nov
(144) |
Dec
(99) |
| 2018 |
Jan
(139) |
Feb
(122) |
Mar
(116) |
Apr
(85) |
May
(232) |
Jun
(181) |
Jul
(190) |
Aug
(105) |
Sep
(92) |
Oct
(178) |
Nov
(105) |
Dec
(86) |
| 2019 |
Jan
(119) |
Feb
(79) |
Mar
(74) |
Apr
(117) |
May
(115) |
Jun
(307) |
Jul
(107) |
Aug
(131) |
Sep
(103) |
Oct
(60) |
Nov
(118) |
Dec
(70) |
| 2020 |
Jan
(114) |
Feb
(103) |
Mar
(77) |
Apr
(121) |
May
(193) |
Jun
(110) |
Jul
(214) |
Aug
(210) |
Sep
(179) |
Oct
(260) |
Nov
(237) |
Dec
(334) |
| 2021 |
Jan
(163) |
Feb
(186) |
Mar
(58) |
Apr
(81) |
May
(108) |
Jun
(175) |
Jul
(154) |
Aug
(180) |
Sep
(217) |
Oct
(204) |
Nov
(232) |
Dec
(190) |
| 2022 |
Jan
(253) |
Feb
(134) |
Mar
(229) |
Apr
(190) |
May
(125) |
Jun
(70) |
Jul
(8) |
Aug
(22) |
Sep
(19) |
Oct
(33) |
Nov
(94) |
Dec
(164) |
| 2023 |
Jan
(158) |
Feb
(366) |
Mar
(272) |
Apr
(109) |
May
(198) |
Jun
(226) |
Jul
(200) |
Aug
(94) |
Sep
(108) |
Oct
(62) |
Nov
(175) |
Dec
(116) |
| 2024 |
Jan
(35) |
Feb
(40) |
Mar
(51) |
Apr
(89) |
May
(24) |
Jun
(26) |
Jul
(53) |
Aug
(71) |
Sep
(23) |
Oct
(11) |
Nov
(22) |
Dec
(58) |
| 2025 |
Jan
(26) |
Feb
(40) |
Mar
(107) |
Apr
(39) |
May
(35) |
Jun
(20) |
Jul
(11) |
Aug
(24) |
Sep
(35) |
Oct
(28) |
Nov
|
Dec
|
|
From: <co...@us...> - 2025-01-10 11:10:19
|
Revision: 45458
http://sourceforge.net/p/vice-emu/code/45458
Author: compyx
Date: 2025-01-10 11:10:18 +0000 (Fri, 10 Jan 2025)
Log Message:
-----------
Remove assigned-but-unused variable
Modified Paths:
--------------
trunk/vice/src/arch/shared/archdep_spawn.c
Modified: trunk/vice/src/arch/shared/archdep_spawn.c
===================================================================
--- trunk/vice/src/arch/shared/archdep_spawn.c 2025-01-10 01:38:21 UTC (rev 45457)
+++ trunk/vice/src/arch/shared/archdep_spawn.c 2025-01-10 11:10:18 UTC (rev 45458)
@@ -125,7 +125,6 @@
return -1;
} else {
if (child_pid == 0) {
- int res;
/* child - CAUTION: log system does not work here */
if (stdout_redir && freopen(stdout_redir, "w", stdout) == NULL) {
stdout_errno = errno;
@@ -135,7 +134,7 @@
stderr_errno = errno;
_exit(-1);
}
- res = execvp(name, argv);
+ execvp(name, argv);
/* execvp should never return, except when there was some error */
_exit(-1);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gp...@us...> - 2025-01-10 01:38:26
|
Revision: 45457
http://sourceforge.net/p/vice-emu/code/45457
Author: gpz
Date: 2025-01-10 01:38:21 +0000 (Fri, 10 Jan 2025)
Log Message:
-----------
improve the test for whether ffmpeg executable exists, cycle through a port range when launching the executable, so ports that are still lingering will not block
Modified Paths:
--------------
trunk/vice/src/gfxoutputdrv/ffmpegexedrv.c
Modified: trunk/vice/src/gfxoutputdrv/ffmpegexedrv.c
===================================================================
--- trunk/vice/src/gfxoutputdrv/ffmpegexedrv.c 2025-01-09 23:38:17 UTC (rev 45456)
+++ trunk/vice/src/gfxoutputdrv/ffmpegexedrv.c 2025-01-10 01:38:21 UTC (rev 45457)
@@ -222,8 +222,10 @@
#define AUDIO_SKIP_SECONDS 4
-#define SOCKETS_VIDEO_PORT 60000
-#define SOCKETS_AUDIO_PORT 60001
+#define SOCKETS_RANGE_FIRST 53248
+#define SOCKETS_RANGE_LAST 57343
+static int current_video_port = SOCKETS_RANGE_FIRST;
+static int current_audio_port = SOCKETS_RANGE_FIRST + 1;
/* input video stream */
#define INPUT_VIDEO_BPP 3
@@ -436,6 +438,17 @@
DBG(("%s FFMPEGVideoHalveFramerate:%d", func, video_halve_framerate));
}
+static void prepare_port_numbers(void)
+{
+ current_video_port += 2;
+ current_audio_port += 2;
+ if (current_audio_port > SOCKETS_RANGE_LAST) {
+ current_video_port = SOCKETS_RANGE_FIRST;
+ current_audio_port = SOCKETS_RANGE_FIRST + 1;
+ }
+ log_message(ffmpeg_log, "prepare_port_numbers %d:%d", current_video_port, current_audio_port);
+}
+
static ssize_t write_video_frame(VIDEOFrame *pic)
{
ssize_t len = INPUT_VIDEO_BPP * video_height * video_width;
@@ -531,6 +544,7 @@
static int test_ffmpeg_executable(void)
{
+#if 0
int ret;
char *argv[5];
/* `exec*()' does not want these to be constant... */
@@ -547,11 +561,77 @@
lib_free(argv[2]);
lib_free(argv[3]);
+ /* NOTE: ffmpeg returns 1 (not 0) on success */
if (ret != 1) {
- log_error(ffmpeg_log, "ffmpeg executable can not be started.");
+ log_error(ffmpeg_log, "ffmpeg executable can not be started. (ret:%d)", ret);
return -1;
}
return 0;
+#else
+ static int test_stdin = -1;
+ static int test_stdout = -1;
+ static vice_pid_t test_pid = -1;
+ int res = -1;
+ size_t n;
+ static char output[0x40];
+ static char command[0x40] = {
+ "ffmpeg 2>&1" /* redirect stderr to stdout. this better works on the big 3 */
+ };
+ /* kill old process in case it is still running for whatever reason */
+ if (test_pid != -1) {
+ kill_coproc(test_pid);
+ test_pid = -1;
+ }
+ if (test_stdin != -1) {
+ close(test_stdin);
+ test_stdin = -1;
+ }
+ if (test_stdout != -1) {
+ close(test_stdout);
+ test_stdout = -1;
+ }
+ DBG(("test_ffmpeg_executable: '%s'", command));
+ /*log_printf("fork command:%s", command);*/
+ if (fork_coproc(&test_stdin, &test_stdout, command, &test_pid) < 0) {
+ log_error(ffmpeg_log, "Cannot fork ffmpeg process '%s'.", command);
+ goto testend;
+ }
+ /*log_printf("test_ffmpeg_executable pid:%d stdin:%d stdout:%d", test_pid, test_stdin, test_stdout);*/
+ if (test_pid <= 0) {
+ log_error(ffmpeg_log, "Cannot fork ffmpeg process '%s' (pid <= 0).", command);
+ goto testend;
+ }
+
+ /* FIXME: stdout is 0 on error ? */
+ if (test_stdout) {
+ memset(output, 0, 0x40);
+ n = read(test_stdout, output, 0x3f);
+ /*log_printf("test_ffmpeg_executable got: '%s'", output);*/
+ output[6] = 0;
+ if ((n >= 6) && !strcmp("ffmpeg", output)) {
+ res = 0;
+ /*log_printf("test_ffmpeg_executable tested ok");*/
+ }
+ }
+ if (res < 0) {
+ log_error(ffmpeg_log, "ffmpeg not found.\n");
+ }
+testend:
+ /* kill new process */
+ if (test_pid != -1) {
+ kill_coproc(test_pid);
+ test_pid = -1;
+ }
+ if (test_stdin != -1) {
+ close(test_stdin);
+ test_stdin = -1;
+ }
+ if (test_stdout != -1) {
+ close(test_stdout);
+ test_stdout = -1;
+ }
+ return res;
+#endif
}
static int start_ffmpeg_executable(void)
@@ -607,7 +687,7 @@
#endif
, fpsstring, fpsstring
, video_width, video_height
- , SOCKETS_VIDEO_PORT
+ , current_video_port
);
strcat(command, tempcommand);
}
@@ -629,7 +709,7 @@
, audio_input_channels
, audio_input_sample_rate
, AUDIO_SKIP_SECONDS
- , SOCKETS_AUDIO_PORT
+ , current_audio_port
);
strcat(command, tempcommand);
}
@@ -686,7 +766,7 @@
if ((video_has_codec > 0) && (video_codec != AV_CODEC_ID_NONE)) {
vice_network_socket_address_t *ad = NULL;
- ad = vice_network_address_generate("127.0.0.1", SOCKETS_VIDEO_PORT);
+ ad = vice_network_address_generate("127.0.0.1", current_video_port);
if (!ad) {
log_error(ffmpeg_log, "Bad device name.\n");
return -1;
@@ -722,7 +802,7 @@
if ((audio_has_codec > 0) && (audio_codec != AV_CODEC_ID_NONE)) {
vice_network_socket_address_t *ad = NULL;
- ad = vice_network_address_generate("127.0.0.1", SOCKETS_AUDIO_PORT);
+ ad = vice_network_address_generate("127.0.0.1", current_audio_port);
if (!ad) {
log_error(ffmpeg_log, "Bad device name.\n");
return -1;
@@ -858,6 +938,8 @@
ffmpeg_pid = 0;
}
#endif
+
+ prepare_port_numbers();
}
/*****************************************************************************
@@ -1155,12 +1237,18 @@
if (test_ffmpeg_executable() < 0) {
screenshot_stop_recording();
- ui_error("ffmpeg executable could not be started.");
- /* Do not return -1, since that would just pop up a second error message,
- which will eventually appear behind the main window, and make the UI
- seem to hang. We can do this, since there is no further error handling
- depending on the return value. */
- return 0;
+ sleep(1);
+ if (test_ffmpeg_executable() < 0) {
+ sleep(1);
+ if (test_ffmpeg_executable() < 0) {
+ ui_error("ffmpeg executable could not be started.");
+ /* Do not return -1, since that would just pop up a second error message,
+ which will eventually appear behind the main window, and make the UI
+ seem to hang. We can do this, since there is no further error handling
+ depending on the return value. */
+ return 0;
+ }
+ }
}
log_resource_values(__FUNCTION__);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gp...@us...> - 2025-01-09 23:38:19
|
Revision: 45456
http://sourceforge.net/p/vice-emu/code/45456
Author: gpz
Date: 2025-01-09 23:38:17 +0000 (Thu, 09 Jan 2025)
Log Message:
-----------
some refactoring, comments, use fork() instead of vfork(), print log messages in parent context
Modified Paths:
--------------
trunk/vice/src/arch/shared/archdep_spawn.c
Modified: trunk/vice/src/arch/shared/archdep_spawn.c
===================================================================
--- trunk/vice/src/arch/shared/archdep_spawn.c 2025-01-09 23:37:07 UTC (rev 45455)
+++ trunk/vice/src/arch/shared/archdep_spawn.c 2025-01-09 23:38:17 UTC (rev 45456)
@@ -28,6 +28,33 @@
*
*/
+/*
+ calls an external program, waits for it to finish, and returns status
+
+ name file name of external program
+ - If the name contains slashes ("/"), the program at the exact
+ location will be executed.
+ - else PATH will be used to search for the binary
+ argv array of pointers to arguments
+ The char *const argv[] argument is an array of pointers to null-terminated
+ strings that represent the argument list available to the new program.
+ The first argument, by convention, should point to the filename associated with
+ the file being executed. The array of pointers must be terminated by a null pointer.
+
+ pstdout_redir pointer to name of file to redirect stdout to
+ - if file name is empty, a temporary name will be created
+ - no redirection if NULL
+ stderr_redir name of file to redirect stderr to
+ - no redirection if NULL
+
+ returns: -1 on errors
+ any other returncode of the called process
+*/
+
+/* this code is currently used to spawn sub processes in:
+ src/zfile.c
+ src/arch/gtk3/actions-help.c (fallback for gtk_show_uri_on_window)
+*/
#include "vice.h"
#include "archdep_defs.h"
@@ -65,7 +92,7 @@
/* #define DEBUG_SPAWN */
#ifdef DEBUG_SPAWN
-#define LOG(a) log_printf a
+#define LOG(a) log_printf a
#else
#define LOG(a)
#endif
@@ -75,11 +102,13 @@
int archdep_spawn(const char *name, char **argv,
char **pstdout_redir, const char *stderr_redir)
{
+ pid_t pid;
pid_t child_pid;
- int child_status;
+ int child_status = 0;
char *stdout_redir;
+ int stdout_errno = 0;
+ int stderr_errno = 0;
-
if (pstdout_redir != NULL) {
if (*pstdout_redir == NULL) {
*pstdout_redir = archdep_tmpnam();
@@ -89,35 +118,49 @@
stdout_redir = NULL;
}
- child_pid = vfork();
+ log_message(LOG_DEFAULT, "Spawn: forking process '%s'", name);
+ child_pid = fork();
if (child_pid < 0) {
- log_error(LOG_DEFAULT, "vfork() failed: %s.", strerror(errno));
+ log_error(LOG_DEFAULT, "fork() failed: %s.", strerror(errno));
return -1;
} else {
if (child_pid == 0) {
+ int res;
+ /* child - CAUTION: log system does not work here */
if (stdout_redir && freopen(stdout_redir, "w", stdout) == NULL) {
- log_error(LOG_DEFAULT, "freopen(\"%s\") failed: %s.", stdout_redir, strerror(errno));
+ stdout_errno = errno;
_exit(-1);
}
if (stderr_redir && freopen(stderr_redir, "w", stderr) == NULL) {
- log_error(LOG_DEFAULT, "freopen(\"%s\") failed: %s.", stderr_redir, strerror(errno));
+ stderr_errno = errno;
_exit(-1);
}
- execvp(name, argv);
+ res = execvp(name, argv);
+ /* execvp should never return, except when there was some error */
_exit(-1);
}
}
- if (waitpid(child_pid, &child_status, 0) != child_pid) {
- log_error(LOG_DEFAULT, "waitpid() failed: %s", strerror(errno));
+ /* wait for the child to finish */
+ if ((pid = waitpid(child_pid, &child_status, 0)) != child_pid) {
+ log_error(LOG_DEFAULT, "waitpid(%d) got pid %d (%d): %s",
+ child_pid, pid, errno, strerror(errno));
return -1;
}
+ /* output the log messages in parent context */
+ if (stdout_errno) {
+ log_error(LOG_DEFAULT, "freopen(\"%s\") failed: %s.", stdout_redir, strerror(stdout_errno));
+ }
+ if (stderr_errno) {
+ log_error(LOG_DEFAULT, "freopen(\"%s\") failed: %s.", stderr_redir, strerror(stderr_errno));
+ }
+
+ LOG(("WIFEXITED(child_status):%d", WIFEXITED(child_status)));
if (WIFEXITED(child_status)) {
return WEXITSTATUS(child_status);
- } else {
- return -1;
}
+ return -1;
}
#elif defined(WINDOWS_COMPILE)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gp...@us...> - 2025-01-09 23:37:08
|
Revision: 45455
http://sourceforge.net/p/vice-emu/code/45455
Author: gpz
Date: 2025-01-09 23:37:07 +0000 (Thu, 09 Jan 2025)
Log Message:
-----------
some refactoring, add comments, use full path to shell for argv[0]
Modified Paths:
--------------
trunk/vice/src/arch/shared/coproc.c
Modified: trunk/vice/src/arch/shared/coproc.c
===================================================================
--- trunk/vice/src/arch/shared/coproc.c 2025-01-09 21:09:29 UTC (rev 45454)
+++ trunk/vice/src/arch/shared/coproc.c 2025-01-09 23:37:07 UTC (rev 45455)
@@ -49,6 +49,22 @@
* installing an ignoring handler.
*/
+/*
+ spawns a shell and executes a shell command (which can be a program)
+ as a background process
+
+ cmd command to run
+
+ returns:
+
+ fd_wr stdin of the child process
+ fd_rd stdout of the child process
+ childpid PID of the child process (to be used with kill_coproc)
+
+ return value: 0:ok, -1:error
+
+*/
+
/* this code is currently used to spawn sub processes in:
- gfxoutputdrv/ffmpegexedrv.c
- printerdrv/output-text.c
@@ -58,6 +74,14 @@
#include "vice.h"
+/* #define DEBUG_COPROC */
+
+#ifdef DEBUG_COPROC
+#define DBG(x) log_printf x
+#else
+#define DBG(x)
+#endif
+
/* TODO: Perhaps implement fork_coproc() on Haiku using Haiku-specific code
* instead of relying on the POSIX compatibility layer? */
#if defined(UNIX_COMPILE) || defined(HAIKU_COMPILE)
@@ -87,7 +111,7 @@
int fork_coproc(int *fd_wr, int *fd_rd, char *cmd, vice_pid_t *childpid)
{
- int fd1[2], fd2[2];
+ int pipe_stdout_fd[2], pipe_stdin_fd[2];
vice_pid_t pid;
ignore.sa_handler = SIG_IGN;
@@ -97,47 +121,52 @@
sigaction(SIGCHLD, &ignore, NULL);
sigaction(SIGPIPE, &ignore, NULL);
- if (pipe(fd1) < 0) {
+ *fd_rd = *fd_wr = *childpid = -1;
+
+ if (pipe(pipe_stdout_fd) < 0) {
log_error(LOG_DEFAULT, "Coproc: Couldn't open pipe!");
return -1;
}
- if (pipe(fd2) < 0) {
+ if (pipe(pipe_stdin_fd) < 0) {
log_error(LOG_DEFAULT, "Coproc: Couldn't open pipe!");
- close(fd1[0]);
- close(fd1[1]);
+ close(pipe_stdout_fd[0]);
+ close(pipe_stdout_fd[1]);
return -1;
}
- log_message(LOG_DEFAULT, "forking process '%s'", cmd);
+
+ log_message(LOG_DEFAULT, "Coproc: forking process '%s'", cmd);
if ((pid = fork()) < 0) {
log_error(LOG_DEFAULT, "Coproc: Couldn't fork()!");
- close(fd1[0]);
- close(fd1[1]);
- close(fd2[0]);
- close(fd2[1]);
+ close(pipe_stdout_fd[0]);
+ close(pipe_stdout_fd[1]);
+ close(pipe_stdin_fd[0]);
+ close(pipe_stdin_fd[1]);
return -1;
- } else if (pid == 0) { /* child */
- close(fd1[0]);
- if (fd1[1] != STDOUT_FILENO) {
- dup2(fd1[1], STDOUT_FILENO);
- close(fd1[1]);
+ } else if (pid == 0) {
+ /* child */
+ close(pipe_stdout_fd[0]);
+ if (pipe_stdout_fd[1] != STDOUT_FILENO) {
+ dup2(pipe_stdout_fd[1], STDOUT_FILENO);
+ close(pipe_stdout_fd[1]);
}
- close(fd2[1]);
- if (fd2[0] != STDIN_FILENO) {
- dup2(fd2[0], STDIN_FILENO);
- close(fd2[0]);
+ close(pipe_stdin_fd[1]);
+ if (pipe_stdin_fd[0] != STDIN_FILENO) {
+ dup2(pipe_stdin_fd[0], STDIN_FILENO);
+ close(pipe_stdin_fd[0]);
}
/* Hm, we have to close all other files that are currently
open now... */
- execl(SHELL, "sh", "-c", cmd, NULL);
+ execl(SHELL, SHELL, "-c", cmd, NULL);
archdep_vice_exit(127); /* child dies on error */
- } else { /* parent */
- close(fd1[1]);
- close(fd2[0]);
+ } else {
+ /* parent */
+ close(pipe_stdout_fd[1]);
+ close(pipe_stdin_fd[0]);
- *fd_rd = fd1[0];
- *fd_wr = fd2[1];
+ *fd_rd = pipe_stdout_fd[0];
+ *fd_wr = pipe_stdin_fd[1];
*childpid = pid;
log_message(LOG_DEFAULT, "forked process id is: %d", pid);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gp...@us...> - 2025-01-09 21:09:32
|
Revision: 45454
http://sourceforge.net/p/vice-emu/code/45454
Author: gpz
Date: 2025-01-09 21:09:29 +0000 (Thu, 09 Jan 2025)
Log Message:
-----------
properly check return value of lib_mvsprintf, print an error and return if NULL. should fix #2112
Modified Paths:
--------------
trunk/vice/src/log.c
Modified: trunk/vice/src/log.c
===================================================================
--- trunk/vice/src/log.c 2025-01-08 13:26:45 UTC (rev 45453)
+++ trunk/vice/src/log.c 2025-01-09 21:09:29 UTC (rev 45454)
@@ -730,8 +730,13 @@
} else {
pretxt = lib_msprintf(LOG_COL_LWHITE "%s" LOG_COL_OFF ": %s", logs[logi], lvlstr);
}
+
/* build the log string */
logtxt = lib_mvsprintf(format, ap);
+ if (logtxt == NULL) {
+ fprintf(stderr, "log_helper: internal error (lib_mvsprintf returned NULL)\n");
+ return -1;
+ }
if ((log_to_file) || (!log_colorize)) {
nocolorpre = logskipcolors(pretxt);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <co...@us...> - 2025-01-08 13:26:47
|
Revision: 45453
http://sourceforge.net/p/vice-emu/code/45453
Author: compyx
Date: 2025-01-08 13:26:45 +0000 (Wed, 08 Jan 2025)
Log Message:
-----------
SDL: Add toggle buttons for "StartMinimized" and "StartMaximized" resources
Add toggle buttons to start the emulator minimized or maximized to the "Video settings" submenu.
Modified Paths:
--------------
trunk/vice/src/arch/sdl/menu_video.c
Modified: trunk/vice/src/arch/sdl/menu_video.c
===================================================================
--- trunk/vice/src/arch/sdl/menu_video.c 2025-01-07 16:45:34 UTC (rev 45452)
+++ trunk/vice/src/arch/sdl/menu_video.c 2025-01-08 13:26:45 UTC (rev 45453)
@@ -349,8 +349,9 @@
#endif
UI_MENU_DEFINE_INT(Window0Width)
UI_MENU_DEFINE_INT(Window0Height)
+UI_MENU_DEFINE_TOGGLE(StartMinimized)
+UI_MENU_DEFINE_TOGGLE(StartMaximized)
-
#define VICE_SDL_SIZE_MENU_DOUBLESIZE(chip) \
{ .string = "Double size", \
.type = MENU_ENTRY_RESOURCE_TOGGLE, \
@@ -816,6 +817,14 @@
.string = "Restore window size",
.type = MENU_ENTRY_OTHER,
},
+ { .string = "Start with minimized window",
+ .type = MENU_ENTRY_RESOURCE_TOGGLE,
+ .callback = toggle_StartMinimized_callback,
+ },
+ { .string = "Start with maximized window",
+ .type = MENU_ENTRY_RESOURCE_TOGGLE,
+ .callback = toggle_StartMaximized_callback,
+ },
SDL_MENU_ITEM_SEPARATOR,
{ .string = "VICII Video cache",
@@ -915,6 +924,14 @@
.string = "Restore window size",
.type = MENU_ENTRY_OTHER,
},
+ { .string = "Start with minimized window",
+ .type = MENU_ENTRY_RESOURCE_TOGGLE,
+ .callback = toggle_StartMinimized_callback,
+ },
+ { .string = "Start with maximized window",
+ .type = MENU_ENTRY_RESOURCE_TOGGLE,
+ .callback = toggle_StartMaximized_callback,
+ },
SDL_MENU_ITEM_SEPARATOR,
{ .string = "Video cache",
@@ -982,6 +999,14 @@
.string = "Restore window size",
.type = MENU_ENTRY_OTHER,
},
+ { .string = "Start with minimized window",
+ .type = MENU_ENTRY_RESOURCE_TOGGLE,
+ .callback = toggle_StartMinimized_callback,
+ },
+ { .string = "Start with maximized window",
+ .type = MENU_ENTRY_RESOURCE_TOGGLE,
+ .callback = toggle_StartMaximized_callback,
+ },
SDL_MENU_ITEM_SEPARATOR,
{ .string = "VICII border mode",
@@ -1047,6 +1072,14 @@
.string = "Restore window size",
.type = MENU_ENTRY_OTHER,
},
+ { .string = "Start with minimized window",
+ .type = MENU_ENTRY_RESOURCE_TOGGLE,
+ .callback = toggle_StartMinimized_callback,
+ },
+ { .string = "Start with maximized window",
+ .type = MENU_ENTRY_RESOURCE_TOGGLE,
+ .callback = toggle_StartMaximized_callback,
+ },
SDL_MENU_ITEM_SEPARATOR,
{ .string = "Video cache",
@@ -1124,6 +1157,14 @@
.string = "Restore window size",
.type = MENU_ENTRY_OTHER,
},
+ { .string = "Start with minimized window",
+ .type = MENU_ENTRY_RESOURCE_TOGGLE,
+ .callback = toggle_StartMinimized_callback,
+ },
+ { .string = "Start with maximized window",
+ .type = MENU_ENTRY_RESOURCE_TOGGLE,
+ .callback = toggle_StartMaximized_callback,
+ },
SDL_MENU_ITEM_SEPARATOR,
{ .string = "Video cache",
@@ -1204,6 +1245,14 @@
.string = "Restore window size",
.type = MENU_ENTRY_OTHER,
},
+ { .string = "Start with minimized window",
+ .type = MENU_ENTRY_RESOURCE_TOGGLE,
+ .callback = toggle_StartMinimized_callback,
+ },
+ { .string = "Start with maximized window",
+ .type = MENU_ENTRY_RESOURCE_TOGGLE,
+ .callback = toggle_StartMaximized_callback,
+ },
SDL_MENU_ITEM_SEPARATOR,
{ .string = "Video cache",
@@ -1252,6 +1301,14 @@
.string = "Restore window size",
.type = MENU_ENTRY_OTHER,
},
+ { .string = "Start with minimized window",
+ .type = MENU_ENTRY_RESOURCE_TOGGLE,
+ .callback = toggle_StartMinimized_callback,
+ },
+ { .string = "Start with maximized window",
+ .type = MENU_ENTRY_RESOURCE_TOGGLE,
+ .callback = toggle_StartMaximized_callback,
+ },
SDL_MENU_ITEM_SEPARATOR,
{ .string = "Video cache",
@@ -1300,6 +1357,14 @@
.string = "Restore window size",
.type = MENU_ENTRY_OTHER,
},
+ { .string = "Start with minimized window",
+ .type = MENU_ENTRY_RESOURCE_TOGGLE,
+ .callback = toggle_StartMinimized_callback,
+ },
+ { .string = "Start with maximized window",
+ .type = MENU_ENTRY_RESOURCE_TOGGLE,
+ .callback = toggle_StartMaximized_callback,
+ },
SDL_MENU_ITEM_SEPARATOR,
{ .string = "Video cache",
@@ -1379,6 +1444,14 @@
.string = "Restore window size",
.type = MENU_ENTRY_OTHER,
},
+ { .string = "Start with minimized window",
+ .type = MENU_ENTRY_RESOURCE_TOGGLE,
+ .callback = toggle_StartMinimized_callback,
+ },
+ { .string = "Start with maximized window",
+ .type = MENU_ENTRY_RESOURCE_TOGGLE,
+ .callback = toggle_StartMaximized_callback,
+ },
SDL_MENU_ITEM_SEPARATOR,
{ .string = "Video cache",
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <co...@us...> - 2025-01-07 16:45:36
|
Revision: 45452
http://sourceforge.net/p/vice-emu/code/45452
Author: compyx
Date: 2025-01-07 16:45:34 +0000 (Tue, 07 Jan 2025)
Log Message:
-----------
SDL: Add -maximized to SDL2 UI
Add command line options [-+]maxnimized to SDL UI (2.x only, 1.x doesn't have
any function or flag to properly maximize a window).
No menu item to toggle "StartMaximized", there isn't one for "StartMinimized"
either.
Modified Paths:
--------------
trunk/vice/src/arch/sdl/ui.c
trunk/vice/src/arch/sdl/video_sdl2.c
Modified: trunk/vice/src/arch/sdl/ui.c
===================================================================
--- trunk/vice/src/arch/sdl/ui.c 2025-01-06 19:15:38 UTC (rev 45451)
+++ trunk/vice/src/arch/sdl/ui.c 2025-01-07 16:45:34 UTC (rev 45452)
@@ -538,6 +538,7 @@
static int save_resources_on_exit;
static int confirm_on_exit;
static int start_minimized;
+static int start_maximized;
static int set_ui_menukey(int val, void *param)
{
@@ -574,14 +575,35 @@
* \param[in] val 0: start normal 1: start minimized
* \param[in] param extra param (ignored)
*
- * \return 0
+ * \return 0 on success, -1 if both minimized and maximized are requested
*/
static int set_start_minimized(int val, void *param)
{
+ if (val && start_maximized) {
+ log_error(LOG_DEFAULT, "cannot request both minimized and maximized window");
+ return -1;
+ }
start_minimized = val ? 1 : 0;
return 0;
}
+/** \brief Set StartMaximized resource (bool)
+ *
+ * \param[in] val 0: start normal 1: start maximized
+ * \param[in] param extra param (ignored)
+ *
+ * \return 0 on success, -1 if both minimized and maximized are requested
+ */
+static int set_start_maximized(int val, void *param)
+{
+ if (val && start_minimized) {
+ log_error(LOG_DEFAULT, "cannot request both minimized and maximized window");
+ return -1;
+ }
+ start_maximized = val ? 1 : 0;
+ return 0;
+}
+
#ifndef DEFAULT_MENU_KEY
# ifdef MACOS_COMPILE
# define DEFAULT_MENU_KEY SDLK_F10
@@ -628,6 +650,8 @@
#endif
{ "StartMinimized", 0, RES_EVENT_NO, NULL,
&start_minimized, set_start_minimized, NULL },
+ { "StartMaximized", 0, RES_EVENT_NO, NULL,
+ &start_maximized, set_start_maximized, NULL },
RESOURCE_INT_LIST_END
};
@@ -736,6 +760,12 @@
{ "+minimized", SET_RESOURCE, CMDLINE_ATTRIB_NONE,
NULL, NULL, "StartMinimized", (void *)0,
NULL, "Do not start VICE minimized" },
+ { "-maximized", SET_RESOURCE, CMDLINE_ATTRIB_NONE,
+ NULL, NULL, "StartMaximized", (void *)1,
+ NULL, "Start VICE maximized" },
+ { "+maximized", SET_RESOURCE, CMDLINE_ATTRIB_NONE,
+ NULL, NULL, "StartMaximized", (void *)0,
+ NULL, "Do not start VICE maximized" },
CMDLINE_LIST_END
};
Modified: trunk/vice/src/arch/sdl/video_sdl2.c
===================================================================
--- trunk/vice/src/arch/sdl/video_sdl2.c 2025-01-06 19:15:38 UTC (rev 45451)
+++ trunk/vice/src/arch/sdl/video_sdl2.c 2025-01-07 16:45:34 UTC (rev 45452)
@@ -556,6 +556,7 @@
{
SDL_WindowFlags flags = 0;
int minimized = 0;
+ int maximized = 0;
int hide_vdc = 0;
if (machine_class == VICE_MACHINE_C128) {
@@ -562,19 +563,25 @@
resources_get_int("C128HideVDC", &hide_vdc);
}
resources_get_int("StartMinimized", &minimized);
+ resources_get_int("StartMaximized", &maximized);
- if (minimized) {
- flags |= SDL_WINDOW_MINIMIZED;
+ if (minimized && maximized) {
+ log_warning(LOG_DEFAULT,
+ "both StartMinized and StartMaximized are true, ignoring.");
+ } else if (minimized) {
+ flags |= SDL_WINDOW_MINIMIZED;
+ } else if (maximized) {
+ flags |= SDL_WINDOW_MAXIMIZED;
}
if (hide_vdc && (canvas->index == VIDEO_CANVAS_IDX_VDC)) {
- flags |= SDL_WINDOW_HIDDEN;
+ flags |= SDL_WINDOW_HIDDEN;
}
if (canvas->fullscreenconfig->enable) {
- flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
+ flags |= SDL_WINDOW_FULLSCREEN_DESKTOP;
} else {
- flags |= SDL_WINDOW_RESIZABLE;
+ flags |= SDL_WINDOW_RESIZABLE;
}
return flags;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pot...@us...> - 2025-01-06 19:15:40
|
Revision: 45451
http://sourceforge.net/p/vice-emu/code/45451
Author: pottendo
Date: 2025-01-06 19:15:38 +0000 (Mon, 06 Jan 2025)
Log Message:
-----------
disable local certificate lookup
Modified Paths:
--------------
trunk/vice/src/userport/userport_wic64.c
Modified: trunk/vice/src/userport/userport_wic64.c
===================================================================
--- trunk/vice/src/userport/userport_wic64.c 2025-01-05 09:23:13 UTC (rev 45450)
+++ trunk/vice/src/userport/userport_wic64.c 2025-01-06 19:15:38 UTC (rev 45451)
@@ -902,11 +902,17 @@
curl_easy_setopt(eh, CURLOPT_URL, url);
curl_easy_setopt(eh, CURLOPT_PRIVATE, url);
curl_easy_setopt(eh, CURLOPT_FOLLOWLOCATION, 1L);
+ /* need to decied if we want to ship a certificate file
+ curl_easy_setopt(eh, CURLOPT_CAINFO, PREFIX "/share/vice/etc/ca-bundle.crt");
+ curl_easy_setopt(eh, CURLOPT_CAPATH, PREFIX "/share/vice/etc/ca-bundle.crt");
+ */
+ curl_easy_setopt(eh, CURLOPT_SSL_VERIFYPEER, 0L);
- /* work around bug 1964 (https://sourceforge.net/p/vice-emu/bugs/1964/) */
+ /* work around bug 1964 (https://sourceforge.net/p/vice-emu/bugs/1964/) - maybe not needed anymore !*/
#ifdef CURLSSLOPT_NATIVE_CA
curl_easy_setopt(eh, CURLOPT_SSL_OPTIONS, CURLSSLOPT_NATIVE_CA);
#endif
+
/* set USERAGENT: otherwise the server won't return data, e.g. wicradio */
if (wic64_protocol == WIC64_PROT_LEGACY) {
http_user_agent = HTTP_AGENT_LEGACY;
@@ -1652,6 +1658,11 @@
curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L);
}
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
+ /* need to decied if we want to ship a certificate file
+ curl_easy_setopt(curl, CURLOPT_CAINFO, PREFIX "/share/vice/etc/ca-bundle.crt");
+ curl_easy_setopt(curl, CURLOPT_CAPATH, PREFIX "/share/vice/etc/ca-bundle.crt");
+ */
+ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
res = curl_easy_setopt(curl, CURLOPT_USERAGENT, http_user_agent);
if (res != CURLE_OK) {
wic64_log(CONS_COL_NO, "curl set user agent failed: %s", curl_easy_strerror(res));
@@ -1829,6 +1840,11 @@
}
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
+ /* need to decied if we want to ship a certificate file
+ curl_easy_setopt(curl, CURLOPT_CAINFO, PREFIX "/share/vice/etc/ca-bundle.crt");
+ curl_easy_setopt(curl, CURLOPT_CAPATH, PREFIX "/share/vice/etc/ca-bundle.crt");
+ */
+ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
curl_easy_setopt(curl, CURLOPT_URL, buffer);
/* Do not do the transfer - only connect to host */
curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1L);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <co...@us...> - 2025-01-05 09:23:16
|
Revision: 45450
http://sourceforge.net/p/vice-emu/code/45450
Author: compyx
Date: 2025-01-05 09:23:13 +0000 (Sun, 05 Jan 2025)
Log Message:
-----------
Gtk3: add option to start with maximized window (-maximized)
Add resource "StartMaximized" and command line options `-maximized`/`+maximized`
to start the emulator window maximized. The setting can be changed in the
settings dialog: Display => Host Display.
Implementation for the SDL UI will follow soon.
Modified Paths:
--------------
trunk/vice/doc/vice.texi
trunk/vice/src/arch/gtk3/ui.c
trunk/vice/src/arch/gtk3/widgets/settings_host_display.c
Modified: trunk/vice/doc/vice.texi
===================================================================
--- trunk/vice/doc/vice.texi 2025-01-04 17:55:33 UTC (rev 45449)
+++ trunk/vice/doc/vice.texi 2025-01-05 09:23:13 UTC (rev 45450)
@@ -17629,6 +17629,12 @@
Start/Do not start with minimized window
(@code{StartMinimized=1}, @code{StartMinimized=0}).
+@findex -maximized, +maximized
+@item -maximized
+@itemx +maximized
+Start/Do not start with maximized window
+(@code{StartMaximized=1}, @code{StartMaximized=0}).
+
@findex -jamaction
@item -jamaction <Type>
Specify the action to take when the CPU encounters a 'JAM' opcode
@@ -17730,6 +17736,10 @@
@item StartMinimized
Boolean specifying whether the emulator should start minimized
+@vindex StartMaximized
+@item StartMaximized
+Boolean specifying whether the emulator should start maximized
+
@vindex JAMAction
@item JAMAction
Integer specifying the action to take when the CPU encounters a 'JAM' opcode.
Modified: trunk/vice/src/arch/gtk3/ui.c
===================================================================
--- trunk/vice/src/arch/gtk3/ui.c 2025-01-04 17:55:33 UTC (rev 45449)
+++ trunk/vice/src/arch/gtk3/ui.c 2025-01-05 09:23:13 UTC (rev 45450)
@@ -155,7 +155,8 @@
static int set_window_width(gint width, void *window_index);
static int set_window_xpos(gint xpos, void *window_index);
static int set_window_ypos(gint ypos, void *window_index);
-static int set_start_minimized(gboolean start_minimized, void *unused);
+static int set_start_minimized(int start_minimized, void *unused);
+static int set_start_maximized(int start_minimized, void *unused);
static int set_native_monitor(gboolean use_native_monitorl, void *unused);
static int set_monitor_font(const gchar *font_description, void *unused);
static int set_monitor_bg(const gchar *color, void *unused);
@@ -198,6 +199,7 @@
int pause_on_settings; /**< PauseOnSettings (bool) */
int start_minimized; /**< StartMinimized (bool) */
+ int start_maximized; /**< StartMaximized (bool) */
int use_native_monitor; /**< NativeMonitor (bool) */
@@ -285,6 +287,8 @@
{ "StartMinimized", 0, RES_EVENT_NO, NULL,
&ui_resources.start_minimized, set_start_minimized, NULL },
+ { "StartMaximized", 0, RES_EVENT_NO, NULL,
+ &ui_resources.start_maximized, set_start_maximized, NULL },
{ "NativeMonitor", 0, RES_EVENT_NO, NULL,
&ui_resources.use_native_monitor, set_native_monitor, NULL },
@@ -392,6 +396,12 @@
{ "+minimized", SET_RESOURCE, CMDLINE_ATTRIB_NONE,
NULL, NULL, "StartMinimized", (void *)0,
NULL, "Do not start VICE minimized" },
+ { "-maximized", SET_RESOURCE, CMDLINE_ATTRIB_NONE,
+ NULL, NULL, "StartMaximized", (void*)1,
+ NULL, "Start VICE maximized" },
+ { "+maximized", SET_RESOURCE, CMDLINE_ATTRIB_NONE,
+ NULL, NULL, "StartMaximized", (void*)0,
+ NULL, "Do not start VICE maximized" },
{ "-nativemonitor", SET_RESOURCE, CMDLINE_ATTRIB_NONE,
NULL, NULL, "NativeMonitor", (void *)1,
NULL, "Use native monitor on OS terminal" },
@@ -569,14 +579,37 @@
* \param[in] start_minimized start the emulator window minimized
* \param[in] unused extra param (ignored)
*
- * \return 0
+ * \return 0 on success, -1 when StartMaximized is true
*/
-static int set_start_minimized(gboolean start_minimized, void *unused)
+static int set_start_minimized(int start_minimized, void *unused)
{
+ if (start_minimized && ui_resources.start_maximized) {
+ log_error(LOG_DEFAULT,
+ "cannot request both minimized and maximized window.");
+ return -1;
+ }
ui_resources.start_minimized = start_minimized;
return 0;
}
+/** \brief Set StartMaximized resource
+ *
+ * \param[in] start_maximized start the emulator window maximized
+ * \param[in] unused extra param (ignored)
+ *
+ * \return 0 on success, -1 when StartMinimized is true
+ */
+static int set_start_maximized(int start_maximized, void *unused)
+{
+ if (start_maximized && ui_resources.start_minimized) {
+ log_error(LOG_DEFAULT,
+ "cannot request both minimized and maximized window.");
+ return -1;
+ }
+ ui_resources.start_maximized = start_maximized;
+ return 0;
+}
+
/** \brief Set NativeMonitor resource (bool)
*
* Use the spawning shell for the monitor instead of the VTE widget.
@@ -1780,7 +1813,6 @@
GdkPixbuf *icon;
gchar title[256];
- int minimized = 0;
bool restored = false;
if (machine_class != VICE_MACHINE_VSID) {
@@ -1939,18 +1971,16 @@
}
/*
- * Do we start minimized?
+ * Do we start minimized or maximized?
*/
- if (resources_get_int("StartMinimized", &minimized) < 0) {
- minimized = 0; /* fallback : not minimized */
- }
- if (minimized) {
- /* there's no gtk_window_minimize() so we do this:
- * (there is a gtk_window_maximize(), so for API consistency I'd would
- * probably have added gtk_window_minimize() to mirror the maximize
- * function)
- */
+ if (ui_resources.start_minimized && ui_resources.start_maximized) {
+ /* error: cannot have both: log and ignore */
+ log_error(LOG_DEFAULT, "minimized and maximized window requested, ignoring.");
+ } else if (ui_resources.start_minimized) {
+ /* there's no gtk_window_minimize() so we do this */
gtk_window_iconify(GTK_WINDOW(new_window));
+ } else if (ui_resources.start_maximized) {
+ gtk_window_maximize(GTK_WINDOW(new_window));
} else {
/* my guess is a minimized/iconified window cannot be fullscreen */
if (ui_is_fullscreen_from_canvas(canvas)) {
Modified: trunk/vice/src/arch/gtk3/widgets/settings_host_display.c
===================================================================
--- trunk/vice/src/arch/gtk3/widgets/settings_host_display.c 2025-01-04 17:55:33 UTC (rev 45449)
+++ trunk/vice/src/arch/gtk3/widgets/settings_host_display.c 2025-01-05 09:23:13 UTC (rev 45450)
@@ -7,6 +7,7 @@
/*
* $VICERES FullscreenDecorations -vsid
* $VICERES StartMinimized -vsid
+ * $VICERES StartMaximized -vsid
*/
/*
@@ -121,7 +122,22 @@
return grid;
}
+/** \brief Handler for the 'toggled' event of the minimized/maximized check buttons
+ *
+ * Prevent user from enabling both "start minimized" and "start maximized".
+ *
+ * \param[in] self check button triggering event
+ * \param[in] other check button for opposite state
+ */
+static void on_minmax_toggled(GtkToggleButton *self, gpointer other)
+{
+ if (gtk_toggle_button_get_active(self) &&
+ gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(other))) {
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(other), FALSE);
+ }
+}
+
/** \brief Create host display settings widget
*
* \param[in] widget parent widget (used for dialogs)
@@ -138,6 +154,7 @@
GtkWidget *decorations;
GtkWidget *minimized;
+ GtkWidget *maximized;
GtkWidget *rendering_options;
GtkWidget *rendering_options_vdc = NULL;
const char *chip;
@@ -147,6 +164,9 @@
minimized = vice_gtk3_resource_check_button_new(
"StartMinimized",
"Start the emulator window minimized");
+ maximized = vice_gtk3_resource_check_button_new(
+ "StartMaximized",
+ "Start the emulator window maximized");
rendering_options = create_rendering_options_widget(chip);
gtk_widget_set_margin_top(rendering_options, 24);
if (machine_class == VICE_MACHINE_C128) {
@@ -154,11 +174,21 @@
gtk_widget_set_margin_top(rendering_options_vdc, 24);
}
+ g_signal_connect(G_OBJECT(minimized),
+ "toggled",
+ G_CALLBACK(on_minmax_toggled),
+ (gpointer)maximized);
+ g_signal_connect(G_OBJECT(maximized),
+ "toggled",
+ G_CALLBACK(on_minmax_toggled),
+ (gpointer)minimized);
+
gtk_grid_attach(GTK_GRID(grid), decorations, 0, 1, 1, 1);
gtk_grid_attach(GTK_GRID(grid), minimized, 0, 2, 1, 1);
- gtk_grid_attach(GTK_GRID(grid), rendering_options, 0, 3, 1, 1);
+ gtk_grid_attach(GTK_GRID(grid), maximized, 0, 3, 1, 1);
+ gtk_grid_attach(GTK_GRID(grid), rendering_options, 0, 4, 1, 1);
if (machine_class == VICE_MACHINE_C128) {
- gtk_grid_attach(GTK_GRID(grid), rendering_options_vdc, 0, 4, 1, 1);
+ gtk_grid_attach(GTK_GRID(grid), rendering_options_vdc, 0, 5, 1, 1);
}
}
gtk_widget_show_all(grid);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <co...@us...> - 2025-01-04 17:55:34
|
Revision: 45449
http://sourceforge.net/p/vice-emu/code/45449
Author: compyx
Date: 2025-01-04 17:55:33 +0000 (Sat, 04 Jan 2025)
Log Message:
-----------
Gtk3: add $VICERES comment for "StartMinimized"
Modified Paths:
--------------
trunk/vice/src/arch/gtk3/ui.c
Modified: trunk/vice/src/arch/gtk3/ui.c
===================================================================
--- trunk/vice/src/arch/gtk3/ui.c 2025-01-04 17:53:27 UTC (rev 45448)
+++ trunk/vice/src/arch/gtk3/ui.c 2025-01-04 17:55:33 UTC (rev 45449)
@@ -26,7 +26,7 @@
* $VICERES Window1Width x128
* $VICERES Window1Xpos x128
* $VICERES Window1Ypos x128
-
+ * $VICERES StartMinimized -vsid
*/
/*
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pot...@us...> - 2025-01-04 17:53:29
|
Revision: 45448
http://sourceforge.net/p/vice-emu/code/45448
Author: pottendo
Date: 2025-01-04 17:53:27 +0000 (Sat, 04 Jan 2025)
Log Message:
-----------
let curl redirect 30x URLs
Modified Paths:
--------------
trunk/vice/src/userport/userport_wic64.c
Modified: trunk/vice/src/userport/userport_wic64.c
===================================================================
--- trunk/vice/src/userport/userport_wic64.c 2025-01-01 21:56:40 UTC (rev 45447)
+++ trunk/vice/src/userport/userport_wic64.c 2025-01-04 17:53:27 UTC (rev 45448)
@@ -901,6 +901,8 @@
curl_easy_setopt(eh, CURLOPT_WRITEFUNCTION, write_cb);
curl_easy_setopt(eh, CURLOPT_URL, url);
curl_easy_setopt(eh, CURLOPT_PRIVATE, url);
+ curl_easy_setopt(eh, CURLOPT_FOLLOWLOCATION, 1L);
+
/* work around bug 1964 (https://sourceforge.net/p/vice-emu/bugs/1964/) */
#ifdef CURLSSLOPT_NATIVE_CA
curl_easy_setopt(eh, CURLOPT_SSL_OPTIONS, CURLSSLOPT_NATIVE_CA);
@@ -1649,6 +1651,7 @@
} else {
curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L);
}
+ curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
res = curl_easy_setopt(curl, CURLOPT_USERAGENT, http_user_agent);
if (res != CURLE_OK) {
wic64_log(CONS_COL_NO, "curl set user agent failed: %s", curl_easy_strerror(res));
@@ -1825,6 +1828,7 @@
curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L);
}
+ curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_URL, buffer);
/* Do not do the transfer - only connect to host */
curl_easy_setopt(curl, CURLOPT_CONNECT_ONLY, 1L);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dq...@us...> - 2025-01-01 21:56:42
|
Revision: 45447
http://sourceforge.net/p/vice-emu/code/45447
Author: dqh
Date: 2025-01-01 21:56:40 +0000 (Wed, 01 Jan 2025)
Log Message:
-----------
Update macOS bindist to latest notarisation tool
Modified Paths:
--------------
trunk/vice/build/macOS/bindist.sh
Modified: trunk/vice/build/macOS/bindist.sh
===================================================================
--- trunk/vice/build/macOS/bindist.sh 2025-01-01 21:55:24 UTC (rev 45446)
+++ trunk/vice/build/macOS/bindist.sh 2025-01-01 21:56:40 UTC (rev 45447)
@@ -25,11 +25,11 @@
if [ -z "$APPLE_ID_EMAIL" ]; then
err "Missing env APPLE_ID_EMAIL. Set to your apple ID email address"
fi
-if [ -z "$NOTARISATION_PROVIDER" ]; then
- err "Missing env NOTARISATION_PROVIDER. Refer to https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/customizing_the_notarization_workflow"
+if [ -z "$APPLE_TEAM_ID" ]; then
+ err "Missing env APPLE_TEAM_ID. Get it from https://developer.apple.com/account#MembershipDetailsCard"
fi
-if [ -z "$NOTARISATION_PASSWORD" ]; then
- err "Missing env NOTARISATION_PASSWORD. Refer to https://developer.apple.com/documentation/security/notarizing_macos_software_before_distribution/customizing_the_notarization_workflow"
+if [ -z "$APPLE_NOTARISATION_PASSWORD" ]; then
+ err "Missing env APPLE_NOTARISATION_PASSWORD. NOT YOUR APPLE ID PASSWORD. Refer to https://support.apple.com/en-us/102654"
fi
set -o nounset
@@ -51,32 +51,14 @@
function notarise {
OUTPUT="$(mktemp)"
- xcrun altool --notarize-app \
- --primary-bundle-id "$1" \
- --username "$APPLE_ID_EMAIL" \
- --password "$NOTARISATION_PASSWORD" \
- --asc-provider "$NOTARISATION_PROVIDER" \
- --file "$1" \
- 2>&1 | tee "$OUTPUT"
- UUID=$(awk '/RequestUUID/ { print $3 }' "$OUTPUT")
+ xcrun notarytool submit \
+ --apple-id "$APPLE_ID_EMAIL" \
+ --password "$APPLE_NOTARISATION_PASSWORD" \
+ --team-id "$APPLE_TEAM_ID" \
+ --wait \
+ "$1" \
+ 2>&1 | tee "$OUTPUT"
- if [ -z "$UUID" ]
- then
- echo "ERROR: Failed to capture RequestUUID from xcrun output".
- exit 1
- fi
-
- echo "Waiting for Status: success"
-
- while [ -z "$(grep "Status: success" "$OUTPUT")" ]
- do
- sleep 10
- xcrun altool --notarization-info "$UUID" \
- -u "$APPLE_ID_EMAIL" \
- -p "$NOTARISATION_PASSWORD" \
- 2>&1 | tee "$OUTPUT"
- done
-
xcrun stapler staple "$1"
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dq...@us...> - 2025-01-01 21:55:25
|
Revision: 45446
http://sourceforge.net/p/vice-emu/code/45446
Author: dqh
Date: 2025-01-01 21:55:24 +0000 (Wed, 01 Jan 2025)
Log Message:
-----------
Update macOS bindist for latest GTK3
Modified Paths:
--------------
trunk/vice/src/arch/shared/make-bindist_osx.sh
Modified: trunk/vice/src/arch/shared/make-bindist_osx.sh
===================================================================
--- trunk/vice/src/arch/shared/make-bindist_osx.sh 2025-01-01 21:21:39 UTC (rev 45445)
+++ trunk/vice/src/arch/shared/make-bindist_osx.sh 2025-01-01 21:55:24 UTC (rev 45446)
@@ -45,8 +45,10 @@
GTK_UPDATE_ICON_CACHE=gtk-update-icon-cache-3.0
elif which gtk3-update-icon-cache >/dev/null; then
GTK_UPDATE_ICON_CACHE=gtk3-update-icon-cache
+elif which gtk-update-icon-cache >/dev/null; then
+ GTK_UPDATE_ICON_CACHE=gtk-update-icon-cache
else
- >&2 echo "ERROR: Could not find gtk-update-icon-cache-3.0 or gtk3-update-icon-cache"
+ >&2 echo "ERROR: Could not find gtk-update-icon-cache-3.0, gtk3-update-icon-cache, nor gtk-update-icon-cache."
exit 1
fi
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gp...@us...> - 2025-01-01 21:21:40
|
Revision: 45445
http://sourceforge.net/p/vice-emu/code/45445
Author: gpz
Date: 2025-01-01 21:21:39 +0000 (Wed, 01 Jan 2025)
Log Message:
-----------
some better error checking, should now handle correctly the case when the ffmpeg binary dies unexpectedly
Modified Paths:
--------------
trunk/vice/src/arch/gtk3/widgets/statusbarrecordingwidget.c
trunk/vice/src/gfxoutputdrv/ffmpegexedrv.c
trunk/vice/src/screenshot.c
Modified: trunk/vice/src/arch/gtk3/widgets/statusbarrecordingwidget.c
===================================================================
--- trunk/vice/src/arch/gtk3/widgets/statusbarrecordingwidget.c 2025-01-01 20:32:46 UTC (rev 45444)
+++ trunk/vice/src/arch/gtk3/widgets/statusbarrecordingwidget.c 2025-01-01 21:21:39 UTC (rev 45445)
@@ -290,11 +290,20 @@
}
#endif
- if ((type != UI_RECORDING_STATUS_NONE) && (type != UI_RECORDING_STATUS_EVENTS) && status) {
- g_timeout_add_seconds(1, update_timer, (gpointer)widget);
- }
DBG(("statusbar_recording_widget_set_recording_status type:%d", type));
+ switch (type) {
+ case UI_RECORDING_STATUS_NONE:
+ statusbar_recording_widget_hide_all(GTK_WIDGET(widget), HIDE_ALL_TIMEOUT);
+ break;
+ case UI_RECORDING_STATUS_EVENTS:
+ break;
+ case UI_RECORDING_STATUS_AUDIO:
+ case UI_RECORDING_STATUS_VIDEO:
+ g_timeout_add_seconds(1, update_timer, (gpointer)widget);
+ break;
+ }
+
/* update recording status text */
label = gtk_grid_get_child_at(GTK_GRID(widget), RW_COL_TEXT, RW_ROW_TEXT);
Modified: trunk/vice/src/gfxoutputdrv/ffmpegexedrv.c
===================================================================
--- trunk/vice/src/gfxoutputdrv/ffmpegexedrv.c 2025-01-01 20:32:46 UTC (rev 45444)
+++ trunk/vice/src/gfxoutputdrv/ffmpegexedrv.c 2025-01-01 21:21:39 UTC (rev 45445)
@@ -439,6 +439,7 @@
static ssize_t write_video_frame(VIDEOFrame *pic)
{
ssize_t len = INPUT_VIDEO_BPP * video_height * video_width;
+ ssize_t res;
if ((video_has_codec > 0) && (video_codec != AV_CODEC_ID_NONE)) {
if (ffmpeg_video_socket == 0) {
@@ -445,7 +446,11 @@
log_error(ffmpeg_log, "FFMPEG: write_video_frame ffmpeg_video_socket is 0 (framecount:%"PRIu64")", framecounter);
return -1;
}
- return len - vice_network_send(ffmpeg_video_socket, pic->data, len, 0 /* flags */);
+ res = vice_network_send(ffmpeg_video_socket, pic->data, len, 0 /* flags */);
+ if (res < 0) {
+ return -1;
+ }
+ return len - res;
}
return 0;
}
Modified: trunk/vice/src/screenshot.c
===================================================================
--- trunk/vice/src/screenshot.c 2025-01-01 20:32:46 UTC (rev 45444)
+++ trunk/vice/src/screenshot.c 2025-01-01 21:21:39 UTC (rev 45445)
@@ -261,6 +261,7 @@
int screenshot_record(void)
{
screenshot_t screenshot;
+ int result;
if (recording_driver == NULL) {
return 0;
@@ -280,7 +281,15 @@
return -1;
}
- return screenshot_save_core(&screenshot, NULL, NULL);
+ result = screenshot_save_core(&screenshot, NULL, NULL);
+ DBG(("screenshot_record result:%d", result));
+ if (result < 0) {
+ /*log_error(screenshot_log, "Video recording failed, stopping...");*/
+ screenshot_stop_recording();
+ ui_display_recording(UI_RECORDING_STATUS_NONE);
+ }
+
+ return result;
}
void screenshot_stop_recording(void)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gp...@us...> - 2025-01-01 20:32:48
|
Revision: 45444
http://sourceforge.net/p/vice-emu/code/45444
Author: gpz
Date: 2025-01-01 20:32:46 +0000 (Wed, 01 Jan 2025)
Log Message:
-----------
change ui_display_recording() arg from bool to type and pass the type of started recording. also use constants instead of magic values :) UI correctly displays the recording status now
Modified Paths:
--------------
trunk/vice/src/arch/gtk3/actions-snapshot.c
trunk/vice/src/arch/gtk3/uimedia.c
trunk/vice/src/arch/gtk3/uistatusbar.c
trunk/vice/src/arch/gtk3/widgets/statusbarrecordingwidget.c
trunk/vice/src/event.c
trunk/vice/src/screenshot.c
trunk/vice/src/uiapi.h
Modified: trunk/vice/src/arch/gtk3/actions-snapshot.c
===================================================================
--- trunk/vice/src/arch/gtk3/actions-snapshot.c 2024-12-31 11:19:51 UTC (rev 45443)
+++ trunk/vice/src/arch/gtk3/actions-snapshot.c 2025-01-01 20:32:46 UTC (rev 45444)
@@ -88,7 +88,7 @@
static void history_record_start_action(ui_action_map_t *self)
{
event_record_start();
- ui_display_recording(1);
+ ui_display_recording(UI_RECORDING_STATUS_EVENTS);
}
@@ -99,7 +99,7 @@
static void history_record_stop_action(ui_action_map_t *self)
{
event_record_stop();
- ui_display_recording(0);
+ ui_display_recording(UI_RECORDING_STATUS_NONE);
}
Modified: trunk/vice/src/arch/gtk3/uimedia.c
===================================================================
--- trunk/vice/src/arch/gtk3/uimedia.c 2024-12-31 11:19:51 UTC (rev 45443)
+++ trunk/vice/src/arch/gtk3/uimedia.c 2025-01-01 20:32:46 UTC (rev 45444)
@@ -358,14 +358,14 @@
save_screenshot_handler(data);
} else if (strcmp(child_name, CHILD_SOUND) == 0) {
save_audio_recording_handler(data);
- ui_display_recording(1);
+ ui_display_recording(UI_RECORDING_STATUS_AUDIO);
} else if (strcmp(child_name, CHILD_VIDEO) == 0) {
save_video_recording_handler(data);
- ui_display_recording(1);
+ ui_display_recording(UI_RECORDING_STATUS_VIDEO);
}
} else {
save_audio_recording_handler(data);
- ui_display_recording(1);
+ ui_display_recording(UI_RECORDING_STATUS_AUDIO);
}
#if 0
mainlockk_release();
@@ -1067,8 +1067,6 @@
grid = vice_gtk3_grid_new_spaced(16, 8);
-
-#if 1
label = gtk_label_new("Video driver");
gtk_widget_set_margin_start(label, 16);
@@ -1125,21 +1123,7 @@
video_driver_options_grid = options_grid;
gtk_grid_attach(GTK_GRID(grid), options_grid, 0, 1, 1, 1);
-#else
- label = gtk_label_new(NULL);
- gtk_label_set_line_wrap_mode(GTK_LABEL(label), PANGO_WRAP_WORD);
- gtk_widget_set_margin_start(label, 16);
- gtk_widget_set_margin_end(label, 16);
- gtk_widget_set_margin_top(label, 16);
- gtk_widget_set_margin_bottom(label, 16);
- gtk_label_set_markup(GTK_LABEL(label),
- "Video recording is unavailable due to VICE having being compiled"
- " without FFMPEG support.\nPlease recompile with"
- " <tt>--enable-ffmpeg</tt>.\n\n"
- "If you didn't compile VICE yourself, ask your provider.");
- gtk_grid_attach(GTK_GRID(grid), label, 0, 0, 1, 1);
-#endif
gtk_widget_show_all(grid);
return grid;
}
@@ -1256,7 +1240,7 @@
screenshot_stop_recording();
}
- ui_display_recording(0);
+ ui_display_recording(UI_RECORDING_STATUS_NONE);
statusbar_recording_widget_hide_all(ui_statusbar_get_recording_widget(), 10);
}
Modified: trunk/vice/src/arch/gtk3/uistatusbar.c
===================================================================
--- trunk/vice/src/arch/gtk3/uistatusbar.c 2024-12-31 11:19:51 UTC (rev 45443)
+++ trunk/vice/src/arch/gtk3/uistatusbar.c 2025-01-01 20:32:46 UTC (rev 45444)
@@ -106,7 +106,15 @@
#include "uistatusbar.h"
+/* #define DEBUG_STATUSBAR */
+#ifdef DEBUG_STATUSBAR
+#define DBG(x) log_printf x
+#else
+#define DBG(x)
+#endif
+
+
/** \brief The maximum number of status bars we will permit to exist at once. */
#define MAX_STATUS_BARS 3
@@ -2891,7 +2899,7 @@
void ui_display_recording(int recording_status)
{
GtkWidget *widget;
-
+ DBG(("ui_display_recording: %d", recording_status));
/* Ok to call from VICE thread */
widget = allocated_bars[0].record;
statusbar_recording_widget_set_recording_status(widget, recording_status);
Modified: trunk/vice/src/arch/gtk3/widgets/statusbarrecordingwidget.c
===================================================================
--- trunk/vice/src/arch/gtk3/widgets/statusbarrecordingwidget.c 2024-12-31 11:19:51 UTC (rev 45443)
+++ trunk/vice/src/arch/gtk3/widgets/statusbarrecordingwidget.c 2025-01-01 20:32:46 UTC (rev 45444)
@@ -35,11 +35,21 @@
#include "screenshot.h"
#include "sound.h"
#include "ui.h"
+#include "uiapi.h"
#include "uimedia.h"
+#include "log.h"
#include "statusbarrecordingwidget.h"
+/* #define DEBUG_RECORDING */
+#ifdef DEBUG_RECORDING
+#define DBG(x) log_printf x
+#else
+#define DBG(x)
+#endif
+
+
/** \brief Seconds to wait before hiding the widget after pressing 'STOP'
*/
#define HIDE_ALL_TIMEOUT 5
@@ -81,7 +91,7 @@
RW_ROW_BUTTON = 0 /**< STOP button (takes both rows) */
};
-
+#if 0
/** \brief Types of recordings
*/
enum {
@@ -90,8 +100,8 @@
RW_TYPE_AUDIO, /**< recording audio */
RW_TYPE_VIDEO /**< recording video */
};
+#endif
-
/** \brief Types of recordings as strings
*/
static const gchar *rec_types[] = {
@@ -238,13 +248,15 @@
* \param[in] status recording status (boolean)
*/
void statusbar_recording_widget_set_recording_status(GtkWidget *widget,
- int status)
+ int type)
{
GtkWidget *label;
gchar buffer[256];
GtkWidget *button;
- int type = 0; /* set recording type to 'inactive' */
+ int status = (type == UI_RECORDING_STATUS_NONE) ? 0 : 1;
+ DBG(("statusbar_recording_widget_set_recording_status status:%d", status));
+
if (timeout_id > 0) {
g_source_remove(timeout_id);
timeout_id = 0;
@@ -254,7 +266,9 @@
if (status == 0) {
g_object_set_data(G_OBJECT(widget), "Seconds", GINT_TO_POINTER(0));
}
-
+#if 0
+ DBG(("event_record_active():%d sound_is_recording():%d screenshot_is_recording():%d",
+ event_record_active(), sound_is_recording(), screenshot_is_recording()));
/* determine recording type */
if (event_record_active()) {
type = RW_TYPE_EVENTS;
@@ -271,10 +285,15 @@
} else if (screenshot_is_recording()) {
type = RW_TYPE_VIDEO;
}
+ if ((type != RW_TYPE_NONE) && (type != RW_TYPE_EVENTS) && status) {
+ g_timeout_add_seconds(1, update_timer, (gpointer)widget);
+ }
+#endif
- if (type != RW_TYPE_NONE && type != RW_TYPE_EVENTS && status) {
+ if ((type != UI_RECORDING_STATUS_NONE) && (type != UI_RECORDING_STATUS_EVENTS) && status) {
g_timeout_add_seconds(1, update_timer, (gpointer)widget);
}
+ DBG(("statusbar_recording_widget_set_recording_status type:%d", type));
/* update recording status text */
label = gtk_grid_get_child_at(GTK_GRID(widget), RW_COL_TEXT, RW_ROW_TEXT);
@@ -333,11 +352,11 @@
status = gtk_grid_get_child_at(GTK_GRID(widget), RW_COL_TEXT, RW_ROW_TEXT);
/* determine recording type */
if (event_record_active()) {
- type = RW_TYPE_EVENTS;
+ type = UI_RECORDING_STATUS_EVENTS;
} else if ((dev != NULL && *dev != '\0') && !screenshot_is_recording()) {
- type = RW_TYPE_AUDIO;
+ type = UI_RECORDING_STATUS_AUDIO;
} else {
- type = RW_TYPE_VIDEO;
+ type = UI_RECORDING_STATUS_VIDEO;
}
g_snprintf(buffer, sizeof(buffer), "Recording %s ...", rec_types[type]);
gtk_label_set_text(GTK_LABEL(status), buffer);
Modified: trunk/vice/src/event.c
===================================================================
--- trunk/vice/src/event.c 2024-12-31 11:19:51 UTC (rev 45443)
+++ trunk/vice/src/event.c 2025-01-01 20:32:46 UTC (rev 45444)
@@ -698,7 +698,7 @@
1, 1, 0) < 0) {
ui_error("Could not create start snapshot file %s.",
event_snapshot_path(event_start_snapshot));
- ui_display_recording(0);
+ ui_display_recording(UI_RECORDING_STATUS_NONE);
return;
}
destroy_list();
@@ -752,7 +752,7 @@
alarm_set(event_alarm, next_timestamp_clk);
record_active = 1;
- ui_display_recording(1);
+ ui_display_recording(UI_RECORDING_STATUS_EVENTS);
}
int event_record_start(void)
@@ -797,7 +797,7 @@
interrupt_maincpu_trigger_trap(event_record_stop_trap, (void *)0);
- ui_display_recording(0);
+ ui_display_recording(UI_RECORDING_STATUS_NONE);
alarm_unset(event_alarm);
Modified: trunk/vice/src/screenshot.c
===================================================================
--- trunk/vice/src/screenshot.c 2024-12-31 11:19:51 UTC (rev 45443)
+++ trunk/vice/src/screenshot.c 2025-01-01 20:32:46 UTC (rev 45444)
@@ -50,7 +50,14 @@
#include "ui.h"
#include "vsync.h"
+/* #define DEBUG_SCREENSHOT */
+#ifdef DEBUG_SCREENSHOT
+#define DBG(x) log_printf x
+#else
+#define DBG(x)
+#endif
+
static log_t screenshot_log = LOG_DEFAULT;
static gfxoutputdrv_t *recording_driver;
static struct video_canvas_s *recording_canvas;
@@ -197,7 +204,9 @@
screenshot_t screenshot;
gfxoutputdrv_t *drv;
int result;
- /* printf("screenshot_save(%s, %s, ...)\n", drvname, filename); */
+
+ DBG(("screenshot_save(%s, %s, ...)", drvname, filename));
+
if ((drv = gfxoutput_get_driver(drvname)) == NULL) {
return -1;
}
@@ -222,7 +231,7 @@
}
result = screenshot_save_core(&screenshot, drv, filename);
-
+ DBG(("screenshot_save_core result:%d", result));
if (result < 0) {
recording_driver = NULL;
recording_canvas = NULL;
@@ -248,6 +257,7 @@
}
#endif
+/* called for each frame */
int screenshot_record(void)
{
screenshot_t screenshot;
@@ -256,6 +266,8 @@
return 0;
}
+ /* DBG(("screenshot_record")); */
+
/* Retrive framebuffer and screen geometry. */
if (recording_canvas != NULL) {
if (machine_screenshot(&screenshot, recording_canvas) < 0) {
Modified: trunk/vice/src/uiapi.h
===================================================================
--- trunk/vice/src/uiapi.h 2024-12-31 11:19:51 UTC (rev 45443)
+++ trunk/vice/src/uiapi.h 2025-01-01 20:32:46 UTC (rev 45444)
@@ -101,6 +101,11 @@
/* Recording UI */
void ui_display_playback(int playback_status, char *version);
+
+#define UI_RECORDING_STATUS_NONE 0 /**< nothing is being recorded */
+#define UI_RECORDING_STATUS_EVENTS 1 /**< recording events */
+#define UI_RECORDING_STATUS_AUDIO 2 /**< recording audio */
+#define UI_RECORDING_STATUS_VIDEO 3 /**< recording video */
void ui_display_recording(int recording_status);
void ui_display_event_time(unsigned int current, unsigned int total);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <co...@us...> - 2024-12-31 11:19:53
|
Revision: 45443
http://sourceforge.net/p/vice-emu/code/45443
Author: compyx
Date: 2024-12-31 11:19:51 +0000 (Tue, 31 Dec 2024)
Log Message:
-----------
configure: also show --with[out]-libieee1284 status on Windows
We can use libieee1284 on Windows, so configure should display the status of
this at the end of its run.
Modified Paths:
--------------
trunk/vice/configure.ac
Modified: trunk/vice/configure.ac
===================================================================
--- trunk/vice/configure.ac 2024-12-31 10:45:52 UTC (rev 45442)
+++ trunk/vice/configure.ac 2024-12-31 11:19:51 UTC (rev 45443)
@@ -3718,7 +3718,7 @@
echo "POSIX 1003.1e capabilities support: $HAVE_CAPABILITIES_SUPPORT"
fi
-if test x"$real_arch" = "xUnix"; then
+if test x"$real_arch" = "xUnix" -o x"$real_arch" = "xWin32"; then
echo "libieee1284 support : $HAVE_LIBIEEE1284_SUPPORT (--with/--wihout-libieee1284)"
fi
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <co...@us...> - 2024-12-31 10:45:55
|
Revision: 45442
http://sourceforge.net/p/vice-emu/code/45442
Author: compyx
Date: 2024-12-31 10:45:52 +0000 (Tue, 31 Dec 2024)
Log Message:
-----------
Fix -Wformat warnings
Fix (s)printf() format string warnings found by clang 19. There are likely
more to be found when enabling the DBG() macros in individual files.
Modified Paths:
--------------
trunk/vice/src/core/tpicore.c
trunk/vice/src/monitor/mon_disassemble.c
trunk/vice/src/parallel/parallel-trap.c
trunk/vice/src/serial/fsdrive.c
trunk/vice/src/sha1.c
trunk/vice/src/vdc/vdc-mem.c
Modified: trunk/vice/src/core/tpicore.c
===================================================================
--- trunk/vice/src/core/tpicore.c 2024-12-31 10:41:51 UTC (rev 45441)
+++ trunk/vice/src/core/tpicore.c 2024-12-31 10:45:52 UTC (rev 45442)
@@ -93,8 +93,7 @@
if (mytpi_debug) {
log_message(tpi_context->log,
"pop_irq_state(latches=%02x, stack=%02x, active=%02x)",
- (int)irq_latches, (int)(tpi_context->irq_stack),
- (int)irq_active);
+ irq_latches, tpi_context->irq_stack, irq_active);
}
if (irq_priority) {
if (tpi_context->irq_stack) {
@@ -120,8 +119,7 @@
if (mytpi_debug) {
log_message(tpi_context->log,
"push_irq_state(latches=%02x, act=%02x, stack=%02x mask=%02x).",
- (int)irq_latches, (int)irq_active,
- (int)(tpi_context->irq_stack), (int)irq_mask);
+ irq_latches, irq_active, tpi_context->irq_stack, irq_mask);
}
irq_latches &= ~irq_active;
Modified: trunk/vice/src/monitor/mon_disassemble.c
===================================================================
--- trunk/vice/src/monitor/mon_disassemble.c 2024-12-31 10:41:51 UTC (rev 45441)
+++ trunk/vice/src/monitor/mon_disassemble.c 2024-12-31 10:45:52 UTC (rev 45442)
@@ -145,23 +145,28 @@
switch (opc_size) {
case 1:
- sprintf(buff, "%02X %s%s", x,
+ sprintf(buff, "%02X %s%s",
+ x,
is_undoc ? "*" : "", string);
break;
case 2:
- sprintf(buff, "%02X %02X %s%s", x, p1 & 0xff,
+ sprintf(buff, "%02X %02X %s%s",
+ x, (unsigned int)p1 & 0xff,
is_undoc ? "*" : "", string);
break;
case 3:
- sprintf(buff, "%02X %02X %02X %s%s", x, p1 & 0xff, p2 & 0xff,
+ sprintf(buff, "%02X %02X %02X %s%s",
+ x, (unsigned int)p1 & 0xff, (unsigned int)p2 & 0xff,
is_undoc ? "*" : "", string);
break;
case 4:
- sprintf(buff, "%02X %02X %02X %02X %s%s", x, p1 & 0xff, p2 & 0xff, p3 & 0xff,
+ sprintf(buff, "%02X %02X %02X %02X %s%s",
+ x, (unsigned int)p1 & 0xff, (unsigned int)p2 & 0xff, (unsigned int)p3 & 0xff,
is_undoc ? "*" : "", string);
break;
case 5:
- sprintf(buff, "%02X%02X%02X %02X%02X %s%s", x, p1 & 0xff, p2 & 0xff, p3 & 0xff, p4 & 0xFF,
+ sprintf(buff, "%02X%02X%02X %02X%02X %s%s",
+ x, (unsigned int)p1 & 0xff, (unsigned int)p2 & 0xff, (unsigned int)p3 & 0xff, (unsigned int)p4 & 0xff,
is_undoc ? "*" : "", string);
break;
default:
@@ -356,7 +361,11 @@
break;
case ASM_ADDR_MODE_MOVE:
- sprintf(buffp, (hex_mode ? " $%02X,$%02X" : " %3d,%3u"), p2 & 0xff, ival);
+ if (hex_mode) {
+ sprintf(buffp, " $%02X,$%02X", (unsigned int)p2 & 0xff, ival);
+ } else {
+ sprintf(buffp, " %3d,%3u", p2 & 0xff, ival);
+ }
break;
case ASM_ADDR_MODE_RELATIVE:
Modified: trunk/vice/src/parallel/parallel-trap.c
===================================================================
--- trunk/vice/src/parallel/parallel-trap.c 2024-12-31 10:41:51 UTC (rev 45441)
+++ trunk/vice/src/parallel/parallel-trap.c 2024-12-31 10:45:52 UTC (rev 45442)
@@ -171,7 +171,7 @@
}
break;
default:
- log_error(parallel_log, "Unknown command %02X.", TrapSecondary & 0xff);
+ log_error(parallel_log, "Unknown command %02X.", (unsigned int)(TrapSecondary & 0xff));
}
return st;
}
@@ -374,7 +374,7 @@
"ok=%s, st=%04x.",
(unsigned int)secadr,
p->lastbyte[secadr],
- (int)*data,
+ (unsigned int)*data,
p->lastok[secadr] ? "ok" : "no",
(unsigned int)(p->lastst[secadr]),
p->nextbyte[secadr],
Modified: trunk/vice/src/serial/fsdrive.c
===================================================================
--- trunk/vice/src/serial/fsdrive.c 2024-12-31 10:41:51 UTC (rev 45441)
+++ trunk/vice/src/serial/fsdrive.c 2024-12-31 10:45:52 UTC (rev 45442)
@@ -184,7 +184,7 @@
break;
default:
- log_error(fsdrive_log, "Unknown command %02X.", secondary & 0xff);
+ log_error(fsdrive_log, "Unknown command %02X.", (unsigned int)(secondary & 0xff));
}
return st;
Modified: trunk/vice/src/sha1.c
===================================================================
--- trunk/vice/src/sha1.c 2024-12-31 10:41:51 UTC (rev 45441)
+++ trunk/vice/src/sha1.c 2024-12-31 10:45:52 UTC (rev 45442)
@@ -313,6 +313,6 @@
/* format the hash for comparison */
for(offset = 0; offset < 20; offset++) {
- sprintf(hash_string_out + (2 * offset), "%02x", result[offset] & 0xff);
+ sprintf(hash_string_out + (2 * offset), "%02x", (unsigned int)result[offset] & 0xff);
}
}
Modified: trunk/vice/src/vdc/vdc-mem.c
===================================================================
--- trunk/vice/src/vdc/vdc-mem.c 2024-12-31 10:41:51 UTC (rev 45441)
+++ trunk/vice/src/vdc/vdc-mem.c 2024-12-31 10:45:52 UTC (rev 45442)
@@ -678,7 +678,7 @@
mon_out("%02x: ", regnum);
for (c = 0; c < 16; c++) {
if (regnum <= 37) {
- mon_out("%02x ", vdc.regs[regnum] | regmask[regnum]);
+ mon_out("%02x ", (unsigned int)(vdc.regs[regnum] | regmask[regnum]));
}
regnum++;
if ((c & 3) == 3) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <pot...@us...> - 2024-12-31 10:41:53
|
Revision: 45441
http://sourceforge.net/p/vice-emu/code/45441
Author: pottendo
Date: 2024-12-31 10:41:51 +0000 (Tue, 31 Dec 2024)
Log Message:
-----------
reset wic64 also on enable
Modified Paths:
--------------
trunk/vice/src/userport/userport_wic64.c
Modified: trunk/vice/src/userport/userport_wic64.c
===================================================================
--- trunk/vice/src/userport/userport_wic64.c 2024-12-31 10:06:02 UTC (rev 45440)
+++ trunk/vice/src/userport/userport_wic64.c 2024-12-31 10:41:51 UTC (rev 45441)
@@ -545,7 +545,7 @@
log_message(wic64_loghandle, "WiC64 enabled");
prep_wic64_str();
-
+ userport_wic64_reset();
} else {
if (httpbuffer) {
lib_free(httpbuffer);
@@ -1021,7 +1021,7 @@
res = curl_easy_getinfo(msg->easy_handle, CURLINFO_EFFECTIVE_URL, &url);
if (res != CURLE_OK) {
/* ignore problem, URL is only for debugging */
- wic64_log(LOG_COL_LRED, "%s: curl_easy_getinfo(...&URL failed: %s", __FUNCTION__,
+ debug_log(CONS_COL_NO, 2, "%s: curl_easy_getinfo(...&URL failed: %s", __FUNCTION__,
curl_easy_strerror(res));
url = "<unknown>";
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <co...@us...> - 2024-12-31 10:06:05
|
Revision: 45440
http://sourceforge.net/p/vice-emu/code/45440
Author: compyx
Date: 2024-12-31 10:06:02 +0000 (Tue, 31 Dec 2024)
Log Message:
-----------
Build system: remove --without-zlib and make zlib mandatory
Zlib is ubiquitous enough to just require as a hard dependency.
Modified Paths:
--------------
trunk/vice/configure.ac
trunk/vice/src/lib/libzmbv/Makefile.am
trunk/vice/src/vicefeatures.c
trunk/vice/src/zfile.c
Modified: trunk/vice/configure.ac
===================================================================
--- trunk/vice/configure.ac 2024-12-31 06:32:45 UTC (rev 45439)
+++ trunk/vice/configure.ac 2024-12-31 10:06:02 UTC (rev 45440)
@@ -112,7 +112,6 @@
dnl
dnl Misc build options
dnl
-VICE_ARG_WITH_LIST(zlib, [ --without-zlib do not use the zlib support])
VICE_ARG_WITH_LIST(unzip-bin, [ --with-unzip-bin enables distribution of unzip.exe in the windows bindist])
VICE_ARG_WITH_LIST(libieee1284, [ --with-libieee1284 use the libieee1284 parallel port library])
VICE_ARG_ENABLE_LIST(arch, [ --enable-arch[[=arch]] enable architecture specific compilation [[default=yes]]], [], [enable_arch=yes])
@@ -1195,10 +1194,6 @@
AC_MSG_ERROR([GTK3 UI requested, but GTK3 support packages are missing])
fi
fi
- dnl error out if gtk3 support is requested but zlib is disabled
- if test x"$enable_gtk3ui" = "xyes" -a x"$with_zlib" = "xno"; then
- AC_MSG_ERROR([GTK3 UI requested, but zlib is explicitly disabled])
- fi
dnl Used to compile the vice.gresource.xml file
AC_CHECK_PROG(GLIB_COMPILE_RESOURCES, [glib-compile-resources], [glib-compile-resources], [no])
@@ -2159,27 +2154,19 @@
dnl ----- ZLib -----
ZLIB_LIBS=
-if test x"$with_zlib" != "xno" ; then
- AC_CHECK_HEADER(zlib.h,,)
- if test x"$ac_cv_header_zlib_h" = "xyes" ; then
- ac_cv_lib_z_zlibVersion=yes
- AC_CHECK_LIB(z, zlibVersion,
+AC_CHECK_HEADER(zlib.h,,)
+if test x"$ac_cv_header_zlib_h" = "xyes" ; then
+ ac_cv_lib_z_zlibVersion=yes
+ AC_CHECK_LIB(z, zlibVersion,
[ ZLIB_LIBS="-lz";
HAVE_ZLIB_SUPPORT="yes";
AC_DEFINE(HAVE_ZLIB,,
[Can we use the ZLIB compression library?]) ],,)
- fi
-fi
-
-if test x"$HAVE_ZLIB_SUPPORT" = "xyes" ; then
- AM_CONDITIONAL(HAVE_ZLIB, true)
else
- AM_CONDITIONAL(HAVE_ZLIB, false)
+ AC_MSG_ERROR([Zlib header not found, please install zlib.])
fi
-
AC_SUBST(ZLIB_LIBS)
-
dnl --- Curl / WIC64 ---
dnl We need at least version 7.77.1 for `CURLSSLOPT_NATIVE_CA`
dnl
@@ -3731,8 +3718,6 @@
echo "POSIX 1003.1e capabilities support: $HAVE_CAPABILITIES_SUPPORT"
fi
-echo "zlib support : $HAVE_ZLIB_SUPPORT (--with/without-zlib)"
-
if test x"$real_arch" = "xUnix"; then
echo "libieee1284 support : $HAVE_LIBIEEE1284_SUPPORT (--with/--wihout-libieee1284)"
fi
Modified: trunk/vice/src/lib/libzmbv/Makefile.am
===================================================================
--- trunk/vice/src/lib/libzmbv/Makefile.am 2024-12-31 06:32:45 UTC (rev 45439)
+++ trunk/vice/src/lib/libzmbv/Makefile.am 2024-12-31 10:06:02 UTC (rev 45440)
@@ -5,11 +5,6 @@
AM_CXXFLAGS = @VICE_CXXFLAGS@
AM_LDFLAGS = @VICE_LDFLAGS@
-if !HAVE_ZLIB
-AM_CPPFLAGS += -DZMBV_USE_MINIZ
-AM_CFLAGS += -DZMBV_USE_MINIZ
-endif
-
noinst_LIBRARIES = libzmbv.a
libzmbv_a_SOURCES = \
Modified: trunk/vice/src/vicefeatures.c
===================================================================
--- trunk/vice/src/vicefeatures.c 2024-12-31 06:32:45 UTC (rev 45439)
+++ trunk/vice/src/vicefeatures.c 2024-12-31 10:06:02 UTC (rev 45440)
@@ -350,12 +350,6 @@
#endif
/* (all) */
- { "HAVE_ZLIB", "Use the ZLIB compression library.",
-#ifndef HAVE_ZLIB
- 0 },
-#else
- 1 },
-#endif
#ifdef UNIX_COMPILE /* (unix) */
{ "LINUX_JOYSTICK", "Enable support for Linux style joysticks.",
#ifndef LINUX_JOYSTICK
Modified: trunk/vice/src/zfile.c
===================================================================
--- trunk/vice/src/zfile.c 2024-12-31 06:32:45 UTC (rev 45439)
+++ trunk/vice/src/zfile.c 2024-12-31 10:06:02 UTC (rev 45440)
@@ -43,9 +43,7 @@
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
-#ifdef HAVE_ZLIB
#include <zlib.h>
-#endif
#ifdef HAVE_STRINGS_H
#include <strings.h>
@@ -199,7 +197,6 @@
of the temporary file; return NULL otherwise. */
static char *try_uncompress_with_gzip(const char *name)
{
-#ifdef HAVE_ZLIB
FILE *fddest;
gzFile fdsrc;
char *tmp_name = NULL;
@@ -242,38 +239,6 @@
fclose(fddest);
return tmp_name;
-#else
- char *tmp_name = NULL;
- int exit_status;
- char *argv[4];
-
- if (!file_is_gzip(name)) {
- return NULL;
- }
-
- /* `exec*()' does not want these to be constant... */
- argv[0] = lib_strdup("gzip");
- argv[1] = lib_strdup("-cd");
- argv[2] = archdep_filename_parameter(name);
- argv[3] = NULL;
-
- ZDEBUG(("try_uncompress_with_gzip: spawning gzip -cd %s", name));
- exit_status = archdep_spawn("gzip", argv, &tmp_name, NULL);
-
- lib_free(argv[0]);
- lib_free(argv[1]);
- lib_free(argv[2]);
-
- if (exit_status == 0) {
- ZDEBUG(("try_uncompress_with_gzip: OK"));
- return tmp_name;
- } else {
- ZDEBUG(("try_uncompress_with_gzip: failed"));
- archdep_remove(tmp_name);
- lib_free(tmp_name);
- return NULL;
- }
-#endif
}
/* If `name' has a bzip-like extension, try to uncompress it into a temporary
@@ -829,7 +794,6 @@
/* Compress `src' into `dest' using gzip. */
static int compress_with_gzip(const char *src, const char *dest)
{
-#ifdef HAVE_ZLIB
FILE *fdsrc;
gzFile fddest;
size_t len;
@@ -859,36 +823,6 @@
ZDEBUG(("compress with zlib: OK."));
return 0;
-#else
- static char *argv[4];
- int exit_status;
- char *mdest;
-
- /* `exec*()' does not want these to be constant... */
- argv[0] = lib_strdup("gzip");
- argv[1] = lib_strdup("-c");
- argv[2] = lib_strdup(src);
- argv[3] = NULL;
-
- mdest = lib_strdup(dest);
-
- ZDEBUG(("compress_with_gzip: spawning gzip -c %s", src));
- exit_status = archdep_spawn("gzip", argv, &mdest, NULL);
-
- lib_free(mdest);
-
- lib_free(argv[0]);
- lib_free(argv[1]);
- lib_free(argv[2]);
-
- if (exit_status == 0) {
- ZDEBUG(("compress_with_gzip: OK."));
- return 0;
- } else {
- ZDEBUG(("compress_with_gzip: failed."));
- return -1;
- }
-#endif
}
/* Compress `src' into `dest' using bzip. */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gp...@us...> - 2024-12-31 06:32:48
|
Revision: 45439
http://sourceforge.net/p/vice-emu/code/45439
Author: gpz
Date: 2024-12-31 06:32:45 +0000 (Tue, 31 Dec 2024)
Log Message:
-----------
remove all traces of HAVE_FFMPEG
Modified Paths:
--------------
trunk/vice/configure.ac
trunk/vice/src/arch/gtk3/widgets/ffmpegwidget.c
trunk/vice/src/arch/sdl/menu_ffmpeg.c
trunk/vice/src/arch/sdl/menu_media.c
trunk/vice/src/arch/sdl/uimenu.c
trunk/vice/src/arch/shared/hotkeys/parser.c
trunk/vice/src/gfxoutputdrv/Makefile.am
trunk/vice/src/gfxoutputdrv/ffmpegexedrv.c
trunk/vice/src/gfxoutputdrv/ffmpegexedrv.h
trunk/vice/src/gfxoutputdrv/gfxoutput.c
trunk/vice/src/gfxoutputdrv/zmbvdrv.c
trunk/vice/src/vicefeatures.c
Removed Paths:
-------------
trunk/vice/src/gfxoutputdrv/ffmpegdrv.c
trunk/vice/src/gfxoutputdrv/ffmpegdrv.h
trunk/vice/src/gfxoutputdrv/ffmpeglib.c
trunk/vice/src/gfxoutputdrv/ffmpeglib.h
Modified: trunk/vice/configure.ac
===================================================================
--- trunk/vice/configure.ac 2024-12-29 14:58:40 UTC (rev 45438)
+++ trunk/vice/configure.ac 2024-12-31 06:32:45 UTC (rev 45439)
@@ -106,7 +106,6 @@
dnl
VICE_ARG_WITH_LIST(gif, [ --with-gif use GIF screenshot system])
VICE_ARG_WITH_LIST(png, [ --without-png do not use the PNG screenshot system])
-VICE_ARG_ENABLE_LIST(ffmpeg, [ --enable-ffmpeg enable FFmpeg support])
dnl Only supported for SDL1
VICE_ARG_ENABLE_LIST(hwscale, [ --disable-hwscale disables GPU scaling of emulated screen (SDL1 UI only)])
@@ -448,10 +447,6 @@
HAVE_DINPUT_SUPPORT="no "
HAVE_DYNLIB_SUPPORT_TOO="no "
HAVE_FASTSID_SUPPORT="no "
-HAVE_FFMPEG_AVRESAMPLE_SUPPORT="no "
-HAVE_FFMPEG_SUPPORT="no "
-HAVE_FFMPEG_SWRESAMPLE_SUPPORT="no "
-HAVE_FFMPEG_SWSCALE_SUPPORT="no "
HAVE_FONTCONFIG_SUPPORT="no "
HAVE_GIF_SUPPORT="no "
HAVE_HARDSID_SUPPORT="no "
@@ -2390,121 +2385,6 @@
LIBS="$old_LIBS"
AC_SUBST(NETPLAY_LIBS)
-dnl ----- FFMPEG -----
-FFMPEG_INCLUDES=
-
-HAVE_FFMPEG=no
-ffmpeg_use_header_subdirs=no
-
-AC_MSG_CHECKING([for FFMPEG support])
-
-dnl external ffmpeg
-if test x"$enable_ffmpeg" = "xyes"; then
- PKG_PROG_PKG_CONFIG
-
- valid_ffmpeg_platform="no"
-
- if test x"$is_unix" = "xyes"; then
- dnl --- unix (requires dynlib support) ---
- if test x"$dynlib_support" = "xyes"; then
- valid_ffmpeg_platform="yes"
- fi
- else
- valid_ffmpeg_platform="yes"
- fi
-
- if test x"$valid_ffmpeg_platform" = "xyes"; then
- AC_MSG_RESULT([via pkg-config])
- PKG_CHECK_MODULES(FFMPEG_AV, [libavcodec libavformat libavutil],
- [old_CFLAGS=$CFLAGS
- old_CPPFLAGS=$CPPFLAGS
- CFLAGS="$CFLAGS $FFMPEG_AV_CFLAGS"
- CPPFLAGS="$CPPFLAGS $FFMPEG_AV_CFLAGS"
-
- AC_CHECK_HEADER(libavformat/avformat.h,
- [AC_DEFINE([HAVE_FFMPEG_HEADER_SUBDIRS],,[FFMPEG uses subdirs for headers])
- ffmpeg_use_header_subdirs="yes"],
- [AC_CHECK_HEADER(avformat.h,,
- [AC_MSG_ERROR([No suitable FFMPEG header found!])])])
-
- CFLAGS=$old_CFLAGS
- CPPFLAGS=$old_CPPFLAGS
-
- PKG_CHECK_MODULES(FFMPEG_SWSCALE, [libswscale],
- [have_swscale=yes],
- [echo "no. trying img_convert"]
- [old_LIBS=$LIBS]
- [AC_CHECK_LIB(avcodec, img_convert,[have_imgconvert=yes])]
- [LIBS=$old_LIBS]
- )
- if (test x"${have_swscale}" = x"yes") || (test x"${have_imgconvert}" = x"yes") ; then
- AC_DEFINE([HAVE_FFMPEG],,[Have FFMPEG av* libs available])
- HAVE_FFMPEG_SUPPORT="yes"
- FFMPEG_INCLUDES="$FFMPEG_AV_CFLAGS"
- GFXOUTPUT_DRIVERS="$GFXOUTPUT_DRIVERS ffmpegdrv.o ffmpeglib.o"
- dlopen_pthread=yes
- fi
- if (test x"${have_swscale}" = x"yes") ; then
- AC_DEFINE([HAVE_FFMPEG_SWSCALE],,[Have FFMPEG swscale lib available])
- HAVE_FFMPEG_SWSCALE_SUPPORT="yes"
- FFMPEG_INCLUDES="$FFMPEG_INCLUDES $FFMPEG_SWSCALE_CFLAGS"
- dlopen_pthread=yes
- fi
- ],
- [echo "no. disabled."]
- )
- AC_DEFINE([EXTERNAL_FFMPEG],,[External FFMPEG libraries are used])
- HAVE_FFMPEG=yes
- PKG_CHECK_MODULES(FFMPEG_SWRESAMPLE, [libswresample], [have_swresample=yes], [have_swresample=no])
- if test x"$have_swresample" = "xyes"; then
- AC_DEFINE([HAVE_FFMPEG_SWRESAMPLE],,[Have FFMPEG swresample lib available])
- HAVE_FFMPEG_SWRESAMPLE_SUPPORT="yes"
- else
- # dnl libav is abandoned and support should be removed, but check for it if swresample is missing.
- PKG_CHECK_MODULES(FFMPEG_AVRESAMPLE, [libavresample], [have_avresample=yes], [have_avresample=no])
- if test x"$have_avresample" = "xyes"; then
- AC_DEFINE([HAVE_FFMPEG_AVRESAMPLE],,[Have libav avresample lib available])
- HAVE_FFMPEG_AVRESAMPLE_SUPPORT="yes"
- else
- AC_MSG_ERROR([No swresample or avresample library available!])
- fi
- fi
- else
- AC_MSG_RESULT([not available])
- fi
-fi
-
-if test x"$HAVE_FFMPEG" = "xyes"; then
-
- dnl
- dnl After all that, is the version of ffmpeg compatible with our code.
- dnl ffmpeg 4.x is, ffmpeg 5 is not.
- dnl
-
- ORIG_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $FFMPEG_INCLUDES"
-
- TEST_FFMPEG_C=" AVCodecContext *context_dropped_in_ffmpeg_5;
- "
-
- if test x"$ffmpeg_use_header_subdirs" = "xyes"; then
- AC_TRY_COMPILE([ #include "libavformat/avformat.h" ],
- [ $TEST_FFMPEG_C ],
- ,
- [ AC_MSG_ERROR([ffmpeg version is not compatible. Use 4.x]) ])
- else
- AC_TRY_COMPILE([ #include "avformat.h" ],
- [ $TEST_FFMPEG_C ],
- ,
- [ AC_MSG_ERROR([ffmpeg version is not compatible. Use 4.x])])
- fi
-
- CFLAGS=$ORIG_CFLAGS
- AC_SUBST(FFMPEG_INCLUDES)
-else
- AC_MSG_RESULT([disabled])
-fi
-
dnl check for glibc 2.20+
linux_glibc_220_and_up=yes
AC_MSG_CHECKING(if we are using glibc-2.20 and up)
@@ -3780,18 +3660,6 @@
echo "PNG encoding support : $HAVE_PNG_SUPPORT (--with/without-png)"
echo ""
-echo "VIDEO RECORDING"
-echo "---------------"
-
-echo "FFMPEG support : $HAVE_FFMPEG_SUPPORT (--enable-ffmpeg)"
-echo "FFMPEG swscale support : $HAVE_FFMPEG_SWSCALE_SUPPORT"
-if test x"$have_swresample" = "xyes"; then
- echo "Audio resampling library : swresample"
-elif test x"$have_avresample" = "xyes"; then
- echo "Audio resampling library : avresample"
-fi
-
-echo ""
echo "INPUT"
echo "-----"
Modified: trunk/vice/src/arch/gtk3/widgets/ffmpegwidget.c
===================================================================
--- trunk/vice/src/arch/gtk3/widgets/ffmpegwidget.c 2024-12-29 14:58:40 UTC (rev 45438)
+++ trunk/vice/src/arch/gtk3/widgets/ffmpegwidget.c 2024-12-31 06:32:45 UTC (rev 45439)
@@ -79,15 +79,6 @@
static GtkWidget *audiobitrate;
static GtkWidget *videobitrate;
-/* hack to deal with coexistence of old (lib) and new (exe) FFMPEG drivers,
- we use this to wrap usages of videodriver when producing resource names - in
- that case we use "FFMPEG" also when the videodriver name is "FFMPEGEXE". */
-static const char* ffmpeg_kludges(const char *name)
-{
- if (!strcmp(name, "FFMPEGEXE")) { return "FFMPEG"; }
- return name;
-}
-
/*****************************************************************************
* Event handlers *
****************************************************************************/
@@ -118,7 +109,7 @@
flags = driver_info->formatlist[fmt_id].flags;
if (fmt_name != NULL && *fmt_name != '\0') {
- resources_set_string_sprintf("%sFormat", fmt_name, ffmpeg_kludges(driver_info->name));
+ resources_set_string_sprintf("%sFormat", fmt_name, driver_info->name);
}
video = create_video_model(fmt_id);
@@ -125,7 +116,7 @@
gtk_combo_box_set_active(GTK_COMBO_BOX(video_widget), 0);
gtk_combo_box_set_model(GTK_COMBO_BOX(video_widget),
GTK_TREE_MODEL(video));
- if (resources_get_int_sprintf("%sVideoCodec", &vc, ffmpeg_kludges(driver_info->name)) < 0) {
+ if (resources_get_int_sprintf("%sVideoCodec", &vc, driver_info->name) < 0) {
vc = 0;
}
update_video_combo_box(vc);
@@ -134,7 +125,7 @@
gtk_combo_box_set_active(GTK_COMBO_BOX(audio_widget), 0);
gtk_combo_box_set_model(GTK_COMBO_BOX(audio_widget),
GTK_TREE_MODEL(audio));
- if (resources_get_int_sprintf("%sAudioCodec", &ac, ffmpeg_kludges(driver_info->name)) < 0) {
+ if (resources_get_int_sprintf("%sAudioCodec", &ac, driver_info->name) < 0) {
ac = 0;
}
update_audio_combo_box(ac);
@@ -163,7 +154,7 @@
int codec;
gtk_tree_model_get(model, &iter, 1, &codec, -1);
- resources_set_int_sprintf("%sVideoCodec", codec, ffmpeg_kludges(driver_info->name));
+ resources_set_int_sprintf("%sVideoCodec", codec, driver_info->name);
}
}
@@ -187,7 +178,7 @@
int codec;
gtk_tree_model_get(model, &iter, 1, &codec, -1);
- resources_set_int_sprintf("%sAudioCodec", codec, ffmpeg_kludges(driver_info->name));
+ resources_set_int_sprintf("%sAudioCodec", codec, driver_info->name);
}
}
@@ -530,7 +521,7 @@
formatlist = driver_info->formatlist;
/* get current FFMPEG format */
- if (resources_get_string_sprintf("%sFormat", ¤t_format, ffmpeg_kludges(driver)) < 0) {
+ if (resources_get_string_sprintf("%sFormat", ¤t_format, driver) < 0) {
current_format = "avi"; /* hope this works out */
}
@@ -552,7 +543,7 @@
video_widget = create_video_combo_box(fmt_index);
gtk_grid_attach(GTK_GRID(grid), label, 0, 1, 1, 1);
gtk_grid_attach(GTK_GRID(grid), video_widget, 1, 1, 1, 1);
- if (resources_get_int_sprintf("%sVideoCodec", ¤t_vc, ffmpeg_kludges(driver)) < 0) {
+ if (resources_get_int_sprintf("%sVideoCodec", ¤t_vc, driver) < 0) {
current_vc = 0;
}
update_video_combo_box(current_vc);
@@ -563,7 +554,7 @@
audio_widget = create_audio_combo_box(fmt_index);
gtk_grid_attach(GTK_GRID(grid), label, 2, 1, 1, 1);
gtk_grid_attach(GTK_GRID(grid), audio_widget, 3, 1, 1, 1);
- if (resources_get_int_sprintf("%sAudioCodec", ¤t_ac, ffmpeg_kludges(driver)) < 0) {
+ if (resources_get_int_sprintf("%sAudioCodec", ¤t_ac, driver) < 0) {
current_ac = 0;
}
update_audio_combo_box(current_ac);
Modified: trunk/vice/src/arch/sdl/menu_ffmpeg.c
===================================================================
--- trunk/vice/src/arch/sdl/menu_ffmpeg.c 2024-12-29 14:58:40 UTC (rev 45438)
+++ trunk/vice/src/arch/sdl/menu_ffmpeg.c 2024-12-31 06:32:45 UTC (rev 45439)
@@ -33,7 +33,7 @@
#include "types.h"
-#include "ffmpegdrv.h"
+#include "ffmpegexedrv.h"
#include "gfxoutput.h"
#include "lib.h"
#include "menu_common.h"
@@ -73,15 +73,6 @@
static void update_format_menu(const char *current_format);
static void update_codec_menus(const char *current_format);
-/* hack to deal with coexistence of old (lib) and new (exe) FFMPEG drivers,
- we use this to wrap usages of videodriver when producing resource names - in
- that case we use "FFMPEG" also when the videodriver name is "FFMPEGEXE". */
-static const char* ffmpeg_kludges(const char *name)
-{
- if (!strcmp(name, "FFMPEGEXE")) { return "FFMPEG"; }
- return name;
-}
-
/* activate this driver */
void sdl_menu_ffmpeg_set_driver(const char *videodriver)
{
@@ -96,7 +87,7 @@
videodriver_formatlist = ffmpeg_drv->formatlist;
- resources_get_string_sprintf("%sFormat", &w, ffmpeg_kludges(videodriver));
+ resources_get_string_sprintf("%sFormat", &w, videodriver);
update_format_menu(w);
update_codec_menus(w);
}
@@ -302,7 +293,7 @@
} else {
/* get the currently used video codec */
- resources_get_int_sprintf("%sVideoCodec", &video_codec_id, ffmpeg_kludges(videodriver));
+ resources_get_int_sprintf("%sVideoCodec", &video_codec_id, videodriver);
codec_found = 0;
while (codec && codec->name) {
@@ -335,7 +326,7 @@
/* is the old codec still valid for the new driver? */
if (!codec_found) {
/* no: default to the first codec in the new submenu */
- resources_set_int_sprintf("%sVideoCodec", format->video_codecs[0].id, ffmpeg_kludges(videodriver));
+ resources_set_int_sprintf("%sVideoCodec", format->video_codecs[0].id, videodriver);
}
}
@@ -349,7 +340,7 @@
} else {
/* get the currently selected audio codec */
- resources_get_int_sprintf("%sAudioCodec", &audio_codec_id, ffmpeg_kludges(videodriver));
+ resources_get_int_sprintf("%sAudioCodec", &audio_codec_id, videodriver);
codec_found = 0;
while (codec && codec->name) {
audio_codec_menu[i].action = ACTION_NONE;
@@ -382,7 +373,7 @@
/* is the old codec still valid for the new driver? */
if (!codec_found) {
/* no: default to the first codec in the new submenu */
- resources_set_int_sprintf("%sAudioCodec", format->audio_codecs[0].id, ffmpeg_kludges(videodriver));
+ resources_set_int_sprintf("%sAudioCodec", format->audio_codecs[0].id, videodriver);
}
}
@@ -398,14 +389,14 @@
return NULL;
}
if (activated) {
- resources_set_string_sprintf("%sFormat", (char *)param, ffmpeg_kludges(videodriver));
+ resources_set_string_sprintf("%sFormat", (char *)param, videodriver);
update_codec_menus((const char *)param);
} else {
const char *w;
- resources_get_string_sprintf("%sFormat", &w, ffmpeg_kludges(videodriver));
+ resources_get_string_sprintf("%sFormat", &w, videodriver);
#ifdef SDL_DEBUG
- fprintf(stderr, "%s: %sFormat = '%s'\n", __func__, ffmpeg_kludges(videodriver), w);
+ fprintf(stderr, "%s: %sFormat = '%s'\n", __func__, videodriver, w);
#endif
if (!strcmp(w, (char *)param)) {
return sdl_menu_text_tick;
@@ -424,15 +415,15 @@
}
if (activated) {
const char *w;
- resources_set_int_sprintf("%sAudioCodec", vice_ptr_to_int(param), ffmpeg_kludges(videodriver));
- resources_get_string_sprintf("%sFormat", &w, ffmpeg_kludges(videodriver));
+ resources_set_int_sprintf("%sAudioCodec", vice_ptr_to_int(param), videodriver);
+ resources_get_string_sprintf("%sFormat", &w, videodriver);
update_codec_menus(w);
} else {
int w = 0;
- resources_get_int_sprintf("%sAudioCodec", &w, ffmpeg_kludges(videodriver));
+ resources_get_int_sprintf("%sAudioCodec", &w, videodriver);
#ifdef SDL_DEBUG
- fprintf(stderr, "%s: %sFormat = '%d'\n", __func__, ffmpeg_kludges(videodriver), w);
+ fprintf(stderr, "%s: %sFormat = '%d'\n", __func__, videodriver, w);
#endif
if (w == vice_ptr_to_int(param)) {
return sdl_menu_text_tick;
@@ -451,15 +442,15 @@
}
if (activated) {
const char *w;
- resources_set_int_sprintf("%sVideoCodec", vice_ptr_to_int(param), ffmpeg_kludges(videodriver));
- resources_get_string_sprintf("%sFormat", &w, ffmpeg_kludges(videodriver));
+ resources_set_int_sprintf("%sVideoCodec", vice_ptr_to_int(param), videodriver);
+ resources_get_string_sprintf("%sFormat", &w, videodriver);
update_codec_menus(w);
} else {
int w = 0;
- resources_get_int_sprintf("%sVideoCodec", &w, ffmpeg_kludges(videodriver));
+ resources_get_int_sprintf("%sVideoCodec", &w, videodriver);
#ifdef SDL_DEBUG
- fprintf(stderr, "%s: %sFormat = '%d'\n", __func__, ffmpeg_kludges(videodriver), w);
+ fprintf(stderr, "%s: %sFormat = '%d'\n", __func__, videodriver, w);
#endif
if (w == vice_ptr_to_int(param)) {
return sdl_menu_text_tick;
@@ -494,7 +485,7 @@
return;
}
- resources_get_string_sprintf("%sFormat", &w, ffmpeg_kludges(videodriver));
+ resources_get_string_sprintf("%sFormat", &w, videodriver);
update_format_menu(w);
update_codec_menus(w);
}
Modified: trunk/vice/src/arch/sdl/menu_media.c
===================================================================
--- trunk/vice/src/arch/sdl/menu_media.c 2024-12-29 14:58:40 UTC (rev 45438)
+++ trunk/vice/src/arch/sdl/menu_media.c 2024-12-31 06:32:45 UTC (rev 45439)
@@ -122,11 +122,7 @@
/** \brief Generic media menu */
-#ifdef HAVE_FFMPEG
-#define MAX_VIDEO_DRIVERS 3
-#else
#define MAX_VIDEO_DRIVERS 2
-#endif
/* FIXME: the list of drivers and -menu items should be generated at runtime,
using the list of registered video drivers */
@@ -133,10 +129,7 @@
static int video_driver_index = 0;
static const char *video_driver_names[MAX_VIDEO_DRIVERS] = {
"ZMBV",
-#ifdef HAVE_FFMPEG
"FFMPEG",
-#endif
- "FFMPEGEXE",
};
/* called to (re)build the list/menu of video(movie) drivers */
@@ -190,18 +183,11 @@
.callback = custom_video_driver_callback,
.data = (ui_callback_data_t)"ZMBV"
},
-#ifdef HAVE_FFMPEG
- { .string = "FFMPEG (Library)",
+ { .string = "FFMPEG (Executable)",
.type = MENU_ENTRY_RESOURCE_RADIO,
.callback = custom_video_driver_callback,
.data = (ui_callback_data_t)"FFMPEG"
},
-#endif
- { .string = "FFMPEG (Executable)",
- .type = MENU_ENTRY_RESOURCE_RADIO,
- .callback = custom_video_driver_callback,
- .data = (ui_callback_data_t)"FFMPEGEXE"
- },
SDL_MENU_LIST_END
};
Modified: trunk/vice/src/arch/sdl/uimenu.c
===================================================================
--- trunk/vice/src/arch/sdl/uimenu.c 2024-12-29 14:58:40 UTC (rev 45438)
+++ trunk/vice/src/arch/sdl/uimenu.c 2024-12-31 06:32:45 UTC (rev 45439)
@@ -1422,11 +1422,10 @@
void sdl_ui_activate_pre_action(void)
{
DBG(("sdl_ui_activate_pre_action start"));
-#ifdef HAVE_FFMPEG
+
if (screenshot_is_recording()) {
screenshot_stop_recording();
}
-#endif
vsync_suspend_speed_eval();
sound_suspend();
Modified: trunk/vice/src/arch/shared/hotkeys/parser.c
===================================================================
--- trunk/vice/src/arch/shared/hotkeys/parser.c 2024-12-29 14:58:40 UTC (rev 45438)
+++ trunk/vice/src/arch/shared/hotkeys/parser.c 2024-12-31 06:32:45 UTC (rev 45439)
@@ -1246,13 +1246,6 @@
false
#endif
},
- { "HAVE_FFMPEG",
-#ifdef HAVE_FFMPEG
- true
-#else
- false
-#endif
- },
{ "UNIX",
#if defined(UNIX_COMPILE) && !defined(MACOS_COMPILE)
true
Modified: trunk/vice/src/gfxoutputdrv/Makefile.am
===================================================================
--- trunk/vice/src/gfxoutputdrv/Makefile.am 2024-12-29 14:58:40 UTC (rev 45438)
+++ trunk/vice/src/gfxoutputdrv/Makefile.am 2024-12-31 06:32:45 UTC (rev 45439)
@@ -7,7 +7,6 @@
-I$(top_srcdir)/src \
-I$(top_srcdir)/src/lib/libzmbv \
-I$(top_srcdir)/src/arch/shared/sounddrv \
- @FFMPEG_INCLUDES@ \
@ARCH_INCLUDES@
AM_CFLAGS = @VICE_CFLAGS@
@@ -21,10 +20,6 @@
# These sources are linked only under certain circumstances.
EXTRA_libgfxoutputdrv_a_SOURCES = \
- ffmpegdrv.c \
- ffmpegdrv.h \
- ffmpeglib.c \
- ffmpeglib.h \
gifdrv.c \
gifdrv.h \
pngdrv.c \
Deleted: trunk/vice/src/gfxoutputdrv/ffmpegdrv.c
===================================================================
--- trunk/vice/src/gfxoutputdrv/ffmpegdrv.c 2024-12-29 14:58:40 UTC (rev 45438)
+++ trunk/vice/src/gfxoutputdrv/ffmpegdrv.c 2024-12-31 06:32:45 UTC (rev 45439)
@@ -1,1144 +0,0 @@
-/** \file ffmpegdrv.c
- * \brie Movie driver using FFMPEG library and screenshot API
- *
- * \author Andreas Matthies <and...@gm...>
- */
-
-/*
- * This file is part of VICE, the Versatile Commodore Emulator.
- * See README for copyright notice.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA.
- *
- */
-
-#include "vice.h"
-
-#ifdef HAVE_FFMPEG
-
-/* Disable clang deprecation warnings for ffmpeg - let's fix it when it stops working */
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-
-#include <stdio.h>
-#include <string.h>
-
-#include "archdep.h"
-#include "cmdline.h"
-#include "ffmpegdrv.h"
-#include "ffmpeglib.h"
-#include "gfxoutput.h"
-#include "lib.h"
-#include "log.h"
-#include "machine.h"
-#include "palette.h"
-#include "resources.h"
-#include "screenshot.h"
-#include "uiapi.h"
-#include "util.h"
-#include "soundmovie.h"
-
-/** \brief Helper macro to determine ffmpeg version
- */
-#if (LIBAVCODEC_VERSION_MAJOR >= 58) && (LIBAVCODEC_VERSION_MINOR >= 18)
-# define HAVE_FFMPEG4
-#endif
-
-
-static gfxoutputdrv_codec_t avi_audio_codeclist[] = {
- { AV_CODEC_ID_MP2, "MP2" },
- { AV_CODEC_ID_MP3, "MP3" },
- { AV_CODEC_ID_FLAC, "FLAC" },
- { AV_CODEC_ID_PCM_S16LE, "PCM uncompressed" },
- { 0, NULL }
-};
-
-static gfxoutputdrv_codec_t mp4_audio_codeclist[] = {
- { AV_CODEC_ID_AAC, "AAC" },
- { AV_CODEC_ID_MP3, "MP3" },
- { AV_CODEC_ID_AC3, "AC3" },
- { 0, NULL }
-};
-
-static gfxoutputdrv_codec_t avi_video_codeclist[] = {
- { AV_CODEC_ID_MPEG4, "MPEG4 (DivX)" },
- { AV_CODEC_ID_MPEG1VIDEO, "MPEG1" },
- { AV_CODEC_ID_FFV1, "FFV1 (lossless)" },
- { AV_CODEC_ID_H264, "H264" },
- { AV_CODEC_ID_THEORA, "Theora" },
- { 0, NULL }
-};
-
-static gfxoutputdrv_codec_t mp4_video_codeclist[] = {
- { AV_CODEC_ID_H264, "H264" },
-#ifdef AV_CODEC_ID_H265
- { AV_CODEC_ID_H265, "H265" },
-#endif
- { 0, NULL }
-};
-
-static gfxoutputdrv_codec_t ogg_audio_codeclist[] = {
- { AV_CODEC_ID_FLAC, "FLAC" },
- { 0, NULL }
-};
-
-static gfxoutputdrv_codec_t ogg_video_codeclist[] = {
- { AV_CODEC_ID_THEORA, "Theora" },
- { 0, NULL }
-};
-
-static gfxoutputdrv_codec_t none_codeclist[] = {
- { AV_CODEC_ID_NONE, "" },
- { 0, NULL }
-};
-
-#define VIDEO_OPTIONS \
- (GFXOUTPUTDRV_HAS_AUDIO_CODECS | \
- GFXOUTPUTDRV_HAS_VIDEO_CODECS | \
- GFXOUTPUTDRV_HAS_AUDIO_BITRATE | \
- GFXOUTPUTDRV_HAS_VIDEO_BITRATE | \
- GFXOUTPUTDRV_HAS_HALF_VIDEO_FRAMERATE)
-
-#define AUDIO_OPTIONS \
- (GFXOUTPUTDRV_HAS_AUDIO_CODECS | \
- GFXOUTPUTDRV_HAS_AUDIO_BITRATE)
-
-/* formatlist is filled from with available formats and codecs at init time */
-gfxoutputdrv_format_t *ffmpegdrv_formatlist = NULL;
-static gfxoutputdrv_format_t formats_to_test[] =
-{
- { "mp4", mp4_audio_codeclist, mp4_video_codeclist, VIDEO_OPTIONS },
- { "ogg", ogg_audio_codeclist, ogg_video_codeclist, VIDEO_OPTIONS },
- { "avi", avi_audio_codeclist, avi_video_codeclist, VIDEO_OPTIONS },
- { "matroska", mp4_audio_codeclist, mp4_video_codeclist, VIDEO_OPTIONS },
- { "wav", NULL, NULL, AUDIO_OPTIONS },
- { "mp3", NULL, none_codeclist, AUDIO_OPTIONS }, /* formats expects png which fails in VICE */
- { "mp2", NULL, NULL, AUDIO_OPTIONS },
- { NULL, NULL, NULL, 0 }
-};
-
-typedef struct OutputStream {
- AVStream *st;
- int64_t next_pts;
- int samples_count;
- AVFrame *frame;
- AVFrame *tmp_frame;
-} OutputStream;
-
-/* general */
-static ffmpeglib_t ffmpeglib;
-static AVFormatContext *ffmpegdrv_oc;
-static AVOutputFormat *ffmpegdrv_fmt;
-static int file_init_done;
-
-/* audio */
-static OutputStream audio_st = { 0 };
-static AVCodec *avcodecaudio;
-static soundmovie_buffer_t ffmpegdrv_audio_in;
-static int audio_init_done;
-static int audio_is_open;
-
-#ifndef HAVE_FFMPEG_AVRESAMPLE
-static struct SwrContext *swr_ctx;
-#else
-static struct AVAudioResampleContext *avr_ctx;
-#endif
-
-/* video */
-static OutputStream video_st = { 0 };
-static AVCodec *avcodecvideo;
-static int video_init_done;
-static int video_is_open;
-static int video_width, video_height;
-static unsigned int framecounter;
-#ifdef HAVE_FFMPEG_SWSCALE
-static struct SwsContext *sws_ctx;
-#endif
-
-/* resources */
-static char *ffmpeg_format = NULL;
-static int format_index;
-static int audio_bitrate;
-static int video_bitrate;
-static int audio_codec;
-static int video_codec;
-static int video_halve_framerate;
-
-static int ffmpegdrv_init_file(void);
-
-static int set_container_format(const char *val, void *param)
-{
- int i;
-
- /* kludge to prevent crash at startup when using --help on the commandline */
- if (ffmpegdrv_formatlist == NULL) {
- return 0;
- }
-
- format_index = -1;
-
- for (i = 0; ffmpegdrv_formatlist[i].name != NULL; i++) {
- if (strcmp(val, ffmpegdrv_formatlist[i].name) == 0) {
- format_index = i;
- }
- }
-
- if (format_index < 0) {
- return -1;
- }
-
- util_string_set(&ffmpeg_format, val);
-
- return 0;
-}
-
-static int set_audio_bitrate(int val, void *param)
-{
- audio_bitrate = val;
-
- if ((audio_bitrate < VICE_FFMPEG_AUDIO_RATE_MIN)
- || (audio_bitrate > VICE_FFMPEG_AUDIO_RATE_MAX)) {
- audio_bitrate = VICE_FFMPEG_AUDIO_RATE_DEFAULT;
- }
- return 0;
-}
-
-static int set_video_bitrate(int val, void *param)
-{
- video_bitrate = val;
-
- if ((video_bitrate < VICE_FFMPEG_VIDEO_RATE_MIN)
- || (video_bitrate > VICE_FFMPEG_VIDEO_RATE_MAX)) {
- video_bitrate = VICE_FFMPEG_VIDEO_RATE_DEFAULT;
- }
- return 0;
-}
-
-static int set_audio_codec(int val, void *param)
-{
- audio_codec = val;
- return 0;
-}
-
-static int set_video_codec(int val, void *param)
-{
- video_codec = val;
- return 0;
-}
-
-static int set_video_halve_framerate(int value, void *param)
-{
- int val = value ? 1 : 0;
-
- if (video_halve_framerate != val && screenshot_is_recording()) {
- ui_error("Can't change framerate while recording. Try again later.");
- return 0;
- }
-
- video_halve_framerate = val;
-
- return 0;
-}
-
-/*---------- Resources ------------------------------------------------*/
-
-static const resource_string_t resources_string[] = {
- { "FFMPEGFormat", "mp4", RES_EVENT_NO, NULL,
- &ffmpeg_format, set_container_format, NULL },
- RESOURCE_STRING_LIST_END
-};
-
-static const resource_int_t resources_int[] = {
- { "FFMPEGAudioBitrate", VICE_FFMPEG_AUDIO_RATE_DEFAULT,
- RES_EVENT_NO, NULL,
- &audio_bitrate, set_audio_bitrate, NULL },
- { "FFMPEGVideoBitrate", VICE_FFMPEG_VIDEO_RATE_DEFAULT,
- RES_EVENT_NO, NULL,
- &video_bitrate, set_video_bitrate, NULL },
- { "FFMPEGAudioCodec", AV_CODEC_ID_AAC, RES_EVENT_NO, NULL,
- &audio_codec, set_audio_codec, NULL },
- { "FFMPEGVideoCodec", AV_CODEC_ID_H264, RES_EVENT_NO, NULL,
- &video_codec, set_video_codec, NULL },
- { "FFMPEGVideoHalveFramerate", 0, RES_EVENT_NO, NULL,
- &video_halve_framerate, set_video_halve_framerate, NULL },
- RESOURCE_INT_LIST_END
-};
-
-static int ffmpegdrv_resources_init(void)
-{
- if (resources_register_string(resources_string) < 0) {
- return -1;
- }
-
- return resources_register_int(resources_int);
-}
-
-/*---------- Commandline options --------------------------------------*/
-
-static const cmdline_option_t cmdline_options[] =
-{
- { "-ffmpegaudiobitrate", SET_RESOURCE, CMDLINE_ATTRIB_NEED_ARGS,
- NULL, NULL, "FFMPEGAudioBitrate", NULL,
- "<value>", "Set bitrate for audio stream in media file" },
- { "-ffmpegvideobitrate", SET_RESOURCE, CMDLINE_ATTRIB_NEED_ARGS,
- NULL, NULL, "FFMPEGVideoBitrate", NULL,
- "<value>", "Set bitrate for video stream in media file" },
- CMDLINE_LIST_END
-};
-
-static int ffmpegdrv_cmdline_options_init(void)
-{
- return cmdline_register_options(cmdline_options);
-}
-
-/*---------------------------------------------------------------------*/
-
-static int write_frame(AVFormatContext *fmt_ctx, const AVRational *time_base, AVStream *st, AVPacket *pkt)
-{
- /* rescale output packet timestamp values from codec to stream timebase */
- VICE_P_AV_PACKET_RESCALE_TS(pkt, *time_base, st->time_base);
- pkt->stream_index = st->index;
-
- /* Write the compressed frame to the media file. */
- return VICE_P_AV_INTERLEAVED_WRITE_FRAME(fmt_ctx, pkt);
-}
-
-static void close_stream(OutputStream *ost)
-{
- VICE_P_AVCODEC_CLOSE(ost->st->codec);
- VICE_P_AV_FRAME_FREE(&ost->frame);
- VICE_P_AV_FRAME_FREE(&ost->tmp_frame);
-}
-
-/*-----------------------*/
-/* audio stream encoding */
-/*-----------------------*/
-
-static AVFrame *alloc_audio_frame(enum AVSampleFormat sample_fmt,
- uint64_t channel_layout,
- int sample_rate, int nb_samples)
-{
- AVFrame *frame = VICE_P_AV_FRAME_ALLOC();
- int ret;
-
- if (!frame) {
- log_debug(LOG_DEFAULT, "ffmpegdrv: Error allocating an audio frame");
- return NULL;
- }
-
- frame->format = sample_fmt;
- frame->channel_layout = channel_layout;
- frame->sample_rate = sample_rate;
- frame->nb_samples = nb_samples;
-
- if (nb_samples) {
- ret = VICE_P_AV_FRAME_GET_BUFFER(frame, 0);
- if (ret < 0) {
- log_debug(LOG_DEFAULT, "ffmpegdrv: Error allocating an audio buffer");
- return NULL;
- }
- }
-
- return frame;
-}
-
-static int ffmpegdrv_open_audio(AVFormatContext *oc, AVStream *st)
-{
- AVCodecContext *c;
- int audio_inbuf_samples;
- int ret;
- AVDictionary *opts = NULL;
-
- c = st->codec;
- /* open codec */
- /* aac encoder ist flaged 'experimental' */
- VICE_P_AV_DICT_SET(&opts, "strict", "experimental", 0);
- ret = VICE_P_AVCODEC_OPEN2(c, avcodecaudio, &opts);
- VICE_P_AV_DICT_FREE(&opts);
-
- if (ret < 0) {
- log_debug(LOG_DEFAULT, "ffmpegdrv: could not open audio codec (%d)", ret);
- return -1;
- }
-
- audio_is_open = 1;
-#ifdef HAVE_FFMPEG4
- if (c->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE) {
-#else
- if (c->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE) {
-#endif
- audio_inbuf_samples = 10000;
- } else {
- audio_inbuf_samples = c->frame_size;
- }
-
- audio_st.frame = alloc_audio_frame(c->sample_fmt, c->channel_layout, c->sample_rate, audio_inbuf_samples);
- audio_st.tmp_frame = alloc_audio_frame(AV_SAMPLE_FMT_S16, c->channel_layout, c->sample_rate, audio_inbuf_samples);
-
- if (!audio_st.frame || !audio_st.tmp_frame) {
- return -1;
- }
-
- ffmpegdrv_audio_in.size = audio_inbuf_samples * c->channels;
- ffmpegdrv_audio_in.buffer = (int16_t *)audio_st.tmp_frame->data[0];
- return 0;
-}
-
-static void ffmpegdrv_close_audio(void)
-{
- if (audio_st.st == NULL) {
- return;
- }
-
- if (audio_is_open) {
- close_stream(&audio_st);
- }
-
- audio_is_open = 0;
- ffmpegdrv_audio_in.buffer = NULL;
- ffmpegdrv_audio_in.size = 0;
-#ifndef HAVE_FFMPEG_AVRESAMPLE
- VICE_P_SWR_FREE(&swr_ctx);
-#else
- VICE_P_AVRESAMPLE_FREE(&avr_ctx);
-#endif
-}
-
-static int ffmpegmovie_init_audio(int speed, int channels, soundmovie_buffer_t ** audio_in)
-{
- AVCodecContext *c;
- AVStream *st;
- int i;
-
- if (ffmpegdrv_oc == NULL || ffmpegdrv_fmt == NULL) {
- return -1;
- }
-
- audio_init_done = 1;
-
- if (ffmpegdrv_fmt->audio_codec == AV_CODEC_ID_NONE) {
- return -1;
- }
-
- *audio_in = &ffmpegdrv_audio_in;
-
- (*audio_in)->size = 0; /* not allocated yet */
- (*audio_in)->used = 0;
-
- st = VICE_P_AVFORMAT_NEW_STREAM(ffmpegdrv_oc, avcodecaudio);
- if (!st) {
- log_debug(LOG_DEFAULT, "ffmpegdrv: Could not alloc audio stream");
- return -1;
- }
-
- c = st->codec;
-
- /* put sample parameters */
- c->sample_fmt = avcodecaudio->sample_fmts ? avcodecaudio->sample_fmts[0] : AV_SAMPLE_FMT_S16;
- c->bit_rate = audio_bitrate;
- c->sample_rate = speed;
-
- if (avcodecaudio->supported_samplerates) {
- c->sample_rate = avcodecaudio->supported_samplerates[0];
- for (i = 0; avcodecaudio->supported_samplerates[i]; i++) {
- if (avcodecaudio->supported_samplerates[i] == speed)
- c->sample_rate = speed;
- }
- }
- c->channel_layout = (channels == 1 ? AV_CH_LAYOUT_MONO : AV_CH_LAYOUT_STEREO);
- c->channels = VICE_P_AV_GET_CHANNEL_LAYOUT_NB_CHANNELS(c->channel_layout);
-
- st->time_base = (AVRational){ 1, c->sample_rate };
- audio_st.st = st;
- audio_st.next_pts = 0;
- audio_st.samples_count = 0;
-
- /* Some formats want stream headers to be separate. */
- if (ffmpegdrv_oc->oformat->flags & AVFMT_GLOBALHEADER) {
-#ifdef HAVE_FFMPEG4
- c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
-#else
- c->flags |= CODEC_FLAG_GLOBAL_HEADER;
-#endif
- }
-
- /* create resampler context */
-#ifndef HAVE_FFMPEG_AVRESAMPLE
- swr_ctx = VICE_P_SWR_ALLOC();
- if (!swr_ctx) {
-#else
- avr_ctx = VICE_P_AVRESAMPLE_ALLOC_CONTEXT();
- if (!avr_ctx) {
-#endif
- log_debug(LOG_DEFAULT, "ffmpegdrv: Could not alloc resampler context");
- return -1;
- }
-
- /* set options */
-#ifndef HAVE_FFMPEG_AVRESAMPLE
- VICE_P_AV_OPT_SET_INT(swr_ctx, "in_channel_count", c->channels, 0);
- VICE_P_AV_OPT_SET_INT(swr_ctx, "in_sample_rate", speed, 0);
- VICE_P_AV_OPT_SET_SAMPLE_FMT(swr_ctx, "in_sample_fmt", AV_SAMPLE_FMT_S16, 0);
- VICE_P_AV_OPT_SET_INT(swr_ctx, "out_channel_count", c->channels, 0);
- VICE_P_AV_OPT_SET_INT(swr_ctx, "out_sample_rate", c->sample_rate, 0);
- VICE_P_AV_OPT_SET_SAMPLE_FMT(swr_ctx, "out_sample_fmt", c->sample_fmt, 0);
-#else
- VICE_P_AV_OPT_SET_INT(avr_ctx, "in_channel_count", c->channels, 0);
- VICE_P_AV_OPT_SET_INT(avr_ctx, "in_channel_layout", c->channel_layout, 0);
- VICE_P_AV_OPT_SET_INT(avr_ctx, "in_sample_rate", speed, 0);
- VICE_P_AV_OPT_SET_INT(avr_ctx, "in_sample_fmt", AV_SAMPLE_FMT_S16, 0);
- VICE_P_AV_OPT_SET_INT(avr_ctx, "out_channel_count", c->channels, 0);
- VICE_P_AV_OPT_SET_INT(avr_ctx, "out_channel_layout", c->channel_layout, 0);
- VICE_P_AV_OPT_SET_INT(avr_ctx, "out_sample_rate", c->sample_rate, 0);
- VICE_P_AV_OPT_SET_INT(avr_ctx, "out_sample_fmt", c->sample_fmt, 0);
-#endif
-
- /* initialize the resampling context */
-#ifndef HAVE_FFMPEG_AVRESAMPLE
- if (VICE_P_SWR_INIT(swr_ctx) < 0) {
-#else
- if (VICE_P_AVRESAMPLE_OPEN(avr_ctx) < 0) {
-#endif
- log_debug(LOG_DEFAULT, "ffmpegdrv: Failed to initialize the resampling context");
- return -1;
- }
-
- if (video_init_done) {
- ffmpegdrv_init_file();
- }
-
- return 0;
-}
-
-/* triggered by soundffmpegaudio->write */
-static int ffmpegmovie_encode_audio(soundmovie_buffer_t *audio_in)
-{
- int got_packet;
- int dst_nb_samples;
- AVPacket pkt = { 0 };
- AVCodecContext *c;
- AVFrame *frame;
- int ret;
-
- if (audio_st.st) {
- audio_st.frame->pts = audio_st.next_pts;
- audio_st.next_pts += audio_in->size;
-
- VICE_P_AV_INIT_PACKET(&pkt);
- c = audio_st.st->codec;
-
- frame = audio_st.tmp_frame;
-
- if (frame) {
- /* convert samples from native format to destination codec format, using the resampler */
- /* compute destination number of samples */
-#ifndef HAVE_FFMPEG_AVRESAMPLE
- dst_nb_samples = (int)VICE_P_AV_RESCALE_RND(VICE_P_SWR_GET_DELAY(swr_ctx, c->sample_rate) + frame->nb_samples, c->sample_rate, c->sample_rate, AV_ROUND_UP);
-#else
- dst_nb_samples = (int)VICE_P_AV_RESCALE_RND(VICE_P_AVRESAMPLE_GET_DELAY(avr_ctx, c->sample_rate) + frame->nb_samples, c->sample_rate, c->sample_rate, AV_ROUND_UP);
-#endif
-
- /* when we pass a frame to the encoder, it may keep a reference to it
- * internally;
- * make sure we do not overwrite it here
- */
- ret = VICE_P_AV_FRAME_MAKE_WRITABLE(audio_st.frame);
- if (ret < 0)
- return -1;
-
- /* convert to destination format */
-#ifndef HAVE_FFMPEG_AVRESAMPLE
- ret = VICE_P_SWR_CONVERT(swr_ctx, audio_st.frame->data, dst_nb_samples, (const uint8_t **)frame->data, frame->nb_samples);
-#else
- ret = VICE_P_AVRESAMPLE_CONVERT(avr_ctx, audio_st.frame->data, 0, dst_nb_samples, (const uint8_t **)frame->data, 0, frame->nb_samples);
-#endif
- if (ret < 0) {
- log_debug(LOG_DEFAULT, "ffmpegdrv_encode_audio: Error while converting audio frame");
- return -1;
- }
- frame = audio_st.frame;
- frame->pts = VICE_P_AV_RESCALE_Q(audio_st.samples_count, (AVRational){ 1, c->sample_rate }, c->time_base);
- audio_st.samples_count += dst_nb_samples;
- }
-
- ret = VICE_P_AVCODEC_ENCODE_AUDIO2(audio_st.st->codec, &pkt, audio_st.frame, &got_packet);
- if (got_packet) {
- if (write_frame(ffmpegdrv_oc, &c->time_base, audio_st.st, &pkt)<0)
- {
- log_debug(LOG_DEFAULT, "ffmpegdrv_encode_audio: Error while writing audio frame");
- }
- }
- }
-
- audio_in->used = 0;
- return 0;
-}
-
-static void ffmpegmovie_close(void)
-{
- /* just stop the whole recording */
- screenshot_stop_recording();
-}
-
-static soundmovie_funcs_t ffmpegdrv_soundmovie_funcs = {
- ffmpegmovie_init_audio,
- ffmpegmovie_encode_audio,
- ffmpegmovie_close
-};
-
-/*-----------------------*/
-/* video stream encoding */
-/*-----------------------*/
-static int ffmpegdrv_fill_rgb_image(screenshot_t *screenshot, AVFrame *pic)
-{
- int x, y;
- int dx, dy;
- int colnum;
- int bufferoffset;
- int x_dim = screenshot->width;
- int y_dim = screenshot->height;
- int pix = 0;
- /* center the screenshot in the video */
- dx = (video_width - x_dim) / 2;
- dy = (video_height - y_dim) / 2;
- bufferoffset = screenshot->x_offset + (dx < 0 ? -dx : 0)
- + (screenshot->y_offset + (dy < 0 ? -dy : 0)) * screenshot->draw_buffer_line_size;
-
- for (y = 0; y < video_height; y++) {
- for (x = 0; x < video_width; x++) {
- colnum = screenshot->draw_buffer[bufferoffset + x];
- pic->data[0][pix + 3*x] = screenshot->palette->entries[colnum].red;
- pic->data[0][pix + 3*x + 1] = screenshot->palette->entries[colnum].green;
- pic->data[0][pix + 3*x + 2] = screenshot->palette->entries[colnum].blue;
- }
- bufferoffset += screenshot->draw_buffer_line_size;
- pix += pic->linesize[0];
- }
-
- return 0;
-}
-
-static AVFrame* ffmpegdrv_alloc_picture(enum AVPixelFormat pix_fmt, int width, int height)
-{
- AVFrame *picture;
- int ret;
-
- picture = VICE_P_AV_FRAME_ALLOC();
- if (!picture) {
- return NULL;
- }
- picture->format = pix_fmt;
- picture->width = width;
- picture->height = height;
-
- ret = VICE_P_AV_FRAME_GET_BUFFER(picture, 32);
- if (ret < 0) {
- log_debug(LOG_DEFAULT, "ffmpegdrv: Could not allocate frame data");
- return NULL;
- }
-
- return picture;
-}
-
-static int ffmpegdrv_open_video(AVFormatContext *oc, AVStream *st)
-{
- AVCodecContext *c;
- int ret;
-
- c = st->codec;
-
- /* open the codec */
- ret = VICE_P_AVCODEC_OPEN2(c, avcodecvideo, NULL);
- if (ret < 0) {
- log_debug(LOG_DEFAULT, "ffmpegdrv: could not open video codec");
- return -1;
- }
-
- video_is_open = 1;
-
- /* allocate the encoded raw picture */
- video_st.frame = ffmpegdrv_alloc_picture(c->pix_fmt, c->width, c->height);
- if (!video_st.frame) {
- log_debug(LOG_DEFAULT, "ffmpegdrv: could not allocate picture");
- return -1;
- }
-
- /* if the output format is not RGB24, then a temporary RGB24
- picture is needed too. It is then converted to the required
- output format */
- video_st.tmp_frame = NULL;
- if (c->pix_fmt != VICE_AV_PIX_FMT_RGB24) {
- video_st.tmp_frame = ffmpegdrv_alloc_picture(VICE_AV_PIX_FMT_RGB24, c->width, c->height);
- if (!video_st.tmp_frame) {
- log_debug(LOG_DEFAULT, "ffmpegdrv: could not allocate temporary picture");
- return -1;
- }
- }
- return 0;
-}
-
-static void ffmpegdrv_close_video(void)
-{
- if (video_st.st == NULL) {
- return;
- }
-
- if (video_is_open) {
- close_stream(&video_st);
- }
-
- video_is_open = 0;
-
- if (video_st.frame) {
- lib_free(video_st.frame->data[0]);
- lib_free(video_st.frame);
- video_st.frame = NULL;
- }
- if (video_st.tmp_frame) {
- lib_free(video_st.tmp_frame->data[0]);
- lib_free(video_st.tmp_frame);
- video_st.tmp_frame = NULL;
- }
-
- if (sws_ctx != NULL) {
- VICE_P_SWS_FREECONTEXT(sws_ctx);
- }
-}
-
-static void ffmpegdrv_init_video(screenshot_t *screenshot)
-{
- AVCodecContext *c;
- AVStream *st;
-
- if (ffmpegdrv_oc == NULL || ffmpegdrv_fmt == NULL) {
- return;
- }
-
- video_init_done = 1;
-
- if (ffmpegdrv_fmt->video_codec == AV_CODEC_ID_NONE) {
- return;
- }
-
- st = VICE_P_AVFORMAT_NEW_STREAM(ffmpegdrv_oc, avcodecvideo);
- if (!st) {
- log_debug(LOG_DEFAULT, "ffmpegdrv: Could not alloc video stream\n");
- return;
- }
-
- c = st->codec;
-
- /* put sample parameters */
- c->bit_rate = video_bitrate;
- /* resolution should be a multiple of 16 */
- /* ffmpegdrv_fill_rgb_image only implements cutting so */
- /* adding black border was removed */
- video_width = c->width = screenshot->width & ~0xf;
- video_height = c->height = screenshot->height & ~0xf;
- /* frames per second */
- st->time_base = VICE_P_AV_D2Q(machine_get_cycles_per_frame()
- / (double)(video_halve_framerate ?
- machine_get_cycles_per_second() / 2 :
- machine_get_cycles_per_second()),
- (1 << 16) - 1);
- c->time_base = st->time_base;
-
- c->gop_size = 12; /* emit one intra frame every twelve frames at most */
- c->pix_fmt = AV_PIX_FMT_YUV420P;
-
-#if (LIBAVUTIL_VERSION_MICRO >= 100)
- /* Avoid format conversion which would lead to loss of quality */
- if (c->codec_id == AV_CODEC_ID_FFV1) {
- c->pix_fmt = AV_PIX_FMT_0RGB32;
- }
-#endif
-
- /* Use XVID instead of FMP4 FOURCC for better compatibility */
- if (c->codec_id == AV_CODEC_ID_MPEG4) {
- c->codec_tag = MKTAG('X', 'V', 'I', 'D');
- }
-
- /* Allow nonstandard framerates for MPEG1 codec */
- if (c->codec_id == AV_CODEC_ID_MPEG1VIDEO) {
- c->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL;
- }
-
-#ifdef HAVE_FFMPEG_SWSCALE
- /* setup scaler */
- if (c->pix_fmt != VICE_AV_PIX_FMT_RGB24) {
- sws_ctx = VICE_P_SWS_GETCONTEXT
- (video_width, video_height, VICE_AV_PIX_FMT_RGB24,
- video_width, video_height, c->pix_fmt,
- SWS_BICUBIC,
- NULL, NULL, NULL);
- if (sws_ctx == NULL) {
- log_debug(LOG_DEFAULT, "ffmpegdrv: Can't create Scaler!\n");
- }
- }
-#endif
-
- video_st.st = st;
- video_st.next_pts = 0;
- framecounter = 0;
-
- /* Some formats want stream headers to be separate. */
- if (ffmpegdrv_oc->oformat->flags & AVFMT_GLOBALHEADER) {
-#ifdef HAVE_FFMPEG4
- c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
-#else
- c->flags |= CODEC_FLAG_GLOBAL_HEADER;
-#endif
- }
-
- if (audio_init_done) {
- ffmpegdrv_init_file();
- }
-}
-
-static int ffmpegdrv_init_file(void)
-{
- if (!video_init_done || !audio_init_done) {
- return 0;
- }
-
- VICE_P_AV_DUMP_FORMAT(ffmpegdrv_oc, 0, ffmpegdrv_oc->filename, 1);
-
- if (video_st.st && (ffmpegdrv_open_video(ffmpegdrv_oc, video_st.st) < 0)) {
- ui_error("ffmpegdrv: Cannot open video stream");
- screenshot_stop_recording();
- return -1;
- }
- if (audio_st.st && (ffmpegdrv_open_audio(ffmpegdrv_oc, audio_st.st) < 0)) {
- ui_error("ffmpegdrv: Cannot open audio stream");
- screenshot_stop_recording();
- return -1;
- }
-
- if (!(ffmpegdrv_fmt->flags & AVFMT_NOFILE)) {
- if (VICE_P_AVIO_OPEN(&ffmpegdrv_oc->pb, ffmpegdrv_oc->filename,
- AVIO_FLAG_WRITE) < 0) {
-
- ui_error("ffmpegdrv: Cannot open %s", ffmpegdrv_oc->filename);
- screenshot_stop_recording();
- return -1;
- }
- }
-
- VICE_P_AVFORMAT_WRITE_HEADER(ffmpegdrv_oc,NULL);
-
- log_debug(LOG_DEFAULT, "ffmpegdrv: Initialized file successfully");
-
- file_init_done = 1;
-
- return 0;
-}
-
-static int ffmpegdrv_save(screenshot_t *screenshot, const char *filename)
-{
- gfxoutputdrv_format_t *format;
-
- video_st.st = NULL;
- audio_st.st = NULL;
-
- audio_init_done = 0;
- video_init_done = 0;
- file_init_done = 0;
-
- if (format_index < 0) {
- return -1;
- }
-
- ffmpegdrv_fmt = VICE_P_AV_GUESS_FORMAT(ffmpeg_format, NULL, NULL);
- format = &ffmpegdrv_formatlist[format_index];
-
- if (format->audio_codecs != NULL) {
- /* the codec from resource */
- ffmpegdrv_fmt->audio_codec = audio_codec;
- }
- if (ffmpegdrv_fmt->audio_codec != AV_CODEC_ID_NONE) {
- avcodecaudio = VICE_P_AVCODEC_FIND_ENCODER(ffmpegdrv_fmt->audio_codec);
- }
-
- if (format->video_codecs != NULL) {
- /* the codec from resource */
- ffmpegdrv_fmt->video_codec = video_codec;
- }
- if (ffmpegdrv_fmt->video_codec != AV_CODEC_ID_NONE) {
- avcodecvideo = VICE_P_AVCODEC_FIND_ENCODER(ffmpegdrv_fmt->video_codec);
- }
-
- ffmpegdrv_oc = VICE_P_AVFORMAT_ALLOC_CONTEXT();
-
- if (!ffmpegdrv_oc) {
- log_debug(LOG_DEFAULT, "ffmpegdrv: Cannot allocate format context");
- return -1;
- }
-
- ffmpegdrv_oc->oformat = ffmpegdrv_fmt;
- snprintf(ffmpegdrv_oc->filename, sizeof(ffmpegdrv_oc->filename), "%s", filename);
-
- ffmpegdrv_init_video(screenshot);
-
- soundmovie_start(&ffmpegdrv_soundmovie_funcs);
-
- return 0;
-}
-
-static int ffmpegdrv_close(screenshot_t *screenshot)
-{
- unsigned int i;
-
- /* write the trailer, if any */
- if (file_init_done) {
- VICE_P_AV_WRITE_TRAILER(ffmpegdrv_oc);
- }
-
- soundmovie_stop();
-
- if (video_st.st) {
- ffmpegdrv_close_video();
- }
- if (audio_st.st) {
- ffmpegdrv_close_audio();
- }
-
- if (!(ffmpegdrv_fmt->flags & AVFMT_NOFILE)) {
- /* close the output file */
- VICE_P_AVIO_CLOSE(ffmpegdrv_oc->pb);
- }
-
- /* free the streams */
- for (i = 0; i < ffmpegdrv_oc->nb_streams; i++) {
- VICE_P_AV_FREE((void *)ffmpegdrv_oc->streams[i]);
- ffmpegdrv_oc->streams[i] = NULL;
- }
-
- /* free the stream */
- log_debug(LOG_DEFAULT, "ffmpegdrv: Closed successfully");
-
- file_init_done = 0;
-
- return 0;
-}
-
-/* triggered by screenshot_record */
-static int ffmpegdrv_record(screenshot_t *screenshot)
-{
- AVCodecContext *c;
- int ret;
-
- if (audio_init_done && video_init_done && !file_init_done) {
- ffmpegdrv_init_file();
- }
-
- if (video_st.st == NULL || !file_init_done) {
- return 0;
- }
-
- if (audio_st.st && video_st.next_pts > audio_st.next_pts) {
- /* drop this frame */
- return 0;
- }
-
- framecounter++;
- if (video_halve_framerate && (framecounter & 1)) {
- /* drop every second frame */
- return 0;
- }
-
- c = video_st.st->codec;
-
- if (c->pix_fmt != VICE_AV_PIX_FMT_RGB24) {
- ffmpegdrv_fill_rgb_image(screenshot, video_st.tmp_frame);
-
- if (sws_ctx != NULL) {
- VICE_P_SWS_SCALE(sws_ctx,
- video_st.tmp_frame->data,
- video_st.tmp_frame->linesize, 0, c->height,
- video_st.frame->data, video_st.frame->linesize);
- }
- } else {
- ffmpegdrv_fill_rgb_image(screenshot, video_st.frame);
- }
-
- video_st.frame->pts = video_st.next_pts++;
-
-#ifdef AVFMT_RAWPICTURE
- if (ffmpegdrv_oc->oformat->flags & AVFMT_RAWPICTURE) {
- AVPacket pkt;
- VICE_P_AV_INIT_PACKET(&pkt);
- pkt.flags |= AV_PKT_FLAG_KEY;
- pkt.stream_index = video_st.st->index;
- pkt.data = (uint8_t*)video_st.frame;
- pkt.size = sizeof(AVPicture);
- pkt.pts = pkt.dts = video_st.frame->pts;
-
- ret = VICE_P_AV_INTERLEAVED_WRITE_FRAME(ffmpegdrv_oc, &pkt);
- } else
-#endif
- {
- AVPacket pkt = { 0 };
- int got_packet;
-
- VICE_P_AV_INIT_PACKET(&pkt);
-
- /* encode the image */
- ret = VICE_P_AVCODEC_ENCODE_VIDEO2(c, &pkt, video_st.frame, &got_packet);
- if (ret < 0) {
- log_debug(LOG_DEFAULT, "Error while encoding video frame");
- return -1;
- }
- /* if zero size, it means the image was buffered */
- if (got_packet) {
- if (write_frame(ffmpegdrv_oc, &c->time_base, video_st.st, &pkt)<0)
- {
- log_debug(LOG_DEFAULT, "ffmpegdrv_encode_audio: Error while writing audio frame");
- }
- } else {
- ret = 0;
- }
- }
- if (ret < 0) {
- log_debug(LOG_DEFAULT, "Error while writing video frame");
- return -1;
- }
-
- return 0;
-}
-
-static int ffmpegdrv_write(screenshot_t *screenshot)
-{
- return 0;
-}
-
-
-static void ffmpegdrv_shutdown(void);
-
-
-static gfxoutputdrv_t ffmpeg_drv = {
- GFXOUTPUTDRV_TYPE_VIDEO,
- "FFMPEG",
- "FFMPEG (Library)",
- NULL,
- NULL, /* filled in ffmpeg_get_formats_and_codecs */
- NULL, /* open */
- ffmpegdrv_close,
- ffmpegdrv_write,
- ffmpegdrv_save,
- NULL,
- ffmpegdrv_record,
- ffmpegdrv_shutdown,
- ffmpegdrv_resources_init,
- ffmpegdrv_cmdline_options_init
-#ifdef FEATURE_CPUMEMHISTORY
- , NULL
-#endif
-};
-
-
-static void ffmpegdrv_shutdown(void)
-{
- int i = 0;
-
- ffmpeglib_close(&ffmpeglib);
-
- if (ffmpeg_drv.formatlist != NULL) {
-
- while (ffmpeg_drv.formatlist[i].name != NULL) {
- lib_free(ffmpeg_drv.formatlist[i].name);
- if (ffmpeg_drv.formatlist[i].audio_codecs != NULL) {
- lib_free(ffmpeg_drv.formatlist[i].audio_codecs);
- }
- if (ffmpeg_drv.formatlist[i].video_codecs != NULL) {
- lib_free(ffmpeg_drv.formatlist[i].video_codecs);
- }
- i++;
- }
- lib_free(ffmpeg_drv.formatlist);
- }
- lib_free(ffmpeg_format);
-}
-
-static void ffmpeg_get_formats_and_codecs(void)
-{
- int i, j, ai = 0, vi = 0, f;
- gfxoutputdrv_codec_t *audio_codec_list;
- gfxoutputdrv_codec_t *video_codec_list;
- gfxoutputdrv_codec_t *ac, *vc;
-
- f = 0;
- ffmpegdrv_formatlist = lib_malloc(sizeof(gfxoutputdrv_format_t));
-
- for (i = 0; formats_to_test[i].name != NULL; i++) {
- if (VICE_P_AV_GUESS_FORMAT(formats_to_test[i].name, NULL, NULL)) {
- audio_codec_list = NULL;
- video_codec_list = NULL;
- if (formats_to_test[i].audio_codecs != NULL) {
- ai = 0;
- audio_codec_list = lib_malloc(sizeof(gfxoutputdrv_codec_t));
- ac = formats_to_test[i].audio_codecs;
- for (j = 0; ac[j].name != NULL; j++) {
- if ((ac[j].id == AV_CODEC_ID_NONE) || VICE_P_AVCODEC_FIND_ENCODER(ac[j].id)) {
- audio_codec_list[ai++] = ac[j];
- audio_codec_list = lib_realloc(audio_codec_list, (ai + 1) * sizeof(gfxoutputdrv_codec_t));
- }
- }
- audio_codec_list[ai].name = NULL;
- }
- if (formats_to_test[i].video_codecs != NULL) {
- vi = 0;
- video_codec_list = lib_malloc(sizeof(gfxoutputdrv_codec_t));
- vc = formats_to_test[i].video_codecs;
- for (j = 0; vc[j].name != NULL; j++) {
- if (vc[j].id == AV_CODEC_ID_NONE || VICE_P_AVCODEC_FIND_ENCODER(vc[j].id)) {
- video_codec_list[vi++] = formats_to_test[i].video_codecs[j];
- video_codec_list = lib_realloc(video_codec_list, (vi + 1) * sizeof(gfxoutputdrv_codec_t));
- }
- }
- video_codec_list[vi].name = NULL;
- }
- if (((audio_codec_list == NULL) || (ai > 0)) && ((video_codec_list == NULL) || (vi > 0))) {
- ffmpegdrv_formatlist[f].flags = formats_to_test[i].flags;
- ffmpegdrv_formatlist[f].name = lib_strdup(formats_to_test[i].name);
- ffmpegdrv_formatlist[f].audio_codecs = audio_codec_list;
- ffmpegdrv_formatlist[f++].video_codecs = video_codec_list;
- ffmpegdrv_formatlist = lib_realloc(ffmpegdrv_formatlist, (f + 1) * sizeof(gfxoutputdrv_format_t));
- }
- }
- }
- ffmpegdrv_formatlist[f].name = NULL;
- ffmpeg_drv.formatlist = ffmpegdrv_formatlist;
-}
-
-void gfxoutput_init_ffmpeg(int help)
-{
- if (help) {
- gfxoutput_register(&ffmpeg_drv);
- return;
- }
-
- if (ffmpeglib_open(&ffmpeglib) < 0) {
- return;
- }
- VICE_P_AV_REGISTER_ALL();
- ffmpeg_get_formats_and_codecs();
- gfxoutput_register(&ffmpeg_drv);
-}
-
-/* re-enable ignored clang warnings */
-#pragma clang diagnostic pop
-
-#endif
Deleted: trunk/vice/src/gfxoutputdrv/ffmpegdrv.h
===================================================================
--- trunk/vice/src/gfxoutputdrv/ffmpegdrv.h 2024-12-29 14:58:40 UTC (rev 45438)
+++ trunk/vice/src/gfxoutputdrv/ffmpegdrv.h 2024-12-31 06:32:45 UTC (rev 45439)
@@ -1,82 +0,0 @@
-/*
- * ffmpegdrv.h - Movie driver using FFMPEG library and screenshot API.
- *
- * Written by
- * Andreas Matthies <and...@gm...>
- *
- * This file is part of VICE, the Versatile Commodore Emulator.
- * See README for copyright notice.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- * 02111-1307 USA.
- *
- */
-
-#ifndef VICE_FFMPEGDRV_H
-#define VICE_FFMPEGDRV_H
-
-#include "screenshot.h"
-#include "gfxoutput.h"
-
-void gfxoutput_init_ffmpeg(int help);
-
-/* deprecated access for UIs that do not use the gfxoutputdrv->formatlist yet: */
-extern gfxoutputdrv_format_t *ffmpegdrv_formatlist;
-
-#define VICE_P_AV_PACKET_RESCALE_TS (*ffmpeglib.p_av_packet_rescale_ts)
-#define VICE_P_AV_INTERLEAVED_WRITE_FRAME (*ffmpeglib.p_av_interleaved_write_frame)
-#define VICE_P_AVCODEC_CLOSE (*ffmpeglib.p_avcodec_close)
-#define VICE_P_AV_FRAME_FREE (*ffmpeglib.p_av_frame_free)
-#define VICE_P_AV_FRAME_ALLOC (*ffmpeglib.p_av_frame_alloc)
-#define VICE_P_AV_FRAME_GET_BUFFER (*ffmpeglib.p_av_frame_get_buffer)
-#define VICE_P_AV_DICT_SET (*ffmpeglib.p_av_dict_set)
-#define VICE_P_AVCODEC_OPEN2 (*ffmpeglib.p_avcodec_open2)
-#define VICE_P_AV_DICT_FREE (*ffmpeglib.p_av_dict_free)
-#define VICE_P_AVFORMAT_NEW_STREAM (*ffmpeglib.p_avformat_new_stream)
-#define VICE_P_AV_GET_CHANNEL_LAYOUT_NB_CHANNELS (*ffmpeglib.p_av_get_channel_layout_nb_channels)
-#define VICE_P_AV_OPT_SET_INT (*ffmpeglib.p_av_opt_set_int)
-#define VICE_P_AV_OPT_SET_SAMPLE_FMT (*ffmpeglib.p_av_opt_set_sample_fmt)
-#define VICE_P_AV_INIT_PACKET (*ffmpeglib.p_av_init_packet)
-#define VICE_P_AV_RESCALE_RND (*ffmpeglib.p_av_rescale_rnd)
-#define VICE_P_AV_FRAME_MAKE_WRITABLE (*ffmpeglib.p_av_frame_make_writable)
-#define VICE_P_AV_RESCALE_Q (*ffmpeglib.p_av_rescale_q)
-#define VICE_P_AV_D2Q (*ffmpeglib.p_av_d2q)
-#define VICE_P_AVCODEC_ENCODE_AUDIO2 (*ffmpeglib.p_avcodec_encode_audio2)
-#define VICE_P_SWS_FREECONTEXT (*ffmpeglib.p_sws_freeContext)
-#define VICE_P_SWS_GETCONTEXT (*ffmpeglib.p_sws_getContext)
-#define VICE_P_AV_DUMP_FORMAT (*ffmpeglib.p_av_dump_format)
-#define VICE_P_AVIO_OPEN (*ffmpeglib.p_avio_open)
-#define VICE_P_AVFORMAT_WRITE_HEADER (*ffmpeglib.p_avformat_write_header)
-#define VICE_P_AV_GUESS_FORMAT (*ffmpeglib.p_av_guess_format)
-#define VICE_P_AVCODEC_FIND_ENCODER (*ffmpeglib.p_avcodec_find_encoder)
-#define VICE_P_AVFORMAT_ALLOC_CONTEXT (*ffmpeglib.p_avformat_alloc_context)
-#define VICE_P_AV_WRITE_TRAILER (*ffmpeglib.p_av_write_trailer)
-#define VICE_P_AVIO_CLOSE (*ffmpeglib.p_avio_close)
-#define VICE_P_AV_FREE (*ffmpeglib.p_av_free)
-#define VICE_P_SWS_SCALE (*ffmpeglib.p_sws_scale)
-#define VICE_P_AVCODEC_ENCODE_VIDEO2 (*ffmpeglib.p_avcodec_encode_video2)
-#define VICE_P_AV_REGISTER_ALL (*ffmpeglib.p_av_register_all)
-#define VICE_P_SWR_GET_DELAY (*ffmpeglib.p_swr_get_delay)
-#define VICE_P_SWR_INIT (*ffmpeglib.p_swr_init)
-#define VICE_P_SWR_FREE (*ffmpeglib.p_swr_free)
-#define VICE_P_SWR_ALLOC (*ffmpeglib.p_swr_alloc)
-#define VICE_P_SWR_CONVERT (*ffmpeglib.p_swr_convert)
-#define VICE_P_AVRESAMPLE_ALLOC_CONTEXT (*ffmpeglib.p_avresample_alloc_context)
-#define VICE_P_AVRESAMPLE_OPEN (*ffmpeglib.p_avresample_open)
-#define VICE_P_AVRESAMPLE_CONVERT (*ffmpeglib.p_avresample_convert)
-#define VICE_P_AVRESAMPLE_FREE (*ffmpeglib.p_avresample_free)
-#define VICE_P_AVRESAMPLE_GET_DELAY (*ffmpeglib.p_avresample_get_delay)
-
-#endif
Modified: trunk/vice/src/gfxoutputdrv/ffmpegexedrv.c
===================================================================
--- trunk/vice/src/gfxoutputdrv/ffmpegexedrv.c 2024-12-29 14:58:40 UTC (rev 45438)
+++ trunk/vice/src/gfxoutputdrv/ffmpegexedrv.c 2024-12-31 06:32:45 UTC (rev 45439)
@@ -31,13 +31,6 @@
driver. Instead of linking in the libraries, this one calls the ffmpeg
executable and pipes the data to it.
- This driver was implemented based on a copy of the original driver, and it
- can co-exist with the original driver AND USE THE SAME RESOURCES AND SHARE
- COMMANDLINE OPTIONS for the time being. To make sure this keeps working,
- do NOT alter the resource- or commandline related code, before all of the
- old FFMPEG code was removed. (And at this point some of the code in this
- file can likely be more simplified too).
-
bugs/open ends:
- audio-only saving does not work correctly, apparently due to how the codecs
are being listed (and somehow the results come out wrong)
@@ -70,7 +63,6 @@
#include "archdep.h"
#include "cmdline.h"
#include "coproc.h"
-#include "ffmpegdrv.h"
#include "ffmpegexedrv.h"
#include "gfxoutput.h"
#include "lib.h"
@...
[truncated message content] |
|
From: <co...@us...> - 2024-12-29 14:58:41
|
Revision: 45438
http://sourceforge.net/p/vice-emu/code/45438
Author: compyx
Date: 2024-12-29 14:58:40 +0000 (Sun, 29 Dec 2024)
Log Message:
-----------
GHA: Make runners for .deb packaging use 'ubuntu-22.04'
Instead of using 'ubuntu-latest', which is in the process of moving from 22.04
to 24.04, we fix the version at 22.04. We may need to look at creating .deb
packages on 'ubuntu-24.04' as well.
Modified Paths:
--------------
trunk/.github/workflows/build-main-on-push.yml
Modified: trunk/.github/workflows/build-main-on-push.yml
===================================================================
--- trunk/.github/workflows/build-main-on-push.yml 2024-12-29 12:40:07 UTC (rev 45437)
+++ trunk/.github/workflows/build-main-on-push.yml 2024-12-29 14:58:40 UTC (rev 45438)
@@ -390,7 +390,7 @@
build_deb:
name: Build Debian Package
needs: [create_release, build_doc]
- runs-on: ubuntu-latest
+ runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <co...@us...> - 2024-12-29 12:40:09
|
Revision: 45437
http://sourceforge.net/p/vice-emu/code/45437
Author: compyx
Date: 2024-12-29 12:40:07 +0000 (Sun, 29 Dec 2024)
Log Message:
-----------
GHA: Remove libglew2.1 from control file for Gtk3 Ubuntu package
Also list all dependencies on a single line (lintian complained about the
dependencies being listed on multiple lines).
Somehow dpkg doesn't install libglew2.1 or libportaudio2 when installing VICE,
leading to a broken state, perhaps this will magically fix that.
Modified Paths:
--------------
trunk/vice/build/debian/control.gtk3
Modified: trunk/vice/build/debian/control.gtk3
===================================================================
--- trunk/vice/build/debian/control.gtk3 2024-12-29 10:33:40 UTC (rev 45436)
+++ trunk/vice/build/debian/control.gtk3 2024-12-29 12:40:07 UTC (rev 45437)
@@ -11,33 +11,4 @@
Homepage: https://vice-emu.sourceforge.io/
Installed-Size: __INSTALLED_SIZE__
Conflicts: vice, headlessvice, sdl2vice, sdl1vice
-Depends: libasound2,
- libatk1.0-0,
- libc6,
- libcairo2,
- libcurl4,
- libevdev2,
- libflac8,
- libfontconfig1,
- libgcc-s1,
- libgdk-pixbuf-2.0-0,
- libgif7,
- libgl1,
- libglew2.1 | libglew2.2,
- libglib2.0-0,
- libgomp1,
- libgtk-3-0 (>= 3.24),
- libieee1284-3,
- libmp3lame0,
- libmpg123-0,
- libogg0,
- libpango-1.0-0,
- libpangocairo-1.0-0,
- libportaudio2,
- libpcap0.8,
- libpng16-16,
- libpulse0,
- libstdc++6,
- libvorbis0a,
- libx11-6,
- zlib1g
+Depends: libasound2, libatk1.0-0, libc6, libcairo2, libcurl4, libevdev2, libflac8, libfontconfig1, libgcc-s1, libgdk-pixbuf-2.0-0, libgif7, libgl1, libglew2.2, libglib2.0-0, libgomp1, libgtk-3-0 (>= 3.24), libieee1284-3, libmp3lame0, libmpg123-0, libogg0, libpango-1.0-0, libpangocairo-1.0-0, libportaudio2, libpcap0.8, libpng16-16, libpulse0, libstdc++6, libvorbis0a, libx11-6, zlib1g
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <co...@us...> - 2024-12-29 10:33:42
|
Revision: 45436
http://sourceforge.net/p/vice-emu/code/45436
Author: compyx
Date: 2024-12-29 10:33:40 +0000 (Sun, 29 Dec 2024)
Log Message:
-----------
x64dtv: remove #if 0'ed code left over from previous commit
Modified Paths:
--------------
trunk/vice/src/c64dtv/c64dtv.c
Modified: trunk/vice/src/c64dtv/c64dtv.c
===================================================================
--- trunk/vice/src/c64dtv/c64dtv.c 2024-12-29 10:28:58 UTC (rev 45435)
+++ trunk/vice/src/c64dtv/c64dtv.c 2024-12-29 10:33:40 UTC (rev 45436)
@@ -421,12 +421,6 @@
init_resource_fail("sid");
return -1;
}
-#if 0
- if (rs232drv_resources_init() < 0) {
- init_resource_fail("rs232drv");
- return -1;
- }
-#endif
if (serial_resources_init() < 0) {
init_resource_fail("serial");
return -1;
@@ -529,9 +523,6 @@
flash_trap_resources_shutdown();
c64dtv_resources_shutdown();
c64dtvmem_resources_shutdown();
-#if 0
- rs232drv_resources_shutdown();
-#endif
printer_resources_shutdown();
drive_resources_shutdown();
fsdevice_resources_shutdown();
@@ -565,12 +556,6 @@
init_cmdline_options_fail("sid");
return -1;
}
-#if 0
- if (rs232drv_cmdline_options_init() < 0) {
- init_cmdline_options_fail("rs232drv");
- return -1;
- }
-#endif
if (serial_cmdline_options_init() < 0) {
init_cmdline_options_fail("serial");
return -1;
@@ -717,11 +702,6 @@
return -1;
}
-#if 0
- /* Initialize RS232 handler. */
- rs232drv_init();
-#endif
-
/* Initialize print devices. */
printer_init();
@@ -804,10 +784,6 @@
ciacore_reset(machine_context.cia1);
ciacore_reset(machine_context.cia2);
sid_reset();
-
-#if 0
- rs232drv_reset();
-#endif
printer_reset();
/* FIXME */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <co...@us...> - 2024-12-29 10:29:01
|
Revision: 45435
http://sourceforge.net/p/vice-emu/code/45435
Author: compyx
Date: 2024-12-29 10:28:58 +0000 (Sun, 29 Dec 2024)
Log Message:
-----------
Fix linking issues with LLVM's lld (18 and 19)
Linking with lld-18 and lld-19 triggered some duplicate symbol errors when
linking x64dtv, xpet and xcbm2 in the rs232, userport and parallel cable
libs.
The shared `driver_libs` now has `rs232drv_lib` removed and `rs232drv_lib`
(or `rs232drvpet_lib` in the case of xpet and xcbm2) has been added to the
individual targets of the emulator binaries.
The `rs232drv` directory has an additional target `rs232drvpet.a` which
doesn't link with rsuser.o, avoiding registering userport resources and
command line options with xpet and xcbm2, the stubs in `pet-stubs.c` and
`cbm2-stubs.c` are now properly used during linking.
Parallel cable drive code was linked with x64dtv, probably copy+paste from
x64 code, this has been addressed as well.
Single-target compilation should also handle the split `rs232drv.a` (one rule for `librs232drv.a`, one for `librs232drvpet.a), I haven't tested that.
Modified Paths:
--------------
trunk/vice/src/Makefile.am
trunk/vice/src/c64/Makefile.am
trunk/vice/src/c64dtv/c64dtv.c
trunk/vice/src/rs232drv/Makefile.am
Modified: trunk/vice/src/Makefile.am
===================================================================
--- trunk/vice/src/Makefile.am 2024-12-28 14:05:02 UTC (rev 45434)
+++ trunk/vice/src/Makefile.am 2024-12-29 10:28:58 UTC (rev 45435)
@@ -594,6 +594,7 @@
resid_lib = $(top_builddir)/src/resid/libresid.a
resid_dtv_lib = $(top_builddir)/src/resid-dtv/libresiddtv.a
rs232drv_lib = $(top_builddir)/src/rs232drv/librs232drv.a
+rs232drvpet_lib = $(top_builddir)/src/rs232drv/librs232drvpet.a
raster_lib = $(top_builddir)/src/raster/libraster.a
rtc_lib = $(top_builddir)/src/core/rtc/librtc.a
samplerdrv_lib = $(top_builddir)/src/samplerdrv/libsamplerdrv.a
@@ -631,7 +632,7 @@
# external libraries required for all emulators
emu_extlibs = @UI_LIBS@ @SDL_EXTRA_LIBS@ @SOUND_LIBS@ @JOY_LIBS@ @GFXOUTPUT_LIBS@ @ZLIB_LIBS@ @DYNLIB_LIBS@ @ARCH_LIBS@ $(archdep_lib) $(linenoise_ng_lib)
-driver_libs = $(joyport_lib) $(samplerdrv_lib) $(sounddrv_lib) $(mididrv_lib) $(socketdrv_lib) $(hwsiddrv_lib) $(gfxoutputdrv_lib) $(printerdrv_lib) $(rs232drv_lib) $(diskimage_lib) $(fsdevice_lib) $(tape_lib) $(fileio_lib) $(serial_lib) $(core_lib)
+driver_libs = $(joyport_lib) $(samplerdrv_lib) $(sounddrv_lib) $(mididrv_lib) $(socketdrv_lib) $(hwsiddrv_lib) $(gfxoutputdrv_lib) $(printerdrv_lib) $(diskimage_lib) $(fsdevice_lib) $(tape_lib) $(fileio_lib) $(serial_lib) $(core_lib)
if SUPPORT_X64
x64_bin = x64
@@ -716,6 +717,7 @@
$(sid_lib) \
$(monitor_lib) \
$(driver_libs) \
+ $(rs232drv_lib) \
$(vicii_lib) \
$(raster_lib) \
$(userport_lib) \
@@ -773,6 +775,7 @@
$(sid_lib) \
$(monitor_lib) \
$(driver_libs) \
+ $(rs232drv_lib) \
$(viciisc_lib) \
$(raster_lib) \
$(userport_lib) \
@@ -895,6 +898,7 @@
$(sid_lib) \
$(monitor_lib) \
$(driver_libs) \
+ $(rs232drv_lib) \
$(viciisc_lib) \
$(raster_lib) \
$(userport_lib) \
@@ -954,6 +958,7 @@
$(sid_lib) \
$(monitor_lib) \
$(driver_libs) \
+ $(rs232drv_lib) \
$(vicii_lib) \
$(vdc_lib) \
$(raster_lib) \
@@ -1011,6 +1016,7 @@
$(monitor_lib) \
$(sid_lib) \
$(driver_libs) \
+ $(rs232drv_lib) \
$(raster_lib) \
$(userport_lib) \
$(diag_lib) \
@@ -1063,6 +1069,7 @@
$(monitor_lib) \
$(sid_lib) \
$(driver_libs) \
+ $(rs232drvpet_lib) \
$(crtc_lib) \
$(raster_lib) \
$(video_lib) \
@@ -1122,6 +1129,7 @@
$(monitor_lib) \
$(sid_lib) \
$(driver_libs) \
+ $(rs232drv_lib) \
$(raster_lib) \
$(rtc_lib) \
$(video_lib) \
@@ -1180,6 +1188,7 @@
$(monitor_lib) \
$(sid_lib) \
$(driver_libs) \
+ $(rs232drvpet_lib) \
$(crtc_lib) \
$(raster_lib) \
$(video_lib) \
@@ -1236,6 +1245,7 @@
$(xcbm5x0_lib) \
$(sid_lib) \
$(driver_libs) \
+ $(rs232drv_lib) \
$(vicii_lib) \
$(raster_lib) \
$(rtc_lib) \
@@ -1540,8 +1550,11 @@
@echo "making all in printerdrv"
@(cd printerdrv && $(MAKE))
$(rs232drv_lib):
- @echo "making all in rs232drv"
- @(cd rs232drv && $(MAKE))
+ @echo "making librs232drv.a in rs232drv"
+ @(cd rs232drv && $(MAKE) librs232drv.a)
+$(rs232drvpet_lib):
+ @echo "making librs232drvpet.a in rs232drv"
+ @(cd rs232drv && $(MAKE) librs232drvpet.a)
$(raster_lib):
@echo "making libraster.a in raster"
@(cd raster && $(MAKE) libraster.a)
Modified: trunk/vice/src/c64/Makefile.am
===================================================================
--- trunk/vice/src/c64/Makefile.am 2024-12-28 14:05:02 UTC (rev 45434)
+++ trunk/vice/src/c64/Makefile.am 2024-12-29 10:28:58 UTC (rev 45435)
@@ -216,8 +216,6 @@
c64fastiec.h \
c64keyboard.c \
c64keyboard.h \
- c64parallel.c \
- c64parallel.h \
c64rom.c \
c64rom.h \
c64romset.c \
Modified: trunk/vice/src/c64dtv/c64dtv.c
===================================================================
--- trunk/vice/src/c64dtv/c64dtv.c 2024-12-28 14:05:02 UTC (rev 45434)
+++ trunk/vice/src/c64dtv/c64dtv.c 2024-12-29 10:28:58 UTC (rev 45435)
@@ -89,7 +89,6 @@
#include "protopad.h"
#include "ps2mouse.h"
#include "resources.h"
-#include "rs232drv.h"
#include "rushware_keypad.h"
#include "sampler.h"
#include "sampler2bit.h"
@@ -422,10 +421,12 @@
init_resource_fail("sid");
return -1;
}
+#if 0
if (rs232drv_resources_init() < 0) {
init_resource_fail("rs232drv");
return -1;
}
+#endif
if (serial_resources_init() < 0) {
init_resource_fail("serial");
return -1;
@@ -528,7 +529,9 @@
flash_trap_resources_shutdown();
c64dtv_resources_shutdown();
c64dtvmem_resources_shutdown();
+#if 0
rs232drv_resources_shutdown();
+#endif
printer_resources_shutdown();
drive_resources_shutdown();
fsdevice_resources_shutdown();
@@ -562,10 +565,12 @@
init_cmdline_options_fail("sid");
return -1;
}
+#if 0
if (rs232drv_cmdline_options_init() < 0) {
init_cmdline_options_fail("rs232drv");
return -1;
}
+#endif
if (serial_cmdline_options_init() < 0) {
init_cmdline_options_fail("serial");
return -1;
@@ -712,8 +717,10 @@
return -1;
}
+#if 0
/* Initialize RS232 handler. */
rs232drv_init();
+#endif
/* Initialize print devices. */
printer_init();
@@ -798,8 +805,9 @@
ciacore_reset(machine_context.cia2);
sid_reset();
+#if 0
rs232drv_reset();
-
+#endif
printer_reset();
/* FIXME */
Modified: trunk/vice/src/rs232drv/Makefile.am
===================================================================
--- trunk/vice/src/rs232drv/Makefile.am 2024-12-28 14:05:02 UTC (rev 45434)
+++ trunk/vice/src/rs232drv/Makefile.am 2024-12-29 10:28:58 UTC (rev 45435)
@@ -14,7 +14,7 @@
AM_LDFLAGS = @VICE_LDFLAGS@
-noinst_LIBRARIES = librs232drv.a
+noinst_LIBRARIES = librs232drv.a librs232drvpet.a
librs232drv_a_SOURCES = \
rs232dev.h \
@@ -26,3 +26,16 @@
rs232net.h \
rsuser.c \
rsuser.h
+
+# Same as above, but without the userport bits, to avoid registering userport
+# resources and command line options with xpet and xcbm2 (these have stubs for
+# rsuser_resources_init() and rsuser_cmdline_init()
+librs232drvpet_a_SOURCES = \
+ rs232dev.h \
+ rs232.c \
+ rs232.h \
+ rs232drv.c \
+ rs232drv.h \
+ rs232net.c \
+ rs232net.h \
+ rsuser.h
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gp...@us...> - 2024-12-28 14:05:04
|
Revision: 45434
http://sourceforge.net/p/vice-emu/code/45434
Author: gpz
Date: 2024-12-28 14:05:02 +0000 (Sat, 28 Dec 2024)
Log Message:
-----------
Fix texi warnings on FreeBSD, patch by Dirk Meyer
Modified Paths:
--------------
trunk/vice/doc/vice.texi
Modified: trunk/vice/doc/vice.texi
===================================================================
--- trunk/vice/doc/vice.texi 2024-12-28 14:04:18 UTC (rev 45433)
+++ trunk/vice/doc/vice.texi 2024-12-28 14:05:02 UTC (rev 45434)
@@ -1519,8 +1519,8 @@
specify a complete path instead of just a file name. For example, if
you specify @file{./kernal} as the kernal image name, the kernal image
will be loaded from the current directory. This can be done by using
-command-line options or by modifying resource values (@pxref{Resource
-files}).
+command-line options or by modifying
+resource values (@pxref{Resource files}).
@menu
* ROM files:: Files containing dumps of the original ROMs.
@@ -16918,8 +16918,9 @@
@subsection Changing screen colors
It is also possible to choose what color set is used for the emulation
-window. This is done by specifying a palette file name (@pxref{Palette
-files}) in the @code{PaletteName} resource. The menu provides the
+window. This is done by specifying a palette file
+name (@pxref{Palette files}) in the @code{PaletteName}
+resource. The menu provides the
following values:
@itemize @bullet
@@ -17365,8 +17366,9 @@
@subsection Changing screen colors
It is also possible to choose what color set is used for the emulation
-window. This is done by specifying a palette file name (@pxref{Palette
-files}) in the @code{PaletteName} resource. The menu provides the
+window. This is done by specifying a palette file name
+(@pxref{Palette files}) in the @code{PaletteName}
+resource. The menu provides the
following values:
@itemize @bullet
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|