1 /* 2 * gfxoutput.h - Graphics output driver. 3 * 4 * Written by 5 * Andreas Boose <viceteam@t-online.de> 6 * Marco van den Heuvel <blackystardust68@yahoo.com> 7 * 8 * This file is part of VICE, the Versatile Commodore Emulator. 9 * See README for copyright notice. 10 * 11 * This program is free software; you can redistribute it and/or modify 12 * it under the terms of the GNU General Public License as published by 13 * the Free Software Foundation; either version 2 of the License, or 14 * (at your option) any later version. 15 * 16 * This program is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * GNU General Public License for more details. 20 * 21 * You should have received a copy of the GNU General Public License 22 * along with this program; if not, write to the Free Software 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 24 * 02111-1307 USA. 25 * 26 */ 27 28 #ifndef VICE_GFXOUTPUT_H 29 #define VICE_GFXOUTPUT_H 30 31 #include "types.h" 32 33 struct screenshot_s; 34 35 typedef struct gfxoutputdrv_codec_s { 36 int id; 37 const char *name; 38 } gfxoutputdrv_codec_t; 39 40 typedef struct gfxoutputdrv_format_s { 41 char *name; 42 gfxoutputdrv_codec_t *audio_codecs; 43 gfxoutputdrv_codec_t *video_codecs; 44 } gfxoutputdrv_format_t; 45 46 typedef struct gfxoutputdrv_s { 47 const char *name; 48 const char *displayname; 49 const char *default_extension; 50 gfxoutputdrv_format_t *formatlist; 51 int (*open)(struct screenshot_s *, const char *); 52 int (*close)(struct screenshot_s *); 53 int (*write)(struct screenshot_s *); 54 int (*save)(struct screenshot_s *, const char *); 55 int (*save_native)(struct screenshot_s *, const char *); 56 int (*record)(struct screenshot_s *); 57 void (*shutdown)(void); 58 int (*resources_init)(void); 59 int (*cmdline_options_init)(void); 60 #ifdef FEATURE_CPUMEMHISTORY 61 int (*savememmap)(const char *, int, int, uint8_t *, uint8_t *); 62 #endif 63 } gfxoutputdrv_t; 64 65 /* Functions called by external emulator code. */ 66 extern int gfxoutput_resources_init(void); 67 extern int gfxoutput_cmdline_options_init(void); 68 extern int gfxoutput_early_init(int help); 69 extern int gfxoutput_init(void); 70 extern void gfxoutput_shutdown(void); 71 extern int gfxoutput_num_drivers(void); 72 extern gfxoutputdrv_t *gfxoutput_drivers_iter_init(void); 73 extern gfxoutputdrv_t *gfxoutput_drivers_iter_next(void); 74 extern gfxoutputdrv_t *gfxoutput_get_driver(const char *drvname); 75 76 /* Functions called by graphic output driver modules. */ 77 extern int gfxoutput_register(gfxoutputdrv_t *drv); 78 79 /* FFMPEG bitrate constants. */ 80 #define VICE_FFMPEG_VIDEO_RATE_MIN 100000 81 #define VICE_FFMPEG_VIDEO_RATE_MAX 10000000 82 #define VICE_FFMPEG_VIDEO_RATE_DEFAULT 800000 83 #define VICE_FFMPEG_AUDIO_RATE_MIN 16000 84 #define VICE_FFMPEG_AUDIO_RATE_MAX 384000 85 #define VICE_FFMPEG_AUDIO_RATE_DEFAULT 64000 86 87 /* Native screenshot drivers definitions */ 88 #define NATIVE_SS_OVERSIZE_SCALE 0 89 #define NATIVE_SS_OVERSIZE_CROP_LEFT_TOP 1 90 #define NATIVE_SS_OVERSIZE_CROP_CENTER_TOP 2 91 #define NATIVE_SS_OVERSIZE_CROP_RIGHT_TOP 3 92 #define NATIVE_SS_OVERSIZE_CROP_LEFT_CENTER 4 93 #define NATIVE_SS_OVERSIZE_CROP_CENTER 5 94 #define NATIVE_SS_OVERSIZE_CROP_RIGHT_CENTER 6 95 #define NATIVE_SS_OVERSIZE_CROP_LEFT_BOTTOM 7 96 #define NATIVE_SS_OVERSIZE_CROP_CENTER_BOTTOM 8 97 #define NATIVE_SS_OVERSIZE_CROP_RIGHT_BOTTOM 9 98 99 #define NATIVE_SS_UNDERSIZE_SCALE 0 100 #define NATIVE_SS_UNDERSIZE_BORDERIZE 1 101 102 #define NATIVE_SS_MC2HR_BLACK_WHITE 0 103 #define NATIVE_SS_MC2HR_2_COLORS 1 104 #define NATIVE_SS_MC2HR_4_COLORS 2 105 #define NATIVE_SS_MC2HR_GRAY 3 106 #define NATIVE_SS_MC2HR_DITHER 4 107 108 #define NATIVE_SS_TED_LUM_IGNORE 0 109 #define NATIVE_SS_TED_LUM_DITHER 1 110 111 #define NATIVE_SS_CRTC_WHITE 0 112 #define NATIVE_SS_CRTC_AMBER 1 113 #define NATIVE_SS_CRTC_GREEN 2 114 115 #endif 116