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 
12 namespace openmsx {
13 
14 class Filename;
15 class FrameSource;
16 
17 class AviWriter
18 {
19 public:
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 
26 private:
27  void addAviChunk(const char* tag, unsigned size, void* data, unsigned flags);
28 
29  File file;
30  ZMBVEncoder codec;
31  std::vector<Endian::L32> index;
32 
33  float fps;
34  const unsigned width;
35  const unsigned height;
36  const unsigned channels;
37  const unsigned audiorate;
38 
39  unsigned frames;
40  unsigned audiowritten;
41  unsigned written;
42 };
43 
44 } // namespace openmsx
45 
46 #endif
openmsx::AviWriter::AviWriter
AviWriter(const Filename &filename, unsigned width, unsigned height, unsigned bpp, unsigned channels, unsigned freq)
Definition: AviWriter.cc:17
utf8::unchecked::size
size_t size(std::string_view utf8)
Definition: utf8_unchecked.hh:227
ZMBVEncoder.hh
openmsx::AviWriter::setFps
void setFps(float fps_)
Definition: AviWriter.hh:24
File.hh
openmsx::filename
constexpr const char *const filename
Definition: FirmwareSwitch.cc:10
openmsx::AviWriter::addFrame
void addFrame(FrameSource *frame, unsigned samples, int16_t *sampleData)
Definition: AviWriter.cc:264
openmsx::AviWriter
Definition: AviWriter.hh:17
endian.hh
openmsx::ZMBVEncoder
Definition: ZMBVEncoder.hh:16
openmsx::File
Definition: File.hh:15
openmsx::Filename
Filename
Definition: Filename.cc:50
openmsx::FrameSource
Interface for getting lines from a video frame.
Definition: FrameSource.hh:13
openmsx::Filename
This class represents a filename.
Definition: Filename.hh:17
openmsx::AviWriter::~AviWriter
~AviWriter()
Definition: AviWriter.cc:38
openmsx
Thanks to enen for testing this on a real cartridge:
Definition: Autofire.cc:5