summaryrefslogtreecommitdiff
path: root/src/sink
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2025-01-01 16:04:59 -0500
committerAndrew Opalach <andrew@akon.city> 2025-01-01 16:13:22 -0500
commit24b58a516e6bacfdf59aac422411c2f1fcf4ffb2 (patch)
tree834284316a98f829362619eb2174022687df85ea /src/sink
parent20003fd25404ee5fc4cd068fbc4fae1ad6f6ae99 (diff)
downloadcamu-24b58a516e6bacfdf59aac422411c2f1fcf4ffb2.tar.gz
camu-24b58a516e6bacfdf59aac422411c2f1fcf4ffb2.tar.bz2
camu-24b58a516e6bacfdf59aac422411c2f1fcf4ffb2.zip
Optimizations based on video loop performance
- Support nn_packet_stream direct mode - Hook up FFmpeg hardware accelerated decoding - Refactor VCR - Reduce locking when returning packets to a packet pool Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/sink')
-rw-r--r--src/sink/common.h8
-rw-r--r--src/sink/input_simulator.c11
2 files changed, 12 insertions, 7 deletions
diff --git a/src/sink/common.h b/src/sink/common.h
index e59c780..dffaea1 100644
--- a/src/sink/common.h
+++ b/src/sink/common.h
@@ -14,13 +14,13 @@ static bool camu_default_sink_callback(struct camu_screen *scr, struct camu_mixe
case CAMU_SINK_AUDIO: {
struct camu_audio_buffer *buf = (struct camu_audio_buffer *)opaque;
camu_mixer_add_buffer(mixer, buf);
- al_log_debug("camu_desktop", "Audio buffer added.");
+ al_log_info("camu_desktop", "Audio buffer added.");
break;
}
case CAMU_SINK_VIDEO: {
struct camu_video_buffer *buf = (struct camu_video_buffer *)opaque;
camu_screen_add_buffer(scr, buf);
- al_log_debug("camu_desktop", "Video buffer added.");
+ al_log_info("camu_desktop", "Video buffer added.");
break;
}
}
@@ -30,13 +30,13 @@ static bool camu_default_sink_callback(struct camu_screen *scr, struct camu_mixe
case CAMU_SINK_AUDIO: {
struct camu_audio_buffer *buf = (struct camu_audio_buffer *)opaque;
camu_mixer_remove_buffer(mixer, buf);
- al_log_debug("camu_desktop", "Audio buffer removed.");
+ al_log_info("camu_desktop", "Audio buffer removed.");
break;
}
case CAMU_SINK_VIDEO: {
struct camu_video_buffer *buf = (struct camu_video_buffer *)opaque;
camu_screen_remove_buffer(scr, buf);
- al_log_debug("camu_desktop", "Video buffer removed.");
+ al_log_info("camu_desktop", "Video buffer removed.");
break;
}
}
diff --git a/src/sink/input_simulator.c b/src/sink/input_simulator.c
index 773ac95..baa7dc8 100644
--- a/src/sink/input_simulator.c
+++ b/src/sink/input_simulator.c
@@ -10,11 +10,11 @@ static s32 quit = 1;
static struct nn_thread thread;
enum {
+ SEEK,
SKIP,
BACKSKIP,
TOGGLE_PAUSE,
SHUFFLE,
- SEEK,
MARK, // count
};
@@ -36,10 +36,15 @@ static nn_thread_result NNWT_THREADCALL input_simulation_thread(void *userdata)
case TOGGLE_PAUSE:
camu_sink_toggle_pause(sink);
break;
- case SEEK:
- camu_sink_seek(sink, al_rand() / (f64)AL_RAND_MAX);
+ case SEEK: {
+ f64 pos = al_rand() / (f64)AL_RAND_MAX;
+ if (pos < 0.005) pos = 0.0;
+ if (pos > 0.995) pos = 100.0;
+ else if (pos > 0.99) pos = 99.9;
+ camu_sink_seek(sink, pos);
break;
}
+ }
}
return 0;
}