Switched to using a local debug header file, instead of using the private media kit file.

This should prevent mixer from beeing build with debug enabled, when media kit is build with debug.
Thus CPU usage will be reduced as mixer no longer prints a lot of information to stdout.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16759 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Marcus Overhagen 2006-03-13 11:34:24 +00:00
parent 8bf2c25330
commit f916862c2e
13 changed files with 14 additions and 36 deletions

View File

@ -20,7 +20,6 @@
#include "MixerInput.h"
#include "MixerOutput.h"
#include "MixerUtils.h"
#include "debug.h"
#define VERSION_STRING "0.4"
#define BUILD_STRING __DATE__ " " __TIME__

View File

@ -7,7 +7,7 @@
#include <MediaDefs.h>
#include <ByteOrder.h>
#include "ByteSwap.h"
#include "debug.h"
#include "MixerDebug.h"
static void swap_float(void *buffer, size_t bytecount);
static void swap_int32(void *buffer, size_t bytecount);

View File

@ -2,8 +2,6 @@ SubDir HAIKU_TOP src add-ons media media-add-ons mixer ;
SetSubDirSupportedPlatformsBeOSCompatible ;
UsePrivateHeaders media ;
Addon mixer.media_addon : media :
AudioMixer.cpp
ByteSwap.cpp
@ -21,4 +19,3 @@ Addon mixer.media_addon : media :
Package haiku-mixer-cvs
: mixer.media_addon
: boot home config add-ons media ;

View File

@ -12,7 +12,6 @@
#include "MixerUtils.h"
#include "AudioMixer.h"
#include "Resampler.h"
#include "debug.h"
#include "RtList.h"
#define DOUBLE_RATE_MIXING 0

View File

@ -1,8 +1,8 @@
#ifndef _MEDIA_DEBUG_H_
#define _MEDIA_DEBUG_H_
#ifndef _MIXER_DEBUG_H_
#define _MIXER_DEBUG_H_
#ifndef DEBUG
#define DEBUG 1
#define DEBUG 0
#endif
#include <Debug.h>
@ -13,40 +13,30 @@
#if DEBUG > 0
#define UNIMPLEMENTED() printf("UNIMPLEMENTED %s\n",__PRETTY_FUNCTION__)
inline void ERROR(const char *fmt, ...) { va_list ap; va_start(ap, fmt); printf("### ERROR: "); vprintf(fmt, ap); va_end(ap); }
inline void PRINT(int level, const char *fmt, ...) { va_list ap; if (level > DEBUG) return; va_start(ap, fmt); vprintf(fmt, ap); va_end(ap); }
#define PRINT_FORMAT(_text, _fmt) do { char _buf[300]; string_for_format((_fmt), _buf, sizeof(_buf)); printf("%s %s\n", (_text), (_buf)); } while (0)
#define PRINT_INPUT(_text, _in) do { char _buf[300]; string_for_format((_in).format, _buf, sizeof(_buf)); printf("%s node(node %ld, port %ld); source(port %ld, id %ld); dest(port %ld, id %ld); fmt(%s); name(%s)\n", (_text), (_in).node.node, (_in).node.port, (_in).source.port, (_in).source.id, (_in).destination.port, (_in).destination.id, _buf, (_in).name); } while (0)
#define PRINT_OUTPUT(_text, _out) do { char _buf[300]; string_for_format((_out).format, _buf, sizeof(_buf)); printf("%s node(node %ld, port %ld); source(port %ld, id %ld); dest(port %ld, id %ld); fmt(%s); name(%s)\n", (_text), (_out).node.node, (_out).node.port, (_out).source.port, (_out).source.id, (_out).destination.port, (_out).destination.id, _buf, (_out).name); } while (0)
#define PRINT_CHANNEL_MASK(fmt) do { char s[200]; StringForChannelMask(s, (fmt).u.raw_audio.channel_mask); printf(" channel_mask 0x%08lX %s\n", (fmt).u.raw_audio.channel_mask, s); } while (0)
#if DEBUG >= 2
#define BROKEN() printf("BROKEN %s\n",__PRETTY_FUNCTION__)
#define TRACE printf
#else
#define BROKEN() ((void)0)
#define TRACE(a...) ((void)0)
#endif
#if DEBUG >= 3
#define CALLED() printf("CALLED %s\n",__PRETTY_FUNCTION__)
#else
#define CALLED() ((void)0)
#endif
#else
#define PRINT_FORMAT(_text, _fmt) ((void)0)
#define PRINT_INPUT(_text, _in) ((void)0)
#define PRINT_OUTPUT(_text, _out) ((void)0)
#define UNIMPLEMENTED() ((void)0)
#define BROKEN() ((void)0)
#define CALLED() ((void)0)
#define PRINT_CHANNEL_MASK(fmt) ((void)0)
#define PRINT(l, a...) ((void)0)
#define ERROR(a...) ((void)0)
#define TRACE(a...) ((void)0)
#endif
#endif /* _MEDIA_DEBUG_H_ */
#endif /* _MIXER_DEBUG_H_ */

View File

@ -6,7 +6,6 @@
#include "MixerUtils.h"
#include "Resampler.h"
#include "ByteSwap.h"
#include "debug.h"
MixerInput::MixerInput(MixerCore *core, const media_input &input, float mixFrameRate, int32 mixFrameCount)
: fCore(core),

View File

@ -5,7 +5,7 @@
#include <MediaNode.h>
#include "MixerCore.h"
#include "MixerUtils.h" // DEBUG only
#include "debug.h"
#include "MixerDebug.h"
class ByteSwap;
class Resampler;

View File

@ -2,7 +2,7 @@
#include "MixerOutput.h"
#include "MixerCore.h"
#include "MixerUtils.h"
#include "debug.h"
#include "MixerDebug.h"
MixerOutput::MixerOutput(MixerCore *core, const media_output &output)
: fCore(core),

View File

@ -1,10 +1,10 @@
#ifndef _MIXER_OUTPUT_H
#define _MIXER_OUTPUT_H
#include "debug.h"
#include <Buffer.h>
#include "MixerDebug.h"
#include "ByteSwap.h"
#include "MixerCore.h"
#include <Buffer.h>
/* The data storage for channel sources is optimized
* for fast data retrieval by the MixerCore, which

View File

@ -10,7 +10,7 @@
#include "MixerInput.h"
#include "MixerOutput.h"
#include "MixerSettings.h"
#include "debug.h"
#include "MixerDebug.h"
#define SAVE_DELAY 5000000 // delay saving of settings for 5s
#define SAVE_RUNTIME 30000000 // stop save thread after 30s inactivity

View File

@ -8,7 +8,7 @@
#include "MixerInput.h"
#include "MixerOutput.h"
#include "MixerCore.h"
#include "debug.h"
#include "MixerDebug.h"
const char *StringForFormat(char *str, const media_format & format);

View File

@ -1,12 +1,6 @@
#ifndef _MIXER_UTILS_H
#define _MIXER_UTILS_H
#if DEBUG > 0
#define PRINT_CHANNEL_MASK(fmt) do { char s[200]; StringForChannelMask(s, (fmt).u.raw_audio.channel_mask); printf(" channel_mask 0x%08lX %s\n", (fmt).u.raw_audio.channel_mask, s); } while (0)
#else
#define PRINT_CHANNEL_MASK(fmt) ((void)0)
#endif
#ifndef __SGI_STL_INTERNAL_ALGOBASE_H
template<class t> const t & max(const t &t1, const t &t2) { return (t1 > t2) ? t1 : t2; }
template<class t> const t & min(const t &t1, const t &t2) { return (t1 < t2) ? t1 : t2; }

View File

@ -11,7 +11,7 @@
#include <MediaDefs.h>
#include "Resampler.h"
#include "debug.h"
#include "MixerDebug.h"
Resampler::Resampler(uint32 src_format, uint32 dst_format, int16 dst_valid_bits)
: fFunc(0)