[longomatch] Only force par=1/1 when width or height are not set



commit 02d4328328c8988256666a91acddbcea4c8eced5
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Tue Jan 27 17:00:45 2015 +0100

    Only force par=1/1 when width or height are not set

 libcesarplayer/gst-video-encoder.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/libcesarplayer/gst-video-encoder.c b/libcesarplayer/gst-video-encoder.c
index 33b5d9e..804b719 100644
--- a/libcesarplayer/gst-video-encoder.c
+++ b/libcesarplayer/gst-video-encoder.c
@@ -255,10 +255,6 @@ gst_video_encoder_create_encoder_bin (GstVideoEncoder * gve)
 
   /* Set caps for the encoding resolution */
   video_caps = gst_caps_new_simple ("video/x-raw-yuv", NULL);
-  /* gst_caps_set_simple (video_caps, "format", GST_TYPE_FOURCC,
-      GST_STR_FOURCC ("I420"), NULL); */
-  gst_caps_set_simple (video_caps, "pixel-aspect-ratio", GST_TYPE_FRACTION,
-      1, 1, NULL);
   if (gve->priv->output_width != 0) {
     gst_caps_set_simple (video_caps, "width", G_TYPE_INT,
         gve->priv->output_width, NULL);
@@ -267,6 +263,10 @@ gst_video_encoder_create_encoder_bin (GstVideoEncoder * gve)
     gst_caps_set_simple (video_caps, "height", G_TYPE_INT,
         gve->priv->output_height, NULL);
   }
+  if (gve->priv->output_height == 0 || gve->priv->output_width == 0) {
+    gst_caps_set_simple (video_caps, "pixel-aspect-ratio", GST_TYPE_FRACTION,
+        1, 1, NULL);
+  }
   /* Set caps for the encoding framerate */
   if (gve->priv->fps_n != 0 && gve->priv->fps_d != 0) {
     gst_caps_set_simple (video_caps, "framerate", GST_TYPE_FRACTION,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]