Jump to content

Wak

Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral
  1. Gabriel Corneanu wrote a DirectShow filter for this purpose: https://cc.embarcadero.com/Item/21110 Back in the day, I modified it and successfully got it running with DirectShow9 and Delphi 2009. I used it to play encrypted videos, decrypting them on-the-fly. With the codecs installed, it plays avi, mpeg, mkv, ogg, rmvb, mp4... Playing wmv videos requires some tricks. The catch: DirectShow9 seems to briefly load the whole video into memory, so it cannot play large videos (like 1GB).
  2. Wak

    Styles bloating final packages

    I used TStyleManager for style control and added the .styles files to the resource. However, this increased the size too much and I want to include multiple styles. So I embedded compressed zip files instead. Each style became ~15% of its original size. It is also not difficult to handle: // modified from my code, not tested but should work function LoadZippedStyleFromResource(const ResName, Filename: string): TFmxObject; var rs, ms: TStream; ZipFile: TZipFile; ZipHeader: TZipHeader; begin try rs := TResourceStream.Create(HInstance, ResName, RT_RCDATA); ZipFile := TZipFile.Create; try ZipFile.Open(rs, zmRead); ZipFile.Read(Filename, ms, ZipHeader); try ms.Position := 0; Result := TStyleStreaming.LoadFromStream(ms); finally ms.Free; end; finally ZipFile.Free; FreeAndNil(rs); end except FreeAndNil(rs); Exit(nil); end; end; // used like this Style := LoadZippedStyleFromResource('Polar', 'PolarDark.style'); if Assigned(Style) then TStyleManager.SetStyle(Style);
  3. The helper is not in the scope because Unit1 is not in the Uses list.
×