| 22 | namespace dali { |
| 23 | |
| 24 | int MemoryVideoFile::Read(unsigned char *buffer, int buffer_size) { |
| 25 | int left_in_file = size_ - position_; |
| 26 | if (left_in_file <= 0) { |
| 27 | return AVERROR_EOF; |
| 28 | } |
| 29 | |
| 30 | int to_read = std::min(left_in_file, buffer_size); |
| 31 | std::copy(data_ + position_, data_ + position_ + to_read, buffer); |
| 32 | position_ += to_read; |
| 33 | return to_read; |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * @brief Method for seeking the memory video. It sets position according to provided arguments. |
no test coverage detected