[longomatch] Add support for fluh264enc
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Add support for fluh264enc
- Date: Mon, 26 Jan 2015 14:08:22 +0000 (UTC)
commit c568c029c3435d8fb047a08a07b56928a78d746a
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Mon Jan 26 15:05:57 2015 +0100
Add support for fluh264enc
libcesarplayer/video-utils.m | 39 ++++++++++++++++++++++++---------------
1 files changed, 24 insertions(+), 15 deletions(-)
---
diff --git a/libcesarplayer/video-utils.m b/libcesarplayer/video-utils.m
index 9da9ed1..f1d2e9e 100644
--- a/libcesarplayer/video-utils.m
+++ b/libcesarplayer/video-utils.m
@@ -251,21 +251,10 @@ lgm_create_video_encoder (VideoEncoderType type, guint quality,
case VIDEO_ENCODER_H264:{
GstElement *parse;
- gchar *stats_file = g_build_path (G_DIR_SEPARATOR_S, g_get_tmp_dir (),
- "x264.log", NULL);
+
encoder = gst_element_factory_make ("fluvah264enc", "video-encoder");
parse = gst_element_factory_make ("h264parse", NULL);
- if (!encoder || !parse) {
- if (encoder)
- gst_object_unref (encoder);
- if (parse)
- gst_object_unref (parse);
- encoder = gst_element_factory_make ("x264enc", "video-encoder");
- g_object_set (encoder, "key-int-max", 25, "pass", 17,
- "speed-preset", 3, "stats-file", stats_file,
- "bitrate", quality, NULL);
- name = "X264 video encoder";
- } else {
+ if (encoder != NULL && parse != NULL) {
GstPad *encoder_sink_pad, *parse_src_pad;
GstElement *bin = gst_bin_new (NULL);
@@ -290,9 +279,29 @@ lgm_create_video_encoder (VideoEncoderType type, guint quality,
encoder = bin;
- name = "Fluendo H264 video encoder";
+ name = "Fluendo VA H264 video encoder";
+ } else {
+ if (encoder)
+ gst_object_unref (encoder);
+ if (parse)
+ gst_object_unref (parse);
+ encoder = gst_element_factory_make ("fluh264enc", "video-encoder");
+ if (encoder != NULL) {
+ g_object_set (encoder, "keyframe-period", 1000, "rate-control", 1,
+ "max-threads", 0, "profile", 1, "entropy-mode", 0,
+ "quality-speed", 0, "bitrate", quality, NULL);
+ name = "Fluendo IPP H264 video encoder";
+ } else {
+ gchar *stats_file = g_build_path (G_DIR_SEPARATOR_S, g_get_tmp_dir (),
+ "x264.log", NULL);
+ encoder = gst_element_factory_make ("x264enc", "video-encoder");
+ g_object_set (encoder, "key-int-max", 25, "pass", 17,
+ "speed-preset", 3, "stats-file", stats_file,
+ "bitrate", quality, NULL);
+ g_free (stats_file);
+ name = "X264 video encoder";
+ }
}
- g_free (stats_file);
break;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]