Compare commits
8 Commits
Author | SHA1 | Date |
---|---|---|
Andri Yngvason | 68581dbb70 | |
Andri Yngvason | 5c5a696910 | |
Andri Yngvason | 29ce32732f | |
Andri Yngvason | 560fb8053d | |
Andri Yngvason | d8d15946c5 | |
Andri Yngvason | 48d44a3ee9 | |
Andri Yngvason | 05d408511f | |
Andri Yngvason | bf332bd91f |
|
@ -1,7 +1,7 @@
|
|||
project(
|
||||
'neatvnc',
|
||||
'c',
|
||||
version: '0.5.1',
|
||||
version: '0.5.4',
|
||||
license: 'ISC',
|
||||
default_options: [
|
||||
'c_std=gnu11',
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
#include <libavutil/hwcontext.h>
|
||||
#include <libavutil/hwcontext_drm.h>
|
||||
#include <libavutil/pixdesc.h>
|
||||
#include <libavutil/dict.h>
|
||||
#include <libavfilter/avfilter.h>
|
||||
#include <libavfilter/buffersink.h>
|
||||
#include <libavfilter/buffersrc.h>
|
||||
|
@ -99,12 +100,6 @@ static enum AVPixelFormat drm_to_av_pixel_format(uint32_t format)
|
|||
case DRM_FORMAT_BGRX8888:
|
||||
case DRM_FORMAT_BGRA8888:
|
||||
return AV_PIX_FMT_0RGB;
|
||||
case DRM_FORMAT_XRGB2101010:
|
||||
case DRM_FORMAT_ARGB2101010:
|
||||
return AV_PIX_FMT_X2RGB10LE;
|
||||
case DRM_FORMAT_BGRX1010102:
|
||||
case DRM_FORMAT_BGRA1010102:
|
||||
return AV_PIX_FMT_X2RGB10BE;
|
||||
}
|
||||
|
||||
return AV_PIX_FMT_NONE;
|
||||
|
@ -423,7 +418,9 @@ static void h264_encoder__do_work(void* handle)
|
|||
|
||||
int rc = h264_encoder__encode(self, frame);
|
||||
if (rc != 0) {
|
||||
// TODO: log failure
|
||||
char err[256];
|
||||
av_strerror(rc, err, sizeof(err));
|
||||
nvnc_log(NVNC_LOG_ERROR, "Failed to encode packet: %s", err);
|
||||
goto failure;
|
||||
}
|
||||
|
||||
|
@ -449,8 +446,10 @@ static void h264_encoder__on_work_done(void* handle)
|
|||
return;
|
||||
}
|
||||
|
||||
if (self->current_packet.len == 0)
|
||||
if (self->current_packet.len == 0) {
|
||||
nvnc_log(NVNC_LOG_WARNING, "Whoops, encoded packet length is 0");
|
||||
return;
|
||||
}
|
||||
|
||||
void* userdata = self->userdata;
|
||||
|
||||
|
@ -542,7 +541,12 @@ struct h264_encoder* h264_encoder_create(uint32_t width, uint32_t height,
|
|||
self->codec_ctx->hw_frames_ctx =
|
||||
av_buffer_ref(self->filter_out->inputs[0]->hw_frames_ctx);
|
||||
|
||||
rc = avcodec_open2(self->codec_ctx, codec, NULL);
|
||||
AVDictionary *opts = NULL;
|
||||
av_dict_set_int(&opts, "async_depth", 1, 0);
|
||||
|
||||
rc = avcodec_open2(self->codec_ctx, codec, &opts);
|
||||
av_dict_free(&opts);
|
||||
|
||||
if (rc != 0)
|
||||
goto avcodec_open_failure;
|
||||
|
||||
|
|
|
@ -183,7 +183,7 @@ int resampler_feed(struct resampler* self, struct nvnc_fb* fb,
|
|||
|
||||
nvnc_transform_dimensions(fb->transform, &width, &height);
|
||||
nvnc_fb_pool_resize(self->pool, width, height, fb->fourcc_format,
|
||||
fb->stride);
|
||||
width);
|
||||
|
||||
struct aml* aml = aml_get_default();
|
||||
assert(aml);
|
||||
|
|
|
@ -1353,13 +1353,14 @@ static enum rfb_encodings choose_frame_encoding(struct nvnc_client* client,
|
|||
case RFB_ENCODING_RAW:
|
||||
case RFB_ENCODING_TIGHT:
|
||||
case RFB_ENCODING_ZRLE:
|
||||
return client->encodings[i];
|
||||
#ifdef ENABLE_OPEN_H264
|
||||
case RFB_ENCODING_OPEN_H264:
|
||||
// h264 is useless for sw frames
|
||||
if (fb->type != NVNC_FB_GBM_BO)
|
||||
break;
|
||||
#endif
|
||||
return client->encodings[i];
|
||||
#endif
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -399,7 +399,7 @@ static int stream__try_tls_accept(struct stream* self)
|
|||
}
|
||||
|
||||
if (gnutls_error_is_fatal(rc)) {
|
||||
aml_stop(aml_get_default(), &self->handler);
|
||||
aml_stop(aml_get_default(), self->handler);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue