aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-04-18 18:34:23 +0200
committerdec05eba <dec05eba@protonmail.com>2023-04-18 18:34:23 +0200
commit7749ba83279cd974e319e999a72705ae04997360 (patch)
tree89dec79da9c7391e03761a443cfc25811e5c471b /src
parente985e8e18ee735ea46b1a2807dbbab1928fb493b (diff)
Replace tabs with 4 spaces
Diffstat (limited to 'src')
-rw-r--r--src/color_conversion.c36
-rw-r--r--src/main.cpp10
-rw-r--r--src/window_texture.c6
3 files changed, 26 insertions, 26 deletions
diff --git a/src/color_conversion.c b/src/color_conversion.c
index 8b1590b..2752e2e 100644
--- a/src/color_conversion.c
+++ b/src/color_conversion.c
@@ -26,30 +26,30 @@ static int load_shader_y(gsr_shader *shader, gsr_egl *egl, float rotation) {
"in vec2 texcoords; \n"
"out vec2 texcoords_out; \n"
ROTATE_Z
- "void main() \n"
- "{ \n"
+ "void main() \n"
+ "{ \n"
" texcoords_out = texcoords; \n"
- " gl_Position = vec4(pos.x, pos.y, 0.0, 1.0) * rotate_z(%f); \n"
- "} \n", rotation);
+ " gl_Position = vec4(pos.x, pos.y, 0.0, 1.0) * rotate_z(%f); \n"
+ "} \n", rotation);
char fragment_shader[] =
"#version 300 es \n"
- "precision mediump float; \n"
+ "precision mediump float; \n"
"in vec2 texcoords_out; \n"
"uniform sampler2D tex1; \n"
"out vec4 FragColor; \n"
RGB_TO_YUV
- "void main() \n"
- "{ \n"
+ "void main() \n"
+ "{ \n"
" FragColor.x = (RGBtoYUV * vec4(texture(tex1, texcoords_out).rgb, 1.0)).x; \n"
- "} \n";
+ "} \n";
if(gsr_shader_init(shader, egl, vertex_shader, fragment_shader) != 0)
return -1;
gsr_shader_bind_attribute_location(shader, "pos", 0);
gsr_shader_bind_attribute_location(shader, "texcoords", 1);
- return 0;
+ return 0;
}
static unsigned int load_shader_uv(gsr_shader *shader, gsr_egl *egl, float rotation) {
@@ -60,30 +60,30 @@ static unsigned int load_shader_uv(gsr_shader *shader, gsr_egl *egl, float rotat
"in vec2 texcoords; \n"
"out vec2 texcoords_out; \n"
ROTATE_Z
- "void main() \n"
- "{ \n"
+ "void main() \n"
+ "{ \n"
" texcoords_out = texcoords; \n"
- " gl_Position = vec4(pos.x, pos.y, 0.0, 1.0) * rotate_z(%f) * vec4(0.5, 0.5, 1.0, 1.0) - vec4(0.5, 0.5, 0.0, 0.0); \n"
- "} \n", rotation);
+ " gl_Position = vec4(pos.x, pos.y, 0.0, 1.0) * rotate_z(%f) * vec4(0.5, 0.5, 1.0, 1.0) - vec4(0.5, 0.5, 0.0, 0.0); \n"
+ "} \n", rotation);
char fragment_shader[] =
"#version 300 es \n"
- "precision mediump float; \n"
+ "precision mediump float; \n"
"in vec2 texcoords_out; \n"
"uniform sampler2D tex1; \n"
"out vec4 FragColor; \n"
RGB_TO_YUV
- "void main() \n"
- "{ \n"
+ "void main() \n"
+ "{ \n"
" FragColor.xy = (RGBtoYUV * vec4(texture(tex1, texcoords_out).rgb, 1.0)).zy; \n"
- "} \n";
+ "} \n";
if(gsr_shader_init(shader, egl, vertex_shader, fragment_shader) != 0)
return -1;
gsr_shader_bind_attribute_location(shader, "pos", 0);
gsr_shader_bind_attribute_location(shader, "texcoords", 1);
- return 0;
+ return 0;
}
static int loader_framebuffers(gsr_color_conversion *self) {
diff --git a/src/main.cpp b/src/main.cpp
index 0cc6922..a7db997 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -98,7 +98,7 @@ static void receive_frames(AVCodecContext *av_codec_context, int stream_index, A
std::deque<AVPacket> &frame_data_queue,
int replay_buffer_size_secs,
bool &frames_erased,
- std::mutex &write_output_mutex) {
+ std::mutex &write_output_mutex) {
for (;;) {
// TODO: Use av_packet_alloc instead because sizeof(av_packet) might not be future proof(?)
AVPacket av_packet;
@@ -246,7 +246,7 @@ static AVCodecContext* create_audio_codec_context(int fps, AudioCodec audio_code
AVCodecContext *codec_context = avcodec_alloc_context3(codec);
assert(codec->type == AVMEDIA_TYPE_AUDIO);
- codec_context->codec_id = codec->id;
+ codec_context->codec_id = codec->id;
codec_context->sample_fmt = audio_codec_get_sample_format(audio_codec, codec);
codec_context->bit_rate = audio_codec_get_get_bitrate(audio_codec);
codec_context->sample_rate = 48000;
@@ -984,9 +984,9 @@ static int init_filter_graph(AVCodecContext *audio_codec_context, AVFilterGraph
char args[512];
snprintf(args, sizeof(args), "inputs=%d", (int)num_sources);
-
+
AVFilterContext *mix_ctx;
- err = avfilter_graph_create_filter(&mix_ctx, mix_filter, "amix",
+ err = avfilter_graph_create_filter(&mix_ctx, mix_filter, "amix",
args, NULL, filter_graph);
if (err < 0) {
@@ -1972,7 +1972,7 @@ int main(int argc, char **argv) {
usleep(sleep_time * 1000.0 * 1000.0);
}
- running = 0;
+ running = 0;
if(save_replay_thread.valid()) {
save_replay_thread.get();
diff --git a/src/window_texture.c b/src/window_texture.c
index 81bf053..7448323 100644
--- a/src/window_texture.c
+++ b/src/window_texture.c
@@ -57,9 +57,9 @@ int window_texture_on_resize(WindowTexture *self) {
EGLImage image = NULL;
const intptr_t pixmap_attrs[] = {
- EGL_IMAGE_PRESERVED_KHR, EGL_TRUE,
- EGL_NONE,
- };
+ EGL_IMAGE_PRESERVED_KHR, EGL_TRUE,
+ EGL_NONE,
+ };
pixmap = XCompositeNameWindowPixmap(self->display, self->window);
if(!pixmap) {