summaryrefslogtreecommitdiff
path: root/recipes-multimedia/libgstomx-1.0/files/r21.6.0-sources-gstomx1_src.patch
blob: f74f278e94fb122fe8ce6916eea910594145bc1e (plain)
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
diff -Naur r21.5.0-sources-gstomx1_src-gst-omx1/omx/gstomxh264enc.c r21.6.0-sources-gstomx1_src-gst-omx1/omx/gstomxh264enc.c
--- r21.5.0-sources-gstomx1_src-gst-omx1/omx/gstomxh264enc.c	2016-06-08 06:17:32.000000000 +0200
+++ r21.6.0-sources-gstomx1_src-gst-omx1/omx/gstomxh264enc.c	2017-10-14 03:23:25.000000000 +0200
@@ -48,13 +48,15 @@
 {
   PROP_0,
   PROP_INSERT_SPS_PPS,
-  PROP_NO_BFRAMES,
+  PROP_NUM_BFRAMES,
   PROP_SLICE_HEADER_SPACING,
   PROP_PROFILE
 };
 
 #define DEFAULT_SLICE_HEADER_SPACING 0
 #define DEFAULT_PROFILE OMX_VIDEO_AVCProfileBaseline
+#define DEFAULT_NUM_B_FRAMES 0
+#define MAX_NUM_B_FRAMES 2
 
 
 #define GST_TYPE_OMX_VID_ENC_PROFILE (gst_omx_videnc_profile_get_type ())
@@ -132,11 +134,12 @@
           "Insert H.264 SPS, PPS at every IDR frame",
           FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
-  g_object_class_install_property (gobject_class, PROP_NO_BFRAMES,
-      g_param_spec_boolean ("no-B-Frames",
-          "Do not encode B Frames",
-          "Do not use B Frames while encoding",
-          FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
+  g_object_class_install_property (gobject_class, PROP_NUM_BFRAMES,
+      g_param_spec_uint ("num-B-Frames",
+          "B Frames between two reference frames",
+          "Number of B Frames between two reference frames (not recommended)",
+          0, MAX_NUM_B_FRAMES, DEFAULT_NUM_B_FRAMES,
+          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
           GST_PARAM_MUTABLE_READY));
 
   g_object_class_install_property (gobject_class, PROP_PROFILE,
@@ -151,7 +154,7 @@
 gst_omx_h264_enc_init (GstOMXH264Enc * self)
 {
   self->insert_sps_pps = FALSE;
-  self->no_BFrames = FALSE;
+  self->nBFrames = 0;
   self->slice_header_spacing = DEFAULT_SLICE_HEADER_SPACING;
   self->profile = DEFAULT_PROFILE;
 }
@@ -679,8 +682,8 @@
     case PROP_INSERT_SPS_PPS:
       self->insert_sps_pps = g_value_get_boolean (value);
       break;
-    case PROP_NO_BFRAMES:
-      self->no_BFrames = g_value_get_boolean (value);
+    case PROP_NUM_BFRAMES:
+      self->nBFrames = g_value_get_uint (value);
       break;
     case PROP_SLICE_HEADER_SPACING:
       self->slice_header_spacing = g_value_get_ulong (value);
@@ -704,8 +707,8 @@
     case PROP_INSERT_SPS_PPS:
       g_value_set_boolean (value, self->insert_sps_pps);
       break;
-    case PROP_NO_BFRAMES:
-      g_value_set_boolean (value, self->no_BFrames);
+    case PROP_NUM_BFRAMES:
+      g_value_set_uint (value, self->nBFrames);
       break;
     case PROP_SLICE_HEADER_SPACING:
       g_value_set_ulong (value, self->slice_header_spacing);
@@ -734,7 +737,7 @@
       gst_omx_component_get_parameter (GST_OMX_VIDEO_ENC (self)->enc,
       OMX_IndexParamVideoAvc, &oH264Type);
   if (eError == OMX_ErrorNone) {
-    oH264Type.nBFrames = self->no_BFrames;
+    oH264Type.nBFrames = self->nBFrames;
     oH264Type.nSliceHeaderSpacing = self->slice_header_spacing;
     oH264Type.eProfile = self->profile;
 
diff -Naur r21.5.0-sources-gstomx1_src-gst-omx1/omx/gstomxh264enc.h r21.6.0-sources-gstomx1_src-gst-omx1/omx/gstomxh264enc.h
--- r21.5.0-sources-gstomx1_src-gst-omx1/omx/gstomxh264enc.h	2016-06-08 06:17:32.000000000 +0200
+++ r21.6.0-sources-gstomx1_src-gst-omx1/omx/gstomxh264enc.h	2017-10-14 03:23:25.000000000 +0200
@@ -56,7 +56,7 @@
   GstOMXVideoEnc parent;
   h264_sf stream_format;
   gboolean insert_sps_pps;
-  gboolean no_BFrames;
+  gboolean nBFrames;
   glong slice_header_spacing;
   guint profile;
 };