obs/Source/NullOutput.cpp
2012-09-01 17:03:49 -07:00

52 lines
2.0 KiB
C++

/********************************************************************************
Copyright (C) 2012 Hugh Bailey <obs.jim@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
********************************************************************************/
#include "Main.h"
class NullVideoEncoder : public VideoEncoder
{
public:
virtual bool Encode(LPVOID picIn, List<DataPacket> &packets, DWORD &outputTimestamp) {return true;}
virtual void GetHeaders(DataPacket &packet) {}
virtual int GetBitRate() const {return 0;}
virtual String GetInfoString() const {return String();}
};
class NullAudioEncoder : public AudioEncoder
{
public:
virtual bool Encode(float *input, UINT numInputFrames, DataPacket &packet) {return true;}
virtual void GetHeaders(DataPacket &packet) {}
virtual UINT GetFrameSize() const {return 0;}
virtual int GetBitRate() const {return 0;}
virtual CTSTR GetCodec() const {return NULL;}
virtual String GetInfoString() const {return String();}
};
class NullNetwork : public NetworkStream
{
virtual void SendPacket(BYTE *data, UINT size, DWORD timestamp, bool bAudio) {}
};
VideoEncoder* CreateNullVideoEncoder() {return new NullVideoEncoder;}
AudioEncoder* CreateNullAudioEncoder() {return new NullAudioEncoder;}
NetworkStream* CreateNullNetwork() {return new NullNetwork;}