summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--dxr3osd.c14
-rw-r--r--scaler.c34
-rw-r--r--scaler.h39
4 files changed, 88 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 7229adf..d01c84c 100644
--- a/Makefile
+++ b/Makefile
@@ -75,7 +75,7 @@ OBJS = $(PLUGIN).o dxr3multichannelaudio.o dxr3colormanager.o \
dxr3pesframe.o dxr3demuxdevice.o dxr3configdata.o \
dxr3interface_spu_encoder.o dxr3interface.o dxr3device.o \
dxr3output.o dxr3output-video.o dxr3output-audio.o dxr3osd.o dxr3spudecoder.o \
- dxr3audio-oss.o dxr3audio-alsa.o spuencoder.o spuregion.o
+ dxr3audio-oss.o dxr3audio-alsa.o spuencoder.o spuregion.o scaler.o
### Default target:
diff --git a/dxr3osd.c b/dxr3osd.c
index 9a78b1c..10b4024 100644
--- a/dxr3osd.c
+++ b/dxr3osd.c
@@ -25,6 +25,7 @@
#include "dxr3osd.h"
#include "dxr3interface_spu_encoder.h"
+#include "scaler.h"
// ==================================
// ! create osd at (Left, Top, Level)
@@ -229,6 +230,19 @@ void cDxr3Osd::Flush()
bmap = mergedBitmap;
}
+ uint32_t horizontal, vertical;
+ cDxr3Interface::instance()->dimension(horizontal, vertical);
+
+ // check if we need to scale the osd
+ if (horizontal < 720 || vertical < 576) {
+
+ // TODO
+ dsyslog("SCALE ME");
+ }
+
+ if (!bmap)
+ return;
+
// encode bitmap
if (bmap->Dirty(x1, y1, x2, y2)) {
cSpuEncoder::instance()->encode(bmap, Top(), Left());
diff --git a/scaler.c b/scaler.c
new file mode 100644
index 0000000..04e8d22
--- /dev/null
+++ b/scaler.c
@@ -0,0 +1,34 @@
+/*
+ * _ _ _ _ _____
+ * __ ____| |_ __ _ __ | |_ _ __ _(_)_ __ __| |_ ___ _|___ /
+ * \ \ / / _` | '__|____| '_ \| | | | |/ _` | | '_ \ _____ / _` \ \/ / '__||_ \
+ * \ V / (_| | | |_____| |_) | | |_| | (_| | | | | |_____| (_| |> <| | ___) |
+ * \_/ \__,_|_| | .__/|_|\__,_|\__, |_|_| |_| \__,_/_/\_\_| |____/
+ * |_| |___/
+ *
+ * Copyright (C) 2009 Christian Gmeiner
+ *
+ * This file is part of vdr-plugin-dxr3.
+ *
+ * vdr-plugin-dxr3 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2.
+ *
+ * vdr-plugin-dxr3 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with dxr3-plugin. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#include "scaler.h"
+#include <vdr/osd.h>
+
+cBitmap *cScaler::scaleBitmap(cBitmap *src, uint32_t width, uint32_t height)
+{
+ // TODO
+ return NULL;
+}
diff --git a/scaler.h b/scaler.h
new file mode 100644
index 0000000..0ef336f
--- /dev/null
+++ b/scaler.h
@@ -0,0 +1,39 @@
+/*
+ * _ _ _ _ _____
+ * __ ____| |_ __ _ __ | |_ _ __ _(_)_ __ __| |_ ___ _|___ /
+ * \ \ / / _` | '__|____| '_ \| | | | |/ _` | | '_ \ _____ / _` \ \/ / '__||_ \
+ * \ V / (_| | | |_____| |_) | | |_| | (_| | | | | |_____| (_| |> <| | ___) |
+ * \_/ \__,_|_| | .__/|_|\__,_|\__, |_|_| |_| \__,_/_/\_\_| |____/
+ * |_| |___/
+ *
+ * Copyright (C) 2009 Christian Gmeiner
+ *
+ * This file is part of vdr-plugin-dxr3.
+ *
+ * vdr-plugin-dxr3 is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation version 2.
+ *
+ * vdr-plugin-dxr3 is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with dxr3-plugin. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef SCALER_H
+#define SCALER_H
+
+#include <stdint.h>
+#include <vdr/osd.h>
+
+class cScaler {
+public:
+ static cBitmap *scaleBitmap(cBitmap *src, uint32_t width, uint32_t height);
+};
+
+
+#endif /*SCALER_H*/