diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/capture/kms_vaapi.c | 2 | ||||
-rw-r--r-- | src/capture/nvfbc.c | 6 | ||||
-rw-r--r-- | src/capture/xcomposite_cuda.c | 1 | ||||
-rw-r--r-- | src/capture/xcomposite_vaapi.c | 1 | ||||
-rw-r--r-- | src/egl.c | 6 | ||||
-rw-r--r-- | src/main.cpp | 10 | ||||
-rw-r--r-- | src/sound.cpp | 1 | ||||
-rw-r--r-- | src/utils.c | 1 |
8 files changed, 18 insertions, 10 deletions
diff --git a/src/capture/kms_vaapi.c b/src/capture/kms_vaapi.c index 765da68..16c746c 100644 --- a/src/capture/kms_vaapi.c +++ b/src/capture/kms_vaapi.c @@ -135,6 +135,7 @@ static bool properties_has_atom(Atom *props, int nprop, Atom atom) { } static void monitor_callback(const XRROutputInfo *output_info, const XRRCrtcInfo *crt_info, const XRRModeInfo *mode_info, void *userdata) { + (void)mode_info; MonitorCallbackUserdata *monitor_callback_userdata = userdata; ++monitor_callback_userdata->num_monitors; @@ -436,6 +437,7 @@ static gsr_kms_response_fd* find_largest_drm(gsr_kms_response *kms_response) { } static int gsr_capture_kms_vaapi_capture(gsr_capture *cap, AVFrame *frame) { + (void)frame; gsr_capture_kms_vaapi *cap_kms = cap->priv; for(int i = 0; i < cap_kms->kms_response.num_fds; ++i) { diff --git a/src/capture/nvfbc.c b/src/capture/nvfbc.c index c45712d..32b83fc 100644 --- a/src/capture/nvfbc.c +++ b/src/capture/nvfbc.c @@ -95,6 +95,10 @@ static bool version_less_than(int major, int minor, int expected_major, int expe return major < expected_major || (major == expected_major && minor < expected_minor); } +static void set_func_ptr(void **dst, void *src) { + *dst = src; +} + static bool gsr_capture_nvfbc_load_library(gsr_capture *cap) { gsr_capture_nvfbc *cap_nvfbc = cap->priv; @@ -105,7 +109,7 @@ static bool gsr_capture_nvfbc_load_library(gsr_capture *cap) { return false; } - cap_nvfbc->nv_fbc_create_instance = (PNVFBCCREATEINSTANCE)dlsym(lib, "NvFBCCreateInstance"); + set_func_ptr((void**)&cap_nvfbc->nv_fbc_create_instance, dlsym(lib, "NvFBCCreateInstance")); if(!cap_nvfbc->nv_fbc_create_instance) { fprintf(stderr, "gsr error: unable to resolve symbol 'NvFBCCreateInstance'\n"); dlclose(lib); diff --git a/src/capture/xcomposite_cuda.c b/src/capture/xcomposite_cuda.c index f40f9d2..d6fc10b 100644 --- a/src/capture/xcomposite_cuda.c +++ b/src/capture/xcomposite_cuda.c @@ -477,7 +477,6 @@ static int gsr_capture_xcomposite_cuda_capture(gsr_capture *cap, AVFrame *frame) } static void gsr_capture_xcomposite_cuda_destroy(gsr_capture *cap, AVCodecContext *video_codec_context) { - gsr_capture_xcomposite_cuda *cap_xcomp = cap->priv; if(cap->priv) { gsr_capture_xcomposite_cuda_stop(cap, video_codec_context); free(cap->priv); diff --git a/src/capture/xcomposite_vaapi.c b/src/capture/xcomposite_vaapi.c index 5a39820..bb92f7f 100644 --- a/src/capture/xcomposite_vaapi.c +++ b/src/capture/xcomposite_vaapi.c @@ -606,7 +606,6 @@ static void gsr_capture_xcomposite_vaapi_stop(gsr_capture *cap, AVCodecContext * static void gsr_capture_xcomposite_vaapi_destroy(gsr_capture *cap, AVCodecContext *video_codec_context) { (void)video_codec_context; - gsr_capture_xcomposite_vaapi *cap_xcomp = cap->priv; if(cap->priv) { gsr_capture_xcomposite_vaapi_stop(cap, video_codec_context); free(cap->priv); @@ -112,9 +112,9 @@ static bool gsr_egl_load_egl(gsr_egl *self, void *library) { } static bool gsr_egl_proc_load_egl(gsr_egl *self) { - self->eglExportDMABUFImageQueryMESA = self->eglGetProcAddress("eglExportDMABUFImageQueryMESA"); - self->eglExportDMABUFImageMESA = self->eglGetProcAddress("eglExportDMABUFImageMESA"); - self->glEGLImageTargetTexture2DOES = self->eglGetProcAddress("glEGLImageTargetTexture2DOES"); + self->eglExportDMABUFImageQueryMESA = (FUNC_eglExportDMABUFImageQueryMESA)self->eglGetProcAddress("eglExportDMABUFImageQueryMESA"); + self->eglExportDMABUFImageMESA = (FUNC_eglExportDMABUFImageMESA)self->eglGetProcAddress("eglExportDMABUFImageMESA"); + self->glEGLImageTargetTexture2DOES = (FUNC_glEGLImageTargetTexture2DOES)self->eglGetProcAddress("glEGLImageTargetTexture2DOES"); if(!self->glEGLImageTargetTexture2DOES) { fprintf(stderr, "gsr error: gsr_egl_load failed: could not find glEGLImageTargetTexture2DOES\n"); diff --git a/src/main.cpp b/src/main.cpp index ed757a4..7d03aeb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -46,6 +46,8 @@ static const int VIDEO_STREAM_INDEX = 0; static thread_local char av_error_buffer[AV_ERROR_MAX_STRING_SIZE]; static void monitor_output_callback_print(const XRROutputInfo *output_info, const XRRCrtcInfo *crt_info, const XRRModeInfo *mode_info, void *userdata) { + (void)mode_info; + (void)userdata; fprintf(stderr, " \"%.*s\" (%dx%d+%d+%d)\n", output_info->nameLen, output_info->name, (int)crt_info->width, (int)crt_info->height, crt_info->x, crt_info->y); } @@ -83,11 +85,11 @@ enum class FramerateMode { VARIABLE }; -static int x11_error_handler(Display *dpy, XErrorEvent *ev) { +static int x11_error_handler(Display*, XErrorEvent*) { return 0; } -static int x11_io_error_handler(Display *dpy) { +static int x11_io_error_handler(Display*) { return 0; } @@ -236,7 +238,7 @@ static AVSampleFormat audio_format_to_sample_format(const AudioFormat audio_form return AV_SAMPLE_FMT_S16; } -static AVCodecContext* create_audio_codec_context(int fps, AudioCodec audio_codec, FramerateMode framerate_mode) { +static AVCodecContext* create_audio_codec_context(int fps, AudioCodec audio_codec) { const AVCodec *codec = avcodec_find_encoder(audio_codec_get_id(audio_codec)); if (!codec) { fprintf(stderr, "Error: Could not find %s audio encoder\n", audio_codec_get_name(audio_codec)); @@ -1615,7 +1617,7 @@ int main(int argc, char **argv) { int audio_stream_index = VIDEO_STREAM_INDEX + 1; for(const MergedAudioInputs &merged_audio_inputs : requested_audio_inputs) { - AVCodecContext *audio_codec_context = create_audio_codec_context(fps, audio_codec, framerate_mode); + AVCodecContext *audio_codec_context = create_audio_codec_context(fps, audio_codec); AVStream *audio_stream = nullptr; if(replay_buffer_size_secs == -1) diff --git a/src/sound.cpp b/src/sound.cpp index f29e474..c3aa4d4 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -309,6 +309,7 @@ static void pa_state_cb(pa_context *c, void *userdata) { } static void pa_sourcelist_cb(pa_context *ctx, const pa_source_info *source_info, int eol, void *userdata) { + (void)ctx; if(eol > 0) return; diff --git a/src/utils.c b/src/utils.c index 322d7d9..bee57f3 100644 --- a/src/utils.c +++ b/src/utils.c @@ -46,6 +46,7 @@ void for_each_active_monitor_output(Display *display, active_monitor_callback ca } static void get_monitor_by_name_callback(const XRROutputInfo *output_info, const XRRCrtcInfo *crt_info, const XRRModeInfo *mode_info, void *userdata) { + (void)mode_info; get_monitor_by_name_userdata *data = (get_monitor_by_name_userdata*)userdata; if(!data->found_monitor && data->name_len == output_info->nameLen && memcmp(data->name, output_info->name, data->name_len) == 0) { data->monitor->pos = (vec2i){ .x = crt_info->x, .y = crt_info->y }; |