forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gst-plugins-libav-1.6.3-minr-maxr.patch
74 lines (67 loc) · 3.1 KB
/
gst-plugins-libav-1.6.3-minr-maxr.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
commit e3cf542215519f882b7570a4b59aad75a8d2d27a
Author: Edward Hervey <[email protected]>
Date: Tue Feb 16 16:32:38 2016 +0100
avcfg: rc-min-rate and rc-max-rate are now 64bit integers
Switch the gobject properties and internal handling to support that
diff --git a/ext/libav/gstavcfg.c b/ext/libav/gstavcfg.c
index d38cce1..a361994 100644
--- a/ext/libav/gstavcfg.c
+++ b/ext/libav/gstavcfg.c
@@ -513,13 +513,19 @@ gst_ffmpeg_cfg_init (void)
gst_ffmpeg_add_pspec (pspec, config.rc_buffer_aggressivity, FALSE, mpeg,
NULL);
+#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT (57, 3, 0)
pspec = g_param_spec_int ("rc-max-rate", "Ratecontrol Maximum Bitrate",
"Ratecontrol Maximum Bitrate", 0, G_MAXINT, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+#else
+ pspec = g_param_spec_int64 ("rc-max-rate", "Ratecontrol Maximum Bitrate",
+ "Ratecontrol Maximum Bitrate", 0, G_MAXINT64, 0,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
+#endif
gst_ffmpeg_add_pspec (pspec, config.rc_max_rate, FALSE, mpeg, NULL);
- pspec = g_param_spec_int ("rc-min-rate", "Ratecontrol Minimum Bitrate",
- "Ratecontrol Minimum Bitrate", 0, G_MAXINT, 0,
+ pspec = g_param_spec_int64 ("rc-min-rate", "Ratecontrol Minimum Bitrate",
+ "Ratecontrol Minimum Bitrate", 0, G_MAXINT64, 0,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
gst_ffmpeg_add_pspec (pspec, config.rc_min_rate, FALSE, mpeg, NULL);
@@ -770,6 +776,15 @@ gst_ffmpeg_cfg_install_property (GstFFMpegVidEncClass * klass, guint base)
: pint->default_value, pspec->flags);
break;
}
+ case G_TYPE_INT64:{
+ GParamSpecInt64 *pint = G_PARAM_SPEC_INT64 (pspec);
+
+ pspec = g_param_spec_int64 (name, nick, blurb,
+ pint->minimum, pint->maximum,
+ lavc_default ? G_STRUCT_MEMBER (gint64, ctx, ctx_offset)
+ : pint->default_value, pspec->flags);
+ break;
+ }
case G_TYPE_UINT:{
GParamSpecUInt *puint = G_PARAM_SPEC_UINT (pspec);
@@ -862,6 +877,11 @@ gst_ffmpeg_cfg_set_property (GObject * object,
G_STRUCT_MEMBER (gint, ffmpegenc, qdata->offset) =
g_value_get_int (value);
break;
+ case G_TYPE_INT64:
+ g_return_val_if_fail (qdata->size == sizeof (gint64), TRUE);
+ G_STRUCT_MEMBER (gint64, ffmpegenc, qdata->offset) =
+ g_value_get_int64 (value);
+ break;
case G_TYPE_FLOAT:
g_return_val_if_fail (qdata->size == sizeof (gfloat), TRUE);
G_STRUCT_MEMBER (gfloat, ffmpegenc, qdata->offset) =
@@ -924,6 +944,11 @@ gst_ffmpeg_cfg_get_property (GObject * object,
g_return_val_if_fail (qdata->size == sizeof (gint), TRUE);
g_value_set_int (value, G_STRUCT_MEMBER (gint, ffmpegenc, qdata->offset));
break;
+ case G_TYPE_INT64:
+ g_return_val_if_fail (qdata->size == sizeof (gint64), TRUE);
+ g_value_set_int64 (value, G_STRUCT_MEMBER (gint64, ffmpegenc,
+ qdata->offset));
+ break;
case G_TYPE_FLOAT:
g_return_val_if_fail (qdata->size == sizeof (gfloat), TRUE);
g_value_set_float (value,