diff options
-rw-r--r-- | src/video_out/video_out_xshm.c | 55 | ||||
-rw-r--r-- | src/xine-engine/audio_decoder.c | 7 | ||||
-rw-r--r-- | src/xine-engine/monitor.c | 22 | ||||
-rw-r--r-- | src/xine-engine/monitor.h | 6 | ||||
-rw-r--r-- | src/xine-engine/video_decoder.c | 17 | ||||
-rw-r--r-- | src/xine-engine/video_out.c | 18 | ||||
-rw-r--r-- | src/xine-engine/xine.c | 12 |
7 files changed, 65 insertions, 72 deletions
diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c index 34f7f55cb..17adbfbb2 100644 --- a/src/video_out/video_out_xshm.c +++ b/src/video_out/video_out_xshm.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_xshm.c,v 1.32 2001/09/10 00:53:06 miguelfreitas Exp $ + * $Id: video_out_xshm.c,v 1.33 2001/09/10 13:36:56 jkeil Exp $ * * video_out_xshm.c, X11 shared memory extension interface for xine * @@ -125,13 +125,16 @@ typedef struct xshm_driver_s { int gui_width; /* size of gui window */ int gui_height; - int gui_size_changed; + int gui_changed; int dest_x; int dest_y; /* display anatomy */ double display_ratio; /* given by visual parameter from init function */ + /* profiler */ + int prof_yuv2rgb; + /* gui callbacks */ void (*request_dest_size) (int video_width, int video_height, @@ -143,6 +146,11 @@ typedef struct xshm_driver_s { } xshm_driver_t; +/* possible values for xshm_driver_t, field gui_changed */ +#define GUI_SIZE_CHANGED 1 +#define GUI_ASPECT_CHANGED 2 + + int gX11Fail; /* @@ -326,23 +334,6 @@ static void dispose_ximage (xshm_driver_t *this, } } -#ifdef ARCH_X86 -#undef DETAILED_TIMING /* define as 1 to get cpu cycle timing for */ - /* the yuv2rgb conversion below */ - -#define CPU_MHZ 908 /* your cpu's frequency, in Mhz */ - /* My A7V board operates the 900Mhz T'bird */ - /* at 908Mhz? */ -#endif - -#ifdef DETAILED_TIMING -static inline uint64_t rdtsc() -{ - uint64_t tsc; - __asm__ __volatile__("rdtsc" : "=A"(tsc)); - return tsc; -} -#endif /* * and now, the driver functions @@ -356,10 +347,7 @@ static void xshm_frame_copy (vo_frame_t *vo_img, uint8_t **src) { xshm_frame_t *frame = (xshm_frame_t *) vo_img ; xshm_driver_t *this = (xshm_driver_t *) vo_img->instance->driver; -#ifdef DETAILED_TIMING - uint64_t tsc = rdtsc(); - uint32_t cycles; -#endif + profiler_start_count (this->prof_yuv2rgb); if (frame->format == IMGFMT_YV12) { this->yuv2rgb->yuv2rgb_fun (this->yuv2rgb, frame->rgb_dst, @@ -371,10 +359,7 @@ static void xshm_frame_copy (vo_frame_t *vo_img, uint8_t **src) { } -#ifdef DETAILED_TIMING - cycles = rdtsc() - tsc; - printf("yuv2rgb: %u cycles, %d µsec\n", cycles, cycles/CPU_MHZ); -#endif + profiler_stop_count (this->prof_yuv2rgb); frame->rgb_dst += frame->stripe_inc; } @@ -579,13 +564,13 @@ static void xshm_update_frame_format (vo_driver_t *this_gen, || (height != this->delivered_height) || (ratio_code != this->delivered_ratio_code) || (flags != this->delivered_flags) - || this->gui_size_changed) { + || this->gui_changed) { this->delivered_width = width; this->delivered_height = height; this->delivered_ratio_code = ratio_code; this->delivered_flags = flags; - this->gui_size_changed = 0; + this->gui_changed = 0; xshm_calc_output_size (this); @@ -834,12 +819,7 @@ static int xshm_set_property (vo_driver_t *this_gen, if (value>ASPECT_DVB) value = ASPECT_AUTO; this->user_ratio = value; - -#if 0 - xshm_calc_output_size (this); -#else - this->gui_size_changed = 1; -#endif + this->gui_changed |= GUI_ASPECT_CHANGED; } else { printf ("video_out_xshm: tried to set unsupported property %d\n", property); @@ -922,7 +902,7 @@ static int xshm_gui_data_exchange (vo_driver_t *this_gen, this->gui_width = area->w; this->gui_height = area->h; - this->gui_size_changed = 1; + this->gui_changed |= GUI_SIZE_CHANGED; } XUnlockDisplay (this->display); @@ -1059,6 +1039,9 @@ vo_driver_t *init_video_out_plugin (config_values_t *config, void *visual_gen) { this->gc = XCreateGC (this->display, this->drawable, 0, NULL); + this->prof_yuv2rgb = profiler_allocate_slot ("xshm yuv2rgb convert"); + printf("xshm, yuv2rgb profiler %d\n", this->prof_yuv2rgb); + this->vo_driver.get_capabilities = xshm_get_capabilities; this->vo_driver.alloc_frame = xshm_alloc_frame; this->vo_driver.update_frame_format = xshm_update_frame_format; diff --git a/src/xine-engine/audio_decoder.c b/src/xine-engine/audio_decoder.c index 76bf4d03c..f85ee2d29 100644 --- a/src/xine-engine/audio_decoder.c +++ b/src/xine-engine/audio_decoder.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: audio_decoder.c,v 1.35 2001/09/10 03:04:48 guenter Exp $ + * $Id: audio_decoder.c,v 1.36 2001/09/10 13:36:56 jkeil Exp $ * * * functions that implement audio decoding @@ -41,6 +41,7 @@ void *audio_decoder_loop (void *this_gen) { int running = 1; int i,j; audio_decoder_t *decoder; + int prof_audio_decode = profiler_allocate_slot ("audio decoder/output"); while (running) { @@ -130,7 +131,7 @@ void *audio_decoder_loop (void *this_gen) { if (this->audio_mute) break; - profiler_start_count (1); + profiler_start_count (prof_audio_decode); if ( (buf->type & 0xFF000000) == BUF_AUDIO_BASE ) { @@ -197,7 +198,7 @@ void *audio_decoder_loop (void *this_gen) { } else printf ("audio_loop: unknown buffer type: %08x\n", buf->type); - profiler_stop_count (1); + profiler_stop_count (prof_audio_decode); } buf->free_buffer (buf); diff --git a/src/xine-engine/monitor.c b/src/xine-engine/monitor.c index ed490c89c..05ac994a6 100644 --- a/src/xine-engine/monitor.c +++ b/src/xine-engine/monitor.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: monitor.c,v 1.4 2001/09/06 13:39:36 jkeil Exp $ + * $Id: monitor.c,v 1.5 2001/09/10 13:36:56 jkeil Exp $ * * debug print and profiling functions - implementation * @@ -32,7 +32,7 @@ #include "utils.h" #include "monitor.h" -#define MAX_ID 5 +#define MAX_ID 10 #ifdef DEBUG @@ -51,10 +51,20 @@ void profiler_init () { } } -void profiler_set_label (int id, char *label) { +int profiler_allocate_slot (char *label) { + int id; + + for (id = 0; id < MAX_ID && profiler_label[id] != NULL; id++) + ; + + if (id >= MAX_ID) + return -1; + profiler_label[id] = label; + return id; } + #ifdef ARCH_X86 __inline__ unsigned long long int rdtsc() { @@ -65,12 +75,18 @@ __inline__ unsigned long long int rdtsc() #endif void profiler_start_count (int id) { + + if ((unsigned)id >= MAX_ID) return; + #ifdef ARCH_X86 profiler_start[id] = rdtsc(); #endif } void profiler_stop_count (int id) { + + if ((unsigned)id >= MAX_ID) return; + #ifdef ARCH_X86 profiler_times[id] += rdtsc() - profiler_start[id]; #endif diff --git a/src/xine-engine/monitor.h b/src/xine-engine/monitor.h index 316e855d7..6acb7ea9e 100644 --- a/src/xine-engine/monitor.h +++ b/src/xine-engine/monitor.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: monitor.h,v 1.4 2001/09/06 18:38:12 jkeil Exp $ + * $Id: monitor.h,v 1.5 2001/09/10 13:36:56 jkeil Exp $ * * debug print and profiling functions * @@ -81,7 +81,7 @@ extern uint32_t xine_debug; void profiler_init (); -void profiler_set_label (int id, char *label); +int profiler_allocate_slot (char *label); void profiler_start_count (int id); @@ -100,7 +100,7 @@ void profiler_print_results (); #endif #define profiler_init() -#define profiler_set_label(id, label) +#define profiler_allocate_slot(label) (-1) #define profiler_start_count(id) #define profiler_stop_count(id) #define profiler_print_results() diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c index 3b4dd558f..4005c3b4e 100644 --- a/src/xine-engine/video_decoder.c +++ b/src/xine-engine/video_decoder.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_decoder.c,v 1.47 2001/09/09 15:39:47 jkeil Exp $ + * $Id: video_decoder.c,v 1.48 2001/09/10 13:36:56 jkeil Exp $ * */ @@ -55,7 +55,8 @@ void *video_decoder_loop (void *this_gen) { int streamtype; video_decoder_t *decoder; spu_decoder_t *spu_decoder; - + int prof_video_decode = profiler_allocate_slot ("video decoder"); + int prof_spu_decode = profiler_allocate_slot ("spu decoder"); while (running) { @@ -98,18 +99,18 @@ void *video_decoder_loop (void *this_gen) { break; case BUF_SPU_CLUT: - profiler_start_count (3); + profiler_start_count (prof_spu_decode); spu_decoder = update_spu_decoder(this, buf->type); if (spu_decoder) spu_decoder->decode_data (spu_decoder, buf); - profiler_stop_count (3); + profiler_stop_count (prof_spu_decode); break; case BUF_SPU_PACKAGE: - profiler_start_count (3); + profiler_start_count (prof_spu_decode); /* now, decode this buffer if it's the right track */ if ( (buf->type & 0xFFFF)== this->spu_channel) { @@ -121,7 +122,7 @@ void *video_decoder_loop (void *this_gen) { } - profiler_stop_count (3); + profiler_stop_count (prof_spu_decode); break; case BUF_CONTROL_END: @@ -167,7 +168,7 @@ void *video_decoder_loop (void *this_gen) { break; default: - profiler_start_count (0); + profiler_start_count (prof_video_decode); if ( (buf->type & 0xFF000000) == BUF_VIDEO_BASE ) { @@ -200,7 +201,7 @@ void *video_decoder_loop (void *this_gen) { } else printf ("video_decoder: unknown buffer type: %08x\n", buf->type); - profiler_stop_count (0); + profiler_stop_count (prof_video_decode); break; diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index a32bc8543..3eb7ddff9 100644 --- a/src/xine-engine/video_out.c +++ b/src/xine-engine/video_out.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.c,v 1.42 2001/09/09 15:39:47 jkeil Exp $ + * $Id: video_out.c,v 1.43 2001/09/10 13:36:56 jkeil Exp $ * */ @@ -143,6 +143,8 @@ static void *video_out_loop (void *this_gen) { uint32_t video_step, video_step_new; vo_instance_t *this = (vo_instance_t *) this_gen; sigset_t vo_mask; + int prof_video_out = profiler_allocate_slot ("video output"); + int prof_spu_blend = profiler_allocate_slot ("spu blend"); /* int dummysignum; */ @@ -180,7 +182,7 @@ static void *video_out_loop (void *this_gen) { /* sigwait(&vo_mask, &dummysignum); */ /* wait for next timer tick */ pause (); - profiler_start_count (2); + profiler_start_count (prof_video_out); video_step_new = this->metronom->get_video_rate (this->metronom); if (video_step_new != video_step) { @@ -198,7 +200,7 @@ static void *video_out_loop (void *this_gen) { img = this->display_img_buf_queue->first; if (!img) { - profiler_stop_count (2); + profiler_stop_count (prof_video_out); continue; } @@ -253,7 +255,7 @@ static void *video_out_loop (void *this_gen) { */ if (diff<0) { - profiler_stop_count (2); + profiler_stop_count (prof_video_out); continue; } @@ -267,7 +269,7 @@ static void *video_out_loop (void *this_gen) { img = vo_remove_from_img_buf_queue (this->display_img_buf_queue); if (!img) { - profiler_stop_count (2); + profiler_stop_count (prof_video_out); continue; } @@ -285,18 +287,18 @@ static void *video_out_loop (void *this_gen) { * for flushing it's buffers. So don't remove it! */ vo_overlay_t *ovl; - profiler_start_count (4); + profiler_start_count (prof_spu_blend); ovl = this->overlay_source->get_overlay (this->overlay_source, img->PTS); if (ovl && this->driver->overlay_blend) this->driver->overlay_blend (this->driver, img, ovl); - profiler_stop_count (4); + profiler_stop_count (prof_spu_blend); } this->driver->display_frame (this->driver, img); - profiler_stop_count (2); + profiler_stop_count (prof_video_out); } /* diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index b78b3a994..837a3180d 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.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: xine.c,v 1.59 2001/09/10 03:04:48 guenter Exp $ + * $Id: xine.c,v 1.60 2001/09/10 13:36:56 jkeil Exp $ * * top-level xine functions * @@ -408,16 +408,6 @@ xine_t *xine_init (vo_driver_t *vo, xine_debug = config->lookup_int (config, "xine_debug", 0); /* - * set up profiler - */ - profiler_init(); - profiler_set_label (0, "video decoder "); - profiler_set_label (1, "audio decoder/output "); - profiler_set_label (2, "video output "); - profiler_set_label (3, "spu decoder "); - profiler_set_label (4, "spu blend "); - - /* * init lock */ |