Revision e816f3de

View differences:

Makefile
96 96
OBJS += measures.o
97 97
endif
98 98

  
99
OBJS += output-grapes.o
99 100
IO ?= grapes
100 101
ifeq ($(IO), grapes)
101 102
CFLAGS += -DIO_GRAPES
102
OBJS += input-grapes.o output-grapes.o
103
CFLAGS += -DOUTPUT_REORDER=true
104
OBJS += input-grapes.o
103 105
ifdef FFMPEG_DIR
104 106
CPPFLAGS += -I$(FFMPEG_DIR)
105 107
LDFLAGS += -L$(FFMPEG_DIR)/libavcodec -L$(FFMPEG_DIR)/libavformat -L$(FFMPEG_DIR)/libavutil -L$(FFMPEG_DIR)/libavcore -L$(FFMPEG_DIR)/lib
......
120 122
endif
121 123
ifeq ($(IO), chunkstream)
122 124
CFLAGS += -DIO_CHUNKSTREAM
125
CFLAGS += -DOUTPUT_REORDER=false
123 126
OBJS += input-chunkstream.o output-chunkstream.o
124 127
endif
125 128

  
output-chunkstream.c
22 22
#endif
23 23

  
24 24
#include <chunk.h>
25
#include <chunkiser.h>
25 26
#include <trade_msg_la.h>
26 27

  
27
#include "output.h"
28 28
#include "measures.h"
29 29
#include "dbg.h"
30 30

  
......
104 104
  }
105 105
}
106 106

  
107
void output_init(int bufsize, const char *fn)
107
struct output_stream *out_stream_init(const char *fn, const char *config)
108 108
{
109 109
  if (fn) fname = strdup(fn);
110 110
  output_connect();
111
  return 1;	//TODO: create real output_stream structure
111 112
}
112 113

  
113
void output_deliver(const struct chunk *c)
114
void chunk_write(struct output_stream *out, const struct chunk *c)
114 115
{
115 116
  static char sendbuf[BUFSIZE];
116 117
  static int pos = 0;
output-grapes.c
27 27
static char sflag = 0;
28 28
static char eflag = 0;
29 29

  
30
bool reorder = OUTPUT_REORDER;
31

  
30 32
struct outbuf {
31 33
  struct chunk c;
32 34
};
......
94 96
        fprintf(stderr, "\nFirst chunk id played out: %d\n\n",buff[i].c.id);
95 97
        sflag = 1;
96 98
      }
97
      chunk_write(out, &buff[i].c);
99
      if (reorder) chunk_write(out, &buff[i].c);
98 100
      last_chunk = buff[i].c.id;
99 101
    } else if (eflag == 0 && last_chunk != -1) {
100 102
      fprintf(stderr, "\nLast chunk id played out: %d\n\n", last_chunk);
......
129 131
    output_init(8, NULL);
130 132
  }
131 133

  
134
  if (!reorder) chunk_write(out, c);
135

  
132 136
  dprintf("Chunk %d delivered\n", c->id);
133 137
  buffer_print();
134 138
  if (c->id < next_chunk) {
......
169 173
          fprintf(stderr, "\nFirst chunk id played out: %d\n\n",c->id);
170 174
          sflag = 1;
171 175
        }
172
        chunk_write(out, c);
176
        if (reorder) chunk_write(out, c);
173 177
        last_chunk = c->id;
174 178
      } else if (eflag == 0 && last_chunk != -1) {
175 179
        fprintf(stderr, "\nLast chunk id played out: %d\n\n", last_chunk);

Also available in: Unified diff