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);
49 bool seek(
size_t frame,
size_t sample);
50 [[nodiscard]]
unsigned getSampleRate()
const {
return narrow<unsigned>(vi.rate); }
53 [[nodiscard]]
size_t getFrames()
const {
return totalFrames; }
57 [[nodiscard]]
bool stopFrame(
size_t frame)
const;
58 [[nodiscard]]
size_t getChapter(
int chapterNo)
const;
62 void readTheora(ogg_packet* packet);
63 void theoraHeaderPage(ogg_page* page, th_info& ti, th_comment& tc,
65 void readMetadata(th_comment& tc);
66 void readVorbis(ogg_packet* packet);
67 void vorbisHeaderPage(ogg_page* page);
68 bool nextPage(ogg_page* page);
70 void recycleAudio(std::unique_ptr<AudioFragment> audio);
71 void vorbisFoundPosition();
72 size_t frameNo(ogg_packet* packet)
const;
74 size_t findOffset(
size_t frame,
size_t sample);
75 size_t bisection(
size_t frame,
size_t sample,
76 size_t maxOffset,
size_t maxSamples,
size_t maxFrames);
91 ogg_stream_state vorbisStream, theoraStream;
94 int skeletonSerial{-1};
99 th_dec_ctx* theora{
nullptr};
101 size_t keyFrame{size_t(-1)};
102 size_t currentFrame{1};
107 std::vector<std::unique_ptr<Frame>> recycleFrameList;
115 size_t currentSample{0};
118 std::list<std::unique_ptr<AudioFragment>> audioList;
122 std::vector<size_t> stopFrames;
123 struct ChapterFrame {
127 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
bool seek(size_t frame, size_t sample)
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 th_ycbcr_buffer &yuv)