fix formatting.

This commit is contained in:
Miroslav Šedivý 2020-10-29 18:07:04 +01:00
parent cd769c05d3
commit 78c397ef54
4 changed files with 16 additions and 16 deletions

View File

@ -50,14 +50,14 @@ GstFlowReturn gstreamer_send_new_sample_handler(GstElement *object, gpointer use
gsize copy_size = 0; gsize copy_size = 0;
SampleHandlerUserData *s = (SampleHandlerUserData *)user_data; SampleHandlerUserData *s = (SampleHandlerUserData *)user_data;
g_signal_emit_by_name (object, "pull-sample", &sample); g_signal_emit_by_name(object, "pull-sample", &sample);
if (sample) { if (sample) {
buffer = gst_sample_get_buffer(sample); buffer = gst_sample_get_buffer(sample);
if (buffer) { if (buffer) {
gst_buffer_extract_dup(buffer, 0, gst_buffer_get_size(buffer), &copy, &copy_size); gst_buffer_extract_dup(buffer, 0, gst_buffer_get_size(buffer), &copy, &copy_size);
goHandlePipelineBuffer(copy, copy_size, GST_BUFFER_DURATION(buffer), s->pipelineId); goHandlePipelineBuffer(copy, copy_size, GST_BUFFER_DURATION(buffer), s->pipelineId);
} }
gst_sample_unref (sample); gst_sample_unref(sample);
} }
return GST_FLOW_OK; return GST_FLOW_OK;
@ -69,8 +69,8 @@ GstElement *gstreamer_send_create_pipeline(char *pipeline) {
} }
void gstreamer_send_destroy_pipeline(GstElement *pipeline) { void gstreamer_send_destroy_pipeline(GstElement *pipeline) {
gst_element_set_state (pipeline, GST_STATE_NULL); gst_element_set_state(pipeline, GST_STATE_NULL);
gst_object_unref (pipeline); gst_object_unref(pipeline);
} }
void gstreamer_send_start_pipeline(GstElement *pipeline, int pipelineId) { void gstreamer_send_start_pipeline(GstElement *pipeline, int pipelineId) {
@ -96,5 +96,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

@ -7,6 +7,7 @@ import (
"github.com/kataras/go-events" "github.com/kataras/go-events"
"github.com/rs/zerolog" "github.com/rs/zerolog"
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
"demodesk/neko/internal/gst" "demodesk/neko/internal/gst"
"demodesk/neko/internal/types" "demodesk/neko/internal/types"
"demodesk/neko/internal/types/config" "demodesk/neko/internal/types/config"

View File

@ -2,6 +2,7 @@ package session
import ( import (
"github.com/rs/zerolog" "github.com/rs/zerolog"
"demodesk/neko/internal/types" "demodesk/neko/internal/types"
"demodesk/neko/internal/types/event" "demodesk/neko/internal/types/event"
"demodesk/neko/internal/types/message" "demodesk/neko/internal/types/message"

View File

@ -54,7 +54,7 @@ void XDisplaySet(char *input) {
void XMove(int x, int y) { void XMove(int x, int y) {
Display *display = getXDisplay(); Display *display = getXDisplay();
XWarpPointer(display, None, DefaultRootWindow(display), 0, 0, 0, 0, x, y); XWarpPointer(display, None, DefaultRootWindow(display), 0, 0, 0, 0, x, y);
XSync(display, 0); XSync(display, 0);
} }
@ -102,7 +102,7 @@ void XKey(unsigned long key, int down) {
KeyCode code = XKeysymToKeycode(display, key); KeyCode code = XKeysymToKeycode(display, key);
// Map non-existing keysyms to new keycodes // Map non-existing keysyms to new keycodes
if(code == 0) { if (code == 0) {
int min, max, numcodes; int min, max, numcodes;
XDisplayKeycodes(display, &min, &max); XDisplayKeycodes(display, &min, &max);
XGetKeyboardMapping(display, min, max-min, &numcodes); XGetKeyboardMapping(display, min, max-min, &numcodes);
@ -129,19 +129,19 @@ char *XClipboardGet() {
} }
void XGetScreenConfigurations() { void XGetScreenConfigurations() {
Display *display = getXDisplay(); Display *display = getXDisplay();
Window root = RootWindow(display, 0); Window root = RootWindow(display, 0);
XRRScreenSize *xrrs; XRRScreenSize *xrrs;
int num_sizes; int num_sizes;
xrrs = XRRSizes(display, 0, &num_sizes); xrrs = XRRSizes(display, 0, &num_sizes);
for(int i = 0; i < num_sizes; i ++) { for (int i = 0; i < num_sizes; i++) {
short *rates; short *rates;
int num_rates; int num_rates;
goCreateScreenSize(i, xrrs[i].width, xrrs[i].height, xrrs[i].mwidth, xrrs[i].mheight); goCreateScreenSize(i, xrrs[i].width, xrrs[i].height, xrrs[i].mwidth, xrrs[i].mheight);
rates = XRRRates(display, 0, i, &num_rates); rates = XRRRates(display, 0, i, &num_rates);
for (int j = 0; j < num_rates; j ++) { for (int j = 0; j < num_rates; j++) {
goSetScreenRates(i, j, rates[j]); goSetScreenRates(i, j, rates[j]);
} }
} }
@ -155,14 +155,14 @@ void XSetScreenConfiguration(int index, short rate) {
int XGetScreenSize() { int XGetScreenSize() {
Display *display = getXDisplay(); Display *display = getXDisplay();
XRRScreenConfiguration *conf = XRRGetScreenInfo(display, RootWindow(display, 0)); XRRScreenConfiguration *conf = XRRGetScreenInfo(display, RootWindow(display, 0));
Rotation original_rotation; Rotation original_rotation;
return XRRConfigCurrentConfiguration(conf, &original_rotation); return XRRConfigCurrentConfiguration(conf, &original_rotation);
} }
short XGetScreenRate() { short XGetScreenRate() {
Display *display = getXDisplay(); Display *display = getXDisplay();
XRRScreenConfiguration *conf = XRRGetScreenInfo(display, RootWindow(display, 0)); XRRScreenConfiguration *conf = XRRGetScreenInfo(display, RootWindow(display, 0));
return XRRConfigCurrentRate(conf); return XRRConfigCurrentRate(conf);
} }