annotate src/common/nesvideos-piece.h @ 19:5e8e5083da94

brought in common and gba, fixed problems with outdated Makefile.am files in both of these packages
author Robert McIntyre <rlm@mit.edu>
date Sun, 04 Mar 2012 14:33:52 -0600
parents f9f4f1b99eed
children
rev   line source
rlm@1 1 #ifndef NESVPIECEhh
rlm@1 2 #define NESVPIECEhh
rlm@1 3
rlm@1 4 #define NESVIDEOS_LOGGING 1
rlm@1 5
rlm@1 6 #ifdef __cplusplus
rlm@1 7 extern "C" {
rlm@1 8 #endif
rlm@1 9
rlm@1 10 /* Is video logging enabled? 0=no, 1=yes, 2=active. Default value: 0 */
rlm@1 11 extern int LoggingEnabled;
rlm@1 12
rlm@1 13 /* Get and set the video recording command (shell command) */
rlm@1 14 extern const char* NESVideoGetVideoCmd();
rlm@1 15 extern void NESVideoSetVideoCmd(const char *cmd);
rlm@1 16
rlm@1 17 /* Tells to use these functions for obtaining/releasing FILE pointers for writing - if not specified, popen/pclose are used. */
rlm@1 18 extern void NESVideoSetFileFuncs( FILE* openFunc(const char *,const char *), int closeFunc(FILE*) );
rlm@1 19
rlm@1 20 /* Tells to call these functions per frame with amounts (seconds and frames) of video and audio progress */
rlm@1 21 extern void NESVideoEnableDebugging( void videoMessageFunc(const char *msg), void audioMessageFunc(const char *msg) );
rlm@1 22
rlm@1 23 /* Save 1 frame of video. (Assumed to be 16-bit RGB) */
rlm@1 24 /* FPS is scaled by 24 bits (*0x1000000) */
rlm@1 25 /* Does not do anything if LoggingEnabled<2. */
rlm@1 26 extern void NESVideoLoggingVideo
rlm@1 27 (const void*data, unsigned width, unsigned height,
rlm@1 28 unsigned fps_scaled);
rlm@1 29
rlm@1 30 /* Save N bytes of audio. bytes_per_second is required on the first call. */
rlm@1 31 /* Does not do anything if LoggingEnabled<2. */
rlm@1 32 /* The interval of calling this function is not important, as long as all the audio
rlm@1 33 * data is eventually written without too big delay (5 seconds is too big)
rlm@1 34 * This function may be called multiple times per video frame, or once per a few video
rlm@1 35 * frames, or anything in between. Just that all audio data must be written exactly once,
rlm@1 36 * and in order. */
rlm@1 37 extern void NESVideoLoggingAudio
rlm@1 38 (const void*data,
rlm@1 39 unsigned rate, unsigned bits, unsigned chans,
rlm@1 40 unsigned nsamples);
rlm@1 41 /* nsamples*chans*(bits/8) = bytes in *data. */
rlm@1 42 /* rate*chans*(bits/8) = bytes per second. */
rlm@1 43
rlm@1 44 #ifdef __cplusplus
rlm@1 45 }
rlm@1 46 #endif
rlm@1 47
rlm@1 48 #endif