diff options
author | Michael Roitzsch <mroi@users.sourceforge.net> | 2002-11-20 11:57:38 +0000 |
---|---|---|
committer | Michael Roitzsch <mroi@users.sourceforge.net> | 2002-11-20 11:57:38 +0000 |
commit | 4e95a4f5224e241075b8cd86b4423c85c1d0ee26 (patch) | |
tree | cd9287e15591dce94560663ad66fc4005d006012 /src/dxr3 | |
parent | 74893748b868ecc6ae539fa66e326e06947c4ac9 (diff) | |
download | xine-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/dxr3')
-rw-r--r-- | src/dxr3/dxr3_decode_spu.c | 6 | ||||
-rw-r--r-- | src/dxr3/dxr3_decode_video.c | 32 | ||||
-rw-r--r-- | src/dxr3/video_out_dxr3.c | 66 | ||||
-rw-r--r-- | src/dxr3/video_out_dxr3.h | 4 |
4 files changed, 56 insertions, 52 deletions
diff --git a/src/dxr3/dxr3_decode_spu.c b/src/dxr3/dxr3_decode_spu.c index 74729dc03..2695cce0e 100644 --- a/src/dxr3/dxr3_decode_spu.c +++ b/src/dxr3/dxr3_decode_spu.c @@ -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: dxr3_decode_spu.c,v 1.25 2002/11/15 00:20:31 miguelfreitas Exp $ + * $Id: dxr3_decode_spu.c,v 1.26 2002/11/20 11:57:41 mroi Exp $ */ /* dxr3 spu decoder plugin. @@ -66,7 +66,7 @@ static decoder_info_t dxr3_spudec_info = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_SPU_DECODER, 10, "dxr3-spudec", XINE_VERSION_CODE, &dxr3_spudec_info, &dxr3_spudec_init_plugin }, + { PLUGIN_SPU_DECODER, 11, "dxr3-spudec", XINE_VERSION_CODE, &dxr3_spudec_info, &dxr3_spudec_init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; @@ -435,7 +435,7 @@ static void dxr3_spudec_decode_data(spu_decoder_t *this_gen, buf_element_t *buf) vpts = this->stream->metronom->got_spu_packet(this->stream->metronom, buf->pts); /* estimate with current time, when metronom doesn't know */ - if (!vpts) vpts = this->stream->metronom->get_current_time(this->stream->metronom); + if (!vpts) vpts = this->stream->xine->clock->get_current_time(this->stream->xine->clock); #if LOG_PTS printf("dxr3_decode_spu: pts = %lld vpts = %lld\n", buf->pts, vpts); #endif diff --git a/src/dxr3/dxr3_decode_video.c b/src/dxr3/dxr3_decode_video.c index 8fb4d45e6..f6f2f3dc1 100644 --- a/src/dxr3/dxr3_decode_video.c +++ b/src/dxr3/dxr3_decode_video.c @@ -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: dxr3_decode_video.c,v 1.21 2002/11/17 17:55:21 mroi Exp $ + * $Id: dxr3_decode_video.c,v 1.22 2002/11/20 11:57:42 mroi Exp $ */ /* dxr3 video decoder plugin. @@ -72,7 +72,7 @@ static decoder_info_t dxr3_video_decoder_info = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 12, "dxr3-mpeg2", XINE_VERSION_CODE, &dxr3_video_decoder_info, &dxr3_init_plugin }, + { PLUGIN_VIDEO_DECODER, 13, "dxr3-mpeg2", XINE_VERSION_CODE, &dxr3_video_decoder_info, &dxr3_init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; @@ -98,6 +98,8 @@ typedef struct dxr3_decoder_class_s { char devname[128]; char devnum[3]; + + metronom_clock_t *clock; /* used for syncing */ } dxr3_decoder_class_t; typedef struct dxr3_decoder_s { @@ -179,6 +181,8 @@ static void *dxr3_init_plugin(xine_t *xine, void *data) this->instance = 0; + this->clock = xine->clock; + return &this->video_decoder_class; } @@ -238,7 +242,7 @@ static video_decoder_t *dxr3_open_plugin(video_decoder_class_t *class_gen, xine_ this->skip_count = 0; this->force_duration_window = -FORCE_DURATION_WINDOW_SIZE; - this->last_vpts = this->stream->metronom->get_current_time(this->stream->metronom); + this->last_vpts = this->class->clock->get_current_time(this->class->clock); this->avg_duration = 0; this->sync_every_frame = cfg->register_bool(cfg, @@ -258,7 +262,7 @@ static video_decoder_t *dxr3_open_plugin(video_decoder_class_t *class_gen, xine_ /* set a/v offset to compensate dxr3 internal delay */ this->stream->metronom->set_option(this->stream->metronom, METRONOM_AV_OFFSET, -21600); - stream->video_out->open(stream->video_out); + stream->video_out->open(stream->video_out, stream); class->instance = 1; @@ -369,7 +373,7 @@ static void dxr3_decode_data(video_decoder_t *this_gen, buf_element_t *buf) img->bad_frame = 0; img->duration = get_duration(this); - skip = img->draw(img); + skip = img->draw(img, this->stream); if (skip <= 0) { /* don't skip */ vpts = img->vpts; /* copy so we can free img */ @@ -470,13 +474,13 @@ static void dxr3_decode_data(video_decoder_t *this_gen, buf_element_t *buf) if (!this->scr) { int64_t time; - time = this->stream->metronom->get_current_time(this->stream->metronom); + time = this->class->clock->get_current_time(this->class->clock); this->scr = dxr3_scr_init(this->stream); this->scr->scr_plugin.start(&this->scr->scr_plugin, time); - this->stream->metronom->register_scr( - this->stream->metronom, &this->scr->scr_plugin); - if (this->stream->metronom->scr_master == &this->scr->scr_plugin) + this->class->clock->register_scr( + this->class->clock, &this->scr->scr_plugin); + if (this->class->clock->scr_master == &this->scr->scr_plugin) #if LOG_VID printf("dxr3_decode_video: dxr3_scr plugin is master\n"); #endif @@ -490,8 +494,8 @@ static void dxr3_decode_data(video_decoder_t *this_gen, buf_element_t *buf) if (vpts) { int64_t delay; - delay = vpts - this->stream->metronom->get_current_time( - this->stream->metronom); + delay = vpts - this->class->clock->get_current_time( + this->class->clock); #if LOG_PTS printf("dxr3_decode_video: SETPTS got %lld\n", vpts); #endif @@ -554,10 +558,10 @@ static void dxr3_flush(video_decoder_t *this_gen) static void dxr3_dispose(video_decoder_t *this_gen) { dxr3_decoder_t *this = (dxr3_decoder_t *)this_gen; - metronom_t *metronom = this->stream->metronom; + metronom_clock_t *clock = this->class->clock; if (this->scr) { - metronom->unregister_scr(metronom, &this->scr->scr_plugin); + clock->unregister_scr(clock, &this->scr->scr_plugin); this->scr->scr_plugin.exit(&this->scr->scr_plugin); } @@ -566,7 +570,7 @@ static void dxr3_dispose(video_decoder_t *this_gen) if (this->fd_video >= 0) close(this->fd_video); close(this->fd_control); - this->stream->video_out->close(this->stream->video_out); + this->stream->video_out->close(this->stream->video_out, this->stream); this->class->instance = 0; free(this); diff --git a/src/dxr3/video_out_dxr3.c b/src/dxr3/video_out_dxr3.c index d7d7117dd..b6613f9b1 100644 --- a/src/dxr3/video_out_dxr3.c +++ b/src/dxr3/video_out_dxr3.c @@ -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: video_out_dxr3.c,v 1.60 2002/10/29 15:19:44 mroi Exp $ + * $Id: video_out_dxr3.c,v 1.61 2002/11/20 11:57:42 mroi Exp $ */ /* mpeg1 encoding video out plugin for the dxr3. @@ -75,39 +75,39 @@ static vo_info_t vo_info_dxr3 = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_OUT, 10, "dxr3", XINE_VERSION_CODE, &vo_info_dxr3, &dxr3_vo_init_plugin }, + { PLUGIN_VIDEO_OUT, 11, "dxr3", XINE_VERSION_CODE, &vo_info_dxr3, &dxr3_vo_init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; /* plugin class functions */ -static xine_vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const void *visual); -static char *dxr3_vo_get_identifier(video_driver_class_t *class_gen); -static char *dxr3_vo_get_description(video_driver_class_t *class_gen); -static void dxr3_vo_class_dispose(video_driver_class_t *class_gen); +static vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const void *visual); +static char *dxr3_vo_get_identifier(video_driver_class_t *class_gen); +static char *dxr3_vo_get_description(video_driver_class_t *class_gen); +static void dxr3_vo_class_dispose(video_driver_class_t *class_gen); /* plugin instance functions */ -static uint32_t dxr3_get_capabilities(xine_vo_driver_t *this_gen); -static vo_frame_t *dxr3_alloc_frame(xine_vo_driver_t *this_gen); +static uint32_t dxr3_get_capabilities(vo_driver_t *this_gen); +static vo_frame_t *dxr3_alloc_frame(vo_driver_t *this_gen); static void dxr3_frame_copy(vo_frame_t *frame_gen, uint8_t **src); static void dxr3_frame_field(vo_frame_t *vo_img, int which_field); static void dxr3_frame_dispose(vo_frame_t *frame_gen); -static void dxr3_update_frame_format(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen, +static void dxr3_update_frame_format(vo_driver_t *this_gen, vo_frame_t *frame_gen, uint32_t width, uint32_t height, int ratio_code, int format, int flags); -static void dxr3_overlay_begin(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen, int changed); -static void dxr3_overlay_blend(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen, +static void dxr3_overlay_begin(vo_driver_t *this_gen, vo_frame_t *frame_gen, int changed); +static void dxr3_overlay_blend(vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay); -static void dxr3_overlay_end(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen); -static void dxr3_display_frame(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen); -static int dxr3_redraw_needed(xine_vo_driver_t *this_gen); -static int dxr3_get_property(xine_vo_driver_t *this_gen, int property); -static int dxr3_set_property(xine_vo_driver_t *this_gen, int property, int value); -static void dxr3_get_property_min_max(xine_vo_driver_t *this_gen, int property, +static void dxr3_overlay_end(vo_driver_t *this_gen, vo_frame_t *frame_gen); +static void dxr3_display_frame(vo_driver_t *this_gen, vo_frame_t *frame_gen); +static int dxr3_redraw_needed(vo_driver_t *this_gen); +static int dxr3_get_property(vo_driver_t *this_gen, int property); +static int dxr3_set_property(vo_driver_t *this_gen, int property, int value); +static void dxr3_get_property_min_max(vo_driver_t *this_gen, int property, int *min, int *max); -static int dxr3_gui_data_exchange(xine_vo_driver_t *this_gen, +static int dxr3_gui_data_exchange(vo_driver_t *this_gen, int data_type, void *data); -static void dxr3_dispose(xine_vo_driver_t *this_gen); +static void dxr3_dispose(vo_driver_t *this_gen); /* overlay helper functions only called once during plugin init */ static void gather_screen_vars(dxr3_driver_t *this, const x11_visual_t *vis); @@ -177,7 +177,7 @@ static void dxr3_vo_class_dispose(video_driver_class_t *class_gen) } -static xine_vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const void *visual_gen) +static vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const void *visual_gen) { dxr3_driver_t *this; dxr3_driver_class_t *class = (dxr3_driver_class_t *)class_gen; @@ -431,13 +431,13 @@ static xine_vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, co } -static uint32_t dxr3_get_capabilities(xine_vo_driver_t *this_gen) +static uint32_t dxr3_get_capabilities(vo_driver_t *this_gen) { return VO_CAP_YV12 | VO_CAP_YUY2 | VO_CAP_SATURATION | VO_CAP_BRIGHTNESS | VO_CAP_CONTRAST; } -static vo_frame_t *dxr3_alloc_frame(xine_vo_driver_t *this_gen) +static vo_frame_t *dxr3_alloc_frame(vo_driver_t *this_gen) { dxr3_frame_t *frame; dxr3_driver_t *this = (dxr3_driver_t *)this_gen; @@ -481,7 +481,7 @@ static void dxr3_frame_dispose(vo_frame_t *frame_gen) free(frame); } -static void dxr3_update_frame_format(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen, +static void dxr3_update_frame_format(vo_driver_t *this_gen, vo_frame_t *frame_gen, uint32_t width, uint32_t height, int ratio_code, int format, int flags) { dxr3_driver_t *this = (dxr3_driver_t *)this_gen; @@ -669,7 +669,7 @@ static void dxr3_update_frame_format(xine_vo_driver_t *this_gen, vo_frame_t *fra frame->swap_fields = this->swap_fields; } -static void dxr3_overlay_begin(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen, int changed) +static void dxr3_overlay_begin(vo_driver_t *this_gen, vo_frame_t *frame_gen, int changed) { dxr3_driver_t *this = (dxr3_driver_t *)this_gen; @@ -687,7 +687,7 @@ static void dxr3_overlay_begin(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen this->spu_enc->overlay = NULL; } -static void dxr3_overlay_blend(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen, +static void dxr3_overlay_blend(vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay) { if (frame_gen->format != XINE_IMGFMT_DXR3) { @@ -709,7 +709,7 @@ static void dxr3_overlay_blend(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen } } -static void dxr3_overlay_end(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen) +static void dxr3_overlay_end(vo_driver_t *this_gen, vo_frame_t *frame_gen) { dxr3_driver_t *this = (dxr3_driver_t *)this_gen; em8300_button_t btn; @@ -784,7 +784,7 @@ static void dxr3_overlay_end(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen) pthread_mutex_unlock(&this->spu_device_lock); } -static void dxr3_display_frame(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen) +static void dxr3_display_frame(vo_driver_t *this_gen, vo_frame_t *frame_gen) { dxr3_driver_t *this = (dxr3_driver_t *)this_gen; dxr3_frame_t *frame = (dxr3_frame_t *)frame_gen; @@ -853,7 +853,7 @@ static void dxr3_display_frame(xine_vo_driver_t *this_gen, vo_frame_t *frame_gen } } -static int dxr3_redraw_needed(xine_vo_driver_t *this_gen) +static int dxr3_redraw_needed(vo_driver_t *this_gen) { dxr3_driver_t *this = (dxr3_driver_t *)this_gen; @@ -863,7 +863,7 @@ static int dxr3_redraw_needed(xine_vo_driver_t *this_gen) return 0; } -static int dxr3_get_property(xine_vo_driver_t *this_gen, int property) +static int dxr3_get_property(vo_driver_t *this_gen, int property) { dxr3_driver_t *this = (dxr3_driver_t *)this_gen; @@ -887,7 +887,7 @@ static int dxr3_get_property(xine_vo_driver_t *this_gen, int property) return 0; } -static int dxr3_set_property(xine_vo_driver_t *this_gen, int property, int value) +static int dxr3_set_property(vo_driver_t *this_gen, int property, int value) { dxr3_driver_t *this = (dxr3_driver_t *)this_gen; int val, bcs_changed = 0; @@ -985,7 +985,7 @@ static int dxr3_set_property(xine_vo_driver_t *this_gen, int property, int value return value; } -static void dxr3_get_property_min_max(xine_vo_driver_t *this_gen, int property, +static void dxr3_get_property_min_max(vo_driver_t *this_gen, int property, int *min, int *max) { switch (property) { @@ -1001,7 +1001,7 @@ static void dxr3_get_property_min_max(xine_vo_driver_t *this_gen, int property, } } -static int dxr3_gui_data_exchange(xine_vo_driver_t *this_gen, int data_type, void *data) +static int dxr3_gui_data_exchange(vo_driver_t *this_gen, int data_type, void *data) { #ifdef HAVE_X11 dxr3_driver_t *this = (dxr3_driver_t *)this_gen; @@ -1059,7 +1059,7 @@ static int dxr3_gui_data_exchange(xine_vo_driver_t *this_gen, int data_type, voi return 0; } -static void dxr3_dispose(xine_vo_driver_t *this_gen) +static void dxr3_dispose(vo_driver_t *this_gen) { dxr3_driver_t *this = (dxr3_driver_t *)this_gen; int val = EM8300_OVERLAY_MODE_OFF; diff --git a/src/dxr3/video_out_dxr3.h b/src/dxr3/video_out_dxr3.h index 83d7f80d2..70f65d8ac 100644 --- a/src/dxr3/video_out_dxr3.h +++ b/src/dxr3/video_out_dxr3.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: video_out_dxr3.h,v 1.12 2002/10/26 14:35:05 mroi Exp $ + * $Id: video_out_dxr3.h,v 1.13 2002/11/20 11:57:42 mroi Exp $ */ #ifdef HAVE_CONFIG_H @@ -80,7 +80,7 @@ typedef struct dxr3_driver_class_s { } dxr3_driver_class_t; typedef struct dxr3_driver_s { - xine_vo_driver_t vo_driver; + vo_driver_t vo_driver; dxr3_driver_class_t *class; int fd_control; |