summaryrefslogtreecommitdiffstats
path: root/filters/f_decoder_wrapper.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-02-28 21:17:55 +0100
committerwm4 <wm4@nowhere>2020-02-29 01:23:20 +0100
commitb0b5de306387f03f7f79a34ecc7d2aaf223f180a (patch)
tree40fa6a05b16e4e79829e0acc6434edf8100f046e /filters/f_decoder_wrapper.h
parenta8f4ca587dba1c1579e20b3361196c78babab7fa (diff)
downloadmpv-b0b5de306387f03f7f79a34ecc7d2aaf223f180a.tar.bz2
mpv-b0b5de306387f03f7f79a34ecc7d2aaf223f180a.tar.xz
f_decoder_wrapper: replace most public fields with setters/getters
I may (optionally) move decoding to a separate thread in a future change. It's a bit attractive to move the entire decoder wrapper to there, so if the demuxer has a new packet, it doesn't have to wake up the main thread, and can directly wake up the decoder. (Although that's bullshit, since there's a queue in between, and libavcodec's multi-threaded decoding plays cross-threads ping pong with packets anyway. On the other hand, the main thread would still have to shuffle the packets around, so whatever, just seems like better design.) As preparation, there shouldn't be any mutable state exposed by the wrapper. But there's still a large number of corner-caseish crap, so just use setters/getters for them. This recorder thing will inherently not work, so it'll have to be disabled if threads are used. This is a bit painful, but probably still the right thing. Like speculatively pulling teeth.
Diffstat (limited to 'filters/f_decoder_wrapper.h')
-rw-r--r--filters/f_decoder_wrapper.h39
1 files changed, 18 insertions, 21 deletions
diff --git a/filters/f_decoder_wrapper.h b/filters/f_decoder_wrapper.h
index 28d9b5cb7b..51badaaabd 100644
--- a/filters/f_decoder_wrapper.h
+++ b/filters/f_decoder_wrapper.h
@@ -32,29 +32,8 @@ struct mp_decoder_wrapper {
// Filter with no input and 1 output, which returns the decoded data.
struct mp_filter *f;
- // For informational purposes.
- char *decoder_desc;
-
// Can be set by user.
struct mp_recorder_sink *recorder_sink;
- int play_dir;
-
- // --- for STREAM_VIDEO
-
- // FPS from demuxer or from user override
- float fps;
-
- // Framedrop control for playback (not used for hr seek etc.)
- int attempt_framedrops; // try dropping this many frames
- int dropped_frames; // total frames _probably_ dropped
-
- // --- for STREAM_AUDIO
-
- // Prefer spdif wrapper over real decoders.
- bool try_spdif;
-
- // A pts reset was observed (audio only, heuristic).
- bool pts_reset;
};
// Create the decoder wrapper for the given stream, plus underlying decoder.
@@ -63,6 +42,24 @@ struct mp_decoder_wrapper {
struct mp_decoder_wrapper *mp_decoder_wrapper_create(struct mp_filter *parent,
struct sh_stream *src);
+// For informational purposes.
+void mp_decoder_wrapper_get_desc(struct mp_decoder_wrapper *d,
+ char *buf, size_t buf_size);
+
+// Legacy decoder framedrop control.
+void mp_decoder_wrapper_set_frame_drops(struct mp_decoder_wrapper *d, int num);
+int mp_decoder_wrapper_get_frames_dropped(struct mp_decoder_wrapper *d);
+
+double mp_decoder_wrapper_get_container_fps(struct mp_decoder_wrapper *d);
+
+// Whether to prefer spdif wrapper over real decoders on next reinit.
+void mp_decoder_wrapper_set_spdif_flag(struct mp_decoder_wrapper *d, bool spdif);
+
+// True if a pts reset was observed (audio only, heuristic).
+bool mp_decoder_wrapper_get_pts_reset(struct mp_decoder_wrapper *d);
+
+void mp_decoder_wrapper_set_play_dir(struct mp_decoder_wrapper *d, int dir);
+
struct mp_decoder_list *video_decoder_list(void);
struct mp_decoder_list *audio_decoder_list(void);