MCPcopy Create free account
hub / github.com/AbyssEngine/AbyssEngineOld / videoStreamSeek

Method videoStreamSeek

src/Abyss/Streams/VideoStream.cpp:95–120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95int64_t VideoStream::videoStreamSeek(const int64_t offset, const int whence) {
96 if (!_isPlaying)
97 return -1;
98 _stream.clear();
99
100 std::ios_base::seekdir dir;
101
102 switch (whence) {
103 case SEEK_SET:
104 dir = std::ios_base::beg;
105 break;
106 case SEEK_CUR:
107 dir = std::ios_base::cur;
108 break;
109 case SEEK_END:
110 dir = std::ios_base::end;
111 break;
112 case AVSEEK_SIZE:
113 return _stream.size();
114 default:
115 return -1;
116 }
117
118 _stream.seekg(offset, dir);
119 return _stream.tellg();
120}
121
122VideoStream::VideoStream(FileSystem::InputStream stream, std::optional<FileSystem::InputStream> separateAudio)
123 : _stream(std::move(stream)), _ringBuffer(1024 * 4096), _texture(nullptr, SDL_DestroyTexture), _videoCodecContext(), _audioCodecContext(), _avFrame(),

Callers 1

VideoStreamMethod · 0.80

Calls 2

clearMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected