NullRenderers.cpp

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 #include "StdAfx.h"
00023 #include "NullRenderers.h"
00024 #include "..\..\include\moreuuids.h"
00025 #include "..\..\include\matroska\matroska.h"
00026 
00027 //
00028 // CNullVideoRenderer
00029 //
00030 
00031 HRESULT CNullVideoRenderer::CheckMediaType(const CMediaType* pmt)
00032 {
00033         return pmt->majortype == MEDIATYPE_Video
00034                 || pmt->subtype == MEDIASUBTYPE_MPEG2_VIDEO
00035                 ? S_OK
00036                 : E_FAIL;
00037 }
00038 
00039 //
00040 // CNullUVideoRenderer
00041 //
00042 
00043 HRESULT CNullUVideoRenderer::CheckMediaType(const CMediaType* pmt)
00044 {
00045         return pmt->majortype == MEDIATYPE_Video
00046                 && (pmt->subtype == MEDIASUBTYPE_YV12
00047                 || pmt->subtype == MEDIASUBTYPE_I420
00048                 || pmt->subtype == MEDIASUBTYPE_YUYV
00049                 || pmt->subtype == MEDIASUBTYPE_IYUV
00050                 || pmt->subtype == MEDIASUBTYPE_YVU9
00051                 || pmt->subtype == MEDIASUBTYPE_Y411
00052                 || pmt->subtype == MEDIASUBTYPE_Y41P
00053                 || pmt->subtype == MEDIASUBTYPE_YUY2
00054                 || pmt->subtype == MEDIASUBTYPE_YVYU
00055                 || pmt->subtype == MEDIASUBTYPE_UYVY
00056                 || pmt->subtype == MEDIASUBTYPE_Y211
00057                 || pmt->subtype == MEDIASUBTYPE_RGB1
00058                 || pmt->subtype == MEDIASUBTYPE_RGB4
00059                 || pmt->subtype == MEDIASUBTYPE_RGB8
00060                 || pmt->subtype == MEDIASUBTYPE_RGB565
00061                 || pmt->subtype == MEDIASUBTYPE_RGB555
00062                 || pmt->subtype == MEDIASUBTYPE_RGB24
00063                 || pmt->subtype == MEDIASUBTYPE_RGB32
00064                 || pmt->subtype == MEDIASUBTYPE_ARGB1555
00065                 || pmt->subtype == MEDIASUBTYPE_ARGB4444
00066                 || pmt->subtype == MEDIASUBTYPE_ARGB32
00067                 || pmt->subtype == MEDIASUBTYPE_A2R10G10B10
00068                 || pmt->subtype == MEDIASUBTYPE_A2B10G10R10)
00069                 ? S_OK
00070                 : E_FAIL;
00071 }
00072 
00073 //
00074 // CNullAudioRenderer
00075 //
00076 
00077 HRESULT CNullAudioRenderer::CheckMediaType(const CMediaType* pmt)
00078 {
00079         return pmt->majortype == MEDIATYPE_Audio
00080                 || pmt->majortype == MEDIATYPE_Midi
00081                 || pmt->subtype == MEDIASUBTYPE_MPEG2_AUDIO
00082                 || pmt->subtype == MEDIASUBTYPE_DOLBY_AC3
00083                 || pmt->subtype == MEDIASUBTYPE_DVD_LPCM_AUDIO
00084                 || pmt->subtype == MEDIASUBTYPE_DTS
00085                 || pmt->subtype == MEDIASUBTYPE_SDDS
00086                 || pmt->subtype == MEDIASUBTYPE_MPEG1AudioPayload
00087                 || pmt->subtype == MEDIASUBTYPE_MPEG1Audio
00088                 || pmt->subtype == MEDIASUBTYPE_MPEG1Audio
00089                 ? S_OK
00090                 : E_FAIL;
00091 }
00092 
00093 //
00094 // CNullUAudioRenderer
00095 //
00096 
00097 HRESULT CNullUAudioRenderer::CheckMediaType(const CMediaType* pmt)
00098 {
00099         return pmt->majortype == MEDIATYPE_Audio
00100                 && (pmt->subtype == MEDIASUBTYPE_PCM
00101                 || pmt->subtype == MEDIASUBTYPE_IEEE_FLOAT
00102                 || pmt->subtype == MEDIASUBTYPE_DRM_Audio
00103                 || pmt->subtype == MEDIASUBTYPE_DOLBY_AC3_SPDIF
00104                 || pmt->subtype == MEDIASUBTYPE_RAW_SPORT
00105                 || pmt->subtype == MEDIASUBTYPE_SPDIF_TAG_241h)
00106                 ? S_OK
00107                 : E_FAIL;
00108 }
00109 
00110 //
00111 // CNullTextRenderer
00112 //
00113 
00114 HRESULT CNullTextRenderer::CTextInputPin::CheckMediaType(const CMediaType* pmt)
00115 {
00116         return pmt->majortype == MEDIATYPE_Text
00117                 || pmt->majortype == MEDIATYPE_ScriptCommand
00118                 || pmt->majortype == MEDIATYPE_Subtitle 
00119                 || pmt->subtype == MEDIASUBTYPE_DVD_SUBPICTURE 
00120                 || pmt->subtype == MEDIASUBTYPE_CVD_SUBPICTURE 
00121                 || pmt->subtype == MEDIASUBTYPE_SVCD_SUBPICTURE 
00122                 ? S_OK 
00123                 : E_FAIL;
00124 }
00125 
00126 CNullTextRenderer::CNullTextRenderer(LPUNKNOWN pUnk, HRESULT* phr)
00127         : CBaseFilter(NAME("CNullTextRenderer"), pUnk, this, __uuidof(this), phr) 
00128 {
00129         m_pInput.Attach(new CTextInputPin(this, this, phr));
00130 }

Generated on Tue Dec 13 14:47:07 2005 for guliverkli by  doxygen 1.4.5