/* libdvb_parts.h

 this file contains parts of libdvb-0.5.5.1/transform.{c,h}
 http://freshmeat.net/projects/libdvb/

*/

#ifndef LIBDVB_PARTS_H
#define LIBDVB_PARTS_H

#include <stdint.h>
#include <netinet/in.h>
#include <unistd.h>

#define MAX_PLENGTH 0xFFFF
#define MMAX_PLENGTH (8*MAX_PLENGTH)

#ifdef __cplusplus
extern "C" {
#endif				/* __cplusplus */

typedef struct p2pstruct
  {
  uint found;
  uint8_t buf[MMAX_PLENGTH];
  uint8_t cid;
  uint8_t subid;
  uint32_t plength;
  uint8_t plen[2];
  uint8_t flag1;
  uint8_t flag2;
  uint8_t hlength;
  uint8_t pts[5];
  int mpeg;
  uint8_t check;
  int fd1;
  int fd2;
  int es;
  int filter;
  int which;
  int done;
  int repack;
  uint16_t bigend_repack;
  void (*func)(uint8_t *buf, int count, void *p);
  int startv;
  int starta;
  int64_t apts;
  int64_t vpts;
  int16_t pid;
  uint16_t pida;
  uint16_t pidv;
  uint8_t acounter;
  uint8_t vcounter;
  uint8_t count0;
  uint8_t count1;
  void *data;
  } p2p;

class cPTV_Device;

#ifdef __cplusplus
}
#endif				/* __cplusplus */

#endif // LIBDVB_PARTS_H
