[oe-commits] Koen Kooi : omapfbplay: import 3 patches from git to fix playing weird sized videos

git version control git at git.openembedded.org
Thu Feb 3 22:36:27 UTC 2011


Module: openembedded.git
Branch: ulf/linux-2.6.30-2011-01-16
Commit: 144b41251f7f7cbd392fddd0d08451cf860f07f2
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=144b41251f7f7cbd392fddd0d08451cf860f07f2

Author: Koen Kooi <koen at openembedded.org>
Date:   Wed Jan 26 22:05:44 2011 +0100

omapfbplay: import 3 patches from git to fix playing weird sized videos

Signed-off-by: Koen Kooi <koen at openembedded.org>

---

 recipes/ffmpeg/omapfbplay.inc                      |    5 +-
 ...01-Remove-pointless-function-frame_format.patch |   60 ++++++++++++++++++++
 .../0002-avcodec-fix-frame-size-calculation.patch  |   27 +++++++++
 ...-Print-allocated-and-displayed-frame-size.patch |   27 +++++++++
 4 files changed, 118 insertions(+), 1 deletions(-)

diff --git a/recipes/ffmpeg/omapfbplay.inc b/recipes/ffmpeg/omapfbplay.inc
index 5168698..c301d1d 100644
--- a/recipes/ffmpeg/omapfbplay.inc
+++ b/recipes/ffmpeg/omapfbplay.inc
@@ -2,12 +2,15 @@ DESCRIPTION = "Simple ffmpeg-based player that uses the omapfb overlays"
 DEPENDS = "bzip2 lame ffmpeg virtual/kernel"
 LICENSE = "MIT"
 
-PR = "r27"
+PR = "r28"
 
 PV = "0.0+${PR}+gitr${SRCREV}"
 
 SRCREV = "1d217676ba71e8740524e9814c47da39880ed3bc"
 SRC_URI = "git://git.mansr.com/omapfbplay;protocol=git \
+           file://0001-Remove-pointless-function-frame_format.patch \
+           file://0002-avcodec-fix-frame-size-calculation.patch \
+           file://0003-Print-allocated-and-displayed-frame-size.patch \
 "
 
 S = "${WORKDIR}/git"
diff --git a/recipes/ffmpeg/omapfbplay/0001-Remove-pointless-function-frame_format.patch b/recipes/ffmpeg/omapfbplay/0001-Remove-pointless-function-frame_format.patch
new file mode 100644
index 0000000..07357c9
--- /dev/null
+++ b/recipes/ffmpeg/omapfbplay/0001-Remove-pointless-function-frame_format.patch
@@ -0,0 +1,60 @@
+From 27e9c12063427e6d1c245d9ce594916966764750 Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans at mansr.com>
+Date: Wed, 26 Jan 2011 18:34:26 +0000
+Subject: [PATCH 1/3] Remove pointless function frame_format()
+
+Decoders are required to fill in the frame format.
+---
+ omapfbplay.c |   22 ++++++++--------------
+ 1 files changed, 8 insertions(+), 14 deletions(-)
+
+diff --git a/omapfbplay.c b/omapfbplay.c
+index 3409780..2daed18 100644
+--- a/omapfbplay.c
++++ b/omapfbplay.c
+@@ -300,17 +300,6 @@ void ofbp_post_frame(struct frame *f)
+ }
+ 
+ static void
+-frame_format(int width, int height, struct frame_format *ff)
+-{
+-    ff->width  = ALIGN(width,  32);
+-    ff->height = ALIGN(height, 32);
+-    ff->disp_x = 0;
+-    ff->disp_y = 0;
+-    ff->disp_w = width;
+-    ff->disp_h = height;
+-}
+-
+-static void
+ init_frames(struct frame_format *ff)
+ {
+     const struct pixfmt *pf = ofbp_get_pixfmt(ff->pixfmt);
+@@ -445,7 +434,12 @@ speed_test(const char *drv, const char *mem, const char *conv,
+         return 1;
+     }
+ 
+-    frame_format(w, h, &ff);
++    ff.width  = ALIGN(w, 32);
++    ff.height = ALIGN(h, 32);
++    ff.disp_x = 0;
++    ff.disp_y = 0;
++    ff.disp_w = w;
++    ff.disp_h = h;
+ 
+     dp.pixfmt = ff.pixfmt = PIX_FMT_YUV420P;
+     display = display_open(drv, &dp, &ff);
+@@ -599,8 +593,8 @@ main(int argc, char **argv)
+     }
+ 
+     if (!frame_fmt.width) {
+-        frame_fmt.pixfmt = st->codec->pix_fmt;
+-        frame_format(st->codec->width, st->codec->height, &frame_fmt);
++        fprintf(stderr, "Decoder error: frame size not specified\n");
++        error(1);
+     }
+ 
+     dp.pixfmt = frame_fmt.pixfmt;
+-- 
+1.6.6.1
+
diff --git a/recipes/ffmpeg/omapfbplay/0002-avcodec-fix-frame-size-calculation.patch b/recipes/ffmpeg/omapfbplay/0002-avcodec-fix-frame-size-calculation.patch
new file mode 100644
index 0000000..d8c0d09
--- /dev/null
+++ b/recipes/ffmpeg/omapfbplay/0002-avcodec-fix-frame-size-calculation.patch
@@ -0,0 +1,27 @@
+From a1232ad05e004dbb2253e78223e886c32ccfb9a1 Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans at mansr.com>
+Date: Wed, 26 Jan 2011 18:36:29 +0000
+Subject: [PATCH 2/3] avcodec: fix frame size calculation
+
+---
+ avcodec.c |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/avcodec.c b/avcodec.c
+index f2af6ed..d527924 100644
+--- a/avcodec.c
++++ b/avcodec.c
+@@ -112,8 +112,8 @@ static int lavc_open(const char *name, AVCodecContext *params,
+     x_off      = ALIGN(edge_width, 32);
+     y_off      = edge_width;
+ 
+-    ff->width  = ALIGN(params->width, 32) + 2 * x_off;
+-    ff->height = params->height           + 2 * y_off;
++    ff->width  = ALIGN(params->width  + 2 * x_off, 32);
++    ff->height = ALIGN(params->height + 2 * y_off, 32);
+     ff->disp_x = x_off;
+     ff->disp_y = y_off;
+     ff->disp_w = params->width;
+-- 
+1.6.6.1
+
diff --git a/recipes/ffmpeg/omapfbplay/0003-Print-allocated-and-displayed-frame-size.patch b/recipes/ffmpeg/omapfbplay/0003-Print-allocated-and-displayed-frame-size.patch
new file mode 100644
index 0000000..c5c1d84
--- /dev/null
+++ b/recipes/ffmpeg/omapfbplay/0003-Print-allocated-and-displayed-frame-size.patch
@@ -0,0 +1,27 @@
+From c605472e05594df9fa7c3c3c94ee86b1517aa159 Mon Sep 17 00:00:00 2001
+From: Mans Rullgard <mans at mansr.com>
+Date: Wed, 26 Jan 2011 18:36:52 +0000
+Subject: [PATCH 3/3] Print allocated and displayed frame size
+
+---
+ omapfbplay.c |    4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/omapfbplay.c b/omapfbplay.c
+index 2daed18..ad35bd5 100644
+--- a/omapfbplay.c
++++ b/omapfbplay.c
+@@ -306,6 +306,10 @@ init_frames(struct frame_format *ff)
+     int offsets[3];
+     int i, j;
+ 
++    fprintf(stderr, "Frame size %dx%d, display %dx%d @ %d,%d\n",
++            ff->width, ff->height, ff->disp_w, ff->disp_h,
++            ff->disp_x, ff->disp_y);
++
+     ofbp_get_plane_offsets(offsets, pf, ff->disp_x, ff->disp_y,
+                            frames->linesize);
+ 
+-- 
+1.6.6.1
+





More information about the Openembedded-commits mailing list