libspark/record: Implement writer thread. May or may not improve anything.

Origin commit data
------------------
Branch: master
Commit: ada3f5e24a
Author: martii <m4rtii@gmx.de>
Date: 2014-06-08 (Sun, 08 Jun 2014)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
martii
2014-06-08 19:27:12 +02:00
parent f8b460fc98
commit c6fe034f4c
2 changed files with 89 additions and 105 deletions

View File

@@ -2,6 +2,7 @@
#define __RECORD_TD_H
#include <pthread.h>
#include <semaphore.h>
#include "dmx_lib.h"
#define REC_STATUS_OK 0
@@ -32,6 +33,11 @@ class cRecord
int bufsize_dmx;
void (*failureCallback)(void *);
void *failureData;
sem_t sem;
#define RECORD_WRITER_CHUNKS 16
unsigned char *io_buf[RECORD_WRITER_CHUNKS];
size_t io_len[RECORD_WRITER_CHUNKS];
public:
cRecord(int num = 0, int bs_dmx = 100 * 188 * 1024, int bs = 100 * 188 * 1024);
void setFailureCallback(void (*f)(void *), void *d) { failureCallback = f; failureData = d; }
@@ -46,5 +52,6 @@ class cRecord
bool ChangePids(unsigned short vpid, unsigned short *apids, int numapids);
void RecordThread();
void WriterThread();
};
#endif