New upstream version 25.0.8+dfsg1
This commit is contained in:
parent
8b2e5f2130
commit
8e020cdacb
115 changed files with 1767 additions and 10949 deletions
|
|
@ -81,18 +81,7 @@ struct nv_bitstream {
|
|||
HANDLE event;
|
||||
};
|
||||
|
||||
static inline bool nv_failed(struct nvenc_data *enc, NVENCSTATUS err,
|
||||
const char *func, const char *call)
|
||||
{
|
||||
if (err == NV_ENC_SUCCESS)
|
||||
return false;
|
||||
|
||||
error("%s: %s failed: %d (%s)", func, call, (int)err,
|
||||
nv_error_name(err));
|
||||
return true;
|
||||
}
|
||||
|
||||
#define NV_FAILED(x) nv_failed(enc, x, __FUNCTION__, #x)
|
||||
#define NV_FAILED(x) nv_failed(enc->encoder, x, __FUNCTION__, #x)
|
||||
|
||||
static bool nv_bitstream_init(struct nvenc_data *enc, struct nv_bitstream *bs)
|
||||
{
|
||||
|
|
@ -400,7 +389,8 @@ static bool init_encoder(struct nvenc_data *enc, obs_data_t *settings)
|
|||
err = nv.nvEncGetEncodePresetConfig(enc->session,
|
||||
NV_ENC_CODEC_H264_GUID, nv_preset,
|
||||
&preset_config);
|
||||
if (nv_failed(enc, err, __FUNCTION__, "nvEncGetEncodePresetConfig")) {
|
||||
if (nv_failed(enc->encoder, err, __FUNCTION__,
|
||||
"nvEncGetEncodePresetConfig")) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -578,16 +568,19 @@ static void *nvenc_create(obs_data_t *settings, obs_encoder_t *encoder)
|
|||
* gpu other than the one OBS is currently running on. */
|
||||
int gpu = (int)obs_data_get_int(settings, "gpu");
|
||||
if (gpu != 0) {
|
||||
info("different GPU selected by user, falling back to ffmpeg");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (obs_encoder_scaling_enabled(encoder)) {
|
||||
info("scaling enabled, falling back to ffmpeg");
|
||||
goto fail;
|
||||
}
|
||||
if (!obs_nv12_tex_active()) {
|
||||
info("nv12 not active, falling back to ffmpeg");
|
||||
goto fail;
|
||||
}
|
||||
if (!init_nvenc()) {
|
||||
if (!init_nvenc(encoder)) {
|
||||
goto fail;
|
||||
}
|
||||
if (NV_FAILED(nv_create_instance(&init))) {
|
||||
|
|
@ -766,7 +759,8 @@ static bool get_encoded_packet(struct nvenc_data *enc, bool finalize)
|
|||
if (nvtex->mapped_res) {
|
||||
NVENCSTATUS err;
|
||||
err = nv.nvEncUnmapInputResource(s, nvtex->mapped_res);
|
||||
if (nv_failed(enc, err, __FUNCTION__, "unmap")) {
|
||||
if (nv_failed(enc->encoder, err, __FUNCTION__,
|
||||
"unmap")) {
|
||||
return false;
|
||||
}
|
||||
nvtex->mapped_res = NULL;
|
||||
|
|
@ -859,7 +853,8 @@ static bool nvenc_encode_tex(void *data, uint32_t handle, int64_t pts,
|
|||
|
||||
err = nv.nvEncEncodePicture(enc->session, ¶ms);
|
||||
if (err != NV_ENC_SUCCESS && err != NV_ENC_ERR_NEED_MORE_INPUT) {
|
||||
nv_failed(enc, err, __FUNCTION__, "nvEncEncodePicture");
|
||||
nv_failed(enc->encoder, err, __FUNCTION__,
|
||||
"nvEncEncodePicture");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue