foobar2000 SDK
2015-08-03
|
#include <packet_decoder.h>
Data Structures | |
struct | matroska_setup |
Public Member Functions | |
virtual void | analyze_first_frame (const void *p_buffer, t_size p_bytes, abort_callback &p_abort)=0 |
virtual bool | analyze_first_frame_supported ()=0 |
virtual void | decode (const void *p_buffer, t_size p_bytes, audio_chunk &p_chunk, abort_callback &p_abort)=0 |
FB2K_MAKE_SERVICE_INTERFACE (packet_decoder, service_base) | |
virtual void | get_info (file_info &p_info)=0 |
virtual unsigned | get_max_frame_dependency ()=0 |
virtual double | get_max_frame_dependency_time ()=0 |
size_t | initPadding () |
virtual void | reset_after_seek ()=0 |
virtual t_size | set_stream_property (const GUID &p_type, t_size p_param1, const void *p_param2, t_size p_param2size)=0 |
void | setAllowDelayed (bool bAllow=true) |
void | setCheckingIntegrity (bool checkingIntegrity) |
void | setEventLogger (event_logger::ptr logger) |
Public Member Functions inherited from service_base | |
template<typename outPtr_t > | |
bool | cast (outPtr_t &outPtr) |
virtual int | service_add_ref ()=0 throw () |
virtual bool | service_query (service_ptr_t< service_base > &p_out, const GUID &p_guid) |
template<class T > | |
bool | service_query_t (service_ptr_t< T > &p_out) |
virtual int | service_release ()=0 throw () |
Static Public Member Functions | |
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 Public Attributes | |
static const GUID | owner_ADIF |
static const GUID | owner_ADTS |
static const GUID | owner_matroska |
static const GUID | owner_MP1 |
static const GUID | owner_MP2 |
static const GUID | owner_MP3 |
static const GUID | owner_MP4 |
static const GUID | owner_MP4_AC3 |
static const GUID | owner_MP4_ALAC |
static const GUID | owner_MP4_AMR |
static const GUID | owner_MP4_AMR_WB |
static const GUID | owner_Ogg = { 0x8fa27457, 0xa021, 0x43b9, { 0xad, 0x20, 0xa7, 0x96, 0xdb, 0x94, 0x7c, 0xd1 } } |
static const GUID | property_allow_delayed_output = { 0x985b25a5, 0x5e79, 0x4dda, { 0x8b, 0xdd, 0x53, 0xb4, 0x25, 0x76, 0xe2, 0x2d } } |
static const GUID | property_bitspersample |
static const GUID | property_bufferpadding |
static const GUID | property_byteorder |
static const GUID | property_channelmask |
static const GUID | property_channels |
static const GUID | property_checkingintegrity |
static const GUID | property_eventlogger |
static const GUID | property_mp4_esds = { 0xe8504271, 0xaec0, 0x4805, { 0xbb, 0x69, 0x71, 0xcc, 0xa3, 0xbc, 0x2, 0xdd } } |
static const GUID | property_ogg_header = { 0xbeb22c78, 0xeb49, 0x4f9e, { 0x9e, 0x37, 0x57, 0xd8, 0x87, 0x40, 0xfb, 0x4c } } |
static const GUID | property_ogg_packet = { 0xade740be, 0x8e2e, 0x4d0b, { 0xa4, 0x0, 0x3f, 0x6e, 0x8a, 0xf7, 0x71, 0xe4 } } |
static const GUID | property_ogg_query_preskip = { 0xfae837d4, 0xc396, 0x4ccd, { 0xa7, 0xa5, 0xeb, 0x1e, 0x7e, 0x86, 0x32, 0xfb } } |
static const GUID | property_ogg_query_sample_rate = { 0x6226bf73, 0x1c37, 0x4aa1, { 0xae, 0xb1, 0x18, 0x8b, 0x4a, 0xf3, 0xae, 0xf7 } } |
static const GUID | property_samplerate |
static const GUID | property_samples_per_frame |
static const GUID | property_signed |
Protected Member Functions | |
void | open (const GUID &p_owner, bool p_decode, t_size p_param1, const void *p_param2, t_size p_param2size, abort_callback &p_abort) |
Protected Member Functions inherited from service_base | |
service_base () | |
~service_base () | |
Static Protected Member Functions | |
static bool | g_is_our_setup (const GUID &p_owner, t_size p_param1, const void *p_param2, t_size p_param2size) |
Additional Inherited Members | |
Public Types inherited from service_base | |
typedef service_base | t_interface |
Provides interface to decode various audio data types to PCM. Use packet_decoder_factory_t template to register.
Definition at line 3 of file packet_decoder.h.
struct packet_decoder::matroska_setup |
Definition at line 48 of file packet_decoder.h.
Data Fields | ||
---|---|---|
uint32_t | channels | |
const char * | codec_id | |
const void * | codec_private | |
size_t | codec_private_size | |
uint32_t | sample_rate | |
uint32_t | sample_rate_output |
|
pure virtual |
Optional. Some codecs need to analyze first frame of the stream to return additional info about the stream, such as encoding setup. This can be only called immediately after instantiation (and set_stream_property() if present), before any actual decoding or get_info(). Caller can determine whether this method is supported or not by calling analyze_first_frame_supported(), to avoid reading first frame when decoder won't utiilize the extra info for an example. If particular decoder can't utilize first frame info in any way (and analyze_first_frame_supported() returns false), this function should do nothing and succeed.
|
pure virtual |
Returns whether this packet decoder supports analyze_first_frame() function.
|
pure virtual |
Decodes a block of audio data.
It may return empty chunk even when successful (caused by encoder+decoder delay for an example), caller must check for it and handle it appropriately.
packet_decoder::FB2K_MAKE_SERVICE_INTERFACE | ( | packet_decoder | , |
service_base | |||
) |
|
inlinestaticprotected |
Prototype of function that must be implemented by packet_decoder implementation but is not accessible through packet_decoder interface itself. Determines whether specific packet_decoder implementation supports specified decoder setup data.
Definition at line 7 of file packet_decoder.h.
|
static |
Static helper, creates a packet_decoder instance and initializes it with specific decoder setup data.
Definition at line 3 of file packet_decoder.cpp.
|
pure virtual |
Retrieves additional user-readable tech infos that decoder can provide.
p_info | Interface receiving information about the stream being decoded. Note that it already contains partial info about the file; existing info should not be erased, decoder-provided info should be merged with it. |
|
pure virtual |
Returns many frames back to start decoding when seeking.
|
pure virtual |
Returns much time back to start decoding when seeking (for containers where going back by specified number of frames is not trivial).
size_t packet_decoder::initPadding | ( | ) |
Definition at line 17 of file packet_decoder.cpp.
|
inlineprotected |
Prototype of function that must be implemented by packet_decoder implementation but is not accessible through packet_decoder interface itself. Initializes packet decoder instance with specified decoder setup data. This is called only once, before any other methods.
p_decode | If set to true, decode() and reset_after_seek() calls can be expected later. If set to false, those methods will not be called on this packet_decoder instance - for an example when caller is only retrieving information about the file rather than preparing to decode it. |
Definition at line 12 of file packet_decoder.h.
|
pure virtual |
Flushes decoder after seeking.
|
pure virtual |
Forwards additional information about stream being decoded.
Calling: this must be called immediately after packet_decoder object is created, before any other methods are called.
Implementation: this is called after open() (which is called by implementation framework immediately after creation), and before any other methods are called.
void packet_decoder::setAllowDelayed | ( | bool | bAllow = true | ) |
Definition at line 33 of file packet_decoder.cpp.
void packet_decoder::setCheckingIntegrity | ( | bool | checkingIntegrity | ) |
Definition at line 29 of file packet_decoder.cpp.
void packet_decoder::setEventLogger | ( | event_logger::ptr | logger | ) |
Definition at line 25 of file packet_decoder.cpp.
|
static |
Definition at line 46 of file packet_decoder.h.
|
static |
Definition at line 46 of file packet_decoder.h.
|
static |
Definition at line 46 of file packet_decoder.h.
|
static |
Definition at line 46 of file packet_decoder.h.
|
static |
Definition at line 46 of file packet_decoder.h.
|
static |
Definition at line 46 of file packet_decoder.h.
|
static |
Definition at line 46 of file packet_decoder.h.
|
static |
Definition at line 46 of file packet_decoder.h.
|
static |
Definition at line 46 of file packet_decoder.h.
|
static |
Definition at line 46 of file packet_decoder.h.
|
static |
Definition at line 46 of file packet_decoder.h.
|
static |
Definition at line 46 of file packet_decoder.h.
|
static |
Definition at line 85 of file packet_decoder.h.
|
static |
Definition at line 62 of file packet_decoder.h.
|
static |
Definition at line 62 of file packet_decoder.h.
|
static |
Definition at line 62 of file packet_decoder.h.
|
static |
Definition at line 62 of file packet_decoder.h.
|
static |
Definition at line 62 of file packet_decoder.h.
|
static |
Definition at line 62 of file packet_decoder.h.
|
static |
Definition at line 62 of file packet_decoder.h.
|
static |
Definition at line 82 of file packet_decoder.h.
|
static |
Definition at line 79 of file packet_decoder.h.
|
static |
Definition at line 79 of file packet_decoder.h.
|
static |
Definition at line 79 of file packet_decoder.h.
|
static |
Definition at line 79 of file packet_decoder.h.
|
static |
Definition at line 62 of file packet_decoder.h.
|
static |
Definition at line 62 of file packet_decoder.h.
|
static |
Definition at line 62 of file packet_decoder.h.