Exemple #1
0
        public OgvDecoder(Stream stream)
        {
            this.stream = stream;
            fileSystem  = new Lemon.Api.FileSystem {
                ReadFunc = OgvRead, CloseFunc = OgvClose,
                SeekFunc = OgvSeek, TellFunc = OgvTell
            };
            streamHandle = streamMap.Allocate(stream);

            ogvHandle = Lemon.Api.OgvCreate(streamHandle, fileSystem);
            if (ogvHandle.ToInt32() == 0)
            {
                throw new Lime.Exception("Failed to open Ogv/Theora file");
            }
            FrameSize = new Size(Lemon.Api.OgvGetVideoWidth(ogvHandle),
                                 Lemon.Api.OgvGetVideoHeight(ogvHandle));
        }
Exemple #2
0
 public OggDecoder(Stream stream)
 {
     this.stream = stream;
     fileSystem  = new Lemon.Api.FileSystem {
         ReadFunc = OggRead, CloseFunc = OggClose,
         SeekFunc = OggSeek, TellFunc = OggTell
     };
     handle  = streamMap.Allocate(stream);
     oggFile = Lemon.Api.OggCreate();
     if (Lemon.Api.OggOpen(handle, oggFile, fileSystem) < 0)
     {
         throw new Lime.Exception("Failed to open OGG/Vorbis file");
     }
     if (Lemon.Api.OggGetChannels(oggFile) > 2)
     {
         throw new Lime.Exception("Channel count must be either 1 or 2");
     }
 }