openMSX
AviWriter.hh
Go to the documentation of this file.
1// Code based on DOSBox-0.65
2
3#ifndef AVIWRITER_HH
4#define AVIWRITER_HH
5
6#include "ZMBVEncoder.hh"
7#include "File.hh"
8#include "endian.hh"
9#include <cstdint>
10#include <vector>
11
12namespace openmsx {
13
14class Filename;
15class FrameSource;
16
18{
19public:
20 AviWriter(const Filename& filename, unsigned width, unsigned height,
21 unsigned bpp, unsigned channels, unsigned freq);
22 ~AviWriter();
23 void addFrame(FrameSource* frame, unsigned samples, int16_t* sampleData);
24 void setFps(float fps_) { fps = fps_; }
25
26private:
27 void addAviChunk(const char* tag, size_t size, const void* data, unsigned flags);
28
29private:
30 File file;
31 ZMBVEncoder codec;
32 std::vector<Endian::L32> index;
33
34 float fps;
35 const unsigned width;
36 const unsigned height;
37 const unsigned channels;
38 const unsigned audiorate;
39
40 unsigned frames;
41 unsigned audiowritten;
42 unsigned written;
43};
44
45} // namespace openmsx
46
47#endif
void addFrame(FrameSource *frame, unsigned samples, int16_t *sampleData)
Definition: AviWriter.cc:268
void setFps(float fps_)
Definition: AviWriter.hh:24
AviWriter(const Filename &filename, unsigned width, unsigned height, unsigned bpp, unsigned channels, unsigned freq)
Definition: AviWriter.cc:18
This class represents a filename.
Definition: Filename.hh:18
Interface for getting lines from a video frame.
Definition: FrameSource.hh:17
This file implemented 3 utility functions:
Definition: Autofire.cc:9
constexpr const char *const filename
size_t size(std::string_view utf8)