Modified: trunk/Source/WebCore/ChangeLog (242893 => 242894)
--- trunk/Source/WebCore/ChangeLog 2019-03-13 18:14:21 UTC (rev 242893)
+++ trunk/Source/WebCore/ChangeLog 2019-03-13 18:25:21 UTC (rev 242894)
@@ -1,3 +1,15 @@
+2019-03-13 Thibault Saunier <[email protected]>
+
+ [GStreamer][WebRTC] Add support for omxh264enc encoder
+ https://bugs.webkit.org/show_bug.cgi?id=195676
+
+ Reviewed by Philippe Normand.
+
+ * platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp:
+ (setup_omxh264enc):
+ (set_bitrate_bit_per_sec):
+ (gst_webrtc_video_encoder_class_init):
+
2019-03-13 Antoine Quint <[email protected]>
REGRESSION(r240634): Element::hasPointerCapture() passes a JS-controlled value directly into a HashMap as a key
Modified: trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp (242893 => 242894)
--- trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp 2019-03-13 18:14:21 UTC (rev 242893)
+++ trunk/Source/WebCore/platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp 2019-03-13 18:25:21 UTC (rev 242894)
@@ -62,6 +62,7 @@
ENCODER_NONE = 0,
ENCODER_X264,
ENCODER_OPENH264,
+ ENCODER_OMXH264,
ENCODER_VP8,
ENCODER_LAST,
} EncoderId;
@@ -283,6 +284,13 @@
}
static void
+setup_omxh264enc (GObject * encoder)
+{
+ gst_util_set_object_arg (encoder, "control-rate", "constant");
+}
+
+
+static void
set_bitrate_kbit_per_sec (GObject * encoder, const gchar * prop_name,
gint bitrate)
{
@@ -290,6 +298,13 @@
}
static void
+set_bitrate_bit_per_sec (GObject * encoder, const gchar * prop_name,
+ gint bitrate)
+{
+ g_object_set (encoder, prop_name, bitrate * KBIT_TO_BIT, NULL);
+}
+
+static void
gst_webrtc_video_encoder_class_init (GstWebrtcVideoEncoderClass * klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -324,6 +339,10 @@
(GParamFlags) (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
G_PARAM_CONSTRUCT)));
+ register_known_encoder (ENCODER_OMXH264, "omxh264enc", "h264parse",
+ "video/x-h264",
+ "video/x-h264,alignment=au,stream-format=byte-stream,profile=""
+ setup_omxh264enc, "target-bitrate", set_bitrate_bit_per_sec, "interval-intraframes");
register_known_encoder (ENCODER_X264, "x264enc", "h264parse", "video/x-h264",
"video/x-h264,alignment=au,stream-format=byte-stream,profile=""
setup_x264enc, "bitrate", set_bitrate_kbit_per_sec, "key-int-max");