diff options
author | Juergen Keil <jkeil@users.sourceforge.net> | 2001-09-10 13:36:56 +0000 |
---|---|---|
committer | Juergen Keil <jkeil@users.sourceforge.net> | 2001-09-10 13:36:56 +0000 |
commit | d9f6f14d5110787be31160ef4956bebe572cba4d (patch) | |
tree | c80f06c376a1ce653c1150a5fcaa5a93f1646a31 /src/xine-engine | |
parent | 6fdc5685796399e9ddea30b7dcffc607bd4c10b3 (diff) | |
download | xine-lib-d9f6f14d5110787be31160ef4956bebe572cba4d.tar.gz xine-lib-d9f6f14d5110787be31160ef4956bebe572cba4d.tar.bz2 |
Dynamically allocate the profiler IDs, and add a profiler for video_out_xshm's
yuv2rgb conversion
CVS patchset: 601
CVS date: 2001/09/10 13:36:56
Diffstat (limited to 'src/xine-engine')
-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 |
6 files changed, 46 insertions, 36 deletions
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 */ |