Replace tabs with 4 spaces
This commit is contained in:
parent
e985e8e18e
commit
7749ba8327
@ -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) {
|
||||
|
@ -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;
|
||||
@ -986,7 +986,7 @@ static int init_filter_graph(AVCodecContext *audio_codec_context, AVFilterGraph
|
||||
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();
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user