summaryrefslogtreecommitdiff
path: root/xine/xvdr_metronom.h
blob: d2edf8a1695e77bda7b59b2346f5c0bc39a50333 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
 * xvdr_metronom.h:
 *
 * See the main source file 'xineliboutput.c' for copyright information and
 * how to reach the author.
 *
 * $Id: xvdr_metronom.h,v 1.14 2012-03-26 18:49:34 phintuka Exp $
 *
 */

#ifndef XVDR_METRONOM_H
#define XVDR_METRONOM_H

#include <xine/metronom.h>

#ifdef METRONOM_INTERNAL
#  error METRONOM_INTERNAL defined, struct xvdr_metronom_s size will be incorrect
#endif

#define XVDR_METRONOM_OPTION_BASE  0x1001
#define XVDR_METRONOM_LAST_VO_PTS  (XVDR_METRONOM_OPTION_BASE)
#define XVDR_METRONOM_TRICK_SPEED  (XVDR_METRONOM_OPTION_BASE + 1)
#define XVDR_METRONOM_STILL_MODE   (XVDR_METRONOM_OPTION_BASE + 2)
#define XVDR_METRONOM_ID           (XVDR_METRONOM_OPTION_BASE + 3)

#define XVDR_METRONOM_LIVE_BUFFERING   (XVDR_METRONOM_OPTION_BASE + 4)
#define XVDR_METRONOM_STREAM_START     (XVDR_METRONOM_OPTION_BASE + 5)


typedef struct xvdr_metronom_s xvdr_metronom_t;

struct adjustable_scr_s;

struct xvdr_metronom_s {
  /* xine-lib metronom interface */
  metronom_t     metronom;

  /* management interface */
  void (*dispose)     (xvdr_metronom_t *);

  void (*wire)          (xvdr_metronom_t *);
  void (*unwire)        (xvdr_metronom_t *);

  /* master SCR for buffering control */
  struct adjustable_scr_s *scr;

  /* private data */

#ifdef XVDR_METRONOM_COMPILE

  /* original metronom */
  metronom_t    *orig_metronom;
  xine_stream_t *stream;

  int     trickspeed;    /* current trick speed */
  int     still_mode;
  int64_t last_vo_pts;   /* last displayed video frame PTS */
  int     wired;         /* true if currently wired to stream */

  /* initial buffering in live mode */
  uint8_t  buffering;      /* buffering active */
  uint8_t  live_buffering; /* live buffering enabled */
  uint8_t  stream_start;
  int64_t  vid_pts;        /* last seen video pts */
  int64_t  aud_pts;        /* last seen audio pts */
  int64_t  disc_pts;       /* reported discontinuity pts */
  uint64_t buffering_start_time;
  uint64_t first_frame_seen_time;

  pthread_mutex_t mutex;
#endif
};

xvdr_metronom_t *xvdr_metronom_init(xine_stream_t *);


#endif /* XVDR_METRONOM_H */