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: live mode and ready the code for indicators.. if ever... 2d6ddb83edd6f08e99fbe01dc60a354b5e5a2afe Sylvain BERTRAND 2021-07-23 13:17:47
npv: don't block the muted state 0c29e9329ec5db6bed191b2b4caffff8166bd11f Sylvain BERTRAND 2021-07-21 21:34:37
npv: now we have enough perspective, make states internal 62f6b1bf62fc083762f036ddde1f29dd23baf814 Sylvain BERTRAND 2021-07-21 20:12:36
npv/npa: add gcc4 atomic support d9676b20984dcbfd8df4afbf85178c8ff4295e4f Sylvain BERTRAND 2021-06-18 15:04:01
npv: better reuse of ffmpeg references, stats 4bb1b9ab45609f8e5113cc7613ebc1d09499561b Sylvain BERTRAND 2021-05-20 18:24:32
npv: avoid stale frames fb20683b7cb91622b639b05e8b324d13edc72522 Sylvain BERTRAND 2021-05-16 20:51:34
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
Commit 2d6ddb83edd6f08e99fbe01dc60a354b5e5a2afe - npv: live mode and ready the code for indicators.. if ever...
Author: Sylvain BERTRAND
Author date (UTC): 2021-07-23 13:17
Committer name: Sylvain BERTRAND
Committer date (UTC): 2021-07-23 13:17
Parent(s): 0c29e9329ec5db6bed191b2b4caffff8166bd11f
Signer:
Signing key:
Signing status: N
Tree: fc401195ae13bd1c422fe84193e76be8a9918405
File Lines added Lines deleted
npv/local/code.frag.c 28 9
npv/namespace/public.h 2 0
npv/public/state.frag.h 3 1
npv/video/namespace/main.c 4 0
npv/video/public/code.frag.c 25 12
File npv/local/code.frag.c changed (mode: 100644) (index 72c1ff8..5540b8c)
... ... STATIC void usage(void)
430 430
431 431 pout("\ pout("\
432 432 npv [-f send a fullscreen message to the window manager at start]\n\ npv [-f send a fullscreen message to the window manager at start]\n\
433 [-l live mode (seek/pause are disabled)]\n\
433 434 [-p alsa pcm]\n\ [-p alsa pcm]\n\
434 435 [-fc override initial ffmpeg count of channels used to approximate the alsa\n\ [-fc override initial ffmpeg count of channels used to approximate the alsa\n\
435 436 pcm configuration]\n\ pcm configuration]\n\
 
... ... the ffmpeg audio frame formats which intersect alsa pcm audio formats are:\n"
454 455 ++fmt; ++fmt;
455 456 } }
456 457 } }
457 STATIC void opts_parse(int argc, u8 **args, u8 **url, bool* start_fullscreen,
458 u16 *w, u16 *h, u8 **pcm_str, int *override_initial_ff_chans_n,
459 int *override_initial_ff_rate,
458 STATIC void opts_parse(int argc, u8 **args, u8 **url, bool *live,
459 bool* start_fullscreen, u16 *w, u16 *h, u8 **pcm_str,
460 int *override_initial_ff_chans_n, int *override_initial_ff_rate,
460 461 enum avutil_audio_fr_fmt_t *override_initial_ff_audio_fr_fmt, enum avutil_audio_fr_fmt_t *override_initial_ff_audio_fr_fmt,
461 462 double *vol, u8 *pkts_prefill_percent) double *vol, u8 *pkts_prefill_percent)
462 463 { {
 
... ... STATIC void opts_parse(int argc, u8 **args, u8 **url, bool* start_fullscreen,
471 472 if (strcmp("-f", args[i]) == 0) { if (strcmp("-f", args[i]) == 0) {
472 473 *start_fullscreen = true; *start_fullscreen = true;
473 474 ++i; ++i;
475 } else if (strcmp("-l", args[i]) == 0) {
476 *live = true;
477 ++i;
474 478 } else if (strcmp("-v", args[i]) == 0) { } else if (strcmp("-v", args[i]) == 0) {
475 479 unsigned long vol_ul; unsigned long vol_ul;
476 480
 
... ... STATIC void states_init_once(void)
606 610 #undef PREFILL #undef PREFILL
607 611 #define WIDTH_NOT_DEFINED 0 #define WIDTH_NOT_DEFINED 0
608 612 #define HEIGHT_NOT_DEFINED 0 #define HEIGHT_NOT_DEFINED 0
609 STATIC void init_once(u8 *url, bool start_fullscreen, double initial_vol,
610 u16 win_width, u16 win_height, u8 *pcm_str,
613 STATIC void init_once(u8 *url, bool live, bool start_fullscreen,
614 double initial_vol, u16 win_width, u16 win_height, u8 *pcm_str,
611 615 avcodec_params_t **audio_codec_params, avcodec_params_t **audio_codec_params,
612 616 avcodec_params_t **video_codec_params, avcodec_params_t **video_codec_params,
613 617 u8 **faces) u8 **faces)
 
... ... STATIC void init_once(u8 *url, bool start_fullscreen, double initial_vol,
615 619 avutil_rational_t *audio_st_tb; avutil_rational_t *audio_st_tb;
616 620 avutil_rational_t *video_st_tb; avutil_rational_t *video_st_tb;
617 621
622 live_p = live;
618 623 states_init_once(); states_init_once();
619 624 evt_init_once(); evt_init_once();
620 625 sigs_init_once(); sigs_init_once();
 
... ... STATIC void seek_x(s64 delta)
704 709 warning("seek:audio is draining, seeking disable\n"); warning("seek:audio is draining, seeking disable\n");
705 710 return; return;
706 711 } }
707 if (paused_p) /* we don't seek in pause */
712 if (paused_p) {/* we don't seek in pause */
713 warning("seek:disabled while paused\n");
714 return;
715 }
716 if (live_p) {/* we don't seek in live mode */
717 warning("seek:disabled in live mode\n");
708 718 return; return;
719 }
709 720
710 721 npv_thdsws_wait_for_idle(npv_video_scaler_p.ctx); npv_thdsws_wait_for_idle(npv_video_scaler_p.ctx);
711 722
 
... ... STATIC void npv_cmd_pause(void)
789 800 warning("pause:audio is draining, toggling pause is disable\n"); warning("pause:audio is draining, toggling pause is disable\n");
790 801 return; return;
791 802 } }
803 if (live_p) {
804 warning("pause:disabled in live mode\n");
805 return;
806 }
792 807 if (paused_p) { if (paused_p) {
793 808 int r; int r;
794 809
 
... ... STATIC void npv_cmd_mute(void)
830 845 #define AUDIO_FR_FMT_NOT_OVERRIDDEN AVUTIL_AUDIO_FR_FMT_NONE #define AUDIO_FR_FMT_NOT_OVERRIDDEN AVUTIL_AUDIO_FR_FMT_NONE
831 846 int main(int argc, u8 **args) int main(int argc, u8 **args)
832 847 { {
848 bool live;
833 849 bool start_fullscreen; bool start_fullscreen;
834 850 u16 win_width; u16 win_width;
835 851 u16 win_height; u16 win_height;
 
... ... int main(int argc, u8 **args)
858 874 #ifdef NPV_DEBUG #ifdef NPV_DEBUG
859 875 npv_debug_p = false; npv_debug_p = false;
860 876 #endif #endif
877 live = false;
861 878 start_fullscreen = false; start_fullscreen = false;
862 879 win_width = WIDTH_NOT_DEFINED; win_width = WIDTH_NOT_DEFINED;
863 880 win_height = HEIGHT_NOT_DEFINED; win_height = HEIGHT_NOT_DEFINED;
 
... ... int main(int argc, u8 **args)
869 886 url = 0; url = 0;
870 887 initial_vol = 1.; initial_vol = 1.;
871 888 npv_pipeline_limits_p.pkts.prefill.percent = 0; npv_pipeline_limits_p.pkts.prefill.percent = 0;
872 opts_parse(argc, args, &url, &start_fullscreen, &win_width, &win_height,
889 opts_parse(argc, args, &url, &live, &start_fullscreen,
890 &win_width, &win_height,
873 891 &pcm_str, &override_initial_ff_chans_n, &pcm_str, &override_initial_ff_chans_n,
874 892 &override_initial_ff_rate, &override_initial_ff_rate,
875 893 &override_initial_ff_audio_fr_fmt, &override_initial_ff_audio_fr_fmt,
876 894 &initial_vol, &initial_vol,
877 895 &npv_pipeline_limits_p.pkts.prefill.percent); &npv_pipeline_limits_p.pkts.prefill.percent);
878 init_once(url, start_fullscreen, initial_vol, win_width, win_height,
879 pcm_str, &audio_codec_params, &video_codec_params, npv_faces);
896 init_once(url, live, start_fullscreen, initial_vol, win_width,
897 win_height, pcm_str, &audio_codec_params, &video_codec_params,
898 npv_faces);
880 899 prepare(initial_vol, override_initial_ff_chans_n, prepare(initial_vol, override_initial_ff_chans_n,
881 900 override_initial_ff_rate, override_initial_ff_audio_fr_fmt, override_initial_ff_rate, override_initial_ff_audio_fr_fmt,
882 901 npv_pipeline_limits_p.pkts.prefill.percent, audio_codec_params, npv_pipeline_limits_p.pkts.prefill.percent, audio_codec_params,
File npv/namespace/public.h changed (mode: 100644) (index 4b6e7a4..fecb290)
2 2 #define ep_fd_p npv_ep_fd_p #define ep_fd_p npv_ep_fd_p
3 3 #define exit_ok npv_exit #define exit_ok npv_exit
4 4 #define fatal npv_fatal #define fatal npv_fatal
5 #define live_p npv_live_p
5 6 #define paused_p npv_paused_p #define paused_p npv_paused_p
6 7 #define perr npv_perr #define perr npv_perr
7 8 #define pout npv_pout #define pout npv_pout
 
18 19 #undef ep_fd_p #undef ep_fd_p
19 20 #undef exit_ok #undef exit_ok
20 21 #undef fatal #undef fatal
22 #undef live_p
21 23 #undef paused_p #undef paused_p
22 24 #undef perr #undef perr
23 25 #undef pout #undef pout
File npv/public/state.frag.h changed (mode: 100644) (index 0718abb..1aee75a)
1 1 STATIC int ep_fd_p; STATIC int ep_fd_p;
2 /* major states -- START -----------------------------------------------------------*/
2 /* major states -- START -----------------------------------------------------*/
3 3 /* we first prefill, then predecode, and then run/pause */ /* we first prefill, then predecode, and then run/pause */
4 4 /* /*
5 5 * 0 none * 0 none
 
... ... STATIC atomic_u8 pre_x_p;
10 10 STATIC int pre_x_timer_fd_p; STATIC int pre_x_timer_fd_p;
11 11 STATIC bool prefill_chk_do_p; /* currently, only accessed by the main loop */ STATIC bool prefill_chk_do_p; /* currently, only accessed by the main loop */
12 12 STATIC bool paused_p; STATIC bool paused_p;
13 /*NSPC*/
14 STATIC bool live_p; /* disable seek and pause */
13 15 /* states -- END -----------------------------------------------------------*/ /* states -- END -----------------------------------------------------------*/
14 16 #ifdef NPV_DEBUG #ifdef NPV_DEBUG
15 17 STATIC bool npv_debug_p; STATIC bool npv_debug_p;
File npv/video/namespace/main.c changed (mode: 100644) (index 1a5ae0e..91c569b)
24 24 #define img_mem_barrier_run_once npv_video_img_mem_barrier_run_once #define img_mem_barrier_run_once npv_video_img_mem_barrier_run_once
25 25 #define init_once_local npv_video_init_once_local #define init_once_local npv_video_init_once_local
26 26 #define init_once_public npv_video_init_once_public #define init_once_public npv_video_init_once_public
27 #define interrupted_rendering npv_video_iinterrupted_rendering
27 28 #define is_swpchn_sem_consistent npv_video_is_swpchn_sem_consistent #define is_swpchn_sem_consistent npv_video_is_swpchn_sem_consistent
28 29 #define is_swpchn_sem_fence_submitted_l npv_video_is_swpchn_sem_fence_submitted_l #define is_swpchn_sem_fence_submitted_l npv_video_is_swpchn_sem_fence_submitted_l
29 30 #define last_fr_sent_to_pe_l npv_video_last_fr_sent_to_pe_l #define last_fr_sent_to_pe_l npv_video_last_fr_sent_to_pe_l
30 31 #define match_mem_type npv_video_match_mem_type #define match_mem_type npv_video_match_mem_type
32 #define normal_rendering npv_video_normal_rendering
31 33 #define poutff npv_video_poutff #define poutff npv_video_poutff
32 34 #define receive_fr_l npv_video_receive_fr_l #define receive_fr_l npv_video_receive_fr_l
33 35 #define scaler_img_create npv_video_scaler_img_create #define scaler_img_create npv_video_scaler_img_create
 
74 76 #undef img_mem_barrier_run_once #undef img_mem_barrier_run_once
75 77 #undef init_once_local #undef init_once_local
76 78 #undef init_once_public #undef init_once_public
79 #undef interrupted_rendering
77 80 #undef is_swpchn_sem_consistent #undef is_swpchn_sem_consistent
78 81 #undef is_swpchn_sem_fence_submitted_l #undef is_swpchn_sem_fence_submitted_l
79 82 #undef last_fr_sent_to_pe_l #undef last_fr_sent_to_pe_l
80 83 #undef match_mem_type #undef match_mem_type
84 #undef normal_rendering
81 85 #undef poutff #undef poutff
82 86 #undef receive_fr_l #undef receive_fr_l
83 87 #undef scaler_img_create #undef scaler_img_create
File npv/video/public/code.frag.c changed (mode: 100644) (index 5636117..fe609ce)
... ... STATIC void dec_frs_unlock(void)
199 199 #define READY 0 #define READY 0
200 200 #define NOT_READY 1 #define NOT_READY 1
201 201 #define SENT 0 #define SENT 0
202 #define NONE 0
203 202 /* XXX: we do want to lock the frs q the least amount of time as possible */ /* XXX: we do want to lock the frs q the least amount of time as possible */
204 STATIC void timer_evt(void)
203 STATIC void normal_rendering(void)
205 204 { {
206 u8 pre_x;
207 205 u8 r; u8 r;
208 206 s64 now; s64 now;
209 207 avutil_video_fr_ref_t *fr; avutil_video_fr_ref_t *fr;
210 208 struct dec_fr_priv_t *fr_priv; struct dec_fr_priv_t *fr_priv;
211 209 u32 swpchn_img; u32 swpchn_img;
212 210
213 timer_ack();
214 /*
215 * XXX: it is how that pre[fill|decode] indicators should be implemented
216 */
217 pre_x = atomic_load(&npv_pre_x_p);
218 if (pre_x != NONE)
219 return;
220 211 r = npv_clk_get_video_st_ts(&now); r = npv_clk_get_video_st_ts(&now);
221 212 if (r != TS_FROM_CLK_OK) if (r != TS_FROM_CLK_OK)
222 213 return; return;
 
... ... STATIC void timer_evt(void)
243 234 return; return;
244 235 } }
245 236 if (npv_paused_p) if (npv_paused_p)
246 npv_video_osd_rop_restore();
247 npv_video_osd_rop_blend(now);
237 npv_video_osd_rop_restore(); /* subtitles will happen here */
238 npv_video_osd_rop_blend(now); /* subtitles will happen here */
248 239 if (!is_swpchn_sem_consistent()) if (!is_swpchn_sem_consistent())
249 240 return; return;
250 241 loop { /* because the swpchn can change for many reasons */ loop { /* because the swpchn can change for many reasons */
 
... ... STATIC void timer_evt(void)
265 256 #undef READY #undef READY
266 257 #undef NOT_READY #undef NOT_READY
267 258 #undef SENT #undef SENT
259 STATIC void interrupted_rendering(void)
260 {
261 /*
262 * XXX: it is where that pre[fill|decode] indicators ("interrupted")
263 * should be implemented with with an alternative code path. Here,
264 * merging "normal" and "interrupted" code path would probably lead to
265 * excessive code factorization at a pathological scale.
266 */
267 return;
268 }
269 #define NONE 0
270 STATIC void timer_evt(void)
271 {
272 u8 pre_x;
273
274 timer_ack();
275 pre_x = atomic_load(&npv_pre_x_p);
276 if (pre_x == NONE)
277 normal_rendering();
278 else /* pre[fill|decode] */
279 interrupted_rendering();
280 }
268 281 #undef NONE #undef NONE
269 282 /* we do per-loop fine-grained locking */ /* we do per-loop fine-grained locking */
270 283 #define sz size #define sz size
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