8#include <vorbis/codec.h>
9#include <theora/theoradec.h>
27 std::array<std::array<float, MAX_SAMPLES>, 2>
pcm;
32 explicit Frame(
const th_ycbcr_buffer& yuv);
54 bool seek(
size_t frame,
size_t sample);
55 [[nodiscard]]
unsigned getSampleRate()
const {
return narrow<unsigned>(vi.rate); }
58 [[nodiscard]]
size_t getFrames()
const {
return totalFrames; }
62 [[nodiscard]]
bool stopFrame(
size_t frame)
const;
63 [[nodiscard]]
size_t getChapter(
int chapterNo)
const;
67 void readTheora(ogg_packet* packet);
68 void theoraHeaderPage(ogg_page* page, th_info& ti, th_comment& tc,
70 void readMetadata(th_comment& tc);
71 void readVorbis(ogg_packet* packet);
72 void vorbisHeaderPage(ogg_page* page);
73 bool nextPage(ogg_page* page);
75 void recycleAudio(std::unique_ptr<AudioFragment> audio);
76 void vorbisFoundPosition();
77 size_t frameNo(
const ogg_packet* packet)
const;
79 size_t findOffset(
size_t frame,
size_t sample);
80 size_t bisection(
size_t frame,
size_t sample,
81 size_t maxOffset,
size_t maxSamples,
size_t maxFrames);
96 ogg_stream_state vorbisStream, theoraStream;
99 int skeletonSerial{-1};
100 size_t fileOffset{0};
104 th_dec_ctx* theora{
nullptr};
106 size_t keyFrame{size_t(-1)};
107 size_t currentFrame{1};
112 std::vector<std::unique_ptr<Frame>> recycleFrameList;
120 size_t currentSample{0};
123 std::list<std::unique_ptr<AudioFragment>> audioList;
127 std::vector<size_t> stopFrames;
128 struct ChapterFrame {
132 std::vector<ChapterFrame> chapters;
This implements a queue on top of circular_buffer (not part of boost).
This class represents a filename.
bool stopFrame(size_t frame) const
void getFrameNo(RawFrame &frame, size_t frameno)
OggReader & operator=(const OggReader &)=delete
const AudioFragment * getAudio(size_t sample)
OggReader(const OggReader &)=delete
unsigned getSampleRate() const
size_t getChapter(int chapterNo) const
OggReader & operator=(OggReader &&)=delete
bool seek(size_t frame, size_t sample)
OggReader(OggReader &&)=delete
A video frame as output by the VDP scanline conversion unit, before any postprocessing filters are ap...
This file implemented 3 utility functions:
static constexpr size_t UNKNOWN_POS
static constexpr unsigned MAX_SAMPLES
std::array< std::array< float, MAX_SAMPLES >, 2 > pcm
Frame(const Frame &)=delete
Frame & operator=(Frame &&)=delete
Frame & operator=(const Frame &)=delete