summaryrefslogtreecommitdiff
path: root/src/xine-engine/metronom.h
diff options
context:
space:
mode:
authorMichael Roitzsch <mroi@users.sourceforge.net>2002-11-20 11:57:38 +0000
committerMichael Roitzsch <mroi@users.sourceforge.net>2002-11-20 11:57:38 +0000
commit4e95a4f5224e241075b8cd86b4423c85c1d0ee26 (patch)
treecd9287e15591dce94560663ad66fc4005d006012 /src/xine-engine/metronom.h
parent74893748b868ecc6ae539fa66e326e06947c4ac9 (diff)
downloadxine-lib-4e95a4f5224e241075b8cd86b4423c85c1d0ee26.tar.gz
xine-lib-4e95a4f5224e241075b8cd86b4423c85c1d0ee26.tar.bz2
engine modifications to allow post plugin layer:
* new public output interface xine_{audio,video}_port_t instead of xine_{ao,vo}_driver_t, old names kept as aliases for compatibility * modified the engine to allow multiple streams per output * renaming of some internal structures according to public changes * moving SCR out of per-stream-metronom into a global metronom_clock_t residing in xine_t and therefore easily available to the output layer * adapting all available plugins (note to external projects: the compiler will help you a lot, if a plugin compiles, it is adapted, because all changes add new parameters to some functions) * bump up all interface versions because of xine_t and xine_stream_t changes CVS patchset: 3312 CVS date: 2002/11/20 11:57:38
Diffstat (limited to 'src/xine-engine/metronom.h')
-rw-r--r--src/xine-engine/metronom.h142
1 files changed, 85 insertions, 57 deletions
diff --git a/src/xine-engine/metronom.h b/src/xine-engine/metronom.h
index 0471d1209..949729010 100644
--- a/src/xine-engine/metronom.h
+++ b/src/xine-engine/metronom.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: metronom.h,v 1.40 2002/11/12 18:40:55 miguelfreitas Exp $
+ * $Id: metronom.h,v 1.41 2002/11/20 11:57:49 mroi Exp $
*
* metronom: general pts => virtual calculation/assoc
*
@@ -54,6 +54,7 @@ extern "C" {
#include "xine.h"
typedef struct metronom_s metronom_t ;
+typedef struct metronom_clock_s metronom_clock_t;
typedef struct scr_plugin_s scr_plugin_t;
/* see below */
@@ -150,40 +151,105 @@ struct metronom_s {
*/
void (*set_option) (metronom_t *this, int option, int64_t value);
int64_t (*get_option) (metronom_t *this, int option);
+
+ void (*exit) (metronom_t *this);
+
+ /*
+ * pointer to current xine stream object.
+ */
+ xine_stream_t *stream;
+
+ metronom_clock_t *clock;
+
+ /*
+ * metronom internal stuff
+ */
+
+ int64_t pts_per_smpls;
+
+ int64_t video_vpts;
+ int64_t spu_vpts;
+ int64_t audio_vpts;
+
+ int64_t vpts_offset;
+
+ int64_t video_drift;
+ int64_t video_drift_step;
+
+ int audio_samples;
+ int64_t audio_drift_step;
+
+ int64_t av_offset;
+
+ pthread_mutex_t lock;
+
+ int have_audio;
+ int video_discontinuity_count;
+ int audio_discontinuity_count;
+ int discontinuity_handled_count;
+ pthread_cond_t video_discontinuity_reached;
+ pthread_cond_t audio_discontinuity_reached;
+ pthread_cond_t cancel;
+
+ int force_video_jump;
+ int force_audio_jump;
+
+ int64_t img_duration;
+ int img_cpt;
+ int64_t last_video_pts;
+
+};
+
+/*
+ * metronom options
+ */
+
+#define METRONOM_AV_OFFSET 2
+#define METRONOM_ADJ_VPTS_OFFSET 3
+
+metronom_t *metronom_init (int have_audio, xine_stream_t *stream);
+
+struct metronom_clock_s {
+
+ /*
+ * set/get options for clock, constants see below
+ */
+ void (*set_option) (metronom_clock_t *this, int option, int64_t value);
+ int64_t (*get_option) (metronom_clock_t *this, int option);
/*
* system clock reference (SCR) functions
*/
/*
- * start metronom clock (no clock reset)
+ * start clock (no clock reset)
* at given pts
*/
- void (*start_clock) (metronom_t *this, int64_t pts);
+ void (*start_clock) (metronom_clock_t *this, int64_t pts);
/*
* stop metronom clock
*/
- void (*stop_clock) (metronom_t *this);
+ void (*stop_clock) (metronom_clock_t *this);
/*
* resume clock from where it was stopped
*/
- void (*resume_clock) (metronom_t *this);
+ void (*resume_clock) (metronom_clock_t *this);
/*
* get current clock value in vpts
*/
- int64_t (*get_current_time) (metronom_t *this);
+ int64_t (*get_current_time) (metronom_clock_t *this);
/*
* adjust master clock to external timer (e.g. audio hardware)
*/
- void (*adjust_clock) (metronom_t *this, int64_t desired_pts);
+ void (*adjust_clock) (metronom_clock_t *this, int64_t desired_pts);
/*
@@ -191,74 +257,36 @@ struct metronom_s {
* for constants see xine_internal.h
*/
- int (*set_speed) (metronom_t *this, int speed);
+ int (*set_speed) (metronom_clock_t *this, int speed);
/*
* (un)register a System Clock Reference provider at the metronom
*/
- int (*register_scr) (metronom_t *this, scr_plugin_t *scr);
- void (*unregister_scr) (metronom_t *this, scr_plugin_t *scr);
-
- void (*exit) (metronom_t *this);
-
- /*
- * pointer to current xine stream object.
- */
- xine_stream_t *stream;
+ int (*register_scr) (metronom_clock_t *this, scr_plugin_t *scr);
+ void (*unregister_scr) (metronom_clock_t *this, scr_plugin_t *scr);
- /*
- * metronom internal stuff
- */
-
- int64_t pts_per_smpls;
-
- int64_t video_vpts;
- int64_t spu_vpts;
- int64_t audio_vpts;
-
- int64_t vpts_offset;
-
- int64_t video_drift;
- int64_t video_drift_step;
+ void (*exit) (metronom_clock_t *this);
- int audio_samples;
- int64_t audio_drift_step;
-
- int64_t av_offset;
-
scr_plugin_t* scr_master;
scr_plugin_t** scr_list;
pthread_t sync_thread;
+ int thread_running;
int scr_adjustable;
-
+
+ int speed;
+
pthread_mutex_t lock;
-
- int have_audio;
- int video_discontinuity_count;
- int audio_discontinuity_count;
- int discontinuity_handled_count;
- pthread_cond_t video_discontinuity_reached;
- pthread_cond_t audio_discontinuity_reached;
pthread_cond_t cancel;
- int force_video_jump;
- int force_audio_jump;
-
- int64_t img_duration;
- int img_cpt;
- int64_t last_video_pts;
-
};
-metronom_t *metronom_init (int have_audio, xine_stream_t *stream);
+metronom_clock_t *metronom_clock_init(void);
/*
- * metronom options
+ * clock options
*/
-#define METRONOM_SCR_ADJUSTABLE 1
-#define METRONOM_AV_OFFSET 2
-#define METRONOM_ADJ_VPTS_OFFSET 3
+#define CLOCK_SCR_ADJUSTABLE 1
/*
* SCR (system clock reference) plugins
@@ -287,7 +315,7 @@ struct scr_plugin_s
void (*exit) (scr_plugin_t *this);
- metronom_t *metronom;
+ metronom_clock_t *clock;
};
#ifdef __cplusplus