17 virtual void flush() = 0;
27 virtual bool instantiate(
const file_info &
info, decode_postprocessor_instance::ptr & out) = 0;
34 typedef decode_postprocessor_instance::ptr
item;
38 decode_postprocessor_entry::ptr ptr;
41 if (ptr->instantiate(info, i)) m_items += i;
46 for(
t_size walk = 0; walk < m_items.get_size(); ++walk) {
51 for(
t_size walk = 0; walk < m_items.get_size(); ++walk) {
52 m_items[walk]->flush();
59 return m_items.get_size() > 0;
63 for(
t_size walk = 0; walk < m_items.get_size(); ++walk) {
73 for(
t_size walk = 0; walk < m_items.get_size(); ++walk) {
86 m_chunks.remove_all();
90 if ((p_flags & input_flag_no_postproc) == 0 && m_postproc.should_bother()) {
92 this->get_info(p_subsong, info, p_abort);
93 m_postproc.initialize(info);
95 baseclass::decode_initialize(p_subsong, p_flags, p_abort);
98 m_chunks.remove_all();
102 if ((p_flags & input_flag_no_postproc) == 0 && m_postproc.should_bother()) {
104 this->get_info(info, p_abort);
105 m_postproc.initialize(info);
107 baseclass::decode_initialize(p_flags, p_abort);
110 if (m_postproc.is_active()) {
113 if (m_chunks.get_count() > 0) {
117 m_chunks.remove_by_idx(0);
122 m_chunks.remove_by_idx(0);
125 if (m_haveEOF)
return false;
126 if (!baseclass::decode_run(*m_chunks.insert_item(0), p_abort)) {
128 m_chunks.remove_by_idx(0);
130 m_postproc.run(m_chunks, m_haveEOF, p_abort);
133 return baseclass::decode_run(p_chunk, p_abort);
137 if (m_postproc.is_active()) {
138 throw pfc::exception_not_implemented();
140 return baseclass::decode_run_raw(p_chunk, p_raw, p_abort);
144 bool rv = baseclass::decode_get_dynamic_info(p_out, p_timestamp_delta);
145 if (m_postproc.get_dynamic_info(p_out)) rv =
true;
149 m_chunks.remove_all();
152 double target = pfc::max_t<double>(0, p_seconds - m_postproc.get_buffer_ahead());
153 m_toSkip = p_seconds - target;
154 baseclass::decode_seek(target, p_abort);
void decode_initialize(unsigned p_flags, abort_callback &p_abort)
Stream has already been altered by another instance.
Interface to a DSP chunk list. A DSP chunk list object is passed to the DSP chain each time...
Helper class for managing decode_postprocessor_instance objects. See also: input_postprocessed.
bool decode_run(audio_chunk &p_chunk, abort_callback &p_abort)
void decode_initialize(t_uint32 p_subsong, unsigned p_flags, abort_callback &p_abort)
Generic template to add decode_postprocessor support to your input class. Works with both single-trac...
decode_postprocessor_instance::ptr item
decode_postprocessor m_postproc
void info(const char *p_message)
Interface to container of a chunk of audio data. See audio_chunk_impl for an implementation.
bool process_skip(double &skipDuration)
void run(dsp_chunk_list &p_chunk_list, bool p_eof, abort_callback &p_abort)
dsp_chunk_list_impl m_chunks
void max_acc(t_val &p_acc, const t_val &p_val)
virtual double get_buffer_ahead()=0
Main interface class for information about some playable object.
static bool should_bother()
void initialize(const file_info &info)
bool decode_get_dynamic_info(file_info &p_out, double &p_timestamp_delta)
Base class for all service classes. Provides interfaces for reference counter and querying for differ...
virtual bool run(dsp_chunk_list &p_chunk_list, t_uint32 p_flags, abort_callback &p_abort)=0
End of stream. Flush any buffered data during this call.
virtual bool get_dynamic_info(file_info &p_out)=0
double get_buffer_ahead()
Generic interface for a memory block; used by various other interfaces to return memory blocks while ...
FB2K_MAKE_SERVICE_INTERFACE(decode_postprocessor_instance, service_base)
static bool is_service_present(const GUID &g)
void decode_seek(double p_seconds, abort_callback &p_abort)
bool decode_run_raw(audio_chunk &p_chunk, mem_block_container &p_raw, abort_callback &p_abort)
bool next(service_ptr_t< t_query > &p_out)
pfc::list_t< item > m_items
bool get_dynamic_info(file_info &p_out)