Statistics
| Branch: | Revision:

streamers / input-stream-dummy.c @ 46c24e94

History | View | Annotate | Download (548 Bytes)

1
#include <stdint.h>
2
#include <stdio.h>
3
#include <string.h>
4

    
5
#include "input-stream.h"
6

    
7
static struct input_stream {
8
} fake_descriptor;
9

    
10
struct input_stream *input_stream_open(const char *fname, int *period, uint16_t flags)
11
{
12
  *period = 40000;
13
  return &fake_descriptor;
14
}
15

    
16
void input_stream_close(struct input_stream *dummy)
17
{
18
}
19

    
20
uint8_t *chunkise(struct input_stream *dummy, int id, int *size, uint64_t *ts)
21
{
22
  static char buff[80];
23

    
24
  sprintf(buff, "Chunk %d", id);
25
  *ts = 40 * id * 1000;
26
  *size = strlen(buff) + 1;
27

    
28
  return strdup(buff);
29
}