* Licensed under the GPL v2. For licencing details see COPYING.
*/
-/** \file fecdev_filter.c A filter fec-decodes an audio stream. */
+/** \file fecdec_filter.c A filter fec-decodes an audio stream. */
#include <dirent.h>
#include "para.h"
#include "fec.h"
#include "fd.h"
+/**
+ * How many FEC groups to store in memory.
+ *
+ * Packet reordering requires to keep more than one FEC group in memory because
+ * slices belonging to the next FEC group may arrive before the current FEC group
+ * is complete.
+ */
#define NUM_FEC_GROUPS 3
+
#define INPUT_BUFFER_SIZE 16384
-/** size of the output buffer */
+/** Size of the output buffer of the fecdec filter. */
#define FECDEC_OUTBUF_SIZE 81920
+/** Data read from the header of a slice. */
struct fec_header {
+ /** Total number of slices in this group. */
uint8_t slices_per_group;
+ /** Number of slices needed to start decoding. */
uint8_t data_slices_per_group;
+ /** Size of the ogg vorbis header (zero for mp3, aac). */
uint32_t audio_header_size;
-
+ /** Number of the FEC group this slice belongs to. */
uint32_t group_num;
+ /** Size of the data in this FEC group. */
uint32_t group_bytes;
-
+ /** Number of this slice in the group. */
uint8_t slice_num;
+ /** Used data bytes of this slice. */
uint16_t slice_bytes;
};