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)
npv: backward discontinuity handling 0fc81a53996993992dd86a96a26afd2aab0ac366 Sylvain BERTRAND 2020-09-25 16:14:26
npv: more monotonic, more pts discontinuity 1ab37ad2a24ca8f9fbf6d51eac8f996bd2eefacf Sylvain BERTRAND 2020-09-25 01:34:41
npv: workaround a mesa bug (which leads to linux state corruption) 780e5bec0b90a9e931778cf68fec62a7c5241c13 Sylvain BERTRAND 2020-09-23 15:57:25
npv: fix filter time base handling, prepare discontinuity support 2b7347be805d17a2b6f06e276e897c51431b9c6c Sylvain BERTRAND 2020-09-22 17:38:46
npv: correct coarse sync of vulkan image acquisition a9b52940ff2d567dc6c26b28d86eab54f5876819 Sylvain BERTRAND 2020-09-20 22:00:32
npv: fix channel layout handling and a tad more 88f74f181a567d108874a936fe3d306d34cfefb7 Sylvain BERTRAND 2020-09-19 23:12:04
npv: dynamic audio filter configuration d8a0ff688ddb2abcde22c01a2ae52ea74e9f0f2f Sylvain BERTRAND 2020-09-19 20:54:04
npv:protection against tantrum of media audio 78589150b7c6f1f3cae49b4b4bc8b572c6d8e6b7 Sylvain BERTRAND 2020-09-18 15:26:17
npv/npa:finish to workaround null channel layout 314788563e01d7ffb364a1775ba68619ee3f6c5c Sylvain BERTRAND 2020-09-15 22:50:57
npv: handle empty channel layout 5b5794fc4d5300b671b684a2f41196f66bd1fc4a Sylvain BERTRAND 2020-09-15 22:11:07
npv: tidy mutex locking 1962092d9675f76604414086200e88f6c857346f Sylvain BERTRAND 2020-09-15 00:51:12
npv: less incorrect reprogramming of blits b319e79f4f1b79670f6eef754142cc65c891ad4b Sylvain BERTRAND 2020-09-12 15:14:27
npv:fix osd restoration 8c64f703eca6b8c54b4cb5c95231dd02aa394135 Sylvain BERTRAND 2020-08-29 20:36:12
npv:osd:solo compilation modulo a few warnings 7805bd8f34f913b1535cc81c5be2a3132bd7e0e5 Sylvain BERTRAND 2020-08-29 14:51:35
npv: cleanup and color component fix 44f294e1de96c7974740f1187ebdbe12204884ae Sylvain BERTRAND 2020-08-28 23:48:18
npv:osd:timer, will add more if pertinent 6d34403c2c49bfa6ccf8e7a72e35a69e6f0527c5 Sylvain BERTRAND 2020-08-28 22:47:18
npv/npa: document properly snd_pcm_drain behavior 510ca39ee6a9ac9fcd646484793b7556eaa5972f Sylvain BERTRAND 2020-08-26 17:36:29
npv:remove locale layout dependent key binds f69bbbe529045b4243ece8957c838cb1465352da Sylvain BERTRAND 2020-08-24 21:27:08
npv: global seek based on audio timeline only 3c8fd60fa0a67143fa16ac90565bfcc35a193b6b Sylvain BERTRAND 2020-08-24 18:41:16
npv:_reasonable_ "pedanticage" of the code c5f2644d6eba84bcbcc9b0599c41e1f6733ea95c Sylvain BERTRAND 2020-08-20 16:25:50
Commit 0fc81a53996993992dd86a96a26afd2aab0ac366 - npv: backward discontinuity handling
Author: Sylvain BERTRAND
Author date (UTC): 2020-09-25 16:14
Committer name: Sylvain BERTRAND
Committer date (UTC): 2020-09-25 16:14
Parent(s): 1ab37ad2a24ca8f9fbf6d51eac8f996bd2eefacf
Signing key:
Tree: c78b906b3215c80580a880b5266bcf8763733fab
File Lines added Lines deleted
npv/config.h 9 1
npv/video/local/code.frag.c 51 4
npv/video/local/state.frag.c 4 0
npv/video/namespace/main.c 2 0
npv/video/public/code.frag.c 1 1
File npv/config.h changed (mode: 100644) (index 2628bde..1830bf5)
... ... struct npv_x11_bind_t npv_x11_binds[] = {
61 61 #define VOL_DELTA 0.1 /* from 0.0 to 1.0 */ #define VOL_DELTA 0.1 /* from 0.0 to 1.0 */
62 62 #define SEEK_DELTA INT64_C(10) /* 10 seconds */ #define SEEK_DELTA INT64_C(10) /* 10 seconds */
63 63 #define SEEK_DELTA_BIG (INT64_C(4) * INT64_C(60)) /* 4 minutes */ #define SEEK_DELTA_BIG (INT64_C(4) * INT64_C(60)) /* 4 minutes */
64 /*----------------------------------------------------------------------------*/
64 /*============================================================================*/
65 65 /* kinky internal settings, modify with care */ /* kinky internal settings, modify with care */
66 66 /* the count of decoded video frames in the array, it is "expensive" */ /* the count of decoded video frames in the array, it is "expensive" */
67 67 #define DEC_FRS_ARRAY_N_MAX 4 #define DEC_FRS_ARRAY_N_MAX 4
68 /*
69 * video frames are presumed arriving inorder, but once a backward
70 * discontinuity is detected, in order to avoid a full and dead locked array of
71 * predecoded video frames, we must drop frames until we resynchronize. To
72 * decide if we found a resynchronzining frame, we define a time window based
73 * on the following value
74 */
75 #define DISCONT_BACKWARD_RESYNC_MS 500
68 76 #endif #endif
File npv/video/local/code.frag.c changed (mode: 100644) (index 758aaf2..44017cd)
... ... STATIC void init_once_local(void)
76 76 } }
77 77 receive_fr_l = avutil_video_fr_ref_alloc(); receive_fr_l = avutil_video_fr_ref_alloc();
78 78 is_swpchn_sem_fence_submitted_l = false; is_swpchn_sem_fence_submitted_l = false;
79 drop_l.prev_now = AV_NOPTS_VALUE;
80 drop_l.until_resync = false;
79 81 } }
80 82 #undef NONE #undef NONE
81 83 STATIC void scaler_img_create(avutil_video_fr_ref_t *fr) STATIC void scaler_img_create(avutil_video_fr_ref_t *fr)
 
... ... STATIC void fr_drop(u16 fr)
332 334 } }
333 335 #undef NO_FR #undef NO_FR
334 336 #define NO_FR 0 #define NO_FR 0
335 STATIC void frs_drop(avutil_video_fr_ref_t *selected_fr)
337 STATIC void frs_drop(s64 now, avutil_video_fr_ref_t *selected_fr)
336 338 { {
337 339 u16 fr; u16 fr;
340 s64 lo;
341 s64 hi;
342 s64 resync;
338 343
339 344 if (selected_fr == NO_FR) if (selected_fr == NO_FR)
340 return;
341 /* drop as many of as possible frames received before the selected one */
345 goto exit;
346 /* backward discont detected */
347 if (drop_l.prev_now != AV_NOPTS_VALUE && now < drop_l.prev_now)
348 drop_l.until_resync = true;
349 /*====================================================================*/
350 /*
351 * since the frs are supposed inorder, first drop as many of as possible
352 * frs received before the selected one
353 */
342 354 fr = 0; fr = 0;
343 355 loop { loop {
344 356 if (dec_frs_p.a[fr] == selected_fr) if (dec_frs_p.a[fr] == selected_fr)
345 357 break; break;
346 /* keep the fr the scaler is related to */
358 /* don't touch the scaler fr */
347 359 if (dec_frs_p.a[fr] != scaler_p.img.fr) { if (dec_frs_p.a[fr] != scaler_p.img.fr) {
348 360 if (dec_frs_p.a[fr] == last_fr_sent_to_pe_l) if (dec_frs_p.a[fr] == last_fr_sent_to_pe_l)
349 361 last_fr_sent_to_pe_l = NO_FR; last_fr_sent_to_pe_l = NO_FR;
 
... ... STATIC void frs_drop(avutil_video_fr_ref_t *selected_fr)
351 363 } else } else
352 364 ++fr; ++fr;
353 365 } }
366 /*====================================================================*/
367 /*
368 * here, we detected a backward discont, we are looking for a
369 * resynchronizing fr based on a time win. we must drop, inorder,
370 * frs which are out of the time win in order to avoid the dec frs a
371 * being full and locked
372 */
373 if (!drop_l.until_resync)
374 goto exit;
375 resync = (DISCONT_BACKWARD_RESYNC_MS * st_p.tb.den) / (st_p.tb.num
376 * 1000);
377 lo = now - resync;
378 hi = now + resync;
379 fr = 0;
380 loop {
381 if (fr == dec_frs_p.n)
382 break;
383 /* don't touch the scaler fr or selected fr */
384 if (dec_frs_p.a[fr] != scaler_p.img.fr
385 && dec_frs_p.a[fr] != selected_fr) {
386 if (dec_frs_p.a[fr]->pts < lo
387 || hi < dec_frs_p.a[fr]->pts) {
388 if (dec_frs_p.a[fr] == last_fr_sent_to_pe_l)
389 last_fr_sent_to_pe_l = NO_FR;
390 fr_drop(fr); /* do not advance */
391 } else { /* found a resynchronizing fr */
392 drop_l.until_resync = false;
393 break;
394 }
395 } else
396 ++fr;
397 }
398 exit:
399 drop_l.prev_now = now;
354 400 } }
401
355 402 #undef NO_FR #undef NO_FR
356 403 #define NO_FR 0 #define NO_FR 0
357 404 STATIC void select_fr(s64 now, avutil_video_fr_ref_t **selected_fr, STATIC void select_fr(s64 now, avutil_video_fr_ref_t **selected_fr,
File npv/video/local/state.frag.c changed (mode: 100644) (index ec8e788..89f57be)
... ... STATIC struct {
17 17 } blit_l[npv_vk_swpchn_imgs_n_max]; } blit_l[npv_vk_swpchn_imgs_n_max];
18 18 STATIC avutil_video_fr_ref_t *last_fr_sent_to_pe_l; STATIC avutil_video_fr_ref_t *last_fr_sent_to_pe_l;
19 19 STATIC bool is_swpchn_sem_fence_submitted_l; STATIC bool is_swpchn_sem_fence_submitted_l;
20 STATIC struct {
21 s64 prev_now;
22 bool until_resync;
23 } drop_l;
File npv/video/namespace/main.c changed (mode: 100644) (index bf28b16..8f23c73)
13 13 #define dec_a_grow npv_video_dec_a_grow #define dec_a_grow npv_video_dec_a_grow
14 14 #define dec_ctx_mutex_l npv_video_dec_ctx_mutex_l #define dec_ctx_mutex_l npv_video_dec_ctx_mutex_l
15 15 #define dec_l npv_video_dec_l #define dec_l npv_video_dec_l
16 #define drop_l npv_video_drop_l
16 17 #define fatal npv_video_fatal #define fatal npv_video_fatal
17 18 #define fatalff npv_video_fatalff #define fatalff npv_video_fatalff
18 19 #define fatalvk npv_video_fatalvk #define fatalvk npv_video_fatalvk
 
62 63 #undef dec_a_grow #undef dec_a_grow
63 64 #undef dec_ctx_mutex_l #undef dec_ctx_mutex_l
64 65 #undef dec_l #undef dec_l
66 #undef drop_l
65 67 #undef fatal #undef fatal
66 68 #undef fatalff #undef fatalff
67 69 #undef fatalvk #undef fatalvk
File npv/video/public/code.frag.c changed (mode: 100644) (index ee65471..5fb8dfd)
... ... STATIC void timer_evt(void)
217 217 return; return;
218 218 } }
219 219 select_fr(now, &fr, &fr_priv); select_fr(now, &fr, &fr_priv);
220 frs_drop(fr);
220 frs_drop(now, fr);
221 221 dec_frs_unlock(); dec_frs_unlock();
222 222 /* unlock ------------------------------------------------------------*/ /* unlock ------------------------------------------------------------*/
223 223 if (fr == NO_FR) if (fr == NO_FR)
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