File npv/TODO changed (mode: 100644) (index 57e3367..db368e4) |
1 |
1 |
not ordered: |
not ordered: |
2 |
|
- we were lied to: presentation/decoding timestamps from a demuxer can be |
|
3 |
|
discontinuous without any warning. |
|
4 |
|
- forced monotonic video frame selection? may be, probably, more robust in |
|
5 |
|
regard to latency spikes. |
|
6 |
2 |
- "buffering" indicator (no)? subtitles (mmmmh...)? |
- "buffering" indicator (no)? subtitles (mmmmh...)? |
7 |
3 |
- use vulkan shaders (no glsl or hlsl), compute or not, in order to perform |
- use vulkan shaders (no glsl or hlsl), compute or not, in order to perform |
8 |
4 |
some yuvX pixel formats to srgb format conversions. do NOT use the vulkan |
some yuvX pixel formats to srgb format conversions. do NOT use the vulkan |
File npv/config.h changed (mode: 100644) (index e28b352..2628bde) |
... |
... |
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 |
|
/*----------------------------------------------------------------------------*/ |
|
65 |
|
/* kinky internal settings, modify with care */ |
|
66 |
|
/* the count of decoded video frames in the array, it is "expensive" */ |
|
67 |
|
#define DEC_FRS_ARRAY_N_MAX 4 |
64 |
68 |
#endif |
#endif |
File npv/pipeline/local/code.frag.c changed (mode: 100644) (index 52d64ed..bef6d57) |
... |
... |
STATIC void *audio_thd_entry(void *arg) |
144 |
144 |
/* |
/* |
145 |
145 |
* 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 |
146 |
* mem hierarchy. |
* mem hierarchy. |
147 |
|
* 1920 * 1080 * 4 bytes = 8MB. I like powers of 2, then 4. |
|
|
147 |
|
* 1920 * 1080 * 4 bytes = 8MB. we like powers of 2. |
148 |
148 |
*/ |
*/ |
149 |
149 |
STATIC bool have_enough_predecoded_video_frs(void) |
STATIC bool have_enough_predecoded_video_frs(void) |
150 |
150 |
{ |
{ |
|
... |
... |
STATIC bool have_enough_predecoded_video_frs(void) |
153 |
153 |
npv_video_dec_frs_lock(); |
npv_video_dec_frs_lock(); |
154 |
154 |
if (npv_video_dec_frs_p.eof_receive) { |
if (npv_video_dec_frs_p.eof_receive) { |
155 |
155 |
r = true; |
r = true; |
156 |
|
} else if (npv_video_dec_frs_p.n < 4) { |
|
|
156 |
|
} else if (npv_video_dec_frs_p.n < DEC_FRS_ARRAY_N_MAX) { |
157 |
157 |
r = false; |
r = false; |
158 |
158 |
} else /* >= 4 */ |
} else /* >= 4 */ |
159 |
159 |
r = true; |
r = true; |
File npv/video/local/code.frag.c changed (mode: 100644) (index 7bc1a4c..758aaf2) |
... |
... |
STATIC void warningvk(u8 *fmt, ...) |
52 |
52 |
npv_vk_vwarning(fmt, ap); |
npv_vk_vwarning(fmt, ap); |
53 |
53 |
va_end(ap); |
va_end(ap); |
54 |
54 |
} |
} |
|
55 |
|
#define NONE 0 |
55 |
56 |
STATIC void init_once_local(void) |
STATIC void init_once_local(void) |
56 |
57 |
{ |
{ |
57 |
58 |
u8 i; |
u8 i; |
|
... |
... |
STATIC void init_once_local(void) |
76 |
77 |
receive_fr_l = avutil_video_fr_ref_alloc(); |
receive_fr_l = avutil_video_fr_ref_alloc(); |
77 |
78 |
is_swpchn_sem_fence_submitted_l = false; |
is_swpchn_sem_fence_submitted_l = false; |
78 |
79 |
} |
} |
|
80 |
|
#undef NONE |
79 |
81 |
STATIC void scaler_img_create(avutil_video_fr_ref_t *fr) |
STATIC void scaler_img_create(avutil_video_fr_ref_t *fr) |
80 |
82 |
{ |
{ |
81 |
83 |
struct vk_img_create_info_t info; |
struct vk_img_create_info_t info; |
|
... |
... |
STATIC void fr_drop(u16 fr) |
330 |
332 |
} |
} |
331 |
333 |
#undef NO_FR |
#undef NO_FR |
332 |
334 |
#define NO_FR 0 |
#define NO_FR 0 |
333 |
|
STATIC void frs_drop(s64 now) |
|
|
335 |
|
STATIC void frs_drop(avutil_video_fr_ref_t *selected_fr) |
334 |
336 |
{ |
{ |
335 |
|
s64 low; |
|
336 |
|
s64 threshold; |
|
337 |
337 |
u16 fr; |
u16 fr; |
338 |
338 |
|
|
339 |
|
/* |
|
340 |
|
* https://en.wikipedia.org/wiki/Audio_to_video_synchronization |
|
341 |
|
* we need to make room in the dec a of predecoded frs, based on the |
|
342 |
|
* previous url (20200922), we abitrary choose -30ms. |
|
343 |
|
*/ |
|
344 |
|
threshold = (30 * st_p.tb.den) / (st_p.tb.num * 1000); |
|
345 |
|
low = now - threshold; |
|
|
339 |
|
if (selected_fr == NO_FR) |
|
340 |
|
return; |
|
341 |
|
/* drop as many of as possible frames received before the selected one */ |
346 |
342 |
fr = 0; |
fr = 0; |
347 |
343 |
loop { |
loop { |
348 |
|
s64 pts; |
|
349 |
|
struct dec_fr_priv_t *fr_priv; |
|
350 |
|
|
|
351 |
|
if (dec_frs_p.n == fr) |
|
|
344 |
|
if (dec_frs_p.a[fr] == selected_fr) |
352 |
345 |
break; |
break; |
353 |
|
|
|
354 |
|
pts = dec_frs_p.a[fr]->pts; |
|
355 |
|
fr_priv = dec_frs_p.priv_a[fr]; |
|
356 |
346 |
/* keep the fr the scaler is related to */ |
/* keep the fr the scaler is related to */ |
357 |
|
if ((dec_frs_p.a[fr] != scaler_p.img.fr) && (pts < low)) { |
|
|
347 |
|
if (dec_frs_p.a[fr] != scaler_p.img.fr) { |
358 |
348 |
if (dec_frs_p.a[fr] == last_fr_sent_to_pe_l) |
if (dec_frs_p.a[fr] == last_fr_sent_to_pe_l) |
359 |
349 |
last_fr_sent_to_pe_l = NO_FR; |
last_fr_sent_to_pe_l = NO_FR; |
360 |
350 |
fr_drop(fr); /* do not advance */ |
fr_drop(fr); /* do not advance */ |