Skip to content

Commit 44c6a76

Browse files
upper case enum alignment
1 parent 2816373 commit 44c6a76

3 files changed

Lines changed: 30 additions & 30 deletions

File tree

‎include/livekit/capture_source.h‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -130,21 +130,21 @@ enum class DeviceFrameFormat {
130130
/// Planar I420/YUV420P.
131131
I420 = 0,
132132
/// Biplanar NV12.
133-
Nv12 = 1,
133+
NV12 = 1,
134134
/// Packed BGRA.
135-
Bgra = 2,
135+
BGRA = 2,
136136
/// Packed RGB24.
137-
Rgb24 = 3,
137+
RGB24 = 3,
138138
/// Packed BGR24.
139-
Bgr24 = 4,
139+
BGR24 = 4,
140140
/// Packed YUYV/YUY2.
141-
Yuyv = 5,
141+
YUYV = 5,
142142
/// Packed UYVY.
143-
Uyvy = 6,
143+
UYVY = 6,
144144
/// Single-plane 8-bit luma.
145-
Grey = 7,
145+
GREY = 7,
146146
/// Encoded MJPEG frames.
147-
Mjpeg = 8,
147+
MJPEG = 8,
148148
};
149149

150150
/// Capture format offered by or requested from a device.
@@ -160,7 +160,7 @@ struct DeviceFormat {
160160
std::uint32_t framerate_fps = 0;
161161

162162
/// Frame format.
163-
DeviceFrameFormat frame_format = DeviceFrameFormat::Nv12;
163+
DeviceFrameFormat frame_format = DeviceFrameFormat::NV12;
164164

165165
DeviceFormat() = default;
166166

@@ -180,16 +180,16 @@ struct DeviceFormat {
180180
/// may substitute, so the delivered format can differ from the one requested:
181181
///
182182
/// - macOS accepts only @ref DeviceFrameFormat::I420,
183-
/// @ref DeviceFrameFormat::Nv12, and @ref DeviceFrameFormat::Bgra --
183+
/// @ref DeviceFrameFormat::NV12, and @ref DeviceFrameFormat::BGRA --
184184
/// requesting any other value fails creation -- and then delivers NV12
185185
/// regardless of which of the three was asked for.
186-
/// - V4L2 rejects @ref DeviceFrameFormat::I420 and @ref DeviceFrameFormat::Bgra.
186+
/// - V4L2 rejects @ref DeviceFrameFormat::I420 and @ref DeviceFrameFormat::BGRA.
187187
/// For @ref exact and @ref closest it tries the requested format first and
188188
/// then falls back through the formats it supports; for @ref highestFramerate
189189
/// and @ref highestResolution the constraint selects the format outright, with
190190
/// no fallback.
191191
///
192-
/// @ref DeviceFrameFormat::Nv12 is the only value both backends accept, which
192+
/// @ref DeviceFrameFormat::NV12 is the only value both backends accept, which
193193
/// is why it is @ref DeviceFormat's default.
194194
class LIVEKIT_API DeviceFormatRequest {
195195
public:

‎src/capture_source.cpp‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,21 @@ proto::DeviceFrameFormat toProto(DeviceFrameFormat format) {
5555
switch (format) {
5656
case DeviceFrameFormat::I420:
5757
return proto::DeviceFrameFormat::DEVICE_FRAME_FORMAT_I420;
58-
case DeviceFrameFormat::Nv12:
58+
case DeviceFrameFormat::NV12:
5959
return proto::DeviceFrameFormat::DEVICE_FRAME_FORMAT_NV12;
60-
case DeviceFrameFormat::Bgra:
60+
case DeviceFrameFormat::BGRA:
6161
return proto::DeviceFrameFormat::DEVICE_FRAME_FORMAT_BGRA;
62-
case DeviceFrameFormat::Rgb24:
62+
case DeviceFrameFormat::RGB24:
6363
return proto::DeviceFrameFormat::DEVICE_FRAME_FORMAT_RGB24;
64-
case DeviceFrameFormat::Bgr24:
64+
case DeviceFrameFormat::BGR24:
6565
return proto::DeviceFrameFormat::DEVICE_FRAME_FORMAT_BGR24;
66-
case DeviceFrameFormat::Yuyv:
66+
case DeviceFrameFormat::YUYV:
6767
return proto::DeviceFrameFormat::DEVICE_FRAME_FORMAT_YUYV;
68-
case DeviceFrameFormat::Uyvy:
68+
case DeviceFrameFormat::UYVY:
6969
return proto::DeviceFrameFormat::DEVICE_FRAME_FORMAT_UYVY;
70-
case DeviceFrameFormat::Grey:
70+
case DeviceFrameFormat::GREY:
7171
return proto::DeviceFrameFormat::DEVICE_FRAME_FORMAT_GREY;
72-
case DeviceFrameFormat::Mjpeg:
72+
case DeviceFrameFormat::MJPEG:
7373
return proto::DeviceFrameFormat::DEVICE_FRAME_FORMAT_MJPEG;
7474
}
7575
return proto::DeviceFrameFormat::DEVICE_FRAME_FORMAT_I420;
@@ -80,21 +80,21 @@ DeviceFrameFormat fromProto(proto::DeviceFrameFormat format) {
8080
case proto::DeviceFrameFormat::DEVICE_FRAME_FORMAT_I420:
8181
return DeviceFrameFormat::I420;
8282
case proto::DeviceFrameFormat::DEVICE_FRAME_FORMAT_NV12:
83-
return DeviceFrameFormat::Nv12;
83+
return DeviceFrameFormat::NV12;
8484
case proto::DeviceFrameFormat::DEVICE_FRAME_FORMAT_BGRA:
85-
return DeviceFrameFormat::Bgra;
85+
return DeviceFrameFormat::BGRA;
8686
case proto::DeviceFrameFormat::DEVICE_FRAME_FORMAT_RGB24:
87-
return DeviceFrameFormat::Rgb24;
87+
return DeviceFrameFormat::RGB24;
8888
case proto::DeviceFrameFormat::DEVICE_FRAME_FORMAT_BGR24:
89-
return DeviceFrameFormat::Bgr24;
89+
return DeviceFrameFormat::BGR24;
9090
case proto::DeviceFrameFormat::DEVICE_FRAME_FORMAT_YUYV:
91-
return DeviceFrameFormat::Yuyv;
91+
return DeviceFrameFormat::YUYV;
9292
case proto::DeviceFrameFormat::DEVICE_FRAME_FORMAT_UYVY:
93-
return DeviceFrameFormat::Uyvy;
93+
return DeviceFrameFormat::UYVY;
9494
case proto::DeviceFrameFormat::DEVICE_FRAME_FORMAT_GREY:
95-
return DeviceFrameFormat::Grey;
95+
return DeviceFrameFormat::GREY;
9696
case proto::DeviceFrameFormat::DEVICE_FRAME_FORMAT_MJPEG:
97-
return DeviceFrameFormat::Mjpeg;
97+
return DeviceFrameFormat::MJPEG;
9898
}
9999
return DeviceFrameFormat::I420;
100100
}

‎src/tests/integration/test_capture_source.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ TEST_F(CaptureDeviceTest, ExactFormatRequestRejectsUnsupportedFormat) {
127127
128128
DeviceVideoSourceConfig config;
129129
config.device = DeviceSelector::id(devices.front().id);
130-
// Nv12 is requestable on every backend, so the rejection is attributable to
130+
// NV12 is requestable on every backend, so the rejection is attributable to
131131
// the resolution rather than to frame-format validation.
132-
config.format = DeviceFormatRequest::exact(DeviceFormat{{7, 3}, 1, DeviceFrameFormat::Nv12});
132+
config.format = DeviceFormatRequest::exact(DeviceFormat{{7, 3}, 1, DeviceFrameFormat::NV12});
133133
134134
EXPECT_THROW(CaptureSource::create(config).get(), CaptureSourceError);
135135
}

0 commit comments

Comments
 (0)