/*
 * xine_input_vdr.h:  
 *
 * See the README file for copyright information and how to reach the author.
 *
 */

#ifndef __XINE_INPUT_VDR_H_
#define __XINE_INPUT_VDR_H_

#ifndef DEFAULT_VDR_PORT
#  define DEFAULT_VDR_PORT 37890
#endif
#ifndef DISCOVERY_PORT
#  define DISCOVERY_PORT 37890
#endif

#include "xine_osd_command.h"

#if 0
typedef struct stream_rtp_header {
  /* input_rtp.c ? */
  int dummy;
} __attribute__ ((packed)) stream_rtp_header_t;
#endif

#define UDP_SEQ_MASK 0xff
typedef struct stream_udp_header {
  uint64_t pos; /* stream position of first byte */
                /* -1ULL and first bytes of frame != 00 00 01 */
                /* --> embedded control stream data */
  uint16_t seq; /* packet sequence number 
		   (for re-ordering and detecting missing packets) */
} __attribute__ ((packed)) stream_udp_header_t;

typedef struct stream_tcp_header {
  uint64_t pos; /* stream position of first byte */
  uint32_t len; /* length of following PES packet */
} __attribute__ ((packed)) stream_tcp_header_t;

struct input_plugin_s;

typedef struct vdr_input_plugin_funcs_s {
  /* VDR --> input plugin (only local mode) */
  int  (*push_input_write)(struct input_plugin_s *, char *, int);
  int  (*push_input_control)(struct input_plugin_s *, char *);
  int  (*push_input_osd)(struct input_plugin_s *, osd_command_t *);
  /* input plugin --> frontend (only local mode) */
  void (*xine_input_event)(char *, char *);
  /* input plugin --> frontend */
  void *(*fe_control)(void *fe_handle, char *);
  void *fe_handle;
  /* frontend --> input plugin (remote mode) */
  int  (*input_control)(struct input_plugin_s *, char *, char *, int, int);
} vdr_input_plugin_funcs_t;

#define CONTROL_OK            0
#define CONTROL_UNKNOWN      -1 
#define CONTROL_PARAM_ERROR  -2 
#define CONTROL_DISCONNECTED -3


#endif /*__XINE_INPUT_VDR_H_*/

