File npa/npa.c changed (mode: 100644) (index e1eaab7..815cddf) |
123 |
123 |
#define av_bufsrc_add_frs_flags av_buffersrc_add_frame_flags |
#define av_bufsrc_add_frs_flags av_buffersrc_add_frame_flags |
124 |
124 |
#define AV_BUFSRC_FLAG_KEEP_REF AV_BUFFERSRC_FLAG_KEEP_REF |
#define AV_BUFSRC_FLAG_KEEP_REF AV_BUFFERSRC_FLAG_KEEP_REF |
125 |
125 |
#define AV_BUFSRC_FLAG_PUSH AV_BUFFERSRC_FLAG_PUSH |
#define AV_BUFSRC_FLAG_PUSH AV_BUFFERSRC_FLAG_PUSH |
126 |
|
#define av_codec AVCodec |
|
|
126 |
|
#define av_codec const AVCodec |
127 |
127 |
#define av_codec_ctx AVCodecContext |
#define av_codec_ctx AVCodecContext |
128 |
128 |
#define av_dump_fmt av_dump_format |
#define av_dump_fmt av_dump_format |
129 |
129 |
#define av_duration_estimation_method AVDurationEstimationMethod |
#define av_duration_estimation_method AVDurationEstimationMethod |
File npv/TODO changed (mode: 100644) (index db368e4..1e32934) |
1 |
1 |
not ordered: |
not ordered: |
|
2 |
|
- some live streams can have the audio and video unsynced up to 10 seconds with |
|
3 |
|
missing tons of video frames. |
|
4 |
|
To support those rare and horrible streams, what seems to be a reasonable |
|
5 |
|
work around: |
|
6 |
|
- always presume monotonic decoding of frames, monotonic as presentation |
|
7 |
|
order, not pts monotonic. |
|
8 |
|
- once the array of frames reached a specified limit, do buffer the |
|
9 |
|
video demuxed packets. |
|
10 |
|
- it would means that outside of transient discontinuity handling, |
|
11 |
|
usually based on the audio, only the "too old" frames would be dropped. |
2 |
12 |
- "buffering" indicator (no)? subtitles (mmmmh...)? |
- "buffering" indicator (no)? subtitles (mmmmh...)? |
3 |
13 |
- 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 |
4 |
14 |
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/audio/filt/main.c changed (mode: 100644) (index b9e009d..d16c120) |
14 |
14 |
#include <libavutil/opt.h> |
#include <libavutil/opt.h> |
15 |
15 |
#include <libavutil/channel_layout.h> |
#include <libavutil/channel_layout.h> |
16 |
16 |
#include "npv/c_fixing.h" |
#include "npv/c_fixing.h" |
|
17 |
|
/*----------------------------------------------------------------------------*/ |
|
18 |
|
#include "npv/config.h" |
|
19 |
|
/*----------------------------------------------------------------------------*/ |
17 |
20 |
#include "npv/global.h" |
#include "npv/global.h" |
18 |
21 |
#include "npv/public.h" |
#include "npv/public.h" |
19 |
22 |
#include "npv/audio/public.h" |
#include "npv/audio/public.h" |
20 |
23 |
#include "npv/audio/filt/public.h" |
#include "npv/audio/filt/public.h" |
21 |
24 |
/*----------------------------------------------------------------------------*/ |
/*----------------------------------------------------------------------------*/ |
22 |
|
#include "npv/config.h" |
|
23 |
|
/*----------------------------------------------------------------------------*/ |
|
24 |
25 |
#include "npv/namespace/ffmpeg.h" |
#include "npv/namespace/ffmpeg.h" |
25 |
26 |
#include "npv/audio/namespace/ffmpeg.h" |
#include "npv/audio/namespace/ffmpeg.h" |
26 |
27 |
#include "npv/audio/filt/namespace/public.h" |
#include "npv/audio/filt/namespace/public.h" |
File npv/config.h changed (mode: 100644) (index 1830bf5..54fc3c1) |
1 |
1 |
#ifndef NPV_CONFIG_H |
#ifndef NPV_CONFIG_H |
2 |
2 |
#define NPV_CONFIG_H |
#define NPV_CONFIG_H |
|
3 |
|
/*----------------------------------------------------------------------------*/ |
|
4 |
|
#undef NPV_DEBUG |
|
5 |
|
/*----------------------------------------------------------------------------*/ |
3 |
6 |
#include <stdlib.h> |
#include <stdlib.h> |
4 |
7 |
#include "npv/c_fixing.h" |
#include "npv/c_fixing.h" |
5 |
8 |
/* NotoSansSymbols2 is the only one with the play and pause symbols */ |
/* NotoSansSymbols2 is the only one with the play and pause symbols */ |
|
... |
... |
STATIC void npv_cmd_mute(void); |
25 |
28 |
STATIC void npv_cmd_osd_timer_toggle(void); |
STATIC void npv_cmd_osd_timer_toggle(void); |
26 |
29 |
STATIC void npv_cmd_pause(void); |
STATIC void npv_cmd_pause(void); |
27 |
30 |
STATIC void npv_cmd_fullscreen_toggle(void); |
STATIC void npv_cmd_fullscreen_toggle(void); |
|
31 |
|
#ifdef NPV_DEBUG |
|
32 |
|
STATIC void npv_cmd_debug_toggle(void); |
|
33 |
|
#endif |
28 |
34 |
/*----------------------------------------------------------------------------*/ |
/*----------------------------------------------------------------------------*/ |
29 |
35 |
/* for documentation and example */ |
/* for documentation and example */ |
30 |
36 |
#define LINUX_KEY_ESC 0x01 |
#define LINUX_KEY_ESC 0x01 |
|
... |
... |
struct npv_x11_bind_t npv_x11_binds[] = { |
50 |
56 |
X11_BIND(0x74, "arrow down", npv_cmd_vol_down), |
X11_BIND(0x74, "arrow down", npv_cmd_vol_down), |
51 |
57 |
X11_BIND(0x48, "f6", npv_cmd_mute), |
X11_BIND(0x48, "f6", npv_cmd_mute), |
52 |
58 |
X11_BIND(0x43, "f1", npv_cmd_osd_timer_toggle), |
X11_BIND(0x43, "f1", npv_cmd_osd_timer_toggle), |
53 |
|
X11_BIND(0x5f, "f11", npv_cmd_fullscreen_toggle) |
|
|
59 |
|
X11_BIND(0x5f, "f11", npv_cmd_fullscreen_toggle), |
|
60 |
|
#ifdef NPV_DEBUG |
|
61 |
|
X11_BIND(0x60, "f12", npv_cmd_debug_toggle) |
|
62 |
|
#endif |
54 |
63 |
}; |
}; |
55 |
64 |
#undef X11_BIND |
#undef X11_BIND |
56 |
65 |
#undef LINUX_KEY_ESC |
#undef LINUX_KEY_ESC |
File npv/local/code.frag.c changed (mode: 100644) (index 3f5d5c1..fedbd62) |
... |
... |
int main(int argc, u8 **args) |
783 |
783 |
setlocale(LC_ALL, ""); |
setlocale(LC_ALL, ""); |
784 |
784 |
/* av_log_set_level(AV_LOG_VERBOSE); */ |
/* av_log_set_level(AV_LOG_VERBOSE); */ |
785 |
785 |
/* av_log_set_level(AV_LOG_DEBUG); */ |
/* av_log_set_level(AV_LOG_DEBUG); */ |
|
786 |
|
#ifdef NPV_DEBUG |
|
787 |
|
npv_debug_p = false; |
|
788 |
|
#endif |
786 |
789 |
start_fullscreen = false; |
start_fullscreen = false; |
787 |
790 |
win_width = WIDTH_NOT_DEFINED; |
win_width = WIDTH_NOT_DEFINED; |
788 |
791 |
win_height = HEIGHT_NOT_DEFINED; |
win_height = HEIGHT_NOT_DEFINED; |
File npv/main.c changed (mode: 100644) (index ffef877..01453c7) |
31 |
31 |
#include <alsa/asoundlib.h> |
#include <alsa/asoundlib.h> |
32 |
32 |
/*---------------------------------------------------------------------------*/ |
/*---------------------------------------------------------------------------*/ |
33 |
33 |
#include "npv/c_fixing.h" |
#include "npv/c_fixing.h" |
|
34 |
|
/*---------------------------------------------------------------------------*/ |
|
35 |
|
#include "config.h" |
|
36 |
|
/*---------------------------------------------------------------------------*/ |
34 |
37 |
#include "npv/global.h" |
#include "npv/global.h" |
35 |
38 |
#include "npv/public.h" |
#include "npv/public.h" |
36 |
39 |
#include "npv/fmt/public.h" |
#include "npv/fmt/public.h" |
|
51 |
54 |
#include "npv/namespace/public.h" |
#include "npv/namespace/public.h" |
52 |
55 |
#include "npv/namespace/main.c" |
#include "npv/namespace/main.c" |
53 |
56 |
/*---------------------------------------------------------------------------*/ |
/*---------------------------------------------------------------------------*/ |
54 |
|
#include "config.h" |
|
55 |
|
/*---------------------------------------------------------------------------*/ |
|
56 |
57 |
#include "npv/local/state.frag.c" |
#include "npv/local/state.frag.c" |
57 |
58 |
#include "npv/local/code.frag.c" |
#include "npv/local/code.frag.c" |
58 |
59 |
#include "npv/public/code.frag.c" |
#include "npv/public/code.frag.c" |
File npv/namespace/ffmpeg.h changed (mode: 100644) (index 1e1b61b..c3446ea) |
23 |
23 |
#define AVUTIL_NOPTS_VALUE AV_NOPTS_VALUE |
#define AVUTIL_NOPTS_VALUE AV_NOPTS_VALUE |
24 |
24 |
#define AVUTIL_PIX_FMT_RGB32 AV_PIX_FMT_RGB32 |
#define AVUTIL_PIX_FMT_RGB32 AV_PIX_FMT_RGB32 |
25 |
25 |
/*----------------------------------------------------------------------------*/ |
/*----------------------------------------------------------------------------*/ |
26 |
|
#define avcodec_codec_t AVCodec |
|
|
26 |
|
#define avcodec_codec_t const AVCodec |
27 |
27 |
#define avcodec_codec_ctx_t AVCodecContext |
#define avcodec_codec_ctx_t AVCodecContext |
28 |
28 |
#define avcodec_find_dec avcodec_find_decoder |
#define avcodec_find_dec avcodec_find_decoder |
29 |
29 |
#define avcodec_send_pkt avcodec_send_packet |
#define avcodec_send_pkt avcodec_send_packet |
File npv/video/local/code.frag.c changed (mode: 100644) (index de9a584..d6f7e54) |
... |
... |
STATIC void select_fr(s64 now, avutil_video_fr_ref_t **selected_fr, |
410 |
410 |
fr_idx = 0; |
fr_idx = 0; |
411 |
411 |
*selected_fr = NO_FR; |
*selected_fr = NO_FR; |
412 |
412 |
selected_fr_delta = S64_MAX; |
selected_fr_delta = S64_MAX; |
|
413 |
|
#ifdef NPV_DEBUG |
|
414 |
|
if (npv_debug_p) |
|
415 |
|
npv_perr("DEBUG:%s:scanning %u(max=%u) frames, now=%ld\n", __func__, dec_frs_p.n, dec_frs_p.n_max, now); |
|
416 |
|
#endif |
413 |
417 |
loop { |
loop { |
414 |
418 |
u64 delta; |
u64 delta; |
415 |
419 |
|
|
416 |
420 |
if (fr_idx == dec_frs_p.n) |
if (fr_idx == dec_frs_p.n) |
417 |
421 |
break; |
break; |
418 |
422 |
delta = s64_abs(now - (s64)dec_frs_p.a[fr_idx]->pts); |
delta = s64_abs(now - (s64)dec_frs_p.a[fr_idx]->pts); |
|
423 |
|
#ifdef NPV_DEBUG |
|
424 |
|
if (npv_debug_p) |
|
425 |
|
npv_perr("DEBUG:%s:frame %u pts=%ld delta=%lu/%lu ms\n", __func__, fr_idx, (s64)dec_frs_p.a[fr_idx]->pts, delta, (delta * (u64)st_p.tb.num * 1000) / (u64)st_p.tb.den); |
|
426 |
|
#endif |
419 |
427 |
if (delta < selected_fr_delta) { |
if (delta < selected_fr_delta) { |
420 |
428 |
*selected_fr = dec_frs_p.a[fr_idx]; |
*selected_fr = dec_frs_p.a[fr_idx]; |
421 |
429 |
*selected_fr_priv = dec_frs_p.priv_a[fr_idx]; |
*selected_fr_priv = dec_frs_p.priv_a[fr_idx]; |
File npv/xcb/main.c changed (mode: 100644) (index f0e085b..f3c324c) |
15 |
15 |
#include <xcb/xcb.h> |
#include <xcb/xcb.h> |
16 |
16 |
#include <xcb/xfixes.h> |
#include <xcb/xfixes.h> |
17 |
17 |
#include "npv/c_fixing.h" |
#include "npv/c_fixing.h" |
|
18 |
|
/*----------------------------------------------------------------------------*/ |
|
19 |
|
#include "npv/config.h" |
|
20 |
|
/*----------------------------------------------------------------------------*/ |
18 |
21 |
#include "npv/global.h" |
#include "npv/global.h" |
19 |
22 |
#include "npv/public.h" |
#include "npv/public.h" |
20 |
23 |
#include "npv/xcb/public.h" |
#include "npv/xcb/public.h" |
21 |
24 |
#include "npv/video/public.h" |
#include "npv/video/public.h" |
22 |
|
/*----------------------------------------------------------------------------*/ |
|
23 |
|
#include "npv/config.h" |
|
24 |
|
/*----------------------------------------------------------------------------*/ |
|
25 |
25 |
#include "npv/xcb/local/state.frag.c" |
#include "npv/xcb/local/state.frag.c" |
26 |
26 |
/*----------------------------------------------------------------------------*/ |
/*----------------------------------------------------------------------------*/ |
27 |
27 |
#include "npv/xcb/local/code.frag.c" |
#include "npv/xcb/local/code.frag.c" |