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:osd:timer glyph size change 38787582262a2c4cd08d29384f928c3d86e500eb Sylvain BERTRAND 2024-05-04 22:43:43
epoll cfg done at the wrong time c275849395c9c772d293c0e02216ff3f94bd1899 Sylvain BERTRAND 2023-08-13 20:50:55
npv: my iap trash peering with twitch.tv wants more workaround ccdcd2048de11de3f78c8a6011824b2abdace92d Sylvain BERTRAND 2022-09-04 02:53:07
npv: move to a shared video/audio limit 53d5990ce4a87715a106095dde83e6658c3c1642 Sylvain BERTRAND 2022-08-30 17:58:39
npv: my iap hls peering with twitch.tv is accute trash 4ab8caadb41ac42482f8c7a43725054067674fe3 Sylvain BERTRAND 2022-08-30 17:17:21
npv: alsa, POLLERR is XRUN 73c89d6529123fca081c4f55d1a57eab4ede7b90 Sylvain BERTRAND 2022-06-30 15:43:27
npv: may help IAPs with bad peerings 7ec70f67d779a478f065f0e92259e52f8315d113 Sylvain BERTRAND 2022-06-30 15:42:47
move to new ffmpeg channel layout handling 938790d0c657278f405c4f57987d2274c5ada9b7 Sylvain BERTRAND 2022-03-20 22:18:01
npa: fine grained volume control 89279ea0c7dcaf7a718c9a57ecb6b08a0ccfbcb9 Sylvain BERTRAND 2022-02-15 23:24:36
npv: add fine grained volume control 06bc3b77b065f35f294659db520f66e7e8094c8c Sylvain BERTRAND 2022-02-15 18:47:34
npv: move to freetype SDF rendering 972a3027fec3b69a1e10405cc0da35b5194b6f46 Sylvain BERTRAND 2021-12-27 20:54:53
npv:osd:ascii only mode for the timer 3de3158fc3300f8a9c6f75fcca76b512331b8c2f Sylvain BERTRAND 2021-10-30 19:18:38
npv: default to dejavu instead of noto 708f3166a09fd7ba815ec47907cabfb1af4d26c5 Sylvain BERTRAND 2021-10-10 17:05:17
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
Commit 38787582262a2c4cd08d29384f928c3d86e500eb - npv:osd:timer glyph size change
The EM size can be really far from the actual glyph size, give
some adjustment super powers to the user.
Author: Sylvain BERTRAND
Author date (UTC): 2024-05-04 22:43
Committer name: Sylvain BERTRAND
Committer date (UTC): 2024-05-04 22:43
Parent(s): c275849395c9c772d293c0e02216ff3f94bd1899
Signer:
Signing key:
Signing status: N
Tree: 270d581545be71afd29cbacdcec471275fae9c45
File Lines added Lines deleted
npv/config.h 6 0
npv/video/osd/local/code.frag.c 10 8
npv/video/osd/local/state.frag.c 1 1
npv/video/osd/main.c 3 1
npv/video/osd/public/code.frag.c 19 11
File npv/config.h changed (mode: 100644) (index 6b052c1..44d737c)
... ... STATIC u8 *npv_faces[] = {
11 11 "/usr/share/fonts/dejavu/DejaVuSansMono-Bold.ttf", "/usr/share/fonts/dejavu/DejaVuSansMono-Bold.ttf",
12 12 0 0
13 13 }; };
14 /*
15 * face em square pixel size can be very far from actual glyph size, then
16 * give the user some adjustment super powers
17 */
18 STATIC u8 npv_em_adjust_numerator = 3;
19 STATIC u8 npv_em_adjust_denominator = 2;
14 20 /* for missing play/pause glyphs */ /* for missing play/pause glyphs */
15 21 #define NPV_FACES_ASCII_ONLY 1 #define NPV_FACES_ASCII_ONLY 1
16 22 /* we don't use a xkb state machine, only bear 8bits truncated raw keycodes */ /* we don't use a xkb state machine, only bear 8bits truncated raw keycodes */
File npv/video/osd/local/code.frag.c changed (mode: 100644) (index 89e7c43..04dad3c)
... ... STATIC bool duration_resolve(int64_t *duration, avutil_rational_t *tb)
328 328 STATIC u8 *timer_to_gs(int64_t ts, avutil_rational_t tb) STATIC u8 *timer_to_gs(int64_t ts, avutil_rational_t tb)
329 329 { {
330 330 /* P = Play, S = minus Sign */ /* P = Play, S = minus Sign */
331 static u8 gs[sizeof(TIMER_TMPL)];
331 static u8 gs[sizeof(TIMER_TMPL_MAX)];
332 332 u8 i; u8 i;
333 333 bool is_neg; bool is_neg;
334 334 int64_t remaining; int64_t remaining;
 
... ... STATIC void g_x(bool mode, FT_BitmapGlyph gb, struct pen_t *p)
499 499
500 500 gb_sdf = gb->bitmap.buffer + gb->bitmap.pitch gb_sdf = gb->bitmap.buffer + gb->bitmap.pitch
501 501 * gb_y + gb_x; * gb_y + gb_x;
502 /* the default spread is 2 pixels */
503 if (161 <= *gb_sdf && *gb_sdf <= 255)
504 pix_do(mode, 0xff, 0xff, 0xff,
505 scaler_pix, restore_pix);
506 else if (128 <= *gb_sdf && *gb_sdf <= 160)
507 pix_do(mode, 0, 0, 0, scaler_pix,
502 /* the spread is 2 pixels */
503 if (128 <= *gb_sdf) {
504 if (*gb_sdf < 192)
505 pix_do(mode, 0, 0, 0, scaler_pix,
508 506 restore_pix); restore_pix);
507 else
508 pix_do(mode, 0xff, 0xff, 0xff,
509 scaler_pix, restore_pix);
510 }
509 511 } }
510 512 ++gb_x; ++gb_x;
511 513 ++x; ++x;
 
... ... STATIC void rop_x(u8 mode, u8 *gs)
522 524 u8 i; u8 i;
523 525
524 526 if (mode == BLEND) if (mode == BLEND)
525 memcpy(restore_l.timer_gs, gs, sizeof(TIMER_TMPL));
527 memcpy(restore_l.timer_gs, gs, sizeof(TIMER_TMPL_MAX));
526 528 pen.x = 0; pen.x = 0;
527 529 pen.y = timer_baseline_l; pen.y = timer_baseline_l;
528 530 i = 0; i = 0;
File npv/video/osd/local/state.frag.c changed (mode: 100644) (index a3779db..9ed3cc3)
... ... STATIC struct {
35 35 s16 width; s16 width;
36 36 s16 height; s16 height;
37 37 u32 line_bytes_n; u32 line_bytes_n;
38 u8 timer_gs[sizeof(TIMER_TMPL)];
38 u8 timer_gs[sizeof(TIMER_TMPL_MAX)];
39 39 bool dirty; bool dirty;
40 40 } restore_l; } restore_l;
41 41 STATIC bool timer_on; STATIC bool timer_on;
File npv/video/osd/main.c changed (mode: 100644) (index 8994469..677d0b3)
44 44 #define G_GREATER_THAN 18 #define G_GREATER_THAN 18
45 45 #define G_VERTICAL_BAR 19 #define G_VERTICAL_BAR 19
46 46 #define GS_N 20 #define GS_N 20
47 #define TIMER_TMPL "PS00:00:00/00:00:00"
47 #define TIMER_TMPL_MAX "PPS00:00:00/00:00:00"
48 #define TIMER_GS_N_MAX 20
48 49 /*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
49 50 #include "npv/video/osd/local/state.frag.c" #include "npv/video/osd/local/state.frag.c"
50 51 /*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
 
71 72 #undef G_BLACK_LOWER_RIGHT_TRIANGLE #undef G_BLACK_LOWER_RIGHT_TRIANGLE
72 73 #undef GS_N #undef GS_N
73 74 #undef TIMER_TMPL #undef TIMER_TMPL
75 #undef TIMER_TMPL_GS_N
74 76 /*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
75 77 #define CLEANUP #define CLEANUP
76 78 #include "npv/namespace/ffmpeg.h" #include "npv/namespace/ffmpeg.h"
File npv/video/osd/public/code.frag.c changed (mode: 100644) (index 123905d..eb5ba94)
... ... STATIC void init_once(u8 **faces_files)
92 92 STATIC void update_dimensions(void *scaler_pixs, u16 width, u16 height, STATIC void update_dimensions(void *scaler_pixs, u16 width, u16 height,
93 93 u32 line_bytes_n) u32 line_bytes_n)
94 94 { {
95 static const FT_Int sdf_cfg_spread = 2;
96 static const FT_Int sdf_cfg_flip_sign = 0;
97 static const FT_Bool sdf_cfg_overlaps = (FT_Bool)false;
95 98 FT_Error ft_r; FT_Error ft_r;
96 99 FT_Face f; FT_Face f;
97 100 FTC_ScalerRec scaler_rec; FTC_ScalerRec scaler_rec;
 
... ... STATIC void update_dimensions(void *scaler_pixs, u16 width, u16 height,
102 105 * choices which may end up in the config file: * choices which may end up in the config file:
103 106 * XXX: ascender in most font files ~ em height * XXX: ascender in most font files ~ em height
104 107 */ */
105 if (height / 12 > 80)
106 scaler_rec.height = height / 12;
107 else
108 scaler_rec.height = 80;
109 scaler_rec.width = scaler_rec.height;
110 pout("scaler:em to %ux%u pixels\n", scaler_rec.width, scaler_rec.height);
108 scaler_rec.width = (FT_UInt)width / TIMER_GS_N_MAX \
109 * (FT_UInt)npv_em_adjust_numerator / (FT_UInt)npv_em_adjust_denominator;
110 scaler_rec.height = scaler_rec.width;
111 pout("scaler:heuristic:em to %ux%u pixels from width=%u pixels and user configuration\n", scaler_rec.width, scaler_rec.height, width);
111 112 i = 0; i = 0;
112 113 loop { loop {
113 114 FT_Glyph g; FT_Glyph g;
 
... ... STATIC void update_dimensions(void *scaler_pixs, u16 width, u16 height,
118 119 /* XXX: freetype cache wants ids with uniq ptrs */ /* XXX: freetype cache wants ids with uniq ptrs */
119 120 scaler_rec.face_id = scaler_rec.face_id =
120 121 &(cache_l.faces.ids[cache_l.gs[i].face_id]); &(cache_l.faces.ids[cache_l.gs[i].face_id]);
121 if (height / 12 > 80)
122 scaler_rec.height = height / 12;
123 else
124 scaler_rec.height = 80;
125 scaler_rec.width = scaler_rec.height;
122 scaler_rec.width = (FT_UInt)width / TIMER_GS_N_MAX \
123 * (FT_UInt)npv_em_adjust_numerator / (FT_UInt)npv_em_adjust_denominator;
124 scaler_rec.height = scaler_rec.width;
126 125 scaler_rec.pixel = 1; scaler_rec.pixel = 1;
127 126 /* /*
128 127 * using the SDF render mode in order to draw properly the * using the SDF render mode in order to draw properly the
129 128 * contour of glyphs * contour of glyphs
130 129 */ */
130 ft_r = FT_Property_Set(npv_video_osd_library_l, "sdf", "spread", &sdf_cfg_spread);
131 if (ft_r != FT_Err_Ok)
132 fatal("freetype:unable to set the spread property of the sdf renderer:0x%02x\n",ft_r);
133 ft_r = FT_Property_Set(npv_video_osd_library_l, "sdf", "flip_sign", &sdf_cfg_flip_sign);
134 if (ft_r != FT_Err_Ok)
135 fatal("freetype:unable to set the flip_sign property of the sdf renderer:0x%02x\n",ft_r);
136 ft_r = FT_Property_Set(npv_video_osd_library_l, "sdf", "overlaps", &sdf_cfg_overlaps);
137 if (ft_r != FT_Err_Ok)
138 fatal("freetype:unable to set the overlaps property of the sdf renderer:0x%02x\n",ft_r);
131 139 ft_r = FTC_ImageCache_LookupScaler(cache_l.img_cache, ft_r = FTC_ImageCache_LookupScaler(cache_l.img_cache,
132 140 &scaler_rec, FT_LOAD_RENDER &scaler_rec, FT_LOAD_RENDER
133 141 | FT_LOAD_TARGET_(FT_RENDER_MODE_SDF), | FT_LOAD_TARGET_(FT_RENDER_MODE_SDF),
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