foobar2000 SDK  2015-08-03
packet_decoder.cpp
Go to the documentation of this file.
1 #include "foobar2000.h"
2 
3 void packet_decoder::g_open(service_ptr_t<packet_decoder> & p_out,bool p_decode,const GUID & p_owner,t_size p_param1,const void * p_param2,t_size p_param2size,abort_callback & p_abort)
4 {
7  while(e.next(ptr)) {
8  p_abort.check();
9  if (ptr->is_our_setup(p_owner,p_param1,p_param2,p_param2size)) {
10  ptr->open(p_out,p_decode,p_owner,p_param1,p_param2,p_param2size,p_abort);
11  return;
12  }
13  }
14  throw exception_io_data();
15 }
16 
18  size_t v = this->set_stream_property(property_bufferpadding, 0, NULL, 0);
19  if (v > 0) {
21  }
22  return v;
23 }
24 
25 void packet_decoder::setEventLogger(event_logger::ptr logger) {
26  this->set_stream_property(property_eventlogger, 0, logger.get_ptr(), 0);
27 }
28 
29 void packet_decoder::setCheckingIntegrity(bool checkingIntegrity) {
30  this->set_stream_property(property_checkingintegrity, checkingIntegrity ? 1 : 0, NULL, 0);
31 }
32 
33 void packet_decoder::setAllowDelayed( bool bAllow ) {
34  this->set_stream_property( property_allow_delayed_output, bAllow ? 1 : 0, NULL, 0);
35 }
36 
static const GUID property_allow_delayed_output
size_t initPadding()
Definition: pfc.h:71
static const GUID property_eventlogger
void setCheckingIntegrity(bool checkingIntegrity)
static const GUID property_bufferpadding
size_t t_size
Definition: int_types.h:48
static const GUID property_checkingintegrity
void setEventLogger(event_logger::ptr logger)
void setAllowDelayed(bool bAllow=true)
virtual t_size set_stream_property(const GUID &p_type, t_size p_param1, const void *p_param2, t_size p_param2size)=0
Forwards additional information about stream being decoded. Calling: this must be called immediately...
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
Definition: service.h:55
bool next(service_ptr_t< t_query > &p_out)
Definition: service.h:587
static void g_open(service_ptr_t< packet_decoder > &p_out, bool p_decode, const GUID &p_owner, t_size p_param1, const void *p_param2, t_size p_param2size, abort_callback &p_abort)
Static helper, creates a packet_decoder instance and initializes it with specific decoder setup data...