callback from AVIOContext
| 203 | |
| 204 | /// callback from AVIOContext |
| 205 | static int64_t stream_seek_function(void* opaque, int64_t offset, int whence) { |
| 206 | auto& state = *reinterpret_cast<VideoReaderState*>(opaque); |
| 207 | switch (whence) { |
| 208 | case AVSEEK_SIZE: |
| 209 | return state.streamLength_; |
| 210 | case AVSEEK_FORCE: |
| 211 | state.streamPosition_ = offset; |
| 212 | break; |
| 213 | case SEEK_SET: |
| 214 | state.streamPosition_ = offset; |
| 215 | break; |
| 216 | case SEEK_CUR: |
| 217 | state.streamPosition_ += offset; |
| 218 | break; |
| 219 | case SEEK_END: |
| 220 | state.streamPosition_ = state.streamLength_ + offset; |
| 221 | break; |
| 222 | } |
| 223 | |
| 224 | return state.streamPosition_; |
| 225 | } |
| 226 | |
| 227 | VideoReaderState::VideoReaderState( |
| 228 | const std::shared_ptr<const Array>& contents) { |
nothing calls this directly
no outgoing calls
no test coverage detected