Get the size in bytes of this frame (rough estimate)
| 378 | |
| 379 | // Get the size in bytes of this frame (rough estimate) |
| 380 | int64_t Frame::GetBytes() |
| 381 | { |
| 382 | int64_t total_bytes = 0; |
| 383 | if (image) { |
| 384 | total_bytes += static_cast<int64_t>( |
| 385 | width * height * sizeof(char) * 4); |
| 386 | } |
| 387 | if (audio) { |
| 388 | // approximate audio size (sample rate / 24 fps) |
| 389 | total_bytes += (sample_rate / 24.0) * sizeof(float); |
| 390 | } |
| 391 | |
| 392 | // return size of this frame |
| 393 | return total_bytes; |
| 394 | } |
| 395 | |
| 396 | // Get pixel data (as packets) |
| 397 | const unsigned char* Frame::GetPixels() |
no outgoing calls
no test coverage detected