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 <span>
11#include <vector>
12
13namespace openmsx {
14
15class Filename;
16class FrameSource;
17
19{
20public:
21 AviWriter(const Filename& filename, unsigned width, unsigned height,
22 unsigned bpp, unsigned channels, unsigned freq);
23 ~AviWriter();
24 void addFrame(FrameSource* video, std::span<const int16_t> audio);
25 void setFps(float fps_) { fps = fps_; }
26
27private:
28 void addAviChunk(std::span<const char, 4> tag, size_t size, const void* data, unsigned flags);
29
30private:
31 File file;
32 ZMBVEncoder codec;
33 std::vector<Endian::L32> index;
34
35 float fps = 0.0f; // will be filled in later
36 const uint32_t width;
37 const uint32_t height;
38 const uint32_t channels;
39 const uint32_t audioRate;
40
41 uint32_t frames = 0;
42 uint32_t audioWritten = 0;
43 uint32_t written = 0;
44};
45
46} // namespace openmsx
47
48#endif
void setFps(float fps_)
Definition: AviWriter.hh:25
AviWriter(const Filename &filename, unsigned width, unsigned height, unsigned bpp, unsigned channels, unsigned freq)
Definition: AviWriter.cc:23
void addFrame(FrameSource *video, std::span< const int16_t > audio)
Definition: AviWriter.cc:274
This class represents a filename.
Definition: Filename.hh:18
Interface for getting lines from a video frame.
Definition: FrameSource.hh:20
This file implemented 3 utility functions:
Definition: Autofire.cc:9
size_t size(std::string_view utf8)