clang-format: Increase column limit from 80 to 120
This commit is contained in:
parent
109f64c446
commit
a1fbf1015f
736 changed files with 22684 additions and 45435 deletions
|
|
@ -25,9 +25,7 @@ struct DShowEncoder {
|
|||
DARRAY(uint8_t) firstPacket;
|
||||
DARRAY(uint8_t) header;
|
||||
|
||||
inline DShowEncoder(obs_encoder_t *context_, const wchar_t *device_)
|
||||
: context(context_),
|
||||
device(device_)
|
||||
inline DShowEncoder(obs_encoder_t *context_, const wchar_t *device_) : context(context_), device(device_)
|
||||
{
|
||||
da_init(firstPacket);
|
||||
da_init(header);
|
||||
|
|
@ -42,9 +40,7 @@ struct DShowEncoder {
|
|||
inline void ParseFirstPacket(const uint8_t *data, size_t size);
|
||||
|
||||
inline bool Update(obs_data_t *settings);
|
||||
inline bool Encode(struct encoder_frame *frame,
|
||||
struct encoder_packet *packet,
|
||||
bool *received_packet);
|
||||
inline bool Encode(struct encoder_frame *frame, struct encoder_packet *packet, bool *received_packet);
|
||||
};
|
||||
|
||||
static const char *GetC985EncoderName(void *)
|
||||
|
|
@ -135,8 +131,7 @@ inline bool DShowEncoder::Update(obs_data_t *settings)
|
|||
"\theight: %d\n"
|
||||
"\tfps_num: %d\n"
|
||||
"\tfps_den: %d",
|
||||
deviceName->array, (int)width, (int)height, (int)voi->fps_num,
|
||||
(int)voi->fps_den);
|
||||
deviceName->array, (int)width, (int)height, (int)voi->fps_num, (int)voi->fps_den);
|
||||
|
||||
return encoder.SetConfig(config);
|
||||
}
|
||||
|
|
@ -151,9 +146,7 @@ static bool UpdateDShowEncoder(void *data, obs_data_t *settings)
|
|||
return true;
|
||||
}
|
||||
|
||||
static inline void *CreateDShowEncoder(obs_data_t *settings,
|
||||
obs_encoder_t *context,
|
||||
const wchar_t *device)
|
||||
static inline void *CreateDShowEncoder(obs_data_t *settings, obs_encoder_t *context, const wchar_t *device)
|
||||
{
|
||||
DShowEncoder *encoder = nullptr;
|
||||
|
||||
|
|
@ -162,8 +155,7 @@ static inline void *CreateDShowEncoder(obs_data_t *settings,
|
|||
UpdateDShowEncoder(encoder, settings);
|
||||
|
||||
} catch (const char *error) {
|
||||
blog(LOG_ERROR, "Could not create DirectShow encoder '%s': %s",
|
||||
obs_encoder_get_name(context), error);
|
||||
blog(LOG_ERROR, "Could not create DirectShow encoder '%s': %s", obs_encoder_get_name(context), error);
|
||||
}
|
||||
|
||||
return encoder;
|
||||
|
|
@ -210,21 +202,17 @@ inline void DShowEncoder::ParseFirstPacket(const uint8_t *data, size_t size)
|
|||
nal_end = end;
|
||||
|
||||
if (type == OBS_NAL_SPS || type == OBS_NAL_PPS) {
|
||||
da_push_back_array(header, nal_codestart,
|
||||
nal_end - nal_codestart);
|
||||
da_push_back_array(header, nal_codestart, nal_end - nal_codestart);
|
||||
|
||||
} else {
|
||||
da_push_back_array(firstPacket, nal_codestart,
|
||||
nal_end - nal_codestart);
|
||||
da_push_back_array(firstPacket, nal_codestart, nal_end - nal_codestart);
|
||||
}
|
||||
|
||||
nal_start = nal_end;
|
||||
}
|
||||
}
|
||||
|
||||
inline bool DShowEncoder::Encode(struct encoder_frame *frame,
|
||||
struct encoder_packet *packet,
|
||||
bool *received_packet)
|
||||
inline bool DShowEncoder::Encode(struct encoder_frame *frame, struct encoder_packet *packet, bool *received_packet)
|
||||
{
|
||||
unsigned char *frame_data[DSHOW_MAX_PLANES] = {};
|
||||
size_t frame_sizes[DSHOW_MAX_PLANES] = {};
|
||||
|
|
@ -243,9 +231,8 @@ inline bool DShowEncoder::Encode(struct encoder_frame *frame,
|
|||
|
||||
long long actualPTS = frame->pts * frameInterval;
|
||||
|
||||
bool success = encoder.Encode(frame_data, frame_sizes, actualPTS,
|
||||
actualPTS + frameInterval, dshowPacket,
|
||||
new_packet);
|
||||
bool success =
|
||||
encoder.Encode(frame_data, frame_sizes, actualPTS, actualPTS + frameInterval, dshowPacket, new_packet);
|
||||
if (!success)
|
||||
return false;
|
||||
|
||||
|
|
@ -271,11 +258,9 @@ inline bool DShowEncoder::Encode(struct encoder_frame *frame,
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool DShowEncode(void *data, struct encoder_frame *frame,
|
||||
struct encoder_packet *packet, bool *received_packet)
|
||||
static bool DShowEncode(void *data, struct encoder_frame *frame, struct encoder_packet *packet, bool *received_packet)
|
||||
{
|
||||
return reinterpret_cast<DShowEncoder *>(data)->Encode(frame, packet,
|
||||
received_packet);
|
||||
return reinterpret_cast<DShowEncoder *>(data)->Encode(frame, packet, received_packet);
|
||||
}
|
||||
|
||||
static bool GetDShowExtraData(void *data, uint8_t **extra_data, size_t *size)
|
||||
|
|
@ -290,8 +275,7 @@ static bool GetDShowExtraData(void *data, uint8_t **extra_data, size_t *size)
|
|||
|
||||
static inline bool ValidResolution(uint32_t width, uint32_t height)
|
||||
{
|
||||
return (width == 1280 && height == 720) ||
|
||||
(width == 1024 && height == 768);
|
||||
return (width == 1280 && height == 720) || (width == 1024 && height == 768);
|
||||
}
|
||||
|
||||
static void GetDShowVideoInfo(void *data, struct video_scale_info *info)
|
||||
|
|
@ -299,8 +283,7 @@ static void GetDShowVideoInfo(void *data, struct video_scale_info *info)
|
|||
DShowEncoder *encoder = reinterpret_cast<DShowEncoder *>(data);
|
||||
encoder->format = VIDEO_FORMAT_I420;
|
||||
|
||||
if (info->format == VIDEO_FORMAT_I420 &&
|
||||
ValidResolution(info->width, info->height))
|
||||
if (info->format == VIDEO_FORMAT_I420 && ValidResolution(info->width, info->height))
|
||||
return;
|
||||
|
||||
info->format = VIDEO_FORMAT_I420;
|
||||
|
|
@ -329,8 +312,7 @@ static obs_properties_t *GetDShowEncoderProperties(void *data)
|
|||
{
|
||||
obs_properties_t *ppts = obs_properties_create();
|
||||
|
||||
obs_properties_add_int(ppts, "bitrate", obs_module_text("Bitrate"),
|
||||
1000, 60000, 1);
|
||||
obs_properties_add_int(ppts, "bitrate", obs_module_text("Bitrate"), 1000, 60000, 1);
|
||||
|
||||
UNUSED_PARAMETER(data);
|
||||
return ppts;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue