diff options
author | Andreas Regel <andreas.regel@powarman.de> | 2004-02-04 21:11:00 +0100 |
---|---|---|
committer | Andreas Regel <andreas.regel@powarman.de> | 2004-02-04 21:11:00 +0100 |
commit | 2e17045cd1b8abe771d136cbc3a815b547d32280 (patch) | |
tree | 99d3f176d8b6d32160d7464cdbbcf25a33c47a61 | |
parent | 64fe6b70d0a5b34a80ff458fbf1664018d5c0182 (diff) | |
download | vdr-plugin-osdpip-2e17045cd1b8abe771d136cbc3a815b547d32280.tar.gz vdr-plugin-osdpip-2e17045cd1b8abe771d136cbc3a815b547d32280.tar.bz2 |
Release version 0.0.4v0.0.4
- a second osd window with some information about the viewed channel and
event is now shown on screen
-rw-r--r-- | HISTORY | 7 | ||||
-rw-r--r-- | README | 6 | ||||
-rw-r--r-- | TODO | 5 | ||||
-rw-r--r-- | config.c | 65 | ||||
-rw-r--r-- | config.h | 30 | ||||
-rw-r--r-- | osd.c | 306 | ||||
-rw-r--r-- | osd.h | 15 | ||||
-rw-r--r-- | osdpip.c | 2 |
8 files changed, 307 insertions, 129 deletions
@@ -1,7 +1,12 @@ VDR Plugin 'osdpip' Revision History ------------------------------------ -2004-01-28: Version 0.0.3 (written by Andreas Regel) +2004-02-04: Version 0.0.4 (written by Andreas Regel) + +- a second osd window with some information about the viewed channel and + event is now shown on screen + +2004-01-24: Version 0.0.3 (written by Andreas Regel) - new TS->ES remuxer: now using VDR's cRemux for TS->PES and some own code for PES->ES @@ -43,6 +43,11 @@ From 0.0.3 on the plugin lets you choose the MPEG frames to decode and display (in the setup menu). For slower machines it is further possible to set an additional frame dropping. +From 0.0.4 the plugins shows some channel and schedule info in a second window +when switching channels. In setup menu you can change it's position and size. +This works flawlessly in 16 color greyscale mode. If you want to use it in one +of the other provided modes you have to use one of the already mentioned +patches. Otherwise you have to live with wrong colors in this modes. Installation: @@ -91,4 +96,5 @@ Up/Down Switch Channel up/down 1-4,6-9 Move box around like with cursor keys 0 Switch back to PiP channel and exit PiP Back Exit PiP without switching back +Ok Show/hide channel info window @@ -1,6 +1,3 @@ -- Show some info when switching channels in an extra OSD window - (this is a bit tricky when a 256-color OSD window is on screen, - but possible) - improve fixed palette color quantization - localization - +- vdr-like navigation through channels @@ -26,6 +26,7 @@ const int kColorDepths = 4; const int kSizes = 6; const int kFrameModes = 3; +const int kInfoPositions = 4; const char *ColorDepthItems[] = { "Greyscale (16)", @@ -49,6 +50,13 @@ const char *FrameModeItems[] = { "I-, P-, B-Frames" }; +const char *InfoPositionItems[] = { + "top left", + "top right", + "bottom left", + "bottom right" +}; + cOsdPipSetup OsdPipSetup; cOsdPipSetup::cOsdPipSetup(void) { @@ -63,20 +71,26 @@ cOsdPipSetup::cOsdPipSetup(void) { FrameMode = kFrameModeI; FrameDrop = 0; SwapFfmpeg = 1; + ShowInfo = 1; + InfoWidth = 400; + InfoPosition = kInfoBottomLeft; } bool cOsdPipSetup::SetupParse(const char *Name, const char *Value) { - if (strcmp(Name, "XPosition") == 0) XPosition = atoi(Value); - else if (strcmp(Name, "YPosition") == 0) YPosition = atoi(Value); - else if (strcmp(Name, "CropLeft") == 0) CropLeft = atoi(Value); - else if (strcmp(Name, "CropRight") == 0) CropRight = atoi(Value); - else if (strcmp(Name, "CropTop") == 0) CropTop = atoi(Value); - else if (strcmp(Name, "CropBottom") == 0) CropBottom = atoi(Value); - else if (strcmp(Name, "ColorDepth") == 0) ColorDepth = atoi(Value); - else if (strcmp(Name, "Size") == 0) Size = atoi(Value); - else if (strcmp(Name, "FrameMode") == 0) FrameMode = atoi(Value); - else if (strcmp(Name, "FrameDrop") == 0) FrameDrop = atoi(Value); - else if (strcmp(Name, "SwapFfmpeg") == 0) SwapFfmpeg = atoi(Value); + if (strcmp(Name, "XPosition") == 0) XPosition = atoi(Value); + else if (strcmp(Name, "YPosition") == 0) YPosition = atoi(Value); + else if (strcmp(Name, "CropLeft") == 0) CropLeft = atoi(Value); + else if (strcmp(Name, "CropRight") == 0) CropRight = atoi(Value); + else if (strcmp(Name, "CropTop") == 0) CropTop = atoi(Value); + else if (strcmp(Name, "CropBottom") == 0) CropBottom = atoi(Value); + else if (strcmp(Name, "ColorDepth") == 0) ColorDepth = atoi(Value); + else if (strcmp(Name, "Size") == 0) Size = atoi(Value); + else if (strcmp(Name, "FrameMode") == 0) FrameMode = atoi(Value); + else if (strcmp(Name, "FrameDrop") == 0) FrameDrop = atoi(Value); + else if (strcmp(Name, "SwapFfmpeg") == 0) SwapFfmpeg = atoi(Value); + else if (strcmp(Name, "ShowInfo") == 0) ShowInfo = atoi(Value); + else if (strcmp(Name, "InfoWidth") == 0) InfoWidth = atoi(Value); + else if (strcmp(Name, "InfoPosition") == 0) InfoPosition = atoi(Value); else return false; return true; } @@ -99,6 +113,10 @@ cOsdPipSetupPage::cOsdPipSetupPage(void) { &m_NewOsdPipSetup.FrameMode, kFrameModes, FrameModeItems)); Add(new cMenuEditIntItem(tr("Drop frames"), &m_NewOsdPipSetup.FrameDrop, 0, 2)); Add(new cMenuEditBoolItem(tr("Swap FFMPEG output"), &m_NewOsdPipSetup.SwapFfmpeg)); + Add(new cMenuEditBoolItem(tr("Show info window"), &m_NewOsdPipSetup.ShowInfo)); + Add(new cMenuEditIntItem(tr("Info window width"), &m_NewOsdPipSetup.InfoWidth, 200, 600)); + Add(new cMenuEditStraItem(tr("Info window position"), + &m_NewOsdPipSetup.InfoPosition, kInfoPositions, InfoPositionItems)); } cOsdPipSetupPage::~cOsdPipSetupPage() { @@ -107,15 +125,18 @@ cOsdPipSetupPage::~cOsdPipSetupPage() { void cOsdPipSetupPage::Store(void) { OsdPipSetup = m_NewOsdPipSetup; - SetupStore("XPosition", OsdPipSetup.XPosition); - SetupStore("YPosition", OsdPipSetup.YPosition); - SetupStore("CropLeft", OsdPipSetup.CropLeft); - SetupStore("CropRight", OsdPipSetup.CropRight); - SetupStore("CropTop", OsdPipSetup.CropTop); - SetupStore("CropBottom", OsdPipSetup.CropBottom); - SetupStore("ColorDepth", OsdPipSetup.ColorDepth); - SetupStore("Size", OsdPipSetup.Size); - SetupStore("FrameMode", OsdPipSetup.FrameMode); - SetupStore("FrameDrop", OsdPipSetup.FrameDrop); - SetupStore("SwapFfmpeg", OsdPipSetup.SwapFfmpeg); + SetupStore("XPosition", OsdPipSetup.XPosition); + SetupStore("YPosition", OsdPipSetup.YPosition); + SetupStore("CropLeft", OsdPipSetup.CropLeft); + SetupStore("CropRight", OsdPipSetup.CropRight); + SetupStore("CropTop", OsdPipSetup.CropTop); + SetupStore("CropBottom", OsdPipSetup.CropBottom); + SetupStore("ColorDepth", OsdPipSetup.ColorDepth); + SetupStore("Size", OsdPipSetup.Size); + SetupStore("FrameMode", OsdPipSetup.FrameMode); + SetupStore("FrameDrop", OsdPipSetup.FrameDrop); + SetupStore("SwapFfmpeg", OsdPipSetup.SwapFfmpeg); + SetupStore("ShowInfo", OsdPipSetup.ShowInfo); + SetupStore("InfoWidth", OsdPipSetup.InfoWidth); + SetupStore("InfoPosition", OsdPipSetup.InfoPosition); } @@ -18,22 +18,30 @@ const int kFrameModeI = 0; const int kFrameModeIP = 1; const int kFrameModeIPB = 2; +const int kInfoTopLeft = 0; +const int kInfoTopRight = 1; +const int kInfoBottomLeft = 2; +const int kInfoBottomRight = 3; + struct cOsdPipSetup { cOsdPipSetup(void); bool SetupParse(const char *Name, const char *Value); - int XPosition; - int YPosition; - int CropLeft; - int CropRight; - int CropTop; - int CropBottom; - int ColorDepth; - int Size; - int FrameMode; - int FrameDrop; - int SwapFfmpeg; + int XPosition; + int YPosition; + int CropLeft; + int CropRight; + int CropTop; + int CropBottom; + int ColorDepth; + int Size; + int FrameMode; + int FrameDrop; + int SwapFfmpeg; + int ShowInfo; + int InfoWidth; + int InfoPosition; }; extern cOsdPipSetup OsdPipSetup; @@ -22,10 +22,12 @@ cOsdPipObject::cOsdPipObject(cDevice *Device, const cChannel *Channel): m_Ready = false; m_Width = m_Height = -1; m_Bitmap = NULL; + m_ShowTime = 0; + m_ShowInfo = false; m_AlphaBase = 0xFF000000; memset(m_Palette, 0, 1024); - m_PaletteStart = 0; + m_PaletteStart = 1; Device->SwitchChannel(m_Channel, false); m_Receiver = new cOsdPipReceiver(m_Channel, m_ESBuffer); @@ -120,39 +122,80 @@ void cOsdPipObject::ProcessImage(unsigned char * data, int length) { if (!m_Ready) { switch (OsdPipSetup.Size) { - case 0: - m_Width = 120; - m_Height = 96; - break; - case 1: - m_Width = 160; - m_Height = 128; - break; - case 2: - m_Width = 200; - m_Height = 160; - break; - case 3: - m_Width = 240; - m_Height = 192; - break; - case 4: - m_Width = 280; - m_Height = 224; - break; - case 5: - m_Width = 320; - m_Height = 256; - break; + case 0: m_Width = 120; m_Height = 96; break; + case 1: m_Width = 160; m_Height = 128; break; + case 2: m_Width = 200; m_Height = 160; break; + case 3: m_Width = 240; m_Height = 192; break; + case 4: m_Width = 280; m_Height = 224; break; + case 5: m_Width = 320; m_Height = 256; break; + } + if (OsdPipSetup.ShowInfo) { + int x = 0; + int y = 0; + switch (OsdPipSetup.InfoPosition) { + case kInfoTopLeft: + x = (720 - (Setup.OSDwidth * cOsd::CellWidth())) / 2; + y = (576 - (Setup.OSDheight * cOsd::LineHeight())) / 2; + break; + case kInfoTopRight: + x = (720 + (Setup.OSDwidth * cOsd::CellWidth())) / 2 - OsdPipSetup.InfoWidth; + y = (576 - (Setup.OSDheight * cOsd::LineHeight())) / 2; + break; + case kInfoBottomLeft: + x = (720 - (Setup.OSDwidth * cOsd::CellWidth())) / 2; + y = (576 + (Setup.OSDheight * cOsd::LineHeight())) / 2 - 60; + break; + case kInfoBottomRight: + x = (720 + (Setup.OSDwidth * cOsd::CellWidth())) / 2 - OsdPipSetup.InfoWidth; + y = (576 + (Setup.OSDheight * cOsd::LineHeight())) / 2 - 60; + break; + } + m_WindowInfo = m_Osd->Create(x, y, OsdPipSetup.InfoWidth, 60, 1, false, false); + m_BitmapInfo = new cBitmap(OsdPipSetup.InfoWidth, 60, 1, false); +#ifdef VDR_OSDPIP_PATCHED + m_BitmapInfo->SetColor(0, (eDvbColor) 0xFF000000); + m_BitmapInfo->SetColor(1, (eDvbColor) 0xFFFFFFFF); +#endif + ShowChannelInfo(Channels.GetByNumber(cDevice::ActualDevice()->CurrentChannel())); } m_Window = m_Osd->Create(OsdPipSetup.XPosition, OsdPipSetup.YPosition, m_Width, m_Height, OsdPipSetup.ColorDepth == kDepthGrey16 ? 4 : 8, false); m_Bitmap = new cBitmap(m_Width, m_Height, OsdPipSetup.ColorDepth == kDepthGrey16 ? 4 : 8, false); - if (OsdPipSetup.ColorDepth == kDepthGrey128) - for (unsigned int i = 0; i < 256; i++) { - m_Palette[i] = m_AlphaBase | (i << 16) | (i << 8) | i; + if (OsdPipSetup.ColorDepth == kDepthGrey128 || + OsdPipSetup.ColorDepth == kDepthColor256fix) { +#ifdef VDR_OSDPIP_PATCHED + m_PaletteLookup[0] = 16; + m_PaletteLookup[255] = 17; + for (int i = 1; i < 17; i++) + m_PaletteLookup[i] = i - 1; + for (int i = 17; i < 255; i++) + m_PaletteLookup[i] = i + 1; +#else + for (int i = 0; i < 256; i++) + m_PaletteLookup[i] = i; +#endif + for (int i = 0; i < 256; i++) { + if (OsdPipSetup.ColorDepth == kDepthGrey128) + m_Palette[m_PaletteLookup[i]] = m_AlphaBase | (i << 16) | (i << 8) | i; + else + m_Palette[m_PaletteLookup[i]] = m_AlphaBase | quantizer->OutputPalette()[i]; } +#ifdef VDR_OSDPIP_PATCHED + for (int i = 0; i < 256; i++) + m_Bitmap->SetColor(i, (eDvbColor) m_Palette[i]); +#endif + } + if (OsdPipSetup.ColorDepth == kDepthColor128var) { + m_PaletteLookup[0] = 16; + m_PaletteLookup[255] = 17; + for (int i = 1; i < 17; i++) + m_PaletteLookup[i] = i - 1; + for (int i = 17; i < 255; i++) + m_PaletteLookup[i] = i + 1; + m_Palette[m_PaletteLookup[0]] = 0xFF000000; + m_Palette[m_PaletteLookup[255]] = 0xFFFFFFFF; + } m_Ready = true; } @@ -177,10 +220,10 @@ void cOsdPipObject::ProcessImage(unsigned char * data, int length) { } if (OsdPipSetup.ColorDepth == kDepthGrey128) { outputImage = m_PicResample->data[0]; - m_Bitmap->Clear(); +// m_Bitmap->Clear(); for (int y = 0; y < m_Height; y++) { for (int x = 0; x < m_Width; x++) { - m_Bitmap->SetPixel(x, y, (eDvbColor) m_Palette[outputImage[y * m_Width + x] & 0xFE]); + m_Bitmap->SetPixel(x, y, (eDvbColor) m_Palette[m_PaletteLookup[outputImage[y * m_Width + x] & 0xFE]]); } } } @@ -204,40 +247,37 @@ void cOsdPipObject::ProcessImage(unsigned char * data, int length) { } } - quantizer->Quantize(m_BufferConvert, size, 128); + quantizer->Quantize(m_BufferConvert, size, 127); outputPalette = quantizer->OutputPalette(); outputImage = quantizer->OutputImage(); if (OsdPipSetup.ColorDepth == kDepthColor256fix) { - for (int i = 0; i < 256; i++) - m_Palette[i] = m_AlphaBase | outputPalette[i]; - - m_Bitmap->Clear(); +// m_Bitmap->Clear(); for (int y = 0; y < m_Height; y++) { for (int x = 0; x < m_Width; x++) { - m_Bitmap->SetPixel(x, y, (eDvbColor) m_Palette[outputImage[y * m_Width + x]]); + m_Bitmap->SetPixel(x, y, (eDvbColor) m_Palette[m_PaletteLookup[outputImage[y * m_Width + x]]]); } } } else { - for (int i = 0; i < 128; i++) + for (int i = 0; i < 127; i++) { - m_Palette[m_PaletteStart + i] = outputPalette[i]; - m_Palette[m_PaletteStart + i] |= m_AlphaBase; + m_Palette[m_PaletteLookup[m_PaletteStart + i]] = outputPalette[i]; + m_Palette[m_PaletteLookup[m_PaletteStart + i]] |= m_AlphaBase; } - m_Bitmap->Clear(); +// m_Bitmap->Clear(); for (int i = 0; i < 256; i++) m_Bitmap->SetColor(i, (eDvbColor) m_Palette[i]); for (int y = 0; y < m_Height; y++) { for (int x = 0; x < m_Width; x++) { - m_Bitmap->SetIndex(x, y, m_PaletteStart + outputImage[y * m_Width + x]); + m_Bitmap->SetIndex(x, y, m_PaletteLookup[m_PaletteStart + outputImage[y * m_Width + x]]); } } - if (m_PaletteStart == 0) + if (m_PaletteStart == 1) m_PaletteStart = 128; else - m_PaletteStart = 0; + m_PaletteStart = 1; } } @@ -296,6 +336,21 @@ void cOsdPipObject::Action(void) { usleep(1); } } + if (m_ShowTime != 0) { + if (m_ShowInfo) { + m_Osd->Clear(m_WindowInfo); + m_Osd->SetBitmap(0, 0, *m_BitmapInfo, m_WindowInfo); + m_Osd->Show(m_WindowInfo); + m_Osd->Flush(); + m_ShowInfo = false; + } + time_t currentTime; + time(¤tTime); + if (currentTime - m_ShowTime > 2) { + m_Osd->Hide(m_WindowInfo); + m_ShowTime = 0; + } + } } if (OsdPipSetup.ColorDepth == kDepthColor128var || @@ -322,57 +377,132 @@ eOSState cOsdPipObject::ProcessKey(eKeys Key) { eOSState state = cOsdObject::ProcessKey(Key); if (state == osUnknown) { switch (Key & ~k_Repeat) { - case k0: Channels.SwitchTo(m_Channel->Number()); - case kBack: return osEnd; - - case k1...k9: - switch (Key & ~k_Repeat) { - case k1: - if (OsdPipSetup.XPosition > 9) OsdPipSetup.XPosition -= 10; - if (OsdPipSetup.YPosition > 9) OsdPipSetup.YPosition -= 10; - break; - case k2: - if (OsdPipSetup.YPosition > 9) OsdPipSetup.YPosition -= 10; - break; - case k3: - if (OsdPipSetup.XPosition < Setup.OSDwidth * cOsd::CellWidth()) - OsdPipSetup.XPosition += 10; - if (OsdPipSetup.YPosition > 9) OsdPipSetup.YPosition -= 10; - break; - case k4: - if (OsdPipSetup.XPosition > 9) OsdPipSetup.XPosition -= 10; - break; - case k6: - if (OsdPipSetup.XPosition < Setup.OSDwidth * cOsd::CellWidth()) - OsdPipSetup.XPosition += 10; - break; - case k7: - if (OsdPipSetup.XPosition > 9) OsdPipSetup.XPosition -= 10; - if (OsdPipSetup.YPosition < Setup.OSDheight * cOsd::LineHeight()) - OsdPipSetup.YPosition += 10; - break; - case k8: - if (OsdPipSetup.YPosition < Setup.OSDheight * cOsd::LineHeight()) - OsdPipSetup.YPosition += 10; - break; - case k9: - if (OsdPipSetup.XPosition < Setup.OSDwidth * cOsd::CellWidth()) - OsdPipSetup.XPosition += 10; - if (OsdPipSetup.YPosition < Setup.OSDheight * cOsd::LineHeight()) - OsdPipSetup.YPosition += 10; + case k0: Channels.SwitchTo(m_Channel->Number()); + case kBack: return osEnd; + + case k1...k9: + switch (Key & ~k_Repeat) { + case k1: + if (OsdPipSetup.XPosition > 9) OsdPipSetup.XPosition -= 10; + if (OsdPipSetup.YPosition > 9) OsdPipSetup.YPosition -= 10; + break; + case k2: + if (OsdPipSetup.YPosition > 9) OsdPipSetup.YPosition -= 10; + break; + case k3: + if (OsdPipSetup.XPosition < Setup.OSDwidth * cOsd::CellWidth()) + OsdPipSetup.XPosition += 10; + if (OsdPipSetup.YPosition > 9) OsdPipSetup.YPosition -= 10; + break; + case k4: + if (OsdPipSetup.XPosition > 9) OsdPipSetup.XPosition -= 10; + break; + case k6: + if (OsdPipSetup.XPosition < Setup.OSDwidth * cOsd::CellWidth()) + OsdPipSetup.XPosition += 10; + break; + case k7: + if (OsdPipSetup.XPosition > 9) OsdPipSetup.XPosition -= 10; + if (OsdPipSetup.YPosition < Setup.OSDheight * cOsd::LineHeight()) + OsdPipSetup.YPosition += 10; + break; + case k8: + if (OsdPipSetup.YPosition < Setup.OSDheight * cOsd::LineHeight()) + OsdPipSetup.YPosition += 10; + break; + case k9: + if (OsdPipSetup.XPosition < Setup.OSDwidth * cOsd::CellWidth()) + OsdPipSetup.XPosition += 10; + if (OsdPipSetup.YPosition < Setup.OSDheight * cOsd::LineHeight()) + OsdPipSetup.YPosition += 10; + break; + } + m_Osd->Relocate(m_Window, OsdPipSetup.XPosition, OsdPipSetup.YPosition); break; - } - m_Osd->Relocate(m_Window, OsdPipSetup.XPosition, OsdPipSetup.YPosition); - break; - case kUp: - case kDown: cDevice::SwitchChannel(NORMALKEY(Key) == kUp ? 1 : -1); - break; + case kUp: + case kDown: + cDevice::SwitchChannel(NORMALKEY(Key) == kUp ? 1 : -1); + break; - default: return state; + case kOk: + if (OsdPipSetup.ShowInfo) { + if (m_ShowTime != 0) { + m_ShowTime -= 2; + } else { + ShowChannelInfo(Channels.GetByNumber(cDevice::ActualDevice()->CurrentChannel())); + } + } + break; + default: + return state; } state = osContinue; } return state; } +void cOsdPipObject::ChannelSwitch(const cDevice * device, int channelNumber) { + if (device != cDevice::ActualDevice()) + return; + if (channelNumber == 0) + return; + if (!m_Ready) + return; + if (OsdPipSetup.ShowInfo) + ShowChannelInfo(Channels.GetByNumber(device->CurrentChannel())); +} + +void cOsdPipObject::ShowChannelInfo(const cChannel * channel) { + char line1[100] = ""; + char line2[100] = ""; + + sprintf(line1, "%d %s", channel->Number(), channel->Name()); + +#if VDRVERSNUM >= 10300 + const cEvent * present = NULL; + cSchedulesLock schedulesLock; + const cSchedules * schedules = cSchedules::Schedules(schedulesLock); + if (schedules) { + const cSchedule * schedule = schedules->GetSchedule(channel->GetChannelID()); + if (schedule) { + const char * presentTitle = NULL; + if ((present = schedule->GetPresentEvent()) != NULL) { + presentTitle = present->Title(); + if (!isempty(presentTitle)) { + sprintf(line2, "%s %s", present->GetTimeString(), presentTitle); + while (m_Osd->Width(line2) > OsdPipSetup.InfoWidth - 10) { + line2[strlen(line2) - 1] = 0; + } + } + } + } + } +#else + const cEventInfo * present = NULL; + cMutexLock mutexLock; + const cSchedules * schedules = cSIProcessor::Schedules(mutexLock); + if (schedules) { + const cSchedule * schedule = schedules->GetSchedule(channel->GetChannelID()); + if (schedule) { + const char * presentTitle = NULL; + if ((present = schedule->GetPresentEvent()) != NULL) { + presentTitle = present->GetTitle(); + if (!isempty(presentTitle)) { + sprintf(line2, "%s %s", present->GetTimeString(), presentTitle); + while (m_Osd->Width(line2) > OsdPipSetup.InfoWidth - 10) { + line2[strlen(line2) - 1] = 0; + } + } + } + } + } +#endif + m_BitmapInfo->Clear(); + m_BitmapInfo->Fill(0, 0, OsdPipSetup.InfoWidth, 60, (eDvbColor) 0xFF000000); + m_BitmapInfo->Text(0, 0, line1, (eDvbColor) 0xFFFFFFFF, (eDvbColor) 0xFF000000); + m_BitmapInfo->Text(0, 30, line2, (eDvbColor) 0xFFFFFFFF, (eDvbColor) 0xFF000000); + time(&m_ShowTime); + m_ShowInfo = true; +} + @@ -16,6 +16,8 @@ extern "C" #endif } +#include <sys/time.h> + #include <vdr/osd.h> #include <vdr/thread.h> #include <vdr/status.h> @@ -25,14 +27,19 @@ class cRingBufferFrame; class cOsdPipReceiver; class cQuantize; -class cOsdPipObject: public cOsdObject, public cThread { +class cOsdPipObject: public cOsdObject, public cThread, public cStatus { private: cOsdBase *m_Osd; cRingBufferFrame *m_ESBuffer; cOsdPipReceiver *m_Receiver; const cChannel *m_Channel; tWindowHandle m_Window; - cBitmap *m_Bitmap; + cBitmap * m_Bitmap; + tWindowHandle m_WindowInfo; + cBitmap * m_BitmapInfo; + + time_t m_ShowTime; + bool m_ShowInfo; bool m_Active; bool m_Ready; @@ -50,6 +57,7 @@ private: unsigned int m_AlphaBase; unsigned int m_Palette[256]; int m_PaletteStart; + unsigned char m_PaletteLookup[256]; cQuantize * quantizer; @@ -57,8 +65,11 @@ private: int Resample(); int ConvertToRGB(); void ProcessImage(unsigned char * data, int length); + + void ShowChannelInfo(const cChannel * channel); protected: virtual void Action(void); + virtual void ChannelSwitch(const cDevice * device, int channelNumber); public: cOsdPipObject(cDevice *Device, const cChannel *Channel); @@ -19,7 +19,7 @@ extern "C" #include <vdr/plugin.h> -static const char *VERSION = "0.0.3"; +static const char *VERSION = "0.0.4"; static const char *DESCRIPTION = "OSD Picture-in-Picture"; static const char *MAINMENUENTRY = "Picture-in-Picture"; |