Archived
2
0

cleanup c files.

This commit is contained in:
Miroslav Šedivý 2021-11-07 17:09:00 +01:00
parent dfcb817eec
commit 33256f2ff2
4 changed files with 36 additions and 61 deletions

View File

@ -1,7 +1,5 @@
#include "gst.h" #include "gst.h"
#include <gst/app/gstappsrc.h>
typedef struct SampleHandlerUserData { typedef struct SampleHandlerUserData {
int pipelineId; int pipelineId;
} SampleHandlerUserData; } SampleHandlerUserData;
@ -10,13 +8,6 @@ void gstreamer_init(void) {
gst_init(NULL, NULL); gst_init(NULL, NULL);
} }
GMainLoop *gstreamer_send_main_loop = NULL;
void gstreamer_send_start_mainloop(void) {
gstreamer_send_main_loop = g_main_loop_new(NULL, FALSE);
g_main_loop_run(gstreamer_send_main_loop);
}
static gboolean gstreamer_send_bus_call(GstBus *bus, GstMessage *msg, gpointer data) { static gboolean gstreamer_send_bus_call(GstBus *bus, GstMessage *msg, gpointer data) {
switch (GST_MESSAGE_TYPE(msg)) { switch (GST_MESSAGE_TYPE(msg)) {
@ -90,5 +81,3 @@ void gstreamer_send_play_pipeline(GstElement *pipeline) {
void gstreamer_send_stop_pipeline(GstElement *pipeline) { void gstreamer_send_stop_pipeline(GstElement *pipeline) {
gst_element_set_state(pipeline, GST_STATE_NULL); gst_element_set_state(pipeline, GST_STATE_NULL);
} }

View File

@ -4,7 +4,6 @@ package gst
#cgo pkg-config: gstreamer-1.0 gstreamer-app-1.0 #cgo pkg-config: gstreamer-1.0 gstreamer-app-1.0
#include "gst.h" #include "gst.h"
*/ */
import "C" import "C"
import ( import (

View File

@ -1,10 +1,7 @@
#ifndef GST_H #pragma once
#define GST_H
#include <glib.h>
#include <gst/gst.h> #include <gst/gst.h>
#include <stdint.h> #include <gst/app/gstappsrc.h>
#include <stdlib.h>
extern void goHandlePipelineBuffer(void *buffer, int bufferLen, int samples, int pipelineId); extern void goHandlePipelineBuffer(void *buffer, int bufferLen, int samples, int pipelineId);
@ -13,7 +10,4 @@ GstElement *gstreamer_send_create_pipeline(char *pipeline, GError **error);
void gstreamer_send_start_pipeline(GstElement *pipeline, int pipelineId); void gstreamer_send_start_pipeline(GstElement *pipeline, int pipelineId);
void gstreamer_send_play_pipeline(GstElement *pipeline); void gstreamer_send_play_pipeline(GstElement *pipeline);
void gstreamer_send_stop_pipeline(GstElement *pipeline); void gstreamer_send_stop_pipeline(GstElement *pipeline);
void gstreamer_send_start_mainloop(void);
void gstreamer_init(void); void gstreamer_init(void);
#endif

View File

@ -1,51 +1,44 @@
#pragma once #pragma once
#ifndef XDISPLAY_H #include <X11/XKBlib.h>
#define XDISPLAY_H #include <X11/extensions/Xrandr.h>
#include <X11/extensions/XTest.h>
#include <libclipboard.h>
#include <stdlib.h> /* For free() */
#include <stdio.h> /* For fputs() */
#include <string.h> /* For strdup() */
#include <X11/Xlib.h> extern void goCreateScreenSize(int index, int width, int height, int mwidth, int mheight);
#include <X11/XKBlib.h> extern void goSetScreenRates(int index, int rate_index, short rate);
#include <X11/extensions/Xrandr.h>
#include <X11/extensions/XTest.h>
#include <libclipboard.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h> /* For fputs() */
#include <string.h> /* For strdup() */
extern void goCreateScreenSize(int index, int width, int height, int mwidth, int mheight); typedef struct xkeys_t {
extern void goSetScreenRates(int index, int rate_index, short rate); KeySym keysym;
KeyCode keycode;
struct xkeys_t *next;
} xkeys_t;
typedef struct xkeys_t { /* Returns the main display, closed either on exit or when closeMainDisplay()
KeySym keysym; * is invoked. This removes a bit of the overhead of calling XOpenDisplay() &
KeyCode keycode; * XCloseDisplay() everytime the main display needs to be used.
struct xkeys_t *next; *
} xkeys_t; * Note that this is almost certainly not thread safe. */
Display *getXDisplay(void);
clipboard_c *getClipboard(void);
/* Returns the main display, closed either on exit or when closeMainDisplay() void XMove(int x, int y);
* is invoked. This removes a bit of the overhead of calling XOpenDisplay() & void XScroll(int x, int y);
* XCloseDisplay() everytime the main display needs to be used. void XButton(unsigned int button, int down);
* void XKey(unsigned long key, int down);
* Note that this is almost certainly not thread safe. */
Display *getXDisplay(void);
clipboard_c *getClipboard(void);
void XMove(int x, int y); void XClipboardSet(char *src);
void XScroll(int x, int y); char *XClipboardGet();
void XButton(unsigned int button, int down);
void XKey(unsigned long key, int down);
void XClipboardSet(char *src); void XGetScreenConfigurations();
char *XClipboardGet(); void XSetScreenConfiguration(int index, short rate);
int XGetScreenSize();
short XGetScreenRate();
void XGetScreenConfigurations(); void XDisplayClose(void);
void XSetScreenConfiguration(int index, short rate); void XDisplaySet(char *input);
int XGetScreenSize();
short XGetScreenRate();
void XDisplayClose(void);
void XDisplaySet(char *input);
void SetKeyboardModifiers(int num_lock, int caps_lock, int scroll_lock);
#endif
void SetKeyboardModifiers(int num_lock, int caps_lock, int scroll_lock);