diff options
author | Christian Gmeiner <christian.gmeiner@gmail.com> | 2009-09-01 21:18:28 +0200 |
---|---|---|
committer | Christian Gmeiner <christian.gmeiner@gmail.com> | 2009-09-01 21:18:28 +0200 |
commit | 27aa9797a4697b86b94dc9762317c5b3b8420a1b (patch) | |
tree | 796eecbff606603f264eb99a041ec591e612f333 /spuencoder.c | |
parent | 532cbfabb71649b03c88deffb3b8003894dc1b88 (diff) | |
download | vdr-plugin-dxr3-27aa9797a4697b86b94dc9762317c5b3b8420a1b.tar.gz vdr-plugin-dxr3-27aa9797a4697b86b94dc9762317c5b3b8420a1b.tar.bz2 |
add method generateSpuData
this method will use the rle data and other informations to generate
a valid spu packet. At the moment it is a stub.
Diffstat (limited to 'spuencoder.c')
-rw-r--r-- | spuencoder.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/spuencoder.c b/spuencoder.c index fe6425f..61a5ae8 100644 --- a/spuencoder.c +++ b/spuencoder.c @@ -75,6 +75,8 @@ void cSpuEncoder::encode(cBitmap *bmap, int top, int left) this->left = left; // prepare datastructures + memset(rleData.top, 0, sizeof(rleData.top)); + memset(rleData.bottom, 0, sizeof(rleData.bottom)); memset(&spu, 0, sizeof(spu)); // get needed informations about used colors @@ -82,9 +84,26 @@ void cSpuEncoder::encode(cBitmap *bmap, int top, int left) dsyslog("[dxr3-spuencoder] num colors %d", numColors); - // generate and upload color palette generateColorPalette(); + + // as we have only small space for all our spu data, we do here + // a little trick. If we run out of space, when using + // top and odd bottom, we try to use two times the top lines. + // this will gain some more free space. the osd may not look + // as good as with top and bottom lines, but its better to + // have a working and maybe not so sexy looking osd instead of a + // a broken osd. + + try { + generateSpuData(true); + } catch (char const* e) { + + dsyslog("[dxr3-spuencoder] %s", e); + + // make a try with only even lines + generateSpuData(false); + } } void cSpuEncoder::writeNibble(uint8_t val) @@ -121,3 +140,7 @@ void cSpuEncoder::generateColorPalette() // upload color palette cDxr3Interface::instance()->SetPalette(palcolors); } + +void cSpuEncoder::generateSpuData(bool topAndBottom) throw (char const* ) +{ +} |