[longomatch] Use baseline profile and hint realtime in live recording
- From: Andoni Morales Alastruey <amorales src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [longomatch] Use baseline profile and hint realtime in live recording
- Date: Wed, 3 Dec 2014 15:41:04 +0000 (UTC)
commit 027d61b624b09191c255bf4680671d99d04ee069
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date: Wed Dec 3 15:25:53 2014 +0100
Use baseline profile and hint realtime in live recording
libcesarplayer/gst-camera-capturer.c | 2 +-
libcesarplayer/gst-video-editor.c | 2 +-
libcesarplayer/gst-video-encoder.c | 2 +-
libcesarplayer/video-utils.h | 2 +-
libcesarplayer/video-utils.m | 8 ++++++--
5 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/libcesarplayer/gst-camera-capturer.c b/libcesarplayer/gst-camera-capturer.c
index 2cf1302..df7a731 100644
--- a/libcesarplayer/gst-camera-capturer.c
+++ b/libcesarplayer/gst-camera-capturer.c
@@ -1095,7 +1095,7 @@ gst_camera_capturer_create_video_encoder (GstCameraCapturer * gcc,
g_return_val_if_fail (gcc != NULL, FALSE);
g_return_val_if_fail (GST_IS_CAMERA_CAPTURER (gcc), FALSE);
- encoder = lgm_create_video_encoder (type, gcc->priv->video_quality,
+ encoder = lgm_create_video_encoder (type, gcc->priv->video_quality, TRUE,
GCC_ERROR, err);
if (!encoder) {
return FALSE;
diff --git a/libcesarplayer/gst-video-editor.c b/libcesarplayer/gst-video-editor.c
index 1555a94..b834eec 100644
--- a/libcesarplayer/gst-video-editor.c
+++ b/libcesarplayer/gst-video-editor.c
@@ -235,7 +235,7 @@ gve_create_video_encode_bin (GstVideoEditor * gve)
gve->priv->queue = gst_element_factory_make ("queue2", "video-encode-queue");
gve->priv->video_encoder =
lgm_create_video_encoder (gve->priv->video_encoder_type,
- gve->priv->video_quality, GVE_ERROR, &error);
+ gve->priv->video_quality, FALSE, GVE_ERROR, &error);
if (error) {
g_signal_emit (gve, gve_signals[SIGNAL_ERROR], 0, error->message);
g_error_free (error);
diff --git a/libcesarplayer/gst-video-encoder.c b/libcesarplayer/gst-video-encoder.c
index 643ce78..b6e77b5 100644
--- a/libcesarplayer/gst-video-encoder.c
+++ b/libcesarplayer/gst-video-encoder.c
@@ -465,7 +465,7 @@ gst_video_encoder_create_video_encoder (GstVideoEncoder * gve,
g_return_val_if_fail (GST_IS_VIDEO_ENCODER (gve), FALSE);
encoder = lgm_create_video_encoder (type, gve->priv->video_quality,
- GVE_ERROR, err);
+ FALSE, GVE_ERROR, err);
if (!encoder) {
return FALSE;
}
diff --git a/libcesarplayer/video-utils.h b/libcesarplayer/video-utils.h
index dcc2fb3..14ff9e4 100644
--- a/libcesarplayer/video-utils.h
+++ b/libcesarplayer/video-utils.h
@@ -60,7 +60,7 @@ EXPORT GstDiscovererResult lgm_discover_uri (const gchar *uri, guint64 *duration
guint *par_d, gchar **container, gchar **video_codec, gchar **audio_codec,
GError **err);
EXPORT GstElement * lgm_create_video_encoder (VideoEncoderType type, guint quality,
- GQuark quark, GError **err);
+ gboolean realtime, GQuark quark, GError **err);
EXPORT GstElement * lgm_create_audio_encoder (AudioEncoderType type, guint quality,
GQuark quark, GError **err);
EXPORT GstElement * lgm_create_muxer (VideoMuxerType type,
diff --git a/libcesarplayer/video-utils.m b/libcesarplayer/video-utils.m
index ec67ad6..ba00098 100644
--- a/libcesarplayer/video-utils.m
+++ b/libcesarplayer/video-utils.m
@@ -228,7 +228,7 @@ lgm_discover_uri (const gchar * filename, guint64 * duration, guint * width,
GstElement *
lgm_create_video_encoder (VideoEncoderType type, guint quality,
- GQuark quark, GError ** err)
+ gboolean realtime, GQuark quark, GError ** err)
{
GstElement *encoder = NULL;
gchar *name = NULL;
@@ -270,7 +270,11 @@ lgm_create_video_encoder (VideoEncoderType type, guint quality,
GstElement *bin = gst_bin_new (NULL);
g_object_set (encoder, "bitrate", quality, "keyframe-period", 1000,
- "rate-control", 1, "entropy-mode", 1, NULL);
+ "rate-control", 1, "entropy-mode", 1, "allow-b-frames", FALSE,
+ "profile", 1, NULL);
+ if (realtime) {
+ g_object_set (encoder, "realtime", TRUE, NULL);
+ }
gst_bin_add_many (GST_BIN (bin), encoder, parse, NULL);
gst_element_link (encoder, parse);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]