summaryrefslogtreecommitdiffstats
path: root/DOCS
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-04-13 00:47:54 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-04-13 00:47:54 +0000
commitc6557f97c5b5dd178b89aa22975ff6807d7daa1d (patch)
tree8b4b77573248d36f1fda789d62b5cd4ea0a09735 /DOCS
parente81aec44e8450ca3a986d676c16135b03e00f9b5 (diff)
downloadmpv-c6557f97c5b5dd178b89aa22975ff6807d7daa1d.tar.bz2
mpv-c6557f97c5b5dd178b89aa22975ff6807d7daa1d.tar.xz
draft v0.1
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5582 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'DOCS')
-rw-r--r--DOCS/tech/osd.txt84
1 files changed, 84 insertions, 0 deletions
diff --git a/DOCS/tech/osd.txt b/DOCS/tech/osd.txt
new file mode 100644
index 0000000000..d865dd95a7
--- /dev/null
+++ b/DOCS/tech/osd.txt
@@ -0,0 +1,84 @@
+some draft of new osd engine:
+=============================
+written by A'rpi
+including ideas from maillist from Jiri Svoboda, Tobias Diedrich, Artur Zaprzala
+Michael Niedermayer, Felix Buenemann, LGB
+
+requirements:
+- be able to do partial rendering, within a given bounding box
+ usefull, when parts of osd are outside of teh image and has to be
+ updated only when osd changes, or even has different colorspace
+
+- text should be rendered in 2-pass way: 1. alpha 2. pixels
+ so char's alpha won't overwrite previous char, and may be faster
+
+- osd elements should be cached - so rendering once into the cache and
+ reuse this while it's unchanged
+
+- colors support (csp could be YA, YUVA, RGB )
+
+- change brightness, saturation, hue of chars ???
+
+- way to disable alphablending, and use black outline (FAST_OSD now)
+
+- develop some text-based apps: osdterm, osdzilla etc ;)
+
+Ok. The basic idea of my design is using 'osd objects', a data structure
+in a 1 (or 2?) way linked list.
+There would be different object types, sharing type-dependent data in an
+union. The basic types: box, text, symbol, progressbar, group.
+
+Group would be a special type, grouping other osd objects together,
+with a common x,y and boundingbox. usefull for grouping symbol+progrbar
+or multiline subtitle text.
+
+Each obj could have flags, for example:
+- visible (set if we should display it)
+- color (set if it's YUVA not YA)
+- cached (set when there is a cached rendered variant)
+- bbox updated (should be set when recalc bbox, reset when change params)
+- several flags to control positioning. for example, x;y could be
+ absolute coord, or percent. flags to set left/center/right alignment...
+- start and end timestamp, to automagically set/reset visible flag
+
+ok, my first draft:
+
+typedef struct mp_osd_obj_s {
+ struct mp_osd_obj_s* next;
+ unsigned char type;
+ unsigned char alignment; // 2 bits: x;y percents, 2 bits: x;y relative to parent; 2 bits: alignment left/right/center
+ unsigned short flags;
+ int x,y; // coords
+ unsigned char color[4]; // YUVA
+ mp_osd_bbox_t bbox; // bounding box
+ unsigned int start,duration; // PTS
+ union {
+ struct {
+ int x1,y1,x2,y2;
+ } line;
+ struct {
+ int x,y,w,h;
+ } rect;
+ struct {
+ char* text;
+ mp_font_t* font;
+ } text;
+ struct {
+ int symbol; // unicode
+ mp_font_t* font;
+ } symbol;
+ struct {
+ float value;
+ mp_font_t* font;
+ } pbar;
+ struct {
+ int w,h;
+ unsigned char* image;
+ unsigned int* palette;
+ } spu; // FIXME!
+ struct {
+ struct mp_osd_obj_s* children;
+ } group;
+ } params;
+} mp_osd_obj_t;
+