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: inverted resync logic and rate limiter 9e772be0d5e19dc4dcef05ee2b4ce47c42788f8e Sylvain BERTRAND 2021-05-16 18:06:23
npv:trying to work around nasty live streams 544ddd3381ad56363bb275ae59419e97e8c86895 Sylvain BERTRAND 2021-05-14 15:45:19
npv:spurious braces e8678920198c6795420c54a839b92e5d301b4183 Sylvain BERTRAND 2021-05-06 20:55:38
npv:pts debug tracing, ffmpeg dev tantrum 8c3bf9cf42fc3419b64c232f905c5c580d6a1942 Sylvain BERTRAND 2021-05-06 18:37:35
npa: forgot zero-ing before cmp ceff7a70798b604bdb876a92ba0c446e3ede8a5b Sylvain BERTRAND 2021-04-15 20:15:07
npv: namespace love cb385e293aeb094073963c46022f3c430b6bf9c1 Sylvain BERTRAND 2021-01-16 18:37:11
conservative handling of vulkan linear filtering 7736b342c3566ac3ffa7a83ff1c7985e5595265f Sylvain BERTRAND 2021-01-15 18:18:02
npv: spurious AND faulty image creation flag e7d0d4e9efa15781b323cd092989bc0b95331875 Sylvain BERTRAND 2021-01-15 02:01:16
npa: buffering 9b2ec327646a289dae3e4cbb31b4857bf612d7e2 Sylvain BERTRAND 2020-11-06 17:20:56
npa: tons of love 68a79110ca4a6f5bdb41ed90e421b6f46c1c1877 Sylvain BERTRAND 2020-11-06 15:20:13
npv: spurious unsigned 5b4e039ffd921438a37112f0b4108480366f4d6d Sylvain BERTRAND 2020-11-06 04:31:18
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
Commit 9e772be0d5e19dc4dcef05ee2b4ce47c42788f8e - npv: inverted resync logic and rate limiter
Author: Sylvain BERTRAND
Author date (UTC): 2021-05-16 18:06
Committer name: Sylvain BERTRAND
Committer date (UTC): 2021-05-16 18:06
Parent(s): 544ddd3381ad56363bb275ae59419e97e8c86895
Signer:
Signing key:
Signing status: N
Tree: 351ad97dd861ff934aa30d7c8f00fcff6f564e17
File Lines added Lines deleted
npv/config.h 5 0
npv/pipeline/local/code.frag.c 28 1
npv/pipeline/local/state.frag.c 1 0
npv/pipeline/namespace/main.c 4 0
npv/pipeline/public/code.frag.c 1 0
npv/video/local/code.frag.c 1 1
File npv/config.h changed (mode: 100644) (index 090af26..fea4c64)
... ... struct npv_x11_bind_t npv_x11_binds[] = {
85 85 * a time window based on the following value. * a time window based on the following value.
86 86 */ */
87 87 #define DISCONT_BACKWARD_RESYNC_MS 500 #define DISCONT_BACKWARD_RESYNC_MS 500
88 /*
89 * the rate limiter while resyncing, since it can flood memory. We target 16 ms
90 * or 60 fps
91 */
92 #define RESYNC_RATE_LIMITER_MS 16
88 93 #endif #endif
File npv/pipeline/local/code.frag.c changed (mode: 100644) (index aac6b3d..4ab9aec)
... ... STATIC void *audio_thd_entry(void *arg)
141 141 audio(); audio();
142 142 /* unreachable */ /* unreachable */
143 143 } }
144 /* will return true to block, false to let it pass */
145 STATIC bool rate_limiter_do_block(void)
146 {
147 int r;
148 struct timespec current_tp;
149 s64 current;
150 s64 previous;
151
152 memset(&current_tp, 0, sizeof(current_tp));
153 r = clock_gettime(CLOCK_MONOTONIC, &current_tp);
154 if (r == -1)
155 return false; /* error, let it pass */
156 previous = (s64)rate_limiter_previous_tp.tv_sec * 1000 +
157 (s64)rate_limiter_previous_tp.tv_nsec / 1000000;
158 current = (s64)current_tp.tv_sec * 1000
159 + (s64)current_tp.tv_nsec / 1000000;
160 #ifdef NPV_DEBUG
161 if (npv_debug_p)
162 npv_perr("DEBUG:%s:delta=%ld\n", __func__, current - previous);
163 #endif
164 if ((current - previous) <= RESYNC_RATE_LIMITER_MS)
165 return true;
166 memcpy(&rate_limiter_previous_tp, &current_tp, sizeof(current_tp));
167 return false;
168 }
144 169 /* /*
145 170 * predecoded video frs are expensive from the perspectives of the cpu and the * predecoded video frs are expensive from the perspectives of the cpu and the
146 171 * mem hierarchy. * mem hierarchy.
 
... ... STATIC bool have_enough_predecoded_video_frs(void)
158 183 * We are looking for a "resyncing" fr, and to secure we * We are looking for a "resyncing" fr, and to secure we
159 184 * receive one, we must decode more frs or the dec frs a * receive one, we must decode more frs or the dec frs a
160 185 * may endup full and dead locked. * may endup full and dead locked.
186 * In pratice, this can burst mem with frs, let's rate
187 * limit it 16 ms (~60fps).
161 188 */ */
162 r = false;
189 r = rate_limiter_do_block();
163 190 else if (npv_video_dec_frs_p.n < DEC_FRS_ARRAY_N_MAX) { else if (npv_video_dec_frs_p.n < DEC_FRS_ARRAY_N_MAX) {
164 191 r = false; r = false;
165 192 } else /* >= DEC_FRS_ARRAY_N_MAX && ! RESYNCING */ } else /* >= DEC_FRS_ARRAY_N_MAX && ! RESYNCING */
File npv/pipeline/local/state.frag.c changed (mode: 100644) (index c537fb4..a8c0388)
1 1 STATIC avcodec_pkt_ref_t *eof_pkt_l; STATIC avcodec_pkt_ref_t *eof_pkt_l;
2 STATIC struct timespec rate_limiter_previous_tp;
File npv/pipeline/namespace/main.c changed (mode: 100644) (index df1bddf..d303c84)
12 12 #define have_enough_predecoded_audio_frs npv_pipeline_have_enough_predecoded_audio_frs #define have_enough_predecoded_audio_frs npv_pipeline_have_enough_predecoded_audio_frs
13 13 #define have_enough_predecoded_video_frs npv_pipeline_have_enough_predecoded_video_frs #define have_enough_predecoded_video_frs npv_pipeline_have_enough_predecoded_video_frs
14 14 #define pout npv_pipeline_pout #define pout npv_pipeline_pout
15 #define rate_limiter_do_block npv_pipeline_rate_limiter_do_block
16 #define rate_limiter_previous_tp npv_pipeline_rate_limiter_previous_tp
15 17 #define read npv_pipeline_read #define read npv_pipeline_read
16 18 #define read_thd_entry npv_pipeline_read_thd_entry #define read_thd_entry npv_pipeline_read_thd_entry
17 19 #define timer_ack npv_pipeline_timer_ack #define timer_ack npv_pipeline_timer_ack
 
28 30 #undef have_enough_predecoded_audio_frs #undef have_enough_predecoded_audio_frs
29 31 #undef have_enough_predecoded_video_frs #undef have_enough_predecoded_video_frs
30 32 #undef pout #undef pout
33 #undef rate_limiter_do_block
34 #undef rate_limiter_previous_tp
31 35 #undef read #undef read
32 36 #undef read_thd_entry #undef read_thd_entry
33 37 #undef timer_ack #undef timer_ack
File npv/pipeline/public/code.frag.c changed (mode: 100644) (index f522590..bc341e7)
... ... STATIC void init_once(void)
38 38 r = pthread_mutex_init(&limits_p.mutex, 0); r = pthread_mutex_init(&limits_p.mutex, 0);
39 39 if (r != 0) if (r != 0)
40 40 fatal("unable to initialize the mutex to guard the accounting of limits\n"); fatal("unable to initialize the mutex to guard the accounting of limits\n");
41 memset(&rate_limiter_previous_tp, 0, sizeof(rate_limiter_previous_tp));
41 42 } }
42 43 STATIC void limits_lock(void) STATIC void limits_lock(void)
43 44 { {
File npv/video/local/code.frag.c changed (mode: 100644) (index 20a1a18..292835d)
... ... STATIC void discont_backward(s64 now)
748 748 if (dec_frs_p.discont_backward.prev_now != AV_NOPTS_VALUE if (dec_frs_p.discont_backward.prev_now != AV_NOPTS_VALUE
749 749 && now < dec_frs_p.discont_backward.prev_now) && now < dec_frs_p.discont_backward.prev_now)
750 750 dec_frs_p.discont_backward.resyncing = true; dec_frs_p.discont_backward.resyncing = true;
751 if (dec_frs_p.discont_backward.resyncing)
751 if (!dec_frs_p.discont_backward.resyncing)
752 752 goto exit; goto exit;
753 753 #ifdef NPV_DEBUG #ifdef NPV_DEBUG
754 754 if (npv_debug_p) if (npv_debug_p)
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