Lines 1-6
Link Here
|
1 |
--- src/FFmpegWriter.cpp.orig 2019-11-04 12:14:04 UTC |
1 |
--- src/FFmpegWriter.cpp.orig 2019-12-19 13:04:31 UTC |
2 |
+++ src/FFmpegWriter.cpp |
2 |
+++ src/FFmpegWriter.cpp |
3 |
@@ -172,7 +172,7 @@ void FFmpegWriter::SetVideoOptions(bool has_video, str |
3 |
@@ -172,7 +172,7 @@ void FFmpegWriter::SetVideoOptions(bool has_video, std |
4 |
AVCodec *new_codec; |
4 |
AVCodec *new_codec; |
5 |
// Check if the codec selected is a hardware accelerated codec |
5 |
// Check if the codec selected is a hardware accelerated codec |
6 |
#if IS_FFMPEG_3_2 |
6 |
#if IS_FFMPEG_3_2 |
Lines 9-15
Link Here
|
9 |
if (strstr(codec.c_str(), "_vaapi") != NULL) { |
9 |
if (strstr(codec.c_str(), "_vaapi") != NULL) { |
10 |
new_codec = avcodec_find_encoder_by_name(codec.c_str()); |
10 |
new_codec = avcodec_find_encoder_by_name(codec.c_str()); |
11 |
hw_en_on = 1; |
11 |
hw_en_on = 1; |
12 |
@@ -220,9 +220,9 @@ void FFmpegWriter::SetVideoOptions(bool has_video, str |
12 |
@@ -220,9 +220,9 @@ void FFmpegWriter::SetVideoOptions(bool has_video, std |
13 |
hw_en_on = 0; |
13 |
hw_en_on = 0; |
14 |
hw_en_supported = 0; |
14 |
hw_en_supported = 0; |
15 |
} |
15 |
} |
Lines 30-36
Link Here
|
30 |
if (hw_en_on && hw_en_supported) { |
30 |
if (hw_en_on && hw_en_supported) { |
31 |
if (hw_device_ctx) { |
31 |
if (hw_device_ctx) { |
32 |
av_buffer_unref(&hw_device_ctx); |
32 |
av_buffer_unref(&hw_device_ctx); |
33 |
@@ -1351,7 +1351,7 @@ void FFmpegWriter::open_video(AVFormatContext *oc, AVS |
33 |
@@ -1352,7 +1352,7 @@ void FFmpegWriter::open_video(AVFormatContext *oc, AVS |
34 |
adapter_num = openshot::Settings::Instance()->HW_EN_DEVICE_SET; |
34 |
adapter_num = openshot::Settings::Instance()->HW_EN_DEVICE_SET; |
35 |
fprintf(stderr, "\n\nEncodiing Device Nr: %d\n", adapter_num); |
35 |
fprintf(stderr, "\n\nEncodiing Device Nr: %d\n", adapter_num); |
36 |
if (adapter_num < 3 && adapter_num >=0) { |
36 |
if (adapter_num < 3 && adapter_num >=0) { |
Lines 39-45
Link Here
|
39 |
snprintf(adapter,sizeof(adapter),"/dev/dri/renderD%d", adapter_num+128); |
39 |
snprintf(adapter,sizeof(adapter),"/dev/dri/renderD%d", adapter_num+128); |
40 |
// Maybe 127 is better because the first card would be 1?! |
40 |
// Maybe 127 is better because the first card would be 1?! |
41 |
adapter_ptr = adapter; |
41 |
adapter_ptr = adapter; |
42 |
@@ -1359,17 +1359,21 @@ void FFmpegWriter::open_video(AVFormatContext *oc, AVS |
42 |
@@ -1360,17 +1360,21 @@ void FFmpegWriter::open_video(AVFormatContext *oc, AVS |
43 |
adapter_ptr = NULL; |
43 |
adapter_ptr = NULL; |
44 |
#elif defined(__APPLE__) |
44 |
#elif defined(__APPLE__) |
45 |
adapter_ptr = NULL; |
45 |
adapter_ptr = NULL; |