summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2017-07-11 09:36:45 -0400
committerSebastian Dröge <sebastian@centricular.com>2017-07-25 11:47:23 +0300
commitbb142cc5eded74603feac5e0e2b89bbde34e5bf6 (patch)
treef4160aa6e9ae666380539969ec08aa328d23d706
parent70bda7ef53283115e3ee106caee7ae050a99d259 (diff)
downloadgst-libav-bb142cc5eded74603feac5e0e2b89bbde34e5bf6.tar.gz
avviddec: Remove usage of deprecated EDGE APIs
As a side effect, left/right green bars goes away when using xvimagesink. I just think that xv cropping is broken, so this is probably just hiding a bug.
-rw-r--r--ext/libav/gstavviddec.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c
index 251823b..0eadced 100644
--- a/ext/libav/gstavviddec.c
+++ b/ext/libav/gstavviddec.c
@@ -614,7 +614,6 @@ gst_ffmpegvideodec_prepare_dr_pool (GstFFMpegVidDec * ffmpegdec,
gint width, height;
gint linesize_align[4];
gint i;
- guint edge;
gsize max_align;
width = GST_VIDEO_INFO_WIDTH (info);
@@ -624,22 +623,10 @@ gst_ffmpegvideodec_prepare_dr_pool (GstFFMpegVidDec * ffmpegdec,
avcodec_align_dimensions2 (ffmpegdec->context, &width, &height,
linesize_align);
- if (ffmpegdec->context->flags & CODEC_FLAG_EMU_EDGE)
- edge = 0;
- else
- edge = avcodec_get_edge_width ();
-
- /* increase the size for the padding */
- width += edge << 1;
- height += edge << 1;
-
- align.padding_top = edge;
- align.padding_left = edge;
- align.padding_right = width - GST_VIDEO_INFO_WIDTH (info) - edge;
- align.padding_bottom = height - GST_VIDEO_INFO_HEIGHT (info) - edge;
-
- /* add extra padding to match libav buffer allocation sizes */
- align.padding_bottom++;
+ align.padding_top = 0;
+ align.padding_left = 0;
+ align.padding_right = width - GST_VIDEO_INFO_WIDTH (info);
+ align.padding_bottom = height - GST_VIDEO_INFO_HEIGHT (info);
gst_buffer_pool_config_get_allocator (config, &allocator, &params);
@@ -2077,6 +2064,7 @@ gst_ffmpegviddec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query)
gst_buffer_unref (tmp);
if (same_stride) {
+ GST_DEBUG_OBJECT (ffmpegdec, "Using downstream pool.");
if (ffmpegdec->internal_pool)
gst_object_unref (ffmpegdec->internal_pool);
ffmpegdec->internal_pool = gst_object_ref (pool);
@@ -2091,6 +2079,7 @@ gst_ffmpegviddec_decide_allocation (GstVideoDecoder * decoder, GstQuery * query)
if (have_videometa && ffmpegdec->internal_pool
&& ffmpegdec->pool_width == state->info.width
&& ffmpegdec->pool_height == state->info.height) {
+ GST_DEBUG_OBJECT (ffmpegdec, "Pushing from internal pool");
update_pool = TRUE;
gst_object_unref (pool);
pool = gst_object_ref (ffmpegdec->internal_pool);