[longomatch] Keep DAR in images inserted in the playlist



commit d6d4869c2537ae121e34288ef1e8358be2cddfdb
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Mon Feb 16 18:33:21 2015 +0100

    Keep DAR in images inserted in the playlist
    
    Help video converter to calculate the DAR and add black
    borders when need by setting pixel-aspect-ratio=1/1
    in the buffer caps

 libcesarplayer/gst-nle-source.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/libcesarplayer/gst-nle-source.c b/libcesarplayer/gst-nle-source.c
index 64db5b4..665528e 100644
--- a/libcesarplayer/gst-nle-source.c
+++ b/libcesarplayer/gst-nle-source.c
@@ -412,6 +412,14 @@ gst_nle_source_on_video_buffer (GstAppSink * appsink, gpointer data)
 
   if (item->still_picture) {
     GstBuffer *end_buf;
+    GstCaps *bcaps, *ncaps;
+
+    bcaps = gst_buffer_get_caps (buf);
+    ncaps = gst_caps_make_writable (bcaps);
+    gst_caps_set_simple (ncaps, "pixel-aspect-ratio", GST_TYPE_FRACTION,
+        1, 1, NULL);
+    gst_buffer_set_caps (buf, ncaps);
+    gst_caps_unref (ncaps);
 
     end_buf = gst_buffer_copy (buf);
 


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