mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11:43 +00:00
Start adding support for non-MJPEG frame types.
Not yet supported by MJPEGServer.
This commit is contained in:
17
src/Frame.h
17
src/Frame.h
@@ -37,6 +37,8 @@ class Frame {
|
||||
std::size_t size;
|
||||
std::size_t capacity;
|
||||
VideoMode::PixelFormat pixelFormat;
|
||||
int width;
|
||||
int height;
|
||||
};
|
||||
|
||||
public:
|
||||
@@ -81,11 +83,26 @@ class Frame {
|
||||
return m_data->data;
|
||||
}
|
||||
|
||||
char* data() {
|
||||
if (!m_data) return nullptr;
|
||||
return m_data->data;
|
||||
}
|
||||
|
||||
VideoMode::PixelFormat GetPixelFormat() const {
|
||||
if (!m_data) return VideoMode::kUnknown;
|
||||
return m_data->pixelFormat;
|
||||
}
|
||||
|
||||
int width() const {
|
||||
if (!m_data) return 0;
|
||||
return m_data->width;
|
||||
}
|
||||
|
||||
int height() const {
|
||||
if (!m_data) return 0;
|
||||
return m_data->height;
|
||||
}
|
||||
|
||||
Time time() const {
|
||||
if (!m_data) return Time{};
|
||||
return m_data->time;
|
||||
|
||||
Reference in New Issue
Block a user