filepush: convert default buffersize into a #define
authorMirakels <mirakels@openpli.org>
Sat, 26 Dec 2015 11:06:52 +0000 (12:06 +0100)
committerMirakels <mirakels@openpli.org>
Sat, 26 Dec 2015 11:08:56 +0000 (12:08 +0100)
lib/base/filepush.h

index 22af20e..20ae075 100644 (file)
@@ -8,6 +8,14 @@
 #include <sys/types.h>
 #include <lib/base/rawfile.h>
 
+#ifndef FILEPUSH_BUFSIZE
+# define FILEPUSH_BUFSIZE 188*1024
+#endif
+
+#ifndef FILEPUSH_RECBUFSIZE
+# define FILEPUSH_RECBUFSIZE 188*1024
+#endif
+
 class iFilePushScatterGather
 {
 public:
@@ -18,7 +26,7 @@ public:
 class eFilePushThread: public eThread, public Object
 {
 public:
-       eFilePushThread(int prio_class=IOPRIO_CLASS_BE, int prio_level=0, int blocksize=188, size_t buffersize=188*1024);
+       eFilePushThread(int prio_class=IOPRIO_CLASS_BE, int prio_level=0, int blocksize=188, size_t buffersize=FILEPUSH_BUFSIZE);
        ~eFilePushThread();
        void thread();
        void stop();
@@ -65,7 +73,7 @@ private:
 class eFilePushThreadRecorder: public eThread, public Object
 {
 public:
-       eFilePushThreadRecorder(unsigned char* buffer, size_t buffersize=188*1024);
+       eFilePushThreadRecorder(unsigned char* buffer, size_t buffersize=FILEPUSH_RECBUFSIZE);
        void thread();
        void stop();
        void start(int sourcefd);