style: unify identifier naming per updated conventions
Automated with clang-tidy readability-identifier-naming (config added to .clang-tidy) plus scripted passes, per the updated rules now documented in CONTRIBUTING.md: - types (class/struct/enum/alias/template params): PascalCase - functions, variables, members: snake_case (incl. rational -> Rational) - private/protected members: trailing underscore; static member variables likewise (instance_, available_themes_) - constants and enum values: snake_case (kLinear -> k_linear, F32P -> f32p); ALL_CAPS reserved for macros - macros: OAK_ prefix (OLIVE_ADD_TEST/OLIVE_ASSERT/OLIVE_CONFIG -> OAK_ADD_TEST/OAK_ASSERT/OAK_CONFIG, GL_PREAMBLE -> OAK_GL_PREAMBLE, include guards -> OAK_*) - file names: all lowercase (Current/Plugin/OliveHost/OliveClip/ OlivePluginInstance -> current/plugin/olivehost/oliveclip/ oliveplugininstance) - getters share the member name sans underscore, setters set_foo() - Qt and third-party (OpenFX) virtual overrides and framework callbacks keep their original names (exempt in .clang-tidy) Manual follow-ups required where automation could not reach: - string-based QMetaObject/SIGNAL/SLOT references updated to renamed methods (AddTask, CreatedFile, DeleteSpecificFile, moveSelectionUp, ...) - macro bodies referencing renamed methods (OLIVE_CONFIG, NODE_DEFAULT_DESTRUCTOR, MANAGEDDISPLAYWIDGET_*) - self-shadowing locals renamed where signals/methods became same-named (size_changed, worker_count, selected_items, import param, filters) - third_party OFX member/namespace usages restored (OFX::Host::*, _created, _clipPrefsDirty, createInstance, clearPersistentMessage) - STL protocol aliases restored (const_iterator) with .clang-tidy ignore rules; qHash overloads restored Full build and test suite pass: ctest 4/4, ~1960 gtest cases green.
This commit is contained in:
@@ -19,8 +19,8 @@
|
||||
|
||||
***/
|
||||
|
||||
#ifndef FFMPEG_BRIDGE_INTERNAL_H
|
||||
#define FFMPEG_BRIDGE_INTERNAL_H
|
||||
#ifndef OAK_FFMPEG_BRIDGE_INTERNAL_H
|
||||
#define OAK_FFMPEG_BRIDGE_INTERNAL_H
|
||||
|
||||
// Fixes weird define issue when including <avfilter.h>
|
||||
#include <inttypes.h>
|
||||
@@ -55,46 +55,46 @@ static_assert(FB_NOPTS_VALUE == AV_NOPTS_VALUE, "FB_NOPTS_VALUE mismatch");
|
||||
static_assert(FB_TIME_BASE == AV_TIME_BASE, "FB_TIME_BASE mismatch");
|
||||
static_assert(FB_SCALER_POINT == SWS_POINT, "FB_SCALER_POINT mismatch");
|
||||
|
||||
static_assert(FB_PIX_FMT_NONE == AV_PIX_FMT_NONE, "FB_PIX_FMT_NONE mismatch");
|
||||
static_assert(fb_pix_fmt_none == AV_PIX_FMT_NONE, "FB_PIX_FMT_NONE mismatch");
|
||||
|
||||
static_assert(FB_SAMPLE_FMT_NONE == AV_SAMPLE_FMT_NONE, "samplefmt mismatch");
|
||||
static_assert(FB_SAMPLE_FMT_U8 == AV_SAMPLE_FMT_U8, "samplefmt mismatch");
|
||||
static_assert(FB_SAMPLE_FMT_S16 == AV_SAMPLE_FMT_S16, "samplefmt mismatch");
|
||||
static_assert(FB_SAMPLE_FMT_S32 == AV_SAMPLE_FMT_S32, "samplefmt mismatch");
|
||||
static_assert(FB_SAMPLE_FMT_FLT == AV_SAMPLE_FMT_FLT, "samplefmt mismatch");
|
||||
static_assert(FB_SAMPLE_FMT_DBL == AV_SAMPLE_FMT_DBL, "samplefmt mismatch");
|
||||
static_assert(FB_SAMPLE_FMT_U8P == AV_SAMPLE_FMT_U8P, "samplefmt mismatch");
|
||||
static_assert(FB_SAMPLE_FMT_S16P == AV_SAMPLE_FMT_S16P, "samplefmt mismatch");
|
||||
static_assert(FB_SAMPLE_FMT_S32P == AV_SAMPLE_FMT_S32P, "samplefmt mismatch");
|
||||
static_assert(FB_SAMPLE_FMT_FLTP == AV_SAMPLE_FMT_FLTP, "samplefmt mismatch");
|
||||
static_assert(FB_SAMPLE_FMT_DBLP == AV_SAMPLE_FMT_DBLP, "samplefmt mismatch");
|
||||
static_assert(FB_SAMPLE_FMT_S64 == AV_SAMPLE_FMT_S64, "samplefmt mismatch");
|
||||
static_assert(FB_SAMPLE_FMT_S64P == AV_SAMPLE_FMT_S64P, "samplefmt mismatch");
|
||||
static_assert(fb_sample_fmt_none == AV_SAMPLE_FMT_NONE, "samplefmt mismatch");
|
||||
static_assert(fb_sample_fmt_u8 == AV_SAMPLE_FMT_U8, "samplefmt mismatch");
|
||||
static_assert(fb_sample_fmt_s16 == AV_SAMPLE_FMT_S16, "samplefmt mismatch");
|
||||
static_assert(fb_sample_fmt_s32 == AV_SAMPLE_FMT_S32, "samplefmt mismatch");
|
||||
static_assert(fb_sample_fmt_flt == AV_SAMPLE_FMT_FLT, "samplefmt mismatch");
|
||||
static_assert(fb_sample_fmt_dbl == AV_SAMPLE_FMT_DBL, "samplefmt mismatch");
|
||||
static_assert(fb_sample_fmt_u8_p == AV_SAMPLE_FMT_U8P, "samplefmt mismatch");
|
||||
static_assert(fb_sample_fmt_s16_p == AV_SAMPLE_FMT_S16P, "samplefmt mismatch");
|
||||
static_assert(fb_sample_fmt_s32_p == AV_SAMPLE_FMT_S32P, "samplefmt mismatch");
|
||||
static_assert(fb_sample_fmt_fltp == AV_SAMPLE_FMT_FLTP, "samplefmt mismatch");
|
||||
static_assert(fb_sample_fmt_dblp == AV_SAMPLE_FMT_DBLP, "samplefmt mismatch");
|
||||
static_assert(fb_sample_fmt_s64 == AV_SAMPLE_FMT_S64, "samplefmt mismatch");
|
||||
static_assert(fb_sample_fmt_s64_p == AV_SAMPLE_FMT_S64P, "samplefmt mismatch");
|
||||
|
||||
static_assert(FB_COLOR_RANGE_UNSPEC == AVCOL_RANGE_UNSPECIFIED, "range mismatch");
|
||||
static_assert(FB_COLOR_RANGE_MPEG == AVCOL_RANGE_MPEG, "range mismatch");
|
||||
static_assert(FB_COLOR_RANGE_JPEG == AVCOL_RANGE_JPEG, "range mismatch");
|
||||
static_assert(fb_color_range_unspec == AVCOL_RANGE_UNSPECIFIED, "range mismatch");
|
||||
static_assert(fb_color_range_mpeg == AVCOL_RANGE_MPEG, "range mismatch");
|
||||
static_assert(fb_color_range_jpeg == AVCOL_RANGE_JPEG, "range mismatch");
|
||||
|
||||
static_assert(FB_COL_SPC_RGB == AVCOL_SPC_RGB, "colspace mismatch");
|
||||
static_assert(FB_COL_SPC_BT709 == AVCOL_SPC_BT709, "colspace mismatch");
|
||||
static_assert(FB_COL_SPC_UNSPEC == AVCOL_SPC_UNSPECIFIED, "colspace mismatch");
|
||||
static_assert(FB_COL_SPC_FCC == AVCOL_SPC_FCC, "colspace mismatch");
|
||||
static_assert(FB_COL_SPC_BT470BG == AVCOL_SPC_BT470BG, "colspace mismatch");
|
||||
static_assert(FB_COL_SPC_SMPTE170M == AVCOL_SPC_SMPTE170M, "colspace mismatch");
|
||||
static_assert(FB_COL_SPC_SMPTE240M == AVCOL_SPC_SMPTE240M, "colspace mismatch");
|
||||
static_assert(FB_COL_SPC_BT2020_NCL == AVCOL_SPC_BT2020_NCL, "colspace mismatch");
|
||||
static_assert(fb_col_spc_rgb == AVCOL_SPC_RGB, "colspace mismatch");
|
||||
static_assert(fb_col_spc_b_t709 == AVCOL_SPC_BT709, "colspace mismatch");
|
||||
static_assert(fb_col_spc_unspec == AVCOL_SPC_UNSPECIFIED, "colspace mismatch");
|
||||
static_assert(fb_col_spc_fcc == AVCOL_SPC_FCC, "colspace mismatch");
|
||||
static_assert(fb_col_spc_b_t470_bg == AVCOL_SPC_BT470BG, "colspace mismatch");
|
||||
static_assert(fb_col_spc_smpt_e170_m == AVCOL_SPC_SMPTE170M, "colspace mismatch");
|
||||
static_assert(fb_col_spc_smpt_e240_m == AVCOL_SPC_SMPTE240M, "colspace mismatch");
|
||||
static_assert(fb_col_spc_b_t2020_ncl == AVCOL_SPC_BT2020_NCL, "colspace mismatch");
|
||||
|
||||
static_assert(FB_MEDIA_TYPE_VIDEO == AVMEDIA_TYPE_VIDEO, "mediatype mismatch");
|
||||
static_assert(FB_MEDIA_TYPE_AUDIO == AVMEDIA_TYPE_AUDIO, "mediatype mismatch");
|
||||
static_assert(FB_MEDIA_TYPE_DATA == AVMEDIA_TYPE_DATA, "mediatype mismatch");
|
||||
static_assert(FB_MEDIA_TYPE_SUBTITLE == AVMEDIA_TYPE_SUBTITLE, "mediatype mismatch");
|
||||
static_assert(fb_media_type_video == AVMEDIA_TYPE_VIDEO, "mediatype mismatch");
|
||||
static_assert(fb_media_type_audio == AVMEDIA_TYPE_AUDIO, "mediatype mismatch");
|
||||
static_assert(fb_media_type_data == AVMEDIA_TYPE_DATA, "mediatype mismatch");
|
||||
static_assert(fb_media_type_subtitle == AVMEDIA_TYPE_SUBTITLE, "mediatype mismatch");
|
||||
|
||||
static_assert(FB_FIELD_ORDER_UNKNOWN == AV_FIELD_UNKNOWN, "fieldorder mismatch");
|
||||
static_assert(FB_FIELD_ORDER_PROGRESSIVE == AV_FIELD_PROGRESSIVE, "fieldorder mismatch");
|
||||
static_assert(FB_FIELD_ORDER_TT == AV_FIELD_TT, "fieldorder mismatch");
|
||||
static_assert(FB_FIELD_ORDER_BB == AV_FIELD_BB, "fieldorder mismatch");
|
||||
static_assert(FB_FIELD_ORDER_TB == AV_FIELD_TB, "fieldorder mismatch");
|
||||
static_assert(FB_FIELD_ORDER_BT == AV_FIELD_BT, "fieldorder mismatch");
|
||||
static_assert(fb_field_order_unknown == AV_FIELD_UNKNOWN, "fieldorder mismatch");
|
||||
static_assert(fb_field_order_progressive == AV_FIELD_PROGRESSIVE, "fieldorder mismatch");
|
||||
static_assert(fb_field_order_tt == AV_FIELD_TT, "fieldorder mismatch");
|
||||
static_assert(fb_field_order_bb == AV_FIELD_BB, "fieldorder mismatch");
|
||||
static_assert(fb_field_order_tb == AV_FIELD_TB, "fieldorder mismatch");
|
||||
static_assert(fb_field_order_bt == AV_FIELD_BT, "fieldorder mismatch");
|
||||
|
||||
static_assert(FB_CH_LAYOUT_MONO == AV_CH_LAYOUT_MONO, "layout mismatch");
|
||||
static_assert(FB_CH_LAYOUT_STEREO == AV_CH_LAYOUT_STEREO, "layout mismatch");
|
||||
@@ -123,15 +123,15 @@ namespace fb
|
||||
|
||||
/** Allocate a channel layout from a mask, falling back to a default layout
|
||||
* derived from `fallback_channels` when the mask is zero. */
|
||||
void ChannelLayoutFromMask(AVChannelLayout *layout, uint64_t mask,
|
||||
void channel_layout_from_mask(AVChannelLayout *layout, uint64_t mask,
|
||||
int fallback_channels);
|
||||
|
||||
/** Validate a stream's channel layout, returning a usable mask (never zero
|
||||
* unless the stream truly has no channels). */
|
||||
uint64_t ValidateStreamChannelLayoutMask(const AVStream *stream);
|
||||
uint64_t validate_stream_channel_layout_mask(const AVStream *stream);
|
||||
|
||||
/** Map an AVColorSpace to the corresponding SWS_CS_* constant. */
|
||||
int SwsColorspaceFromAVColorSpace(AVColorSpace cs);
|
||||
int sws_colorspace_from_av_color_space(AVColorSpace cs);
|
||||
|
||||
/**
|
||||
* Translate an FB_PIX_FMT_* value to the AVPixelFormat of the FFmpeg build
|
||||
@@ -141,7 +141,7 @@ int SwsColorspaceFromAVColorSpace(AVColorSpace cs);
|
||||
* AV_PIX_FMT_NONE for FB_PIX_FMT_NONE and for static FB formats unknown to
|
||||
* this FFmpeg build (e.g. rgbf16le/grayf16le on FFmpeg < 7.1).
|
||||
*/
|
||||
AVPixelFormat PixFmtToAV(int fb_fmt);
|
||||
AVPixelFormat pix_fmt_to_av(int fb_fmt);
|
||||
|
||||
/**
|
||||
* Reverse of PixFmtToAV. Returns FB_PIX_FMT_NONE for AV_PIX_FMT_NONE.
|
||||
@@ -149,11 +149,11 @@ AVPixelFormat PixFmtToAV(int fb_fmt);
|
||||
* formats such as p210le, etc.) receive a process-local dynamic id >= 1000
|
||||
* so they can still round-trip through the API.
|
||||
*/
|
||||
int PixFmtFromAV(AVPixelFormat fmt);
|
||||
int pix_fmt_from_av(AVPixelFormat fmt);
|
||||
|
||||
void SetError(char *error_buffer, size_t error_buffer_size, const char *context,
|
||||
void set_error(char *error_buffer, size_t error_buffer_size, const char *context,
|
||||
int error_code);
|
||||
|
||||
} // namespace fb
|
||||
|
||||
#endif // FFMPEG_BRIDGE_INTERNAL_H
|
||||
#endif // OAK_FFMPEG_BRIDGE_INTERNAL_H
|
||||
|
||||
Reference in New Issue
Block a user