12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- #pragma once
- #include <map>
- #include "../nsavi/avi_header.h"
- namespace nsavi
- {
- struct HeaderList;
- struct SeekEntry
- {
- SeekEntry(int dummy=0) : timestamp(0), absolute(false) {}
- int timestamp;
- bool absolute;
- uint64_t file_position = 0;
- #ifdef SEEK_TABLE_STORE_CHUNK_HEADER
- uint32_t chunk_id;
- uint32_t chunk_size;
- #endif
- uint64_t stream_time = 0;
- };
- class SeekTable
- {
- public:
- SeekTable(int stream_number, bool require_keyframes, const nsavi::HeaderList *header_list);
- ~SeekTable();
- enum
- {
- SEEK_WHATEVER=0,
- SEEK_FORWARD=1,
- SEEK_BACKWARD=2,
- };
- const SeekEntry *GetSeekPoint(int ×tamp_ms, int current_ms=0, int seek_direction=SEEK_WHATEVER);
- void AddIndex(const IDX1 *index);
- void AddIndex(const INDX *index, uint64_t start_time);
-
-
- bool GetIndexLocation(int timestamp, uint64_t *position, uint64_t *start_time);
-
- typedef std::map<int, SeekEntry> SeekEntries;
- SeekEntries seek_entries;
- std::map<const void *, bool> data_processed;
- const nsavi::HeaderList *header_list;
- int stream_number;
- bool require_keyframes;
- const nsavi::STRH *stream;
- const nsavi::AVISUPERINDEX *super_index;
- uint32_t indices_processed;
- uint64_t super_index_duration;
- };
- }
|