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