sylware / nyanmp (public) (License: AGPLv3) (since 2020-02-12) (hash sha1)
intended to become a collection of media players for gnu/linux based on ffmpeg, alsa, vulkan, x11, wayland, etc.
List of commits:
Subject Hash Author Date (UTC)
npa: don't slow down too much the audio thread 1b8f1e2dd1d5272cd04a8fa711f26cdc3b6e1049 Sylvain BERTRAND 2020-05-29 03:00:23
npv/npa: lockless madness and much more 368cb50098ac824cc5cb603c3e1539adfeda7e1d Sylvain BERTRAND 2020-05-29 02:20:19
npv:restore pause/seeking, add tmp info command cf4da499db3123561aacd8732cd1eb97b9146e55 Sylvain BERTRAND 2020-05-27 17:31:56
npv:bugs, finer-grained locking, pthread_cond, etc 8bd06c28483adc9986b8b51612e609115948943d Sylvain BERTRAND 2020-05-26 23:59:16
npv: fix obvious multithread bug db4f3801c2185b8da1d9fb3f4b3da3d2ab92ea13 Sylvain BERTRAND 2020-05-24 21:42:08
remove old commented code d3701c5734aceda5c46cd5f60281cc524c55e4a3 Sylvain BERTRAND 2020-05-24 19:29:04
npv: video: handle latency spikes on main thread f629068cb27b47530058f81fc2b065b0786b4afa Sylvain BERTRAND 2020-05-24 18:11:07
npv: media pipeline 30efa7c8f2574c676d9d41b8bf5678d5725b8721 Sylvain BERTRAND 2020-05-24 17:40:23
alsa-lib warning 54b6dc9b912bb9509ba35405f15a623632adf784 Sylvain BERTRAND 2020-05-19 14:32:04
npv: proper handling of snd_pcm_drain() db7959bdd5f7ed921773aef42984b1c982575ad4 Sylvain BERTRAND 2020-05-15 15:00:13
proper handling of snd_pcm_drain() ae2c6458f893e77cd352fe9225e123bdf077e33f Sylvain BERTRAND 2020-05-15 14:46:30
after network testing: need an input thread 0c26bffd3c2268cfb9f7d8e43c7aba2fbf7fec16 Sylvain BERTRAND 2020-05-13 23:11:20
spin on futex waiting in threaded scaler e90420f459c608cbcbae423b3c487598a83de359 Sylvain BERTRAND 2020-05-13 21:05:48
npa tidying and npv addition, usable on our system 443ff39347c8b599dfaafff612caed84287f1a70 Sylvain BERTRAND 2020-05-13 15:12:15
here we go d5a2b11f4d73ec5365a340163f451fa8a123d728 Sylvain BERTRAND 2020-02-12 18:50:57
Commit 1b8f1e2dd1d5272cd04a8fa711f26cdc3b6e1049 - npa: don't slow down too much the audio thread
Author: Sylvain BERTRAND
Author date (UTC): 2020-05-29 03:00
Committer name: Sylvain BERTRAND
Committer date (UTC): 2020-05-29 03:00
Parent(s): 368cb50098ac824cc5cb603c3e1539adfeda7e1d
Signer:
Signing key:
Signing status: N
Tree: f698d046904c2fbfcd34687da2152df0653defac
File Lines added Lines deleted
npa/npa.c 29 27
File npa/npa.c changed (mode: 100644) (index 74af19e..89238d3)
120 120 /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
121 121 static u8 *current_url; static u8 *current_url;
122 122 static int current_st_idx; static int current_st_idx;
123 /* cmd_info must be fast, then a lockless copy of its data */
124 static struct {
125 struct {
126 int64_t duration;
127 enum AVDurationEstimationMethod m;
128 } fmt;
129 struct {
130 AVRational tb;
131 int id;
132 int64_t duration;
133 } st;
134 } cmd_info_data;
123 135 /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
124 136 /* linux and compatible */ /* linux and compatible */
125 137 static int ep_fd; static int ep_fd;
 
... ... static const AVFilter *afmt_filt;
173 185 static AVFilterContext *abufsink_ctx; static AVFilterContext *abufsink_ctx;
174 186 static const AVFilter *abufsink_filt; static const AVFilter *abufsink_filt;
175 187 /*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
176 /* a formally proven concurrent accessed lockless cb */
188 /* a formally proven concurrently accessed lockless cb */
177 189 struct { struct {
178 190 atomic_u8 reset; atomic_u8 reset;
179 191
 
... ... static void cmd_info(void)
347 359 { {
348 360 u8 *ts_str; u8 *ts_str;
349 361 int64_t remaining; int64_t remaining;
350 int64_t fmt_ctx_duration;
351 enum AVDurationEstimationMethod fmt_ctx_m;
352 362 u8 duration_str[sizeof("S9223372036854775807")]; u8 duration_str[sizeof("S9223372036854775807")];
353 AVStream *st;
354 int st_id;
355 AVRational st_tb;
356 int64_t st_duration;
357
358 fmt_ctx_lock();
359 fmt_ctx_duration = fmt_ctx->duration;
360 fmt_ctx_m = fmt_ctx->duration_estimation_method;
361 st = fmt_ctx->streams[current_st_idx];
362 st_tb = st->time_base;
363 st_id = st->id;
364 st_duration = st->duration;
365 fmt_ctx_unlock();
366 363
367 364 RESTORE; RESTORE;
368 365 GREEN;POUT("================================================================================\n");RESTORE; GREEN;POUT("================================================================================\n");RESTORE;
369 366 PURPLE;POUT("%s\n", current_url);RESTORE; PURPLE;POUT("%s\n", current_url);RESTORE;
370 ts_str = ts_to_str(dec_frs.most_recent_ts, st_tb, &remaining);
367 ts_str = ts_to_str(dec_frs.most_recent_ts, cmd_info_data.st.tb, &remaining);
371 368 RED;POUT("%s", ts_str);RESTORE; RED;POUT("%s", ts_str);RESTORE;
372 369 if (remaining != 0) if (remaining != 0)
373 370 POUT(" remaining %"PRId64" time base units", remaining); POUT(" remaining %"PRId64" time base units", remaining);
374 371 else else
375 372 POUT("\n"); POUT("\n");
376 POUT("\t%"PRId64" stream time base units (%d/%d seconds)\n", dec_frs.most_recent_ts, st_tb.num, st_tb.den);
373 POUT("\t%"PRId64" stream time base units (%d/%d seconds)\n", dec_frs.most_recent_ts, cmd_info_data.st.tb.num, cmd_info_data.st.tb.den);
377 374 BLUE;POUT("--------------------------------------------------------------------------------\n");RESTORE; BLUE;POUT("--------------------------------------------------------------------------------\n");RESTORE;
378 375 POUT("format:"); POUT("format:");
379 if (fmt_ctx_duration == AV_NOPTS_VALUE) {
376 if (cmd_info_data.fmt.duration == AV_NOPTS_VALUE) {
380 377 POUT("duration is not provided\n"); POUT("duration is not provided\n");
381 378 } else { } else {
382 snprintf(duration_str, sizeof(duration_str), "%"PRId64, fmt_ctx_duration);
383 ts_str = ts_to_str(fmt_ctx_duration, AV_TIME_BASE_Q,
379 snprintf(duration_str, sizeof(duration_str), "%"PRId64, cmd_info_data.fmt.duration);
380 ts_str = ts_to_str(cmd_info_data.fmt.duration, AV_TIME_BASE_Q,
384 381 &remaining); &remaining);
385 382 POUT("duration=");RED;POUT("%s", ts_str);RESTORE; POUT("duration=");RED;POUT("%s", ts_str);RESTORE;
386 383 if (remaining != 0) if (remaining != 0)
387 384 POUT(" remaining %"PRId64" av_time_base units\n", remaining); POUT(" remaining %"PRId64" av_time_base units\n", remaining);
388 385 else else
389 386 POUT("\n"); POUT("\n");
390 POUT("\t%s av_time_base units (1/%d seconds)\n\testimation method is %s\n", duration_str, AV_TIME_BASE, duration_estimate_to_str(fmt_ctx_m));
387 POUT("\t%s av_time_base units (1/%d seconds)\n\testimation method is %s\n", duration_str, AV_TIME_BASE, duration_estimate_to_str(cmd_info_data.fmt.m));
391 388 } }
392 POUT("stream:id=%d", st_id);
393 if (st->duration == AV_NOPTS_VALUE) {
389 POUT("stream:id=%d", cmd_info_data.st.id);
390 if (cmd_info_data.st.duration == AV_NOPTS_VALUE) {
394 391 POUT(";duration is not provided\n"); POUT(";duration is not provided\n");
395 392 } else { } else {
396 snprintf(duration_str, sizeof(duration_str), "%"PRId64, st_duration);
397 ts_str = ts_to_str(st->duration, st_tb, &remaining);
393 snprintf(duration_str, sizeof(duration_str), "%"PRId64, cmd_info_data.st.duration);
394 ts_str = ts_to_str(cmd_info_data.st.duration, cmd_info_data.st.tb, &remaining);
398 395 POUT(";duration=");RED;POUT("%s\n", ts_str);RESTORE; POUT(";duration=");RED;POUT("%s\n", ts_str);RESTORE;
399 396 if (remaining != 0) if (remaining != 0)
400 397 POUT(" remaining %"PRId64" stream time base units\n", remaining); POUT(" remaining %"PRId64" stream time base units\n", remaining);
401 398 else else
402 399 POUT("\n"); POUT("\n");
403 POUT("\t%s stream time base units (%d/%d seconds)\n", duration_str, st_tb.num, st_tb.den);
400 POUT("\t%s stream time base units (%d/%d seconds)\n", duration_str, cmd_info_data.st.tb.num, cmd_info_data.st.tb.den);
404 401 } }
405 402 BLUE;POUT("--------------------------------------------------------------------------------\n");RESTORE; BLUE;POUT("--------------------------------------------------------------------------------\n");RESTORE;
406 403 POUT("circular buffer: %u/%u/%u (read/send/max)\n", atomic_load(&cb.rd), atomic_load(&cb.sd), U8_MAX); POUT("circular buffer: %u/%u/%u (read/send/max)\n", atomic_load(&cb.rd), atomic_load(&cb.sd), U8_MAX);
 
... ... static void play(int st_idx, double initial_vol)
2245 2242 fmt_ctx_lock(); fmt_ctx_lock();
2246 2243 dec_ctx_cfg(fmt_ctx->streams[st_idx]->codecpar); dec_ctx_cfg(fmt_ctx->streams[st_idx]->codecpar);
2247 2244 dec_frs.most_recent_ts = fmt_ctx->streams[st_idx]->start_time; dec_frs.most_recent_ts = fmt_ctx->streams[st_idx]->start_time;
2245 cmd_info_data.fmt.duration = fmt_ctx->duration;
2246 cmd_info_data.fmt.m = fmt_ctx->duration_estimation_method;
2247 cmd_info_data.st.tb = fmt_ctx->streams[st_idx]->time_base;
2248 cmd_info_data.st.id = fmt_ctx->streams[st_idx]->id;
2249 cmd_info_data.st.duration = fmt_ctx->streams[st_idx]->duration;
2248 2250 fmt_ctx_unlock(); fmt_ctx_unlock();
2249 2251
2250 2252 evt_pcm_uninstall(); evt_pcm_uninstall();
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/sylware/nyanmp

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/sylware/nyanmp

Clone this repository using git:
git clone git://git.rocketgit.com/user/sylware/nyanmp

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main