diff options
author | Christian Gmeiner <christian.gmeiner@gmail.com> | 2009-04-30 15:54:15 +0200 |
---|---|---|
committer | Christian Gmeiner <christian.gmeiner@gmail.com> | 2009-04-30 15:54:15 +0200 |
commit | 1cc0b4ff7cbf83469492023cb0c5dd60c20896df (patch) | |
tree | 604426490eae018ecd6edf7c9a9a1091a1f5eaaf | |
parent | 51d63db494498d3c47183b476125a028be4eb9c8 (diff) | |
download | vdr-plugin-dxr3-1cc0b4ff7cbf83469492023cb0c5dd60c20896df.tar.gz vdr-plugin-dxr3-1cc0b4ff7cbf83469492023cb0c5dd60c20896df.tar.bz2 |
remove some not needed source files
-rw-r--r-- | dxr3spuencoder.c | 240 | ||||
-rw-r--r-- | dxr3spuencoder.h | 203 |
2 files changed, 0 insertions, 443 deletions
diff --git a/dxr3spuencoder.c b/dxr3spuencoder.c deleted file mode 100644 index 091c5c8..0000000 --- a/dxr3spuencoder.c +++ /dev/null @@ -1,240 +0,0 @@ -/* - * spuenc.c - encodes an OSD bitmap as subpicture - * - * Assimilated and adapted by - * Stefan Schluenss <dxr3_osd@schluenss.de> - * Nov. 2002 - * - * Based on the subpicture encoding routines from MPlayer and - * the information given by - * Samuel Hocevar - * Michel Lespinasse - * and http://members.aol.com/mpucoder/DVD/spu.html - * - * This program 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; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#include "dxr3spuencoder.h" - -// ================================== -// dec. -cSpuData::~cSpuData() -{ - Clear(); -} - -// ================================== -// free buffer and set it to 0 -void cSpuData::Clear() -{ - if (data) - { - free(data); - count = malloc_size = 0; - } -} - -// ================================== -// wirte a byte to spu buffer -void cSpuData::WriteByte(uint8_t byte) -{ - if (count >= malloc_size) - { - data = (u_char*)realloc(data, malloc_size += 2048); - } - - data[count++] = byte; -} - -// ================================== -void cSpuData::WriteNibble(int *higher_nibble, uint8_t nibble) -{ -} - -// ================================== -void cSpuData::WriteRle(int *higher_nibble, int length, int color) -{ -} - - -// ================================== -cSPUEncoder::cSPUEncoder() -{ - m_lastwindow = 0; - - // clear osd - memset(m_OSD, 0x00 ,OSDWIDTH * OSDHEIGHT); -} - -// ================================== -// main function for the osd -// makes life nicer :) -int cSPUEncoder::Cmd(OSD_Command cmd, int color, int x0, int y0, int x1, int y1, const void *data) -{ - switch (cmd) - { - case OSD_SetWindow: - // (x0) set window with number 0<x0<8 as current - if (x0 < 8 && x0 > 0) - { - m_lastwindow = x0; - return 0; - } - - return -1; - break; - - case OSD_Open: - // (x0,y0,x1,y1,BitPerPixel[2/4/8](color&0x0F),mix[0..15](color&0xF0)) - // Opens OSD with this size and bit depth - // returns 0 on success, -1 on DRAM allocation error, -2 on "already open" - m_windows[m_lastwindow].x0 = x0; - m_windows[m_lastwindow].y0 = y0; - m_windows[m_lastwindow].x1 = x1; - m_windows[m_lastwindow].y1 = y1; - - // calculate new active osd area - CalculateActiveOsdArea(); - - return 0; - break; - - case OSD_SetPalette: - // Spu->Cmd(OSD_SetPalette, 0, NumColors - 1, 0, 0, 0, Colors); - // (firstcolor{color},lastcolor{x0},data) - // Set a number of entries in the palette - // sets the entries "firstcolor" through "lastcolor" from the array "data" - // data has 4 byte for each color: - // R,G,B, and a opacity value: 0->transparent, 1..254->mix, 255->pixel - - return 0; - break; - - case OSD_SetBlock: - // (x0,y0,x1,y1,increment{color},data) - // fills pixels x0,y0 through x1,y1 with the content of data[] - // inc contains the width of one line in the data block, - // inc<=0 uses blockwidth as linewidth - // returns 0 on success, -1 on clipping all pixel - - return 0; - break; - - case OSD_Close: - // clear colors from plattemanager - - // set windows position to 0 - m_windows[m_lastwindow].x0 = 0; - m_windows[m_lastwindow].y0 = 0; - m_windows[m_lastwindow].x1 = 0; - m_windows[m_lastwindow].y1 = 0; - - // calculate new active osd area - CalculateActiveOsdArea(); - - return 0; - break; - - case OSD_Clear: - // Sets all pixel to color 0 - // returns 0 on success - - // This should be done in cSPUEncoder::cSPUEncoder - - return 0; - break; - - // not needed - at the moment - case OSD_Show: - case OSD_Hide: - case OSD_Fill: - case OSD_SetColor: - case OSD_SetTrans: - case OSD_SetPixel: - case OSD_GetPixel: - case OSD_SetRow: - case OSD_FillRow: - case OSD_FillBlock: - case OSD_Line: - case OSD_Query: - case OSD_Test: - case OSD_Text: - case OSD_MoveWindow: - break; - }; - - return -1; -} - -// ================================== -// stamps window content into full osd bitmap -void cSPUEncoder::CopyBlockIntoOSD(int linewidth, int x0, int y0, int x1, int y1, u_char *data) -{ - int i; - int w; - u_char *cp; - u_char *sp = data; - - - // linewidth contains the width of one line in the data block, - // linewidth<=0 uses blockwidth as linewidth - if (linewidth <= 0) - { - w = m_windows[m_lastwindow].x1 - m_windows[m_lastwindow].x0; - } - else - { - w = linewidth; - } - - for (i = y0; i <= y1; ++i) - { - cp = &m_OSD[i*OSDWIDTH + x0]; - if ((cp+x1-x0+1) < &m_OSD[OSDWIDTH * OSDHEIGHT-1]) - { - for (int xx=0; xx <= (x1-x0); xx++) - { - *(cp+xx) = m_windows[m_lastwindow].colors[*(sp+xx) & 0x0f]; - } - } - else - { - continue; - } - sp += w; - } -} - -// ================================== -// we _only_ write usefull data -void cSPUEncoder::CalculateActiveOsdArea() -{ - // reset - m_active_osd.Reset(); - - // calculate - for (int i = 0; i < 8; i++) - { - m_active_osd.x0 = std::max(m_active_osd.x0, m_windows[i].x0); - m_active_osd.x1 = std::max(m_active_osd.x1, m_windows[i].y0); - m_active_osd.y0 = std::max(m_active_osd.y0, m_windows[i].x1); - m_active_osd.y1 = std::max(m_active_osd.y1, m_windows[i].y1); - } - - cLog::Instance() << "OSD x0: " << m_active_osd.x0 << "\n"; - cLog::Instance() << "OSD y0: " << m_active_osd.y0 << "\n"; - cLog::Instance() << "OSD x1: " << m_active_osd.x1 << "\n"; - cLog::Instance() << "OSD y1: " << m_active_osd.y1 << "\n"; -} diff --git a/dxr3spuencoder.h b/dxr3spuencoder.h deleted file mode 100644 index 4e8ec53..0000000 --- a/dxr3spuencoder.h +++ /dev/null @@ -1,203 +0,0 @@ -/* - * dxr3interface_spu_encoder.h - encodes an OSD bitmap as subpicture - * - * Assimilated and adapted by - * Stefan Schluenss <dxr3_osd@schluenss.de> - * Nov. 2002 - * - * Based on the subpicture encoding routines from MPlayer and - * the information given by - * Samuel Hocevar - * Michel Lespinasse - * and http://members.aol.com/mpucoder/DVD/spu.html - * - * This program 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; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -*/ - -#ifndef _DXR3_INTERFACE_SPU_ENCODER_ -#define _DXR3_INTERFACE_SPU_ENCODER_ - -#include <stdlib.h> -#include <linux/dvb/osd.h> -#include <vdr/osd.h> -#include "dxr3palettemanager.h" -#include "dxr3colormanager.h" -#include "dxr3interface.h" -#include "dxr3singleton.h" - -// ================================== -#define MAXWINDOWS 8 -#define DATASIZE 53220 -#define OSDWIDTH 720 -#define OSDWIDTH2 480 -#define OSDHEIGHT 576 - -// ================================== -// basic infos about one osd "window" -struct sOSD_Window -{ - size_t x0; - size_t y0; - size_t x1; - size_t y1; - - unsigned char colors[16]; - unsigned char opacity[16]; - - size_t NumColors; -}; - -// ================================== -// used to get active osd area -struct sRectal -{ - sRectal() { Reset(); } - - void Reset() - { - x0 = x1 = y0 = y1 = 0; - } - - - size_t x0; - size_t x1; - size_t y0; - size_t y1; -}; - -// ================================== -// our spu(data) with all needed routines -class cSpuData -{ -public: - cSpuData(): count(0), malloc_size(0) {} - ~cSpuData(); - - void Clear(); - u_char* GetData() const { return data; } - - // write operations - void WriteByte(uint8_t byte); - void WriteNibble(int *higher_nibble, uint8_t nibble); - void WriteRle(int *higher_nibble, int length, int color); - -private: - u_char *data; - size_t count; // the count of bytes written - size_t malloc_size; // size of data -}; - -// ================================== -class cSPUEncoder : public Singleton<cSPUEncoder> -{ -public: - cSPUEncoder(); - ~cSPUEncoder() {} - - int Cmd(OSD_Command cmd, int color = 0, int x0 = 0, int y0 = 0, int x1 = 0, int y1 = 0, const void *data = 0); - -private: - void CopyBlockIntoOSD(int linewidth, int x0,int y0, int x1, int y1, u_char *data); - - void CalculateActiveOsdArea(); - - - sOSD_Window m_windows[8]; - size_t m_lastwindow; - - // 'active' osd area - sRectal m_active_osd; - - // our osd :) - u_char m_OSD[OSDWIDTH * OSDHEIGHT]; -}; - -/* - -// ================================== -struct pixbuf -{ - int x, y; - u_int rgb[4]; - u_char* pixels; -}; -*/ -// ================================== -/* - -dxr3interface.c: In member function `void cDxr3Interface::ClearOsd()': -dxr3interface.c:984: error: `encodedata' undeclared (first use this function) -dxr3interface.c:984: error: (Each undeclared identifier is reported only once - for each function it appears in.) -dxr3interface.c:984: error: parse error before `;' token -dxr3interface.c:987: error: `ed' undeclared (first use this function) -make: *** [dxr3interface.o] Error 1 - - - !!Fix this!! - -*/ - -struct encodedata -{ - u_char data[DATASIZE]; - int count; // the count of bytes written - int oddstart; - int nibblewaiting; -}; -/* -// ================================== -class cSPUEncoder : public Singleton<cSPUEncoder> -{ -public: - cSPUEncoder(); - ~cSPUEncoder() {} - - int Cmd(OSD_Command cmd, int color = 0, int x0 = 0, int y0 = 0, int x1 = 0, int y1 = 0, const void *data = 0); - -private: - cSPUEncoder(cSPUEncoder&); // no copy constructor - - // helper functions - void CopyBlockIntoOSD(int linewidth, int x0,int y0, int x1, int y1, u_char *data); - void EncodePixelbufRle(int x, int y, int w, int h, u_char *inbuf, int stride, encodedata *ed); - void ScaleOSD(double fac, unsigned char* buf, unsigned char NumColors=4); - void encode_put_nibble(encodedata* ed, u_char nibble); - void encode_pixels(encodedata* ed, int color, int number); - void encode_eol(encodedata* ed); - void encode_do_row(encodedata* ed, pixbuf* pb, int row); - void encode_do_control(int x,int y, encodedata* ed, pixbuf* pb); - - void CalculateActiveOsdArea(); - - sOSD_Window m_windows[8]; - cDxr3PaletteManager m_palManager; - cColorManager* m_ColorManager; - encodedata m_encodeddata; - int m_lastwindow; - - // our osd :) - u_char OSD_Screen[OSDWIDTH * OSDHEIGHT]; - u_char OSD_Screen2[OSDWIDTH * OSDHEIGHT]; - u_char OSD_Screen3[OSDWIDTH * OSDHEIGHT]; - - // 'active' osd sizes - sRectal m_active_osd; -}; - -*/ - -#endif /*_DXR3_INTERFACE_SPU_ENCODER_*/ |