- Main Page
- Namespaces
- Classes
- Files
- Directories

- File List
- File Members

# VTSReader.h

    00001 /*
    00002  *      Copyright (C) 2003-2005 Gabest
    00003  *      http://www.gabest.org
    00004  *
    00005  *  This Program is free software; you can redistribute it and/or modify
    00006  *  it under the terms of the GNU General Public License as published by
    00007  *  the Free Software Foundation; either version 2, or (at your option)
    00008  *  any later version.
    00009  *
    00010  *  This Program is distributed in the hope that it will be useful,
    00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    00013  *  GNU General Public License for more details.
    00014  *
    00015  *  You should have received a copy of the GNU General Public License
    00016  *  along with GNU Make; see the file COPYING.  If not, write to
    00017  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
    00018  *  http://www.gnu.org/copyleft/gpl.html
    00019  *
    00020  */
    00021
    00022 #pragma once
    00023
    00024 #include <atlbase.h>
    00025 #include "..\asyncreader\asyncio.h"
    00026 #include "..\asyncreader\asyncrdr.h"
    00027
    00028 class CVobFile;
    00029
    00030 class CVTSStream : public CAsyncStream
    00031 {
    00032 private:
    00033     CCritSec m_csLock;
    00034
    00035         CAutoPtr<CVobFile> m_vob;
    00036         int m_off;
    00037
    00038 public:
    00039         CVTSStream();
    00040         virtual ~CVTSStream();
    00041
    00042         bool Load(const WCHAR* fnw);
    00043
    00044     HRESULT SetPointer(LONGLONG llPos);
    00045     HRESULT Read(PBYTE pbBuffer, DWORD dwBytesToRead, BOOL bAlign, LPDWORD pdwBytesRead);
    00046     LONGLONG Size(LONGLONG* pSizeAvailable);
    00047     DWORD Alignment();
    00048     void Lock();
    00049         void Unlock();
    00050 };
    00051
    00052 [uuid("773EAEDE-D5EE-4fce-9C8F-C4F53D0A2F73")]
    00053 class CVTSReader
    00054         : public CAsyncReader
    00055         , public IFileSourceFilter
    00056 {
    00057         CVTSStream m_stream;
    00058         CStringW m_fn;
    00059
    00060 public:
    00061     CVTSReader(IUnknown* pUnk, HRESULT* phr);
    00062         ~CVTSReader();
    00063
    00064     DECLARE_IUNKNOWN
    00065     STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void** ppv);
    00066
    00067         // IFileSourceFilter
    00068         STDMETHODIMP Load(LPCOLESTR pszFileName, const AM_MEDIA_TYPE* pmt);
    00069         STDMETHODIMP GetCurFile(LPOLESTR* ppszFileName, AM_MEDIA_TYPE* pmt);
    00070 };