MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / getBytes

Method getBytes

src/Qt/VideoCacheThread.cpp:107–118  ·  view source on GitHub ↗

Get the size in bytes of a frame (rough estimate)

Source from the content-addressed store, hash-verified

105
106 // Get the size in bytes of a frame (rough estimate)
107 int64_t VideoCacheThread::getBytes(int width,
108 int height,
109 int sample_rate,
110 int channels,
111 float fps)
112 {
113 // RGBA video frame
114 int64_t bytes = static_cast<int64_t>(width) * height * sizeof(char) * 4;
115 // Approximate audio: (sample_rate * channels)/fps samples per frame
116 bytes += ((sample_rate * channels) / fps) * sizeof(float);
117 return bytes;
118 }
119
120 /// Start the cache thread at high priority, and return true if it’s actually running.
121 bool VideoCacheThread::StartThread()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected