- Main Page
- Namespaces
- Classes
- Files
- Directories

- File List
- File Members

# D2VSource.h

    00001 /*
    00002  *      Copyright (C) 2003-2005 Gabest
    00003  *
    00004  *  This Program is free software; you can redistribute it and/or modify
    00005  *  it under the terms of the GNU General Public License as published by
    00006  *  the Free Software Foundation; either version 2, or (at your option)
    00007  *  any later version.
    00008  *
    00009  *  This Program is distributed in the hope that it will be useful,
    00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
    00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    00012  *  GNU General Public License for more details.
    00013  *
    00014  *  You should have received a copy of the GNU General Public License
    00015  *  along with GNU Make; see the file COPYING.  If not, write to
    00016  *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
    00017  *
    00018  */
    00019
    00020 #pragma once
    00021 #include <atlbase.h>
    00022 #include "..\BaseSource\BaseSource.h"
    00023
    00024 class CD2VStream;
    00025
    00026 [uuid("47CE0591-C4D5-4b41-BED7-28F59AD76228")]
    00027 class CD2VSource : public CBaseSource<CD2VStream>
    00028 {
    00029 public:
    00030         CD2VSource(LPUNKNOWN lpunk, HRESULT* phr);
    00031         virtual ~CD2VSource();
    00032 };
    00033
    00034 class CMPEG2Dec;
    00035
    00036 class CD2VStream : public CBaseStream
    00037 {
    00038 private:
    00039         CAutoPtr<CMPEG2Dec> m_pDecoder;
    00040         CAutoVectorPtr<BYTE> m_pFrameBuffer;
    00041
    00042         bool GetDim(int& w, int& h, int& bpp);
    00043
    00044 public:
    00045     CD2VStream(const WCHAR* fn, CSource* pParent, HRESULT* phr);
    00046         virtual ~CD2VStream();
    00047
    00048     HRESULT FillBuffer(IMediaSample* pSample, int nFrame, BYTE* pOut, long& len /*in+out*/);
    00049
    00050     HRESULT DecideBufferSize(IMemAllocator* pIMemAlloc, ALLOCATOR_PROPERTIES* pProperties);
    00051     HRESULT CheckMediaType(const CMediaType* pMediaType);
    00052     HRESULT GetMediaType(int iPosition, CMediaType* pmt);
    00053     HRESULT SetMediaType(const CMediaType* pmt);
    00054
    00055         STDMETHODIMP Notify(IBaseFilter* pSender, Quality q);
    00056 };