summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoen Kooi <koen@openembedded.org>2011-01-26 22:05:44 +0100
committerKoen Kooi <koen@openembedded.org>2011-01-26 22:07:10 +0100
commit60911f259a77727839b07188f03eaff34e64de2f (patch)
tree08dffdd38a9314225746ef1daea6da045015b660
parent1a9a5b145cad7d4c5e5d5533886f21db454b9ec5 (diff)
downloadopenembedded-60911f259a77727839b07188f03eaff34e64de2f.tar.gz
omapfbplay: import 3 patches from git to fix playing weird sized videos
Signed-off-by: Koen Kooi <koen@openembedded.org>
-rw-r--r--recipes/ffmpeg/omapfbplay.inc5
-rw-r--r--recipes/ffmpeg/omapfbplay/0001-Remove-pointless-function-frame_format.patch60
-rw-r--r--recipes/ffmpeg/omapfbplay/0002-avcodec-fix-frame-size-calculation.patch27
-rw-r--r--recipes/ffmpeg/omapfbplay/0003-Print-allocated-and-displayed-frame-size.patch27
4 files changed, 118 insertions, 1 deletions
diff --git a/recipes/ffmpeg/omapfbplay.inc b/recipes/ffmpeg/omapfbplay.inc
index 5168698426..c301d1dce3 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 0000000000..07357c9907
--- /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@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 0000000000..d8c0d09823
--- /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@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 0000000000..c5c1d84ae7
--- /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@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
+