[xiph-commits] r8447 - in trunk/oggdsf/src:
lib/codecs/cmml/dsfCMMLRawSource lib/codecs/cmml/libCMMLTags
lib/codecs/cmml/libCMMLTagsDotNET lib/codecs/cmml/libWinCMMLParse
lib/codecs/dirac/filters/dsfDiracDecodeSource
lib/codecs/dirac/filters/dsfDiracEncodeFilter
lib/codecs/flac/filters/dsfFLACDecoder
lib/codecs/flac/filters/dsfFLACEncoder
lib/codecs/flac/filters/dsfNativeFLACSource
lib/codecs/flac/libs/libFLACHelper
lib/codecs/flac/libs/libflac/include/FLAC
lib/codecs/flac/libs/libflac/include/FLAC++
lib/codecs/flac/libs/libflac/include/OggFLAC
lib/codecs/flac/libs/libflac/include/OggFLAC++
lib/codecs/flac/libs/libflac/include/share
lib/codecs/flac/libs/libflac/include/share/grabbag
lib/codecs/flac/libs/libflac/src/flac
lib/codecs/flac/libs/libflac/src/libFLAC/ia32
lib/codecs/flac/libs/libflac/src/libFLAC/include/private
lib/codecs/flac/libs/libflac/src/libFLAC/include/protected
lib/codecs/flac/libs/libflac/src/libFLAC++
lib/codecs/flac/libs/libflac/src/libOggFLAC/include/private
lib/codecs/flac/libs/libflac/src/libOggFLAC/include/protected
lib/codecs/flac/libs/libflac/src/libOggFLAC++
lib/codecs/flac/libs/libflac/src/metaflac
lib/codecs/flac/libs/libflac/src/plugin_common
lib/codecs/flac/libs/libflac/src/plugin_common/include/private
lib/codecs/flac/libs/libflac/src/plugin_winamp2
lib/codecs/flac/libs/libflac/src/plugin_winamp2/include/winamp2
lib/codecs/flac/libs/libflac/src/plugin_winamp3
lib/codecs/flac/libs/libflac/src/plugin_xmms
lib/codecs/flac/libs/libflac/src/share/replaygain_synthesis/include/private
lib/codecs/flac/libs/libflac/src/share/utf8
lib/codecs/flac/libs/libflac/src/test_libFLAC
lib/codecs/flac/libs/libflac/src/test_libFLAC++
lib/codecs/flac/libs/libflac/src/test_libOggFLAC
lib/codecs/flac/libs/libflac/src/test_libOggFLAC++
lib/codecs/helper/libfishsound/include/fishsound
lib/codecs/helper/libfishsound/src/libfishsound
lib/codecs/helper/libfishsound/src/tests
lib/codecs/helper/libfishsound/win32
lib/codecs/helper/libfishsound/win32/encdec-audio
lib/codecs/helper/libfishsound/win32/encdec-comments
lib/codecs/speex/filters/dsfSpeexDecoder
lib/codecs/speex/filters/dsfSpeexEncoder
lib/codecs/speex/libs/libspeex/include
lib/codecs/speex/libs/libspeex/include/speex
lib/codecs/speex/libs/libspeex/libspeex
lib/codecs/speex/libs/libspeex/src
lib/codecs/theora/filters/dsfTheoraDecoder
lib/codecs/theora/filters/dsfTheoraEncoder
lib/codecs/theora/libs/libOOTheora
lib/codecs/theora/libs/libtheora/examples
lib/codecs/theora/libs/libtheora/include/theora
lib/codecs/theora/libs/libtheora/lib
lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include
lib/codecs/theora/libs/libtheora/win32/experimental/splayer/portaudio/pa_common
lib/codecs/theora/libs/libtheora/win32/experimental/splayer/portaudio/pablio
lib/codecs/theora/libs/libtheora/win32/experimental/transcoder/avi2vp3
lib/codecs/theora/libs/libtheora/win32/experimental/wincompat
lib/codecs/theora/libs/libtheora/win32/libtheora
lib/codecs/vorbis/filters/dsfVorbisDecoder
lib/codecs/vorbis/filters/dsfVorbisEncoder
lib/codecs/vorbis/libs/libvorbis/include/vorbis
lib/codecs/vorbis/libs/libvorbis/lib
lib/codecs/vorbis/libs/libvorbis/lib/books/coupled
lib/codecs/vorbis/libs/libvorbis/lib/books/floor
lib/codecs/vorbis/libs/libvorbis/lib/books/uncoupled
lib/codecs/vorbis/libs/libvorbis/lib/modes
lib/codecs/vorbis/libs/libvorbis/macos/compat/sys
lib/codecs/vorbis/libs/libvorbis/vq
lib/core/annodex/libOOAnnodex lib/core/annodex/libannodex
lib/core/annodex/libannodex/doc
lib/core/annodex/libannodex/include/annodex
lib/core/annodex/libannodex/libltdl
lib/core/annodex/libannodex/src/libannodex
lib/core/annodex/libannodex/src/tests
lib/core/annodex/libannodex/src/tools
lib/core/annodex/libannodex/win32
lib/core/directshow/dsfAbstractAudioDecoder
lib/core/directshow/dsfAbstractAudioEncoder
lib/core/directshow/dsfAbstractVideoDecoder
lib/core/directshow/dsfAbstractVideoEncoder
lib/core/directshow/dsfAnxDemux lib/core/directshow/dsfAnxMux
lib/core/directshow/dsfOggDemux lib/core/directshow/dsfOggMux
lib/core/directshow/dsfSeeking lib/core/directshow/dsfSubtitleVMR9
lib/core/directshow/libDirectshowAbstracts
lib/core/ogg/libOOOgg lib/core/ogg/libOOOggSeek
lib/core/ogg/libVorbisComment lib/core/ogg/libVorbisCommentDotNET
lib/core/ogg/libogg/include/ogg lib/core/ogg/libogg/macos/compat/sys
lib/core/ogg/liboggz/include/oggz lib/core/ogg/liboggz/src/liboggz
lib/core/ogg/liboggz/src/tests lib/core/ogg/liboggz/win32
lib/helper/iDSHelper lib/helper/libCDROM
lib/helper/libiWrapper lib/helper/libilliCore
lib/player/libDSPlayDotNET lib/plugin/axAnxOggPlayer
tests/testCDROM tests/testCMMLParser tests/testCircleBuffer
tests/testLibOOOgg tests/testMuxDemux tests/testOOOggMux
tests/testlibOOOggSpeed1 tests/testliboggSpeed1
tests/testliboggzSpeed1 tools/AnxCutter tools/CLOgg
tools/OOOggCommentDump tools/OOOggDump tools/OOOggPacketise
tools/OOOggSeekFileMaker tools/OOOggSeekFileReader
tools/OOOggStat tools/OOOggValidate tools/iTranscode
tools/oggChainSplitter
illiminable at motherfish-iii.xiph.org
illiminable at motherfish-iii.xiph.org
Thu Dec 16 06:15:55 PST 2004
Author: illiminable
Date: 2004-12-16 06:15:51 -0800 (Thu, 16 Dec 2004)
New Revision: 8447
Modified:
trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourceFilter.cpp
trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourceFilter.h
trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourcePin.cpp
trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourcePin.h
trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/cmmlrawsourcedllstuff.cpp
trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/cmmlrawsourcedllstuff.h
trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/dsfCMMLRawSource.cpp
trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/dsfCMMLRawSource.h
trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/stdafx.cpp
trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/stdafx.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_AnchorTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_AnchorTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_BaseTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_BaseTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLDoc.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLDoc.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLError.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLError.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLPreamble.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLPreamble.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLRootTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLRootTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTime.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTime.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_DescTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_DescTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HeadTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HeadTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HumReadCMMLTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HumReadCMMLTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImageTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImageTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_Import.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTagList.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTagList.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_Int64.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_Int64.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTagList.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTagList.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTagList.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTagList.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTagList.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTagList.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_StreamTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_StreamTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TagList.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TagList.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TextFieldTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TextFieldTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TitleTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TitleTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/config.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/cpp_lib_cmml.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/cpp_lib_cmml.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/libCMMLTags.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/libCMMLTags.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/stdafx.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/stdafx.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/AnchorTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/AnchorTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/AssemblyInfo.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/BaseTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/BaseTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLDoc.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLDoc.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLPreamble.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLPreamble.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLRootTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLRootTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTagList.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTagList.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/DescTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/DescTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HeadTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HeadTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HumReadCMMLTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HumReadCMMLTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImageTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImageTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImportTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImportTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImportTagList.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImportTagList.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MMLRootTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MMLRootTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTagList.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTagList.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTagList.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTagList.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ParamTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ParamTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ParamTagList.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ParamTagList.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/Stdafx.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/Stdafx.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/StreamTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/StreamTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TagList.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TagList.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TextFieldTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TextFieldTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TitleTag.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TitleTag.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/libCMMLTagsDotNET.cpp
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/libCMMLTagsDotNET.h
trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/resource.h
trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/CMMLParser.cpp
trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/CMMLParser.h
trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/libWinCMMLParse.cpp
trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/libWinCMMLParse.h
trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/stdafx.cpp
trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/stdafx.h
trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/DiracDecodeSourceFilter.cpp
trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/DiracDecodeSourceFilter.h
trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/DiracDecodeSourcePin.cpp
trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/DiracDecodeSourcePin.h
trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/dsfDiracDecodeSource.cpp
trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/dsfDiracDecodeSource.h
trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/stdafx.cpp
trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/stdafx.h
trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeFilter.cpp
trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeFilter.h
trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeInputPin.cpp
trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeInputPin.h
trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeOutputPin.cpp
trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeOutputPin.h
trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/dsfDiracEncodeFilter.cpp
trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/dsfDiracEncodeFilter.h
trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/stdafx.cpp
trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/stdafx.h
trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeFilter.cpp
trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeFilter.h
trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeInputPin.cpp
trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeInputPin.h
trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeOutputPin.cpp
trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeOutputPin.h
trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACdecoderdllstuff.cpp
trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACdecoderdllstuff.h
trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/dsfFLACDecoder.cpp
trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/stdafx.cpp
trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/stdafx.h
trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeFilter.cpp
trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeFilter.h
trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeInputPin.cpp
trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeInputPin.h
trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeOutputPin.cpp
trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeOutputPin.h
trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/dsfFLACEncoder.cpp
trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/flacencoderdllstuff.cpp
trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/flacencoderdllstuff.h
trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/stdafx.cpp
trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/stdafx.h
trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.cpp
trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.h
trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourcePin.cpp
trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourcePin.h
trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/dsfNativeFLACSource.cpp
trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/dsfNativeFLACSource.h
trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/stdafx.cpp
trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/stdafx.h
trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACHeaderTweaker.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACHeaderTweaker.h
trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACMetadataSplitter.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACMetadataSplitter.h
trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACPushDecoder.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACPushDecoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/stdafx.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/stdafx.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC++/all.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC++/decoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC++/encoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC++/export.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC++/metadata.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/all.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/assert.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/callback.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/export.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/file_decoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/file_encoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/format.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/metadata.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/ordinals.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/seekable_stream_decoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/seekable_stream_encoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/stream_decoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/stream_encoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/OggFLAC++/all.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/OggFLAC++/decoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/OggFLAC++/encoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/OggFLAC++/export.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/OggFLAC/all.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/OggFLAC/export.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/OggFLAC/file_decoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/OggFLAC/file_encoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/OggFLAC/seekable_stream_decoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/OggFLAC/seekable_stream_encoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/OggFLAC/stream_decoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/OggFLAC/stream_encoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/gain_analysis.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/getopt.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/grabbag.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/grabbag/cuesheet.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/grabbag/file.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/grabbag/replaygain.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/grabbag/seektable.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/replaygain_analysis.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/replaygain_synthesis.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/utf8.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/flac/analyze.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/flac/decode.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/flac/encode.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/flac/local_string_utils.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/flac/utils.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/flac/vorbiscomment.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC++/file_decoder.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC++/file_encoder.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC++/metadata.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC++/seekable_stream_decoder.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC++/seekable_stream_encoder.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC++/stream_decoder.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC++/stream_encoder.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/ia32/nasm.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/private/all.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/private/bitbuffer.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/private/bitmath.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/private/cpu.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/private/crc.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/private/fixed.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/private/format.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/private/lpc.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/private/md5.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/private/memory.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/private/metadata.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/private/stream_encoder_framing.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/protected/all.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/protected/file_decoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/protected/file_encoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/protected/seekable_stream_decoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/protected/seekable_stream_encoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/protected/stream_decoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/protected/stream_encoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC++/file_decoder.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC++/file_encoder.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC++/seekable_stream_decoder.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC++/seekable_stream_encoder.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC++/stream_decoder.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC++/stream_encoder.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC/include/private/all.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC/include/private/ogg_decoder_aspect.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC/include/private/ogg_encoder_aspect.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC/include/private/ogg_helper.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC/include/private/ogg_mapping.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC/include/protected/all.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC/include/protected/file_decoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC/include/protected/file_encoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC/include/protected/seekable_stream_decoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC/include/protected/seekable_stream_encoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC/include/protected/stream_decoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC/include/protected/stream_encoder.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/metaflac/operations.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/metaflac/options.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/metaflac/usage.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/metaflac/utils.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_common/all.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_common/canonical_tag.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_common/charset.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_common/defs.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_common/dither.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_common/id3v1.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_common/id3v2.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_common/include/private/fast_float_math_hack.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_common/locale_hack.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_common/replaygain_synthesis.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_common/vorbiscomment.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/config.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/include/winamp2/in2.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/include/winamp2/out.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/infobox.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/playback.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/resource.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/tagz.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/tagz.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp3/cnv_flacpcm.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp3/cnv_flacpcm.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp3/flacpcm.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp3/flacpcm.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_xmms/charset.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_xmms/configure.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_xmms/tag.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_xmms/wrap_id3.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/share/replaygain_synthesis/include/private/fast_float_math_hack.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/share/utf8/charmaps.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/share/utf8/charset.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/share/utf8/charsetmap.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC++/decoders.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC++/decoders.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC++/encoders.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC++/encoders.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC++/file_utils.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC++/main.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC++/metadata.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC++/metadata.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC++/metadata_manip.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC++/metadata_object.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC++/metadata_utils.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC/bitbuffer.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC/decoders.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC/encoders.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC/file_utils.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC/metadata.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC/metadata_utils.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libOggFLAC++/decoders.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libOggFLAC++/decoders.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libOggFLAC++/encoders.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libOggFLAC++/encoders.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libOggFLAC++/file_utils.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libOggFLAC++/main.cpp
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libOggFLAC++/metadata_utils.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libOggFLAC/decoders.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libOggFLAC/encoders.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libOggFLAC/file_utils.h
trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libOggFLAC/metadata_utils.h
trunk/oggdsf/src/lib/codecs/helper/libfishsound/include/fishsound/comments.h
trunk/oggdsf/src/lib/codecs/helper/libfishsound/include/fishsound/constants.h
trunk/oggdsf/src/lib/codecs/helper/libfishsound/include/fishsound/fishsound.h
trunk/oggdsf/src/lib/codecs/helper/libfishsound/src/libfishsound/fs_compat.h
trunk/oggdsf/src/lib/codecs/helper/libfishsound/src/libfishsound/fs_vector.h
trunk/oggdsf/src/lib/codecs/helper/libfishsound/src/libfishsound/private.h
trunk/oggdsf/src/lib/codecs/helper/libfishsound/src/tests/fs_compat.h
trunk/oggdsf/src/lib/codecs/helper/libfishsound/src/tests/fs_tests.h
trunk/oggdsf/src/lib/codecs/helper/libfishsound/win32/config.h
trunk/oggdsf/src/lib/codecs/helper/libfishsound/win32/encdec-audio/encdec-audio.cpp
trunk/oggdsf/src/lib/codecs/helper/libfishsound/win32/encdec-comments/encdec-comments.cpp
trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeFilter.cpp
trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeFilter.h
trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeInputPin.cpp
trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeInputPin.h
trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeOutputPin.cpp
trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeOutputPin.h
trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/dsfSpeexDecoder.cpp
trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/fish_cdecl.h
trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/speexdecoderdllstuff.cpp
trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/speexdecoderdllstuff.h
trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/stdafx.cpp
trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/stdafx.h
trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeFilter.cpp
trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeFilter.h
trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeInputPin.cpp
trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeInputPin.h
trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeOutputPin.cpp
trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeOutputPin.h
trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/dsfSpeexEncoder.cpp
trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/fish_cdecl.h
trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/speexencoderdllstuff.cpp
trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/speexencoderdllstuff.h
trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/stdafx.cpp
trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/stdafx.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/include/speex.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/include/speex/speex.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/include/speex/speex_bits.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/include/speex/speex_callbacks.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/include/speex/speex_header.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/include/speex/speex_stereo.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/include/speex_bits.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/include/speex_callbacks.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/include/speex_header.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/include/speex_stereo.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/cb_search.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/filters.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/filters_sse.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/lpc.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/lsp.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/ltp.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/ltp_sse.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/math_approx.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/misc.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/modes.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/nb_celp.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/quant_lsp.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/sb_celp.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/speex.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/speex_bits.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/speex_callbacks.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/speex_header.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/speex_stereo.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/stack_alloc.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/vbr.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/vq.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/src/getopt_win.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/src/wav_io.h
trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/src/wave_out.h
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.h
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeInputPin.cpp
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeInputPin.h
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.cpp
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.h
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/dsfTheoraDecoder.cpp
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/stdafx.cpp
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/stdafx.h
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/theoradecodedllstuff.cpp
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/theoradecoderdllstuff.h
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/theoradllstuff.cpp
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/ITheoraEncodeSettings.cpp
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/ITheoraEncodeSettings.h
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/PropsTheoraEncoder.cpp
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/PropsTheoraEncoder.h
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeFilter.cpp
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeFilter.h
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.cpp
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.h
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeOutputPin.cpp
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeOutputPin.h
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/dsfTheoraEncoder.cpp
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/resource.h
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/stdafx.cpp
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/stdafx.h
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/theoraencoderdllstuff.cpp
trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/theoraencoderdllstuff.h
trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/TheoraDecoder.cpp
trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/TheoraDecoder.h
trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/TheoraEncoder.cpp
trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/TheoraEncoder.h
trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/libOOTheora.cpp
trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/libOOTheora.h
trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/stdafx.cpp
trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/stdafx.h
trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/theora_cdecl.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/examples/getopt.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/include/theora/theora.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/lib/block_inline.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/lib/encoder_internal.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/lib/encoder_lookup.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/lib/huffman.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/lib/hufftables.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/lib/mcomp.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/lib/pp.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/lib/quant_lookup.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/lib/toplevel_lookup.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_active.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_audio.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_byteorder.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_cdrom.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_copying.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_endian.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_error.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_events.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_getenv.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_joystick.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_keyboard.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_keysym.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_main.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_mouse.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_mutex.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_name.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_opengl.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_quit.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_rwops.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_syswm.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_thread.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_timer.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_types.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_version.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_video.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/begin_code.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/close_code.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/portaudio/pa_common/pa_host.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/portaudio/pa_common/pa_trace.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/portaudio/pa_common/portaudio.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/portaudio/pablio/pablio.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/portaudio/pablio/ringbuffer.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/transcoder/avi2vp3/avilib.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/wincompat/getopt.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/wincompat/unistd.h
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/libtheora/libtheora.cpp
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/libtheora/stdafx.cpp
trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/libtheora/stdafx.h
trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeFilter.cpp
trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeFilter.h
trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.cpp
trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.h
trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeOutputPin.cpp
trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeOutputPin.h
trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/dsfVorbisDecoder.cpp
trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/fish_cdecl.h
trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/stdafx.cpp
trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/stdafx.h
trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/vorbisdecoderdllstuff.cpp
trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/vorbisdecoderdllstuff.h
trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeFilter.cpp
trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeFilter.h
trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeInputPin.cpp
trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeInputPin.h
trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeOutputPin.cpp
trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeOutputPin.h
trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/dsfVorbisEncoder.cpp
trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/fish_cdecl.h
trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/stdafx.cpp
trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/stdafx.h
trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/vorbisencoderdllstuff.cpp
trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/vorbisencoderdllstuff.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/include/vorbis/codec.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/include/vorbis/vorbisenc.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/include/vorbis/vorbisfile.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/backends.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/bitrate.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/books/coupled/res_books_stereo.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/books/floor/floor_books.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/books/uncoupled/res_books_uncoupled.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/codebook.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/codec_internal.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/envelope.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/highlevel.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/lookup.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/lookup_data.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/lpc.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/lsp.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/masking.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/mdct.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/misc.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/floor_all.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/psych_11.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/psych_16.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/psych_44.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/psych_8.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/residue_16.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/residue_44.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/residue_44u.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/residue_8.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/setup_11.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/setup_16.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/setup_22.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/setup_32.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/setup_44.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/setup_44u.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/setup_8.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/setup_X.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/os.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/psy.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/registry.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/scales.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/smallft.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/window.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/macos/compat/sys/types.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/vq/bookutil.h
trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/vq/vqgen.h
trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/AnxPacketMaker.cpp
trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/AnxPacketMaker.h
trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/AnxPageInterleaver.cpp
trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/AnxPageInterleaver.h
trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/libOOAnnodex.cpp
trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/libOOAnnodex.h
trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/stdafx.cpp
trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/stdafx.h
trunk/oggdsf/src/lib/core/annodex/libannodex/acconfig.h
trunk/oggdsf/src/lib/core/annodex/libannodex/doc/anx_read_dox.h
trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/annodex.h
trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/anx_constants.h
trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/anx_core.h
trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/anx_general.h
trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/anx_import.h
trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/anx_int64.h
trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/anx_int64_w32.h
trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/anx_list.h
trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/anx_params.h
trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/anx_read.h
trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/anx_track.h
trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/anx_types.h
trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/anx_write.h
trunk/oggdsf/src/lib/core/annodex/libannodex/libltdl/ltdl.h
trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/anx_bos.h
trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/anx_byteswap.h
trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/anx_command.h
trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/anx_compat.h
trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/anx_import_private.h
trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/anx_mapping.h
trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/anx_private.h
trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/anx_snprint.h
trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/anx_tree.h
trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/content_type.h
trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/fix_dl.h
trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/xtag.h
trunk/oggdsf/src/lib/core/annodex/libannodex/src/tests/anx_tests.h
trunk/oggdsf/src/lib/core/annodex/libannodex/src/tools/common.h
trunk/oggdsf/src/lib/core/annodex/libannodex/win32/config.h
trunk/oggdsf/src/lib/core/annodex/libannodex/win32/dirent.h
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeFilter.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeFilter.h
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeInputPin.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeInputPin.h
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeOutputPin.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeOutputPin.h
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/abstractaudiodllstuff.h
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/dsfAbstracOggAudioDecoder.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/dsfAbstracOggAudioDecoder.h
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/stdafx.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/stdafx.h
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeFilter.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeFilter.h
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeInputPin.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeInputPin.h
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeOutputPin.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeOutputPin.h
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/abstractaudioencodedllstuff.h
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/dsfAbstractAudioEncoder.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/dsfAbstractAudioEncoder.h
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/stdafx.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/stdafx.h
trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeFilter.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeFilter.h
trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeInputPin.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeInputPin.h
trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeOutputPin.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeOutputPin.h
trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/abstractvideodllstuff.h
trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/dsfAbstractVideoDecoder.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/stdafx.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/stdafx.h
trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeFilter.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeFilter.h
trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeInputPin.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeInputPin.h
trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeOutputPin.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeOutputPin.h
trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/abstractvideoencoderdllstuff.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/abstractvideoencoderdllstuff.h
trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/dsfAbstractVideoEncoder.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/stdafx.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/stdafx.h
trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourceFilter.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourceFilter.h
trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourcePin.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourcePin.h
trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxStreamMapper.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxStreamMapper.h
trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLSourcePin.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLSourcePin.h
trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLStream.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLStream.h
trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/anxdllstuff.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/anxdllstuff.h
trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/dsfAnxDemux.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/stdafx.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/stdafx.h
trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxFilter.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxFilter.h
trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.h
trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPacketMaker.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPacketMaker.h
trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.h
trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/anxmuxdllstuff.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/anxmuxdllstuff.h
trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/dsfAnxMux.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/dsfAnxMux.h
trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/stdafx.cpp
trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/stdafx.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPFileSource.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPFileSource.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPMediaFile.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPMediaFile.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/DataSourceFactory.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/DataSourceFactory.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FLACStream.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FLACStream.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FilterFileSource.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FilterFileSource.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPOggSeeking.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPOggSeeking.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPSocket.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPSocket.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/IFilterDataSource.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/IFilterDataSource.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxFilter.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxFilter.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxOutputPin.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxOutputPin.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxer.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxer.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggFLAC_1_0_Stream.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggFLAC_1_0_Stream.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamFactory.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamFactory.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamMapper.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamMapper.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/PropsAbout.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/PropsAbout.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/RegWrap.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/RegWrap.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SingleMediaFileCache.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SingleMediaFileCache.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SpeexStream.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SpeexStream.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/StreamHeaders.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/StreamHeaders.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/StreamMapper.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/StreamMapper.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/TheoraStream.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/TheoraStream.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/VorbisStream.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/VorbisStream.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/ds_guids.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/oggdllstuff.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/oggdllstuff.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/resource.h
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/stdafx.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/stdafx.h
trunk/oggdsf/src/lib/core/directshow/dsfOggMux/FishSkeleton.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggMux/FishSkeleton.h
trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.h
trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.h
trunk/oggdsf/src/lib/core/directshow/dsfOggMux/dsfOggMux.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.h
trunk/oggdsf/src/lib/core/directshow/dsfOggMux/stdafx.cpp
trunk/oggdsf/src/lib/core/directshow/dsfOggMux/stdafx.h
trunk/oggdsf/src/lib/core/directshow/dsfSeeking/BasicSeekable.cpp
trunk/oggdsf/src/lib/core/directshow/dsfSeeking/BasicSeekable.h
trunk/oggdsf/src/lib/core/directshow/dsfSeeking/dsfSeeking.cpp
trunk/oggdsf/src/lib/core/directshow/dsfSeeking/dsfSeeking.h
trunk/oggdsf/src/lib/core/directshow/dsfSeeking/stdafx.cpp
trunk/oggdsf/src/lib/core/directshow/dsfSeeking/stdafx.h
trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9Filter.cpp
trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9Filter.h
trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9InputPin.cpp
trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9InputPin.h
trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9OutputPin.cpp
trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9OutputPin.h
trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/dsfSubtitleVMR9.cpp
trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/stdafx.cpp
trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/stdafx.h
trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/subtitledllstuff.cpp
trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/subtitledllstuff.h
trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformFilter.cpp
trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformFilter.h
trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformInputPin.cpp
trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformInputPin.h
trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformOutputPin.cpp
trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformOutputPin.h
trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/BasicSeekPassThrough.cpp
trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/BasicSeekPassThrough.h
trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/directshowabstractsdllstuff.h
trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/stdafx.cpp
trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/stdafx.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/IDataSource.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/IFIFOBuffer.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/INotifyArrival.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/INotifyComplete.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/IOggCallback.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/IOggPackSource.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/IStampedOggPacketSink.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPacket.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPacket.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPacketiser.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPacketiser.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPage.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPage.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageHeader.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageHeader.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageInterleaver.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageInterleaver.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginatorSettings.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginatorSettings.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggTypeDefs.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/StampedOggPacket.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOgg/StampedOggPacket.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/dllstuff.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/libOOOgg.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOgg/libOOOgg.h
trunk/oggdsf/src/lib/core/ogg/libOOOgg/stdafx.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOgg/stdafx.h
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoAnxSeekTable.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoAnxSeekTable.h
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.h
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/IOggSeeker.h
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OGGSRecogniser.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OGGSRecogniser.h
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.h
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekPoint.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekPoint.h
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.h
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.h
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/stdafx.cpp
trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/stdafx.h
trunk/oggdsf/src/lib/core/ogg/libVorbisComment/FileComments.cpp
trunk/oggdsf/src/lib/core/ogg/libVorbisComment/FileComments.h
trunk/oggdsf/src/lib/core/ogg/libVorbisComment/SingleVorbisComment.cpp
trunk/oggdsf/src/lib/core/ogg/libVorbisComment/SingleVorbisComment.h
trunk/oggdsf/src/lib/core/ogg/libVorbisComment/StreamCommentInfo.cpp
trunk/oggdsf/src/lib/core/ogg/libVorbisComment/StreamCommentInfo.h
trunk/oggdsf/src/lib/core/ogg/libVorbisComment/VorbisComments.cpp
trunk/oggdsf/src/lib/core/ogg/libVorbisComment/VorbisComments.h
trunk/oggdsf/src/lib/core/ogg/libVorbisComment/libVorbisComment.cpp
trunk/oggdsf/src/lib/core/ogg/libVorbisComment/libVorbisComment.h
trunk/oggdsf/src/lib/core/ogg/libVorbisComment/stdafx.cpp
trunk/oggdsf/src/lib/core/ogg/libVorbisComment/stdafx.h
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/AssemblyInfo.cpp
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNFileComments.cpp
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNFileComments.h
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNSingleVorbisComment.cpp
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNSingleVorbisComment.h
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNStreamCommentInfo.cpp
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNStreamCommentInfo.h
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNVorbisComments.cpp
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNVorbisComments.h
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/Stdafx.cpp
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/Stdafx.h
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/libVorbisCommentDotNET.cpp
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/libVorbisCommentDotNET.h
trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/resource.h
trunk/oggdsf/src/lib/core/ogg/libogg/include/ogg/ogg.h
trunk/oggdsf/src/lib/core/ogg/libogg/include/ogg/os_types.h
trunk/oggdsf/src/lib/core/ogg/libogg/macos/compat/sys/types.h
trunk/oggdsf/src/lib/core/ogg/liboggz/include/oggz/oggz.h
trunk/oggdsf/src/lib/core/ogg/liboggz/include/oggz/oggz_constants.h
trunk/oggdsf/src/lib/core/ogg/liboggz/include/oggz/oggz_io.h
trunk/oggdsf/src/lib/core/ogg/liboggz/include/oggz/oggz_table.h
trunk/oggdsf/src/lib/core/ogg/liboggz/src/liboggz/oggz_auto.h
trunk/oggdsf/src/lib/core/ogg/liboggz/src/liboggz/oggz_byteorder.h
trunk/oggdsf/src/lib/core/ogg/liboggz/src/liboggz/oggz_compat.h
trunk/oggdsf/src/lib/core/ogg/liboggz/src/liboggz/oggz_macros.h
trunk/oggdsf/src/lib/core/ogg/liboggz/src/liboggz/oggz_private.h
trunk/oggdsf/src/lib/core/ogg/liboggz/src/liboggz/oggz_vector.h
trunk/oggdsf/src/lib/core/ogg/liboggz/src/tests/oggz_tests.h
trunk/oggdsf/src/lib/core/ogg/liboggz/win32/config.h
trunk/oggdsf/src/lib/core/ogg/liboggz/win32/getopt.h
trunk/oggdsf/src/lib/helper/iDSHelper/DSStringer.cpp
trunk/oggdsf/src/lib/helper/iDSHelper/DSStringer.h
trunk/oggdsf/src/lib/helper/iDSHelper/iDSHelper.cpp
trunk/oggdsf/src/lib/helper/iDSHelper/iDSHelper.h
trunk/oggdsf/src/lib/helper/iDSHelper/stdafx.cpp
trunk/oggdsf/src/lib/helper/iDSHelper/stdafx.h
trunk/oggdsf/src/lib/helper/libCDROM/CDROM.cpp
trunk/oggdsf/src/lib/helper/libCDROM/CDROM.h
trunk/oggdsf/src/lib/helper/libCDROM/cdwin32api.h
trunk/oggdsf/src/lib/helper/libCDROM/libCDROM.cpp
trunk/oggdsf/src/lib/helper/libCDROM/libCDROM.h
trunk/oggdsf/src/lib/helper/libCDROM/stdafx.cpp
trunk/oggdsf/src/lib/helper/libCDROM/stdafx.h
trunk/oggdsf/src/lib/helper/libiWrapper/AssemblyInfo.cpp
trunk/oggdsf/src/lib/helper/libiWrapper/Stdafx.cpp
trunk/oggdsf/src/lib/helper/libiWrapper/Stdafx.h
trunk/oggdsf/src/lib/helper/libiWrapper/Wrappers.cpp
trunk/oggdsf/src/lib/helper/libiWrapper/Wrappers.h
trunk/oggdsf/src/lib/helper/libiWrapper/libiWrapper.cpp
trunk/oggdsf/src/lib/helper/libiWrapper/libiWrapper.h
trunk/oggdsf/src/lib/helper/libilliCore/StringHelper.cpp
trunk/oggdsf/src/lib/helper/libilliCore/StringHelper.h
trunk/oggdsf/src/lib/helper/libilliCore/config.h
trunk/oggdsf/src/lib/helper/libilliCore/iBE_Math.cpp
trunk/oggdsf/src/lib/helper/libilliCore/iBE_Math.h
trunk/oggdsf/src/lib/helper/libilliCore/iLE_Math.cpp
trunk/oggdsf/src/lib/helper/libilliCore/iLE_Math.h
trunk/oggdsf/src/lib/helper/libilliCore/illicoreconfig.h
trunk/oggdsf/src/lib/helper/libilliCore/libilliCore.cpp
trunk/oggdsf/src/lib/helper/libilliCore/libilliCore.h
trunk/oggdsf/src/lib/helper/libilliCore/stdafx.cpp
trunk/oggdsf/src/lib/helper/libilliCore/stdafx.h
trunk/oggdsf/src/lib/player/libDSPlayDotNET/AssemblyInfo.cpp
trunk/oggdsf/src/lib/player/libDSPlayDotNET/CMMLCallbackProxy.cpp
trunk/oggdsf/src/lib/player/libDSPlayDotNET/CMMLCallbackProxy.h
trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.cpp
trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.h
trunk/oggdsf/src/lib/player/libDSPlayDotNET/IDNCMMLCallbacks.h
trunk/oggdsf/src/lib/player/libDSPlayDotNET/IDNMediaEvent.h
trunk/oggdsf/src/lib/player/libDSPlayDotNET/Stdafx.cpp
trunk/oggdsf/src/lib/player/libDSPlayDotNET/Stdafx.h
trunk/oggdsf/src/lib/player/libDSPlayDotNET/libDSPlayDotNET.cpp
trunk/oggdsf/src/lib/player/libDSPlayDotNET/libDSPlayDotNET.h
trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/ControlDialog.cpp
trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/ControlDialog.h
trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.cpp
trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.h
trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/IMediaEventNotification.cpp
trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/IMediaEventNotification.h
trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/Resource.h
trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayer.cpp
trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayer.h
trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayerCtrl.cpp
trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayerCtrl.h
trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayerPropPage.cpp
trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayerPropPage.h
trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/stdafx.cpp
trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/stdafx.h
trunk/oggdsf/src/tests/testCDROM/stdafx.cpp
trunk/oggdsf/src/tests/testCDROM/stdafx.h
trunk/oggdsf/src/tests/testCDROM/testCDROM.cpp
trunk/oggdsf/src/tests/testCMMLParser/stdafx.cpp
trunk/oggdsf/src/tests/testCMMLParser/stdafx.h
trunk/oggdsf/src/tests/testCMMLParser/testCMMLParser.cpp
trunk/oggdsf/src/tests/testCircleBuffer/stdafx.cpp
trunk/oggdsf/src/tests/testCircleBuffer/stdafx.h
trunk/oggdsf/src/tests/testCircleBuffer/testCircleBuffer.cpp
trunk/oggdsf/src/tests/testLibOOOgg/OggPageFileWriter.cpp
trunk/oggdsf/src/tests/testLibOOOgg/OggPageFileWriter.h
trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPacketChecker.cpp
trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPacketChecker.h
trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPacketGenerator.cpp
trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPacketGenerator.h
trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPageChecker.cpp
trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPageChecker.h
trunk/oggdsf/src/tests/testLibOOOgg/stdafx.cpp
trunk/oggdsf/src/tests/testLibOOOgg/stdafx.h
trunk/oggdsf/src/tests/testLibOOOgg/testLibOOOgg.cpp
trunk/oggdsf/src/tests/testMuxDemux/OggPageFileWriter.cpp
trunk/oggdsf/src/tests/testMuxDemux/OggPageFileWriter.h
trunk/oggdsf/src/tests/testMuxDemux/stdafx.cpp
trunk/oggdsf/src/tests/testMuxDemux/stdafx.h
trunk/oggdsf/src/tests/testMuxDemux/testMuxDemux.cpp
trunk/oggdsf/src/tests/testOOOggMux/stdafx.cpp
trunk/oggdsf/src/tests/testOOOggMux/stdafx.h
trunk/oggdsf/src/tests/testOOOggMux/testOOOggMux.cpp
trunk/oggdsf/src/tests/testlibOOOggSpeed1/stdafx.cpp
trunk/oggdsf/src/tests/testlibOOOggSpeed1/stdafx.h
trunk/oggdsf/src/tests/testlibOOOggSpeed1/testlibOOOggSpeed1.cpp
trunk/oggdsf/src/tests/testliboggSpeed1/stdafx.cpp
trunk/oggdsf/src/tests/testliboggSpeed1/stdafx.h
trunk/oggdsf/src/tests/testliboggSpeed1/testliboggSpeed1.cpp
trunk/oggdsf/src/tests/testliboggzSpeed1/stdafx.cpp
trunk/oggdsf/src/tests/testliboggzSpeed1/stdafx.h
trunk/oggdsf/src/tests/testliboggzSpeed1/testliboggzSpeed1.cpp
trunk/oggdsf/src/tools/AnxCutter/AnxCutter.cpp
trunk/oggdsf/src/tools/AnxCutter/stdafx.cpp
trunk/oggdsf/src/tools/AnxCutter/stdafx.h
trunk/oggdsf/src/tools/CLOgg/CLOgg.cpp
trunk/oggdsf/src/tools/CLOgg/stdafx.cpp
trunk/oggdsf/src/tools/CLOgg/stdafx.h
trunk/oggdsf/src/tools/OOOggCommentDump/OOOggCommentDump.cpp
trunk/oggdsf/src/tools/OOOggCommentDump/stdafx.cpp
trunk/oggdsf/src/tools/OOOggCommentDump/stdafx.h
trunk/oggdsf/src/tools/OOOggDump/OOOggDump.cpp
trunk/oggdsf/src/tools/OOOggDump/stdafx.cpp
trunk/oggdsf/src/tools/OOOggDump/stdafx.h
trunk/oggdsf/src/tools/OOOggPacketise/OOOggPacketDumper.cpp
trunk/oggdsf/src/tools/OOOggPacketise/OOOggPacketDumper.h
trunk/oggdsf/src/tools/OOOggPacketise/OOOggPacketise.cpp
trunk/oggdsf/src/tools/OOOggPacketise/stdafx.cpp
trunk/oggdsf/src/tools/OOOggPacketise/stdafx.h
trunk/oggdsf/src/tools/OOOggSeekFileMaker/OOOggSeekFileMaker.cpp
trunk/oggdsf/src/tools/OOOggSeekFileMaker/stdafx.cpp
trunk/oggdsf/src/tools/OOOggSeekFileMaker/stdafx.h
trunk/oggdsf/src/tools/OOOggSeekFileReader/OOOggSeekFileReader.cpp
trunk/oggdsf/src/tools/OOOggSeekFileReader/stdafx.cpp
trunk/oggdsf/src/tools/OOOggSeekFileReader/stdafx.h
trunk/oggdsf/src/tools/OOOggStat/OOOggStat.cpp
trunk/oggdsf/src/tools/OOOggStat/stdafx.cpp
trunk/oggdsf/src/tools/OOOggStat/stdafx.h
trunk/oggdsf/src/tools/OOOggValidate/OOOggValidate.cpp
trunk/oggdsf/src/tools/OOOggValidate/OggStreamValidationState.cpp
trunk/oggdsf/src/tools/OOOggValidate/OggStreamValidationState.h
trunk/oggdsf/src/tools/OOOggValidate/OggValidationState.cpp
trunk/oggdsf/src/tools/OOOggValidate/OggValidationState.h
trunk/oggdsf/src/tools/OOOggValidate/stdafx.cpp
trunk/oggdsf/src/tools/OOOggValidate/stdafx.h
trunk/oggdsf/src/tools/iTranscode/iTranscode.cpp
trunk/oggdsf/src/tools/iTranscode/stdafx.cpp
trunk/oggdsf/src/tools/iTranscode/stdafx.h
trunk/oggdsf/src/tools/oggChainSplitter/oggChainSplitter.cpp
trunk/oggdsf/src/tools/oggChainSplitter/stdafx.cpp
trunk/oggdsf/src/tools/oggChainSplitter/stdafx.h
Log:
Use native EOL markers
Modified: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourceFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourceFilter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourceFilter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,186 +1,186 @@
-#include "StdAfx.h"
-#include ".\cmmlrawsourcefilter.h"
-
-CFactoryTemplate g_Templates[] =
-{
- {
- L"CMMLRawDemuxFilter", // Name
- &CLSID_CMMLRawSourceFilter, // CLSID
- CMMLRawSourceFilter::CreateInstance, // Method to create an instance of MyComponent
- NULL, // Initialization function
- NULL // Set-up information (for filters)
- }
-
-};
-
-// Generic way of determining the number of items in the template
-int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
-
-
-CUnknown* WINAPI CMMLRawSourceFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
-{
- CMMLRawSourceFilter *pNewObject = new CMMLRawSourceFilter();
- if (pNewObject == NULL) {
- *pHr = E_OUTOFMEMORY;
- }
- return pNewObject;
-}
-
-STDMETHODIMP CMMLRawSourceFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
- if (riid == IID_IFileSourceFilter) {
- *ppv = (IFileSourceFilter*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- }
- return CBaseFilter::NonDelegatingQueryInterface(riid, ppv);
-}
-
-CMMLRawSourceFilter::CMMLRawSourceFilter(void)
- : CBaseFilter(NAME("CMMLRawSourceFilter"), NULL, m_pLock, CLSID_CMMLRawSourceFilter)
- , mCMMLDoc(NULL)
- , mUptoTag(0)
-{
- m_pLock = new CCritSec;
- mCMMLSourcePin = new CMMLRawSourcePin( this
- , this->m_pLock);
-
-
-
-}
-
-CMMLRawSourceFilter::~CMMLRawSourceFilter(void)
-{
-
- delete mCMMLSourcePin;
- delete mCMMLDoc;
- delete m_pLock;
-}
-
-//BaseFilter Interface
-int CMMLRawSourceFilter::GetPinCount() {
- return 1;
-}
-CBasePin* CMMLRawSourceFilter::GetPin(int inPinNo) {
-
- if (inPinNo == 0) {
- return mCMMLSourcePin;
- } else {
- return NULL;
- }
-}
-
-//IAMFilterMiscFlags Interface
-ULONG CMMLRawSourceFilter::GetMiscFlags(void) {
- return AM_FILTER_MISC_FLAGS_IS_SOURCE;
-}
-
- //IFileSource Interface
-STDMETHODIMP CMMLRawSourceFilter::GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType) {
- //Return the filename and mediatype of the raw data
-
-
- LPOLESTR x = SysAllocString(mFileName.c_str());
- *outFileName = x;
-
- return S_OK;
-}
-
-//ANX::: Seek table will need modifying to handle this.
-STDMETHODIMP CMMLRawSourceFilter::Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType) {
- //Initialise the file here and setup all the streams
- CAutoLock locLock(m_pLock);
- mFileName = inFileName;
-
- delete mCMMLDoc;
- mCMMLDoc = new C_CMMLDoc;
- bool retVal = mCMMLParser.parseDocFromFile(mFileName, mCMMLDoc);
-
- mUptoTag = -1;
-
- if (retVal) {
- return S_OK;
- } else {
- return S_FALSE;
- }
-
-
-}
-
-//CAMThread Stuff
-DWORD CMMLRawSourceFilter::ThreadProc(void) {
- //debugLog << "Thread Proc Called..."<<endl;
-
- while(true) {
- DWORD locThreadCommand = GetRequest();
- //debugLog << "Command = "<<locThreadCommand<<endl;
- switch(locThreadCommand) {
- case THREAD_EXIT:
- //debugLog << "EXIT ** "<<endl;
- Reply(S_OK);
- return S_OK;
-
- case THREAD_RUN:
- //debugLog << "RUN ** "<<endl;
- Reply(S_OK);
- DataProcessLoop();
- break;
- }
-
- }
- return S_OK;
-}
-
-
-HRESULT CMMLRawSourceFilter::DataProcessLoop()
-{
- DWORD locCommand = 0;
- while(true) {
- if(CheckRequest(&locCommand) == TRUE) {
- //debugLog<<"DataProcessLoop : Thread Command issued... leaving loop."<<endl;
- return S_OK;
- }
-
- if (mUptoTag == -1) {
- mCMMLSourcePin->deliverTag(mCMMLDoc->root()->head());
- } else if (mUptoTag < mCMMLDoc->root()->clipList()->numTags()) {
- mCMMLSourcePin->deliverTag(mCMMLDoc->root()->clipList()->getTag(mUptoTag));
- } else {
- mCMMLSourcePin->DeliverEndOfStream();
- return S_OK;
- }
- mUptoTag++;
-
- }
- return S_OK;
-
-}
-//IMEdiaStreaming
-STDMETHODIMP CMMLRawSourceFilter::Run(REFERENCE_TIME tStart) {
- CAutoLock locLock(m_pLock);
- return CBaseFilter::Run(tStart);
-}
-STDMETHODIMP CMMLRawSourceFilter::Pause(void) {
- CAutoLock locLock(m_pLock);
- if (m_State == State_Stopped) {
- if (ThreadExists() == FALSE) {
- Create();
- }
- CallWorker(THREAD_RUN);
- }
-
- HRESULT locHR = CBaseFilter::Pause();
- return locHR;
-
-}
-STDMETHODIMP CMMLRawSourceFilter::Stop(void) {
- CAutoLock locLock(m_pLock);
- CallWorker(THREAD_EXIT);
- Close();
- //mJustSeeked = true;
- //mSeekRequest = 0;
- mUptoTag = -1;
- mCMMLSourcePin->DeliverBeginFlush();
- mCMMLSourcePin->DeliverEndFlush();
- return CBaseFilter::Stop();
+#include "StdAfx.h"
+#include ".\cmmlrawsourcefilter.h"
+
+CFactoryTemplate g_Templates[] =
+{
+ {
+ L"CMMLRawDemuxFilter", // Name
+ &CLSID_CMMLRawSourceFilter, // CLSID
+ CMMLRawSourceFilter::CreateInstance, // Method to create an instance of MyComponent
+ NULL, // Initialization function
+ NULL // Set-up information (for filters)
+ }
+
+};
+
+// Generic way of determining the number of items in the template
+int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
+
+
+CUnknown* WINAPI CMMLRawSourceFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
+{
+ CMMLRawSourceFilter *pNewObject = new CMMLRawSourceFilter();
+ if (pNewObject == NULL) {
+ *pHr = E_OUTOFMEMORY;
+ }
+ return pNewObject;
+}
+
+STDMETHODIMP CMMLRawSourceFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+ if (riid == IID_IFileSourceFilter) {
+ *ppv = (IFileSourceFilter*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ }
+ return CBaseFilter::NonDelegatingQueryInterface(riid, ppv);
+}
+
+CMMLRawSourceFilter::CMMLRawSourceFilter(void)
+ : CBaseFilter(NAME("CMMLRawSourceFilter"), NULL, m_pLock, CLSID_CMMLRawSourceFilter)
+ , mCMMLDoc(NULL)
+ , mUptoTag(0)
+{
+ m_pLock = new CCritSec;
+ mCMMLSourcePin = new CMMLRawSourcePin( this
+ , this->m_pLock);
+
+
+
+}
+
+CMMLRawSourceFilter::~CMMLRawSourceFilter(void)
+{
+
+ delete mCMMLSourcePin;
+ delete mCMMLDoc;
+ delete m_pLock;
+}
+
+//BaseFilter Interface
+int CMMLRawSourceFilter::GetPinCount() {
+ return 1;
+}
+CBasePin* CMMLRawSourceFilter::GetPin(int inPinNo) {
+
+ if (inPinNo == 0) {
+ return mCMMLSourcePin;
+ } else {
+ return NULL;
+ }
+}
+
+//IAMFilterMiscFlags Interface
+ULONG CMMLRawSourceFilter::GetMiscFlags(void) {
+ return AM_FILTER_MISC_FLAGS_IS_SOURCE;
+}
+
+ //IFileSource Interface
+STDMETHODIMP CMMLRawSourceFilter::GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType) {
+ //Return the filename and mediatype of the raw data
+
+
+ LPOLESTR x = SysAllocString(mFileName.c_str());
+ *outFileName = x;
+
+ return S_OK;
+}
+
+//ANX::: Seek table will need modifying to handle this.
+STDMETHODIMP CMMLRawSourceFilter::Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType) {
+ //Initialise the file here and setup all the streams
+ CAutoLock locLock(m_pLock);
+ mFileName = inFileName;
+
+ delete mCMMLDoc;
+ mCMMLDoc = new C_CMMLDoc;
+ bool retVal = mCMMLParser.parseDocFromFile(mFileName, mCMMLDoc);
+
+ mUptoTag = -1;
+
+ if (retVal) {
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
+
+
+}
+
+//CAMThread Stuff
+DWORD CMMLRawSourceFilter::ThreadProc(void) {
+ //debugLog << "Thread Proc Called..."<<endl;
+
+ while(true) {
+ DWORD locThreadCommand = GetRequest();
+ //debugLog << "Command = "<<locThreadCommand<<endl;
+ switch(locThreadCommand) {
+ case THREAD_EXIT:
+ //debugLog << "EXIT ** "<<endl;
+ Reply(S_OK);
+ return S_OK;
+
+ case THREAD_RUN:
+ //debugLog << "RUN ** "<<endl;
+ Reply(S_OK);
+ DataProcessLoop();
+ break;
+ }
+
+ }
+ return S_OK;
+}
+
+
+HRESULT CMMLRawSourceFilter::DataProcessLoop()
+{
+ DWORD locCommand = 0;
+ while(true) {
+ if(CheckRequest(&locCommand) == TRUE) {
+ //debugLog<<"DataProcessLoop : Thread Command issued... leaving loop."<<endl;
+ return S_OK;
+ }
+
+ if (mUptoTag == -1) {
+ mCMMLSourcePin->deliverTag(mCMMLDoc->root()->head());
+ } else if (mUptoTag < mCMMLDoc->root()->clipList()->numTags()) {
+ mCMMLSourcePin->deliverTag(mCMMLDoc->root()->clipList()->getTag(mUptoTag));
+ } else {
+ mCMMLSourcePin->DeliverEndOfStream();
+ return S_OK;
+ }
+ mUptoTag++;
+
+ }
+ return S_OK;
+
+}
+//IMEdiaStreaming
+STDMETHODIMP CMMLRawSourceFilter::Run(REFERENCE_TIME tStart) {
+ CAutoLock locLock(m_pLock);
+ return CBaseFilter::Run(tStart);
+}
+STDMETHODIMP CMMLRawSourceFilter::Pause(void) {
+ CAutoLock locLock(m_pLock);
+ if (m_State == State_Stopped) {
+ if (ThreadExists() == FALSE) {
+ Create();
+ }
+ CallWorker(THREAD_RUN);
+ }
+
+ HRESULT locHR = CBaseFilter::Pause();
+ return locHR;
+
+}
+STDMETHODIMP CMMLRawSourceFilter::Stop(void) {
+ CAutoLock locLock(m_pLock);
+ CallWorker(THREAD_EXIT);
+ Close();
+ //mJustSeeked = true;
+ //mSeekRequest = 0;
+ mUptoTag = -1;
+ mCMMLSourcePin->DeliverBeginFlush();
+ mCMMLSourcePin->DeliverEndFlush();
+ return CBaseFilter::Stop();
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourceFilter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourceFilter.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourceFilter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourceFilter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,64 +1,64 @@
-#pragma once
-
-#include <string>
-#include "libWinCMMLParse.h"
-#include "CMMLParser.h"
-#include "CMMLRawSourcePin.h"
-using namespace std;
-
-class CMMLRawSourcePin;
-
-class CMMLRawSourceFilter
- : public CBaseFilter
- , public CAMThread
- , public IFileSourceFilter
- , public IAMFilterMiscFlags
-{
-public:
-
- friend class CMMLRawSourcePin;
-
- enum eThreadCommands {
- THREAD_EXIT = 0,
- THREAD_PAUSE = 1,
- THREAD_RUN = 2
- };
-
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- CMMLRawSourceFilter(void);
- virtual ~CMMLRawSourceFilter(void);
-
- static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
-
- //IBaseFilter Pure Virtuals
- virtual int GetPinCount();
- virtual CBasePin* GetPin(int inPinNo);
-
- //IAMFilterMiscFlags Interface
- ULONG STDMETHODCALLTYPE GetMiscFlags(void);
-
- //IFileSource Interface
- virtual STDMETHODIMP GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType);
- virtual STDMETHODIMP Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType);
-
- //CAMThread
- virtual DWORD ThreadProc(void);
-
-
- STDMETHODIMP Run(REFERENCE_TIME tStart);
- STDMETHODIMP Pause(void);
- STDMETHODIMP Stop(void);
-
-protected:
- virtual HRESULT DataProcessLoop();
-
- CMMLRawSourcePin* mCMMLSourcePin;
- CMMLParser mCMMLParser;
-
- C_CMMLDoc* mCMMLDoc;
- wstring mFileName;
-
- long mUptoTag;
-};
+#pragma once
+
+#include <string>
+#include "libWinCMMLParse.h"
+#include "CMMLParser.h"
+#include "CMMLRawSourcePin.h"
+using namespace std;
+
+class CMMLRawSourcePin;
+
+class CMMLRawSourceFilter
+ : public CBaseFilter
+ , public CAMThread
+ , public IFileSourceFilter
+ , public IAMFilterMiscFlags
+{
+public:
+
+ friend class CMMLRawSourcePin;
+
+ enum eThreadCommands {
+ THREAD_EXIT = 0,
+ THREAD_PAUSE = 1,
+ THREAD_RUN = 2
+ };
+
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ CMMLRawSourceFilter(void);
+ virtual ~CMMLRawSourceFilter(void);
+
+ static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+
+ //IBaseFilter Pure Virtuals
+ virtual int GetPinCount();
+ virtual CBasePin* GetPin(int inPinNo);
+
+ //IAMFilterMiscFlags Interface
+ ULONG STDMETHODCALLTYPE GetMiscFlags(void);
+
+ //IFileSource Interface
+ virtual STDMETHODIMP GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType);
+ virtual STDMETHODIMP Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType);
+
+ //CAMThread
+ virtual DWORD ThreadProc(void);
+
+
+ STDMETHODIMP Run(REFERENCE_TIME tStart);
+ STDMETHODIMP Pause(void);
+ STDMETHODIMP Stop(void);
+
+protected:
+ virtual HRESULT DataProcessLoop();
+
+ CMMLRawSourcePin* mCMMLSourcePin;
+ CMMLParser mCMMLParser;
+
+ C_CMMLDoc* mCMMLDoc;
+ wstring mFileName;
+
+ long mUptoTag;
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourceFilter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourcePin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourcePin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourcePin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,168 +1,168 @@
-#include "StdAfx.h"
-#include ".\cmmlrawsourcepin.h"
-
-CMMLRawSourcePin::CMMLRawSourcePin(CMMLRawSourceFilter* inParentFilter, CCritSec* inFilterLock)
- : CBaseOutputPin(NAME("CMML Raw Source Pin"), inParentFilter, inFilterLock, &mFilterHR, L"CMML Source")
- , mDataQueue(NULL)
-
-{
- mCMMLFormatBlock.granuleDenominator = 1;
- mCMMLFormatBlock.granuleNumerator = 1000;
-
-}
-
-CMMLRawSourcePin::~CMMLRawSourcePin(void)
-{
-}
-
-STDMETHODIMP CMMLRawSourcePin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
-
- return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
-}
-
-HRESULT CMMLRawSourcePin::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
-{
-
- mDataQueue->NewSegment(tStart, tStop, dRate);
-
- return S_OK;
-}
-HRESULT CMMLRawSourcePin::DeliverEndOfStream(void)
-{
-
- mDataQueue->EOS();
- return S_OK;
-}
-
-HRESULT CMMLRawSourcePin::DeliverEndFlush(void)
-{
- mDataQueue->EndFlush();
- return S_OK;
-}
-
-HRESULT CMMLRawSourcePin::DeliverBeginFlush(void)
-{
-
- mDataQueue->BeginFlush();
- return S_OK;
-}
-
-HRESULT CMMLRawSourcePin::CompleteConnect (IPin *inReceivePin)
-{
- mFilterHR = S_OK;
- //Set the delegate for seeking
- //((BasicSeekable*)(inReceivePin))->SetDelegate(this);
- //This may cause issue if pins are disconnected and reconnected
- //DELETE in DEStructor
- mDataQueue = new COutputQueue (inReceivePin, &mFilterHR, FALSE, TRUE,1,TRUE, NUM_BUFFERS);
- if (FAILED(mFilterHR)) {
- mFilterHR = mFilterHR;
- }
-
- return CBaseOutputPin::CompleteConnect(inReceivePin);
-}
-
-HRESULT CMMLRawSourcePin::BreakConnect(void) {
- delete mDataQueue;
- mDataQueue = NULL;
- return CBaseOutputPin::BreakConnect();
-}
-
- //CSourceStream virtuals
-HRESULT CMMLRawSourcePin::GetMediaType(int inPosition, CMediaType* outMediaType) {
- //Put it in from the info we got in the constructor.
- //NOTE::: May have missed some fields ????
- //NOTE::: May want to check for null pointers
- //outMediaType->SetFormat(mMediaType->Format(), mMediaType->FormatLength());
- if (inPosition == 0) {
- CMediaType locMediaType;
-
- locMediaType.majortype = MEDIATYPE_Text;
- locMediaType.subtype = MEDIASUBTYPE_CMML;
- locMediaType.formattype = FORMAT_CMML;
-
- BYTE* locFB = locMediaType.AllocFormatBuffer(sizeof(sCMMLFormatBlock)); //0;//sizeof(sSpeexFormatBlock);
-
- //locMediaType.pbFormat = (BYTE*)&mCMMLFormatBlock; //(BYTE*)locSpeexFormatInfo;
- memcpy((void*)locFB, (const void*)&mCMMLFormatBlock, sizeof(sCMMLFormatBlock));
- locMediaType.pUnk = NULL;
- *outMediaType = locMediaType;
- return S_OK;
- } else {
- return VFW_S_NO_MORE_ITEMS;
- }
-}
-HRESULT CMMLRawSourcePin::CheckMediaType(const CMediaType* inMediaType) {
- if ((inMediaType->majortype == MEDIATYPE_Text) && (inMediaType->subtype == MEDIASUBTYPE_CMML) && (inMediaType->formattype == FORMAT_CMML)) {
- return S_OK;
- } else {
- return E_FAIL;
- }
-}
-HRESULT CMMLRawSourcePin::DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest) {
-
- HRESULT locHR = S_OK;
-
- ALLOCATOR_PROPERTIES locReqAlloc;
- ALLOCATOR_PROPERTIES locActualAlloc;
-
-
- locReqAlloc.cbAlign = 1;
- locReqAlloc.cbBuffer = BUFFER_SIZE;
- locReqAlloc.cbPrefix = 0;
- locReqAlloc.cBuffers = NUM_BUFFERS;
-
- locHR = inoutAllocator->SetProperties(&locReqAlloc, &locActualAlloc);
-
- if (locHR != S_OK) {
- return locHR;
- }
-
- locHR = inoutAllocator->Commit();
-
- return locHR;
-
-}
-
-
-HRESULT CMMLRawSourcePin::deliverTag(C_CMMLTag* inTag) {
-
- IMediaSample* locSample = NULL;
- REFERENCE_TIME locStart = 0;
- REFERENCE_TIME locStop = 0;
-
- HRESULT locHR = GetDeliveryBuffer(&locSample, NULL, NULL, NULL);
-
-
- if (locHR != S_OK) {
- //debugLog<<"Failure... No buffer"<<endl;
- return locHR;
- }
-
- BYTE* locOutBuffer = NULL;
- locHR = locSample->GetPointer(&locOutBuffer);
-
- if (locHR != S_OK) {
- //debugLog<<"Failure... No buffer"<<endl;
- return locHR;
- }
-
- wstring locStr = inTag->toString();
-
-
- //TODO::: For now, this narrowfies the string... to ascii, instead of sending
- // 2 byte chars.
-
- string locNarrowStr = StringHelper::toNarrowStr(locStr);
-
- memcpy((void*)locOutBuffer, (const void*)locNarrowStr.c_str(), locNarrowStr.size());
-
- locSample->SetActualDataLength(locNarrowStr.size());
-
-
-
- return Deliver(locSample);
-
-
+#include "StdAfx.h"
+#include ".\cmmlrawsourcepin.h"
+
+CMMLRawSourcePin::CMMLRawSourcePin(CMMLRawSourceFilter* inParentFilter, CCritSec* inFilterLock)
+ : CBaseOutputPin(NAME("CMML Raw Source Pin"), inParentFilter, inFilterLock, &mFilterHR, L"CMML Source")
+ , mDataQueue(NULL)
+
+{
+ mCMMLFormatBlock.granuleDenominator = 1;
+ mCMMLFormatBlock.granuleNumerator = 1000;
+
+}
+
+CMMLRawSourcePin::~CMMLRawSourcePin(void)
+{
+}
+
+STDMETHODIMP CMMLRawSourcePin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+
+ return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
+}
+
+HRESULT CMMLRawSourcePin::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
+{
+
+ mDataQueue->NewSegment(tStart, tStop, dRate);
+
+ return S_OK;
+}
+HRESULT CMMLRawSourcePin::DeliverEndOfStream(void)
+{
+
+ mDataQueue->EOS();
+ return S_OK;
+}
+
+HRESULT CMMLRawSourcePin::DeliverEndFlush(void)
+{
+ mDataQueue->EndFlush();
+ return S_OK;
+}
+
+HRESULT CMMLRawSourcePin::DeliverBeginFlush(void)
+{
+
+ mDataQueue->BeginFlush();
+ return S_OK;
+}
+
+HRESULT CMMLRawSourcePin::CompleteConnect (IPin *inReceivePin)
+{
+ mFilterHR = S_OK;
+ //Set the delegate for seeking
+ //((BasicSeekable*)(inReceivePin))->SetDelegate(this);
+ //This may cause issue if pins are disconnected and reconnected
+ //DELETE in DEStructor
+ mDataQueue = new COutputQueue (inReceivePin, &mFilterHR, FALSE, TRUE,1,TRUE, NUM_BUFFERS);
+ if (FAILED(mFilterHR)) {
+ mFilterHR = mFilterHR;
+ }
+
+ return CBaseOutputPin::CompleteConnect(inReceivePin);
+}
+
+HRESULT CMMLRawSourcePin::BreakConnect(void) {
+ delete mDataQueue;
+ mDataQueue = NULL;
+ return CBaseOutputPin::BreakConnect();
+}
+
+ //CSourceStream virtuals
+HRESULT CMMLRawSourcePin::GetMediaType(int inPosition, CMediaType* outMediaType) {
+ //Put it in from the info we got in the constructor.
+ //NOTE::: May have missed some fields ????
+ //NOTE::: May want to check for null pointers
+ //outMediaType->SetFormat(mMediaType->Format(), mMediaType->FormatLength());
+ if (inPosition == 0) {
+ CMediaType locMediaType;
+
+ locMediaType.majortype = MEDIATYPE_Text;
+ locMediaType.subtype = MEDIASUBTYPE_CMML;
+ locMediaType.formattype = FORMAT_CMML;
+
+ BYTE* locFB = locMediaType.AllocFormatBuffer(sizeof(sCMMLFormatBlock)); //0;//sizeof(sSpeexFormatBlock);
+
+ //locMediaType.pbFormat = (BYTE*)&mCMMLFormatBlock; //(BYTE*)locSpeexFormatInfo;
+ memcpy((void*)locFB, (const void*)&mCMMLFormatBlock, sizeof(sCMMLFormatBlock));
+ locMediaType.pUnk = NULL;
+ *outMediaType = locMediaType;
+ return S_OK;
+ } else {
+ return VFW_S_NO_MORE_ITEMS;
+ }
+}
+HRESULT CMMLRawSourcePin::CheckMediaType(const CMediaType* inMediaType) {
+ if ((inMediaType->majortype == MEDIATYPE_Text) && (inMediaType->subtype == MEDIASUBTYPE_CMML) && (inMediaType->formattype == FORMAT_CMML)) {
+ return S_OK;
+ } else {
+ return E_FAIL;
+ }
+}
+HRESULT CMMLRawSourcePin::DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest) {
+
+ HRESULT locHR = S_OK;
+
+ ALLOCATOR_PROPERTIES locReqAlloc;
+ ALLOCATOR_PROPERTIES locActualAlloc;
+
+
+ locReqAlloc.cbAlign = 1;
+ locReqAlloc.cbBuffer = BUFFER_SIZE;
+ locReqAlloc.cbPrefix = 0;
+ locReqAlloc.cBuffers = NUM_BUFFERS;
+
+ locHR = inoutAllocator->SetProperties(&locReqAlloc, &locActualAlloc);
+
+ if (locHR != S_OK) {
+ return locHR;
+ }
+
+ locHR = inoutAllocator->Commit();
+
+ return locHR;
+
+}
+
+
+HRESULT CMMLRawSourcePin::deliverTag(C_CMMLTag* inTag) {
+
+ IMediaSample* locSample = NULL;
+ REFERENCE_TIME locStart = 0;
+ REFERENCE_TIME locStop = 0;
+
+ HRESULT locHR = GetDeliveryBuffer(&locSample, NULL, NULL, NULL);
+
+
+ if (locHR != S_OK) {
+ //debugLog<<"Failure... No buffer"<<endl;
+ return locHR;
+ }
+
+ BYTE* locOutBuffer = NULL;
+ locHR = locSample->GetPointer(&locOutBuffer);
+
+ if (locHR != S_OK) {
+ //debugLog<<"Failure... No buffer"<<endl;
+ return locHR;
+ }
+
+ wstring locStr = inTag->toString();
+
+
+ //TODO::: For now, this narrowfies the string... to ascii, instead of sending
+ // 2 byte chars.
+
+ string locNarrowStr = StringHelper::toNarrowStr(locStr);
+
+ memcpy((void*)locOutBuffer, (const void*)locNarrowStr.c_str(), locNarrowStr.size());
+
+ locSample->SetActualDataLength(locNarrowStr.size());
+
+
+
+ return Deliver(locSample);
+
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourcePin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourcePin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourcePin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourcePin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,78 +1,78 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2003, 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "cmmlrawsourcedllstuff.h"
-#include "StringHelper.h"
-#include <fstream>
-using namespace std;
-
-class CMMLRawSourceFilter;
-
-class CMMLRawSourcePin
- : public CBaseOutputPin
-{
-public:
-
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- CMMLRawSourcePin( CMMLRawSourceFilter* inParentFilter, CCritSec* inFilterLock);
-
- virtual ~CMMLRawSourcePin(void);
-
- static const unsigned long BUFFER_SIZE = 65536; //What should this be ????
- static const unsigned long NUM_BUFFERS = 10;
-
- //CBaseOutputPin virtuals
- virtual HRESULT GetMediaType(int inPosition, CMediaType* outMediaType);
- virtual HRESULT CheckMediaType(const CMediaType* inMediaType);
- virtual HRESULT DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest);
-
-
- //IPin
- virtual HRESULT CompleteConnect (IPin *inReceivePin);
- virtual HRESULT BreakConnect(void);
- virtual HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
- virtual HRESULT DeliverEndOfStream(void);
- virtual HRESULT DeliverEndFlush(void);
- virtual HRESULT DeliverBeginFlush(void);
-
- virtual HRESULT deliverTag(C_CMMLTag* inTag);
-protected:
- //fstream debugLog;
- HRESULT mFilterHR;
- COutputQueue* mDataQueue;
- sCMMLFormatBlock mCMMLFormatBlock;
-};
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "cmmlrawsourcedllstuff.h"
+#include "StringHelper.h"
+#include <fstream>
+using namespace std;
+
+class CMMLRawSourceFilter;
+
+class CMMLRawSourcePin
+ : public CBaseOutputPin
+{
+public:
+
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ CMMLRawSourcePin( CMMLRawSourceFilter* inParentFilter, CCritSec* inFilterLock);
+
+ virtual ~CMMLRawSourcePin(void);
+
+ static const unsigned long BUFFER_SIZE = 65536; //What should this be ????
+ static const unsigned long NUM_BUFFERS = 10;
+
+ //CBaseOutputPin virtuals
+ virtual HRESULT GetMediaType(int inPosition, CMediaType* outMediaType);
+ virtual HRESULT CheckMediaType(const CMediaType* inMediaType);
+ virtual HRESULT DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest);
+
+
+ //IPin
+ virtual HRESULT CompleteConnect (IPin *inReceivePin);
+ virtual HRESULT BreakConnect(void);
+ virtual HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
+ virtual HRESULT DeliverEndOfStream(void);
+ virtual HRESULT DeliverEndFlush(void);
+ virtual HRESULT DeliverBeginFlush(void);
+
+ virtual HRESULT deliverTag(C_CMMLTag* inTag);
+protected:
+ //fstream debugLog;
+ HRESULT mFilterHR;
+ COutputQueue* mDataQueue;
+ sCMMLFormatBlock mCMMLFormatBlock;
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/CMMLRawSourcePin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/cmmlrawsourcedllstuff.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/cmmlrawsourcedllstuff.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/cmmlrawsourcedllstuff.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,113 +1,113 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "cmmlrawsourcedllstuff.h"
-
-
-
-
-extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
-BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
-{
- return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
-}
-
-
-//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
-STDAPI DllRegisterServer()
-{
-
- //TO DO::: Should we be releasing the filter mapper even when we return early ?
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(TRUE);
- if (FAILED(hr)) {
-
- return hr;
- }
-
-
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
-
-
- if (FAILED(hr)) {
- return hr;
- }
-
- hr = locFilterMapper->RegisterFilter(
- CLSID_CMMLRawSourceFilter, // Filter CLSID.
- L"CMML Raw Source Filter", // Filter name.
- NULL, // Device moniker.
- &CLSID_LegacyAmFilterCategory, // Direct Show general category
- L"CMML Raw Source Filter", // Instance data. ???????
- &CMMLRawSourceFilterReg // Pointer to filter information.
- );
-
-
-
- locFilterMapper->Release();
-
- return hr;
-
-}
-
-STDAPI DllUnregisterServer()
-{
- //This is not a general purpose function.
- //RegWrap::removeMediaDesc();
-
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(FALSE);
- if (FAILED(hr)) {
-
- return hr;
- }
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
- IID_IFilterMapper2, (void **)&locFilterMapper);
-
- if (FAILED(hr)) {
- return hr;
- }
-
-
- hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory,
- L"CMML Raw Source Filter", CLSID_CMMLRawSourceFilter);
-
- //
- locFilterMapper->Release();
- return hr;
-
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "cmmlrawsourcedllstuff.h"
+
+
+
+
+extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
+BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+ return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
+}
+
+
+//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
+STDAPI DllRegisterServer()
+{
+
+ //TO DO::: Should we be releasing the filter mapper even when we return early ?
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(TRUE);
+ if (FAILED(hr)) {
+
+ return hr;
+ }
+
+
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
+
+
+ if (FAILED(hr)) {
+ return hr;
+ }
+
+ hr = locFilterMapper->RegisterFilter(
+ CLSID_CMMLRawSourceFilter, // Filter CLSID.
+ L"CMML Raw Source Filter", // Filter name.
+ NULL, // Device moniker.
+ &CLSID_LegacyAmFilterCategory, // Direct Show general category
+ L"CMML Raw Source Filter", // Instance data. ???????
+ &CMMLRawSourceFilterReg // Pointer to filter information.
+ );
+
+
+
+ locFilterMapper->Release();
+
+ return hr;
+
+}
+
+STDAPI DllUnregisterServer()
+{
+ //This is not a general purpose function.
+ //RegWrap::removeMediaDesc();
+
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(FALSE);
+ if (FAILED(hr)) {
+
+ return hr;
+ }
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
+ IID_IFilterMapper2, (void **)&locFilterMapper);
+
+ if (FAILED(hr)) {
+ return hr;
+ }
+
+
+ hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory,
+ L"CMML Raw Source Filter", CLSID_CMMLRawSourceFilter);
+
+ //
+ locFilterMapper->Release();
+ return hr;
+
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/cmmlrawsourcedllstuff.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/cmmlrawsourcedllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/cmmlrawsourcedllstuff.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/cmmlrawsourcedllstuff.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,69 +1,69 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include <streams.h>
-#include <pullpin.h>
-#include <initguid.h>
-
-#ifdef DSFCMMLRAWSOURCE_EXPORTS
-#define DSFCMMLRAWSOURCE_API __declspec(dllexport)
-#else
-#define DSFCMMLRAWSOURCE_API __declspec(dllimport)
-#endif
-
-// {B78032F1-DCC8-4af4-91AD-FB98E806130D}
-DEFINE_GUID(CLSID_CMMLRawSourceFilter,
-0xb78032f1, 0xdcc8, 0x4af4, 0x91, 0xad, 0xfb, 0x98, 0xe8, 0x6, 0x13, 0xd);
-
-
-// {53696C76-6961-40b2-B136-436F6E726164}
-DEFINE_GUID(FORMAT_CMML,
-0x53696c76, 0x6961, 0x40b2, 0xb1, 0x36, 0x43, 0x6f, 0x6e, 0x72, 0x61, 0x64);
-
-
-// {5A656E74-6172-6F26-B79C-D6416E647282}
-DEFINE_GUID(MEDIASUBTYPE_CMML,
-0x5a656e74, 0x6172, 0x6f26, 0xb7, 0x9c, 0xd6, 0x41, 0x6e, 0x64, 0x72, 0x82);
-
-//Structure defining the registration details of the filter
-const REGFILTER2 CMMLRawSourceFilterReg = {
- 1,
- MERIT_NORMAL,
- 0,
- NULL
-
-};
-
-
-struct sCMMLFormatBlock {
- __int64 granuleNumerator;
- __int64 granuleDenominator;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+#include <streams.h>
+#include <pullpin.h>
+#include <initguid.h>
+
+#ifdef DSFCMMLRAWSOURCE_EXPORTS
+#define DSFCMMLRAWSOURCE_API __declspec(dllexport)
+#else
+#define DSFCMMLRAWSOURCE_API __declspec(dllimport)
+#endif
+
+// {B78032F1-DCC8-4af4-91AD-FB98E806130D}
+DEFINE_GUID(CLSID_CMMLRawSourceFilter,
+0xb78032f1, 0xdcc8, 0x4af4, 0x91, 0xad, 0xfb, 0x98, 0xe8, 0x6, 0x13, 0xd);
+
+
+// {53696C76-6961-40b2-B136-436F6E726164}
+DEFINE_GUID(FORMAT_CMML,
+0x53696c76, 0x6961, 0x40b2, 0xb1, 0x36, 0x43, 0x6f, 0x6e, 0x72, 0x61, 0x64);
+
+
+// {5A656E74-6172-6F26-B79C-D6416E647282}
+DEFINE_GUID(MEDIASUBTYPE_CMML,
+0x5a656e74, 0x6172, 0x6f26, 0xb7, 0x9c, 0xd6, 0x41, 0x6e, 0x64, 0x72, 0x82);
+
+//Structure defining the registration details of the filter
+const REGFILTER2 CMMLRawSourceFilterReg = {
+ 1,
+ MERIT_NORMAL,
+ 0,
+ NULL
+
+};
+
+
+struct sCMMLFormatBlock {
+ __int64 granuleNumerator;
+ __int64 granuleDenominator;
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/cmmlrawsourcedllstuff.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/dsfCMMLRawSource.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/dsfCMMLRawSource.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/dsfCMMLRawSource.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,36 +1,36 @@
-// dsfCMMLRawSource.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-#include "dsfCMMLRawSource.h"
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
-}
-
-// This is an example of an exported variable
-DSFCMMLRAWSOURCE_API int ndsfCMMLRawSource=0;
-
-// This is an example of an exported function.
-DSFCMMLRAWSOURCE_API int fndsfCMMLRawSource(void)
-{
- return 42;
-}
-
-// This is the constructor of a class that has been exported.
-// see dsfCMMLRawSource.h for the class definition
-CdsfCMMLRawSource::CdsfCMMLRawSource()
-{
- return;
-}
+// dsfCMMLRawSource.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+#include "dsfCMMLRawSource.h"
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ switch (ul_reason_for_call)
+ {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
+}
+
+// This is an example of an exported variable
+DSFCMMLRAWSOURCE_API int ndsfCMMLRawSource=0;
+
+// This is an example of an exported function.
+DSFCMMLRAWSOURCE_API int fndsfCMMLRawSource(void)
+{
+ return 42;
+}
+
+// This is the constructor of a class that has been exported.
+// see dsfCMMLRawSource.h for the class definition
+CdsfCMMLRawSource::CdsfCMMLRawSource()
+{
+ return;
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/dsfCMMLRawSource.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/dsfCMMLRawSource.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/dsfCMMLRawSource.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/dsfCMMLRawSource.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,22 +1,22 @@
-// The following ifdef block is the standard way of creating macros which make exporting
-// from a DLL simpler. All files within this DLL are compiled with the DSFCMMLRAWSOURCE_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see
-// DSFCMMLRAWSOURCE_API functions as being imported from a DLL, whereas this DLL sees symbols
-// defined with this macro as being exported.
-#ifdef DSFCMMLRAWSOURCE_EXPORTS
-#define DSFCMMLRAWSOURCE_API __declspec(dllexport)
-#else
-#define DSFCMMLRAWSOURCE_API __declspec(dllimport)
-#endif
-
-// This class is exported from the dsfCMMLRawSource.dll
-class DSFCMMLRAWSOURCE_API CdsfCMMLRawSource {
-public:
- CdsfCMMLRawSource(void);
- // TODO: add your methods here.
-};
-
-extern DSFCMMLRAWSOURCE_API int ndsfCMMLRawSource;
-
-DSFCMMLRAWSOURCE_API int fndsfCMMLRawSource(void);
+// The following ifdef block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the DSFCMMLRAWSOURCE_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// DSFCMMLRAWSOURCE_API functions as being imported from a DLL, whereas this DLL sees symbols
+// defined with this macro as being exported.
+#ifdef DSFCMMLRAWSOURCE_EXPORTS
+#define DSFCMMLRAWSOURCE_API __declspec(dllexport)
+#else
+#define DSFCMMLRAWSOURCE_API __declspec(dllimport)
+#endif
+
+// This class is exported from the dsfCMMLRawSource.dll
+class DSFCMMLRAWSOURCE_API CdsfCMMLRawSource {
+public:
+ CdsfCMMLRawSource(void);
+ // TODO: add your methods here.
+};
+
+extern DSFCMMLRAWSOURCE_API int ndsfCMMLRawSource;
+
+DSFCMMLRAWSOURCE_API int fndsfCMMLRawSource(void);
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/dsfCMMLRawSource.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// dsfCMMLRawSource.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// dsfCMMLRawSource.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,16 +1,16 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-// TODO: reference additional headers your program requires here
-#include "cmmlrawsourcedllstuff.h"
-#include "CMMLRawSourceFilter.h"
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+// TODO: reference additional headers your program requires here
+#include "cmmlrawsourcedllstuff.h"
+#include "CMMLRawSourceFilter.h"
#include "CMMLRawSourcePin.h"
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/dsfCMMLRawSource/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_AnchorTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_AnchorTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_AnchorTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,71 +30,71 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-
-#include "StdAfx.h"
-#include ".\c_anchortag.h"
-
-//Constructors
-C_AnchorTag::C_AnchorTag(void)
-{
- //Set the tag type
- mTagType = C_CMMLTag::eTagType::ANCHOR;
- mCls = L"";
- mHref = L"";
-}
-
-C_AnchorTag::~C_AnchorTag(void)
-{
-}
-C_AnchorTag* C_AnchorTag::clone() {
- C_AnchorTag* retTag = new C_AnchorTag;
- privateClone(retTag);
- return retTag;
-
-}
-C_CMMLTag* C_AnchorTag::genericClone() {
- return clone();
-}
-
-//Accessors
-wstring C_AnchorTag::cls() {
- return mCls;
-}
-wstring C_AnchorTag::href() {
- return mHref;
-}
-
-//Mutators
-void C_AnchorTag::setCls(wstring inCls) {
- mCls = inCls;
-}
-void C_AnchorTag::setHref(wstring inHref) {
- mHref = inHref;
-}
-
-//Other
-wstring C_AnchorTag::toString() {
-
-
- wstring retStr = L"<a";
-
- retStr += makeElement(L"id", mId);
- retStr += makeLangElements();
- retStr += makeElement(L"class", mCls);
- retStr += makeRequiredElement(L"href", mHref);
-
- retStr += L">";
- retStr += mText;
- retStr += L"</a>\n";
-
- return retStr;
-}
-
-void C_AnchorTag::privateClone(C_CMMLTag* outTag) {
- C_TextFieldTag::privateClone(outTag);
- C_AnchorTag* locTag = reinterpret_cast<C_AnchorTag*>(outTag);
- locTag->mCls = mCls;
- locTag->mHref = mHref;
-}
+*/
+
+
+#include "StdAfx.h"
+#include ".\c_anchortag.h"
+
+//Constructors
+C_AnchorTag::C_AnchorTag(void)
+{
+ //Set the tag type
+ mTagType = C_CMMLTag::eTagType::ANCHOR;
+ mCls = L"";
+ mHref = L"";
+}
+
+C_AnchorTag::~C_AnchorTag(void)
+{
+}
+C_AnchorTag* C_AnchorTag::clone() {
+ C_AnchorTag* retTag = new C_AnchorTag;
+ privateClone(retTag);
+ return retTag;
+
+}
+C_CMMLTag* C_AnchorTag::genericClone() {
+ return clone();
+}
+
+//Accessors
+wstring C_AnchorTag::cls() {
+ return mCls;
+}
+wstring C_AnchorTag::href() {
+ return mHref;
+}
+
+//Mutators
+void C_AnchorTag::setCls(wstring inCls) {
+ mCls = inCls;
+}
+void C_AnchorTag::setHref(wstring inHref) {
+ mHref = inHref;
+}
+
+//Other
+wstring C_AnchorTag::toString() {
+
+
+ wstring retStr = L"<a";
+
+ retStr += makeElement(L"id", mId);
+ retStr += makeLangElements();
+ retStr += makeElement(L"class", mCls);
+ retStr += makeRequiredElement(L"href", mHref);
+
+ retStr += L">";
+ retStr += mText;
+ retStr += L"</a>\n";
+
+ return retStr;
+}
+
+void C_AnchorTag::privateClone(C_CMMLTag* outTag) {
+ C_TextFieldTag::privateClone(outTag);
+ C_AnchorTag* locTag = reinterpret_cast<C_AnchorTag*>(outTag);
+ locTag->mCls = mCls;
+ locTag->mHref = mHref;
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_AnchorTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_AnchorTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_AnchorTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_AnchorTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,45 +30,45 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#pragma once
-
-//STL Include Files
-#include <string>
-using namespace std;
-
-//Local Include Files
-#include "C_TextFieldTag.h"
-
-class LIBCMMLTAGS_API C_AnchorTag
- //Derived Classes
- : public C_TextFieldTag
-{
-public:
- //Constructors
- C_AnchorTag(void);
- virtual ~C_AnchorTag(void);
-
- //Accessors
- wstring cls();
- wstring href();
-
- //Mutators
- void setCls(wstring inCls);
- void setHref(wstring inHref);
-
- //Other
- virtual wstring toString();
- C_AnchorTag* clone();
- virtual C_CMMLTag* genericClone();
-
-protected:
- //Property Data
- wstring mCls;
- wstring mHref;
-
- //Protected Helper Methods
- virtual void privateClone(C_CMMLTag* outTag);
-
-};
+*/
+
+#pragma once
+
+//STL Include Files
+#include <string>
+using namespace std;
+
+//Local Include Files
+#include "C_TextFieldTag.h"
+
+class LIBCMMLTAGS_API C_AnchorTag
+ //Derived Classes
+ : public C_TextFieldTag
+{
+public:
+ //Constructors
+ C_AnchorTag(void);
+ virtual ~C_AnchorTag(void);
+
+ //Accessors
+ wstring cls();
+ wstring href();
+
+ //Mutators
+ void setCls(wstring inCls);
+ void setHref(wstring inHref);
+
+ //Other
+ virtual wstring toString();
+ C_AnchorTag* clone();
+ virtual C_CMMLTag* genericClone();
+
+protected:
+ //Property Data
+ wstring mCls;
+ wstring mHref;
+
+ //Protected Helper Methods
+ virtual void privateClone(C_CMMLTag* outTag);
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_AnchorTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_BaseTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_BaseTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_BaseTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,55 +30,55 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "StdAfx.h"
-#include ".\c_basetag.h"
-
-C_BaseTag::C_BaseTag(void)
-{
- mTagType = C_CMMLTag::eTagType::BASE;
- mHref = L"";
-}
-
-C_BaseTag::~C_BaseTag(void)
-{
-}
-
-//Accessors
-wstring C_BaseTag::href() {
- return mHref;
-}
-
-//Mutators
-void C_BaseTag::setHref(wstring inHref) {
- mHref = inHref;
-}
-
-//Other
-C_BaseTag* C_BaseTag::clone() {
- C_BaseTag* retTag = new C_BaseTag;
- privateClone(retTag);
- return retTag;
-}
-
-C_CMMLTag* C_BaseTag::genericClone() {
- return clone();
-}
-wstring C_BaseTag::toString() {
- //FIX ::: Make this do something
- wstring retStr = L"<base";
-
- if (mId.size() != 0) {
- retStr += makeElement(L"id", mId);
- }
-
- retStr += makeElement(L"href", mHref);
- retStr += L"/>\n";
- return retStr;
-}
-
-void C_BaseTag::privateClone(C_CMMLTag* outTag) {
- C_CMMLTag::privateClone(outTag);
- ((C_BaseTag*)outTag)->mHref = mHref;
+*/
+
+#include "StdAfx.h"
+#include ".\c_basetag.h"
+
+C_BaseTag::C_BaseTag(void)
+{
+ mTagType = C_CMMLTag::eTagType::BASE;
+ mHref = L"";
+}
+
+C_BaseTag::~C_BaseTag(void)
+{
+}
+
+//Accessors
+wstring C_BaseTag::href() {
+ return mHref;
+}
+
+//Mutators
+void C_BaseTag::setHref(wstring inHref) {
+ mHref = inHref;
+}
+
+//Other
+C_BaseTag* C_BaseTag::clone() {
+ C_BaseTag* retTag = new C_BaseTag;
+ privateClone(retTag);
+ return retTag;
+}
+
+C_CMMLTag* C_BaseTag::genericClone() {
+ return clone();
+}
+wstring C_BaseTag::toString() {
+ //FIX ::: Make this do something
+ wstring retStr = L"<base";
+
+ if (mId.size() != 0) {
+ retStr += makeElement(L"id", mId);
+ }
+
+ retStr += makeElement(L"href", mHref);
+ retStr += L"/>\n";
+ return retStr;
+}
+
+void C_BaseTag::privateClone(C_CMMLTag* outTag) {
+ C_CMMLTag::privateClone(outTag);
+ ((C_BaseTag*)outTag)->mHref = mHref;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_BaseTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_BaseTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_BaseTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_BaseTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,41 +30,41 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#pragma once
-//STL Include Files
-#include <string>
-using namespace std;
-
-//Local Include Files
-#include "C_CMMLTag.h"
-
-class LIBCMMLTAGS_API C_BaseTag
- //Derived Classes
- : public C_CMMLTag
-{
-public:
- //Constructors
- C_BaseTag(void);
- virtual ~C_BaseTag(void);
-
- //Accessors
- wstring href();
-
- //Mutators
- void setHref(wstring inHref);
-
- //Other
- virtual wstring toString();
- C_BaseTag* clone();
- virtual C_CMMLTag* genericClone();
-
-protected:
- //Property Data
- wstring mHref;
-
- //Protected Helper Methods
- virtual void privateClone(C_CMMLTag* outTag);
-
-};
+*/
+
+#pragma once
+//STL Include Files
+#include <string>
+using namespace std;
+
+//Local Include Files
+#include "C_CMMLTag.h"
+
+class LIBCMMLTAGS_API C_BaseTag
+ //Derived Classes
+ : public C_CMMLTag
+{
+public:
+ //Constructors
+ C_BaseTag(void);
+ virtual ~C_BaseTag(void);
+
+ //Accessors
+ wstring href();
+
+ //Mutators
+ void setHref(wstring inHref);
+
+ //Other
+ virtual wstring toString();
+ C_BaseTag* clone();
+ virtual C_CMMLTag* genericClone();
+
+protected:
+ //Property Data
+ wstring mHref;
+
+ //Protected Helper Methods
+ virtual void privateClone(C_CMMLTag* outTag);
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_BaseTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLDoc.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLDoc.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLDoc.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,35 +30,35 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\c_cmmldoc.h"
-
-C_CMMLDoc::C_CMMLDoc(void)
-{
- mPreamble = new C_CMMLPreamble;
- mRoot = new C_CMMLRootTag;
-
-}
-
-C_CMMLDoc::~C_CMMLDoc(void)
-{
- delete mPreamble;
- delete mRoot;
-}
-
-C_CMMLPreamble* C_CMMLDoc::preamble() {
- return mPreamble;
-}
-C_CMMLRootTag* C_CMMLDoc::root() {
- return mRoot;
-}
-void C_CMMLDoc::setRoot(C_CMMLRootTag* inRootTag) {
- delete mRoot;
- mRoot = inRootTag;
-}
-wstring C_CMMLDoc::toString() {
- wstring retStr = mPreamble->toString();
- retStr += mRoot->toString();
- return retStr;
-}
+*/
+#include "StdAfx.h"
+#include ".\c_cmmldoc.h"
+
+C_CMMLDoc::C_CMMLDoc(void)
+{
+ mPreamble = new C_CMMLPreamble;
+ mRoot = new C_CMMLRootTag;
+
+}
+
+C_CMMLDoc::~C_CMMLDoc(void)
+{
+ delete mPreamble;
+ delete mRoot;
+}
+
+C_CMMLPreamble* C_CMMLDoc::preamble() {
+ return mPreamble;
+}
+C_CMMLRootTag* C_CMMLDoc::root() {
+ return mRoot;
+}
+void C_CMMLDoc::setRoot(C_CMMLRootTag* inRootTag) {
+ delete mRoot;
+ mRoot = inRootTag;
+}
+wstring C_CMMLDoc::toString() {
+ wstring retStr = mPreamble->toString();
+ retStr += mRoot->toString();
+ return retStr;
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLDoc.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLDoc.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLDoc.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLDoc.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,135 +30,135 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#pragma once
-//These are the original callbacks... need to provide an interface that does not
-//include the C structs and hopefully no void*
-//
-//typedef int (*CMMLReadStreamCB) (CMML *cmml, const CMML_Stream *stream, void * user_data);
-//typedef int (*CMMLReadHeadCB) (CMML *cmml, const CMML_Head *head, void * user_data);
-//typedef int (*CMMLReadClipCB) (CMML *cmml, const CMML_Clip *clip, void * user_data);
-
-//STL Include Files
-#include <string>
-using namespace std;
-
-//Local Include Files
-#include "C_CMMLPreamble.h"
-#include "C_CMMLRootTag.h"
-//#include "C_CMMLError.h"
-
-
-//typedef int (*CMMLReadStreamCB) (const C_StreamTag *inStream, void * user_data);
-//typedef int (*CMMLReadHeadCB) (const C_HeadTag *inHead, void * user_data);
-//typedef int (*CMMLReadClipCB) (const C_ClipTag *inClip, void * user_data);
-
-
-class LIBCMMLTAGS_API C_CMMLDoc
-{
-public:
- //Constructors
- C_CMMLDoc(void);
- virtual ~C_CMMLDoc(void);
-
- C_CMMLPreamble* preamble();
- C_CMMLRootTag* root();
-
- void setRoot(C_CMMLRootTag* inRootTag);
-
- virtual wstring toString();
- C_CMMLDoc* clone();
-
-
- //Opening files
- //bool open(wstring inFilename);
- //bool open(wstring inFilename, CMMLReadStreamCB inStreamCB, CMMLReadHeadCB inHeadCB, CMMLReadClipCB inClipCB);
- //ISSUE ::: Void pointer on interface...
- //bool open(wstring inFilename, CMMLReadStreamCB inStreamCB, CMMLReadHeadCB inHeadCB, CMMLReadClipCB inClipCB, void* inUserData);
- //ISSUE ::: Find a way to allow the passing in of a fstream
-
-
-
- //Close the file. Releases resources but leaves the object capable of handling
- //another file.
- //void close();
-
- //Load all the callbacks if they were unknown at open
- // or if they have to be changed mid parse.
- //bool setCallbacks(CMMLReadStreamCB inStreamCB, CMMLReadHeadCB inHeadCB, CMMLReadClipCB inClipCB, void* inUserData);
-
- //Ask the underlying library to read a certain number of bytes
- //void read(unsigned long inNumBytes);
-
- //The the underlying library to read to the end of the file.
- // This is useful to do initially to read the entire file
- //void readToEnd();
-
- //Resets the filestream, removes all stored tag data, but DOES NOT
- // remove the file stream or the callbacks
- //void resetFile();
-
- //Removes the associated file, removes all stored tag data, resets all the
- // callbacks. This brings it back to it's initial state as it was when
- // constructed with no parameters before it was attached to any files or callbacks.
-
- //Currently just clear all tags by deleting them
- //void clearAll();
-
- //Accessors
- //Is the file ready to go. ie has a file been attached and opened.
- //bool isStreamReady();
-
- //NO READ OPERATIONS CAN TAKE PLACE WHILE EITHER OF THE TWO FOLLOWING REPORT TRUE
-
- //Is it at the end of the file
- //bool isEOF();
-
- //Is there an error reading the stream.
- //bool isStreamError();
-
- //Returns a pointer to the last CMML error. Or NULL if no error.
- //These are parsing errors. They ARE NOT the same as the stream errors.
- //They represent badly formatted documents not errors in reading the data.
- //You shouldn't call this unless CMMLError is true.
- //C_CMMLError* lastCMMLError();
-
- //Returns if there is a CMML error pending.
- //bool isCMMLError();
-
- //ALL THE FOLLOWING WILL RETURN NULL IF THEY DON"T EXIST OR HAVE NOT BEEN
- // READ YET.
-
- //Returns a pointer to the list of clips already read. Should never return NULL
- // As each new clip is read it is appended to the end of the clip list.
- // The clip list object can tell you about how many clips have been read
- // and you can access them by number.
- //ISSUE ::: Should they also be able to be retrieved by id ??
- //C_ClipTagList* clipList();
-
- //Returns a pointer to the most recently read clip or if the entire file is
- // read the last clip in the file
- //C_ClipTag* lastClip();
-
- //Returns a pointer to the second last clip that waas read or if the entire file
- // has been read, the previous clip in the file.
- //C_ClipTag* previousClip();
-
-
-
-
-protected:
- C_CMMLPreamble* mPreamble;
- C_CMMLRootTag* mRoot;
-
-
- //bool mIsStreamReady;
- //bool mIsEOF;
- //bool mIsStreamError;
-
-
-
- //C_CMMLError* mLastError;
-
-};
+*/
+
+#pragma once
+//These are the original callbacks... need to provide an interface that does not
+//include the C structs and hopefully no void*
+//
+//typedef int (*CMMLReadStreamCB) (CMML *cmml, const CMML_Stream *stream, void * user_data);
+//typedef int (*CMMLReadHeadCB) (CMML *cmml, const CMML_Head *head, void * user_data);
+//typedef int (*CMMLReadClipCB) (CMML *cmml, const CMML_Clip *clip, void * user_data);
+
+//STL Include Files
+#include <string>
+using namespace std;
+
+//Local Include Files
+#include "C_CMMLPreamble.h"
+#include "C_CMMLRootTag.h"
+//#include "C_CMMLError.h"
+
+
+//typedef int (*CMMLReadStreamCB) (const C_StreamTag *inStream, void * user_data);
+//typedef int (*CMMLReadHeadCB) (const C_HeadTag *inHead, void * user_data);
+//typedef int (*CMMLReadClipCB) (const C_ClipTag *inClip, void * user_data);
+
+
+class LIBCMMLTAGS_API C_CMMLDoc
+{
+public:
+ //Constructors
+ C_CMMLDoc(void);
+ virtual ~C_CMMLDoc(void);
+
+ C_CMMLPreamble* preamble();
+ C_CMMLRootTag* root();
+
+ void setRoot(C_CMMLRootTag* inRootTag);
+
+ virtual wstring toString();
+ C_CMMLDoc* clone();
+
+
+ //Opening files
+ //bool open(wstring inFilename);
+ //bool open(wstring inFilename, CMMLReadStreamCB inStreamCB, CMMLReadHeadCB inHeadCB, CMMLReadClipCB inClipCB);
+ //ISSUE ::: Void pointer on interface...
+ //bool open(wstring inFilename, CMMLReadStreamCB inStreamCB, CMMLReadHeadCB inHeadCB, CMMLReadClipCB inClipCB, void* inUserData);
+ //ISSUE ::: Find a way to allow the passing in of a fstream
+
+
+
+ //Close the file. Releases resources but leaves the object capable of handling
+ //another file.
+ //void close();
+
+ //Load all the callbacks if they were unknown at open
+ // or if they have to be changed mid parse.
+ //bool setCallbacks(CMMLReadStreamCB inStreamCB, CMMLReadHeadCB inHeadCB, CMMLReadClipCB inClipCB, void* inUserData);
+
+ //Ask the underlying library to read a certain number of bytes
+ //void read(unsigned long inNumBytes);
+
+ //The the underlying library to read to the end of the file.
+ // This is useful to do initially to read the entire file
+ //void readToEnd();
+
+ //Resets the filestream, removes all stored tag data, but DOES NOT
+ // remove the file stream or the callbacks
+ //void resetFile();
+
+ //Removes the associated file, removes all stored tag data, resets all the
+ // callbacks. This brings it back to it's initial state as it was when
+ // constructed with no parameters before it was attached to any files or callbacks.
+
+ //Currently just clear all tags by deleting them
+ //void clearAll();
+
+ //Accessors
+ //Is the file ready to go. ie has a file been attached and opened.
+ //bool isStreamReady();
+
+ //NO READ OPERATIONS CAN TAKE PLACE WHILE EITHER OF THE TWO FOLLOWING REPORT TRUE
+
+ //Is it at the end of the file
+ //bool isEOF();
+
+ //Is there an error reading the stream.
+ //bool isStreamError();
+
+ //Returns a pointer to the last CMML error. Or NULL if no error.
+ //These are parsing errors. They ARE NOT the same as the stream errors.
+ //They represent badly formatted documents not errors in reading the data.
+ //You shouldn't call this unless CMMLError is true.
+ //C_CMMLError* lastCMMLError();
+
+ //Returns if there is a CMML error pending.
+ //bool isCMMLError();
+
+ //ALL THE FOLLOWING WILL RETURN NULL IF THEY DON"T EXIST OR HAVE NOT BEEN
+ // READ YET.
+
+ //Returns a pointer to the list of clips already read. Should never return NULL
+ // As each new clip is read it is appended to the end of the clip list.
+ // The clip list object can tell you about how many clips have been read
+ // and you can access them by number.
+ //ISSUE ::: Should they also be able to be retrieved by id ??
+ //C_ClipTagList* clipList();
+
+ //Returns a pointer to the most recently read clip or if the entire file is
+ // read the last clip in the file
+ //C_ClipTag* lastClip();
+
+ //Returns a pointer to the second last clip that waas read or if the entire file
+ // has been read, the previous clip in the file.
+ //C_ClipTag* previousClip();
+
+
+
+
+protected:
+ C_CMMLPreamble* mPreamble;
+ C_CMMLRootTag* mRoot;
+
+
+ //bool mIsStreamReady;
+ //bool mIsEOF;
+ //bool mIsStreamError;
+
+
+
+ //C_CMMLError* mLastError;
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLDoc.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLError.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLError.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLError.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,29 +30,29 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\c_cmmlerror.h"
-
-C_CMMLError::C_CMMLError(unsigned long inLine, unsigned long inCol, unsigned long inErrorCode)
-{
- mLine = inLine;
- mCol = inCol;
- mErrorCode = inErrorCode;
-}
-
-C_CMMLError::~C_CMMLError(void)
-{
-}
-
-
-//Accessors
-unsigned long C_CMMLError::line() {
- return mLine;
-}
-unsigned long C_CMMLError::col() {
- return mCol;
-}
-unsigned long C_CMMLError::errorCode() {
- return mErrorCode;
+*/
+#include "StdAfx.h"
+#include ".\c_cmmlerror.h"
+
+C_CMMLError::C_CMMLError(unsigned long inLine, unsigned long inCol, unsigned long inErrorCode)
+{
+ mLine = inLine;
+ mCol = inCol;
+ mErrorCode = inErrorCode;
+}
+
+C_CMMLError::~C_CMMLError(void)
+{
+}
+
+
+//Accessors
+unsigned long C_CMMLError::line() {
+ return mLine;
+}
+unsigned long C_CMMLError::col() {
+ return mCol;
+}
+unsigned long C_CMMLError::errorCode() {
+ return mErrorCode;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLError.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLError.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLError.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLError.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,5 +1,5 @@
-
-
+
+
/*
Copyright (C) 2003, 2004 Zentaro Kavanagh
@@ -32,26 +32,26 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#pragma once
-
-class LIBCMMLTAGS_API C_CMMLError
-{
-public:
- //Constructors
- C_CMMLError(unsigned long inLine, unsigned long inCol, unsigned long inErrorCode);
- ~C_CMMLError(void);
-
- //Accessors
- unsigned long line();
- unsigned long col();
- unsigned long errorCode();
-
- //No Mutators
-
-protected:
- unsigned long mErrorCode;
- unsigned long mLine;
- unsigned long mCol;
-};
+*/
+
+#pragma once
+
+class LIBCMMLTAGS_API C_CMMLError
+{
+public:
+ //Constructors
+ C_CMMLError(unsigned long inLine, unsigned long inCol, unsigned long inErrorCode);
+ ~C_CMMLError(void);
+
+ //Accessors
+ unsigned long line();
+ unsigned long col();
+ unsigned long errorCode();
+
+ //No Mutators
+
+protected:
+ unsigned long mErrorCode;
+ unsigned long mLine;
+ unsigned long mCol;
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLError.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLPreamble.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLPreamble.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLPreamble.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,66 +30,66 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\c_cmmlpreamble.h"
-
-C_CMMLPreamble::C_CMMLPreamble(void)
-{
- mXmlVersion = L"1.0";
- mXmlEncoding = L"UTF-8";
- mXmlStandAlone = L"yes";
-
-}
-
-C_CMMLPreamble::~C_CMMLPreamble(void)
-{
-}
-
-//Accessors
-wstring C_CMMLPreamble::xmlVersion() {
- return mXmlVersion;
-}
-wstring C_CMMLPreamble::xmlEncoding() {
- return mXmlEncoding;
-}
-wstring C_CMMLPreamble::xmlStandAlone() {
- return mXmlStandAlone;
-}
-
-
-//Mutators
-void C_CMMLPreamble::setXmlVersion(wstring inVersion) {
-
-}
-void C_CMMLPreamble::setXmlEncoding(wstring inEncoding) {
-
-}
-void C_CMMLPreamble::setXmlStandAlone(wstring inStandAlone) {
-}
-
-C_CMMLPreamble* C_CMMLPreamble::clone() {
- C_CMMLPreamble* retPreamble = new C_CMMLPreamble();
- retPreamble->mXmlEncoding = mXmlEncoding;
- retPreamble->mXmlStandAlone = mXmlStandAlone;
- retPreamble->mXmlVersion = mXmlVersion;
- return retPreamble;
-}
-
-//Others
-wstring C_CMMLPreamble::toString() {
- wstring retStr;
- retStr = L"<?xml version=\"";
- retStr += mXmlVersion;
- retStr += L"\" encoding=\"";
- retStr += mXmlEncoding;
- retStr += L"\" standalone=\"";
- retStr += mXmlStandAlone;
- retStr += L"\"?>\n";
-
- //TO DO::: Make this more generalised properly
- retStr += L"<!DOCTYPE cmml SYSTEM \"cmml.dtd\">\n";
-
- return retStr;
-
-}
+*/
+#include "StdAfx.h"
+#include ".\c_cmmlpreamble.h"
+
+C_CMMLPreamble::C_CMMLPreamble(void)
+{
+ mXmlVersion = L"1.0";
+ mXmlEncoding = L"UTF-8";
+ mXmlStandAlone = L"yes";
+
+}
+
+C_CMMLPreamble::~C_CMMLPreamble(void)
+{
+}
+
+//Accessors
+wstring C_CMMLPreamble::xmlVersion() {
+ return mXmlVersion;
+}
+wstring C_CMMLPreamble::xmlEncoding() {
+ return mXmlEncoding;
+}
+wstring C_CMMLPreamble::xmlStandAlone() {
+ return mXmlStandAlone;
+}
+
+
+//Mutators
+void C_CMMLPreamble::setXmlVersion(wstring inVersion) {
+
+}
+void C_CMMLPreamble::setXmlEncoding(wstring inEncoding) {
+
+}
+void C_CMMLPreamble::setXmlStandAlone(wstring inStandAlone) {
+}
+
+C_CMMLPreamble* C_CMMLPreamble::clone() {
+ C_CMMLPreamble* retPreamble = new C_CMMLPreamble();
+ retPreamble->mXmlEncoding = mXmlEncoding;
+ retPreamble->mXmlStandAlone = mXmlStandAlone;
+ retPreamble->mXmlVersion = mXmlVersion;
+ return retPreamble;
+}
+
+//Others
+wstring C_CMMLPreamble::toString() {
+ wstring retStr;
+ retStr = L"<?xml version=\"";
+ retStr += mXmlVersion;
+ retStr += L"\" encoding=\"";
+ retStr += mXmlEncoding;
+ retStr += L"\" standalone=\"";
+ retStr += mXmlStandAlone;
+ retStr += L"\"?>\n";
+
+ //TO DO::: Make this more generalised properly
+ retStr += L"<!DOCTYPE cmml SYSTEM \"cmml.dtd\">\n";
+
+ return retStr;
+
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLPreamble.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLPreamble.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLPreamble.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLPreamble.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,53 +30,53 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-//STL Include Files
-#include <string>
-using namespace std;
-
-class LIBCMMLTAGS_API C_CMMLPreamble
-{
-public:
- //Constructors
- C_CMMLPreamble(void);
- virtual ~C_CMMLPreamble(void);
-
-
-
- //Accessors
- wstring xmlVersion();
- wstring xmlEncoding();
- wstring xmlStandAlone();
-
- //Mutators
- void setXmlVersion(wstring inVersion);
- void setXmlEncoding(wstring inEncoding);
- void setXmlStandAlone(wstring inStandAlone);
-
- //Others
- virtual wstring toString();
- C_CMMLPreamble* clone();
-
-
-protected:
- //Original Structure
- //
- //typedef struct {
- // char *xml_version; /**< version attribute of xml proc instr */
- // char *xml_encoding; /**< encoding attribute of xml proc instr */
- // int xml_standalone; /**< standalone attribute of xml proc instr */
- // int doctype_declared; /**< was doctype declared */
- // char *cmml_lang; /**< lang attribute of cmml tag */
- // char *cmml_dir; /**< dir attribute of cmml tag */
- // char *cmml_id; /**< id attribute of cmml tag */
- // char *cmml_xmlns; /**< xmlns attribute of cmml tag */
- //} CMML_Preamble;
-
- //Property Data
- wstring mXmlVersion;
- wstring mXmlEncoding;
- wstring mXmlStandAlone;
-};
+*/
+#pragma once
+
+//STL Include Files
+#include <string>
+using namespace std;
+
+class LIBCMMLTAGS_API C_CMMLPreamble
+{
+public:
+ //Constructors
+ C_CMMLPreamble(void);
+ virtual ~C_CMMLPreamble(void);
+
+
+
+ //Accessors
+ wstring xmlVersion();
+ wstring xmlEncoding();
+ wstring xmlStandAlone();
+
+ //Mutators
+ void setXmlVersion(wstring inVersion);
+ void setXmlEncoding(wstring inEncoding);
+ void setXmlStandAlone(wstring inStandAlone);
+
+ //Others
+ virtual wstring toString();
+ C_CMMLPreamble* clone();
+
+
+protected:
+ //Original Structure
+ //
+ //typedef struct {
+ // char *xml_version; /**< version attribute of xml proc instr */
+ // char *xml_encoding; /**< encoding attribute of xml proc instr */
+ // int xml_standalone; /**< standalone attribute of xml proc instr */
+ // int doctype_declared; /**< was doctype declared */
+ // char *cmml_lang; /**< lang attribute of cmml tag */
+ // char *cmml_dir; /**< dir attribute of cmml tag */
+ // char *cmml_id; /**< id attribute of cmml tag */
+ // char *cmml_xmlns; /**< xmlns attribute of cmml tag */
+ //} CMML_Preamble;
+
+ //Property Data
+ wstring mXmlVersion;
+ wstring mXmlEncoding;
+ wstring mXmlStandAlone;
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLPreamble.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLRootTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLRootTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLRootTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,91 +30,91 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\c_cmmlroottag.h"
-
-C_CMMLRootTag::C_CMMLRootTag(void)
-{
- mStream = NULL;
- mHead = new C_HeadTag;
- mClipList = new C_ClipTagList;
-}
-
-C_CMMLRootTag::~C_CMMLRootTag(void)
-{
-
- delete mStream;
- delete mHead;
- delete mClipList;
-}
-
-
-C_StreamTag* C_CMMLRootTag::stream() {
- return mStream;
-}
-C_HeadTag* C_CMMLRootTag::head() {
- return mHead;
-}
-C_ClipTagList* C_CMMLRootTag::clipList() {
- return mClipList;
-}
-
-void C_CMMLRootTag::setClipList(C_ClipTagList* inClipList) {
- delete mClipList;
- mClipList = inClipList;
-}
-
-void C_CMMLRootTag::setStream(C_StreamTag* inStreamTag) {
- delete mStream;
- mStream = inStreamTag;
-
-}
-void C_CMMLRootTag::setHead(C_HeadTag* inHeadTag) {
- //Delete the existing one
- delete mHead;
- mHead = inHeadTag;
-}
-
-void C_CMMLRootTag::privateClone(C_CMMLTag* outTag) {
- C_HumReadCMMLTag::privateClone(outTag);
- C_CMMLRootTag* locTag = reinterpret_cast<C_CMMLRootTag*>(outTag);
- if (mStream != NULL) {
- locTag->setStream(mStream->clone());
- }
- locTag->setHead(mHead->clone());
- locTag->setClipList(mClipList->clone());
-
-
-}
-C_CMMLTag* C_CMMLRootTag::genericClone() {
- return clone();
-}
-
-C_CMMLRootTag* C_CMMLRootTag::clone() {
- C_CMMLRootTag* retTag = new C_CMMLRootTag;
- privateClone(retTag);
- return retTag;
-
-}
-
-wstring C_CMMLRootTag::toString() {
- wstring retStr;
- retStr = L"<cmml";
-
- retStr += makeElement(L"id", mId);
- retStr += makeLangElements();
- //TODO::: This shouldn't be hardcoded here !
- retStr += makeElement(L"xmlns", L"http://www.annodex.net/cmml");
-
-
- retStr += L">\n";
- if (mStream != NULL) {
- retStr += mStream->toString();
- }
-
- retStr += mHead->toString();
- retStr += mClipList->toString();
- retStr += L"</cmml>\n";
- return retStr;
-}
+*/
+#include "StdAfx.h"
+#include ".\c_cmmlroottag.h"
+
+C_CMMLRootTag::C_CMMLRootTag(void)
+{
+ mStream = NULL;
+ mHead = new C_HeadTag;
+ mClipList = new C_ClipTagList;
+}
+
+C_CMMLRootTag::~C_CMMLRootTag(void)
+{
+
+ delete mStream;
+ delete mHead;
+ delete mClipList;
+}
+
+
+C_StreamTag* C_CMMLRootTag::stream() {
+ return mStream;
+}
+C_HeadTag* C_CMMLRootTag::head() {
+ return mHead;
+}
+C_ClipTagList* C_CMMLRootTag::clipList() {
+ return mClipList;
+}
+
+void C_CMMLRootTag::setClipList(C_ClipTagList* inClipList) {
+ delete mClipList;
+ mClipList = inClipList;
+}
+
+void C_CMMLRootTag::setStream(C_StreamTag* inStreamTag) {
+ delete mStream;
+ mStream = inStreamTag;
+
+}
+void C_CMMLRootTag::setHead(C_HeadTag* inHeadTag) {
+ //Delete the existing one
+ delete mHead;
+ mHead = inHeadTag;
+}
+
+void C_CMMLRootTag::privateClone(C_CMMLTag* outTag) {
+ C_HumReadCMMLTag::privateClone(outTag);
+ C_CMMLRootTag* locTag = reinterpret_cast<C_CMMLRootTag*>(outTag);
+ if (mStream != NULL) {
+ locTag->setStream(mStream->clone());
+ }
+ locTag->setHead(mHead->clone());
+ locTag->setClipList(mClipList->clone());
+
+
+}
+C_CMMLTag* C_CMMLRootTag::genericClone() {
+ return clone();
+}
+
+C_CMMLRootTag* C_CMMLRootTag::clone() {
+ C_CMMLRootTag* retTag = new C_CMMLRootTag;
+ privateClone(retTag);
+ return retTag;
+
+}
+
+wstring C_CMMLRootTag::toString() {
+ wstring retStr;
+ retStr = L"<cmml";
+
+ retStr += makeElement(L"id", mId);
+ retStr += makeLangElements();
+ //TODO::: This shouldn't be hardcoded here !
+ retStr += makeElement(L"xmlns", L"http://www.annodex.net/cmml");
+
+
+ retStr += L">\n";
+ if (mStream != NULL) {
+ retStr += mStream->toString();
+ }
+
+ retStr += mHead->toString();
+ retStr += mClipList->toString();
+ retStr += L"</cmml>\n";
+ return retStr;
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLRootTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLRootTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLRootTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLRootTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,53 +30,53 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-//STL Include Files
-#include <string>
-using namespace std;
-
-//Local Include Files
-#include "C_CMMLTag.h"
-#include "C_HumReadCMMLTag.h"
-#include "C_StreamTag.h"
-#include "C_HeadTag.h"
-#include "C_ClipTagList.h"
-
-class LIBCMMLTAGS_API C_CMMLRootTag :
- //Derived Classes
- public C_HumReadCMMLTag
-{
-public:
- //Constructors
- C_CMMLRootTag(void);
- virtual ~C_CMMLRootTag(void);
-
- //Accessors
-
- C_StreamTag* stream();
- C_HeadTag* head();
- C_ClipTagList* clipList();
-
- //Mutators
- void setStream(C_StreamTag* inStreamTag);
- void setHead(C_HeadTag* inHeadTag);
- void setClipList(C_ClipTagList* inClipList);
-
- //Other
- virtual wstring toString();
- virtual C_CMMLTag* genericClone();
- C_CMMLRootTag* clone();
-
-protected:
- //Property Data
-
- C_StreamTag* mStream;
- C_HeadTag* mHead;
- C_ClipTagList* mClipList;
-
- //Protected Helper Methods
- virtual void privateClone(C_CMMLTag* outTag);
-
-};
+*/
+#pragma once
+
+//STL Include Files
+#include <string>
+using namespace std;
+
+//Local Include Files
+#include "C_CMMLTag.h"
+#include "C_HumReadCMMLTag.h"
+#include "C_StreamTag.h"
+#include "C_HeadTag.h"
+#include "C_ClipTagList.h"
+
+class LIBCMMLTAGS_API C_CMMLRootTag :
+ //Derived Classes
+ public C_HumReadCMMLTag
+{
+public:
+ //Constructors
+ C_CMMLRootTag(void);
+ virtual ~C_CMMLRootTag(void);
+
+ //Accessors
+
+ C_StreamTag* stream();
+ C_HeadTag* head();
+ C_ClipTagList* clipList();
+
+ //Mutators
+ void setStream(C_StreamTag* inStreamTag);
+ void setHead(C_HeadTag* inHeadTag);
+ void setClipList(C_ClipTagList* inClipList);
+
+ //Other
+ virtual wstring toString();
+ virtual C_CMMLTag* genericClone();
+ C_CMMLRootTag* clone();
+
+protected:
+ //Property Data
+
+ C_StreamTag* mStream;
+ C_HeadTag* mHead;
+ C_ClipTagList* mClipList;
+
+ //Protected Helper Methods
+ virtual void privateClone(C_CMMLTag* outTag);
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLRootTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,48 +30,48 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\c_cmmltag.h"
-
-C_CMMLTag::C_CMMLTag(void)
-{
-}
-
-C_CMMLTag::~C_CMMLTag(void)
-{
-}
-
-//Accessors
-wstring C_CMMLTag::id() {
- return mId;
-}
-
-//Mutators
-void C_CMMLTag::setId(wstring inId) {
- mId = inId;
-}
-
-//Protected Helper Methods
-wstring C_CMMLTag::makeElement(wstring inElemName, wstring inElemContent) {
- if (inElemContent != L"") {
- wstring retStr;
- retStr = L" " + inElemName + L"=\"" + inElemContent + L"\"";
- return retStr;
- } else {
- return L"";
- }
-}
-
-wstring C_CMMLTag::makeRequiredElement(wstring inElemName, wstring inElemContent) {
- wstring retStr;
- retStr = L" " + inElemName + L"=\"" + inElemContent + L"\"";
- return retStr;
-}
-
-
-void C_CMMLTag::privateClone(C_CMMLTag* outTag) {
- outTag->setId(mId);
-}
-
-
+*/
+#include "StdAfx.h"
+#include ".\c_cmmltag.h"
+
+C_CMMLTag::C_CMMLTag(void)
+{
+}
+
+C_CMMLTag::~C_CMMLTag(void)
+{
+}
+
+//Accessors
+wstring C_CMMLTag::id() {
+ return mId;
+}
+
+//Mutators
+void C_CMMLTag::setId(wstring inId) {
+ mId = inId;
+}
+
+//Protected Helper Methods
+wstring C_CMMLTag::makeElement(wstring inElemName, wstring inElemContent) {
+ if (inElemContent != L"") {
+ wstring retStr;
+ retStr = L" " + inElemName + L"=\"" + inElemContent + L"\"";
+ return retStr;
+ } else {
+ return L"";
+ }
+}
+
+wstring C_CMMLTag::makeRequiredElement(wstring inElemName, wstring inElemContent) {
+ wstring retStr;
+ retStr = L" " + inElemName + L"=\"" + inElemContent + L"\"";
+ return retStr;
+}
+
+
+void C_CMMLTag::privateClone(C_CMMLTag* outTag) {
+ outTag->setId(mId);
+}
+
+
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,62 +30,62 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-//STL Include Files
-#include <string>
-using namespace std;
-
-//DESCRIPTION:
-// This is the base class for all tags. This is an abstract class.
-
-//PURE VIRTUAL FUNCTIONS
-// wstring toString(); //Turn the tag to a string
-
-class LIBCMMLTAGS_API C_CMMLTag
-{
-public:
- //Constructors
- C_CMMLTag(void);
- virtual ~C_CMMLTag(void);
-
- virtual C_CMMLTag* genericClone() = 0;
-
-
- //Enumerations
- enum eTagType {
- UNKNOWN,
- IMPORT,
- STREAM,
- META,
- HEAD,
- TITLE,
- BASE,
- CLIP,
- ANCHOR,
- IMAGE,
- DESC,
- PARAM,
- BAD_TAG = 1000
- };
-
- //Accessors
- wstring id();
-
- //Mutators
- void setId(wstring inId);
-
- //Other
- virtual wstring toString() = 0;
-protected:
- //Property Data
- wstring mId;
- eTagType mTagType;
-
- //Protected Helper Methods
- virtual void privateClone(C_CMMLTag* outTag);
- wstring makeElement(wstring inElemName, wstring inElemContent);
- wstring C_CMMLTag::makeRequiredElement(wstring inElemName, wstring inElemContent);
-
-};
+*/
+#pragma once
+
+//STL Include Files
+#include <string>
+using namespace std;
+
+//DESCRIPTION:
+// This is the base class for all tags. This is an abstract class.
+
+//PURE VIRTUAL FUNCTIONS
+// wstring toString(); //Turn the tag to a string
+
+class LIBCMMLTAGS_API C_CMMLTag
+{
+public:
+ //Constructors
+ C_CMMLTag(void);
+ virtual ~C_CMMLTag(void);
+
+ virtual C_CMMLTag* genericClone() = 0;
+
+
+ //Enumerations
+ enum eTagType {
+ UNKNOWN,
+ IMPORT,
+ STREAM,
+ META,
+ HEAD,
+ TITLE,
+ BASE,
+ CLIP,
+ ANCHOR,
+ IMAGE,
+ DESC,
+ PARAM,
+ BAD_TAG = 1000
+ };
+
+ //Accessors
+ wstring id();
+
+ //Mutators
+ void setId(wstring inId);
+
+ //Other
+ virtual wstring toString() = 0;
+protected:
+ //Property Data
+ wstring mId;
+ eTagType mTagType;
+
+ //Protected Helper Methods
+ virtual void privateClone(C_CMMLTag* outTag);
+ wstring makeElement(wstring inElemName, wstring inElemContent);
+ wstring C_CMMLTag::makeRequiredElement(wstring inElemName, wstring inElemContent);
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTime.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTime.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTime.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,20 +1,20 @@
-#include "StdAfx.h"
-#include ".\c_cmmltime.h"
-
-C_CMMLTime::C_CMMLTime(void)
-{
-}
-
-C_CMMLTime::~C_CMMLTime(void)
-{
-}
-
-//Accessors
-wstring C_CMMLTime::time() {
- return mTime;
-}
-
-//Mutators
-void C_CMMLTime::setTime(wstring inTime) {
- mTime = inTime;
-}
+#include "StdAfx.h"
+#include ".\c_cmmltime.h"
+
+C_CMMLTime::C_CMMLTime(void)
+{
+}
+
+C_CMMLTime::~C_CMMLTime(void)
+{
+}
+
+//Accessors
+wstring C_CMMLTime::time() {
+ return mTime;
+}
+
+//Mutators
+void C_CMMLTime::setTime(wstring inTime) {
+ mTime = inTime;
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTime.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTime.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTime.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTime.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,22 +1,22 @@
-#pragma once
-#include <string>
-
-using namespace std;
-
-class LIBCMMLTAGS_API C_CMMLTime
-{
-public:
- C_CMMLTime(void);
- ~C_CMMLTime(void);
-
- //Accessors
- wstring time();
-
- //Mutators
- void setTime(wstring inTime);
-
-
-//Temporarily just a string container
-protected:
- wstring mTime;
-};
+#pragma once
+#include <string>
+
+using namespace std;
+
+class LIBCMMLTAGS_API C_CMMLTime
+{
+public:
+ C_CMMLTime(void);
+ ~C_CMMLTime(void);
+
+ //Accessors
+ wstring time();
+
+ //Mutators
+ void setTime(wstring inTime);
+
+
+//Temporarily just a string container
+protected:
+ wstring mTime;
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_CMMLTime.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,158 +30,158 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\c_cliptag.h"
-
-//TO DO ::: track element
-C_ClipTag::C_ClipTag(void)
-{
- mTagType = C_CMMLTag::eTagType::CLIP;
-
- mMetaList = new C_MetaTagList;
- mAnchor = NULL;
- mImage = NULL;
- mDesc = NULL;
- mStart = L"0";
- mTrack = L"";
-
-}
-
-C_ClipTag::~C_ClipTag(void)
-{
- delete mAnchor;
- delete mImage;
- delete mDesc;
- delete mMetaList;
-}
-
-//Accessors
-wstring C_ClipTag::track() {
- return mTrack;
-}
-C_MetaTagList* C_ClipTag::metaList() {
- return mMetaList;
-}
-C_AnchorTag* C_ClipTag::anchor() {
- return mAnchor;
-}
-C_ImageTag* C_ClipTag::image() {
- return mImage;
-}
-C_DescTag* C_ClipTag::desc() {
- return mDesc;
-}
-
-wstring C_ClipTag::start() {
- return mStart;
-}
-wstring C_ClipTag::end() {
- return mEnd;
-}
-//Mutators
-void C_ClipTag::setTrack(wstring inTrack) {
- mTrack = inTrack;
-}
-void C_ClipTag::setAnchor(C_AnchorTag* inAnchor) {
- delete mAnchor;
- mAnchor = inAnchor;
-}
-void C_ClipTag::setImage(C_ImageTag* inImage) {
- delete mImage;
- mImage = inImage;
-}
-void C_ClipTag::setDesc(C_DescTag* inDesc) {
- delete mDesc;
- mDesc = inDesc;
-}
-
-void C_ClipTag::setStart(wstring inStart) {
- if (inStart != L"") {
- mStart = inStart;
- }
-}
-void C_ClipTag::setEnd(wstring inEnd) {
- mEnd = inEnd;
-}
-
-//Others
-
-C_ClipTag* C_ClipTag::clone() {
- C_ClipTag* retTag = new C_ClipTag;
- privateClone(retTag);
- return retTag;
-
-}
-C_CMMLTag* C_ClipTag::genericClone() {
- return clone();
-}
-
-void C_ClipTag::privateClone(C_CMMLTag* outTag) {
- C_HumReadCMMLTag::privateClone(outTag);
- C_ClipTag* locTag = reinterpret_cast<C_ClipTag*>(outTag);
- locTag->mTrack = mTrack;
- if (mAnchor != NULL) {
- locTag->setAnchor(mAnchor->clone());
- } else {
- locTag->setAnchor(NULL);
- }
-
- if (mImage != NULL) {
- locTag->setImage(mImage->clone());
- } else {
- locTag->setImage(NULL);
- }
-
- if (mDesc != NULL) {
- locTag->setDesc(mDesc->clone());
- } else {
- locTag->setDesc(NULL);
- }
- locTag->setStart(mStart);
- locTag->setEnd(mEnd);
- //locTag->mMetaList = mMetaList->clone();
- for (int i = 0; i < mMetaList->numTags(); i++) {
- locTag->metaList()->addTag(mMetaList->getTag(i)->clone());
- }
-}
-wstring C_ClipTag::toString() {
- wstring retStr = L"<clip";
-
- //TO DO::: Language data ???
-
- //Id element
- if (mId != L"") {
- retStr += makeElement(L"id", mId);
- }
-
- retStr += makeLangElements();
-
- //track Element
- if (mTrack != L"") {
- retStr += makeElement(L"track", mTrack);
- }
-
- //TO DO::: Sort out what to do about start and end
- retStr += makeElement(L"start", mStart);
-
- if (mEnd != L"") {
- retStr += makeElement(L"end", mEnd);
- }
-
- retStr += L">\n";
-
- if (mAnchor != NULL) {
- retStr += mAnchor->toString();
- }
- if (mImage != NULL) {
- retStr += mImage->toString();
- }
- if (mDesc != NULL) {
- retStr += mDesc->toString();
- }
-
- retStr += mMetaList->toString();
- retStr += L"</clip>\n\n";
- return retStr;
+*/
+#include "StdAfx.h"
+#include ".\c_cliptag.h"
+
+//TO DO ::: track element
+C_ClipTag::C_ClipTag(void)
+{
+ mTagType = C_CMMLTag::eTagType::CLIP;
+
+ mMetaList = new C_MetaTagList;
+ mAnchor = NULL;
+ mImage = NULL;
+ mDesc = NULL;
+ mStart = L"0";
+ mTrack = L"";
+
+}
+
+C_ClipTag::~C_ClipTag(void)
+{
+ delete mAnchor;
+ delete mImage;
+ delete mDesc;
+ delete mMetaList;
+}
+
+//Accessors
+wstring C_ClipTag::track() {
+ return mTrack;
+}
+C_MetaTagList* C_ClipTag::metaList() {
+ return mMetaList;
+}
+C_AnchorTag* C_ClipTag::anchor() {
+ return mAnchor;
+}
+C_ImageTag* C_ClipTag::image() {
+ return mImage;
+}
+C_DescTag* C_ClipTag::desc() {
+ return mDesc;
+}
+
+wstring C_ClipTag::start() {
+ return mStart;
+}
+wstring C_ClipTag::end() {
+ return mEnd;
+}
+//Mutators
+void C_ClipTag::setTrack(wstring inTrack) {
+ mTrack = inTrack;
+}
+void C_ClipTag::setAnchor(C_AnchorTag* inAnchor) {
+ delete mAnchor;
+ mAnchor = inAnchor;
+}
+void C_ClipTag::setImage(C_ImageTag* inImage) {
+ delete mImage;
+ mImage = inImage;
+}
+void C_ClipTag::setDesc(C_DescTag* inDesc) {
+ delete mDesc;
+ mDesc = inDesc;
+}
+
+void C_ClipTag::setStart(wstring inStart) {
+ if (inStart != L"") {
+ mStart = inStart;
+ }
+}
+void C_ClipTag::setEnd(wstring inEnd) {
+ mEnd = inEnd;
+}
+
+//Others
+
+C_ClipTag* C_ClipTag::clone() {
+ C_ClipTag* retTag = new C_ClipTag;
+ privateClone(retTag);
+ return retTag;
+
+}
+C_CMMLTag* C_ClipTag::genericClone() {
+ return clone();
+}
+
+void C_ClipTag::privateClone(C_CMMLTag* outTag) {
+ C_HumReadCMMLTag::privateClone(outTag);
+ C_ClipTag* locTag = reinterpret_cast<C_ClipTag*>(outTag);
+ locTag->mTrack = mTrack;
+ if (mAnchor != NULL) {
+ locTag->setAnchor(mAnchor->clone());
+ } else {
+ locTag->setAnchor(NULL);
+ }
+
+ if (mImage != NULL) {
+ locTag->setImage(mImage->clone());
+ } else {
+ locTag->setImage(NULL);
+ }
+
+ if (mDesc != NULL) {
+ locTag->setDesc(mDesc->clone());
+ } else {
+ locTag->setDesc(NULL);
+ }
+ locTag->setStart(mStart);
+ locTag->setEnd(mEnd);
+ //locTag->mMetaList = mMetaList->clone();
+ for (int i = 0; i < mMetaList->numTags(); i++) {
+ locTag->metaList()->addTag(mMetaList->getTag(i)->clone());
+ }
+}
+wstring C_ClipTag::toString() {
+ wstring retStr = L"<clip";
+
+ //TO DO::: Language data ???
+
+ //Id element
+ if (mId != L"") {
+ retStr += makeElement(L"id", mId);
+ }
+
+ retStr += makeLangElements();
+
+ //track Element
+ if (mTrack != L"") {
+ retStr += makeElement(L"track", mTrack);
+ }
+
+ //TO DO::: Sort out what to do about start and end
+ retStr += makeElement(L"start", mStart);
+
+ if (mEnd != L"") {
+ retStr += makeElement(L"end", mEnd);
+ }
+
+ retStr += L">\n";
+
+ if (mAnchor != NULL) {
+ retStr += mAnchor->toString();
+ }
+ if (mImage != NULL) {
+ retStr += mImage->toString();
+ }
+ if (mDesc != NULL) {
+ retStr += mDesc->toString();
+ }
+
+ retStr += mMetaList->toString();
+ retStr += L"</clip>\n\n";
+ return retStr;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,72 +30,72 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#pragma once
-
-//STL Include Files
-#include <string>
-using namespace std;
-
-//Local Include Files
-#include "C_HumReadCMMLTag.h"
-#include "C_MetaTagList.h"
-#include "C_AnchorTag.h"
-#include "C_ImageTag.h"
-#include "C_DescTag.h"
-
-
-class LIBCMMLTAGS_API C_ClipTag :
- //Derived Classes
- public C_HumReadCMMLTag
-{
-public:
- //Constructors
- C_ClipTag(void);
- virtual ~C_ClipTag(void);
-
-
- //Accessors
- wstring track();
- C_MetaTagList* metaList();
- C_AnchorTag* anchor();
- C_ImageTag* image();
- C_DescTag* desc();
-
- wstring start();
- wstring end();
-
-
- //Mutators
- void setTrack(wstring inTrack);
- void setAnchor(C_AnchorTag* inAnchor);
- void setImage(C_ImageTag* inImage);
- void setDesc(C_DescTag* inDesc);
-
- void setStart(wstring inStart);
- void setEnd(wstring inEnd);
-
-
- //Others
- virtual wstring toString();
- C_ClipTag* clone();
- virtual C_CMMLTag* genericClone();
-
-protected:
- //Property Data
- wstring mTrack;
- C_MetaTagList* mMetaList;
- C_AnchorTag* mAnchor;
- C_ImageTag* mImage;
- C_DescTag* mDesc;
-
- wstring mStart;
- wstring mEnd;
-
- //Protected Helper Methods
- virtual void privateClone(C_CMMLTag* outTag);
-
-
-
-};
+*/
+
+#pragma once
+
+//STL Include Files
+#include <string>
+using namespace std;
+
+//Local Include Files
+#include "C_HumReadCMMLTag.h"
+#include "C_MetaTagList.h"
+#include "C_AnchorTag.h"
+#include "C_ImageTag.h"
+#include "C_DescTag.h"
+
+
+class LIBCMMLTAGS_API C_ClipTag :
+ //Derived Classes
+ public C_HumReadCMMLTag
+{
+public:
+ //Constructors
+ C_ClipTag(void);
+ virtual ~C_ClipTag(void);
+
+
+ //Accessors
+ wstring track();
+ C_MetaTagList* metaList();
+ C_AnchorTag* anchor();
+ C_ImageTag* image();
+ C_DescTag* desc();
+
+ wstring start();
+ wstring end();
+
+
+ //Mutators
+ void setTrack(wstring inTrack);
+ void setAnchor(C_AnchorTag* inAnchor);
+ void setImage(C_ImageTag* inImage);
+ void setDesc(C_DescTag* inDesc);
+
+ void setStart(wstring inStart);
+ void setEnd(wstring inEnd);
+
+
+ //Others
+ virtual wstring toString();
+ C_ClipTag* clone();
+ virtual C_CMMLTag* genericClone();
+
+protected:
+ //Property Data
+ wstring mTrack;
+ C_MetaTagList* mMetaList;
+ C_AnchorTag* mAnchor;
+ C_ImageTag* mImage;
+ C_DescTag* mDesc;
+
+ wstring mStart;
+ wstring mEnd;
+
+ //Protected Helper Methods
+ virtual void privateClone(C_CMMLTag* outTag);
+
+
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,44 +30,44 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\c_cliptaglist.h"
-
-C_ClipTagList::C_ClipTagList(void)
-{
-}
-
-C_ClipTagList::~C_ClipTagList(void)
-{
- //Everything is deleted by the base class
-}
-
-
-wstring C_ClipTagList::toString() {
- wstring retStr = L"";
- for (unsigned long i = 0; i < mTagList.size(); i++) {
- retStr += mTagList[i]->toString();
- }
- return retStr;
-}
-
-void C_ClipTagList::addTag(C_ClipTag* inTag) {
- C_TagList::addTag(inTag);
-
-}
-C_ClipTag* C_ClipTagList::getTag(unsigned long inTagNo) {
- return (C_ClipTag*) C_TagList::getTag(inTagNo);
-}
-
-void C_ClipTagList::privateClone(C_TagList* outTagList) {
- C_TagList::privateClone(outTagList);
-
-
-}
-
-C_ClipTagList* C_ClipTagList::clone() {
- C_ClipTagList* retList = new C_ClipTagList;
- privateClone(retList);
- return retList;
+*/
+#include "StdAfx.h"
+#include ".\c_cliptaglist.h"
+
+C_ClipTagList::C_ClipTagList(void)
+{
+}
+
+C_ClipTagList::~C_ClipTagList(void)
+{
+ //Everything is deleted by the base class
+}
+
+
+wstring C_ClipTagList::toString() {
+ wstring retStr = L"";
+ for (unsigned long i = 0; i < mTagList.size(); i++) {
+ retStr += mTagList[i]->toString();
+ }
+ return retStr;
+}
+
+void C_ClipTagList::addTag(C_ClipTag* inTag) {
+ C_TagList::addTag(inTag);
+
+}
+C_ClipTag* C_ClipTagList::getTag(unsigned long inTagNo) {
+ return (C_ClipTag*) C_TagList::getTag(inTagNo);
+}
+
+void C_ClipTagList::privateClone(C_TagList* outTagList) {
+ C_TagList::privateClone(outTagList);
+
+
+}
+
+C_ClipTagList* C_ClipTagList::clone() {
+ C_ClipTagList* retList = new C_ClipTagList;
+ privateClone(retList);
+ return retList;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,33 +30,33 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-//STL Include Files
-#include <string>
-using namespace std;
-
-//Local Include Files
-#include "C_TagList.h"
-#include "C_ClipTag.h"
-
-//TO DO:::Make this class !
-class LIBCMMLTAGS_API C_ClipTagList :
- //Derived Classes
- public C_TagList
-{
-public:
- //Constructors
- C_ClipTagList(void);
- virtual ~C_ClipTagList(void);
-
-
- virtual wstring toString();
- C_ClipTagList* clone();
-
- void addTag(C_ClipTag* inTag);
- C_ClipTag* getTag(unsigned long inTagNo);
-
- virtual void privateClone(C_TagList* outTagList);
-};
+*/
+#pragma once
+
+//STL Include Files
+#include <string>
+using namespace std;
+
+//Local Include Files
+#include "C_TagList.h"
+#include "C_ClipTag.h"
+
+//TO DO:::Make this class !
+class LIBCMMLTAGS_API C_ClipTagList :
+ //Derived Classes
+ public C_TagList
+{
+public:
+ //Constructors
+ C_ClipTagList(void);
+ virtual ~C_ClipTagList(void);
+
+
+ virtual wstring toString();
+ C_ClipTagList* clone();
+
+ void addTag(C_ClipTag* inTag);
+ C_ClipTag* getTag(unsigned long inTagNo);
+
+ virtual void privateClone(C_TagList* outTagList);
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ClipTagList.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_DescTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_DescTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_DescTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,45 +30,45 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\c_desctag.h"
-
-C_DescTag::C_DescTag(void)
-{
- mTagType = C_CMMLTag::eTagType::DESC;
-}
-
-C_DescTag::~C_DescTag(void)
-{
-}
-
-
-//Other
-wstring C_DescTag::toString() {
- //FIX ::: Make this do something
- wstring retStr = L"<desc";
- if (mId.size() != 0) {
- retStr += makeElement(L"id", mId);
- }
-
- retStr += makeLangElements();
-
- retStr += L">";
- retStr += mText;
- retStr += L"</desc>\n";
- return retStr;
-}
-
-void C_DescTag::privateClone(C_CMMLTag* outTag) {
- C_TextFieldTag::privateClone(outTag);
-}
-C_CMMLTag* C_DescTag::genericClone() {
- return clone();
-}
-C_DescTag* C_DescTag::clone() {
- C_DescTag* retTag = new C_DescTag;
- privateClone(retTag);
- return retTag;
-
+*/
+#include "StdAfx.h"
+#include ".\c_desctag.h"
+
+C_DescTag::C_DescTag(void)
+{
+ mTagType = C_CMMLTag::eTagType::DESC;
+}
+
+C_DescTag::~C_DescTag(void)
+{
+}
+
+
+//Other
+wstring C_DescTag::toString() {
+ //FIX ::: Make this do something
+ wstring retStr = L"<desc";
+ if (mId.size() != 0) {
+ retStr += makeElement(L"id", mId);
+ }
+
+ retStr += makeLangElements();
+
+ retStr += L">";
+ retStr += mText;
+ retStr += L"</desc>\n";
+ return retStr;
+}
+
+void C_DescTag::privateClone(C_CMMLTag* outTag) {
+ C_TextFieldTag::privateClone(outTag);
+}
+C_CMMLTag* C_DescTag::genericClone() {
+ return clone();
+}
+C_DescTag* C_DescTag::clone() {
+ C_DescTag* retTag = new C_DescTag;
+ privateClone(retTag);
+ return retTag;
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_DescTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_DescTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_DescTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_DescTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,33 +30,33 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-//STL Include Files
-#include <string>
-using namespace std;
-
-//Local Include Files
-#include "C_TextFieldTag.h"
-
-class LIBCMMLTAGS_API C_DescTag
- //Derived Classes
- : public C_TextFieldTag
-{
-public:
- //Constructors
- C_DescTag(void);
- virtual ~C_DescTag(void);
-
- //Other
- virtual wstring toString();
- C_DescTag* clone();
- virtual C_CMMLTag* genericClone();
-
-protected:
- //Protected Helper Methods
- virtual void privateClone(C_CMMLTag* outTag);
-
-
-};
+*/
+#pragma once
+
+//STL Include Files
+#include <string>
+using namespace std;
+
+//Local Include Files
+#include "C_TextFieldTag.h"
+
+class LIBCMMLTAGS_API C_DescTag
+ //Derived Classes
+ : public C_TextFieldTag
+{
+public:
+ //Constructors
+ C_DescTag(void);
+ virtual ~C_DescTag(void);
+
+ //Other
+ virtual wstring toString();
+ C_DescTag* clone();
+ virtual C_CMMLTag* genericClone();
+
+protected:
+ //Protected Helper Methods
+ virtual void privateClone(C_CMMLTag* outTag);
+
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_DescTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HeadTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HeadTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HeadTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,99 +30,99 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\c_headtag.h"
-
-C_HeadTag::C_HeadTag(void)
-{
- mTagType = C_CMMLTag::eTagType::HEAD;
- mMetaList = new C_MetaTagList;
- mTitle = new C_TitleTag;
- mBase = NULL;
-}
-
-C_HeadTag::~C_HeadTag(void)
-{
- delete mTitle;
- delete mBase;
- delete mMetaList;
-
-}
-
-//Accessors
-wstring C_HeadTag::profile() {
- return mProfile;
-}
-C_TitleTag* C_HeadTag::title() {
- return mTitle;
-}
-C_BaseTag* C_HeadTag::base() {
- return mBase;
-}
-C_MetaTagList* C_HeadTag::metaList() {
- return mMetaList;
-}
-//Mutators
-void C_HeadTag::setProfile(wstring inProfile) {
- mProfile = inProfile;
-}
-void C_HeadTag::setTitle(C_TitleTag* inTitle) {
- delete mTitle;
- mTitle = inTitle;
-}
-void C_HeadTag::setBase(C_BaseTag* inBase) {
- delete mBase;
- mBase = inBase;
-}
-//Other
-
-void C_HeadTag::privateClone(C_CMMLTag* outTag) {
- C_HumReadCMMLTag::privateClone(outTag);
- C_HeadTag* locTag = reinterpret_cast<C_HeadTag*>(outTag);
- locTag->setProfile(mProfile);
- //locTag->mTitle = mTitle;
- if (mBase != NULL) {
- locTag->setBase(mBase->clone());
- }
- locTag->setTitle(mTitle->clone());
-}
-C_CMMLTag* C_HeadTag::genericClone() {
- return clone();
-}
-C_HeadTag* C_HeadTag::clone() {
- C_HeadTag* retTag = new C_HeadTag;
- privateClone(retTag);
- return retTag;
-
-}
-
-
-wstring C_HeadTag::toString() {
- //TO DO::: Optional tags
- wstring retStr = L"<head";
-
- if (mId.size() != 0) {
- retStr += L" id=\"";
- retStr += mId;
- retStr += L"\"";
- }
-
- retStr += makeLangElements();
-
- if (mProfile.size() != 0) {
- retStr += L" profile=\"";
- retStr += mProfile;
- retStr += L"\"";
- }
- retStr+= L">\n";
-
- if (mBase != NULL) {
- retStr += mBase->toString();
- }
-
- retStr += mTitle->toString();
- retStr += mMetaList->toString();
- retStr += L"</head>\n\n";
- return retStr;
-}
+*/
+#include "StdAfx.h"
+#include ".\c_headtag.h"
+
+C_HeadTag::C_HeadTag(void)
+{
+ mTagType = C_CMMLTag::eTagType::HEAD;
+ mMetaList = new C_MetaTagList;
+ mTitle = new C_TitleTag;
+ mBase = NULL;
+}
+
+C_HeadTag::~C_HeadTag(void)
+{
+ delete mTitle;
+ delete mBase;
+ delete mMetaList;
+
+}
+
+//Accessors
+wstring C_HeadTag::profile() {
+ return mProfile;
+}
+C_TitleTag* C_HeadTag::title() {
+ return mTitle;
+}
+C_BaseTag* C_HeadTag::base() {
+ return mBase;
+}
+C_MetaTagList* C_HeadTag::metaList() {
+ return mMetaList;
+}
+//Mutators
+void C_HeadTag::setProfile(wstring inProfile) {
+ mProfile = inProfile;
+}
+void C_HeadTag::setTitle(C_TitleTag* inTitle) {
+ delete mTitle;
+ mTitle = inTitle;
+}
+void C_HeadTag::setBase(C_BaseTag* inBase) {
+ delete mBase;
+ mBase = inBase;
+}
+//Other
+
+void C_HeadTag::privateClone(C_CMMLTag* outTag) {
+ C_HumReadCMMLTag::privateClone(outTag);
+ C_HeadTag* locTag = reinterpret_cast<C_HeadTag*>(outTag);
+ locTag->setProfile(mProfile);
+ //locTag->mTitle = mTitle;
+ if (mBase != NULL) {
+ locTag->setBase(mBase->clone());
+ }
+ locTag->setTitle(mTitle->clone());
+}
+C_CMMLTag* C_HeadTag::genericClone() {
+ return clone();
+}
+C_HeadTag* C_HeadTag::clone() {
+ C_HeadTag* retTag = new C_HeadTag;
+ privateClone(retTag);
+ return retTag;
+
+}
+
+
+wstring C_HeadTag::toString() {
+ //TO DO::: Optional tags
+ wstring retStr = L"<head";
+
+ if (mId.size() != 0) {
+ retStr += L" id=\"";
+ retStr += mId;
+ retStr += L"\"";
+ }
+
+ retStr += makeLangElements();
+
+ if (mProfile.size() != 0) {
+ retStr += L" profile=\"";
+ retStr += mProfile;
+ retStr += L"\"";
+ }
+ retStr+= L">\n";
+
+ if (mBase != NULL) {
+ retStr += mBase->toString();
+ }
+
+ retStr += mTitle->toString();
+ retStr += mMetaList->toString();
+ retStr += L"</head>\n\n";
+ return retStr;
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HeadTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HeadTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HeadTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HeadTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,66 +30,66 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#pragma once
-//STL Include Files
-#include <string>
-using namespace std;
-
-//Local Include Files
-#include "C_HumReadCMMLTag.h"
-#include "C_TitleTag.h"
-#include "C_BaseTag.h"
-#include "C_MetaTagList.h"
-
-class LIBCMMLTAGS_API C_HeadTag
- //Derived Classes
- : public C_HumReadCMMLTag
-{
-public:
- //Constructors
- C_HeadTag(void);
- virtual ~C_HeadTag(void);
-
- //Accessors
- wstring profile();
- C_TitleTag* title();
- C_BaseTag* base();
- C_MetaTagList* metaList();
-
- //Mutators
- void setProfile(wstring inProfile);
- void setTitle(C_TitleTag* inTitle);
- void setBase(C_BaseTag* inBase);
-
- //Other
- virtual wstring toString();
- C_HeadTag* clone();
- virtual C_CMMLTag* genericClone();
-protected:
- //Property Data
- wstring mProfile;
- C_TitleTag* mTitle;
- C_BaseTag* mBase;
- C_MetaTagList* mMetaList;
-
- //Protected Helper Methods
- virtual void privateClone(C_CMMLTag* outTag);
-
-
-};
-
- //typedef struct {
- // char *head_id; /**< id attribute of header */
- // char *lang; /**< language of header */
- // char *dir; /**< directionality of lang */
- // char *profile; /**< profile of header */
- // char *title; /**< title element of header */
- // char *title_id; /**< id attribute of title element */
- // char *title_lang; /**< language of title */
- // char *title_dir; /**< directionality of title_lang */
- // char *base_id; /**< id attribute of base element */
- // char *base_href; /**< href attribute of base element */
- // CMML_List * meta; /**< list of meta elements */
- //} CMML_Head;
+*/
+
+#pragma once
+//STL Include Files
+#include <string>
+using namespace std;
+
+//Local Include Files
+#include "C_HumReadCMMLTag.h"
+#include "C_TitleTag.h"
+#include "C_BaseTag.h"
+#include "C_MetaTagList.h"
+
+class LIBCMMLTAGS_API C_HeadTag
+ //Derived Classes
+ : public C_HumReadCMMLTag
+{
+public:
+ //Constructors
+ C_HeadTag(void);
+ virtual ~C_HeadTag(void);
+
+ //Accessors
+ wstring profile();
+ C_TitleTag* title();
+ C_BaseTag* base();
+ C_MetaTagList* metaList();
+
+ //Mutators
+ void setProfile(wstring inProfile);
+ void setTitle(C_TitleTag* inTitle);
+ void setBase(C_BaseTag* inBase);
+
+ //Other
+ virtual wstring toString();
+ C_HeadTag* clone();
+ virtual C_CMMLTag* genericClone();
+protected:
+ //Property Data
+ wstring mProfile;
+ C_TitleTag* mTitle;
+ C_BaseTag* mBase;
+ C_MetaTagList* mMetaList;
+
+ //Protected Helper Methods
+ virtual void privateClone(C_CMMLTag* outTag);
+
+
+};
+
+ //typedef struct {
+ // char *head_id; /**< id attribute of header */
+ // char *lang; /**< language of header */
+ // char *dir; /**< directionality of lang */
+ // char *profile; /**< profile of header */
+ // char *title; /**< title element of header */
+ // char *title_id; /**< id attribute of title element */
+ // char *title_lang; /**< language of title */
+ // char *title_dir; /**< directionality of title_lang */
+ // char *base_id; /**< id attribute of base element */
+ // char *base_href; /**< href attribute of base element */
+ // CMML_List * meta; /**< list of meta elements */
+ //} CMML_Head;
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HeadTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HumReadCMMLTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HumReadCMMLTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HumReadCMMLTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,52 +30,52 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\c_humreadcmmltag.h"
-
-C_HumReadCMMLTag::C_HumReadCMMLTag(void)
-{
-}
-
-C_HumReadCMMLTag::~C_HumReadCMMLTag(void)
-{
-}
-
-//Accessors
-wstring C_HumReadCMMLTag::lang() {
- return mLang;
-}
-wstring C_HumReadCMMLTag::dirn() {
- return mDirn;
-}
-
-//Mutators
-void C_HumReadCMMLTag::setLang(wstring inLang) {
- mLang = inLang;
-}
-void C_HumReadCMMLTag::setDirn(wstring inDirn) {
- mDirn = inDirn;
-}
-
-//Protected Helper Methods
-void C_HumReadCMMLTag::privateClone(C_CMMLTag* outTag) {
- C_CMMLTag::privateClone(outTag);
- C_HumReadCMMLTag* locTag = reinterpret_cast<C_HumReadCMMLTag*>(outTag);
- locTag->setLang(mLang);
- locTag->setDirn(mDirn);
-}
-
-wstring C_HumReadCMMLTag::makeLangElements() {
- wstring retStr = L"";
-
- if (mLang.size() != 0) {
- retStr += makeElement(L"lang", mLang);
- }
-
- if (mDirn.size() != 0) {
- retStr += makeElement(L"dir", mDirn);
- }
-
- return retStr;
+*/
+#include "StdAfx.h"
+#include ".\c_humreadcmmltag.h"
+
+C_HumReadCMMLTag::C_HumReadCMMLTag(void)
+{
+}
+
+C_HumReadCMMLTag::~C_HumReadCMMLTag(void)
+{
+}
+
+//Accessors
+wstring C_HumReadCMMLTag::lang() {
+ return mLang;
+}
+wstring C_HumReadCMMLTag::dirn() {
+ return mDirn;
+}
+
+//Mutators
+void C_HumReadCMMLTag::setLang(wstring inLang) {
+ mLang = inLang;
+}
+void C_HumReadCMMLTag::setDirn(wstring inDirn) {
+ mDirn = inDirn;
+}
+
+//Protected Helper Methods
+void C_HumReadCMMLTag::privateClone(C_CMMLTag* outTag) {
+ C_CMMLTag::privateClone(outTag);
+ C_HumReadCMMLTag* locTag = reinterpret_cast<C_HumReadCMMLTag*>(outTag);
+ locTag->setLang(mLang);
+ locTag->setDirn(mDirn);
+}
+
+wstring C_HumReadCMMLTag::makeLangElements() {
+ wstring retStr = L"";
+
+ if (mLang.size() != 0) {
+ retStr += makeElement(L"lang", mLang);
+ }
+
+ if (mDirn.size() != 0) {
+ retStr += makeElement(L"dir", mDirn);
+ }
+
+ return retStr;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HumReadCMMLTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HumReadCMMLTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HumReadCMMLTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HumReadCMMLTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,43 +30,43 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-//STL Include Files
-#include <string>
-using namespace std;
-
-//Local Include Files
-#include "c_cmmltag.h"
-
-class LIBCMMLTAGS_API C_HumReadCMMLTag :
- //Derived Classes
- public C_CMMLTag
-{
-public:
- //Constructors
- C_HumReadCMMLTag(void);
- virtual ~C_HumReadCMMLTag(void);
-
- //Accessors
- wstring lang();
- wstring dirn();
-
- //Mutators
- void setLang(wstring inLang);
- void setDirn(wstring inDirn);
-
- //Other
- virtual wstring toString() = 0;
-
-protected:
- //Property Data
- wstring mLang;
- wstring mDirn;
-
- //Protected Helper Methods
- virtual void privateClone(C_CMMLTag* outTag);
-
- virtual wstring makeLangElements();
-
-};
+*/
+#pragma once
+//STL Include Files
+#include <string>
+using namespace std;
+
+//Local Include Files
+#include "c_cmmltag.h"
+
+class LIBCMMLTAGS_API C_HumReadCMMLTag :
+ //Derived Classes
+ public C_CMMLTag
+{
+public:
+ //Constructors
+ C_HumReadCMMLTag(void);
+ virtual ~C_HumReadCMMLTag(void);
+
+ //Accessors
+ wstring lang();
+ wstring dirn();
+
+ //Mutators
+ void setLang(wstring inLang);
+ void setDirn(wstring inDirn);
+
+ //Other
+ virtual wstring toString() = 0;
+
+protected:
+ //Property Data
+ wstring mLang;
+ wstring mDirn;
+
+ //Protected Helper Methods
+ virtual void privateClone(C_CMMLTag* outTag);
+
+ virtual wstring makeLangElements();
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_HumReadCMMLTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImageTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImageTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImageTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,69 +30,69 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\c_imagetag.h"
-
-C_ImageTag::C_ImageTag(void)
-{
- mTagType = C_CMMLTag::eTagType::IMAGE;
-}
-
-C_ImageTag::~C_ImageTag(void)
-{
-}
-
-//Accessors
-wstring C_ImageTag::src() {
- return mSrc;
-}
-wstring C_ImageTag::alt() {
- return mAlt;
-}
-
-//Mutators
-void C_ImageTag::setSrc(wstring inSrc) {
- mSrc = inSrc;
-}
-void C_ImageTag::setAlt(wstring inAlt) {
- mAlt = inAlt;
-}
-
-//Other
-
-void C_ImageTag::privateClone(C_CMMLTag* outTag) {
- C_HumReadCMMLTag::privateClone(outTag);
- C_ImageTag* locTag = reinterpret_cast<C_ImageTag*>(outTag);
- locTag->setSrc(mSrc);
- locTag->setAlt(mAlt);
-}
-
-C_ImageTag* C_ImageTag::clone() {
- C_ImageTag* retTag = new C_ImageTag;
- privateClone(retTag);
- return retTag;
-
-}
-C_CMMLTag* C_ImageTag::genericClone() {
- return clone();
-}
-wstring C_ImageTag::toString() {
- wstring retStr = L"<img";
- if (mId.size() != 0) {
- retStr += makeElement(L"id", mId);
- }
-
- retStr += makeLangElements();
-
- retStr += makeElement(L"src", mSrc);
-
- if (mAlt.size() != 0) {
- retStr += makeElement(L"alt", mAlt);
- }
-
- retStr += L"/>\n";
-
- return retStr;
-
+*/
+#include "StdAfx.h"
+#include ".\c_imagetag.h"
+
+C_ImageTag::C_ImageTag(void)
+{
+ mTagType = C_CMMLTag::eTagType::IMAGE;
+}
+
+C_ImageTag::~C_ImageTag(void)
+{
+}
+
+//Accessors
+wstring C_ImageTag::src() {
+ return mSrc;
+}
+wstring C_ImageTag::alt() {
+ return mAlt;
+}
+
+//Mutators
+void C_ImageTag::setSrc(wstring inSrc) {
+ mSrc = inSrc;
+}
+void C_ImageTag::setAlt(wstring inAlt) {
+ mAlt = inAlt;
+}
+
+//Other
+
+void C_ImageTag::privateClone(C_CMMLTag* outTag) {
+ C_HumReadCMMLTag::privateClone(outTag);
+ C_ImageTag* locTag = reinterpret_cast<C_ImageTag*>(outTag);
+ locTag->setSrc(mSrc);
+ locTag->setAlt(mAlt);
+}
+
+C_ImageTag* C_ImageTag::clone() {
+ C_ImageTag* retTag = new C_ImageTag;
+ privateClone(retTag);
+ return retTag;
+
+}
+C_CMMLTag* C_ImageTag::genericClone() {
+ return clone();
+}
+wstring C_ImageTag::toString() {
+ wstring retStr = L"<img";
+ if (mId.size() != 0) {
+ retStr += makeElement(L"id", mId);
+ }
+
+ retStr += makeLangElements();
+
+ retStr += makeElement(L"src", mSrc);
+
+ if (mAlt.size() != 0) {
+ retStr += makeElement(L"alt", mAlt);
+ }
+
+ retStr += L"/>\n";
+
+ return retStr;
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImageTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImageTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImageTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImageTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,45 +30,45 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-//STL Include Files
-#include <string>
-using namespace std;
-
-//Local Include Files
-#include "c_humreadcmmltag.h"
-
-class LIBCMMLTAGS_API C_ImageTag :
- //Derived Classes
- public C_HumReadCMMLTag
-{
-public:
- //Constructors
- C_ImageTag(void);
- virtual ~C_ImageTag(void);
-
- //Accessors
- wstring src();
- wstring alt();
-
- //Mutators
- void setSrc(wstring inSrc);
- void setAlt(wstring inAlt);
-
- //Other
- virtual wstring toString();
- C_ImageTag* clone();
- virtual C_CMMLTag* genericClone();
-protected:
- //Property Data
- wstring mSrc;
- wstring mAlt;
-
- //Protected Helper Methods
- virtual void privateClone(C_CMMLTag* outTag);
-
-
-
-};
+*/
+#pragma once
+
+//STL Include Files
+#include <string>
+using namespace std;
+
+//Local Include Files
+#include "c_humreadcmmltag.h"
+
+class LIBCMMLTAGS_API C_ImageTag :
+ //Derived Classes
+ public C_HumReadCMMLTag
+{
+public:
+ //Constructors
+ C_ImageTag(void);
+ virtual ~C_ImageTag(void);
+
+ //Accessors
+ wstring src();
+ wstring alt();
+
+ //Mutators
+ void setSrc(wstring inSrc);
+ void setAlt(wstring inAlt);
+
+ //Other
+ virtual wstring toString();
+ C_ImageTag* clone();
+ virtual C_CMMLTag* genericClone();
+protected:
+ //Property Data
+ wstring mSrc;
+ wstring mAlt;
+
+ //Protected Helper Methods
+ virtual void privateClone(C_CMMLTag* outTag);
+
+
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImageTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_Import.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_Import.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_Import.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-#pragma once
-
-class C_Import
-{
-public:
- C_Import(void);
- ~C_Import(void);
-};
+#pragma once
+
+class C_Import
+{
+public:
+ C_Import(void);
+ ~C_Import(void);
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_Import.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,134 +30,134 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\c_importtag.h"
-
-C_ImportTag::C_ImportTag(void)
-{
- mTagType = C_CMMLTag::eTagType::IMPORT;
- mStart = L"0";
- mParamList = new C_ParamTagList;
-}
-
-C_ImportTag::~C_ImportTag(void)
-{
- delete mParamList;
-}
-
-
-//Accessors
-wstring C_ImportTag::granuleRate() {
- return mGranuleRate;
-}
-wstring C_ImportTag::contentType() {
- return mContentType;
-}
-wstring C_ImportTag::src() {
- return mSrc;
-}
-wstring C_ImportTag::start() {
- return mStart;
-}
-wstring C_ImportTag::end() {
- return mEnd;
-}
-wstring C_ImportTag::title() {
- return mTitle;
-}
-C_ParamTagList* C_ImportTag::paramList() {
- return mParamList;
-}
-
-//Mutators
-void C_ImportTag::setGranuleRate(wstring inGranuleRate) {
- mGranuleRate = inGranuleRate;
-}
-void C_ImportTag::setContentType(wstring inContentType) {
- mContentType = inContentType;
-}
-void C_ImportTag::setSrc(wstring inSrc) {
- mSrc = inSrc;
-}
-void C_ImportTag::setStart(wstring inStart) {
- if (inStart != L"") {
- mStart = inStart;
- } else {
- mStart = L"0";
- }
-}
-void C_ImportTag::setEnd(wstring inEnd) {
- mEnd = inEnd;
-}
-void C_ImportTag::setTitle(wstring inTitle) {
- mTitle = inTitle;
-}
-void C_ImportTag::setParamList(C_ParamTagList* inParamList) {
- delete mParamList;
- mParamList = inParamList;
-}
-
-//Other
-
-void C_ImportTag::privateClone(C_CMMLTag* outTag) {
-
- C_HumReadCMMLTag::privateClone(outTag);
- C_ImportTag* locTag = reinterpret_cast<C_ImportTag*>(outTag);
- locTag->setGranuleRate(mGranuleRate);
- locTag->setContentType(mContentType);
- locTag->setSrc(mSrc );
- locTag->setStart(mStart);
- locTag->setEnd(mEnd);
- locTag->setTitle(mTitle);
- locTag->setParamList(mParamList->clone());
-}
-C_ImportTag* C_ImportTag::clone() {
- C_ImportTag* retTag = new C_ImportTag;
- privateClone(retTag);
- return retTag;
-
-}
-
-C_CMMLTag* C_ImportTag::genericClone() {
- return clone();
-}
-wstring C_ImportTag::toString() {
-
- wstring retStr;
- retStr = L"<import";
-
- if (mId.size() != 0) {
- retStr += makeElement(L"id", mId);
- }
-
- retStr += makeLangElements();
-
- if (mGranuleRate.size() != 0) {
- retStr += makeElement(L"granulerate", mGranuleRate);
- }
-
- if (mContentType.size() != 0) {
- retStr += makeElement(L"contenttype", mContentType);
- }
-
- retStr += makeElement(L"src", mSrc);
- retStr += makeElement(L"start", mStart);
- if (mEnd.size() != 0) {
- retStr += makeElement(L"end", mEnd);
- }
-
- if (mTitle.size() != 0) {
- retStr += makeElement(L"title", mTitle);
- }
-
- retStr += L">\n";
-
- retStr += mParamList->toString();
-
- retStr += L"</import>\n";
- return retStr;
-
-}
-
+*/
+#include "StdAfx.h"
+#include ".\c_importtag.h"
+
+C_ImportTag::C_ImportTag(void)
+{
+ mTagType = C_CMMLTag::eTagType::IMPORT;
+ mStart = L"0";
+ mParamList = new C_ParamTagList;
+}
+
+C_ImportTag::~C_ImportTag(void)
+{
+ delete mParamList;
+}
+
+
+//Accessors
+wstring C_ImportTag::granuleRate() {
+ return mGranuleRate;
+}
+wstring C_ImportTag::contentType() {
+ return mContentType;
+}
+wstring C_ImportTag::src() {
+ return mSrc;
+}
+wstring C_ImportTag::start() {
+ return mStart;
+}
+wstring C_ImportTag::end() {
+ return mEnd;
+}
+wstring C_ImportTag::title() {
+ return mTitle;
+}
+C_ParamTagList* C_ImportTag::paramList() {
+ return mParamList;
+}
+
+//Mutators
+void C_ImportTag::setGranuleRate(wstring inGranuleRate) {
+ mGranuleRate = inGranuleRate;
+}
+void C_ImportTag::setContentType(wstring inContentType) {
+ mContentType = inContentType;
+}
+void C_ImportTag::setSrc(wstring inSrc) {
+ mSrc = inSrc;
+}
+void C_ImportTag::setStart(wstring inStart) {
+ if (inStart != L"") {
+ mStart = inStart;
+ } else {
+ mStart = L"0";
+ }
+}
+void C_ImportTag::setEnd(wstring inEnd) {
+ mEnd = inEnd;
+}
+void C_ImportTag::setTitle(wstring inTitle) {
+ mTitle = inTitle;
+}
+void C_ImportTag::setParamList(C_ParamTagList* inParamList) {
+ delete mParamList;
+ mParamList = inParamList;
+}
+
+//Other
+
+void C_ImportTag::privateClone(C_CMMLTag* outTag) {
+
+ C_HumReadCMMLTag::privateClone(outTag);
+ C_ImportTag* locTag = reinterpret_cast<C_ImportTag*>(outTag);
+ locTag->setGranuleRate(mGranuleRate);
+ locTag->setContentType(mContentType);
+ locTag->setSrc(mSrc );
+ locTag->setStart(mStart);
+ locTag->setEnd(mEnd);
+ locTag->setTitle(mTitle);
+ locTag->setParamList(mParamList->clone());
+}
+C_ImportTag* C_ImportTag::clone() {
+ C_ImportTag* retTag = new C_ImportTag;
+ privateClone(retTag);
+ return retTag;
+
+}
+
+C_CMMLTag* C_ImportTag::genericClone() {
+ return clone();
+}
+wstring C_ImportTag::toString() {
+
+ wstring retStr;
+ retStr = L"<import";
+
+ if (mId.size() != 0) {
+ retStr += makeElement(L"id", mId);
+ }
+
+ retStr += makeLangElements();
+
+ if (mGranuleRate.size() != 0) {
+ retStr += makeElement(L"granulerate", mGranuleRate);
+ }
+
+ if (mContentType.size() != 0) {
+ retStr += makeElement(L"contenttype", mContentType);
+ }
+
+ retStr += makeElement(L"src", mSrc);
+ retStr += makeElement(L"start", mStart);
+ if (mEnd.size() != 0) {
+ retStr += makeElement(L"end", mEnd);
+ }
+
+ if (mTitle.size() != 0) {
+ retStr += makeElement(L"title", mTitle);
+ }
+
+ retStr += L">\n";
+
+ retStr += mParamList->toString();
+
+ retStr += L"</import>\n";
+ return retStr;
+
+}
+
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,82 +30,82 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-//STL Include Files
-#include <string>
-using namespace std;
-
-//Local Include Files
-#include "C_HumReadCMMLTag.h"
-#include "C_ParamTagList.h"
-#include "C_CMMLTime.h"
-
-class LIBCMMLTAGS_API C_ImportTag
- //Derived Classes
- : public C_HumReadCMMLTag
-{
-public:
- //Constructors
- C_ImportTag(void);
- virtual ~C_ImportTag(void);
-
- //Accessors
- wstring granuleRate();
- wstring contentType();
- wstring src();
- wstring start();
- wstring end();
- wstring title();
- C_ParamTagList* paramList();
-
- //Mutators
- void setGranuleRate(wstring inGranuleRate);
- void setContentType(wstring inContentType);
- void setSrc(wstring inSrc);
- void setStart(wstring inStart);
- void setEnd(wstring inEnd);
- void setTitle(wstring inTitle);
- void setParamList(C_ParamTagList* inParamList);
-
- //Other
- virtual wstring toString();
- C_ImportTag* clone();
- virtual C_CMMLTag* genericClone();
-
-protected:
- //Property Data
-
- //FIX ::: Change this to appropriate integer type ??
- wstring mGranuleRate;
- wstring mContentType;
- wstring mSrc;
- wstring mStart;
- wstring mEnd;
- wstring mTitle;
- C_ParamTagList* mParamList;
-
- //Protected Helper Methods
- virtual void privateClone(C_CMMLTag* outTag);
-
-
-};
-
-
- //Original structure
- //
- //typedef struct {
- // char *id; /**< id of import tag */
- // char *lang; /**< language code of import tag */
- // char *dir; /**< directionality of lang (ltr/rtl) */
- // char *granulerate; /**< base temporal resolution in Hz */
- // char *contenttype; /**< content type of the import bitstream */
- // char *src; /**< URI to import document */
- // CMML_Time * start_time; /**< insertion time in annodex bitstream */
- // CMML_Time * end_time; /**< end time of this logical bitstream */
- // char *title; /**< comment on the import bitstream */
- // CMML_List * param; /**< list of optional further nam-value
- // metadata for the import bitstreams */
- //} CMML_ImportElement;
- //
+*/
+#pragma once
+
+//STL Include Files
+#include <string>
+using namespace std;
+
+//Local Include Files
+#include "C_HumReadCMMLTag.h"
+#include "C_ParamTagList.h"
+#include "C_CMMLTime.h"
+
+class LIBCMMLTAGS_API C_ImportTag
+ //Derived Classes
+ : public C_HumReadCMMLTag
+{
+public:
+ //Constructors
+ C_ImportTag(void);
+ virtual ~C_ImportTag(void);
+
+ //Accessors
+ wstring granuleRate();
+ wstring contentType();
+ wstring src();
+ wstring start();
+ wstring end();
+ wstring title();
+ C_ParamTagList* paramList();
+
+ //Mutators
+ void setGranuleRate(wstring inGranuleRate);
+ void setContentType(wstring inContentType);
+ void setSrc(wstring inSrc);
+ void setStart(wstring inStart);
+ void setEnd(wstring inEnd);
+ void setTitle(wstring inTitle);
+ void setParamList(C_ParamTagList* inParamList);
+
+ //Other
+ virtual wstring toString();
+ C_ImportTag* clone();
+ virtual C_CMMLTag* genericClone();
+
+protected:
+ //Property Data
+
+ //FIX ::: Change this to appropriate integer type ??
+ wstring mGranuleRate;
+ wstring mContentType;
+ wstring mSrc;
+ wstring mStart;
+ wstring mEnd;
+ wstring mTitle;
+ C_ParamTagList* mParamList;
+
+ //Protected Helper Methods
+ virtual void privateClone(C_CMMLTag* outTag);
+
+
+};
+
+
+ //Original structure
+ //
+ //typedef struct {
+ // char *id; /**< id of import tag */
+ // char *lang; /**< language code of import tag */
+ // char *dir; /**< directionality of lang (ltr/rtl) */
+ // char *granulerate; /**< base temporal resolution in Hz */
+ // char *contenttype; /**< content type of the import bitstream */
+ // char *src; /**< URI to import document */
+ // CMML_Time * start_time; /**< insertion time in annodex bitstream */
+ // CMML_Time * end_time; /**< end time of this logical bitstream */
+ // char *title; /**< comment on the import bitstream */
+ // CMML_List * param; /**< list of optional further nam-value
+ // metadata for the import bitstreams */
+ //} CMML_ImportElement;
+ //
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTagList.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTagList.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTagList.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,46 +30,46 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\c_importtaglist.h"
-
-C_ImportTagList::C_ImportTagList(void)
-{
-}
-
-C_ImportTagList::~C_ImportTagList(void)
-{
- //The tags are deleted from the base class
-}
-
-
-wstring C_ImportTagList::toString() {
- wstring retStr;
-
- for (unsigned long i = 0; i < mTagList.size(); i++) {
- retStr += mTagList[i]->toString();
- }
-
- return retStr;
-}
-
-void C_ImportTagList::addTag(C_ImportTag* inTag) {
- C_TagList::addTag(inTag);
-}
-C_ImportTag* C_ImportTagList::getTag(unsigned long inTagNo) {
- //TO DO::: Should be dynamic casts
- return (C_ImportTag*)C_TagList::getTag(inTagNo);
-}
-
-void C_ImportTagList::privateClone(C_TagList* outTagList) {
-
- C_TagList::privateClone(outTagList);
-}
-
-C_ImportTagList* C_ImportTagList::clone() {
- C_ImportTagList* retList = new C_ImportTagList;
- privateClone(retList);
- return retList;
-
+*/
+#include "StdAfx.h"
+#include ".\c_importtaglist.h"
+
+C_ImportTagList::C_ImportTagList(void)
+{
+}
+
+C_ImportTagList::~C_ImportTagList(void)
+{
+ //The tags are deleted from the base class
+}
+
+
+wstring C_ImportTagList::toString() {
+ wstring retStr;
+
+ for (unsigned long i = 0; i < mTagList.size(); i++) {
+ retStr += mTagList[i]->toString();
+ }
+
+ return retStr;
+}
+
+void C_ImportTagList::addTag(C_ImportTag* inTag) {
+ C_TagList::addTag(inTag);
+}
+C_ImportTag* C_ImportTagList::getTag(unsigned long inTagNo) {
+ //TO DO::: Should be dynamic casts
+ return (C_ImportTag*)C_TagList::getTag(inTagNo);
+}
+
+void C_ImportTagList::privateClone(C_TagList* outTagList) {
+
+ C_TagList::privateClone(outTagList);
+}
+
+C_ImportTagList* C_ImportTagList::clone() {
+ C_ImportTagList* retList = new C_ImportTagList;
+ privateClone(retList);
+ return retList;
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTagList.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTagList.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTagList.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTagList.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,32 +30,32 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-//STL Include Files
-#include <string>
-using namespace std;
-
-//Local Include Files
-#include "C_TagList.h"
-#include "C_ImportTag.h"
-class LIBCMMLTAGS_API C_ImportTagList
- //Derived Classes
- : public C_TagList
-{
-public:
- //Constructors
- C_ImportTagList(void);
- virtual ~C_ImportTagList(void);
-
- virtual wstring toString();
- C_ImportTagList* clone();
-
- void addTag(C_ImportTag* inTag);
- C_ImportTag* getTag(unsigned long inTagNo);
-
-protected:
- virtual void privateClone(C_TagList* outTagList);
-
-};
+*/
+#pragma once
+
+//STL Include Files
+#include <string>
+using namespace std;
+
+//Local Include Files
+#include "C_TagList.h"
+#include "C_ImportTag.h"
+class LIBCMMLTAGS_API C_ImportTagList
+ //Derived Classes
+ : public C_TagList
+{
+public:
+ //Constructors
+ C_ImportTagList(void);
+ virtual ~C_ImportTagList(void);
+
+ virtual wstring toString();
+ C_ImportTagList* clone();
+
+ void addTag(C_ImportTag* inTag);
+ C_ImportTag* getTag(unsigned long inTagNo);
+
+protected:
+ virtual void privateClone(C_TagList* outTagList);
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ImportTagList.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_Int64.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_Int64.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_Int64.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,14 +30,14 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\c_int64.h"
-
-C_Int64::C_Int64(void)
-{
-}
-
-C_Int64::~C_Int64(void)
-{
-}
+*/
+#include "StdAfx.h"
+#include ".\c_int64.h"
+
+C_Int64::C_Int64(void)
+{
+}
+
+C_Int64::~C_Int64(void)
+{
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_Int64.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_Int64.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_Int64.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_Int64.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,13 +30,13 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#pragma once
-
-class LIBCMMLTAGS_API C_Int64
-{
-public:
- C_Int64(void);
- ~C_Int64(void);
-};
+*/
+
+#pragma once
+
+class LIBCMMLTAGS_API C_Int64
+{
+public:
+ C_Int64(void);
+ ~C_Int64(void);
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_Int64.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,41 +30,41 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\c_mappedtag.h"
-
-C_MappedTag::C_MappedTag(void)
-{
-
-}
-
-C_MappedTag::~C_MappedTag(void)
-{
-}
-C_MappedTag::C_MappedTag(wstring inName, wstring inContent) {
- mName = inName;
- mContent = inContent;
-}
-
-//accessors
-wstring C_MappedTag::name() {
- return mName;
-}
-wstring C_MappedTag::content() {
- return mContent;
-}
-
-//mutators
-void C_MappedTag::setName(wstring inName) {
- mName = inName;
-}
-void C_MappedTag::setContent(wstring inContent) {
- mContent = inContent;
-}
-void C_MappedTag::privateClone(C_CMMLTag* outTag) {
- C_HumReadCMMLTag::privateClone(outTag);
- C_MappedTag* locTag = reinterpret_cast<C_MappedTag*>(outTag);
- locTag->setName(mName);
- locTag->setContent(mContent);
+*/
+#include "StdAfx.h"
+#include ".\c_mappedtag.h"
+
+C_MappedTag::C_MappedTag(void)
+{
+
+}
+
+C_MappedTag::~C_MappedTag(void)
+{
+}
+C_MappedTag::C_MappedTag(wstring inName, wstring inContent) {
+ mName = inName;
+ mContent = inContent;
+}
+
+//accessors
+wstring C_MappedTag::name() {
+ return mName;
+}
+wstring C_MappedTag::content() {
+ return mContent;
+}
+
+//mutators
+void C_MappedTag::setName(wstring inName) {
+ mName = inName;
+}
+void C_MappedTag::setContent(wstring inContent) {
+ mContent = inContent;
+}
+void C_MappedTag::privateClone(C_CMMLTag* outTag) {
+ C_HumReadCMMLTag::privateClone(outTag);
+ C_MappedTag* locTag = reinterpret_cast<C_MappedTag*>(outTag);
+ locTag->setName(mName);
+ locTag->setContent(mContent);
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,44 +30,44 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-//STL Include Files
-#include <string>
-using namespace std;
-
-//Local Include Files
-#include "C_HumReadCMMLTag.h"
-
-class LIBCMMLTAGS_API C_MappedTag
- //Derived Classes
- : public C_HumReadCMMLTag
-{
-public:
- //Constructors
- C_MappedTag(void);
- C_MappedTag(wstring inName, wstring inContent);
- virtual ~C_MappedTag(void);
-
- //Accessors
- wstring name();
- wstring content();
-
- //Mutators
- void setName(wstring inName);
- void setContent(wstring inContent);
-
- //Other
- virtual wstring toString() = 0;
- virtual C_MappedTag* mappedClone() = 0;
-
-protected:
- //Property Data
- wstring mName;
- wstring mContent;
-
- //Protected Helper Methods
- virtual void privateClone(C_CMMLTag* outTag);
-
-};
+*/
+#pragma once
+
+//STL Include Files
+#include <string>
+using namespace std;
+
+//Local Include Files
+#include "C_HumReadCMMLTag.h"
+
+class LIBCMMLTAGS_API C_MappedTag
+ //Derived Classes
+ : public C_HumReadCMMLTag
+{
+public:
+ //Constructors
+ C_MappedTag(void);
+ C_MappedTag(wstring inName, wstring inContent);
+ virtual ~C_MappedTag(void);
+
+ //Accessors
+ wstring name();
+ wstring content();
+
+ //Mutators
+ void setName(wstring inName);
+ void setContent(wstring inContent);
+
+ //Other
+ virtual wstring toString() = 0;
+ virtual C_MappedTag* mappedClone() = 0;
+
+protected:
+ //Property Data
+ wstring mName;
+ wstring mContent;
+
+ //Protected Helper Methods
+ virtual void privateClone(C_CMMLTag* outTag);
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTagList.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTagList.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTagList.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,77 +30,77 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\c_mappedtaglist.h"
-
-C_MappedTagList::C_MappedTagList(void)
-{
-}
-
-C_MappedTagList::~C_MappedTagList(void)
-{
- emptyList();
-}
-
-void C_MappedTagList::emptyList() {
- for (unsigned long i = 0; i < mTagList.size(); i++) {
- delete mTagList[i];
- }
- mTagList.clear();
-}
-
-void C_MappedTagList::addTag(C_MappedTag* inTag) {
- //Fix for sorted list
- mTagList.push_back(inTag);
-}
-
-//void C_MappedTagList::addTag(wstring inName, wstring inContent) {
-// C_MappedTag* locMappedTag = new C_MappedTag(inName, inContent);
-// addTag(locMappedTag);
-//}
-
-unsigned long C_MappedTagList::numTags() {
- return (unsigned long)mTagList.size();
-}
-
-C_MappedTag* C_MappedTagList::getTag(unsigned long inTagNo) {
- //Error check index
- if ( (inTagNo < mTagList.size()) && (mTagList.size() > 0)) {
- return mTagList[inTagNo];
- } else {
- //ISSUE :: Or throw exception ??
- return NULL;
- }
-}
-C_MappedTag* C_MappedTagList::getTag(wstring inName) {
- unsigned long i = 0;
- unsigned long locSize = (unsigned long)mTagList.size();
-
- //while there is more items in the list and we haven't found what we are after
- while ( i < locSize ) {
- if (inName == mTagList[i]->name()) {
- //EXIT POINT
- return mTagList[i];
- }
- i++;
- }
- return NULL;
-}
-
-wstring C_MappedTagList::getContent(wstring inName) {
- return getTag(inName)->name();
-}
-
-wstring C_MappedTagList::toString() {
- //FIX ::: Make this do something
- wstring retStr = L"";
- return retStr;
-}
-
-void C_MappedTagList::privateClone(C_MappedTagList* outTagList) {
- for(int i = 0; i < mTagList.size(); i++) {
- outTagList->addTag(mTagList[i]->mappedClone());
-
- }
+*/
+#include "StdAfx.h"
+#include ".\c_mappedtaglist.h"
+
+C_MappedTagList::C_MappedTagList(void)
+{
+}
+
+C_MappedTagList::~C_MappedTagList(void)
+{
+ emptyList();
+}
+
+void C_MappedTagList::emptyList() {
+ for (unsigned long i = 0; i < mTagList.size(); i++) {
+ delete mTagList[i];
+ }
+ mTagList.clear();
+}
+
+void C_MappedTagList::addTag(C_MappedTag* inTag) {
+ //Fix for sorted list
+ mTagList.push_back(inTag);
+}
+
+//void C_MappedTagList::addTag(wstring inName, wstring inContent) {
+// C_MappedTag* locMappedTag = new C_MappedTag(inName, inContent);
+// addTag(locMappedTag);
+//}
+
+unsigned long C_MappedTagList::numTags() {
+ return (unsigned long)mTagList.size();
+}
+
+C_MappedTag* C_MappedTagList::getTag(unsigned long inTagNo) {
+ //Error check index
+ if ( (inTagNo < mTagList.size()) && (mTagList.size() > 0)) {
+ return mTagList[inTagNo];
+ } else {
+ //ISSUE :: Or throw exception ??
+ return NULL;
+ }
+}
+C_MappedTag* C_MappedTagList::getTag(wstring inName) {
+ unsigned long i = 0;
+ unsigned long locSize = (unsigned long)mTagList.size();
+
+ //while there is more items in the list and we haven't found what we are after
+ while ( i < locSize ) {
+ if (inName == mTagList[i]->name()) {
+ //EXIT POINT
+ return mTagList[i];
+ }
+ i++;
+ }
+ return NULL;
+}
+
+wstring C_MappedTagList::getContent(wstring inName) {
+ return getTag(inName)->name();
+}
+
+wstring C_MappedTagList::toString() {
+ //FIX ::: Make this do something
+ wstring retStr = L"";
+ return retStr;
+}
+
+void C_MappedTagList::privateClone(C_MappedTagList* outTagList) {
+ for(int i = 0; i < mTagList.size(); i++) {
+ outTagList->addTag(mTagList[i]->mappedClone());
+
+ }
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTagList.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTagList.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTagList.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTagList.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,49 +30,49 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-//STL Include Files
-#include <string>
-#include <vector>
-using namespace std;
-
-//Local Include Files
-#include "C_MappedTag.h"
-
-class LIBCMMLTAGS_API C_MappedTagList
-{
-public:
- C_MappedTagList(void);
- virtual ~C_MappedTagList(void);
-
- //What to do about this ? **** They are now protected dervied classes implement themselves
- //void addTag(wstring inName, wstring inContent);
-
- //void removeTag ???
- unsigned long numTags();
-
- wstring getContent(wstring mName);
-
- //Maybe not !
- //void addTag(wstring inName, wstring inContent);
-
- virtual wstring toString() = 0;
-
-
-
-protected:
- vector<C_MappedTag*> mTagList;
-
- C_MappedTag* getTag(unsigned long inTagNo);
- C_MappedTag* getTag(wstring mName);
- void addTag(C_MappedTag* inTag);
- void emptyList();
-
-
- //Protected Helper Methods
- virtual void privateClone(C_MappedTagList* outTagList);
-
-
-};
+*/
+#pragma once
+
+//STL Include Files
+#include <string>
+#include <vector>
+using namespace std;
+
+//Local Include Files
+#include "C_MappedTag.h"
+
+class LIBCMMLTAGS_API C_MappedTagList
+{
+public:
+ C_MappedTagList(void);
+ virtual ~C_MappedTagList(void);
+
+ //What to do about this ? **** They are now protected dervied classes implement themselves
+ //void addTag(wstring inName, wstring inContent);
+
+ //void removeTag ???
+ unsigned long numTags();
+
+ wstring getContent(wstring mName);
+
+ //Maybe not !
+ //void addTag(wstring inName, wstring inContent);
+
+ virtual wstring toString() = 0;
+
+
+
+protected:
+ vector<C_MappedTag*> mTagList;
+
+ C_MappedTag* getTag(unsigned long inTagNo);
+ C_MappedTag* getTag(wstring mName);
+ void addTag(C_MappedTag* inTag);
+ void emptyList();
+
+
+ //Protected Helper Methods
+ virtual void privateClone(C_MappedTagList* outTagList);
+
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MappedTagList.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,65 +30,65 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\c_metatag.h"
-
-C_MetaTag::C_MetaTag(void)
-{
- mTagType = C_CMMLTag::eTagType::META;
-}
-
-C_MetaTag::~C_MetaTag(void)
-{
-}
-//Accessors
-wstring C_MetaTag::scheme() {
- return mScheme;
-}
-
-//Mutators
-void C_MetaTag::setScheme(wstring inScheme) {
- mScheme = inScheme;
-}
-
-//Other
-
-void C_MetaTag::privateClone(C_CMMLTag* outTag) {
- C_MappedTag::privateClone(outTag);
- C_MetaTag* locTag = reinterpret_cast<C_MetaTag*>(outTag);
- locTag->setScheme(mScheme);
-}
-C_MetaTag* C_MetaTag::clone() {
- C_MetaTag* retTag = new C_MetaTag;
- privateClone(retTag);
- return retTag;
-
-}
-C_CMMLTag* C_MetaTag::genericClone() {
- return clone();
-}
-C_MappedTag* C_MetaTag::mappedClone() {
- return clone();
-}
-wstring C_MetaTag::toString() {
- //QUERY ::: How are the internationalisation tags included
- wstring retStr = L"<meta";
-
- if (mId.size() != 0) {
- retStr += makeElement(L"id", mId);
- }
-
- retStr += makeLangElements();
- retStr += makeElement(L"name", mName);
- retStr += makeElement(L"content", mContent);
-
- if (mScheme != L"") {
- retStr += makeElement(L"scheme", mScheme);
- }
-
- retStr += L"/>\n";
-
-
- return retStr;
-}
+*/
+#include "StdAfx.h"
+#include ".\c_metatag.h"
+
+C_MetaTag::C_MetaTag(void)
+{
+ mTagType = C_CMMLTag::eTagType::META;
+}
+
+C_MetaTag::~C_MetaTag(void)
+{
+}
+//Accessors
+wstring C_MetaTag::scheme() {
+ return mScheme;
+}
+
+//Mutators
+void C_MetaTag::setScheme(wstring inScheme) {
+ mScheme = inScheme;
+}
+
+//Other
+
+void C_MetaTag::privateClone(C_CMMLTag* outTag) {
+ C_MappedTag::privateClone(outTag);
+ C_MetaTag* locTag = reinterpret_cast<C_MetaTag*>(outTag);
+ locTag->setScheme(mScheme);
+}
+C_MetaTag* C_MetaTag::clone() {
+ C_MetaTag* retTag = new C_MetaTag;
+ privateClone(retTag);
+ return retTag;
+
+}
+C_CMMLTag* C_MetaTag::genericClone() {
+ return clone();
+}
+C_MappedTag* C_MetaTag::mappedClone() {
+ return clone();
+}
+wstring C_MetaTag::toString() {
+ //QUERY ::: How are the internationalisation tags included
+ wstring retStr = L"<meta";
+
+ if (mId.size() != 0) {
+ retStr += makeElement(L"id", mId);
+ }
+
+ retStr += makeLangElements();
+ retStr += makeElement(L"name", mName);
+ retStr += makeElement(L"content", mContent);
+
+ if (mScheme != L"") {
+ retStr += makeElement(L"scheme", mScheme);
+ }
+
+ retStr += L"/>\n";
+
+
+ return retStr;
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,53 +30,53 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-//STL Include Files
-#include <string>
-using namespace std;
-
-//Local Include Files
-#include "C_MappedTag.h"
-
-class LIBCMMLTAGS_API C_MetaTag
- //Derived Classes
- : public C_MappedTag
-{
-public:
- //Constructors
- C_MetaTag(void);
- virtual ~C_MetaTag(void);
-
- //Accessors
- wstring scheme();
-
- //Mutators
- void setScheme(wstring inScheme);
-
- //Other
- virtual wstring toString();
- C_MetaTag* clone();
- virtual C_CMMLTag* genericClone();
- virtual C_MappedTag* mappedClone();
-
-protected:
- //Property Data
- wstring mScheme;
-
- //Protected Helper Methods
- virtual void privateClone(C_CMMLTag* outTag);
-
-
-};
-
-
- //typedef struct {
- // char *id; /**< id attribute of meta element */
- // char *lang; /**< language code of meta element */
- // char *dir; /**< directionality of lang (ltr/rtl) */
- // char *name; /**< property name of meta element */
- // char *content; /**< property value of meta element */
- // char *scheme; /**< scheme name of meta element */
- //} CMML_MetaElement;
+*/
+#pragma once
+
+//STL Include Files
+#include <string>
+using namespace std;
+
+//Local Include Files
+#include "C_MappedTag.h"
+
+class LIBCMMLTAGS_API C_MetaTag
+ //Derived Classes
+ : public C_MappedTag
+{
+public:
+ //Constructors
+ C_MetaTag(void);
+ virtual ~C_MetaTag(void);
+
+ //Accessors
+ wstring scheme();
+
+ //Mutators
+ void setScheme(wstring inScheme);
+
+ //Other
+ virtual wstring toString();
+ C_MetaTag* clone();
+ virtual C_CMMLTag* genericClone();
+ virtual C_MappedTag* mappedClone();
+
+protected:
+ //Property Data
+ wstring mScheme;
+
+ //Protected Helper Methods
+ virtual void privateClone(C_CMMLTag* outTag);
+
+
+};
+
+
+ //typedef struct {
+ // char *id; /**< id attribute of meta element */
+ // char *lang; /**< language code of meta element */
+ // char *dir; /**< directionality of lang (ltr/rtl) */
+ // char *name; /**< property name of meta element */
+ // char *content; /**< property value of meta element */
+ // char *scheme; /**< scheme name of meta element */
+ //} CMML_MetaElement;
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTagList.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTagList.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTagList.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,67 +30,67 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\c_metataglist.h"
-
-C_MetaTagList::C_MetaTagList(void)
-{
-}
-
-C_MetaTagList::~C_MetaTagList(void)
-{
- //Everything is deleted by the base class
-}
-
-
-void C_MetaTagList::addTag(C_MetaTag* inTag) {
- C_MappedTagList::addTag(inTag);
-}
-
-void C_MetaTagList::emptyList() {
- C_MappedTagList::emptyList();
-
-}
-
-
-void C_MetaTagList::addTag(wstring inName, wstring inContent) {
- C_MetaTag* retTag = new C_MetaTag;
- retTag->setName(inName);
- retTag->setContent(inContent);
- addTag(retTag);
-
-}
-//void removeTag ???
-
-//Dynamic casting ?????
-C_MetaTag* C_MetaTagList::getTag(unsigned long inTagNo) {
- return (C_MetaTag*) mTagList[inTagNo];
-}
-C_MetaTag* C_MetaTagList::getTag(wstring inName) {
- return (C_MetaTag*) C_MappedTagList::getTag(inName);
-}
-
-wstring C_MetaTagList::getContent(wstring inName) {
- return getTag(inName)->content();
-}
-
-wstring C_MetaTagList::toString() {
-
- wstring retStr;
- for (unsigned long i = 0; i < mTagList.size(); i++) {
- retStr+=mTagList[i]->toString();
- }
- return retStr;
-
-}
-
-C_MetaTagList* C_MetaTagList::clone() {
- C_MetaTagList* retList = new C_MetaTagList;
- privateClone(retList);
- return retList;
-}
-void C_MetaTagList::privateClone(C_MappedTagList* outTagList) {
- C_MappedTagList::privateClone(outTagList);
-
+*/
+#include "StdAfx.h"
+#include ".\c_metataglist.h"
+
+C_MetaTagList::C_MetaTagList(void)
+{
+}
+
+C_MetaTagList::~C_MetaTagList(void)
+{
+ //Everything is deleted by the base class
+}
+
+
+void C_MetaTagList::addTag(C_MetaTag* inTag) {
+ C_MappedTagList::addTag(inTag);
+}
+
+void C_MetaTagList::emptyList() {
+ C_MappedTagList::emptyList();
+
+}
+
+
+void C_MetaTagList::addTag(wstring inName, wstring inContent) {
+ C_MetaTag* retTag = new C_MetaTag;
+ retTag->setName(inName);
+ retTag->setContent(inContent);
+ addTag(retTag);
+
+}
+//void removeTag ???
+
+//Dynamic casting ?????
+C_MetaTag* C_MetaTagList::getTag(unsigned long inTagNo) {
+ return (C_MetaTag*) mTagList[inTagNo];
+}
+C_MetaTag* C_MetaTagList::getTag(wstring inName) {
+ return (C_MetaTag*) C_MappedTagList::getTag(inName);
+}
+
+wstring C_MetaTagList::getContent(wstring inName) {
+ return getTag(inName)->content();
+}
+
+wstring C_MetaTagList::toString() {
+
+ wstring retStr;
+ for (unsigned long i = 0; i < mTagList.size(); i++) {
+ retStr+=mTagList[i]->toString();
+ }
+ return retStr;
+
+}
+
+C_MetaTagList* C_MetaTagList::clone() {
+ C_MetaTagList* retList = new C_MetaTagList;
+ privateClone(retList);
+ return retList;
+}
+void C_MetaTagList::privateClone(C_MappedTagList* outTagList) {
+ C_MappedTagList::privateClone(outTagList);
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTagList.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTagList.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTagList.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTagList.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,33 +30,33 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-#include "C_MappedTagList.h"
-#include "C_MetaTag.h"
-
-class LIBCMMLTAGS_API C_MetaTagList
- : public C_MappedTagList
-{
-public:
- C_MetaTagList(void);
- virtual ~C_MetaTagList(void);
-
- void emptyList();
- void addTag(C_MetaTag* inTag);
- void addTag(wstring inName, wstring inContent);
- //void removeTag ???
- //unsigned long numTags();
-
- C_MetaTag* getTag(unsigned long inTagNo);
- C_MetaTag* getTag(wstring inName);
-
- wstring getContent(wstring inName);
-
- virtual wstring toString();
- C_MetaTagList* clone();
-protected:
- //Protected Helper Methods
- virtual void privateClone(C_MappedTagList* outTagList);
-
-};
+*/
+#pragma once
+#include "C_MappedTagList.h"
+#include "C_MetaTag.h"
+
+class LIBCMMLTAGS_API C_MetaTagList
+ : public C_MappedTagList
+{
+public:
+ C_MetaTagList(void);
+ virtual ~C_MetaTagList(void);
+
+ void emptyList();
+ void addTag(C_MetaTag* inTag);
+ void addTag(wstring inName, wstring inContent);
+ //void removeTag ???
+ //unsigned long numTags();
+
+ C_MetaTag* getTag(unsigned long inTagNo);
+ C_MetaTag* getTag(wstring inName);
+
+ wstring getContent(wstring inName);
+
+ virtual wstring toString();
+ C_MetaTagList* clone();
+protected:
+ //Protected Helper Methods
+ virtual void privateClone(C_MappedTagList* outTagList);
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_MetaTagList.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,45 +30,45 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\c_paramtag.h"
-
-C_ParamTag::C_ParamTag(void)
-{
-}
-
-C_ParamTag::~C_ParamTag(void)
-{
-}
-
-wstring C_ParamTag::toString() {
- wstring retStr;
- retStr = L"<param";
- if (mId.size() != 0) {
- retStr += makeElement(L"id", mId);
- }
-
- retStr += makeLangElements();
- retStr += makeElement(L"name", mName);
- retStr += makeElement(L"value", mContent);
- retStr += L"/>\n";
- return retStr;
-
-}
-
-void C_ParamTag::privateClone(C_CMMLTag* outTag) {
- C_MappedTag::privateClone(outTag);
-}
-C_ParamTag* C_ParamTag::clone() {
- C_ParamTag* retTag = new C_ParamTag;
- privateClone(retTag);
- return retTag;
-
-}
-C_MappedTag* C_ParamTag::mappedClone() {
- return clone();
-}
-C_CMMLTag* C_ParamTag::genericClone() {
- return clone();
+*/
+#include "StdAfx.h"
+#include ".\c_paramtag.h"
+
+C_ParamTag::C_ParamTag(void)
+{
+}
+
+C_ParamTag::~C_ParamTag(void)
+{
+}
+
+wstring C_ParamTag::toString() {
+ wstring retStr;
+ retStr = L"<param";
+ if (mId.size() != 0) {
+ retStr += makeElement(L"id", mId);
+ }
+
+ retStr += makeLangElements();
+ retStr += makeElement(L"name", mName);
+ retStr += makeElement(L"value", mContent);
+ retStr += L"/>\n";
+ return retStr;
+
+}
+
+void C_ParamTag::privateClone(C_CMMLTag* outTag) {
+ C_MappedTag::privateClone(outTag);
+}
+C_ParamTag* C_ParamTag::clone() {
+ C_ParamTag* retTag = new C_ParamTag;
+ privateClone(retTag);
+ return retTag;
+
+}
+C_MappedTag* C_ParamTag::mappedClone() {
+ return clone();
+}
+C_CMMLTag* C_ParamTag::genericClone() {
+ return clone();
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,34 +30,34 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-//STL Include Files
-#include <string>
-using namespace std;
-
-//Local Include Files
-#include "c_mappedtag.h"
-
-class LIBCMMLTAGS_API C_ParamTag
- //Derived Classes
- : public C_MappedTag
-{
-public:
- //Constructors
- C_ParamTag(void);
- virtual ~C_ParamTag(void);
-
- //Other
- virtual wstring toString();
- C_ParamTag* clone();
- virtual C_CMMLTag* genericClone();
- virtual C_MappedTag* mappedClone();
-
-protected:
-
- //Protected Helper Methods
- virtual void privateClone(C_CMMLTag* outTag);
-
-};
+*/
+#pragma once
+
+//STL Include Files
+#include <string>
+using namespace std;
+
+//Local Include Files
+#include "c_mappedtag.h"
+
+class LIBCMMLTAGS_API C_ParamTag
+ //Derived Classes
+ : public C_MappedTag
+{
+public:
+ //Constructors
+ C_ParamTag(void);
+ virtual ~C_ParamTag(void);
+
+ //Other
+ virtual wstring toString();
+ C_ParamTag* clone();
+ virtual C_CMMLTag* genericClone();
+ virtual C_MappedTag* mappedClone();
+
+protected:
+
+ //Protected Helper Methods
+ virtual void privateClone(C_CMMLTag* outTag);
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTagList.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTagList.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTagList.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,35 +30,35 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\c_paramtaglist.h"
-
-C_ParamTagList::C_ParamTagList(void)
-{
-}
-
-C_ParamTagList::~C_ParamTagList(void)
-{
- //Everything is deleted by the base class
-}
-wstring C_ParamTagList::toString() {
-
- wstring retStr = L"";
- for (unsigned long i = 0; i < mTagList.size(); i++) {
- retStr += mTagList[i]->toString();
- }
- return retStr;
-}
-
-void C_ParamTagList::addTag(C_ParamTag* inTag) {
- C_MappedTagList::addTag(inTag);
-}
-C_ParamTag* C_ParamTagList::getTag(unsigned long inTagNo) {
- return (C_ParamTag*)C_MappedTagList::getTag(inTagNo);
-}
-C_ParamTagList* C_ParamTagList::clone() {
- C_ParamTagList* retList = new C_ParamTagList;
- privateClone(retList);
- return retList;
+*/
+#include "StdAfx.h"
+#include ".\c_paramtaglist.h"
+
+C_ParamTagList::C_ParamTagList(void)
+{
+}
+
+C_ParamTagList::~C_ParamTagList(void)
+{
+ //Everything is deleted by the base class
+}
+wstring C_ParamTagList::toString() {
+
+ wstring retStr = L"";
+ for (unsigned long i = 0; i < mTagList.size(); i++) {
+ retStr += mTagList[i]->toString();
+ }
+ return retStr;
+}
+
+void C_ParamTagList::addTag(C_ParamTag* inTag) {
+ C_MappedTagList::addTag(inTag);
+}
+C_ParamTag* C_ParamTagList::getTag(unsigned long inTagNo) {
+ return (C_ParamTag*)C_MappedTagList::getTag(inTagNo);
+}
+C_ParamTagList* C_ParamTagList::clone() {
+ C_ParamTagList* retList = new C_ParamTagList;
+ privateClone(retList);
+ return retList;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTagList.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTagList.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTagList.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTagList.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,36 +30,36 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-
-//STL Include Files
-#include <string>
-using namespace std;
-
-//Local Include Files
-#include "C_ParamTag.h"
-#include "C_MappedTagList.h"
-
-class LIBCMMLTAGS_API C_ParamTagList
- //Derived Classes
- : public C_MappedTagList
-{
-public:
- //Constructors
- C_ParamTagList(void);
- virtual ~C_ParamTagList(void);
-
- //Accessors
- C_ParamTag* getTag(unsigned long inTagNo);
-
- //Mutators
- void addTag(C_ParamTag* inTag);
-
-
- //Other
- virtual wstring toString();
- C_ParamTagList* clone();
-
-};
+*/
+#pragma once
+
+
+//STL Include Files
+#include <string>
+using namespace std;
+
+//Local Include Files
+#include "C_ParamTag.h"
+#include "C_MappedTagList.h"
+
+class LIBCMMLTAGS_API C_ParamTagList
+ //Derived Classes
+ : public C_MappedTagList
+{
+public:
+ //Constructors
+ C_ParamTagList(void);
+ virtual ~C_ParamTagList(void);
+
+ //Accessors
+ C_ParamTag* getTag(unsigned long inTagNo);
+
+ //Mutators
+ void addTag(C_ParamTag* inTag);
+
+
+ //Other
+ virtual wstring toString();
+ C_ParamTagList* clone();
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_ParamTagList.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_StreamTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_StreamTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_StreamTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,81 +30,81 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\c_streamtag.h"
-
-C_StreamTag::C_StreamTag(void)
-{
- mTagType = C_CMMLTag::eTagType::STREAM;
- mImportList = new C_ImportTagList;
- mTimebase = L"0";
-}
-
-C_StreamTag::~C_StreamTag(void)
-{
- delete mImportList;
-}
-
-//Accessors
-wstring C_StreamTag::timebase() {
- return mTimebase;
-}
-wstring C_StreamTag::utc() {
- return mUtc;
-}
-C_ImportTagList* C_StreamTag::importList() {
- return mImportList;
-}
-
-//Mutators
-void C_StreamTag::setTimebase(wstring inTimebase) {
- mTimebase = inTimebase;
-}
-void C_StreamTag::setUtc(wstring inUtc) {
- mUtc = inUtc;
-}
-
-void C_StreamTag::setImportList(C_ImportTagList* inTagList) {
- delete mImportList;
- mImportList = inTagList;
-}
-
-//Other
-
-void C_StreamTag::privateClone(C_CMMLTag* outTag) {
- C_CMMLTag::privateClone(outTag);
- C_StreamTag* locTag = reinterpret_cast<C_StreamTag*>(outTag);
- locTag->setUtc(mUtc);
- locTag->setTimebase(mTimebase);
- locTag->setImportList(mImportList->clone());
-
-}
-
-C_StreamTag* C_StreamTag::clone() {
- C_StreamTag* retTag = new C_StreamTag;
- privateClone(retTag);
- return retTag;
-
-}
-C_CMMLTag* C_StreamTag::genericClone() {
- return clone();
-}
-wstring C_StreamTag::toString() {
- //FIX ::: Make this do something
- wstring retStr;
-
- retStr = L"<stream";
- if (mId.size() != 0) {
- retStr += makeElement(L"id", mId);
- }
- retStr += makeElement(L"timebase", mTimebase);
- if (mUtc.size() != 0) {
- retStr += makeElement(L"utc", mUtc);
- }
- retStr += L">\n";
- retStr += mImportList->toString();
- retStr += L"</stream>\n\n";
-
- return retStr;
-}
+*/
+#include "StdAfx.h"
+#include ".\c_streamtag.h"
+
+C_StreamTag::C_StreamTag(void)
+{
+ mTagType = C_CMMLTag::eTagType::STREAM;
+ mImportList = new C_ImportTagList;
+ mTimebase = L"0";
+}
+
+C_StreamTag::~C_StreamTag(void)
+{
+ delete mImportList;
+}
+
+//Accessors
+wstring C_StreamTag::timebase() {
+ return mTimebase;
+}
+wstring C_StreamTag::utc() {
+ return mUtc;
+}
+C_ImportTagList* C_StreamTag::importList() {
+ return mImportList;
+}
+
+//Mutators
+void C_StreamTag::setTimebase(wstring inTimebase) {
+ mTimebase = inTimebase;
+}
+void C_StreamTag::setUtc(wstring inUtc) {
+ mUtc = inUtc;
+}
+
+void C_StreamTag::setImportList(C_ImportTagList* inTagList) {
+ delete mImportList;
+ mImportList = inTagList;
+}
+
+//Other
+
+void C_StreamTag::privateClone(C_CMMLTag* outTag) {
+ C_CMMLTag::privateClone(outTag);
+ C_StreamTag* locTag = reinterpret_cast<C_StreamTag*>(outTag);
+ locTag->setUtc(mUtc);
+ locTag->setTimebase(mTimebase);
+ locTag->setImportList(mImportList->clone());
+
+}
+
+C_StreamTag* C_StreamTag::clone() {
+ C_StreamTag* retTag = new C_StreamTag;
+ privateClone(retTag);
+ return retTag;
+
+}
+C_CMMLTag* C_StreamTag::genericClone() {
+ return clone();
+}
+wstring C_StreamTag::toString() {
+ //FIX ::: Make this do something
+ wstring retStr;
+
+ retStr = L"<stream";
+ if (mId.size() != 0) {
+ retStr += makeElement(L"id", mId);
+ }
+ retStr += makeElement(L"timebase", mTimebase);
+ if (mUtc.size() != 0) {
+ retStr += makeElement(L"utc", mUtc);
+ }
+ retStr += L">\n";
+ retStr += mImportList->toString();
+ retStr += L"</stream>\n\n";
+
+ return retStr;
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_StreamTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_StreamTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_StreamTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_StreamTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,58 +30,58 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-//STL Include Files
-#include <string>
-using namespace std;
-
-//Local Include Files
-#include "C_CMMLTag.h"
-#include "C_ImportTagList.h"
-
-class LIBCMMLTAGS_API C_StreamTag
- //Derived Classes
- : public C_CMMLTag
-{
-public:
- //Constructors
- C_StreamTag(void);
- virtual ~C_StreamTag(void);
-
- //Accessors
- wstring timebase();
- wstring utc();
- C_ImportTagList* importList();
-
- //Mutators
- void setTimebase(wstring inTimebase);
- void setUtc(wstring inUtc);
- void setImportList(C_ImportTagList* inTagList);
-
- //Other
- virtual wstring toString();
- C_StreamTag* clone();
- virtual C_CMMLTag* genericClone();
-
-
-
-protected:
- //Property Data
- wstring mTimebase;
- wstring mUtc;
- C_ImportTagList* mImportList;
-
- //Protected Helper Methods
- virtual void privateClone(C_CMMLTag* outTag);
-
-};
-
- //typedef struct {
- // char *id; /**< id attribute of stream element */
- // CMML_Time * timebase; /**< timebase attribute of stream element */
- // CMML_Time * utc; /**< utc attribute of stream element */
- // CMML_List * import; /**< list of import elements */
- //} CMML_Stream;
-
+*/
+#pragma once
+
+//STL Include Files
+#include <string>
+using namespace std;
+
+//Local Include Files
+#include "C_CMMLTag.h"
+#include "C_ImportTagList.h"
+
+class LIBCMMLTAGS_API C_StreamTag
+ //Derived Classes
+ : public C_CMMLTag
+{
+public:
+ //Constructors
+ C_StreamTag(void);
+ virtual ~C_StreamTag(void);
+
+ //Accessors
+ wstring timebase();
+ wstring utc();
+ C_ImportTagList* importList();
+
+ //Mutators
+ void setTimebase(wstring inTimebase);
+ void setUtc(wstring inUtc);
+ void setImportList(C_ImportTagList* inTagList);
+
+ //Other
+ virtual wstring toString();
+ C_StreamTag* clone();
+ virtual C_CMMLTag* genericClone();
+
+
+
+protected:
+ //Property Data
+ wstring mTimebase;
+ wstring mUtc;
+ C_ImportTagList* mImportList;
+
+ //Protected Helper Methods
+ virtual void privateClone(C_CMMLTag* outTag);
+
+};
+
+ //typedef struct {
+ // char *id; /**< id attribute of stream element */
+ // CMML_Time * timebase; /**< timebase attribute of stream element */
+ // CMML_Time * utc; /**< utc attribute of stream element */
+ // CMML_List * import; /**< list of import elements */
+ //} CMML_Stream;
+
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_StreamTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TagList.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TagList.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TagList.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,55 +30,55 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\c_taglist.h"
-
-C_TagList::C_TagList(void)
-{
-}
-
-C_TagList::~C_TagList(void)
-{
- //Empty the tag list
- for (unsigned long i = 0; i < mTagList.size(); i++) {
- delete mTagList[i];
- }
-
- mTagList.clear();
-}
-
-void C_TagList::addTag(C_CMMLTag* inTag) {
- //Fix for sorted list
- mTagList.push_back(inTag);
-}
-unsigned long C_TagList::numTags() {
- return (unsigned long)mTagList.size();
-}
-
-C_CMMLTag* C_TagList::getTag(unsigned long inTagNo) {
- //Error check index
- if ( (inTagNo < mTagList.size()) && (mTagList.size() > 0)) {
- return mTagList[inTagNo];
- } else {
- //ISSUE :: Or throw exception ??
- return NULL;
- }
-}
-
-wstring C_TagList::toString() {
- //Return the CMML of the list of tags appended together
- wstring retStr = L"";
-
- for (unsigned long i = 0; i < mTagList.size(); i++) {
- retStr.append(mTagList[i]->toString());
- }
- return retStr;
-}
-
-void C_TagList::privateClone(C_TagList* outTagList) {
- for (int i = 0; i < mTagList.size(); i++) {
- outTagList->addTag(mTagList[i]->genericClone());
- }
-
+*/
+#include "StdAfx.h"
+#include ".\c_taglist.h"
+
+C_TagList::C_TagList(void)
+{
+}
+
+C_TagList::~C_TagList(void)
+{
+ //Empty the tag list
+ for (unsigned long i = 0; i < mTagList.size(); i++) {
+ delete mTagList[i];
+ }
+
+ mTagList.clear();
+}
+
+void C_TagList::addTag(C_CMMLTag* inTag) {
+ //Fix for sorted list
+ mTagList.push_back(inTag);
+}
+unsigned long C_TagList::numTags() {
+ return (unsigned long)mTagList.size();
+}
+
+C_CMMLTag* C_TagList::getTag(unsigned long inTagNo) {
+ //Error check index
+ if ( (inTagNo < mTagList.size()) && (mTagList.size() > 0)) {
+ return mTagList[inTagNo];
+ } else {
+ //ISSUE :: Or throw exception ??
+ return NULL;
+ }
+}
+
+wstring C_TagList::toString() {
+ //Return the CMML of the list of tags appended together
+ wstring retStr = L"";
+
+ for (unsigned long i = 0; i < mTagList.size(); i++) {
+ retStr.append(mTagList[i]->toString());
+ }
+ return retStr;
+}
+
+void C_TagList::privateClone(C_TagList* outTagList) {
+ for (int i = 0; i < mTagList.size(); i++) {
+ outTagList->addTag(mTagList[i]->genericClone());
+ }
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TagList.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TagList.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TagList.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TagList.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,41 +30,41 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-//STL Include Files
-#include <vector>
-#include <string>
-using namespace std;
-
-//Local Include Files
-#include "C_CMMLTag.h"
-
-
-class LIBCMMLTAGS_API C_TagList
-{
-public:
- //Constructors
- C_TagList(void);
- virtual ~C_TagList(void);
-
- //void removeTag ???
-
- //Accessors
- unsigned long numTags();
-
- //Other
- virtual wstring toString() = 0;
-
-protected:
- //Property Data
- vector<C_CMMLTag*> mTagList;
-
- //Protected Member Functions
- void addTag(C_CMMLTag* inTag);
- C_CMMLTag* getTag(unsigned long inTagNo);
-
-
- virtual void privateClone(C_TagList* outTagList);
-};
+*/
+#pragma once
+
+//STL Include Files
+#include <vector>
+#include <string>
+using namespace std;
+
+//Local Include Files
+#include "C_CMMLTag.h"
+
+
+class LIBCMMLTAGS_API C_TagList
+{
+public:
+ //Constructors
+ C_TagList(void);
+ virtual ~C_TagList(void);
+
+ //void removeTag ???
+
+ //Accessors
+ unsigned long numTags();
+
+ //Other
+ virtual wstring toString() = 0;
+
+protected:
+ //Property Data
+ vector<C_CMMLTag*> mTagList;
+
+ //Protected Member Functions
+ void addTag(C_CMMLTag* inTag);
+ C_CMMLTag* getTag(unsigned long inTagNo);
+
+
+ virtual void privateClone(C_TagList* outTagList);
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TagList.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TextFieldTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TextFieldTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TextFieldTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,29 +30,29 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\c_textfieldtag.h"
-
-C_TextFieldTag::C_TextFieldTag(void)
-{
-}
-
-C_TextFieldTag::~C_TextFieldTag(void)
-{
-}
-
-//Accessors
-wstring C_TextFieldTag::text() {
- return mText;
-}
-
-//Mutators
-void C_TextFieldTag::setText(wstring inText) {
- mText = inText;
-}
-
-void C_TextFieldTag::privateClone(C_CMMLTag* outTag) {
- C_HumReadCMMLTag::privateClone(outTag);
- ((C_TextFieldTag*)outTag)->setText(mText);
+*/
+#include "StdAfx.h"
+#include ".\c_textfieldtag.h"
+
+C_TextFieldTag::C_TextFieldTag(void)
+{
+}
+
+C_TextFieldTag::~C_TextFieldTag(void)
+{
+}
+
+//Accessors
+wstring C_TextFieldTag::text() {
+ return mText;
+}
+
+//Mutators
+void C_TextFieldTag::setText(wstring inText) {
+ mText = inText;
+}
+
+void C_TextFieldTag::privateClone(C_CMMLTag* outTag) {
+ C_HumReadCMMLTag::privateClone(outTag);
+ ((C_TextFieldTag*)outTag)->setText(mText);
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TextFieldTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TextFieldTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TextFieldTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TextFieldTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,38 +30,38 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-//STL Include Files
-#include <string>
-using namespace std;
-
-//Local Include Files
-#include "C_HumReadCMMLTag.h"
-
-class LIBCMMLTAGS_API C_TextFieldTag
- //Derived Classes
- : public C_HumReadCMMLTag
-{
-public:
- //Constructors
- C_TextFieldTag(void);
- virtual ~C_TextFieldTag(void);
-
- //Accessors
- wstring text();
-
- //Mutators
- void setText(wstring inText);
-
- //Other
- virtual wstring toString() = 0;
-protected:
- //Property Data
- wstring mText;
-
- //Protected Helper Methods
- virtual void privateClone(C_CMMLTag* outTag);
-
-};
+*/
+#pragma once
+
+//STL Include Files
+#include <string>
+using namespace std;
+
+//Local Include Files
+#include "C_HumReadCMMLTag.h"
+
+class LIBCMMLTAGS_API C_TextFieldTag
+ //Derived Classes
+ : public C_HumReadCMMLTag
+{
+public:
+ //Constructors
+ C_TextFieldTag(void);
+ virtual ~C_TextFieldTag(void);
+
+ //Accessors
+ wstring text();
+
+ //Mutators
+ void setText(wstring inText);
+
+ //Other
+ virtual wstring toString() = 0;
+protected:
+ //Property Data
+ wstring mText;
+
+ //Protected Helper Methods
+ virtual void privateClone(C_CMMLTag* outTag);
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TextFieldTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TitleTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TitleTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TitleTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,42 +30,42 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\c_titletag.h"
-
-C_TitleTag::C_TitleTag(void)
-{
- mTagType = C_CMMLTag::eTagType::TITLE;
-}
-
-C_TitleTag::~C_TitleTag(void)
-{
-}
-
-wstring C_TitleTag::toString() {
- //FIX ::: Make this do something
- wstring retStr = L"<title";
-
- if (mId.size() != 0) {
- retStr += makeElement(L"id", mId);
- }
-
- retStr += makeLangElements();
- retStr += L">";
- retStr += mText;
- retStr+= L"</title>\n";
- return retStr;
-}
-void C_TitleTag::privateClone(C_CMMLTag* outTag) {
- C_TextFieldTag::privateClone(outTag);
-}
-C_TitleTag* C_TitleTag::clone() {
- C_TitleTag* retTag = new C_TitleTag;
- privateClone(retTag);
- return retTag;
-
-}
-C_CMMLTag* C_TitleTag::genericClone() {
- return clone();
+*/
+#include "StdAfx.h"
+#include ".\c_titletag.h"
+
+C_TitleTag::C_TitleTag(void)
+{
+ mTagType = C_CMMLTag::eTagType::TITLE;
+}
+
+C_TitleTag::~C_TitleTag(void)
+{
+}
+
+wstring C_TitleTag::toString() {
+ //FIX ::: Make this do something
+ wstring retStr = L"<title";
+
+ if (mId.size() != 0) {
+ retStr += makeElement(L"id", mId);
+ }
+
+ retStr += makeLangElements();
+ retStr += L">";
+ retStr += mText;
+ retStr+= L"</title>\n";
+ return retStr;
+}
+void C_TitleTag::privateClone(C_CMMLTag* outTag) {
+ C_TextFieldTag::privateClone(outTag);
+}
+C_TitleTag* C_TitleTag::clone() {
+ C_TitleTag* retTag = new C_TitleTag;
+ privateClone(retTag);
+ return retTag;
+
+}
+C_CMMLTag* C_TitleTag::genericClone() {
+ return clone();
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TitleTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TitleTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TitleTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TitleTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,32 +30,32 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-//STL Include Files
-#include <string>
-using namespace std;
-
-//Local Include Files
-#include "C_TextFieldTag.h"
-
-class LIBCMMLTAGS_API C_TitleTag
- //Derived Classes
- : public C_TextFieldTag
-{
-public:
- //Constructors
- C_TitleTag(void);
- virtual ~C_TitleTag(void);
-
- //Other
- virtual wstring toString();
- C_TitleTag* clone();
- virtual C_CMMLTag* genericClone();
-protected:
- //Protected Helper Methods
- virtual void privateClone(C_CMMLTag* outTag);
-
-
-};
+*/
+#pragma once
+
+//STL Include Files
+#include <string>
+using namespace std;
+
+//Local Include Files
+#include "C_TextFieldTag.h"
+
+class LIBCMMLTAGS_API C_TitleTag
+ //Derived Classes
+ : public C_TextFieldTag
+{
+public:
+ //Constructors
+ C_TitleTag(void);
+ virtual ~C_TitleTag(void);
+
+ //Other
+ virtual wstring toString();
+ C_TitleTag* clone();
+ virtual C_CMMLTag* genericClone();
+protected:
+ //Protected Helper Methods
+ virtual void privateClone(C_CMMLTag* outTag);
+
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/C_TitleTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/config.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/config.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/config.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,19 +30,19 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-// The following ifdef block is the standard way of creating macros which make exporting
-// from a DLL simpler. All files within this DLL are compiled with the CPP_LIB_CMML_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see
-// LIBCMMLTAGS_API functions as being imported from a DLL, whereas this DLL sees symbols
-// defined with this macro as being exported.
-
-#ifdef LIBCMMLTAGS_EXPORTS
-#define LIBCMMLTAGS_API __declspec(dllexport)
-#pragma message ("Exporting libCMMLTags Library Symbols...")
-#else
-#define LIBCMMLTAGS_API __declspec(dllimport)
-#pragma message ("Importing libCMMLTags Library Symbols...")
+*/
+
+// The following ifdef block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the CPP_LIB_CMML_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// LIBCMMLTAGS_API functions as being imported from a DLL, whereas this DLL sees symbols
+// defined with this macro as being exported.
+
+#ifdef LIBCMMLTAGS_EXPORTS
+#define LIBCMMLTAGS_API __declspec(dllexport)
+#pragma message ("Exporting libCMMLTags Library Symbols...")
+#else
+#define LIBCMMLTAGS_API __declspec(dllimport)
+#pragma message ("Importing libCMMLTags Library Symbols...")
#endif
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/config.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/cpp_lib_cmml.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/cpp_lib_cmml.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/cpp_lib_cmml.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,31 +30,31 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-// cpp_lib_cmml.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-#include "cpp_lib_cmml.h"
-
-//Ignore these unreferenced variable wanrings only for this file
-#pragma warning(push)
-#pragma warning(disable: 4100)
-
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
-}
-
-#pragma warning(pop)
+*/
+// cpp_lib_cmml.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+#include "cpp_lib_cmml.h"
+
+//Ignore these unreferenced variable wanrings only for this file
+#pragma warning(push)
+#pragma warning(disable: 4100)
+
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ switch (ul_reason_for_call)
+ {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
+}
+
+#pragma warning(pop)
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/cpp_lib_cmml.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/cpp_lib_cmml.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/cpp_lib_cmml.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/cpp_lib_cmml.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,33 +30,33 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "config.h"
-
-// These classes are exported from the cpp_lib_cmml.dll
-#include "C_AnchorTag.h"
-#include "C_BaseTag.h"
-#include "C_ClipTag.h"
-#include "C_ClipTagList.h"
-#include "C_CMMLDoc.h"
-#include "C_CMMLPreamble.h"
-#include "C_CMMLRootTag.h"
-#include "C_CMMLTag.h"
-#include "C_DescTag.h"
-#include "C_HeadTag.h"
-#include "C_HumReadCMMLTag.h"
-#include "C_ImageTag.h"
-#include "C_ImportTag.h"
-#include "C_ImportTagList.h"
-#include "C_Int64.h" //Remove ??
-#include "C_MappedTag.h"
-#include "C_MappedTagList.h"
-#include "C_MetaTag.h"
-#include "C_MetaTagList.h"
-#include "C_ParamTag.h"
-#include "C_ParamTagList.h"
-#include "C_StreamTag.h"
-#include "C_TagList.h"
-#include "C_TextFieldTag.h"
-#include "C_TitleTag.h"
-
+*/
+#include "config.h"
+
+// These classes are exported from the cpp_lib_cmml.dll
+#include "C_AnchorTag.h"
+#include "C_BaseTag.h"
+#include "C_ClipTag.h"
+#include "C_ClipTagList.h"
+#include "C_CMMLDoc.h"
+#include "C_CMMLPreamble.h"
+#include "C_CMMLRootTag.h"
+#include "C_CMMLTag.h"
+#include "C_DescTag.h"
+#include "C_HeadTag.h"
+#include "C_HumReadCMMLTag.h"
+#include "C_ImageTag.h"
+#include "C_ImportTag.h"
+#include "C_ImportTagList.h"
+#include "C_Int64.h" //Remove ??
+#include "C_MappedTag.h"
+#include "C_MappedTagList.h"
+#include "C_MetaTag.h"
+#include "C_MetaTagList.h"
+#include "C_ParamTag.h"
+#include "C_ParamTagList.h"
+#include "C_StreamTag.h"
+#include "C_TagList.h"
+#include "C_TextFieldTag.h"
+#include "C_TitleTag.h"
+
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/cpp_lib_cmml.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/libCMMLTags.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/libCMMLTags.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/libCMMLTags.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,31 +30,31 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-// cpp_lib_cmml.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-#include "libCMMLTags.h"
-
-//Ignore these unreferenced variable wanrings only for this file
-#pragma warning(push)
-#pragma warning(disable: 4100)
-
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
-}
-
-#pragma warning(pop)
+*/
+// cpp_lib_cmml.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+#include "libCMMLTags.h"
+
+//Ignore these unreferenced variable wanrings only for this file
+#pragma warning(push)
+#pragma warning(disable: 4100)
+
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ switch (ul_reason_for_call)
+ {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
+}
+
+#pragma warning(pop)
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/libCMMLTags.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/libCMMLTags.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/libCMMLTags.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/libCMMLTags.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,47 +30,47 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-// The following ifdef block is the standard way of creating macros which make exporting
-// from a DLL simpler. All files within this DLL are compiled with the LIBCMMLTAGS_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see
-// LIBCMMLTAGS_API functions as being imported from a DLL, whereas this DLL sees symbols
-// defined with this macro as being exported.
-#ifdef LIBCMMLTAGS_EXPORTS
-#define LIBCMMLTAGS_API __declspec(dllexport)
-#else
-#define LIBCMMLTAGS_API __declspec(dllimport)
-#endif
-
-
-#include "config.h"
-
-// These classes are exported from the cpp_lib_cmml.dll
-#include "C_AnchorTag.h"
-#include "C_BaseTag.h"
-#include "C_ClipTag.h"
-#include "C_ClipTagList.h"
-#include "C_CMMLDoc.h"
-#include "C_CMMLPreamble.h"
-#include "C_CMMLRootTag.h"
-#include "C_CMMLTag.h"
-#include "C_DescTag.h"
-#include "C_HeadTag.h"
-#include "C_HumReadCMMLTag.h"
-#include "C_ImageTag.h"
-#include "C_ImportTag.h"
-#include "C_ImportTagList.h"
-#include "C_Int64.h" //Remove ??
-#include "C_MappedTag.h"
-#include "C_MappedTagList.h"
-#include "C_MetaTag.h"
-#include "C_MetaTagList.h"
-#include "C_ParamTag.h"
-#include "C_ParamTagList.h"
-#include "C_StreamTag.h"
-#include "C_TagList.h"
-#include "C_TextFieldTag.h"
-#include "C_TitleTag.h"
-
+*/
+
+// The following ifdef block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the LIBCMMLTAGS_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// LIBCMMLTAGS_API functions as being imported from a DLL, whereas this DLL sees symbols
+// defined with this macro as being exported.
+#ifdef LIBCMMLTAGS_EXPORTS
+#define LIBCMMLTAGS_API __declspec(dllexport)
+#else
+#define LIBCMMLTAGS_API __declspec(dllimport)
+#endif
+
+
+#include "config.h"
+
+// These classes are exported from the cpp_lib_cmml.dll
+#include "C_AnchorTag.h"
+#include "C_BaseTag.h"
+#include "C_ClipTag.h"
+#include "C_ClipTagList.h"
+#include "C_CMMLDoc.h"
+#include "C_CMMLPreamble.h"
+#include "C_CMMLRootTag.h"
+#include "C_CMMLTag.h"
+#include "C_DescTag.h"
+#include "C_HeadTag.h"
+#include "C_HumReadCMMLTag.h"
+#include "C_ImageTag.h"
+#include "C_ImportTag.h"
+#include "C_ImportTagList.h"
+#include "C_Int64.h" //Remove ??
+#include "C_MappedTag.h"
+#include "C_MappedTagList.h"
+#include "C_MetaTag.h"
+#include "C_MetaTagList.h"
+#include "C_ParamTag.h"
+#include "C_ParamTagList.h"
+#include "C_StreamTag.h"
+#include "C_TagList.h"
+#include "C_TextFieldTag.h"
+#include "C_TitleTag.h"
+
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/libCMMLTags.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,13 +30,13 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-// stdafx.cpp : source file that includes just the standard includes
-// cpp_lib_cmml.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+*/
+
+// stdafx.cpp : source file that includes just the standard includes
+// cpp_lib_cmml.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,20 +30,20 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-//These are warnings about STL on dll interface
-#pragma warning(disable:4251)
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-#include "config.h"
-
-// TODO: reference additional headers your program requires here
+*/
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+//These are warnings about STL on dll interface
+#pragma warning(disable:4251)
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+#include "config.h"
+
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTags/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/AnchorTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/AnchorTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/AnchorTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,67 +30,67 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "StdAfx.h"
-#include ".\anchortag.h"
-
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- AnchorTag::AnchorTag(void)
- {
- mBaseClass = new C_AnchorTag;
- }
-
- AnchorTag::~AnchorTag(void)
- {
- if (mDeleteBase) {
- delete mBaseClass;
- }
- mBaseClass = NULL;
- }
-
- AnchorTag::AnchorTag(C_AnchorTag* inTag, bool inDeleteBase) {
- mBaseClass = inTag;
- mDeleteBase = inDeleteBase;
- }
-
- C_AnchorTag* AnchorTag::getMe() {
- return (C_AnchorTag*)mBaseClass;
- }
-
-
- //Accessors
- String* AnchorTag::cls() {
- return Wrappers::WStrToNetStr( getMe()->cls().c_str() );
-
- }
- String* AnchorTag::href() {
- return Wrappers::WStrToNetStr( getMe()->href().c_str() );
- }
-
- //Mutators
- void AnchorTag::setCls(String* inCls) {
- wchar_t* tc = Wrappers::netStrToWStr( inCls );
- wstring locStr = tc;
- getMe()->setCls( locStr );
- Wrappers::releaseWStr( tc );
- }
- void AnchorTag::setHref(String* inHref) {
- wchar_t* tc = Wrappers::netStrToWStr( inHref );
- wstring locStr = tc;
- getMe()->setHref( locStr );
- Wrappers::releaseWStr( tc );
-
- }
-
- //Other
- String* AnchorTag::toString() {
- return Wrappers::WStrToNetStr( getMe()->toString().c_str() );
-
- }
-
-}
-}
+*/
+
+#include "StdAfx.h"
+#include ".\anchortag.h"
+
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ AnchorTag::AnchorTag(void)
+ {
+ mBaseClass = new C_AnchorTag;
+ }
+
+ AnchorTag::~AnchorTag(void)
+ {
+ if (mDeleteBase) {
+ delete mBaseClass;
+ }
+ mBaseClass = NULL;
+ }
+
+ AnchorTag::AnchorTag(C_AnchorTag* inTag, bool inDeleteBase) {
+ mBaseClass = inTag;
+ mDeleteBase = inDeleteBase;
+ }
+
+ C_AnchorTag* AnchorTag::getMe() {
+ return (C_AnchorTag*)mBaseClass;
+ }
+
+
+ //Accessors
+ String* AnchorTag::cls() {
+ return Wrappers::WStrToNetStr( getMe()->cls().c_str() );
+
+ }
+ String* AnchorTag::href() {
+ return Wrappers::WStrToNetStr( getMe()->href().c_str() );
+ }
+
+ //Mutators
+ void AnchorTag::setCls(String* inCls) {
+ wchar_t* tc = Wrappers::netStrToWStr( inCls );
+ wstring locStr = tc;
+ getMe()->setCls( locStr );
+ Wrappers::releaseWStr( tc );
+ }
+ void AnchorTag::setHref(String* inHref) {
+ wchar_t* tc = Wrappers::netStrToWStr( inHref );
+ wstring locStr = tc;
+ getMe()->setHref( locStr );
+ Wrappers::releaseWStr( tc );
+
+ }
+
+ //Other
+ String* AnchorTag::toString() {
+ return Wrappers::WStrToNetStr( getMe()->toString().c_str() );
+
+ }
+
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/AnchorTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/AnchorTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/AnchorTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/AnchorTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,71 +30,71 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-using namespace System;
-#pragma managed
-#using "libiWrapper.dll"
-using namespace illiminable::libiWrapper;
-
-#include "TextFieldTag.h"
-
-#pragma unmanaged
-#include <config.h>
-#include <C_AnchorTag.h>
-#pragma managed
-
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
-
- //ORIGINAL CLASS
-// //Derived Classes
-// : public C_TextFieldTag
-//{
-//public:
-// //Constructors
-// C_AnchorTag(void);
-// virtual ~C_AnchorTag(void);
-//
-// //Accessors
-// string cls();
-// string href();
-//
-// //Mutators
-// void setCls(string inCls);
-// void setHref(string inHref);
-//
-// //Other
-// virtual string toString();
-
-
-
- public __gc class AnchorTag
- : public TextFieldTag
- {
- public:
- AnchorTag(void);
- AnchorTag(C_AnchorTag* inTag, bool inDeleteBase);
- virtual ~AnchorTag(void);
-
- //Accessors
- String* cls();
- String* href();
-
- //Mutators
- void setCls(String* inCls);
- void setHref(String* inHref);
-
- //Other
- virtual String* toString();
-
-
- C_AnchorTag* getMe();
-
-
- };
-}
-}
+*/
+#pragma once
+
+using namespace System;
+#pragma managed
+#using "libiWrapper.dll"
+using namespace illiminable::libiWrapper;
+
+#include "TextFieldTag.h"
+
+#pragma unmanaged
+#include <config.h>
+#include <C_AnchorTag.h>
+#pragma managed
+
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+
+ //ORIGINAL CLASS
+// //Derived Classes
+// : public C_TextFieldTag
+//{
+//public:
+// //Constructors
+// C_AnchorTag(void);
+// virtual ~C_AnchorTag(void);
+//
+// //Accessors
+// string cls();
+// string href();
+//
+// //Mutators
+// void setCls(string inCls);
+// void setHref(string inHref);
+//
+// //Other
+// virtual string toString();
+
+
+
+ public __gc class AnchorTag
+ : public TextFieldTag
+ {
+ public:
+ AnchorTag(void);
+ AnchorTag(C_AnchorTag* inTag, bool inDeleteBase);
+ virtual ~AnchorTag(void);
+
+ //Accessors
+ String* cls();
+ String* href();
+
+ //Mutators
+ void setCls(String* inCls);
+ void setHref(String* inHref);
+
+ //Other
+ virtual String* toString();
+
+
+ C_AnchorTag* getMe();
+
+
+ };
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/AnchorTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/AssemblyInfo.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/AssemblyInfo.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/AssemblyInfo.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,62 +30,62 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "stdafx.h"
-
-using namespace System::Reflection;
-using namespace System::Runtime::CompilerServices;
-
-//
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-//
-[assembly:AssemblyTitleAttribute("")];
-[assembly:AssemblyDescriptionAttribute("")];
-[assembly:AssemblyConfigurationAttribute("")];
-[assembly:AssemblyCompanyAttribute("")];
-[assembly:AssemblyProductAttribute("")];
-[assembly:AssemblyCopyrightAttribute("")];
-[assembly:AssemblyTrademarkAttribute("")];
-[assembly:AssemblyCultureAttribute("")];
-
-//
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the value or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-
-[assembly:AssemblyVersionAttribute("1.0.*")];
-
-//
-// In order to sign your assembly you must specify a key to use. Refer to the
-// Microsoft .NET Framework documentation for more information on assembly signing.
-//
-// Use the attributes below to control which key is used for signing.
-//
-// Notes:
-// (*) If no key is specified, the assembly is not signed.
-// (*) KeyName refers to a key that has been installed in the Crypto Service
-// Provider (CSP) on your machine. KeyFile refers to a file which contains
-// a key.
-// (*) If the KeyFile and the KeyName values are both specified, the
-// following processing occurs:
-// (1) If the KeyName can be found in the CSP, that key is used.
-// (2) If the KeyName does not exist and the KeyFile does exist, the key
-// in the KeyFile is installed into the CSP and used.
-// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
-// When specifying the KeyFile, the location of the KeyFile should be
-// relative to the project directory.
-// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
-// documentation for more information on this.
-//
-[assembly:AssemblyDelaySignAttribute(false)];
-[assembly:AssemblyKeyFileAttribute("")];
-[assembly:AssemblyKeyNameAttribute("")];
-
+*/
+#include "stdafx.h"
+
+using namespace System::Reflection;
+using namespace System::Runtime::CompilerServices;
+
+//
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly:AssemblyTitleAttribute("")];
+[assembly:AssemblyDescriptionAttribute("")];
+[assembly:AssemblyConfigurationAttribute("")];
+[assembly:AssemblyCompanyAttribute("")];
+[assembly:AssemblyProductAttribute("")];
+[assembly:AssemblyCopyrightAttribute("")];
+[assembly:AssemblyTrademarkAttribute("")];
+[assembly:AssemblyCultureAttribute("")];
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the value or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly:AssemblyVersionAttribute("1.0.*")];
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing.
+//
+// Notes:
+// (*) If no key is specified, the assembly is not signed.
+// (*) KeyName refers to a key that has been installed in the Crypto Service
+// Provider (CSP) on your machine. KeyFile refers to a file which contains
+// a key.
+// (*) If the KeyFile and the KeyName values are both specified, the
+// following processing occurs:
+// (1) If the KeyName can be found in the CSP, that key is used.
+// (2) If the KeyName does not exist and the KeyFile does exist, the key
+// in the KeyFile is installed into the CSP and used.
+// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+// When specifying the KeyFile, the location of the KeyFile should be
+// relative to the project directory.
+// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+// documentation for more information on this.
+//
+[assembly:AssemblyDelaySignAttribute(false)];
+[assembly:AssemblyKeyFileAttribute("")];
+[assembly:AssemblyKeyNameAttribute("")];
+
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/AssemblyInfo.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/BaseTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/BaseTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/BaseTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,55 +30,55 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "StdAfx.h"
-#include ".\basetag.h"
-
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- BaseTag::BaseTag(void) {
- mBaseClass = new C_BaseTag;
- }
-
- BaseTag::BaseTag(C_BaseTag* inTag, bool inDeleteBase) {
- mBaseClass = inTag;
- mDeleteBase = inDeleteBase;
- }
-
- BaseTag::~BaseTag(void) {
- if (mDeleteBase) {
- delete mBaseClass;
- }
-
-
- mBaseClass = NULL;
- }
-
- C_BaseTag* BaseTag::getMe() {
- return (C_BaseTag*)mBaseClass;
- }
-
- //Accessors
- String* BaseTag::href() {
- return Wrappers::WStrToNetStr( getMe()->href().c_str() );
- }
-
- //Mutators
- void BaseTag::setHref(String* inHref) {
- wchar_t* tc = Wrappers::netStrToWStr( inHref );
- wstring locStr = tc;
- getMe()->setHref( locStr );
- Wrappers::releaseWStr( tc );
- }
-
- //Other
- String* BaseTag::toString() {
- return Wrappers::WStrToNetStr( getMe()->toString().c_str() );
- }
-
-
-}
+*/
+
+#include "StdAfx.h"
+#include ".\basetag.h"
+
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ BaseTag::BaseTag(void) {
+ mBaseClass = new C_BaseTag;
+ }
+
+ BaseTag::BaseTag(C_BaseTag* inTag, bool inDeleteBase) {
+ mBaseClass = inTag;
+ mDeleteBase = inDeleteBase;
+ }
+
+ BaseTag::~BaseTag(void) {
+ if (mDeleteBase) {
+ delete mBaseClass;
+ }
+
+
+ mBaseClass = NULL;
+ }
+
+ C_BaseTag* BaseTag::getMe() {
+ return (C_BaseTag*)mBaseClass;
+ }
+
+ //Accessors
+ String* BaseTag::href() {
+ return Wrappers::WStrToNetStr( getMe()->href().c_str() );
+ }
+
+ //Mutators
+ void BaseTag::setHref(String* inHref) {
+ wchar_t* tc = Wrappers::netStrToWStr( inHref );
+ wstring locStr = tc;
+ getMe()->setHref( locStr );
+ Wrappers::releaseWStr( tc );
+ }
+
+ //Other
+ String* BaseTag::toString() {
+ return Wrappers::WStrToNetStr( getMe()->toString().c_str() );
+ }
+
+
+}
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/BaseTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/BaseTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/BaseTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/BaseTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,60 +30,60 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-
-
-using namespace System;
-#using "libiWrapper.dll"
-using namespace illiminable::libiWrapper;
-
-#include "CMMLTag.h"
-
-#pragma unmanaged
-#include <config.h>
-#include <C_BaseTag.h>
-#pragma managed
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
-
-
- ////Accessors
- //string href();
-
- ////Mutators
- //void setHref(string inHref);
-
- ////Other
- //virtual string toString();
-
-
- public __gc class BaseTag
- : public CMMLTag
- {
- public:
- BaseTag(void);
- BaseTag(C_BaseTag* inTag, bool inDeleteBase);
- ~BaseTag(void);
-
- //Accessors
- String* href();
-
- //Mutators
- void setHref(String* inHref);
-
- //Other
- virtual String* toString();
-
-
- C_BaseTag* getMe();
-
-
- };
-}
-}
-
-
+*/
+#pragma once
+
+
+
+using namespace System;
+#using "libiWrapper.dll"
+using namespace illiminable::libiWrapper;
+
+#include "CMMLTag.h"
+
+#pragma unmanaged
+#include <config.h>
+#include <C_BaseTag.h>
+#pragma managed
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+
+
+ ////Accessors
+ //string href();
+
+ ////Mutators
+ //void setHref(string inHref);
+
+ ////Other
+ //virtual string toString();
+
+
+ public __gc class BaseTag
+ : public CMMLTag
+ {
+ public:
+ BaseTag(void);
+ BaseTag(C_BaseTag* inTag, bool inDeleteBase);
+ ~BaseTag(void);
+
+ //Accessors
+ String* href();
+
+ //Mutators
+ void setHref(String* inHref);
+
+ //Other
+ virtual String* toString();
+
+
+ C_BaseTag* getMe();
+
+
+ };
+}
+}
+
+
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/BaseTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLDoc.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLDoc.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLDoc.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,49 +30,49 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\cmmldoc.h"
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
-
-CMMLDoc::CMMLDoc(void)
-{
- mBaseClass = new C_CMMLDoc;
-}
-
-CMMLDoc::~CMMLDoc(void)
-{
- delete mBaseClass;
-}
-
-
-CMMLPreamble* CMMLDoc::preamble()
-{
- return new CMMLPreamble(getMe()->preamble(), false);
-}
-CMMLRootTag* CMMLDoc::root()
-{
- return new CMMLRootTag(getMe()->root(), false);
-}
-
-void CMMLDoc::setRoot(CMMLRootTag* inRootTag)
-{
- getMe()->setRoot( inRootTag->getMe()->clone() );
-}
-
-String* CMMLDoc::toString()
-{
- return Wrappers::WStrToNetStr( getMe()->toString().c_str() );
-
-}
-C_CMMLDoc* CMMLDoc::getMe()
-{
- return (C_CMMLDoc*)mBaseClass;
-}
-
-
-}
-}
+*/
+#include "StdAfx.h"
+#include ".\cmmldoc.h"
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+
+CMMLDoc::CMMLDoc(void)
+{
+ mBaseClass = new C_CMMLDoc;
+}
+
+CMMLDoc::~CMMLDoc(void)
+{
+ delete mBaseClass;
+}
+
+
+CMMLPreamble* CMMLDoc::preamble()
+{
+ return new CMMLPreamble(getMe()->preamble(), false);
+}
+CMMLRootTag* CMMLDoc::root()
+{
+ return new CMMLRootTag(getMe()->root(), false);
+}
+
+void CMMLDoc::setRoot(CMMLRootTag* inRootTag)
+{
+ getMe()->setRoot( inRootTag->getMe()->clone() );
+}
+
+String* CMMLDoc::toString()
+{
+ return Wrappers::WStrToNetStr( getMe()->toString().c_str() );
+
+}
+C_CMMLDoc* CMMLDoc::getMe()
+{
+ return (C_CMMLDoc*)mBaseClass;
+}
+
+
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLDoc.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLDoc.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLDoc.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLDoc.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,48 +30,48 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-using namespace System;
-
-#using "libiWrapper.dll"
-using namespace illiminable::libiWrapper;
-
-//#include "StreamTag.h"
-//#include "HeadTag.h"
-//#include "ClipTagList.h"
-//#include "CMMLTag.h"
-
-#include "CMMLPreamble.h"
-#include "CMMLRootTag.h"
-
-#pragma unmanaged
-#include <config.h>
-#include <C_CMMLDoc.h>
-#pragma managed
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- public __gc class CMMLDoc
- {
- public:
- CMMLDoc(void);
- ~CMMLDoc(void);
-
-
- CMMLPreamble* preamble();
- CMMLRootTag* root();
-
- void setRoot(CMMLRootTag* inRootTag);
-
- virtual String* toString();
-
- C_CMMLDoc* getMe();
- //C_CMMLDoc* clone();
- protected:
- C_CMMLDoc* mBaseClass;
- };
-}
-}
+*/
+#pragma once
+
+using namespace System;
+
+#using "libiWrapper.dll"
+using namespace illiminable::libiWrapper;
+
+//#include "StreamTag.h"
+//#include "HeadTag.h"
+//#include "ClipTagList.h"
+//#include "CMMLTag.h"
+
+#include "CMMLPreamble.h"
+#include "CMMLRootTag.h"
+
+#pragma unmanaged
+#include <config.h>
+#include <C_CMMLDoc.h>
+#pragma managed
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ public __gc class CMMLDoc
+ {
+ public:
+ CMMLDoc(void);
+ ~CMMLDoc(void);
+
+
+ CMMLPreamble* preamble();
+ CMMLRootTag* root();
+
+ void setRoot(CMMLRootTag* inRootTag);
+
+ virtual String* toString();
+
+ C_CMMLDoc* getMe();
+ //C_CMMLDoc* clone();
+ protected:
+ C_CMMLDoc* mBaseClass;
+ };
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLDoc.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLPreamble.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLPreamble.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLPreamble.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,60 +30,60 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\cmmlpreamble.h"
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
-
- CMMLPreamble::CMMLPreamble(void)
- {
- }
- CMMLPreamble::CMMLPreamble(C_CMMLPreamble* inPreamble, bool inDeleteBase)
- {
- mBaseClass = inPreamble;
- mDeleteBase = inDeleteBase;
- }
-
- CMMLPreamble::~CMMLPreamble(void)
- {
- }
-
-
- //Accessors
- String* CMMLPreamble::xmlVersion() {
- return Wrappers::WStrToNetStr( mBaseClass->xmlVersion().c_str() );
- }
- String* CMMLPreamble::xmlEncoding() {
- return Wrappers::WStrToNetStr( mBaseClass->xmlEncoding().c_str() );
- }
- String* CMMLPreamble::xmlStandAlone() {
- return Wrappers::WStrToNetStr( mBaseClass->xmlStandAlone().c_str() );
- }
-
- //Mutators
- void CMMLPreamble::setXmlVersion(String* inVersion) {
- wchar_t* tc = Wrappers::netStrToWStr( inVersion );
- mBaseClass->setXmlVersion( tc );
- Wrappers::releaseWStr( tc );
- }
- void CMMLPreamble::setXmlEncoding(String* inEncoding) {
- wchar_t* tc = Wrappers::netStrToWStr( inEncoding );
- mBaseClass->setXmlEncoding( tc );
- Wrappers::releaseWStr( tc );
- }
- void CMMLPreamble::setXmlStandAlone(String* inStandAlone) {
- wchar_t* tc = Wrappers::netStrToWStr( inStandAlone );
- mBaseClass->setXmlStandAlone( tc );
- Wrappers::releaseWStr( tc );
- }
-
- //Others
- String* CMMLPreamble::toString() {
- return Wrappers::WStrToNetStr( mBaseClass->toString().c_str() );
- }
-
-}
-}
+*/
+#include "StdAfx.h"
+#include ".\cmmlpreamble.h"
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+
+ CMMLPreamble::CMMLPreamble(void)
+ {
+ }
+ CMMLPreamble::CMMLPreamble(C_CMMLPreamble* inPreamble, bool inDeleteBase)
+ {
+ mBaseClass = inPreamble;
+ mDeleteBase = inDeleteBase;
+ }
+
+ CMMLPreamble::~CMMLPreamble(void)
+ {
+ }
+
+
+ //Accessors
+ String* CMMLPreamble::xmlVersion() {
+ return Wrappers::WStrToNetStr( mBaseClass->xmlVersion().c_str() );
+ }
+ String* CMMLPreamble::xmlEncoding() {
+ return Wrappers::WStrToNetStr( mBaseClass->xmlEncoding().c_str() );
+ }
+ String* CMMLPreamble::xmlStandAlone() {
+ return Wrappers::WStrToNetStr( mBaseClass->xmlStandAlone().c_str() );
+ }
+
+ //Mutators
+ void CMMLPreamble::setXmlVersion(String* inVersion) {
+ wchar_t* tc = Wrappers::netStrToWStr( inVersion );
+ mBaseClass->setXmlVersion( tc );
+ Wrappers::releaseWStr( tc );
+ }
+ void CMMLPreamble::setXmlEncoding(String* inEncoding) {
+ wchar_t* tc = Wrappers::netStrToWStr( inEncoding );
+ mBaseClass->setXmlEncoding( tc );
+ Wrappers::releaseWStr( tc );
+ }
+ void CMMLPreamble::setXmlStandAlone(String* inStandAlone) {
+ wchar_t* tc = Wrappers::netStrToWStr( inStandAlone );
+ mBaseClass->setXmlStandAlone( tc );
+ Wrappers::releaseWStr( tc );
+ }
+
+ //Others
+ String* CMMLPreamble::toString() {
+ return Wrappers::WStrToNetStr( mBaseClass->toString().c_str() );
+ }
+
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLPreamble.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLPreamble.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLPreamble.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLPreamble.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,65 +30,65 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-
-using namespace System;
-#using "libiWrapper.dll"
-using namespace illiminable::libiWrapper;
-
-#pragma unmanaged
-#include <config.h>
-#include <C_CMMLPreamble.h>
-#pragma managed
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
-
- ////Accessors
- //string xmlVersion();
- //string xmlEncoding();
- //string xmlStandAlone();
- //
- ////Mutators
- //void setXmlVersion(string inVersion);
- //void setXmlEncoding(string inEncoding);
- //void setXmlStandAlone(string inStandAlone);
-
- ////Others
- //virtual string toString();
-
- public __gc class CMMLPreamble
- {
- public:
- CMMLPreamble(void);
- CMMLPreamble(C_CMMLPreamble* inPreamble, bool inDeleteBase);
- ~CMMLPreamble(void);
-
-
-
- //Accessors
- String* xmlVersion();
- String* xmlEncoding();
- String* xmlStandAlone();
-
- //Mutators
- void setXmlVersion(String* inVersion);
- void setXmlEncoding(String* inEncoding);
- void setXmlStandAlone(String* inStandAlone);
-
- //Others
- virtual String* toString();
- protected:
-
- C_CMMLPreamble* mBaseClass;
- bool mDeleteBase;
-
-
-
-
- };
-}
-}
+*/
+#pragma once
+
+
+using namespace System;
+#using "libiWrapper.dll"
+using namespace illiminable::libiWrapper;
+
+#pragma unmanaged
+#include <config.h>
+#include <C_CMMLPreamble.h>
+#pragma managed
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+
+ ////Accessors
+ //string xmlVersion();
+ //string xmlEncoding();
+ //string xmlStandAlone();
+ //
+ ////Mutators
+ //void setXmlVersion(string inVersion);
+ //void setXmlEncoding(string inEncoding);
+ //void setXmlStandAlone(string inStandAlone);
+
+ ////Others
+ //virtual string toString();
+
+ public __gc class CMMLPreamble
+ {
+ public:
+ CMMLPreamble(void);
+ CMMLPreamble(C_CMMLPreamble* inPreamble, bool inDeleteBase);
+ ~CMMLPreamble(void);
+
+
+
+ //Accessors
+ String* xmlVersion();
+ String* xmlEncoding();
+ String* xmlStandAlone();
+
+ //Mutators
+ void setXmlVersion(String* inVersion);
+ void setXmlEncoding(String* inEncoding);
+ void setXmlStandAlone(String* inStandAlone);
+
+ //Others
+ virtual String* toString();
+ protected:
+
+ C_CMMLPreamble* mBaseClass;
+ bool mDeleteBase;
+
+
+
+
+ };
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLPreamble.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLRootTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLRootTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLRootTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,66 +30,66 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\cmmlroottag.h"
-#using <mscorlib.dll>
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
-CMMLRootTag::CMMLRootTag(void)
-{
- mBaseClass = new C_CMMLRootTag;
-}
-
-CMMLRootTag::CMMLRootTag(C_CMMLRootTag* inRootTag, bool inDeleteBase)
-{
- mBaseClass = inRootTag;
- mDeleteBase = inDeleteBase;
-}
-
-CMMLRootTag::~CMMLRootTag(void)
-
-{
- if(mDeleteBase) {
- delete mBaseClass;
- }
- mBaseClass = NULL;
-}
-
- //Accessors
-
-StreamTag* CMMLRootTag::stream() {
- return new StreamTag(getMe()->stream(), false);
-}
-HeadTag* CMMLRootTag::head() {
- return new HeadTag(getMe()->head(), false);
-}
-ClipTagList* CMMLRootTag::clipList() {
- return new ClipTagList(getMe()->clipList(), false);
-
-}
-
- //Mutators
-void CMMLRootTag::setStream(StreamTag* inStreamTag) {
- getMe()->setStream(inStreamTag->getMe()->clone());
-}
-void CMMLRootTag::setHead(HeadTag* inHeadTag) {
- getMe()->setHead(inHeadTag->getMe()->clone());
-}
-void CMMLRootTag::setClipList(ClipTagList* inClipList) {
- getMe()->setClipList(inClipList->getMe()->clone());
-}
-
- //Other
-String* CMMLRootTag::toString() {
- return Wrappers::WStrToNetStr( getMe()->toString().c_str());
-}
-
-C_CMMLRootTag* CMMLRootTag::getMe() {
- return (C_CMMLRootTag*)mBaseClass;
-}
-
-}
+*/
+#include "StdAfx.h"
+#include ".\cmmlroottag.h"
+#using <mscorlib.dll>
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+CMMLRootTag::CMMLRootTag(void)
+{
+ mBaseClass = new C_CMMLRootTag;
+}
+
+CMMLRootTag::CMMLRootTag(C_CMMLRootTag* inRootTag, bool inDeleteBase)
+{
+ mBaseClass = inRootTag;
+ mDeleteBase = inDeleteBase;
+}
+
+CMMLRootTag::~CMMLRootTag(void)
+
+{
+ if(mDeleteBase) {
+ delete mBaseClass;
+ }
+ mBaseClass = NULL;
+}
+
+ //Accessors
+
+StreamTag* CMMLRootTag::stream() {
+ return new StreamTag(getMe()->stream(), false);
+}
+HeadTag* CMMLRootTag::head() {
+ return new HeadTag(getMe()->head(), false);
+}
+ClipTagList* CMMLRootTag::clipList() {
+ return new ClipTagList(getMe()->clipList(), false);
+
+}
+
+ //Mutators
+void CMMLRootTag::setStream(StreamTag* inStreamTag) {
+ getMe()->setStream(inStreamTag->getMe()->clone());
+}
+void CMMLRootTag::setHead(HeadTag* inHeadTag) {
+ getMe()->setHead(inHeadTag->getMe()->clone());
+}
+void CMMLRootTag::setClipList(ClipTagList* inClipList) {
+ getMe()->setClipList(inClipList->getMe()->clone());
+}
+
+ //Other
+String* CMMLRootTag::toString() {
+ return Wrappers::WStrToNetStr( getMe()->toString().c_str());
+}
+
+C_CMMLRootTag* CMMLRootTag::getMe() {
+ return (C_CMMLRootTag*)mBaseClass;
+}
+
+}
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLRootTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLRootTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLRootTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLRootTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,50 +30,50 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-using namespace System;
-#using "libiWrapper.dll"
-using namespace illiminable::libiWrapper;
-
-#include "StreamTag.h"
-#include "HeadTag.h"
-#include "ClipTagList.h"
-#include "CMMLTag.h"
-
-#pragma unmanaged
-#include <config.h>
-#include <C_CMMLRootTag.h>
-#pragma managed
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- public __gc class CMMLRootTag
- : public CMMLTag
- {
- public:
- CMMLRootTag(void);
- CMMLRootTag(C_CMMLRootTag* inRootTag, bool inDeleteBase);
- virtual ~CMMLRootTag(void);
-
- //Accessors
-
- StreamTag* stream();
- HeadTag* head();
- ClipTagList* clipList();
-
- //Mutators
- void setStream(StreamTag* inStreamTag);
- void setHead(HeadTag* inHeadTag);
- void setClipList(ClipTagList* inClipList);
-
- //Other
- virtual String* toString();
- C_CMMLRootTag* getMe();
-
- };
-
-}
-}
+*/
+#pragma once
+
+using namespace System;
+#using "libiWrapper.dll"
+using namespace illiminable::libiWrapper;
+
+#include "StreamTag.h"
+#include "HeadTag.h"
+#include "ClipTagList.h"
+#include "CMMLTag.h"
+
+#pragma unmanaged
+#include <config.h>
+#include <C_CMMLRootTag.h>
+#pragma managed
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ public __gc class CMMLRootTag
+ : public CMMLTag
+ {
+ public:
+ CMMLRootTag(void);
+ CMMLRootTag(C_CMMLRootTag* inRootTag, bool inDeleteBase);
+ virtual ~CMMLRootTag(void);
+
+ //Accessors
+
+ StreamTag* stream();
+ HeadTag* head();
+ ClipTagList* clipList();
+
+ //Mutators
+ void setStream(StreamTag* inStreamTag);
+ void setHead(HeadTag* inHeadTag);
+ void setClipList(ClipTagList* inClipList);
+
+ //Other
+ virtual String* toString();
+ C_CMMLRootTag* getMe();
+
+ };
+
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLRootTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,39 +30,39 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "StdAfx.h"
-#include ".\cmmltag.h"
-
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- CMMLTag::CMMLTag(void) {
- //ABSTRACT CLASS
- //mBaseClass = new C_CMMLTag;
- }
-
- CMMLTag::~CMMLTag(void)
- //delete mBaseClass;
- {
- }
- //Accessors
- String* CMMLTag::id() {
- return Wrappers::WStrToNetStr( mBaseClass->id().c_str() );
- }
-
- //Mutators
- void CMMLTag::setId(String* inId) {
- wchar_t* tc = Wrappers::netStrToWStr( inId );
- wstring locStr = tc;
- mBaseClass->setId( locStr );
- Wrappers::releaseWStr( tc );
-
- }
-
-
-
-}
-}
+*/
+
+#include "StdAfx.h"
+#include ".\cmmltag.h"
+
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ CMMLTag::CMMLTag(void) {
+ //ABSTRACT CLASS
+ //mBaseClass = new C_CMMLTag;
+ }
+
+ CMMLTag::~CMMLTag(void)
+ //delete mBaseClass;
+ {
+ }
+ //Accessors
+ String* CMMLTag::id() {
+ return Wrappers::WStrToNetStr( mBaseClass->id().c_str() );
+ }
+
+ //Mutators
+ void CMMLTag::setId(String* inId) {
+ wchar_t* tc = Wrappers::netStrToWStr( inId );
+ wstring locStr = tc;
+ mBaseClass->setId( locStr );
+ Wrappers::releaseWStr( tc );
+
+ }
+
+
+
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,100 +30,100 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-using namespace System;
-#using "libiWrapper.dll"
-using namespace illiminable::libiWrapper;
-
-#pragma unmanaged
-#include <config.h>
-#include <C_CMMLTag.h>
-#pragma managed
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
-
- //ORIGINAL TAG
-
-// public:
-// //Constructors
-// C_CMMLTag(void);
-// virtual ~C_CMMLTag(void);
-//
-// //Enumerations
-// enum eTagType {
-// UNKNOWN,
-// IMPORT,
-// STREAM,
-// META,
-// HEAD,
-// TITLE,
-// BASE,
-// CLIP,
-// ANCHOR,
-// IMAGE,
-// DESC,
-// PARAM,
-// BAD_TAG = 1000
-// };
-//
-// //Accessors
-// string id();
-//
-// //Mutators
-// void setId(string inId);
-//
-// //Other
-// virtual string toString() = 0;
-//protected:
-// //Property Data
-// string mId;
-// eTagType mTagType;
-//
-// string makeElement(string inElemName, string inElemContent);
-
-
- public __gc class CMMLTag
- {
- public:
- CMMLTag(void);
- ~CMMLTag(void);
-
- //enum eTagType {
- // UNKNOWN,
- // IMPORT,
- // STREAM,
- // META,
- // HEAD,
- // TITLE,
- // BASE,
- // CLIP,
- // ANCHOR,
- // IMAGE,
- // DESC,
- // PARAM,
- // BAD_TAG = 1000
- //};
-
- //Accessors
- String* id();
-
- //Mutators
- void setId(String* inId);
-
- //Other
- virtual String* toString() = 0;
-
- protected:
- C_CMMLTag* mBaseClass;
- bool mDeleteBase;
-
-
- };
-
-
-}
-}
+*/
+#pragma once
+
+using namespace System;
+#using "libiWrapper.dll"
+using namespace illiminable::libiWrapper;
+
+#pragma unmanaged
+#include <config.h>
+#include <C_CMMLTag.h>
+#pragma managed
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+
+ //ORIGINAL TAG
+
+// public:
+// //Constructors
+// C_CMMLTag(void);
+// virtual ~C_CMMLTag(void);
+//
+// //Enumerations
+// enum eTagType {
+// UNKNOWN,
+// IMPORT,
+// STREAM,
+// META,
+// HEAD,
+// TITLE,
+// BASE,
+// CLIP,
+// ANCHOR,
+// IMAGE,
+// DESC,
+// PARAM,
+// BAD_TAG = 1000
+// };
+//
+// //Accessors
+// string id();
+//
+// //Mutators
+// void setId(string inId);
+//
+// //Other
+// virtual string toString() = 0;
+//protected:
+// //Property Data
+// string mId;
+// eTagType mTagType;
+//
+// string makeElement(string inElemName, string inElemContent);
+
+
+ public __gc class CMMLTag
+ {
+ public:
+ CMMLTag(void);
+ ~CMMLTag(void);
+
+ //enum eTagType {
+ // UNKNOWN,
+ // IMPORT,
+ // STREAM,
+ // META,
+ // HEAD,
+ // TITLE,
+ // BASE,
+ // CLIP,
+ // ANCHOR,
+ // IMAGE,
+ // DESC,
+ // PARAM,
+ // BAD_TAG = 1000
+ //};
+
+ //Accessors
+ String* id();
+
+ //Mutators
+ void setId(String* inId);
+
+ //Other
+ virtual String* toString() = 0;
+
+ protected:
+ C_CMMLTag* mBaseClass;
+ bool mDeleteBase;
+
+
+ };
+
+
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/CMMLTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,111 +30,111 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "StdAfx.h"
-#include ".\cliptag.h"
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- ClipTag::ClipTag(void)
- {
- mBaseClass = new C_ClipTag;
- mDeleteBase = true;
- }
-
- ClipTag::ClipTag(C_ClipTag* inTag, bool inDeleteBase) {
- mBaseClass = inTag;
- mDeleteBase = inDeleteBase;
- }
- ClipTag::~ClipTag(void)
- {
- delete mBaseClass;
- }
-
- C_ClipTag* ClipTag::getMe() {
- return (C_ClipTag*)mBaseClass;
- }
-
- //Accessors
- String* ClipTag::track() {
- return Wrappers::WStrToNetStr( getMe()->track().c_str() );
- }
- MetaTagList* ClipTag::metaList() {
- return new MetaTagList(getMe()->metaList(), false);
- }
- AnchorTag* ClipTag::anchor() {
- C_AnchorTag* locAnchor = getMe()->anchor();
- if (locAnchor != NULL) {
- return new AnchorTag(locAnchor,false);
- } else {
- return NULL;
- }
- }
- ImageTag* ClipTag::image() {
- C_ImageTag* locImage = getMe()->image();
- if (locImage != NULL) {
- return new ImageTag(locImage, false);
- } else {
- return NULL;
- }
- }
- DescTag* ClipTag::desc() {
- C_DescTag* locDesc = getMe()->desc();
- if (locDesc != NULL) {
- return new DescTag(locDesc, false);
- } else {
- return NULL;
- }
- }
-
- String* ClipTag::start() {
- return Wrappers::WStrToNetStr( getMe()->start().c_str() );
-
- }
- String* ClipTag::end() {
- return Wrappers::WStrToNetStr( getMe()->end().c_str() );
-
- }
-
-
- //Mutators
- void ClipTag::setTrack(String* inTrack) {
- wchar_t* tc = Wrappers::netStrToWStr( inTrack );
- wstring locStr = tc;
- getMe()->setTrack( locStr );
- Wrappers::releaseWStr( tc );
- }
- void ClipTag::setAnchor(AnchorTag* inAnchor) {
- getMe()->setAnchor(inAnchor->getMe()->clone());
- }
- void ClipTag::setImage(ImageTag* inImage) {
- getMe()->setImage(inImage->getMe()->clone());
- }
- void ClipTag::setDesc(DescTag* inDesc) {
- getMe()->setDesc(inDesc->getMe()->clone());
- }
-
- void ClipTag::setStart(String* inStart) {
- wchar_t* tc = Wrappers::netStrToWStr( inStart );
- wstring locStr = tc;
- getMe()->setStart( locStr );
- Wrappers::releaseWStr( tc );
- }
- void ClipTag::setEnd(String* inEnd) {
- wchar_t* tc = Wrappers::netStrToWStr( inEnd );
- wstring locStr = tc;
- getMe()->setEnd( locStr );
- Wrappers::releaseWStr( tc );
- }
-
-
- //Others
- String* ClipTag::toString() {
- return Wrappers::WStrToNetStr( getMe()->toString().c_str() );
-
- }
-
-}
+*/
+
+#include "StdAfx.h"
+#include ".\cliptag.h"
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ ClipTag::ClipTag(void)
+ {
+ mBaseClass = new C_ClipTag;
+ mDeleteBase = true;
+ }
+
+ ClipTag::ClipTag(C_ClipTag* inTag, bool inDeleteBase) {
+ mBaseClass = inTag;
+ mDeleteBase = inDeleteBase;
+ }
+ ClipTag::~ClipTag(void)
+ {
+ delete mBaseClass;
+ }
+
+ C_ClipTag* ClipTag::getMe() {
+ return (C_ClipTag*)mBaseClass;
+ }
+
+ //Accessors
+ String* ClipTag::track() {
+ return Wrappers::WStrToNetStr( getMe()->track().c_str() );
+ }
+ MetaTagList* ClipTag::metaList() {
+ return new MetaTagList(getMe()->metaList(), false);
+ }
+ AnchorTag* ClipTag::anchor() {
+ C_AnchorTag* locAnchor = getMe()->anchor();
+ if (locAnchor != NULL) {
+ return new AnchorTag(locAnchor,false);
+ } else {
+ return NULL;
+ }
+ }
+ ImageTag* ClipTag::image() {
+ C_ImageTag* locImage = getMe()->image();
+ if (locImage != NULL) {
+ return new ImageTag(locImage, false);
+ } else {
+ return NULL;
+ }
+ }
+ DescTag* ClipTag::desc() {
+ C_DescTag* locDesc = getMe()->desc();
+ if (locDesc != NULL) {
+ return new DescTag(locDesc, false);
+ } else {
+ return NULL;
+ }
+ }
+
+ String* ClipTag::start() {
+ return Wrappers::WStrToNetStr( getMe()->start().c_str() );
+
+ }
+ String* ClipTag::end() {
+ return Wrappers::WStrToNetStr( getMe()->end().c_str() );
+
+ }
+
+
+ //Mutators
+ void ClipTag::setTrack(String* inTrack) {
+ wchar_t* tc = Wrappers::netStrToWStr( inTrack );
+ wstring locStr = tc;
+ getMe()->setTrack( locStr );
+ Wrappers::releaseWStr( tc );
+ }
+ void ClipTag::setAnchor(AnchorTag* inAnchor) {
+ getMe()->setAnchor(inAnchor->getMe()->clone());
+ }
+ void ClipTag::setImage(ImageTag* inImage) {
+ getMe()->setImage(inImage->getMe()->clone());
+ }
+ void ClipTag::setDesc(DescTag* inDesc) {
+ getMe()->setDesc(inDesc->getMe()->clone());
+ }
+
+ void ClipTag::setStart(String* inStart) {
+ wchar_t* tc = Wrappers::netStrToWStr( inStart );
+ wstring locStr = tc;
+ getMe()->setStart( locStr );
+ Wrappers::releaseWStr( tc );
+ }
+ void ClipTag::setEnd(String* inEnd) {
+ wchar_t* tc = Wrappers::netStrToWStr( inEnd );
+ wstring locStr = tc;
+ getMe()->setEnd( locStr );
+ Wrappers::releaseWStr( tc );
+ }
+
+
+ //Others
+ String* ClipTag::toString() {
+ return Wrappers::WStrToNetStr( getMe()->toString().c_str() );
+
+ }
+
+}
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,62 +30,62 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-using namespace System;
-#using "libiWrapper.dll"
-using namespace illiminable::libiWrapper;
-
-#include "HumReadCMMLTag.h"
-#include "MetaTagList.h"
-#include "AnchorTag.h"
-#include "ImageTag.h"
-#include "DescTag.h"
-
-#pragma unmanaged
-#include <config.h>
-#include <C_ClipTag.h>
-#pragma managed
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- public __gc class ClipTag
- : public HumReadCMMLTag
- {
- public:
- ClipTag(void);
- ClipTag(C_ClipTag* inTag, bool inDeleteBase);
- virtual ~ClipTag(void);
-
-
- //Accessors
- String* track();
- MetaTagList* metaList();
- AnchorTag* anchor();
- ImageTag* image();
- DescTag* desc();
-
- String* start();
- String* end();
-
-
- //Mutators
- void setTrack(String* inTrack);
- void setAnchor(AnchorTag* inAnchor);
- void setImage(ImageTag* inImage);
- void setDesc(DescTag* inDesc);
-
- void setStart(String* inStart);
- void setEnd(String* inEnd);
-
-
- //Others
- virtual String* toString();
-
-
- C_ClipTag* getMe();
- };
-}
-}
+*/
+#pragma once
+
+using namespace System;
+#using "libiWrapper.dll"
+using namespace illiminable::libiWrapper;
+
+#include "HumReadCMMLTag.h"
+#include "MetaTagList.h"
+#include "AnchorTag.h"
+#include "ImageTag.h"
+#include "DescTag.h"
+
+#pragma unmanaged
+#include <config.h>
+#include <C_ClipTag.h>
+#pragma managed
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ public __gc class ClipTag
+ : public HumReadCMMLTag
+ {
+ public:
+ ClipTag(void);
+ ClipTag(C_ClipTag* inTag, bool inDeleteBase);
+ virtual ~ClipTag(void);
+
+
+ //Accessors
+ String* track();
+ MetaTagList* metaList();
+ AnchorTag* anchor();
+ ImageTag* image();
+ DescTag* desc();
+
+ String* start();
+ String* end();
+
+
+ //Mutators
+ void setTrack(String* inTrack);
+ void setAnchor(AnchorTag* inAnchor);
+ void setImage(ImageTag* inImage);
+ void setDesc(DescTag* inDesc);
+
+ void setStart(String* inStart);
+ void setEnd(String* inEnd);
+
+
+ //Others
+ virtual String* toString();
+
+
+ C_ClipTag* getMe();
+ };
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTagList.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTagList.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTagList.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,48 +30,48 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "StdAfx.h"
-#include ".\cliptaglist.h"
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
-
- ClipTagList::ClipTagList(void)
- {
- mBaseClass = new C_ClipTagList;
- }
-
- ClipTagList::ClipTagList(C_ClipTagList* inList, bool inDeleteBase)
- {
-
- mBaseClass = inList;
- mDeleteBase = inDeleteBase;
- }
- ClipTagList::~ClipTagList(void)
- {
- if (mDeleteBase) {
- delete mBaseClass;
- }
- mBaseClass = NULL;
- }
-
-
- String* ClipTagList::toString() {
- return Wrappers::WStrToNetStr( getMe()->toString().c_str());
- }
-
- void ClipTagList::addTag(ClipTag* inTag) {
- getMe()->addTag( inTag->getMe()->clone());
- }
- ClipTag* ClipTagList::getTag(unsigned long inTagNo) {
- return new ClipTag( getMe()->getTag(inTagNo), false);
- }
-
- C_ClipTagList* ClipTagList::getMe() {
- return (C_ClipTagList*)mBaseClass;
-
- }
-}
-}
+*/
+
+#include "StdAfx.h"
+#include ".\cliptaglist.h"
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+
+ ClipTagList::ClipTagList(void)
+ {
+ mBaseClass = new C_ClipTagList;
+ }
+
+ ClipTagList::ClipTagList(C_ClipTagList* inList, bool inDeleteBase)
+ {
+
+ mBaseClass = inList;
+ mDeleteBase = inDeleteBase;
+ }
+ ClipTagList::~ClipTagList(void)
+ {
+ if (mDeleteBase) {
+ delete mBaseClass;
+ }
+ mBaseClass = NULL;
+ }
+
+
+ String* ClipTagList::toString() {
+ return Wrappers::WStrToNetStr( getMe()->toString().c_str());
+ }
+
+ void ClipTagList::addTag(ClipTag* inTag) {
+ getMe()->addTag( inTag->getMe()->clone());
+ }
+ ClipTag* ClipTagList::getTag(unsigned long inTagNo) {
+ return new ClipTag( getMe()->getTag(inTagNo), false);
+ }
+
+ C_ClipTagList* ClipTagList::getMe() {
+ return (C_ClipTagList*)mBaseClass;
+
+ }
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTagList.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTagList.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTagList.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTagList.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,39 +30,39 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-using namespace System;
-#using "libiWrapper.dll"
-using namespace illiminable::libiWrapper;
-
-#include "ClipTag.h"
-#include "TagList.h"
-
-
-#pragma unmanaged
-#include <config.h>
-#include <C_ClipTagList.h>
-#pragma managed
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- public __gc class ClipTagList
- : public TagList
- {
- public:
- ClipTagList(void);
- ClipTagList(C_ClipTagList* inList, bool inDeleteBase);
- virtual ~ClipTagList(void);
-
- virtual String* toString();
-
- void addTag(ClipTag* inTag);
- ClipTag* getTag(unsigned long inTagNo);
- C_ClipTagList* getMe();
-
- };
-}
-}
+*/
+#pragma once
+
+using namespace System;
+#using "libiWrapper.dll"
+using namespace illiminable::libiWrapper;
+
+#include "ClipTag.h"
+#include "TagList.h"
+
+
+#pragma unmanaged
+#include <config.h>
+#include <C_ClipTagList.h>
+#pragma managed
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ public __gc class ClipTagList
+ : public TagList
+ {
+ public:
+ ClipTagList(void);
+ ClipTagList(C_ClipTagList* inList, bool inDeleteBase);
+ virtual ~ClipTagList(void);
+
+ virtual String* toString();
+
+ void addTag(ClipTag* inTag);
+ ClipTag* getTag(unsigned long inTagNo);
+ C_ClipTagList* getMe();
+
+ };
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ClipTagList.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/DescTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/DescTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/DescTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,37 +30,37 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\desctag.h"
-
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- DescTag::DescTag(void)
- {
- mBaseClass = new C_DescTag;
- }
-
- DescTag::~DescTag(void)
- {
- if (mDeleteBase) {
- delete mBaseClass;
- }
- mDeleteBase = NULL;
- }
-
- DescTag::DescTag(C_DescTag* inTag, bool inDeleteBase) {
- mBaseClass = inTag;
- mDeleteBase = inDeleteBase;
- }
-
- C_DescTag* DescTag::getMe() {
- return (C_DescTag*)mBaseClass;
- }
- String* DescTag::toString() {
- return Wrappers::WStrToNetStr( getMe()->toString().c_str() );
- }
-}
-}
+*/
+#include "StdAfx.h"
+#include ".\desctag.h"
+
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ DescTag::DescTag(void)
+ {
+ mBaseClass = new C_DescTag;
+ }
+
+ DescTag::~DescTag(void)
+ {
+ if (mDeleteBase) {
+ delete mBaseClass;
+ }
+ mDeleteBase = NULL;
+ }
+
+ DescTag::DescTag(C_DescTag* inTag, bool inDeleteBase) {
+ mBaseClass = inTag;
+ mDeleteBase = inDeleteBase;
+ }
+
+ C_DescTag* DescTag::getMe() {
+ return (C_DescTag*)mBaseClass;
+ }
+ String* DescTag::toString() {
+ return Wrappers::WStrToNetStr( getMe()->toString().c_str() );
+ }
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/DescTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/DescTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/DescTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/DescTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,38 +30,38 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-using namespace System;
-#using "libiWrapper.dll"
-using namespace illiminable::libiWrapper;
-
-#include "TextFieldTag.h"
-
-#pragma unmanaged
-#include <config.h>
-#include <C_DescTag.h>
-#pragma managed
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- ////Other
- //virtual string toString();
-
- public __gc class DescTag
- : public TextFieldTag
-
- {
- public:
- DescTag(void);
- DescTag(C_DescTag* inTag, bool inDeleteBase);
- ~DescTag(void);
- virtual String* toString();
-
-
- C_DescTag* getMe();
- };
-}
-}
+*/
+#pragma once
+
+using namespace System;
+#using "libiWrapper.dll"
+using namespace illiminable::libiWrapper;
+
+#include "TextFieldTag.h"
+
+#pragma unmanaged
+#include <config.h>
+#include <C_DescTag.h>
+#pragma managed
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ ////Other
+ //virtual string toString();
+
+ public __gc class DescTag
+ : public TextFieldTag
+
+ {
+ public:
+ DescTag(void);
+ DescTag(C_DescTag* inTag, bool inDeleteBase);
+ ~DescTag(void);
+ virtual String* toString();
+
+
+ C_DescTag* getMe();
+ };
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/DescTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HeadTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HeadTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HeadTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,82 +30,82 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\headtag.h"
-
-
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- HeadTag::HeadTag(void)
- {
- mBaseClass = new C_HeadTag;
- }
-
- HeadTag::HeadTag(C_HeadTag* inTag, bool inDeleteBase)
- {
- mBaseClass = inTag;
- mDeleteBase = inDeleteBase;
-
- }
-
- HeadTag::~HeadTag(void)
- {
- if (mDeleteBase) {
- delete mBaseClass;
- }
- mBaseClass = NULL;
- }
-
- String* HeadTag::profile() {
- return Wrappers::WStrToNetStr( getMe()->profile().c_str());
- }
- TitleTag* HeadTag::title() {
- //Title is gauranteed to exist.
- return new TitleTag(getMe()->title()->clone());
- }
- BaseTag* HeadTag::base() {
- if (getMe()->base() != NULL) {
- return new BaseTag(getMe()->base(), false);
- } else {
- return NULL;
- }
- }
- MetaTagList* HeadTag::metaList() {
- return new MetaTagList(getMe()->metaList(), false);
-
-
- }
-
- //Mutators
- void HeadTag::setProfile(String* inProfile) {
- wchar_t* tc = Wrappers::netStrToWStr( inProfile );
- wstring locStr = tc;
- getMe()->setProfile( locStr );
- Wrappers::releaseWStr( tc );
-
- }
- void HeadTag::setTitle(TitleTag* inTitle){
- //TODO::: Maybe this needs code to handle a null pointer being passed in.
- getMe()->setTitle(inTitle->getMe()->clone());
- }
- void HeadTag::setBase(BaseTag* inBase) {
- getMe()->setBase(inBase->getMe()->clone());
- }
-
- //Other
- String* HeadTag::toString() {
-
- return Wrappers::WStrToNetStr( getMe()->toString().c_str());
-
-
- }
-
- C_HeadTag* HeadTag::getMe() {
- return (C_HeadTag*)mBaseClass;
- }
-
-}
-}
+*/
+#include "StdAfx.h"
+#include ".\headtag.h"
+
+
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ HeadTag::HeadTag(void)
+ {
+ mBaseClass = new C_HeadTag;
+ }
+
+ HeadTag::HeadTag(C_HeadTag* inTag, bool inDeleteBase)
+ {
+ mBaseClass = inTag;
+ mDeleteBase = inDeleteBase;
+
+ }
+
+ HeadTag::~HeadTag(void)
+ {
+ if (mDeleteBase) {
+ delete mBaseClass;
+ }
+ mBaseClass = NULL;
+ }
+
+ String* HeadTag::profile() {
+ return Wrappers::WStrToNetStr( getMe()->profile().c_str());
+ }
+ TitleTag* HeadTag::title() {
+ //Title is gauranteed to exist.
+ return new TitleTag(getMe()->title()->clone());
+ }
+ BaseTag* HeadTag::base() {
+ if (getMe()->base() != NULL) {
+ return new BaseTag(getMe()->base(), false);
+ } else {
+ return NULL;
+ }
+ }
+ MetaTagList* HeadTag::metaList() {
+ return new MetaTagList(getMe()->metaList(), false);
+
+
+ }
+
+ //Mutators
+ void HeadTag::setProfile(String* inProfile) {
+ wchar_t* tc = Wrappers::netStrToWStr( inProfile );
+ wstring locStr = tc;
+ getMe()->setProfile( locStr );
+ Wrappers::releaseWStr( tc );
+
+ }
+ void HeadTag::setTitle(TitleTag* inTitle){
+ //TODO::: Maybe this needs code to handle a null pointer being passed in.
+ getMe()->setTitle(inTitle->getMe()->clone());
+ }
+ void HeadTag::setBase(BaseTag* inBase) {
+ getMe()->setBase(inBase->getMe()->clone());
+ }
+
+ //Other
+ String* HeadTag::toString() {
+
+ return Wrappers::WStrToNetStr( getMe()->toString().c_str());
+
+
+ }
+
+ C_HeadTag* HeadTag::getMe() {
+ return (C_HeadTag*)mBaseClass;
+ }
+
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HeadTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HeadTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HeadTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HeadTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,51 +30,51 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#pragma once
-
-using namespace System;
-#using "libiWrapper.dll"
-using namespace illiminable::libiWrapper;
-
-#include "TitleTag.h"
-#include "BaseTag.h"
-#include "MetaTagList.h"
-#include "HumReadCMMLTag.h"
-
-#pragma unmanaged
-#include <config.h>
-#include <C_HeadTag.h>
-#pragma managed
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- public __gc class HeadTag
- : public HumReadCMMLTag
- {
- public:
- HeadTag(void);
- HeadTag(C_HeadTag* inTag, bool inDeleteBase);
- virtual ~HeadTag(void);
-
-
- //Accessors
- String* profile();
- TitleTag* title();
- BaseTag* base();
- MetaTagList* metaList();
-
- //Mutators
- void setProfile(String* inProfile);
- void setTitle(TitleTag* inTitle);
- void setBase(BaseTag* inBase);
-
- //Other
- virtual String* toString();
- C_HeadTag* getMe();
- };
-
-}
-}
+*/
+
+#pragma once
+
+using namespace System;
+#using "libiWrapper.dll"
+using namespace illiminable::libiWrapper;
+
+#include "TitleTag.h"
+#include "BaseTag.h"
+#include "MetaTagList.h"
+#include "HumReadCMMLTag.h"
+
+#pragma unmanaged
+#include <config.h>
+#include <C_HeadTag.h>
+#pragma managed
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ public __gc class HeadTag
+ : public HumReadCMMLTag
+ {
+ public:
+ HeadTag(void);
+ HeadTag(C_HeadTag* inTag, bool inDeleteBase);
+ virtual ~HeadTag(void);
+
+
+ //Accessors
+ String* profile();
+ TitleTag* title();
+ BaseTag* base();
+ MetaTagList* metaList();
+
+ //Mutators
+ void setProfile(String* inProfile);
+ void setTitle(TitleTag* inTitle);
+ void setBase(BaseTag* inBase);
+
+ //Other
+ virtual String* toString();
+ C_HeadTag* getMe();
+ };
+
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HeadTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HumReadCMMLTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HumReadCMMLTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HumReadCMMLTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,47 +30,47 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\humreadcmmltag.h"
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- HumReadCMMLTag::HumReadCMMLTag(void)
- {
- //ABSTRACT
- }
-
- HumReadCMMLTag::~HumReadCMMLTag(void)
- {
- //ABSTRACT
- }
-
- C_HumReadCMMLTag* HumReadCMMLTag::getMe() {
- return (C_HumReadCMMLTag*)mBaseClass;
- }
- //Accessors
- String* HumReadCMMLTag::lang() {
- return Wrappers::WStrToNetStr( getMe()->lang().c_str() );
- }
- String* HumReadCMMLTag::dirn() {
- return Wrappers::WStrToNetStr( getMe()->dirn().c_str() );
- }
-
- //Mutators
- void HumReadCMMLTag::setLang(String* inLang) {
- wchar_t* tc = Wrappers::netStrToWStr( inLang );
- wstring locStr = tc;
- getMe()->setLang( locStr );
- Wrappers::releaseWStr( tc );
- }
- void HumReadCMMLTag::setDirn(String* inDirn) {
- wchar_t* tc = Wrappers::netStrToWStr( inDirn );
- wstring locStr = tc;
- getMe()->setDirn( locStr );
- Wrappers::releaseWStr( tc );
- }
-
-}
-}
+*/
+#include "StdAfx.h"
+#include ".\humreadcmmltag.h"
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ HumReadCMMLTag::HumReadCMMLTag(void)
+ {
+ //ABSTRACT
+ }
+
+ HumReadCMMLTag::~HumReadCMMLTag(void)
+ {
+ //ABSTRACT
+ }
+
+ C_HumReadCMMLTag* HumReadCMMLTag::getMe() {
+ return (C_HumReadCMMLTag*)mBaseClass;
+ }
+ //Accessors
+ String* HumReadCMMLTag::lang() {
+ return Wrappers::WStrToNetStr( getMe()->lang().c_str() );
+ }
+ String* HumReadCMMLTag::dirn() {
+ return Wrappers::WStrToNetStr( getMe()->dirn().c_str() );
+ }
+
+ //Mutators
+ void HumReadCMMLTag::setLang(String* inLang) {
+ wchar_t* tc = Wrappers::netStrToWStr( inLang );
+ wstring locStr = tc;
+ getMe()->setLang( locStr );
+ Wrappers::releaseWStr( tc );
+ }
+ void HumReadCMMLTag::setDirn(String* inDirn) {
+ wchar_t* tc = Wrappers::netStrToWStr( inDirn );
+ wstring locStr = tc;
+ getMe()->setDirn( locStr );
+ Wrappers::releaseWStr( tc );
+ }
+
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HumReadCMMLTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HumReadCMMLTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HumReadCMMLTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HumReadCMMLTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,74 +30,74 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#pragma once
-
-using namespace System;
-#using "libiWrapper.dll"
-using namespace illiminable::libiWrapper;
-
-
-
-#include "CMMLTag.h"
-
-#pragma unmanaged
-#include <config.h>
-#include <C_HumReadCMMLTag.h>
-#pragma managed
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- public __gc class HumReadCMMLTag
- : public CMMLTag
- {
-
- //class CPP_LIB_CMML_API C_HumReadCMMLTag :
- // //Derived Classes
- // public C_CMMLTag
- //{
- //public:
- // //Constructors
- // C_HumReadCMMLTag(void);
- // virtual ~C_HumReadCMMLTag(void);
- //
- // //Accessors
- // string lang();
- // string dirn();
- //
- // //Mutators
- // void setLang(string inLang);
- // void setDirn(string inDirn);
- //
- // //Other
- // virtual string toString() = 0;
- //
- //protected:
- // //Property Data
- // string mLang;
- // string mDirn;
- //};
-
- public:
- HumReadCMMLTag(void);
- virtual ~HumReadCMMLTag(void);
-
- //Accessors
- String* lang();
- String* dirn();
-
- //Mutators
- void setLang(String* inLang);
- void setDirn(String* inDirn);
-
- //Other
- virtual String* toString() = 0;
-
-
- protected:
- C_HumReadCMMLTag* getMe();
- };
-}
-}
+*/
+
+#pragma once
+
+using namespace System;
+#using "libiWrapper.dll"
+using namespace illiminable::libiWrapper;
+
+
+
+#include "CMMLTag.h"
+
+#pragma unmanaged
+#include <config.h>
+#include <C_HumReadCMMLTag.h>
+#pragma managed
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ public __gc class HumReadCMMLTag
+ : public CMMLTag
+ {
+
+ //class CPP_LIB_CMML_API C_HumReadCMMLTag :
+ // //Derived Classes
+ // public C_CMMLTag
+ //{
+ //public:
+ // //Constructors
+ // C_HumReadCMMLTag(void);
+ // virtual ~C_HumReadCMMLTag(void);
+ //
+ // //Accessors
+ // string lang();
+ // string dirn();
+ //
+ // //Mutators
+ // void setLang(string inLang);
+ // void setDirn(string inDirn);
+ //
+ // //Other
+ // virtual string toString() = 0;
+ //
+ //protected:
+ // //Property Data
+ // string mLang;
+ // string mDirn;
+ //};
+
+ public:
+ HumReadCMMLTag(void);
+ virtual ~HumReadCMMLTag(void);
+
+ //Accessors
+ String* lang();
+ String* dirn();
+
+ //Mutators
+ void setLang(String* inLang);
+ void setDirn(String* inDirn);
+
+ //Other
+ virtual String* toString() = 0;
+
+
+ protected:
+ C_HumReadCMMLTag* getMe();
+ };
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/HumReadCMMLTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImageTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImageTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImageTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,63 +30,63 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\imagetag.h"
-
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- ImageTag::ImageTag(void)
- {
- mBaseClass = new C_ImageTag;
- }
-
- ImageTag::~ImageTag(void)
- {
- if (mDeleteBase) {
- delete mBaseClass;
- }
- mBaseClass = NULL;
- }
-
- ImageTag::ImageTag(C_ImageTag* inTag, bool inDeleteBase) {
- mBaseClass = inTag;
- mDeleteBase = inDeleteBase;
- }
-
- //Accessors
- String* ImageTag::src() {
- return Wrappers::WStrToNetStr( getMe()->src().c_str() );
- }
- String* ImageTag::alt() {
- return Wrappers::WStrToNetStr( getMe()->alt().c_str() );
- }
-
- //Mutators
- void ImageTag::setSrc(String* inSrc) {
- wchar_t* tc = Wrappers::netStrToWStr( inSrc );
- wstring locStr = tc;
- getMe()->setSrc( locStr );
- Wrappers::releaseWStr( tc );
- }
- void ImageTag::setAlt(String* inAlt) {
- wchar_t* tc = Wrappers::netStrToWStr( inAlt );
- wstring locStr = tc;
- getMe()->setAlt( locStr );
- Wrappers::releaseWStr( tc );
- }
-
- //Other
- String* ImageTag::toString() {
- return Wrappers::WStrToNetStr( getMe()->toString().c_str() );
- }
-
-
- C_ImageTag* ImageTag::getMe() {
- return (C_ImageTag*)mBaseClass;
- }
-
-}
-}
+*/
+#include "StdAfx.h"
+#include ".\imagetag.h"
+
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ ImageTag::ImageTag(void)
+ {
+ mBaseClass = new C_ImageTag;
+ }
+
+ ImageTag::~ImageTag(void)
+ {
+ if (mDeleteBase) {
+ delete mBaseClass;
+ }
+ mBaseClass = NULL;
+ }
+
+ ImageTag::ImageTag(C_ImageTag* inTag, bool inDeleteBase) {
+ mBaseClass = inTag;
+ mDeleteBase = inDeleteBase;
+ }
+
+ //Accessors
+ String* ImageTag::src() {
+ return Wrappers::WStrToNetStr( getMe()->src().c_str() );
+ }
+ String* ImageTag::alt() {
+ return Wrappers::WStrToNetStr( getMe()->alt().c_str() );
+ }
+
+ //Mutators
+ void ImageTag::setSrc(String* inSrc) {
+ wchar_t* tc = Wrappers::netStrToWStr( inSrc );
+ wstring locStr = tc;
+ getMe()->setSrc( locStr );
+ Wrappers::releaseWStr( tc );
+ }
+ void ImageTag::setAlt(String* inAlt) {
+ wchar_t* tc = Wrappers::netStrToWStr( inAlt );
+ wstring locStr = tc;
+ getMe()->setAlt( locStr );
+ Wrappers::releaseWStr( tc );
+ }
+
+ //Other
+ String* ImageTag::toString() {
+ return Wrappers::WStrToNetStr( getMe()->toString().c_str() );
+ }
+
+
+ C_ImageTag* ImageTag::getMe() {
+ return (C_ImageTag*)mBaseClass;
+ }
+
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImageTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImageTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImageTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImageTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,47 +30,47 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-
-
-using namespace System;
-#using "libiWrapper.dll"
-using namespace illiminable::libiWrapper;
-
-#include "HumReadCMMLTag.h"
-
-#pragma unmanaged
-#include <config.h>
-#include <C_ImageTag.h>
-#pragma managed
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- public __gc class ImageTag
- : public HumReadCMMLTag
- {
- public:
- ImageTag(void);
- ImageTag(C_ImageTag* inTag, bool inDeleteBase);
- virtual ~ImageTag(void);
-
-
- //Accessors
- String* src();
- String* alt();
-
- //Mutators
- void setSrc(String* inSrc);
- void setAlt(String* inAlt);
-
- //Other
- virtual String* toString();
-
-
- C_ImageTag* getMe();
- };
-}
-}
+*/
+#pragma once
+
+
+
+using namespace System;
+#using "libiWrapper.dll"
+using namespace illiminable::libiWrapper;
+
+#include "HumReadCMMLTag.h"
+
+#pragma unmanaged
+#include <config.h>
+#include <C_ImageTag.h>
+#pragma managed
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ public __gc class ImageTag
+ : public HumReadCMMLTag
+ {
+ public:
+ ImageTag(void);
+ ImageTag(C_ImageTag* inTag, bool inDeleteBase);
+ virtual ~ImageTag(void);
+
+
+ //Accessors
+ String* src();
+ String* alt();
+
+ //Mutators
+ void setSrc(String* inSrc);
+ void setAlt(String* inAlt);
+
+ //Other
+ virtual String* toString();
+
+
+ C_ImageTag* getMe();
+ };
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImageTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImportTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImportTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImportTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,108 +30,108 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\importtag.h"
-
-
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- ImportTag::ImportTag(void)
- {
- mBaseClass = new C_ImportTag;
- }
-
- ImportTag::ImportTag(C_ImportTag* inTag, bool inDeleteBase)
- {
- mBaseClass = inTag;
- mDeleteBase = inDeleteBase;
- }
-
- ImportTag::~ImportTag(void)
- {
- if (mDeleteBase) {
- delete mBaseClass;
- }
-
- mBaseClass = NULL;
- }
-
- //Accessors
- String* ImportTag::granuleRate() {
- return Wrappers::WStrToNetStr( getMe()->granuleRate().c_str() );
- }
- String* ImportTag::contentType() {
- return Wrappers::WStrToNetStr( getMe()->contentType().c_str() );
- }
- String* ImportTag::src() {
- return Wrappers::WStrToNetStr( getMe()->src().c_str() );
- }
- String* ImportTag::start() {
- return Wrappers::WStrToNetStr( getMe()->start().c_str() );
- }
- String* ImportTag::end() {
- return Wrappers::WStrToNetStr( getMe()->end().c_str() );
- }
- String* ImportTag::title() {
- return Wrappers::WStrToNetStr( getMe()->title().c_str() );
- }
- ParamTagList* ImportTag::paramList() {
- return new ParamTagList(getMe()->paramList()->clone());
-
- }
-
- //Mutators
- void ImportTag::setGranuleRate(String* inGranuleRate) {
- wchar_t* tc = Wrappers::netStrToWStr( inGranuleRate );
- wstring locStr = tc;
- getMe()->setGranuleRate( locStr );
- Wrappers::releaseWStr( tc );
- }
- void ImportTag::setContentType(String* inContentType) {
- wchar_t* tc = Wrappers::netStrToWStr( inContentType );
- wstring locStr = tc;
- getMe()->setContentType( locStr );
- Wrappers::releaseWStr( tc );
- }
- void ImportTag::setSrc(String* inSrc) {
- wchar_t* tc = Wrappers::netStrToWStr( inSrc );
- wstring locStr = tc;
- getMe()->setSrc( locStr );
- Wrappers::releaseWStr( tc );
- }
- void ImportTag::setStart(String* inStart) {
- wchar_t* tc = Wrappers::netStrToWStr( inStart );
- wstring locStr = tc;
- getMe()->setStart( locStr );
- Wrappers::releaseWStr( tc );
- }
- void ImportTag::setEnd(String* inEnd) {
- wchar_t* tc = Wrappers::netStrToWStr( inEnd );
- wstring locStr = tc;
- getMe()->setEnd( locStr );
- Wrappers::releaseWStr( tc );
- }
- void ImportTag::setTitle(String* inTitle) {
- wchar_t* tc = Wrappers::netStrToWStr( inTitle );
- wstring locStr = tc;
- getMe()->setTitle( locStr );
- Wrappers::releaseWStr( tc );
- }
- void ImportTag::setParamList(ParamTagList* inParamList) {
- getMe()->setParamList(inParamList->getMe()->clone());
- }
-
- //Other
- String* ImportTag::toString() {
- return Wrappers::WStrToNetStr( getMe()->toString().c_str() );
-
- }
-
- C_ImportTag* ImportTag::getMe() {
- return (C_ImportTag*)mBaseClass;
- }
-}
-}
+*/
+#include "StdAfx.h"
+#include ".\importtag.h"
+
+
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ ImportTag::ImportTag(void)
+ {
+ mBaseClass = new C_ImportTag;
+ }
+
+ ImportTag::ImportTag(C_ImportTag* inTag, bool inDeleteBase)
+ {
+ mBaseClass = inTag;
+ mDeleteBase = inDeleteBase;
+ }
+
+ ImportTag::~ImportTag(void)
+ {
+ if (mDeleteBase) {
+ delete mBaseClass;
+ }
+
+ mBaseClass = NULL;
+ }
+
+ //Accessors
+ String* ImportTag::granuleRate() {
+ return Wrappers::WStrToNetStr( getMe()->granuleRate().c_str() );
+ }
+ String* ImportTag::contentType() {
+ return Wrappers::WStrToNetStr( getMe()->contentType().c_str() );
+ }
+ String* ImportTag::src() {
+ return Wrappers::WStrToNetStr( getMe()->src().c_str() );
+ }
+ String* ImportTag::start() {
+ return Wrappers::WStrToNetStr( getMe()->start().c_str() );
+ }
+ String* ImportTag::end() {
+ return Wrappers::WStrToNetStr( getMe()->end().c_str() );
+ }
+ String* ImportTag::title() {
+ return Wrappers::WStrToNetStr( getMe()->title().c_str() );
+ }
+ ParamTagList* ImportTag::paramList() {
+ return new ParamTagList(getMe()->paramList()->clone());
+
+ }
+
+ //Mutators
+ void ImportTag::setGranuleRate(String* inGranuleRate) {
+ wchar_t* tc = Wrappers::netStrToWStr( inGranuleRate );
+ wstring locStr = tc;
+ getMe()->setGranuleRate( locStr );
+ Wrappers::releaseWStr( tc );
+ }
+ void ImportTag::setContentType(String* inContentType) {
+ wchar_t* tc = Wrappers::netStrToWStr( inContentType );
+ wstring locStr = tc;
+ getMe()->setContentType( locStr );
+ Wrappers::releaseWStr( tc );
+ }
+ void ImportTag::setSrc(String* inSrc) {
+ wchar_t* tc = Wrappers::netStrToWStr( inSrc );
+ wstring locStr = tc;
+ getMe()->setSrc( locStr );
+ Wrappers::releaseWStr( tc );
+ }
+ void ImportTag::setStart(String* inStart) {
+ wchar_t* tc = Wrappers::netStrToWStr( inStart );
+ wstring locStr = tc;
+ getMe()->setStart( locStr );
+ Wrappers::releaseWStr( tc );
+ }
+ void ImportTag::setEnd(String* inEnd) {
+ wchar_t* tc = Wrappers::netStrToWStr( inEnd );
+ wstring locStr = tc;
+ getMe()->setEnd( locStr );
+ Wrappers::releaseWStr( tc );
+ }
+ void ImportTag::setTitle(String* inTitle) {
+ wchar_t* tc = Wrappers::netStrToWStr( inTitle );
+ wstring locStr = tc;
+ getMe()->setTitle( locStr );
+ Wrappers::releaseWStr( tc );
+ }
+ void ImportTag::setParamList(ParamTagList* inParamList) {
+ getMe()->setParamList(inParamList->getMe()->clone());
+ }
+
+ //Other
+ String* ImportTag::toString() {
+ return Wrappers::WStrToNetStr( getMe()->toString().c_str() );
+
+ }
+
+ C_ImportTag* ImportTag::getMe() {
+ return (C_ImportTag*)mBaseClass;
+ }
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImportTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImportTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImportTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImportTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,56 +30,56 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-using namespace System;
-#using "libiWrapper.dll"
-using namespace illiminable::libiWrapper;
-
-#include "HumReadCMMLTag.h"
-#include "ParamTagList.h"
-
-#pragma unmanaged
-#include <config.h>
-#include <C_ImportTag.h>
-#pragma managed
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- public __gc class ImportTag
- : public HumReadCMMLTag
- {
- public:
- ImportTag(void);
- ImportTag(C_ImportTag* inTag, bool inDeleteBase);
- virtual ~ImportTag(void);
-
-
- //Accessors
- String* granuleRate();
- String* contentType();
- String* src();
- String* start();
- String* end();
- String* title();
- ParamTagList* paramList();
-
- //Mutators
- void setGranuleRate(String* inGranuleRate);
- void setContentType(String* inContentType);
- void setSrc(String* inSrc);
- void setStart(String* inStart);
- void setEnd(String* inEnd);
- void setTitle(String* inTitle);
- void setParamList(ParamTagList* inParamList);
-
- //Other
- virtual String* toString();
- C_ImportTag* getMe();
-
- };
-
-}
-}
+*/
+#pragma once
+
+using namespace System;
+#using "libiWrapper.dll"
+using namespace illiminable::libiWrapper;
+
+#include "HumReadCMMLTag.h"
+#include "ParamTagList.h"
+
+#pragma unmanaged
+#include <config.h>
+#include <C_ImportTag.h>
+#pragma managed
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ public __gc class ImportTag
+ : public HumReadCMMLTag
+ {
+ public:
+ ImportTag(void);
+ ImportTag(C_ImportTag* inTag, bool inDeleteBase);
+ virtual ~ImportTag(void);
+
+
+ //Accessors
+ String* granuleRate();
+ String* contentType();
+ String* src();
+ String* start();
+ String* end();
+ String* title();
+ ParamTagList* paramList();
+
+ //Mutators
+ void setGranuleRate(String* inGranuleRate);
+ void setContentType(String* inContentType);
+ void setSrc(String* inSrc);
+ void setStart(String* inStart);
+ void setEnd(String* inEnd);
+ void setTitle(String* inTitle);
+ void setParamList(ParamTagList* inParamList);
+
+ //Other
+ virtual String* toString();
+ C_ImportTag* getMe();
+
+ };
+
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImportTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImportTagList.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImportTagList.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImportTagList.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,50 +30,50 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\importtaglist.h"
-
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- ImportTagList::ImportTagList(void)
- {
- mBaseClass = new C_ImportTagList;
- }
-
- ImportTagList::ImportTagList(C_ImportTagList* inTagList, bool inDeleteBase) {
-
- mBaseClass = inTagList;
- mDeleteBase = inDeleteBase;
- }
- ImportTagList::~ImportTagList(void)
- {
- if (mDeleteBase) {
- delete mBaseClass;
- }
-
- mBaseClass = NULL;
- }
-
-
- String* ImportTagList::toString() {
- return Wrappers::WStrToNetStr (getMe()->toString().c_str() );
- }
-
- void ImportTagList::addTag(ImportTag* inTag) {
- getMe()->addTag(inTag->getMe()->clone());
-
- }
- ImportTag* ImportTagList::getTag(unsigned long inTagNo) {
- return new ImportTag( getMe()->getTag(inTagNo), false);
- }
-
- C_ImportTagList* ImportTagList::getMe() {
- return (C_ImportTagList*)mBaseClass;
- }
-
-
-}
-}
+*/
+#include "StdAfx.h"
+#include ".\importtaglist.h"
+
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ ImportTagList::ImportTagList(void)
+ {
+ mBaseClass = new C_ImportTagList;
+ }
+
+ ImportTagList::ImportTagList(C_ImportTagList* inTagList, bool inDeleteBase) {
+
+ mBaseClass = inTagList;
+ mDeleteBase = inDeleteBase;
+ }
+ ImportTagList::~ImportTagList(void)
+ {
+ if (mDeleteBase) {
+ delete mBaseClass;
+ }
+
+ mBaseClass = NULL;
+ }
+
+
+ String* ImportTagList::toString() {
+ return Wrappers::WStrToNetStr (getMe()->toString().c_str() );
+ }
+
+ void ImportTagList::addTag(ImportTag* inTag) {
+ getMe()->addTag(inTag->getMe()->clone());
+
+ }
+ ImportTag* ImportTagList::getTag(unsigned long inTagNo) {
+ return new ImportTag( getMe()->getTag(inTagNo), false);
+ }
+
+ C_ImportTagList* ImportTagList::getMe() {
+ return (C_ImportTagList*)mBaseClass;
+ }
+
+
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImportTagList.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImportTagList.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImportTagList.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImportTagList.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,39 +30,39 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-using namespace System;
-#using "libiWrapper.dll"
-using namespace illiminable::libiWrapper;
-
-#include "TagList.h"
-#include "ImportTag.h"
-
-#pragma unmanaged
-#include <config.h>
-#include <C_ImportTagList.h>
-#pragma managed
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- public __gc class ImportTagList
- : public TagList
- {
- public:
- ImportTagList(void);
- ImportTagList(C_ImportTagList* inTagList, bool inDeleteBase);
- ~ImportTagList(void);
-
- virtual String* toString();
-
- void addTag(ImportTag* inTag);
- ImportTag* getTag(unsigned long inTagNo);
-
- C_ImportTagList* getMe();
- };
-
-}
-}
+*/
+#pragma once
+
+using namespace System;
+#using "libiWrapper.dll"
+using namespace illiminable::libiWrapper;
+
+#include "TagList.h"
+#include "ImportTag.h"
+
+#pragma unmanaged
+#include <config.h>
+#include <C_ImportTagList.h>
+#pragma managed
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ public __gc class ImportTagList
+ : public TagList
+ {
+ public:
+ ImportTagList(void);
+ ImportTagList(C_ImportTagList* inTagList, bool inDeleteBase);
+ ~ImportTagList(void);
+
+ virtual String* toString();
+
+ void addTag(ImportTag* inTag);
+ ImportTag* getTag(unsigned long inTagNo);
+
+ C_ImportTagList* getMe();
+ };
+
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ImportTagList.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MMLRootTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MMLRootTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MMLRootTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,11 +1,11 @@
-#include "StdAfx.h"
-#include ".\mmlroottag.h"
-#using <mscorlib.dll>
-
-CMMLRootTag::CMMLRootTag(void)
-{
-}
-
-CMMLRootTag::~CMMLRootTag(void)
-{
-}
+#include "StdAfx.h"
+#include ".\mmlroottag.h"
+#using <mscorlib.dll>
+
+CMMLRootTag::CMMLRootTag(void)
+{
+}
+
+CMMLRootTag::~CMMLRootTag(void)
+{
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MMLRootTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MMLRootTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MMLRootTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MMLRootTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-#pragma once
-
-class CMMLRootTag
-{
-public:
- CMMLRootTag(void);
- ~CMMLRootTag(void);
-};
+#pragma once
+
+class CMMLRootTag
+{
+public:
+ CMMLRootTag(void);
+ ~CMMLRootTag(void);
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MMLRootTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,56 +30,56 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\mappedtag.h"
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- MappedTag::MappedTag(void)
- {
- //ABSTRACT CLASS
- }
-
- MappedTag::~MappedTag(void)
- {
- }
-
- MappedTag::MappedTag(String* inName, String* inContent) {
- setName(inName);
- setContent(inContent);
- }
-
- C_MappedTag* MappedTag::getMe() {
- return (C_MappedTag*)mBaseClass;
- }
- //Accessors
- String* MappedTag::name() {
- return Wrappers::WStrToNetStr( getMe()->name().c_str() );
-
- }
- String* MappedTag::content() {
- return Wrappers::WStrToNetStr( getMe()->content().c_str() );
- }
-
- //Mutators
- void MappedTag::setName(String* inName) {
- wchar_t* tc = Wrappers::netStrToWStr( inName );
- wstring locStr = tc;
- getMe()->setName( locStr );
- Wrappers::releaseWStr( tc );
-
- }
- void MappedTag::setContent(String* inContent) {
- wchar_t* tc = Wrappers::netStrToWStr( inContent );
- wstring locStr = tc;
- getMe()->setContent( locStr );
- Wrappers::releaseWStr( tc );
- }
-
-
-
-
-}
-}
+*/
+#include "StdAfx.h"
+#include ".\mappedtag.h"
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ MappedTag::MappedTag(void)
+ {
+ //ABSTRACT CLASS
+ }
+
+ MappedTag::~MappedTag(void)
+ {
+ }
+
+ MappedTag::MappedTag(String* inName, String* inContent) {
+ setName(inName);
+ setContent(inContent);
+ }
+
+ C_MappedTag* MappedTag::getMe() {
+ return (C_MappedTag*)mBaseClass;
+ }
+ //Accessors
+ String* MappedTag::name() {
+ return Wrappers::WStrToNetStr( getMe()->name().c_str() );
+
+ }
+ String* MappedTag::content() {
+ return Wrappers::WStrToNetStr( getMe()->content().c_str() );
+ }
+
+ //Mutators
+ void MappedTag::setName(String* inName) {
+ wchar_t* tc = Wrappers::netStrToWStr( inName );
+ wstring locStr = tc;
+ getMe()->setName( locStr );
+ Wrappers::releaseWStr( tc );
+
+ }
+ void MappedTag::setContent(String* inContent) {
+ wchar_t* tc = Wrappers::netStrToWStr( inContent );
+ wstring locStr = tc;
+ getMe()->setContent( locStr );
+ Wrappers::releaseWStr( tc );
+ }
+
+
+
+
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,47 +30,47 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-
-using namespace System;
-#using "libiWrapper.dll"
-using namespace illiminable::libiWrapper;
-
-#include "HumReadCMMLTag.h"
-
-#pragma unmanaged
-#include <config.h>
-#include <C_MappedTag.h>
-#pragma managed
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
-
-
- public __gc class MappedTag
- : public HumReadCMMLTag
- {
- public:
- MappedTag(void);
- MappedTag(String* inName, String* inContent);
- virtual ~MappedTag(void);
-
- //Accessors
- String* name();
- String* content();
-
- //Mutators
- void setName(String* inName);
- void setContent(String* inContent);
-
- //Other
- virtual String* toString() = 0;
-
- C_MappedTag* getMe();
- };
-
-}
-}
+*/
+#pragma once
+
+
+using namespace System;
+#using "libiWrapper.dll"
+using namespace illiminable::libiWrapper;
+
+#include "HumReadCMMLTag.h"
+
+#pragma unmanaged
+#include <config.h>
+#include <C_MappedTag.h>
+#pragma managed
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+
+
+ public __gc class MappedTag
+ : public HumReadCMMLTag
+ {
+ public:
+ MappedTag(void);
+ MappedTag(String* inName, String* inContent);
+ virtual ~MappedTag(void);
+
+ //Accessors
+ String* name();
+ String* content();
+
+ //Mutators
+ void setName(String* inName);
+ void setContent(String* inContent);
+
+ //Other
+ virtual String* toString() = 0;
+
+ C_MappedTag* getMe();
+ };
+
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTagList.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTagList.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTagList.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,35 +30,35 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\mappedtaglist.h"
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- MappedTagList::MappedTagList(void)
- {
- //ABSTRACT CLASS
- }
-
- MappedTagList::~MappedTagList(void)
- {
- }
-
- unsigned long MappedTagList::numTags() {
- return mBaseClass->numTags();
- }
-
- String* MappedTagList::getContent(String* inName) {
- wchar_t* tc = Wrappers::netStrToWStr( inName );
- wstring locStr = tc;
- String* ts = Wrappers::WStrToNetStr( mBaseClass->getContent(locStr).c_str() );
- Wrappers::releaseWStr( tc );
- return ts;
- }
-
-
-
-}
-}
+*/
+#include "StdAfx.h"
+#include ".\mappedtaglist.h"
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ MappedTagList::MappedTagList(void)
+ {
+ //ABSTRACT CLASS
+ }
+
+ MappedTagList::~MappedTagList(void)
+ {
+ }
+
+ unsigned long MappedTagList::numTags() {
+ return mBaseClass->numTags();
+ }
+
+ String* MappedTagList::getContent(String* inName) {
+ wchar_t* tc = Wrappers::netStrToWStr( inName );
+ wstring locStr = tc;
+ String* ts = Wrappers::WStrToNetStr( mBaseClass->getContent(locStr).c_str() );
+ Wrappers::releaseWStr( tc );
+ return ts;
+ }
+
+
+
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTagList.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTagList.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTagList.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTagList.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,37 +30,37 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-using namespace System;
-#using "libiWrapper.dll"
-using namespace illiminable::libiWrapper;
-
-
-#pragma unmanaged
-#include <config.h>
-#include <C_MappedTagList.h>
-#pragma managed
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- public __gc class MappedTagList
- {
- public:
- MappedTagList(void);
-
- virtual ~MappedTagList(void);
-
- unsigned long numTags();
-
- String* getContent(String* inName);
-
- protected:
- C_MappedTagList* mBaseClass;
- bool mDeleteBase;
- };
-
-}
-}
+*/
+#pragma once
+
+using namespace System;
+#using "libiWrapper.dll"
+using namespace illiminable::libiWrapper;
+
+
+#pragma unmanaged
+#include <config.h>
+#include <C_MappedTagList.h>
+#pragma managed
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ public __gc class MappedTagList
+ {
+ public:
+ MappedTagList(void);
+
+ virtual ~MappedTagList(void);
+
+ unsigned long numTags();
+
+ String* getContent(String* inName);
+
+ protected:
+ C_MappedTagList* mBaseClass;
+ bool mDeleteBase;
+ };
+
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MappedTagList.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,49 +30,49 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\metatag.h"
-
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- MetaTag::MetaTag(void)
- {
- mBaseClass = new C_MetaTag;
- }
-
- MetaTag::MetaTag(C_MetaTag* inTag) {
- mBaseClass = inTag;
- }
- MetaTag::~MetaTag(void)
- {
- delete mBaseClass;
- }
-
- C_MetaTag* MetaTag::getMe() {
- return (C_MetaTag*)mBaseClass;
- }
-
-
- //Accessors
- String* MetaTag::scheme() {
- return Wrappers::WStrToNetStr( getMe()->scheme().c_str() );
- }
-
- //Mutators
- void MetaTag::setScheme(String* inScheme) {
- wchar_t* tc = Wrappers::netStrToWStr( inScheme );
- wstring locStr = tc;
- getMe()->setScheme( locStr );
- Wrappers::releaseWStr( tc );
- }
-
- //Other
- String* MetaTag::toString() {
- return Wrappers::WStrToNetStr( getMe()->toString().c_str() );
- }
-
-}
-}
+*/
+#include "StdAfx.h"
+#include ".\metatag.h"
+
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ MetaTag::MetaTag(void)
+ {
+ mBaseClass = new C_MetaTag;
+ }
+
+ MetaTag::MetaTag(C_MetaTag* inTag) {
+ mBaseClass = inTag;
+ }
+ MetaTag::~MetaTag(void)
+ {
+ delete mBaseClass;
+ }
+
+ C_MetaTag* MetaTag::getMe() {
+ return (C_MetaTag*)mBaseClass;
+ }
+
+
+ //Accessors
+ String* MetaTag::scheme() {
+ return Wrappers::WStrToNetStr( getMe()->scheme().c_str() );
+ }
+
+ //Mutators
+ void MetaTag::setScheme(String* inScheme) {
+ wchar_t* tc = Wrappers::netStrToWStr( inScheme );
+ wstring locStr = tc;
+ getMe()->setScheme( locStr );
+ Wrappers::releaseWStr( tc );
+ }
+
+ //Other
+ String* MetaTag::toString() {
+ return Wrappers::WStrToNetStr( getMe()->toString().c_str() );
+ }
+
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,41 +30,41 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-using namespace System;
-#using "libiWrapper.dll"
-using namespace illiminable::libiWrapper;
-
-#include "MappedTag.h"
-
-#pragma unmanaged
-#include <config.h>
-#include <C_MetaTag.h>
-#pragma managed
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- public __gc class MetaTag
- : public MappedTag
- {
- public:
- MetaTag(void);
- MetaTag(C_MetaTag* inTag);
- virtual ~MetaTag(void);
-
- //Accessors
- String* scheme();
-
- //Mutators
- void setScheme(String* inScheme);
-
- //Other
- virtual String* toString();
-
- C_MetaTag* getMe();
- };
-}
-}
+*/
+#pragma once
+
+using namespace System;
+#using "libiWrapper.dll"
+using namespace illiminable::libiWrapper;
+
+#include "MappedTag.h"
+
+#pragma unmanaged
+#include <config.h>
+#include <C_MetaTag.h>
+#pragma managed
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ public __gc class MetaTag
+ : public MappedTag
+ {
+ public:
+ MetaTag(void);
+ MetaTag(C_MetaTag* inTag);
+ virtual ~MetaTag(void);
+
+ //Accessors
+ String* scheme();
+
+ //Mutators
+ void setScheme(String* inScheme);
+
+ //Other
+ virtual String* toString();
+
+ C_MetaTag* getMe();
+ };
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTagList.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTagList.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTagList.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,88 +30,88 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\metataglist.h"
-#using <mscorlib.dll>
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- MetaTagList::MetaTagList(void)
- {
- mBaseClass = new C_MetaTagList;
- }
-
- MetaTagList::MetaTagList(C_MetaTagList* inList, bool inDeleteBase)
- {
- mBaseClass = inList;
- mDeleteBase = inDeleteBase;
- }
-
- MetaTagList::~MetaTagList(void)
- {
- if (mDeleteBase) {
- delete mBaseClass;
- }
- mBaseClass = NULL;
- }
-
- void MetaTagList::emptyList() {
- getMe()->emptyList();
- }
-
-
- void MetaTagList::addTag(MetaTag* inTag) {
- getMe()->addTag(inTag->getMe()->clone());
-
- }
- void MetaTagList::addTag(String* inName, String* inContent) {
- wchar_t* tc1 = Wrappers::netStrToWStr( inName );
- wchar_t* tc2 = Wrappers::netStrToWStr( inContent );
-
- wstring locStr1 = tc1;
- wstring locStr2 = tc2;
-
- getMe()->addTag(locStr1, locStr2);
-
- Wrappers::releaseWStr( tc2 );
- Wrappers::releaseWStr( tc1 );
- }
- //void removeTag ???
- unsigned long MetaTagList::numTags() {
- return getMe()->numTags();
-
- }
-
- MetaTag* MetaTagList::getTag(unsigned long inTagNo) {
- return new MetaTag(getMe()->getTag(inTagNo));
- }
- MetaTag* MetaTagList::getTag(String* inName) {
- wchar_t* tc = Wrappers::netStrToWStr( inName );
- wstring locStr = tc;
- MetaTag* retVal = new MetaTag(getMe()->getTag(locStr));
- Wrappers::releaseWStr( tc );
- return retVal;
-
- }
-
- String* MetaTagList::getContent(String* inName) {
- wchar_t* tc = Wrappers::netStrToWStr( inName );
- wstring locStr = tc;
- String* ts = Wrappers::WStrToNetStr(getMe()->getContent(locStr).c_str());
- Wrappers::releaseWStr( tc );
- return ts;
- }
-
- String* MetaTagList::toString() {
- return Wrappers::WStrToNetStr(getMe()->toString().c_str());
- }
-
-
- C_MetaTagList* MetaTagList::getMe() {
- return (C_MetaTagList*)mBaseClass;
- }
-
-}
-}
+*/
+#include "StdAfx.h"
+#include ".\metataglist.h"
+#using <mscorlib.dll>
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ MetaTagList::MetaTagList(void)
+ {
+ mBaseClass = new C_MetaTagList;
+ }
+
+ MetaTagList::MetaTagList(C_MetaTagList* inList, bool inDeleteBase)
+ {
+ mBaseClass = inList;
+ mDeleteBase = inDeleteBase;
+ }
+
+ MetaTagList::~MetaTagList(void)
+ {
+ if (mDeleteBase) {
+ delete mBaseClass;
+ }
+ mBaseClass = NULL;
+ }
+
+ void MetaTagList::emptyList() {
+ getMe()->emptyList();
+ }
+
+
+ void MetaTagList::addTag(MetaTag* inTag) {
+ getMe()->addTag(inTag->getMe()->clone());
+
+ }
+ void MetaTagList::addTag(String* inName, String* inContent) {
+ wchar_t* tc1 = Wrappers::netStrToWStr( inName );
+ wchar_t* tc2 = Wrappers::netStrToWStr( inContent );
+
+ wstring locStr1 = tc1;
+ wstring locStr2 = tc2;
+
+ getMe()->addTag(locStr1, locStr2);
+
+ Wrappers::releaseWStr( tc2 );
+ Wrappers::releaseWStr( tc1 );
+ }
+ //void removeTag ???
+ unsigned long MetaTagList::numTags() {
+ return getMe()->numTags();
+
+ }
+
+ MetaTag* MetaTagList::getTag(unsigned long inTagNo) {
+ return new MetaTag(getMe()->getTag(inTagNo));
+ }
+ MetaTag* MetaTagList::getTag(String* inName) {
+ wchar_t* tc = Wrappers::netStrToWStr( inName );
+ wstring locStr = tc;
+ MetaTag* retVal = new MetaTag(getMe()->getTag(locStr));
+ Wrappers::releaseWStr( tc );
+ return retVal;
+
+ }
+
+ String* MetaTagList::getContent(String* inName) {
+ wchar_t* tc = Wrappers::netStrToWStr( inName );
+ wstring locStr = tc;
+ String* ts = Wrappers::WStrToNetStr(getMe()->getContent(locStr).c_str());
+ Wrappers::releaseWStr( tc );
+ return ts;
+ }
+
+ String* MetaTagList::toString() {
+ return Wrappers::WStrToNetStr(getMe()->toString().c_str());
+ }
+
+
+ C_MetaTagList* MetaTagList::getMe() {
+ return (C_MetaTagList*)mBaseClass;
+ }
+
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTagList.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTagList.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTagList.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTagList.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,48 +30,48 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-using namespace System;
-#using "libiWrapper.dll"
-using namespace illiminable::libiWrapper;
-
-#include "MappedTagList.h"
-#include "MetaTag.h"
-
-#pragma unmanaged
-#include <config.h>
-#include <C_MetaTagList.h>
-#pragma managed
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
-
- public __gc class MetaTagList
- : public MappedTagList
- {
- public:
- MetaTagList(void);
- MetaTagList(C_MetaTagList* inTag, bool inDeleteBase);
- virtual ~MetaTagList(void);
-
- void emptyList();
- void addTag(MetaTag* inTag);
- void addTag(String* inName, String* inContent);
- //void removeTag ???
- unsigned long numTags();
-
- MetaTag* getTag(unsigned long inTagNo);
- MetaTag* getTag(String* inName);
-
- String* getContent(String* inName);
-
- String* toString();
-
- protected:
- C_MetaTagList* getMe();
- };
-}
-}
+*/
+#pragma once
+
+using namespace System;
+#using "libiWrapper.dll"
+using namespace illiminable::libiWrapper;
+
+#include "MappedTagList.h"
+#include "MetaTag.h"
+
+#pragma unmanaged
+#include <config.h>
+#include <C_MetaTagList.h>
+#pragma managed
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+
+ public __gc class MetaTagList
+ : public MappedTagList
+ {
+ public:
+ MetaTagList(void);
+ MetaTagList(C_MetaTagList* inTag, bool inDeleteBase);
+ virtual ~MetaTagList(void);
+
+ void emptyList();
+ void addTag(MetaTag* inTag);
+ void addTag(String* inName, String* inContent);
+ //void removeTag ???
+ unsigned long numTags();
+
+ MetaTag* getTag(unsigned long inTagNo);
+ MetaTag* getTag(String* inName);
+
+ String* getContent(String* inName);
+
+ String* toString();
+
+ protected:
+ C_MetaTagList* getMe();
+ };
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/MetaTagList.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ParamTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ParamTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ParamTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,33 +30,33 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\paramtag.h"
-
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- ParamTag::ParamTag(void)
- {
- mBaseClass = new C_ParamTag;
- }
-
- ParamTag::ParamTag(C_ParamTag* inTag) {
- mBaseClass = inTag;
- }
- ParamTag::~ParamTag(void)
- {
- delete mBaseClass;
- }
-
- C_ParamTag* ParamTag::getMe() {
- return (C_ParamTag*)mBaseClass;
- }
-
- String* ParamTag::toString() {
- return Wrappers::WStrToNetStr( getMe()->toString().c_str() );
- }
-}
-}
+*/
+#include "StdAfx.h"
+#include ".\paramtag.h"
+
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ ParamTag::ParamTag(void)
+ {
+ mBaseClass = new C_ParamTag;
+ }
+
+ ParamTag::ParamTag(C_ParamTag* inTag) {
+ mBaseClass = inTag;
+ }
+ ParamTag::~ParamTag(void)
+ {
+ delete mBaseClass;
+ }
+
+ C_ParamTag* ParamTag::getMe() {
+ return (C_ParamTag*)mBaseClass;
+ }
+
+ String* ParamTag::toString() {
+ return Wrappers::WStrToNetStr( getMe()->toString().c_str() );
+ }
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ParamTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ParamTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ParamTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ParamTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,38 +30,38 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-
-using namespace System;
-#using "libiWrapper.dll"
-using namespace illiminable::libiWrapper;
-
-#include "MappedTag.h"
-
-#pragma unmanaged
-#include <config.h>
-#include <C_ParamTag.h>
-#pragma managed
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- public __gc class ParamTag
- : public MappedTag
- {
- public:
- ParamTag(void);
- ParamTag(C_ParamTag* inTag);
- virtual ~ParamTag(void);
-
- //Other
- String* toString();
-
-
- C_ParamTag* getMe();
-
- };
-}
-}
+*/
+#pragma once
+
+
+using namespace System;
+#using "libiWrapper.dll"
+using namespace illiminable::libiWrapper;
+
+#include "MappedTag.h"
+
+#pragma unmanaged
+#include <config.h>
+#include <C_ParamTag.h>
+#pragma managed
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ public __gc class ParamTag
+ : public MappedTag
+ {
+ public:
+ ParamTag(void);
+ ParamTag(C_ParamTag* inTag);
+ virtual ~ParamTag(void);
+
+ //Other
+ String* toString();
+
+
+ C_ParamTag* getMe();
+
+ };
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ParamTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ParamTagList.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ParamTagList.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ParamTagList.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,47 +30,47 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\paramtaglist.h"
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
-
- ParamTagList::ParamTagList(void)
- {
- mBaseClass = new C_ParamTagList;
- }
-
- ParamTagList::ParamTagList(C_ParamTagList* inTagList) {
- mBaseClass = inTagList;
-
- }
-
- ParamTagList::~ParamTagList(void)
- {
- delete mBaseClass;
- }
- //Accessors
- ParamTag* ParamTagList::getTag(unsigned long inTagNo) {
- return new ParamTag(getMe()->getTag(inTagNo)->clone());
- }
-
- //Mutators
- void ParamTagList::addTag(ParamTag* inTag) {
- getMe()->addTag(inTag->getMe()->clone());
- }
-
- //Other
- String* ParamTagList::toString() {
- return Wrappers::WStrToNetStr( getMe()->toString().c_str() );
- }
-
-
- C_ParamTagList* ParamTagList::getMe() {
- return (C_ParamTagList*)mBaseClass;
- }
-
-}
-}
+*/
+#include "StdAfx.h"
+#include ".\paramtaglist.h"
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+
+ ParamTagList::ParamTagList(void)
+ {
+ mBaseClass = new C_ParamTagList;
+ }
+
+ ParamTagList::ParamTagList(C_ParamTagList* inTagList) {
+ mBaseClass = inTagList;
+
+ }
+
+ ParamTagList::~ParamTagList(void)
+ {
+ delete mBaseClass;
+ }
+ //Accessors
+ ParamTag* ParamTagList::getTag(unsigned long inTagNo) {
+ return new ParamTag(getMe()->getTag(inTagNo)->clone());
+ }
+
+ //Mutators
+ void ParamTagList::addTag(ParamTag* inTag) {
+ getMe()->addTag(inTag->getMe()->clone());
+ }
+
+ //Other
+ String* ParamTagList::toString() {
+ return Wrappers::WStrToNetStr( getMe()->toString().c_str() );
+ }
+
+
+ C_ParamTagList* ParamTagList::getMe() {
+ return (C_ParamTagList*)mBaseClass;
+ }
+
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ParamTagList.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ParamTagList.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ParamTagList.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ParamTagList.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,44 +30,44 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-using namespace System;
-#using "libiWrapper.dll"
-using namespace illiminable::libiWrapper;
-
-#include "MappedTagList.h"
-#include "ParamTag.h"
-
-#pragma unmanaged
-#include <config.h>
-#include <C_ParamTagList.h>
-#pragma managed
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- public __gc class ParamTagList
- : public MappedTagList
- {
- public:
- ParamTagList(void);
- ParamTagList(C_ParamTagList* inTagList);
- virtual ~ParamTagList(void);
-
- //Accessors
- ParamTag* getTag(unsigned long inTagNo);
-
- //Mutators
- void addTag(ParamTag* inTag);
-
- //Other
- virtual String* toString();
-
-
- C_ParamTagList* getMe();
-
- };
-}
-}
+*/
+#pragma once
+
+using namespace System;
+#using "libiWrapper.dll"
+using namespace illiminable::libiWrapper;
+
+#include "MappedTagList.h"
+#include "ParamTag.h"
+
+#pragma unmanaged
+#include <config.h>
+#include <C_ParamTagList.h>
+#pragma managed
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ public __gc class ParamTagList
+ : public MappedTagList
+ {
+ public:
+ ParamTagList(void);
+ ParamTagList(C_ParamTagList* inTagList);
+ virtual ~ParamTagList(void);
+
+ //Accessors
+ ParamTag* getTag(unsigned long inTagNo);
+
+ //Mutators
+ void addTag(ParamTag* inTag);
+
+ //Other
+ virtual String* toString();
+
+
+ C_ParamTagList* getMe();
+
+ };
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/ParamTagList.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/Stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/Stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/Stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,9 +30,9 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-// stdafx.cpp : source file that includes just the standard includes
-// dotnet_cmml.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
+*/
+// stdafx.cpp : source file that includes just the standard includes
+// dotnet_cmml.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/Stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/Stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/Stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/Stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,14 +30,14 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently,
-// but are changed infrequently
-
-#pragma once
-#pragma warning(disable : 4251)
-#using <mscorlib.dll>
-
-
+*/
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently,
+// but are changed infrequently
+
+#pragma once
+#pragma warning(disable : 4251)
+#using <mscorlib.dll>
+
+
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/Stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/StreamTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/StreamTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/StreamTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,73 +30,73 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\streamtag.h"
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
-
- StreamTag::StreamTag(void)
- {
- mBaseClass = new C_StreamTag;
- }
-
- StreamTag::StreamTag(C_StreamTag* inTag, bool inDeleteBase)
- {
-
- mBaseClass = inTag;
- mDeleteBase = inDeleteBase;
- }
-
- StreamTag::~StreamTag(void)
- {
- if (mDeleteBase) {
- delete mBaseClass;
- }
- mBaseClass = NULL;
- }
-
- //Accessors
- String* StreamTag::timebase() {
- return Wrappers::WStrToNetStr( getMe()->timebase().c_str() );
- }
- String* StreamTag::utc() {
- return Wrappers::WStrToNetStr( getMe()->utc().c_str() );
- }
- ImportTagList* StreamTag::importList() {
- return new ImportTagList( getMe()->importList(), false);
-
- }
-
- //Mutators
- void StreamTag::setTimebase(String* inTimebase) {
- wchar_t* tc = Wrappers::netStrToWStr( inTimebase );
- wstring locStr = tc;
- getMe()->setTimebase( locStr );
- Wrappers::releaseWStr( tc );
-
- }
- void StreamTag::setUtc(String* inUtc) {
- wchar_t* tc = Wrappers::netStrToWStr( inUtc );
- wstring locStr = tc;
- getMe()->setUtc( locStr );
- Wrappers::releaseWStr( tc );
- }
- void StreamTag::setImportList(ImportTagList* inTagList) {
- getMe()->setImportList(inTagList->getMe()->clone());
- }
-
- //Other
- String* StreamTag::toString() {
- return Wrappers::WStrToNetStr( getMe()->toString().c_str());
-
- }
- C_StreamTag* StreamTag::getMe() {
- return (C_StreamTag*) mBaseClass;
-
- }
-
-}
-}
+*/
+#include "StdAfx.h"
+#include ".\streamtag.h"
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+
+ StreamTag::StreamTag(void)
+ {
+ mBaseClass = new C_StreamTag;
+ }
+
+ StreamTag::StreamTag(C_StreamTag* inTag, bool inDeleteBase)
+ {
+
+ mBaseClass = inTag;
+ mDeleteBase = inDeleteBase;
+ }
+
+ StreamTag::~StreamTag(void)
+ {
+ if (mDeleteBase) {
+ delete mBaseClass;
+ }
+ mBaseClass = NULL;
+ }
+
+ //Accessors
+ String* StreamTag::timebase() {
+ return Wrappers::WStrToNetStr( getMe()->timebase().c_str() );
+ }
+ String* StreamTag::utc() {
+ return Wrappers::WStrToNetStr( getMe()->utc().c_str() );
+ }
+ ImportTagList* StreamTag::importList() {
+ return new ImportTagList( getMe()->importList(), false);
+
+ }
+
+ //Mutators
+ void StreamTag::setTimebase(String* inTimebase) {
+ wchar_t* tc = Wrappers::netStrToWStr( inTimebase );
+ wstring locStr = tc;
+ getMe()->setTimebase( locStr );
+ Wrappers::releaseWStr( tc );
+
+ }
+ void StreamTag::setUtc(String* inUtc) {
+ wchar_t* tc = Wrappers::netStrToWStr( inUtc );
+ wstring locStr = tc;
+ getMe()->setUtc( locStr );
+ Wrappers::releaseWStr( tc );
+ }
+ void StreamTag::setImportList(ImportTagList* inTagList) {
+ getMe()->setImportList(inTagList->getMe()->clone());
+ }
+
+ //Other
+ String* StreamTag::toString() {
+ return Wrappers::WStrToNetStr( getMe()->toString().c_str());
+
+ }
+ C_StreamTag* StreamTag::getMe() {
+ return (C_StreamTag*) mBaseClass;
+
+ }
+
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/StreamTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/StreamTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/StreamTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/StreamTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,48 +30,48 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-
-using namespace System;
-#using "libiWrapper.dll"
-using namespace illiminable::libiWrapper;
-
-#include "TagList.h"
-#include "ImportTagList.h"
-#include "CMMLTag.h"
-
-
-#pragma unmanaged
-#include <config.h>
-#include <C_StreamTag.h>
-#pragma managed
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- public __gc class StreamTag
- : public CMMLTag
- {
- public:
- StreamTag(void);
- StreamTag(C_StreamTag* inTag, bool inDeleteBase);
- virtual ~StreamTag(void);
-
- //Accessors
- String* timebase();
- String* utc();
- ImportTagList* importList();
-
- //Mutators
- void setTimebase(String* inTimebase);
- void setUtc(String* inUtc);
- void setImportList(ImportTagList* inTagList);
-
- //Other
- virtual String* toString();
- C_StreamTag* getMe();
- };
-}
-}
+*/
+#pragma once
+
+
+using namespace System;
+#using "libiWrapper.dll"
+using namespace illiminable::libiWrapper;
+
+#include "TagList.h"
+#include "ImportTagList.h"
+#include "CMMLTag.h"
+
+
+#pragma unmanaged
+#include <config.h>
+#include <C_StreamTag.h>
+#pragma managed
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ public __gc class StreamTag
+ : public CMMLTag
+ {
+ public:
+ StreamTag(void);
+ StreamTag(C_StreamTag* inTag, bool inDeleteBase);
+ virtual ~StreamTag(void);
+
+ //Accessors
+ String* timebase();
+ String* utc();
+ ImportTagList* importList();
+
+ //Mutators
+ void setTimebase(String* inTimebase);
+ void setUtc(String* inUtc);
+ void setImportList(ImportTagList* inTagList);
+
+ //Other
+ virtual String* toString();
+ C_StreamTag* getMe();
+ };
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/StreamTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TagList.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TagList.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TagList.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,29 +30,29 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\taglist.h"
-
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
-
- TagList::TagList(void)
- {
- //ABSTRACT CLASS
- }
-
- TagList::~TagList(void)
- {
- }
-
- //Accessors
- unsigned long TagList::numTags() {
- return mBaseClass->numTags();
- }
-
-
-}
+*/
+#include "StdAfx.h"
+#include ".\taglist.h"
+
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+
+ TagList::TagList(void)
+ {
+ //ABSTRACT CLASS
+ }
+
+ TagList::~TagList(void)
+ {
+ }
+
+ //Accessors
+ unsigned long TagList::numTags() {
+ return mBaseClass->numTags();
+ }
+
+
+}
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TagList.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TagList.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TagList.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TagList.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,38 +30,38 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-using namespace System;
-#using "libiWrapper.dll"
-using namespace illiminable::libiWrapper;
-
-
-
-#pragma unmanaged
-#include <config.h>
-#include <C_TagList.h>
-#pragma managed
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- public __gc class TagList
- {
- public:
- TagList(void);
- virtual ~TagList(void);
-
- //Accessors
- unsigned long numTags();
-
- //Other
- virtual String* toString() = 0;
-
- protected:
- C_TagList* mBaseClass;
- bool mDeleteBase;
- };
-}
-}
+*/
+#pragma once
+
+using namespace System;
+#using "libiWrapper.dll"
+using namespace illiminable::libiWrapper;
+
+
+
+#pragma unmanaged
+#include <config.h>
+#include <C_TagList.h>
+#pragma managed
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ public __gc class TagList
+ {
+ public:
+ TagList(void);
+ virtual ~TagList(void);
+
+ //Accessors
+ unsigned long numTags();
+
+ //Other
+ virtual String* toString() = 0;
+
+ protected:
+ C_TagList* mBaseClass;
+ bool mDeleteBase;
+ };
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TagList.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TextFieldTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TextFieldTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TextFieldTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,36 +30,36 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\textfieldtag.h"
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- TextFieldTag::TextFieldTag(void)
- {
- }
-
- TextFieldTag::~TextFieldTag(void)
- {
- }
-
- C_TextFieldTag* TextFieldTag::getMe() {
- return (C_TextFieldTag*)mBaseClass;
- }
-
- //Accessors
- String* TextFieldTag::text() {
- return Wrappers::WStrToNetStr( getMe()->text().c_str() );
- }
-
- //Mutators
- void TextFieldTag::setText(String* inText) {
- wchar_t* tc = Wrappers::netStrToWStr( inText );
- wstring locStr = tc;
- getMe()->setText( locStr );
- Wrappers::releaseWStr( tc );
- }
-}
-}
+*/
+#include "StdAfx.h"
+#include ".\textfieldtag.h"
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ TextFieldTag::TextFieldTag(void)
+ {
+ }
+
+ TextFieldTag::~TextFieldTag(void)
+ {
+ }
+
+ C_TextFieldTag* TextFieldTag::getMe() {
+ return (C_TextFieldTag*)mBaseClass;
+ }
+
+ //Accessors
+ String* TextFieldTag::text() {
+ return Wrappers::WStrToNetStr( getMe()->text().c_str() );
+ }
+
+ //Mutators
+ void TextFieldTag::setText(String* inText) {
+ wchar_t* tc = Wrappers::netStrToWStr( inText );
+ wstring locStr = tc;
+ getMe()->setText( locStr );
+ Wrappers::releaseWStr( tc );
+ }
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TextFieldTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TextFieldTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TextFieldTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TextFieldTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,62 +30,62 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#pragma once
-
-using namespace System;
-#using "libiWrapper.dll"
-using namespace illiminable::libiWrapper;
-
-#include "HumReadCMMLTag.h"
-
-#pragma unmanaged
-#include <config.h>
-#include <C_TextFieldTag.h>
-#pragma managed
-
-
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
-
- //class CPP_LIB_CMML_API C_TextFieldTag
- // //Derived Classes
- // : public C_HumReadCMMLTag
- //{
- //public:
- // //Constructors
- // C_TextFieldTag(void);
- // virtual ~C_TextFieldTag(void);
- //
- // //Accessors
- // string text();
- //
- // //Mutators
- // void setText(string inText);
- //
- // //Other
- // virtual string toString() = 0;
-
- public __gc class TextFieldTag
- : public HumReadCMMLTag
- {
- public:
- TextFieldTag(void);
- virtual ~TextFieldTag(void);
-
- //Accessors
- String* text();
-
- //Mutators
- void setText(String* inText);
-
- //Other
- virtual String* toString() = 0;
-
-
- C_TextFieldTag* getMe();
- };
-}
-}
+*/
+#pragma once
+
+using namespace System;
+#using "libiWrapper.dll"
+using namespace illiminable::libiWrapper;
+
+#include "HumReadCMMLTag.h"
+
+#pragma unmanaged
+#include <config.h>
+#include <C_TextFieldTag.h>
+#pragma managed
+
+
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+
+ //class CPP_LIB_CMML_API C_TextFieldTag
+ // //Derived Classes
+ // : public C_HumReadCMMLTag
+ //{
+ //public:
+ // //Constructors
+ // C_TextFieldTag(void);
+ // virtual ~C_TextFieldTag(void);
+ //
+ // //Accessors
+ // string text();
+ //
+ // //Mutators
+ // void setText(string inText);
+ //
+ // //Other
+ // virtual string toString() = 0;
+
+ public __gc class TextFieldTag
+ : public HumReadCMMLTag
+ {
+ public:
+ TextFieldTag(void);
+ virtual ~TextFieldTag(void);
+
+ //Accessors
+ String* text();
+
+ //Mutators
+ void setText(String* inText);
+
+ //Other
+ virtual String* toString() = 0;
+
+
+ C_TextFieldTag* getMe();
+ };
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TextFieldTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TitleTag.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TitleTag.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TitleTag.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,36 +30,36 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-#include "StdAfx.h"
-#include ".\titletag.h"
-
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- TitleTag::TitleTag(void)
- {
- mBaseClass = new C_TitleTag;
- }
-
- TitleTag::TitleTag(C_TitleTag* inTag)
- {
- mBaseClass = inTag;
- }
-
-
- TitleTag::~TitleTag(void)
- {
- delete mBaseClass;
- }
- String* TitleTag::toString() {
- return Wrappers::WStrToNetStr( getMe()->toString().c_str() );
- }
-
- C_TitleTag* TitleTag::getMe() {
- return (C_TitleTag*)mBaseClass;
- }
-
-}
-}
+*/
+#include "StdAfx.h"
+#include ".\titletag.h"
+
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ TitleTag::TitleTag(void)
+ {
+ mBaseClass = new C_TitleTag;
+ }
+
+ TitleTag::TitleTag(C_TitleTag* inTag)
+ {
+ mBaseClass = inTag;
+ }
+
+
+ TitleTag::~TitleTag(void)
+ {
+ delete mBaseClass;
+ }
+ String* TitleTag::toString() {
+ return Wrappers::WStrToNetStr( getMe()->toString().c_str() );
+ }
+
+ C_TitleTag* TitleTag::getMe() {
+ return (C_TitleTag*)mBaseClass;
+ }
+
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TitleTag.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TitleTag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TitleTag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TitleTag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,42 +30,42 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-
-
-
-#pragma once
-
-
-#pragma managed
-
-using namespace System;
-#using "libiWrapper.dll"
-using namespace illiminable::libiWrapper;
-
-#include "TextFieldTag.h"
-
-#pragma unmanaged
-#include <config.h>
-#include <C_TitleTag.h>
-#pragma managed
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
- public __gc class TitleTag
- : public TextFieldTag
- {
- public:
- TitleTag(void);
- TitleTag(C_TitleTag* inTag);
- virtual ~TitleTag(void);
- //Other
- virtual String* toString();
-
- C_TitleTag* getMe();
-
- };
-}
-}
+*/
+
+
+
+
+#pragma once
+
+
+#pragma managed
+
+using namespace System;
+#using "libiWrapper.dll"
+using namespace illiminable::libiWrapper;
+
+#include "TextFieldTag.h"
+
+#pragma unmanaged
+#include <config.h>
+#include <C_TitleTag.h>
+#pragma managed
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+ public __gc class TitleTag
+ : public TextFieldTag
+ {
+ public:
+ TitleTag(void);
+ TitleTag(C_TitleTag* inTag);
+ virtual ~TitleTag(void);
+ //Other
+ virtual String* toString();
+
+ C_TitleTag* getMe();
+
+ };
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/TitleTag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/libCMMLTagsDotNET.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/libCMMLTagsDotNET.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/libCMMLTagsDotNET.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,15 +30,15 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-// This is the main DLL file.
-
-#include "stdafx.h"
-
-#include "libCMMLTagsDotNET.h"
-
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-}
-}
+*/
+// This is the main DLL file.
+
+#include "stdafx.h"
+
+#include "libCMMLTagsDotNET.h"
+
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/libCMMLTagsDotNET.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/libCMMLTagsDotNET.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/libCMMLTagsDotNET.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/libCMMLTagsDotNET.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,17 +30,17 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-
-#pragma once
-#pragma managed
-using namespace System;
-#using "libiWrapper.dll"
-
-namespace illiminable {
-namespace libCMMLTagsDotNET {
-
-
-}
-}
+*/
+
+
+#pragma once
+#pragma managed
+using namespace System;
+#using "libiWrapper.dll"
+
+namespace illiminable {
+namespace libCMMLTagsDotNET {
+
+
+}
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/libCMMLTagsDotNET.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/resource.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/resource.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/resource.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,3 +1,3 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by app.rc
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by app.rc
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libCMMLTagsDotNET/resource.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/CMMLParser.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/CMMLParser.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/CMMLParser.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,853 +1,853 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "cmmlparser.h"
-
-CMMLParser::CMMLParser(void)
-{
- HRESULT hr;
- hr = CoInitialize(NULL);
-}
-
-CMMLParser::~CMMLParser(void)
-{
-}
-
-
-
-
-bool CMMLParser::setupXMLHandles(wstring inText, MSXML2::IXMLDOMDocument** outDoc) {
-
- HRESULT locHR = S_FALSE;
- // Check the return value, hr...
- locHR = CoCreateInstance(__uuidof(DOMDocument30), NULL, CLSCTX_INPROC_SERVER, IID_IXMLDOMDocument, (void**)outDoc);
- if (locHR != S_OK) {
- return false;
- }
-
- BSTR locClipStr = SysAllocString(inText.c_str());
- VARIANT_BOOL locBool;
- locHR = (*outDoc)->loadXML(locClipStr, &locBool);
-
-
- SysFreeString(locClipStr);
-
- if (locHR == S_OK) {
- return true;
- } else {
- return false;
- }
-}
-
-bool CMMLParser::parseDocFromFile(wstring inFilename, C_CMMLDoc* outCMMLDoc) {
-
- MSXML2::IXMLDOMDocument* locDoc = NULL;
- MSXML2::IXMLDOMNode* locNode = NULL;
- BSTR locQuery = SysAllocString(L"cmml");;
- VARIANT locFilename;
-
- VariantInit(&locFilename);
- V_BSTR(&locFilename) = SysAllocString(inFilename.c_str());
- V_VT(&locFilename) = VT_BSTR;
- //locFilename.vt = VT_BSTR;
- //locFilename.bstrVal = SysAllocString(inFilename.c_str());
-
-
- bool retVal = true;
- HRESULT locHR = S_FALSE;
-
-
- locHR = CoCreateInstance(__uuidof(DOMDocument30), NULL, CLSCTX_INPROC_SERVER, IID_IXMLDOMDocument, (void**)&locDoc);
- if (locHR != S_OK) {
- retVal = false;
- } else {
-
-
- VARIANT_BOOL locBool = VARIANT_FALSE;
- locDoc->put_validateOnParse(locBool);
-
- locHR = locDoc->load(locFilename, &locBool);
- MSXML2::IXMLDOMParseError *locParseError = NULL;
- locHR = locDoc->get_parseError(&locParseError);
- long locEC = 0;
- locParseError->get_errorCode(&locEC);
- BSTR locStr;
- locParseError->get_reason(&locStr);
-
-
-
- //--------------Child Nodes-----------------
- locHR = locDoc->selectSingleNode(locQuery, &locNode);
- if (locHR != S_OK) {
- retVal = false;
- } else {
-
- C_CMMLRootTag* locRootTag = new C_CMMLRootTag;
-
- retVal = parseCMMLRootTag(locNode, locRootTag);
- if (retVal) {
- outCMMLDoc->setRoot(locRootTag);
- } else {
- delete locRootTag;
- }
- }
- }
-
- //SysFreeString(locFilename.bstrVal);
- SysFreeString(locQuery);
- if (&locFilename) VariantClear(&locFilename);
- if (locDoc != NULL) locDoc->Release();
- if (locNode != NULL) locNode->Release();
-
- return retVal;
-}
-
-
-
-MSXML2::IXMLDOMNode* CMMLParser::getNamedNode(wstring inXPath, MSXML2::IXMLDOMDocument* inDoc) {
- BSTR locQuery = SysAllocString(inXPath.c_str());
- HRESULT locHR = S_FALSE;
- MSXML2::IXMLDOMNode* retNode = NULL;
-
- locHR = inDoc->selectSingleNode(locQuery, &retNode);
-
- SysFreeString(locQuery);
-
- //If the select fails... will return NULL
- return retNode;
-}
-
-wstring CMMLParser::getNamedAttribValue(wstring inAttribName, MSXML2::IXMLDOMNamedNodeMap* inAttribMap) {
- BSTR locAttribName = SysAllocString(inAttribName.c_str());
- BSTR locBStr = NULL;
- MSXML2::IXMLDOMNode* locAttribNode = NULL;
- HRESULT locHR = S_FALSE;
- wstring retStr = L"";
-
- locHR = inAttribMap->getNamedItem(locAttribName, &locAttribNode);
-
- if (locHR == S_OK) {
- locHR = locAttribNode->get_text(&locBStr);
- retStr = locBStr;
- }
-
- //Cleanup
- if (locAttribNode != NULL) locAttribNode->Release();
- SysFreeString(locBStr);
- SysFreeString(locAttribName);
-
- //Will return "" on error
- return retStr;
-}
-
-bool CMMLParser::parseClipTag(MSXML2::IXMLDOMNode* inClipNode, C_ClipTag* outClip) {
-
- //Required start is not checked for, because CMML in annodex doesn't have one. May need to be
- // cvalidated elsewhere to be used in CMML documents
- MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
- MSXML2::IXMLDOMNode* locNode = NULL;
- MSXML2::IXMLDOMNodeList* locChildNodes = NULL;
- BSTR locBStr = NULL;
- HRESULT locHR = S_FALSE;
-
- wstring locNodeName;
- long locNumNodes = 0;
-
- unsigned long locNum_a = 0;
- unsigned long locNum_desc = 0;
- unsigned long locNum_img = 0;
- unsigned long locNum_meta = 0;
- unsigned long locNumUnknown = 0;
-
- //---------------Attributes-----------------
- //Get the attributes
- locHR = inClipNode->get_attributes(&locAttribMap);
-
- outClip->setId(getNamedAttribValue(L"id", locAttribMap));
- outClip->setLang(getNamedAttribValue(L"lang", locAttribMap));
- outClip->setDirn(getNamedAttribValue(L"dir", locAttribMap));
- outClip->setTrack(getNamedAttribValue(L"track", locAttribMap));
- outClip->setStart(getNamedAttribValue(L"start", locAttribMap));
- outClip->setEnd(getNamedAttribValue(L"end", locAttribMap));
- //------------------------------------------
- //--------------Child Nodes-----------------
- locHR = inClipNode->get_childNodes(&locChildNodes);
- locHR = locChildNodes->get_length(&locNumNodes);
-
- for (int i = 0; i < locNumNodes; i++) {
-
- locHR = locChildNodes->get_item(i, &locNode);
- locHR = locNode->get_nodeName(&locBStr);
- locNodeName = locBStr;
-
- if (locNodeName == L"a") {
-
- //ZERO OR ONE a elements allowed
- C_AnchorTag* locAnchor = new C_AnchorTag;
-
- if (parseAnchorTag(locNode, locAnchor)) {
- outClip->setAnchor(locAnchor);
- locNum_a++;
- } else {
- delete locAnchor;
- outClip->setAnchor(NULL);
- }
-
- } else if(locNodeName == L"desc") {
-
- //ZERO OR ONE desc elements allowed
- C_DescTag* locDesc = new C_DescTag;
- if (parseDescTag(locNode, locDesc)) {
- outClip->setDesc(locDesc);
- locNum_desc++;
- } else {
- delete locDesc;
- outClip->setDesc(NULL);
- }
-
- } else if (locNodeName == L"img") {
-
- //ZERO OR ONE img elements allowed
- C_ImageTag* locImage = new C_ImageTag;
- if (parseImageTag(locNode, locImage)) {
- outClip->setImage(locImage);
- locNum_img++;
- } else {
- delete locImage;
- outClip->setImage(locImage);
- }
-
- } else if (locNodeName == L"meta") {
-
- //ZERO OR *MORE* meta elements allowed
- C_MetaTag* locMeta = new C_MetaTag;
- if (parseMetaTag(locNode, locMeta)) {
- outClip->metaList()->addTag(locMeta);
- locNum_meta++;
- } else {
- delete locMeta;
- }
-
- } else {
-
- //TODO::: How to handle ??? For now just ignore tags we don't know.
- locNumUnknown++;
- }
- }
-
- bool retVal = (locNum_a <= 1)
- && (locNum_img <= 1)
- && (locNum_desc <= 1);
-
- SysFreeString(locBStr);
- if (locAttribMap != NULL) locAttribMap->Release();
- if (locNode != NULL) locNode->Release();
- if (locChildNodes != NULL) locChildNodes->Release();
- return retVal;
-}
-
-bool CMMLParser::parseClipTag(wstring inClipText, C_ClipTag* outClip) {
- HRESULT locHR = S_FALSE;
- MSXML2::IXMLDOMDocument* locXMLClipFrag = NULL;
- MSXML2::IXMLDOMNode* locClipNode = NULL;
-
- bool retVal = setupXMLHandles(inClipText, &locXMLClipFrag);
-
- if (retVal) {
- locClipNode = getNamedNode(L"clip", locXMLClipFrag);
-
- if (locClipNode != NULL) {
- //Now we have a node representing the clip tag and it's children.
- retVal = parseClipTag(locClipNode, outClip);
- } else {
- retVal = false;
- }
- }
-
- if (locXMLClipFrag != NULL) locXMLClipFrag->Release();
- if (locClipNode != NULL) locClipNode->Release();
-
- return retVal;
-}
-
-bool CMMLParser::parseCMMLRootTag(MSXML2::IXMLDOMNode* inCMMLRootNode, C_CMMLRootTag* outCMMLRoot) {
- MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
- MSXML2::IXMLDOMNodeList* locChildNodes = NULL;
- MSXML2::IXMLDOMNode* locNode = NULL;
- HRESULT locHR = S_FALSE;
- long locNumNodes = 0;
- BSTR locBStr = NULL;
- wstring locNodeName = L"";
-
-
- unsigned long locNum_clip = 0;
- unsigned long locNum_head = 0;
- unsigned long locNum_stream = 0;
- unsigned long locNumUnknown = 0;
-
- bool retVal = true;
-
- //---------------Attributes-----------------
- locHR = inCMMLRootNode->get_attributes(&locAttribMap);
-
- outCMMLRoot->setId(getNamedAttribValue(L"id", locAttribMap));
- outCMMLRoot->setLang(getNamedAttribValue(L"lang", locAttribMap));
- outCMMLRoot->setDirn(getNamedAttribValue(L"dir", locAttribMap));
-
- //------------------------------------------
- //--------------Child Nodes-----------------
- locHR = inCMMLRootNode->get_childNodes(&locChildNodes);
- locHR = locChildNodes->get_length(&locNumNodes);
-
- for (int i = 0; i < locNumNodes; i++) {
- locHR = locChildNodes->get_item(i, &locNode);
- locHR = locNode->get_nodeName(&locBStr);
- //TODO::: Needs checks ??
-
- locNodeName = locBStr;
- if (locNodeName == L"stream") {
- //If it exists it must be first
- if ( (locNum_stream == 0)
- && (locNum_clip == 0)
- && (locNum_head == 0)) {
- //OPTIONALLY ONE stream tag
- C_StreamTag* locStream = new C_StreamTag;
-
- if (parseStreamTag(locNode, locStream)) {
- outCMMLRoot->setStream(locStream);
- locNum_stream++;
- } else {
- delete locStream;
- outCMMLRoot->setStream(NULL);
- }
- } else {
- retVal = false;
- }
-
-
- } else if (locNodeName == L"head") {
-
- //MUST HAVE ONE head tag
- if ( (locNum_stream <= 1)
- && (locNum_clip == 0)
- && (locNum_head == 0)) {
-
- C_HeadTag* locHead = new C_HeadTag;
-
- if (parseHeadTag(locNode, locHead)) {
- outCMMLRoot->setHead(locHead);
- locNum_head++;
- } else {
- delete locHead;
- retVal = false;
- }
- } else {
- retVal = false;
-
- }
- } else if (locNodeName == L"clip") {
-
- //ZERO OR MORE clip tags
- if ( (locNum_stream <= 1)
- && (locNum_head == 1)) {
-
- C_ClipTag* locClip = new C_ClipTag;
-
- if(parseClipTag(locNode, locClip)) {
- outCMMLRoot->clipList()->addTag(locClip);
- locNum_clip++;
- } else {
- delete locClip;
- }
- } else {
- retVal = false;
- }
-
- } else {
- locNumUnknown++;
- }
- }
-
- retVal = (retVal)
- && (locNum_stream <= 1)
- && (locNum_head == 1);
-
-
-
- SysFreeString(locBStr);
- if (locAttribMap != NULL) locAttribMap->Release();
- if (locNode != NULL) locNode->Release();
- if (locChildNodes != NULL) locChildNodes->Release();
- return retVal;
-}
-
-
-bool CMMLParser::parseCMMLRootTag(wstring inCMMLRootText, C_CMMLRootTag* outCMMLRoot) {
- HRESULT locHR = S_FALSE;
- MSXML2::IXMLDOMDocument* locXMLCMMLRootFrag = NULL;
- MSXML2::IXMLDOMNode* locCMMLRootNode = NULL;
-
- bool retVal = setupXMLHandles(inCMMLRootText, &locXMLCMMLRootFrag);
-
- if (retVal) {
- locCMMLRootNode = getNamedNode(L"cmml", locXMLCMMLRootFrag);
-
- if (locCMMLRootNode != NULL) {
-
- retVal = parseCMMLRootTag(locCMMLRootNode, outCMMLRoot);
- } else {
- retVal = false;
- }
- }
-
- if (locXMLCMMLRootFrag != NULL) locXMLCMMLRootFrag->Release();
- if (locCMMLRootNode != NULL) locCMMLRootNode->Release();
-
- return retVal;
-}
-bool CMMLParser::parseHeadTag(MSXML2::IXMLDOMNode* inHeadNode, C_HeadTag* outHead) {
- MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
- MSXML2::IXMLDOMNodeList* locChildNodes = NULL;
- MSXML2::IXMLDOMNode* locNode = NULL;
- HRESULT locHR = S_FALSE;
- long locNumNodes = 0;
- BSTR locBStr = NULL;
- wstring locNodeName;
-
- unsigned long locNum_title = 0;
- unsigned long locNum_meta = 0;
- unsigned long locNum_base = 0;
- unsigned long locNumUnknown = 0;
-
-
- //---------------Attributes-----------------
- locHR = inHeadNode->get_attributes(&locAttribMap);
-
- outHead->setId(getNamedAttribValue(L"id", locAttribMap));
- outHead->setLang(getNamedAttribValue(L"lang", locAttribMap));
- outHead->setDirn(getNamedAttribValue(L"dir", locAttribMap));
- outHead->setProfile(getNamedAttribValue(L"profile", locAttribMap));
- //------------------------------------------
-
- //--------------Child Nodes-----------------
- locHR = inHeadNode->get_childNodes(&locChildNodes);
- locHR = locChildNodes->get_length(&locNumNodes);
- for (int i = 0; i < locNumNodes; i++) {
- locHR = locChildNodes->get_item(i, &locNode);
- locHR = locNode->get_nodeName(&locBStr);
- //TODO::: Needs checks ??
-
- locNodeName = locBStr;
- if (locNodeName == L"title") {
-
- //Must contain ONE title tag
- C_TitleTag* locTitle = new C_TitleTag;
-
- if (parseTitleTag(locNode, locTitle)) {
- outHead->setTitle(locTitle);
- locNum_title++;
- } else {
- delete locTitle;
- outHead->setTitle(NULL);
- }
-
-
- } else if (locNodeName == L"meta") {
-
- //Can contain ANY AMOUNT of meta tags
- C_MetaTag* locMeta = new C_MetaTag;
-
- if (parseMetaTag(locNode, locMeta)) {
- outHead->metaList()->addTag(locMeta);
- locNum_meta++;
- } else {
- delete locMeta;
- }
-
- } else if (locNodeName == L"base") {
-
- //OPTIONALLY ONE base tag.
- C_BaseTag* locBase = new C_BaseTag;
-
- if(parseBaseTag(locNode, locBase)) {
- outHead->setBase(locBase);
- locNum_base++;
- } else {
- delete locBase;
- outHead->setBase(NULL);
- }
-
- } else {
- locNumUnknown++;
- }
- }
-
- bool retVal = (locNum_title == 1)
- && (locNum_base <= 1);
-
-
- SysFreeString(locBStr);
- if (locAttribMap != NULL) locAttribMap->Release();
- if (locNode != NULL) locNode->Release();
- if (locChildNodes != NULL) locChildNodes->Release();
- return retVal;
-}
-
-bool CMMLParser::parseHeadTag(wstring inHeadText, C_HeadTag* outHead) {
- HRESULT locHR = S_FALSE;
- MSXML2::IXMLDOMDocument* locXMLHeadFrag = NULL;
- MSXML2::IXMLDOMNode* locHeadNode = NULL;
-
- bool retVal = setupXMLHandles(inHeadText, &locXMLHeadFrag);
-
- if (retVal) {
- locHeadNode = getNamedNode(L"head", locXMLHeadFrag);
- if (locHeadNode != NULL) {
-
- //Now we have a node representing the clip tag and it's children.
- retVal = parseHeadTag(locHeadNode, outHead);
- } else {
- retVal = false;
- }
- }
-
- if (locXMLHeadFrag != NULL) locXMLHeadFrag->Release();
- if (locHeadNode != NULL) locHeadNode->Release();
-
- return retVal;
-}
-
-bool CMMLParser::parseStreamTag(MSXML2::IXMLDOMNode* inStreamNode, C_StreamTag* outStream) {
- ////-------------Initialisation-------------
- MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
- MSXML2::IXMLDOMNode* locNode = NULL;
- MSXML2::IXMLDOMNodeList* locChildNodes = NULL;
- HRESULT locHR = S_FALSE;
- long locNumNodes = 0;
- BSTR locBStr = NULL;
- wstring locNodeName = L"";
-
- //---------------Attributes-----------------
- locHR = inStreamNode->get_attributes(&locAttribMap);
- //outStream->setLang(getNamedAttribValue(L"lang", locAttribMap));
- //outStream->setDirn(getNamedAttribValue(L"dir", locAttribMap));
- outStream->setId(getNamedAttribValue(L"id", locAttribMap));
- outStream->setTimebase(getNamedAttribValue(L"timebase", locAttribMap));
- outStream->setUtc(getNamedAttribValue(L"utc", locAttribMap));
- //------------------------------------------
- //--------------Child Nodes-----------------
- locHR = inStreamNode->get_childNodes(&locChildNodes);
- locHR = locChildNodes->get_length(&locNumNodes);
- for (int i = 0; i < locNumNodes; i++) {
- locHR = locChildNodes->get_item(i, &locNode);
- locHR = locNode->get_nodeName(&locBStr);
- locNodeName = locBStr;
- if(locNodeName == L"import") {
-
- C_ImportTag* locImport = new C_ImportTag;
- if (parseImportTag(locNode, locImport)) {
- outStream->importList()->addTag(locImport);
- } else {
- //TODO::: Anything ???
- }
-
- } else {
- //TODO::: Handle this, otherwise ignore.
- }
- }
-
- //--------------Clean Up--------------------
- SysFreeString(locBStr);
- if (locAttribMap != NULL) locAttribMap->Release();
- if (locNode != NULL) locNode->Release();
- if (locChildNodes != NULL) locChildNodes->Release();
- return true;
-}
-
-bool CMMLParser::parseImportTag(MSXML2::IXMLDOMNode* inImportNode, C_ImportTag* outImport) {
-
- //TODO::: Stream and import tags need checking about what to do with internationalisation
- MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
- MSXML2::IXMLDOMNode* locNode = NULL;
- MSXML2::IXMLDOMNodeList* locChildNodes = NULL;
- HRESULT locHR = S_FALSE;
- long locNumNodes = 0;
- BSTR locBStr = NULL;
- wstring locNodeName = L"";
-
- bool retVal = true;
-
- //---------------Attributes-----------------
- locHR = inImportNode->get_attributes(&locAttribMap);
-
- outImport->setId(getNamedAttribValue(L"id", locAttribMap));
- outImport->setContentType(getNamedAttribValue(L"contenttype", locAttribMap));
- outImport->setSrc(getNamedAttribValue(L"src", locAttribMap));
- if (outImport->src() == L"") {
- //Source is required.
- retVal = false;
- }
- outImport->setStart(getNamedAttribValue(L"start", locAttribMap));
- outImport->setEnd(getNamedAttribValue(L"end", locAttribMap));
- outImport->setTitle(getNamedAttribValue(L"title", locAttribMap));
- outImport->setGranuleRate(getNamedAttribValue(L"granulerate", locAttribMap));
- //------------------------------------------
-
-
- locHR = inImportNode->get_childNodes(&locChildNodes);
- locHR = locChildNodes->get_length(&locNumNodes);
- for (int i = 0; i < locNumNodes; i++) {
- locHR = locChildNodes->get_item(i, &locNode);
- locHR = locNode->get_nodeName(&locBStr);
- locNodeName = locBStr;
- if(locNodeName == L"param") {
-
- C_ParamTag* locParam = new C_ParamTag;
- if (parseParamTag(locNode, locParam)) {
- outImport->paramList()->addTag(locParam);
- } else {
- //TODO::: Anything ???
- }
-
- } else {
- //TODO::: Handle this, otherwise ignore.
- }
- }
-
- SysFreeString(locBStr);
- if (locAttribMap != NULL) locAttribMap->Release();
- if (locNode != NULL) locNode->Release();
- if (locChildNodes != NULL) locChildNodes->Release();
- return retVal;
-}
-
-bool CMMLParser::parseImageTag(MSXML2::IXMLDOMNode* inImageNode, C_ImageTag* outImage) {
- MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
- // MSXML2::IXMLDOMNode* locImageNode = NULL;
- HRESULT locHR = S_FALSE;
-
- bool retVal = true;
- //---------------Attributes-----------------
- locHR = inImageNode->get_attributes(&locAttribMap);
- outImage->setId(getNamedAttribValue(L"id", locAttribMap));
- outImage->setSrc(getNamedAttribValue(L"src", locAttribMap));
- if (outImage->src() == L"") {
- retVal = false;
- }
- outImage->setAlt(getNamedAttribValue(L"alt", locAttribMap));
-
- if (locAttribMap != NULL) locAttribMap->Release();
- return retVal;
-}
-/*
-bool CMMLParser::parseMetaTag(MSXML2::IXMLDOMNode* inMetaNode, C_MetaTag* outMeta) {
- MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
- MSXML2::IXMLDOMNode* locMetaNode = NULL;
- HRESULT locHR = S_FALSE;
-
- //---------------Attributes-----------------
- locHR = inMetaNode->get_attributes(&locAttribMap);
-
-}
-*/
-
-bool CMMLParser::parseMetaTag(MSXML2::IXMLDOMNode* inMetaNode, C_MetaTag* outMeta) {
- MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
- HRESULT locHR = S_FALSE;
-
- bool retVal = true;
- //---------------Attributes-----------------
- locHR = inMetaNode->get_attributes(&locAttribMap);
-
- outMeta->setId(getNamedAttribValue(L"id", locAttribMap));
- outMeta->setLang(getNamedAttribValue(L"lang", locAttribMap));
- outMeta->setDirn(getNamedAttribValue(L"dir", locAttribMap));
- outMeta->setName(getNamedAttribValue(L"name", locAttribMap));
- if (outMeta->name() == L"") {
- retVal = false;
- } else {
- outMeta->setContent(getNamedAttribValue(L"content", locAttribMap));
- if (outMeta->content() == L"") {
- retVal = false;
- }
- }
-
- outMeta->setScheme(getNamedAttribValue(L"scheme", locAttribMap));
- //------------------------------------------
-
- if (locAttribMap != NULL) locAttribMap->Release();
- return true;
-}
-
-//string CMMLParser::toNarrowStr(wstring inString) {
-// string retVal;
-//
-//
-// for (std::wstring::const_iterator i = inString.begin(); i != inString.end(); i++) {
-// retVal.append(1, *i);
-// }
-//
-// return retVal;
-//}
-
-bool CMMLParser::parseAnchorTag(MSXML2::IXMLDOMNode* inAnchorNode, C_AnchorTag* outAnchor) {
- MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
- HRESULT locHR = S_FALSE;
- BSTR locBStr = NULL;
- wstring locAnchorText = L"";
-
- bool retVal = true;
- //---------------Attributes-----------------
- locHR = inAnchorNode->get_attributes(&locAttribMap);
- outAnchor->setId(getNamedAttribValue(L"id", locAttribMap));
- outAnchor->setLang(getNamedAttribValue(L"lang", locAttribMap));
- outAnchor->setDirn(getNamedAttribValue(L"dir", locAttribMap));
- outAnchor->setCls(getNamedAttribValue(L"class", locAttribMap));
- outAnchor->setHref(getNamedAttribValue(L"href", locAttribMap));
- if (outAnchor->href() == L"") {
- retVal = false;
- }
- //------------------------------------------
- //Anchor text
-
- inAnchorNode->get_text(&locBStr);
- locAnchorText = locBStr;
-
- //if (locAnchorText == L"") {
- // retVal = false;
- //}
- outAnchor->setText(locAnchorText);
-
- //Cleanup
- SysFreeString(locBStr);
- if (locAttribMap != NULL) locAttribMap->Release();
- return retVal;
-}
-
-bool CMMLParser::parseTitleTag(MSXML2::IXMLDOMNode* inTitleNode, C_TitleTag* outTitle) {
- MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
- BSTR locBStr = NULL;
- wstring locTitleText;
- HRESULT locHR = S_FALSE;
-
- //---------------Attributes-----------------
- locHR = inTitleNode->get_attributes(&locAttribMap);
-
- outTitle->setId(getNamedAttribValue(L"id", locAttribMap));
- outTitle->setLang(getNamedAttribValue(L"lang", locAttribMap));
- outTitle->setDirn(getNamedAttribValue(L"dir", locAttribMap));
- //------------------------------------------
-
- inTitleNode->get_text(&locBStr);
- locTitleText = locBStr;
- outTitle->setText(locTitleText);
-
- SysFreeString(locBStr);
- if (locAttribMap != NULL) locAttribMap->Release();
- return true;
-
-}
-
-bool CMMLParser::parseDescTag(MSXML2::IXMLDOMNode* inDescNode, C_DescTag* outDesc) {
- MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
- BSTR locBStr = NULL;
- wstring locDescText;
- HRESULT locHR = S_FALSE;
-
- //---------------Attributes-----------------
- locHR = inDescNode->get_attributes(&locAttribMap);
- outDesc->setId(getNamedAttribValue(L"id", locAttribMap));
- outDesc->setLang(getNamedAttribValue(L"lang", locAttribMap));
- outDesc->setDirn(getNamedAttribValue(L"dir", locAttribMap));
- //------------------------------------------
- inDescNode->get_text(&locBStr);
- locDescText = locBStr;
- outDesc->setText(locDescText);
-
- SysFreeString(locBStr);
- if (locAttribMap != NULL) locAttribMap->Release();
- return true;
-
-}
-
-
-
-
-bool CMMLParser::parseBaseTag(MSXML2::IXMLDOMNode* inBaseNode, C_BaseTag* outBase) {
- MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
- HRESULT locHR = S_FALSE;
-
- bool retVal = true;
- //---------------Attributes-----------------
- locHR = inBaseNode->get_attributes(&locAttribMap);
-
- outBase->setId(getNamedAttribValue(L"id", locAttribMap));
- outBase->setHref(getNamedAttribValue(L"href", locAttribMap));
- if (outBase->href() == L"") {
- retVal = false;
- }
- //------------------------------------------
-
- if (locAttribMap != NULL) locAttribMap->Release();
- return retVal;
-
-}
-
-
-
-bool CMMLParser::parseParamTag(MSXML2::IXMLDOMNode* inParamNode, C_ParamTag* outParam) {
- MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
- HRESULT locHR = S_FALSE;
-
- bool retVal = true;
- //---------------Attributes-----------------
- locHR = inParamNode->get_attributes(&locAttribMap);
-
- outParam->setId(getNamedAttribValue(L"id", locAttribMap));
- outParam->setName(getNamedAttribValue(L"name", locAttribMap));
- if (outParam->name() == L"") {
- retVal = false;
- } else {
- outParam->setContent(getNamedAttribValue(L"value", locAttribMap));
- if (outParam->content() == L"") {
- retVal = false;
- }
- }
-
-
- //------------------------------------------
-
- if (locAttribMap != NULL) locAttribMap->Release();
- return true;
-}
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "cmmlparser.h"
+
+CMMLParser::CMMLParser(void)
+{
+ HRESULT hr;
+ hr = CoInitialize(NULL);
+}
+
+CMMLParser::~CMMLParser(void)
+{
+}
+
+
+
+
+bool CMMLParser::setupXMLHandles(wstring inText, MSXML2::IXMLDOMDocument** outDoc) {
+
+ HRESULT locHR = S_FALSE;
+ // Check the return value, hr...
+ locHR = CoCreateInstance(__uuidof(DOMDocument30), NULL, CLSCTX_INPROC_SERVER, IID_IXMLDOMDocument, (void**)outDoc);
+ if (locHR != S_OK) {
+ return false;
+ }
+
+ BSTR locClipStr = SysAllocString(inText.c_str());
+ VARIANT_BOOL locBool;
+ locHR = (*outDoc)->loadXML(locClipStr, &locBool);
+
+
+ SysFreeString(locClipStr);
+
+ if (locHR == S_OK) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+bool CMMLParser::parseDocFromFile(wstring inFilename, C_CMMLDoc* outCMMLDoc) {
+
+ MSXML2::IXMLDOMDocument* locDoc = NULL;
+ MSXML2::IXMLDOMNode* locNode = NULL;
+ BSTR locQuery = SysAllocString(L"cmml");;
+ VARIANT locFilename;
+
+ VariantInit(&locFilename);
+ V_BSTR(&locFilename) = SysAllocString(inFilename.c_str());
+ V_VT(&locFilename) = VT_BSTR;
+ //locFilename.vt = VT_BSTR;
+ //locFilename.bstrVal = SysAllocString(inFilename.c_str());
+
+
+ bool retVal = true;
+ HRESULT locHR = S_FALSE;
+
+
+ locHR = CoCreateInstance(__uuidof(DOMDocument30), NULL, CLSCTX_INPROC_SERVER, IID_IXMLDOMDocument, (void**)&locDoc);
+ if (locHR != S_OK) {
+ retVal = false;
+ } else {
+
+
+ VARIANT_BOOL locBool = VARIANT_FALSE;
+ locDoc->put_validateOnParse(locBool);
+
+ locHR = locDoc->load(locFilename, &locBool);
+ MSXML2::IXMLDOMParseError *locParseError = NULL;
+ locHR = locDoc->get_parseError(&locParseError);
+ long locEC = 0;
+ locParseError->get_errorCode(&locEC);
+ BSTR locStr;
+ locParseError->get_reason(&locStr);
+
+
+
+ //--------------Child Nodes-----------------
+ locHR = locDoc->selectSingleNode(locQuery, &locNode);
+ if (locHR != S_OK) {
+ retVal = false;
+ } else {
+
+ C_CMMLRootTag* locRootTag = new C_CMMLRootTag;
+
+ retVal = parseCMMLRootTag(locNode, locRootTag);
+ if (retVal) {
+ outCMMLDoc->setRoot(locRootTag);
+ } else {
+ delete locRootTag;
+ }
+ }
+ }
+
+ //SysFreeString(locFilename.bstrVal);
+ SysFreeString(locQuery);
+ if (&locFilename) VariantClear(&locFilename);
+ if (locDoc != NULL) locDoc->Release();
+ if (locNode != NULL) locNode->Release();
+
+ return retVal;
+}
+
+
+
+MSXML2::IXMLDOMNode* CMMLParser::getNamedNode(wstring inXPath, MSXML2::IXMLDOMDocument* inDoc) {
+ BSTR locQuery = SysAllocString(inXPath.c_str());
+ HRESULT locHR = S_FALSE;
+ MSXML2::IXMLDOMNode* retNode = NULL;
+
+ locHR = inDoc->selectSingleNode(locQuery, &retNode);
+
+ SysFreeString(locQuery);
+
+ //If the select fails... will return NULL
+ return retNode;
+}
+
+wstring CMMLParser::getNamedAttribValue(wstring inAttribName, MSXML2::IXMLDOMNamedNodeMap* inAttribMap) {
+ BSTR locAttribName = SysAllocString(inAttribName.c_str());
+ BSTR locBStr = NULL;
+ MSXML2::IXMLDOMNode* locAttribNode = NULL;
+ HRESULT locHR = S_FALSE;
+ wstring retStr = L"";
+
+ locHR = inAttribMap->getNamedItem(locAttribName, &locAttribNode);
+
+ if (locHR == S_OK) {
+ locHR = locAttribNode->get_text(&locBStr);
+ retStr = locBStr;
+ }
+
+ //Cleanup
+ if (locAttribNode != NULL) locAttribNode->Release();
+ SysFreeString(locBStr);
+ SysFreeString(locAttribName);
+
+ //Will return "" on error
+ return retStr;
+}
+
+bool CMMLParser::parseClipTag(MSXML2::IXMLDOMNode* inClipNode, C_ClipTag* outClip) {
+
+ //Required start is not checked for, because CMML in annodex doesn't have one. May need to be
+ // cvalidated elsewhere to be used in CMML documents
+ MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
+ MSXML2::IXMLDOMNode* locNode = NULL;
+ MSXML2::IXMLDOMNodeList* locChildNodes = NULL;
+ BSTR locBStr = NULL;
+ HRESULT locHR = S_FALSE;
+
+ wstring locNodeName;
+ long locNumNodes = 0;
+
+ unsigned long locNum_a = 0;
+ unsigned long locNum_desc = 0;
+ unsigned long locNum_img = 0;
+ unsigned long locNum_meta = 0;
+ unsigned long locNumUnknown = 0;
+
+ //---------------Attributes-----------------
+ //Get the attributes
+ locHR = inClipNode->get_attributes(&locAttribMap);
+
+ outClip->setId(getNamedAttribValue(L"id", locAttribMap));
+ outClip->setLang(getNamedAttribValue(L"lang", locAttribMap));
+ outClip->setDirn(getNamedAttribValue(L"dir", locAttribMap));
+ outClip->setTrack(getNamedAttribValue(L"track", locAttribMap));
+ outClip->setStart(getNamedAttribValue(L"start", locAttribMap));
+ outClip->setEnd(getNamedAttribValue(L"end", locAttribMap));
+ //------------------------------------------
+ //--------------Child Nodes-----------------
+ locHR = inClipNode->get_childNodes(&locChildNodes);
+ locHR = locChildNodes->get_length(&locNumNodes);
+
+ for (int i = 0; i < locNumNodes; i++) {
+
+ locHR = locChildNodes->get_item(i, &locNode);
+ locHR = locNode->get_nodeName(&locBStr);
+ locNodeName = locBStr;
+
+ if (locNodeName == L"a") {
+
+ //ZERO OR ONE a elements allowed
+ C_AnchorTag* locAnchor = new C_AnchorTag;
+
+ if (parseAnchorTag(locNode, locAnchor)) {
+ outClip->setAnchor(locAnchor);
+ locNum_a++;
+ } else {
+ delete locAnchor;
+ outClip->setAnchor(NULL);
+ }
+
+ } else if(locNodeName == L"desc") {
+
+ //ZERO OR ONE desc elements allowed
+ C_DescTag* locDesc = new C_DescTag;
+ if (parseDescTag(locNode, locDesc)) {
+ outClip->setDesc(locDesc);
+ locNum_desc++;
+ } else {
+ delete locDesc;
+ outClip->setDesc(NULL);
+ }
+
+ } else if (locNodeName == L"img") {
+
+ //ZERO OR ONE img elements allowed
+ C_ImageTag* locImage = new C_ImageTag;
+ if (parseImageTag(locNode, locImage)) {
+ outClip->setImage(locImage);
+ locNum_img++;
+ } else {
+ delete locImage;
+ outClip->setImage(locImage);
+ }
+
+ } else if (locNodeName == L"meta") {
+
+ //ZERO OR *MORE* meta elements allowed
+ C_MetaTag* locMeta = new C_MetaTag;
+ if (parseMetaTag(locNode, locMeta)) {
+ outClip->metaList()->addTag(locMeta);
+ locNum_meta++;
+ } else {
+ delete locMeta;
+ }
+
+ } else {
+
+ //TODO::: How to handle ??? For now just ignore tags we don't know.
+ locNumUnknown++;
+ }
+ }
+
+ bool retVal = (locNum_a <= 1)
+ && (locNum_img <= 1)
+ && (locNum_desc <= 1);
+
+ SysFreeString(locBStr);
+ if (locAttribMap != NULL) locAttribMap->Release();
+ if (locNode != NULL) locNode->Release();
+ if (locChildNodes != NULL) locChildNodes->Release();
+ return retVal;
+}
+
+bool CMMLParser::parseClipTag(wstring inClipText, C_ClipTag* outClip) {
+ HRESULT locHR = S_FALSE;
+ MSXML2::IXMLDOMDocument* locXMLClipFrag = NULL;
+ MSXML2::IXMLDOMNode* locClipNode = NULL;
+
+ bool retVal = setupXMLHandles(inClipText, &locXMLClipFrag);
+
+ if (retVal) {
+ locClipNode = getNamedNode(L"clip", locXMLClipFrag);
+
+ if (locClipNode != NULL) {
+ //Now we have a node representing the clip tag and it's children.
+ retVal = parseClipTag(locClipNode, outClip);
+ } else {
+ retVal = false;
+ }
+ }
+
+ if (locXMLClipFrag != NULL) locXMLClipFrag->Release();
+ if (locClipNode != NULL) locClipNode->Release();
+
+ return retVal;
+}
+
+bool CMMLParser::parseCMMLRootTag(MSXML2::IXMLDOMNode* inCMMLRootNode, C_CMMLRootTag* outCMMLRoot) {
+ MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
+ MSXML2::IXMLDOMNodeList* locChildNodes = NULL;
+ MSXML2::IXMLDOMNode* locNode = NULL;
+ HRESULT locHR = S_FALSE;
+ long locNumNodes = 0;
+ BSTR locBStr = NULL;
+ wstring locNodeName = L"";
+
+
+ unsigned long locNum_clip = 0;
+ unsigned long locNum_head = 0;
+ unsigned long locNum_stream = 0;
+ unsigned long locNumUnknown = 0;
+
+ bool retVal = true;
+
+ //---------------Attributes-----------------
+ locHR = inCMMLRootNode->get_attributes(&locAttribMap);
+
+ outCMMLRoot->setId(getNamedAttribValue(L"id", locAttribMap));
+ outCMMLRoot->setLang(getNamedAttribValue(L"lang", locAttribMap));
+ outCMMLRoot->setDirn(getNamedAttribValue(L"dir", locAttribMap));
+
+ //------------------------------------------
+ //--------------Child Nodes-----------------
+ locHR = inCMMLRootNode->get_childNodes(&locChildNodes);
+ locHR = locChildNodes->get_length(&locNumNodes);
+
+ for (int i = 0; i < locNumNodes; i++) {
+ locHR = locChildNodes->get_item(i, &locNode);
+ locHR = locNode->get_nodeName(&locBStr);
+ //TODO::: Needs checks ??
+
+ locNodeName = locBStr;
+ if (locNodeName == L"stream") {
+ //If it exists it must be first
+ if ( (locNum_stream == 0)
+ && (locNum_clip == 0)
+ && (locNum_head == 0)) {
+ //OPTIONALLY ONE stream tag
+ C_StreamTag* locStream = new C_StreamTag;
+
+ if (parseStreamTag(locNode, locStream)) {
+ outCMMLRoot->setStream(locStream);
+ locNum_stream++;
+ } else {
+ delete locStream;
+ outCMMLRoot->setStream(NULL);
+ }
+ } else {
+ retVal = false;
+ }
+
+
+ } else if (locNodeName == L"head") {
+
+ //MUST HAVE ONE head tag
+ if ( (locNum_stream <= 1)
+ && (locNum_clip == 0)
+ && (locNum_head == 0)) {
+
+ C_HeadTag* locHead = new C_HeadTag;
+
+ if (parseHeadTag(locNode, locHead)) {
+ outCMMLRoot->setHead(locHead);
+ locNum_head++;
+ } else {
+ delete locHead;
+ retVal = false;
+ }
+ } else {
+ retVal = false;
+
+ }
+ } else if (locNodeName == L"clip") {
+
+ //ZERO OR MORE clip tags
+ if ( (locNum_stream <= 1)
+ && (locNum_head == 1)) {
+
+ C_ClipTag* locClip = new C_ClipTag;
+
+ if(parseClipTag(locNode, locClip)) {
+ outCMMLRoot->clipList()->addTag(locClip);
+ locNum_clip++;
+ } else {
+ delete locClip;
+ }
+ } else {
+ retVal = false;
+ }
+
+ } else {
+ locNumUnknown++;
+ }
+ }
+
+ retVal = (retVal)
+ && (locNum_stream <= 1)
+ && (locNum_head == 1);
+
+
+
+ SysFreeString(locBStr);
+ if (locAttribMap != NULL) locAttribMap->Release();
+ if (locNode != NULL) locNode->Release();
+ if (locChildNodes != NULL) locChildNodes->Release();
+ return retVal;
+}
+
+
+bool CMMLParser::parseCMMLRootTag(wstring inCMMLRootText, C_CMMLRootTag* outCMMLRoot) {
+ HRESULT locHR = S_FALSE;
+ MSXML2::IXMLDOMDocument* locXMLCMMLRootFrag = NULL;
+ MSXML2::IXMLDOMNode* locCMMLRootNode = NULL;
+
+ bool retVal = setupXMLHandles(inCMMLRootText, &locXMLCMMLRootFrag);
+
+ if (retVal) {
+ locCMMLRootNode = getNamedNode(L"cmml", locXMLCMMLRootFrag);
+
+ if (locCMMLRootNode != NULL) {
+
+ retVal = parseCMMLRootTag(locCMMLRootNode, outCMMLRoot);
+ } else {
+ retVal = false;
+ }
+ }
+
+ if (locXMLCMMLRootFrag != NULL) locXMLCMMLRootFrag->Release();
+ if (locCMMLRootNode != NULL) locCMMLRootNode->Release();
+
+ return retVal;
+}
+bool CMMLParser::parseHeadTag(MSXML2::IXMLDOMNode* inHeadNode, C_HeadTag* outHead) {
+ MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
+ MSXML2::IXMLDOMNodeList* locChildNodes = NULL;
+ MSXML2::IXMLDOMNode* locNode = NULL;
+ HRESULT locHR = S_FALSE;
+ long locNumNodes = 0;
+ BSTR locBStr = NULL;
+ wstring locNodeName;
+
+ unsigned long locNum_title = 0;
+ unsigned long locNum_meta = 0;
+ unsigned long locNum_base = 0;
+ unsigned long locNumUnknown = 0;
+
+
+ //---------------Attributes-----------------
+ locHR = inHeadNode->get_attributes(&locAttribMap);
+
+ outHead->setId(getNamedAttribValue(L"id", locAttribMap));
+ outHead->setLang(getNamedAttribValue(L"lang", locAttribMap));
+ outHead->setDirn(getNamedAttribValue(L"dir", locAttribMap));
+ outHead->setProfile(getNamedAttribValue(L"profile", locAttribMap));
+ //------------------------------------------
+
+ //--------------Child Nodes-----------------
+ locHR = inHeadNode->get_childNodes(&locChildNodes);
+ locHR = locChildNodes->get_length(&locNumNodes);
+ for (int i = 0; i < locNumNodes; i++) {
+ locHR = locChildNodes->get_item(i, &locNode);
+ locHR = locNode->get_nodeName(&locBStr);
+ //TODO::: Needs checks ??
+
+ locNodeName = locBStr;
+ if (locNodeName == L"title") {
+
+ //Must contain ONE title tag
+ C_TitleTag* locTitle = new C_TitleTag;
+
+ if (parseTitleTag(locNode, locTitle)) {
+ outHead->setTitle(locTitle);
+ locNum_title++;
+ } else {
+ delete locTitle;
+ outHead->setTitle(NULL);
+ }
+
+
+ } else if (locNodeName == L"meta") {
+
+ //Can contain ANY AMOUNT of meta tags
+ C_MetaTag* locMeta = new C_MetaTag;
+
+ if (parseMetaTag(locNode, locMeta)) {
+ outHead->metaList()->addTag(locMeta);
+ locNum_meta++;
+ } else {
+ delete locMeta;
+ }
+
+ } else if (locNodeName == L"base") {
+
+ //OPTIONALLY ONE base tag.
+ C_BaseTag* locBase = new C_BaseTag;
+
+ if(parseBaseTag(locNode, locBase)) {
+ outHead->setBase(locBase);
+ locNum_base++;
+ } else {
+ delete locBase;
+ outHead->setBase(NULL);
+ }
+
+ } else {
+ locNumUnknown++;
+ }
+ }
+
+ bool retVal = (locNum_title == 1)
+ && (locNum_base <= 1);
+
+
+ SysFreeString(locBStr);
+ if (locAttribMap != NULL) locAttribMap->Release();
+ if (locNode != NULL) locNode->Release();
+ if (locChildNodes != NULL) locChildNodes->Release();
+ return retVal;
+}
+
+bool CMMLParser::parseHeadTag(wstring inHeadText, C_HeadTag* outHead) {
+ HRESULT locHR = S_FALSE;
+ MSXML2::IXMLDOMDocument* locXMLHeadFrag = NULL;
+ MSXML2::IXMLDOMNode* locHeadNode = NULL;
+
+ bool retVal = setupXMLHandles(inHeadText, &locXMLHeadFrag);
+
+ if (retVal) {
+ locHeadNode = getNamedNode(L"head", locXMLHeadFrag);
+ if (locHeadNode != NULL) {
+
+ //Now we have a node representing the clip tag and it's children.
+ retVal = parseHeadTag(locHeadNode, outHead);
+ } else {
+ retVal = false;
+ }
+ }
+
+ if (locXMLHeadFrag != NULL) locXMLHeadFrag->Release();
+ if (locHeadNode != NULL) locHeadNode->Release();
+
+ return retVal;
+}
+
+bool CMMLParser::parseStreamTag(MSXML2::IXMLDOMNode* inStreamNode, C_StreamTag* outStream) {
+ ////-------------Initialisation-------------
+ MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
+ MSXML2::IXMLDOMNode* locNode = NULL;
+ MSXML2::IXMLDOMNodeList* locChildNodes = NULL;
+ HRESULT locHR = S_FALSE;
+ long locNumNodes = 0;
+ BSTR locBStr = NULL;
+ wstring locNodeName = L"";
+
+ //---------------Attributes-----------------
+ locHR = inStreamNode->get_attributes(&locAttribMap);
+ //outStream->setLang(getNamedAttribValue(L"lang", locAttribMap));
+ //outStream->setDirn(getNamedAttribValue(L"dir", locAttribMap));
+ outStream->setId(getNamedAttribValue(L"id", locAttribMap));
+ outStream->setTimebase(getNamedAttribValue(L"timebase", locAttribMap));
+ outStream->setUtc(getNamedAttribValue(L"utc", locAttribMap));
+ //------------------------------------------
+ //--------------Child Nodes-----------------
+ locHR = inStreamNode->get_childNodes(&locChildNodes);
+ locHR = locChildNodes->get_length(&locNumNodes);
+ for (int i = 0; i < locNumNodes; i++) {
+ locHR = locChildNodes->get_item(i, &locNode);
+ locHR = locNode->get_nodeName(&locBStr);
+ locNodeName = locBStr;
+ if(locNodeName == L"import") {
+
+ C_ImportTag* locImport = new C_ImportTag;
+ if (parseImportTag(locNode, locImport)) {
+ outStream->importList()->addTag(locImport);
+ } else {
+ //TODO::: Anything ???
+ }
+
+ } else {
+ //TODO::: Handle this, otherwise ignore.
+ }
+ }
+
+ //--------------Clean Up--------------------
+ SysFreeString(locBStr);
+ if (locAttribMap != NULL) locAttribMap->Release();
+ if (locNode != NULL) locNode->Release();
+ if (locChildNodes != NULL) locChildNodes->Release();
+ return true;
+}
+
+bool CMMLParser::parseImportTag(MSXML2::IXMLDOMNode* inImportNode, C_ImportTag* outImport) {
+
+ //TODO::: Stream and import tags need checking about what to do with internationalisation
+ MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
+ MSXML2::IXMLDOMNode* locNode = NULL;
+ MSXML2::IXMLDOMNodeList* locChildNodes = NULL;
+ HRESULT locHR = S_FALSE;
+ long locNumNodes = 0;
+ BSTR locBStr = NULL;
+ wstring locNodeName = L"";
+
+ bool retVal = true;
+
+ //---------------Attributes-----------------
+ locHR = inImportNode->get_attributes(&locAttribMap);
+
+ outImport->setId(getNamedAttribValue(L"id", locAttribMap));
+ outImport->setContentType(getNamedAttribValue(L"contenttype", locAttribMap));
+ outImport->setSrc(getNamedAttribValue(L"src", locAttribMap));
+ if (outImport->src() == L"") {
+ //Source is required.
+ retVal = false;
+ }
+ outImport->setStart(getNamedAttribValue(L"start", locAttribMap));
+ outImport->setEnd(getNamedAttribValue(L"end", locAttribMap));
+ outImport->setTitle(getNamedAttribValue(L"title", locAttribMap));
+ outImport->setGranuleRate(getNamedAttribValue(L"granulerate", locAttribMap));
+ //------------------------------------------
+
+
+ locHR = inImportNode->get_childNodes(&locChildNodes);
+ locHR = locChildNodes->get_length(&locNumNodes);
+ for (int i = 0; i < locNumNodes; i++) {
+ locHR = locChildNodes->get_item(i, &locNode);
+ locHR = locNode->get_nodeName(&locBStr);
+ locNodeName = locBStr;
+ if(locNodeName == L"param") {
+
+ C_ParamTag* locParam = new C_ParamTag;
+ if (parseParamTag(locNode, locParam)) {
+ outImport->paramList()->addTag(locParam);
+ } else {
+ //TODO::: Anything ???
+ }
+
+ } else {
+ //TODO::: Handle this, otherwise ignore.
+ }
+ }
+
+ SysFreeString(locBStr);
+ if (locAttribMap != NULL) locAttribMap->Release();
+ if (locNode != NULL) locNode->Release();
+ if (locChildNodes != NULL) locChildNodes->Release();
+ return retVal;
+}
+
+bool CMMLParser::parseImageTag(MSXML2::IXMLDOMNode* inImageNode, C_ImageTag* outImage) {
+ MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
+ // MSXML2::IXMLDOMNode* locImageNode = NULL;
+ HRESULT locHR = S_FALSE;
+
+ bool retVal = true;
+ //---------------Attributes-----------------
+ locHR = inImageNode->get_attributes(&locAttribMap);
+ outImage->setId(getNamedAttribValue(L"id", locAttribMap));
+ outImage->setSrc(getNamedAttribValue(L"src", locAttribMap));
+ if (outImage->src() == L"") {
+ retVal = false;
+ }
+ outImage->setAlt(getNamedAttribValue(L"alt", locAttribMap));
+
+ if (locAttribMap != NULL) locAttribMap->Release();
+ return retVal;
+}
+/*
+bool CMMLParser::parseMetaTag(MSXML2::IXMLDOMNode* inMetaNode, C_MetaTag* outMeta) {
+ MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
+ MSXML2::IXMLDOMNode* locMetaNode = NULL;
+ HRESULT locHR = S_FALSE;
+
+ //---------------Attributes-----------------
+ locHR = inMetaNode->get_attributes(&locAttribMap);
+
+}
+*/
+
+bool CMMLParser::parseMetaTag(MSXML2::IXMLDOMNode* inMetaNode, C_MetaTag* outMeta) {
+ MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
+ HRESULT locHR = S_FALSE;
+
+ bool retVal = true;
+ //---------------Attributes-----------------
+ locHR = inMetaNode->get_attributes(&locAttribMap);
+
+ outMeta->setId(getNamedAttribValue(L"id", locAttribMap));
+ outMeta->setLang(getNamedAttribValue(L"lang", locAttribMap));
+ outMeta->setDirn(getNamedAttribValue(L"dir", locAttribMap));
+ outMeta->setName(getNamedAttribValue(L"name", locAttribMap));
+ if (outMeta->name() == L"") {
+ retVal = false;
+ } else {
+ outMeta->setContent(getNamedAttribValue(L"content", locAttribMap));
+ if (outMeta->content() == L"") {
+ retVal = false;
+ }
+ }
+
+ outMeta->setScheme(getNamedAttribValue(L"scheme", locAttribMap));
+ //------------------------------------------
+
+ if (locAttribMap != NULL) locAttribMap->Release();
+ return true;
+}
+
+//string CMMLParser::toNarrowStr(wstring inString) {
+// string retVal;
+//
+//
+// for (std::wstring::const_iterator i = inString.begin(); i != inString.end(); i++) {
+// retVal.append(1, *i);
+// }
+//
+// return retVal;
+//}
+
+bool CMMLParser::parseAnchorTag(MSXML2::IXMLDOMNode* inAnchorNode, C_AnchorTag* outAnchor) {
+ MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
+ HRESULT locHR = S_FALSE;
+ BSTR locBStr = NULL;
+ wstring locAnchorText = L"";
+
+ bool retVal = true;
+ //---------------Attributes-----------------
+ locHR = inAnchorNode->get_attributes(&locAttribMap);
+ outAnchor->setId(getNamedAttribValue(L"id", locAttribMap));
+ outAnchor->setLang(getNamedAttribValue(L"lang", locAttribMap));
+ outAnchor->setDirn(getNamedAttribValue(L"dir", locAttribMap));
+ outAnchor->setCls(getNamedAttribValue(L"class", locAttribMap));
+ outAnchor->setHref(getNamedAttribValue(L"href", locAttribMap));
+ if (outAnchor->href() == L"") {
+ retVal = false;
+ }
+ //------------------------------------------
+ //Anchor text
+
+ inAnchorNode->get_text(&locBStr);
+ locAnchorText = locBStr;
+
+ //if (locAnchorText == L"") {
+ // retVal = false;
+ //}
+ outAnchor->setText(locAnchorText);
+
+ //Cleanup
+ SysFreeString(locBStr);
+ if (locAttribMap != NULL) locAttribMap->Release();
+ return retVal;
+}
+
+bool CMMLParser::parseTitleTag(MSXML2::IXMLDOMNode* inTitleNode, C_TitleTag* outTitle) {
+ MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
+ BSTR locBStr = NULL;
+ wstring locTitleText;
+ HRESULT locHR = S_FALSE;
+
+ //---------------Attributes-----------------
+ locHR = inTitleNode->get_attributes(&locAttribMap);
+
+ outTitle->setId(getNamedAttribValue(L"id", locAttribMap));
+ outTitle->setLang(getNamedAttribValue(L"lang", locAttribMap));
+ outTitle->setDirn(getNamedAttribValue(L"dir", locAttribMap));
+ //------------------------------------------
+
+ inTitleNode->get_text(&locBStr);
+ locTitleText = locBStr;
+ outTitle->setText(locTitleText);
+
+ SysFreeString(locBStr);
+ if (locAttribMap != NULL) locAttribMap->Release();
+ return true;
+
+}
+
+bool CMMLParser::parseDescTag(MSXML2::IXMLDOMNode* inDescNode, C_DescTag* outDesc) {
+ MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
+ BSTR locBStr = NULL;
+ wstring locDescText;
+ HRESULT locHR = S_FALSE;
+
+ //---------------Attributes-----------------
+ locHR = inDescNode->get_attributes(&locAttribMap);
+ outDesc->setId(getNamedAttribValue(L"id", locAttribMap));
+ outDesc->setLang(getNamedAttribValue(L"lang", locAttribMap));
+ outDesc->setDirn(getNamedAttribValue(L"dir", locAttribMap));
+ //------------------------------------------
+ inDescNode->get_text(&locBStr);
+ locDescText = locBStr;
+ outDesc->setText(locDescText);
+
+ SysFreeString(locBStr);
+ if (locAttribMap != NULL) locAttribMap->Release();
+ return true;
+
+}
+
+
+
+
+bool CMMLParser::parseBaseTag(MSXML2::IXMLDOMNode* inBaseNode, C_BaseTag* outBase) {
+ MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
+ HRESULT locHR = S_FALSE;
+
+ bool retVal = true;
+ //---------------Attributes-----------------
+ locHR = inBaseNode->get_attributes(&locAttribMap);
+
+ outBase->setId(getNamedAttribValue(L"id", locAttribMap));
+ outBase->setHref(getNamedAttribValue(L"href", locAttribMap));
+ if (outBase->href() == L"") {
+ retVal = false;
+ }
+ //------------------------------------------
+
+ if (locAttribMap != NULL) locAttribMap->Release();
+ return retVal;
+
+}
+
+
+
+bool CMMLParser::parseParamTag(MSXML2::IXMLDOMNode* inParamNode, C_ParamTag* outParam) {
+ MSXML2::IXMLDOMNamedNodeMap* locAttribMap = NULL;
+ HRESULT locHR = S_FALSE;
+
+ bool retVal = true;
+ //---------------Attributes-----------------
+ locHR = inParamNode->get_attributes(&locAttribMap);
+
+ outParam->setId(getNamedAttribValue(L"id", locAttribMap));
+ outParam->setName(getNamedAttribValue(L"name", locAttribMap));
+ if (outParam->name() == L"") {
+ retVal = false;
+ } else {
+ outParam->setContent(getNamedAttribValue(L"value", locAttribMap));
+ if (outParam->content() == L"") {
+ retVal = false;
+ }
+ }
+
+
+ //------------------------------------------
+
+ if (locAttribMap != NULL) locAttribMap->Release();
+ return true;
+}
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/CMMLParser.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/CMMLParser.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/CMMLParser.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/CMMLParser.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,85 +1,85 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include <string>
-#include "libCMMLTags.h"
-#import <msxml3.dll> raw_interfaces_only
-using namespace MSXML2;
-#include <msxml.h>
-using namespace std;
-class LIBWINCMMLPARSE_API CMMLParser
-{
-public:
- CMMLParser(void);
- ~CMMLParser(void);
-
- bool setupXMLHandles(wstring inText, MSXML2::IXMLDOMDocument** outDoc);
- //C_CMMLTag* genericParseTag(string inCMMLText);
- //bool parseCMMLDoc(string inCMMLDocText, C_CMMLDoc* outDoc);
- bool parseClipTag(wstring inClipText, C_ClipTag* outClip);
- bool parseHeadTag(wstring inHeadText, C_HeadTag* outHead);
- bool parseCMMLRootTag(wstring inCMMLRootText, C_CMMLRootTag* outCMMLRoot);
-
- bool parseHeadTag(MSXML2::IXMLDOMNode* inHeadNode, C_HeadTag* outHead);
- bool parseAnchorTag(MSXML2::IXMLDOMNode* inAnchorNode, C_AnchorTag* outAnchor);
- bool parseStreamTag(MSXML2::IXMLDOMNode* inStreamNode, C_StreamTag* outStream);
- bool parseImportTag(MSXML2::IXMLDOMNode* inImportNode, C_ImportTag* outImport);
- bool parseTitleTag(MSXML2::IXMLDOMNode* inTitleNode, C_TitleTag* outTitle);
- bool parseClipTag(MSXML2::IXMLDOMNode* inClipNode, C_ClipTag* outClip);
- bool parseImageTag(MSXML2::IXMLDOMNode* inImageNode, C_ImageTag* outImage);
- bool parseMetaTag(MSXML2::IXMLDOMNode* inMetaNode, C_MetaTag* outMeta);
- bool parseDescTag(MSXML2::IXMLDOMNode* inDescNode, C_DescTag* outDesc);
- bool parseBaseTag(MSXML2::IXMLDOMNode* inBaseNode, C_BaseTag* outBase);
- bool parseParamTag(MSXML2::IXMLDOMNode* inParamNode, C_ParamTag* outParam);
- bool parseCMMLRootTag(MSXML2::IXMLDOMNode* inCMMLRootNode, C_CMMLRootTag* outCMMLRoot);
-
-
- bool CMMLParser::parseDocFromFile(wstring inFilename, C_CMMLDoc* outCMMLDoc);
-
-
-
-protected:
- wstring getNamedAttribValue(wstring inAttribName, MSXML2::IXMLDOMNamedNodeMap* inAttribMap);
- MSXML2::IXMLDOMNode* getNamedNode(wstring inXPath, MSXML2::IXMLDOMDocument* inDoc);
- //string toNarrowStr(wstring inString);
- //void createTagMap();
- //unsigned long hashFunction(string inTagName);
-
-
- //typedef map<unsigned long, string> tTagMap;
- //tTagMap mTagMap;
- //tTagMap::value_type mTagValue;
-
-};
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include <string>
+#include "libCMMLTags.h"
+#import <msxml3.dll> raw_interfaces_only
+using namespace MSXML2;
+#include <msxml.h>
+using namespace std;
+class LIBWINCMMLPARSE_API CMMLParser
+{
+public:
+ CMMLParser(void);
+ ~CMMLParser(void);
+
+ bool setupXMLHandles(wstring inText, MSXML2::IXMLDOMDocument** outDoc);
+ //C_CMMLTag* genericParseTag(string inCMMLText);
+ //bool parseCMMLDoc(string inCMMLDocText, C_CMMLDoc* outDoc);
+ bool parseClipTag(wstring inClipText, C_ClipTag* outClip);
+ bool parseHeadTag(wstring inHeadText, C_HeadTag* outHead);
+ bool parseCMMLRootTag(wstring inCMMLRootText, C_CMMLRootTag* outCMMLRoot);
+
+ bool parseHeadTag(MSXML2::IXMLDOMNode* inHeadNode, C_HeadTag* outHead);
+ bool parseAnchorTag(MSXML2::IXMLDOMNode* inAnchorNode, C_AnchorTag* outAnchor);
+ bool parseStreamTag(MSXML2::IXMLDOMNode* inStreamNode, C_StreamTag* outStream);
+ bool parseImportTag(MSXML2::IXMLDOMNode* inImportNode, C_ImportTag* outImport);
+ bool parseTitleTag(MSXML2::IXMLDOMNode* inTitleNode, C_TitleTag* outTitle);
+ bool parseClipTag(MSXML2::IXMLDOMNode* inClipNode, C_ClipTag* outClip);
+ bool parseImageTag(MSXML2::IXMLDOMNode* inImageNode, C_ImageTag* outImage);
+ bool parseMetaTag(MSXML2::IXMLDOMNode* inMetaNode, C_MetaTag* outMeta);
+ bool parseDescTag(MSXML2::IXMLDOMNode* inDescNode, C_DescTag* outDesc);
+ bool parseBaseTag(MSXML2::IXMLDOMNode* inBaseNode, C_BaseTag* outBase);
+ bool parseParamTag(MSXML2::IXMLDOMNode* inParamNode, C_ParamTag* outParam);
+ bool parseCMMLRootTag(MSXML2::IXMLDOMNode* inCMMLRootNode, C_CMMLRootTag* outCMMLRoot);
+
+
+ bool CMMLParser::parseDocFromFile(wstring inFilename, C_CMMLDoc* outCMMLDoc);
+
+
+
+protected:
+ wstring getNamedAttribValue(wstring inAttribName, MSXML2::IXMLDOMNamedNodeMap* inAttribMap);
+ MSXML2::IXMLDOMNode* getNamedNode(wstring inXPath, MSXML2::IXMLDOMDocument* inDoc);
+ //string toNarrowStr(wstring inString);
+ //void createTagMap();
+ //unsigned long hashFunction(string inTagName);
+
+
+ //typedef map<unsigned long, string> tTagMap;
+ //tTagMap mTagMap;
+ //tTagMap::value_type mTagValue;
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/CMMLParser.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/libWinCMMLParse.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/libWinCMMLParse.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/libWinCMMLParse.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,55 +1,55 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// libWinCMMLParse.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-#include "libWinCMMLParse.h"
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
-}
-
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// libWinCMMLParse.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+#include "libWinCMMLParse.h"
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ switch (ul_reason_for_call)
+ {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
+}
+
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/libWinCMMLParse.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/libWinCMMLParse.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/libWinCMMLParse.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/libWinCMMLParse.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,46 +1,46 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// TODO: reference additional headers your program requires here
-// The following ifdef block is the standard way of creating macros which make exporting
-// from a DLL simpler. All files within this DLL are compiled with the LIBWINCMMLPARSE_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see
-// LIBWINCMMLPARSE_API functions as being imported from a DLL, whereas this DLL sees symbols
-// defined with this macro as being exported.
-#ifdef LIBWINCMMLPARSE_EXPORTS
-#define LIBWINCMMLPARSE_API __declspec(dllexport)
-#else
-#define LIBWINCMMLPARSE_API __declspec(dllimport)
-#endif
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// TODO: reference additional headers your program requires here
+// The following ifdef block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the LIBWINCMMLPARSE_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// LIBWINCMMLPARSE_API functions as being imported from a DLL, whereas this DLL sees symbols
+// defined with this macro as being exported.
+#ifdef LIBWINCMMLPARSE_EXPORTS
+#define LIBWINCMMLPARSE_API __declspec(dllexport)
+#else
+#define LIBWINCMMLPARSE_API __declspec(dllimport)
+#endif
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/libWinCMMLParse.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,42 +1,42 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.cpp : source file that includes just the standard includes
-// libWinCMMLParse.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.cpp : source file that includes just the standard includes
+// libWinCMMLParse.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,46 +1,46 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-#include "libWinCMMLParse.h"
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+#include "libWinCMMLParse.h"
Property changes on: trunk/oggdsf/src/lib/codecs/cmml/libWinCMMLParse/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/DiracDecodeSourceFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/DiracDecodeSourceFilter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/DiracDecodeSourceFilter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,175 +1,175 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include ".\DiracDecodeSourceFilter.h"
-
-CFactoryTemplate g_Templates[] =
-{
- {
- L"DiracDecodeSourceFilter", // Name
- &CLSID_DiracDecodeSourceFilter, // CLSID
- DiracDecodeSourceFilter::CreateInstance, // Method to create an instance of MyComponent
- NULL, // Initialization function
- NULL // Set-up information (for filters)
- }
-
-};
-
-// Generic way of determining the number of items in the template
-int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
-
-
-CUnknown* WINAPI DiracDecodeSourceFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
-{
- DiracDecodeSourceFilter *pNewObject = new DiracDecodeSourceFilter();
- if (pNewObject == NULL) {
- *pHr = E_OUTOFMEMORY;
- }
- return pNewObject;
-}
-
-DiracDecodeSourceFilter::DiracDecodeSourceFilter(void)
- : CBaseFilter(NAME("DiracDecodeSourceFilter"), NULL, m_pLock, CLSID_DiracDecodeSourceFilter)
- , mDecoder(NULL)
-{
- mDiracSourcePin = new DiracDecodeSourcePin(this, m_pLock);
-}
-
-DiracDecodeSourceFilter::~DiracDecodeSourceFilter(void)
-{
- delete mDiracSourcePin;
- mDiracSourcePin = NULL;
-}
-
-//BaseFilter Interface
-int DiracDecodeSourceFilter::GetPinCount() {
- return 1;
-}
-CBasePin* DiracDecodeSourceFilter::GetPin(int inPinNo) {
-
- if (inPinNo == 0) {
- return mDiracSourcePin;
- } else {
- return NULL;
- }
-}
-
-//IAMFilterMiscFlags Interface
-ULONG DiracDecodeSourceFilter::GetMiscFlags(void) {
- return AM_FILTER_MISC_FLAGS_IS_SOURCE;
-}
-
- //IFileSource Interface
-STDMETHODIMP DiracDecodeSourceFilter::GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType) {
- //Return the filename and mediatype of the raw data
-
-
- LPOLESTR x = SysAllocString(mFileName.c_str());
- *outFileName = x;
-
- return S_OK;
-}
-
-//ANX::: Seek table will need modifying to handle this.
-STDMETHODIMP DiracDecodeSourceFilter::Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType) {
- //Initialise the file here and setup all the streams
- CAutoLock locLock(m_pLock);
- mFileName = inFileName;
-
- //Strip the extension...
- //size_t locDotPos = mFileName.find_last_of('.');
- //if (locDotPos != ios_base::npos) {
- // mHDRFileName = mFileName.substr(0, locDotPos);
- // mHDRFileName += ".hdr";
- //} else {
- // return S_FALSE;
- //}
-
- mInputFile.open(StringHelper::toNarrowStr(mFileName), ios_base::in | ios_base::binary);
-
- if (!mInputFile.is_open()) {
- return S_FALSE;
- }
-
-
-
- return S_OK;
-}
-
-STDMETHODIMP DiracDecodeSourceFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
-
- return CBaseFilter::NonDelegatingQueryInterface(riid, ppv);
-}
-
-
-//IMEdiaStreaming
-STDMETHODIMP DiracDecodeSourceFilter::Run(REFERENCE_TIME tStart) {
- const REFERENCE_TIME A_LONG_TIME = UNITS * 1000;
- CAutoLock locLock(m_pLock);
- //debugLog<<"Run : time = "<<tStart<<endl;
- //DeliverNewSegment(tStart, tStart + A_LONG_TIME, 1.0);
- return CBaseFilter::Run(tStart);
-
-
-}
-STDMETHODIMP DiracDecodeSourceFilter::Pause(void) {
- CAutoLock locLock(m_pLock);
- //debugLog << "** Pause called **"<<endl;
- if (m_State == State_Stopped) {
- //debugLog << "Was in stopped state... starting thread"<<endl;
- if (ThreadExists() == FALSE) {
- Create();
- }
- CallWorker(THREAD_RUN);
- }
- //debugLog<<"Was NOT is stopped state, not doing much at all..."<<endl;
-
- HRESULT locHR = CBaseFilter::Pause();
-
- return locHR;
-
-}
-STDMETHODIMP DiracDecodeSourceFilter::Stop(void) {
- CAutoLock locLock(m_pLock);
- //debugLog<<"** Stop Called ** "<<endl;
- CallWorker(THREAD_EXIT);
- Close();
- //DeliverBeginFlush();
- //DeliverEndFlush();
- return CBaseFilter::Stop();
-}
-
-HRESULT DiracDecodeSourceFilter::DataProcessLoop() {
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include ".\DiracDecodeSourceFilter.h"
+
+CFactoryTemplate g_Templates[] =
+{
+ {
+ L"DiracDecodeSourceFilter", // Name
+ &CLSID_DiracDecodeSourceFilter, // CLSID
+ DiracDecodeSourceFilter::CreateInstance, // Method to create an instance of MyComponent
+ NULL, // Initialization function
+ NULL // Set-up information (for filters)
+ }
+
+};
+
+// Generic way of determining the number of items in the template
+int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
+
+
+CUnknown* WINAPI DiracDecodeSourceFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
+{
+ DiracDecodeSourceFilter *pNewObject = new DiracDecodeSourceFilter();
+ if (pNewObject == NULL) {
+ *pHr = E_OUTOFMEMORY;
+ }
+ return pNewObject;
+}
+
+DiracDecodeSourceFilter::DiracDecodeSourceFilter(void)
+ : CBaseFilter(NAME("DiracDecodeSourceFilter"), NULL, m_pLock, CLSID_DiracDecodeSourceFilter)
+ , mDecoder(NULL)
+{
+ mDiracSourcePin = new DiracDecodeSourcePin(this, m_pLock);
+}
+
+DiracDecodeSourceFilter::~DiracDecodeSourceFilter(void)
+{
+ delete mDiracSourcePin;
+ mDiracSourcePin = NULL;
+}
+
+//BaseFilter Interface
+int DiracDecodeSourceFilter::GetPinCount() {
+ return 1;
+}
+CBasePin* DiracDecodeSourceFilter::GetPin(int inPinNo) {
+
+ if (inPinNo == 0) {
+ return mDiracSourcePin;
+ } else {
+ return NULL;
+ }
+}
+
+//IAMFilterMiscFlags Interface
+ULONG DiracDecodeSourceFilter::GetMiscFlags(void) {
+ return AM_FILTER_MISC_FLAGS_IS_SOURCE;
+}
+
+ //IFileSource Interface
+STDMETHODIMP DiracDecodeSourceFilter::GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType) {
+ //Return the filename and mediatype of the raw data
+
+
+ LPOLESTR x = SysAllocString(mFileName.c_str());
+ *outFileName = x;
+
+ return S_OK;
+}
+
+//ANX::: Seek table will need modifying to handle this.
+STDMETHODIMP DiracDecodeSourceFilter::Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType) {
+ //Initialise the file here and setup all the streams
+ CAutoLock locLock(m_pLock);
+ mFileName = inFileName;
+
+ //Strip the extension...
+ //size_t locDotPos = mFileName.find_last_of('.');
+ //if (locDotPos != ios_base::npos) {
+ // mHDRFileName = mFileName.substr(0, locDotPos);
+ // mHDRFileName += ".hdr";
+ //} else {
+ // return S_FALSE;
+ //}
+
+ mInputFile.open(StringHelper::toNarrowStr(mFileName), ios_base::in | ios_base::binary);
+
+ if (!mInputFile.is_open()) {
+ return S_FALSE;
+ }
+
+
+
+ return S_OK;
+}
+
+STDMETHODIMP DiracDecodeSourceFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+
+ return CBaseFilter::NonDelegatingQueryInterface(riid, ppv);
+}
+
+
+//IMEdiaStreaming
+STDMETHODIMP DiracDecodeSourceFilter::Run(REFERENCE_TIME tStart) {
+ const REFERENCE_TIME A_LONG_TIME = UNITS * 1000;
+ CAutoLock locLock(m_pLock);
+ //debugLog<<"Run : time = "<<tStart<<endl;
+ //DeliverNewSegment(tStart, tStart + A_LONG_TIME, 1.0);
+ return CBaseFilter::Run(tStart);
+
+
+}
+STDMETHODIMP DiracDecodeSourceFilter::Pause(void) {
+ CAutoLock locLock(m_pLock);
+ //debugLog << "** Pause called **"<<endl;
+ if (m_State == State_Stopped) {
+ //debugLog << "Was in stopped state... starting thread"<<endl;
+ if (ThreadExists() == FALSE) {
+ Create();
+ }
+ CallWorker(THREAD_RUN);
+ }
+ //debugLog<<"Was NOT is stopped state, not doing much at all..."<<endl;
+
+ HRESULT locHR = CBaseFilter::Pause();
+
+ return locHR;
+
+}
+STDMETHODIMP DiracDecodeSourceFilter::Stop(void) {
+ CAutoLock locLock(m_pLock);
+ //debugLog<<"** Stop Called ** "<<endl;
+ CallWorker(THREAD_EXIT);
+ Close();
+ //DeliverBeginFlush();
+ //DeliverEndFlush();
+ return CBaseFilter::Stop();
+}
+
+HRESULT DiracDecodeSourceFilter::DataProcessLoop() {
+
do
{
/* parse the input data */
@@ -279,40 +279,40 @@
default:
continue;
}
- } while (bytes > 0 && state != STATE_INVALID);
-
-
-
-
-
- return S_OK;
-}
-
-//CAMThread Stuff
-DWORD DiracDecodeSourceFilter::ThreadProc(void) {
- //debugLog << "Thread Proc Called..."<<endl;
- while(true) {
- DWORD locThreadCommand = GetRequest();
- //debugLog << "Command = "<<locThreadCommand<<endl;
- switch(locThreadCommand) {
- case THREAD_EXIT:
- //debugLog << "EXIT ** "<<endl;
- Reply(S_OK);
- return S_OK;
-
- //case THREAD_PAUSE:
- // // we are paused already
- // Reply(S_OK);
- // break;
-
- case THREAD_RUN:
- //debugLog << "RUN ** "<<endl;
- Reply(S_OK);
- DataProcessLoop();
- break;
- }
-
-
- }
- return S_OK;
+ } while (bytes > 0 && state != STATE_INVALID);
+
+
+
+
+
+ return S_OK;
+}
+
+//CAMThread Stuff
+DWORD DiracDecodeSourceFilter::ThreadProc(void) {
+ //debugLog << "Thread Proc Called..."<<endl;
+ while(true) {
+ DWORD locThreadCommand = GetRequest();
+ //debugLog << "Command = "<<locThreadCommand<<endl;
+ switch(locThreadCommand) {
+ case THREAD_EXIT:
+ //debugLog << "EXIT ** "<<endl;
+ Reply(S_OK);
+ return S_OK;
+
+ //case THREAD_PAUSE:
+ // // we are paused already
+ // Reply(S_OK);
+ // break;
+
+ case THREAD_RUN:
+ //debugLog << "RUN ** "<<endl;
+ Reply(S_OK);
+ DataProcessLoop();
+ break;
+ }
+
+
+ }
+ return S_OK;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/DiracDecodeSourceFilter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/DiracDecodeSourceFilter.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/DiracDecodeSourceFilter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/DiracDecodeSourceFilter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,86 +1,86 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include "dsfDiracDecodeSource.h"
-
-#include <string>
-using namespace std;
-
-
-class DiracDecodeSourcePin;
-class DiracDecodeSourceFilter
- : public CBaseFilter
- , public IFileSourceFilter
- , public IAMFilterMiscFlags
- , public CAMThread
-{
-public:
- enum eThreadCommands {
- THREAD_EXIT = 0,
- THREAD_PAUSE = 1,
- THREAD_RUN = 2
- };
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- DiracDecodeSourceFilter(void);
- virtual ~DiracDecodeSourceFilter(void);
-
- static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
-
- //IBaseFilter Pure Virtuals
- virtual int GetPinCount();
- virtual CBasePin* GetPin(int inPinNo);
-
- //IAMFilterMiscFlags Interface
- ULONG STDMETHODCALLTYPE GetMiscFlags(void);
- //
-
- //IFileSource Interface
- virtual STDMETHODIMP GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType);
- virtual STDMETHODIMP Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType);
-
- //Streaming MEthods
- STDMETHODIMP Run(REFERENCE_TIME tStart);
- STDMETHODIMP Pause(void);
- STDMETHODIMP Stop(void);
-
- //CAMThread
- virtual DWORD ThreadProc(void);
-protected:
-
- HRESULT DataProcessLoop();
- DiracDecodeSourcePin* mDiracSourcePin;
- wstring mFileName;
- wstring mHDRFileName;
-
- dirac_decoder_t* mDecoder;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+#include "dsfDiracDecodeSource.h"
+
+#include <string>
+using namespace std;
+
+
+class DiracDecodeSourcePin;
+class DiracDecodeSourceFilter
+ : public CBaseFilter
+ , public IFileSourceFilter
+ , public IAMFilterMiscFlags
+ , public CAMThread
+{
+public:
+ enum eThreadCommands {
+ THREAD_EXIT = 0,
+ THREAD_PAUSE = 1,
+ THREAD_RUN = 2
+ };
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ DiracDecodeSourceFilter(void);
+ virtual ~DiracDecodeSourceFilter(void);
+
+ static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+
+ //IBaseFilter Pure Virtuals
+ virtual int GetPinCount();
+ virtual CBasePin* GetPin(int inPinNo);
+
+ //IAMFilterMiscFlags Interface
+ ULONG STDMETHODCALLTYPE GetMiscFlags(void);
+ //
+
+ //IFileSource Interface
+ virtual STDMETHODIMP GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType);
+ virtual STDMETHODIMP Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType);
+
+ //Streaming MEthods
+ STDMETHODIMP Run(REFERENCE_TIME tStart);
+ STDMETHODIMP Pause(void);
+ STDMETHODIMP Stop(void);
+
+ //CAMThread
+ virtual DWORD ThreadProc(void);
+protected:
+
+ HRESULT DataProcessLoop();
+ DiracDecodeSourcePin* mDiracSourcePin;
+ wstring mFileName;
+ wstring mHDRFileName;
+
+ dirac_decoder_t* mDecoder;
+};
Property changes on: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/DiracDecodeSourceFilter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/DiracDecodeSourcePin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/DiracDecodeSourcePin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/DiracDecodeSourcePin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,150 +1,150 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include ".\DiracDecodeSourcePin.h"
-
-DiracDecodeSourcePin::DiracDecodeSourcePin(DiracDecodeSourceFilter* inParentFilter, CCritSec* inFilterLock)
- : CBaseOutputPin(NAME("Dirac Video Source Pin"), inParentFilter, inFilterLock, &mFilterHR, L"Video Out")
-{
-}
-
-DiracDecodeSourcePin::~DiracDecodeSourcePin(void)
-{
-}
-
-STDMETHODIMP DiracDecodeSourcePin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
-
- return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
-}
-
-HRESULT DiracDecodeSourcePin::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
-{
-
- mDataQueue->NewSegment(tStart, tStop, dRate);
-
- return S_OK;
-}
-HRESULT DiracDecodeSourcePin::DeliverEndOfStream(void)
-{
-
- mDataQueue->EOS();
- return S_OK;
-}
-
-HRESULT DiracDecodeSourcePin::DeliverEndFlush(void)
-{
- mDataQueue->EndFlush();
- return S_OK;
-}
-
-HRESULT DiracDecodeSourcePin::DeliverBeginFlush(void)
-{
-
- mDataQueue->BeginFlush();
- return S_OK;
-}
-
-HRESULT DiracDecodeSourcePin::CompleteConnect (IPin *inReceivePin)
-{
- mFilterHR = S_OK;
- //Set the delegate for seeking
- //((BasicSeekable*)(inReceivePin))->SetDelegate(this);
- //This may cause issue if pins are disconnected and reconnected
- //DELETE in DEStructor
- mDataQueue = new COutputQueue (inReceivePin, &mFilterHR, FALSE, TRUE,1,TRUE, NUM_BUFFERS);
- if (FAILED(mFilterHR)) {
- mFilterHR = mFilterHR;
- }
-
- return CBaseOutputPin::CompleteConnect(inReceivePin);
-}
-
-HRESULT DiracDecodeSourcePin::BreakConnect(void) {
- delete mDataQueue;
- mDataQueue = NULL;
- return CBaseOutputPin::BreakConnect();
-}
-
- //CSourceStream virtuals
-HRESULT DiracDecodeSourcePin::GetMediaType(int inPosition, CMediaType* outMediaType) {
- //Put it in from the info we got in the constructor.
- //NOTE::: May have missed some fields ????
- //NOTE::: May want to check for null pointers
- //outMediaType->SetFormat(mMediaType->Format(), mMediaType->FormatLength());
- if (inPosition == 0) {
- CMediaType locMediaType;
-
- locMediaType.majortype = MEDIATYPE_Video;
- locMediaType.subtype = MEDIASUBTYPE_YV12;
- locMediaType.formattype = FORMAT_VideoInfo;
- locMediaType.cbFormat = sizeof(VIDEOINFOHEADER);
- locMediaType.pbFormat = NULL; //(BYTE*)mCMMLFormatBlock; //(BYTE*)locSpeexFormatInfo;
- locMediaType.pUnk = NULL;
- *outMediaType = locMediaType;
- return S_OK;
- } else {
- return VFW_S_NO_MORE_ITEMS;
- }
-}
-HRESULT DiracDecodeSourcePin::CheckMediaType(const CMediaType* inMediaType) {
- if ((inMediaType->majortype == MEDIATYPE_Video) && (inMediaType->subtype == MEDIASUBTYPE_YV12)) {
- return S_OK;
- } else {
- return E_FAIL;
- }
-}
-HRESULT DiracDecodeSourcePin::DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest) {
-
- HRESULT locHR = S_OK;
-
- ALLOCATOR_PROPERTIES locReqAlloc;
- ALLOCATOR_PROPERTIES locActualAlloc;
-
-
- locReqAlloc.cbAlign = 1;
- locReqAlloc.cbBuffer = BUFFER_SIZE;
- locReqAlloc.cbPrefix = 0;
- locReqAlloc.cBuffers = NUM_BUFFERS;
-
- locHR = inoutAllocator->SetProperties(&locReqAlloc, &locActualAlloc);
-
- if (locHR != S_OK) {
- return locHR;
- }
-
- locHR = inoutAllocator->Commit();
-
- return locHR;
-
-}
-
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include ".\DiracDecodeSourcePin.h"
+
+DiracDecodeSourcePin::DiracDecodeSourcePin(DiracDecodeSourceFilter* inParentFilter, CCritSec* inFilterLock)
+ : CBaseOutputPin(NAME("Dirac Video Source Pin"), inParentFilter, inFilterLock, &mFilterHR, L"Video Out")
+{
+}
+
+DiracDecodeSourcePin::~DiracDecodeSourcePin(void)
+{
+}
+
+STDMETHODIMP DiracDecodeSourcePin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+
+ return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
+}
+
+HRESULT DiracDecodeSourcePin::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
+{
+
+ mDataQueue->NewSegment(tStart, tStop, dRate);
+
+ return S_OK;
+}
+HRESULT DiracDecodeSourcePin::DeliverEndOfStream(void)
+{
+
+ mDataQueue->EOS();
+ return S_OK;
+}
+
+HRESULT DiracDecodeSourcePin::DeliverEndFlush(void)
+{
+ mDataQueue->EndFlush();
+ return S_OK;
+}
+
+HRESULT DiracDecodeSourcePin::DeliverBeginFlush(void)
+{
+
+ mDataQueue->BeginFlush();
+ return S_OK;
+}
+
+HRESULT DiracDecodeSourcePin::CompleteConnect (IPin *inReceivePin)
+{
+ mFilterHR = S_OK;
+ //Set the delegate for seeking
+ //((BasicSeekable*)(inReceivePin))->SetDelegate(this);
+ //This may cause issue if pins are disconnected and reconnected
+ //DELETE in DEStructor
+ mDataQueue = new COutputQueue (inReceivePin, &mFilterHR, FALSE, TRUE,1,TRUE, NUM_BUFFERS);
+ if (FAILED(mFilterHR)) {
+ mFilterHR = mFilterHR;
+ }
+
+ return CBaseOutputPin::CompleteConnect(inReceivePin);
+}
+
+HRESULT DiracDecodeSourcePin::BreakConnect(void) {
+ delete mDataQueue;
+ mDataQueue = NULL;
+ return CBaseOutputPin::BreakConnect();
+}
+
+ //CSourceStream virtuals
+HRESULT DiracDecodeSourcePin::GetMediaType(int inPosition, CMediaType* outMediaType) {
+ //Put it in from the info we got in the constructor.
+ //NOTE::: May have missed some fields ????
+ //NOTE::: May want to check for null pointers
+ //outMediaType->SetFormat(mMediaType->Format(), mMediaType->FormatLength());
+ if (inPosition == 0) {
+ CMediaType locMediaType;
+
+ locMediaType.majortype = MEDIATYPE_Video;
+ locMediaType.subtype = MEDIASUBTYPE_YV12;
+ locMediaType.formattype = FORMAT_VideoInfo;
+ locMediaType.cbFormat = sizeof(VIDEOINFOHEADER);
+ locMediaType.pbFormat = NULL; //(BYTE*)mCMMLFormatBlock; //(BYTE*)locSpeexFormatInfo;
+ locMediaType.pUnk = NULL;
+ *outMediaType = locMediaType;
+ return S_OK;
+ } else {
+ return VFW_S_NO_MORE_ITEMS;
+ }
+}
+HRESULT DiracDecodeSourcePin::CheckMediaType(const CMediaType* inMediaType) {
+ if ((inMediaType->majortype == MEDIATYPE_Video) && (inMediaType->subtype == MEDIASUBTYPE_YV12)) {
+ return S_OK;
+ } else {
+ return E_FAIL;
+ }
+}
+HRESULT DiracDecodeSourcePin::DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest) {
+
+ HRESULT locHR = S_OK;
+
+ ALLOCATOR_PROPERTIES locReqAlloc;
+ ALLOCATOR_PROPERTIES locActualAlloc;
+
+
+ locReqAlloc.cbAlign = 1;
+ locReqAlloc.cbBuffer = BUFFER_SIZE;
+ locReqAlloc.cbPrefix = 0;
+ locReqAlloc.cBuffers = NUM_BUFFERS;
+
+ locHR = inoutAllocator->SetProperties(&locReqAlloc, &locActualAlloc);
+
+ if (locHR != S_OK) {
+ return locHR;
+ }
+
+ locHR = inoutAllocator->Commit();
+
+ return locHR;
+
+}
+
+
Property changes on: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/DiracDecodeSourcePin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/DiracDecodeSourcePin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/DiracDecodeSourcePin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/DiracDecodeSourcePin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,70 +1,70 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "dsfDiracDecodeSource.h"
-#include "DiracDecodeSourceFilter.h"
-#include <fstream>
-using namespace std;
-class DiracDecodeSourcePin
- : public CBaseOutputPin
-{
-public:
-
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- DiracDecodeSourcePin( DiracDecodeSourceFilter* inParentFilter, CCritSec* inFilterLock);
-
- virtual ~DiracDecodeSourcePin(void);
-
- static const unsigned long BUFFER_SIZE = 65536; //What should this be ????
- static const unsigned long NUM_BUFFERS = 10;
-
- //CBaseOutputPin virtuals
- virtual HRESULT GetMediaType(int inPosition, CMediaType* outMediaType);
- virtual HRESULT CheckMediaType(const CMediaType* inMediaType);
- virtual HRESULT DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest);
-
-
- //IPin
- virtual HRESULT CompleteConnect (IPin *inReceivePin);
- virtual HRESULT BreakConnect(void);
- virtual HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
- virtual HRESULT DeliverEndOfStream(void);
- virtual HRESULT DeliverEndFlush(void);
- virtual HRESULT DeliverBeginFlush(void);
-protected:
- //fstream debugLog;
- HRESULT mFilterHR;
- COutputQueue* mDataQueue;
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "dsfDiracDecodeSource.h"
+#include "DiracDecodeSourceFilter.h"
+#include <fstream>
+using namespace std;
+class DiracDecodeSourcePin
+ : public CBaseOutputPin
+{
+public:
+
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ DiracDecodeSourcePin( DiracDecodeSourceFilter* inParentFilter, CCritSec* inFilterLock);
+
+ virtual ~DiracDecodeSourcePin(void);
+
+ static const unsigned long BUFFER_SIZE = 65536; //What should this be ????
+ static const unsigned long NUM_BUFFERS = 10;
+
+ //CBaseOutputPin virtuals
+ virtual HRESULT GetMediaType(int inPosition, CMediaType* outMediaType);
+ virtual HRESULT CheckMediaType(const CMediaType* inMediaType);
+ virtual HRESULT DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest);
+
+
+ //IPin
+ virtual HRESULT CompleteConnect (IPin *inReceivePin);
+ virtual HRESULT BreakConnect(void);
+ virtual HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
+ virtual HRESULT DeliverEndOfStream(void);
+ virtual HRESULT DeliverEndFlush(void);
+ virtual HRESULT DeliverBeginFlush(void);
+protected:
+ //fstream debugLog;
+ HRESULT mFilterHR;
+ COutputQueue* mDataQueue;
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/DiracDecodeSourcePin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/dsfDiracDecodeSource.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/dsfDiracDecodeSource.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/dsfDiracDecodeSource.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,118 +1,118 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-
-
-
-
-extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
-BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
-{
- return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
-}
-
-
-//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
-STDAPI DllRegisterServer()
-{
-
- ////TO DO::: Should we be releasing the filter mapper even when we return early ?
- // HRESULT hr;
- // IFilterMapper2* locFilterMapper = NULL;
- //
- // hr = AMovieDllRegisterServer2(TRUE);
- //if (FAILED(hr)) {
- //
- // return hr;
- //}
- //
- //
-
- // hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
-
- //
- //if (FAILED(hr)) {
- // return hr;
- //}
- //
- //hr = locFilterMapper->RegisterFilter(
- // CLSID_OggDemuxSourceFilter, // Filter CLSID.
- // L"Ogg Demux Source Filter", // Filter name.
- // NULL, // Device moniker.
- // &CLSID_LegacyAmFilterCategory, // Direct Show general category
- // L"Ogg Demux Source Filter", // Instance data. ???????
- // &OggDemuxSourceFilterReg // Pointer to filter information.
- // );
-
-
- ////Only call once... if you need multiple you have to fix the hack job in RegWrap !
- //RegWrap::addMediaPlayerDesc("Ogg File", "*.ogg;*.ogv;*.oga;*.spx");
-
-
-
-
-
- // locFilterMapper->Release();
-
- // return hr;
- return S_OK;
-}
-
-STDAPI DllUnregisterServer()
-{
- ////This is not a general purpose function.
- //RegWrap::removeMediaDesc();
-
- // HRESULT hr;
- // IFilterMapper2* locFilterMapper = NULL;
-
- // hr = AMovieDllRegisterServer2(FALSE);
- //if (FAILED(hr)) {
- //
- // return hr;
- //}
- //
- // hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
- // IID_IFilterMapper2, (void **)&locFilterMapper);
-
- //if (FAILED(hr)) {
- // return hr;
- //}
- //
-
- // hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory,
- // L"Ogg Demux Source Filter", CLSID_OggDemuxSourceFilter);
-
- ////
- // locFilterMapper->Release();
- // return hr;
- return S_OK;
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+
+
+
+
+extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
+BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+ return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
+}
+
+
+//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
+STDAPI DllRegisterServer()
+{
+
+ ////TO DO::: Should we be releasing the filter mapper even when we return early ?
+ // HRESULT hr;
+ // IFilterMapper2* locFilterMapper = NULL;
+ //
+ // hr = AMovieDllRegisterServer2(TRUE);
+ //if (FAILED(hr)) {
+ //
+ // return hr;
+ //}
+ //
+ //
+
+ // hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
+
+ //
+ //if (FAILED(hr)) {
+ // return hr;
+ //}
+ //
+ //hr = locFilterMapper->RegisterFilter(
+ // CLSID_OggDemuxSourceFilter, // Filter CLSID.
+ // L"Ogg Demux Source Filter", // Filter name.
+ // NULL, // Device moniker.
+ // &CLSID_LegacyAmFilterCategory, // Direct Show general category
+ // L"Ogg Demux Source Filter", // Instance data. ???????
+ // &OggDemuxSourceFilterReg // Pointer to filter information.
+ // );
+
+
+ ////Only call once... if you need multiple you have to fix the hack job in RegWrap !
+ //RegWrap::addMediaPlayerDesc("Ogg File", "*.ogg;*.ogv;*.oga;*.spx");
+
+
+
+
+
+ // locFilterMapper->Release();
+
+ // return hr;
+ return S_OK;
+}
+
+STDAPI DllUnregisterServer()
+{
+ ////This is not a general purpose function.
+ //RegWrap::removeMediaDesc();
+
+ // HRESULT hr;
+ // IFilterMapper2* locFilterMapper = NULL;
+
+ // hr = AMovieDllRegisterServer2(FALSE);
+ //if (FAILED(hr)) {
+ //
+ // return hr;
+ //}
+ //
+ // hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
+ // IID_IFilterMapper2, (void **)&locFilterMapper);
+
+ //if (FAILED(hr)) {
+ // return hr;
+ //}
+ //
+
+ // hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory,
+ // L"Ogg Demux Source Filter", CLSID_OggDemuxSourceFilter);
+
+ ////
+ // locFilterMapper->Release();
+ // return hr;
+ return S_OK;
+}
Property changes on: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/dsfDiracDecodeSource.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/dsfDiracDecodeSource.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/dsfDiracDecodeSource.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/dsfDiracDecodeSource.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,162 +1,162 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include <streams.h>
-#include <pullpin.h>
-#include <initguid.h>
-
-// {278EA0E1-B5B3-444d-92BA-9B90C801C9A9}
-DEFINE_GUID(CLSID_DiracDecodeSourceFilter,
-0x278ea0e1, 0xb5b3, 0x444d, 0x92, 0xba, 0x9b, 0x90, 0xc8, 0x1, 0xc9, 0xa9);
-
-
-//
-//
-//
-//#ifdef LIBOOOGG_EXPORTS
-//#define LIBOOOGG_API __declspec(dllexport)
-//#else
-//#define LIBOOOGG_API __declspec(dllimport)
-//#endif
-//
-//
-//#ifdef DSFOGGDEMUX_EXPORTS
-//#pragma message("----> Exporting from Ogg Demux...")
-//#define OGG_DEMUX_API __declspec(dllexport)
-//#else
-//#pragma message("<---- Importing from Ogg Demux...")
-//#define OGG_DEMUX_API __declspec(dllimport)
-//#endif
-//
-//
-//// {4BB64C4A-1674-436b-A49D-D6B3B64DBD60}
-//DEFINE_GUID(CLSID_PropsAbout,
-//0x4bb64c4a, 0x1674, 0x436b, 0xa4, 0x9d, 0xd6, 0xb3, 0xb6, 0x4d, 0xbd, 0x60);
-//
-////New section
-//// {31CA0186-1FF0-4181-AA38-3CA4040BD260}
-//DEFINE_GUID(CLSID_OggDemuxSourceFilter,
-//0x31ca0186, 0x1ff0, 0x4181, 0xaa, 0x38, 0x3c, 0xa4, 0x4, 0xb, 0xd2, 0x60);
-//
-//// {3913F0AB-E7ED-41c4-979B-1D1FDD983C07}
-//DEFINE_GUID(MEDIASUBTYPE_FLAC,
-//0x3913f0ab, 0xe7ed, 0x41c4, 0x97, 0x9b, 0x1d, 0x1f, 0xdd, 0x98, 0x3c, 0x7);
-//
-//
-//// {8A0566AC-42B3-4ad9-ACA3-93B906DDF98A}
-//DEFINE_GUID(MEDIASUBTYPE_Vorbis,
-//0x8a0566ac, 0x42b3, 0x4ad9, 0xac, 0xa3, 0x93, 0xb9, 0x6, 0xdd, 0xf9, 0x8a);
-//
-//// {25A9729D-12F6-420e-BD53-1D631DC217DF}
-//DEFINE_GUID(MEDIASUBTYPE_Speex,
-//0x25a9729d, 0x12f6, 0x420e, 0xbd, 0x53, 0x1d, 0x63, 0x1d, 0xc2, 0x17, 0xdf);
-//
-//// {44E04F43-58B3-4de1-9BAA-8901F852DAE4}
-//DEFINE_GUID(FORMAT_Vorbis,
-//0x44e04f43, 0x58b3, 0x4de1, 0x9b, 0xaa, 0x89, 0x1, 0xf8, 0x52, 0xda, 0xe4);
-//
-//// {78701A27-EFB5-4157-9553-38A7854E3E81}
-//DEFINE_GUID(FORMAT_Speex,
-//0x78701a27, 0xefb5, 0x4157, 0x95, 0x53, 0x38, 0xa7, 0x85, 0x4e, 0x3e, 0x81);
-//
-//// {1CDC48AC-4C24-4b8b-982B-7007A29D83C4}
-//DEFINE_GUID(FORMAT_FLAC,
-//0x1cdc48ac, 0x4c24, 0x4b8b, 0x98, 0x2b, 0x70, 0x7, 0xa2, 0x9d, 0x83, 0xc4);
-//
-//
-//// {05187161-5C36-4324-A734-22BF37509F2D}
-//DEFINE_GUID(CLSID_TheoraDecodeFilter,
-//0x5187161, 0x5c36, 0x4324, 0xa7, 0x34, 0x22, 0xbf, 0x37, 0x50, 0x9f, 0x2d);
-//
-//// {D124B2B1-8968-4ae8-B288-FE16EA34B0CE}
-//DEFINE_GUID(MEDIASUBTYPE_Theora,
-//0xd124b2b1, 0x8968, 0x4ae8, 0xb2, 0x88, 0xfe, 0x16, 0xea, 0x34, 0xb0, 0xce);
-//
-//// {A99F116C-DFFA-412c-95DE-725F99874826}
-//DEFINE_GUID(FORMAT_Theora,
-//0xa99f116c, 0xdffa, 0x412c, 0x95, 0xde, 0x72, 0x5f, 0x99, 0x87, 0x48, 0x26);
-//
-////This structure defines the type of input we accept on the input pin... Stream/Annodex
-//
-//
-////Structure defining the registration details of the filter
-//const REGFILTER2 OggDemuxSourceFilterReg = {
-// 1,
-// MERIT_NORMAL,
-// 0,
-// NULL
-//
-//};
-//
-//
-//struct sVorbisFormatBlock {
-// unsigned long vorbisVersion;
-// unsigned long samplesPerSec;
-// unsigned long minBitsPerSec;
-// unsigned long avgBitsPerSec;
-// unsigned long maxBitsPerSec;
-// unsigned char numChannels;
-//};
-//
-//struct sSpeexFormatBlock {
-// unsigned long speexVersion;
-// unsigned long samplesPerSec;
-// unsigned long minBitsPerSec;
-// unsigned long avgBitsPerSec;
-// unsigned long maxBitsPerSec;
-// unsigned long numChannels;
-//
-//};
-//
-//struct sFLACFormatBlock {
-// unsigned short numChannels;
-// unsigned long numBitsPerSample;
-// unsigned long sampleRate;
-//
-//};
-//
-//struct sTheoraFormatBlock {
-// unsigned long theoraVersion;
-// unsigned long width;
-// unsigned long height;
-// unsigned long frameWidth;
-// unsigned long frameHeight;
-// unsigned long frameRateNumerator;
-// unsigned long frameRateDenominator;
-// unsigned long aspectNumerator;
-// unsigned long aspectDenominator;
-// unsigned long maxKeyframeInterval;
-// unsigned long targetBitrate;
-// unsigned char targetQuality;
-// unsigned char xOffset;
-// unsigned char yOffset;
-// unsigned char colourSpace;
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+#include <streams.h>
+#include <pullpin.h>
+#include <initguid.h>
+
+// {278EA0E1-B5B3-444d-92BA-9B90C801C9A9}
+DEFINE_GUID(CLSID_DiracDecodeSourceFilter,
+0x278ea0e1, 0xb5b3, 0x444d, 0x92, 0xba, 0x9b, 0x90, 0xc8, 0x1, 0xc9, 0xa9);
+
+
+//
+//
+//
+//#ifdef LIBOOOGG_EXPORTS
+//#define LIBOOOGG_API __declspec(dllexport)
+//#else
+//#define LIBOOOGG_API __declspec(dllimport)
+//#endif
+//
+//
+//#ifdef DSFOGGDEMUX_EXPORTS
+//#pragma message("----> Exporting from Ogg Demux...")
+//#define OGG_DEMUX_API __declspec(dllexport)
+//#else
+//#pragma message("<---- Importing from Ogg Demux...")
+//#define OGG_DEMUX_API __declspec(dllimport)
+//#endif
+//
+//
+//// {4BB64C4A-1674-436b-A49D-D6B3B64DBD60}
+//DEFINE_GUID(CLSID_PropsAbout,
+//0x4bb64c4a, 0x1674, 0x436b, 0xa4, 0x9d, 0xd6, 0xb3, 0xb6, 0x4d, 0xbd, 0x60);
+//
+////New section
+//// {31CA0186-1FF0-4181-AA38-3CA4040BD260}
+//DEFINE_GUID(CLSID_OggDemuxSourceFilter,
+//0x31ca0186, 0x1ff0, 0x4181, 0xaa, 0x38, 0x3c, 0xa4, 0x4, 0xb, 0xd2, 0x60);
+//
+//// {3913F0AB-E7ED-41c4-979B-1D1FDD983C07}
+//DEFINE_GUID(MEDIASUBTYPE_FLAC,
+//0x3913f0ab, 0xe7ed, 0x41c4, 0x97, 0x9b, 0x1d, 0x1f, 0xdd, 0x98, 0x3c, 0x7);
+//
+//
+//// {8A0566AC-42B3-4ad9-ACA3-93B906DDF98A}
+//DEFINE_GUID(MEDIASUBTYPE_Vorbis,
+//0x8a0566ac, 0x42b3, 0x4ad9, 0xac, 0xa3, 0x93, 0xb9, 0x6, 0xdd, 0xf9, 0x8a);
+//
+//// {25A9729D-12F6-420e-BD53-1D631DC217DF}
+//DEFINE_GUID(MEDIASUBTYPE_Speex,
+//0x25a9729d, 0x12f6, 0x420e, 0xbd, 0x53, 0x1d, 0x63, 0x1d, 0xc2, 0x17, 0xdf);
+//
+//// {44E04F43-58B3-4de1-9BAA-8901F852DAE4}
+//DEFINE_GUID(FORMAT_Vorbis,
+//0x44e04f43, 0x58b3, 0x4de1, 0x9b, 0xaa, 0x89, 0x1, 0xf8, 0x52, 0xda, 0xe4);
+//
+//// {78701A27-EFB5-4157-9553-38A7854E3E81}
+//DEFINE_GUID(FORMAT_Speex,
+//0x78701a27, 0xefb5, 0x4157, 0x95, 0x53, 0x38, 0xa7, 0x85, 0x4e, 0x3e, 0x81);
+//
+//// {1CDC48AC-4C24-4b8b-982B-7007A29D83C4}
+//DEFINE_GUID(FORMAT_FLAC,
+//0x1cdc48ac, 0x4c24, 0x4b8b, 0x98, 0x2b, 0x70, 0x7, 0xa2, 0x9d, 0x83, 0xc4);
+//
+//
+//// {05187161-5C36-4324-A734-22BF37509F2D}
+//DEFINE_GUID(CLSID_TheoraDecodeFilter,
+//0x5187161, 0x5c36, 0x4324, 0xa7, 0x34, 0x22, 0xbf, 0x37, 0x50, 0x9f, 0x2d);
+//
+//// {D124B2B1-8968-4ae8-B288-FE16EA34B0CE}
+//DEFINE_GUID(MEDIASUBTYPE_Theora,
+//0xd124b2b1, 0x8968, 0x4ae8, 0xb2, 0x88, 0xfe, 0x16, 0xea, 0x34, 0xb0, 0xce);
+//
+//// {A99F116C-DFFA-412c-95DE-725F99874826}
+//DEFINE_GUID(FORMAT_Theora,
+//0xa99f116c, 0xdffa, 0x412c, 0x95, 0xde, 0x72, 0x5f, 0x99, 0x87, 0x48, 0x26);
+//
+////This structure defines the type of input we accept on the input pin... Stream/Annodex
+//
+//
+////Structure defining the registration details of the filter
+//const REGFILTER2 OggDemuxSourceFilterReg = {
+// 1,
+// MERIT_NORMAL,
+// 0,
+// NULL
+//
+//};
+//
+//
+//struct sVorbisFormatBlock {
+// unsigned long vorbisVersion;
+// unsigned long samplesPerSec;
+// unsigned long minBitsPerSec;
+// unsigned long avgBitsPerSec;
+// unsigned long maxBitsPerSec;
+// unsigned char numChannels;
+//};
+//
+//struct sSpeexFormatBlock {
+// unsigned long speexVersion;
+// unsigned long samplesPerSec;
+// unsigned long minBitsPerSec;
+// unsigned long avgBitsPerSec;
+// unsigned long maxBitsPerSec;
+// unsigned long numChannels;
+//
+//};
+//
+//struct sFLACFormatBlock {
+// unsigned short numChannels;
+// unsigned long numBitsPerSample;
+// unsigned long sampleRate;
+//
+//};
+//
+//struct sTheoraFormatBlock {
+// unsigned long theoraVersion;
+// unsigned long width;
+// unsigned long height;
+// unsigned long frameWidth;
+// unsigned long frameHeight;
+// unsigned long frameRateNumerator;
+// unsigned long frameRateDenominator;
+// unsigned long aspectNumerator;
+// unsigned long aspectDenominator;
+// unsigned long maxKeyframeInterval;
+// unsigned long targetBitrate;
+// unsigned char targetQuality;
+// unsigned char xOffset;
+// unsigned char yOffset;
+// unsigned char colourSpace;
//};
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/dsfDiracDecodeSource.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// dsfDiracDecodeSource.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// dsfDiracDecodeSource.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,15 +1,15 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-// TODO: reference additional headers your program requires here
-#include "DiracDecodeSourcePin.h"
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+// TODO: reference additional headers your program requires here
+#include "DiracDecodeSourcePin.h"
#include "DiracDecodeSourceFilter.h"
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracDecodeSource/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeFilter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeFilter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,92 +1,92 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "Diracencodefilter.h"
-
-
-//COM Factory Template
-CFactoryTemplate g_Templates[] =
-{
- {
- L"Dirac Encode Filter", // Name
- &CLSID_DiracEncodeFilter, // CLSID
- DiracEncodeFilter::CreateInstance, // Method to create an instance of MyComponent
- NULL, // Initialization function
- NULL // Set-up information (for filters)
- }
-
-
-};
-
-// Generic way of determining the number of items in the template
-int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
-
-CUnknown* WINAPI DiracEncodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
-{
- //This routine is the COM implementation to create a new Filter
- DiracEncodeFilter *pNewObject = new DiracEncodeFilter();
- if (pNewObject == NULL) {
- *pHr = E_OUTOFMEMORY;
- }
- return pNewObject;
-}
-STDMETHODIMP DiracEncodeFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
-
-
-
- return AbstractVideoEncodeFilter::NonDelegatingQueryInterface(riid, ppv);
-}
-
-DiracEncodeFilter::DiracEncodeFilter(void)
- : AbstractVideoEncodeFilter(NAME("Dirac Encoder"), CLSID_DiracEncodeFilter, AbstractVideoEncodeFilter::DIRAC)
-{
- bool locWasConstructed = ConstructPins();
-}
-
-DiracEncodeFilter::~DiracEncodeFilter(void)
-{
-}
-
-bool DiracEncodeFilter::ConstructPins()
-{
-
- CMediaType* locOutputMediaType = new CMediaType(&MEDIATYPE_Video);
- locOutputMediaType->subtype = MEDIASUBTYPE_Dirac;
- locOutputMediaType->formattype = FORMAT_Dirac;
- //Output pin must be done first because it's passed to the input pin.
- mOutputPin = new DiracEncodeOutputPin(this, m_pLock, locOutputMediaType);
-
-
- mInputPin = new DiracEncodeInputPin(this, m_pLock, mOutputPin);
- return true;
-}
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "Diracencodefilter.h"
+
+
+//COM Factory Template
+CFactoryTemplate g_Templates[] =
+{
+ {
+ L"Dirac Encode Filter", // Name
+ &CLSID_DiracEncodeFilter, // CLSID
+ DiracEncodeFilter::CreateInstance, // Method to create an instance of MyComponent
+ NULL, // Initialization function
+ NULL // Set-up information (for filters)
+ }
+
+
+};
+
+// Generic way of determining the number of items in the template
+int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
+
+CUnknown* WINAPI DiracEncodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
+{
+ //This routine is the COM implementation to create a new Filter
+ DiracEncodeFilter *pNewObject = new DiracEncodeFilter();
+ if (pNewObject == NULL) {
+ *pHr = E_OUTOFMEMORY;
+ }
+ return pNewObject;
+}
+STDMETHODIMP DiracEncodeFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
+
+
+
+ return AbstractVideoEncodeFilter::NonDelegatingQueryInterface(riid, ppv);
+}
+
+DiracEncodeFilter::DiracEncodeFilter(void)
+ : AbstractVideoEncodeFilter(NAME("Dirac Encoder"), CLSID_DiracEncodeFilter, AbstractVideoEncodeFilter::DIRAC)
+{
+ bool locWasConstructed = ConstructPins();
+}
+
+DiracEncodeFilter::~DiracEncodeFilter(void)
+{
+}
+
+bool DiracEncodeFilter::ConstructPins()
+{
+
+ CMediaType* locOutputMediaType = new CMediaType(&MEDIATYPE_Video);
+ locOutputMediaType->subtype = MEDIASUBTYPE_Dirac;
+ locOutputMediaType->formattype = FORMAT_Dirac;
+ //Output pin must be done first because it's passed to the input pin.
+ mOutputPin = new DiracEncodeOutputPin(this, m_pLock, locOutputMediaType);
+
+
+ mInputPin = new DiracEncodeInputPin(this, m_pLock, mOutputPin);
+ return true;
+}
+
Property changes on: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeFilter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeFilter.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeFilter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeFilter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,80 +1,80 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-#include "dsfDiracEncodeFilter.h"
-//#include "AbstractVideoEncodeFilter.h"
-
-//Forward Declarations
-
-class DiracEncodeInputPin;
-class DiracEncodeOutputPin;
-
-class DiracEncodeFilter
- //Base classes
- : public AbstractVideoEncodeFilter
-{
-public:
- //Friends classes
- friend class DiracEncodeInputPin;
- friend class DiracEncodeOutputPin;
-
- //Constructors and Destructors
- DiracEncodeFilter(void);
- virtual ~DiracEncodeFilter(void);
-
- //COM Functions
- DECLARE_IUNKNOWN
- static CUnknown* WINAPI DiracEncodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- ////IDiracEncodeSettings Implementation
- //STDMETHODIMP_(unsigned long) targetBitrate();
- //STDMETHODIMP_(unsigned char) quality();
- //STDMETHODIMP_(unsigned long) keyframeFreq();
-
- //STDMETHODIMP_(bool) setTargetBitrate(unsigned long inBitrate);
- //STDMETHODIMP_(bool) setQuality(unsigned char inQuality);
- //STDMETHODIMP_(bool) setKeyframeFreq(unsigned long inKeyframeFreq);
- ////
-
- //AbstractVideoEncodeFilter pure virtuals
- virtual bool ConstructPins();
-
- //SpecifyPropertyPages Implementation
- //STDMETHODIMP DiracEncodeFilter::GetPages(CAUUID* outPropPages);
-
-protected:
- //Member data
- sDiracFormatBlock mDiracFormatBlock;
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+#include "dsfDiracEncodeFilter.h"
+//#include "AbstractVideoEncodeFilter.h"
+
+//Forward Declarations
+
+class DiracEncodeInputPin;
+class DiracEncodeOutputPin;
+
+class DiracEncodeFilter
+ //Base classes
+ : public AbstractVideoEncodeFilter
+{
+public:
+ //Friends classes
+ friend class DiracEncodeInputPin;
+ friend class DiracEncodeOutputPin;
+
+ //Constructors and Destructors
+ DiracEncodeFilter(void);
+ virtual ~DiracEncodeFilter(void);
+
+ //COM Functions
+ DECLARE_IUNKNOWN
+ static CUnknown* WINAPI DiracEncodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ ////IDiracEncodeSettings Implementation
+ //STDMETHODIMP_(unsigned long) targetBitrate();
+ //STDMETHODIMP_(unsigned char) quality();
+ //STDMETHODIMP_(unsigned long) keyframeFreq();
+
+ //STDMETHODIMP_(bool) setTargetBitrate(unsigned long inBitrate);
+ //STDMETHODIMP_(bool) setQuality(unsigned char inQuality);
+ //STDMETHODIMP_(bool) setKeyframeFreq(unsigned long inKeyframeFreq);
+ ////
+
+ //AbstractVideoEncodeFilter pure virtuals
+ virtual bool ConstructPins();
+
+ //SpecifyPropertyPages Implementation
+ //STDMETHODIMP DiracEncodeFilter::GetPages(CAUUID* outPropPages);
+
+protected:
+ //Member data
+ sDiracFormatBlock mDiracFormatBlock;
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeFilter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeInputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeInputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,396 +1,396 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "diracencodeinputpin.h"
-
-DiracEncodeInputPin::DiracEncodeInputPin(AbstractVideoEncodeFilter* inParentFilter, CCritSec* inFilterLock, AbstractVideoEncodeOutputPin* inOutputPin)
- : AbstractVideoEncodeInputPin(inParentFilter, inFilterLock, inOutputPin, NAME("DiracEncodeInputPin"), L"YV12 In")
- , mXOffset(0)
- , mYOffset(0)
-
-
-{
- //debugLog.open("g:\\logs\\theoencfiltinput.log", ios_base::out);
-
-
-}
-
-DiracEncodeInputPin::~DiracEncodeInputPin(void)
-{
- //debugLog.close();
- DestroyCodec();
-
-
-}
-
-
-HRESULT DiracEncodeInputPin::deliverData(LONGLONG inStart, LONGLONG inEnd, unsigned char* inBuf, unsigned long inNumBytes) {
- //debugLog <<" deliverData : "<<inStart<<" - "<<inEnd<<" :: size = "<<inNumBytes<<endl;
- //Get a pointer to a new sample stamped with our time
- IMediaSample* locSample;
- HRESULT locHR = mOutputPin->GetDeliveryBuffer(&locSample, &inStart, &inEnd, NULL);
-
- if (locHR != S_OK) {
- //We get here when the application goes into stop mode usually.
- return locHR;
- }
-
- BYTE* locBuffer = NULL;
-
-
- //Make our pointers set to point to the samples buffer
- locSample->GetPointer(&locBuffer);
-
- if (locSample->GetSize() >= inNumBytes) {
-
- memcpy((void*)locBuffer, (const void*)inBuf, inNumBytes);
-
- //Set the sample parameters.
- SetSampleParams(locSample, inNumBytes, &inStart, &inEnd);
-
- {
- CAutoLock locLock(m_pLock);
-
- HRESULT locHR = mOutputPin->mDataQueue->Receive(locSample); //->DownstreamFilter()->Receive(locSample);
- if (locHR != S_OK) {
- return locHR;
- } else {
- }
- }
- //debugLog<<"deliverData : SUCCESS"<<endl;
- return S_OK;
- } else {
- //debugLog<<"Buffer too small !!!! FATALITY !"<<endl;
- throw 0;
- }
-
-}
-
-long DiracEncodeInputPin::encodeYV12ToYV12(unsigned char* inBuf, long inNumBytes) {
- ////Source Buffer all in one buffer
-
- ////YV12 memory layout for directshow
- ////=================================
- ////YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
- ////YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
- ////YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
- ////YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
- ////VVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVV
- ////UUUUUUUUUUUUUUUUUUUUUUUU UUUUUUUUUUUUUUUUUUUUUUUU
-
-
- ////Destination buffer Y, U, V in seperate planes, lowercase are line padding, "." height padding
- ////.............................. ..............................
- ////.............................. ..............................
- ////yyyyyyYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYyyyyyy
- ////yyyyyyYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYyyyyyy
- ////yyyyyyYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYyyyyyy
- ////yyyyyyYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYyyyyyy
- ////.............................. ..............................
- ////.............................. ..............................
-
- ////.............................. ..............................
- ////vvvVVVVVVVVVVVVVVVVVVVVVVVVvvv vvvVVVVVVVVVVVVVVVVVVVVVVVVvvv
- ////.............................. ..............................
- //
- ////.............................. ..............................
- ////uuuUUUUUUUUUUUUUUUUUUUUUUUUuuu uuuUUUUUUUUUUUUUUUUUUUUUUUUuuu
- ////.............................. ..............................
-
- ////NOTE : mHeight, mWidth are the actual video sizes and are the sizes of the incoming buffer
- //// The yuv width, height parameters are a /16 up rounded size of the output buffer to be sent to libDirac
-
-
- ////Setup the source pointer
- //unsigned char* locSourceUptoPtr = inBuf; //View only... don't delete locUptoPtr
- ////
- //
- ////========
- ////Y DATA |
- ////=========================================================================================================
-
- ////Setup the destination pointer
- //char* locDestUptoPtr = mYUV.y;
- ////
-
- ////Pad top of Y plane buffer with mYOffset lines of width mYUV.y_width
- //if (mYOffset != 0) {
- // memset((void*)locDestUptoPtr, NULL, mYOffset * mYUV.y_width); //Is it needed to zero this out ? Or just leave junk ?
- // locDestUptoPtr += (mYOffset * mYUV.y_width);
- //}
- ////Source pointer does not advance
- ////
-
- ////Add mHeight lines of data of width mWidth plus padding of mXOffset at each end
- //if (mXOffset == 0) {
- // //Slight optimisation to keep the inner loop tighter
- // for (long line = 0; line < mHeight; line++) {
- // memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth);
- // locSourceUptoPtr += mWidth;
- // locDestUptoPtr += mWidth;
- // }
- //} else {
- // for (long line = 0; line < mHeight; line++) {
- // //Pad the start of the line with mXOffset bytes
- // memset((void*)locDestUptoPtr, NULL, mXOffset);
- // locDestUptoPtr += mXOffset;
-
- // //Fill in the meaty bit
- // memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth);
- // locSourceUptoPtr += mWidth;
- // locDestUptoPtr += mWidth;
-
- // //Pad the end of the line with mXOffset bytes
- // memset((void*)locDestUptoPtr, NULL, mXOffset);
- // locDestUptoPtr += mXOffset;
- // }
-
- //}
-
- ////Pad bottom of Y plane buffer with mYOffset lines of width mYUV.y_width
- //if (mYOffset != 0) {
- // memset((void*)locDestUptoPtr, NULL, mYOffset * mYUV.y_width); //Is it needed to zero this out ? Or just leave junk ?
- // locDestUptoPtr += (mYOffset * mYUV.y_width);
- // //Source pointer does not advance
- //}
- //
-
-
- ////========
- ////V DATA |
- ////=========================================================================================================
-
- ////Set the destination poitner
- //locDestUptoPtr = mYUV.v;
- ////
-
- ////Pad top of V plane buffer with mYOffset/2 lines of width mYUV.uv_width
- //if (mYOffset != 0) {
- // memset((void*)locDestUptoPtr, NULL, (mYOffset * mYUV.uv_width) / 2); //Is it needed to zero this out ? Or just leave junk ?
- // locDestUptoPtr += ((mYOffset * mYUV.uv_width) / 2);
- // //Source pointer does not advance
- //}
- ////
-
- ////Add mHeight/2 lines of data of length mWidth/2 plus padded by mXOffset/2 at each end
- //if (mXOffset == 0) {
- // //Slight optimisation to keep the inner loop tighter
- // for (long line = 0; line < mHeight / 2; line++) {
- // memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth / 2);
- // locSourceUptoPtr += (mWidth / 2);
- // locDestUptoPtr += (mWidth / 2);
- // }
- //} else {
- // for (long line = 0; line < mHeight / 2; line++) {
- // //Pad the start of the line
- // memset((void*)locDestUptoPtr, NULL, mXOffset / 2);
- // locDestUptoPtr += (mXOffset / 2);
- // //Source pointer does not advance
-
- // //Fill in the meaty bit
- // memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth / 2);
- // locSourceUptoPtr += (mWidth / 2);
- // locDestUptoPtr += (mWidth / 2);
-
- // //Pad the end of the line
- // memset((void*)locDestUptoPtr, NULL, mXOffset / 2);
- // locDestUptoPtr += (mXOffset / 2);
- // //Source pointer does not advance
- // }
-
- //}
-
- ////Pad bottom of V plane buffer with mYOffset / 2 lines of width mYUV.uv_width
- //if (mYOffset != 0) {
- // memset((void*)locDestUptoPtr, NULL, (mYOffset * mYUV.uv_width) / 2); //Is it needed to zero this out ? Or just leave junk ?
- // locDestUptoPtr += ((mYOffset * mYUV.uv_width) / 2);
- // //Source pointer does not advance
- //}
- //
-
-
-
-
- ////========
- ////U DATA |
- ////=========================================================================================================
-
- ////Set the destination pointer
- //locDestUptoPtr = mYUV.u;
- ////
-
- ////Pad top of U plane buffer with mYOffset/2 lines of width mYUV.uv_width
- //if (mYOffset != 0) {
- // memset((void*)locDestUptoPtr, NULL, (mYOffset * mYUV.uv_width) / 2); //Is it needed to zero this out ? Or just leave junk ?
- // locDestUptoPtr += ((mYOffset * mYUV.uv_width) / 2);
- // //Source pointer does not advance
- //}
- ////
-
- ////Add mHeight/2 lines of data of length mWidth/2 plus padded by mXOffset/2 at each end
- //if (mXOffset == 0) {
- // //Slight optimisation to keep the inner loop tighter
- // for (long line = 0; line < mHeight / 2; line++) {
- // memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth / 2);
- // locSourceUptoPtr += (mWidth / 2);
- // locDestUptoPtr += (mWidth / 2);
- // }
- //} else {
- // for (long line = 0; line < mHeight / 2; line++) {
- // //Pad the start of the line
- // memset((void*)locDestUptoPtr, NULL, mXOffset / 2);
- // locDestUptoPtr += (mXOffset / 2);
- // //Source pointer does not advance
-
- // //Fill in the meaty bit
- // memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth / 2);
- // locSourceUptoPtr += (mWidth / 2);
- // locDestUptoPtr += (mWidth / 2);
-
- // //Pad the end of the line
- // memset((void*)locDestUptoPtr, NULL, mXOffset / 2);
- // locDestUptoPtr += (mXOffset / 2);
- // //Source pointer does not advance
- // }
-
- //}
-
- ////Pad bottom of U plane buffer with mYOffset / 2 lines of width mYUV.uv_width
- //if (mYOffset != 0) {
- // memset((void*)locDestUptoPtr, NULL, (mYOffset * mYUV.uv_width) / 2); //Is it needed to zero this out ? Or just leave junk ?
- // locDestUptoPtr += ((mYOffset * mYUV.uv_width) / 2);
- // //Source pointer does not advance
- //}
-
- ////======================================================================================================
- return 0;
-
-}
-
-//-------------------------------------------------------------------------
-
-
-
-
-
-//PURE VIRTUALS
-long DiracEncodeInputPin::encodeData(unsigned char* inBuf, long inNumBytes) {
-
- //TODO::: Break this function up a bit !!
-
- //Time stamps are granule pos not directshow times
- //debugLog<<"Encode data"<<endl;
-
-
- LONGLONG locFrameStart = mUptoFrame;
- LONGLONG locFrameEnd = 0;
- HRESULT locHR = S_OK;
- if (!mBegun) {
- //debugLog<<"encodeData : First time"<<endl;
- //mBegun = true;
- //
- //StampedOggPacket** locHeaders;
- //locHeaders = mTheoraEncoder.initCodec(mTheoraInfo);
-
- //for (int i = 0; i < 3; i++) {
- // locHR = deliverData(0,0,locHeaders[i]->packetData(), locHeaders[i]->packetSize());
- // if (locHR != S_OK) {
- // return locHR;
- // }
- //}
- }
-
- if (mPinInputType.subtype == MEDIASUBTYPE_YV12) {
-
- encodeYV12ToYV12(inBuf, inNumBytes);
-
-
-
-
- //} else if (mPinInputType.subtype == MEDIASUBTYPE_AYUV) {
- // encodeAYUVtoYV12(inBuf, inNumBytes);
-
- //} else if (mPinInputType.subtype == MEDIASUBTYPE_RGB32) {
- // encodeRGB32toYV12(inBuf, inNumBytes);
-
- //} else if (mPinInputType.subtype == MEDIASUBTYPE_RGB24) {
- // encodeRGB24toYV12(inBuf, inNumBytes);
-
-
- //} else if (mPinInputType.subtype == MEDIASUBTYPE_YV12) {
- // //Should be more specifc.
- // //debugLog<<"About to encode YV12 to YV12"<<endl;
- // encodeYV12ToYV12(inBuf, inNumBytes);
- //} else if (mPinInputType.subtype == MEDIASUBTYPE_UYVY) {
- //
- //
- // encodeUYVYToYV12(inBuf, inNumBytes);
-
- //} else if (mPinInputType.subtype == MEDIASUBTYPE_YVYU) {
- //
- //
- // encodeYVYUToYV12(inBuf, inNumBytes);
- //} else if (mPinInputType.subtype == MEDIASUBTYPE_IYUV) {
- //
- //
- // encodeIYUVToYV12(inBuf, inNumBytes);
-
-
- } else {
-
- //FATAL ERROR
- throw 0;
- }
-
-
- //StampedOggPacket* locPacket = mTheoraEncoder.encodeTheora(&mYUV);
- //if (locPacket == NULL) {
- // //debugLog<<"Encode returns NULL"<<endl;
- // return S_FALSE;
- //}
- //locFrameEnd = mUptoFrame
- // = locPacket->endTime();
- //debugLog<<"Delivering..."<<endl;
-
-
-
-
-
- //return deliverData(locFrameStart, locFrameEnd, locPacket->packetData(), locPacket->packetSize());
-
-}
-bool DiracEncodeInputPin::ConstructCodec() {
-
- //debugLog<<"Contructing codec..."<<endl;
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "diracencodeinputpin.h"
+
+DiracEncodeInputPin::DiracEncodeInputPin(AbstractVideoEncodeFilter* inParentFilter, CCritSec* inFilterLock, AbstractVideoEncodeOutputPin* inOutputPin)
+ : AbstractVideoEncodeInputPin(inParentFilter, inFilterLock, inOutputPin, NAME("DiracEncodeInputPin"), L"YV12 In")
+ , mXOffset(0)
+ , mYOffset(0)
+
+
+{
+ //debugLog.open("g:\\logs\\theoencfiltinput.log", ios_base::out);
+
+
+}
+
+DiracEncodeInputPin::~DiracEncodeInputPin(void)
+{
+ //debugLog.close();
+ DestroyCodec();
+
+
+}
+
+
+HRESULT DiracEncodeInputPin::deliverData(LONGLONG inStart, LONGLONG inEnd, unsigned char* inBuf, unsigned long inNumBytes) {
+ //debugLog <<" deliverData : "<<inStart<<" - "<<inEnd<<" :: size = "<<inNumBytes<<endl;
+ //Get a pointer to a new sample stamped with our time
+ IMediaSample* locSample;
+ HRESULT locHR = mOutputPin->GetDeliveryBuffer(&locSample, &inStart, &inEnd, NULL);
+
+ if (locHR != S_OK) {
+ //We get here when the application goes into stop mode usually.
+ return locHR;
+ }
+
+ BYTE* locBuffer = NULL;
+
+
+ //Make our pointers set to point to the samples buffer
+ locSample->GetPointer(&locBuffer);
+
+ if (locSample->GetSize() >= inNumBytes) {
+
+ memcpy((void*)locBuffer, (const void*)inBuf, inNumBytes);
+
+ //Set the sample parameters.
+ SetSampleParams(locSample, inNumBytes, &inStart, &inEnd);
+
+ {
+ CAutoLock locLock(m_pLock);
+
+ HRESULT locHR = mOutputPin->mDataQueue->Receive(locSample); //->DownstreamFilter()->Receive(locSample);
+ if (locHR != S_OK) {
+ return locHR;
+ } else {
+ }
+ }
+ //debugLog<<"deliverData : SUCCESS"<<endl;
+ return S_OK;
+ } else {
+ //debugLog<<"Buffer too small !!!! FATALITY !"<<endl;
+ throw 0;
+ }
+
+}
+
+long DiracEncodeInputPin::encodeYV12ToYV12(unsigned char* inBuf, long inNumBytes) {
+ ////Source Buffer all in one buffer
+
+ ////YV12 memory layout for directshow
+ ////=================================
+ ////YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
+ ////YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
+ ////YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
+ ////YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
+ ////VVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVV
+ ////UUUUUUUUUUUUUUUUUUUUUUUU UUUUUUUUUUUUUUUUUUUUUUUU
+
+
+ ////Destination buffer Y, U, V in seperate planes, lowercase are line padding, "." height padding
+ ////.............................. ..............................
+ ////.............................. ..............................
+ ////yyyyyyYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYyyyyyy
+ ////yyyyyyYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYyyyyyy
+ ////yyyyyyYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYyyyyyy
+ ////yyyyyyYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYyyyyyy
+ ////.............................. ..............................
+ ////.............................. ..............................
+
+ ////.............................. ..............................
+ ////vvvVVVVVVVVVVVVVVVVVVVVVVVVvvv vvvVVVVVVVVVVVVVVVVVVVVVVVVvvv
+ ////.............................. ..............................
+ //
+ ////.............................. ..............................
+ ////uuuUUUUUUUUUUUUUUUUUUUUUUUUuuu uuuUUUUUUUUUUUUUUUUUUUUUUUUuuu
+ ////.............................. ..............................
+
+ ////NOTE : mHeight, mWidth are the actual video sizes and are the sizes of the incoming buffer
+ //// The yuv width, height parameters are a /16 up rounded size of the output buffer to be sent to libDirac
+
+
+ ////Setup the source pointer
+ //unsigned char* locSourceUptoPtr = inBuf; //View only... don't delete locUptoPtr
+ ////
+ //
+ ////========
+ ////Y DATA |
+ ////=========================================================================================================
+
+ ////Setup the destination pointer
+ //char* locDestUptoPtr = mYUV.y;
+ ////
+
+ ////Pad top of Y plane buffer with mYOffset lines of width mYUV.y_width
+ //if (mYOffset != 0) {
+ // memset((void*)locDestUptoPtr, NULL, mYOffset * mYUV.y_width); //Is it needed to zero this out ? Or just leave junk ?
+ // locDestUptoPtr += (mYOffset * mYUV.y_width);
+ //}
+ ////Source pointer does not advance
+ ////
+
+ ////Add mHeight lines of data of width mWidth plus padding of mXOffset at each end
+ //if (mXOffset == 0) {
+ // //Slight optimisation to keep the inner loop tighter
+ // for (long line = 0; line < mHeight; line++) {
+ // memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth);
+ // locSourceUptoPtr += mWidth;
+ // locDestUptoPtr += mWidth;
+ // }
+ //} else {
+ // for (long line = 0; line < mHeight; line++) {
+ // //Pad the start of the line with mXOffset bytes
+ // memset((void*)locDestUptoPtr, NULL, mXOffset);
+ // locDestUptoPtr += mXOffset;
+
+ // //Fill in the meaty bit
+ // memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth);
+ // locSourceUptoPtr += mWidth;
+ // locDestUptoPtr += mWidth;
+
+ // //Pad the end of the line with mXOffset bytes
+ // memset((void*)locDestUptoPtr, NULL, mXOffset);
+ // locDestUptoPtr += mXOffset;
+ // }
+
+ //}
+
+ ////Pad bottom of Y plane buffer with mYOffset lines of width mYUV.y_width
+ //if (mYOffset != 0) {
+ // memset((void*)locDestUptoPtr, NULL, mYOffset * mYUV.y_width); //Is it needed to zero this out ? Or just leave junk ?
+ // locDestUptoPtr += (mYOffset * mYUV.y_width);
+ // //Source pointer does not advance
+ //}
+ //
+
+
+ ////========
+ ////V DATA |
+ ////=========================================================================================================
+
+ ////Set the destination poitner
+ //locDestUptoPtr = mYUV.v;
+ ////
+
+ ////Pad top of V plane buffer with mYOffset/2 lines of width mYUV.uv_width
+ //if (mYOffset != 0) {
+ // memset((void*)locDestUptoPtr, NULL, (mYOffset * mYUV.uv_width) / 2); //Is it needed to zero this out ? Or just leave junk ?
+ // locDestUptoPtr += ((mYOffset * mYUV.uv_width) / 2);
+ // //Source pointer does not advance
+ //}
+ ////
+
+ ////Add mHeight/2 lines of data of length mWidth/2 plus padded by mXOffset/2 at each end
+ //if (mXOffset == 0) {
+ // //Slight optimisation to keep the inner loop tighter
+ // for (long line = 0; line < mHeight / 2; line++) {
+ // memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth / 2);
+ // locSourceUptoPtr += (mWidth / 2);
+ // locDestUptoPtr += (mWidth / 2);
+ // }
+ //} else {
+ // for (long line = 0; line < mHeight / 2; line++) {
+ // //Pad the start of the line
+ // memset((void*)locDestUptoPtr, NULL, mXOffset / 2);
+ // locDestUptoPtr += (mXOffset / 2);
+ // //Source pointer does not advance
+
+ // //Fill in the meaty bit
+ // memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth / 2);
+ // locSourceUptoPtr += (mWidth / 2);
+ // locDestUptoPtr += (mWidth / 2);
+
+ // //Pad the end of the line
+ // memset((void*)locDestUptoPtr, NULL, mXOffset / 2);
+ // locDestUptoPtr += (mXOffset / 2);
+ // //Source pointer does not advance
+ // }
+
+ //}
+
+ ////Pad bottom of V plane buffer with mYOffset / 2 lines of width mYUV.uv_width
+ //if (mYOffset != 0) {
+ // memset((void*)locDestUptoPtr, NULL, (mYOffset * mYUV.uv_width) / 2); //Is it needed to zero this out ? Or just leave junk ?
+ // locDestUptoPtr += ((mYOffset * mYUV.uv_width) / 2);
+ // //Source pointer does not advance
+ //}
+ //
+
+
+
+
+ ////========
+ ////U DATA |
+ ////=========================================================================================================
+
+ ////Set the destination pointer
+ //locDestUptoPtr = mYUV.u;
+ ////
+
+ ////Pad top of U plane buffer with mYOffset/2 lines of width mYUV.uv_width
+ //if (mYOffset != 0) {
+ // memset((void*)locDestUptoPtr, NULL, (mYOffset * mYUV.uv_width) / 2); //Is it needed to zero this out ? Or just leave junk ?
+ // locDestUptoPtr += ((mYOffset * mYUV.uv_width) / 2);
+ // //Source pointer does not advance
+ //}
+ ////
+
+ ////Add mHeight/2 lines of data of length mWidth/2 plus padded by mXOffset/2 at each end
+ //if (mXOffset == 0) {
+ // //Slight optimisation to keep the inner loop tighter
+ // for (long line = 0; line < mHeight / 2; line++) {
+ // memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth / 2);
+ // locSourceUptoPtr += (mWidth / 2);
+ // locDestUptoPtr += (mWidth / 2);
+ // }
+ //} else {
+ // for (long line = 0; line < mHeight / 2; line++) {
+ // //Pad the start of the line
+ // memset((void*)locDestUptoPtr, NULL, mXOffset / 2);
+ // locDestUptoPtr += (mXOffset / 2);
+ // //Source pointer does not advance
+
+ // //Fill in the meaty bit
+ // memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth / 2);
+ // locSourceUptoPtr += (mWidth / 2);
+ // locDestUptoPtr += (mWidth / 2);
+
+ // //Pad the end of the line
+ // memset((void*)locDestUptoPtr, NULL, mXOffset / 2);
+ // locDestUptoPtr += (mXOffset / 2);
+ // //Source pointer does not advance
+ // }
+
+ //}
+
+ ////Pad bottom of U plane buffer with mYOffset / 2 lines of width mYUV.uv_width
+ //if (mYOffset != 0) {
+ // memset((void*)locDestUptoPtr, NULL, (mYOffset * mYUV.uv_width) / 2); //Is it needed to zero this out ? Or just leave junk ?
+ // locDestUptoPtr += ((mYOffset * mYUV.uv_width) / 2);
+ // //Source pointer does not advance
+ //}
+
+ ////======================================================================================================
+ return 0;
+
+}
+
+//-------------------------------------------------------------------------
+
+
+
+
+
+//PURE VIRTUALS
+long DiracEncodeInputPin::encodeData(unsigned char* inBuf, long inNumBytes) {
+
+ //TODO::: Break this function up a bit !!
+
+ //Time stamps are granule pos not directshow times
+ //debugLog<<"Encode data"<<endl;
+
+
+ LONGLONG locFrameStart = mUptoFrame;
+ LONGLONG locFrameEnd = 0;
+ HRESULT locHR = S_OK;
+ if (!mBegun) {
+ //debugLog<<"encodeData : First time"<<endl;
+ //mBegun = true;
+ //
+ //StampedOggPacket** locHeaders;
+ //locHeaders = mTheoraEncoder.initCodec(mTheoraInfo);
+
+ //for (int i = 0; i < 3; i++) {
+ // locHR = deliverData(0,0,locHeaders[i]->packetData(), locHeaders[i]->packetSize());
+ // if (locHR != S_OK) {
+ // return locHR;
+ // }
+ //}
+ }
+
+ if (mPinInputType.subtype == MEDIASUBTYPE_YV12) {
+
+ encodeYV12ToYV12(inBuf, inNumBytes);
+
+
+
+
+ //} else if (mPinInputType.subtype == MEDIASUBTYPE_AYUV) {
+ // encodeAYUVtoYV12(inBuf, inNumBytes);
+
+ //} else if (mPinInputType.subtype == MEDIASUBTYPE_RGB32) {
+ // encodeRGB32toYV12(inBuf, inNumBytes);
+
+ //} else if (mPinInputType.subtype == MEDIASUBTYPE_RGB24) {
+ // encodeRGB24toYV12(inBuf, inNumBytes);
+
+
+ //} else if (mPinInputType.subtype == MEDIASUBTYPE_YV12) {
+ // //Should be more specifc.
+ // //debugLog<<"About to encode YV12 to YV12"<<endl;
+ // encodeYV12ToYV12(inBuf, inNumBytes);
+ //} else if (mPinInputType.subtype == MEDIASUBTYPE_UYVY) {
+ //
+ //
+ // encodeUYVYToYV12(inBuf, inNumBytes);
+
+ //} else if (mPinInputType.subtype == MEDIASUBTYPE_YVYU) {
+ //
+ //
+ // encodeYVYUToYV12(inBuf, inNumBytes);
+ //} else if (mPinInputType.subtype == MEDIASUBTYPE_IYUV) {
+ //
+ //
+ // encodeIYUVToYV12(inBuf, inNumBytes);
+
+
+ } else {
+
+ //FATAL ERROR
+ throw 0;
+ }
+
+
+ //StampedOggPacket* locPacket = mTheoraEncoder.encodeTheora(&mYUV);
+ //if (locPacket == NULL) {
+ // //debugLog<<"Encode returns NULL"<<endl;
+ // return S_FALSE;
+ //}
+ //locFrameEnd = mUptoFrame
+ // = locPacket->endTime();
+ //debugLog<<"Delivering..."<<endl;
+
+
+
+
+
+ //return deliverData(locFrameStart, locFrameEnd, locPacket->packetData(), locPacket->packetSize());
+
+}
+bool DiracEncodeInputPin::ConstructCodec() {
+
+ //debugLog<<"Contructing codec..."<<endl;
// theora_info_init(&mTheoraInfo);
//Round up to multiple of 16 for theora
@@ -493,38 +493,38 @@
//mTheoraInfo.keyframe_data_target_bitrate=mTheoraInfo.target_bitrate*1.5;
//mTheoraInfo.keyframe_auto_threshold=80;
//mTheoraInfo.keyframe_mindistance=8;
- //mTheoraInfo.noise_sensitivity=1;
-
- //((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.frameRateNumerator = locNum;
- //((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.frameRateDenominator = 1;
- //((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.maxKeyframeInterval = 6; //log2(keyframe_freq) from above
- //((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.frameHeight = mHeight;
- //((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.frameWidth = mWidth;
- //((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.colourSpace = OC_CS_UNSPECIFIED;
- //((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.height = mTheoraInfo.height;
- //((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.width = mTheoraInfo.width;
- //((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.xOffset = mXOffset;
- //((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.yOffset = mYOffset;
- //((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.aspectDenominator = 0;
- //((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.aspectNumerator = 0;
-
- return true;
-
-}
-void DiracEncodeInputPin::DestroyCodec() {
- //fish_sound_delete(mFishSound);
- //mFishSound = NULL;
-}
-
-
-
-HRESULT DiracEncodeInputPin::SetMediaType(const CMediaType* inMediaType) {
- AbstractVideoEncodeInputPin::SetMediaType(inMediaType);
-
- ConstructCodec();
-
-
- return S_OK;
-
-}
-
+ //mTheoraInfo.noise_sensitivity=1;
+
+ //((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.frameRateNumerator = locNum;
+ //((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.frameRateDenominator = 1;
+ //((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.maxKeyframeInterval = 6; //log2(keyframe_freq) from above
+ //((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.frameHeight = mHeight;
+ //((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.frameWidth = mWidth;
+ //((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.colourSpace = OC_CS_UNSPECIFIED;
+ //((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.height = mTheoraInfo.height;
+ //((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.width = mTheoraInfo.width;
+ //((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.xOffset = mXOffset;
+ //((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.yOffset = mYOffset;
+ //((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.aspectDenominator = 0;
+ //((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.aspectNumerator = 0;
+
+ return true;
+
+}
+void DiracEncodeInputPin::DestroyCodec() {
+ //fish_sound_delete(mFishSound);
+ //mFishSound = NULL;
+}
+
+
+
+HRESULT DiracEncodeInputPin::SetMediaType(const CMediaType* inMediaType) {
+ AbstractVideoEncodeInputPin::SetMediaType(inMediaType);
+
+ ConstructCodec();
+
+
+ return S_OK;
+
+}
+
Property changes on: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeInputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeInputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeInputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,98 +1,98 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "dsfDiracEncodeFilter.h"
-//#include "DiracEncoder.h"
-
-
-
-//Mmmmm macrolicious !
-//#define INT_FLOOR(num,scale) (num - (num % scale))
-#define CLIP3(x,y,z) ((z < x) ? x : ((z > y) ? y : z))
-//
-
-//DEBUG ONLY
-#include <fstream>
-using namespace std;
-//
-
-class DiracEncodeOutputPin;
-class DiracEncodeInputPin
- : public AbstractVideoEncodeInputPin
-{
-public:
- DiracEncodeInputPin(AbstractVideoEncodeFilter* inFilter, CCritSec* inFilterLock, AbstractVideoEncodeOutputPin* inOutputPin);
- virtual ~DiracEncodeInputPin(void);
-
-
- //PURE VIRTUALS
- virtual long encodeData(unsigned char* inBuf, long inNumBytes);
- virtual bool ConstructCodec();
- virtual void DestroyCodec();
- virtual HRESULT SetMediaType(const CMediaType* inMediaType);
- //
-
- //theora_info* theoraInfo();
-
-protected:
- HRESULT mHR;
- //bool mBegun; //Already in base class !
-
- HRESULT deliverData(LONGLONG inStart, LONGLONG inEnd, unsigned char* inBuf, unsigned long inNumBytes);
-
- long encodeYV12ToYV12(unsigned char* inBuf, long inNumBytes);
- //long encodeYUY2ToYV12(unsigned char* inBuf, long inNumBytes);
- //long encodeAYUVtoYV12(unsigned char* inBuf, long inNumBytes);
- //long encodeRGB24toYV12(unsigned char* inBuf, long inNumBytes);
- //long encodeRGB32toYV12(unsigned char* inBuf, long inNumBytes);
- //long encodeUYVYToYV12(unsigned char* inBuf, long inNumBytes);
- //long encodeYVYUToYV12(unsigned char* inBuf, long inNumBytes);
- //long encodeIYUVToYV12(unsigned char* inBuf, long inNumBytes);
- //
-// bool fillTheoraInfo(theora_info* outTheora, sTheoraFormatBlock* inTheoraFormatBlock);
- //
- //TheoraEncodeOutputPin* mOutputPin; //Already in the base class. Naughty c++
- //__int64 mUptoFrame; //Already in base class stupid !
-
- //TheoraEncoder mTheoraEncoder;
- //theora_info mTheoraInfo;
- //yuv_buffer mYUV;
-
- unsigned long mXOffset;
- unsigned long mYOffset;
-
- //DEBUG ONLY
- //fstream debugLog;
- //
-
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "dsfDiracEncodeFilter.h"
+//#include "DiracEncoder.h"
+
+
+
+//Mmmmm macrolicious !
+//#define INT_FLOOR(num,scale) (num - (num % scale))
+#define CLIP3(x,y,z) ((z < x) ? x : ((z > y) ? y : z))
+//
+
+//DEBUG ONLY
+#include <fstream>
+using namespace std;
+//
+
+class DiracEncodeOutputPin;
+class DiracEncodeInputPin
+ : public AbstractVideoEncodeInputPin
+{
+public:
+ DiracEncodeInputPin(AbstractVideoEncodeFilter* inFilter, CCritSec* inFilterLock, AbstractVideoEncodeOutputPin* inOutputPin);
+ virtual ~DiracEncodeInputPin(void);
+
+
+ //PURE VIRTUALS
+ virtual long encodeData(unsigned char* inBuf, long inNumBytes);
+ virtual bool ConstructCodec();
+ virtual void DestroyCodec();
+ virtual HRESULT SetMediaType(const CMediaType* inMediaType);
+ //
+
+ //theora_info* theoraInfo();
+
+protected:
+ HRESULT mHR;
+ //bool mBegun; //Already in base class !
+
+ HRESULT deliverData(LONGLONG inStart, LONGLONG inEnd, unsigned char* inBuf, unsigned long inNumBytes);
+
+ long encodeYV12ToYV12(unsigned char* inBuf, long inNumBytes);
+ //long encodeYUY2ToYV12(unsigned char* inBuf, long inNumBytes);
+ //long encodeAYUVtoYV12(unsigned char* inBuf, long inNumBytes);
+ //long encodeRGB24toYV12(unsigned char* inBuf, long inNumBytes);
+ //long encodeRGB32toYV12(unsigned char* inBuf, long inNumBytes);
+ //long encodeUYVYToYV12(unsigned char* inBuf, long inNumBytes);
+ //long encodeYVYUToYV12(unsigned char* inBuf, long inNumBytes);
+ //long encodeIYUVToYV12(unsigned char* inBuf, long inNumBytes);
+ //
+// bool fillTheoraInfo(theora_info* outTheora, sTheoraFormatBlock* inTheoraFormatBlock);
+ //
+ //TheoraEncodeOutputPin* mOutputPin; //Already in the base class. Naughty c++
+ //__int64 mUptoFrame; //Already in base class stupid !
+
+ //TheoraEncoder mTheoraEncoder;
+ //theora_info mTheoraInfo;
+ //yuv_buffer mYUV;
+
+ unsigned long mXOffset;
+ unsigned long mYOffset;
+
+ //DEBUG ONLY
+ //fstream debugLog;
+ //
+
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeInputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeOutputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeOutputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeOutputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,51 +1,51 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "Diracencodeoutputpin.h"
-
-DiracEncodeOutputPin::DiracEncodeOutputPin(DiracEncodeFilter* inParentFilter,CCritSec* inFilterLock, CMediaType* inOutputMediaType)
- : AbstractVideoEncodeOutputPin(inParentFilter, inFilterLock,NAME("DiracDecodeOutputPin"), L"Dirac Out", inOutputMediaType)
-{
-}
-
-DiracEncodeOutputPin::~DiracEncodeOutputPin(void)
-{
-}
-
-bool DiracEncodeOutputPin::FillFormatBuffer(BYTE* inFormatBuffer) {
- DiracEncodeFilter* locParentFilter = (DiracEncodeFilter*)mParentFilter;
- memcpy((void*)inFormatBuffer, (const void*) &(locParentFilter->mDiracFormatBlock), sizeof(sDiracFormatBlock));
- return true;
-}
-unsigned long DiracEncodeOutputPin::FormatBufferSize() {
- return sizeof(sDiracFormatBlock);
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "Diracencodeoutputpin.h"
+
+DiracEncodeOutputPin::DiracEncodeOutputPin(DiracEncodeFilter* inParentFilter,CCritSec* inFilterLock, CMediaType* inOutputMediaType)
+ : AbstractVideoEncodeOutputPin(inParentFilter, inFilterLock,NAME("DiracDecodeOutputPin"), L"Dirac Out", inOutputMediaType)
+{
+}
+
+DiracEncodeOutputPin::~DiracEncodeOutputPin(void)
+{
+}
+
+bool DiracEncodeOutputPin::FillFormatBuffer(BYTE* inFormatBuffer) {
+ DiracEncodeFilter* locParentFilter = (DiracEncodeFilter*)mParentFilter;
+ memcpy((void*)inFormatBuffer, (const void*) &(locParentFilter->mDiracFormatBlock), sizeof(sDiracFormatBlock));
+ return true;
+}
+unsigned long DiracEncodeOutputPin::FormatBufferSize() {
+ return sizeof(sDiracFormatBlock);
+}
Property changes on: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeOutputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeOutputPin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeOutputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeOutputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,54 +1,54 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-#include "dsfDiracEncodeFilter.h"
-//#include "AbstractVideoEncodeOutputPin.h"
-
-class DiracEncodeFilter;
-struct sDiracFormatBlock;
-
-class DiracEncodeOutputPin
- : public AbstractVideoEncodeOutputPin
-{
-public:
- DiracEncodeOutputPin(DiracEncodeFilter* inParentFilter, CCritSec* inFilterLock, CMediaType* inOutputMediaType);
- virtual ~DiracEncodeOutputPin(void);
-
- //PURE VIRTUAL IMPLEMENTATION
- virtual bool FillFormatBuffer(BYTE* inFormatBuffer);
- virtual unsigned long FormatBufferSize();
-
-
-protected:
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+#include "dsfDiracEncodeFilter.h"
+//#include "AbstractVideoEncodeOutputPin.h"
+
+class DiracEncodeFilter;
+struct sDiracFormatBlock;
+
+class DiracEncodeOutputPin
+ : public AbstractVideoEncodeOutputPin
+{
+public:
+ DiracEncodeOutputPin(DiracEncodeFilter* inParentFilter, CCritSec* inFilterLock, CMediaType* inOutputMediaType);
+ virtual ~DiracEncodeOutputPin(void);
+
+ //PURE VIRTUAL IMPLEMENTATION
+ virtual bool FillFormatBuffer(BYTE* inFormatBuffer);
+ virtual unsigned long FormatBufferSize();
+
+
+protected:
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/DiracEncodeOutputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/dsfDiracEncodeFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/dsfDiracEncodeFilter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/dsfDiracEncodeFilter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,100 +1,100 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-
-#include "dsfDiracEncodeFilter.h"
-
-extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
-BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
-{
- return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
-}
-
-
-//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
-STDAPI DllRegisterServer()
-{
-
- //TO DO::: Should we be releasing the filter mapper even when we return early ?
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(TRUE);
-
-
-
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
-
-
- hr = locFilterMapper->RegisterFilter(
- CLSID_DiracEncodeFilter, // Filter CLSID.
- L"Dirac Encode Filter", // Filter name.
- NULL, // Device moniker.
- &CLSID_LegacyAmFilterCategory, // Direct Show general category
- L"Dirac Encode Filter", // Instance data. ???????
- &DiracEncodeFilterReg // Pointer to filter information.
- );
-
- locFilterMapper->Release();
-
- return hr;
-
-}
-
-STDAPI DllUnregisterServer()
-{
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(FALSE);
- if (FAILED(hr)) {
-
- return hr;
- }
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
- IID_IFilterMapper2, (void **)&locFilterMapper);
-
- if (FAILED(hr)) {
- return hr;
- }
-
-
- hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, L"Dirac Encode Filter", CLSID_DiracEncodeFilter);
-
-
- //
- locFilterMapper->Release();
- return hr;
-
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+
+#include "dsfDiracEncodeFilter.h"
+
+extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
+BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+ return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
+}
+
+
+//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
+STDAPI DllRegisterServer()
+{
+
+ //TO DO::: Should we be releasing the filter mapper even when we return early ?
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(TRUE);
+
+
+
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
+
+
+ hr = locFilterMapper->RegisterFilter(
+ CLSID_DiracEncodeFilter, // Filter CLSID.
+ L"Dirac Encode Filter", // Filter name.
+ NULL, // Device moniker.
+ &CLSID_LegacyAmFilterCategory, // Direct Show general category
+ L"Dirac Encode Filter", // Instance data. ???????
+ &DiracEncodeFilterReg // Pointer to filter information.
+ );
+
+ locFilterMapper->Release();
+
+ return hr;
+
+}
+
+STDAPI DllUnregisterServer()
+{
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(FALSE);
+ if (FAILED(hr)) {
+
+ return hr;
+ }
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
+ IID_IFilterMapper2, (void **)&locFilterMapper);
+
+ if (FAILED(hr)) {
+ return hr;
+ }
+
+
+ hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, L"Dirac Encode Filter", CLSID_DiracEncodeFilter);
+
+
+ //
+ locFilterMapper->Release();
+ return hr;
+
+}
Property changes on: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/dsfDiracEncodeFilter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/dsfDiracEncodeFilter.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/dsfDiracEncodeFilter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/dsfDiracEncodeFilter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,214 +1,214 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-
-
-#include <streams.h>
-#include <pullpin.h>
-#include <initguid.h>
-
-#ifdef DSFDIRACENCODEFILTER_EXPORTS
-#define DSFDIRACENCODEFILTER_API __declspec(dllexport)
-#else
-#define DSFDIRACENCODEFILTER_API __declspec(dllimport)
-#endif
-
-
-
-
-struct sDiracFormatBlock {
- int chromaFormat;
- int width;
- int height;
- int frameRate;
- bool isInterlaced;
- bool isTopFieldFirst;
-
-};
-
-// {855236D7-01D6-432e-9563-4D0A322B2FFB}
-DEFINE_GUID(CLSID_DiracEncodeFilter,
-0x855236d7, 0x1d6, 0x432e, 0x95, 0x63, 0x4d, 0xa, 0x32, 0x2b, 0x2f, 0xfb);
-
-// {15B9B7CA-A7C0-448c-A68D-4D45A4137E38}
-DEFINE_GUID(MEDIASUBTYPE_Dirac,
-0x15b9b7ca, 0xa7c0, 0x448c, 0xa6, 0x8d, 0x4d, 0x45, 0xa4, 0x13, 0x7e, 0x38);
-
-// {4D8CEB62-0F52-44d0-B1EB-4AD6B24EA62C}
-DEFINE_GUID(FORMAT_Dirac,
-0x4d8ceb62, 0xf52, 0x44d0, 0xb1, 0xeb, 0x4a, 0xd6, 0xb2, 0x4e, 0xa6, 0x2c);
-
-
-const REGPINTYPES DiracEncodeInputTypes = {
- &MEDIATYPE_Video,
- &MEDIASUBTYPE_YV12
-};
-
-const REGPINTYPES DiracEncodeOutputTypes = {
- &MEDIATYPE_Video,
- &MEDIASUBTYPE_Dirac
-};
-
-const REGFILTERPINS DiracEncodePinReg[] = {
- {
- L"YV12 Input", //Name (obsoleted)
- FALSE, //Renders from this pin ?? Not sure about this.
- FALSE, //Not an output pin
- FALSE, //Cannot have zero instances of this pin
- FALSE, //Cannot have more than one instance of this pin
- NULL, //Connects to filter (obsoleted)
- NULL, //Connects to pin (obsoleted)
- 1, //upport two media type
- &DiracEncodeInputTypes //Pointer to media type (Video/VY12)
- } ,
-
- {
- L"Dirac Output", //Name (obsoleted)
- FALSE, //Renders from this pin ?? Not sure about this.
- TRUE, //Is an output pin
- FALSE, //Cannot have zero instances of this pin
- FALSE, //Cannot have more than one instance of this pin
- NULL, //Connects to filter (obsoleted)
- NULL, //Connects to pin (obsoleted)
- 1, //Only support one media type
- &DiracEncodeOutputTypes //Pointer to media type (Audio/PCM)
-
- }
-};
-
-
-
-const REGFILTER2 DiracEncodeFilterReg = {
- 1,
- MERIT_NORMAL,
- 2,
- DiracEncodePinReg
-
-};
-
-
-
-
-
-//
-//#ifdef LIBOOOGG_EXPORTS
-//#define LIBOOOGG_API __declspec(dllexport)
-//#else
-//#define LIBOOOGG_API __declspec(dllimport)
-//#endif
-//
-//// {121EA765-6D3F-4519-9686-A0BA6E5281A2}
-//DEFINE_GUID(CLSID_PropsTheoraEncoder,
-//0x121ea765, 0x6d3f, 0x4519, 0x96, 0x86, 0xa0, 0xba, 0x6e, 0x52, 0x81, 0xa2);
-//
-//// {4F063B3A-B397-4c22-AFF4-2F8DB96D292A}
-//DEFINE_GUID(IID_ITheoraEncodeSettings,
-//0x4f063b3a, 0xb397, 0x4c22, 0xaf, 0xf4, 0x2f, 0x8d, 0xb9, 0x6d, 0x29, 0x2a);
-//
-//// {5C769985-C3E1-4f95-BEE7-1101C465F5FC}
-//DEFINE_GUID(CLSID_TheoraEncodeFilter,
-//0x5c769985, 0xc3e1, 0x4f95, 0xbe, 0xe7, 0x11, 0x1, 0xc4, 0x65, 0xf5, 0xfc);
-//
-//// {D124B2B1-8968-4ae8-B288-FE16EA34B0CE}
-//DEFINE_GUID(MEDIASUBTYPE_Theora,
-//0xd124b2b1, 0x8968, 0x4ae8, 0xb2, 0x88, 0xfe, 0x16, 0xea, 0x34, 0xb0, 0xce);
-//
-//// {A99F116C-DFFA-412c-95DE-725F99874826}
-//DEFINE_GUID(FORMAT_Theora,
-//0xa99f116c, 0xdffa, 0x412c, 0x95, 0xde, 0x72, 0x5f, 0x99, 0x87, 0x48, 0x26);
-//
-//const REGPINTYPES TheoraEncodeInputTypes = {
-// &MEDIATYPE_Video,
-// &MEDIASUBTYPE_YV12
-//};
-//
-//const REGPINTYPES TheoraEncodeOutputTypes = {
-// &MEDIATYPE_Video,
-// &MEDIASUBTYPE_Theora
-//};
-//
-//const REGFILTERPINS TheoraEncodePinReg[] = {
-// {
-// L"YV12 Input", //Name (obsoleted)
-// FALSE, //Renders from this pin ?? Not sure about this.
-// FALSE, //Not an output pin
-// FALSE, //Cannot have zero instances of this pin
-// FALSE, //Cannot have more than one instance of this pin
-// NULL, //Connects to filter (obsoleted)
-// NULL, //Connects to pin (obsoleted)
-// 1, //upport two media type
-// &TheoraEncodeInputTypes //Pointer to media type (Video/VY12)
-// } ,
-//
-// {
-// L"Theora Output", //Name (obsoleted)
-// FALSE, //Renders from this pin ?? Not sure about this.
-// TRUE, //Is an output pin
-// FALSE, //Cannot have zero instances of this pin
-// FALSE, //Cannot have more than one instance of this pin
-// NULL, //Connects to filter (obsoleted)
-// NULL, //Connects to pin (obsoleted)
-// 1, //Only support one media type
-// &TheoraEncodeOutputTypes //Pointer to media type (Audio/PCM)
-//
-// }
-//};
-//
-//
-//
-//const REGFILTER2 TheoraEncodeFilterReg = {
-// 1,
-// MERIT_NORMAL,
-// 2,
-// TheoraEncodePinReg
-//
-//};
-//
-//struct sTheoraFormatBlock {
-// unsigned long theoraVersion;
-// unsigned long width;
-// unsigned long height;
-// unsigned long frameWidth;
-// unsigned long frameHeight;
-// unsigned long frameRateNumerator;
-// unsigned long frameRateDenominator;
-// unsigned long aspectNumerator;
-// unsigned long aspectDenominator;
-// unsigned long maxKeyframeInterval;
-// unsigned long targetBitrate;
-// unsigned char targetQuality;
-// unsigned char xOffset;
-// unsigned char yOffset;
-// unsigned char colourSpace;
-//};
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+
+
+#include <streams.h>
+#include <pullpin.h>
+#include <initguid.h>
+
+#ifdef DSFDIRACENCODEFILTER_EXPORTS
+#define DSFDIRACENCODEFILTER_API __declspec(dllexport)
+#else
+#define DSFDIRACENCODEFILTER_API __declspec(dllimport)
+#endif
+
+
+
+
+struct sDiracFormatBlock {
+ int chromaFormat;
+ int width;
+ int height;
+ int frameRate;
+ bool isInterlaced;
+ bool isTopFieldFirst;
+
+};
+
+// {855236D7-01D6-432e-9563-4D0A322B2FFB}
+DEFINE_GUID(CLSID_DiracEncodeFilter,
+0x855236d7, 0x1d6, 0x432e, 0x95, 0x63, 0x4d, 0xa, 0x32, 0x2b, 0x2f, 0xfb);
+
+// {15B9B7CA-A7C0-448c-A68D-4D45A4137E38}
+DEFINE_GUID(MEDIASUBTYPE_Dirac,
+0x15b9b7ca, 0xa7c0, 0x448c, 0xa6, 0x8d, 0x4d, 0x45, 0xa4, 0x13, 0x7e, 0x38);
+
+// {4D8CEB62-0F52-44d0-B1EB-4AD6B24EA62C}
+DEFINE_GUID(FORMAT_Dirac,
+0x4d8ceb62, 0xf52, 0x44d0, 0xb1, 0xeb, 0x4a, 0xd6, 0xb2, 0x4e, 0xa6, 0x2c);
+
+
+const REGPINTYPES DiracEncodeInputTypes = {
+ &MEDIATYPE_Video,
+ &MEDIASUBTYPE_YV12
+};
+
+const REGPINTYPES DiracEncodeOutputTypes = {
+ &MEDIATYPE_Video,
+ &MEDIASUBTYPE_Dirac
+};
+
+const REGFILTERPINS DiracEncodePinReg[] = {
+ {
+ L"YV12 Input", //Name (obsoleted)
+ FALSE, //Renders from this pin ?? Not sure about this.
+ FALSE, //Not an output pin
+ FALSE, //Cannot have zero instances of this pin
+ FALSE, //Cannot have more than one instance of this pin
+ NULL, //Connects to filter (obsoleted)
+ NULL, //Connects to pin (obsoleted)
+ 1, //upport two media type
+ &DiracEncodeInputTypes //Pointer to media type (Video/VY12)
+ } ,
+
+ {
+ L"Dirac Output", //Name (obsoleted)
+ FALSE, //Renders from this pin ?? Not sure about this.
+ TRUE, //Is an output pin
+ FALSE, //Cannot have zero instances of this pin
+ FALSE, //Cannot have more than one instance of this pin
+ NULL, //Connects to filter (obsoleted)
+ NULL, //Connects to pin (obsoleted)
+ 1, //Only support one media type
+ &DiracEncodeOutputTypes //Pointer to media type (Audio/PCM)
+
+ }
+};
+
+
+
+const REGFILTER2 DiracEncodeFilterReg = {
+ 1,
+ MERIT_NORMAL,
+ 2,
+ DiracEncodePinReg
+
+};
+
+
+
+
+
+//
+//#ifdef LIBOOOGG_EXPORTS
+//#define LIBOOOGG_API __declspec(dllexport)
+//#else
+//#define LIBOOOGG_API __declspec(dllimport)
+//#endif
+//
+//// {121EA765-6D3F-4519-9686-A0BA6E5281A2}
+//DEFINE_GUID(CLSID_PropsTheoraEncoder,
+//0x121ea765, 0x6d3f, 0x4519, 0x96, 0x86, 0xa0, 0xba, 0x6e, 0x52, 0x81, 0xa2);
+//
+//// {4F063B3A-B397-4c22-AFF4-2F8DB96D292A}
+//DEFINE_GUID(IID_ITheoraEncodeSettings,
+//0x4f063b3a, 0xb397, 0x4c22, 0xaf, 0xf4, 0x2f, 0x8d, 0xb9, 0x6d, 0x29, 0x2a);
+//
+//// {5C769985-C3E1-4f95-BEE7-1101C465F5FC}
+//DEFINE_GUID(CLSID_TheoraEncodeFilter,
+//0x5c769985, 0xc3e1, 0x4f95, 0xbe, 0xe7, 0x11, 0x1, 0xc4, 0x65, 0xf5, 0xfc);
+//
+//// {D124B2B1-8968-4ae8-B288-FE16EA34B0CE}
+//DEFINE_GUID(MEDIASUBTYPE_Theora,
+//0xd124b2b1, 0x8968, 0x4ae8, 0xb2, 0x88, 0xfe, 0x16, 0xea, 0x34, 0xb0, 0xce);
+//
+//// {A99F116C-DFFA-412c-95DE-725F99874826}
+//DEFINE_GUID(FORMAT_Theora,
+//0xa99f116c, 0xdffa, 0x412c, 0x95, 0xde, 0x72, 0x5f, 0x99, 0x87, 0x48, 0x26);
+//
+//const REGPINTYPES TheoraEncodeInputTypes = {
+// &MEDIATYPE_Video,
+// &MEDIASUBTYPE_YV12
+//};
+//
+//const REGPINTYPES TheoraEncodeOutputTypes = {
+// &MEDIATYPE_Video,
+// &MEDIASUBTYPE_Theora
+//};
+//
+//const REGFILTERPINS TheoraEncodePinReg[] = {
+// {
+// L"YV12 Input", //Name (obsoleted)
+// FALSE, //Renders from this pin ?? Not sure about this.
+// FALSE, //Not an output pin
+// FALSE, //Cannot have zero instances of this pin
+// FALSE, //Cannot have more than one instance of this pin
+// NULL, //Connects to filter (obsoleted)
+// NULL, //Connects to pin (obsoleted)
+// 1, //upport two media type
+// &TheoraEncodeInputTypes //Pointer to media type (Video/VY12)
+// } ,
+//
+// {
+// L"Theora Output", //Name (obsoleted)
+// FALSE, //Renders from this pin ?? Not sure about this.
+// TRUE, //Is an output pin
+// FALSE, //Cannot have zero instances of this pin
+// FALSE, //Cannot have more than one instance of this pin
+// NULL, //Connects to filter (obsoleted)
+// NULL, //Connects to pin (obsoleted)
+// 1, //Only support one media type
+// &TheoraEncodeOutputTypes //Pointer to media type (Audio/PCM)
+//
+// }
+//};
+//
+//
+//
+//const REGFILTER2 TheoraEncodeFilterReg = {
+// 1,
+// MERIT_NORMAL,
+// 2,
+// TheoraEncodePinReg
+//
+//};
+//
+//struct sTheoraFormatBlock {
+// unsigned long theoraVersion;
+// unsigned long width;
+// unsigned long height;
+// unsigned long frameWidth;
+// unsigned long frameHeight;
+// unsigned long frameRateNumerator;
+// unsigned long frameRateDenominator;
+// unsigned long aspectNumerator;
+// unsigned long aspectDenominator;
+// unsigned long maxKeyframeInterval;
+// unsigned long targetBitrate;
+// unsigned char targetQuality;
+// unsigned char xOffset;
+// unsigned char yOffset;
+// unsigned char colourSpace;
+//};
+//
Property changes on: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/dsfDiracEncodeFilter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// dsfDiracEncodeFilter.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// dsfDiracEncodeFilter.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,20 +1,20 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-// TODO: reference additional headers your program requires here
-#include "dsfDiracEncodeFilter.h"
-#include "AbstractVideoEncodeFilter.h"
-#include "AbstractVideoEncodeInputPin.h"
-#include "AbstractVideoEncodeOutputPin.h"
-#include "DiracEncodeInputPin.h"
-#include "DiracEncodeOutputPin.h"
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+// TODO: reference additional headers your program requires here
+#include "dsfDiracEncodeFilter.h"
+#include "AbstractVideoEncodeFilter.h"
+#include "AbstractVideoEncodeInputPin.h"
+#include "AbstractVideoEncodeOutputPin.h"
+#include "DiracEncodeInputPin.h"
+#include "DiracEncodeOutputPin.h"
#include "DiracEncodeFilter.h"
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/dirac/filters/dsfDiracEncodeFilter/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeFilter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeFilter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,116 +1,116 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "FLACDecodeFilter.h"
-
-
-//COM Factory Template
-CFactoryTemplate g_Templates[] =
-{
- {
- L"FLAC Decode Filter", // Name
- &CLSID_FLACDecodeFilter, // CLSID
- FLACDecodeFilter::CreateInstance, // Method to create an instance of MyComponent
- NULL, // Initialization function
- NULL // Set-up information (for filters)
- }
-
-};
-
-// Generic way of determining the number of items in the template
-int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
-
-FLACDecodeFilter::FLACDecodeFilter(void)
- : AbstractTransformFilter(NAME("FLAC Audio Decoder"), CLSID_FLACDecodeFilter)
- , mFLACFormatBlock(NULL)
-{
- bool locWasConstructed = ConstructPins();
-}
-
-FLACDecodeFilter::~FLACDecodeFilter(void)
-{
- delete mFLACFormatBlock;
- mFLACFormatBlock = NULL;
-}
-
-bool FLACDecodeFilter::ConstructPins()
-{
- //Vector to hold our set of media types we want to accept.
- vector<CMediaType*> locAcceptableTypes;
-
- //Setup the media types for the output pin.
- CMediaType* locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted in pin destructor
- locAcceptMediaType->subtype = MEDIASUBTYPE_PCM;
- locAcceptMediaType->formattype = FORMAT_WaveFormatEx;
-
- locAcceptableTypes.push_back(locAcceptMediaType);
-
- //Output pin must be done first because it's passed to the input pin.
- mOutputPin = new FLACDecodeOutputPin(this, m_pLock, locAcceptableTypes); //Deleted in base class destructor
-
- //Clear out the vector, now we've already passed it to the output pin.
- locAcceptableTypes.clear();
-
- //Setup the media Types for the input pin.
- locAcceptMediaType = NULL;
- locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted by pin
-
- locAcceptMediaType->subtype = MEDIASUBTYPE_FLAC;
- locAcceptMediaType->formattype = FORMAT_FLAC;
-
- locAcceptableTypes.push_back(locAcceptMediaType);
-
- mInputPin = new FLACDecodeInputPin(this, m_pLock, mOutputPin, locAcceptableTypes); //Deleted in base class filter destructor.
- return true;
-
-}
-
-CUnknown* WINAPI FLACDecodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
-{
- //This routine is the COM implementation to create a new Filter
- FLACDecodeFilter *pNewObject = new FLACDecodeFilter();
- if (pNewObject == NULL) {
- *pHr = E_OUTOFMEMORY;
- }
- return pNewObject;
-}
-
-sFLACFormatBlock* FLACDecodeFilter::getFLACFormatBlock()
-{
- return mFLACFormatBlock;
-}
-void FLACDecodeFilter::setFLACFormatBlock(sFLACFormatBlock* inFormatBlock)
-{
- delete mFLACFormatBlock;
- mFLACFormatBlock = new sFLACFormatBlock; //Deleted in destructor.
- *mFLACFormatBlock = *inFormatBlock;
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "FLACDecodeFilter.h"
+
+
+//COM Factory Template
+CFactoryTemplate g_Templates[] =
+{
+ {
+ L"FLAC Decode Filter", // Name
+ &CLSID_FLACDecodeFilter, // CLSID
+ FLACDecodeFilter::CreateInstance, // Method to create an instance of MyComponent
+ NULL, // Initialization function
+ NULL // Set-up information (for filters)
+ }
+
+};
+
+// Generic way of determining the number of items in the template
+int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
+
+FLACDecodeFilter::FLACDecodeFilter(void)
+ : AbstractTransformFilter(NAME("FLAC Audio Decoder"), CLSID_FLACDecodeFilter)
+ , mFLACFormatBlock(NULL)
+{
+ bool locWasConstructed = ConstructPins();
+}
+
+FLACDecodeFilter::~FLACDecodeFilter(void)
+{
+ delete mFLACFormatBlock;
+ mFLACFormatBlock = NULL;
+}
+
+bool FLACDecodeFilter::ConstructPins()
+{
+ //Vector to hold our set of media types we want to accept.
+ vector<CMediaType*> locAcceptableTypes;
+
+ //Setup the media types for the output pin.
+ CMediaType* locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted in pin destructor
+ locAcceptMediaType->subtype = MEDIASUBTYPE_PCM;
+ locAcceptMediaType->formattype = FORMAT_WaveFormatEx;
+
+ locAcceptableTypes.push_back(locAcceptMediaType);
+
+ //Output pin must be done first because it's passed to the input pin.
+ mOutputPin = new FLACDecodeOutputPin(this, m_pLock, locAcceptableTypes); //Deleted in base class destructor
+
+ //Clear out the vector, now we've already passed it to the output pin.
+ locAcceptableTypes.clear();
+
+ //Setup the media Types for the input pin.
+ locAcceptMediaType = NULL;
+ locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted by pin
+
+ locAcceptMediaType->subtype = MEDIASUBTYPE_FLAC;
+ locAcceptMediaType->formattype = FORMAT_FLAC;
+
+ locAcceptableTypes.push_back(locAcceptMediaType);
+
+ mInputPin = new FLACDecodeInputPin(this, m_pLock, mOutputPin, locAcceptableTypes); //Deleted in base class filter destructor.
+ return true;
+
+}
+
+CUnknown* WINAPI FLACDecodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
+{
+ //This routine is the COM implementation to create a new Filter
+ FLACDecodeFilter *pNewObject = new FLACDecodeFilter();
+ if (pNewObject == NULL) {
+ *pHr = E_OUTOFMEMORY;
+ }
+ return pNewObject;
+}
+
+sFLACFormatBlock* FLACDecodeFilter::getFLACFormatBlock()
+{
+ return mFLACFormatBlock;
+}
+void FLACDecodeFilter::setFLACFormatBlock(sFLACFormatBlock* inFormatBlock)
+{
+ delete mFLACFormatBlock;
+ mFLACFormatBlock = new sFLACFormatBlock; //Deleted in destructor.
+ *mFLACFormatBlock = *inFormatBlock;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeFilter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeFilter.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeFilter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeFilter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,61 +1,61 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-//Local Includes
-#include "FLACdecoderdllstuff.h"
-
-//External INcludes
-#include "FLAC++/decoder.h"
-
-class FLACDecodeFilter
- //Base Classes
- : public AbstractTransformFilter
-{
-public:
- //Friend Classes
- friend class FLACDecodeInputPin;
- friend class FLACDecodeOutputPin;
-
- //Constructors
- FLACDecodeFilter(void);
- virtual ~FLACDecodeFilter(void);
-
- //COM Creator Function
- static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
-
- void FLACDecodeFilter::setFLACFormatBlock(sFLACFormatBlock* inFormatBlock) ;
- sFLACFormatBlock* FLACDecodeFilter::getFLACFormatBlock();
-protected:
- //Implemenation of Pue Virtuals from AbstractTransformFilter
- virtual bool ConstructPins();
- sFLACFormatBlock* mFLACFormatBlock;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+//Local Includes
+#include "FLACdecoderdllstuff.h"
+
+//External INcludes
+#include "FLAC++/decoder.h"
+
+class FLACDecodeFilter
+ //Base Classes
+ : public AbstractTransformFilter
+{
+public:
+ //Friend Classes
+ friend class FLACDecodeInputPin;
+ friend class FLACDecodeOutputPin;
+
+ //Constructors
+ FLACDecodeFilter(void);
+ virtual ~FLACDecodeFilter(void);
+
+ //COM Creator Function
+ static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+
+ void FLACDecodeFilter::setFLACFormatBlock(sFLACFormatBlock* inFormatBlock) ;
+ sFLACFormatBlock* FLACDecodeFilter::getFLACFormatBlock();
+protected:
+ //Implemenation of Pue Virtuals from AbstractTransformFilter
+ virtual bool ConstructPins();
+ sFLACFormatBlock* mFLACFormatBlock;
+};
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeFilter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeInputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeInputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,223 +1,223 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "flacdecodeinputpin.h"
-
-FLACDecodeInputPin::FLACDecodeInputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes)
- : AbstractTransformInputPin(inParentFilter, inFilterLock, inOutputPin, NAME("FLACDecodeInputPin"), L"FLAC In", inAcceptableMediaTypes)
- , mGotMetaData(false)
- , mCodecLock(NULL)
-
- , mUptoFrame(0)
-
-{
- //debugLog.open("G:\\logs\\flacfilter.log", ios_base::out);
- mCodecLock = new CCritSec; //Deleted in destructor.
- ConstructCodec();
-}
-
-FLACDecodeInputPin::~FLACDecodeInputPin(void)
-{
- //debugLog.close();
- delete mCodecLock;
-
-}
-
-STDMETHODIMP FLACDecodeInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
- if (riid == IID_IMediaSeeking) {
- *ppv = (IMediaSeeking*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- }
-
- return CBaseInputPin::NonDelegatingQueryInterface(riid, ppv);
-}
-bool FLACDecodeInputPin::ConstructCodec()
-{
- mFLACDecoder.initCodec();
-
- return true;
-}
-void FLACDecodeInputPin::DestroyCodec()
-{
-
-}
-STDMETHODIMP FLACDecodeInputPin::NewSegment(REFERENCE_TIME inStartTime, REFERENCE_TIME inStopTime, double inRate)
-{
- CAutoLock locLock(mStreamLock);
- //debugLog<<"New segment "<<inStartTime<<" - "<<inStopTime<<endl;
- mUptoFrame = 0;
- return AbstractTransformInputPin::NewSegment(inStartTime, inStopTime, inRate);
-
-}
-HRESULT FLACDecodeInputPin::TransformData(BYTE* inBuf, long inNumBytes)
-{
-
- //TODO::: Locks ???
-
- //What happens when another packet arrives and the other one is still there ?
- //delete mPendingPacket;
- //debugLog<<"decodeData : "<<endl;
- if(!m_bFlushing) {
- unsigned char* locBuff = new unsigned char[inNumBytes]; //Given to packet.
- memcpy((void*)locBuff, (const void*)inBuf, inNumBytes);
-
- OggPacket* locPacket = new OggPacket(locBuff, inNumBytes, false, false); //We give this away.
-
- if (mGotMetaData) {
- StampedOggPacket* locStamped = NULL;
- {
- CAutoLock locCodecLock(mCodecLock);
- //for(unsigned long i = 0; i < mPendingPackets.size(); i++) {
- locStamped = (StampedOggPacket*)mFLACDecoder.decodeFLAC(locPacket)->clone(); //clone deleted below, locpacket accepted by decoder.
- }
-
- if (locStamped != NULL) {
- //Do the directshow crap here....
-
- IMediaSample* locSample;
-
- HRESULT locHR = mOutputPin->GetDeliveryBuffer(&locSample, NULL, NULL, NULL);
-
- if (FAILED(locHR)) {
- //debugLog<<"Write_Callback : Get deliverybuffer failed. returning abort code."<<endl;
- // //We get here when the application goes into stop mode usually.
- delete locStamped;
- return S_FALSE;
- }
-
-
- BYTE* locBuffer = NULL;
-
-
- // //Make our pointers set to point to the samples buffer
- locSample->GetPointer(&locBuffer);
-
-
- if (locSample->GetSize() >= locStamped->packetSize()) {
- REFERENCE_TIME locFrameStart = (((__int64)(mUptoFrame * UNITS)) / mFLACDecoder.mSampleRate);
-
- //Increment the frame counter - note the returned packet is stamped 0-numSamples
- mUptoFrame += locStamped->endTime();
-
- // //Make the end frame counter
-
- REFERENCE_TIME locFrameEnd = (((__int64)(mUptoFrame * UNITS)) / mFLACDecoder.mSampleRate);
-
- memcpy((void*)locBuffer, (const void*)locStamped->packetData(), locStamped->packetSize());
- SetSampleParams(locSample, locStamped->packetSize(), &locFrameStart, &locFrameEnd);
- HRESULT locHR = ((FLACDecodeOutputPin*)(mOutputPin))->mDataQueue->Receive(locSample);
- if (locHR != S_OK) {
-
- } else {
- //debugLog<<"Write_Callback : Delivery of sample succeeded"<<endl;
- }
- } else {
- delete locStamped;
- throw 0; //SAMPLE SIZE IS TOO SMALL TO FIT DATA
- }
-
-
- delete locStamped;
- return S_OK;
- } else {
- return S_FALSE;
- }
-
- } else {
- {
- CAutoLock locCodecLock(mCodecLock);
- mGotMetaData = mFLACDecoder.acceptMetadata(locPacket); //Accepts the packet.
- }
- if (mGotMetaData) {
- return S_OK;
- } else {
- return S_FALSE;
- }
-
-
-
- }
- //debugLog<<"decodeData : Successful return."<<endl;
-
- //Should be impossible to get here.
- return S_OK;
- } else {
- //debugLog<<"decodeData : Filter flushing... bad things !!!"<<endl;
- return S_FALSE;
- }
-
-
-}
-
-
-STDMETHODIMP FLACDecodeInputPin::BeginFlush() {
- CAutoLock locLock(m_pLock);
-
- //debugLog<<"BeginFlush : Calling flush on the codec."<<endl;
-
- HRESULT locHR = AbstractTransformInputPin::BeginFlush();
- { //PROTECT CODEC FROM IMPLODING
- CAutoLock locCodecLock(mCodecLock);
- mFLACDecoder.flushCodec();
- } //END CRITICAL SECTION
- return locHR;
-
-}
-
-STDMETHODIMP FLACDecodeInputPin::EndOfStream(void) {
- CAutoLock locStreamLock(mStreamLock);
- { //PROTECT CODEC FROM IMPLODING
- CAutoLock locCodecLock(mCodecLock);
- mFLACDecoder.flushCodec();
- } //END CRITICAL SECTION
-
- return AbstractTransformInputPin::EndOfStream();
-}
-
-HRESULT FLACDecodeInputPin::SetMediaType(const CMediaType* inMediaType) {
- //FIX:::Error checking
- //RESOLVED::: Bit better.
-
- if (inMediaType->subtype == MEDIASUBTYPE_FLAC) {
-
- //Keep the format block
-
- ((FLACDecodeFilter*)mParentFilter)->setFLACFormatBlock((sFLACFormatBlock*)inMediaType->pbFormat); //Copies the format in the mutator
-
- } else {
- throw 0;
- }
- return CBaseInputPin::SetMediaType(inMediaType);
-}
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "flacdecodeinputpin.h"
+
+FLACDecodeInputPin::FLACDecodeInputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes)
+ : AbstractTransformInputPin(inParentFilter, inFilterLock, inOutputPin, NAME("FLACDecodeInputPin"), L"FLAC In", inAcceptableMediaTypes)
+ , mGotMetaData(false)
+ , mCodecLock(NULL)
+
+ , mUptoFrame(0)
+
+{
+ //debugLog.open("G:\\logs\\flacfilter.log", ios_base::out);
+ mCodecLock = new CCritSec; //Deleted in destructor.
+ ConstructCodec();
+}
+
+FLACDecodeInputPin::~FLACDecodeInputPin(void)
+{
+ //debugLog.close();
+ delete mCodecLock;
+
+}
+
+STDMETHODIMP FLACDecodeInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+ if (riid == IID_IMediaSeeking) {
+ *ppv = (IMediaSeeking*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ }
+
+ return CBaseInputPin::NonDelegatingQueryInterface(riid, ppv);
+}
+bool FLACDecodeInputPin::ConstructCodec()
+{
+ mFLACDecoder.initCodec();
+
+ return true;
+}
+void FLACDecodeInputPin::DestroyCodec()
+{
+
+}
+STDMETHODIMP FLACDecodeInputPin::NewSegment(REFERENCE_TIME inStartTime, REFERENCE_TIME inStopTime, double inRate)
+{
+ CAutoLock locLock(mStreamLock);
+ //debugLog<<"New segment "<<inStartTime<<" - "<<inStopTime<<endl;
+ mUptoFrame = 0;
+ return AbstractTransformInputPin::NewSegment(inStartTime, inStopTime, inRate);
+
+}
+HRESULT FLACDecodeInputPin::TransformData(BYTE* inBuf, long inNumBytes)
+{
+
+ //TODO::: Locks ???
+
+ //What happens when another packet arrives and the other one is still there ?
+ //delete mPendingPacket;
+ //debugLog<<"decodeData : "<<endl;
+ if(!m_bFlushing) {
+ unsigned char* locBuff = new unsigned char[inNumBytes]; //Given to packet.
+ memcpy((void*)locBuff, (const void*)inBuf, inNumBytes);
+
+ OggPacket* locPacket = new OggPacket(locBuff, inNumBytes, false, false); //We give this away.
+
+ if (mGotMetaData) {
+ StampedOggPacket* locStamped = NULL;
+ {
+ CAutoLock locCodecLock(mCodecLock);
+ //for(unsigned long i = 0; i < mPendingPackets.size(); i++) {
+ locStamped = (StampedOggPacket*)mFLACDecoder.decodeFLAC(locPacket)->clone(); //clone deleted below, locpacket accepted by decoder.
+ }
+
+ if (locStamped != NULL) {
+ //Do the directshow crap here....
+
+ IMediaSample* locSample;
+
+ HRESULT locHR = mOutputPin->GetDeliveryBuffer(&locSample, NULL, NULL, NULL);
+
+ if (FAILED(locHR)) {
+ //debugLog<<"Write_Callback : Get deliverybuffer failed. returning abort code."<<endl;
+ // //We get here when the application goes into stop mode usually.
+ delete locStamped;
+ return S_FALSE;
+ }
+
+
+ BYTE* locBuffer = NULL;
+
+
+ // //Make our pointers set to point to the samples buffer
+ locSample->GetPointer(&locBuffer);
+
+
+ if (locSample->GetSize() >= locStamped->packetSize()) {
+ REFERENCE_TIME locFrameStart = (((__int64)(mUptoFrame * UNITS)) / mFLACDecoder.mSampleRate);
+
+ //Increment the frame counter - note the returned packet is stamped 0-numSamples
+ mUptoFrame += locStamped->endTime();
+
+ // //Make the end frame counter
+
+ REFERENCE_TIME locFrameEnd = (((__int64)(mUptoFrame * UNITS)) / mFLACDecoder.mSampleRate);
+
+ memcpy((void*)locBuffer, (const void*)locStamped->packetData(), locStamped->packetSize());
+ SetSampleParams(locSample, locStamped->packetSize(), &locFrameStart, &locFrameEnd);
+ HRESULT locHR = ((FLACDecodeOutputPin*)(mOutputPin))->mDataQueue->Receive(locSample);
+ if (locHR != S_OK) {
+
+ } else {
+ //debugLog<<"Write_Callback : Delivery of sample succeeded"<<endl;
+ }
+ } else {
+ delete locStamped;
+ throw 0; //SAMPLE SIZE IS TOO SMALL TO FIT DATA
+ }
+
+
+ delete locStamped;
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
+
+ } else {
+ {
+ CAutoLock locCodecLock(mCodecLock);
+ mGotMetaData = mFLACDecoder.acceptMetadata(locPacket); //Accepts the packet.
+ }
+ if (mGotMetaData) {
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
+
+
+
+ }
+ //debugLog<<"decodeData : Successful return."<<endl;
+
+ //Should be impossible to get here.
+ return S_OK;
+ } else {
+ //debugLog<<"decodeData : Filter flushing... bad things !!!"<<endl;
+ return S_FALSE;
+ }
+
+
+}
+
+
+STDMETHODIMP FLACDecodeInputPin::BeginFlush() {
+ CAutoLock locLock(m_pLock);
+
+ //debugLog<<"BeginFlush : Calling flush on the codec."<<endl;
+
+ HRESULT locHR = AbstractTransformInputPin::BeginFlush();
+ { //PROTECT CODEC FROM IMPLODING
+ CAutoLock locCodecLock(mCodecLock);
+ mFLACDecoder.flushCodec();
+ } //END CRITICAL SECTION
+ return locHR;
+
+}
+
+STDMETHODIMP FLACDecodeInputPin::EndOfStream(void) {
+ CAutoLock locStreamLock(mStreamLock);
+ { //PROTECT CODEC FROM IMPLODING
+ CAutoLock locCodecLock(mCodecLock);
+ mFLACDecoder.flushCodec();
+ } //END CRITICAL SECTION
+
+ return AbstractTransformInputPin::EndOfStream();
+}
+
+HRESULT FLACDecodeInputPin::SetMediaType(const CMediaType* inMediaType) {
+ //FIX:::Error checking
+ //RESOLVED::: Bit better.
+
+ if (inMediaType->subtype == MEDIASUBTYPE_FLAC) {
+
+ //Keep the format block
+
+ ((FLACDecodeFilter*)mParentFilter)->setFLACFormatBlock((sFLACFormatBlock*)inMediaType->pbFormat); //Copies the format in the mutator
+
+ } else {
+ throw 0;
+ }
+ return CBaseInputPin::SetMediaType(inMediaType);
+}
+
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeInputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeInputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeInputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,84 +1,84 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-//Local Includes
-#include "FLACdecoderdllstuff.h"
-
-//External Includes
-#include "FLACPushDecoder.h"
-#include "OggPacket.h"
-#include "StampedOggPacket.h"
-
-//STL Includes
-//debug only
-#include <fstream>
-//
-using namespace std;
-
-
-class FLACDecodeInputPin
- //Base Classes
- : public AbstractTransformInputPin
-{
-public:
- //COM Initialisation
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- //Constructors
- FLACDecodeInputPin(AbstractTransformFilter* inFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes);
- virtual ~FLACDecodeInputPin(void);
-
- HRESULT SetMediaType(const CMediaType* inMediaType);
-
- virtual STDMETHODIMP BeginFlush();
- virtual STDMETHODIMP EndOfStream(void);
- virtual STDMETHODIMP NewSegment(REFERENCE_TIME inStartTime, REFERENCE_TIME inStopTime, double inRate);
-
-protected:
- //Implementation of pure virtuals from AbstractTransformInputPin
- virtual bool ConstructCodec();
- virtual void DestroyCodec();
- virtual HRESULT TransformData(unsigned char* inBuf, long inNumBytes);
-
- //Member Data
- bool mGotMetaData;
- FLACPushDecoder mFLACDecoder;
- CCritSec* mCodecLock;
- unsigned long mUptoFrame;
-
- //debug only
- //fstream debugLog;
- //
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+//Local Includes
+#include "FLACdecoderdllstuff.h"
+
+//External Includes
+#include "FLACPushDecoder.h"
+#include "OggPacket.h"
+#include "StampedOggPacket.h"
+
+//STL Includes
+//debug only
+#include <fstream>
+//
+using namespace std;
+
+
+class FLACDecodeInputPin
+ //Base Classes
+ : public AbstractTransformInputPin
+{
+public:
+ //COM Initialisation
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ //Constructors
+ FLACDecodeInputPin(AbstractTransformFilter* inFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes);
+ virtual ~FLACDecodeInputPin(void);
+
+ HRESULT SetMediaType(const CMediaType* inMediaType);
+
+ virtual STDMETHODIMP BeginFlush();
+ virtual STDMETHODIMP EndOfStream(void);
+ virtual STDMETHODIMP NewSegment(REFERENCE_TIME inStartTime, REFERENCE_TIME inStopTime, double inRate);
+
+protected:
+ //Implementation of pure virtuals from AbstractTransformInputPin
+ virtual bool ConstructCodec();
+ virtual void DestroyCodec();
+ virtual HRESULT TransformData(unsigned char* inBuf, long inNumBytes);
+
+ //Member Data
+ bool mGotMetaData;
+ FLACPushDecoder mFLACDecoder;
+ CCritSec* mCodecLock;
+ unsigned long mUptoFrame;
+
+ //debug only
+ //fstream debugLog;
+ //
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeInputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeOutputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeOutputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeOutputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,72 +1,72 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "flacdecodeoutputpin.h"
-
-FLACDecodeOutputPin::FLACDecodeOutputPin(FLACDecodeFilter* inParentFilter, CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes)
- : AbstractTransformOutputPin(inParentFilter, inFilterLock, NAME("FLACDecodeOutputPin"), L"PCM Out", 65536, 20, inAcceptableMediaTypes)
-{
-}
-
-FLACDecodeOutputPin::~FLACDecodeOutputPin(void)
-{
-}
-
-STDMETHODIMP FLACDecodeOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
- if (riid == IID_IMediaSeeking) {
- *ppv = (IMediaSeeking*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- }
-
- return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
-}
-
-HRESULT FLACDecodeOutputPin::CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition)
-{
- if (inPosition == 0) {
- WAVEFORMATEX* locWaveFormat = (WAVEFORMATEX*)outMediaType->AllocFormatBuffer(sizeof(WAVEFORMATEX));
- FLACDecodeFilter* locFilter = (FLACDecodeFilter*)mParentFilter;
-
- locWaveFormat->wFormatTag = WAVE_FORMAT_PCM;
- locWaveFormat->nChannels = locFilter->getFLACFormatBlock()->numChannels;
- locWaveFormat->nSamplesPerSec = locFilter->getFLACFormatBlock()->samplesPerSec;
- locWaveFormat->wBitsPerSample = locFilter->getFLACFormatBlock()->numBitsPerSample;
- locWaveFormat->nBlockAlign = (locWaveFormat->nChannels) * (locWaveFormat->wBitsPerSample >> 3);
- locWaveFormat->nAvgBytesPerSec = ((locWaveFormat->nChannels) * (locWaveFormat->wBitsPerSample >> 3)) * locWaveFormat->nSamplesPerSec;
- locWaveFormat->cbSize = 0;
- return S_OK;
- } else {
- return S_FALSE;
- }
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "flacdecodeoutputpin.h"
+
+FLACDecodeOutputPin::FLACDecodeOutputPin(FLACDecodeFilter* inParentFilter, CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes)
+ : AbstractTransformOutputPin(inParentFilter, inFilterLock, NAME("FLACDecodeOutputPin"), L"PCM Out", 65536, 20, inAcceptableMediaTypes)
+{
+}
+
+FLACDecodeOutputPin::~FLACDecodeOutputPin(void)
+{
+}
+
+STDMETHODIMP FLACDecodeOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+ if (riid == IID_IMediaSeeking) {
+ *ppv = (IMediaSeeking*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ }
+
+ return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
+}
+
+HRESULT FLACDecodeOutputPin::CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition)
+{
+ if (inPosition == 0) {
+ WAVEFORMATEX* locWaveFormat = (WAVEFORMATEX*)outMediaType->AllocFormatBuffer(sizeof(WAVEFORMATEX));
+ FLACDecodeFilter* locFilter = (FLACDecodeFilter*)mParentFilter;
+
+ locWaveFormat->wFormatTag = WAVE_FORMAT_PCM;
+ locWaveFormat->nChannels = locFilter->getFLACFormatBlock()->numChannels;
+ locWaveFormat->nSamplesPerSec = locFilter->getFLACFormatBlock()->samplesPerSec;
+ locWaveFormat->wBitsPerSample = locFilter->getFLACFormatBlock()->numBitsPerSample;
+ locWaveFormat->nBlockAlign = (locWaveFormat->nChannels) * (locWaveFormat->wBitsPerSample >> 3);
+ locWaveFormat->nAvgBytesPerSec = ((locWaveFormat->nChannels) * (locWaveFormat->wBitsPerSample >> 3)) * locWaveFormat->nSamplesPerSec;
+ locWaveFormat->cbSize = 0;
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeOutputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeOutputPin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeOutputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeOutputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,56 +1,56 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-//Local Includes
-#include "FLACdecoderdllstuff.h"
-
-//Forward Declarations
-class FLACDecodeFilter;
-
-class FLACDecodeOutputPin
- : public AbstractTransformOutputPin
-{
-public:
- //Friend Classes
- friend class FLACDecodeInputPin;
-
- //COM Initialisation
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- //Constructors
- FLACDecodeOutputPin(FLACDecodeFilter* inParentFilter, CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes);
- virtual ~FLACDecodeOutputPin(void);
-protected:
- virtual HRESULT CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition);
- //virtual bool FillWaveFormatExBuffer(WAVEFORMATEX* inFormatBuffer);
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+//Local Includes
+#include "FLACdecoderdllstuff.h"
+
+//Forward Declarations
+class FLACDecodeFilter;
+
+class FLACDecodeOutputPin
+ : public AbstractTransformOutputPin
+{
+public:
+ //Friend Classes
+ friend class FLACDecodeInputPin;
+
+ //COM Initialisation
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ //Constructors
+ FLACDecodeOutputPin(FLACDecodeFilter* inParentFilter, CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes);
+ virtual ~FLACDecodeOutputPin(void);
+protected:
+ virtual HRESULT CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition);
+ //virtual bool FillWaveFormatExBuffer(WAVEFORMATEX* inFormatBuffer);
+};
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACDecodeOutputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACdecoderdllstuff.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACdecoderdllstuff.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACdecoderdllstuff.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,95 +1,95 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "FLACdecoderdllstuff.h"
-
-extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
-BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
-{
- return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
-}
-
-
-//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
-STDAPI DllRegisterServer()
-{
-
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(TRUE);
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
-
-
- hr = locFilterMapper->RegisterFilter(
- CLSID_FLACDecodeFilter, // Filter CLSID.
- L"FLAC Decode Filter", // Filter name.
- NULL, // Device moniker.
- &CLSID_LegacyAmFilterCategory, // Direct Show general category
- L"FLAC Decode Filter", // Instance data. ???????
- &FLACDecodeFilterReg // Pointer to filter information.
- );
-
- locFilterMapper->Release();
-
- return hr;
-
-}
-
-STDAPI DllUnregisterServer()
-{
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(FALSE);
- if (FAILED(hr)) {
-
- return hr;
- }
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
- IID_IFilterMapper2, (void **)&locFilterMapper);
-
- if (FAILED(hr)) {
- return hr;
- }
-
-
- hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, L"FLAC Decode Filter", CLSID_FLACDecodeFilter);
-
-
- //
- locFilterMapper->Release();
- return hr;
-
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "FLACdecoderdllstuff.h"
+
+extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
+BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+ return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
+}
+
+
+//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
+STDAPI DllRegisterServer()
+{
+
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(TRUE);
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
+
+
+ hr = locFilterMapper->RegisterFilter(
+ CLSID_FLACDecodeFilter, // Filter CLSID.
+ L"FLAC Decode Filter", // Filter name.
+ NULL, // Device moniker.
+ &CLSID_LegacyAmFilterCategory, // Direct Show general category
+ L"FLAC Decode Filter", // Instance data. ???????
+ &FLACDecodeFilterReg // Pointer to filter information.
+ );
+
+ locFilterMapper->Release();
+
+ return hr;
+
+}
+
+STDAPI DllUnregisterServer()
+{
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(FALSE);
+ if (FAILED(hr)) {
+
+ return hr;
+ }
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
+ IID_IFilterMapper2, (void **)&locFilterMapper);
+
+ if (FAILED(hr)) {
+ return hr;
+ }
+
+
+ hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, L"FLAC Decode Filter", CLSID_FLACDecodeFilter);
+
+
+ //
+ locFilterMapper->Release();
+ return hr;
+
+}
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACdecoderdllstuff.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACdecoderdllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACdecoderdllstuff.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACdecoderdllstuff.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,113 +1,113 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-
-#pragma once
-//#ifdef DSFABSTRACOGGAUDIODECODER_EXPORTS
-//#pragma message("----> Exporting from Abstract Library...")
-//#define ABS_AUDIO_DEC_API __declspec(dllexport)
-//#else
-//#pragma message("<---- Importing from Abstract Library...")
-//#define ABS_AUDIO_DEC_API __declspec(dllimport)
-//#endif
-
-struct sFLACFormatBlock {
- unsigned short numChannels;
- unsigned long numBitsPerSample;
- unsigned long samplesPerSec;
-};
-
-#include "AbstractTransformFilter.h"
-#include "AbstractTransformInputPin.h"
-#include "AbstractTransformOutputPin.h"
-#include "FLACDecodeFilter.h"
-#include "FLACDecodeInputPin.h"
-#include "FLACDecodeOutputPin.h"
-
-
-// {3913F0AB-E7ED-41c4-979B-1D1FDD983C07}
-DEFINE_GUID(MEDIASUBTYPE_FLAC,
-0x3913f0ab, 0xe7ed, 0x41c4, 0x97, 0x9b, 0x1d, 0x1f, 0xdd, 0x98, 0x3c, 0x7);
-
-// {3376086C-D6F9-4ce4-8B89-33CD570106B5}
-DEFINE_GUID(CLSID_FLACDecodeFilter,
-0x3376086c, 0xd6f9, 0x4ce4, 0x8b, 0x89, 0x33, 0xcd, 0x57, 0x1, 0x6, 0xb5);
-
-// {1CDC48AC-4C24-4b8b-982B-7007A29D83C4}
-DEFINE_GUID(FORMAT_FLAC,
-0x1cdc48ac, 0x4c24, 0x4b8b, 0x98, 0x2b, 0x70, 0x7, 0xa2, 0x9d, 0x83, 0xc4);
-
-
-const REGPINTYPES FLACDecodeOutputTypes = {
- &MEDIATYPE_Audio,
- &MEDIASUBTYPE_PCM
-};
-
-const REGPINTYPES FLACDecodeInputTypes = {
- &MEDIATYPE_Audio,
- &MEDIASUBTYPE_FLAC
-};
-const REGFILTERPINS FLACDecodePinReg[] = {
- {
- L"FLAC Input", //Name (obsoleted)
- FALSE, //Renders from this pin ?? Not sure about this.
- FALSE, //Not an output pin
- FALSE, //Cannot have zero instances of this pin
- FALSE, //Cannot have more than one instance of this pin
- NULL, //Connects to filter (obsoleted)
- NULL, //Connects to pin (obsoleted)
- 1, //upport two media type
- &FLACDecodeInputTypes //Pointer to media type (Audio/Vorbis or Audio/Speex)
- } ,
-
- {
- L"PCM Output", //Name (obsoleted)
- FALSE, //Renders from this pin ?? Not sure about this.
- TRUE, //Is an output pin
- FALSE, //Cannot have zero instances of this pin
- FALSE, //Cannot have more than one instance of this pin
- NULL, //Connects to filter (obsoleted)
- NULL, //Connects to pin (obsoleted)
- 1, //Only support one media type
- &FLACDecodeOutputTypes //Pointer to media type (Audio/PCM)
-
- }
-};
-
-
-
-const REGFILTER2 FLACDecodeFilterReg = {
- 1,
- MERIT_NORMAL,
- 2,
- FLACDecodePinReg
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+
+#pragma once
+//#ifdef DSFABSTRACOGGAUDIODECODER_EXPORTS
+//#pragma message("----> Exporting from Abstract Library...")
+//#define ABS_AUDIO_DEC_API __declspec(dllexport)
+//#else
+//#pragma message("<---- Importing from Abstract Library...")
+//#define ABS_AUDIO_DEC_API __declspec(dllimport)
+//#endif
+
+struct sFLACFormatBlock {
+ unsigned short numChannels;
+ unsigned long numBitsPerSample;
+ unsigned long samplesPerSec;
+};
+
+#include "AbstractTransformFilter.h"
+#include "AbstractTransformInputPin.h"
+#include "AbstractTransformOutputPin.h"
+#include "FLACDecodeFilter.h"
+#include "FLACDecodeInputPin.h"
+#include "FLACDecodeOutputPin.h"
+
+
+// {3913F0AB-E7ED-41c4-979B-1D1FDD983C07}
+DEFINE_GUID(MEDIASUBTYPE_FLAC,
+0x3913f0ab, 0xe7ed, 0x41c4, 0x97, 0x9b, 0x1d, 0x1f, 0xdd, 0x98, 0x3c, 0x7);
+
+// {3376086C-D6F9-4ce4-8B89-33CD570106B5}
+DEFINE_GUID(CLSID_FLACDecodeFilter,
+0x3376086c, 0xd6f9, 0x4ce4, 0x8b, 0x89, 0x33, 0xcd, 0x57, 0x1, 0x6, 0xb5);
+
+// {1CDC48AC-4C24-4b8b-982B-7007A29D83C4}
+DEFINE_GUID(FORMAT_FLAC,
+0x1cdc48ac, 0x4c24, 0x4b8b, 0x98, 0x2b, 0x70, 0x7, 0xa2, 0x9d, 0x83, 0xc4);
+
+
+const REGPINTYPES FLACDecodeOutputTypes = {
+ &MEDIATYPE_Audio,
+ &MEDIASUBTYPE_PCM
+};
+
+const REGPINTYPES FLACDecodeInputTypes = {
+ &MEDIATYPE_Audio,
+ &MEDIASUBTYPE_FLAC
+};
+const REGFILTERPINS FLACDecodePinReg[] = {
+ {
+ L"FLAC Input", //Name (obsoleted)
+ FALSE, //Renders from this pin ?? Not sure about this.
+ FALSE, //Not an output pin
+ FALSE, //Cannot have zero instances of this pin
+ FALSE, //Cannot have more than one instance of this pin
+ NULL, //Connects to filter (obsoleted)
+ NULL, //Connects to pin (obsoleted)
+ 1, //upport two media type
+ &FLACDecodeInputTypes //Pointer to media type (Audio/Vorbis or Audio/Speex)
+ } ,
+
+ {
+ L"PCM Output", //Name (obsoleted)
+ FALSE, //Renders from this pin ?? Not sure about this.
+ TRUE, //Is an output pin
+ FALSE, //Cannot have zero instances of this pin
+ FALSE, //Cannot have more than one instance of this pin
+ NULL, //Connects to filter (obsoleted)
+ NULL, //Connects to pin (obsoleted)
+ 1, //Only support one media type
+ &FLACDecodeOutputTypes //Pointer to media type (Audio/PCM)
+
+ }
+};
+
+
+
+const REGFILTER2 FLACDecodeFilterReg = {
+ 1,
+ MERIT_NORMAL,
+ 2,
+ FLACDecodePinReg
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/FLACdecoderdllstuff.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/dsfFLACDecoder.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/dsfFLACDecoder.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/dsfFLACDecoder.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,12 +1,12 @@
-// dsfFLACDecoder.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- return TRUE;
-}
-
+// dsfFLACDecoder.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ return TRUE;
+}
+
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/dsfFLACDecoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,40 +1,40 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.cpp : source file that includes just the standard includes
-// dsfFLACDecoder.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.cpp : source file that includes just the standard includes
+// dsfFLACDecoder.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,45 +1,45 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-
-// TODO: reference additional headers your program requires here
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACDecoder/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeFilter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeFilter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,108 +1,108 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-
-
-#include "FLACEncodeFilter.h"
-
-
-//COM Factory Template
-CFactoryTemplate g_Templates[] =
-{
- {
- L"FLAC Encode Filter", // Name
- &CLSID_FLACEncodeFilter, // CLSID
- FLACEncodeFilter::CreateInstance, // Method to create an instance of MyComponent
- NULL, // Initialization function
- NULL // Set-up information (for filters)
- }
-
-};
-
-// Generic way of determining the number of items in the template
-int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
-
-CUnknown* WINAPI FLACEncodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
-{
- //This routine is the COM implementation to create a new Filter
- FLACEncodeFilter *pNewObject = new FLACEncodeFilter();
- if (pNewObject == NULL) {
- *pHr = E_OUTOFMEMORY;
- }
- return pNewObject;
-}
-
-FLACEncodeFilter::FLACEncodeFilter(void)
- : AbstractTransformFilter(NAME("FLAC Encoder"), CLSID_FLACEncodeFilter)
-{
- bool locWasConstructed = ConstructPins();
-}
-
-FLACEncodeFilter::~FLACEncodeFilter(void)
-{
-}
-
-bool FLACEncodeFilter::ConstructPins()
-{
- //Input : Audio / PCM / WaveFormatEx
- //Output : Audio / FLAC_1_0 / FLAC
-
-
- //Vector to hold our set of media types we want to accept.
- vector<CMediaType*> locAcceptableTypes;
-
- //Setup the media types for the output pin.
- CMediaType* locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted in pin destructor
- locAcceptMediaType->subtype = MEDIASUBTYPE_OggFLAC_1_0;
- locAcceptMediaType->formattype = FORMAT_FLAC;
-
- locAcceptableTypes.push_back(locAcceptMediaType);
-
- //Output pin must be done first because it's passed to the input pin.
- mOutputPin = new FLACEncodeOutputPin(this, m_pLock, locAcceptableTypes); //Deleted in base class destructor
-
- //Clear out the vector, now we've already passed it to the output pin.
- locAcceptableTypes.clear();
-
- //Setup the media Types for the input pin.
- locAcceptMediaType = NULL;
- locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted by pin
-
- locAcceptMediaType->subtype = MEDIASUBTYPE_PCM;
- locAcceptMediaType->formattype = FORMAT_WaveFormatEx;
-
- locAcceptableTypes.push_back(locAcceptMediaType);
-
- mInputPin = new FLACEncodeInputPin(this, m_pLock, mOutputPin, locAcceptableTypes); //Deleted in base class filter destructor.
- return true;
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+
+
+#include "FLACEncodeFilter.h"
+
+
+//COM Factory Template
+CFactoryTemplate g_Templates[] =
+{
+ {
+ L"FLAC Encode Filter", // Name
+ &CLSID_FLACEncodeFilter, // CLSID
+ FLACEncodeFilter::CreateInstance, // Method to create an instance of MyComponent
+ NULL, // Initialization function
+ NULL // Set-up information (for filters)
+ }
+
+};
+
+// Generic way of determining the number of items in the template
+int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
+
+CUnknown* WINAPI FLACEncodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
+{
+ //This routine is the COM implementation to create a new Filter
+ FLACEncodeFilter *pNewObject = new FLACEncodeFilter();
+ if (pNewObject == NULL) {
+ *pHr = E_OUTOFMEMORY;
+ }
+ return pNewObject;
+}
+
+FLACEncodeFilter::FLACEncodeFilter(void)
+ : AbstractTransformFilter(NAME("FLAC Encoder"), CLSID_FLACEncodeFilter)
+{
+ bool locWasConstructed = ConstructPins();
+}
+
+FLACEncodeFilter::~FLACEncodeFilter(void)
+{
+}
+
+bool FLACEncodeFilter::ConstructPins()
+{
+ //Input : Audio / PCM / WaveFormatEx
+ //Output : Audio / FLAC_1_0 / FLAC
+
+
+ //Vector to hold our set of media types we want to accept.
+ vector<CMediaType*> locAcceptableTypes;
+
+ //Setup the media types for the output pin.
+ CMediaType* locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted in pin destructor
+ locAcceptMediaType->subtype = MEDIASUBTYPE_OggFLAC_1_0;
+ locAcceptMediaType->formattype = FORMAT_FLAC;
+
+ locAcceptableTypes.push_back(locAcceptMediaType);
+
+ //Output pin must be done first because it's passed to the input pin.
+ mOutputPin = new FLACEncodeOutputPin(this, m_pLock, locAcceptableTypes); //Deleted in base class destructor
+
+ //Clear out the vector, now we've already passed it to the output pin.
+ locAcceptableTypes.clear();
+
+ //Setup the media Types for the input pin.
+ locAcceptMediaType = NULL;
+ locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted by pin
+
+ locAcceptMediaType->subtype = MEDIASUBTYPE_PCM;
+ locAcceptMediaType->formattype = FORMAT_WaveFormatEx;
+
+ locAcceptableTypes.push_back(locAcceptMediaType);
+
+ mInputPin = new FLACEncodeInputPin(this, m_pLock, mOutputPin, locAcceptableTypes); //Deleted in base class filter destructor.
+ return true;
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeFilter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeFilter.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeFilter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeFilter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,69 +1,69 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-//Local Includes
-#include "flacencoderdllstuff.h"
-
-//External Includes
-#include "AbstractTransformFilter.h"
-
-//Forward Declarations
-struct sFLACFormatBlock;
-class FLACEncodeInputPin;
-class FLACEncodeOutputPin;
-
-class FLACEncodeFilter
- //Base Classes
- : public AbstractTransformFilter
-{
-public:
- //Friend Classes
- friend class FLACEncodeInputPin;
- friend class FLACEncodeOutputPin;
-
- //Constructors
- FLACEncodeFilter(void);
- virtual ~FLACEncodeFilter(void);
-
- //COM Creator function
- static CUnknown* WINAPI FLACEncodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
-
-protected:
- //PURE VIRTUAL IMPLEMENTATION
- virtual bool ConstructPins();
-
- //TODO::: This shouldn'y be here... use the getter setters.
- sFLACFormatBlock mFLACFormatBlock;
-
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+//Local Includes
+#include "flacencoderdllstuff.h"
+
+//External Includes
+#include "AbstractTransformFilter.h"
+
+//Forward Declarations
+struct sFLACFormatBlock;
+class FLACEncodeInputPin;
+class FLACEncodeOutputPin;
+
+class FLACEncodeFilter
+ //Base Classes
+ : public AbstractTransformFilter
+{
+public:
+ //Friend Classes
+ friend class FLACEncodeInputPin;
+ friend class FLACEncodeOutputPin;
+
+ //Constructors
+ FLACEncodeFilter(void);
+ virtual ~FLACEncodeFilter(void);
+
+ //COM Creator function
+ static CUnknown* WINAPI FLACEncodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+
+protected:
+ //PURE VIRTUAL IMPLEMENTATION
+ virtual bool ConstructPins();
+
+ //TODO::: This shouldn'y be here... use the getter setters.
+ sFLACFormatBlock mFLACFormatBlock;
+
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeFilter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeInputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeInputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,65 +1,65 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "FLACencodeinputpin.h"
-
-FLACEncodeInputPin::FLACEncodeInputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes)
- : AbstractTransformInputPin(inParentFilter, inFilterLock, inOutputPin, NAME("FLACEncodeInputPin"), L"PCM In", inAcceptableMediaTypes)
- , mTweakedHeaders(false)
- , mBegun(false)
- , mWaveFormat(NULL)
- , mUptoFrame(0)
-
-
-{
- //debugLog.open("G:\\logs\\FLACenc.log", ios_base::out);
-}
-
-FLACEncodeInputPin::~FLACEncodeInputPin(void)
-{
- //debugLog.close();
- DestroyCodec();
-}
-
-
-//PURE VIRTUALS
-HRESULT FLACEncodeInputPin::TransformData(unsigned char* inBuf, long inNumBytes) {
-
- if (mBegun == false) {
-
- //First bit of data, set up the encoder.
- mBegun = true;
- init();
- }
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "FLACencodeinputpin.h"
+
+FLACEncodeInputPin::FLACEncodeInputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes)
+ : AbstractTransformInputPin(inParentFilter, inFilterLock, inOutputPin, NAME("FLACEncodeInputPin"), L"PCM In", inAcceptableMediaTypes)
+ , mTweakedHeaders(false)
+ , mBegun(false)
+ , mWaveFormat(NULL)
+ , mUptoFrame(0)
+
+
+{
+ //debugLog.open("G:\\logs\\FLACenc.log", ios_base::out);
+}
+
+FLACEncodeInputPin::~FLACEncodeInputPin(void)
+{
+ //debugLog.close();
+ DestroyCodec();
+}
+
+
+//PURE VIRTUALS
+HRESULT FLACEncodeInputPin::TransformData(unsigned char* inBuf, long inNumBytes) {
+
+ if (mBegun == false) {
+
+ //First bit of data, set up the encoder.
+ mBegun = true;
+ init();
+ }
FLAC__int32* locFLACBuff = NULL;
FLACEncodeFilter* locParentFilter = (FLACEncodeFilter*)mParentFilter; //View only don't delete.
unsigned long locFLACBuffSize = (inNumBytes * 8) / locParentFilter->mFLACFormatBlock.numBitsPerSample;
@@ -85,36 +85,36 @@
} else {
return -1;
}
-
-}
-bool FLACEncodeInputPin::ConstructCodec()
-{
-
- set_channels(mWaveFormat->nChannels);
- set_sample_rate(mWaveFormat->nSamplesPerSec);
- set_bits_per_sample(mWaveFormat->wBitsPerSample);
-
- FLACEncodeFilter* locParentFilter = (FLACEncodeFilter*)mParentFilter; //View only don't delete.
- locParentFilter->mFLACFormatBlock.numBitsPerSample = mWaveFormat->wBitsPerSample;
- locParentFilter->mFLACFormatBlock.numChannels = mWaveFormat->nChannels;
- locParentFilter->mFLACFormatBlock.sampleRate = mWaveFormat->nSamplesPerSec;
-
- //This can't be here, it causes callbacks to fire, and the data can't be delivered
- // because the filter is not fully set up yet.
- //init();
-
- ////FIX::: Proper return value
- return true;
-}
-void FLACEncodeInputPin::DestroyCodec()
-{
-
- //Should there be some cleanup function ??
-}
-
-
-
-
+
+}
+bool FLACEncodeInputPin::ConstructCodec()
+{
+
+ set_channels(mWaveFormat->nChannels);
+ set_sample_rate(mWaveFormat->nSamplesPerSec);
+ set_bits_per_sample(mWaveFormat->wBitsPerSample);
+
+ FLACEncodeFilter* locParentFilter = (FLACEncodeFilter*)mParentFilter; //View only don't delete.
+ locParentFilter->mFLACFormatBlock.numBitsPerSample = mWaveFormat->wBitsPerSample;
+ locParentFilter->mFLACFormatBlock.numChannels = mWaveFormat->nChannels;
+ locParentFilter->mFLACFormatBlock.sampleRate = mWaveFormat->nSamplesPerSec;
+
+ //This can't be here, it causes callbacks to fire, and the data can't be delivered
+ // because the filter is not fully set up yet.
+ //init();
+
+ ////FIX::: Proper return value
+ return true;
+}
+void FLACEncodeInputPin::DestroyCodec()
+{
+
+ //Should there be some cleanup function ??
+}
+
+
+
+
::FLAC__StreamEncoderWriteStatus FLACEncodeInputPin::write_callback(const FLAC__byte inBuffer[], unsigned inNumBytes, unsigned inNumSamples, unsigned inCurrentFrame) {
//This is called back with encoded data after raw data is fed in by stream_encoder_process or
@@ -143,41 +143,41 @@
//Loop through firing out all the headers.
//debugLog<<"Sending new header "<<i<<endl;
- //Get a pointer to a new sample stamped with our time
- IMediaSample* locSample;
- HRESULT locHR = mOutputPin->GetDeliveryBuffer(&locSample, NULL, NULL, NULL);
-
- if (FAILED(locHR)) {
- //We get here when the application goes into stop mode usually.
- //locThis->debugLog<<"Getting buffer failed"<<endl;
- return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR;
- }
-
- BYTE* locBuffer = NULL;
-
- //Make our pointers set to point to the samples buffer
- locSample->GetPointer(&locBuffer);
-
- memcpy((void*)locBuffer, (const void*)mHeaderTweaker.getHeader(i)->packetData(), mHeaderTweaker.getHeader(i)->packetSize());
-
- //Set the sample parameters. (stamps will be 0)
- SetSampleParams(locSample, mHeaderTweaker.getHeader(i)->packetSize(), &locFrameStart, &locFrameEnd);
-
- {
- CAutoLock locLock(m_pLock);
-
-
- HRESULT locHR = ((FLACEncodeOutputPin*)(mOutputPin))->mDataQueue->Receive(locSample); //->DownstreamFilter()->Receive(locSample);
- if (locHR != S_OK) {
- //debugLog<<"Sample rejected"<<endl;
- } else {
- //debugLog<<"Sample Delivered"<<endl;
- }
- }
-
-
+ //Get a pointer to a new sample stamped with our time
+ IMediaSample* locSample;
+ HRESULT locHR = mOutputPin->GetDeliveryBuffer(&locSample, NULL, NULL, NULL);
+ if (FAILED(locHR)) {
+ //We get here when the application goes into stop mode usually.
+ //locThis->debugLog<<"Getting buffer failed"<<endl;
+ return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR;
+ }
+
+ BYTE* locBuffer = NULL;
+ //Make our pointers set to point to the samples buffer
+ locSample->GetPointer(&locBuffer);
+
+ memcpy((void*)locBuffer, (const void*)mHeaderTweaker.getHeader(i)->packetData(), mHeaderTweaker.getHeader(i)->packetSize());
+
+ //Set the sample parameters. (stamps will be 0)
+ SetSampleParams(locSample, mHeaderTweaker.getHeader(i)->packetSize(), &locFrameStart, &locFrameEnd);
+
+ {
+ CAutoLock locLock(m_pLock);
+
+
+ HRESULT locHR = ((FLACEncodeOutputPin*)(mOutputPin))->mDataQueue->Receive(locSample); //->DownstreamFilter()->Receive(locSample);
+ if (locHR != S_OK) {
+ //debugLog<<"Sample rejected"<<endl;
+ } else {
+ //debugLog<<"Sample Delivered"<<endl;
+ }
+ }
+
+
+
+
}
return FLAC__STREAM_ENCODER_WRITE_STATUS_OK;
@@ -192,83 +192,83 @@
}
- locFrameStart = mUptoFrame;
- if (inNumSamples != 0) {
- mUptoFrame += inNumSamples;
- }
+ locFrameStart = mUptoFrame;
+ if (inNumSamples != 0) {
+ mUptoFrame += inNumSamples;
+ }
locFrameEnd = mUptoFrame;
- //Get a pointer to a new sample stamped with our time
- IMediaSample* locSample;
- HRESULT locHR = mOutputPin->GetDeliveryBuffer(&locSample, &locFrameStart, &locFrameEnd, NULL);
-
- if (FAILED(locHR)) {
- //We get here when the application goes into stop mode usually.
- //locThis->debugLog<<"Getting buffer failed"<<endl;
- return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR;
- }
-
- BYTE* locBuffer = NULL;
-
- //Make our pointers set to point to the samples buffer
- locSample->GetPointer(&locBuffer);
-
- if (locSample->GetSize() >= inNumBytes) {
-
- memcpy((void*)locBuffer, (const void*)inBuffer, inNumBytes);
-
- //Set the sample parameters.
- SetSampleParams(locSample, inNumBytes, &locFrameStart, &locFrameEnd);
-
- {
- CAutoLock locLock(m_pLock);
-
-
- HRESULT locHR = ((FLACEncodeOutputPin*)(mOutputPin))->mDataQueue->Receive(locSample); //->DownstreamFilter()->Receive(locSample);
- if (locHR != S_OK) {
- //locThis->debugLog<<"Sample rejected"<<endl;
- } else {
- //locThis->debugLog<<"Sample Delivered"<<endl;
- }
- }
-
- return FLAC__STREAM_ENCODER_WRITE_STATUS_OK;
- } else {
- throw 0;
+ //Get a pointer to a new sample stamped with our time
+ IMediaSample* locSample;
+ HRESULT locHR = mOutputPin->GetDeliveryBuffer(&locSample, &locFrameStart, &locFrameEnd, NULL);
+
+ if (FAILED(locHR)) {
+ //We get here when the application goes into stop mode usually.
+ //locThis->debugLog<<"Getting buffer failed"<<endl;
+ return FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR;
+ }
+
+ BYTE* locBuffer = NULL;
+
+ //Make our pointers set to point to the samples buffer
+ locSample->GetPointer(&locBuffer);
+
+ if (locSample->GetSize() >= inNumBytes) {
+
+ memcpy((void*)locBuffer, (const void*)inBuffer, inNumBytes);
+
+ //Set the sample parameters.
+ SetSampleParams(locSample, inNumBytes, &locFrameStart, &locFrameEnd);
+
+ {
+ CAutoLock locLock(m_pLock);
+
+
+ HRESULT locHR = ((FLACEncodeOutputPin*)(mOutputPin))->mDataQueue->Receive(locSample); //->DownstreamFilter()->Receive(locSample);
+ if (locHR != S_OK) {
+ //locThis->debugLog<<"Sample rejected"<<endl;
+ } else {
+ //locThis->debugLog<<"Sample Delivered"<<endl;
+ }
+ }
+
+ return FLAC__STREAM_ENCODER_WRITE_STATUS_OK;
+ } else {
+ throw 0;
}
}
-void FLACEncodeInputPin::metadata_callback(const ::FLAC__StreamMetadata *metadata)
-{
-
- //Ignore it.
-}
-
-STDMETHODIMP FLACEncodeInputPin::EndOfStream(void) {
- //Catch the end of stream so we can send a finish signal.
- finish(); //Tell flac we are done so it can flush
- return AbstractTransformInputPin::EndOfStream(); //Call the base class.
-}
-
-HRESULT FLACEncodeInputPin::SetMediaType(const CMediaType* inMediaType)
-{
-
- if ( (inMediaType->subtype == MEDIASUBTYPE_PCM) &&
- (inMediaType->formattype == FORMAT_WaveFormatEx)) {
-
- mWaveFormat = (WAVEFORMATEX*)inMediaType->pbFormat;
-
- } else {
- //Failed... should never be here !
- throw 0;
- }
- //This is here and not the constructor because we need audio params from the
- // input pin to construct properly.
-
- ConstructCodec();
-
- return CBaseInputPin::SetMediaType(inMediaType);
-
+void FLACEncodeInputPin::metadata_callback(const ::FLAC__StreamMetadata *metadata)
+{
+
+ //Ignore it.
+}
+
+STDMETHODIMP FLACEncodeInputPin::EndOfStream(void) {
+ //Catch the end of stream so we can send a finish signal.
+ finish(); //Tell flac we are done so it can flush
+ return AbstractTransformInputPin::EndOfStream(); //Call the base class.
+}
+
+HRESULT FLACEncodeInputPin::SetMediaType(const CMediaType* inMediaType)
+{
+
+ if ( (inMediaType->subtype == MEDIASUBTYPE_PCM) &&
+ (inMediaType->formattype == FORMAT_WaveFormatEx)) {
+
+ mWaveFormat = (WAVEFORMATEX*)inMediaType->pbFormat;
+
+ } else {
+ //Failed... should never be here !
+ throw 0;
+ }
+ //This is here and not the constructor because we need audio params from the
+ // input pin to construct properly.
+
+ ConstructCodec();
+
+ return CBaseInputPin::SetMediaType(inMediaType);
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeInputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeInputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeInputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,83 +1,83 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-#include "FLAC++/encoder.h"
-#include "AbstractTransformInputPin.h"
-#include "FLACEncodeInputPin.h"
-
-#include "FLACEncodeFilter.h"
-#include "FLACHeaderTweaker.h"
-
-
-//#include <fstream>
-//using namespace std;
-
-using namespace FLAC::Encoder;
-
-class FLACEncodeInputPin
- : public AbstractTransformInputPin
- , public Stream
-{
-public:
- FLACEncodeInputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes);
- virtual ~FLACEncodeInputPin(void);
-
- //static int FLACEncodeInputPin::FLACEncoded (FishSound* inFishSound, unsigned char* inPacketData, long inNumBytes, void* inThisPointer) ;
- //PURE VIRTUALS from Flac Encoder
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+#include "FLAC++/encoder.h"
+#include "AbstractTransformInputPin.h"
+#include "FLACEncodeInputPin.h"
+
+#include "FLACEncodeFilter.h"
+#include "FLACHeaderTweaker.h"
+
+
+//#include <fstream>
+//using namespace std;
+
+using namespace FLAC::Encoder;
+
+class FLACEncodeInputPin
+ : public AbstractTransformInputPin
+ , public Stream
+{
+public:
+ FLACEncodeInputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes);
+ virtual ~FLACEncodeInputPin(void);
+
+ //static int FLACEncodeInputPin::FLACEncoded (FishSound* inFishSound, unsigned char* inPacketData, long inNumBytes, void* inThisPointer) ;
+ //PURE VIRTUALS from Flac Encoder
virtual ::FLAC__StreamEncoderWriteStatus write_callback(const FLAC__byte buffer[], unsigned bytes, unsigned samples, unsigned current_frame);
- virtual void metadata_callback(const ::FLAC__StreamMetadata *metadata);
-
-
- virtual HRESULT SetMediaType(const CMediaType* inMediaType);
-
- //OVerrides
- virtual STDMETHODIMP EndOfStream(void);
-protected:
-
- //PURE VIRTUALS from Abstract Encoder
- virtual HRESULT TransformData(unsigned char* inBuf, long inNumBytes);
- virtual bool ConstructCodec();
- virtual void DestroyCodec();
-
- HRESULT mHR;
- WAVEFORMATEX* mWaveFormat;
- bool mTweakedHeaders;
- FLACHeaderTweaker mHeaderTweaker;
-
- bool mBegun;
-
- __int64 mUptoFrame;
-
- //fstream debugLog;
-
-};
+ virtual void metadata_callback(const ::FLAC__StreamMetadata *metadata);
+
+
+ virtual HRESULT SetMediaType(const CMediaType* inMediaType);
+
+ //OVerrides
+ virtual STDMETHODIMP EndOfStream(void);
+protected:
+
+ //PURE VIRTUALS from Abstract Encoder
+ virtual HRESULT TransformData(unsigned char* inBuf, long inNumBytes);
+ virtual bool ConstructCodec();
+ virtual void DestroyCodec();
+
+ HRESULT mHR;
+ WAVEFORMATEX* mWaveFormat;
+ bool mTweakedHeaders;
+ FLACHeaderTweaker mHeaderTweaker;
+
+ bool mBegun;
+
+ __int64 mUptoFrame;
+
+ //fstream debugLog;
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeInputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeOutputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeOutputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeOutputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,66 +1,66 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "FLACencodeoutputpin.h"
-
-FLACEncodeOutputPin::FLACEncodeOutputPin(FLACEncodeFilter* inParentFilter,CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes)
- : AbstractTransformOutputPin(inParentFilter, inFilterLock,NAME("FLACDecodeOutputPin"), L"FLAC Out", 131072, 5, inAcceptableMediaTypes)
-{
-}
-
-FLACEncodeOutputPin::~FLACEncodeOutputPin(void)
-{
-}
-
-HRESULT FLACEncodeOutputPin::CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition)
-{
- if (inPosition == 0) {
- sFLACFormatBlock* locFLACFormat = (sFLACFormatBlock*)outMediaType->AllocFormatBuffer(sizeof(sFLACFormatBlock));
- //TODO::: Check for null ?
-
- memcpy((void*)locFLACFormat, (const void*) &(((FLACEncodeFilter*)mParentFilter)->mFLACFormatBlock), sizeof(sFLACFormatBlock));
- return S_OK;
- } else {
- return S_FALSE;
- }
-}
-
-//bool FLACEncodeOutputPin::FillFormatBuffer(BYTE* inFormatBuffer) {
-// FLACEncodeFilter* locParentFilter = (FLACEncodeFilter*)mParentFilter;
-//
-// //TODO::: This is not needed... put in a get and set
-// memcpy((void*)inFormatBuffer, (const void*) &(locParentFilter->mFLACFormatBlock), sizeof(sFLACFormatBlock));
-// return true;
-//}
-//unsigned long FLACEncodeOutputPin::FormatBufferSize() {
-// return sizeof(sFLACFormatBlock);
-//}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "FLACencodeoutputpin.h"
+
+FLACEncodeOutputPin::FLACEncodeOutputPin(FLACEncodeFilter* inParentFilter,CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes)
+ : AbstractTransformOutputPin(inParentFilter, inFilterLock,NAME("FLACDecodeOutputPin"), L"FLAC Out", 131072, 5, inAcceptableMediaTypes)
+{
+}
+
+FLACEncodeOutputPin::~FLACEncodeOutputPin(void)
+{
+}
+
+HRESULT FLACEncodeOutputPin::CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition)
+{
+ if (inPosition == 0) {
+ sFLACFormatBlock* locFLACFormat = (sFLACFormatBlock*)outMediaType->AllocFormatBuffer(sizeof(sFLACFormatBlock));
+ //TODO::: Check for null ?
+
+ memcpy((void*)locFLACFormat, (const void*) &(((FLACEncodeFilter*)mParentFilter)->mFLACFormatBlock), sizeof(sFLACFormatBlock));
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
+}
+
+//bool FLACEncodeOutputPin::FillFormatBuffer(BYTE* inFormatBuffer) {
+// FLACEncodeFilter* locParentFilter = (FLACEncodeFilter*)mParentFilter;
+//
+// //TODO::: This is not needed... put in a get and set
+// memcpy((void*)inFormatBuffer, (const void*) &(locParentFilter->mFLACFormatBlock), sizeof(sFLACFormatBlock));
+// return true;
+//}
+//unsigned long FLACEncodeOutputPin::FormatBufferSize() {
+// return sizeof(sFLACFormatBlock);
+//}
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeOutputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeOutputPin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeOutputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeOutputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,56 +1,56 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-#include "FLACencoderdllstuff.h"
-#include "AbstractTransformOutputPin.h"
-
-class FLACEncodeFilter;
-struct sFLACFormatBlock;
-
-class FLACEncodeOutputPin
- : public AbstractTransformOutputPin
-{
-public:
-
- friend class FLACEncodeInputPin;
- FLACEncodeOutputPin(FLACEncodeFilter* inParentFilter, CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes);
- virtual ~FLACEncodeOutputPin(void);
-
- ////PURE VIRTUAL IMPLEMENTATION
- //virtual bool FillFormatBuffer(BYTE* inFormatBuffer);
- //virtual unsigned long FormatBufferSize();
-
-
-protected:
- virtual HRESULT CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition);
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+#include "FLACencoderdllstuff.h"
+#include "AbstractTransformOutputPin.h"
+
+class FLACEncodeFilter;
+struct sFLACFormatBlock;
+
+class FLACEncodeOutputPin
+ : public AbstractTransformOutputPin
+{
+public:
+
+ friend class FLACEncodeInputPin;
+ FLACEncodeOutputPin(FLACEncodeFilter* inParentFilter, CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes);
+ virtual ~FLACEncodeOutputPin(void);
+
+ ////PURE VIRTUAL IMPLEMENTATION
+ //virtual bool FillFormatBuffer(BYTE* inFormatBuffer);
+ //virtual unsigned long FormatBufferSize();
+
+
+protected:
+ virtual HRESULT CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition);
+};
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/FLACEncodeOutputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/dsfFLACEncoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/flacencoderdllstuff.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/flacencoderdllstuff.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/flacencoderdllstuff.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,98 +1,98 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "flacencoderdllstuff.h"
-
-extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
-BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
-{
- return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
-}
-
-
-//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
-STDAPI DllRegisterServer()
-{
-
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(TRUE);
-
-
-
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
-
-
- hr = locFilterMapper->RegisterFilter(
- CLSID_FLACEncodeFilter, // Filter CLSID.
- L"FLAC Encode Filter", // Filter name.
- NULL, // Device moniker.
- &CLSID_LegacyAmFilterCategory, // Direct Show general category
- L"FLAC Encode Filter", // Instance data. ???????
- &FLACEncodeFilterReg // Pointer to filter information.
- );
-
- locFilterMapper->Release();
-
- return hr;
-
-}
-
-STDAPI DllUnregisterServer()
-{
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(FALSE);
- if (FAILED(hr)) {
-
- return hr;
- }
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
- IID_IFilterMapper2, (void **)&locFilterMapper);
-
- if (FAILED(hr)) {
- return hr;
- }
-
-
- hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, L"FLAC Encode Filter", CLSID_FLACEncodeFilter);
-
-
- //
- locFilterMapper->Release();
- return hr;
-
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "flacencoderdllstuff.h"
+
+extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
+BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+ return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
+}
+
+
+//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
+STDAPI DllRegisterServer()
+{
+
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(TRUE);
+
+
+
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
+
+
+ hr = locFilterMapper->RegisterFilter(
+ CLSID_FLACEncodeFilter, // Filter CLSID.
+ L"FLAC Encode Filter", // Filter name.
+ NULL, // Device moniker.
+ &CLSID_LegacyAmFilterCategory, // Direct Show general category
+ L"FLAC Encode Filter", // Instance data. ???????
+ &FLACEncodeFilterReg // Pointer to filter information.
+ );
+
+ locFilterMapper->Release();
+
+ return hr;
+
+}
+
+STDAPI DllUnregisterServer()
+{
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(FALSE);
+ if (FAILED(hr)) {
+
+ return hr;
+ }
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
+ IID_IFilterMapper2, (void **)&locFilterMapper);
+
+ if (FAILED(hr)) {
+ return hr;
+ }
+
+
+ hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, L"FLAC Encode Filter", CLSID_FLACEncodeFilter);
+
+
+ //
+ locFilterMapper->Release();
+ return hr;
+
+}
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/flacencoderdllstuff.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/flacencoderdllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/flacencoderdllstuff.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/flacencoderdllstuff.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,122 +1,122 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-struct sFLACFormatBlock {
- unsigned short numChannels;
- unsigned long numBitsPerSample;
- unsigned long sampleRate;
-
-};
-
-#include "AbstractTransformFilter.h"
-#include "AbstractTransformInputPin.h"
-#include "AbstractTransformOutputPin.h"
-#include "FLACEncodeInputPin.h"
-#include "FLACEncodeOutputPin.h"
-#include "FLACEncodeFilter.h"
-
-#ifdef LIBOOOGG_EXPORTS
-#define LIBOOOGG_API __declspec(dllexport)
-#else
-#define LIBOOOGG_API __declspec(dllimport)
-#endif
-
-
-//// {3913F0AB-E7ED-41c4-979B-1D1FDD983C07}
-//DEFINE_GUID(MEDIASUBTYPE_FLAC,
-//0x3913f0ab, 0xe7ed, 0x41c4, 0x97, 0x9b, 0x1d, 0x1f, 0xdd, 0x98, 0x3c, 0x7);
-
-// {2C409DB0-95BF-47ba-B0F5-587256F1EDCF}
-DEFINE_GUID(MEDIASUBTYPE_OggFLAC_1_0,
-0x2c409db0, 0x95bf, 0x47ba, 0xb0, 0xf5, 0x58, 0x72, 0x56, 0xf1, 0xed, 0xcf);
-
-// {77E3A6A3-2A24-43fa-B929-00747E4B560B}
-DEFINE_GUID(CLSID_FLACEncodeFilter,
-0x77e3a6a3, 0x2a24, 0x43fa, 0xb9, 0x29, 0x0, 0x74, 0x7e, 0x4b, 0x56, 0xb);
-
-
-// {1CDC48AC-4C24-4b8b-982B-7007A29D83C4}
-DEFINE_GUID(FORMAT_FLAC,
-0x1cdc48ac, 0x4c24, 0x4b8b, 0x98, 0x2b, 0x70, 0x7, 0xa2, 0x9d, 0x83, 0xc4);
-
-
-
-
-const REGPINTYPES FLACEncodeInputTypes = {
- &MEDIATYPE_Audio,
- &MEDIASUBTYPE_PCM
-};
-
-const REGPINTYPES FLACEncodeOutputTypes = {
- &MEDIATYPE_Audio,
- &MEDIASUBTYPE_OggFLAC_1_0
-};
-
-const REGFILTERPINS FLACEncodePinReg[] = {
- {
- L"PCM Input", //Name (obsoleted)
- FALSE, //Renders from this pin ?? Not sure about this.
- FALSE, //Not an output pin
- FALSE, //Cannot have zero instances of this pin
- FALSE, //Cannot have more than one instance of this pin
- NULL, //Connects to filter (obsoleted)
- NULL, //Connects to pin (obsoleted)
- 1, //upport two media type
- &FLACEncodeInputTypes //Pointer to media type (Audio/FLAC or Audio/FLAC)
- } ,
-
- {
- L"FLAC Output", //Name (obsoleted)
- FALSE, //Renders from this pin ?? Not sure about this.
- TRUE, //Is an output pin
- FALSE, //Cannot have zero instances of this pin
- FALSE, //Cannot have more than one instance of this pin
- NULL, //Connects to filter (obsoleted)
- NULL, //Connects to pin (obsoleted)
- 1, //Only support one media type
- &FLACEncodeOutputTypes //Pointer to media type (Audio/PCM)
-
- }
-};
-
-
-
-const REGFILTER2 FLACEncodeFilterReg = {
- 1,
- MERIT_DO_NOT_USE,
- 2,
- FLACEncodePinReg
-
-};
-
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+struct sFLACFormatBlock {
+ unsigned short numChannels;
+ unsigned long numBitsPerSample;
+ unsigned long sampleRate;
+
+};
+
+#include "AbstractTransformFilter.h"
+#include "AbstractTransformInputPin.h"
+#include "AbstractTransformOutputPin.h"
+#include "FLACEncodeInputPin.h"
+#include "FLACEncodeOutputPin.h"
+#include "FLACEncodeFilter.h"
+
+#ifdef LIBOOOGG_EXPORTS
+#define LIBOOOGG_API __declspec(dllexport)
+#else
+#define LIBOOOGG_API __declspec(dllimport)
+#endif
+
+
+//// {3913F0AB-E7ED-41c4-979B-1D1FDD983C07}
+//DEFINE_GUID(MEDIASUBTYPE_FLAC,
+//0x3913f0ab, 0xe7ed, 0x41c4, 0x97, 0x9b, 0x1d, 0x1f, 0xdd, 0x98, 0x3c, 0x7);
+
+// {2C409DB0-95BF-47ba-B0F5-587256F1EDCF}
+DEFINE_GUID(MEDIASUBTYPE_OggFLAC_1_0,
+0x2c409db0, 0x95bf, 0x47ba, 0xb0, 0xf5, 0x58, 0x72, 0x56, 0xf1, 0xed, 0xcf);
+
+// {77E3A6A3-2A24-43fa-B929-00747E4B560B}
+DEFINE_GUID(CLSID_FLACEncodeFilter,
+0x77e3a6a3, 0x2a24, 0x43fa, 0xb9, 0x29, 0x0, 0x74, 0x7e, 0x4b, 0x56, 0xb);
+
+
+// {1CDC48AC-4C24-4b8b-982B-7007A29D83C4}
+DEFINE_GUID(FORMAT_FLAC,
+0x1cdc48ac, 0x4c24, 0x4b8b, 0x98, 0x2b, 0x70, 0x7, 0xa2, 0x9d, 0x83, 0xc4);
+
+
+
+
+const REGPINTYPES FLACEncodeInputTypes = {
+ &MEDIATYPE_Audio,
+ &MEDIASUBTYPE_PCM
+};
+
+const REGPINTYPES FLACEncodeOutputTypes = {
+ &MEDIATYPE_Audio,
+ &MEDIASUBTYPE_OggFLAC_1_0
+};
+
+const REGFILTERPINS FLACEncodePinReg[] = {
+ {
+ L"PCM Input", //Name (obsoleted)
+ FALSE, //Renders from this pin ?? Not sure about this.
+ FALSE, //Not an output pin
+ FALSE, //Cannot have zero instances of this pin
+ FALSE, //Cannot have more than one instance of this pin
+ NULL, //Connects to filter (obsoleted)
+ NULL, //Connects to pin (obsoleted)
+ 1, //upport two media type
+ &FLACEncodeInputTypes //Pointer to media type (Audio/FLAC or Audio/FLAC)
+ } ,
+
+ {
+ L"FLAC Output", //Name (obsoleted)
+ FALSE, //Renders from this pin ?? Not sure about this.
+ TRUE, //Is an output pin
+ FALSE, //Cannot have zero instances of this pin
+ FALSE, //Cannot have more than one instance of this pin
+ NULL, //Connects to filter (obsoleted)
+ NULL, //Connects to pin (obsoleted)
+ 1, //Only support one media type
+ &FLACEncodeOutputTypes //Pointer to media type (Audio/PCM)
+
+ }
+};
+
+
+
+const REGFILTER2 FLACEncodeFilterReg = {
+ 1,
+ MERIT_DO_NOT_USE,
+ 2,
+ FLACEncodePinReg
+
+};
+
+
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/flacencoderdllstuff.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,39 +1,39 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.cpp : source file that includes just the standard includes
-// dsfFLACEncoder.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.cpp : source file that includes just the standard includes
+// dsfFLACEncoder.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,44 +1,44 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-// TODO: reference additional headers your program requires here
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfFLACEncoder/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,387 +1,387 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include ".\NativeFLACSourceFilter.h"
-
-CFactoryTemplate g_Templates[] =
-{
- {
- L"Native FLAC SourceFilter", // Name
- &CLSID_NativeFLACSourceFilter, // CLSID
- NativeFLACSourceFilter::CreateInstance, // Method to create an instance of MyComponent
- NULL, // Initialization function
- NULL // Set-up information (for filters)
- }
-
-};
-
-// Generic way of determining the number of items in the template
-int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
-
-
-CUnknown* WINAPI NativeFLACSourceFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
-{
- NativeFLACSourceFilter *pNewObject = new NativeFLACSourceFilter();
- if (pNewObject == NULL) {
- *pHr = E_OUTOFMEMORY;
- }
- return pNewObject;
-}
-
-NativeFLACSourceFilter::NativeFLACSourceFilter(void)
- : CBaseFilter(NAME("NativeFLACSourceFilter"), NULL, m_pLock, CLSID_NativeFLACSourceFilter)
- , mNumChannels(0)
- , mSampleRate(0)
- , mBitsPerSample(0)
- , mBegun(false)
- , mUpto(0)
- , mJustSeeked(true)
- , mSeekRequest(0)
- , mTotalNumSamples(0)
- , mWasEOF(false)
-{
- m_pLock = new CCritSec;
- mCodecLock = new CCritSec;
- mFLACSourcePin = new NativeFLACSourcePin(this, m_pLock);
-}
-
-NativeFLACSourceFilter::~NativeFLACSourceFilter(void)
-{
- delete mFLACSourcePin;
- mFLACSourcePin = NULL;
- delete mCodecLock;
-}
-
-//BaseFilter Interface
-int NativeFLACSourceFilter::GetPinCount() {
- return 1;
-}
-CBasePin* NativeFLACSourceFilter::GetPin(int inPinNo) {
- if (inPinNo == 0) {
- return mFLACSourcePin;
- } else {
- return NULL;
- }
-}
-
-//IAMFilterMiscFlags Interface
-ULONG NativeFLACSourceFilter::GetMiscFlags(void) {
- return AM_FILTER_MISC_FLAGS_IS_SOURCE;
-}
-
- //IFileSource Interface
-STDMETHODIMP NativeFLACSourceFilter::GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType) {
- LPOLESTR x = SysAllocString(mFileName.c_str());
- *outFileName = x;
- return S_OK;
-}
-
-
-STDMETHODIMP NativeFLACSourceFilter::Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType) {
- //Initialise the file here and setup the stream
- CAutoLock locLock(m_pLock);
- mFileName = inFileName;
-
- mInputFile.open(StringHelper::toNarrowStr(mFileName).c_str(), ios_base::in | ios_base::binary);
-
- mInputFile.seekg(0, ios_base::end);
- mFileSize = mInputFile.tellg();
- mInputFile.seekg(0, ios_base::beg);
-
- unsigned char locBuff[64];
- mInputFile.read((char*)&locBuff, 64);
- const unsigned char FLAC_CHANNEL_MASK = 14; //00001110
- const unsigned char FLAC_BPS_START_MASK = 1; //00000001
- const unsigned char FLAC_BPS_END_MASK = 240; //11110000
-
- mNumChannels = (((locBuff[20]) & FLAC_CHANNEL_MASK) >> 1) + 1;
- mSampleRate = (iBE_Math::charArrToULong(&locBuff[18])) >> 12;
- mBitsPerSample = (((locBuff[20] & FLAC_BPS_START_MASK) << 4) | ((locBuff[21] & FLAC_BPS_END_MASK) >> 4)) + 1;
- mTotalNumSamples = (((__int64)(locBuff[21] % 16)) << 32) + ((__int64)(iBE_Math::charArrToULong(&locBuff[22])));
-
- //TODO::: NEed to handle the case where the number of samples is zero by making it non-seekable.
- mInputFile.seekg(0, ios_base::beg);
-
- init();
- bool locResult = process_until_end_of_metadata();
-
- return S_OK;
-}
-
-STDMETHODIMP NativeFLACSourceFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
- if (riid == IID_IFileSourceFilter) {
- *ppv = (IFileSourceFilter*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- }
-
- return CBaseFilter::NonDelegatingQueryInterface(riid, ppv);
-}
-
-
-//IMEdiaStreaming
-STDMETHODIMP NativeFLACSourceFilter::Run(REFERENCE_TIME tStart) {
- CAutoLock locLock(m_pLock);
- return CBaseFilter::Run(tStart);
-}
-STDMETHODIMP NativeFLACSourceFilter::Pause(void) {
- CAutoLock locLock(m_pLock);
- if (m_State == State_Stopped) {
- if (ThreadExists() == FALSE) {
- Create();
- }
- CallWorker(THREAD_RUN);
- }
-
- HRESULT locHR = CBaseFilter::Pause();
- return locHR;
-
-}
-STDMETHODIMP NativeFLACSourceFilter::Stop(void) {
- CAutoLock locLock(m_pLock);
- CallWorker(THREAD_EXIT);
- Close();
- mJustSeeked = true;
- mSeekRequest = 0;
- mUpto = 0;
- mFLACSourcePin->DeliverBeginFlush();
- mFLACSourcePin->DeliverEndFlush();
- return CBaseFilter::Stop();
-}
-
-HRESULT NativeFLACSourceFilter::DataProcessLoop() {
- DWORD locCommand = 0;
- bool res = false;
- while (true) {
- if(CheckRequest(&locCommand) == TRUE) {
- return S_OK;
- }
- {
- CAutoLock locLock(mCodecLock);
- if (mJustSeeked) {
- mJustSeeked = false;
- bool res2 = false;
- res2 = seek_absolute(mSeekRequest);
- }
-
- res = process_single();
-
- if (mWasEOF) {
- break;
- }
-
- }
- }
-
- mInputFile.clear();
- mInputFile.seekg(0);
- mWasEOF = false;
- mFLACSourcePin->DeliverEndOfStream();
- return S_OK;
-}
-
-//CAMThread Stuff
-DWORD NativeFLACSourceFilter::ThreadProc(void) {
- while(true) {
- DWORD locThreadCommand = GetRequest();
- switch(locThreadCommand) {
- case THREAD_EXIT:
- Reply(S_OK);
- return S_OK;
-
- case THREAD_RUN:
- Reply(S_OK);
- DataProcessLoop();
- break;
- }
- }
- return S_OK;
-}
-
-
-::FLAC__SeekableStreamDecoderReadStatus NativeFLACSourceFilter::read_callback(FLAC__byte outBuffer[], unsigned int* outNumBytes) {
- const unsigned long BUFF_SIZE = 8192;
- mInputFile.read((char*)outBuffer, BUFF_SIZE);
- *outNumBytes = mInputFile.gcount();
- mWasEOF = mInputFile.eof();
- return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK;
-}
-::FLAC__SeekableStreamDecoderSeekStatus NativeFLACSourceFilter::seek_callback(FLAC__uint64 inSeekPos) {
- mInputFile.seekg(inSeekPos);
- return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK;
-}
-::FLAC__SeekableStreamDecoderTellStatus NativeFLACSourceFilter::tell_callback(FLAC__uint64* outTellPos) {
- *outTellPos = mInputFile.tellg();
- return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK;
-}
-::FLAC__SeekableStreamDecoderLengthStatus NativeFLACSourceFilter::length_callback(FLAC__uint64* outLength) {
- *outLength = mFileSize;
- return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK;
-}
-::FLAC__StreamDecoderWriteStatus NativeFLACSourceFilter::write_callback(const FLAC__Frame* inFrame,const FLAC__int32 *const inBuffer[]) {
- //Do the magic !
- if (! mBegun) {
- //This may not even be needed any more.
- mBegun = true;
- const int SIZE_16_BITS = 2;
- mNumChannels = inFrame->header.channels;
- mFrameSize = mNumChannels * SIZE_16_BITS;
- mSampleRate = inFrame->header.sample_rate;
- }
-
- unsigned long locNumFrames = inFrame->header.blocksize;
- unsigned long locActualSize = locNumFrames * mFrameSize;
- unsigned long locTotalFrameCount = locNumFrames * mNumChannels;
-
- //BUG::: There's a bug here. Implicitly assumes 2 channels. I think.
- unsigned char* locBuff = new unsigned char[locActualSize]; //Gives to the deliverdata method
- //It could actually be a single buffer for the class.
-
- signed short* locShortBuffer = (signed short*)locBuff; //Don't delete this.
-
- signed short tempInt = 0;
- int tempLong = 0;
- float tempFloat = 0;
- for(unsigned long i = 0; i < locNumFrames; i++) {
- for (unsigned long j = 0; j < mNumChannels; j++) {
- tempLong = inBuffer[j][i];
-
- //FIX::: Why on earth are you dividing by 2 ? It does not make sense !
- tempInt = (signed short)(tempLong/2);
-
- *locShortBuffer = tempInt;
- locShortBuffer++;
- }
- }
-
- mFLACSourcePin->deliverData(locBuff, locActualSize, (mUpto*UNITS) / mSampleRate, ((mUpto+locNumFrames)*UNITS) / mSampleRate);
- mUpto += locNumFrames;
- return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
-}
-void NativeFLACSourceFilter::metadata_callback(const FLAC__StreamMetadata* inMetaData) {
-
-}
-void NativeFLACSourceFilter::error_callback(FLAC__StreamDecoderErrorStatus inStatus) {
-
-}
-
-bool NativeFLACSourceFilter::eof_callback(void) {
- return mInputFile.eof();
-}
-
-
-
-STDMETHODIMP NativeFLACSourceFilter::GetCapabilities(DWORD* inCapabilities) {
- *inCapabilities = AM_SEEKING_CanSeekAbsolute |
- AM_SEEKING_CanSeekForwards |
- AM_SEEKING_CanSeekBackwards |
- AM_SEEKING_CanGetCurrentPos |
- AM_SEEKING_CanGetStopPos |
- AM_SEEKING_CanGetDuration;
- return S_OK;
-}
-STDMETHODIMP NativeFLACSourceFilter::CheckCapabilities(DWORD *pCapabilities) {
- return E_NOTIMPL;
-}
-STDMETHODIMP NativeFLACSourceFilter::IsFormatSupported(const GUID *pFormat) {
- if (*pFormat == TIME_FORMAT_MEDIA_TIME) {
- return S_OK;
- } else {
- return S_FALSE;
- }
-}
-STDMETHODIMP NativeFLACSourceFilter::QueryPreferredFormat(GUID *pFormat) {
- *pFormat = TIME_FORMAT_MEDIA_TIME;
- return S_OK;
-}
-STDMETHODIMP NativeFLACSourceFilter::SetTimeFormat(const GUID *pFormat) {
- return E_NOTIMPL;
-}
-STDMETHODIMP NativeFLACSourceFilter::GetTimeFormat( GUID *pFormat) {
- *pFormat = TIME_FORMAT_MEDIA_TIME;
- return S_OK;
-}
-STDMETHODIMP NativeFLACSourceFilter::GetDuration(LONGLONG *pDuration) {
- *pDuration = (mTotalNumSamples * UNITS) / mSampleRate;
- return S_OK;
-}
-STDMETHODIMP NativeFLACSourceFilter::GetStopPosition(LONGLONG *pStop) {
- *pStop = (mTotalNumSamples * UNITS) / mSampleRate;
- return S_OK;
-}
-STDMETHODIMP NativeFLACSourceFilter::GetCurrentPosition(LONGLONG *pCurrent){
- return E_NOTIMPL;
-}
-STDMETHODIMP NativeFLACSourceFilter::ConvertTimeFormat(LONGLONG *pTarget, const GUID *pTargetFormat, LONGLONG Source, const GUID *pSourceFormat){
- return E_NOTIMPL;
-}
-STDMETHODIMP NativeFLACSourceFilter::SetPositions(LONGLONG *pCurrent,DWORD dwCurrentFlags,LONGLONG *pStop,DWORD dwStopFlags){
- unsigned __int64 locSampleToSeek = (*pCurrent) * mSampleRate/ UNITS;
- mFLACSourcePin->DeliverBeginFlush();
- mFLACSourcePin->DeliverEndFlush();
-
- bool locRes = false;
- {
- CAutoLock locLock(mCodecLock);
- mUpto = 0;
- mJustSeeked = true;
- mSeekRequest = locSampleToSeek;
- }
-
- return S_OK;
-}
-STDMETHODIMP NativeFLACSourceFilter::GetPositions(LONGLONG *pCurrent, LONGLONG *pStop){
- return E_NOTIMPL;
-}
-STDMETHODIMP NativeFLACSourceFilter::GetAvailable(LONGLONG *pEarliest, LONGLONG *pLatest){
- *pEarliest = 0;
- *pLatest = (mTotalNumSamples * UNITS) / mSampleRate;
- return S_OK;
-}
-STDMETHODIMP NativeFLACSourceFilter::SetRate(double dRate){
- return E_NOTIMPL;
-}
-STDMETHODIMP NativeFLACSourceFilter::GetRate(double *dRate){
- *dRate = 1.0;
- return S_OK;
-}
-STDMETHODIMP NativeFLACSourceFilter::GetPreroll(LONGLONG *pllPreroll){
- *pllPreroll = 0;
- return S_OK;
-}
-STDMETHODIMP NativeFLACSourceFilter::IsUsingTimeFormat(const GUID *pFormat){
- if (*pFormat == TIME_FORMAT_MEDIA_TIME) {
- return S_OK;
- } else {
- return S_FALSE;
- }
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include ".\NativeFLACSourceFilter.h"
+
+CFactoryTemplate g_Templates[] =
+{
+ {
+ L"Native FLAC SourceFilter", // Name
+ &CLSID_NativeFLACSourceFilter, // CLSID
+ NativeFLACSourceFilter::CreateInstance, // Method to create an instance of MyComponent
+ NULL, // Initialization function
+ NULL // Set-up information (for filters)
+ }
+
+};
+
+// Generic way of determining the number of items in the template
+int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
+
+
+CUnknown* WINAPI NativeFLACSourceFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
+{
+ NativeFLACSourceFilter *pNewObject = new NativeFLACSourceFilter();
+ if (pNewObject == NULL) {
+ *pHr = E_OUTOFMEMORY;
+ }
+ return pNewObject;
+}
+
+NativeFLACSourceFilter::NativeFLACSourceFilter(void)
+ : CBaseFilter(NAME("NativeFLACSourceFilter"), NULL, m_pLock, CLSID_NativeFLACSourceFilter)
+ , mNumChannels(0)
+ , mSampleRate(0)
+ , mBitsPerSample(0)
+ , mBegun(false)
+ , mUpto(0)
+ , mJustSeeked(true)
+ , mSeekRequest(0)
+ , mTotalNumSamples(0)
+ , mWasEOF(false)
+{
+ m_pLock = new CCritSec;
+ mCodecLock = new CCritSec;
+ mFLACSourcePin = new NativeFLACSourcePin(this, m_pLock);
+}
+
+NativeFLACSourceFilter::~NativeFLACSourceFilter(void)
+{
+ delete mFLACSourcePin;
+ mFLACSourcePin = NULL;
+ delete mCodecLock;
+}
+
+//BaseFilter Interface
+int NativeFLACSourceFilter::GetPinCount() {
+ return 1;
+}
+CBasePin* NativeFLACSourceFilter::GetPin(int inPinNo) {
+ if (inPinNo == 0) {
+ return mFLACSourcePin;
+ } else {
+ return NULL;
+ }
+}
+
+//IAMFilterMiscFlags Interface
+ULONG NativeFLACSourceFilter::GetMiscFlags(void) {
+ return AM_FILTER_MISC_FLAGS_IS_SOURCE;
+}
+
+ //IFileSource Interface
+STDMETHODIMP NativeFLACSourceFilter::GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType) {
+ LPOLESTR x = SysAllocString(mFileName.c_str());
+ *outFileName = x;
+ return S_OK;
+}
+
+
+STDMETHODIMP NativeFLACSourceFilter::Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType) {
+ //Initialise the file here and setup the stream
+ CAutoLock locLock(m_pLock);
+ mFileName = inFileName;
+
+ mInputFile.open(StringHelper::toNarrowStr(mFileName).c_str(), ios_base::in | ios_base::binary);
+
+ mInputFile.seekg(0, ios_base::end);
+ mFileSize = mInputFile.tellg();
+ mInputFile.seekg(0, ios_base::beg);
+
+ unsigned char locBuff[64];
+ mInputFile.read((char*)&locBuff, 64);
+ const unsigned char FLAC_CHANNEL_MASK = 14; //00001110
+ const unsigned char FLAC_BPS_START_MASK = 1; //00000001
+ const unsigned char FLAC_BPS_END_MASK = 240; //11110000
+
+ mNumChannels = (((locBuff[20]) & FLAC_CHANNEL_MASK) >> 1) + 1;
+ mSampleRate = (iBE_Math::charArrToULong(&locBuff[18])) >> 12;
+ mBitsPerSample = (((locBuff[20] & FLAC_BPS_START_MASK) << 4) | ((locBuff[21] & FLAC_BPS_END_MASK) >> 4)) + 1;
+ mTotalNumSamples = (((__int64)(locBuff[21] % 16)) << 32) + ((__int64)(iBE_Math::charArrToULong(&locBuff[22])));
+
+ //TODO::: NEed to handle the case where the number of samples is zero by making it non-seekable.
+ mInputFile.seekg(0, ios_base::beg);
+
+ init();
+ bool locResult = process_until_end_of_metadata();
+
+ return S_OK;
+}
+
+STDMETHODIMP NativeFLACSourceFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+ if (riid == IID_IFileSourceFilter) {
+ *ppv = (IFileSourceFilter*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ }
+
+ return CBaseFilter::NonDelegatingQueryInterface(riid, ppv);
+}
+
+
+//IMEdiaStreaming
+STDMETHODIMP NativeFLACSourceFilter::Run(REFERENCE_TIME tStart) {
+ CAutoLock locLock(m_pLock);
+ return CBaseFilter::Run(tStart);
+}
+STDMETHODIMP NativeFLACSourceFilter::Pause(void) {
+ CAutoLock locLock(m_pLock);
+ if (m_State == State_Stopped) {
+ if (ThreadExists() == FALSE) {
+ Create();
+ }
+ CallWorker(THREAD_RUN);
+ }
+
+ HRESULT locHR = CBaseFilter::Pause();
+ return locHR;
+
+}
+STDMETHODIMP NativeFLACSourceFilter::Stop(void) {
+ CAutoLock locLock(m_pLock);
+ CallWorker(THREAD_EXIT);
+ Close();
+ mJustSeeked = true;
+ mSeekRequest = 0;
+ mUpto = 0;
+ mFLACSourcePin->DeliverBeginFlush();
+ mFLACSourcePin->DeliverEndFlush();
+ return CBaseFilter::Stop();
+}
+
+HRESULT NativeFLACSourceFilter::DataProcessLoop() {
+ DWORD locCommand = 0;
+ bool res = false;
+ while (true) {
+ if(CheckRequest(&locCommand) == TRUE) {
+ return S_OK;
+ }
+ {
+ CAutoLock locLock(mCodecLock);
+ if (mJustSeeked) {
+ mJustSeeked = false;
+ bool res2 = false;
+ res2 = seek_absolute(mSeekRequest);
+ }
+
+ res = process_single();
+
+ if (mWasEOF) {
+ break;
+ }
+
+ }
+ }
+
+ mInputFile.clear();
+ mInputFile.seekg(0);
+ mWasEOF = false;
+ mFLACSourcePin->DeliverEndOfStream();
+ return S_OK;
+}
+
+//CAMThread Stuff
+DWORD NativeFLACSourceFilter::ThreadProc(void) {
+ while(true) {
+ DWORD locThreadCommand = GetRequest();
+ switch(locThreadCommand) {
+ case THREAD_EXIT:
+ Reply(S_OK);
+ return S_OK;
+
+ case THREAD_RUN:
+ Reply(S_OK);
+ DataProcessLoop();
+ break;
+ }
+ }
+ return S_OK;
+}
+
+
+::FLAC__SeekableStreamDecoderReadStatus NativeFLACSourceFilter::read_callback(FLAC__byte outBuffer[], unsigned int* outNumBytes) {
+ const unsigned long BUFF_SIZE = 8192;
+ mInputFile.read((char*)outBuffer, BUFF_SIZE);
+ *outNumBytes = mInputFile.gcount();
+ mWasEOF = mInputFile.eof();
+ return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK;
+}
+::FLAC__SeekableStreamDecoderSeekStatus NativeFLACSourceFilter::seek_callback(FLAC__uint64 inSeekPos) {
+ mInputFile.seekg(inSeekPos);
+ return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK;
+}
+::FLAC__SeekableStreamDecoderTellStatus NativeFLACSourceFilter::tell_callback(FLAC__uint64* outTellPos) {
+ *outTellPos = mInputFile.tellg();
+ return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK;
+}
+::FLAC__SeekableStreamDecoderLengthStatus NativeFLACSourceFilter::length_callback(FLAC__uint64* outLength) {
+ *outLength = mFileSize;
+ return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK;
+}
+::FLAC__StreamDecoderWriteStatus NativeFLACSourceFilter::write_callback(const FLAC__Frame* inFrame,const FLAC__int32 *const inBuffer[]) {
+ //Do the magic !
+ if (! mBegun) {
+ //This may not even be needed any more.
+ mBegun = true;
+ const int SIZE_16_BITS = 2;
+ mNumChannels = inFrame->header.channels;
+ mFrameSize = mNumChannels * SIZE_16_BITS;
+ mSampleRate = inFrame->header.sample_rate;
+ }
+
+ unsigned long locNumFrames = inFrame->header.blocksize;
+ unsigned long locActualSize = locNumFrames * mFrameSize;
+ unsigned long locTotalFrameCount = locNumFrames * mNumChannels;
+
+ //BUG::: There's a bug here. Implicitly assumes 2 channels. I think.
+ unsigned char* locBuff = new unsigned char[locActualSize]; //Gives to the deliverdata method
+ //It could actually be a single buffer for the class.
+
+ signed short* locShortBuffer = (signed short*)locBuff; //Don't delete this.
+
+ signed short tempInt = 0;
+ int tempLong = 0;
+ float tempFloat = 0;
+ for(unsigned long i = 0; i < locNumFrames; i++) {
+ for (unsigned long j = 0; j < mNumChannels; j++) {
+ tempLong = inBuffer[j][i];
+
+ //FIX::: Why on earth are you dividing by 2 ? It does not make sense !
+ tempInt = (signed short)(tempLong/2);
+
+ *locShortBuffer = tempInt;
+ locShortBuffer++;
+ }
+ }
+
+ mFLACSourcePin->deliverData(locBuff, locActualSize, (mUpto*UNITS) / mSampleRate, ((mUpto+locNumFrames)*UNITS) / mSampleRate);
+ mUpto += locNumFrames;
+ return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
+}
+void NativeFLACSourceFilter::metadata_callback(const FLAC__StreamMetadata* inMetaData) {
+
+}
+void NativeFLACSourceFilter::error_callback(FLAC__StreamDecoderErrorStatus inStatus) {
+
+}
+
+bool NativeFLACSourceFilter::eof_callback(void) {
+ return mInputFile.eof();
+}
+
+
+
+STDMETHODIMP NativeFLACSourceFilter::GetCapabilities(DWORD* inCapabilities) {
+ *inCapabilities = AM_SEEKING_CanSeekAbsolute |
+ AM_SEEKING_CanSeekForwards |
+ AM_SEEKING_CanSeekBackwards |
+ AM_SEEKING_CanGetCurrentPos |
+ AM_SEEKING_CanGetStopPos |
+ AM_SEEKING_CanGetDuration;
+ return S_OK;
+}
+STDMETHODIMP NativeFLACSourceFilter::CheckCapabilities(DWORD *pCapabilities) {
+ return E_NOTIMPL;
+}
+STDMETHODIMP NativeFLACSourceFilter::IsFormatSupported(const GUID *pFormat) {
+ if (*pFormat == TIME_FORMAT_MEDIA_TIME) {
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
+}
+STDMETHODIMP NativeFLACSourceFilter::QueryPreferredFormat(GUID *pFormat) {
+ *pFormat = TIME_FORMAT_MEDIA_TIME;
+ return S_OK;
+}
+STDMETHODIMP NativeFLACSourceFilter::SetTimeFormat(const GUID *pFormat) {
+ return E_NOTIMPL;
+}
+STDMETHODIMP NativeFLACSourceFilter::GetTimeFormat( GUID *pFormat) {
+ *pFormat = TIME_FORMAT_MEDIA_TIME;
+ return S_OK;
+}
+STDMETHODIMP NativeFLACSourceFilter::GetDuration(LONGLONG *pDuration) {
+ *pDuration = (mTotalNumSamples * UNITS) / mSampleRate;
+ return S_OK;
+}
+STDMETHODIMP NativeFLACSourceFilter::GetStopPosition(LONGLONG *pStop) {
+ *pStop = (mTotalNumSamples * UNITS) / mSampleRate;
+ return S_OK;
+}
+STDMETHODIMP NativeFLACSourceFilter::GetCurrentPosition(LONGLONG *pCurrent){
+ return E_NOTIMPL;
+}
+STDMETHODIMP NativeFLACSourceFilter::ConvertTimeFormat(LONGLONG *pTarget, const GUID *pTargetFormat, LONGLONG Source, const GUID *pSourceFormat){
+ return E_NOTIMPL;
+}
+STDMETHODIMP NativeFLACSourceFilter::SetPositions(LONGLONG *pCurrent,DWORD dwCurrentFlags,LONGLONG *pStop,DWORD dwStopFlags){
+ unsigned __int64 locSampleToSeek = (*pCurrent) * mSampleRate/ UNITS;
+ mFLACSourcePin->DeliverBeginFlush();
+ mFLACSourcePin->DeliverEndFlush();
+
+ bool locRes = false;
+ {
+ CAutoLock locLock(mCodecLock);
+ mUpto = 0;
+ mJustSeeked = true;
+ mSeekRequest = locSampleToSeek;
+ }
+
+ return S_OK;
+}
+STDMETHODIMP NativeFLACSourceFilter::GetPositions(LONGLONG *pCurrent, LONGLONG *pStop){
+ return E_NOTIMPL;
+}
+STDMETHODIMP NativeFLACSourceFilter::GetAvailable(LONGLONG *pEarliest, LONGLONG *pLatest){
+ *pEarliest = 0;
+ *pLatest = (mTotalNumSamples * UNITS) / mSampleRate;
+ return S_OK;
+}
+STDMETHODIMP NativeFLACSourceFilter::SetRate(double dRate){
+ return E_NOTIMPL;
+}
+STDMETHODIMP NativeFLACSourceFilter::GetRate(double *dRate){
+ *dRate = 1.0;
+ return S_OK;
+}
+STDMETHODIMP NativeFLACSourceFilter::GetPreroll(LONGLONG *pllPreroll){
+ *pllPreroll = 0;
+ return S_OK;
+}
+STDMETHODIMP NativeFLACSourceFilter::IsUsingTimeFormat(const GUID *pFormat){
+ if (*pFormat == TIME_FORMAT_MEDIA_TIME) {
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,155 +1,155 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-//Local Includes
-#include "dsfNativeFLACSource.h"
-#include "NativeFLACSourcePin.h"
-
-//Library Includes
-#include "FLAC++/decoder.h"
-#include "StringHelper.h"
-#include "iBE_Math.h"
-using namespace FLAC::Decoder;
-
-//STL Includes
-#include <string>
-using namespace std;
-
-//Forward Declarations
-class NativeFLACSourcePin;
-
-class NativeFLACSourceFilter
- //Base Classes
- : public CBaseFilter
- , public IFileSourceFilter
- , public IAMFilterMiscFlags
- , public IMediaSeeking
- , public CAMThread
- , protected FLAC::Decoder::SeekableStream
-{
-public:
- //Friends
- friend class NativeFLACSourcePin;
-
- //Constants
- enum eThreadCommands {
- THREAD_EXIT = 0,
- THREAD_PAUSE = 1,
- THREAD_RUN = 2
- };
-
- //COM Stuff
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
- static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
-
- //Constructors
- NativeFLACSourceFilter(void);
- virtual ~NativeFLACSourceFilter(void);
-
- //IBaseFilter Pure Virtuals
- virtual int GetPinCount();
- virtual CBasePin* GetPin(int inPinNo);
-
- //IAMFilterMiscFlags Interface
- ULONG STDMETHODCALLTYPE GetMiscFlags(void);
-
- //IFileSource Interface
- virtual STDMETHODIMP GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType);
- virtual STDMETHODIMP Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType);
-
- //Streaming MEthods
- STDMETHODIMP Run(REFERENCE_TIME tStart);
- STDMETHODIMP Pause(void);
- STDMETHODIMP Stop(void);
-
- //CAMThread
- virtual DWORD ThreadProc(void);
-
- //FLAC Virtuals
- virtual ::FLAC__SeekableStreamDecoderReadStatus read_callback(FLAC__byte outBuffer[], unsigned int* outNumBytes);
- virtual ::FLAC__SeekableStreamDecoderSeekStatus seek_callback(FLAC__uint64 inSeekPos);
- virtual ::FLAC__SeekableStreamDecoderTellStatus tell_callback(FLAC__uint64* outTellPos);
- virtual ::FLAC__SeekableStreamDecoderLengthStatus length_callback(FLAC__uint64* outLength);
- virtual ::FLAC__StreamDecoderWriteStatus write_callback(const FLAC__Frame* outFrame,const FLAC__int32 *const outBuffer[]);
- virtual void metadata_callback(const FLAC__StreamMetadata* inMetaData);
- virtual void error_callback(FLAC__StreamDecoderErrorStatus inStatus);
- virtual bool eof_callback(void);
-
- //IMediaSeeking Interface
- virtual STDMETHODIMP GetCapabilities(DWORD *pCapabilities);
- virtual STDMETHODIMP CheckCapabilities(DWORD *pCapabilities);
- virtual STDMETHODIMP IsFormatSupported(const GUID *pFormat);
- virtual STDMETHODIMP QueryPreferredFormat(GUID *pFormat);
- virtual STDMETHODIMP SetTimeFormat(const GUID *pFormat);
- virtual STDMETHODIMP GetTimeFormat( GUID *pFormat);
- virtual STDMETHODIMP GetDuration(LONGLONG *pDuration);
- virtual STDMETHODIMP GetStopPosition(LONGLONG *pStop);
- virtual STDMETHODIMP GetCurrentPosition(LONGLONG *pCurrent);
- virtual STDMETHODIMP ConvertTimeFormat(LONGLONG *pTarget, const GUID *pTargetFormat, LONGLONG Source, const GUID *pSourceFormat);
- virtual STDMETHODIMP SetPositions(LONGLONG *pCurrent,DWORD dwCurrentFlags,LONGLONG *pStop,DWORD dwStopFlags);
- virtual STDMETHODIMP GetPositions(LONGLONG *pCurrent, LONGLONG *pStop);
- virtual STDMETHODIMP GetAvailable(LONGLONG *pEarliest, LONGLONG *pLatest);
- virtual STDMETHODIMP SetRate(double dRate);
- virtual STDMETHODIMP GetRate(double *dRate);
- virtual STDMETHODIMP GetPreroll(LONGLONG *pllPreroll);
- virtual STDMETHODIMP IsUsingTimeFormat(const GUID *pFormat);
-
-protected:
- //Helper Methods
- HRESULT DataProcessLoop();
-
- //Pin Class
- NativeFLACSourcePin* mFLACSourcePin;
-
- //Source File Members
- wstring mFileName;
- fstream mInputFile;
- unsigned long mFileSize;
-
- //State Variables
- bool mBegun;
- bool mJustSeeked;
- __int64 mSeekRequest;
- bool mWasEOF;
- unsigned long mUpto;
-
- //Stream info data.
- unsigned long mNumChannels;
- unsigned long mFrameSize;
- unsigned long mSampleRate;
- unsigned long mBitsPerSample;
- __int64 mTotalNumSamples;
-
- //Critical Section to protect codec.
- CCritSec* mCodecLock;
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+//Local Includes
+#include "dsfNativeFLACSource.h"
+#include "NativeFLACSourcePin.h"
+
+//Library Includes
+#include "FLAC++/decoder.h"
+#include "StringHelper.h"
+#include "iBE_Math.h"
+using namespace FLAC::Decoder;
+
+//STL Includes
+#include <string>
+using namespace std;
+
+//Forward Declarations
+class NativeFLACSourcePin;
+
+class NativeFLACSourceFilter
+ //Base Classes
+ : public CBaseFilter
+ , public IFileSourceFilter
+ , public IAMFilterMiscFlags
+ , public IMediaSeeking
+ , public CAMThread
+ , protected FLAC::Decoder::SeekableStream
+{
+public:
+ //Friends
+ friend class NativeFLACSourcePin;
+
+ //Constants
+ enum eThreadCommands {
+ THREAD_EXIT = 0,
+ THREAD_PAUSE = 1,
+ THREAD_RUN = 2
+ };
+
+ //COM Stuff
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+ static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+
+ //Constructors
+ NativeFLACSourceFilter(void);
+ virtual ~NativeFLACSourceFilter(void);
+
+ //IBaseFilter Pure Virtuals
+ virtual int GetPinCount();
+ virtual CBasePin* GetPin(int inPinNo);
+
+ //IAMFilterMiscFlags Interface
+ ULONG STDMETHODCALLTYPE GetMiscFlags(void);
+
+ //IFileSource Interface
+ virtual STDMETHODIMP GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType);
+ virtual STDMETHODIMP Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType);
+
+ //Streaming MEthods
+ STDMETHODIMP Run(REFERENCE_TIME tStart);
+ STDMETHODIMP Pause(void);
+ STDMETHODIMP Stop(void);
+
+ //CAMThread
+ virtual DWORD ThreadProc(void);
+
+ //FLAC Virtuals
+ virtual ::FLAC__SeekableStreamDecoderReadStatus read_callback(FLAC__byte outBuffer[], unsigned int* outNumBytes);
+ virtual ::FLAC__SeekableStreamDecoderSeekStatus seek_callback(FLAC__uint64 inSeekPos);
+ virtual ::FLAC__SeekableStreamDecoderTellStatus tell_callback(FLAC__uint64* outTellPos);
+ virtual ::FLAC__SeekableStreamDecoderLengthStatus length_callback(FLAC__uint64* outLength);
+ virtual ::FLAC__StreamDecoderWriteStatus write_callback(const FLAC__Frame* outFrame,const FLAC__int32 *const outBuffer[]);
+ virtual void metadata_callback(const FLAC__StreamMetadata* inMetaData);
+ virtual void error_callback(FLAC__StreamDecoderErrorStatus inStatus);
+ virtual bool eof_callback(void);
+
+ //IMediaSeeking Interface
+ virtual STDMETHODIMP GetCapabilities(DWORD *pCapabilities);
+ virtual STDMETHODIMP CheckCapabilities(DWORD *pCapabilities);
+ virtual STDMETHODIMP IsFormatSupported(const GUID *pFormat);
+ virtual STDMETHODIMP QueryPreferredFormat(GUID *pFormat);
+ virtual STDMETHODIMP SetTimeFormat(const GUID *pFormat);
+ virtual STDMETHODIMP GetTimeFormat( GUID *pFormat);
+ virtual STDMETHODIMP GetDuration(LONGLONG *pDuration);
+ virtual STDMETHODIMP GetStopPosition(LONGLONG *pStop);
+ virtual STDMETHODIMP GetCurrentPosition(LONGLONG *pCurrent);
+ virtual STDMETHODIMP ConvertTimeFormat(LONGLONG *pTarget, const GUID *pTargetFormat, LONGLONG Source, const GUID *pSourceFormat);
+ virtual STDMETHODIMP SetPositions(LONGLONG *pCurrent,DWORD dwCurrentFlags,LONGLONG *pStop,DWORD dwStopFlags);
+ virtual STDMETHODIMP GetPositions(LONGLONG *pCurrent, LONGLONG *pStop);
+ virtual STDMETHODIMP GetAvailable(LONGLONG *pEarliest, LONGLONG *pLatest);
+ virtual STDMETHODIMP SetRate(double dRate);
+ virtual STDMETHODIMP GetRate(double *dRate);
+ virtual STDMETHODIMP GetPreroll(LONGLONG *pllPreroll);
+ virtual STDMETHODIMP IsUsingTimeFormat(const GUID *pFormat);
+
+protected:
+ //Helper Methods
+ HRESULT DataProcessLoop();
+
+ //Pin Class
+ NativeFLACSourcePin* mFLACSourcePin;
+
+ //Source File Members
+ wstring mFileName;
+ fstream mInputFile;
+ unsigned long mFileSize;
+
+ //State Variables
+ bool mBegun;
+ bool mJustSeeked;
+ __int64 mSeekRequest;
+ bool mWasEOF;
+ unsigned long mUpto;
+
+ //Stream info data.
+ unsigned long mNumChannels;
+ unsigned long mFrameSize;
+ unsigned long mSampleRate;
+ unsigned long mBitsPerSample;
+ __int64 mTotalNumSamples;
+
+ //Critical Section to protect codec.
+ CCritSec* mCodecLock;
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourceFilter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourcePin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourcePin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourcePin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,202 +1,202 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include ".\NativeFLACSourcePin.h"
-
-NativeFLACSourcePin::NativeFLACSourcePin(NativeFLACSourceFilter* inParentFilter, CCritSec* inFilterLock)
- : CBaseOutputPin(NAME("Native FLAC Source Pin"), inParentFilter, inFilterLock, &mFilterHR, L"PCM Out")
- , mParentFilter(inParentFilter)
- , mDataQueue(NULL)
-
-{
- //Subvert COM and do this directly... this way, the source filter won't expose the interface to the
- // graph but we can still delegate to it.
- IMediaSeeking* locSeeker = NULL;
- locSeeker = (IMediaSeeking*)mParentFilter;
- SetDelegate(locSeeker);
-}
-
-NativeFLACSourcePin::~NativeFLACSourcePin(void)
-{
- SetDelegate(NULL); //Avoid infinite destructor loop.
- delete mDataQueue;
- mDataQueue = NULL;
-}
-
-STDMETHODIMP NativeFLACSourcePin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
- if (riid == IID_IMediaSeeking) {
- *ppv = (IMediaSeeking*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- }
- return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
-}
-
-HRESULT NativeFLACSourcePin::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
-{
- mDataQueue->NewSegment(tStart, tStop, dRate);
-
- return S_OK;
-}
-HRESULT NativeFLACSourcePin::DeliverEndOfStream(void)
-{
- mDataQueue->EOS();
- return S_OK;
-}
-
-HRESULT NativeFLACSourcePin::DeliverEndFlush(void)
-{
- mDataQueue->EndFlush();
- return S_OK;
-}
-
-HRESULT NativeFLACSourcePin::DeliverBeginFlush(void)
-{
- mDataQueue->BeginFlush();
- return S_OK;
-}
-
-HRESULT NativeFLACSourcePin::CompleteConnect (IPin *inReceivePin)
-{
- mFilterHR = S_OK;
- //Deleted in destructor
- mDataQueue = new COutputQueue (inReceivePin, &mFilterHR, FALSE, TRUE,1,TRUE, NUM_BUFFERS);
- if (FAILED(mFilterHR)) {
- //TODO::: Probably should handle this !
- mFilterHR = mFilterHR;
- }
-
- return CBaseOutputPin::CompleteConnect(inReceivePin);
-}
-
-HRESULT NativeFLACSourcePin::BreakConnect(void) {
- delete mDataQueue;
- mDataQueue = NULL;
- return CBaseOutputPin::BreakConnect();
-}
-
- //CSourceStream virtuals
-HRESULT NativeFLACSourcePin::GetMediaType(int inPosition, CMediaType* outMediaType) {
- if (inPosition == 0) {
- outMediaType->SetType(&MEDIATYPE_Audio);
- outMediaType->SetSubtype(&MEDIASUBTYPE_PCM);
- outMediaType->SetFormatType(&FORMAT_WaveFormatEx);
- outMediaType->SetTemporalCompression(FALSE);
- outMediaType->SetSampleSize(0);
-
- WAVEFORMATEX* locFormat = (WAVEFORMATEX*)outMediaType->AllocFormatBuffer(sizeof(WAVEFORMATEX));
- locFormat->wFormatTag = WAVE_FORMAT_PCM;
-
- locFormat->nChannels = mParentFilter->mNumChannels;
- locFormat->nSamplesPerSec = mParentFilter->mSampleRate;
- locFormat->wBitsPerSample = mParentFilter->mBitsPerSample;
- locFormat->nBlockAlign = (mParentFilter->mNumChannels) * (mParentFilter->mBitsPerSample >> 3);
- locFormat->nAvgBytesPerSec = ((mParentFilter->mNumChannels) * (mParentFilter->mBitsPerSample >> 3)) * mParentFilter->mSampleRate;
- locFormat->cbSize = 0;
-
- return S_OK;
- } else {
- return VFW_S_NO_MORE_ITEMS;
- }
-}
-HRESULT NativeFLACSourcePin::CheckMediaType(const CMediaType* inMediaType) {
- if ((inMediaType->majortype == MEDIATYPE_Audio) && (inMediaType->subtype == MEDIASUBTYPE_PCM) && (inMediaType->formattype == FORMAT_WaveFormatEx)) {
- return S_OK;
- } else {
- return E_FAIL;
- }
-}
-HRESULT NativeFLACSourcePin::DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest) {
- HRESULT locHR = S_OK;
-
- ALLOCATOR_PROPERTIES locReqAlloc;
- ALLOCATOR_PROPERTIES locActualAlloc;
-
- locReqAlloc.cbAlign = 1;
- locReqAlloc.cbBuffer = BUFFER_SIZE;
- locReqAlloc.cbPrefix = 0;
- locReqAlloc.cBuffers = NUM_BUFFERS;
-
- locHR = inoutAllocator->SetProperties(&locReqAlloc, &locActualAlloc);
-
- if (locHR != S_OK) {
- return locHR;
- }
-
- locHR = inoutAllocator->Commit();
-
- return locHR;
-}
-
-//This method is responsible for deleting the incoming buffer.
-HRESULT NativeFLACSourcePin::deliverData(unsigned char* inBuff, unsigned long inBuffSize, __int64 inStart, __int64 inEnd) {
- //Locks !!
-
- IMediaSample* locSample = NULL;
- REFERENCE_TIME locStart = inStart;
- REFERENCE_TIME locStop = inEnd;
-
- HRESULT locHR = GetDeliveryBuffer(&locSample, &locStart, &locStop, NULL);
-
- //Error checks
- if (locHR != S_OK) {
- delete[] inBuff;
- return locHR;
- }
-
- locSample->SetTime(&locStart, &locStop);
-
- locSample->SetSyncPoint(TRUE);
-
- // Create a pointer for the samples buffer
- BYTE* locBuffer = NULL;
- locSample->GetPointer(&locBuffer);
-
- if (locSample->GetSize() >= inBuffSize) {
- memcpy((void*)locBuffer, (const void*)inBuff, inBuffSize);
- locSample->SetActualDataLength(inBuffSize);
-
- locHR = mDataQueue->Receive(locSample);
-
- if (locHR != S_OK) {
- delete[] inBuff;
- return locHR;
-
- } else {
- delete[] inBuff;
- return S_OK;
- }
- } else {
- delete[] inBuff;
- throw 0;
- }
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include ".\NativeFLACSourcePin.h"
+
+NativeFLACSourcePin::NativeFLACSourcePin(NativeFLACSourceFilter* inParentFilter, CCritSec* inFilterLock)
+ : CBaseOutputPin(NAME("Native FLAC Source Pin"), inParentFilter, inFilterLock, &mFilterHR, L"PCM Out")
+ , mParentFilter(inParentFilter)
+ , mDataQueue(NULL)
+
+{
+ //Subvert COM and do this directly... this way, the source filter won't expose the interface to the
+ // graph but we can still delegate to it.
+ IMediaSeeking* locSeeker = NULL;
+ locSeeker = (IMediaSeeking*)mParentFilter;
+ SetDelegate(locSeeker);
+}
+
+NativeFLACSourcePin::~NativeFLACSourcePin(void)
+{
+ SetDelegate(NULL); //Avoid infinite destructor loop.
+ delete mDataQueue;
+ mDataQueue = NULL;
+}
+
+STDMETHODIMP NativeFLACSourcePin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+ if (riid == IID_IMediaSeeking) {
+ *ppv = (IMediaSeeking*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ }
+ return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
+}
+
+HRESULT NativeFLACSourcePin::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
+{
+ mDataQueue->NewSegment(tStart, tStop, dRate);
+
+ return S_OK;
+}
+HRESULT NativeFLACSourcePin::DeliverEndOfStream(void)
+{
+ mDataQueue->EOS();
+ return S_OK;
+}
+
+HRESULT NativeFLACSourcePin::DeliverEndFlush(void)
+{
+ mDataQueue->EndFlush();
+ return S_OK;
+}
+
+HRESULT NativeFLACSourcePin::DeliverBeginFlush(void)
+{
+ mDataQueue->BeginFlush();
+ return S_OK;
+}
+
+HRESULT NativeFLACSourcePin::CompleteConnect (IPin *inReceivePin)
+{
+ mFilterHR = S_OK;
+ //Deleted in destructor
+ mDataQueue = new COutputQueue (inReceivePin, &mFilterHR, FALSE, TRUE,1,TRUE, NUM_BUFFERS);
+ if (FAILED(mFilterHR)) {
+ //TODO::: Probably should handle this !
+ mFilterHR = mFilterHR;
+ }
+
+ return CBaseOutputPin::CompleteConnect(inReceivePin);
+}
+
+HRESULT NativeFLACSourcePin::BreakConnect(void) {
+ delete mDataQueue;
+ mDataQueue = NULL;
+ return CBaseOutputPin::BreakConnect();
+}
+
+ //CSourceStream virtuals
+HRESULT NativeFLACSourcePin::GetMediaType(int inPosition, CMediaType* outMediaType) {
+ if (inPosition == 0) {
+ outMediaType->SetType(&MEDIATYPE_Audio);
+ outMediaType->SetSubtype(&MEDIASUBTYPE_PCM);
+ outMediaType->SetFormatType(&FORMAT_WaveFormatEx);
+ outMediaType->SetTemporalCompression(FALSE);
+ outMediaType->SetSampleSize(0);
+
+ WAVEFORMATEX* locFormat = (WAVEFORMATEX*)outMediaType->AllocFormatBuffer(sizeof(WAVEFORMATEX));
+ locFormat->wFormatTag = WAVE_FORMAT_PCM;
+
+ locFormat->nChannels = mParentFilter->mNumChannels;
+ locFormat->nSamplesPerSec = mParentFilter->mSampleRate;
+ locFormat->wBitsPerSample = mParentFilter->mBitsPerSample;
+ locFormat->nBlockAlign = (mParentFilter->mNumChannels) * (mParentFilter->mBitsPerSample >> 3);
+ locFormat->nAvgBytesPerSec = ((mParentFilter->mNumChannels) * (mParentFilter->mBitsPerSample >> 3)) * mParentFilter->mSampleRate;
+ locFormat->cbSize = 0;
+
+ return S_OK;
+ } else {
+ return VFW_S_NO_MORE_ITEMS;
+ }
+}
+HRESULT NativeFLACSourcePin::CheckMediaType(const CMediaType* inMediaType) {
+ if ((inMediaType->majortype == MEDIATYPE_Audio) && (inMediaType->subtype == MEDIASUBTYPE_PCM) && (inMediaType->formattype == FORMAT_WaveFormatEx)) {
+ return S_OK;
+ } else {
+ return E_FAIL;
+ }
+}
+HRESULT NativeFLACSourcePin::DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest) {
+ HRESULT locHR = S_OK;
+
+ ALLOCATOR_PROPERTIES locReqAlloc;
+ ALLOCATOR_PROPERTIES locActualAlloc;
+
+ locReqAlloc.cbAlign = 1;
+ locReqAlloc.cbBuffer = BUFFER_SIZE;
+ locReqAlloc.cbPrefix = 0;
+ locReqAlloc.cBuffers = NUM_BUFFERS;
+
+ locHR = inoutAllocator->SetProperties(&locReqAlloc, &locActualAlloc);
+
+ if (locHR != S_OK) {
+ return locHR;
+ }
+
+ locHR = inoutAllocator->Commit();
+
+ return locHR;
+}
+
+//This method is responsible for deleting the incoming buffer.
+HRESULT NativeFLACSourcePin::deliverData(unsigned char* inBuff, unsigned long inBuffSize, __int64 inStart, __int64 inEnd) {
+ //Locks !!
+
+ IMediaSample* locSample = NULL;
+ REFERENCE_TIME locStart = inStart;
+ REFERENCE_TIME locStop = inEnd;
+
+ HRESULT locHR = GetDeliveryBuffer(&locSample, &locStart, &locStop, NULL);
+
+ //Error checks
+ if (locHR != S_OK) {
+ delete[] inBuff;
+ return locHR;
+ }
+
+ locSample->SetTime(&locStart, &locStop);
+
+ locSample->SetSyncPoint(TRUE);
+
+ // Create a pointer for the samples buffer
+ BYTE* locBuffer = NULL;
+ locSample->GetPointer(&locBuffer);
+
+ if (locSample->GetSize() >= inBuffSize) {
+ memcpy((void*)locBuffer, (const void*)inBuff, inBuffSize);
+ locSample->SetActualDataLength(inBuffSize);
+
+ locHR = mDataQueue->Receive(locSample);
+
+ if (locHR != S_OK) {
+ delete[] inBuff;
+ return locHR;
+
+ } else {
+ delete[] inBuff;
+ return S_OK;
+ }
+ } else {
+ delete[] inBuff;
+ throw 0;
+ }
+}
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourcePin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourcePin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourcePin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourcePin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,81 +1,81 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-//Local Includes
-#include "dsfNativeFLACSource.h"
-
-//Library Includes
-#include "BasicSeekPassThrough.h"
-
-//Forward Declararions.
-class NativeFLACSourceFilter;
-class NativeFLACSourcePin
- //Base classes.
- : public CBaseOutputPin
- , public BasicSeekPassThrough
-{
-public:
- //COM Stuff
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- //Constructors.
- NativeFLACSourcePin( NativeFLACSourceFilter* inParentFilter, CCritSec* inFilterLock);
- virtual ~NativeFLACSourcePin(void);
-
- //Constants
- static const unsigned long BUFFER_SIZE = 65536; //What should this be ????
- static const unsigned long NUM_BUFFERS = 10;
-
- //CBaseOutputPin virtuals
- virtual HRESULT GetMediaType(int inPosition, CMediaType* outMediaType);
- virtual HRESULT CheckMediaType(const CMediaType* inMediaType);
- virtual HRESULT DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest);
-
- //IPin virtuals
- virtual HRESULT CompleteConnect (IPin *inReceivePin);
- virtual HRESULT BreakConnect(void);
- virtual HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
- virtual HRESULT DeliverEndOfStream(void);
- virtual HRESULT DeliverEndFlush(void);
- virtual HRESULT DeliverBeginFlush(void);
-
- //Helper method
- HRESULT deliverData(unsigned char* inBuff, unsigned long inBuffSize, __int64 inStart, __int64 inEnd);
-protected:
- HRESULT mFilterHR;
-
- //Member variables.
- COutputQueue* mDataQueue;
- NativeFLACSourceFilter* mParentFilter;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+//Local Includes
+#include "dsfNativeFLACSource.h"
+
+//Library Includes
+#include "BasicSeekPassThrough.h"
+
+//Forward Declararions.
+class NativeFLACSourceFilter;
+class NativeFLACSourcePin
+ //Base classes.
+ : public CBaseOutputPin
+ , public BasicSeekPassThrough
+{
+public:
+ //COM Stuff
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ //Constructors.
+ NativeFLACSourcePin( NativeFLACSourceFilter* inParentFilter, CCritSec* inFilterLock);
+ virtual ~NativeFLACSourcePin(void);
+
+ //Constants
+ static const unsigned long BUFFER_SIZE = 65536; //What should this be ????
+ static const unsigned long NUM_BUFFERS = 10;
+
+ //CBaseOutputPin virtuals
+ virtual HRESULT GetMediaType(int inPosition, CMediaType* outMediaType);
+ virtual HRESULT CheckMediaType(const CMediaType* inMediaType);
+ virtual HRESULT DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest);
+
+ //IPin virtuals
+ virtual HRESULT CompleteConnect (IPin *inReceivePin);
+ virtual HRESULT BreakConnect(void);
+ virtual HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
+ virtual HRESULT DeliverEndOfStream(void);
+ virtual HRESULT DeliverEndFlush(void);
+ virtual HRESULT DeliverBeginFlush(void);
+
+ //Helper method
+ HRESULT deliverData(unsigned char* inBuff, unsigned long inBuffSize, __int64 inStart, __int64 inEnd);
+protected:
+ HRESULT mFilterHR;
+
+ //Member variables.
+ COutputQueue* mDataQueue;
+ NativeFLACSourceFilter* mParentFilter;
+};
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/NativeFLACSourcePin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/dsfNativeFLACSource.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/dsfNativeFLACSource.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/dsfNativeFLACSource.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,118 +1,118 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-
-
-
-
-extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
-BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
-{
- return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
-}
-
-
-//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
-STDAPI DllRegisterServer()
-{
-
- //TO DO::: Should we be releasing the filter mapper even when we return early ?
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(TRUE);
- if (FAILED(hr)) {
-
- return hr;
- }
-
-
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
-
-
- if (FAILED(hr)) {
- return hr;
- }
-
- hr = locFilterMapper->RegisterFilter(
- CLSID_NativeFLACSourceFilter, // Filter CLSID.
- L"Native FLAC Source Filter", // Filter name.
- NULL, // Device moniker.
- &CLSID_LegacyAmFilterCategory, // Direct Show general category
- L"Native FLAC Source Filter", // Instance data. ???????
- &NativeFLACSourceFilterReg // Pointer to filter information.
- );
-
-
- //Only call once... if you need multiple you have to fix the hack job in RegWrap !
- //RegWrap::addMediaPlayerDesc("Ogg File", "*.ogg;*.ogv;*.oga;*.spx");
-
-
-
-
-
- locFilterMapper->Release();
-
- return hr;
- //return S_OK;
-}
-
-STDAPI DllUnregisterServer()
-{
- //This is not a general purpose function.
- //RegWrap::removeMediaDesc();
-
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(FALSE);
- if (FAILED(hr)) {
-
- return hr;
- }
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
- IID_IFilterMapper2, (void **)&locFilterMapper);
-
- if (FAILED(hr)) {
- return hr;
- }
-
-
- hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory,
- L"Native FLAC Source Filter", CLSID_NativeFLACSourceFilter);
-
- //
- locFilterMapper->Release();
- return hr;
-
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+
+
+
+
+extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
+BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+ return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
+}
+
+
+//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
+STDAPI DllRegisterServer()
+{
+
+ //TO DO::: Should we be releasing the filter mapper even when we return early ?
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(TRUE);
+ if (FAILED(hr)) {
+
+ return hr;
+ }
+
+
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
+
+
+ if (FAILED(hr)) {
+ return hr;
+ }
+
+ hr = locFilterMapper->RegisterFilter(
+ CLSID_NativeFLACSourceFilter, // Filter CLSID.
+ L"Native FLAC Source Filter", // Filter name.
+ NULL, // Device moniker.
+ &CLSID_LegacyAmFilterCategory, // Direct Show general category
+ L"Native FLAC Source Filter", // Instance data. ???????
+ &NativeFLACSourceFilterReg // Pointer to filter information.
+ );
+
+
+ //Only call once... if you need multiple you have to fix the hack job in RegWrap !
+ //RegWrap::addMediaPlayerDesc("Ogg File", "*.ogg;*.ogv;*.oga;*.spx");
+
+
+
+
+
+ locFilterMapper->Release();
+
+ return hr;
+ //return S_OK;
+}
+
+STDAPI DllUnregisterServer()
+{
+ //This is not a general purpose function.
+ //RegWrap::removeMediaDesc();
+
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(FALSE);
+ if (FAILED(hr)) {
+
+ return hr;
+ }
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
+ IID_IFilterMapper2, (void **)&locFilterMapper);
+
+ if (FAILED(hr)) {
+ return hr;
+ }
+
+
+ hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory,
+ L"Native FLAC Source Filter", CLSID_NativeFLACSourceFilter);
+
+ //
+ locFilterMapper->Release();
+ return hr;
+
+}
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/dsfNativeFLACSource.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/dsfNativeFLACSource.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/dsfNativeFLACSource.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/dsfNativeFLACSource.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,78 +1,78 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include <streams.h>
-#include <pullpin.h>
-#include <initguid.h>
-
-#include "dsfNativeFLACSource.h"
-#include "NativeFLACSourceFilter.h"
-#include "NativeFLACSourcePin.h"
-// {6DDA37BA-0553-499a-AE0D-BEBA67204548}
-DEFINE_GUID(CLSID_NativeFLACSourceFilter,
-0x6dda37ba, 0x553, 0x499a, 0xae, 0xd, 0xbe, 0xba, 0x67, 0x20, 0x45, 0x48);
-
-
-
-
-
-const REGPINTYPES FLACSourceOutputTypes = {
- &MEDIATYPE_Audio,
- &MEDIASUBTYPE_PCM
-};
-
-const REGFILTERPINS FLACSourcePinReg[] = {
- {
- L"PCM Output", //Name (obsoleted)
- FALSE, //Renders from this pin ?? Not sure about this.
- TRUE, //Is an output pin
- FALSE, //Cannot have zero instances of this pin
- FALSE, //Cannot have more than one instance of this pin
- NULL, //Connects to filter (obsoleted)
- NULL, //Connects to pin (obsoleted)
- 1, //Only support one media type
- &FLACSourceOutputTypes //Pointer to media type (Audio/PCM)
-
- }
-};
-
-
-
-const REGFILTER2 NativeFLACSourceFilterReg = {
- 1,
- MERIT_NORMAL,
- 0,
- FLACSourcePinReg
-
-};
-
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include <streams.h>
+#include <pullpin.h>
+#include <initguid.h>
+
+#include "dsfNativeFLACSource.h"
+#include "NativeFLACSourceFilter.h"
+#include "NativeFLACSourcePin.h"
+// {6DDA37BA-0553-499a-AE0D-BEBA67204548}
+DEFINE_GUID(CLSID_NativeFLACSourceFilter,
+0x6dda37ba, 0x553, 0x499a, 0xae, 0xd, 0xbe, 0xba, 0x67, 0x20, 0x45, 0x48);
+
+
+
+
+
+const REGPINTYPES FLACSourceOutputTypes = {
+ &MEDIATYPE_Audio,
+ &MEDIASUBTYPE_PCM
+};
+
+const REGFILTERPINS FLACSourcePinReg[] = {
+ {
+ L"PCM Output", //Name (obsoleted)
+ FALSE, //Renders from this pin ?? Not sure about this.
+ TRUE, //Is an output pin
+ FALSE, //Cannot have zero instances of this pin
+ FALSE, //Cannot have more than one instance of this pin
+ NULL, //Connects to filter (obsoleted)
+ NULL, //Connects to pin (obsoleted)
+ 1, //Only support one media type
+ &FLACSourceOutputTypes //Pointer to media type (Audio/PCM)
+
+ }
+};
+
+
+
+const REGFILTER2 NativeFLACSourceFilterReg = {
+ 1,
+ MERIT_NORMAL,
+ 0,
+ FLACSourcePinReg
+
+};
+
+
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/dsfNativeFLACSource.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// dsfNativeFLACSource.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// dsfNativeFLACSource.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,14 +1,14 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-// TODO: reference additional headers your program requires here
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+// TODO: reference additional headers your program requires here
#include "dsfNativeFLACSource.h"
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/flac/filters/dsfNativeFLACSource/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACHeaderTweaker.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACHeaderTweaker.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACHeaderTweaker.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,198 +1,198 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include ".\flacheadertweaker.h"
-
-FLACHeaderTweaker::FLACHeaderTweaker(void)
- : mSeenAllHeaders(false)
-
-{
- //debugLog.open("G:\\logs\\flactweaker.log", ios_base::out);
-
-}
-
-FLACHeaderTweaker::~FLACHeaderTweaker(void)
-{
-
- //debugLog<<"Pre delete old..."<<endl;
- deleteOldHeaders();
- //debugLog<<"Pre delete new..."<<endl;
- deleteNewHeaders();
- //debugLog<<"Post delete..."<<endl;
- //debugLog.close();
-}
-
-FLACHeaderTweaker::eFLACAcceptHeaderResult FLACHeaderTweaker::acceptHeader(OggPacket* inHeader) {
- //debugLog<<endl<<"Accepting header.."<<endl;
- //debugLog<<inHeader->toPackDumpString()<<endl;
- const unsigned char MORE_HEADERS_MASK = 128;
- if (!mSeenAllHeaders) {
- //debugLog<<"Still tweaking... adding to old list..."<<endl;
-
-
- mOldHeaderList.push_back(inHeader);
- if ((inHeader->packetData()[0] & MORE_HEADERS_MASK) != 0) {
- //debugLog<<"This is the last header..."<<endl;
- //Last header
- mSeenAllHeaders = true;
- if (createNewHeaderList()) {
- //debugLog<<"Create new headers OK"<<endl;
- return LAST_HEADER_ACCEPTED;
- } else {
- //debugLog<<"Create new headers FAILED"<<endl;
- return HEADER_ERROR;
- }
- } else {
- //debugLog<<"Still need more ehaders..."<<endl;
- //Still more headers to come...
- return HEADER_ACCEPTED;
- }
- } else {
- //debugLog<<"All headers already seen"<<endl;
- return ALL_HEADERS_ALREADY_SEEN;
- }
-
-}
-
-bool FLACHeaderTweaker::createNewHeaderList() {
-
- //debugLog<<"Create new header list method"<<endl;
-
- //debugLog<<"Filling first pack"<<endl;
- unsigned char* locFirstPackBuff = new unsigned char[51];
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include ".\flacheadertweaker.h"
+
+FLACHeaderTweaker::FLACHeaderTweaker(void)
+ : mSeenAllHeaders(false)
+
+{
+ //debugLog.open("G:\\logs\\flactweaker.log", ios_base::out);
+
+}
+
+FLACHeaderTweaker::~FLACHeaderTweaker(void)
+{
+
+ //debugLog<<"Pre delete old..."<<endl;
+ deleteOldHeaders();
+ //debugLog<<"Pre delete new..."<<endl;
+ deleteNewHeaders();
+ //debugLog<<"Post delete..."<<endl;
+ //debugLog.close();
+}
+
+FLACHeaderTweaker::eFLACAcceptHeaderResult FLACHeaderTweaker::acceptHeader(OggPacket* inHeader) {
+ //debugLog<<endl<<"Accepting header.."<<endl;
+ //debugLog<<inHeader->toPackDumpString()<<endl;
+ const unsigned char MORE_HEADERS_MASK = 128;
+ if (!mSeenAllHeaders) {
+ //debugLog<<"Still tweaking... adding to old list..."<<endl;
+
+
+ mOldHeaderList.push_back(inHeader);
+ if ((inHeader->packetData()[0] & MORE_HEADERS_MASK) != 0) {
+ //debugLog<<"This is the last header..."<<endl;
+ //Last header
+ mSeenAllHeaders = true;
+ if (createNewHeaderList()) {
+ //debugLog<<"Create new headers OK"<<endl;
+ return LAST_HEADER_ACCEPTED;
+ } else {
+ //debugLog<<"Create new headers FAILED"<<endl;
+ return HEADER_ERROR;
+ }
+ } else {
+ //debugLog<<"Still need more ehaders..."<<endl;
+ //Still more headers to come...
+ return HEADER_ACCEPTED;
+ }
+ } else {
+ //debugLog<<"All headers already seen"<<endl;
+ return ALL_HEADERS_ALREADY_SEEN;
+ }
+
+}
+
+bool FLACHeaderTweaker::createNewHeaderList() {
+
+ //debugLog<<"Create new header list method"<<endl;
+
+ //debugLog<<"Filling first pack"<<endl;
+ unsigned char* locFirstPackBuff = new unsigned char[51];
locFirstPackBuff[0] = '\177';
locFirstPackBuff[1] = 'F';
locFirstPackBuff[2] = 'L';
locFirstPackBuff[3] = 'A';
locFirstPackBuff[4] = 'C';
locFirstPackBuff[5] = 1;
- locFirstPackBuff[6] = 0;
- locFirstPackBuff[7] = 0; //Num header HIGH BYTE
- locFirstPackBuff[8] = mOldHeaderList.size() - 2; //Num headers LOW BYTE
- locFirstPackBuff[9] = 'f';
- locFirstPackBuff[10] = 'L';
- locFirstPackBuff[11] = 'a';
- locFirstPackBuff[12] = 'C';
-
- //debugLog<<"Copying in packet data"<<endl;
- memcpy((void*)(locFirstPackBuff + 13), (const void*) mOldHeaderList[1]->packetData(), 38);
-
- mNewHeaderList.empty();
- mNewHeaderList.clear();
- //debugLog<<"Putting first header into new list"<<endl;
- mNewHeaderList.push_back(new OggPacket(locFirstPackBuff, 51, false, false));
- locFirstPackBuff = NULL;
-
- bool locFoundComment = false;
- int locCommentNo = -1;
-
- //Start at 2, 0 is just fLaC, 1 is the stream info
- for (int i = 2; i < mOldHeaderList.size(); i++) {
- //Loop through to find the comment packet...
- //debugLog<<"Scanning old header "<<i<<endl;
- if ( ((mOldHeaderList[i]->packetData()[0]) & 127) == 4) {
- //It's the comment packet.
- //debugLog<<"Found a comment packet..."<<endl;
- locFoundComment = true;
- locCommentNo = i;
- mNewHeaderList.push_back(mOldHeaderList[i]->clone());
- }
- }
-
- if (locFoundComment != true) {
- //debugLog<<"No comments present... FATALITY !"<<endl;
- //Maybe make one... for now bail out !
- throw 0;
- }
-
- for (int i = 2; i < mOldHeaderList.size(); i++) {
-
- if (i != locCommentNo) {
- //debugLog<<"Adding another ehader..."<<endl;
- //If it's not the comment packet we already added, put it in the list.
- mNewHeaderList.push_back(mOldHeaderList[i]->clone());
- }
- }
-
- for (int i = 1; i < mNewHeaderList.size(); i++) {
- //Loop through the new headers and make sure the flags are set right.
- if (i != mNewHeaderList.size() -1) {
- //Clear the first bit
- //debugLog<<"Clearing header bit "<<i<<endl;
- mNewHeaderList[i]->packetData()[0] = mNewHeaderList[i]->packetData()[0] & 127;
- } else {
- //debugLog<<"Setting header bit "<<i<<endl;
- //Set the first bit on the last header
- mNewHeaderList[i]->packetData()[0] = mNewHeaderList[i]->packetData()[0] | 128;
- }
- }
-
- //debugLog<<"Deleting old headers..."<<endl;
- deleteOldHeaders();
-
- return true;
-
-
-}
-
-void FLACHeaderTweaker::deleteOldHeaders() {
- int locSize = mOldHeaderList.size();
- //debugLog<<"Num old headers... = "<<locSize<<endl;
- for (int i = 0; i < locSize; i++) {
- delete mOldHeaderList[i];
- }
- //debugLog<<"Post old delete loop..."<<endl;
- mOldHeaderList.clear();
-
-}
-
-void FLACHeaderTweaker::deleteNewHeaders() {
- int locSize = mNewHeaderList.size();
- //debugLog<<"Num new headers... = "<<locSize<<endl;
- for (int i = 0; i < locSize; i++) {
- delete mNewHeaderList[i];
- }
- //debugLog<<"Post new delete loop"<<endl;
-
- mNewHeaderList.clear();
-}
-
-unsigned long FLACHeaderTweaker::numNewHeaders() {
- return mNewHeaderList.size();
-}
-OggPacket* FLACHeaderTweaker::getHeader(unsigned long inHeaderNo) {
- if (inHeaderNo < mNewHeaderList.size() ) {
- return mNewHeaderList[inHeaderNo]->clone();
- } else {
- return NULL;
- }
+ locFirstPackBuff[6] = 0;
+ locFirstPackBuff[7] = 0; //Num header HIGH BYTE
+ locFirstPackBuff[8] = mOldHeaderList.size() - 2; //Num headers LOW BYTE
+ locFirstPackBuff[9] = 'f';
+ locFirstPackBuff[10] = 'L';
+ locFirstPackBuff[11] = 'a';
+ locFirstPackBuff[12] = 'C';
+
+ //debugLog<<"Copying in packet data"<<endl;
+ memcpy((void*)(locFirstPackBuff + 13), (const void*) mOldHeaderList[1]->packetData(), 38);
+
+ mNewHeaderList.empty();
+ mNewHeaderList.clear();
+ //debugLog<<"Putting first header into new list"<<endl;
+ mNewHeaderList.push_back(new OggPacket(locFirstPackBuff, 51, false, false));
+ locFirstPackBuff = NULL;
+
+ bool locFoundComment = false;
+ int locCommentNo = -1;
+
+ //Start at 2, 0 is just fLaC, 1 is the stream info
+ for (int i = 2; i < mOldHeaderList.size(); i++) {
+ //Loop through to find the comment packet...
+ //debugLog<<"Scanning old header "<<i<<endl;
+ if ( ((mOldHeaderList[i]->packetData()[0]) & 127) == 4) {
+ //It's the comment packet.
+ //debugLog<<"Found a comment packet..."<<endl;
+ locFoundComment = true;
+ locCommentNo = i;
+ mNewHeaderList.push_back(mOldHeaderList[i]->clone());
+ }
+ }
+
+ if (locFoundComment != true) {
+ //debugLog<<"No comments present... FATALITY !"<<endl;
+ //Maybe make one... for now bail out !
+ throw 0;
+ }
+
+ for (int i = 2; i < mOldHeaderList.size(); i++) {
+
+ if (i != locCommentNo) {
+ //debugLog<<"Adding another ehader..."<<endl;
+ //If it's not the comment packet we already added, put it in the list.
+ mNewHeaderList.push_back(mOldHeaderList[i]->clone());
+ }
+ }
+
+ for (int i = 1; i < mNewHeaderList.size(); i++) {
+ //Loop through the new headers and make sure the flags are set right.
+ if (i != mNewHeaderList.size() -1) {
+ //Clear the first bit
+ //debugLog<<"Clearing header bit "<<i<<endl;
+ mNewHeaderList[i]->packetData()[0] = mNewHeaderList[i]->packetData()[0] & 127;
+ } else {
+ //debugLog<<"Setting header bit "<<i<<endl;
+ //Set the first bit on the last header
+ mNewHeaderList[i]->packetData()[0] = mNewHeaderList[i]->packetData()[0] | 128;
+ }
+ }
+
+ //debugLog<<"Deleting old headers..."<<endl;
+ deleteOldHeaders();
+
+ return true;
+
+
+}
+
+void FLACHeaderTweaker::deleteOldHeaders() {
+ int locSize = mOldHeaderList.size();
+ //debugLog<<"Num old headers... = "<<locSize<<endl;
+ for (int i = 0; i < locSize; i++) {
+ delete mOldHeaderList[i];
+ }
+ //debugLog<<"Post old delete loop..."<<endl;
+ mOldHeaderList.clear();
+
+}
+
+void FLACHeaderTweaker::deleteNewHeaders() {
+ int locSize = mNewHeaderList.size();
+ //debugLog<<"Num new headers... = "<<locSize<<endl;
+ for (int i = 0; i < locSize; i++) {
+ delete mNewHeaderList[i];
+ }
+ //debugLog<<"Post new delete loop"<<endl;
+
+ mNewHeaderList.clear();
+}
+
+unsigned long FLACHeaderTweaker::numNewHeaders() {
+ return mNewHeaderList.size();
+}
+OggPacket* FLACHeaderTweaker::getHeader(unsigned long inHeaderNo) {
+ if (inHeaderNo < mNewHeaderList.size() ) {
+ return mNewHeaderList[inHeaderNo]->clone();
+ } else {
+ return NULL;
+ }
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACHeaderTweaker.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACHeaderTweaker.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACHeaderTweaker.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACHeaderTweaker.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,67 +1,67 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "dllstuff.h"
-#include "OggPacket.h"
-#include <vector>
-#include <fstream>
-using namespace std;
-class FLACHeaderTweaker
-{
-public:
- FLACHeaderTweaker(void);
- ~FLACHeaderTweaker(void);
-
- enum eFLACAcceptHeaderResult {
- HEADER_ACCEPTED = 0,
- LAST_HEADER_ACCEPTED = 1,
- HEADER_ERROR = 100,
- ALL_HEADERS_ALREADY_SEEN = 101
- };
-
- eFLACAcceptHeaderResult acceptHeader(OggPacket* inHeader);
-
- unsigned long numNewHeaders();
- OggPacket* getHeader(unsigned long inHeaderNo);
-protected:
- bool createNewHeaderList();
- void deleteOldHeaders();
- void deleteNewHeaders();
-
-
- vector<OggPacket*> mOldHeaderList;
- vector<OggPacket*> mNewHeaderList;
-
-
- //fstream debugLog;
- bool mSeenAllHeaders;
-};
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "dllstuff.h"
+#include "OggPacket.h"
+#include <vector>
+#include <fstream>
+using namespace std;
+class FLACHeaderTweaker
+{
+public:
+ FLACHeaderTweaker(void);
+ ~FLACHeaderTweaker(void);
+
+ enum eFLACAcceptHeaderResult {
+ HEADER_ACCEPTED = 0,
+ LAST_HEADER_ACCEPTED = 1,
+ HEADER_ERROR = 100,
+ ALL_HEADERS_ALREADY_SEEN = 101
+ };
+
+ eFLACAcceptHeaderResult acceptHeader(OggPacket* inHeader);
+
+ unsigned long numNewHeaders();
+ OggPacket* getHeader(unsigned long inHeaderNo);
+protected:
+ bool createNewHeaderList();
+ void deleteOldHeaders();
+ void deleteNewHeaders();
+
+
+ vector<OggPacket*> mOldHeaderList;
+ vector<OggPacket*> mNewHeaderList;
+
+
+ //fstream debugLog;
+ bool mSeenAllHeaders;
+};
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACHeaderTweaker.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACMetadataSplitter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACMetadataSplitter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACMetadataSplitter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,173 +1,173 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include ".\flacmetadatasplitter.h"
-
-FLACMetadataSplitter::FLACMetadataSplitter(void)
- : mMetadataBlock(NULL)
-{
- //debugLog.open("G:\\logs\\flacsplitter.log", ios_base::out);
-}
-
-FLACMetadataSplitter::~FLACMetadataSplitter(void)
-{
- delete mMetadataBlock;
- //Delete stuff !!
- //debugLog.close();
-}
-StampedOggPacket* FLACMetadataSplitter::convertToStampedPacket(OggPacket* inPacket) {
- //Convert the old packet to the new one.
- //This function deletes the incoming packet... and transfers the buffer directly into
- // the stamped packet without a memcpy
- //debugLog<<"Convert packet..."<<endl;
- StampedOggPacket* locStamped = new StampedOggPacket(inPacket->packetData(), inPacket->packetSize(), false, false, 0,0,StampedOggPacket::OGG_END_ONLY);
- //Ensure when we delete the old packet, it doesn't delete it's buffer
- inPacket->setPacketData(NULL);
- delete inPacket;
- //debugLog<<"Post delete..."<<endl;
- return locStamped;
-}
-
-bool FLACMetadataSplitter::loadMetadata(OggPacket* inMetadata) {
- //debugLog<<"Load Metadata"<<endl;
- delete mMetadataBlock;
- mMetadataBlock = inMetadata;
- return splitMetadata();
-}
-unsigned long FLACMetadataSplitter::numHeaders() {
- return mHeaderTweaker.numNewHeaders();
-}
-StampedOggPacket* FLACMetadataSplitter::getHeader(unsigned long inIndex) {
- if (inIndex < mHeaderTweaker.numNewHeaders()) {
- return (FLACMetadataSplitter::convertToStampedPacket(mHeaderTweaker.getHeader(inIndex)));
- } else {
- return NULL;
- }
-}
-
-void FLACMetadataSplitter::emptyList() {
-
-
-}
-bool FLACMetadataSplitter::splitMetadata() {
- //debugLog<<"Splitmetadata"<<endl;
- //emptyList();
- //OggPacket* locPacket = NULL;
- unsigned char* locBuff = NULL;
- if (mMetadataBlock == NULL) {
- return false;
- } else {
- if (verifyCodecID()) {
- //debugLog<<"Start adding packets..."<<endl;
- addCodecIdent();
- addStreamInfo();
- addOtherHeaders();
- //debugLog<<"Done adding packets..."<<endl;
- } else {
- return false;
- }
-
- }
-
-}
-
-bool FLACMetadataSplitter::addOtherHeaders() {
- //debugLog<<"Add other headers..."<<endl;
- unsigned long locUpto = 42;
- unsigned long locMetaSize = mMetadataBlock->packetSize();
- unsigned char* locSourceBuff = mMetadataBlock->packetData(); //Don't delete !
- unsigned char* locNewBuff = NULL;
- unsigned long locPacketSize = 0;
- OggPacket* locPacket = NULL;
-
- //debugLog<<"Metadata size = "<<locMetaSize<<endl;
- while ( locUpto < locMetaSize) {
- //debugLog<<"Add others loop... upto = "<<locUpto<<endl;
- for (int i = 1; i < 4; i++) {
- locPacketSize <<=8;
- locPacketSize += locSourceBuff[locUpto+i];
- }
- locPacketSize += 4;
- //debugLog<<"Packet size = "<<locPacketSize<<endl;
- //locUpto += 4;
-
- locNewBuff = new unsigned char[locPacketSize];
- memcpy((void*)locNewBuff, (const void*)(locSourceBuff + locUpto), locPacketSize);
-
- locPacket = new OggPacket(locNewBuff, locPacketSize, false, false);
- //debugLog<<"Adding other packet..."<<endl;
- //debugLog<<locPacket->toPackDumpString()<<endl;
- mHeaderTweaker.acceptHeader(locPacket);
- locPacket = NULL;
-
- locUpto += (locPacketSize);
-
-
- }
-
- return true;
-}
-bool FLACMetadataSplitter::addStreamInfo() {
- //debugLog<<"addstreaminfo..."<<endl;
- OggPacket* locPacket = NULL;
- unsigned char* locBuff = new unsigned char[38];
-
- memcpy((void*)locBuff, (const void*)(mMetadataBlock->packetData()+4), 38);
- locPacket = new OggPacket(locBuff, 38, false, false); //No need to delete
- //debugLog<<"Adding stream info packet..."<<endl;
- //debugLog<<locPacket->toPackDumpString()<<endl;
- mHeaderTweaker.acceptHeader(locPacket);
- return true;
-}
-bool FLACMetadataSplitter::addCodecIdent() {
- //debugLog<<"Add codec ident"<<endl;
- OggPacket* locPacket = NULL;
- unsigned char* locBuff = new unsigned char[4];
- locBuff[0] = 'f';
- locBuff[1] = 'L';
- locBuff[2] = 'a';
- locBuff[3] = 'C';
- locPacket = new OggPacket(locBuff, 4, false, false); //No need to delete.
- mHeaderTweaker.acceptHeader(locPacket);
- return true;
-}
-
-bool FLACMetadataSplitter::verifyCodecID() {
- if ((strncmp((char*)mMetadataBlock->packetData(), "fLaC\000\000\000\042", 8)) == 0) {
- //debugLog<<"Codec verified"<<endl;
- return true;
- } else {
- //debugLog<<"Codec NOT VERIFIED"<<endl;
- return false;
- }
-
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include ".\flacmetadatasplitter.h"
+
+FLACMetadataSplitter::FLACMetadataSplitter(void)
+ : mMetadataBlock(NULL)
+{
+ //debugLog.open("G:\\logs\\flacsplitter.log", ios_base::out);
+}
+
+FLACMetadataSplitter::~FLACMetadataSplitter(void)
+{
+ delete mMetadataBlock;
+ //Delete stuff !!
+ //debugLog.close();
+}
+StampedOggPacket* FLACMetadataSplitter::convertToStampedPacket(OggPacket* inPacket) {
+ //Convert the old packet to the new one.
+ //This function deletes the incoming packet... and transfers the buffer directly into
+ // the stamped packet without a memcpy
+ //debugLog<<"Convert packet..."<<endl;
+ StampedOggPacket* locStamped = new StampedOggPacket(inPacket->packetData(), inPacket->packetSize(), false, false, 0,0,StampedOggPacket::OGG_END_ONLY);
+ //Ensure when we delete the old packet, it doesn't delete it's buffer
+ inPacket->setPacketData(NULL);
+ delete inPacket;
+ //debugLog<<"Post delete..."<<endl;
+ return locStamped;
+}
+
+bool FLACMetadataSplitter::loadMetadata(OggPacket* inMetadata) {
+ //debugLog<<"Load Metadata"<<endl;
+ delete mMetadataBlock;
+ mMetadataBlock = inMetadata;
+ return splitMetadata();
+}
+unsigned long FLACMetadataSplitter::numHeaders() {
+ return mHeaderTweaker.numNewHeaders();
+}
+StampedOggPacket* FLACMetadataSplitter::getHeader(unsigned long inIndex) {
+ if (inIndex < mHeaderTweaker.numNewHeaders()) {
+ return (FLACMetadataSplitter::convertToStampedPacket(mHeaderTweaker.getHeader(inIndex)));
+ } else {
+ return NULL;
+ }
+}
+
+void FLACMetadataSplitter::emptyList() {
+
+
+}
+bool FLACMetadataSplitter::splitMetadata() {
+ //debugLog<<"Splitmetadata"<<endl;
+ //emptyList();
+ //OggPacket* locPacket = NULL;
+ unsigned char* locBuff = NULL;
+ if (mMetadataBlock == NULL) {
+ return false;
+ } else {
+ if (verifyCodecID()) {
+ //debugLog<<"Start adding packets..."<<endl;
+ addCodecIdent();
+ addStreamInfo();
+ addOtherHeaders();
+ //debugLog<<"Done adding packets..."<<endl;
+ } else {
+ return false;
+ }
+
+ }
+
+}
+
+bool FLACMetadataSplitter::addOtherHeaders() {
+ //debugLog<<"Add other headers..."<<endl;
+ unsigned long locUpto = 42;
+ unsigned long locMetaSize = mMetadataBlock->packetSize();
+ unsigned char* locSourceBuff = mMetadataBlock->packetData(); //Don't delete !
+ unsigned char* locNewBuff = NULL;
+ unsigned long locPacketSize = 0;
+ OggPacket* locPacket = NULL;
+
+ //debugLog<<"Metadata size = "<<locMetaSize<<endl;
+ while ( locUpto < locMetaSize) {
+ //debugLog<<"Add others loop... upto = "<<locUpto<<endl;
+ for (int i = 1; i < 4; i++) {
+ locPacketSize <<=8;
+ locPacketSize += locSourceBuff[locUpto+i];
+ }
+ locPacketSize += 4;
+ //debugLog<<"Packet size = "<<locPacketSize<<endl;
+ //locUpto += 4;
+
+ locNewBuff = new unsigned char[locPacketSize];
+ memcpy((void*)locNewBuff, (const void*)(locSourceBuff + locUpto), locPacketSize);
+
+ locPacket = new OggPacket(locNewBuff, locPacketSize, false, false);
+ //debugLog<<"Adding other packet..."<<endl;
+ //debugLog<<locPacket->toPackDumpString()<<endl;
+ mHeaderTweaker.acceptHeader(locPacket);
+ locPacket = NULL;
+
+ locUpto += (locPacketSize);
+
+
+ }
+
+ return true;
+}
+bool FLACMetadataSplitter::addStreamInfo() {
+ //debugLog<<"addstreaminfo..."<<endl;
+ OggPacket* locPacket = NULL;
+ unsigned char* locBuff = new unsigned char[38];
+
+ memcpy((void*)locBuff, (const void*)(mMetadataBlock->packetData()+4), 38);
+ locPacket = new OggPacket(locBuff, 38, false, false); //No need to delete
+ //debugLog<<"Adding stream info packet..."<<endl;
+ //debugLog<<locPacket->toPackDumpString()<<endl;
+ mHeaderTweaker.acceptHeader(locPacket);
+ return true;
+}
+bool FLACMetadataSplitter::addCodecIdent() {
+ //debugLog<<"Add codec ident"<<endl;
+ OggPacket* locPacket = NULL;
+ unsigned char* locBuff = new unsigned char[4];
+ locBuff[0] = 'f';
+ locBuff[1] = 'L';
+ locBuff[2] = 'a';
+ locBuff[3] = 'C';
+ locPacket = new OggPacket(locBuff, 4, false, false); //No need to delete.
+ mHeaderTweaker.acceptHeader(locPacket);
+ return true;
+}
+
+bool FLACMetadataSplitter::verifyCodecID() {
+ if ((strncmp((char*)mMetadataBlock->packetData(), "fLaC\000\000\000\042", 8)) == 0) {
+ //debugLog<<"Codec verified"<<endl;
+ return true;
+ } else {
+ //debugLog<<"Codec NOT VERIFIED"<<endl;
+ return false;
+ }
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACMetadataSplitter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACMetadataSplitter.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACMetadataSplitter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACMetadataSplitter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,65 +1,65 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include "dllstuff.h"
-#include "OggPacket.h"
-#include "StampedOggPacket.h"
-#include "FLACHeaderTweaker.h"
-
-#include <fstream>
-
-using namespace std;
-
-class FLACMetadataSplitter
-{
-public:
- FLACMetadataSplitter(void);
- ~FLACMetadataSplitter(void);
-
-
- bool loadMetadata(OggPacket* inMetadata);
- unsigned long numHeaders();
- StampedOggPacket* getHeader(unsigned long inIndex);
-protected:
- static StampedOggPacket* convertToStampedPacket(OggPacket* inPacket);
- OggPacket* mMetadataBlock;
- FLACHeaderTweaker mHeaderTweaker;
-
- void emptyList();
- bool addOtherHeaders();
- bool addStreamInfo();
- bool verifyCodecID();
- bool addCodecIdent();
-
- bool splitMetadata();
-
- //fstream debugLog;
-};
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+#include "dllstuff.h"
+#include "OggPacket.h"
+#include "StampedOggPacket.h"
+#include "FLACHeaderTweaker.h"
+
+#include <fstream>
+
+using namespace std;
+
+class FLACMetadataSplitter
+{
+public:
+ FLACMetadataSplitter(void);
+ ~FLACMetadataSplitter(void);
+
+
+ bool loadMetadata(OggPacket* inMetadata);
+ unsigned long numHeaders();
+ StampedOggPacket* getHeader(unsigned long inIndex);
+protected:
+ static StampedOggPacket* convertToStampedPacket(OggPacket* inPacket);
+ OggPacket* mMetadataBlock;
+ FLACHeaderTweaker mHeaderTweaker;
+
+ void emptyList();
+ bool addOtherHeaders();
+ bool addStreamInfo();
+ bool verifyCodecID();
+ bool addCodecIdent();
+
+ bool splitMetadata();
+
+ //fstream debugLog;
+};
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACMetadataSplitter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACPushDecoder.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACPushDecoder.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACPushDecoder.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,62 +1,62 @@
-#include "StdAfx.h"
-#include ".\flacpushdecoder.h"
-
-FLACPushDecoder::FLACPushDecoder(void)
- : mInPacket(NULL)
- , mOutPacket(NULL)
- , mNumChannels(0)
- , mFrameSize(0)
- , mSampleRate(0)
- , mBegun(false)
- , mGotMetaData(false)
-{
-
-}
-
-FLACPushDecoder::~FLACPushDecoder(void)
-{
- delete mInPacket;
- delete mOutPacket;
-}
-
-void FLACPushDecoder::initCodec() {
- init();
-}
-void FLACPushDecoder::flushCodec() {
- flush();
-}
-
-bool FLACPushDecoder::acceptMetadata(OggPacket* inPacket) {
- delete mInPacket;
- mInPacket = inPacket;
- bool locMetaOK = process_until_end_of_metadata();
- delete mInPacket;
- mInPacket = NULL;
- delete mOutPacket;
- mOutPacket = NULL;
- return locMetaOK;
-}
-StampedOggPacket* FLACPushDecoder::decodeFLAC(OggPacket* inPacket) {
- //Basically puts the incoming packet into the member variable.
- //Calls process_single() and the read call back is fired.
- //The read callback feeds in the packet we just saved.
- //The write callback fires.
- //The write callback sets the outpacket into a member variable.
- //We return the member variable.
- delete mInPacket;
- mInPacket = inPacket;
- if(process_single()) {
- return mOutPacket;
- } else {
- delete mInPacket;
- mInPacket = NULL;
- delete mOutPacket;
- mOutPacket = NULL;
- return NULL;
- }
-
-}
-//FLAC Callbacks
+#include "StdAfx.h"
+#include ".\flacpushdecoder.h"
+
+FLACPushDecoder::FLACPushDecoder(void)
+ : mInPacket(NULL)
+ , mOutPacket(NULL)
+ , mNumChannels(0)
+ , mFrameSize(0)
+ , mSampleRate(0)
+ , mBegun(false)
+ , mGotMetaData(false)
+{
+
+}
+
+FLACPushDecoder::~FLACPushDecoder(void)
+{
+ delete mInPacket;
+ delete mOutPacket;
+}
+
+void FLACPushDecoder::initCodec() {
+ init();
+}
+void FLACPushDecoder::flushCodec() {
+ flush();
+}
+
+bool FLACPushDecoder::acceptMetadata(OggPacket* inPacket) {
+ delete mInPacket;
+ mInPacket = inPacket;
+ bool locMetaOK = process_until_end_of_metadata();
+ delete mInPacket;
+ mInPacket = NULL;
+ delete mOutPacket;
+ mOutPacket = NULL;
+ return locMetaOK;
+}
+StampedOggPacket* FLACPushDecoder::decodeFLAC(OggPacket* inPacket) {
+ //Basically puts the incoming packet into the member variable.
+ //Calls process_single() and the read call back is fired.
+ //The read callback feeds in the packet we just saved.
+ //The write callback fires.
+ //The write callback sets the outpacket into a member variable.
+ //We return the member variable.
+ delete mInPacket;
+ mInPacket = inPacket;
+ if(process_single()) {
+ return mOutPacket;
+ } else {
+ delete mInPacket;
+ mInPacket = NULL;
+ delete mOutPacket;
+ mOutPacket = NULL;
+ return NULL;
+ }
+
+}
+//FLAC Callbacks
::FLAC__StreamDecoderReadStatus FLACPushDecoder::read_callback(FLAC__byte outBuffer[], unsigned* outNumBytes)
{
//If we have a packet waiting...
@@ -80,57 +80,57 @@
}
::FLAC__StreamDecoderWriteStatus FLACPushDecoder::write_callback(const ::FLAC__Frame* inFrame, const FLAC__int32* const inBuffer[])
{
-
- if (! mBegun) {
-
- mBegun = true;
-
- mNumChannels = inFrame->header.channels;
- mFrameSize = mNumChannels * SIZE_16_BITS;
- mSampleRate = inFrame->header.sample_rate;
-
- }
- unsigned long locNumFrames = inFrame->header.blocksize;
- unsigned long locActualSize = locNumFrames * mFrameSize;
- unsigned long locTotalFrameCount = locNumFrames * mNumChannels;
-
- //BUG::: There's a bug here. Implicitly assumes 2 channels.
- unsigned char* locBuff = new unsigned char[locActualSize];
-
-
- signed short* locShortBuffer = (signed short*)locBuff; //Don't delete this.
-
- signed short tempInt = 0;
- int tempLong = 0;
- float tempFloat = 0;
-
- //FIX:::Move the clipping to the abstract function
- //Make sure our sample buffer is big enough
-
- //Modified for FLAC int32 not float
-
-
- //Must interleave and convert sample size.
- for(unsigned long i = 0; i < locNumFrames; i++) {
- for (unsigned long j = 0; j < mNumChannels; j++) {
-
-
- //No clipping required for ints
- //FIX:::Take out the unnescessary variable.
- tempLong = inBuffer[j][i];
- //Convert 32 bit to 16 bit
-
- //FIX::: Why on earth are you dividing by 2 ? It does not make sense !
- tempInt = (signed short)(tempLong/2);
-
- *locShortBuffer = tempInt;
- locShortBuffer++;
- }
- }
- delete mOutPacket;
- mOutPacket = new StampedOggPacket(locBuff, locActualSize, false, false, 0, locNumFrames, StampedOggPacket::OGG_END_ONLY);
- return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
+ if (! mBegun) {
+
+ mBegun = true;
+
+ mNumChannels = inFrame->header.channels;
+ mFrameSize = mNumChannels * SIZE_16_BITS;
+ mSampleRate = inFrame->header.sample_rate;
+
+ }
+ unsigned long locNumFrames = inFrame->header.blocksize;
+ unsigned long locActualSize = locNumFrames * mFrameSize;
+ unsigned long locTotalFrameCount = locNumFrames * mNumChannels;
+
+ //BUG::: There's a bug here. Implicitly assumes 2 channels.
+ unsigned char* locBuff = new unsigned char[locActualSize];
+
+
+ signed short* locShortBuffer = (signed short*)locBuff; //Don't delete this.
+
+ signed short tempInt = 0;
+ int tempLong = 0;
+ float tempFloat = 0;
+
+ //FIX:::Move the clipping to the abstract function
+ //Make sure our sample buffer is big enough
+
+ //Modified for FLAC int32 not float
+
+
+ //Must interleave and convert sample size.
+ for(unsigned long i = 0; i < locNumFrames; i++) {
+ for (unsigned long j = 0; j < mNumChannels; j++) {
+
+
+ //No clipping required for ints
+ //FIX:::Take out the unnescessary variable.
+ tempLong = inBuffer[j][i];
+ //Convert 32 bit to 16 bit
+
+ //FIX::: Why on earth are you dividing by 2 ? It does not make sense !
+ tempInt = (signed short)(tempLong/2);
+
+ *locShortBuffer = tempInt;
+ locShortBuffer++;
+ }
+ }
+ delete mOutPacket;
+ mOutPacket = new StampedOggPacket(locBuff, locActualSize, false, false, 0, locNumFrames, StampedOggPacket::OGG_END_ONLY);
+ return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
+
}
void FLACPushDecoder::metadata_callback(const ::FLAC__StreamMetadata* inMetadata)
{
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACPushDecoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACPushDecoder.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACPushDecoder.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACPushDecoder.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,36 +1,36 @@
-#pragma once
-#include "dllstuff.h"
-#include "StampedOggPacket.h"
-#include "OggPacket.h"
-#include "FLAC++/decoder.h"
-using namespace FLAC::Decoder;
-class FLACPushDecoder
- : protected Stream
-{
-public:
- FLACPushDecoder(void);
- virtual ~FLACPushDecoder(void);
-
+#pragma once
+#include "dllstuff.h"
+#include "StampedOggPacket.h"
+#include "OggPacket.h"
+#include "FLAC++/decoder.h"
+using namespace FLAC::Decoder;
+class FLACPushDecoder
+ : protected Stream
+{
+public:
+ FLACPushDecoder(void);
+ virtual ~FLACPushDecoder(void);
+
StampedOggPacket* decodeFLAC(OggPacket* inPacket);
bool acceptMetadata(OggPacket* inPacket);
-
- void initCodec();
- void flushCodec();
- //Probably shouldn't be public... but who cares for now.
- unsigned long mNumChannels;
- unsigned long mFrameSize;
- unsigned long mSampleRate;
-protected:
- static const int SIZE_16_BITS = 2;
- //Virtuals frmo FLAC decoder
+
+ void initCodec();
+ void flushCodec();
+ //Probably shouldn't be public... but who cares for now.
+ unsigned long mNumChannels;
+ unsigned long mFrameSize;
+ unsigned long mSampleRate;
+protected:
+ static const int SIZE_16_BITS = 2;
+ //Virtuals frmo FLAC decoder
virtual ::FLAC__StreamDecoderReadStatus read_callback(FLAC__byte buffer[], unsigned *bytes);
virtual ::FLAC__StreamDecoderWriteStatus write_callback(const ::FLAC__Frame *frame, const FLAC__int32 * const buffer[]);
virtual void metadata_callback(const ::FLAC__StreamMetadata *metadata);
- virtual void error_callback(::FLAC__StreamDecoderErrorStatus status);
-
- OggPacket* mInPacket;
- StampedOggPacket* mOutPacket;
- bool mBegun;
- bool mGotMetaData;
-
-};
+ virtual void error_callback(::FLAC__StreamDecoderErrorStatus status);
+
+ OggPacket* mInPacket;
+ StampedOggPacket* mOutPacket;
+ bool mBegun;
+ bool mGotMetaData;
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/FLACPushDecoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// libFLACHelper.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// libFLACHelper.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,11 +1,11 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-
-// TODO: reference additional headers your program requires here
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libFLACHelper/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/all.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/assert.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/callback.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/export.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/file_decoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/file_encoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/format.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/metadata.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/ordinals.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/seekable_stream_decoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/seekable_stream_encoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/stream_decoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC/stream_encoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC++/all.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC++/decoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC++/encoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC++/export.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/FLAC++/metadata.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/OggFLAC/all.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/OggFLAC/export.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/OggFLAC/file_decoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/OggFLAC/file_encoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/OggFLAC/seekable_stream_decoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/OggFLAC/seekable_stream_encoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/OggFLAC/stream_decoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/OggFLAC/stream_encoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/OggFLAC++/all.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/OggFLAC++/decoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/OggFLAC++/encoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/OggFLAC++/export.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/gain_analysis.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/gain_analysis.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/gain_analysis.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,57 +1,57 @@
-/*
- * ReplayGainAnalysis - analyzes input samples and give the recommended dB change
- * Copyright (C) 2001 David Robinson and Glen Sawyer
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * concept and filter values by David Robinson (David at Robinson.org)
- * -- blame him if you think the idea is flawed
- * coding by Glen Sawyer (glensawyer at hotmail.com) 442 N 700 E, Provo, UT 84606 USA
- * -- blame him if you think this runs too slowly, or the coding is otherwise flawed
- * minor cosmetic tweaks to integrate with FLAC by Josh Coalson
- *
- * For an explanation of the concepts and the basic algorithms involved, go to:
- * http://www.replaygain.org/
- */
-
-#ifndef GAIN_ANALYSIS_H
-#define GAIN_ANALYSIS_H
-
-#include <stddef.h>
-
-#define GAIN_NOT_ENOUGH_SAMPLES -24601
-#define GAIN_ANALYSIS_ERROR 0
-#define GAIN_ANALYSIS_OK 1
-
-#define INIT_GAIN_ANALYSIS_ERROR 0
-#define INIT_GAIN_ANALYSIS_OK 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef float Float_t; /* Type used for filtering */
-
-int InitGainAnalysis ( long samplefreq );
-int AnalyzeSamples ( const Float_t* left_samples, const Float_t* right_samples, size_t num_samples, int num_channels );
-int ResetSampleFrequency ( long samplefreq );
-Float_t GetTitleGain ( void );
-Float_t GetAlbumGain ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GAIN_ANALYSIS_H */
+/*
+ * ReplayGainAnalysis - analyzes input samples and give the recommended dB change
+ * Copyright (C) 2001 David Robinson and Glen Sawyer
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * concept and filter values by David Robinson (David at Robinson.org)
+ * -- blame him if you think the idea is flawed
+ * coding by Glen Sawyer (glensawyer at hotmail.com) 442 N 700 E, Provo, UT 84606 USA
+ * -- blame him if you think this runs too slowly, or the coding is otherwise flawed
+ * minor cosmetic tweaks to integrate with FLAC by Josh Coalson
+ *
+ * For an explanation of the concepts and the basic algorithms involved, go to:
+ * http://www.replaygain.org/
+ */
+
+#ifndef GAIN_ANALYSIS_H
+#define GAIN_ANALYSIS_H
+
+#include <stddef.h>
+
+#define GAIN_NOT_ENOUGH_SAMPLES -24601
+#define GAIN_ANALYSIS_ERROR 0
+#define GAIN_ANALYSIS_OK 1
+
+#define INIT_GAIN_ANALYSIS_ERROR 0
+#define INIT_GAIN_ANALYSIS_OK 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef float Float_t; /* Type used for filtering */
+
+int InitGainAnalysis ( long samplefreq );
+int AnalyzeSamples ( const Float_t* left_samples, const Float_t* right_samples, size_t num_samples, int num_channels );
+int ResetSampleFrequency ( long samplefreq );
+Float_t GetTitleGain ( void );
+Float_t GetAlbumGain ( void );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GAIN_ANALYSIS_H */
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/gain_analysis.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/getopt.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/grabbag/cuesheet.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/grabbag/file.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/grabbag/replaygain.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/grabbag/seektable.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/grabbag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/replaygain_analysis.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/replaygain_analysis.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/replaygain_analysis.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,57 +1,57 @@
-/*
- * ReplayGainAnalysis - analyzes input samples and give the recommended dB change
- * Copyright (C) 2001 David Robinson and Glen Sawyer
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * concept and filter values by David Robinson (David at Robinson.org)
- * -- blame him if you think the idea is flawed
- * coding by Glen Sawyer (glensawyer at hotmail.com) 442 N 700 E, Provo, UT 84606 USA
- * -- blame him if you think this runs too slowly, or the coding is otherwise flawed
- * minor cosmetic tweaks to integrate with FLAC by Josh Coalson
- *
- * For an explanation of the concepts and the basic algorithms involved, go to:
- * http://www.replaygain.org/
- */
-
-#ifndef GAIN_ANALYSIS_H
-#define GAIN_ANALYSIS_H
-
-#include <stddef.h>
-
-#define GAIN_NOT_ENOUGH_SAMPLES -24601
-#define GAIN_ANALYSIS_ERROR 0
-#define GAIN_ANALYSIS_OK 1
-
-#define INIT_GAIN_ANALYSIS_ERROR 0
-#define INIT_GAIN_ANALYSIS_OK 1
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef float Float_t; /* Type used for filtering */
-
-int InitGainAnalysis ( long samplefreq );
-int AnalyzeSamples ( const Float_t* left_samples, const Float_t* right_samples, size_t num_samples, int num_channels );
-int ResetSampleFrequency ( long samplefreq );
-Float_t GetTitleGain ( void );
-Float_t GetAlbumGain ( void );
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* GAIN_ANALYSIS_H */
+/*
+ * ReplayGainAnalysis - analyzes input samples and give the recommended dB change
+ * Copyright (C) 2001 David Robinson and Glen Sawyer
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ * concept and filter values by David Robinson (David at Robinson.org)
+ * -- blame him if you think the idea is flawed
+ * coding by Glen Sawyer (glensawyer at hotmail.com) 442 N 700 E, Provo, UT 84606 USA
+ * -- blame him if you think this runs too slowly, or the coding is otherwise flawed
+ * minor cosmetic tweaks to integrate with FLAC by Josh Coalson
+ *
+ * For an explanation of the concepts and the basic algorithms involved, go to:
+ * http://www.replaygain.org/
+ */
+
+#ifndef GAIN_ANALYSIS_H
+#define GAIN_ANALYSIS_H
+
+#include <stddef.h>
+
+#define GAIN_NOT_ENOUGH_SAMPLES -24601
+#define GAIN_ANALYSIS_ERROR 0
+#define GAIN_ANALYSIS_OK 1
+
+#define INIT_GAIN_ANALYSIS_ERROR 0
+#define INIT_GAIN_ANALYSIS_OK 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef float Float_t; /* Type used for filtering */
+
+int InitGainAnalysis ( long samplefreq );
+int AnalyzeSamples ( const Float_t* left_samples, const Float_t* right_samples, size_t num_samples, int num_channels );
+int ResetSampleFrequency ( long samplefreq );
+Float_t GetTitleGain ( void );
+Float_t GetAlbumGain ( void );
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* GAIN_ANALYSIS_H */
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/replaygain_analysis.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/replaygain_synthesis.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/include/share/utf8.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/flac/analyze.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/flac/decode.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/flac/encode.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/flac/local_string_utils.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/flac/utils.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/flac/vorbiscomment.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/ia32/nasm.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/private/all.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/private/bitbuffer.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/private/bitmath.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/private/cpu.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/private/crc.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/private/fixed.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/private/format.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/private/lpc.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/private/md5.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/private/memory.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/private/metadata.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/private/stream_encoder_framing.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/protected/all.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/protected/file_decoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/protected/file_encoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/protected/seekable_stream_decoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/protected/seekable_stream_encoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/protected/stream_decoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC/include/protected/stream_encoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC++/file_decoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC++/file_encoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC++/metadata.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC++/seekable_stream_decoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC++/seekable_stream_encoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC++/stream_decoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libFLAC++/stream_encoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC/include/private/all.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC/include/private/ogg_decoder_aspect.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC/include/private/ogg_encoder_aspect.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC/include/private/ogg_helper.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC/include/private/ogg_mapping.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC/include/protected/all.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC/include/protected/file_decoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC/include/protected/file_encoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC/include/protected/seekable_stream_decoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC/include/protected/seekable_stream_encoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC/include/protected/stream_decoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC/include/protected/stream_encoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC++/file_decoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC++/file_encoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC++/seekable_stream_decoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC++/seekable_stream_encoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC++/stream_decoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/libOggFLAC++/stream_encoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/metaflac/operations.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/metaflac/options.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/metaflac/usage.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/metaflac/utils.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_common/all.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_common/canonical_tag.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_common/canonical_tag.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_common/canonical_tag.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,88 +1,88 @@
-/* plugin_common - Routines common to several plugins
- * Copyright (C) 2002,2003,2004 Josh Coalson
- *
- * 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.
- */
-
-#ifndef FLAC__PLUGIN_COMMON__CANONICAL_TAG_H
-#define FLAC__PLUGIN_COMMON__CANONICAL_TAG_H
-
-#include "FLAC/ordinals.h"
-
-/* TODO: splay tree? */
-typedef struct tagFLAC__tag_entry FLAC__tag_entry;
-struct tagFLAC__tag_entry
-{
- FLAC__tag_entry *next, *prev;
- /* TODO: name in ascii? */
- wchar_t *name;
- wchar_t *value;
-};
-
-typedef struct {
- FLAC__tag_entry *head, *tail;
- unsigned count;
-} FLAC_Plugin__CanonicalTag;
-
-
-typedef FLAC__tag_entry *FLAC__tag_iterator;
-
-FLAC_Plugin__CanonicalTag *FLAC_plugin__canonical_tag_new();
-void FLAC_plugin__canonical_tag_init(FLAC_Plugin__CanonicalTag *);
-void FLAC_plugin__canonical_tag_clear(FLAC_Plugin__CanonicalTag *);
-void FLAC_plugin__canonical_tag_delete(FLAC_Plugin__CanonicalTag *);
-
-/* note that multiple fields with the same name are allowed.
- * set - adds field if it's not present yet, or replaces
- * existing field if it's present.
- */
-void FLAC_plugin__canonical_set(FLAC_Plugin__CanonicalTag *tag, const wchar_t *name, const wchar_t *value);
-void FLAC_plugin__canonical_set_ansi(FLAC_Plugin__CanonicalTag *tag, const wchar_t *name, const char *value);
-/* set_new - only adds field if it's not present yet. */
-void FLAC_plugin__canonical_set_new(FLAC_Plugin__CanonicalTag *tag, const wchar_t *name, const wchar_t *value);
-/* add - adds field if it's not present yet, or merges value with existing
- * field, if it's present. (sep - separator string to use when merging;
- * if sep==NULL no merging occurs - always adds new field)
- */
-void FLAC_plugin__canonical_add(FLAC_Plugin__CanonicalTag *tag, const wchar_t *name, const wchar_t *value, const wchar_t *sep);
-void FLAC_plugin__canonical_add_utf8(FLAC_Plugin__CanonicalTag *tag, const char *name, const char *value, unsigned namelen, unsigned vallen, const char *sep); /* 'namelen'/'vallen' may be (unsigned)(-1) if 'name'/'value' is NUL-terminated */
-
-/* gets value of the first field with the given name (NULL if field not found) */
-const wchar_t *FLAC_plugin__canonical_get(const FLAC_Plugin__CanonicalTag *tag, const wchar_t *name);
-/* removes first field with the given name.
- * (returns 'true' if deleted, 'false' if not found)
- */
-FLAC__bool FLAC_plugin__canonical_remove(FLAC_Plugin__CanonicalTag *tag, const wchar_t *name);
-/* removes all fields with the given name. */
-void FLAC_plugin__canonical_remove_all(FLAC_Plugin__CanonicalTag *tag, const wchar_t *name);
-
-/* enumeration */
-unsigned FLAC_plugin__canonical_get_count(FLAC_Plugin__CanonicalTag *tag);
-FLAC__tag_iterator FLAC_plugin__canonical_first(FLAC_Plugin__CanonicalTag *tag);
-FLAC__tag_iterator FLAC_plugin__canonical_next(FLAC__tag_iterator it);
-wchar_t *FLAC_plugin__canonical_get_name(FLAC__tag_iterator it);
-wchar_t *FLAC_plugin__canonical_get_value(FLAC__tag_iterator it);
-
-/* returns a new string containing the current entry in UTF-8 in "NAME=VALUE" form */
-char *FLAC_plugin__canonical_get_formatted(FLAC__tag_iterator it);
-
-void FLAC_plugin__canonical_tag_merge(FLAC_Plugin__CanonicalTag *dest, const FLAC_Plugin__CanonicalTag *src);
-
-/* helpers */
-wchar_t *FLAC_plugin__convert_ansi_to_wide(const char *src);
-wchar_t *FLAC_plugin__convert_utf8_to_ucs2(const char *src, unsigned length); /* 'length' may be (unsigned)(-1) if 'src' is NUL-terminated */
-char *FLAC_plugin__convert_ucs2_to_utf8(const wchar_t *src);
-
-#endif
+/* plugin_common - Routines common to several plugins
+ * Copyright (C) 2002,2003,2004 Josh Coalson
+ *
+ * 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.
+ */
+
+#ifndef FLAC__PLUGIN_COMMON__CANONICAL_TAG_H
+#define FLAC__PLUGIN_COMMON__CANONICAL_TAG_H
+
+#include "FLAC/ordinals.h"
+
+/* TODO: splay tree? */
+typedef struct tagFLAC__tag_entry FLAC__tag_entry;
+struct tagFLAC__tag_entry
+{
+ FLAC__tag_entry *next, *prev;
+ /* TODO: name in ascii? */
+ wchar_t *name;
+ wchar_t *value;
+};
+
+typedef struct {
+ FLAC__tag_entry *head, *tail;
+ unsigned count;
+} FLAC_Plugin__CanonicalTag;
+
+
+typedef FLAC__tag_entry *FLAC__tag_iterator;
+
+FLAC_Plugin__CanonicalTag *FLAC_plugin__canonical_tag_new();
+void FLAC_plugin__canonical_tag_init(FLAC_Plugin__CanonicalTag *);
+void FLAC_plugin__canonical_tag_clear(FLAC_Plugin__CanonicalTag *);
+void FLAC_plugin__canonical_tag_delete(FLAC_Plugin__CanonicalTag *);
+
+/* note that multiple fields with the same name are allowed.
+ * set - adds field if it's not present yet, or replaces
+ * existing field if it's present.
+ */
+void FLAC_plugin__canonical_set(FLAC_Plugin__CanonicalTag *tag, const wchar_t *name, const wchar_t *value);
+void FLAC_plugin__canonical_set_ansi(FLAC_Plugin__CanonicalTag *tag, const wchar_t *name, const char *value);
+/* set_new - only adds field if it's not present yet. */
+void FLAC_plugin__canonical_set_new(FLAC_Plugin__CanonicalTag *tag, const wchar_t *name, const wchar_t *value);
+/* add - adds field if it's not present yet, or merges value with existing
+ * field, if it's present. (sep - separator string to use when merging;
+ * if sep==NULL no merging occurs - always adds new field)
+ */
+void FLAC_plugin__canonical_add(FLAC_Plugin__CanonicalTag *tag, const wchar_t *name, const wchar_t *value, const wchar_t *sep);
+void FLAC_plugin__canonical_add_utf8(FLAC_Plugin__CanonicalTag *tag, const char *name, const char *value, unsigned namelen, unsigned vallen, const char *sep); /* 'namelen'/'vallen' may be (unsigned)(-1) if 'name'/'value' is NUL-terminated */
+
+/* gets value of the first field with the given name (NULL if field not found) */
+const wchar_t *FLAC_plugin__canonical_get(const FLAC_Plugin__CanonicalTag *tag, const wchar_t *name);
+/* removes first field with the given name.
+ * (returns 'true' if deleted, 'false' if not found)
+ */
+FLAC__bool FLAC_plugin__canonical_remove(FLAC_Plugin__CanonicalTag *tag, const wchar_t *name);
+/* removes all fields with the given name. */
+void FLAC_plugin__canonical_remove_all(FLAC_Plugin__CanonicalTag *tag, const wchar_t *name);
+
+/* enumeration */
+unsigned FLAC_plugin__canonical_get_count(FLAC_Plugin__CanonicalTag *tag);
+FLAC__tag_iterator FLAC_plugin__canonical_first(FLAC_Plugin__CanonicalTag *tag);
+FLAC__tag_iterator FLAC_plugin__canonical_next(FLAC__tag_iterator it);
+wchar_t *FLAC_plugin__canonical_get_name(FLAC__tag_iterator it);
+wchar_t *FLAC_plugin__canonical_get_value(FLAC__tag_iterator it);
+
+/* returns a new string containing the current entry in UTF-8 in "NAME=VALUE" form */
+char *FLAC_plugin__canonical_get_formatted(FLAC__tag_iterator it);
+
+void FLAC_plugin__canonical_tag_merge(FLAC_Plugin__CanonicalTag *dest, const FLAC_Plugin__CanonicalTag *src);
+
+/* helpers */
+wchar_t *FLAC_plugin__convert_ansi_to_wide(const char *src);
+wchar_t *FLAC_plugin__convert_utf8_to_ucs2(const char *src, unsigned length); /* 'length' may be (unsigned)(-1) if 'src' is NUL-terminated */
+char *FLAC_plugin__convert_ucs2_to_utf8(const wchar_t *src);
+
+#endif
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_common/canonical_tag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_common/charset.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_common/defs.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_common/dither.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_common/id3v1.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_common/id3v2.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_common/include/private/fast_float_math_hack.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_common/locale_hack.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_common/replaygain_synthesis.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_common/vorbiscomment.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/config.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/config.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/config.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,49 +1,49 @@
-/* in_flac - Winamp2 FLAC input plugin
- * Copyright (C) 2002,2003,2004 Josh Coalson
- *
- * 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 "playback.h"
-
-/*
- * common stuff
- */
-
-typedef struct {
- struct {
- char tag_format[256];
- char sep[16];
- WCHAR *tag_format_w;
- } title;
- struct {
- BOOL reserve_space;
- } tag;
- struct {
- FLAC__bool show_bps;
- } display;
- output_config_t output;
-} flac_config_t;
-
-extern flac_config_t flac_cfg;
-
-/*
- * prototypes
- */
-
-void InitConfig();
-void ReadConfig();
-void WriteConfig();
-int DoConfig(HINSTANCE inst, HWND parent);
+/* in_flac - Winamp2 FLAC input plugin
+ * Copyright (C) 2002,2003,2004 Josh Coalson
+ *
+ * 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 "playback.h"
+
+/*
+ * common stuff
+ */
+
+typedef struct {
+ struct {
+ char tag_format[256];
+ char sep[16];
+ WCHAR *tag_format_w;
+ } title;
+ struct {
+ BOOL reserve_space;
+ } tag;
+ struct {
+ FLAC__bool show_bps;
+ } display;
+ output_config_t output;
+} flac_config_t;
+
+extern flac_config_t flac_cfg;
+
+/*
+ * prototypes
+ */
+
+void InitConfig();
+void ReadConfig();
+void WriteConfig();
+int DoConfig(HINSTANCE inst, HWND parent);
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/config.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/include/winamp2/in2.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/include/winamp2/in2.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/include/winamp2/in2.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -3,9 +3,9 @@
#include "out.h"
-/* post this to the main window at end of file (after playback as stopped) */
-#define WM_WA_MPEG_EOF (WM_USER + 2)
-
+/* post this to the main window at end of file (after playback as stopped) */
+#define WM_WA_MPEG_EOF (WM_USER + 2)
+
// note: exported symbol is now winampGetInModule2.
#define IN_VER 0x100
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/include/winamp2/in2.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/include/winamp2/out.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/infobox.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/infobox.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/infobox.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,28 +1,28 @@
-/* in_flac - Winamp2 FLAC input plugin
- * Copyright (C) 2002,2003,2004 Josh Coalson
- *
- * 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.
- */
-
-/*
- * prototypes
- */
-
-ULONGLONG FileSize(const char *fileName);
-void ReadTags(const char *fileName, FLAC_Plugin__CanonicalTag *tag, BOOL forDisplay);
-
-void InitInfobox();
-void DeinitInfobox();
-void DoInfoBox(HINSTANCE inst, HWND hwnd, const char *filename);
+/* in_flac - Winamp2 FLAC input plugin
+ * Copyright (C) 2002,2003,2004 Josh Coalson
+ *
+ * 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.
+ */
+
+/*
+ * prototypes
+ */
+
+ULONGLONG FileSize(const char *fileName);
+void ReadTags(const char *fileName, FLAC_Plugin__CanonicalTag *tag, BOOL forDisplay);
+
+void InitInfobox();
+void DeinitInfobox();
+void DoInfoBox(HINSTANCE inst, HWND hwnd, const char *filename);
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/infobox.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/playback.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/playback.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/playback.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,92 +1,92 @@
-/* in_flac - Winamp2 FLAC input plugin
- * Copyright (C) 2000,2001,2002,2003,2004 Josh Coalson
- *
- * 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 "FLAC/all.h"
-#include "share/replaygain_synthesis.h"
-#include "plugin_common/all.h"
-
-/*
- * constants
- */
-
-#define SAMPLES_PER_WRITE 576
-
-#define BITRATE_HIST_SEGMENT_MSEC 500
-#define BITRATE_HIST_SIZE 64
-
-/*
- * common structures
- */
-
-typedef struct {
- volatile FLAC__bool is_playing;
- volatile FLAC__bool abort_flag;
- volatile FLAC__bool eof;
- volatile int seek_to;
- unsigned total_samples;
- unsigned bits_per_sample;
- unsigned output_bits_per_sample;
- unsigned channels;
- unsigned sample_rate;
- unsigned length_in_msec;
- unsigned average_bps;
- FLAC__bool has_replaygain;
- double replay_scale;
- DitherContext dither_context;
-} file_info_struct;
-
-
-typedef struct {
- struct {
- FLAC__bool enable;
- FLAC__bool album_mode;
- int preamp;
- FLAC__bool hard_limit;
- } replaygain;
- struct {
- struct {
- FLAC__bool dither_24_to_16;
- } normal;
- struct {
- FLAC__bool dither;
- int noise_shaping; /* value must be one of NoiseShaping enum, see plugin_common/replaygain_synthesis.h */
- int bps_out;
- } replaygain;
- } resolution;
- struct {
- FLAC__bool stop_err;
- } misc;
-} output_config_t;
-
-/*
- * protopytes
- */
-
-FLAC__bool FLAC_plugin__decoder_init(FLAC__FileDecoder *decoder, const char *filename, FLAC__int64 filesize, file_info_struct *file_info, output_config_t *config);
-void FLAC_plugin__decoder_finish(FLAC__FileDecoder *decoder);
-void FLAC_plugin__decoder_delete(FLAC__FileDecoder *decoder);
-
-int FLAC_plugin__seek(FLAC__FileDecoder *decoder, file_info_struct *file_info);
-unsigned FLAC_plugin__decode(FLAC__FileDecoder *decoder, file_info_struct *file_info, char *sample_buffer);
-int FLAC_plugin__get_rate(unsigned written_time, unsigned output_time, file_info_struct *file_info);
-
-/*
- * these should be defined in plug-in
- */
-
-extern void FLAC_plugin__show_error(const char *message,...);
+/* in_flac - Winamp2 FLAC input plugin
+ * Copyright (C) 2000,2001,2002,2003,2004 Josh Coalson
+ *
+ * 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 "FLAC/all.h"
+#include "share/replaygain_synthesis.h"
+#include "plugin_common/all.h"
+
+/*
+ * constants
+ */
+
+#define SAMPLES_PER_WRITE 576
+
+#define BITRATE_HIST_SEGMENT_MSEC 500
+#define BITRATE_HIST_SIZE 64
+
+/*
+ * common structures
+ */
+
+typedef struct {
+ volatile FLAC__bool is_playing;
+ volatile FLAC__bool abort_flag;
+ volatile FLAC__bool eof;
+ volatile int seek_to;
+ unsigned total_samples;
+ unsigned bits_per_sample;
+ unsigned output_bits_per_sample;
+ unsigned channels;
+ unsigned sample_rate;
+ unsigned length_in_msec;
+ unsigned average_bps;
+ FLAC__bool has_replaygain;
+ double replay_scale;
+ DitherContext dither_context;
+} file_info_struct;
+
+
+typedef struct {
+ struct {
+ FLAC__bool enable;
+ FLAC__bool album_mode;
+ int preamp;
+ FLAC__bool hard_limit;
+ } replaygain;
+ struct {
+ struct {
+ FLAC__bool dither_24_to_16;
+ } normal;
+ struct {
+ FLAC__bool dither;
+ int noise_shaping; /* value must be one of NoiseShaping enum, see plugin_common/replaygain_synthesis.h */
+ int bps_out;
+ } replaygain;
+ } resolution;
+ struct {
+ FLAC__bool stop_err;
+ } misc;
+} output_config_t;
+
+/*
+ * protopytes
+ */
+
+FLAC__bool FLAC_plugin__decoder_init(FLAC__FileDecoder *decoder, const char *filename, FLAC__int64 filesize, file_info_struct *file_info, output_config_t *config);
+void FLAC_plugin__decoder_finish(FLAC__FileDecoder *decoder);
+void FLAC_plugin__decoder_delete(FLAC__FileDecoder *decoder);
+
+int FLAC_plugin__seek(FLAC__FileDecoder *decoder, file_info_struct *file_info);
+unsigned FLAC_plugin__decode(FLAC__FileDecoder *decoder, file_info_struct *file_info, char *sample_buffer);
+int FLAC_plugin__get_rate(unsigned written_time, unsigned output_time, file_info_struct *file_info);
+
+/*
+ * these should be defined in plug-in
+ */
+
+extern void FLAC_plugin__show_error(const char *message,...);
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/playback.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/resource.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/resource.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/resource.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,47 +1,47 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by resource.rc
-//
-#define IDC_RESET 3
-#define IDD_CONFIG 101
-#define IDD_CONFIG_GENERAL 103
-#define IDD_CONFIG_OUTPUT 104
-#define IDD_INFOBOX 105
-#define IDC_ENABLE 1000
-#define IDC_ALBUM 1001
-#define IDC_LIMITER 1002
-#define IDC_COMMENT 1002
-#define IDC_PREAMP 1003
-#define IDC_YEAR 1003
-#define IDC_PA 1004
-#define IDC_TRACK 1004
-#define IDC_DITHER 1005
-#define IDC_DITHERRG 1006
-#define IDC_TO 1008
-#define IDC_SHAPE 1009
-#define IDC_TABS 1009
-#define IDC_TITLE 1010
-#define IDC_TAGZ_HELP 1011
-#define IDC_ARTIST 1011
-#define IDC_TAGZ_DEFAULT 1012
-#define IDC_SEP 1013
-#define IDC_NAME 1014
-#define IDC_INFO 1015
-#define IDC_GENRE 1017
-#define IDC_REMOVE 1020
-#define IDC_UPDATE 1021
-#define IDC_ID3V1 1030
-#define IDC_RESERVE 1032
-#define IDC_BPS 1036
-#define IDC_ERRORS 1037
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 106
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1037
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by resource.rc
+//
+#define IDC_RESET 3
+#define IDD_CONFIG 101
+#define IDD_CONFIG_GENERAL 103
+#define IDD_CONFIG_OUTPUT 104
+#define IDD_INFOBOX 105
+#define IDC_ENABLE 1000
+#define IDC_ALBUM 1001
+#define IDC_LIMITER 1002
+#define IDC_COMMENT 1002
+#define IDC_PREAMP 1003
+#define IDC_YEAR 1003
+#define IDC_PA 1004
+#define IDC_TRACK 1004
+#define IDC_DITHER 1005
+#define IDC_DITHERRG 1006
+#define IDC_TO 1008
+#define IDC_SHAPE 1009
+#define IDC_TABS 1009
+#define IDC_TITLE 1010
+#define IDC_TAGZ_HELP 1011
+#define IDC_ARTIST 1011
+#define IDC_TAGZ_DEFAULT 1012
+#define IDC_SEP 1013
+#define IDC_NAME 1014
+#define IDC_INFO 1015
+#define IDC_GENRE 1017
+#define IDC_REMOVE 1020
+#define IDC_UPDATE 1021
+#define IDC_ID3V1 1030
+#define IDC_RESERVE 1032
+#define IDC_BPS 1036
+#define IDC_ERRORS 1037
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 106
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1037
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/resource.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/tagz.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/tagz.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/tagz.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,921 +1,921 @@
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include "tagz.h"
-
-#ifdef TAGZ_UNICODE
-
-#define _TX(X) L##X
-#define t_strdup wcsdup
-#define t_strlen wcslen
-#define t_strnicmp wcsnicmp
-#define t_atoi(x) wcstol(x,0,10)
-#define t_stricmp wcsicmp
-#define t_strstr wcsstr
-#define sprintf swprintf
-
-#else
-
-#define _TX(X) X
-#define t_strdup strdup
-#define t_strlen strlen
-#define t_strnicmp strnicmp
-#define t_atoi atoi
-#define t_stricmp stricmp
-#define t_strstr strstr
-
-#endif
-
-#define TABSIZE(x) (sizeof(x)/sizeof(x[0]))
-
-
-class T_String
-{
-private:
- T_CHAR * data;
- UINT size,used;
-public:
- T_String() {data=0;size=0;used=0;}
- void AddChar(T_CHAR c)
- {
- if (!data)
- {
- data=(T_CHAR*)malloc((size=512)*sizeof(T_CHAR));
- used=0;
- }
- else if (size==used)
- {
- size<<=1;
- data=(T_CHAR*)realloc((char*)data,size*sizeof(T_CHAR));
- }
- if (data) data[used++]=c;
- }
- void AddInt(int i)
- {
- T_CHAR foo[16];
- sprintf(foo,_TX("%i"),i);
- AddString(foo);
- }
- void AddString(const T_CHAR * z)
- {
- while(*z) {AddChar(*z);z++;}
- }
- void AddString(T_String & s)
- {
- AddString(s.Peek());
- }
- ~T_String()
- {
- if (data) free(data);
- }
- T_CHAR * GetBuf()
- {
- if (!data) return ::t_strdup(_TX(""));
- T_CHAR * r=(T_CHAR*)realloc(data,(used+1)*sizeof(T_CHAR));
- r[used]=0;
- data=0;
- return r;
- }
- T_CHAR operator[](UINT i)
- {
- if (!data || i>=used) return 0;
- else return data[i];
- }
- UINT Len() {return data ? used : 0;}
- void Reset()
- {
- if (data) {free(data);data=0;}
- }
- const T_CHAR * Peek()
- {
- AddChar(0);
- used--;
- return data;
- }
- T_CHAR * strdup()
- {
- return ::t_strdup(Peek());
- }
-};
-
-
-
-
-static int separator(T_CHAR x)
-{
- if (!x || x==' ') return 1;
- if (x=='\'' || x=='_') return 0;
-#ifdef TAGZ_UNICODE
- return !iswalnum(x);
-#else
- return !isalnum(x);
-#endif
-}
-
-static int sepcmp(T_CHAR* src,T_CHAR* val)
-{
- UINT l=t_strlen(val);
- return !t_strnicmp(src,val,l) && separator(src[l]);
-}
-
-static char roman_num[]=
-{
- 'I','V','X','L','C','D','M'
-};
-
-
-static int is_roman(T_CHAR * ptr)/* could be more smart i think */
-{
- if (ptr[0]==']' && ptr[1]=='[' && separator(ptr[2])) return 1;
- while(!separator(*ptr))
- {
- UINT n;
- bool found=0;
- for(n=0;n<TABSIZE(roman_num);n++)
- {
- if (*ptr==roman_num[n]) {found=1;break;}
- }
- if (!found) return 0;
- ptr++;
- }
- return 1;
-}
-
-static int need_full(T_CHAR* ptr)
-{
- if (is_roman(ptr)) return 1;
- if (sepcmp(ptr,_TX("RPG"))) return 1;
- while(!separator(*ptr))
- {
- if (*ptr<'0' || *ptr>'9') return 0;
- ptr++;
- }
- return 1;
-}
-
-typedef bool (*TEXTFUNC)(UINT n_src,T_CHAR **src,UINT*,T_String &out);
-
-#define MAKEFUNC(X) static bool X(UINT n_src,T_CHAR ** src,UINT *found_src,T_String &out)
-
-
-MAKEFUNC(If)
-{
- if (n_src!=3) return false;
-
- out.AddString(src[found_src[0] ? 1 : 2]);
- return true;
-}
-
-MAKEFUNC(If2)
-{
- if (n_src!=2) return false;
-
- out.AddString(src[found_src[0] ? 0 : 1]);
- return true;
-}
-
-
-MAKEFUNC(Iflonger)
-{
- if (n_src!=4) return false;
-
- out.AddString(src[(int)t_strlen(src[0])>t_atoi(src[1]) ? 2 : 3]);
- return true;
-}
-
-MAKEFUNC(Ifgreater)
-{
- if (n_src!=4) return false;
-
- out.AddString(src[t_atoi(src[0])>t_atoi(src[1]) ? 2 : 3]);
- return true;
-}
-
-MAKEFUNC(Upper)
-{
- if (n_src!=1) return false;
-
- T_CHAR * s=src[0];
-
- while(*s)
- out.AddChar(toupper(*(s++)));
-
- return true;
-}
-
-MAKEFUNC(Lower)
-{
- if (n_src!=1) return false;
-
- T_CHAR * s=src[0];
-
- while(*s)
- out.AddChar(tolower(*(s++)));
-
- return true;
-}
-
-MAKEFUNC(Pad)
-{
- if (n_src<2 || n_src>3) return false;
-
- T_CHAR *fill=_TX(" ");
- if (n_src==3 && src[2][0])
- fill = src[2];
-
- int num = t_atoi(src[1]);
- T_CHAR *p = src[0];
-
- while (*p) { out.AddChar(*(p++)); num--; }
-
- UINT fl = t_strlen(fill);
- while (num>0)
- out.AddChar(fill[(--num)%fl]);
-
- return true;
-}
-
-MAKEFUNC(Cut)
-{
- if (n_src!=2) return false;
-
- UINT num = t_atoi(src[1]);
- T_CHAR *p = src[0];
-
- while (*p && num>0) {out.AddChar(*(p++));num--;}
-
- return true;
-}
-
-MAKEFUNC(PadCut)
-{
- if (n_src<2 || n_src>3) return false;
-
- T_CHAR *fill = _TX(" ");
- if (n_src==3 && src[2][0])
- fill = src[2];
-
- int num = t_atoi(src[1]);
- T_CHAR *p = src[0];
-
- while(*p && num>0) {out.AddChar(*(p++));num--;}
-
- UINT fl=t_strlen(fill);
- while (num>0)
- out.AddChar(fill[(--num)%fl]);
-
- return true;
-}
-
-/* abbr(string) */
-/* abbr(string,len) */
-MAKEFUNC(Abbr)
-{
- if (n_src==0 || n_src>2) return false;
-
-
- if (n_src==2 && (int)t_strlen(src[0])<t_atoi(src[1]))
- {
- out.AddString(src[0]);
- return true;
- }
-
- T_CHAR * meta=src[0];
- bool w=0, r=0;
-
- while(*meta)
- {
- bool an=!separator(*meta) || *meta==']' || *meta=='[';
-
- if (w && !an)
- w=0;
- else if (!w && an)
- {
- w=1;
- r=need_full(meta)?1:0;
- out.AddChar(*meta);
- }
- else if (w && r)
- out.AddChar(*meta);
- meta++;
- }
-
- return true;
-}
-
-
-
-MAKEFUNC(Caps)
-{
- if (n_src!=1) return false;
-
- T_CHAR* sp=src[0];
- int sep = 1;
-
- while(*sp)
- {
- T_CHAR c=*(sp++);
- int s = separator(c);
- if (!s && sep)
- c=toupper(c);
- else if (!sep) c=tolower(c);
- sep=s;
- out.AddChar(c);
- }
-
- return true;
-}
-
-MAKEFUNC(Caps2)
-{
- if (n_src!=1) return false;
-
- T_CHAR* sp=src[0];
- int sep=1;
-
- while(*sp)
- {
- T_CHAR c=*(sp++);
- int s = separator(c);
- if (!s && sep)
- c=toupper(c);
- sep=s;
- out.AddChar(c);
- }
-
- return true;
-}
-
-MAKEFUNC(Longest)
-{
- T_CHAR *ptr=0;
- UINT n, m=0;
-
- for(n=0;n<n_src;n++)
- {
- UINT l=t_strlen(src[n]);
- if (l>m) {m=l;ptr=src[n];}
- }
-
- if (ptr) out.AddString(ptr);
- return true;
-}
-
-MAKEFUNC(Shortest)
-{
- T_CHAR * ptr=0;
- UINT n,m=(UINT)(-1);
-
- for(n=0;n<n_src;n++)
- {
- UINT l=t_strlen(src[n]);
- if (l<m) {m=l;ptr=src[n];}
- }
-
- if (ptr) out.AddString(ptr);
- return true;
-}
-
-MAKEFUNC(Num)
-{
- if (n_src!=2) return false;
-
- T_CHAR tmp[16];
- T_CHAR tmp1[16];
- sprintf(tmp1,_TX("%%0%uu"),t_atoi(src[1]));
- sprintf(tmp,tmp1,t_atoi(src[0]));
- out.AddString(tmp);
-
- return true;
-}
-
-MAKEFUNC(Hex)
-{
- if (n_src!=2) return false;
-
- T_CHAR tmp[16];
- T_CHAR tmp1[16];
- sprintf(tmp1,_TX("%%0%ux"),t_atoi(src[1]));
- sprintf(tmp,tmp1,t_atoi(src[0]));
- out.AddString(tmp);
-
- return true;
-}
-
-MAKEFUNC(StrChr)
-{
- if (n_src!=2) return false;
-
- T_CHAR * p=src[0];
- T_CHAR s=src[1][0];
-
- while (*p && *p!=s) p++;
- if (*p==s)
- out.AddInt(1+p-src[0]);
- else out.AddChar('0');
-
- return true;
-}
-
-MAKEFUNC(StrRChr)
-{
- if (n_src!=2) return false;
-
- T_CHAR * p=src[0],*p1=0;
- T_CHAR s=src[1][0];
-
- while(*p)
- {
- if (*p==s) p1=p;
- p++;
- }
-
- if (p1)
- out.AddInt(1+p1-src[0]);
- else out.AddChar('0');
-
- return true;
-}
-
-MAKEFUNC(StrStr)
-{
- if (n_src!=2) return false;
-
- T_CHAR * p = t_strstr(src[0],src[1]);
-
- if (p)
- out.AddInt(1+p-src[0]);
- else out.AddChar('0');
-
- return true;
-}
-
-/* substr(string, index) */
-/* substr(string, index, length) */
-MAKEFUNC(SubStr)
-{
- if (n_src<2 || n_src>3) return false;
-
- int n1 = t_atoi(src[1]), n2;
-
- if (n_src == 3)
- n2 = t_atoi(src[2]);
- else n2 = n1;
-
- if (n1 < 1) n1=1;
- if (n2 >= n1)
- {
- n1--;
- n2--;
- while(n1<=n2 && src[0][n1])
- out.AddChar(src[0][n1++]);
- }
-
- return true;
-}
-
-MAKEFUNC(Len)
-{
- if (n_src!=1) return false;
-
- out.AddInt(t_strlen(src[0]));
- return true;
-}
-
-MAKEFUNC(Add)
-{
- UINT n;
- int s=0;
-
- for (n=0;n<n_src;n++)
- s+=t_atoi(src[n]);
-
- out.AddInt(s);
-
- return true;
-}
-
-MAKEFUNC(Sub)
-{
- if (n_src==0) return false;
-
- UINT n;
- int s=t_atoi(src[0]);
-
- for (n=1;n<n_src;n++)
- s-=t_atoi(src[n]);
-
- out.AddInt(s);
-
- return true;
-}
-
-MAKEFUNC(Mul)
-{
- UINT n;
- int s=1;
-
- for(n=0;n<n_src;n++)
- s*=t_atoi(src[n]);
-
- out.AddInt(s);
-
- return true;
-}
-
-MAKEFUNC(Div)
-{
- if (n_src==0) return false;
-
- UINT n;
- int s=t_atoi(src[0]);
-
- for(n=1;n<n_src;n++)
- {
- int t=t_atoi(src[n]);
- if (t) s/=t;
- else t=0;
- }
-
- out.AddInt(s);
-
- return true;
-}
-
-MAKEFUNC(Mod)
-{
- if (n_src==0) return false;
-
- UINT n;
- int s=t_atoi(src[0]);
-
- for(n=1;n<n_src;n++)
- {
- int t=t_atoi(src[n]);
- if (t) s%=t;
- else t=0;
- }
-
- out.AddInt(s);
-
- return true;
-}
-
-MAKEFUNC(Max)
-{
- if (!n_src) return false;
-
- int m = t_atoi(src[0]);
- UINT n;
-
- for (n=1; n<n_src; n++)
- {
- int t = t_atoi(src[n]);
- if (t > m) m = t;
- }
- out.AddInt(m);
-
- return true;
-}
-
-MAKEFUNC(Min)
-{
- if (!n_src) return false;
-
- int m=t_atoi(src[0]);
- UINT n;
-
- for(n=1;n<n_src;n++)
- {
- int t=t_atoi(src[n]);
- if (t<m) m=t;
- }
- out.AddInt(m);
-
- return true;
-}
-
-/* replace(string, what_to_replace, replacement) */
-MAKEFUNC(Replace)
-{
- if (n_src!=3) return false;
- T_CHAR *p = src[0];
-
- while (*p)
- {
- UINT n=0;
-
- while (src[1][n] && p[n]==src[1][n]) n++;
-
- if (!src[1][n])
- {
- out.AddString(src[2]);
- p += n;
- }
- else out.AddChar(*p++);
- }
-
- return true;
-}
-
-struct
-{
- TEXTFUNC func;
- const T_CHAR * name;
-}
-FUNCS[] =
-{
- If,_TX("if"),
- If2,_TX("if2"),
- Upper,_TX("upper"),
- Lower,_TX("lower"),
- Pad,_TX("pad"),
- Cut,_TX("cut"),
- PadCut,_TX("padcut"),
- Abbr,_TX("abbr"),
- Caps,_TX("caps"),
- Caps2,_TX("caps2"),
- Longest,_TX("longest"),
- Shortest,_TX("shortest"),
- Iflonger,_TX("iflonger"),
- Ifgreater,_TX("ifgreater"),
- Num,_TX("num"),Num,_TX("dec"),
- Hex,_TX("hex"),
- StrChr,_TX("strchr"),
- StrChr,_TX("strlchr"),
- StrRChr,_TX("strrchr"),
- StrStr,_TX("strstr"),
- SubStr,_TX("substr"),
- Len,_TX("len"),
- Add,_TX("add"),
- Sub,_TX("sub"),
- Mul,_TX("mul"),
- Div,_TX("div"),
- Mod,_TX("mod"),
- Min,_TX("min"),
- Max,_TX("max"),
- Replace,_TX("replace"),
-};
-
-
-class FMT
-{
-private:
- T_String str;
- T_CHAR * spec;
- TAGFUNC f;
- TAGFREEFUNC ff;
- void * fp;
- T_CHAR * org_spec;
- int found;
-
- void Error(T_CHAR *e=0)
- {
- str.Reset();
- str.AddString(e ? e : _TX("[SYNTAX ERROR IN FORMATTING STRING]"));
- found++; /* force displaying */
- }
-
- T_CHAR * _FMT(T_CHAR * s,UINT *f=0)
- {
- FMT fmt(this,s);
- T_CHAR * c=(T_CHAR*)fmt;
- if (f) *f=fmt.found;
- found+=fmt.found;
- return c;
- }
-
- static bool skipshit(T_CHAR** _p,T_CHAR *bl)
- {
- T_CHAR * p=*_p;
- int bc1=0,bc2=0;
- while(*p)
- {
- if (!bc1 && !bc2 && bl)
- {
- T_CHAR *z=bl;
- while(*z)
- {
- if (*z==*p) break;
- z++;
- }
- if (*z) break;
- }
- if (*p=='\'')
- {
- p++;
- while(*p && *p!='\'') p++;
- if (!*p) return 0;
- }
- else if (*p=='(') bc1++;
- else if (*p==')')
- {
- if (--bc1<0) return 0;
- }
- else if (*p=='[') bc2++;
- else if (*p==']')
- {
- if (--bc2<0) return 0;
- }
- p++;
- }
- *_p=p;
- return *p && !bc1 && !bc2;
- }
-
- void run()
- {
- if (!spec) {Error();return;}
- while(*spec)
- {
- if (*spec=='%')
- {
- spec++;
- if (*spec=='%') {str.AddChar('%');spec++;continue;}
- T_CHAR* s1=spec+1;
- while(*s1 && *s1!='%') s1++;
- if (!*s1) {Error();break;}
- *s1=0;
- const T_CHAR * tag=f(spec,fp);
- *s1='%';
- /*if (!tag) tag=tag_unknown; */
- if (tag && tag[0])
- {
- found++;
- str.AddString(tag);
- }
- else
- {
- str.AddString(_TX("?"));
- }
- if (tag && ff) ff(tag,fp);
- spec=s1+1;
- }
- else if (*spec=='$')
- {
- spec++;
- if (*spec=='$') {str.AddChar('$');spec++;continue;}
- T_CHAR * s1=spec+1;
- while(*s1 && *s1!='(') s1++;
- if (!*s1) {Error();break;}
- T_CHAR * s2=s1+1;
- if (!skipshit(&s2,_TX(")"))) {Error();break;}
- if (!*s2) {Error();break;};
- T_CHAR * p=s1+1;
- T_CHAR* temp[64];
- UINT temp_f[64];
- UINT nt=0;
- T_CHAR * p1=s1+1;
- while(p<=s2 && nt<64)
- {
- if (!skipshit(&p,_TX(",)"))) {Error();return;}
- if (p>s2 || (*p!=',' && *p!=')')) {Error(_TX("internal error"));return;}
- T_CHAR bk=*p;
- *p=0;
- temp[nt]=_FMT(p1,&temp_f[nt]);
- nt++;
- *p=bk;;
- p1=p+1;
- p++;
- }
- *s1=0;
- UINT n;
-
- for (n=0; n<TABSIZE(FUNCS); n++)
- if (!t_stricmp(spec, FUNCS[n].name))
- break;
-
- *s1='(';
-
- if (n != TABSIZE(FUNCS))
- {
- if (!FUNCS[n].func(nt, temp, temp_f, str))
- {
- Error(_TX("[INVALID $"));
- str.AddString(FUNCS[n].name);
- str.AddString(_TX(" SYNTAX]"));
- return;
- }
- }
- else
- {
- Error(_TX("[UNKNOWN FUNCTION]"));
- return;
- }
-
- for(n=0;n<nt;n++) free(temp[n]);
- spec=s2+1;
- }
- else if (*spec=='\'')
- {
- spec++;
- if (*spec=='\'') {str.AddChar('\'');spec++;continue;}
- T_CHAR * s1=spec+1;
- while(*s1 && *s1!='\'') s1++;
- if (!*s1) {Error();break;}
- *s1=0;
- str.AddString(spec);
- *s1='\'';
- spec=s1+1;
- }
- else if (*spec=='[')
- {
- spec++;
- T_CHAR * s1=spec;
- UINT bc=0;
- if (!skipshit(&s1,_TX("]"))) {Error();break;}
- T_CHAR bk=*s1;
- *s1=0;
- FMT fmt(this,spec);
- fmt.run();
- if (fmt.found)
- {
- str.AddString(fmt.str);
- found+=fmt.found;
- }
- *s1=bk;
- spec=s1+1;
- }
- else if (*spec == ']') {Error();break;}
- else
- {
- str.AddChar(*spec);
- spec++;
- }
- }
- }
-
- FMT(FMT* base,T_CHAR * _spec)
- {
- found=0;
- org_spec=0;
- f=base->f;
- ff=base->ff;
- fp=base->fp;
- spec=_spec;
- }
-public:
- FMT(const T_CHAR * p_spec,TAGFUNC _f,TAGFREEFUNC _ff,void * _fp)
- {
- found=0;
- org_spec=spec=t_strdup(p_spec);
- f=_f;
- ff=_ff;
- fp=_fp;
- }
- operator T_CHAR*()
- {
- run();
- return str.GetBuf();
- }
- ~FMT()
- {
- if (org_spec) free(org_spec);
- }
-};
-
-extern "C"
-{
-
-UINT tagz_format(const T_CHAR * spec,TAGFUNC f,TAGFREEFUNC ff,void *fp,T_CHAR* out,UINT max)
-{
- T_CHAR * zz=tagz_format_r(spec,f,ff,fp);
- UINT r=0;
- while(r<max-1 && zz[r])
- {
- out[r]=zz[r];
- r++;
- }
- out[r]=0;
- free(zz);
- return r;
-}
-
-T_CHAR * tagz_format_r(const T_CHAR* spec,TAGFUNC f,TAGFREEFUNC ff,void * fp)
-{
- return FMT(spec,f,ff,fp);
-}
-
-const char tagz_manual[]="Syntax reference: \n"
- "\n"
- "* %tagname% - inserts field named <tagname>, eg. \"%artist%\"\n"
- "* $abbr(x) - inserts abbreviation of x, eg. \"$abbr(%album%)\" - will convert album name of \"Final Fantasy VI\" to \"FFVI\"\n"
- "* $abbr(x,y) - inserts abbreviation of x if x is longer than y characters; otherwise inserts full value of x, eg. \"$abbr(%album%,10)\"\n"
- "* $lower(x), $upper(x) - converts x to in lower/uppercase, eg. \"$upper(%title%)\"\n"
- "* $num(x,y) - displays x number and pads with zeros up to y characters (useful for track numbers), eg. $num(%tracknumber%,2)\n"
- "* $caps(x) - converts first letter in every word of x to uppercase, and all other letters to lowercase, eg. \"blah BLAH\" -> \"Blah Blah\"\n"
- "* $caps2(x) - similar to $caps, but leaves uppercase letters as they are, eg. \"blah BLAH\" -> \"Blah BLAH\"\n"
- "* $if(A,B,C) - if A contains at least one valid tag, displays B, otherwise displays C; eg. \"$if(%artist%,%artist%,unknown artist)\" will display artist name if present; otherwise will display \"unknown artist\"; note that \"$if(A,A,)\" is equivalent to \"[A]\" (see below)\n"
- "* $if2(A,B) - equals to $if(A,A,B)\n"
- "* $longest(A,B,C,....) - compares lengths of output strings produced by A,B,C... and displays the longest one, eg. \"$longest(%title%,%comment%)\" will display either title if it's longer than comment; otherwise it will display comment\n"
- "* $pad(x,y) - pads x with spaces up to y characters\n"
- "* $cut(x,y) - truncates x to y characters\n"
- "* $padcut(x,y) - pads x to y characters and truncates to y if longer\n"
- "* [ .... ] - displays contents of brackets only if at least one of fields referenced inside has been found, eg. \"%artist% - [%album% / ]%title%\" will hide [] block if album field is not present\n"
- "* \' (single quotation mark) - outputs raw text without parsing, eg, \'blah$blah%blah[][]\' will output the contained string and ignore all reserved characters (%,$,[,]) in it; you can use this feature to insert square brackets for an example.\n"
- "\n"
- "eg. \"[%artist% - ][$abbr(%album%,10)[ %tracknumber%] / ]%title%[ %streamtitle%]\"\n";
-
-
-}
+#include <string.h>
+#include <stdio.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include "tagz.h"
+
+#ifdef TAGZ_UNICODE
+
+#define _TX(X) L##X
+#define t_strdup wcsdup
+#define t_strlen wcslen
+#define t_strnicmp wcsnicmp
+#define t_atoi(x) wcstol(x,0,10)
+#define t_stricmp wcsicmp
+#define t_strstr wcsstr
+#define sprintf swprintf
+
+#else
+
+#define _TX(X) X
+#define t_strdup strdup
+#define t_strlen strlen
+#define t_strnicmp strnicmp
+#define t_atoi atoi
+#define t_stricmp stricmp
+#define t_strstr strstr
+
+#endif
+
+#define TABSIZE(x) (sizeof(x)/sizeof(x[0]))
+
+
+class T_String
+{
+private:
+ T_CHAR * data;
+ UINT size,used;
+public:
+ T_String() {data=0;size=0;used=0;}
+ void AddChar(T_CHAR c)
+ {
+ if (!data)
+ {
+ data=(T_CHAR*)malloc((size=512)*sizeof(T_CHAR));
+ used=0;
+ }
+ else if (size==used)
+ {
+ size<<=1;
+ data=(T_CHAR*)realloc((char*)data,size*sizeof(T_CHAR));
+ }
+ if (data) data[used++]=c;
+ }
+ void AddInt(int i)
+ {
+ T_CHAR foo[16];
+ sprintf(foo,_TX("%i"),i);
+ AddString(foo);
+ }
+ void AddString(const T_CHAR * z)
+ {
+ while(*z) {AddChar(*z);z++;}
+ }
+ void AddString(T_String & s)
+ {
+ AddString(s.Peek());
+ }
+ ~T_String()
+ {
+ if (data) free(data);
+ }
+ T_CHAR * GetBuf()
+ {
+ if (!data) return ::t_strdup(_TX(""));
+ T_CHAR * r=(T_CHAR*)realloc(data,(used+1)*sizeof(T_CHAR));
+ r[used]=0;
+ data=0;
+ return r;
+ }
+ T_CHAR operator[](UINT i)
+ {
+ if (!data || i>=used) return 0;
+ else return data[i];
+ }
+ UINT Len() {return data ? used : 0;}
+ void Reset()
+ {
+ if (data) {free(data);data=0;}
+ }
+ const T_CHAR * Peek()
+ {
+ AddChar(0);
+ used--;
+ return data;
+ }
+ T_CHAR * strdup()
+ {
+ return ::t_strdup(Peek());
+ }
+};
+
+
+
+
+static int separator(T_CHAR x)
+{
+ if (!x || x==' ') return 1;
+ if (x=='\'' || x=='_') return 0;
+#ifdef TAGZ_UNICODE
+ return !iswalnum(x);
+#else
+ return !isalnum(x);
+#endif
+}
+
+static int sepcmp(T_CHAR* src,T_CHAR* val)
+{
+ UINT l=t_strlen(val);
+ return !t_strnicmp(src,val,l) && separator(src[l]);
+}
+
+static char roman_num[]=
+{
+ 'I','V','X','L','C','D','M'
+};
+
+
+static int is_roman(T_CHAR * ptr)/* could be more smart i think */
+{
+ if (ptr[0]==']' && ptr[1]=='[' && separator(ptr[2])) return 1;
+ while(!separator(*ptr))
+ {
+ UINT n;
+ bool found=0;
+ for(n=0;n<TABSIZE(roman_num);n++)
+ {
+ if (*ptr==roman_num[n]) {found=1;break;}
+ }
+ if (!found) return 0;
+ ptr++;
+ }
+ return 1;
+}
+
+static int need_full(T_CHAR* ptr)
+{
+ if (is_roman(ptr)) return 1;
+ if (sepcmp(ptr,_TX("RPG"))) return 1;
+ while(!separator(*ptr))
+ {
+ if (*ptr<'0' || *ptr>'9') return 0;
+ ptr++;
+ }
+ return 1;
+}
+
+typedef bool (*TEXTFUNC)(UINT n_src,T_CHAR **src,UINT*,T_String &out);
+
+#define MAKEFUNC(X) static bool X(UINT n_src,T_CHAR ** src,UINT *found_src,T_String &out)
+
+
+MAKEFUNC(If)
+{
+ if (n_src!=3) return false;
+
+ out.AddString(src[found_src[0] ? 1 : 2]);
+ return true;
+}
+
+MAKEFUNC(If2)
+{
+ if (n_src!=2) return false;
+
+ out.AddString(src[found_src[0] ? 0 : 1]);
+ return true;
+}
+
+
+MAKEFUNC(Iflonger)
+{
+ if (n_src!=4) return false;
+
+ out.AddString(src[(int)t_strlen(src[0])>t_atoi(src[1]) ? 2 : 3]);
+ return true;
+}
+
+MAKEFUNC(Ifgreater)
+{
+ if (n_src!=4) return false;
+
+ out.AddString(src[t_atoi(src[0])>t_atoi(src[1]) ? 2 : 3]);
+ return true;
+}
+
+MAKEFUNC(Upper)
+{
+ if (n_src!=1) return false;
+
+ T_CHAR * s=src[0];
+
+ while(*s)
+ out.AddChar(toupper(*(s++)));
+
+ return true;
+}
+
+MAKEFUNC(Lower)
+{
+ if (n_src!=1) return false;
+
+ T_CHAR * s=src[0];
+
+ while(*s)
+ out.AddChar(tolower(*(s++)));
+
+ return true;
+}
+
+MAKEFUNC(Pad)
+{
+ if (n_src<2 || n_src>3) return false;
+
+ T_CHAR *fill=_TX(" ");
+ if (n_src==3 && src[2][0])
+ fill = src[2];
+
+ int num = t_atoi(src[1]);
+ T_CHAR *p = src[0];
+
+ while (*p) { out.AddChar(*(p++)); num--; }
+
+ UINT fl = t_strlen(fill);
+ while (num>0)
+ out.AddChar(fill[(--num)%fl]);
+
+ return true;
+}
+
+MAKEFUNC(Cut)
+{
+ if (n_src!=2) return false;
+
+ UINT num = t_atoi(src[1]);
+ T_CHAR *p = src[0];
+
+ while (*p && num>0) {out.AddChar(*(p++));num--;}
+
+ return true;
+}
+
+MAKEFUNC(PadCut)
+{
+ if (n_src<2 || n_src>3) return false;
+
+ T_CHAR *fill = _TX(" ");
+ if (n_src==3 && src[2][0])
+ fill = src[2];
+
+ int num = t_atoi(src[1]);
+ T_CHAR *p = src[0];
+
+ while(*p && num>0) {out.AddChar(*(p++));num--;}
+
+ UINT fl=t_strlen(fill);
+ while (num>0)
+ out.AddChar(fill[(--num)%fl]);
+
+ return true;
+}
+
+/* abbr(string) */
+/* abbr(string,len) */
+MAKEFUNC(Abbr)
+{
+ if (n_src==0 || n_src>2) return false;
+
+
+ if (n_src==2 && (int)t_strlen(src[0])<t_atoi(src[1]))
+ {
+ out.AddString(src[0]);
+ return true;
+ }
+
+ T_CHAR * meta=src[0];
+ bool w=0, r=0;
+
+ while(*meta)
+ {
+ bool an=!separator(*meta) || *meta==']' || *meta=='[';
+
+ if (w && !an)
+ w=0;
+ else if (!w && an)
+ {
+ w=1;
+ r=need_full(meta)?1:0;
+ out.AddChar(*meta);
+ }
+ else if (w && r)
+ out.AddChar(*meta);
+ meta++;
+ }
+
+ return true;
+}
+
+
+
+MAKEFUNC(Caps)
+{
+ if (n_src!=1) return false;
+
+ T_CHAR* sp=src[0];
+ int sep = 1;
+
+ while(*sp)
+ {
+ T_CHAR c=*(sp++);
+ int s = separator(c);
+ if (!s && sep)
+ c=toupper(c);
+ else if (!sep) c=tolower(c);
+ sep=s;
+ out.AddChar(c);
+ }
+
+ return true;
+}
+
+MAKEFUNC(Caps2)
+{
+ if (n_src!=1) return false;
+
+ T_CHAR* sp=src[0];
+ int sep=1;
+
+ while(*sp)
+ {
+ T_CHAR c=*(sp++);
+ int s = separator(c);
+ if (!s && sep)
+ c=toupper(c);
+ sep=s;
+ out.AddChar(c);
+ }
+
+ return true;
+}
+
+MAKEFUNC(Longest)
+{
+ T_CHAR *ptr=0;
+ UINT n, m=0;
+
+ for(n=0;n<n_src;n++)
+ {
+ UINT l=t_strlen(src[n]);
+ if (l>m) {m=l;ptr=src[n];}
+ }
+
+ if (ptr) out.AddString(ptr);
+ return true;
+}
+
+MAKEFUNC(Shortest)
+{
+ T_CHAR * ptr=0;
+ UINT n,m=(UINT)(-1);
+
+ for(n=0;n<n_src;n++)
+ {
+ UINT l=t_strlen(src[n]);
+ if (l<m) {m=l;ptr=src[n];}
+ }
+
+ if (ptr) out.AddString(ptr);
+ return true;
+}
+
+MAKEFUNC(Num)
+{
+ if (n_src!=2) return false;
+
+ T_CHAR tmp[16];
+ T_CHAR tmp1[16];
+ sprintf(tmp1,_TX("%%0%uu"),t_atoi(src[1]));
+ sprintf(tmp,tmp1,t_atoi(src[0]));
+ out.AddString(tmp);
+
+ return true;
+}
+
+MAKEFUNC(Hex)
+{
+ if (n_src!=2) return false;
+
+ T_CHAR tmp[16];
+ T_CHAR tmp1[16];
+ sprintf(tmp1,_TX("%%0%ux"),t_atoi(src[1]));
+ sprintf(tmp,tmp1,t_atoi(src[0]));
+ out.AddString(tmp);
+
+ return true;
+}
+
+MAKEFUNC(StrChr)
+{
+ if (n_src!=2) return false;
+
+ T_CHAR * p=src[0];
+ T_CHAR s=src[1][0];
+
+ while (*p && *p!=s) p++;
+ if (*p==s)
+ out.AddInt(1+p-src[0]);
+ else out.AddChar('0');
+
+ return true;
+}
+
+MAKEFUNC(StrRChr)
+{
+ if (n_src!=2) return false;
+
+ T_CHAR * p=src[0],*p1=0;
+ T_CHAR s=src[1][0];
+
+ while(*p)
+ {
+ if (*p==s) p1=p;
+ p++;
+ }
+
+ if (p1)
+ out.AddInt(1+p1-src[0]);
+ else out.AddChar('0');
+
+ return true;
+}
+
+MAKEFUNC(StrStr)
+{
+ if (n_src!=2) return false;
+
+ T_CHAR * p = t_strstr(src[0],src[1]);
+
+ if (p)
+ out.AddInt(1+p-src[0]);
+ else out.AddChar('0');
+
+ return true;
+}
+
+/* substr(string, index) */
+/* substr(string, index, length) */
+MAKEFUNC(SubStr)
+{
+ if (n_src<2 || n_src>3) return false;
+
+ int n1 = t_atoi(src[1]), n2;
+
+ if (n_src == 3)
+ n2 = t_atoi(src[2]);
+ else n2 = n1;
+
+ if (n1 < 1) n1=1;
+ if (n2 >= n1)
+ {
+ n1--;
+ n2--;
+ while(n1<=n2 && src[0][n1])
+ out.AddChar(src[0][n1++]);
+ }
+
+ return true;
+}
+
+MAKEFUNC(Len)
+{
+ if (n_src!=1) return false;
+
+ out.AddInt(t_strlen(src[0]));
+ return true;
+}
+
+MAKEFUNC(Add)
+{
+ UINT n;
+ int s=0;
+
+ for (n=0;n<n_src;n++)
+ s+=t_atoi(src[n]);
+
+ out.AddInt(s);
+
+ return true;
+}
+
+MAKEFUNC(Sub)
+{
+ if (n_src==0) return false;
+
+ UINT n;
+ int s=t_atoi(src[0]);
+
+ for (n=1;n<n_src;n++)
+ s-=t_atoi(src[n]);
+
+ out.AddInt(s);
+
+ return true;
+}
+
+MAKEFUNC(Mul)
+{
+ UINT n;
+ int s=1;
+
+ for(n=0;n<n_src;n++)
+ s*=t_atoi(src[n]);
+
+ out.AddInt(s);
+
+ return true;
+}
+
+MAKEFUNC(Div)
+{
+ if (n_src==0) return false;
+
+ UINT n;
+ int s=t_atoi(src[0]);
+
+ for(n=1;n<n_src;n++)
+ {
+ int t=t_atoi(src[n]);
+ if (t) s/=t;
+ else t=0;
+ }
+
+ out.AddInt(s);
+
+ return true;
+}
+
+MAKEFUNC(Mod)
+{
+ if (n_src==0) return false;
+
+ UINT n;
+ int s=t_atoi(src[0]);
+
+ for(n=1;n<n_src;n++)
+ {
+ int t=t_atoi(src[n]);
+ if (t) s%=t;
+ else t=0;
+ }
+
+ out.AddInt(s);
+
+ return true;
+}
+
+MAKEFUNC(Max)
+{
+ if (!n_src) return false;
+
+ int m = t_atoi(src[0]);
+ UINT n;
+
+ for (n=1; n<n_src; n++)
+ {
+ int t = t_atoi(src[n]);
+ if (t > m) m = t;
+ }
+ out.AddInt(m);
+
+ return true;
+}
+
+MAKEFUNC(Min)
+{
+ if (!n_src) return false;
+
+ int m=t_atoi(src[0]);
+ UINT n;
+
+ for(n=1;n<n_src;n++)
+ {
+ int t=t_atoi(src[n]);
+ if (t<m) m=t;
+ }
+ out.AddInt(m);
+
+ return true;
+}
+
+/* replace(string, what_to_replace, replacement) */
+MAKEFUNC(Replace)
+{
+ if (n_src!=3) return false;
+ T_CHAR *p = src[0];
+
+ while (*p)
+ {
+ UINT n=0;
+
+ while (src[1][n] && p[n]==src[1][n]) n++;
+
+ if (!src[1][n])
+ {
+ out.AddString(src[2]);
+ p += n;
+ }
+ else out.AddChar(*p++);
+ }
+
+ return true;
+}
+
+struct
+{
+ TEXTFUNC func;
+ const T_CHAR * name;
+}
+FUNCS[] =
+{
+ If,_TX("if"),
+ If2,_TX("if2"),
+ Upper,_TX("upper"),
+ Lower,_TX("lower"),
+ Pad,_TX("pad"),
+ Cut,_TX("cut"),
+ PadCut,_TX("padcut"),
+ Abbr,_TX("abbr"),
+ Caps,_TX("caps"),
+ Caps2,_TX("caps2"),
+ Longest,_TX("longest"),
+ Shortest,_TX("shortest"),
+ Iflonger,_TX("iflonger"),
+ Ifgreater,_TX("ifgreater"),
+ Num,_TX("num"),Num,_TX("dec"),
+ Hex,_TX("hex"),
+ StrChr,_TX("strchr"),
+ StrChr,_TX("strlchr"),
+ StrRChr,_TX("strrchr"),
+ StrStr,_TX("strstr"),
+ SubStr,_TX("substr"),
+ Len,_TX("len"),
+ Add,_TX("add"),
+ Sub,_TX("sub"),
+ Mul,_TX("mul"),
+ Div,_TX("div"),
+ Mod,_TX("mod"),
+ Min,_TX("min"),
+ Max,_TX("max"),
+ Replace,_TX("replace"),
+};
+
+
+class FMT
+{
+private:
+ T_String str;
+ T_CHAR * spec;
+ TAGFUNC f;
+ TAGFREEFUNC ff;
+ void * fp;
+ T_CHAR * org_spec;
+ int found;
+
+ void Error(T_CHAR *e=0)
+ {
+ str.Reset();
+ str.AddString(e ? e : _TX("[SYNTAX ERROR IN FORMATTING STRING]"));
+ found++; /* force displaying */
+ }
+
+ T_CHAR * _FMT(T_CHAR * s,UINT *f=0)
+ {
+ FMT fmt(this,s);
+ T_CHAR * c=(T_CHAR*)fmt;
+ if (f) *f=fmt.found;
+ found+=fmt.found;
+ return c;
+ }
+
+ static bool skipshit(T_CHAR** _p,T_CHAR *bl)
+ {
+ T_CHAR * p=*_p;
+ int bc1=0,bc2=0;
+ while(*p)
+ {
+ if (!bc1 && !bc2 && bl)
+ {
+ T_CHAR *z=bl;
+ while(*z)
+ {
+ if (*z==*p) break;
+ z++;
+ }
+ if (*z) break;
+ }
+ if (*p=='\'')
+ {
+ p++;
+ while(*p && *p!='\'') p++;
+ if (!*p) return 0;
+ }
+ else if (*p=='(') bc1++;
+ else if (*p==')')
+ {
+ if (--bc1<0) return 0;
+ }
+ else if (*p=='[') bc2++;
+ else if (*p==']')
+ {
+ if (--bc2<0) return 0;
+ }
+ p++;
+ }
+ *_p=p;
+ return *p && !bc1 && !bc2;
+ }
+
+ void run()
+ {
+ if (!spec) {Error();return;}
+ while(*spec)
+ {
+ if (*spec=='%')
+ {
+ spec++;
+ if (*spec=='%') {str.AddChar('%');spec++;continue;}
+ T_CHAR* s1=spec+1;
+ while(*s1 && *s1!='%') s1++;
+ if (!*s1) {Error();break;}
+ *s1=0;
+ const T_CHAR * tag=f(spec,fp);
+ *s1='%';
+ /*if (!tag) tag=tag_unknown; */
+ if (tag && tag[0])
+ {
+ found++;
+ str.AddString(tag);
+ }
+ else
+ {
+ str.AddString(_TX("?"));
+ }
+ if (tag && ff) ff(tag,fp);
+ spec=s1+1;
+ }
+ else if (*spec=='$')
+ {
+ spec++;
+ if (*spec=='$') {str.AddChar('$');spec++;continue;}
+ T_CHAR * s1=spec+1;
+ while(*s1 && *s1!='(') s1++;
+ if (!*s1) {Error();break;}
+ T_CHAR * s2=s1+1;
+ if (!skipshit(&s2,_TX(")"))) {Error();break;}
+ if (!*s2) {Error();break;};
+ T_CHAR * p=s1+1;
+ T_CHAR* temp[64];
+ UINT temp_f[64];
+ UINT nt=0;
+ T_CHAR * p1=s1+1;
+ while(p<=s2 && nt<64)
+ {
+ if (!skipshit(&p,_TX(",)"))) {Error();return;}
+ if (p>s2 || (*p!=',' && *p!=')')) {Error(_TX("internal error"));return;}
+ T_CHAR bk=*p;
+ *p=0;
+ temp[nt]=_FMT(p1,&temp_f[nt]);
+ nt++;
+ *p=bk;;
+ p1=p+1;
+ p++;
+ }
+ *s1=0;
+ UINT n;
+
+ for (n=0; n<TABSIZE(FUNCS); n++)
+ if (!t_stricmp(spec, FUNCS[n].name))
+ break;
+
+ *s1='(';
+
+ if (n != TABSIZE(FUNCS))
+ {
+ if (!FUNCS[n].func(nt, temp, temp_f, str))
+ {
+ Error(_TX("[INVALID $"));
+ str.AddString(FUNCS[n].name);
+ str.AddString(_TX(" SYNTAX]"));
+ return;
+ }
+ }
+ else
+ {
+ Error(_TX("[UNKNOWN FUNCTION]"));
+ return;
+ }
+
+ for(n=0;n<nt;n++) free(temp[n]);
+ spec=s2+1;
+ }
+ else if (*spec=='\'')
+ {
+ spec++;
+ if (*spec=='\'') {str.AddChar('\'');spec++;continue;}
+ T_CHAR * s1=spec+1;
+ while(*s1 && *s1!='\'') s1++;
+ if (!*s1) {Error();break;}
+ *s1=0;
+ str.AddString(spec);
+ *s1='\'';
+ spec=s1+1;
+ }
+ else if (*spec=='[')
+ {
+ spec++;
+ T_CHAR * s1=spec;
+ UINT bc=0;
+ if (!skipshit(&s1,_TX("]"))) {Error();break;}
+ T_CHAR bk=*s1;
+ *s1=0;
+ FMT fmt(this,spec);
+ fmt.run();
+ if (fmt.found)
+ {
+ str.AddString(fmt.str);
+ found+=fmt.found;
+ }
+ *s1=bk;
+ spec=s1+1;
+ }
+ else if (*spec == ']') {Error();break;}
+ else
+ {
+ str.AddChar(*spec);
+ spec++;
+ }
+ }
+ }
+
+ FMT(FMT* base,T_CHAR * _spec)
+ {
+ found=0;
+ org_spec=0;
+ f=base->f;
+ ff=base->ff;
+ fp=base->fp;
+ spec=_spec;
+ }
+public:
+ FMT(const T_CHAR * p_spec,TAGFUNC _f,TAGFREEFUNC _ff,void * _fp)
+ {
+ found=0;
+ org_spec=spec=t_strdup(p_spec);
+ f=_f;
+ ff=_ff;
+ fp=_fp;
+ }
+ operator T_CHAR*()
+ {
+ run();
+ return str.GetBuf();
+ }
+ ~FMT()
+ {
+ if (org_spec) free(org_spec);
+ }
+};
+
+extern "C"
+{
+
+UINT tagz_format(const T_CHAR * spec,TAGFUNC f,TAGFREEFUNC ff,void *fp,T_CHAR* out,UINT max)
+{
+ T_CHAR * zz=tagz_format_r(spec,f,ff,fp);
+ UINT r=0;
+ while(r<max-1 && zz[r])
+ {
+ out[r]=zz[r];
+ r++;
+ }
+ out[r]=0;
+ free(zz);
+ return r;
+}
+
+T_CHAR * tagz_format_r(const T_CHAR* spec,TAGFUNC f,TAGFREEFUNC ff,void * fp)
+{
+ return FMT(spec,f,ff,fp);
+}
+
+const char tagz_manual[]="Syntax reference: \n"
+ "\n"
+ "* %tagname% - inserts field named <tagname>, eg. \"%artist%\"\n"
+ "* $abbr(x) - inserts abbreviation of x, eg. \"$abbr(%album%)\" - will convert album name of \"Final Fantasy VI\" to \"FFVI\"\n"
+ "* $abbr(x,y) - inserts abbreviation of x if x is longer than y characters; otherwise inserts full value of x, eg. \"$abbr(%album%,10)\"\n"
+ "* $lower(x), $upper(x) - converts x to in lower/uppercase, eg. \"$upper(%title%)\"\n"
+ "* $num(x,y) - displays x number and pads with zeros up to y characters (useful for track numbers), eg. $num(%tracknumber%,2)\n"
+ "* $caps(x) - converts first letter in every word of x to uppercase, and all other letters to lowercase, eg. \"blah BLAH\" -> \"Blah Blah\"\n"
+ "* $caps2(x) - similar to $caps, but leaves uppercase letters as they are, eg. \"blah BLAH\" -> \"Blah BLAH\"\n"
+ "* $if(A,B,C) - if A contains at least one valid tag, displays B, otherwise displays C; eg. \"$if(%artist%,%artist%,unknown artist)\" will display artist name if present; otherwise will display \"unknown artist\"; note that \"$if(A,A,)\" is equivalent to \"[A]\" (see below)\n"
+ "* $if2(A,B) - equals to $if(A,A,B)\n"
+ "* $longest(A,B,C,....) - compares lengths of output strings produced by A,B,C... and displays the longest one, eg. \"$longest(%title%,%comment%)\" will display either title if it's longer than comment; otherwise it will display comment\n"
+ "* $pad(x,y) - pads x with spaces up to y characters\n"
+ "* $cut(x,y) - truncates x to y characters\n"
+ "* $padcut(x,y) - pads x to y characters and truncates to y if longer\n"
+ "* [ .... ] - displays contents of brackets only if at least one of fields referenced inside has been found, eg. \"%artist% - [%album% / ]%title%\" will hide [] block if album field is not present\n"
+ "* \' (single quotation mark) - outputs raw text without parsing, eg, \'blah$blah%blah[][]\' will output the contained string and ignore all reserved characters (%,$,[,]) in it; you can use this feature to insert square brackets for an example.\n"
+ "\n"
+ "eg. \"[%artist% - ][$abbr(%album%,10)[ %tracknumber%] / ]%title%[ %streamtitle%]\"\n";
+
+
+}
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/tagz.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/tagz.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/tagz.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/tagz.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,28 +1,28 @@
-#pragma once
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef UINT
-typedef unsigned int UINT;
-#endif
-
-#ifdef TAGZ_UNICODE
-typedef unsigned short T_CHAR;
-#else
-#define T_CHAR char
-#endif
-
-typedef const T_CHAR* (*TAGFUNC)(const T_CHAR *tag,void *p); /* return 0 if not found */
-typedef void (*TAGFREEFUNC)(const T_CHAR *tag,void *p);
-
-
-UINT tagz_format(const T_CHAR * spec,TAGFUNC f,TAGFREEFUNC ff,void *fp,T_CHAR * out,UINT max);
-T_CHAR * tagz_format_r(const T_CHAR * spec,TAGFUNC f,TAGFREEFUNC ff,void * fp);
-
-extern const char tagz_manual[];
-
-#ifdef __cplusplus
-}
-#endif
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef UINT
+typedef unsigned int UINT;
+#endif
+
+#ifdef TAGZ_UNICODE
+typedef unsigned short T_CHAR;
+#else
+#define T_CHAR char
+#endif
+
+typedef const T_CHAR* (*TAGFUNC)(const T_CHAR *tag,void *p); /* return 0 if not found */
+typedef void (*TAGFREEFUNC)(const T_CHAR *tag,void *p);
+
+
+UINT tagz_format(const T_CHAR * spec,TAGFUNC f,TAGFREEFUNC ff,void *fp,T_CHAR * out,UINT max);
+T_CHAR * tagz_format_r(const T_CHAR * spec,TAGFUNC f,TAGFREEFUNC ff,void * fp);
+
+extern const char tagz_manual[];
+
+#ifdef __cplusplus
+}
+#endif
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp2/tagz.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp3/cnv_flacpcm.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp3/cnv_flacpcm.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp3/cnv_flacpcm.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,82 +1,82 @@
-/* FLAC input plugin for Winamp3
- * Copyright (C) 2000,2001,2002,2003 Josh Coalson
- *
- * 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.
- *
- * NOTE: this code is derived from the 'rawpcm' example by
- * Nullsoft; the original license for the 'rawpcm' example follows.
- */
-/*
-
- Nullsoft WASABI Source File License
-
- Copyright 1999-2001 Nullsoft, Inc.
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
-
- Brennan Underwood
- brennan at nullsoft.com
-
-*/
-
-#include "cnv_flacpcm.h"
-#include "flacpcm.h"
-
-static WACNAME wac;
-WAComponentClient *the = &wac;
-
-#include "studio/services/servicei.h"
-
-// {683FA153-4055-467c-ABEE-5E35FA03C51E}
-static const GUID guid =
-{ 0x683fa153, 0x4055, 0x467c, { 0xab, 0xee, 0x5e, 0x35, 0xfa, 0x3, 0xc5, 0x1e } };
-
-_int nch("# of channels", 2);
-_int samplerate("Sample rate", 44100);
-_int bps("Bits per second", 16);
-
-WACNAME::WACNAME() : WAComponentClient("FLAC file support") {
- registerService(new waServiceT<svc_mediaConverter, FlacPcm>);
-}
-
-WACNAME::~WACNAME() {
-}
-
-GUID WACNAME::getGUID() {
- return guid;
-}
-
-void WACNAME::onRegisterServices() {
- api->core_registerExtension("*.flac","FLAC Files");
-
- registerAttribute(&nch);
- registerAttribute(&samplerate);
- registerAttribute(&bps);
-}
+/* FLAC input plugin for Winamp3
+ * Copyright (C) 2000,2001,2002,2003 Josh Coalson
+ *
+ * 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.
+ *
+ * NOTE: this code is derived from the 'rawpcm' example by
+ * Nullsoft; the original license for the 'rawpcm' example follows.
+ */
+/*
+
+ Nullsoft WASABI Source File License
+
+ Copyright 1999-2001 Nullsoft, Inc.
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+
+ Brennan Underwood
+ brennan at nullsoft.com
+
+*/
+
+#include "cnv_flacpcm.h"
+#include "flacpcm.h"
+
+static WACNAME wac;
+WAComponentClient *the = &wac;
+
+#include "studio/services/servicei.h"
+
+// {683FA153-4055-467c-ABEE-5E35FA03C51E}
+static const GUID guid =
+{ 0x683fa153, 0x4055, 0x467c, { 0xab, 0xee, 0x5e, 0x35, 0xfa, 0x3, 0xc5, 0x1e } };
+
+_int nch("# of channels", 2);
+_int samplerate("Sample rate", 44100);
+_int bps("Bits per second", 16);
+
+WACNAME::WACNAME() : WAComponentClient("FLAC file support") {
+ registerService(new waServiceT<svc_mediaConverter, FlacPcm>);
+}
+
+WACNAME::~WACNAME() {
+}
+
+GUID WACNAME::getGUID() {
+ return guid;
+}
+
+void WACNAME::onRegisterServices() {
+ api->core_registerExtension("*.flac","FLAC Files");
+
+ registerAttribute(&nch);
+ registerAttribute(&samplerate);
+ registerAttribute(&bps);
+}
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp3/cnv_flacpcm.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp3/cnv_flacpcm.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp3/cnv_flacpcm.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp3/cnv_flacpcm.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,69 +1,69 @@
-/* FLAC input plugin for Winamp3
- * Copyright (C) 2000,2001,2002,2003 Josh Coalson
- *
- * 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.
- *
- * NOTE: this code is derived from the 'rawpcm' example by
- * Nullsoft; the original license for the 'rawpcm' example follows.
- */
-/*
-
- Nullsoft WASABI Source File License
-
- Copyright 1999-2001 Nullsoft, Inc.
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
-
- Brennan Underwood
- brennan at nullsoft.com
-
-*/
-
-#ifndef _CNV_FLACPCM_H
-#define _CNV_FLACPCM_H
-
-#include "studio/wac.h"
-#include "common/rootcomp.h"
-#include "attribs/cfgitemi.h"
-#include "attribs/attrint.h"
-
-#define WACNAME WACcnv_flacpcm
-
-class WACNAME : public WAComponentClient {
-public:
- WACNAME();
- virtual ~WACNAME();
-
- virtual GUID getGUID();
-
- virtual void onRegisterServices();
-};
-
-#endif
+/* FLAC input plugin for Winamp3
+ * Copyright (C) 2000,2001,2002,2003 Josh Coalson
+ *
+ * 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.
+ *
+ * NOTE: this code is derived from the 'rawpcm' example by
+ * Nullsoft; the original license for the 'rawpcm' example follows.
+ */
+/*
+
+ Nullsoft WASABI Source File License
+
+ Copyright 1999-2001 Nullsoft, Inc.
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+
+ Brennan Underwood
+ brennan at nullsoft.com
+
+*/
+
+#ifndef _CNV_FLACPCM_H
+#define _CNV_FLACPCM_H
+
+#include "studio/wac.h"
+#include "common/rootcomp.h"
+#include "attribs/cfgitemi.h"
+#include "attribs/attrint.h"
+
+#define WACNAME WACcnv_flacpcm
+
+class WACNAME : public WAComponentClient {
+public:
+ WACNAME();
+ virtual ~WACNAME();
+
+ virtual GUID getGUID();
+
+ virtual void onRegisterServices();
+};
+
+#endif
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp3/cnv_flacpcm.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp3/flacpcm.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp3/flacpcm.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp3/flacpcm.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,351 +1,351 @@
-/* FLAC input plugin for Winamp3
- * Copyright (C) 2000,2001,2002,2003 Josh Coalson
- *
- * 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.
- *
- * NOTE: this code is derived from the 'rawpcm' example by
- * Nullsoft; the original license for the 'rawpcm' example follows.
- */
-/*
-
- Nullsoft WASABI Source File License
-
- Copyright 1999-2001 Nullsoft, Inc.
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
-
- Brennan Underwood
- brennan at nullsoft.com
-
-*/
-
-#include "flacpcm.h"
-extern "C" {
-#include "FLAC/metadata.h"
-};
-
-
-struct id3v1_struct {
- FLAC__byte raw[128];
- char title[31];
- char artist[31];
- char album[31];
- char comment[31];
- unsigned year;
- unsigned track; /* may be 0 if v1 (not v1.1) tag */
- unsigned genre;
- char description[1024]; /* the formatted description passed to the gui */
-};
-
-
-static bool get_id3v1_tag_(const char *filename, id3v1_struct *tag);
-
-
-FlacPcm::FlacPcm():
-needs_seek(false),
-seek_sample(0),
-samples_in_reservoir(0),
-abort_flag(false),
-reader(0),
-decoder(0)
-{
-}
-
-FlacPcm::~FlacPcm()
-{
- cleanup();
-}
-
-int FlacPcm::getInfos(MediaInfo *infos)
-{
- reader = infos->getReader();
- if(!reader) return 0;
-
- //@@@ to be really "clean" we should go through the reader instead of directly to the file...
- if(!FLAC__metadata_get_streaminfo(infos->getFilename(), &streaminfo))
- return 1;
-
- id3v1_struct tag;
-
- bool has_tag = get_id3v1_tag_(infos->getFilename(), &tag);
-
- infos->setLength(lengthInMsec());
- //@@@ infos->setTitle(Std::filename(infos->getFilename()));
- infos->setTitle(tag.description);
- infos->setInfo(StringPrintf("FLAC:<%ihz:%ibps:%dch>", streaminfo.data.stream_info.sample_rate, streaminfo.data.stream_info.bits_per_sample, streaminfo.data.stream_info.channels)); //@@@ fix later
- if(has_tag) {
- infos->setData("Title", tag.title);
- infos->setData("Artist", tag.artist);
- infos->setData("Album", tag.album);
- }
-
- return 0;
-}
-
-int FlacPcm::processData(MediaInfo *infos, ChunkList *chunk_list, bool *killswitch)
-{
- reader = infos->getReader();
- if(reader == 0)
- return 0;
-
- if(decoder == 0) {
- decoder = FLAC__seekable_stream_decoder_new();
- if(decoder == 0)
- return 0;
- FLAC__seekable_stream_decoder_set_md5_checking(decoder, false);
- FLAC__seekable_stream_decoder_set_read_callback(decoder, readCallback_);
- FLAC__seekable_stream_decoder_set_seek_callback(decoder, seekCallback_);
- FLAC__seekable_stream_decoder_set_tell_callback(decoder, tellCallback_);
- FLAC__seekable_stream_decoder_set_length_callback(decoder, lengthCallback_);
- FLAC__seekable_stream_decoder_set_eof_callback(decoder, eofCallback_);
- FLAC__seekable_stream_decoder_set_write_callback(decoder, writeCallback_);
- FLAC__seekable_stream_decoder_set_metadata_callback(decoder, metadataCallback_);
- FLAC__seekable_stream_decoder_set_error_callback(decoder, errorCallback_);
- FLAC__seekable_stream_decoder_set_client_data(decoder, this);
-
- if(FLAC__seekable_stream_decoder_init(decoder) != FLAC__SEEKABLE_STREAM_DECODER_OK) {
- cleanup();
- return 0;
- }
- if(!FLAC__seekable_stream_decoder_process_until_end_of_metadata(decoder)) {
- cleanup();
- return 0;
- }
- }
-
- if(needs_seek) {
- FLAC__seekable_stream_decoder_seek_absolute(decoder, seek_sample);
- needs_seek = false;
- }
-
- bool eof = false;
-
- while(samples_in_reservoir < 576) {
- if(FLAC__seekable_stream_decoder_get_state(decoder) == FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM) {
- eof = true;
- break;
- }
- else if(!FLAC__seekable_stream_decoder_process_single(decoder)) {
- //@@@ how to do this? MessageBox(mod_.hMainWindow, FLAC__FileDecoderStateString[FLAC__file_decoder_get_state(decoder_)], "READ ERROR processing frame", 0);
- eof = true;
- break;
- }
- }
-
- if(samples_in_reservoir == 0) {
- eof = true;
- }
- else {
- const unsigned channels = streaminfo.data.stream_info.channels;
- const unsigned bits_per_sample = streaminfo.data.stream_info.bits_per_sample;
- const unsigned bytes_per_sample = (bits_per_sample+7)/8;
- const unsigned sample_rate = streaminfo.data.stream_info.sample_rate;
- unsigned i, n = min(samples_in_reservoir, 576), delta;
- signed short *ssbuffer = (signed short*)output;
-
- for(i = 0; i < n*channels; i++)
- ssbuffer[i] = reservoir[i];
- delta = i;
- for( ; i < samples_in_reservoir*channels; i++)
- reservoir[i-delta] = reservoir[i];
- samples_in_reservoir -= n;
-
- const int bytes = n * channels * bytes_per_sample;
-
- ChunkInfosI *ci=new ChunkInfosI();
- ci->addInfo("srate", sample_rate);
- ci->addInfo("bps", bits_per_sample);
- ci->addInfo("nch", channels);
-
- chunk_list->setChunk("PCM", output, bytes, ci);
- }
-
- if(eof)
- return 0;
-
- return 1;
-}
-
-int FlacPcm::corecb_onSeeked(int newpos)
-{
- if(streaminfo.data.stream_info.total_samples == 0 || newpos < 0)
- return 1;
-
- needs_seek = true;
- seek_sample = (FLAC__uint64)((double)newpos / (double)lengthInMsec() * (double)(FLAC__int64)streaminfo.data.stream_info.total_samples);
- return 0;
-}
-
-void FlacPcm::cleanup()
-{
- if(decoder) {
- FLAC__seekable_stream_decoder_finish(decoder);
- FLAC__seekable_stream_decoder_delete(decoder);
- decoder = 0;
- }
-}
-FLAC__SeekableStreamDecoderReadStatus FlacPcm::readCallback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data)
-{
- FlacPcm *instance = (FlacPcm*)client_data;
- *bytes = instance->reader->read((char*)buffer, *bytes);
- return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK;
-}
-
-FLAC__SeekableStreamDecoderSeekStatus FlacPcm::seekCallback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data)
-{
- FlacPcm *instance = (FlacPcm*)client_data;
- if(instance->reader->seek((int)absolute_byte_offset) < 0)
- return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR;
- else
- return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK;
-}
-
-FLAC__SeekableStreamDecoderTellStatus FlacPcm::tellCallback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data)
-{
- FlacPcm *instance = (FlacPcm*)client_data;
- int pos = instance->reader->getPos();
- if(pos < 0)
- return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR;
- else {
- *absolute_byte_offset = pos;
- return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK;
- }
-}
-
-FLAC__SeekableStreamDecoderLengthStatus FlacPcm::lengthCallback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data)
-{
- FlacPcm *instance = (FlacPcm*)client_data;
- int length = instance->reader->getPos();
- if(length < 0)
- return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR;
- else {
- *stream_length = length;
- return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK;
- }
-}
-
-FLAC__bool FlacPcm::eofCallback_(const FLAC__SeekableStreamDecoder *decoder, void *client_data)
-{
- FlacPcm *instance = (FlacPcm*)client_data;
- return instance->reader->getPos() == instance->reader->getLength();
-}
-
-FLAC__StreamDecoderWriteStatus FlacPcm::writeCallback_(const FLAC__SeekableStreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data)
-{
- FlacPcm *instance = (FlacPcm*)client_data;
- const unsigned bps = instance->streaminfo.data.stream_info.bits_per_sample, channels = instance->streaminfo.data.stream_info.channels, wide_samples = frame->header.blocksize;
- unsigned wide_sample, sample, channel;
-
- (void)decoder;
-
- if(instance->abort_flag)
- return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
-
- for(sample = instance->samples_in_reservoir*channels, wide_sample = 0; wide_sample < wide_samples; wide_sample++)
- for(channel = 0; channel < channels; channel++, sample++)
- instance->reservoir[sample] = (FLAC__int16)buffer[channel][wide_sample];
-
- instance->samples_in_reservoir += wide_samples;
-
- return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
-}
-
-void FlacPcm::metadataCallback_(const FLAC__SeekableStreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
-{
- FlacPcm *instance = (FlacPcm*)client_data;
- (void)decoder;
- if(metadata->type == FLAC__METADATA_TYPE_STREAMINFO) {
- instance->streaminfo = *metadata;
-
- if(instance->streaminfo.data.stream_info.bits_per_sample != 16) {
- //@@@ how to do this? MessageBox(mod.hMainWindow, "ERROR: plugin can only handle 16-bit samples\n", "ERROR: plugin can only handle 16-bit samples", 0);
- instance->abort_flag = true;
- return;
- }
- }
-}
-
-void FlacPcm::errorCallback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data)
-{
- FlacPcm *instance = (FlacPcm*)client_data;
- (void)decoder;
- if(status != FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC)
- instance->abort_flag = true;
-}
-
-/***********************************************************************
- * local routines
- **********************************************************************/
-
-bool get_id3v1_tag_(const char *filename, id3v1_struct *tag)
-{
- const char *temp;
- FILE *f = fopen(filename, "rb");
- memset(tag, 0, sizeof(id3v1_struct));
-
- /* set the title and description to the filename by default */
- temp = strrchr(filename, '/');
- if(!temp)
- temp = filename;
- else
- temp++;
- strcpy(tag->description, temp);
- *strrchr(tag->description, '.') = '\0';
- strncpy(tag->title, tag->description, 30); tag->title[30] = '\0';
-
- if(0 == f)
- return false;
- if(-1 == fseek(f, -128, SEEK_END)) {
- fclose(f);
- return false;
- }
- if(fread(tag->raw, 1, 128, f) < 128) {
- fclose(f);
- return false;
- }
- fclose(f);
- if(strncmp((const char*)tag->raw, "TAG", 3))
- return false;
- else {
- char year_str[5];
-
- memcpy(tag->title, tag->raw+3, 30);
- memcpy(tag->artist, tag->raw+33, 30);
- memcpy(tag->album, tag->raw+63, 30);
- memcpy(year_str, tag->raw+93, 4); year_str[4] = '\0'; tag->year = atoi(year_str);
- memcpy(tag->comment, tag->raw+97, 30);
- tag->genre = (unsigned)((FLAC__byte)tag->raw[127]);
- tag->track = (unsigned)((FLAC__byte)tag->raw[126]);
-
- sprintf(tag->description, "%s - %s", tag->artist, tag->title);
-
- return true;
- }
-}
+/* FLAC input plugin for Winamp3
+ * Copyright (C) 2000,2001,2002,2003 Josh Coalson
+ *
+ * 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.
+ *
+ * NOTE: this code is derived from the 'rawpcm' example by
+ * Nullsoft; the original license for the 'rawpcm' example follows.
+ */
+/*
+
+ Nullsoft WASABI Source File License
+
+ Copyright 1999-2001 Nullsoft, Inc.
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+
+ Brennan Underwood
+ brennan at nullsoft.com
+
+*/
+
+#include "flacpcm.h"
+extern "C" {
+#include "FLAC/metadata.h"
+};
+
+
+struct id3v1_struct {
+ FLAC__byte raw[128];
+ char title[31];
+ char artist[31];
+ char album[31];
+ char comment[31];
+ unsigned year;
+ unsigned track; /* may be 0 if v1 (not v1.1) tag */
+ unsigned genre;
+ char description[1024]; /* the formatted description passed to the gui */
+};
+
+
+static bool get_id3v1_tag_(const char *filename, id3v1_struct *tag);
+
+
+FlacPcm::FlacPcm():
+needs_seek(false),
+seek_sample(0),
+samples_in_reservoir(0),
+abort_flag(false),
+reader(0),
+decoder(0)
+{
+}
+
+FlacPcm::~FlacPcm()
+{
+ cleanup();
+}
+
+int FlacPcm::getInfos(MediaInfo *infos)
+{
+ reader = infos->getReader();
+ if(!reader) return 0;
+
+ //@@@ to be really "clean" we should go through the reader instead of directly to the file...
+ if(!FLAC__metadata_get_streaminfo(infos->getFilename(), &streaminfo))
+ return 1;
+
+ id3v1_struct tag;
+
+ bool has_tag = get_id3v1_tag_(infos->getFilename(), &tag);
+
+ infos->setLength(lengthInMsec());
+ //@@@ infos->setTitle(Std::filename(infos->getFilename()));
+ infos->setTitle(tag.description);
+ infos->setInfo(StringPrintf("FLAC:<%ihz:%ibps:%dch>", streaminfo.data.stream_info.sample_rate, streaminfo.data.stream_info.bits_per_sample, streaminfo.data.stream_info.channels)); //@@@ fix later
+ if(has_tag) {
+ infos->setData("Title", tag.title);
+ infos->setData("Artist", tag.artist);
+ infos->setData("Album", tag.album);
+ }
+
+ return 0;
+}
+
+int FlacPcm::processData(MediaInfo *infos, ChunkList *chunk_list, bool *killswitch)
+{
+ reader = infos->getReader();
+ if(reader == 0)
+ return 0;
+
+ if(decoder == 0) {
+ decoder = FLAC__seekable_stream_decoder_new();
+ if(decoder == 0)
+ return 0;
+ FLAC__seekable_stream_decoder_set_md5_checking(decoder, false);
+ FLAC__seekable_stream_decoder_set_read_callback(decoder, readCallback_);
+ FLAC__seekable_stream_decoder_set_seek_callback(decoder, seekCallback_);
+ FLAC__seekable_stream_decoder_set_tell_callback(decoder, tellCallback_);
+ FLAC__seekable_stream_decoder_set_length_callback(decoder, lengthCallback_);
+ FLAC__seekable_stream_decoder_set_eof_callback(decoder, eofCallback_);
+ FLAC__seekable_stream_decoder_set_write_callback(decoder, writeCallback_);
+ FLAC__seekable_stream_decoder_set_metadata_callback(decoder, metadataCallback_);
+ FLAC__seekable_stream_decoder_set_error_callback(decoder, errorCallback_);
+ FLAC__seekable_stream_decoder_set_client_data(decoder, this);
+
+ if(FLAC__seekable_stream_decoder_init(decoder) != FLAC__SEEKABLE_STREAM_DECODER_OK) {
+ cleanup();
+ return 0;
+ }
+ if(!FLAC__seekable_stream_decoder_process_until_end_of_metadata(decoder)) {
+ cleanup();
+ return 0;
+ }
+ }
+
+ if(needs_seek) {
+ FLAC__seekable_stream_decoder_seek_absolute(decoder, seek_sample);
+ needs_seek = false;
+ }
+
+ bool eof = false;
+
+ while(samples_in_reservoir < 576) {
+ if(FLAC__seekable_stream_decoder_get_state(decoder) == FLAC__SEEKABLE_STREAM_DECODER_END_OF_STREAM) {
+ eof = true;
+ break;
+ }
+ else if(!FLAC__seekable_stream_decoder_process_single(decoder)) {
+ //@@@ how to do this? MessageBox(mod_.hMainWindow, FLAC__FileDecoderStateString[FLAC__file_decoder_get_state(decoder_)], "READ ERROR processing frame", 0);
+ eof = true;
+ break;
+ }
+ }
+
+ if(samples_in_reservoir == 0) {
+ eof = true;
+ }
+ else {
+ const unsigned channels = streaminfo.data.stream_info.channels;
+ const unsigned bits_per_sample = streaminfo.data.stream_info.bits_per_sample;
+ const unsigned bytes_per_sample = (bits_per_sample+7)/8;
+ const unsigned sample_rate = streaminfo.data.stream_info.sample_rate;
+ unsigned i, n = min(samples_in_reservoir, 576), delta;
+ signed short *ssbuffer = (signed short*)output;
+
+ for(i = 0; i < n*channels; i++)
+ ssbuffer[i] = reservoir[i];
+ delta = i;
+ for( ; i < samples_in_reservoir*channels; i++)
+ reservoir[i-delta] = reservoir[i];
+ samples_in_reservoir -= n;
+
+ const int bytes = n * channels * bytes_per_sample;
+
+ ChunkInfosI *ci=new ChunkInfosI();
+ ci->addInfo("srate", sample_rate);
+ ci->addInfo("bps", bits_per_sample);
+ ci->addInfo("nch", channels);
+
+ chunk_list->setChunk("PCM", output, bytes, ci);
+ }
+
+ if(eof)
+ return 0;
+
+ return 1;
+}
+
+int FlacPcm::corecb_onSeeked(int newpos)
+{
+ if(streaminfo.data.stream_info.total_samples == 0 || newpos < 0)
+ return 1;
+
+ needs_seek = true;
+ seek_sample = (FLAC__uint64)((double)newpos / (double)lengthInMsec() * (double)(FLAC__int64)streaminfo.data.stream_info.total_samples);
+ return 0;
+}
+
+void FlacPcm::cleanup()
+{
+ if(decoder) {
+ FLAC__seekable_stream_decoder_finish(decoder);
+ FLAC__seekable_stream_decoder_delete(decoder);
+ decoder = 0;
+ }
+}
+FLAC__SeekableStreamDecoderReadStatus FlacPcm::readCallback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data)
+{
+ FlacPcm *instance = (FlacPcm*)client_data;
+ *bytes = instance->reader->read((char*)buffer, *bytes);
+ return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_OK;
+}
+
+FLAC__SeekableStreamDecoderSeekStatus FlacPcm::seekCallback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data)
+{
+ FlacPcm *instance = (FlacPcm*)client_data;
+ if(instance->reader->seek((int)absolute_byte_offset) < 0)
+ return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_ERROR;
+ else
+ return FLAC__SEEKABLE_STREAM_DECODER_SEEK_STATUS_OK;
+}
+
+FLAC__SeekableStreamDecoderTellStatus FlacPcm::tellCallback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data)
+{
+ FlacPcm *instance = (FlacPcm*)client_data;
+ int pos = instance->reader->getPos();
+ if(pos < 0)
+ return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR;
+ else {
+ *absolute_byte_offset = pos;
+ return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_OK;
+ }
+}
+
+FLAC__SeekableStreamDecoderLengthStatus FlacPcm::lengthCallback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data)
+{
+ FlacPcm *instance = (FlacPcm*)client_data;
+ int length = instance->reader->getPos();
+ if(length < 0)
+ return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR;
+ else {
+ *stream_length = length;
+ return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_OK;
+ }
+}
+
+FLAC__bool FlacPcm::eofCallback_(const FLAC__SeekableStreamDecoder *decoder, void *client_data)
+{
+ FlacPcm *instance = (FlacPcm*)client_data;
+ return instance->reader->getPos() == instance->reader->getLength();
+}
+
+FLAC__StreamDecoderWriteStatus FlacPcm::writeCallback_(const FLAC__SeekableStreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data)
+{
+ FlacPcm *instance = (FlacPcm*)client_data;
+ const unsigned bps = instance->streaminfo.data.stream_info.bits_per_sample, channels = instance->streaminfo.data.stream_info.channels, wide_samples = frame->header.blocksize;
+ unsigned wide_sample, sample, channel;
+
+ (void)decoder;
+
+ if(instance->abort_flag)
+ return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
+
+ for(sample = instance->samples_in_reservoir*channels, wide_sample = 0; wide_sample < wide_samples; wide_sample++)
+ for(channel = 0; channel < channels; channel++, sample++)
+ instance->reservoir[sample] = (FLAC__int16)buffer[channel][wide_sample];
+
+ instance->samples_in_reservoir += wide_samples;
+
+ return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE;
+}
+
+void FlacPcm::metadataCallback_(const FLAC__SeekableStreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data)
+{
+ FlacPcm *instance = (FlacPcm*)client_data;
+ (void)decoder;
+ if(metadata->type == FLAC__METADATA_TYPE_STREAMINFO) {
+ instance->streaminfo = *metadata;
+
+ if(instance->streaminfo.data.stream_info.bits_per_sample != 16) {
+ //@@@ how to do this? MessageBox(mod.hMainWindow, "ERROR: plugin can only handle 16-bit samples\n", "ERROR: plugin can only handle 16-bit samples", 0);
+ instance->abort_flag = true;
+ return;
+ }
+ }
+}
+
+void FlacPcm::errorCallback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data)
+{
+ FlacPcm *instance = (FlacPcm*)client_data;
+ (void)decoder;
+ if(status != FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC)
+ instance->abort_flag = true;
+}
+
+/***********************************************************************
+ * local routines
+ **********************************************************************/
+
+bool get_id3v1_tag_(const char *filename, id3v1_struct *tag)
+{
+ const char *temp;
+ FILE *f = fopen(filename, "rb");
+ memset(tag, 0, sizeof(id3v1_struct));
+
+ /* set the title and description to the filename by default */
+ temp = strrchr(filename, '/');
+ if(!temp)
+ temp = filename;
+ else
+ temp++;
+ strcpy(tag->description, temp);
+ *strrchr(tag->description, '.') = '\0';
+ strncpy(tag->title, tag->description, 30); tag->title[30] = '\0';
+
+ if(0 == f)
+ return false;
+ if(-1 == fseek(f, -128, SEEK_END)) {
+ fclose(f);
+ return false;
+ }
+ if(fread(tag->raw, 1, 128, f) < 128) {
+ fclose(f);
+ return false;
+ }
+ fclose(f);
+ if(strncmp((const char*)tag->raw, "TAG", 3))
+ return false;
+ else {
+ char year_str[5];
+
+ memcpy(tag->title, tag->raw+3, 30);
+ memcpy(tag->artist, tag->raw+33, 30);
+ memcpy(tag->album, tag->raw+63, 30);
+ memcpy(year_str, tag->raw+93, 4); year_str[4] = '\0'; tag->year = atoi(year_str);
+ memcpy(tag->comment, tag->raw+97, 30);
+ tag->genre = (unsigned)((FLAC__byte)tag->raw[127]);
+ tag->track = (unsigned)((FLAC__byte)tag->raw[126]);
+
+ sprintf(tag->description, "%s - %s", tag->artist, tag->title);
+
+ return true;
+ }
+}
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp3/flacpcm.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp3/flacpcm.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp3/flacpcm.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp3/flacpcm.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,107 +1,107 @@
-/* FLAC input plugin for Winamp3
- * Copyright (C) 2000,2001,2002,2003 Josh Coalson
- *
- * 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.
- *
- * NOTE: this code is derived from the 'rawpcm' example by
- * Nullsoft; the original license for the 'rawpcm' example follows.
- */
-/*
-
- Nullsoft WASABI Source File License
-
- Copyright 1999-2001 Nullsoft, Inc.
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
-
- Brennan Underwood
- brennan at nullsoft.com
-
-*/
-
-#ifndef _FLACPCM_H
-#define _FLACPCM_H
-
-#include "studio/services/svc_mediaconverter.h"
-#include "studio/services/servicei.h"
-#include "studio/corecb.h"
-#include "studio/wac.h"
-#include "attribs/cfgitemi.h"
-#include "attribs/attrint.h"
-extern "C" {
-#include "FLAC/seekable_stream_decoder.h"
-};
-
-class FlacPcm : public svc_mediaConverterI {
-public:
- FlacPcm();
- virtual ~FlacPcm();
-
- // service
- static const char *getServiceName() { return "FLAC to PCM converter service"; }
-
- virtual int canConvertFrom(svc_fileReader *reader, const char *name, const char *chunktype)
- { return name && !STRICMP(Std::extension(name), "flac"); } // only accepts *.flac files
-
- virtual const char *getConverterTo() { return "PCM"; }
-
- virtual int getInfos(MediaInfo *infos);
-
- virtual int processData(MediaInfo *infos, ChunkList *chunk_list, bool *killswitch);
-
- virtual int getLatency(void) { return 0; }
-
- // callbacks
- virtual int corecb_onSeeked(int newpos);
-
-protected:
- bool needs_seek;
- FLAC__uint64 seek_sample;
- unsigned samples_in_reservoir;
- bool abort_flag;
- svc_fileReader *reader;
- FLAC__SeekableStreamDecoder *decoder;
- FLAC__StreamMetadata streaminfo;
- FLAC__int16 reservoir[FLAC__MAX_BLOCK_SIZE * 2 * 2]; // *2 for max channels, another *2 for overflow
- unsigned char output[576 * 2 * (16/8)]; // *2 for max channels, (16/8) for max bytes per sample
-
- unsigned lengthInMsec() { return (unsigned)((FLAC__uint64)1000 * streaminfo.data.stream_info.total_samples / streaminfo.data.stream_info.sample_rate); }
-private:
- void cleanup();
- static FLAC__SeekableStreamDecoderReadStatus readCallback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data);
- static FLAC__SeekableStreamDecoderSeekStatus seekCallback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data);
- static FLAC__SeekableStreamDecoderTellStatus tellCallback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data);
- static FLAC__SeekableStreamDecoderLengthStatus lengthCallback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data);
- static FLAC__bool eofCallback_(const FLAC__SeekableStreamDecoder *decoder, void *client_data);
- static FLAC__StreamDecoderWriteStatus writeCallback_(const FLAC__SeekableStreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
- static void metadataCallback_(const FLAC__SeekableStreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
- static void errorCallback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
-};
-#endif
+/* FLAC input plugin for Winamp3
+ * Copyright (C) 2000,2001,2002,2003 Josh Coalson
+ *
+ * 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.
+ *
+ * NOTE: this code is derived from the 'rawpcm' example by
+ * Nullsoft; the original license for the 'rawpcm' example follows.
+ */
+/*
+
+ Nullsoft WASABI Source File License
+
+ Copyright 1999-2001 Nullsoft, Inc.
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any damages
+ arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any purpose,
+ including commercial applications, and to alter it and redistribute it
+ freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must not
+ claim that you wrote the original software. If you use this software
+ in a product, an acknowledgment in the product documentation would be
+ appreciated but is not required.
+ 2. Altered source versions must be plainly marked as such, and must not be
+ misrepresented as being the original software.
+ 3. This notice may not be removed or altered from any source distribution.
+
+
+ Brennan Underwood
+ brennan at nullsoft.com
+
+*/
+
+#ifndef _FLACPCM_H
+#define _FLACPCM_H
+
+#include "studio/services/svc_mediaconverter.h"
+#include "studio/services/servicei.h"
+#include "studio/corecb.h"
+#include "studio/wac.h"
+#include "attribs/cfgitemi.h"
+#include "attribs/attrint.h"
+extern "C" {
+#include "FLAC/seekable_stream_decoder.h"
+};
+
+class FlacPcm : public svc_mediaConverterI {
+public:
+ FlacPcm();
+ virtual ~FlacPcm();
+
+ // service
+ static const char *getServiceName() { return "FLAC to PCM converter service"; }
+
+ virtual int canConvertFrom(svc_fileReader *reader, const char *name, const char *chunktype)
+ { return name && !STRICMP(Std::extension(name), "flac"); } // only accepts *.flac files
+
+ virtual const char *getConverterTo() { return "PCM"; }
+
+ virtual int getInfos(MediaInfo *infos);
+
+ virtual int processData(MediaInfo *infos, ChunkList *chunk_list, bool *killswitch);
+
+ virtual int getLatency(void) { return 0; }
+
+ // callbacks
+ virtual int corecb_onSeeked(int newpos);
+
+protected:
+ bool needs_seek;
+ FLAC__uint64 seek_sample;
+ unsigned samples_in_reservoir;
+ bool abort_flag;
+ svc_fileReader *reader;
+ FLAC__SeekableStreamDecoder *decoder;
+ FLAC__StreamMetadata streaminfo;
+ FLAC__int16 reservoir[FLAC__MAX_BLOCK_SIZE * 2 * 2]; // *2 for max channels, another *2 for overflow
+ unsigned char output[576 * 2 * (16/8)]; // *2 for max channels, (16/8) for max bytes per sample
+
+ unsigned lengthInMsec() { return (unsigned)((FLAC__uint64)1000 * streaminfo.data.stream_info.total_samples / streaminfo.data.stream_info.sample_rate); }
+private:
+ void cleanup();
+ static FLAC__SeekableStreamDecoderReadStatus readCallback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__byte buffer[], unsigned *bytes, void *client_data);
+ static FLAC__SeekableStreamDecoderSeekStatus seekCallback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 absolute_byte_offset, void *client_data);
+ static FLAC__SeekableStreamDecoderTellStatus tellCallback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *absolute_byte_offset, void *client_data);
+ static FLAC__SeekableStreamDecoderLengthStatus lengthCallback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__uint64 *stream_length, void *client_data);
+ static FLAC__bool eofCallback_(const FLAC__SeekableStreamDecoder *decoder, void *client_data);
+ static FLAC__StreamDecoderWriteStatus writeCallback_(const FLAC__SeekableStreamDecoder *decoder, const FLAC__Frame *frame, const FLAC__int32 * const buffer[], void *client_data);
+ static void metadataCallback_(const FLAC__SeekableStreamDecoder *decoder, const FLAC__StreamMetadata *metadata, void *client_data);
+ static void errorCallback_(const FLAC__SeekableStreamDecoder *decoder, FLAC__StreamDecoderErrorStatus status, void *client_data);
+};
+#endif
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_winamp3/flacpcm.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_xmms/charset.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_xmms/configure.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_xmms/tag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/plugin_xmms/wrap_id3.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/share/replaygain_synthesis/include/private/fast_float_math_hack.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/share/utf8/charmaps.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/share/utf8/charset.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/share/utf8/charsetmap.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC/bitbuffer.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC/decoders.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC/encoders.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC/file_utils.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC/metadata.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC/metadata_utils.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC++/decoders.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC++/decoders.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC++/encoders.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC++/encoders.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC++/file_utils.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC++/main.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC++/metadata.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC++/metadata.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC++/metadata_manip.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC++/metadata_object.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libFLAC++/metadata_utils.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libOggFLAC/decoders.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libOggFLAC/encoders.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libOggFLAC/file_utils.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libOggFLAC/metadata_utils.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libOggFLAC++/decoders.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libOggFLAC++/decoders.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libOggFLAC++/encoders.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libOggFLAC++/encoders.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libOggFLAC++/file_utils.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libOggFLAC++/main.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/flac/libs/libflac/src/test_libOggFLAC++/metadata_utils.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/helper/libfishsound/include/fishsound/comments.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/helper/libfishsound/include/fishsound/constants.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/helper/libfishsound/include/fishsound/fishsound.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/helper/libfishsound/src/libfishsound/fs_compat.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/helper/libfishsound/src/libfishsound/fs_vector.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/helper/libfishsound/src/libfishsound/private.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/helper/libfishsound/src/tests/fs_compat.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/helper/libfishsound/src/tests/fs_tests.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/helper/libfishsound/win32/config.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/helper/libfishsound/win32/config.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/helper/libfishsound/win32/config.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -85,12 +85,12 @@
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
-
-/* Define to `long' if <sys/types.h> does not define. */
-/* #undef off_t */
-
-/* Define to rpl_realloc if the replacement function should be used. */
-#undef realloc
-
-/* Define to `unsigned' if <sys/types.h> does not define. */
-#undef size_t
+
+/* Define to `long' if <sys/types.h> does not define. */
+/* #undef off_t */
+
+/* Define to rpl_realloc if the replacement function should be used. */
+#undef realloc
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+#undef size_t
Property changes on: trunk/oggdsf/src/lib/codecs/helper/libfishsound/win32/config.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/helper/libfishsound/win32/encdec-audio/encdec-audio.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/helper/libfishsound/win32/encdec-audio/encdec-audio.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/helper/libfishsound/win32/encdec-audio/encdec-audio.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,10 +1,10 @@
-// encdec-audio.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-
-int _tmain(int argc, _TCHAR* argv[])
-{
- return 0;
-}
-
+// encdec-audio.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+
+int _tmain(int argc, _TCHAR* argv[])
+{
+ return 0;
+}
+
Property changes on: trunk/oggdsf/src/lib/codecs/helper/libfishsound/win32/encdec-audio/encdec-audio.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/helper/libfishsound/win32/encdec-comments/encdec-comments.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/helper/libfishsound/win32/encdec-comments/encdec-comments.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/helper/libfishsound/win32/encdec-comments/encdec-comments.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,10 +1,10 @@
-// encdec-comments.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-
-int _tmain(int argc, _TCHAR* argv[])
-{
- return 0;
-}
-
+// encdec-comments.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+
+int _tmain(int argc, _TCHAR* argv[])
+{
+ return 0;
+}
+
Property changes on: trunk/oggdsf/src/lib/codecs/helper/libfishsound/win32/encdec-comments/encdec-comments.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeFilter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeFilter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,120 +1,120 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-//Include Files
-#include "StdAfx.h"
-#include "SpeexDecodeFilter.h"
-
-
-//COM Factory Template
-CFactoryTemplate g_Templates[] =
-{
- {
- L"Speex Decode Filter", // Name
- &CLSID_SpeexDecodeFilter, // CLSID
- SpeexDecodeFilter::CreateInstance, // Method to create an instance of Speex Decoder
- NULL, // Initialization function
- NULL // Set-up information (for filters)
- }
-
-};
-
-// Generic way of determining the number of items in the template
-int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
-
-SpeexDecodeFilter::SpeexDecodeFilter()
- : AbstractTransformFilter(NAME("Speex Audio Decoder"), CLSID_SpeexDecodeFilter)
- , mSpeexFormatInfo(NULL)
-{
-
- bool locWasConstructed = ConstructPins();
-}
-
-bool SpeexDecodeFilter::ConstructPins()
-{
-
- //Vector to hold our set of media types we want to accept.
- vector<CMediaType*> locAcceptableTypes;
-
- //Setup the media types for the output pin.
- CMediaType* locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted in pin destructor
- locAcceptMediaType->subtype = MEDIASUBTYPE_PCM;
- locAcceptMediaType->formattype = FORMAT_WaveFormatEx;
-
- locAcceptableTypes.push_back(locAcceptMediaType);
-
- //Output pin must be done first because it's passed to the input pin.
- mOutputPin = new SpeexDecodeOutputPin(this, m_pLock, locAcceptableTypes); //Deleted in base class destructor
-
- //Clear out the vector, now we've already passed it to the output pin.
- locAcceptableTypes.clear();
-
- //Setup the media Types for the input pin.
- locAcceptMediaType = NULL;
- locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted by pin
-
- locAcceptMediaType->subtype = MEDIASUBTYPE_Speex;
- locAcceptMediaType->formattype = FORMAT_Speex;
-
- locAcceptableTypes.push_back(locAcceptMediaType);
-
- mInputPin = new SpeexDecodeInputPin(this, m_pLock, mOutputPin, locAcceptableTypes); //Deleted in base class filter destructor.
- return true;
-
-}
-
-SpeexDecodeFilter::~SpeexDecodeFilter(void)
-{
- delete mSpeexFormatInfo;
-}
-
-CUnknown* WINAPI SpeexDecodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
-{
- //This routine is the COM implementation to create a new Filter
- SpeexDecodeFilter *pNewObject = new SpeexDecodeFilter();
- if (pNewObject == NULL) {
- *pHr = E_OUTOFMEMORY;
- }
- return pNewObject;
-}
-
-//QUERY::: Do we need these ? Aren't we all friedns here ??
-//RESULT::: Keep them, set function must be kept... get could go... but keep for consistency
-sSpeexFormatBlock* SpeexDecodeFilter::getSpeexFormatBlock()
-{
- return mSpeexFormatInfo;
-}
-void SpeexDecodeFilter::setSpeexFormat(sSpeexFormatBlock* inFormatBlock)
-{
- delete mSpeexFormatInfo;
- mSpeexFormatInfo = new sSpeexFormatBlock;
- *mSpeexFormatInfo = *inFormatBlock;
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+//Include Files
+#include "StdAfx.h"
+#include "SpeexDecodeFilter.h"
+
+
+//COM Factory Template
+CFactoryTemplate g_Templates[] =
+{
+ {
+ L"Speex Decode Filter", // Name
+ &CLSID_SpeexDecodeFilter, // CLSID
+ SpeexDecodeFilter::CreateInstance, // Method to create an instance of Speex Decoder
+ NULL, // Initialization function
+ NULL // Set-up information (for filters)
+ }
+
+};
+
+// Generic way of determining the number of items in the template
+int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
+
+SpeexDecodeFilter::SpeexDecodeFilter()
+ : AbstractTransformFilter(NAME("Speex Audio Decoder"), CLSID_SpeexDecodeFilter)
+ , mSpeexFormatInfo(NULL)
+{
+
+ bool locWasConstructed = ConstructPins();
+}
+
+bool SpeexDecodeFilter::ConstructPins()
+{
+
+ //Vector to hold our set of media types we want to accept.
+ vector<CMediaType*> locAcceptableTypes;
+
+ //Setup the media types for the output pin.
+ CMediaType* locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted in pin destructor
+ locAcceptMediaType->subtype = MEDIASUBTYPE_PCM;
+ locAcceptMediaType->formattype = FORMAT_WaveFormatEx;
+
+ locAcceptableTypes.push_back(locAcceptMediaType);
+
+ //Output pin must be done first because it's passed to the input pin.
+ mOutputPin = new SpeexDecodeOutputPin(this, m_pLock, locAcceptableTypes); //Deleted in base class destructor
+
+ //Clear out the vector, now we've already passed it to the output pin.
+ locAcceptableTypes.clear();
+
+ //Setup the media Types for the input pin.
+ locAcceptMediaType = NULL;
+ locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted by pin
+
+ locAcceptMediaType->subtype = MEDIASUBTYPE_Speex;
+ locAcceptMediaType->formattype = FORMAT_Speex;
+
+ locAcceptableTypes.push_back(locAcceptMediaType);
+
+ mInputPin = new SpeexDecodeInputPin(this, m_pLock, mOutputPin, locAcceptableTypes); //Deleted in base class filter destructor.
+ return true;
+
+}
+
+SpeexDecodeFilter::~SpeexDecodeFilter(void)
+{
+ delete mSpeexFormatInfo;
+}
+
+CUnknown* WINAPI SpeexDecodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
+{
+ //This routine is the COM implementation to create a new Filter
+ SpeexDecodeFilter *pNewObject = new SpeexDecodeFilter();
+ if (pNewObject == NULL) {
+ *pHr = E_OUTOFMEMORY;
+ }
+ return pNewObject;
+}
+
+//QUERY::: Do we need these ? Aren't we all friedns here ??
+//RESULT::: Keep them, set function must be kept... get could go... but keep for consistency
+sSpeexFormatBlock* SpeexDecodeFilter::getSpeexFormatBlock()
+{
+ return mSpeexFormatInfo;
+}
+void SpeexDecodeFilter::setSpeexFormat(sSpeexFormatBlock* inFormatBlock)
+{
+ delete mSpeexFormatInfo;
+ mSpeexFormatInfo = new sSpeexFormatBlock;
+ *mSpeexFormatInfo = *inFormatBlock;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeFilter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeFilter.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeFilter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeFilter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,70 +1,70 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-//Include Files
-#include "speexdecoderdllstuff.h"
-#include "AbstractTransformFilter.h"
-
-//Forward Declarations
-struct sSpeexFormatBlock;
-class SpeexDecodeInputPin;
-class SpeexDecodeOutputPin;
-
-//Class Interface
-class SpeexDecodeFilter
- //Base Classes
- : public AbstractTransformFilter
-{
-public:
- //Friends
- friend class SpeexDecodeInputPin;
- friend class SpeexDecodeOutputPin;
-
- //Constructors and Destructors
- SpeexDecodeFilter(void);
- virtual ~SpeexDecodeFilter(void);
-
- //COM Creator Function
- static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
-
-
- //FIX::: Do we need these ? Aren't they all friends ??
- virtual sSpeexFormatBlock* getSpeexFormatBlock();
- virtual void setSpeexFormat(sSpeexFormatBlock* inFormatBlock);
-
-protected:
- //Pure Virtuals from AbstracttransformFilter
- virtual bool ConstructPins();
-
- //Format Block
- sSpeexFormatBlock* mSpeexFormatInfo;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+//Include Files
+#include "speexdecoderdllstuff.h"
+#include "AbstractTransformFilter.h"
+
+//Forward Declarations
+struct sSpeexFormatBlock;
+class SpeexDecodeInputPin;
+class SpeexDecodeOutputPin;
+
+//Class Interface
+class SpeexDecodeFilter
+ //Base Classes
+ : public AbstractTransformFilter
+{
+public:
+ //Friends
+ friend class SpeexDecodeInputPin;
+ friend class SpeexDecodeOutputPin;
+
+ //Constructors and Destructors
+ SpeexDecodeFilter(void);
+ virtual ~SpeexDecodeFilter(void);
+
+ //COM Creator Function
+ static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+
+
+ //FIX::: Do we need these ? Aren't they all friends ??
+ virtual sSpeexFormatBlock* getSpeexFormatBlock();
+ virtual void setSpeexFormat(sSpeexFormatBlock* inFormatBlock);
+
+protected:
+ //Pure Virtuals from AbstracttransformFilter
+ virtual bool ConstructPins();
+
+ //Format Block
+ sSpeexFormatBlock* mSpeexFormatInfo;
+};
Property changes on: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeFilter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeInputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeInputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,209 +1,209 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "SpeexDecodeInputPin.h"
-
-
-SpeexDecodeInputPin::SpeexDecodeInputPin(AbstractTransformFilter* inFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes)
- : AbstractTransformInputPin(inFilter, inFilterLock, inOutputPin, NAME("SpeexDecodeInputPin"), L"Speex In", inAcceptableMediaTypes)
- , mFishSound(NULL)
-
- , mNumChannels(0)
- , mFrameSize(0)
- , mSampleRate(0)
- , mUptoFrame(0)
-
- , mBegun(false)
-{
- ConstructCodec();
-}
-
-bool SpeexDecodeInputPin::ConstructCodec() {
- mFishSound = fish_sound_new (FISH_SOUND_DECODE, &mFishInfo);
-
- int i = 1;
- //FIX::: Use new API for interleave setting
- fish_sound_command(mFishSound, FISH_SOUND_SET_INTERLEAVE, &i, sizeof(int));
-
- fish_sound_set_decoded_callback (mFishSound, SpeexDecodeInputPin::SpeexDecoded, this);
- //FIX::: Proper return value
- return true;
-}
-void SpeexDecodeInputPin::DestroyCodec() {
- fish_sound_delete(mFishSound);
- mFishSound = NULL;
-}
-SpeexDecodeInputPin::~SpeexDecodeInputPin(void)
-{
- DestroyCodec();
-}
-
-STDMETHODIMP SpeexDecodeInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
- if (riid == IID_IMediaSeeking) {
- *ppv = (IMediaSeeking*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- }
-
- return CBaseInputPin::NonDelegatingQueryInterface(riid, ppv);
-}
-STDMETHODIMP SpeexDecodeInputPin::NewSegment(REFERENCE_TIME inStartTime, REFERENCE_TIME inStopTime, double inRate)
-{
- CAutoLock locLock(mStreamLock);
- //debugLog<<"New segment "<<inStartTime<<" - "<<inStopTime<<endl;
- mUptoFrame = 0;
- return AbstractTransformInputPin::NewSegment(inStartTime, inStopTime, inRate);
-
-}
-
-int SpeexDecodeInputPin::SpeexDecoded (FishSound* inFishSound, float** inPCM, long inFrames, void* inThisPointer)
-{
- //Do we need to delete the pcm structure ????
- //More of this can go to the abstract class.
-
- //For convenience we do all these cast once and for all here.
- SpeexDecodeInputPin* locThis = reinterpret_cast<SpeexDecodeInputPin*> (inThisPointer);
- SpeexDecodeFilter* locFilter = reinterpret_cast<SpeexDecodeFilter*>(locThis->m_pFilter);
-
-
- if (! locThis->mBegun) {
-
- fish_sound_command (locThis->mFishSound, FISH_SOUND_GET_INFO, &(locThis->mFishInfo), sizeof (FishSoundInfo));
- locThis->mBegun = true;
-
- locThis->mNumChannels = locThis->mFishInfo.channels;
- locThis->mFrameSize = locThis->mNumChannels * SIZE_16_BITS;
- locThis->mSampleRate = locThis->mFishInfo.samplerate;
-
- }
-
- //TO DO::: Move this somewhere else
- unsigned long locActualSize = inFrames * locThis->mFrameSize;
- unsigned long locTotalFrameCount = inFrames * locThis->mNumChannels;
-
- REFERENCE_TIME locFrameStart = (((__int64)(locThis->mUptoFrame * UNITS)) / locThis->mSampleRate);
- //Increment the frame counter
- locThis->mUptoFrame += inFrames;
- //Make the end frame counter
-
-
- REFERENCE_TIME locFrameEnd = (((__int64)(locThis->mUptoFrame * UNITS)) / locThis->mSampleRate);
-
-
- IMediaSample* locSample;
- HRESULT locHR = locThis->mOutputPin->GetDeliveryBuffer(&locSample, &locFrameStart, &locFrameEnd, NULL);
-
- if (locHR != S_OK) {
- return locHR;
- }
-
- //Create pointers for the samples buffer to be assigned to
- BYTE* locBuffer = NULL;
- signed short* locShortBuffer = NULL;
-
- //Make our pointers set to point to the samples buffer
- locSample->GetPointer(&locBuffer);
- locShortBuffer = (short *) locBuffer;
-
- signed short tempInt = 0;
- float tempFloat = 0;
-
- //FIX:::Move the clipping to the abstract function
-
- if (locSample->GetSize() >= locActualSize) {
- //Do float to int conversion with clipping
- float SINT_MAX_AS_FLOAT = 32767.0f;
- for (unsigned long i = 0; i < locTotalFrameCount; i++) {
- //Clipping because vorbis puts out floats out of range -1 to 1
- if (((float*)inPCM)[i] <= -1.0f) {
- tempInt = SINT_MIN;
- } else if (((float*)inPCM)[i] >= 1.0f) {
- tempInt = SINT_MAX;
- } else {
- //FIX:::Take out the unnescessary variable.
- tempFloat = ((( (float*) inPCM )[i]) * SINT_MAX_AS_FLOAT);
- //ASSERT((tempFloat <= 32767.0f) && (tempFloat >= -32786.0f));
- tempInt = (signed short)(tempFloat);
- //tempInt = (signed short) ((( (float*) inPCM )[i]) * SINT_MAX_AS_FLOAT);
- }
-
- *locShortBuffer = tempInt;
- locShortBuffer++;
- }
-
- //Set the sample parameters.
- locThis->SetSampleParams(locSample, locActualSize, &locFrameStart, &locFrameEnd);
-
- {
- CAutoLock locLock(locThis->m_pLock);
- HRESULT locHR = ((SpeexDecodeOutputPin*)(locThis->mOutputPin))->mDataQueue->Receive(locSample);
- if (locHR != S_OK) {
- return locHR;
- }
- }
-
-
- return 0;
- } else {
- throw 0;
- }
-
-}
-
-
-
-HRESULT SpeexDecodeInputPin::TransformData(BYTE* inBuf, long inNumBytes)
-{
- long locErr = fish_sound_decode(mFishSound, inBuf, inNumBytes);
- if (locErr == 0) {
- return S_OK;
- } else {
- return S_FALSE;
- }
-}
-
-
-
-HRESULT SpeexDecodeInputPin::SetMediaType(const CMediaType* inMediaType) {
- //FIX:::Error checking
- //RESOLVED::: Bit better.
-
- if (inMediaType->subtype == MEDIASUBTYPE_Speex) {
- ((SpeexDecodeFilter*)mParentFilter)->setSpeexFormat((sSpeexFormatBlock*)inMediaType->pbFormat);
-
- } else {
- throw 0;
- }
- return CBaseInputPin::SetMediaType(inMediaType);
-}
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "SpeexDecodeInputPin.h"
+
+
+SpeexDecodeInputPin::SpeexDecodeInputPin(AbstractTransformFilter* inFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes)
+ : AbstractTransformInputPin(inFilter, inFilterLock, inOutputPin, NAME("SpeexDecodeInputPin"), L"Speex In", inAcceptableMediaTypes)
+ , mFishSound(NULL)
+
+ , mNumChannels(0)
+ , mFrameSize(0)
+ , mSampleRate(0)
+ , mUptoFrame(0)
+
+ , mBegun(false)
+{
+ ConstructCodec();
+}
+
+bool SpeexDecodeInputPin::ConstructCodec() {
+ mFishSound = fish_sound_new (FISH_SOUND_DECODE, &mFishInfo);
+
+ int i = 1;
+ //FIX::: Use new API for interleave setting
+ fish_sound_command(mFishSound, FISH_SOUND_SET_INTERLEAVE, &i, sizeof(int));
+
+ fish_sound_set_decoded_callback (mFishSound, SpeexDecodeInputPin::SpeexDecoded, this);
+ //FIX::: Proper return value
+ return true;
+}
+void SpeexDecodeInputPin::DestroyCodec() {
+ fish_sound_delete(mFishSound);
+ mFishSound = NULL;
+}
+SpeexDecodeInputPin::~SpeexDecodeInputPin(void)
+{
+ DestroyCodec();
+}
+
+STDMETHODIMP SpeexDecodeInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+ if (riid == IID_IMediaSeeking) {
+ *ppv = (IMediaSeeking*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ }
+
+ return CBaseInputPin::NonDelegatingQueryInterface(riid, ppv);
+}
+STDMETHODIMP SpeexDecodeInputPin::NewSegment(REFERENCE_TIME inStartTime, REFERENCE_TIME inStopTime, double inRate)
+{
+ CAutoLock locLock(mStreamLock);
+ //debugLog<<"New segment "<<inStartTime<<" - "<<inStopTime<<endl;
+ mUptoFrame = 0;
+ return AbstractTransformInputPin::NewSegment(inStartTime, inStopTime, inRate);
+
+}
+
+int SpeexDecodeInputPin::SpeexDecoded (FishSound* inFishSound, float** inPCM, long inFrames, void* inThisPointer)
+{
+ //Do we need to delete the pcm structure ????
+ //More of this can go to the abstract class.
+
+ //For convenience we do all these cast once and for all here.
+ SpeexDecodeInputPin* locThis = reinterpret_cast<SpeexDecodeInputPin*> (inThisPointer);
+ SpeexDecodeFilter* locFilter = reinterpret_cast<SpeexDecodeFilter*>(locThis->m_pFilter);
+
+
+ if (! locThis->mBegun) {
+
+ fish_sound_command (locThis->mFishSound, FISH_SOUND_GET_INFO, &(locThis->mFishInfo), sizeof (FishSoundInfo));
+ locThis->mBegun = true;
+
+ locThis->mNumChannels = locThis->mFishInfo.channels;
+ locThis->mFrameSize = locThis->mNumChannels * SIZE_16_BITS;
+ locThis->mSampleRate = locThis->mFishInfo.samplerate;
+
+ }
+
+ //TO DO::: Move this somewhere else
+ unsigned long locActualSize = inFrames * locThis->mFrameSize;
+ unsigned long locTotalFrameCount = inFrames * locThis->mNumChannels;
+
+ REFERENCE_TIME locFrameStart = (((__int64)(locThis->mUptoFrame * UNITS)) / locThis->mSampleRate);
+ //Increment the frame counter
+ locThis->mUptoFrame += inFrames;
+ //Make the end frame counter
+
+
+ REFERENCE_TIME locFrameEnd = (((__int64)(locThis->mUptoFrame * UNITS)) / locThis->mSampleRate);
+
+
+ IMediaSample* locSample;
+ HRESULT locHR = locThis->mOutputPin->GetDeliveryBuffer(&locSample, &locFrameStart, &locFrameEnd, NULL);
+
+ if (locHR != S_OK) {
+ return locHR;
+ }
+
+ //Create pointers for the samples buffer to be assigned to
+ BYTE* locBuffer = NULL;
+ signed short* locShortBuffer = NULL;
+
+ //Make our pointers set to point to the samples buffer
+ locSample->GetPointer(&locBuffer);
+ locShortBuffer = (short *) locBuffer;
+
+ signed short tempInt = 0;
+ float tempFloat = 0;
+
+ //FIX:::Move the clipping to the abstract function
+
+ if (locSample->GetSize() >= locActualSize) {
+ //Do float to int conversion with clipping
+ float SINT_MAX_AS_FLOAT = 32767.0f;
+ for (unsigned long i = 0; i < locTotalFrameCount; i++) {
+ //Clipping because vorbis puts out floats out of range -1 to 1
+ if (((float*)inPCM)[i] <= -1.0f) {
+ tempInt = SINT_MIN;
+ } else if (((float*)inPCM)[i] >= 1.0f) {
+ tempInt = SINT_MAX;
+ } else {
+ //FIX:::Take out the unnescessary variable.
+ tempFloat = ((( (float*) inPCM )[i]) * SINT_MAX_AS_FLOAT);
+ //ASSERT((tempFloat <= 32767.0f) && (tempFloat >= -32786.0f));
+ tempInt = (signed short)(tempFloat);
+ //tempInt = (signed short) ((( (float*) inPCM )[i]) * SINT_MAX_AS_FLOAT);
+ }
+
+ *locShortBuffer = tempInt;
+ locShortBuffer++;
+ }
+
+ //Set the sample parameters.
+ locThis->SetSampleParams(locSample, locActualSize, &locFrameStart, &locFrameEnd);
+
+ {
+ CAutoLock locLock(locThis->m_pLock);
+ HRESULT locHR = ((SpeexDecodeOutputPin*)(locThis->mOutputPin))->mDataQueue->Receive(locSample);
+ if (locHR != S_OK) {
+ return locHR;
+ }
+ }
+
+
+ return 0;
+ } else {
+ throw 0;
+ }
+
+}
+
+
+
+HRESULT SpeexDecodeInputPin::TransformData(BYTE* inBuf, long inNumBytes)
+{
+ long locErr = fish_sound_decode(mFishSound, inBuf, inNumBytes);
+ if (locErr == 0) {
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
+}
+
+
+
+HRESULT SpeexDecodeInputPin::SetMediaType(const CMediaType* inMediaType) {
+ //FIX:::Error checking
+ //RESOLVED::: Bit better.
+
+ if (inMediaType->subtype == MEDIASUBTYPE_Speex) {
+ ((SpeexDecodeFilter*)mParentFilter)->setSpeexFormat((sSpeexFormatBlock*)inMediaType->pbFormat);
+
+ } else {
+ throw 0;
+ }
+ return CBaseInputPin::SetMediaType(inMediaType);
+}
+
Property changes on: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeInputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeInputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeInputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,77 +1,77 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "speexdecoderdllstuff.h"
-#include "AbstractTransformInputPin.h"
-#include "SpeexDecodeInputPin.h"
-
-#include "SpeexDecodeFilter.h"
-
-extern "C" {
-//#include <fishsound/fishsound.h>
-#include "fish_cdecl.h"
-}
-
-class SpeexDecodeOutputPin;
-
-class SpeexDecodeInputPin
- : public AbstractTransformInputPin
-{
-public:
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
- SpeexDecodeInputPin(AbstractTransformFilter* inFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes);
- virtual ~SpeexDecodeInputPin(void);
-
- static int __cdecl SpeexDecoded (FishSound* inFishSound, float** inPCM, long inFrames, void* inThisPointer);
-
-
- virtual HRESULT SetMediaType(const CMediaType* inMediaType);
- virtual STDMETHODIMP NewSegment(REFERENCE_TIME inStartTime, REFERENCE_TIME inStopTime, double inRate);
-
-protected:
- //Implementation of pure virtuals from AbstractTransformInputPin
- virtual bool ConstructCodec();
- virtual void DestroyCodec();
- virtual HRESULT TransformData(unsigned char* inBuf, long inNumBytes);
-
- FishSound* mFishSound;
- FishSoundInfo mFishInfo;
-
- int mNumChannels;
- int mFrameSize;
- int mSampleRate;
- unsigned int mUptoFrame;
-
- bool mBegun;
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "speexdecoderdllstuff.h"
+#include "AbstractTransformInputPin.h"
+#include "SpeexDecodeInputPin.h"
+
+#include "SpeexDecodeFilter.h"
+
+extern "C" {
+//#include <fishsound/fishsound.h>
+#include "fish_cdecl.h"
+}
+
+class SpeexDecodeOutputPin;
+
+class SpeexDecodeInputPin
+ : public AbstractTransformInputPin
+{
+public:
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+ SpeexDecodeInputPin(AbstractTransformFilter* inFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes);
+ virtual ~SpeexDecodeInputPin(void);
+
+ static int __cdecl SpeexDecoded (FishSound* inFishSound, float** inPCM, long inFrames, void* inThisPointer);
+
+
+ virtual HRESULT SetMediaType(const CMediaType* inMediaType);
+ virtual STDMETHODIMP NewSegment(REFERENCE_TIME inStartTime, REFERENCE_TIME inStopTime, double inRate);
+
+protected:
+ //Implementation of pure virtuals from AbstractTransformInputPin
+ virtual bool ConstructCodec();
+ virtual void DestroyCodec();
+ virtual HRESULT TransformData(unsigned char* inBuf, long inNumBytes);
+
+ FishSound* mFishSound;
+ FishSoundInfo mFishInfo;
+
+ int mNumChannels;
+ int mFrameSize;
+ int mSampleRate;
+ unsigned int mUptoFrame;
+
+ bool mBegun;
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeInputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeOutputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeOutputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeOutputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,72 +1,72 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "speexdecodeoutputpin.h"
-
-SpeexDecodeOutputPin::SpeexDecodeOutputPin(SpeexDecodeFilter* inParentFilter, CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes)
- : AbstractTransformOutputPin(inParentFilter, inFilterLock,NAME("SpeexDecodeOutputPin"), L"PCM Out", 65536, 20, inAcceptableMediaTypes)
-{
-
-
-}
-SpeexDecodeOutputPin::~SpeexDecodeOutputPin(void)
-{
-
-
-}
-
-STDMETHODIMP SpeexDecodeOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
- if (riid == IID_IMediaSeeking) {
- *ppv = (IMediaSeeking*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- }
-
- return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
-}
-HRESULT SpeexDecodeOutputPin::CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition)
-{
- if (inPosition == 0) {
- WAVEFORMATEX* locWaveFormat = (WAVEFORMATEX*)outMediaType->AllocFormatBuffer(sizeof(WAVEFORMATEX));
- locWaveFormat->wFormatTag = WAVE_FORMAT_PCM;
- locWaveFormat->nChannels = ((SpeexDecodeFilter*)m_pFilter)->mSpeexFormatInfo->numChannels;
- locWaveFormat->nSamplesPerSec = ((SpeexDecodeFilter*)m_pFilter)->mSpeexFormatInfo->samplesPerSec;
- locWaveFormat->wBitsPerSample = 16;
- locWaveFormat->nBlockAlign = (locWaveFormat->nChannels) * (locWaveFormat->wBitsPerSample >> 3);
- locWaveFormat->nAvgBytesPerSec = ((locWaveFormat->nChannels) * (locWaveFormat->wBitsPerSample >> 3)) * locWaveFormat->nSamplesPerSec;
- locWaveFormat->cbSize = 0;
- return S_OK;
- } else {
- return S_FALSE;
- }
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "speexdecodeoutputpin.h"
+
+SpeexDecodeOutputPin::SpeexDecodeOutputPin(SpeexDecodeFilter* inParentFilter, CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes)
+ : AbstractTransformOutputPin(inParentFilter, inFilterLock,NAME("SpeexDecodeOutputPin"), L"PCM Out", 65536, 20, inAcceptableMediaTypes)
+{
+
+
+}
+SpeexDecodeOutputPin::~SpeexDecodeOutputPin(void)
+{
+
+
+}
+
+STDMETHODIMP SpeexDecodeOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+ if (riid == IID_IMediaSeeking) {
+ *ppv = (IMediaSeeking*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ }
+
+ return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
+}
+HRESULT SpeexDecodeOutputPin::CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition)
+{
+ if (inPosition == 0) {
+ WAVEFORMATEX* locWaveFormat = (WAVEFORMATEX*)outMediaType->AllocFormatBuffer(sizeof(WAVEFORMATEX));
+ locWaveFormat->wFormatTag = WAVE_FORMAT_PCM;
+ locWaveFormat->nChannels = ((SpeexDecodeFilter*)m_pFilter)->mSpeexFormatInfo->numChannels;
+ locWaveFormat->nSamplesPerSec = ((SpeexDecodeFilter*)m_pFilter)->mSpeexFormatInfo->samplesPerSec;
+ locWaveFormat->wBitsPerSample = 16;
+ locWaveFormat->nBlockAlign = (locWaveFormat->nChannels) * (locWaveFormat->wBitsPerSample >> 3);
+ locWaveFormat->nAvgBytesPerSec = ((locWaveFormat->nChannels) * (locWaveFormat->wBitsPerSample >> 3)) * locWaveFormat->nSamplesPerSec;
+ locWaveFormat->cbSize = 0;
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeOutputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeOutputPin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeOutputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeOutputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,57 +1,57 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "speexdecoderdllstuff.h"
-#include "AbstractTransformInputPin.h"
-
-
-class SpeexDecodeFilter;
-class SpeexDecodeOutputPin :
- public AbstractTransformOutputPin
-{
-public:
-
- friend class SpeexDecodeInputPin;
-
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- SpeexDecodeOutputPin(SpeexDecodeFilter* inParentFilter,CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes);
- virtual ~SpeexDecodeOutputPin(void);
-
- //virtual bool FillWaveFormatExBuffer(WAVEFORMATEX* inFormatBuffer);
-protected:
- virtual HRESULT CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition);
-
-};
-
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "speexdecoderdllstuff.h"
+#include "AbstractTransformInputPin.h"
+
+
+class SpeexDecodeFilter;
+class SpeexDecodeOutputPin :
+ public AbstractTransformOutputPin
+{
+public:
+
+ friend class SpeexDecodeInputPin;
+
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ SpeexDecodeOutputPin(SpeexDecodeFilter* inParentFilter,CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes);
+ virtual ~SpeexDecodeOutputPin(void);
+
+ //virtual bool FillWaveFormatExBuffer(WAVEFORMATEX* inFormatBuffer);
+protected:
+ virtual HRESULT CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition);
+
+};
+
+
Property changes on: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/SpeexDecodeOutputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/dsfSpeexDecoder.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/dsfSpeexDecoder.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/dsfSpeexDecoder.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,12 +1,12 @@
-// dsfSpeexDecoder.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- return TRUE;
-}
-
+// dsfSpeexDecoder.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ return TRUE;
+}
+
Property changes on: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/dsfSpeexDecoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/fish_cdecl.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/speexdecoderdllstuff.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/speexdecoderdllstuff.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/speexdecoderdllstuff.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,99 +1,99 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "speexdecoderdllstuff.h"
-
-extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
-BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
-{
- return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
-}
-
-
-//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
-STDAPI DllRegisterServer()
-{
-
-
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(TRUE);
-
-
-
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
-
-
- hr = locFilterMapper->RegisterFilter(
- CLSID_SpeexDecodeFilter, // Filter CLSID.
- L"Speex Decode Filter", // Filter name.
- NULL, // Device moniker.
- &CLSID_LegacyAmFilterCategory, // Direct Show general category
- L"Speex Decode Filter", // Instance data. ???????
- &SpeexDecodeFilterReg // Pointer to filter information.
- );
-
- locFilterMapper->Release();
-
- return hr;
-
-}
-
-STDAPI DllUnregisterServer()
-{
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(FALSE);
- if (FAILED(hr)) {
-
- return hr;
- }
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
- IID_IFilterMapper2, (void **)&locFilterMapper);
-
- if (FAILED(hr)) {
- return hr;
- }
-
-
- hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, L"Speex Decode Filter", CLSID_SpeexDecodeFilter);
-
-
- //
- locFilterMapper->Release();
- return hr;
-
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "speexdecoderdllstuff.h"
+
+extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
+BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+ return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
+}
+
+
+//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
+STDAPI DllRegisterServer()
+{
+
+
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(TRUE);
+
+
+
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
+
+
+ hr = locFilterMapper->RegisterFilter(
+ CLSID_SpeexDecodeFilter, // Filter CLSID.
+ L"Speex Decode Filter", // Filter name.
+ NULL, // Device moniker.
+ &CLSID_LegacyAmFilterCategory, // Direct Show general category
+ L"Speex Decode Filter", // Instance data. ???????
+ &SpeexDecodeFilterReg // Pointer to filter information.
+ );
+
+ locFilterMapper->Release();
+
+ return hr;
+
+}
+
+STDAPI DllUnregisterServer()
+{
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(FALSE);
+ if (FAILED(hr)) {
+
+ return hr;
+ }
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
+ IID_IFilterMapper2, (void **)&locFilterMapper);
+
+ if (FAILED(hr)) {
+ return hr;
+ }
+
+
+ hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, L"Speex Decode Filter", CLSID_SpeexDecodeFilter);
+
+
+ //
+ locFilterMapper->Release();
+ return hr;
+
+}
Property changes on: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/speexdecoderdllstuff.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/speexdecoderdllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/speexdecoderdllstuff.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/speexdecoderdllstuff.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,119 +1,119 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-//#include <streams.h>
-//#include <pullpin.h>
-//#include <initguid.h>
-
-//#ifdef DSFABSTRACOGGAUDIODECODER_EXPORTS
-//#pragma message("----> Exporting from Abstract Library...")
-//#define ABS_AUDIO_DEC_API __declspec(dllexport)
-//#else
-//#pragma message("<---- Importing from Abstract Library...")
-//#define ABS_AUDIO_DEC_API __declspec(dllimport)
-//#endif
-
-#ifdef LIBOOOGG_EXPORTS
-#define LIBOOOGG_API __declspec(dllexport)
-#else
-#define LIBOOOGG_API __declspec(dllimport)
-#endif
-
-// {7605E26C-DE38-4b82-ADD8-FE2568CC0B25}
-DEFINE_GUID(CLSID_SpeexDecodeFilter,
-0x7605e26c, 0xde38, 0x4b82, 0xad, 0xd8, 0xfe, 0x25, 0x68, 0xcc, 0xb, 0x25);
-
-// {25A9729D-12F6-420e-BD53-1D631DC217DF}
-DEFINE_GUID(MEDIASUBTYPE_Speex,
-0x25a9729d, 0x12f6, 0x420e, 0xbd, 0x53, 0x1d, 0x63, 0x1d, 0xc2, 0x17, 0xdf);
-
-// {78701A27-EFB5-4157-9553-38A7854E3E81}
-DEFINE_GUID(FORMAT_Speex,
-0x78701a27, 0xefb5, 0x4157, 0x95, 0x53, 0x38, 0xa7, 0x85, 0x4e, 0x3e, 0x81);
-//This structure defines the type of input we accept on the input pin... Stream/Annodex
-
-const REGPINTYPES SpeexDecodeOutputTypes = {
- &MEDIATYPE_Audio,
- &MEDIASUBTYPE_PCM
-};
-
-const REGPINTYPES SpeexDecodeInputTypes = {
- &MEDIATYPE_Audio,
- &MEDIASUBTYPE_Speex
-};
-const REGFILTERPINS SpeexDecodePinReg[] = {
- {
- L"Speex Input", //Name (obsoleted)
- FALSE, //Renders from this pin ?? Not sure about this.
- FALSE, //Not an output pin
- FALSE, //Cannot have zero instances of this pin
- FALSE, //Cannot have more than one instance of this pin
- NULL, //Connects to filter (obsoleted)
- NULL, //Connects to pin (obsoleted)
- 1, //upport two media type
- &SpeexDecodeInputTypes //Pointer to media type (Audio/Vorbis or Audio/Speex)
- } ,
-
- {
- L"PCM Output", //Name (obsoleted)
- FALSE, //Renders from this pin ?? Not sure about this.
- TRUE, //Is an output pin
- FALSE, //Cannot have zero instances of this pin
- FALSE, //Cannot have more than one instance of this pin
- NULL, //Connects to filter (obsoleted)
- NULL, //Connects to pin (obsoleted)
- 1, //Only support one media type
- &SpeexDecodeOutputTypes //Pointer to media type (Audio/PCM)
-
- }
-};
-
-
-
-const REGFILTER2 SpeexDecodeFilterReg = {
- 1,
- MERIT_NORMAL,
- 2,
- SpeexDecodePinReg
-
-};
-
-
-struct sSpeexFormatBlock {
- unsigned long speexVersion;
- unsigned long samplesPerSec;
- unsigned long minBitsPerSec;
- unsigned long avgBitsPerSec;
- unsigned long maxBitsPerSec;
- unsigned long numChannels;
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+//#include <streams.h>
+//#include <pullpin.h>
+//#include <initguid.h>
+
+//#ifdef DSFABSTRACOGGAUDIODECODER_EXPORTS
+//#pragma message("----> Exporting from Abstract Library...")
+//#define ABS_AUDIO_DEC_API __declspec(dllexport)
+//#else
+//#pragma message("<---- Importing from Abstract Library...")
+//#define ABS_AUDIO_DEC_API __declspec(dllimport)
+//#endif
+
+#ifdef LIBOOOGG_EXPORTS
+#define LIBOOOGG_API __declspec(dllexport)
+#else
+#define LIBOOOGG_API __declspec(dllimport)
+#endif
+
+// {7605E26C-DE38-4b82-ADD8-FE2568CC0B25}
+DEFINE_GUID(CLSID_SpeexDecodeFilter,
+0x7605e26c, 0xde38, 0x4b82, 0xad, 0xd8, 0xfe, 0x25, 0x68, 0xcc, 0xb, 0x25);
+
+// {25A9729D-12F6-420e-BD53-1D631DC217DF}
+DEFINE_GUID(MEDIASUBTYPE_Speex,
+0x25a9729d, 0x12f6, 0x420e, 0xbd, 0x53, 0x1d, 0x63, 0x1d, 0xc2, 0x17, 0xdf);
+
+// {78701A27-EFB5-4157-9553-38A7854E3E81}
+DEFINE_GUID(FORMAT_Speex,
+0x78701a27, 0xefb5, 0x4157, 0x95, 0x53, 0x38, 0xa7, 0x85, 0x4e, 0x3e, 0x81);
+//This structure defines the type of input we accept on the input pin... Stream/Annodex
+
+const REGPINTYPES SpeexDecodeOutputTypes = {
+ &MEDIATYPE_Audio,
+ &MEDIASUBTYPE_PCM
+};
+
+const REGPINTYPES SpeexDecodeInputTypes = {
+ &MEDIATYPE_Audio,
+ &MEDIASUBTYPE_Speex
+};
+const REGFILTERPINS SpeexDecodePinReg[] = {
+ {
+ L"Speex Input", //Name (obsoleted)
+ FALSE, //Renders from this pin ?? Not sure about this.
+ FALSE, //Not an output pin
+ FALSE, //Cannot have zero instances of this pin
+ FALSE, //Cannot have more than one instance of this pin
+ NULL, //Connects to filter (obsoleted)
+ NULL, //Connects to pin (obsoleted)
+ 1, //upport two media type
+ &SpeexDecodeInputTypes //Pointer to media type (Audio/Vorbis or Audio/Speex)
+ } ,
+
+ {
+ L"PCM Output", //Name (obsoleted)
+ FALSE, //Renders from this pin ?? Not sure about this.
+ TRUE, //Is an output pin
+ FALSE, //Cannot have zero instances of this pin
+ FALSE, //Cannot have more than one instance of this pin
+ NULL, //Connects to filter (obsoleted)
+ NULL, //Connects to pin (obsoleted)
+ 1, //Only support one media type
+ &SpeexDecodeOutputTypes //Pointer to media type (Audio/PCM)
+
+ }
+};
+
+
+
+const REGFILTER2 SpeexDecodeFilterReg = {
+ 1,
+ MERIT_NORMAL,
+ 2,
+ SpeexDecodePinReg
+
+};
+
+
+struct sSpeexFormatBlock {
+ unsigned long speexVersion;
+ unsigned long samplesPerSec;
+ unsigned long minBitsPerSec;
+ unsigned long avgBitsPerSec;
+ unsigned long maxBitsPerSec;
+ unsigned long numChannels;
+
};
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/speexdecoderdllstuff.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,39 +1,39 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.cpp : source file that includes just the standard includes
-// dsfSpeexDecoder.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.cpp : source file that includes just the standard includes
+// dsfSpeexDecoder.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,50 +1,50 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-// TODO: reference additional headers your program requires here
-
-#include "AbstractTransformFilter.h"
-#include "AbstractTransformInputPin.h"
-#include "AbstractTransformOutputPin.h"
-#include "SpeexDecodeInputPin.h"
-#include "SpeexDecodeOutputPin.h"
-#include "SpeexDecodeFilter.h"
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+// TODO: reference additional headers your program requires here
+
+#include "AbstractTransformFilter.h"
+#include "AbstractTransformInputPin.h"
+#include "AbstractTransformOutputPin.h"
+#include "SpeexDecodeInputPin.h"
+#include "SpeexDecodeOutputPin.h"
+#include "SpeexDecodeFilter.h"
Property changes on: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexDecoder/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeFilter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeFilter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,106 +1,106 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-
-
-#include "SpeexEncodeFilter.h"
-
-
-//COM Factory Template
-CFactoryTemplate g_Templates[] =
-{
- {
- L"Speex Encode Filter", // Name
- &CLSID_SpeexEncodeFilter, // CLSID
- SpeexEncodeFilter::CreateInstance, // Method to create an instance of MyComponent
- NULL, // Initialization function
- NULL // Set-up information (for filters)
- }
-
-};
-
-// Generic way of determining the number of items in the template
-int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
-
-CUnknown* WINAPI SpeexEncodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
-{
- //This routine is the COM implementation to create a new Filter
- SpeexEncodeFilter *pNewObject = new SpeexEncodeFilter();
- if (pNewObject == NULL) {
- *pHr = E_OUTOFMEMORY;
- }
- return pNewObject;
-}
-
-SpeexEncodeFilter::SpeexEncodeFilter(void)
- : AbstractTransformFilter(NAME("Speex Encoder"), CLSID_SpeexEncodeFilter)
-{
- bool locWasConstructed = ConstructPins();
-}
-
-SpeexEncodeFilter::~SpeexEncodeFilter(void)
-{
-}
-
-bool SpeexEncodeFilter::ConstructPins()
-{
- //Inputs Audio / PCM / WaveFormatEx
- //Outputs Audio / Speex / Speex
-
- //Vector to hold our set of media types we want to accept.
- vector<CMediaType*> locAcceptableTypes;
-
- //Setup the media types for the output pin.
- CMediaType* locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted in pin destructor
- locAcceptMediaType->subtype = MEDIASUBTYPE_Speex;
- locAcceptMediaType->formattype = FORMAT_Speex;
-
- locAcceptableTypes.push_back(locAcceptMediaType);
-
- //Output pin must be done first because it's passed to the input pin.
- mOutputPin = new SpeexEncodeOutputPin(this, m_pLock, locAcceptableTypes); //Deleted in base class destructor
-
- //Clear out the vector, now we've already passed it to the output pin.
- locAcceptableTypes.clear();
-
- //Setup the media Types for the input pin.
- locAcceptMediaType = NULL;
- locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted by pin
-
- locAcceptMediaType->subtype = MEDIASUBTYPE_PCM;
- locAcceptMediaType->formattype = FORMAT_WaveFormatEx;
-
- locAcceptableTypes.push_back(locAcceptMediaType);
-
- mInputPin = new SpeexEncodeInputPin(this, m_pLock, mOutputPin, locAcceptableTypes); //Deleted in base class filter destructor.
- return true;
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+
+
+#include "SpeexEncodeFilter.h"
+
+
+//COM Factory Template
+CFactoryTemplate g_Templates[] =
+{
+ {
+ L"Speex Encode Filter", // Name
+ &CLSID_SpeexEncodeFilter, // CLSID
+ SpeexEncodeFilter::CreateInstance, // Method to create an instance of MyComponent
+ NULL, // Initialization function
+ NULL // Set-up information (for filters)
+ }
+
+};
+
+// Generic way of determining the number of items in the template
+int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
+
+CUnknown* WINAPI SpeexEncodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
+{
+ //This routine is the COM implementation to create a new Filter
+ SpeexEncodeFilter *pNewObject = new SpeexEncodeFilter();
+ if (pNewObject == NULL) {
+ *pHr = E_OUTOFMEMORY;
+ }
+ return pNewObject;
+}
+
+SpeexEncodeFilter::SpeexEncodeFilter(void)
+ : AbstractTransformFilter(NAME("Speex Encoder"), CLSID_SpeexEncodeFilter)
+{
+ bool locWasConstructed = ConstructPins();
+}
+
+SpeexEncodeFilter::~SpeexEncodeFilter(void)
+{
+}
+
+bool SpeexEncodeFilter::ConstructPins()
+{
+ //Inputs Audio / PCM / WaveFormatEx
+ //Outputs Audio / Speex / Speex
+
+ //Vector to hold our set of media types we want to accept.
+ vector<CMediaType*> locAcceptableTypes;
+
+ //Setup the media types for the output pin.
+ CMediaType* locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted in pin destructor
+ locAcceptMediaType->subtype = MEDIASUBTYPE_Speex;
+ locAcceptMediaType->formattype = FORMAT_Speex;
+
+ locAcceptableTypes.push_back(locAcceptMediaType);
+
+ //Output pin must be done first because it's passed to the input pin.
+ mOutputPin = new SpeexEncodeOutputPin(this, m_pLock, locAcceptableTypes); //Deleted in base class destructor
+
+ //Clear out the vector, now we've already passed it to the output pin.
+ locAcceptableTypes.clear();
+
+ //Setup the media Types for the input pin.
+ locAcceptMediaType = NULL;
+ locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted by pin
+
+ locAcceptMediaType->subtype = MEDIASUBTYPE_PCM;
+ locAcceptMediaType->formattype = FORMAT_WaveFormatEx;
+
+ locAcceptableTypes.push_back(locAcceptMediaType);
+
+ mInputPin = new SpeexEncodeInputPin(this, m_pLock, mOutputPin, locAcceptableTypes); //Deleted in base class filter destructor.
+ return true;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeFilter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeFilter.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeFilter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeFilter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,69 +1,69 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-//Local Includes
-#include "speexencoderdllstuff.h"
-
-//External Includes
-#include "AbstractTransformFilter.h"
-
-//Forward Declarations
-struct sSpeexFormatBlock;
-class SpeexEncodeInputPin;
-class SpeexEncodeOutputPin;
-
-class SpeexEncodeFilter
- //Base Classes
- : public AbstractTransformFilter
-{
-public:
- //Friend Classes
- friend class SpeexEncodeOutputPin;
- friend class SpeexEncodeInputPin;
-
- //Constructors
- SpeexEncodeFilter(void);
- virtual ~SpeexEncodeFilter(void);
-
- //COM Creator function
- static CUnknown* WINAPI SpeexEncodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
-
-
-protected:
- //Implementation of pure virtual from AbstractTransformFilter.
- virtual bool ConstructPins();
-
- //Member data
- sSpeexFormatBlock mSpeexFormatBlock;
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+//Local Includes
+#include "speexencoderdllstuff.h"
+
+//External Includes
+#include "AbstractTransformFilter.h"
+
+//Forward Declarations
+struct sSpeexFormatBlock;
+class SpeexEncodeInputPin;
+class SpeexEncodeOutputPin;
+
+class SpeexEncodeFilter
+ //Base Classes
+ : public AbstractTransformFilter
+{
+public:
+ //Friend Classes
+ friend class SpeexEncodeOutputPin;
+ friend class SpeexEncodeInputPin;
+
+ //Constructors
+ SpeexEncodeFilter(void);
+ virtual ~SpeexEncodeFilter(void);
+
+ //COM Creator function
+ static CUnknown* WINAPI SpeexEncodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+
+
+protected:
+ //Implementation of pure virtual from AbstractTransformFilter.
+ virtual bool ConstructPins();
+
+ //Member data
+ sSpeexFormatBlock mSpeexFormatBlock;
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeFilter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeInputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeInputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,199 +1,199 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "SpeexEncodeInputPin.h"
-
-SpeexEncodeInputPin::SpeexEncodeInputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes)
- : AbstractTransformInputPin(inParentFilter, inFilterLock, inOutputPin, NAME("SpeexEncodeInputPin"), L"PCM In", inAcceptableMediaTypes)
- , mFishSound(NULL)
- , mWaveFormat(NULL)
-
- , mUptoFrame(0)
-{
- //debugLog.open("C:\\temp\\speexenc.log", ios_base::out);
-}
-
-SpeexEncodeInputPin::~SpeexEncodeInputPin(void)
-{
- //debugLog.close();
- DestroyCodec();
-}
-
-
-//PURE VIRTUALS
-HRESULT SpeexEncodeInputPin::TransformData(unsigned char* inBuf, long inNumBytes) {
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "SpeexEncodeInputPin.h"
+
+SpeexEncodeInputPin::SpeexEncodeInputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes)
+ : AbstractTransformInputPin(inParentFilter, inFilterLock, inOutputPin, NAME("SpeexEncodeInputPin"), L"PCM In", inAcceptableMediaTypes)
+ , mFishSound(NULL)
+ , mWaveFormat(NULL)
+
+ , mUptoFrame(0)
+{
+ //debugLog.open("C:\\temp\\speexenc.log", ios_base::out);
+}
+
+SpeexEncodeInputPin::~SpeexEncodeInputPin(void)
+{
+ //debugLog.close();
+ DestroyCodec();
+}
+
+
+//PURE VIRTUALS
+HRESULT SpeexEncodeInputPin::TransformData(unsigned char* inBuf, long inNumBytes) {
+
//TODO::: There is a problem when we get 8 bit samples.
//=====================================================
- //debugLog << "encodeData receives : "<<inNumBytes<<" bytes"<<endl;
-
-
- //************************************ Check this line... the +(inNumBytes%2) is new
- //Note the 2 is because a float is twice the width of a short.
- float* locFloatBuf = new float[inNumBytes/2]; // + (inNumBytes % 2)];
- //************************************
- short locTempShort = 0;
- float locTempFloat = 0;
-
-
- for (int i = 0; i < inNumBytes; i += 2) {
- locTempShort = *((short*)(inBuf + i));
- locTempFloat = (float)locTempShort;
- locTempFloat /= 32767.0;
- locFloatBuf[i/2] = locTempFloat;;
- }
- //debugLog<<"Calling encode"<<endl;
- //FIX::: The 2 is the size of a sample ie 16 bits
- long locErr = fish_sound_encode(mFishSound, (float**)locFloatBuf, inNumBytes/(mFishInfo.channels*2));
- delete[] locFloatBuf;
- //FIX::: Do something here ?
- if (locErr < 0) {
- //debugLog<<"Fishsound reports error"<<endl;
- } else {
-
- }
- return S_OK;
-}
-bool SpeexEncodeInputPin::ConstructCodec() {
- mFishInfo.channels = mWaveFormat->nChannels;
- mFishInfo.format = FISH_SOUND_SPEEX;
- mFishInfo.samplerate = mWaveFormat->nSamplesPerSec;
-
- //Change to fill in vorbis format block so muxer can work
- ((SpeexEncodeFilter*)mParentFilter)->mSpeexFormatBlock.numChannels = mWaveFormat->nChannels;
- ((SpeexEncodeFilter*)mParentFilter)->mSpeexFormatBlock.samplesPerSec = mWaveFormat->nSamplesPerSec;
-
- //
-
- mFishSound = fish_sound_new (FISH_SOUND_ENCODE, &mFishInfo);
-
- int i = 1;
- //FIX::: Use new API for interleave setting
- fish_sound_command(mFishSound, FISH_SOUND_SET_INTERLEAVE, &i, sizeof(int));
-
- fish_sound_set_encoded_callback (mFishSound, SpeexEncodeInputPin::SpeexEncoded, this);
- //FIX::: Proper return value
- return true;
-
-}
-void SpeexEncodeInputPin::DestroyCodec() {
- fish_sound_delete(mFishSound);
- mFishSound = NULL;
-}
-
-
-//Encoded callback
-int SpeexEncodeInputPin::SpeexEncoded (FishSound* inFishSound, unsigned char* inPacketData, long inNumBytes, void* inThisPointer)
-{
-
-
- SpeexEncodeInputPin* locThis = reinterpret_cast<SpeexEncodeInputPin*> (inThisPointer);
- SpeexEncodeFilter* locFilter = reinterpret_cast<SpeexEncodeFilter*>(locThis->m_pFilter);
- //locThis->debugLog << "SpeexEncoded called with "<<inNumBytes<< " byte of data"<<endl;
-
- //Time stamps are granule pos not directshow times
- LONGLONG locFrameStart = locThis->mUptoFrame;
- LONGLONG locFrameEnd = locThis->mUptoFrame
- = fish_sound_get_frameno(locThis->mFishSound);
-
-
- //locThis->debugLog << "Stamping packet "<<locFrameStart<< " to "<<locFrameEnd<<endl;
- //Get a pointer to a new sample stamped with our time
- IMediaSample* locSample;
- HRESULT locHR = locThis->mOutputPin->GetDeliveryBuffer(&locSample, &locFrameStart, &locFrameEnd, NULL);
-
- if (FAILED(locHR)) {
- //We get here when the application goes into stop mode usually.
- //locThis->debugLog<<"Getting buffer failed"<<endl;
- return locHR;
- }
-
- BYTE* locBuffer = NULL;
-
-
- //Make our pointers set to point to the samples buffer
- locSample->GetPointer(&locBuffer);
-
-
-
- if (locSample->GetSize() >= inNumBytes) {
-
- memcpy((void*)locBuffer, (const void*)inPacketData, inNumBytes);
-
- //Set the sample parameters.
- locThis->SetSampleParams(locSample, inNumBytes, &locFrameStart, &locFrameEnd);
-
- {
- CAutoLock locLock(locThis->m_pLock);
-
- //Add a reference so it isn't deleted en route.
- //locSample->AddRef();
- //NO - It alrady has a ref on it.
-
- //TODO::: Need to propagate error states.
- HRESULT locHR = ((SpeexEncodeOutputPin*)(locThis->mOutputPin))->mDataQueue->Receive(locSample); //->DownstreamFilter()->Receive(locSample);
- if (locHR != S_OK) {
- //locThis->debugLog<<"Sample rejected"<<endl;
- } else {
- //locThis->debugLog<<"Sample Delivered"<<endl;
- }
- }
-
- return 0;
- } else {
- throw 0;
- }
-}
-
-
-HRESULT SpeexEncodeInputPin::SetMediaType(const CMediaType* inMediaType)
-{
-
- if ( (inMediaType->subtype == MEDIASUBTYPE_PCM) &&
- (inMediaType->formattype == FORMAT_WaveFormatEx)) {
-
- mWaveFormat = (WAVEFORMATEX*)inMediaType->pbFormat;
-
- } else {
- //Failed... should never be here !
- throw 0;
- }
- //This is here and not the constructor because we need audio params from the
- // input pin to construct properly.
-
- ConstructCodec();
-
- return CBaseInputPin::SetMediaType(inMediaType);
-
-
-
+ //debugLog << "encodeData receives : "<<inNumBytes<<" bytes"<<endl;
+
+
+ //************************************ Check this line... the +(inNumBytes%2) is new
+ //Note the 2 is because a float is twice the width of a short.
+ float* locFloatBuf = new float[inNumBytes/2]; // + (inNumBytes % 2)];
+ //************************************
+ short locTempShort = 0;
+ float locTempFloat = 0;
+
+
+ for (int i = 0; i < inNumBytes; i += 2) {
+ locTempShort = *((short*)(inBuf + i));
+ locTempFloat = (float)locTempShort;
+ locTempFloat /= 32767.0;
+ locFloatBuf[i/2] = locTempFloat;;
+ }
+ //debugLog<<"Calling encode"<<endl;
+ //FIX::: The 2 is the size of a sample ie 16 bits
+ long locErr = fish_sound_encode(mFishSound, (float**)locFloatBuf, inNumBytes/(mFishInfo.channels*2));
+ delete[] locFloatBuf;
+ //FIX::: Do something here ?
+ if (locErr < 0) {
+ //debugLog<<"Fishsound reports error"<<endl;
+ } else {
+
+ }
+ return S_OK;
+}
+bool SpeexEncodeInputPin::ConstructCodec() {
+ mFishInfo.channels = mWaveFormat->nChannels;
+ mFishInfo.format = FISH_SOUND_SPEEX;
+ mFishInfo.samplerate = mWaveFormat->nSamplesPerSec;
+
+ //Change to fill in vorbis format block so muxer can work
+ ((SpeexEncodeFilter*)mParentFilter)->mSpeexFormatBlock.numChannels = mWaveFormat->nChannels;
+ ((SpeexEncodeFilter*)mParentFilter)->mSpeexFormatBlock.samplesPerSec = mWaveFormat->nSamplesPerSec;
+
+ //
+
+ mFishSound = fish_sound_new (FISH_SOUND_ENCODE, &mFishInfo);
+
+ int i = 1;
+ //FIX::: Use new API for interleave setting
+ fish_sound_command(mFishSound, FISH_SOUND_SET_INTERLEAVE, &i, sizeof(int));
+
+ fish_sound_set_encoded_callback (mFishSound, SpeexEncodeInputPin::SpeexEncoded, this);
+ //FIX::: Proper return value
+ return true;
+
+}
+void SpeexEncodeInputPin::DestroyCodec() {
+ fish_sound_delete(mFishSound);
+ mFishSound = NULL;
+}
+
+
+//Encoded callback
+int SpeexEncodeInputPin::SpeexEncoded (FishSound* inFishSound, unsigned char* inPacketData, long inNumBytes, void* inThisPointer)
+{
+
+
+ SpeexEncodeInputPin* locThis = reinterpret_cast<SpeexEncodeInputPin*> (inThisPointer);
+ SpeexEncodeFilter* locFilter = reinterpret_cast<SpeexEncodeFilter*>(locThis->m_pFilter);
+ //locThis->debugLog << "SpeexEncoded called with "<<inNumBytes<< " byte of data"<<endl;
+
+ //Time stamps are granule pos not directshow times
+ LONGLONG locFrameStart = locThis->mUptoFrame;
+ LONGLONG locFrameEnd = locThis->mUptoFrame
+ = fish_sound_get_frameno(locThis->mFishSound);
+
+
+ //locThis->debugLog << "Stamping packet "<<locFrameStart<< " to "<<locFrameEnd<<endl;
+ //Get a pointer to a new sample stamped with our time
+ IMediaSample* locSample;
+ HRESULT locHR = locThis->mOutputPin->GetDeliveryBuffer(&locSample, &locFrameStart, &locFrameEnd, NULL);
+
+ if (FAILED(locHR)) {
+ //We get here when the application goes into stop mode usually.
+ //locThis->debugLog<<"Getting buffer failed"<<endl;
+ return locHR;
+ }
+
+ BYTE* locBuffer = NULL;
+
+
+ //Make our pointers set to point to the samples buffer
+ locSample->GetPointer(&locBuffer);
+
+
+
+ if (locSample->GetSize() >= inNumBytes) {
+
+ memcpy((void*)locBuffer, (const void*)inPacketData, inNumBytes);
+
+ //Set the sample parameters.
+ locThis->SetSampleParams(locSample, inNumBytes, &locFrameStart, &locFrameEnd);
+
+ {
+ CAutoLock locLock(locThis->m_pLock);
+
+ //Add a reference so it isn't deleted en route.
+ //locSample->AddRef();
+ //NO - It alrady has a ref on it.
+
+ //TODO::: Need to propagate error states.
+ HRESULT locHR = ((SpeexEncodeOutputPin*)(locThis->mOutputPin))->mDataQueue->Receive(locSample); //->DownstreamFilter()->Receive(locSample);
+ if (locHR != S_OK) {
+ //locThis->debugLog<<"Sample rejected"<<endl;
+ } else {
+ //locThis->debugLog<<"Sample Delivered"<<endl;
+ }
+ }
+
+ return 0;
+ } else {
+ throw 0;
+ }
+}
+
+
+HRESULT SpeexEncodeInputPin::SetMediaType(const CMediaType* inMediaType)
+{
+
+ if ( (inMediaType->subtype == MEDIASUBTYPE_PCM) &&
+ (inMediaType->formattype == FORMAT_WaveFormatEx)) {
+
+ mWaveFormat = (WAVEFORMATEX*)inMediaType->pbFormat;
+
+ } else {
+ //Failed... should never be here !
+ throw 0;
+ }
+ //This is here and not the constructor because we need audio params from the
+ // input pin to construct properly.
+
+ ConstructCodec();
+
+ return CBaseInputPin::SetMediaType(inMediaType);
+
+
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeInputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeInputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeInputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,74 +1,74 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-
-#include "AbstractTransformInputPin.h"
-#include "SpeexEncodeInputPin.h"
-
-#include "SpeexEncodeFilter.h"
-
-extern "C" {
-//#include <fishsound/fishsound.h>
-#include "fish_cdecl.h"
-}
-
-//#include <fstream>
-//using namespace std;
-class SpeexEncodeInputPin
- : public AbstractTransformInputPin
-{
-public:
- SpeexEncodeInputPin(AbstractTransformFilter* inFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes);
- virtual ~SpeexEncodeInputPin(void);
-
- static int __cdecl SpeexEncodeInputPin::SpeexEncoded (FishSound* inFishSound, unsigned char* inPacketData, long inNumBytes, void* inThisPointer) ;
-
- virtual HRESULT SetMediaType(const CMediaType* inMediaType);
-
-protected:
- HRESULT mHR;
-//PURE VIRTUALS
- virtual HRESULT TransformData(unsigned char* inBuf, long inNumBytes);
- virtual bool ConstructCodec();
- virtual void DestroyCodec();
-
-
- WAVEFORMATEX* mWaveFormat;
- __int64 mUptoFrame;
-
- //fstream debugLog;
- FishSound* mFishSound;
- FishSoundInfo mFishInfo;
-
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+
+#include "AbstractTransformInputPin.h"
+#include "SpeexEncodeInputPin.h"
+
+#include "SpeexEncodeFilter.h"
+
+extern "C" {
+//#include <fishsound/fishsound.h>
+#include "fish_cdecl.h"
+}
+
+//#include <fstream>
+//using namespace std;
+class SpeexEncodeInputPin
+ : public AbstractTransformInputPin
+{
+public:
+ SpeexEncodeInputPin(AbstractTransformFilter* inFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes);
+ virtual ~SpeexEncodeInputPin(void);
+
+ static int __cdecl SpeexEncodeInputPin::SpeexEncoded (FishSound* inFishSound, unsigned char* inPacketData, long inNumBytes, void* inThisPointer) ;
+
+ virtual HRESULT SetMediaType(const CMediaType* inMediaType);
+
+protected:
+ HRESULT mHR;
+//PURE VIRTUALS
+ virtual HRESULT TransformData(unsigned char* inBuf, long inNumBytes);
+ virtual bool ConstructCodec();
+ virtual void DestroyCodec();
+
+
+ WAVEFORMATEX* mWaveFormat;
+ __int64 mUptoFrame;
+
+ //fstream debugLog;
+ FishSound* mFishSound;
+ FishSoundInfo mFishInfo;
+
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeInputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeOutputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeOutputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeOutputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,63 +1,63 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "Speexencodeoutputpin.h"
-
-SpeexEncodeOutputPin::SpeexEncodeOutputPin(SpeexEncodeFilter* inParentFilter,CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes)
- : AbstractTransformOutputPin(inParentFilter, inFilterLock,NAME("SpeexDecodeOutputPin"), L"Speex Out", 65536, 5, inAcceptableMediaTypes)
-{
-}
-
-SpeexEncodeOutputPin::~SpeexEncodeOutputPin(void)
-{
-}
-
-HRESULT SpeexEncodeOutputPin::CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition)
-{
- if (inPosition == 0) {
- sSpeexFormatBlock* locSpeexFormat = (sSpeexFormatBlock*)outMediaType->AllocFormatBuffer(sizeof(sSpeexFormatBlock));
- //TODO::: Check for null ?
-
- memcpy((void*)locSpeexFormat, (const void*) &(((SpeexEncodeFilter*)mParentFilter)->mSpeexFormatBlock), sizeof(sSpeexFormatBlock));
- return S_OK;
- } else {
- return S_FALSE;
- }
-}
-//bool SpeexEncodeOutputPin::FillFormatBuffer(BYTE* inFormatBuffer) {
-// SpeexEncodeFilter* locParentFilter = (SpeexEncodeFilter*)mParentFilter;
-// memcpy((void*)inFormatBuffer, (const void*) &(locParentFilter->mSpeexFormatBlock), sizeof(sSpeexFormatBlock));
-// return true;
-//}
-//unsigned long SpeexEncodeOutputPin::FormatBufferSize() {
-// return sizeof(sSpeexFormatBlock);
-//}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "Speexencodeoutputpin.h"
+
+SpeexEncodeOutputPin::SpeexEncodeOutputPin(SpeexEncodeFilter* inParentFilter,CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes)
+ : AbstractTransformOutputPin(inParentFilter, inFilterLock,NAME("SpeexDecodeOutputPin"), L"Speex Out", 65536, 5, inAcceptableMediaTypes)
+{
+}
+
+SpeexEncodeOutputPin::~SpeexEncodeOutputPin(void)
+{
+}
+
+HRESULT SpeexEncodeOutputPin::CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition)
+{
+ if (inPosition == 0) {
+ sSpeexFormatBlock* locSpeexFormat = (sSpeexFormatBlock*)outMediaType->AllocFormatBuffer(sizeof(sSpeexFormatBlock));
+ //TODO::: Check for null ?
+
+ memcpy((void*)locSpeexFormat, (const void*) &(((SpeexEncodeFilter*)mParentFilter)->mSpeexFormatBlock), sizeof(sSpeexFormatBlock));
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
+}
+//bool SpeexEncodeOutputPin::FillFormatBuffer(BYTE* inFormatBuffer) {
+// SpeexEncodeFilter* locParentFilter = (SpeexEncodeFilter*)mParentFilter;
+// memcpy((void*)inFormatBuffer, (const void*) &(locParentFilter->mSpeexFormatBlock), sizeof(sSpeexFormatBlock));
+// return true;
+//}
+//unsigned long SpeexEncodeOutputPin::FormatBufferSize() {
+// return sizeof(sSpeexFormatBlock);
+//}
Property changes on: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeOutputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeOutputPin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeOutputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeOutputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,58 +1,58 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-//Local Includes
-#include "Speexencoderdllstuff.h"
-
-//External Includes
-#include "AbstractTransformOutputPin.h"
-
-//Forward Declarations
-class SpeexEncodeFilter;
-struct sSpeexFormatBlock;
-
-class SpeexEncodeOutputPin
- //Base Classes
- : public AbstractTransformOutputPin
-{
-public:
- //Friend Classes
- friend class SpeexEncodeInputPin;
-
- //Constructors
- SpeexEncodeOutputPin(SpeexEncodeFilter* inParentFilter, CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes);
- virtual ~SpeexEncodeOutputPin(void);
-
-protected:
- virtual HRESULT CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition);
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+//Local Includes
+#include "Speexencoderdllstuff.h"
+
+//External Includes
+#include "AbstractTransformOutputPin.h"
+
+//Forward Declarations
+class SpeexEncodeFilter;
+struct sSpeexFormatBlock;
+
+class SpeexEncodeOutputPin
+ //Base Classes
+ : public AbstractTransformOutputPin
+{
+public:
+ //Friend Classes
+ friend class SpeexEncodeInputPin;
+
+ //Constructors
+ SpeexEncodeOutputPin(SpeexEncodeFilter* inParentFilter, CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes);
+ virtual ~SpeexEncodeOutputPin(void);
+
+protected:
+ virtual HRESULT CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition);
+};
Property changes on: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/SpeexEncodeOutputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/dsfSpeexEncoder.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/dsfSpeexEncoder.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/dsfSpeexEncoder.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,3 +1,3 @@
-// dsfSpeexEncoder.cpp : Defines the entry point for the DLL application.
-//
-
+// dsfSpeexEncoder.cpp : Defines the entry point for the DLL application.
+//
+
Property changes on: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/dsfSpeexEncoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/fish_cdecl.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/speexencoderdllstuff.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/speexencoderdllstuff.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/speexencoderdllstuff.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,98 +1,98 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "Speexencoderdllstuff.h"
-
-extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
-BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
-{
- return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
-}
-
-
-//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
-STDAPI DllRegisterServer()
-{
-
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(TRUE);
-
-
-
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
-
-
- hr = locFilterMapper->RegisterFilter(
- CLSID_SpeexEncodeFilter, // Filter CLSID.
- L"Speex Encode Filter", // Filter name.
- NULL, // Device moniker.
- &CLSID_LegacyAmFilterCategory, // Direct Show general category
- L"Speex Encode Filter", // Instance data. ???????
- &SpeexEncodeFilterReg // Pointer to filter information.
- );
-
- locFilterMapper->Release();
-
- return hr;
-
-}
-
-STDAPI DllUnregisterServer()
-{
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(FALSE);
- if (FAILED(hr)) {
-
- return hr;
- }
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
- IID_IFilterMapper2, (void **)&locFilterMapper);
-
- if (FAILED(hr)) {
- return hr;
- }
-
-
- hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, L"Speex Encode Filter", CLSID_SpeexEncodeFilter);
-
-
- //
- locFilterMapper->Release();
- return hr;
-
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "Speexencoderdllstuff.h"
+
+extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
+BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+ return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
+}
+
+
+//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
+STDAPI DllRegisterServer()
+{
+
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(TRUE);
+
+
+
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
+
+
+ hr = locFilterMapper->RegisterFilter(
+ CLSID_SpeexEncodeFilter, // Filter CLSID.
+ L"Speex Encode Filter", // Filter name.
+ NULL, // Device moniker.
+ &CLSID_LegacyAmFilterCategory, // Direct Show general category
+ L"Speex Encode Filter", // Instance data. ???????
+ &SpeexEncodeFilterReg // Pointer to filter information.
+ );
+
+ locFilterMapper->Release();
+
+ return hr;
+
+}
+
+STDAPI DllUnregisterServer()
+{
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(FALSE);
+ if (FAILED(hr)) {
+
+ return hr;
+ }
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
+ IID_IFilterMapper2, (void **)&locFilterMapper);
+
+ if (FAILED(hr)) {
+ return hr;
+ }
+
+
+ hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, L"Speex Encode Filter", CLSID_SpeexEncodeFilter);
+
+
+ //
+ locFilterMapper->Release();
+ return hr;
+
+}
Property changes on: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/speexencoderdllstuff.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/speexencoderdllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/speexencoderdllstuff.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/speexencoderdllstuff.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,119 +1,119 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-struct sSpeexFormatBlock {
- unsigned long speexVersion;
- unsigned long samplesPerSec;
- unsigned long minBitsPerSec;
- unsigned long avgBitsPerSec;
- unsigned long maxBitsPerSec;
- unsigned long numChannels;
-
-};
-#include "AbstractTransformFilter.h"
-#include "AbstractTransformInputPin.h"
-#include "AbstractTransformOutputPin.h"
-#include "SpeexEncodeInputPin.h"
-#include "SpeexEncodeOutputPin.h"
-#include "SpeexEncodeFilter.h"
-
-#ifdef LIBOOOGG_EXPORTS
-#define LIBOOOGG_API __declspec(dllexport)
-#else
-#define LIBOOOGG_API __declspec(dllimport)
-#endif
-
-
-
-
-// {7036C2FE-A209-464c-97AB-95B9260EDBF7}
-DEFINE_GUID(CLSID_SpeexEncodeFilter,
-0x7036c2fe, 0xa209, 0x464c, 0x97, 0xab, 0x95, 0xb9, 0x26, 0xe, 0xdb, 0xf7);
-
-// {25A9729D-12F6-420e-BD53-1D631DC217DF}
-DEFINE_GUID(MEDIASUBTYPE_Speex,
-0x25a9729d, 0x12f6, 0x420e, 0xbd, 0x53, 0x1d, 0x63, 0x1d, 0xc2, 0x17, 0xdf);
-
-// {78701A27-EFB5-4157-9553-38A7854E3E81}
-DEFINE_GUID(FORMAT_Speex,
-0x78701a27, 0xefb5, 0x4157, 0x95, 0x53, 0x38, 0xa7, 0x85, 0x4e, 0x3e, 0x81);
-//This structure defines the type of input we accept on the input pin... Stream/Annodex
-
-const REGPINTYPES SpeexEncodeInputTypes = {
- &MEDIATYPE_Audio,
- &MEDIASUBTYPE_PCM
-};
-
-const REGPINTYPES SpeexEncodeOutputTypes = {
- &MEDIATYPE_Audio,
- &MEDIASUBTYPE_Speex
-};
-
-const REGFILTERPINS SpeexEncodePinReg[] = {
- {
- L"PCM Input", //Name (obsoleted)
- FALSE, //Renders from this pin ?? Not sure about this.
- FALSE, //Not an output pin
- FALSE, //Cannot have zero instances of this pin
- FALSE, //Cannot have more than one instance of this pin
- NULL, //Connects to filter (obsoleted)
- NULL, //Connects to pin (obsoleted)
- 1, //upport two media type
- &SpeexEncodeInputTypes //Pointer to media type (Audio/Speex or Audio/Speex)
- } ,
-
- {
- L"Speex Output", //Name (obsoleted)
- FALSE, //Renders from this pin ?? Not sure about this.
- TRUE, //Is an output pin
- FALSE, //Cannot have zero instances of this pin
- FALSE, //Cannot have more than one instance of this pin
- NULL, //Connects to filter (obsoleted)
- NULL, //Connects to pin (obsoleted)
- 1, //Only support one media type
- &SpeexEncodeOutputTypes //Pointer to media type (Audio/PCM)
-
- }
-};
-
-
-
-const REGFILTER2 SpeexEncodeFilterReg = {
- 1,
- MERIT_DO_NOT_USE,
- 2,
- SpeexEncodePinReg
-
-};
-
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+struct sSpeexFormatBlock {
+ unsigned long speexVersion;
+ unsigned long samplesPerSec;
+ unsigned long minBitsPerSec;
+ unsigned long avgBitsPerSec;
+ unsigned long maxBitsPerSec;
+ unsigned long numChannels;
+
+};
+#include "AbstractTransformFilter.h"
+#include "AbstractTransformInputPin.h"
+#include "AbstractTransformOutputPin.h"
+#include "SpeexEncodeInputPin.h"
+#include "SpeexEncodeOutputPin.h"
+#include "SpeexEncodeFilter.h"
+
+#ifdef LIBOOOGG_EXPORTS
+#define LIBOOOGG_API __declspec(dllexport)
+#else
+#define LIBOOOGG_API __declspec(dllimport)
+#endif
+
+
+
+
+// {7036C2FE-A209-464c-97AB-95B9260EDBF7}
+DEFINE_GUID(CLSID_SpeexEncodeFilter,
+0x7036c2fe, 0xa209, 0x464c, 0x97, 0xab, 0x95, 0xb9, 0x26, 0xe, 0xdb, 0xf7);
+
+// {25A9729D-12F6-420e-BD53-1D631DC217DF}
+DEFINE_GUID(MEDIASUBTYPE_Speex,
+0x25a9729d, 0x12f6, 0x420e, 0xbd, 0x53, 0x1d, 0x63, 0x1d, 0xc2, 0x17, 0xdf);
+
+// {78701A27-EFB5-4157-9553-38A7854E3E81}
+DEFINE_GUID(FORMAT_Speex,
+0x78701a27, 0xefb5, 0x4157, 0x95, 0x53, 0x38, 0xa7, 0x85, 0x4e, 0x3e, 0x81);
+//This structure defines the type of input we accept on the input pin... Stream/Annodex
+
+const REGPINTYPES SpeexEncodeInputTypes = {
+ &MEDIATYPE_Audio,
+ &MEDIASUBTYPE_PCM
+};
+
+const REGPINTYPES SpeexEncodeOutputTypes = {
+ &MEDIATYPE_Audio,
+ &MEDIASUBTYPE_Speex
+};
+
+const REGFILTERPINS SpeexEncodePinReg[] = {
+ {
+ L"PCM Input", //Name (obsoleted)
+ FALSE, //Renders from this pin ?? Not sure about this.
+ FALSE, //Not an output pin
+ FALSE, //Cannot have zero instances of this pin
+ FALSE, //Cannot have more than one instance of this pin
+ NULL, //Connects to filter (obsoleted)
+ NULL, //Connects to pin (obsoleted)
+ 1, //upport two media type
+ &SpeexEncodeInputTypes //Pointer to media type (Audio/Speex or Audio/Speex)
+ } ,
+
+ {
+ L"Speex Output", //Name (obsoleted)
+ FALSE, //Renders from this pin ?? Not sure about this.
+ TRUE, //Is an output pin
+ FALSE, //Cannot have zero instances of this pin
+ FALSE, //Cannot have more than one instance of this pin
+ NULL, //Connects to filter (obsoleted)
+ NULL, //Connects to pin (obsoleted)
+ 1, //Only support one media type
+ &SpeexEncodeOutputTypes //Pointer to media type (Audio/PCM)
+
+ }
+};
+
+
+
+const REGFILTER2 SpeexEncodeFilterReg = {
+ 1,
+ MERIT_DO_NOT_USE,
+ 2,
+ SpeexEncodePinReg
+
+};
+
+
Property changes on: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/speexencoderdllstuff.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,39 +1,39 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.cpp : source file that includes just the standard includes
-// dsfSpeexEncoder.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.cpp : source file that includes just the standard includes
+// dsfSpeexEncoder.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,12 +1,12 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-// TODO: reference additional headers your program requires here
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/lib/codecs/speex/filters/dsfSpeexEncoder/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/include/speex/speex.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/include/speex/speex_bits.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/include/speex/speex_callbacks.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/include/speex/speex_header.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/include/speex/speex_stereo.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/include/speex.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/include/speex_bits.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/include/speex_callbacks.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/include/speex_header.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/include/speex_stereo.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/cb_search.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/filters.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/filters_sse.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/lpc.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/lsp.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/lsp.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/lsp.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,57 +1,57 @@
-/*---------------------------------------------------------------------------*\
-Original Copyright
- FILE........: AK2LSPD.H
- TYPE........: Turbo C header file
- COMPANY.....: Voicetronix
- AUTHOR......: James Whitehall
- DATE CREATED: 21/11/95
-
-Modified by Jean-Marc Valin
-
- This file contains functions for converting Linear Prediction
- Coefficients (LPC) to Line Spectral Pair (LSP) and back. Note that the
- LSP coefficients are not in radians format but in the x domain of the
- unit circle.
-
-\*---------------------------------------------------------------------------*/
-/* Speex License:
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- - Neither the name of the Xiph.org Foundation nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#ifndef __AK2LSPD__
-#define __AK2LSPD__
-
-int lpc_to_lsp (float *a, int lpcrdr, float *freq, int nb, float delta, char *stack);
-void lsp_to_lpc(float *freq, float *ak, int lpcrdr, char *stack);
-
-/*Added by JMV*/
-void lsp_enforce_margin(float *lsp, int len, float margin);
-
-
-#endif /* __AK2LSPD__ */
+/*---------------------------------------------------------------------------*\
+Original Copyright
+ FILE........: AK2LSPD.H
+ TYPE........: Turbo C header file
+ COMPANY.....: Voicetronix
+ AUTHOR......: James Whitehall
+ DATE CREATED: 21/11/95
+
+Modified by Jean-Marc Valin
+
+ This file contains functions for converting Linear Prediction
+ Coefficients (LPC) to Line Spectral Pair (LSP) and back. Note that the
+ LSP coefficients are not in radians format but in the x domain of the
+ unit circle.
+
+\*---------------------------------------------------------------------------*/
+/* Speex License:
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ - Neither the name of the Xiph.org Foundation nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+#ifndef __AK2LSPD__
+#define __AK2LSPD__
+
+int lpc_to_lsp (float *a, int lpcrdr, float *freq, int nb, float delta, char *stack);
+void lsp_to_lpc(float *freq, float *ak, int lpcrdr, char *stack);
+
+/*Added by JMV*/
+void lsp_enforce_margin(float *lsp, int len, float margin);
+
+
+#endif /* __AK2LSPD__ */
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/lsp.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/ltp.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/ltp_sse.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/math_approx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/misc.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/modes.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/nb_celp.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/quant_lsp.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/sb_celp.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/speex.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/speex_bits.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/speex_callbacks.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/speex_header.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/speex_stereo.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/stack_alloc.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/vbr.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/libspeex/vq.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/src/getopt_win.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/src/getopt_win.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/src/getopt_win.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,169 +1,169 @@
-/* Declarations for getopt.
- Copyright (C) 1989,90,91,92,93,94,96,97,98 Free Software Foundation, Inc.
- This file is part of the GNU C Library.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Library General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
-
- The GNU C Library 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
- Library General Public License for more details.
-
- You should have received a copy of the GNU Library General Public
- License along with the GNU C Library; see the file COPYING.LIB. If not,
- write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- Boston, MA 02111-1307, USA. */
-
-#ifndef _GETOPT_H
-
-#ifndef __need_getopt
-# define _GETOPT_H 1
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* For communication from `getopt' to the caller.
- When `getopt' finds an option that takes an argument,
- the argument value is returned here.
- Also, when `ordering' is RETURN_IN_ORDER,
- each non-option ARGV-element is returned here. */
-
-extern char *optarg;
-
-/* Index in ARGV of the next element to be scanned.
- This is used for communication to and from the caller
- and for communication between successive calls to `getopt'.
-
- On entry to `getopt', zero means this is the first call; initialize.
-
- When `getopt' returns -1, this is the index of the first of the
- non-option elements that the caller should itself scan.
-
- Otherwise, `optind' communicates from one call to the next
- how much of ARGV has been scanned so far. */
-
-extern int optind;
-
-/* Callers store zero here to inhibit the error message `getopt' prints
- for unrecognized options. */
-
-extern int opterr;
-
-/* Set to an option character which was unrecognized. */
-
-extern int optopt;
-
-#ifndef __need_getopt
-/* Describe the long-named options requested by the application.
- The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
- of `struct option' terminated by an element containing a name which is
- zero.
-
- The field `has_arg' is:
- no_argument (or 0) if the option does not take an argument,
- required_argument (or 1) if the option requires an argument,
- optional_argument (or 2) if the option takes an optional argument.
-
- If the field `flag' is not NULL, it points to a variable that is set
- to the value given in the field `val' when the option is found, but
- left unchanged if the option is not found.
-
- To have a long-named option do something other than set an `int' to
- a compiled-in constant, such as set a value from `optarg', set the
- option's `flag' field to zero and its `val' field to a nonzero
- value (the equivalent single-letter option character, if there is
- one). For long options that have a zero `flag' field, `getopt'
- returns the contents of the `val' field. */
-
-struct option
-{
-# if defined __STDC__ && __STDC__
- const char *name;
-# else
- char *name;
-# endif
- /* has_arg can't be an enum because some compilers complain about
- type mismatches in all the code that assumes it is an int. */
- int has_arg;
- int *flag;
- int val;
-};
-
-/* Names for the values of the `has_arg' field of `struct option'. */
-
-# define no_argument 0
-# define required_argument 1
-# define optional_argument 2
-#endif /* need getopt */
-
-
-/* Get definitions and prototypes for functions to process the
- arguments in ARGV (ARGC of them, minus the program name) for
- options given in OPTS.
-
- Return the option character from OPTS just read. Return -1 when
- there are no more options. For unrecognized options, or options
- missing arguments, `optopt' is set to the option letter, and '?' is
- returned.
-
- The OPTS string is a list of characters which are recognized option
- letters, optionally followed by colons, specifying that that letter
- takes an argument, to be placed in `optarg'.
-
- If a letter in OPTS is followed by two colons, its argument is
- optional. This behavior is specific to the GNU `getopt'.
-
- The argument `--' causes premature termination of argument
- scanning, explicitly telling `getopt' that there are no more
- options.
-
- If OPTS begins with `--', then non-option arguments are treated as
- arguments to the option '\0'. This behavior is specific to the GNU
- `getopt'. */
-
-#if defined __STDC__ && __STDC__
-# ifdef __GNU_LIBRARY__
-/* Many other libraries have conflicting prototypes for getopt, with
- differences in the consts, in stdlib.h. To avoid compilation
- errors, only prototype getopt for the GNU C library. */
-extern int getopt (int __argc, char *const *__argv, const char *__shortopts);
-# else /* not __GNU_LIBRARY__ */
-extern int getopt ();
-# endif /* __GNU_LIBRARY__ */
-
-# ifndef __need_getopt
-extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts,
- const struct option *__longopts, int *__longind);
-extern int getopt_long_only (int __argc, char *const *__argv,
- const char *__shortopts,
- const struct option *__longopts, int *__longind);
-
-/* Internal only. Users should not call this directly. */
-extern int _getopt_internal (int __argc, char *const *__argv,
- const char *__shortopts,
- const struct option *__longopts, int *__longind,
- int __long_only);
-# endif
-#else /* not __STDC__ */
-extern int getopt ();
-# ifndef __need_getopt
-extern int getopt_long ();
-extern int getopt_long_only ();
-
-extern int _getopt_internal ();
-# endif
-#endif /* __STDC__ */
-
-#ifdef __cplusplus
-}
-#endif
-
-/* Make sure we later can get all the definitions and declarations. */
-#undef __need_getopt
-
-#endif /* getopt.h */
+/* Declarations for getopt.
+ Copyright (C) 1989,90,91,92,93,94,96,97,98 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef _GETOPT_H
+
+#ifndef __need_getopt
+# define _GETOPT_H 1
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* For communication from `getopt' to the caller.
+ When `getopt' finds an option that takes an argument,
+ the argument value is returned here.
+ Also, when `ordering' is RETURN_IN_ORDER,
+ each non-option ARGV-element is returned here. */
+
+extern char *optarg;
+
+/* Index in ARGV of the next element to be scanned.
+ This is used for communication to and from the caller
+ and for communication between successive calls to `getopt'.
+
+ On entry to `getopt', zero means this is the first call; initialize.
+
+ When `getopt' returns -1, this is the index of the first of the
+ non-option elements that the caller should itself scan.
+
+ Otherwise, `optind' communicates from one call to the next
+ how much of ARGV has been scanned so far. */
+
+extern int optind;
+
+/* Callers store zero here to inhibit the error message `getopt' prints
+ for unrecognized options. */
+
+extern int opterr;
+
+/* Set to an option character which was unrecognized. */
+
+extern int optopt;
+
+#ifndef __need_getopt
+/* Describe the long-named options requested by the application.
+ The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
+ of `struct option' terminated by an element containing a name which is
+ zero.
+
+ The field `has_arg' is:
+ no_argument (or 0) if the option does not take an argument,
+ required_argument (or 1) if the option requires an argument,
+ optional_argument (or 2) if the option takes an optional argument.
+
+ If the field `flag' is not NULL, it points to a variable that is set
+ to the value given in the field `val' when the option is found, but
+ left unchanged if the option is not found.
+
+ To have a long-named option do something other than set an `int' to
+ a compiled-in constant, such as set a value from `optarg', set the
+ option's `flag' field to zero and its `val' field to a nonzero
+ value (the equivalent single-letter option character, if there is
+ one). For long options that have a zero `flag' field, `getopt'
+ returns the contents of the `val' field. */
+
+struct option
+{
+# if defined __STDC__ && __STDC__
+ const char *name;
+# else
+ char *name;
+# endif
+ /* has_arg can't be an enum because some compilers complain about
+ type mismatches in all the code that assumes it is an int. */
+ int has_arg;
+ int *flag;
+ int val;
+};
+
+/* Names for the values of the `has_arg' field of `struct option'. */
+
+# define no_argument 0
+# define required_argument 1
+# define optional_argument 2
+#endif /* need getopt */
+
+
+/* Get definitions and prototypes for functions to process the
+ arguments in ARGV (ARGC of them, minus the program name) for
+ options given in OPTS.
+
+ Return the option character from OPTS just read. Return -1 when
+ there are no more options. For unrecognized options, or options
+ missing arguments, `optopt' is set to the option letter, and '?' is
+ returned.
+
+ The OPTS string is a list of characters which are recognized option
+ letters, optionally followed by colons, specifying that that letter
+ takes an argument, to be placed in `optarg'.
+
+ If a letter in OPTS is followed by two colons, its argument is
+ optional. This behavior is specific to the GNU `getopt'.
+
+ The argument `--' causes premature termination of argument
+ scanning, explicitly telling `getopt' that there are no more
+ options.
+
+ If OPTS begins with `--', then non-option arguments are treated as
+ arguments to the option '\0'. This behavior is specific to the GNU
+ `getopt'. */
+
+#if defined __STDC__ && __STDC__
+# ifdef __GNU_LIBRARY__
+/* Many other libraries have conflicting prototypes for getopt, with
+ differences in the consts, in stdlib.h. To avoid compilation
+ errors, only prototype getopt for the GNU C library. */
+extern int getopt (int __argc, char *const *__argv, const char *__shortopts);
+# else /* not __GNU_LIBRARY__ */
+extern int getopt ();
+# endif /* __GNU_LIBRARY__ */
+
+# ifndef __need_getopt
+extern int getopt_long (int __argc, char *const *__argv, const char *__shortopts,
+ const struct option *__longopts, int *__longind);
+extern int getopt_long_only (int __argc, char *const *__argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind);
+
+/* Internal only. Users should not call this directly. */
+extern int _getopt_internal (int __argc, char *const *__argv,
+ const char *__shortopts,
+ const struct option *__longopts, int *__longind,
+ int __long_only);
+# endif
+#else /* not __STDC__ */
+extern int getopt ();
+# ifndef __need_getopt
+extern int getopt_long ();
+extern int getopt_long_only ();
+
+extern int _getopt_internal ();
+# endif
+#endif /* __STDC__ */
+
+#ifdef __cplusplus
+}
+#endif
+
+/* Make sure we later can get all the definitions and declarations. */
+#undef __need_getopt
+
+#endif /* getopt.h */
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/src/getopt_win.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/src/wav_io.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/src/wave_out.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/src/wave_out.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/src/wave_out.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,65 +1,65 @@
-/* Copyright (c) 2002, John Edwards
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- - Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- - Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- - Neither the name of the Xiph.org Foundation nor the names of its
- contributors may be used to endorse or promote products derived from
- this software without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-// WAVE_OUT.H - Necessary stuff for WIN_AUDIO
-
-
-#include <stdio.h>
-#include <windows.h>
-
-#define VERSION_STRING "\n 0.7.0\n"
-
-#define Cdecl __cdecl
-#define __attribute__(x)
-#define sleep(__sec) Sleep ((__sec) * 1000)
-#define inline __inline
-#define restrict
-
-//// constants /////////////////////////////////////////////////////
-
-#define CD_SAMPLE_FREQ 44.1e3
-#define SAMPLE_SIZE 16
-#define SAMPLE_SIZE_STRING ""
-#define WINAUDIO_FD ((FILE_T)-128)
-#define FILE_T FILE*
-#define INVALID_FILEDESC NULL
-
-//// Simple types //////////////////////////////////////////////////
-
-typedef signed int Int; // at least -32767...+32767, fast type
-typedef unsigned int Uint; // at least 0...65535, fast type
-typedef long double Ldouble; // most exact floating point format
-
-//// procedures/functions //////////////////////////////////////////
-// wave_out.c
-Int Set_WIN_Params ( FILE_T dummyFile , Ldouble SampleFreq, Uint BitsPerSample, Uint Channels);
-int WIN_Play_Samples ( const void* buff, size_t len );
-int WIN_Audio_close ( void );
-
+/* Copyright (c) 2002, John Edwards
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ - Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ - Neither the name of the Xiph.org Foundation nor the names of its
+ contributors may be used to endorse or promote products derived from
+ this software without specific prior written permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+// WAVE_OUT.H - Necessary stuff for WIN_AUDIO
+
+
+#include <stdio.h>
+#include <windows.h>
+
+#define VERSION_STRING "\n 0.7.0\n"
+
+#define Cdecl __cdecl
+#define __attribute__(x)
+#define sleep(__sec) Sleep ((__sec) * 1000)
+#define inline __inline
+#define restrict
+
+//// constants /////////////////////////////////////////////////////
+
+#define CD_SAMPLE_FREQ 44.1e3
+#define SAMPLE_SIZE 16
+#define SAMPLE_SIZE_STRING ""
+#define WINAUDIO_FD ((FILE_T)-128)
+#define FILE_T FILE*
+#define INVALID_FILEDESC NULL
+
+//// Simple types //////////////////////////////////////////////////
+
+typedef signed int Int; // at least -32767...+32767, fast type
+typedef unsigned int Uint; // at least 0...65535, fast type
+typedef long double Ldouble; // most exact floating point format
+
+//// procedures/functions //////////////////////////////////////////
+// wave_out.c
+Int Set_WIN_Params ( FILE_T dummyFile , Ldouble SampleFreq, Uint BitsPerSample, Uint Channels);
+int WIN_Play_Samples ( const void* buff, size_t len );
+int WIN_Audio_close ( void );
+
Property changes on: trunk/oggdsf/src/lib/codecs/speex/libs/libspeex/src/wave_out.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,804 +1,806 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-
-#include "TheoraDecodeFilter.h"
-
-
-
-//COM Factory Template
-CFactoryTemplate g_Templates[] =
-{
- {
- L"Theora Decode Filter", // Name
- &CLSID_TheoraDecodeFilter, // CLSID
- TheoraDecodeFilter::CreateInstance, // Method to create an instance of Theora Decoder
- NULL, // Initialization function
- NULL // Set-up information (for filters)
- }
-
-};
-
-// Generic way of determining the number of items in the template
-int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
-
-
-
-TheoraDecodeFilter::TheoraDecodeFilter()
- : CTransformFilter( NAME("Theora Decode Filter"), NULL, CLSID_TheoraDecodeFilter)
- , mHeight(0)
- , mWidth(0)
- , mFrameSize(0)
- , mFrameCount(0)
- , mYOffset(0)
- , mXOffset(0)
- , mFrameDuration(0)
- , mBegun(false)
- , mSeekTimeBase(0)
- , mLastSeenStartGranPos(0)
- , mTheoraFormatInfo(NULL)
-{
- //debugLog.open("G:\\logs\\newtheofilter.log", ios_base::out);
-
- mTheoraDecoder = new TheoraDecoder;
- mTheoraDecoder->initCodec();
-
-}
-
-TheoraDecodeFilter::~TheoraDecodeFilter() {
- delete mTheoraDecoder;
- mTheoraDecoder = NULL;
-
- delete mTheoraFormatInfo;
- mTheoraFormatInfo = NULL;
- //debugLog.close();
-
-}
-
-CUnknown* WINAPI TheoraDecodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
-{
- //This routine is the COM implementation to create a new Filter
- TheoraDecodeFilter *pNewObject = new TheoraDecodeFilter();
- if (pNewObject == NULL) {
- *pHr = E_OUTOFMEMORY;
- }
- return pNewObject;
-}
-void TheoraDecodeFilter::FillMediaType(CMediaType* outMediaType, unsigned long inSampleSize) {
- outMediaType->SetType(&MEDIATYPE_Video);
- outMediaType->SetSubtype(&MEDIASUBTYPE_YV12);
- outMediaType->SetFormatType(&FORMAT_VideoInfo);
- outMediaType->SetTemporalCompression(FALSE);
- outMediaType->SetSampleSize(inSampleSize);
-
-}
-bool TheoraDecodeFilter::FillVideoInfoHeader(VIDEOINFOHEADER* inFormatBuffer) {
- TheoraDecodeFilter* locFilter = this;
-
- inFormatBuffer->AvgTimePerFrame = (UNITS * locFilter->mTheoraFormatInfo->frameRateDenominator) / locFilter->mTheoraFormatInfo->frameRateNumerator;
- inFormatBuffer->dwBitRate = locFilter->mTheoraFormatInfo->targetBitrate;
-
- inFormatBuffer->bmiHeader.biBitCount = 12; //12 bits per pixel
- inFormatBuffer->bmiHeader.biClrImportant = 0; //All colours important
- inFormatBuffer->bmiHeader.biClrUsed = 0; //Use max colour depth
- inFormatBuffer->bmiHeader.biCompression = MAKEFOURCC('Y','V','1','2');
- inFormatBuffer->bmiHeader.biHeight = locFilter->mTheoraFormatInfo->frameHeight; //Not sure
- inFormatBuffer->bmiHeader.biPlanes = 1; //Must be 1
- inFormatBuffer->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); //????? Size of what ?
- inFormatBuffer->bmiHeader.biSizeImage = ((locFilter->mTheoraFormatInfo->frameHeight * locFilter->mTheoraFormatInfo->frameWidth) * 3)/2; //Size in bytes of image ??
- inFormatBuffer->bmiHeader.biWidth = locFilter->mTheoraFormatInfo->frameWidth;
- inFormatBuffer->bmiHeader.biXPelsPerMeter = 2000; //Fuck knows
- inFormatBuffer->bmiHeader.biYPelsPerMeter = 2000; //" " " " "
-
- inFormatBuffer->rcSource.top = 0;
- inFormatBuffer->rcSource.bottom = locFilter->mTheoraFormatInfo->frameHeight;
- inFormatBuffer->rcSource.left = 0;
- inFormatBuffer->rcSource.right = locFilter->mTheoraFormatInfo->frameWidth;
-
- inFormatBuffer->rcTarget.top = 0;
- inFormatBuffer->rcTarget.bottom = locFilter->mTheoraFormatInfo->frameHeight;
- inFormatBuffer->rcTarget.left = 0;
- inFormatBuffer->rcTarget.right = locFilter->mTheoraFormatInfo->frameWidth;
-
- inFormatBuffer->dwBitErrorRate=0;
- return true;
-}
-
-HRESULT TheoraDecodeFilter::CheckInputType(const CMediaType* inMediaType) {
-
- if ( (inMediaType->majortype == MEDIATYPE_Video) &&
- (inMediaType->subtype == MEDIASUBTYPE_Theora) && (inMediaType->formattype == FORMAT_Theora)
- )
- {
- return S_OK;
- } else {
- return S_FALSE;
- }
-}
-HRESULT TheoraDecodeFilter::CheckTransform(const CMediaType* inInputMediaType, const CMediaType* inOutputMediaType) {
- if ((CheckInputType(inInputMediaType) == S_OK) &&
- ((inOutputMediaType->majortype == MEDIATYPE_Video) && (inOutputMediaType->subtype == MEDIASUBTYPE_YV12) && (inOutputMediaType->formattype == FORMAT_VideoInfo)
- )) {
- VIDEOINFOHEADER* locVideoHeader = (VIDEOINFOHEADER*)inOutputMediaType->Format();
- mHeight = (unsigned long)abs(locVideoHeader->bmiHeader.biHeight);
- mWidth = (unsigned long)abs(locVideoHeader->bmiHeader.biWidth);
-
-
- return S_OK;
- } else {
- return S_FALSE;
- }
-}
-HRESULT TheoraDecodeFilter::DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES* inPropertyRequest) {
- //debugLog<<endl;
//debugLog<<"DecideBufferSize :"<<endl;
//FIX::: Abstract this out properly
-
- //debugLog<<"Allocator is "<<(unsigned long)inAllocator<<endl;
- //Our error variable
- HRESULT locHR = S_OK;
-
- //Create the structures for setproperties to use
- ALLOCATOR_PROPERTIES locReqAlloc;
- ALLOCATOR_PROPERTIES locActualAlloc;
-
- //debugLog<<"DecideBufferSize : Requested :"<<endl;
- //debugLog<<"DecideBufferSize : Align : "<<inPropertyRequest->cbAlign<<endl;
- //debugLog<<"DecideBufferSize : BuffSize : "<<inPropertyRequest->cbBuffer<<endl;
- //debugLog<<"DecideBufferSize : Prefix : "<<inPropertyRequest->cbPrefix<<endl;
- //debugLog<<"DecideBufferSize : NumBuffs : "<<inPropertyRequest->cBuffers<<endl;
-
-
- const unsigned long MIN_BUFFER_SIZE = 16*16; //What should this be ????
- const unsigned long DEFAULT_BUFFER_SIZE = 1024*1024 * 2;
- const unsigned long MIN_NUM_BUFFERS = 1;
- const unsigned long DEFAULT_NUM_BUFFERS = 1;
-
-
- //Validate and change what we have been requested to do.
- //Allignment of data
- if (inPropertyRequest->cbAlign <= 0) {
- locReqAlloc.cbAlign = 1;
- } else {
- locReqAlloc.cbAlign = inPropertyRequest->cbAlign;
- }
-
- //Size of each buffer
- if (inPropertyRequest->cbBuffer < MIN_BUFFER_SIZE) {
- locReqAlloc.cbBuffer = DEFAULT_BUFFER_SIZE;
- } else {
- locReqAlloc.cbBuffer = inPropertyRequest->cbBuffer;
- }
-
- //How many prefeixed bytes
- if (inPropertyRequest->cbPrefix < 0) {
- locReqAlloc.cbPrefix = 0;
- } else {
- locReqAlloc.cbPrefix = inPropertyRequest->cbPrefix;
- }
-
- //Number of buffers in the allcoator
- if (inPropertyRequest->cBuffers < MIN_NUM_BUFFERS) {
- locReqAlloc.cBuffers = DEFAULT_NUM_BUFFERS;
- } else {
-
- locReqAlloc.cBuffers = inPropertyRequest->cBuffers;
- }
-
- //debugLog<<"DecideBufferSize : Modified Request :"<<endl;
- //debugLog<<"DecideBufferSize : Align : "<<locReqAlloc.cbAlign<<endl;
- //debugLog<<"DecideBufferSize : BuffSize : "<<locReqAlloc.cbBuffer<<endl;
- //debugLog<<"DecideBufferSize : Prefix : "<<locReqAlloc.cbPrefix<<endl;
- //debugLog<<"DecideBufferSize : NumBuffs : "<<locReqAlloc.cBuffers<<endl;
-
-
- //Set the properties in the allocator
- locHR = inAllocator->SetProperties(&locReqAlloc, &locActualAlloc);
-
- //debugLog<<"DecideBufferSize : SetProperties returns "<<locHR<<endl;
- //debugLog<<"DecideBufferSize : Actual Params :"<<endl;
- //debugLog<<"DecideBufferSize : Align : "<<locActualAlloc.cbAlign<<endl;
- //debugLog<<"DecideBufferSize : BuffSize : "<<locActualAlloc.cbBuffer<<endl;
- //debugLog<<"DecideBufferSize : Prefix : "<<locActualAlloc.cbPrefix<<endl;
- //debugLog<<"DecideBufferSize : NumBuffs : "<<locActualAlloc.cBuffers<<endl;
-
- //Check the response
- switch (locHR) {
- case E_POINTER:
- //debugLog<<"DecideBufferSize : SetProperties - NULL POINTER"<<endl;
- return locHR;
-
-
- case VFW_E_ALREADY_COMMITTED:
- //debugLog<<"DecideBufferSize : SetProperties - Already COMMITED"<<endl;
- return locHR;
-
- case VFW_E_BADALIGN:
- //debugLog<<"DecideBufferSize : SetProperties - Bad ALIGN"<<endl;
- return locHR;
-
- case VFW_E_BUFFERS_OUTSTANDING:
- //debugLog<<"DecideBufferSize : SetProperties - BUFFS OUTSTANDING"<<endl;
- return locHR;
-
-
- case S_OK:
-
- break;
- default:
- //debugLog<<"DecideBufferSize : SetProperties - UNKNOWN ERROR"<<endl;
- break;
-
- }
-
-
- //TO DO::: Do we commit ?
- //RESOLVED ::: Yep !
-
- locHR = inAllocator->Commit();
- //debugLog<<"DecideBufferSize : Commit Returned "<<locHR<<endl;
-
-
- switch (locHR) {
- case E_FAIL:
- //debugLog<<"DecideBufferSize : Commit - FAILED "<<endl;
- return locHR;
- case E_POINTER:
- //debugLog<<"DecideBufferSize : Commit - NULL POINTER "<<endl;
- return locHR;
- case E_INVALIDARG:
- //debugLog<<"DecideBufferSize : Commit - INVALID ARG "<<endl;
- return locHR;
- case E_NOTIMPL:
- //debugLog<<"DecideBufferSize : Commit - NOT IMPL"<<endl;
- return locHR;
- case S_OK:
- //debugLog<<"DecideBufferSize : Commit - ** SUCCESS **"<<endl;
- break;
- default:
- //debugLog<<"DecideBufferSize : Commit - UNKNOWN ERROR "<<endl;
- return locHR;
- }
-
-
- return S_OK;
-}
-HRESULT TheoraDecodeFilter::GetMediaType(int inPosition, CMediaType* outOutputMediaType) {
- if (inPosition < 0) {
- return E_INVALIDARG;
- }
-
- if (inPosition == 0) {
-
- VIDEOINFOHEADER* locVideoFormat = (VIDEOINFOHEADER*)outOutputMediaType->AllocFormatBuffer(sizeof(VIDEOINFOHEADER));
- FillVideoInfoHeader(locVideoFormat);
- FillMediaType(outOutputMediaType, locVideoFormat->bmiHeader.biSizeImage);
- //debugLog<<"Vid format size "<<locVideoFormat->bmiHeader.biSizeImage<<endl;
- //outMediaType->SetSampleSize(locVideoFormat->bmiHeader.biSizeImage);
- //debugLog<<"Returning from GetMediaType"<<endl;
- return S_OK;
- } else {
- return VFW_S_NO_MORE_ITEMS;
- }
-}
-
-void TheoraDecodeFilter::ResetFrameCount() {
- mFrameCount = 0;
-
-}
-HRESULT TheoraDecodeFilter::Transform(IMediaSample* inInputSample, IMediaSample* outOutputSample) {
-
- //CAutoLock locLock(mStreamLock);
- //debugLog<<endl<<"Transform "<<endl;
- //debugLog<<"outOutputSample Size = "<<outOutputSample->
- HRESULT locHR;
- BYTE* locBuff = NULL;
- //Get a source poitner into the input buffer
- locHR = inInputSample->GetPointer(&locBuff);
- BYTE* locNewBuff = new unsigned char[inInputSample->GetActualDataLength()];
- memcpy((void*)locNewBuff, (const void*)locBuff, inInputSample->GetActualDataLength());
-
-
- if (FAILED(locHR)) {
- //debugLog<<"Receive : Get pointer failed..."<<locHR<<endl;
- return locHR;
- } else {
- //debugLog<<"Receive : Get pointer succeeds..."<<endl;
- //New start time hacks
- REFERENCE_TIME locStart = 0;
- REFERENCE_TIME locEnd = 0;
- inInputSample->GetTime(&locStart, &locEnd);
- //Error chacks needed here
- //debugLog<<"Input Sample Time - "<<locStart<<" to "<<locEnd<<endl;
-
- //More work arounds for that stupid granule pos scheme in theora!
- REFERENCE_TIME locTimeBase = 0;
- REFERENCE_TIME locDummy = 0;
- inInputSample->GetMediaTime(&locTimeBase, &locDummy);
- mSeekTimeBase = locTimeBase;
- //
-
- //debugLog<<"SeekTimeBase = "<<mSeekTimeBase<<endl;
-
- if ((mLastSeenStartGranPos != locStart) && (locStart != -1)) {
- //debugLog<<"Resetting frame count"<<endl;
- ResetFrameCount();
- mLastSeenStartGranPos = locStart;
- //debugLog<<"Setting base gran pos to "<<locStart<<endl;
- }
-
- //End of additions
-
-
-
- AM_MEDIA_TYPE* locMediaType = NULL;
- inInputSample->GetMediaType(&locMediaType);
- if (locMediaType == NULL) {
- //debugLog<<"No dynamic change..."<<endl;
- } else {
- //debugLog<<"Attempting dynamic change..."<<endl;
- }
-
- //This packet is given to the decoder.
- StampedOggPacket* locPacket = new StampedOggPacket(locNewBuff, inInputSample->GetActualDataLength(), false, false, locStart, locEnd, StampedOggPacket::OGG_END_ONLY);
- yuv_buffer* locYUV = mTheoraDecoder->decodeTheora(locPacket);
- if (locYUV != NULL) {
- if (TheoraDecoded(locYUV, outOutputSample) != 0) {
- //debugLog<<"Decoded *** FALSE ***"<<endl;
- return S_FALSE;
- }
- } else {
- //debugLog<<"!@&#^()!&@#!()*@#&)!(*@#&()!*@# NULL Decode"<<endl;
- return S_FALSE;
- }
-
- return S_OK;
-
- }
-
-}
-
-int TheoraDecodeFilter::TheoraDecoded (yuv_buffer* inYUVBuffer, IMediaSample* outSample)
-{
- //debugLog<<"TheoraDecoded... #################### "<<endl;
-
-
- if (!mBegun) {
- //debugLog<<"First time..."<<endl;
- mBegun = true;
-
- //How many UNITS does one frame take.
- mFrameDuration = (UNITS * mTheoraFormatInfo->frameRateDenominator) / (mTheoraFormatInfo->frameRateNumerator);
-
- mFrameSize = (mHeight * mWidth * 3) / 2;
- mFrameCount = 0;
- //debugLog<<"Frame Durn = "<<mFrameDuration<<endl;
- //debugLog<<"FrameSize = "<<mFrameSize<<endl;
-
-
- }
-
- //debugLog<<"y_height x width = "<<inYUVBuffer->y_height<<" x "<<inYUVBuffer->y_width<<" ("<<inYUVBuffer->y_stride<<endl;
- //debugLog<<"uv_height x width = "<<inYUVBuffer->uv_height<<" x "<<inYUVBuffer->uv_width<<" ("<<inYUVBuffer->y_stride<<endl;
-
- //debugLog<<"mWidth x mHeight = "<<mWidth<<" x "<<mHeight<<endl;
- //debugLog<<"mFrameSize = "<<mFrameSize<<endl;
- //debugLog<<"Offsets x,y = "<<mXOffset<<", "<<mYOffset<<endl;
- ////FIX::: Most of this will be obselete... the demux does it all.
- //
-
- ////TO DO::: Fix this up... needs to move around order and some only needs to be done once, move it into the block aboce and use member data
-
- ////Make the start timestamp
- ////FIX:::Abstract this calculation
- //DbgLog((LOG_TRACE,1,TEXT("Frame Count = %d"), mFrameCount));
- //debugLog<<"Frame Count = "<<mFrameCount<<endl;
- //REFERENCE_TIME locFrameStart = CurrentStartTime() + (mFrameCount * mFrameDuration);
-
- //Timestamp hacks start here...
- unsigned long locMod = (unsigned long)pow(2, mTheoraFormatInfo->maxKeyframeInterval);
-
- //DbgLog((LOG_TRACE,1,TEXT("locSeenGranPos = %d"), mLastSeenStartGranPos));
- //DbgLog((LOG_TRACE,1,TEXT("locMod = %d"), locMod));
-
- //debugLog<<"locMod = "<<locMod<<endl;
- unsigned long locInterFrameNo = (mLastSeenStartGranPos) % locMod;
-
- //DbgLog((LOG_TRACE,1,TEXT("InterFrameNo = %d"), locInterFrameNo));
- //debugLog<<"Interframe No = "<<locInterFrameNo<<endl;
- LONGLONG locAbsFramePos = ((mLastSeenStartGranPos >> mTheoraFormatInfo->maxKeyframeInterval)) + locInterFrameNo;
-
- //debugLog<<"Abs frame No = "<<locAbsFramePos<<endl;
- //DbgLog((LOG_TRACE,1,TEXT("AbsFrameNo = %d"), locAbsFramePos));
- //DbgLog((LOG_TRACE,1,TEXT("mSeekTimeBase = %d"), mSeekTimeBase));
-
- //debugLog<<"Seek time base = "<<mSeekTimeBase<<endl;
- REFERENCE_TIME locTimeBase = (locAbsFramePos * mFrameDuration) - mSeekTimeBase;
-
- //debugLog<<"LocTimeBase = "<<locTimeBase<<endl;
-
- DbgLog((LOG_TRACE,1,TEXT("locTimeBase = %d"), locTimeBase));
- //
- //
-
- REFERENCE_TIME locFrameStart = locTimeBase + (mFrameCount * mFrameDuration);
- //Increment the frame counter
- mFrameCount++;
-
- //Make the end frame counter
- //REFERENCE_TIME locFrameEnd = CurrentStartTime() + (mFrameCount * mFrameDuration);
- REFERENCE_TIME locFrameEnd = locTimeBase + (mFrameCount * mFrameDuration);
-
-
-
-
- //debugLog<<"Sample times = "<<locFrameStart<<" to "<<locFrameEnd<<endl;
-
- //FILTER_STATE locFS;
- //GetState(0, &locFS);
- //debugLog<<"State Before = "<<locFS<<endl;
- //HRESULT locHR = mOutputPin->GetDeliveryBuffer(&locSample, &locFrameStart, &locFrameEnd, locFlags);
- //GetState(0, &locFS);
- //debugLog<<"State After = "<<locFS<<endl;
-
-
-
- //Debuggin code
- AM_MEDIA_TYPE* locMediaType = NULL;
- outSample->GetMediaType(&locMediaType);
- if (locMediaType == NULL) {
- //debugLog<<"No dynamic change..."<<endl;
- } else {
- //debugLog<<"Attempting dynamic change..."<<endl;
- if (locMediaType->majortype == MEDIATYPE_Video) {
- //debugLog<<"Still MEDIATYPE_Video"<<endl;
- }
-
- if (locMediaType->subtype == MEDIASUBTYPE_YV12) {
- //debugLog<<"Still MEDIASUBTYPE_YV12"<<endl;
- }
-
- if (locMediaType->formattype == FORMAT_VideoInfo) {
- //debugLog<<"Still FORMAT_VideoInfo"<<endl;
- VIDEOINFOHEADER* locVF = (VIDEOINFOHEADER*)locMediaType->pbFormat;
- //debugLog<<"Size = "<<locVF->bmiHeader.biSizeImage<<endl;
- //debugLog<<"Dim = "<<locVF->bmiHeader.biWidth<<" x " <<locVF->bmiHeader.biHeight<<endl;
- }
-
- //debugLog<<"Major : "<<DSStringer::GUID2String(&locMediaType->majortype);
- //debugLog<<"Minor : "<<DSStringer::GUID2String(&locMediaType->subtype);
- //debugLog<<"Format : "<<DSStringer::GUID2String(&locMediaType->formattype);
- //debugLog<<"Form Sz: "<<locMediaType->cbFormat;
-
-
- }
- //
-
- ////Create pointers for the samples buffer to be assigned to
- BYTE* locBuffer = NULL;
-
- //
- ////Make our pointers set to point to the samples buffer
- outSample->GetPointer(&locBuffer);
-
-
-
-
- //Fill the buffer with yuv data...
- //
-
-
-
- //Set up the pointers
- unsigned char* locDestUptoPtr = locBuffer;
- char* locSourceUptoPtr = inYUVBuffer->y;
-
- //Strides from theora are generally -'ve
- long locYStride = inYUVBuffer->y_stride;
- long locUVStride = inYUVBuffer->uv_stride;
-
- //debugLog<<"Y Stride = "<<locYStride<<endl;
- //debugLog<<"UV Stride = "<<locUVStride<<endl;
- //
- //Y DATA
- //
-
- //NEW WAY with offsets Y Data
- long locTopPad = inYUVBuffer->y_height - mHeight - mYOffset;
- //debugLog<<"--------- PAD = "<<locTopPad<<endl;
- ASSERT(locTopPad >= 0);
- if (locTopPad < 0) {
- locTopPad = 0;
- } else {
-
- }
-
- //Skip the top padding
- locSourceUptoPtr += (locTopPad * locYStride);
-
- for (long line = 0; line < mHeight; line++) {
- memcpy((void*)(locDestUptoPtr), (const void*)(locSourceUptoPtr + mXOffset), mWidth);
- locSourceUptoPtr += locYStride;
- locDestUptoPtr += mWidth;
- }
-
- locSourceUptoPtr += (mYOffset * locYStride);
-
- //debugLog<<"Dest Distance(y) = "<<(unsigned long)(locDestUptoPtr - locBuffer)<<endl;
-
- //Source advances by (y_height * y_stride)
- //Dest advances by (mHeight * mWidth)
-
- //
- //V DATA
- //
-
- //Half the padding for uv planes... is this correct ?
- locTopPad = locTopPad /2;
-
- locSourceUptoPtr = inYUVBuffer->v;
-
- //Skip the top padding
- locSourceUptoPtr += (locTopPad * locYStride);
-
- for (long line = 0; line < mHeight / 2; line++) {
- memcpy((void*)(locDestUptoPtr), (const void*)(locSourceUptoPtr + (mXOffset / 2)), mWidth / 2);
- locSourceUptoPtr += locUVStride;
- locDestUptoPtr += (mWidth / 2);
- }
- locSourceUptoPtr += ((mYOffset/2) * locUVStride);
-
- //Source advances by (locTopPad + mYOffset/2 + mHeight /2) * uv_stride
- //where locTopPad for uv = (inYUVBuffer->y_height - mHeight - mYOffset) / 2
- // = (inYUVBuffer->yheight/2 - mHeight/2 - mYOffset/2)
- // so source advances by (y_height/2) * uv_stride
- //Dest advances by (mHeight * mWidth) /4
-
-
- //debugLog<<"Dest Distance(V) = "<<(unsigned long)(locDestUptoPtr - locBuffer)<<endl;
- //
- //U DATA
- //
-
- locSourceUptoPtr = inYUVBuffer->u;
-
- //Skip the top padding
- locSourceUptoPtr += (locTopPad * locYStride);
-
- for (long line = 0; line < mHeight / 2; line++) {
- memcpy((void*)(locDestUptoPtr), (const void*)(locSourceUptoPtr + (mXOffset / 2)), mWidth / 2);
- locSourceUptoPtr += locUVStride;
- locDestUptoPtr += (mWidth / 2);
- }
- locSourceUptoPtr += ((mYOffset/2) * locUVStride);
-
- //debugLog<<"Dest Distance(U) = "<<(unsigned long)(locDestUptoPtr - locBuffer)<<endl;
- //debugLog<<"Frame Size = "<<mFrameSize<<endl;
-
- //Set the sample parameters.
- BOOL locIsKeyFrame = (locInterFrameNo == 0);
- locIsKeyFrame = TRUE;
- if (locIsKeyFrame == TRUE) {
- //debugLog<<"KEY FRAME ++++++"<<endl;
- };
- SetSampleParams(outSample, mFrameSize, &locFrameStart, &locFrameEnd, locIsKeyFrame);
-
-
-
- return 0;
-
-
-}
-
-
-HRESULT TheoraDecodeFilter::SetMediaType(PIN_DIRECTION inDirection, const CMediaType* inMediaType) {
-
- if (inDirection == PINDIR_INPUT) {
- if (inMediaType->subtype == MEDIASUBTYPE_Theora) {
- //debugLog<<"Setting format block"<<endl;
- setTheoraFormat((sTheoraFormatBlock*)inMediaType->pbFormat);
-
- //Set some other stuff here too...
- mXOffset = ((sTheoraFormatBlock*)inMediaType->pbFormat)->xOffset;
- mYOffset = ((sTheoraFormatBlock*)inMediaType->pbFormat)->yOffset;
- //mHeight = ((sTheoraFormatBlock*)inMediaType->pbFormat)->frameHeight;
- //mWidth = ((sTheoraFormatBlock*)inMediaType->pbFormat)->frameWidth;
- //debugLog<<"Setting height width to "<<mWidth<<" x "<<mHeight<<endl;
- //debugLog<<"Frame Dims were "<<((sTheoraFormatBlock*)inMediaType->pbFormat)->frameWidth<<" x "<<((sTheoraFormatBlock*)inMediaType->pbFormat)->frameHeight<<endl;
-
- } else {
- //Failed... should never be here !
- throw 0;
- }
- return CTransformFilter::SetMediaType(PINDIR_INPUT, inMediaType);//CVideoTransformFilter::SetMediaType(PINDIR_INPUT, inMediaType);
- } else {
- //debugLog<<"Setting Output Stuff"<<endl;
- //Output pin SetMediaType
- //VIDEOINFOHEADER* locVideoHeader = (VIDEOINFOHEADER*)inMediaType->Format();
- //mHeight = (unsigned long)abs(locVideoHeader->bmiHeader.biHeight);
- //mWidth = (unsigned long)abs(locVideoHeader->bmiHeader.biWidth);
-
-
- //mFrameSize = (unsigned long)locVideoHeader->bmiHeader.biSizeImage;
-
- //debugLog<<"Size = "<<mWidth<<" x "<<mHeight<<" ("<<mFrameSize<<")"<<endl;
- //debugLog<<"Size in Format = "<<locVideoHeader->bmiHeader.biWidth<<" x "<<locVideoHeader->bmiHeader.biHeight<<endl;
- return CTransformFilter::SetMediaType(PINDIR_OUTPUT, inMediaType);//CVideoTransformFilter::SetMediaType(PINDIR_OUTPUT, inMediaType);
- }
-}
-
-
-bool TheoraDecodeFilter::SetSampleParams(IMediaSample* outMediaSample, unsigned long inDataSize, REFERENCE_TIME* inStartTime, REFERENCE_TIME* inEndTime, BOOL inIsSync)
-{
- outMediaSample->SetTime(inStartTime, inEndTime);
- outMediaSample->SetMediaTime(NULL, NULL);
- outMediaSample->SetActualDataLength(inDataSize);
- outMediaSample->SetPreroll(FALSE);
- outMediaSample->SetDiscontinuity(FALSE);
- outMediaSample->SetSyncPoint(inIsSync);
- return true;
-}
-//BOOL TheoraDecodeFilter::ShouldSkipFrame(IMediaSample* inSample) {
-// //m_bSkipping = FALSE;
-// debugLog<<"Don't skip"<<endl;
-// return FALSE;
-//}
-
-sTheoraFormatBlock* TheoraDecodeFilter::getTheoraFormatBlock()
-{
- return mTheoraFormatInfo;
-}
-void TheoraDecodeFilter::setTheoraFormat(sTheoraFormatBlock* inFormatBlock)
-{
- delete mTheoraFormatInfo;
- mTheoraFormatInfo = new sTheoraFormatBlock; //Deelted in destructor.
- *mTheoraFormatInfo = *inFormatBlock;
-}
-
-CBasePin* TheoraDecodeFilter::GetPin(int inPinNo)
-{
- HRESULT locHR = S_OK;
-
- // Create an input pin if necessary
-
- if (m_pInput == NULL) {
-
- m_pInput = new TheoraDecodeInputPin(this, &locHR); //Deleted in base destructor
-
-
- if (m_pInput == NULL) {
- return NULL;
- }
- m_pOutput = new TheoraDecodeOutputPin(this, &locHR); //Deleted in base destructor
-
-
- if (m_pOutput == NULL) {
- delete m_pInput;
- m_pInput = NULL;
- }
- }
-
- // Return the pin
-
- if (inPinNo == 0) {
- return m_pInput;
- } else if (inPinNo == 1) {
- return m_pOutput;
- } else {
- return NULL;
- }
-}
-//---------------------------------------
-//OLD IMPLOEMENTATION....
-//---------------------------------------
-//#include "theoradecodefilter.h"
-//
-//
-//
-////COM Factory Template
-//CFactoryTemplate g_Templates[] =
-//{
-// {
-// L"Theora Decode Filter", // Name
-// &CLSID_TheoraDecodeFilter, // CLSID
-// TheoraDecodeFilter::CreateInstance, // Method to create an instance of Theora Decoder
-// NULL, // Initialization function
-// NULL // Set-up information (for filters)
-// }
-//
-//};
-//
-//// Generic way of determining the number of items in the template
-//int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
-//
-//
-//
-////Theora Decode Filter Implementation
-////==================================
-//TheoraDecodeFilter::TheoraDecodeFilter()
-// : AbstractVideoDecodeFilter(NAME("Ogg Video Decoder"), CLSID_TheoraDecodeFilter, THEORA)
-// , mTheoraFormatInfo(NULL)
-//{
-//
-// bool locWasConstructed = ConstructPins();
-//}
-//
-//bool TheoraDecodeFilter::ConstructPins()
-//{
-//
-// //Output pin must be done first because it's passed to the input pin.
-// mOutputPin = new TheoraDecodeOutputPin(this, m_pLock);
-//
-// CMediaType* locAcceptMediaType = new CMediaType(&MEDIATYPE_Video);
-// locAcceptMediaType->subtype = MEDIASUBTYPE_Theora;
-// locAcceptMediaType->formattype = FORMAT_Theora;
-// mInputPin = new TheoraDecodeInputPin(this, m_pLock, mOutputPin, locAcceptMediaType);
-// return true;
-//}
-//
-//TheoraDecodeFilter::~TheoraDecodeFilter(void)
-//{
-// //DestroyPins();
-// delete mTheoraFormatInfo;
-//}
-//
-//CUnknown* WINAPI TheoraDecodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
-//{
-// //This routine is the COM implementation to create a new Filter
-// TheoraDecodeFilter *pNewObject = new TheoraDecodeFilter();
-// if (pNewObject == NULL) {
-// *pHr = E_OUTOFMEMORY;
-// }
-// return pNewObject;
-//}
-//
-//STDMETHODIMP TheoraDecodeFilter::GetState(DWORD dw, FILTER_STATE *pState)
-//{
-// CheckPointer(pState, E_POINTER);
-// *pState = m_State;
-// if (m_State == State_Paused) {
-// return VFW_S_CANT_CUE;
-// } else {
-// return S_OK;
-// }
-//}
-//
-////QUERY::: Do we need these ? Aren't we all friedns here ??
-////RESULT::: Keep them, set function must be kept... get could go... but keep for consistency
-//sTheoraFormatBlock* TheoraDecodeFilter::getTheoraFormatBlock()
-//{
-// return mTheoraFormatInfo;
-//}
-//void TheoraDecodeFilter::setTheoraFormat(sTheoraFormatBlock* inFormatBlock)
-//{
-// delete mTheoraFormatInfo;
-// mTheoraFormatInfo = new sTheoraFormatBlock;
-// *mTheoraFormatInfo = *inFormatBlock;
-//}
\ No newline at end of file
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+
+#include "TheoraDecodeFilter.h"
+
+
+
+//COM Factory Template
+CFactoryTemplate g_Templates[] =
+{
+ {
+ L"Theora Decode Filter", // Name
+ &CLSID_TheoraDecodeFilter, // CLSID
+ TheoraDecodeFilter::CreateInstance, // Method to create an instance of Theora Decoder
+ NULL, // Initialization function
+ NULL // Set-up information (for filters)
+ }
+
+};
+
+// Generic way of determining the number of items in the template
+int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
+
+
+
+TheoraDecodeFilter::TheoraDecodeFilter()
+ : CTransformFilter( NAME("Theora Decode Filter"), NULL, CLSID_TheoraDecodeFilter)
+ , mHeight(0)
+ , mWidth(0)
+ , mFrameSize(0)
+ , mFrameCount(0)
+ , mYOffset(0)
+ , mXOffset(0)
+ , mFrameDuration(0)
+ , mBegun(false)
+ , mSeekTimeBase(0)
+ , mLastSeenStartGranPos(0)
+ , mTheoraFormatInfo(NULL)
+{
+ //debugLog.open("G:\\logs\\newtheofilter.log", ios_base::out);
+
+ mTheoraDecoder = new TheoraDecoder;
+ mTheoraDecoder->initCodec();
+
+}
+
+TheoraDecodeFilter::~TheoraDecodeFilter() {
+ delete mTheoraDecoder;
+ mTheoraDecoder = NULL;
+
+ delete mTheoraFormatInfo;
+ mTheoraFormatInfo = NULL;
+ //debugLog.close();
+
+}
+
+CUnknown* WINAPI TheoraDecodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
+{
+ //This routine is the COM implementation to create a new Filter
+ TheoraDecodeFilter *pNewObject = new TheoraDecodeFilter();
+ if (pNewObject == NULL) {
+ *pHr = E_OUTOFMEMORY;
+ }
+ return pNewObject;
+}
+void TheoraDecodeFilter::FillMediaType(CMediaType* outMediaType, unsigned long inSampleSize) {
+ outMediaType->SetType(&MEDIATYPE_Video);
+ outMediaType->SetSubtype(&MEDIASUBTYPE_YV12);
+ outMediaType->SetFormatType(&FORMAT_VideoInfo);
+ outMediaType->SetTemporalCompression(FALSE);
+ outMediaType->SetSampleSize(inSampleSize);
+
+}
+bool TheoraDecodeFilter::FillVideoInfoHeader(VIDEOINFOHEADER* inFormatBuffer) {
+ TheoraDecodeFilter* locFilter = this;
+
+ inFormatBuffer->AvgTimePerFrame = (UNITS * locFilter->mTheoraFormatInfo->frameRateDenominator) / locFilter->mTheoraFormatInfo->frameRateNumerator;
+ inFormatBuffer->dwBitRate = locFilter->mTheoraFormatInfo->targetBitrate;
+
+ inFormatBuffer->bmiHeader.biBitCount = 12; //12 bits per pixel
+ inFormatBuffer->bmiHeader.biClrImportant = 0; //All colours important
+ inFormatBuffer->bmiHeader.biClrUsed = 0; //Use max colour depth
+ inFormatBuffer->bmiHeader.biCompression = MAKEFOURCC('Y','V','1','2');
+ inFormatBuffer->bmiHeader.biHeight = locFilter->mTheoraFormatInfo->frameHeight; //Not sure
+ inFormatBuffer->bmiHeader.biPlanes = 1; //Must be 1
+ inFormatBuffer->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); //????? Size of what ?
+ inFormatBuffer->bmiHeader.biSizeImage = ((locFilter->mTheoraFormatInfo->frameHeight * locFilter->mTheoraFormatInfo->frameWidth) * 3)/2; //Size in bytes of image ??
+ inFormatBuffer->bmiHeader.biWidth = locFilter->mTheoraFormatInfo->frameWidth;
+ inFormatBuffer->bmiHeader.biXPelsPerMeter = 2000; //Fuck knows
+ inFormatBuffer->bmiHeader.biYPelsPerMeter = 2000; //" " " " "
+
+ inFormatBuffer->rcSource.top = 0;
+ inFormatBuffer->rcSource.bottom = locFilter->mTheoraFormatInfo->frameHeight;
+ inFormatBuffer->rcSource.left = 0;
+ inFormatBuffer->rcSource.right = locFilter->mTheoraFormatInfo->frameWidth;
+
+ inFormatBuffer->rcTarget.top = 0;
+ inFormatBuffer->rcTarget.bottom = locFilter->mTheoraFormatInfo->frameHeight;
+ inFormatBuffer->rcTarget.left = 0;
+ inFormatBuffer->rcTarget.right = locFilter->mTheoraFormatInfo->frameWidth;
+
+ inFormatBuffer->dwBitErrorRate=0;
+ return true;
+}
+
+HRESULT TheoraDecodeFilter::CheckInputType(const CMediaType* inMediaType) {
+
+ if ( (inMediaType->majortype == MEDIATYPE_Video) &&
+ (inMediaType->subtype == MEDIASUBTYPE_Theora) && (inMediaType->formattype == FORMAT_Theora)
+ )
+ {
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
+}
+HRESULT TheoraDecodeFilter::CheckTransform(const CMediaType* inInputMediaType, const CMediaType* inOutputMediaType) {
+ if ((CheckInputType(inInputMediaType) == S_OK) &&
+ ((inOutputMediaType->majortype == MEDIATYPE_Video) && (inOutputMediaType->subtype == MEDIASUBTYPE_YV12) && (inOutputMediaType->formattype == FORMAT_VideoInfo)
+ )) {
+ VIDEOINFOHEADER* locVideoHeader = (VIDEOINFOHEADER*)inOutputMediaType->Format();
+ mHeight = (unsigned long)abs(locVideoHeader->bmiHeader.biHeight);
+ mWidth = (unsigned long)abs(locVideoHeader->bmiHeader.biWidth);
+
+
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
+}
+HRESULT TheoraDecodeFilter::DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES* inPropertyRequest) {
+ //debugLog<<endl;
+ //debugLog<<"DecideBufferSize :"<<endl;
+ //FIX::: Abstract this out properly
+
+ //debugLog<<"Allocator is "<<(unsigned long)inAllocator<<endl;
+ //Our error variable
+ HRESULT locHR = S_OK;
+
+ //Create the structures for setproperties to use
+ ALLOCATOR_PROPERTIES locReqAlloc;
+ ALLOCATOR_PROPERTIES locActualAlloc;
+
+ //debugLog<<"DecideBufferSize : Requested :"<<endl;
+ //debugLog<<"DecideBufferSize : Align : "<<inPropertyRequest->cbAlign<<endl;
+ //debugLog<<"DecideBufferSize : BuffSize : "<<inPropertyRequest->cbBuffer<<endl;
+ //debugLog<<"DecideBufferSize : Prefix : "<<inPropertyRequest->cbPrefix<<endl;
+ //debugLog<<"DecideBufferSize : NumBuffs : "<<inPropertyRequest->cBuffers<<endl;
+
+
+ const unsigned long MIN_BUFFER_SIZE = 16*16; //What should this be ????
+ const unsigned long DEFAULT_BUFFER_SIZE = 1024*1024 * 2;
+ const unsigned long MIN_NUM_BUFFERS = 1;
+ const unsigned long DEFAULT_NUM_BUFFERS = 1;
+
+
+ //Validate and change what we have been requested to do.
+ //Allignment of data
+ if (inPropertyRequest->cbAlign <= 0) {
+ locReqAlloc.cbAlign = 1;
+ } else {
+ locReqAlloc.cbAlign = inPropertyRequest->cbAlign;
+ }
+
+ //Size of each buffer
+ if (inPropertyRequest->cbBuffer < MIN_BUFFER_SIZE) {
+ locReqAlloc.cbBuffer = DEFAULT_BUFFER_SIZE;
+ } else {
+ locReqAlloc.cbBuffer = inPropertyRequest->cbBuffer;
+ }
+
+ //How many prefeixed bytes
+ if (inPropertyRequest->cbPrefix < 0) {
+ locReqAlloc.cbPrefix = 0;
+ } else {
+ locReqAlloc.cbPrefix = inPropertyRequest->cbPrefix;
+ }
+
+ //Number of buffers in the allcoator
+ if (inPropertyRequest->cBuffers < MIN_NUM_BUFFERS) {
+ locReqAlloc.cBuffers = DEFAULT_NUM_BUFFERS;
+ } else {
+
+ locReqAlloc.cBuffers = inPropertyRequest->cBuffers;
+ }
+
+ //debugLog<<"DecideBufferSize : Modified Request :"<<endl;
+ //debugLog<<"DecideBufferSize : Align : "<<locReqAlloc.cbAlign<<endl;
+ //debugLog<<"DecideBufferSize : BuffSize : "<<locReqAlloc.cbBuffer<<endl;
+ //debugLog<<"DecideBufferSize : Prefix : "<<locReqAlloc.cbPrefix<<endl;
+ //debugLog<<"DecideBufferSize : NumBuffs : "<<locReqAlloc.cBuffers<<endl;
+
+
+ //Set the properties in the allocator
+ locHR = inAllocator->SetProperties(&locReqAlloc, &locActualAlloc);
+
+ //debugLog<<"DecideBufferSize : SetProperties returns "<<locHR<<endl;
+ //debugLog<<"DecideBufferSize : Actual Params :"<<endl;
+ //debugLog<<"DecideBufferSize : Align : "<<locActualAlloc.cbAlign<<endl;
+ //debugLog<<"DecideBufferSize : BuffSize : "<<locActualAlloc.cbBuffer<<endl;
+ //debugLog<<"DecideBufferSize : Prefix : "<<locActualAlloc.cbPrefix<<endl;
+ //debugLog<<"DecideBufferSize : NumBuffs : "<<locActualAlloc.cBuffers<<endl;
+
+ //Check the response
+ switch (locHR) {
+ case E_POINTER:
+ //debugLog<<"DecideBufferSize : SetProperties - NULL POINTER"<<endl;
+ return locHR;
+
+
+ case VFW_E_ALREADY_COMMITTED:
+ //debugLog<<"DecideBufferSize : SetProperties - Already COMMITED"<<endl;
+ return locHR;
+
+ case VFW_E_BADALIGN:
+ //debugLog<<"DecideBufferSize : SetProperties - Bad ALIGN"<<endl;
+ return locHR;
+
+ case VFW_E_BUFFERS_OUTSTANDING:
+ //debugLog<<"DecideBufferSize : SetProperties - BUFFS OUTSTANDING"<<endl;
+ return locHR;
+
+
+ case S_OK:
+
+ break;
+ default:
+ //debugLog<<"DecideBufferSize : SetProperties - UNKNOWN ERROR"<<endl;
+ break;
+
+ }
+
+
+ //TO DO::: Do we commit ?
+ //RESOLVED ::: Yep !
+
+ locHR = inAllocator->Commit();
+ //debugLog<<"DecideBufferSize : Commit Returned "<<locHR<<endl;
+
+
+ switch (locHR) {
+ case E_FAIL:
+ //debugLog<<"DecideBufferSize : Commit - FAILED "<<endl;
+ return locHR;
+ case E_POINTER:
+ //debugLog<<"DecideBufferSize : Commit - NULL POINTER "<<endl;
+ return locHR;
+ case E_INVALIDARG:
+ //debugLog<<"DecideBufferSize : Commit - INVALID ARG "<<endl;
+ return locHR;
+ case E_NOTIMPL:
+ //debugLog<<"DecideBufferSize : Commit - NOT IMPL"<<endl;
+ return locHR;
+ case S_OK:
+ //debugLog<<"DecideBufferSize : Commit - ** SUCCESS **"<<endl;
+ break;
+ default:
+ //debugLog<<"DecideBufferSize : Commit - UNKNOWN ERROR "<<endl;
+ return locHR;
+ }
+
+
+ return S_OK;
+}
+HRESULT TheoraDecodeFilter::GetMediaType(int inPosition, CMediaType* outOutputMediaType) {
+ if (inPosition < 0) {
+ return E_INVALIDARG;
+ }
+
+ if (inPosition == 0) {
+
+ VIDEOINFOHEADER* locVideoFormat = (VIDEOINFOHEADER*)outOutputMediaType->AllocFormatBuffer(sizeof(VIDEOINFOHEADER));
+ FillVideoInfoHeader(locVideoFormat);
+ FillMediaType(outOutputMediaType, locVideoFormat->bmiHeader.biSizeImage);
+ //debugLog<<"Vid format size "<<locVideoFormat->bmiHeader.biSizeImage<<endl;
+ //outMediaType->SetSampleSize(locVideoFormat->bmiHeader.biSizeImage);
+ //debugLog<<"Returning from GetMediaType"<<endl;
+ return S_OK;
+ } else {
+ return VFW_S_NO_MORE_ITEMS;
+ }
+}
+
+void TheoraDecodeFilter::ResetFrameCount() {
+ mFrameCount = 0;
+
+}
+HRESULT TheoraDecodeFilter::Transform(IMediaSample* inInputSample, IMediaSample* outOutputSample) {
+
+ //CAutoLock locLock(mStreamLock);
+ //debugLog<<endl<<"Transform "<<endl;
+ //debugLog<<"outOutputSample Size = "<<outOutputSample->
+ HRESULT locHR;
+ BYTE* locBuff = NULL;
+ //Get a source poitner into the input buffer
+ locHR = inInputSample->GetPointer(&locBuff);
+ BYTE* locNewBuff = new unsigned char[inInputSample->GetActualDataLength()];
+ memcpy((void*)locNewBuff, (const void*)locBuff, inInputSample->GetActualDataLength());
+
+
+ if (FAILED(locHR)) {
+ //debugLog<<"Receive : Get pointer failed..."<<locHR<<endl;
+ return locHR;
+ } else {
+ //debugLog<<"Receive : Get pointer succeeds..."<<endl;
+ //New start time hacks
+ REFERENCE_TIME locStart = 0;
+ REFERENCE_TIME locEnd = 0;
+ inInputSample->GetTime(&locStart, &locEnd);
+ //Error chacks needed here
+ //debugLog<<"Input Sample Time - "<<locStart<<" to "<<locEnd<<endl;
+
+ //More work arounds for that stupid granule pos scheme in theora!
+ REFERENCE_TIME locTimeBase = 0;
+ REFERENCE_TIME locDummy = 0;
+ inInputSample->GetMediaTime(&locTimeBase, &locDummy);
+ mSeekTimeBase = locTimeBase;
+ //
+
+ //debugLog<<"SeekTimeBase = "<<mSeekTimeBase<<endl;
+
+ if ((mLastSeenStartGranPos != locStart) && (locStart != -1)) {
+ //debugLog<<"Resetting frame count"<<endl;
+ ResetFrameCount();
+ mLastSeenStartGranPos = locStart;
+ //debugLog<<"Setting base gran pos to "<<locStart<<endl;
+ }
+
+ //End of additions
+
+
+
+ AM_MEDIA_TYPE* locMediaType = NULL;
+ inInputSample->GetMediaType(&locMediaType);
+ if (locMediaType == NULL) {
+ //debugLog<<"No dynamic change..."<<endl;
+ } else {
+ //debugLog<<"Attempting dynamic change..."<<endl;
+ }
+
+ //This packet is given to the decoder.
+ StampedOggPacket* locPacket = new StampedOggPacket(locNewBuff, inInputSample->GetActualDataLength(), false, false, locStart, locEnd, StampedOggPacket::OGG_END_ONLY);
+ yuv_buffer* locYUV = mTheoraDecoder->decodeTheora(locPacket);
+ if (locYUV != NULL) {
+ if (TheoraDecoded(locYUV, outOutputSample) != 0) {
+ //debugLog<<"Decoded *** FALSE ***"<<endl;
+ return S_FALSE;
+ }
+ } else {
+ //debugLog<<"!@&#^()!&@#!()*@#&)!(*@#&()!*@# NULL Decode"<<endl;
+ return S_FALSE;
+ }
+
+ return S_OK;
+
+ }
+
+}
+
+int TheoraDecodeFilter::TheoraDecoded (yuv_buffer* inYUVBuffer, IMediaSample* outSample)
+{
+ //debugLog<<"TheoraDecoded... #################### "<<endl;
+
+
+ if (!mBegun) {
+ //debugLog<<"First time..."<<endl;
+ mBegun = true;
+
+ //How many UNITS does one frame take.
+ mFrameDuration = (UNITS * mTheoraFormatInfo->frameRateDenominator) / (mTheoraFormatInfo->frameRateNumerator);
+
+ mFrameSize = (mHeight * mWidth * 3) / 2;
+ mFrameCount = 0;
+ //debugLog<<"Frame Durn = "<<mFrameDuration<<endl;
+ //debugLog<<"FrameSize = "<<mFrameSize<<endl;
+
+
+ }
+
+ //debugLog<<"y_height x width = "<<inYUVBuffer->y_height<<" x "<<inYUVBuffer->y_width<<" ("<<inYUVBuffer->y_stride<<endl;
+ //debugLog<<"uv_height x width = "<<inYUVBuffer->uv_height<<" x "<<inYUVBuffer->uv_width<<" ("<<inYUVBuffer->y_stride<<endl;
+
+ //debugLog<<"mWidth x mHeight = "<<mWidth<<" x "<<mHeight<<endl;
+ //debugLog<<"mFrameSize = "<<mFrameSize<<endl;
+ //debugLog<<"Offsets x,y = "<<mXOffset<<", "<<mYOffset<<endl;
+ ////FIX::: Most of this will be obselete... the demux does it all.
+ //
+
+ ////TO DO::: Fix this up... needs to move around order and some only needs to be done once, move it into the block aboce and use member data
+
+ ////Make the start timestamp
+ ////FIX:::Abstract this calculation
+ //DbgLog((LOG_TRACE,1,TEXT("Frame Count = %d"), mFrameCount));
+ //debugLog<<"Frame Count = "<<mFrameCount<<endl;
+ //REFERENCE_TIME locFrameStart = CurrentStartTime() + (mFrameCount * mFrameDuration);
+
+ //Timestamp hacks start here...
+ unsigned long locMod = (unsigned long)pow(2, mTheoraFormatInfo->maxKeyframeInterval);
+
+ //DbgLog((LOG_TRACE,1,TEXT("locSeenGranPos = %d"), mLastSeenStartGranPos));
+ //DbgLog((LOG_TRACE,1,TEXT("locMod = %d"), locMod));
+
+ //debugLog<<"locMod = "<<locMod<<endl;
+ unsigned long locInterFrameNo = (mLastSeenStartGranPos) % locMod;
+
+ //DbgLog((LOG_TRACE,1,TEXT("InterFrameNo = %d"), locInterFrameNo));
+ //debugLog<<"Interframe No = "<<locInterFrameNo<<endl;
+ LONGLONG locAbsFramePos = ((mLastSeenStartGranPos >> mTheoraFormatInfo->maxKeyframeInterval)) + locInterFrameNo;
+
+ //debugLog<<"Abs frame No = "<<locAbsFramePos<<endl;
+ //DbgLog((LOG_TRACE,1,TEXT("AbsFrameNo = %d"), locAbsFramePos));
+ //DbgLog((LOG_TRACE,1,TEXT("mSeekTimeBase = %d"), mSeekTimeBase));
+
+ //debugLog<<"Seek time base = "<<mSeekTimeBase<<endl;
+ REFERENCE_TIME locTimeBase = (locAbsFramePos * mFrameDuration) - mSeekTimeBase;
+
+ //debugLog<<"LocTimeBase = "<<locTimeBase<<endl;
+
+ DbgLog((LOG_TRACE,1,TEXT("locTimeBase = %d"), locTimeBase));
+ //
+ //
+
+ REFERENCE_TIME locFrameStart = locTimeBase + (mFrameCount * mFrameDuration);
+ //Increment the frame counter
+ mFrameCount++;
+
+ //Make the end frame counter
+ //REFERENCE_TIME locFrameEnd = CurrentStartTime() + (mFrameCount * mFrameDuration);
+ REFERENCE_TIME locFrameEnd = locTimeBase + (mFrameCount * mFrameDuration);
+
+
+
+
+ //debugLog<<"Sample times = "<<locFrameStart<<" to "<<locFrameEnd<<endl;
+
+ //FILTER_STATE locFS;
+ //GetState(0, &locFS);
+ //debugLog<<"State Before = "<<locFS<<endl;
+ //HRESULT locHR = mOutputPin->GetDeliveryBuffer(&locSample, &locFrameStart, &locFrameEnd, locFlags);
+ //GetState(0, &locFS);
+ //debugLog<<"State After = "<<locFS<<endl;
+
+
+
+ //Debuggin code
+ AM_MEDIA_TYPE* locMediaType = NULL;
+ outSample->GetMediaType(&locMediaType);
+ if (locMediaType == NULL) {
+ //debugLog<<"No dynamic change..."<<endl;
+ } else {
+ //debugLog<<"Attempting dynamic change..."<<endl;
+ if (locMediaType->majortype == MEDIATYPE_Video) {
+ //debugLog<<"Still MEDIATYPE_Video"<<endl;
+ }
+
+ if (locMediaType->subtype == MEDIASUBTYPE_YV12) {
+ //debugLog<<"Still MEDIASUBTYPE_YV12"<<endl;
+ }
+
+ if (locMediaType->formattype == FORMAT_VideoInfo) {
+ //debugLog<<"Still FORMAT_VideoInfo"<<endl;
+ VIDEOINFOHEADER* locVF = (VIDEOINFOHEADER*)locMediaType->pbFormat;
+ //debugLog<<"Size = "<<locVF->bmiHeader.biSizeImage<<endl;
+ //debugLog<<"Dim = "<<locVF->bmiHeader.biWidth<<" x " <<locVF->bmiHeader.biHeight<<endl;
+ }
+
+ //debugLog<<"Major : "<<DSStringer::GUID2String(&locMediaType->majortype);
+ //debugLog<<"Minor : "<<DSStringer::GUID2String(&locMediaType->subtype);
+ //debugLog<<"Format : "<<DSStringer::GUID2String(&locMediaType->formattype);
+ //debugLog<<"Form Sz: "<<locMediaType->cbFormat;
+
+
+ }
+ //
+
+ ////Create pointers for the samples buffer to be assigned to
+ BYTE* locBuffer = NULL;
+
+ //
+ ////Make our pointers set to point to the samples buffer
+ outSample->GetPointer(&locBuffer);
+
+
+
+
+ //Fill the buffer with yuv data...
+ //
+
+
+
+ //Set up the pointers
+ unsigned char* locDestUptoPtr = locBuffer;
+ char* locSourceUptoPtr = inYUVBuffer->y;
+
+ //Strides from theora are generally -'ve
+ long locYStride = inYUVBuffer->y_stride;
+ long locUVStride = inYUVBuffer->uv_stride;
+
+ //debugLog<<"Y Stride = "<<locYStride<<endl;
+ //debugLog<<"UV Stride = "<<locUVStride<<endl;
+ //
+ //Y DATA
+ //
+
+ //NEW WAY with offsets Y Data
+ long locTopPad = inYUVBuffer->y_height - mHeight - mYOffset;
+ //debugLog<<"--------- PAD = "<<locTopPad<<endl;
+ ASSERT(locTopPad >= 0);
+ if (locTopPad < 0) {
+ locTopPad = 0;
+ } else {
+
+ }
+
+ //Skip the top padding
+ locSourceUptoPtr += (locTopPad * locYStride);
+
+ for (long line = 0; line < mHeight; line++) {
+ memcpy((void*)(locDestUptoPtr), (const void*)(locSourceUptoPtr + mXOffset), mWidth);
+ locSourceUptoPtr += locYStride;
+ locDestUptoPtr += mWidth;
+ }
+
+ locSourceUptoPtr += (mYOffset * locYStride);
+
+ //debugLog<<"Dest Distance(y) = "<<(unsigned long)(locDestUptoPtr - locBuffer)<<endl;
+
+ //Source advances by (y_height * y_stride)
+ //Dest advances by (mHeight * mWidth)
+
+ //
+ //V DATA
+ //
+
+ //Half the padding for uv planes... is this correct ?
+ locTopPad = locTopPad /2;
+
+ locSourceUptoPtr = inYUVBuffer->v;
+
+ //Skip the top padding
+ locSourceUptoPtr += (locTopPad * locYStride);
+
+ for (long line = 0; line < mHeight / 2; line++) {
+ memcpy((void*)(locDestUptoPtr), (const void*)(locSourceUptoPtr + (mXOffset / 2)), mWidth / 2);
+ locSourceUptoPtr += locUVStride;
+ locDestUptoPtr += (mWidth / 2);
+ }
+ locSourceUptoPtr += ((mYOffset/2) * locUVStride);
+
+ //Source advances by (locTopPad + mYOffset/2 + mHeight /2) * uv_stride
+ //where locTopPad for uv = (inYUVBuffer->y_height - mHeight - mYOffset) / 2
+ // = (inYUVBuffer->yheight/2 - mHeight/2 - mYOffset/2)
+ // so source advances by (y_height/2) * uv_stride
+ //Dest advances by (mHeight * mWidth) /4
+
+
+ //debugLog<<"Dest Distance(V) = "<<(unsigned long)(locDestUptoPtr - locBuffer)<<endl;
+ //
+ //U DATA
+ //
+
+ locSourceUptoPtr = inYUVBuffer->u;
+
+ //Skip the top padding
+ locSourceUptoPtr += (locTopPad * locYStride);
+
+ for (long line = 0; line < mHeight / 2; line++) {
+ memcpy((void*)(locDestUptoPtr), (const void*)(locSourceUptoPtr + (mXOffset / 2)), mWidth / 2);
+ locSourceUptoPtr += locUVStride;
+ locDestUptoPtr += (mWidth / 2);
+ }
+ locSourceUptoPtr += ((mYOffset/2) * locUVStride);
+
+ //debugLog<<"Dest Distance(U) = "<<(unsigned long)(locDestUptoPtr - locBuffer)<<endl;
+ //debugLog<<"Frame Size = "<<mFrameSize<<endl;
+
+ //Set the sample parameters.
+ BOOL locIsKeyFrame = (locInterFrameNo == 0);
+ locIsKeyFrame = TRUE;
+ if (locIsKeyFrame == TRUE) {
+ //debugLog<<"KEY FRAME ++++++"<<endl;
+ };
+ SetSampleParams(outSample, mFrameSize, &locFrameStart, &locFrameEnd, locIsKeyFrame);
+
+
+
+ return 0;
+
+
+}
+
+
+HRESULT TheoraDecodeFilter::SetMediaType(PIN_DIRECTION inDirection, const CMediaType* inMediaType) {
+
+ if (inDirection == PINDIR_INPUT) {
+ if (inMediaType->subtype == MEDIASUBTYPE_Theora) {
+ //debugLog<<"Setting format block"<<endl;
+ setTheoraFormat((sTheoraFormatBlock*)inMediaType->pbFormat);
+
+ //Set some other stuff here too...
+ mXOffset = ((sTheoraFormatBlock*)inMediaType->pbFormat)->xOffset;
+ mYOffset = ((sTheoraFormatBlock*)inMediaType->pbFormat)->yOffset;
+ //mHeight = ((sTheoraFormatBlock*)inMediaType->pbFormat)->frameHeight;
+ //mWidth = ((sTheoraFormatBlock*)inMediaType->pbFormat)->frameWidth;
+ //debugLog<<"Setting height width to "<<mWidth<<" x "<<mHeight<<endl;
+ //debugLog<<"Frame Dims were "<<((sTheoraFormatBlock*)inMediaType->pbFormat)->frameWidth<<" x "<<((sTheoraFormatBlock*)inMediaType->pbFormat)->frameHeight<<endl;
+
+ } else {
+ //Failed... should never be here !
+ throw 0;
+ }
+ return CTransformFilter::SetMediaType(PINDIR_INPUT, inMediaType);//CVideoTransformFilter::SetMediaType(PINDIR_INPUT, inMediaType);
+ } else {
+ //debugLog<<"Setting Output Stuff"<<endl;
+ //Output pin SetMediaType
+ //VIDEOINFOHEADER* locVideoHeader = (VIDEOINFOHEADER*)inMediaType->Format();
+ //mHeight = (unsigned long)abs(locVideoHeader->bmiHeader.biHeight);
+ //mWidth = (unsigned long)abs(locVideoHeader->bmiHeader.biWidth);
+
+
+ //mFrameSize = (unsigned long)locVideoHeader->bmiHeader.biSizeImage;
+
+ //debugLog<<"Size = "<<mWidth<<" x "<<mHeight<<" ("<<mFrameSize<<")"<<endl;
+ //debugLog<<"Size in Format = "<<locVideoHeader->bmiHeader.biWidth<<" x "<<locVideoHeader->bmiHeader.biHeight<<endl;
+ return CTransformFilter::SetMediaType(PINDIR_OUTPUT, inMediaType);//CVideoTransformFilter::SetMediaType(PINDIR_OUTPUT, inMediaType);
+ }
+}
+
+
+bool TheoraDecodeFilter::SetSampleParams(IMediaSample* outMediaSample, unsigned long inDataSize, REFERENCE_TIME* inStartTime, REFERENCE_TIME* inEndTime, BOOL inIsSync)
+{
+ outMediaSample->SetTime(inStartTime, inEndTime);
+ outMediaSample->SetMediaTime(NULL, NULL);
+ outMediaSample->SetActualDataLength(inDataSize);
+ outMediaSample->SetPreroll(FALSE);
+ outMediaSample->SetDiscontinuity(FALSE);
+ outMediaSample->SetSyncPoint(inIsSync);
+ return true;
+}
+//BOOL TheoraDecodeFilter::ShouldSkipFrame(IMediaSample* inSample) {
+// //m_bSkipping = FALSE;
+// debugLog<<"Don't skip"<<endl;
+// return FALSE;
+//}
+
+sTheoraFormatBlock* TheoraDecodeFilter::getTheoraFormatBlock()
+{
+ return mTheoraFormatInfo;
+}
+void TheoraDecodeFilter::setTheoraFormat(sTheoraFormatBlock* inFormatBlock)
+{
+ delete mTheoraFormatInfo;
+ mTheoraFormatInfo = new sTheoraFormatBlock; //Deelted in destructor.
+ *mTheoraFormatInfo = *inFormatBlock;
+}
+
+CBasePin* TheoraDecodeFilter::GetPin(int inPinNo)
+{
+ HRESULT locHR = S_OK;
+
+ // Create an input pin if necessary
+
+ if (m_pInput == NULL) {
+
+ m_pInput = new TheoraDecodeInputPin(this, &locHR); //Deleted in base destructor
+
+
+ if (m_pInput == NULL) {
+ return NULL;
+ }
+ m_pOutput = new TheoraDecodeOutputPin(this, &locHR); //Deleted in base destructor
+
+
+ if (m_pOutput == NULL) {
+ delete m_pInput;
+ m_pInput = NULL;
+ }
+ }
+
+ // Return the pin
+
+ if (inPinNo == 0) {
+ return m_pInput;
+ } else if (inPinNo == 1) {
+ return m_pOutput;
+ } else {
+ return NULL;
+ }
+}
+//---------------------------------------
+//OLD IMPLOEMENTATION....
+//---------------------------------------
+//#include "theoradecodefilter.h"
+//
+//
+//
+////COM Factory Template
+//CFactoryTemplate g_Templates[] =
+//{
+// {
+// L"Theora Decode Filter", // Name
+// &CLSID_TheoraDecodeFilter, // CLSID
+// TheoraDecodeFilter::CreateInstance, // Method to create an instance of Theora Decoder
+// NULL, // Initialization function
+// NULL // Set-up information (for filters)
+// }
+//
+//};
+//
+//// Generic way of determining the number of items in the template
+//int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
+//
+//
+//
+////Theora Decode Filter Implementation
+////==================================
+//TheoraDecodeFilter::TheoraDecodeFilter()
+// : AbstractVideoDecodeFilter(NAME("Ogg Video Decoder"), CLSID_TheoraDecodeFilter, THEORA)
+// , mTheoraFormatInfo(NULL)
+//{
+//
+// bool locWasConstructed = ConstructPins();
+//}
+//
+//bool TheoraDecodeFilter::ConstructPins()
+//{
+//
+// //Output pin must be done first because it's passed to the input pin.
+// mOutputPin = new TheoraDecodeOutputPin(this, m_pLock);
+//
+// CMediaType* locAcceptMediaType = new CMediaType(&MEDIATYPE_Video);
+// locAcceptMediaType->subtype = MEDIASUBTYPE_Theora;
+// locAcceptMediaType->formattype = FORMAT_Theora;
+// mInputPin = new TheoraDecodeInputPin(this, m_pLock, mOutputPin, locAcceptMediaType);
+// return true;
+//}
+//
+//TheoraDecodeFilter::~TheoraDecodeFilter(void)
+//{
+// //DestroyPins();
+// delete mTheoraFormatInfo;
+//}
+//
+//CUnknown* WINAPI TheoraDecodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
+//{
+// //This routine is the COM implementation to create a new Filter
+// TheoraDecodeFilter *pNewObject = new TheoraDecodeFilter();
+// if (pNewObject == NULL) {
+// *pHr = E_OUTOFMEMORY;
+// }
+// return pNewObject;
+//}
+//
+//STDMETHODIMP TheoraDecodeFilter::GetState(DWORD dw, FILTER_STATE *pState)
+//{
+// CheckPointer(pState, E_POINTER);
+// *pState = m_State;
+// if (m_State == State_Paused) {
+// return VFW_S_CANT_CUE;
+// } else {
+// return S_OK;
+// }
+//}
+//
+////QUERY::: Do we need these ? Aren't we all friedns here ??
+////RESULT::: Keep them, set function must be kept... get could go... but keep for consistency
+//sTheoraFormatBlock* TheoraDecodeFilter::getTheoraFormatBlock()
+//{
+// return mTheoraFormatInfo;
+//}
+//void TheoraDecodeFilter::setTheoraFormat(sTheoraFormatBlock* inFormatBlock)
+//{
+// delete mTheoraFormatInfo;
+// mTheoraFormatInfo = new sTheoraFormatBlock;
+// *mTheoraFormatInfo = *inFormatBlock;
+//}
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,140 +1,140 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-#include "Theoradecoderdllstuff.h"
-#include "theoradecodeoutputpin.h"
-#include "theoradecodeinputpin.h"
-#include <math.h>
-//#include "DSStringer.h"
-#include "TheoraDecoder.h"
-#include <fstream>
-using namespace std;
-class TheoraDecodeFilter
- //: public CVideoTransformFilter
- : public CTransformFilter
-
-{
-public:
- TheoraDecodeFilter(void);
- virtual ~TheoraDecodeFilter(void);
-
- //COM Creator Function
- static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
-
- //CTransfrom filter pure virtuals
- virtual HRESULT CheckInputType(const CMediaType* inMediaType);
- virtual HRESULT CheckTransform(const CMediaType* inInputMediaType, const CMediaType* inOutputMediaType);
- virtual HRESULT DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES* inPropertyRequest);
- virtual HRESULT GetMediaType(int inPosition, CMediaType* outOutputMediaType);
- virtual HRESULT Transform(IMediaSample* inInputSample, IMediaSample* outOutputSample);
-
- //Overrides
- virtual HRESULT TheoraDecodeFilter::SetMediaType(PIN_DIRECTION inDirection, const CMediaType* inMediaType);
- //virtual BOOL ShouldSkipFrame(IMediaSample* inSample);
- virtual CBasePin* TheoraDecodeFilter::GetPin(int inPinNo);
- //Helpers
- sTheoraFormatBlock* getTheoraFormatBlock();
- void setTheoraFormat(sTheoraFormatBlock* inFormatBlock);
-protected:
- virtual void ResetFrameCount();
- void FillMediaType(CMediaType* outMediaType, unsigned long inSampleSize);
- bool FillVideoInfoHeader(VIDEOINFOHEADER* inFormatBuffer);
- bool SetSampleParams(IMediaSample* outMediaSample, unsigned long inDataSize, REFERENCE_TIME* inStartTime, REFERENCE_TIME* inEndTime, BOOL inIsSync);
- unsigned long mHeight;
- unsigned long mWidth;
- unsigned long mFrameSize;
- unsigned long mFrameCount;
- unsigned long mYOffset;
- unsigned long mXOffset;
- __int64 mFrameDuration;
- bool mBegun;
- TheoraDecoder* mTheoraDecoder;
-
-
- int TheoraDecoded (yuv_buffer* inYUVBuffer, IMediaSample* outSample);
-
-
- __int64 mSeekTimeBase;
- __int64 mLastSeenStartGranPos;
- //Format Block
- sTheoraFormatBlock* mTheoraFormatInfo;
- //fstream debugLog;
-};
-//---------------------------------------
-//OLD IMPLOEMENTATION....
-//---------------------------------------
-////Include Files
-//#include "Theoradecoderdllstuff.h"
-//#include "AbstractVideoDecodeFilter.h"
-//
-////Forward Declarations
-//struct sTheoraFormatBlock;
-//class TheoraDecodeInputPin;
-//class TheoraDecodeOutputPin;
-//
-////Class Interface
-//class TheoraDecodeFilter
-// //Base Classes
-// : public AbstractVideoDecodeFilter
-//{
-//public:
-// //Friends
-// friend class TheoraDecodeInputPin;
-// friend class TheoraDecodeOutputPin;
-//
-//
-//
-//
-// //Constructors and Destructors
-// TheoraDecodeFilter(void);
-// virtual ~TheoraDecodeFilter(void);
-//
-// //COM Creator Function
-// static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
-//
-// //IMediaFilter OVerride - This lets us tell the graph we may not produce data in pause state so don't block.
-// virtual STDMETHODIMP GetState(DWORD dw, FILTER_STATE *pState);
-//
-//
-//
-// //VIRTUAL FUNCTIONS - AbstractAudioDecodeFilter
-// virtual bool ConstructPins();
-//
-// //FIX::: Do we need these ? Aren't they all friends ??
-// virtual sTheoraFormatBlock* getTheoraFormatBlock();
-// virtual void setTheoraFormat(sTheoraFormatBlock* inFormatBlock);
-//
-//protected:
-// //Format Block
-// sTheoraFormatBlock* mTheoraFormatInfo;
-//};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+#include "Theoradecoderdllstuff.h"
+#include "theoradecodeoutputpin.h"
+#include "theoradecodeinputpin.h"
+#include <math.h>
+//#include "DSStringer.h"
+#include "TheoraDecoder.h"
+#include <fstream>
+using namespace std;
+class TheoraDecodeFilter
+ //: public CVideoTransformFilter
+ : public CTransformFilter
+
+{
+public:
+ TheoraDecodeFilter(void);
+ virtual ~TheoraDecodeFilter(void);
+
+ //COM Creator Function
+ static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+
+ //CTransfrom filter pure virtuals
+ virtual HRESULT CheckInputType(const CMediaType* inMediaType);
+ virtual HRESULT CheckTransform(const CMediaType* inInputMediaType, const CMediaType* inOutputMediaType);
+ virtual HRESULT DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES* inPropertyRequest);
+ virtual HRESULT GetMediaType(int inPosition, CMediaType* outOutputMediaType);
+ virtual HRESULT Transform(IMediaSample* inInputSample, IMediaSample* outOutputSample);
+
+ //Overrides
+ virtual HRESULT TheoraDecodeFilter::SetMediaType(PIN_DIRECTION inDirection, const CMediaType* inMediaType);
+ //virtual BOOL ShouldSkipFrame(IMediaSample* inSample);
+ virtual CBasePin* TheoraDecodeFilter::GetPin(int inPinNo);
+ //Helpers
+ sTheoraFormatBlock* getTheoraFormatBlock();
+ void setTheoraFormat(sTheoraFormatBlock* inFormatBlock);
+protected:
+ virtual void ResetFrameCount();
+ void FillMediaType(CMediaType* outMediaType, unsigned long inSampleSize);
+ bool FillVideoInfoHeader(VIDEOINFOHEADER* inFormatBuffer);
+ bool SetSampleParams(IMediaSample* outMediaSample, unsigned long inDataSize, REFERENCE_TIME* inStartTime, REFERENCE_TIME* inEndTime, BOOL inIsSync);
+ unsigned long mHeight;
+ unsigned long mWidth;
+ unsigned long mFrameSize;
+ unsigned long mFrameCount;
+ unsigned long mYOffset;
+ unsigned long mXOffset;
+ __int64 mFrameDuration;
+ bool mBegun;
+ TheoraDecoder* mTheoraDecoder;
+
+
+ int TheoraDecoded (yuv_buffer* inYUVBuffer, IMediaSample* outSample);
+
+
+ __int64 mSeekTimeBase;
+ __int64 mLastSeenStartGranPos;
+ //Format Block
+ sTheoraFormatBlock* mTheoraFormatInfo;
+ //fstream debugLog;
+};
+//---------------------------------------
+//OLD IMPLOEMENTATION....
+//---------------------------------------
+////Include Files
+//#include "Theoradecoderdllstuff.h"
+//#include "AbstractVideoDecodeFilter.h"
+//
+////Forward Declarations
+//struct sTheoraFormatBlock;
+//class TheoraDecodeInputPin;
+//class TheoraDecodeOutputPin;
+//
+////Class Interface
+//class TheoraDecodeFilter
+// //Base Classes
+// : public AbstractVideoDecodeFilter
+//{
+//public:
+// //Friends
+// friend class TheoraDecodeInputPin;
+// friend class TheoraDecodeOutputPin;
+//
+//
+//
+//
+// //Constructors and Destructors
+// TheoraDecodeFilter(void);
+// virtual ~TheoraDecodeFilter(void);
+//
+// //COM Creator Function
+// static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+//
+// //IMediaFilter OVerride - This lets us tell the graph we may not produce data in pause state so don't block.
+// virtual STDMETHODIMP GetState(DWORD dw, FILTER_STATE *pState);
+//
+//
+//
+// //VIRTUAL FUNCTIONS - AbstractAudioDecodeFilter
+// virtual bool ConstructPins();
+//
+// //FIX::: Do we need these ? Aren't they all friends ??
+// virtual sTheoraFormatBlock* getTheoraFormatBlock();
+// virtual void setTheoraFormat(sTheoraFormatBlock* inFormatBlock);
+//
+//protected:
+// //Format Block
+// sTheoraFormatBlock* mTheoraFormatInfo;
+//};
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeFilter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeInputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeInputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,440 +1,440 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "theoradecodeinputpin.h"
-
-
-TheoraDecodeInputPin::TheoraDecodeInputPin(CTransformFilter* inParentFilter, HRESULT* outHR)
- : CTransformInputPin(NAME("Theora Input Pin"), inParentFilter, outHR, L"Theora In")
-{
- //debugLog.open("G:\\logs\\theoinput.log", ios_base::out);
-}
-TheoraDecodeInputPin::~TheoraDecodeInputPin() {
- //debugLog.close();
-}
-
-STDMETHODIMP TheoraDecodeInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
- //debugLog<<"Querying interface"<<endl;
- if (riid == IID_IMediaSeeking) {
- //debugLog<<"Got Seeker"<<endl;
- *ppv = (IMediaSeeking*)this;
- ((IUnknown*)*ppv)->AddRef();
-
- return NOERROR;
- }
-
- return CBaseInputPin::NonDelegatingQueryInterface(riid, ppv);
-}
-
-HRESULT TheoraDecodeInputPin::BreakConnect() {
- CAutoLock locLock(m_pLock);
- //debugLog<<"Break conenct"<<endl;
- //Need a lock ??
- ReleaseDelegate();
- return CTransformInputPin::BreakConnect();
-}
-HRESULT TheoraDecodeInputPin::CompleteConnect (IPin *inReceivePin) {
- CAutoLock locLock(m_pLock);
- //debugLog<<"Complete conenct"<<endl;
- IMediaSeeking* locSeeker = NULL;
- inReceivePin->QueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
- if (locSeeker == NULL) {
- //debugLog<<"Seeker is null"<<endl;
- }
- SetDelegate(locSeeker);
- return CTransformInputPin::CompleteConnect(inReceivePin);
-}
-
-//----------------------
-//OLD IMPLEMENTATION
-//----------------------
-//TheoraDecodeInputPin::TheoraDecodeInputPin(AbstractVideoDecodeFilter* inFilter, CCritSec* inFilterLock, AbstractVideoDecodeOutputPin* inOutputPin, CMediaType* inAcceptMediaType)
-// : AbstractVideoDecodeInputPin(inFilter, inFilterLock, inOutputPin, NAME("TheoraDecodeInputPin"), L"Theora In", inAcceptMediaType)
-// , mXOffset(0)
-// , mYOffset(0)
-//
-//{
-// debugLog.open("G:\\logs\\theoInputPin.log", ios_base::out);
-// ConstructCodec();
-//}
-//
-//STDMETHODIMP TheoraDecodeInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-//{
-// if (riid == IID_IMediaSeeking) {
-// *ppv = (IMediaSeeking*)this;
-// ((IUnknown*)*ppv)->AddRef();
-// return NOERROR;
-// }
-//
-// return CBaseInputPin::NonDelegatingQueryInterface(riid, ppv);
-//}
-//bool TheoraDecodeInputPin::ConstructCodec() {
-//
-//
-// mTheoraDecoder = new TheoraDecoder;
-// mTheoraDecoder->initCodec();
-// return true;
-//}
-//void TheoraDecodeInputPin::DestroyCodec() {
-// delete mTheoraDecoder;
-//}
-//TheoraDecodeInputPin::~TheoraDecodeInputPin(void)
-//{
-// debugLog.close();
-// DestroyCodec();
-//
-//}
-//
-//
-//
-//int TheoraDecodeInputPin::TheoraDecoded (yuv_buffer* inYUVBuffer)
-//{
-// DbgLog((LOG_TRACE,1,TEXT("Decoded... Sending...")));
-//
-// debugLog<<"TheoraDecoded... "<<endl;
-//
-// TheoraDecodeFilter* locFilter = reinterpret_cast<TheoraDecodeFilter*>(m_pFilter);
-// //
-// if (!mBegun) {
-//
-//
-//
-// mBegun = true;
-//
-// //How many UNITS does one frame take.
-// mFrameDuration = (UNITS * locFilter->mTheoraFormatInfo->frameRateDenominator) / (locFilter->mTheoraFormatInfo->frameRateNumerator);
-// mFrameSize = (mHeight * mWidth * 3) / 2;
-// mFrameCount = 0;
-// }
-//
-//
-//
-// ////FIX::: Most of this will be obselete... the demux does it all.
-// //
-//
-// ////TO DO::: Fix this up... needs to move around order and some only needs to be done once, move it into the block aboce and use member data
-//
-// ////Make the start timestamp
-// ////FIX:::Abstract this calculation
-// DbgLog((LOG_TRACE,1,TEXT("Frame Count = %d"), mFrameCount));
-// //REFERENCE_TIME locFrameStart = CurrentStartTime() + (mFrameCount * mFrameDuration);
-//
-// //Timestamp hacks start here...
-// unsigned long locMod = (unsigned long)pow(2, locFilter->mTheoraFormatInfo->maxKeyframeInterval);
-// DbgLog((LOG_TRACE,1,TEXT("locSeenGranPos = %d"), mLastSeenStartGranPos));
-// DbgLog((LOG_TRACE,1,TEXT("locMod = %d"), locMod));
-// unsigned long locInterFrameNo = (mLastSeenStartGranPos) % locMod;
-// DbgLog((LOG_TRACE,1,TEXT("InterFrameNo = %d"), locInterFrameNo));
-// LONGLONG locAbsFramePos = ((mLastSeenStartGranPos >> locFilter->mTheoraFormatInfo->maxKeyframeInterval)) + locInterFrameNo;
-// DbgLog((LOG_TRACE,1,TEXT("AbsFrameNo = %d"), locAbsFramePos));
-// DbgLog((LOG_TRACE,1,TEXT("mSeekTimeBase = %d"), mSeekTimeBase));
-// REFERENCE_TIME locTimeBase = (locAbsFramePos * mFrameDuration) - mSeekTimeBase;
-// DbgLog((LOG_TRACE,1,TEXT("locTimeBase = %d"), locTimeBase));
-// //
-// //
-//
-// REFERENCE_TIME locFrameStart = locTimeBase + (mFrameCount * mFrameDuration);
-// //Increment the frame counter
-// mFrameCount++;
-//
-// //Make the end frame counter
-// //REFERENCE_TIME locFrameEnd = CurrentStartTime() + (mFrameCount * mFrameDuration);
-// REFERENCE_TIME locFrameEnd = locTimeBase + (mFrameCount * mFrameDuration);
-//
-// DbgLog((LOG_TRACE,1,TEXT("Frame Runs From %d"), locFrameStart));
-// DbgLog((LOG_TRACE,1,TEXT("Frame Runs To %d"), locFrameEnd));
-//
-// IMediaSample* locSample = NULL;
-// debugLog<<"Sample times = "<<locFrameStart<<" to "<<locFrameEnd<<endl;
-// DWORD locFlags = 0;//AM_GBF_PREVFRAMESKIPPED | AM_GBF_NOTASYNCPOINT;
-//
-// FILTER_STATE locFS;
-// mParentFilter->GetState(0, &locFS);
-// debugLog<<"State Before = "<<locFS<<endl;
-// HRESULT locHR = mOutputPin->GetDeliveryBuffer(&locSample, &locFrameStart, &locFrameEnd, locFlags);
-// mParentFilter->GetState(0, &locFS);
-// debugLog<<"State After = "<<locFS<<endl;
-// if (locHR != S_OK) {
-// debugLog<<"Get DeliveryBuffer FAILED with "<<locHR<<endl;
-// debugLog<<"locSample is "<<(unsigned long)locSample<<endl;
-// //We get here when the application goes into stop mode usually.
-//
-// switch (locHR) {
-// case VFW_E_SIZENOTSET:
-// debugLog<<"SIZE NOT SET"<<endl;
-// break;
-// case VFW_E_NOT_COMMITTED:
-// debugLog<<"NOT COMMITTED"<<endl;
-// break;
-// case VFW_E_TIMEOUT:
-// debugLog<<"TIMEOUT"<<endl;
-// break;
-// case VFW_E_STATE_CHANGED:
-// debugLog<<"STATE CHANGED"<<endl;
-// return S_OK;
-// default:
-// debugLog<<"SOMETHING ELSE !!!"<<endl;
-// break;
-// }
-// return locHR;
-// }
-//
-// debugLog<<"GetDeliveryBuffer &** SUCCEEDED **"<<endl;
-//
-// //Debuggin code
-// AM_MEDIA_TYPE* locMediaType = NULL;
-// locSample->GetMediaType(&locMediaType);
-// if (locMediaType == NULL) {
-// debugLog<<"No dynamic change..."<<endl;
-// } else {
-// debugLog<<"Attempting dynamic change..."<<endl;
-// if (locMediaType->majortype == MEDIATYPE_Video) {
-// debugLog<<"Still MEDIATYPE_Video"<<endl;
-// }
-//
-// if (locMediaType->subtype == MEDIASUBTYPE_YV12) {
-// debugLog<<"Still MEDIASUBTYPE_YV12"<<endl;
-// }
-//
-// if (locMediaType->formattype == FORMAT_VideoInfo) {
-// debugLog<<"Still FORMAT_VideoInfo"<<endl;
-// VIDEOINFOHEADER* locVF = (VIDEOINFOHEADER*)locMediaType->pbFormat;
-// debugLog<<"Size = "<<locVF->bmiHeader.biSizeImage<<endl;
-// debugLog<<"Dim = "<<locVF->bmiHeader.biWidth<<" x " <<locVF->bmiHeader.biHeight<<endl;
-// }
-//
-// debugLog<<"Major : "<<DSStringer::GUID2String(&locMediaType->majortype);
-// debugLog<<"Minor : "<<DSStringer::GUID2String(&locMediaType->subtype);
-// debugLog<<"Format : "<<DSStringer::GUID2String(&locMediaType->formattype);
-// debugLog<<"Form Sz: "<<locMediaType->cbFormat;
-//
-//
-// }
-// //
-//
-// ////Create pointers for the samples buffer to be assigned to
-// BYTE* locBuffer = NULL;
-//
-// //
-// ////Make our pointers set to point to the samples buffer
-// locSample->GetPointer(&locBuffer);
-//
-//
-//
-// //Fill the buffer with yuv data...
-// //
-//
-//
-//
-// //Set up the pointers
-// unsigned char* locDestUptoPtr = locBuffer;
-// char* locSourceUptoPtr = inYUVBuffer->y;
-//
-// //
-// //Y DATA
-// //
-//
-// //NEW WAY with offsets Y Data
-// long locTopPad = inYUVBuffer->y_height - mHeight - mYOffset;
-// ASSERT(locTopPad >= 0);
-// if (locTopPad < 0) {
-// locTopPad = 0;
-// }
-//
-// //Skip the top padding
-// locSourceUptoPtr += (locTopPad * inYUVBuffer->y_stride);
-//
-// for (long line = 0; line < mHeight; line++) {
-// memcpy((void*)(locDestUptoPtr), (const void*)(locSourceUptoPtr + mXOffset), mWidth);
-// locSourceUptoPtr += inYUVBuffer->y_stride;
-// locDestUptoPtr += mWidth;
-// }
-//
-// locSourceUptoPtr += (mYOffset * inYUVBuffer->y_stride);
-//
-// //Source advances by (y_height * y_stride)
-// //Dest advances by (mHeight * mWidth)
-//
-// //
-// //V DATA
-// //
-//
-// //Half the padding for uv planes... is this correct ?
-// locTopPad = locTopPad /2;
-//
-// locSourceUptoPtr = inYUVBuffer->v;
-//
-// //Skip the top padding
-// locSourceUptoPtr += (locTopPad * inYUVBuffer->y_stride);
-//
-// for (long line = 0; line < mHeight / 2; line++) {
-// memcpy((void*)(locDestUptoPtr), (const void*)(locSourceUptoPtr + (mXOffset / 2)), mWidth / 2);
-// locSourceUptoPtr += inYUVBuffer->uv_stride;
-// locDestUptoPtr += (mWidth / 2);
-// }
-// locSourceUptoPtr += ((mYOffset/2) * inYUVBuffer->uv_stride);
-//
-// //Source advances by (locTopPad + mYOffset/2 + mHeight /2) * uv_stride
-// //where locTopPad for uv = (inYUVBuffer->y_height - mHeight - mYOffset) / 2
-// // = (inYUVBuffer->yheight/2 - mHeight/2 - mYOffset/2)
-// // so source advances by (y_height/2) * uv_stride
-// //Dest advances by (mHeight * mWidth) /4
-//
-//
-// //
-// //U DATA
-// //
-//
-// locSourceUptoPtr = inYUVBuffer->u;
-//
-// //Skip the top padding
-// locSourceUptoPtr += (locTopPad * inYUVBuffer->y_stride);
-//
-// for (long line = 0; line < mHeight / 2; line++) {
-// memcpy((void*)(locDestUptoPtr), (const void*)(locSourceUptoPtr + (mXOffset / 2)), mWidth / 2);
-// locSourceUptoPtr += inYUVBuffer->uv_stride;
-// locDestUptoPtr += (mWidth / 2);
-// }
-// locSourceUptoPtr += ((mYOffset/2) * inYUVBuffer->uv_stride);
-//
-//
-// ////Y Data.
-// //for ( long line = 0; line < inYUVBuffer->y_height; line++) {
-// // memcpy((void*)locBuffer, (const void*)(inYUVBuffer->y + (inYUVBuffer->y_stride * (line))), inYUVBuffer->y_width);
-// // locBuffer += inYUVBuffer->y_width;
-//
-// // if (mWidth > inYUVBuffer->y_width) {
-// // memset((void*)locBuffer, 0, mWidth - inYUVBuffer->y_width);
-// // }
-// // locBuffer += mWidth - inYUVBuffer->y_width;
-// //}
-//
-// ////Pad height...
-// //for ( long line = 0; line < mHeight - inYUVBuffer->y_height; line++) {
-// // memset((void*)locBuffer, 0, mWidth);
-// // locBuffer += mWidth;
-// //}
-//
-// ////V Data
-// //for ( long line = 0; line < inYUVBuffer->uv_height; line++) {
-// // memcpy((void*)locBuffer, (const void*)(inYUVBuffer->v + (inYUVBuffer->uv_stride * (line))), inYUVBuffer->uv_width);
-// // locBuffer += inYUVBuffer->uv_width;
-//
-// // if (mWidth/2 > inYUVBuffer->uv_width) {
-// // memset((void*)locBuffer, 0, (mWidth/2) - inYUVBuffer->uv_width);
-// // }
-// // locBuffer += (mWidth/2) - inYUVBuffer->uv_width;
-// //}
-//
-// ////Pad height...
-// //for ( long line = 0; line < (mHeight/2) - inYUVBuffer->uv_height; line++) {
-// // memset((void*)locBuffer, 0, mWidth/2);
-// // locBuffer += mWidth/2;
-// //}
-//
-// ////U Data
-// //for (long line = 0; line < inYUVBuffer->uv_height; line++) {
-// // memcpy((void*)locBuffer, (const void*)(inYUVBuffer->u + (inYUVBuffer->uv_stride * (line))), inYUVBuffer->uv_width);
-// // locBuffer += inYUVBuffer->uv_width;
-//
-// // if (mWidth/2 > inYUVBuffer->uv_width) {
-// // memset((void*)locBuffer, 0, (mWidth/2) - inYUVBuffer->uv_width);
-// // }
-// // locBuffer += (mWidth/2) - inYUVBuffer->uv_width;
-// //}
-//
-// ////Pad height...
-// //for ( long line = 0; line < (mHeight/2) - inYUVBuffer->uv_height; line++) {
-// // memset((void*)locBuffer, 0, mWidth/2);
-// // locBuffer += mWidth/2;
-// //}
-//
-//
-//
-//
-//
-// //Set the sample parameters.
-// SetSampleParams(locSample, mFrameSize, &locFrameStart, &locFrameEnd);
-//
-// {
-//
-// //Add a reerence to the sample so it isn't deleted in the queue.
-// //locSample->AddRef();
-// HRESULT locHR = mOutputPin->mDataQueue->Receive(locSample); //->DownstreamFilter()->Receive(locSample);
-// if (locHR != S_OK) {
-// debugLog<<"Data Q rejects sample... with "<<locHR<<endl;
-// return -1;
-//
-// }
-// }
-//
-//
-// return 0;
-//
-//
-//}
-//
-//
-//
-//long TheoraDecodeInputPin::decodeData(BYTE* inBuf, long inNumBytes, LONGLONG inStart, LONGLONG inEnd)
-//{
-// DbgLog((LOG_TRACE,1,TEXT("decodeData")));
-// //Not truncated or continued... it's a full packet
-// StampedOggPacket* locPacket = new StampedOggPacket(inBuf, inNumBytes, false, false, inStart, inEnd, StampedOggPacket::OGG_END_ONLY);
-// yuv_buffer* locYUV = mTheoraDecoder->decodeTheora(locPacket);
-// if (locYUV != NULL) {
-// if (TheoraDecoded(locYUV) != 0) {
-// return -1;
-// }
-// }
-//
-// return 0;
-//}
-//
-//
-//
-//HRESULT TheoraDecodeInputPin::SetMediaType(const CMediaType* inMediaType) {
-//
-// if (inMediaType->subtype == MEDIASUBTYPE_Theora) {
-// ((TheoraDecodeFilter*)mParentFilter)->setTheoraFormat((sTheoraFormatBlock*)inMediaType->pbFormat);
-// mParentFilter->mVideoFormat = AbstractVideoDecodeFilter::THEORA;
-// //Set some other stuff here too...
-// mXOffset = ((sTheoraFormatBlock*)inMediaType->pbFormat)->xOffset;
-// mYOffset = ((sTheoraFormatBlock*)inMediaType->pbFormat)->yOffset;
-//
-// } else {
-// //Failed... should never be here !
-// throw 0;
-// }
-// return CBaseInputPin::SetMediaType(inMediaType);
-//}
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "theoradecodeinputpin.h"
+
+
+TheoraDecodeInputPin::TheoraDecodeInputPin(CTransformFilter* inParentFilter, HRESULT* outHR)
+ : CTransformInputPin(NAME("Theora Input Pin"), inParentFilter, outHR, L"Theora In")
+{
+ //debugLog.open("G:\\logs\\theoinput.log", ios_base::out);
+}
+TheoraDecodeInputPin::~TheoraDecodeInputPin() {
+ //debugLog.close();
+}
+
+STDMETHODIMP TheoraDecodeInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
+ //debugLog<<"Querying interface"<<endl;
+ if (riid == IID_IMediaSeeking) {
+ //debugLog<<"Got Seeker"<<endl;
+ *ppv = (IMediaSeeking*)this;
+ ((IUnknown*)*ppv)->AddRef();
+
+ return NOERROR;
+ }
+
+ return CBaseInputPin::NonDelegatingQueryInterface(riid, ppv);
+}
+
+HRESULT TheoraDecodeInputPin::BreakConnect() {
+ CAutoLock locLock(m_pLock);
+ //debugLog<<"Break conenct"<<endl;
+ //Need a lock ??
+ ReleaseDelegate();
+ return CTransformInputPin::BreakConnect();
+}
+HRESULT TheoraDecodeInputPin::CompleteConnect (IPin *inReceivePin) {
+ CAutoLock locLock(m_pLock);
+ //debugLog<<"Complete conenct"<<endl;
+ IMediaSeeking* locSeeker = NULL;
+ inReceivePin->QueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+ if (locSeeker == NULL) {
+ //debugLog<<"Seeker is null"<<endl;
+ }
+ SetDelegate(locSeeker);
+ return CTransformInputPin::CompleteConnect(inReceivePin);
+}
+
+//----------------------
+//OLD IMPLEMENTATION
+//----------------------
+//TheoraDecodeInputPin::TheoraDecodeInputPin(AbstractVideoDecodeFilter* inFilter, CCritSec* inFilterLock, AbstractVideoDecodeOutputPin* inOutputPin, CMediaType* inAcceptMediaType)
+// : AbstractVideoDecodeInputPin(inFilter, inFilterLock, inOutputPin, NAME("TheoraDecodeInputPin"), L"Theora In", inAcceptMediaType)
+// , mXOffset(0)
+// , mYOffset(0)
+//
+//{
+// debugLog.open("G:\\logs\\theoInputPin.log", ios_base::out);
+// ConstructCodec();
+//}
+//
+//STDMETHODIMP TheoraDecodeInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+//{
+// if (riid == IID_IMediaSeeking) {
+// *ppv = (IMediaSeeking*)this;
+// ((IUnknown*)*ppv)->AddRef();
+// return NOERROR;
+// }
+//
+// return CBaseInputPin::NonDelegatingQueryInterface(riid, ppv);
+//}
+//bool TheoraDecodeInputPin::ConstructCodec() {
+//
+//
+// mTheoraDecoder = new TheoraDecoder;
+// mTheoraDecoder->initCodec();
+// return true;
+//}
+//void TheoraDecodeInputPin::DestroyCodec() {
+// delete mTheoraDecoder;
+//}
+//TheoraDecodeInputPin::~TheoraDecodeInputPin(void)
+//{
+// debugLog.close();
+// DestroyCodec();
+//
+//}
+//
+//
+//
+//int TheoraDecodeInputPin::TheoraDecoded (yuv_buffer* inYUVBuffer)
+//{
+// DbgLog((LOG_TRACE,1,TEXT("Decoded... Sending...")));
+//
+// debugLog<<"TheoraDecoded... "<<endl;
+//
+// TheoraDecodeFilter* locFilter = reinterpret_cast<TheoraDecodeFilter*>(m_pFilter);
+// //
+// if (!mBegun) {
+//
+//
+//
+// mBegun = true;
+//
+// //How many UNITS does one frame take.
+// mFrameDuration = (UNITS * locFilter->mTheoraFormatInfo->frameRateDenominator) / (locFilter->mTheoraFormatInfo->frameRateNumerator);
+// mFrameSize = (mHeight * mWidth * 3) / 2;
+// mFrameCount = 0;
+// }
+//
+//
+//
+// ////FIX::: Most of this will be obselete... the demux does it all.
+// //
+//
+// ////TO DO::: Fix this up... needs to move around order and some only needs to be done once, move it into the block aboce and use member data
+//
+// ////Make the start timestamp
+// ////FIX:::Abstract this calculation
+// DbgLog((LOG_TRACE,1,TEXT("Frame Count = %d"), mFrameCount));
+// //REFERENCE_TIME locFrameStart = CurrentStartTime() + (mFrameCount * mFrameDuration);
+//
+// //Timestamp hacks start here...
+// unsigned long locMod = (unsigned long)pow(2, locFilter->mTheoraFormatInfo->maxKeyframeInterval);
+// DbgLog((LOG_TRACE,1,TEXT("locSeenGranPos = %d"), mLastSeenStartGranPos));
+// DbgLog((LOG_TRACE,1,TEXT("locMod = %d"), locMod));
+// unsigned long locInterFrameNo = (mLastSeenStartGranPos) % locMod;
+// DbgLog((LOG_TRACE,1,TEXT("InterFrameNo = %d"), locInterFrameNo));
+// LONGLONG locAbsFramePos = ((mLastSeenStartGranPos >> locFilter->mTheoraFormatInfo->maxKeyframeInterval)) + locInterFrameNo;
+// DbgLog((LOG_TRACE,1,TEXT("AbsFrameNo = %d"), locAbsFramePos));
+// DbgLog((LOG_TRACE,1,TEXT("mSeekTimeBase = %d"), mSeekTimeBase));
+// REFERENCE_TIME locTimeBase = (locAbsFramePos * mFrameDuration) - mSeekTimeBase;
+// DbgLog((LOG_TRACE,1,TEXT("locTimeBase = %d"), locTimeBase));
+// //
+// //
+//
+// REFERENCE_TIME locFrameStart = locTimeBase + (mFrameCount * mFrameDuration);
+// //Increment the frame counter
+// mFrameCount++;
+//
+// //Make the end frame counter
+// //REFERENCE_TIME locFrameEnd = CurrentStartTime() + (mFrameCount * mFrameDuration);
+// REFERENCE_TIME locFrameEnd = locTimeBase + (mFrameCount * mFrameDuration);
+//
+// DbgLog((LOG_TRACE,1,TEXT("Frame Runs From %d"), locFrameStart));
+// DbgLog((LOG_TRACE,1,TEXT("Frame Runs To %d"), locFrameEnd));
+//
+// IMediaSample* locSample = NULL;
+// debugLog<<"Sample times = "<<locFrameStart<<" to "<<locFrameEnd<<endl;
+// DWORD locFlags = 0;//AM_GBF_PREVFRAMESKIPPED | AM_GBF_NOTASYNCPOINT;
+//
+// FILTER_STATE locFS;
+// mParentFilter->GetState(0, &locFS);
+// debugLog<<"State Before = "<<locFS<<endl;
+// HRESULT locHR = mOutputPin->GetDeliveryBuffer(&locSample, &locFrameStart, &locFrameEnd, locFlags);
+// mParentFilter->GetState(0, &locFS);
+// debugLog<<"State After = "<<locFS<<endl;
+// if (locHR != S_OK) {
+// debugLog<<"Get DeliveryBuffer FAILED with "<<locHR<<endl;
+// debugLog<<"locSample is "<<(unsigned long)locSample<<endl;
+// //We get here when the application goes into stop mode usually.
+//
+// switch (locHR) {
+// case VFW_E_SIZENOTSET:
+// debugLog<<"SIZE NOT SET"<<endl;
+// break;
+// case VFW_E_NOT_COMMITTED:
+// debugLog<<"NOT COMMITTED"<<endl;
+// break;
+// case VFW_E_TIMEOUT:
+// debugLog<<"TIMEOUT"<<endl;
+// break;
+// case VFW_E_STATE_CHANGED:
+// debugLog<<"STATE CHANGED"<<endl;
+// return S_OK;
+// default:
+// debugLog<<"SOMETHING ELSE !!!"<<endl;
+// break;
+// }
+// return locHR;
+// }
+//
+// debugLog<<"GetDeliveryBuffer &** SUCCEEDED **"<<endl;
+//
+// //Debuggin code
+// AM_MEDIA_TYPE* locMediaType = NULL;
+// locSample->GetMediaType(&locMediaType);
+// if (locMediaType == NULL) {
+// debugLog<<"No dynamic change..."<<endl;
+// } else {
+// debugLog<<"Attempting dynamic change..."<<endl;
+// if (locMediaType->majortype == MEDIATYPE_Video) {
+// debugLog<<"Still MEDIATYPE_Video"<<endl;
+// }
+//
+// if (locMediaType->subtype == MEDIASUBTYPE_YV12) {
+// debugLog<<"Still MEDIASUBTYPE_YV12"<<endl;
+// }
+//
+// if (locMediaType->formattype == FORMAT_VideoInfo) {
+// debugLog<<"Still FORMAT_VideoInfo"<<endl;
+// VIDEOINFOHEADER* locVF = (VIDEOINFOHEADER*)locMediaType->pbFormat;
+// debugLog<<"Size = "<<locVF->bmiHeader.biSizeImage<<endl;
+// debugLog<<"Dim = "<<locVF->bmiHeader.biWidth<<" x " <<locVF->bmiHeader.biHeight<<endl;
+// }
+//
+// debugLog<<"Major : "<<DSStringer::GUID2String(&locMediaType->majortype);
+// debugLog<<"Minor : "<<DSStringer::GUID2String(&locMediaType->subtype);
+// debugLog<<"Format : "<<DSStringer::GUID2String(&locMediaType->formattype);
+// debugLog<<"Form Sz: "<<locMediaType->cbFormat;
+//
+//
+// }
+// //
+//
+// ////Create pointers for the samples buffer to be assigned to
+// BYTE* locBuffer = NULL;
+//
+// //
+// ////Make our pointers set to point to the samples buffer
+// locSample->GetPointer(&locBuffer);
+//
+//
+//
+// //Fill the buffer with yuv data...
+// //
+//
+//
+//
+// //Set up the pointers
+// unsigned char* locDestUptoPtr = locBuffer;
+// char* locSourceUptoPtr = inYUVBuffer->y;
+//
+// //
+// //Y DATA
+// //
+//
+// //NEW WAY with offsets Y Data
+// long locTopPad = inYUVBuffer->y_height - mHeight - mYOffset;
+// ASSERT(locTopPad >= 0);
+// if (locTopPad < 0) {
+// locTopPad = 0;
+// }
+//
+// //Skip the top padding
+// locSourceUptoPtr += (locTopPad * inYUVBuffer->y_stride);
+//
+// for (long line = 0; line < mHeight; line++) {
+// memcpy((void*)(locDestUptoPtr), (const void*)(locSourceUptoPtr + mXOffset), mWidth);
+// locSourceUptoPtr += inYUVBuffer->y_stride;
+// locDestUptoPtr += mWidth;
+// }
+//
+// locSourceUptoPtr += (mYOffset * inYUVBuffer->y_stride);
+//
+// //Source advances by (y_height * y_stride)
+// //Dest advances by (mHeight * mWidth)
+//
+// //
+// //V DATA
+// //
+//
+// //Half the padding for uv planes... is this correct ?
+// locTopPad = locTopPad /2;
+//
+// locSourceUptoPtr = inYUVBuffer->v;
+//
+// //Skip the top padding
+// locSourceUptoPtr += (locTopPad * inYUVBuffer->y_stride);
+//
+// for (long line = 0; line < mHeight / 2; line++) {
+// memcpy((void*)(locDestUptoPtr), (const void*)(locSourceUptoPtr + (mXOffset / 2)), mWidth / 2);
+// locSourceUptoPtr += inYUVBuffer->uv_stride;
+// locDestUptoPtr += (mWidth / 2);
+// }
+// locSourceUptoPtr += ((mYOffset/2) * inYUVBuffer->uv_stride);
+//
+// //Source advances by (locTopPad + mYOffset/2 + mHeight /2) * uv_stride
+// //where locTopPad for uv = (inYUVBuffer->y_height - mHeight - mYOffset) / 2
+// // = (inYUVBuffer->yheight/2 - mHeight/2 - mYOffset/2)
+// // so source advances by (y_height/2) * uv_stride
+// //Dest advances by (mHeight * mWidth) /4
+//
+//
+// //
+// //U DATA
+// //
+//
+// locSourceUptoPtr = inYUVBuffer->u;
+//
+// //Skip the top padding
+// locSourceUptoPtr += (locTopPad * inYUVBuffer->y_stride);
+//
+// for (long line = 0; line < mHeight / 2; line++) {
+// memcpy((void*)(locDestUptoPtr), (const void*)(locSourceUptoPtr + (mXOffset / 2)), mWidth / 2);
+// locSourceUptoPtr += inYUVBuffer->uv_stride;
+// locDestUptoPtr += (mWidth / 2);
+// }
+// locSourceUptoPtr += ((mYOffset/2) * inYUVBuffer->uv_stride);
+//
+//
+// ////Y Data.
+// //for ( long line = 0; line < inYUVBuffer->y_height; line++) {
+// // memcpy((void*)locBuffer, (const void*)(inYUVBuffer->y + (inYUVBuffer->y_stride * (line))), inYUVBuffer->y_width);
+// // locBuffer += inYUVBuffer->y_width;
+//
+// // if (mWidth > inYUVBuffer->y_width) {
+// // memset((void*)locBuffer, 0, mWidth - inYUVBuffer->y_width);
+// // }
+// // locBuffer += mWidth - inYUVBuffer->y_width;
+// //}
+//
+// ////Pad height...
+// //for ( long line = 0; line < mHeight - inYUVBuffer->y_height; line++) {
+// // memset((void*)locBuffer, 0, mWidth);
+// // locBuffer += mWidth;
+// //}
+//
+// ////V Data
+// //for ( long line = 0; line < inYUVBuffer->uv_height; line++) {
+// // memcpy((void*)locBuffer, (const void*)(inYUVBuffer->v + (inYUVBuffer->uv_stride * (line))), inYUVBuffer->uv_width);
+// // locBuffer += inYUVBuffer->uv_width;
+//
+// // if (mWidth/2 > inYUVBuffer->uv_width) {
+// // memset((void*)locBuffer, 0, (mWidth/2) - inYUVBuffer->uv_width);
+// // }
+// // locBuffer += (mWidth/2) - inYUVBuffer->uv_width;
+// //}
+//
+// ////Pad height...
+// //for ( long line = 0; line < (mHeight/2) - inYUVBuffer->uv_height; line++) {
+// // memset((void*)locBuffer, 0, mWidth/2);
+// // locBuffer += mWidth/2;
+// //}
+//
+// ////U Data
+// //for (long line = 0; line < inYUVBuffer->uv_height; line++) {
+// // memcpy((void*)locBuffer, (const void*)(inYUVBuffer->u + (inYUVBuffer->uv_stride * (line))), inYUVBuffer->uv_width);
+// // locBuffer += inYUVBuffer->uv_width;
+//
+// // if (mWidth/2 > inYUVBuffer->uv_width) {
+// // memset((void*)locBuffer, 0, (mWidth/2) - inYUVBuffer->uv_width);
+// // }
+// // locBuffer += (mWidth/2) - inYUVBuffer->uv_width;
+// //}
+//
+// ////Pad height...
+// //for ( long line = 0; line < (mHeight/2) - inYUVBuffer->uv_height; line++) {
+// // memset((void*)locBuffer, 0, mWidth/2);
+// // locBuffer += mWidth/2;
+// //}
+//
+//
+//
+//
+//
+// //Set the sample parameters.
+// SetSampleParams(locSample, mFrameSize, &locFrameStart, &locFrameEnd);
+//
+// {
+//
+// //Add a reerence to the sample so it isn't deleted in the queue.
+// //locSample->AddRef();
+// HRESULT locHR = mOutputPin->mDataQueue->Receive(locSample); //->DownstreamFilter()->Receive(locSample);
+// if (locHR != S_OK) {
+// debugLog<<"Data Q rejects sample... with "<<locHR<<endl;
+// return -1;
+//
+// }
+// }
+//
+//
+// return 0;
+//
+//
+//}
+//
+//
+//
+//long TheoraDecodeInputPin::decodeData(BYTE* inBuf, long inNumBytes, LONGLONG inStart, LONGLONG inEnd)
+//{
+// DbgLog((LOG_TRACE,1,TEXT("decodeData")));
+// //Not truncated or continued... it's a full packet
+// StampedOggPacket* locPacket = new StampedOggPacket(inBuf, inNumBytes, false, false, inStart, inEnd, StampedOggPacket::OGG_END_ONLY);
+// yuv_buffer* locYUV = mTheoraDecoder->decodeTheora(locPacket);
+// if (locYUV != NULL) {
+// if (TheoraDecoded(locYUV) != 0) {
+// return -1;
+// }
+// }
+//
+// return 0;
+//}
+//
+//
+//
+//HRESULT TheoraDecodeInputPin::SetMediaType(const CMediaType* inMediaType) {
+//
+// if (inMediaType->subtype == MEDIASUBTYPE_Theora) {
+// ((TheoraDecodeFilter*)mParentFilter)->setTheoraFormat((sTheoraFormatBlock*)inMediaType->pbFormat);
+// mParentFilter->mVideoFormat = AbstractVideoDecodeFilter::THEORA;
+// //Set some other stuff here too...
+// mXOffset = ((sTheoraFormatBlock*)inMediaType->pbFormat)->xOffset;
+// mYOffset = ((sTheoraFormatBlock*)inMediaType->pbFormat)->yOffset;
+//
+// } else {
+// //Failed... should never be here !
+// throw 0;
+// }
+// return CBaseInputPin::SetMediaType(inMediaType);
+//}
+//
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeInputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeInputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeInputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,105 +1,105 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "Theoradecoderdllstuff.h"
-#include "BasicSeekPassThrough.h"
-
-#include <fstream>
-using namespace std;
-class TheoraDecodeInputPin
- : public CTransformInputPin
- , public BasicSeekPassThrough
-{
-public:
-
- TheoraDecodeInputPin(CTransformFilter* inParentFilter, HRESULT* outHR);
- virtual ~TheoraDecodeInputPin();
-
- //COM Guff
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- //Overrides
- virtual HRESULT BreakConnect();
- virtual HRESULT CompleteConnect (IPin *inReceivePin);
-
- //fstream debugLog;
-};
-//----------------------
-//OLD IMPLEMENTATION
-//----------------------
-//
-//#include "Theoradecoderdllstuff.h"
-////#include "AbstractVideoDecodeInputPin.h"
-////#include "TheoraDecodeInputPin.h"
-//
-////#include "TheoraDecodeFilter.h"
-//#include "DSStringer.h"
-//#include "TheoraDecoder.h"
-//#include <math.h>
-//#include <fstream>
-//using namespace std;
-//
-//
-//class TheoraDecodeOutputPin;
-//
-//class TheoraDecodeInputPin
-// : public AbstractVideoDecodeInputPin
-//{
-//public:
-// TheoraDecodeInputPin(AbstractVideoDecodeFilter* inFilter, CCritSec* inFilterLock, AbstractVideoDecodeOutputPin* inOutputPin, CMediaType* inAcceptMediaType);
-// virtual ~TheoraDecodeInputPin(void);
-// int TheoraDecoded (yuv_buffer* inYUVBuffer);
-//
-// DECLARE_IUNKNOWN
-// STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-//
-// HRESULT SetMediaType(const CMediaType* inMediaType);
-//
-// //VIRTUAL FUNCTIONS - AbstractAudioDecodeInputPin
-// //FIX:::These should be protected.
-// virtual bool ConstructCodec();
-// virtual void DestroyCodec();
-//
-// long decodeData(BYTE* inBuf, long inNumBytes, LONGLONG inStart, LONGLONG inEnd) ;
-//
-//protected:
-// fstream debugLog;
-// //FishSound* mFishSound;
-// //FishSoundInfo mFishInfo;
-// TheoraDecoder* mTheoraDecoder;
-// unsigned long mXOffset;
-// unsigned long mYOffset;
-//
-//
-//
-//};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "Theoradecoderdllstuff.h"
+#include "BasicSeekPassThrough.h"
+
+#include <fstream>
+using namespace std;
+class TheoraDecodeInputPin
+ : public CTransformInputPin
+ , public BasicSeekPassThrough
+{
+public:
+
+ TheoraDecodeInputPin(CTransformFilter* inParentFilter, HRESULT* outHR);
+ virtual ~TheoraDecodeInputPin();
+
+ //COM Guff
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ //Overrides
+ virtual HRESULT BreakConnect();
+ virtual HRESULT CompleteConnect (IPin *inReceivePin);
+
+ //fstream debugLog;
+};
+//----------------------
+//OLD IMPLEMENTATION
+//----------------------
+//
+//#include "Theoradecoderdllstuff.h"
+////#include "AbstractVideoDecodeInputPin.h"
+////#include "TheoraDecodeInputPin.h"
+//
+////#include "TheoraDecodeFilter.h"
+//#include "DSStringer.h"
+//#include "TheoraDecoder.h"
+//#include <math.h>
+//#include <fstream>
+//using namespace std;
+//
+//
+//class TheoraDecodeOutputPin;
+//
+//class TheoraDecodeInputPin
+// : public AbstractVideoDecodeInputPin
+//{
+//public:
+// TheoraDecodeInputPin(AbstractVideoDecodeFilter* inFilter, CCritSec* inFilterLock, AbstractVideoDecodeOutputPin* inOutputPin, CMediaType* inAcceptMediaType);
+// virtual ~TheoraDecodeInputPin(void);
+// int TheoraDecoded (yuv_buffer* inYUVBuffer);
+//
+// DECLARE_IUNKNOWN
+// STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+//
+// HRESULT SetMediaType(const CMediaType* inMediaType);
+//
+// //VIRTUAL FUNCTIONS - AbstractAudioDecodeInputPin
+// //FIX:::These should be protected.
+// virtual bool ConstructCodec();
+// virtual void DestroyCodec();
+//
+// long decodeData(BYTE* inBuf, long inNumBytes, LONGLONG inStart, LONGLONG inEnd) ;
+//
+//protected:
+// fstream debugLog;
+// //FishSound* mFishSound;
+// //FishSoundInfo mFishInfo;
+// TheoraDecoder* mTheoraDecoder;
+// unsigned long mXOffset;
+// unsigned long mYOffset;
+//
+//
+//
+//};
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeInputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,257 +1,257 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "theoradecodeoutputpin.h"
-
-
-
-TheoraDecodeOutputPin::TheoraDecodeOutputPin(CTransformFilter* inParentFilter, HRESULT* outHR)
- : CTransformOutputPin(NAME("Theora Output Pin"), inParentFilter, outHR, L"YV12 Out")
-{
- //debugLog.open("G:\\logs\\theooutput.log", ios_base::out);
-}
-TheoraDecodeOutputPin::~TheoraDecodeOutputPin() {
- //debugLog.close();
-}
-
-STDMETHODIMP TheoraDecodeOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
- //debugLog<<"Querying interface"<<endl;
- if (riid == IID_IMediaSeeking) {
- //debugLog<<"Got seekeer"<<endl;
- *ppv = (IMediaSeeking*)this;
- ((IUnknown*)*ppv)->AddRef();
-
- return NOERROR;
- } else if (riid == IID_IMediaPosition) {
- //debugLog<<"Asking for OLD SEEKER"<<endl;
- }
- //debugLog<<"Trying base output pin"<<endl;
- return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
-}
-
-HRESULT TheoraDecodeOutputPin::BreakConnect() {
- CAutoLock locLock(m_pLock);
- //Need a lock ??
- ReleaseDelegate();
- //debugLog<<"Break connect"<<endl;
- return CTransformOutputPin::BreakConnect();
-}
-HRESULT TheoraDecodeOutputPin::CompleteConnect (IPin *inReceivePin) {
- CAutoLock locLock(m_pLock);
- //debugLog<<"Complete connect"<<endl;
- IMediaSeeking* locSeeker = NULL;
-
- m_pFilter->GetPin(0)->QueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
-
- if (locSeeker == NULL) {
- //debugLog<<"Seeker was NULL"<<endl;
- }
- SetDelegate(locSeeker);
- return CTransformOutputPin::CompleteConnect(inReceivePin);
-}
-
-STDMETHODIMP TheoraDecodeOutputPin::Notify(IBaseFilter* inMessageSource, Quality inQuality) {
- return E_NOTIMPL;
-}
-//----------------------
-//OLD IMPLEMENTATION
-//----------------------
-//TheoraDecodeOutputPin::TheoraDecodeOutputPin(TheoraDecodeFilter* inParentFilter, CCritSec* inFilterLock)
-// : AbstractVideoDecodeOutputPin(inParentFilter, inFilterLock,NAME("TheoraDecodeOutputPin"), L"YV12 Out")
-//{
-//
-//
-//}
-//TheoraDecodeOutputPin::~TheoraDecodeOutputPin(void)
-//{
-//
-//
-//}
-//STDMETHODIMP TheoraDecodeOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-//{
-// if (riid == IID_IMediaSeeking) {
-// *ppv = (IMediaSeeking*)this;
-// ((IUnknown*)*ppv)->AddRef();
-// return NOERROR;
-// //} else if (riid == IID_IStreamBuilder) {
-// // *ppv = (IStreamBuilder*)this;
-// // ((IUnknown*)*ppv)->AddRef();
-// // return NOERROR;
-// }
-//
-// return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
-//}
-//
-//
-//STDMETHODIMP TheoraDecodeOutputPin::Notify(IBaseFilter *pSelf, Quality q) {
-// return S_OK;
-//
-//}
-//
-//bool TheoraDecodeOutputPin::FillVideoInfoHeader(VIDEOINFOHEADER* inFormatBuffer) {
-// TheoraDecodeFilter* locFilter = ((TheoraDecodeFilter*)m_pFilter);
-//
-// inFormatBuffer->AvgTimePerFrame = (UNITS * locFilter->mTheoraFormatInfo->frameRateDenominator) / locFilter->mTheoraFormatInfo->frameRateNumerator;
-// inFormatBuffer->dwBitRate = locFilter->mTheoraFormatInfo->targetBitrate;
-//
-// inFormatBuffer->bmiHeader.biBitCount = 12; //12 bits per pixel
-// inFormatBuffer->bmiHeader.biClrImportant = 0; //All colours important
-// inFormatBuffer->bmiHeader.biClrUsed = 0; //Use max colour depth
-// inFormatBuffer->bmiHeader.biCompression = MAKEFOURCC('Y','V','1','2');
-// inFormatBuffer->bmiHeader.biHeight = locFilter->mTheoraFormatInfo->frameHeight; //Not sure
-// inFormatBuffer->bmiHeader.biPlanes = 1; //Must be 1
-// inFormatBuffer->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); //????? Size of what ?
-// inFormatBuffer->bmiHeader.biSizeImage = ((locFilter->mTheoraFormatInfo->frameHeight * locFilter->mTheoraFormatInfo->frameWidth) * 3)/2; //Size in bytes of image ??
-// inFormatBuffer->bmiHeader.biWidth = locFilter->mTheoraFormatInfo->frameWidth;
-// inFormatBuffer->bmiHeader.biXPelsPerMeter = 2000; //Fuck knows
-// inFormatBuffer->bmiHeader.biYPelsPerMeter = 2000; //" " " " "
-//
-// inFormatBuffer->rcSource.top = 0;
-// inFormatBuffer->rcSource.bottom = locFilter->mTheoraFormatInfo->frameHeight;
-// inFormatBuffer->rcSource.left = 0;
-// inFormatBuffer->rcSource.right = locFilter->mTheoraFormatInfo->frameWidth;
-//
-// inFormatBuffer->rcTarget.top = 0;
-// inFormatBuffer->rcTarget.bottom = locFilter->mTheoraFormatInfo->frameHeight;
-// inFormatBuffer->rcTarget.left = 0;
-// inFormatBuffer->rcTarget.right = locFilter->mTheoraFormatInfo->frameWidth;
-//
-// inFormatBuffer->dwBitErrorRate=0;
-// return true;
-//}
-//
-////STDMETHODIMP TheoraDecodeOutputPin::Render(IPin* inOutputPin, IGraphBuilder* inGraphBuilder) {
-//// if (inOutputPin == NULL || inGraphBuilder == NULL) {
-//// return E_POINTER;
-//// }
-////
-////
-//// IBaseFilter* locRenderer = NULL;
-////
-//// // Create the VMR9
-//// //FIX::: Probably should check if it's already in the graph.
-//// // Also should let it connect to other VMR's
-////
-////
-//// HRESULT locHR = S_OK;
-//// locHR = inGraphBuilder->FindFilterByName(L"Video Mixing Renderer", &locRenderer);
-//// /*IEnumFilters* locEnumFilters = NULL;
-//// locHR = S_OK;
-//// locHR = inGraphBuilder->EnumFilters(&locEnumFilters);
-//// IBaseFilter* locFilter = NULL;
-//// CLSID locCLSID;
-//// while (locHR ==S_OK) {
-//// locHR = locEnumFilters->Next(1, &locFilter, 0);
-//// locFilter->GetClassID(&locCLSID);
-//// if (locCLSID == CLSID_VideoMixingRenderer9) {
-//// locHR=locHR;
-//// }
-//// }*/
-////
-//// if (locRenderer == NULL) {
-//// locHR= CoCreateInstance(CLSID_VideoMixingRenderer9, NULL, CLSCTX_INPROC, IID_IBaseFilter, (void **)&locRenderer);
-//// if (locHR != S_OK) {
-//// return locHR;
-//// }
-////
-//// //Add the VMR9 to the graph
-//// locHR = inGraphBuilder->AddFilter(locRenderer, L"Video Mixing Renderer");
-//// if (locHR != S_OK) {
-//// locRenderer->Release();
-//// return locHR;
-//// }
-//// IVMRFilterConfig9* locVMRConfig = NULL;
-//// locHR = locRenderer->QueryInterface(IID_IVMRFilterConfig9, (void**)&locVMRConfig);
-//// if(locHR == S_OK) {
-//// //locHR = locVMRConfig->SetRenderingMode(VMR9Mode_Renderless);
-//// }
-//// }
-////
-//// IEnumPins* locEnumPins;
-//// IPin* locRendererInputPin = NULL;
-//// locHR = locRenderer->EnumPins(&locEnumPins);
-////
-//// if (SUCCEEDED(locHR)) {
-//// if (S_OK != locEnumPins->Next(1, &locRendererInputPin, 0)) {
-//// locHR = E_UNEXPECTED;
-//// }
-//// }
-////
-//// if (SUCCEEDED(locHR)) {
-//// // CConnect VMR9 to the output of the theora decoder
-//// CMediaType* locMediaType = new CMediaType;
-////
-//// FillMediaType(locMediaType);
-//// //Fixes the null format block error
-//// VIDEOINFOHEADER* locVideoFormat = (VIDEOINFOHEADER*)locMediaType->AllocFormatBuffer(sizeof(VIDEOINFOHEADER));
-//// FillVideoInfoHeader(locVideoFormat);
-//// locHR = inGraphBuilder->ConnectDirect(inOutputPin, locRendererInputPin, locMediaType);
-//// locRendererInputPin->Release();
-//// }
-//// if (FAILED(locHR))
-//// {
-//// // Could not connect to the VMR9 renderer. Remove it from the graph.
-//// inGraphBuilder->RemoveFilter(locRenderer);
-//// }
-//// locRenderer->Release();
-////
-//// return locHR;
-////
-////
-////}
-////STDMETHODIMP TheoraDecodeOutputPin::Backout(IPin* inOutputPin, IGraphBuilder* inGraphBuilder) {
-//// //HRESULT locHR = S_OK;
-//// // if (m_Connected != NULL) // Pointer to the pin we're connected to.
-//// // {
-//// // // Find the filter that owns the pin connected to us.
-//// // FILTER_INFO fi;
-//// // hr = m_Connected->QueryFilterInfo(&fi);
-//// // if (SUCCEEDED(hr))
-//// // {
-//// // if (fi.pFilter != NULL)
-//// // {
-//// // // Disconnect the pins.
-//// // pGraph->Disconnect(m_Connected);
-//// // pGraph->Disconnect(pPin);
-//// // // Remove the filter from the graph.
-//// // pGraph->RemoveFilter(fi.pFilter);
-//// // fi.pFilter->Release();
-//// // }
-//// // else
-//// // {
-//// // hr = E_UNEXPECTED;
-//// // }
-//// // }
-//// // }
-//// // return hr;
-//// return S_OK;
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "theoradecodeoutputpin.h"
+
+
+
+TheoraDecodeOutputPin::TheoraDecodeOutputPin(CTransformFilter* inParentFilter, HRESULT* outHR)
+ : CTransformOutputPin(NAME("Theora Output Pin"), inParentFilter, outHR, L"YV12 Out")
+{
+ //debugLog.open("G:\\logs\\theooutput.log", ios_base::out);
+}
+TheoraDecodeOutputPin::~TheoraDecodeOutputPin() {
+ //debugLog.close();
+}
+
+STDMETHODIMP TheoraDecodeOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
+ //debugLog<<"Querying interface"<<endl;
+ if (riid == IID_IMediaSeeking) {
+ //debugLog<<"Got seekeer"<<endl;
+ *ppv = (IMediaSeeking*)this;
+ ((IUnknown*)*ppv)->AddRef();
+
+ return NOERROR;
+ } else if (riid == IID_IMediaPosition) {
+ //debugLog<<"Asking for OLD SEEKER"<<endl;
+ }
+ //debugLog<<"Trying base output pin"<<endl;
+ return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
+}
+
+HRESULT TheoraDecodeOutputPin::BreakConnect() {
+ CAutoLock locLock(m_pLock);
+ //Need a lock ??
+ ReleaseDelegate();
+ //debugLog<<"Break connect"<<endl;
+ return CTransformOutputPin::BreakConnect();
+}
+HRESULT TheoraDecodeOutputPin::CompleteConnect (IPin *inReceivePin) {
+ CAutoLock locLock(m_pLock);
+ //debugLog<<"Complete connect"<<endl;
+ IMediaSeeking* locSeeker = NULL;
+
+ m_pFilter->GetPin(0)->QueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+
+ if (locSeeker == NULL) {
+ //debugLog<<"Seeker was NULL"<<endl;
+ }
+ SetDelegate(locSeeker);
+ return CTransformOutputPin::CompleteConnect(inReceivePin);
+}
+
+STDMETHODIMP TheoraDecodeOutputPin::Notify(IBaseFilter* inMessageSource, Quality inQuality) {
+ return E_NOTIMPL;
+}
+//----------------------
+//OLD IMPLEMENTATION
+//----------------------
+//TheoraDecodeOutputPin::TheoraDecodeOutputPin(TheoraDecodeFilter* inParentFilter, CCritSec* inFilterLock)
+// : AbstractVideoDecodeOutputPin(inParentFilter, inFilterLock,NAME("TheoraDecodeOutputPin"), L"YV12 Out")
+//{
+//
+//
+//}
+//TheoraDecodeOutputPin::~TheoraDecodeOutputPin(void)
+//{
+//
+//
+//}
+//STDMETHODIMP TheoraDecodeOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+//{
+// if (riid == IID_IMediaSeeking) {
+// *ppv = (IMediaSeeking*)this;
+// ((IUnknown*)*ppv)->AddRef();
+// return NOERROR;
+// //} else if (riid == IID_IStreamBuilder) {
+// // *ppv = (IStreamBuilder*)this;
+// // ((IUnknown*)*ppv)->AddRef();
+// // return NOERROR;
+// }
+//
+// return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
+//}
+//
+//
+//STDMETHODIMP TheoraDecodeOutputPin::Notify(IBaseFilter *pSelf, Quality q) {
+// return S_OK;
+//
+//}
+//
+//bool TheoraDecodeOutputPin::FillVideoInfoHeader(VIDEOINFOHEADER* inFormatBuffer) {
+// TheoraDecodeFilter* locFilter = ((TheoraDecodeFilter*)m_pFilter);
+//
+// inFormatBuffer->AvgTimePerFrame = (UNITS * locFilter->mTheoraFormatInfo->frameRateDenominator) / locFilter->mTheoraFormatInfo->frameRateNumerator;
+// inFormatBuffer->dwBitRate = locFilter->mTheoraFormatInfo->targetBitrate;
+//
+// inFormatBuffer->bmiHeader.biBitCount = 12; //12 bits per pixel
+// inFormatBuffer->bmiHeader.biClrImportant = 0; //All colours important
+// inFormatBuffer->bmiHeader.biClrUsed = 0; //Use max colour depth
+// inFormatBuffer->bmiHeader.biCompression = MAKEFOURCC('Y','V','1','2');
+// inFormatBuffer->bmiHeader.biHeight = locFilter->mTheoraFormatInfo->frameHeight; //Not sure
+// inFormatBuffer->bmiHeader.biPlanes = 1; //Must be 1
+// inFormatBuffer->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); //????? Size of what ?
+// inFormatBuffer->bmiHeader.biSizeImage = ((locFilter->mTheoraFormatInfo->frameHeight * locFilter->mTheoraFormatInfo->frameWidth) * 3)/2; //Size in bytes of image ??
+// inFormatBuffer->bmiHeader.biWidth = locFilter->mTheoraFormatInfo->frameWidth;
+// inFormatBuffer->bmiHeader.biXPelsPerMeter = 2000; //Fuck knows
+// inFormatBuffer->bmiHeader.biYPelsPerMeter = 2000; //" " " " "
+//
+// inFormatBuffer->rcSource.top = 0;
+// inFormatBuffer->rcSource.bottom = locFilter->mTheoraFormatInfo->frameHeight;
+// inFormatBuffer->rcSource.left = 0;
+// inFormatBuffer->rcSource.right = locFilter->mTheoraFormatInfo->frameWidth;
+//
+// inFormatBuffer->rcTarget.top = 0;
+// inFormatBuffer->rcTarget.bottom = locFilter->mTheoraFormatInfo->frameHeight;
+// inFormatBuffer->rcTarget.left = 0;
+// inFormatBuffer->rcTarget.right = locFilter->mTheoraFormatInfo->frameWidth;
+//
+// inFormatBuffer->dwBitErrorRate=0;
+// return true;
+//}
+//
+////STDMETHODIMP TheoraDecodeOutputPin::Render(IPin* inOutputPin, IGraphBuilder* inGraphBuilder) {
+//// if (inOutputPin == NULL || inGraphBuilder == NULL) {
+//// return E_POINTER;
+//// }
+////
+////
+//// IBaseFilter* locRenderer = NULL;
+////
+//// // Create the VMR9
+//// //FIX::: Probably should check if it's already in the graph.
+//// // Also should let it connect to other VMR's
+////
+////
+//// HRESULT locHR = S_OK;
+//// locHR = inGraphBuilder->FindFilterByName(L"Video Mixing Renderer", &locRenderer);
+//// /*IEnumFilters* locEnumFilters = NULL;
+//// locHR = S_OK;
+//// locHR = inGraphBuilder->EnumFilters(&locEnumFilters);
+//// IBaseFilter* locFilter = NULL;
+//// CLSID locCLSID;
+//// while (locHR ==S_OK) {
+//// locHR = locEnumFilters->Next(1, &locFilter, 0);
+//// locFilter->GetClassID(&locCLSID);
+//// if (locCLSID == CLSID_VideoMixingRenderer9) {
+//// locHR=locHR;
+//// }
+//// }*/
+////
+//// if (locRenderer == NULL) {
+//// locHR= CoCreateInstance(CLSID_VideoMixingRenderer9, NULL, CLSCTX_INPROC, IID_IBaseFilter, (void **)&locRenderer);
+//// if (locHR != S_OK) {
+//// return locHR;
+//// }
+////
+//// //Add the VMR9 to the graph
+//// locHR = inGraphBuilder->AddFilter(locRenderer, L"Video Mixing Renderer");
+//// if (locHR != S_OK) {
+//// locRenderer->Release();
+//// return locHR;
+//// }
+//// IVMRFilterConfig9* locVMRConfig = NULL;
+//// locHR = locRenderer->QueryInterface(IID_IVMRFilterConfig9, (void**)&locVMRConfig);
+//// if(locHR == S_OK) {
+//// //locHR = locVMRConfig->SetRenderingMode(VMR9Mode_Renderless);
+//// }
+//// }
+////
+//// IEnumPins* locEnumPins;
+//// IPin* locRendererInputPin = NULL;
+//// locHR = locRenderer->EnumPins(&locEnumPins);
+////
+//// if (SUCCEEDED(locHR)) {
+//// if (S_OK != locEnumPins->Next(1, &locRendererInputPin, 0)) {
+//// locHR = E_UNEXPECTED;
+//// }
+//// }
+////
+//// if (SUCCEEDED(locHR)) {
+//// // CConnect VMR9 to the output of the theora decoder
+//// CMediaType* locMediaType = new CMediaType;
+////
+//// FillMediaType(locMediaType);
+//// //Fixes the null format block error
+//// VIDEOINFOHEADER* locVideoFormat = (VIDEOINFOHEADER*)locMediaType->AllocFormatBuffer(sizeof(VIDEOINFOHEADER));
+//// FillVideoInfoHeader(locVideoFormat);
+//// locHR = inGraphBuilder->ConnectDirect(inOutputPin, locRendererInputPin, locMediaType);
+//// locRendererInputPin->Release();
+//// }
+//// if (FAILED(locHR))
+//// {
+//// // Could not connect to the VMR9 renderer. Remove it from the graph.
+//// inGraphBuilder->RemoveFilter(locRenderer);
+//// }
+//// locRenderer->Release();
+////
+//// return locHR;
+////
+////
+////}
+////STDMETHODIMP TheoraDecodeOutputPin::Backout(IPin* inOutputPin, IGraphBuilder* inGraphBuilder) {
+//// //HRESULT locHR = S_OK;
+//// // if (m_Connected != NULL) // Pointer to the pin we're connected to.
+//// // {
+//// // // Find the filter that owns the pin connected to us.
+//// // FILTER_INFO fi;
+//// // hr = m_Connected->QueryFilterInfo(&fi);
+//// // if (SUCCEEDED(hr))
+//// // {
+//// // if (fi.pFilter != NULL)
+//// // {
+//// // // Disconnect the pins.
+//// // pGraph->Disconnect(m_Connected);
+//// // pGraph->Disconnect(pPin);
+//// // // Remove the filter from the graph.
+//// // pGraph->RemoveFilter(fi.pFilter);
+//// // fi.pFilter->Release();
+//// // }
+//// // else
+//// // {
+//// // hr = E_UNEXPECTED;
+//// // }
+//// // }
+//// // }
+//// // return hr;
+//// return S_OK;
////}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,100 +1,100 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "Theoradecoderdllstuff.h"
-#include "BasicSeekPassThrough.h"
-
-#include <fstream>
-using namespace std;
-class TheoraDecodeOutputPin
- : public CTransformOutputPin
- , public BasicSeekPassThrough
-{
-public:
- //COnstructors
- TheoraDecodeOutputPin(CTransformFilter* inParentFilter, HRESULT* outHR);
- virtual ~TheoraDecodeOutputPin();
-
- //COM Guff
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- //Overrides
- virtual HRESULT BreakConnect();
- virtual HRESULT CompleteConnect (IPin *inReceivePin);
-
- //Quality control
- virtual STDMETHODIMP Notify(IBaseFilter* inMessageSource, Quality inQuality);
-
- //fstream debugLog;
-};
-//----------------------
-//OLD IMPLEMENTATION
-//----------------------
-//#include <d3d9.h>
-//#include <vmr9.h>
-//#include "Theoradecoderdllstuff.h"
-//#include "AbstractVideoDecodeOutputPin.h"
-//
-//
-//class TheoraDecodeFilter;
-//class TheoraDecodeOutputPin
-// : public AbstractVideoDecodeOutputPin
-// //, public IStreamBuilder
-//{
-//public:
-// friend class TheoraDecodeInputPin;
-//
-// DECLARE_IUNKNOWN
-// STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-// TheoraDecodeOutputPin(TheoraDecodeFilter* inParentFilter,CCritSec* inFilterLock);
-// virtual ~TheoraDecodeOutputPin(void);
-//
-// STDMETHODIMP Notify(IBaseFilter *pSelf, Quality q);
-//
-// //Implements IStreamBuilder to force the pin to connect to VMR9
-// //STDMETHODIMP Render(IPin* inOutputPin, IGraphBuilder* inGraphBuilder);
-// //STDMETHODIMP Backout(IPin* inOutputPin, IGraphBuilder* inGraphBuilder);
-//
-//
-//
-//
-//
-//
-//
-// //virtual bool FillWaveFormatExBuffer(WAVEFORMATEX* inFormatBuffer);
-// virtual bool FillVideoInfoHeader(VIDEOINFOHEADER* inFormatBuffer);
-//
-//
-//};
-//
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "Theoradecoderdllstuff.h"
+#include "BasicSeekPassThrough.h"
+
+#include <fstream>
+using namespace std;
+class TheoraDecodeOutputPin
+ : public CTransformOutputPin
+ , public BasicSeekPassThrough
+{
+public:
+ //COnstructors
+ TheoraDecodeOutputPin(CTransformFilter* inParentFilter, HRESULT* outHR);
+ virtual ~TheoraDecodeOutputPin();
+
+ //COM Guff
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ //Overrides
+ virtual HRESULT BreakConnect();
+ virtual HRESULT CompleteConnect (IPin *inReceivePin);
+
+ //Quality control
+ virtual STDMETHODIMP Notify(IBaseFilter* inMessageSource, Quality inQuality);
+
+ //fstream debugLog;
+};
+//----------------------
+//OLD IMPLEMENTATION
+//----------------------
+//#include <d3d9.h>
+//#include <vmr9.h>
+//#include "Theoradecoderdllstuff.h"
+//#include "AbstractVideoDecodeOutputPin.h"
+//
+//
+//class TheoraDecodeFilter;
+//class TheoraDecodeOutputPin
+// : public AbstractVideoDecodeOutputPin
+// //, public IStreamBuilder
+//{
+//public:
+// friend class TheoraDecodeInputPin;
+//
+// DECLARE_IUNKNOWN
+// STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+// TheoraDecodeOutputPin(TheoraDecodeFilter* inParentFilter,CCritSec* inFilterLock);
+// virtual ~TheoraDecodeOutputPin(void);
+//
+// STDMETHODIMP Notify(IBaseFilter *pSelf, Quality q);
+//
+// //Implements IStreamBuilder to force the pin to connect to VMR9
+// //STDMETHODIMP Render(IPin* inOutputPin, IGraphBuilder* inGraphBuilder);
+// //STDMETHODIMP Backout(IPin* inOutputPin, IGraphBuilder* inGraphBuilder);
+//
+//
+//
+//
+//
+//
+//
+// //virtual bool FillWaveFormatExBuffer(WAVEFORMATEX* inFormatBuffer);
+// virtual bool FillVideoInfoHeader(VIDEOINFOHEADER* inFormatBuffer);
+//
+//
+//};
+//
+//
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/TheoraDecodeOutputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/dsfTheoraDecoder.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/dsfTheoraDecoder.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/dsfTheoraDecoder.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,12 +1,12 @@
-// dsfTheoraDecoder.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- return TRUE;
-}
-
+// dsfTheoraDecoder.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ return TRUE;
+}
+
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/dsfTheoraDecoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,39 +1,39 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.cpp : source file that includes just the standard includes
-// dsfTheoraDecoder.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.cpp : source file that includes just the standard includes
+// dsfTheoraDecoder.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,54 +1,54 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-
-
-
-
-//OLD
-// TODO: reference additional headers your program requires here
-//#include "AbstractVideoDecodeFilter.h"
-//#include "AbstractVideoDecodeInputPin.h"
-//#include "AbstractVideoDecodeOutputPin.h"
-//#include "TheoraDecodeInputPin.h"
-//#include "TheoraDecodeOutputPin.h"
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+
+
+
+
+//OLD
+// TODO: reference additional headers your program requires here
+//#include "AbstractVideoDecodeFilter.h"
+//#include "AbstractVideoDecodeInputPin.h"
+//#include "AbstractVideoDecodeOutputPin.h"
+//#include "TheoraDecodeInputPin.h"
+//#include "TheoraDecodeOutputPin.h"
//#include "TheoraDecodeFilter.h"
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/theoradecodedllstuff.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/theoradecodedllstuff.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/theoradecodedllstuff.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,100 +1,100 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-
-#include "Theoradecoderdllstuff.h"
-
-extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
-BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
-{
- return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
-}
-
-
-//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
-STDAPI DllRegisterServer()
-{
-
- //TO DO::: Should we be releasing the filter mapper even when we return early ?
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(TRUE);
-
-
-
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
-
-
- hr = locFilterMapper->RegisterFilter(
- CLSID_TheoraDecodeFilter, // Filter CLSID.
- L"Theora Decode Filter", // Filter name.
- NULL, // Device moniker.
- &CLSID_LegacyAmFilterCategory, // Direct Show general category
- L"Theora Decode Filter", // Instance data. ???????
- &TheoraDecodeFilterReg // Pointer to filter information.
- );
-
- locFilterMapper->Release();
-
- return hr;
-
-}
-
-STDAPI DllUnregisterServer()
-{
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(FALSE);
- if (FAILED(hr)) {
-
- return hr;
- }
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
- IID_IFilterMapper2, (void **)&locFilterMapper);
-
- if (FAILED(hr)) {
- return hr;
- }
-
-
- hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, L"Theora Decode Filter", CLSID_TheoraDecodeFilter);
-
-
- //
- locFilterMapper->Release();
- return hr;
-
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+
+#include "Theoradecoderdllstuff.h"
+
+extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
+BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+ return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
+}
+
+
+//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
+STDAPI DllRegisterServer()
+{
+
+ //TO DO::: Should we be releasing the filter mapper even when we return early ?
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(TRUE);
+
+
+
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
+
+
+ hr = locFilterMapper->RegisterFilter(
+ CLSID_TheoraDecodeFilter, // Filter CLSID.
+ L"Theora Decode Filter", // Filter name.
+ NULL, // Device moniker.
+ &CLSID_LegacyAmFilterCategory, // Direct Show general category
+ L"Theora Decode Filter", // Instance data. ???????
+ &TheoraDecodeFilterReg // Pointer to filter information.
+ );
+
+ locFilterMapper->Release();
+
+ return hr;
+
+}
+
+STDAPI DllUnregisterServer()
+{
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(FALSE);
+ if (FAILED(hr)) {
+
+ return hr;
+ }
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
+ IID_IFilterMapper2, (void **)&locFilterMapper);
+
+ if (FAILED(hr)) {
+ return hr;
+ }
+
+
+ hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, L"Theora Decode Filter", CLSID_TheoraDecodeFilter);
+
+
+ //
+ locFilterMapper->Release();
+ return hr;
+
+}
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/theoradecodedllstuff.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/theoradecoderdllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/theoradecoderdllstuff.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/theoradecoderdllstuff.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,126 +1,126 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include <streams.h>
-#include <pullpin.h>
-#include <initguid.h>
-
-//#ifdef DSFABSTRACTOGGVIDEODECODER_EXPORTS
-//#pragma message("----> Exporting from Abstract Video Library...")
-//#define ABS_VIDEO_DEC_API __declspec(dllexport)
-//#else
-//#pragma message("<---- Importing from Abstract Video Library...")
-//#define ABS_VIDEO_DEC_API __declspec(dllimport)
-//#endif
-
-#ifdef LIBOOOGG_EXPORTS
-#define LIBOOOGG_API __declspec(dllexport)
-#else
-#define LIBOOOGG_API __declspec(dllimport)
-#endif
-
-// {05187161-5C36-4324-A734-22BF37509F2D}
-DEFINE_GUID(CLSID_TheoraDecodeFilter,
-0x5187161, 0x5c36, 0x4324, 0xa7, 0x34, 0x22, 0xbf, 0x37, 0x50, 0x9f, 0x2d);
-
-// {D124B2B1-8968-4ae8-B288-FE16EA34B0CE}
-DEFINE_GUID(MEDIASUBTYPE_Theora,
-0xd124b2b1, 0x8968, 0x4ae8, 0xb2, 0x88, 0xfe, 0x16, 0xea, 0x34, 0xb0, 0xce);
-
-// {A99F116C-DFFA-412c-95DE-725F99874826}
-DEFINE_GUID(FORMAT_Theora,
-0xa99f116c, 0xdffa, 0x412c, 0x95, 0xde, 0x72, 0x5f, 0x99, 0x87, 0x48, 0x26);
-
-const REGPINTYPES TheoraDecodeOutputTypes = {
- &MEDIATYPE_Video,
- &MEDIASUBTYPE_YV12
-};
-
-const REGPINTYPES TheoraDecodeInputTypes = {
- &MEDIATYPE_Video,
- &MEDIASUBTYPE_Theora
-};
-const REGFILTERPINS TheoraDecodePinReg[] = {
- {
- L"Theora Input", //Name (obsoleted)
- FALSE, //Renders from this pin ?? Not sure about this.
- FALSE, //Not an output pin
- FALSE, //Cannot have zero instances of this pin
- FALSE, //Cannot have more than one instance of this pin
- NULL, //Connects to filter (obsoleted)
- NULL, //Connects to pin (obsoleted)
- 1, //upport two media type
- &TheoraDecodeInputTypes //Pointer to media type (Video/Theora)
- } ,
-
- {
- L"YV12 Output", //Name (obsoleted)
- FALSE, //Renders from this pin ?? Not sure about this.
- TRUE, //Is an output pin
- FALSE, //Cannot have zero instances of this pin
- FALSE, //Cannot have more than one instance of this pin
- NULL, //Connects to filter (obsoleted)
- NULL, //Connects to pin (obsoleted)
- 1, //Only support one media type
- &TheoraDecodeOutputTypes //Pointer to media type (YV12)
-
- }
-};
-
-
-
-const REGFILTER2 TheoraDecodeFilterReg = {
- 1,
- MERIT_NORMAL,
- 2,
- TheoraDecodePinReg
-
-};
-
-
-struct sTheoraFormatBlock {
- unsigned long theoraVersion;
- unsigned long width;
- unsigned long height;
- unsigned long frameWidth;
- unsigned long frameHeight;
- unsigned long frameRateNumerator;
- unsigned long frameRateDenominator;
- unsigned long aspectNumerator;
- unsigned long aspectDenominator;
- unsigned long maxKeyframeInterval;
- unsigned long targetBitrate;
- unsigned char targetQuality;
- unsigned char xOffset;
- unsigned char yOffset;
- unsigned char colourSpace;
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include <streams.h>
+#include <pullpin.h>
+#include <initguid.h>
+
+//#ifdef DSFABSTRACTOGGVIDEODECODER_EXPORTS
+//#pragma message("----> Exporting from Abstract Video Library...")
+//#define ABS_VIDEO_DEC_API __declspec(dllexport)
+//#else
+//#pragma message("<---- Importing from Abstract Video Library...")
+//#define ABS_VIDEO_DEC_API __declspec(dllimport)
+//#endif
+
+#ifdef LIBOOOGG_EXPORTS
+#define LIBOOOGG_API __declspec(dllexport)
+#else
+#define LIBOOOGG_API __declspec(dllimport)
+#endif
+
+// {05187161-5C36-4324-A734-22BF37509F2D}
+DEFINE_GUID(CLSID_TheoraDecodeFilter,
+0x5187161, 0x5c36, 0x4324, 0xa7, 0x34, 0x22, 0xbf, 0x37, 0x50, 0x9f, 0x2d);
+
+// {D124B2B1-8968-4ae8-B288-FE16EA34B0CE}
+DEFINE_GUID(MEDIASUBTYPE_Theora,
+0xd124b2b1, 0x8968, 0x4ae8, 0xb2, 0x88, 0xfe, 0x16, 0xea, 0x34, 0xb0, 0xce);
+
+// {A99F116C-DFFA-412c-95DE-725F99874826}
+DEFINE_GUID(FORMAT_Theora,
+0xa99f116c, 0xdffa, 0x412c, 0x95, 0xde, 0x72, 0x5f, 0x99, 0x87, 0x48, 0x26);
+
+const REGPINTYPES TheoraDecodeOutputTypes = {
+ &MEDIATYPE_Video,
+ &MEDIASUBTYPE_YV12
+};
+
+const REGPINTYPES TheoraDecodeInputTypes = {
+ &MEDIATYPE_Video,
+ &MEDIASUBTYPE_Theora
+};
+const REGFILTERPINS TheoraDecodePinReg[] = {
+ {
+ L"Theora Input", //Name (obsoleted)
+ FALSE, //Renders from this pin ?? Not sure about this.
+ FALSE, //Not an output pin
+ FALSE, //Cannot have zero instances of this pin
+ FALSE, //Cannot have more than one instance of this pin
+ NULL, //Connects to filter (obsoleted)
+ NULL, //Connects to pin (obsoleted)
+ 1, //upport two media type
+ &TheoraDecodeInputTypes //Pointer to media type (Video/Theora)
+ } ,
+
+ {
+ L"YV12 Output", //Name (obsoleted)
+ FALSE, //Renders from this pin ?? Not sure about this.
+ TRUE, //Is an output pin
+ FALSE, //Cannot have zero instances of this pin
+ FALSE, //Cannot have more than one instance of this pin
+ NULL, //Connects to filter (obsoleted)
+ NULL, //Connects to pin (obsoleted)
+ 1, //Only support one media type
+ &TheoraDecodeOutputTypes //Pointer to media type (YV12)
+
+ }
+};
+
+
+
+const REGFILTER2 TheoraDecodeFilterReg = {
+ 1,
+ MERIT_NORMAL,
+ 2,
+ TheoraDecodePinReg
+
+};
+
+
+struct sTheoraFormatBlock {
+ unsigned long theoraVersion;
+ unsigned long width;
+ unsigned long height;
+ unsigned long frameWidth;
+ unsigned long frameHeight;
+ unsigned long frameRateNumerator;
+ unsigned long frameRateDenominator;
+ unsigned long aspectNumerator;
+ unsigned long aspectDenominator;
+ unsigned long maxKeyframeInterval;
+ unsigned long targetBitrate;
+ unsigned char targetQuality;
+ unsigned char xOffset;
+ unsigned char yOffset;
+ unsigned char colourSpace;
};
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/theoradecoderdllstuff.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraDecoder/theoradllstuff.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/ITheoraEncodeSettings.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/ITheoraEncodeSettings.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/ITheoraEncodeSettings.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,10 +1,10 @@
-#include "StdAfx.h"
-#include "itheoraencodesettings.h"
-
-ITheoraEncodeSettings::ITheoraEncodeSettings(void)
-{
-}
-
-ITheoraEncodeSettings::~ITheoraEncodeSettings(void)
-{
-}
+#include "StdAfx.h"
+#include "itheoraencodesettings.h"
+
+ITheoraEncodeSettings::ITheoraEncodeSettings(void)
+{
+}
+
+ITheoraEncodeSettings::~ITheoraEncodeSettings(void)
+{
+}
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/ITheoraEncodeSettings.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/ITheoraEncodeSettings.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/ITheoraEncodeSettings.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/ITheoraEncodeSettings.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,16 +1,16 @@
-#pragma once
-
-//class ITheoraEncodeSettings
-//{
-//public:
-// DECLARE_IUNKNOWN
-// virtual unsigned long targetBitrate() = 0;
-// virtual unsigned char quality() = 0;
-// virtual unsigned long keyframeFreq() = 0;
-//
-// virtual bool setTargetBitrate(unsigned long inBitrate) = 0;
-// virtual bool setQuality(unsigned char inQuality) = 0;
-// virtual bool setKeyframeFreq(unsigned long inKeyframeFreq) = 0;
+#pragma once
+
+//class ITheoraEncodeSettings
+//{
+//public:
+// DECLARE_IUNKNOWN
+// virtual unsigned long targetBitrate() = 0;
+// virtual unsigned char quality() = 0;
+// virtual unsigned long keyframeFreq() = 0;
+//
+// virtual bool setTargetBitrate(unsigned long inBitrate) = 0;
+// virtual bool setQuality(unsigned char inQuality) = 0;
+// virtual bool setKeyframeFreq(unsigned long inKeyframeFreq) = 0;
//protected:
// //unsigned long mTargetBitrate;
//
@@ -18,32 +18,32 @@
//
// //unsigned long mKeyframeFreq;
//
-//};
-
-#ifndef __ITHEORAENCODESETTINGS__
-#define __ITHEORAENCODESETTINGS__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-DECLARE_INTERFACE_(ITheoraEncodeSettings, IUnknown) {
-
- virtual STDMETHODIMP_(unsigned long) targetBitrate() PURE;
-
- virtual STDMETHODIMP_(unsigned char) quality() PURE;
- virtual STDMETHODIMP_(unsigned long) keyframeFreq() PURE;
-
- virtual STDMETHODIMP_(bool) setTargetBitrate(unsigned long inBitrate) PURE;
- virtual STDMETHODIMP_(bool) setQuality(unsigned char inQuality) PURE;
- virtual STDMETHODIMP_(bool) setKeyframeFreq(unsigned long inKeyframeFreq) PURE;
-
-
-};
-
-#ifdef __cplusplus
-}
-#endif
-
+//};
+
+#ifndef __ITHEORAENCODESETTINGS__
+#define __ITHEORAENCODESETTINGS__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+DECLARE_INTERFACE_(ITheoraEncodeSettings, IUnknown) {
+
+ virtual STDMETHODIMP_(unsigned long) targetBitrate() PURE;
+
+ virtual STDMETHODIMP_(unsigned char) quality() PURE;
+ virtual STDMETHODIMP_(unsigned long) keyframeFreq() PURE;
+
+ virtual STDMETHODIMP_(bool) setTargetBitrate(unsigned long inBitrate) PURE;
+ virtual STDMETHODIMP_(bool) setQuality(unsigned char inQuality) PURE;
+ virtual STDMETHODIMP_(bool) setKeyframeFreq(unsigned long inKeyframeFreq) PURE;
+
+
+};
+
+#ifdef __cplusplus
+}
+#endif
+
#endif
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/ITheoraEncodeSettings.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/PropsTheoraEncoder.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/PropsTheoraEncoder.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/PropsTheoraEncoder.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,193 +1,193 @@
-#include "StdAfx.h"
-#include "propstheoraencoder.h"
-
-PropsTheoraEncoder::PropsTheoraEncoder(LPUNKNOWN inUnk, HRESULT* outHR)
- : CBasePropertyPage(NAME("illiminable Directshow Filters"), inUnk, IDD_THEORA_ENCODE_SETTINGS, IDS_THEORA_ENC_PROPS_STRING)
- , mTheoraEncodeSettings(NULL)
-
-{
- //debugLog.open("G:\\logs\\TheoProps.log", ios_base::out);
- *outHR = S_OK;
-}
-
-PropsTheoraEncoder::~PropsTheoraEncoder(void)
-{
- //debugLog.close();
-}
-
-CUnknown* PropsTheoraEncoder::CreateInstance(LPUNKNOWN inUnk, HRESULT* outHR)
-{
- return new PropsTheoraEncoder(inUnk, outHR);
-}
-
-//LRESULT PropsTheoraEncoder::addNumberToCombo(int inComboID, int inNum) {
-// char locStrBuff[16];
-// itoa(inNum, (char*)&locStrBuff, 10);
-// return SendDlgItemMessage(m_Dlg, IDC_COMBO_BITRATE, CB_ADDSTRING, NOT_USED, (LPARAM)&locStrBuff);
-//
-//}
-//
-//void PropsTheoraEncoder::SetupBitrateCombo() {
-// addNumberToCombo(IDC_COMBO_BITRATE, 64000);
-// addNumberToCombo(IDC_COMBO_BITRATE, 96000);
-// addNumberToCombo(IDC_COMBO_BITRATE, 128000);
-// addNumberToCombo(IDC_COMBO_BITRATE, 192000);
-// addNumberToCombo(IDC_COMBO_BITRATE, 256000);
-// addNumberToCombo(IDC_COMBO_BITRATE, 384000);
-// addNumberToCombo(IDC_COMBO_BITRATE, 512000);
-// addNumberToCombo(IDC_COMBO_BITRATE, 768000);
-// addNumberToCombo(IDC_COMBO_BITRATE, 1024000);
-// addNumberToCombo(IDC_COMBO_BITRATE, 1536000);
-// addNumberToCombo(IDC_COMBO_BITRATE, 2000000);
-//
-//}
-//
-//void PropsTheoraEncoder::SetupKeyframeFreqCombo() {
-//
-// addNumberToCombo(IDC_COMBO_LOG_KEYFRAME_FREQ, 1);
-// addNumberToCombo(IDC_COMBO_LOG_KEYFRAME_FREQ, 2);
-// addNumberToCombo(IDC_COMBO_LOG_KEYFRAME_FREQ, 3);
-// addNumberToCombo(IDC_COMBO_LOG_KEYFRAME_FREQ, 4);
-// addNumberToCombo(IDC_COMBO_LOG_KEYFRAME_FREQ, 5);
-// addNumberToCombo(IDC_COMBO_LOG_KEYFRAME_FREQ, 6);
-// addNumberToCombo(IDC_COMBO_LOG_KEYFRAME_FREQ, 7);
-// addNumberToCombo(IDC_COMBO_LOG_KEYFRAME_FREQ, 8);
-// addNumberToCombo(IDC_COMBO_LOG_KEYFRAME_FREQ, 9);
-// addNumberToCombo(IDC_COMBO_LOG_KEYFRAME_FREQ, 10);
-//
-//}
-
-unsigned long PropsTheoraEncoder::log2(unsigned long inNum) {
- unsigned long ret = 0;
- while (inNum != 0) {
- inNum>>=1;
- ret++;
- }
- return ret - 1;
-}
-
-unsigned long PropsTheoraEncoder::pow2(unsigned long inNum) {
- return 1 << (inNum);
-}
-
-HRESULT PropsTheoraEncoder::OnApplyChanges(void)
-{
- if (mTheoraEncodeSettings == NULL) {
- return E_POINTER;
- }
-
- mTheoraEncodeSettings->setQuality(SendDlgItemMessage(m_hwnd,IDC_SLIDER_QUALITY, TBM_GETPOS, NOT_USED, NOT_USED));
- mTheoraEncodeSettings->setKeyframeFreq(pow2(SendDlgItemMessage(m_hwnd,IDC_SLIDER_LOG_KEYFRAME, TBM_GETPOS, NOT_USED, NOT_USED)));
- mTheoraEncodeSettings->setTargetBitrate(SendDlgItemMessage(m_hwnd,IDC_SLIDER_BITRATE, TBM_GETPOS, NOT_USED, NOT_USED) * 1000);
- SetClean();
- return S_OK;
-}
-
-HRESULT PropsTheoraEncoder::OnActivate(void)
-{
-
- char* locStrBuff = new char[16];
-
- //SetupBitrateCombo();
- //SetupKeyframeFreqCombo();
-
- //Set up the sliders
- SendDlgItemMessage(m_Dlg, IDC_SLIDER_QUALITY, TBM_SETRANGE, TRUE, MAKELONG(0, 63));
- SendDlgItemMessage(m_Dlg, IDC_SLIDER_QUALITY, TBM_SETTICFREQ, 1, 0);
- SendDlgItemMessage(m_Dlg, IDC_SLIDER_QUALITY, TBM_SETPOS, 1, mTheoraEncodeSettings->quality());
-
- SendDlgItemMessage(m_Dlg, IDC_SLIDER_LOG_KEYFRAME, TBM_SETRANGE, TRUE, MAKELONG(0, 13));
- SendDlgItemMessage(m_Dlg, IDC_SLIDER_LOG_KEYFRAME, TBM_SETTICFREQ, 1, 0);
- SendDlgItemMessage(m_Dlg, IDC_SLIDER_LOG_KEYFRAME, TBM_SETPOS, 1, log2(mTheoraEncodeSettings->keyframeFreq()));
-
- SendDlgItemMessage(m_Dlg, IDC_SLIDER_BITRATE, TBM_SETRANGE, TRUE, MAKELONG(64, 1984));
- SendDlgItemMessage(m_Dlg, IDC_SLIDER_BITRATE, TBM_SETTICFREQ, 32, 0);
- SendDlgItemMessage(m_Dlg, IDC_SLIDER_BITRATE, TBM_SETPOS, 1, mTheoraEncodeSettings->targetBitrate() / 1000);
-
-
- itoa(mTheoraEncodeSettings->quality(), locStrBuff, 10);
- SendDlgItemMessage(m_Dlg, IDC_LABEL_QUALITY, WM_SETTEXT, NOT_USED, (LPARAM)locStrBuff);
-
- itoa(mTheoraEncodeSettings->keyframeFreq(), locStrBuff, 10);
- SendDlgItemMessage(m_Dlg, IDC_LABEL_LOG_KEYFRAME, WM_SETTEXT,NOT_USED, (LPARAM)locStrBuff);
-
- itoa(mTheoraEncodeSettings->targetBitrate(), locStrBuff, 10);
- SendDlgItemMessage(m_Dlg, IDC_LABEL_BITRATE, WM_SETTEXT,NOT_USED, (LPARAM)locStrBuff);
-
- delete[] locStrBuff;
- return S_OK;
-}
-
-HRESULT PropsTheoraEncoder::OnConnect(IUnknown *pUnk)
-{
-
- if (mTheoraEncodeSettings != NULL) {
- //mTheoraEncodeSettings->Release();
- mTheoraEncodeSettings = NULL;
- }
-
- HRESULT locHR;
- // Query pUnk for the filter's custom interface.
- locHR = pUnk->QueryInterface(IID_ITheoraEncodeSettings, (void**)(&mTheoraEncodeSettings));
- return locHR;
-}
-
-HRESULT PropsTheoraEncoder::OnDisconnect(void)
-{
- if (mTheoraEncodeSettings != NULL) {
- //mTheoraEncodeSettings->Release();
- mTheoraEncodeSettings = NULL;
- }
- return S_OK;
-}
-void PropsTheoraEncoder::SetDirty()
-{
- m_bDirty = TRUE;
- if (m_pPageSite)
- {
- m_pPageSite->OnStatusChange(PROPPAGESTATUS_DIRTY);
- }
-}
-
-void PropsTheoraEncoder::SetClean()
-{
- m_bDirty = FALSE;
- if (m_pPageSite)
- {
- m_pPageSite->OnStatusChange(PROPPAGESTATUS_CLEAN);
- }
-}
-INT_PTR PropsTheoraEncoder::OnReceiveMessage(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
-{
- char locBuff[16];
- switch (uMsg) {
- case WM_COMMAND:
-
- case WM_HSCROLL:
- if (HWND(lParam) == GetDlgItem(m_hwnd, IDC_SLIDER_QUALITY)) {
- SetDirty();
- itoa(SendDlgItemMessage(m_hwnd,IDC_SLIDER_QUALITY, TBM_GETPOS, NOT_USED, NOT_USED), (char*)&locBuff, 10);
- SendDlgItemMessage(m_hwnd, IDC_LABEL_QUALITY, WM_SETTEXT, NOT_USED, (LPARAM)&locBuff);
- return (INT_PTR)TRUE;
-
- } else if (HWND(lParam) == GetDlgItem(m_hwnd, IDC_SLIDER_BITRATE)) {
- SetDirty();
- itoa(SendDlgItemMessage(m_hwnd,IDC_SLIDER_BITRATE, TBM_GETPOS, NOT_USED, NOT_USED) * 1000, (char*)&locBuff, 10);
- SendDlgItemMessage(m_hwnd, IDC_LABEL_BITRATE, WM_SETTEXT, NOT_USED, (LPARAM)&locBuff);
- return (INT_PTR)TRUE;
-
- } else if (HWND(lParam) == GetDlgItem(m_hwnd, IDC_SLIDER_LOG_KEYFRAME)) {
- SetDirty();
- itoa(pow2(SendDlgItemMessage(m_hwnd,IDC_SLIDER_LOG_KEYFRAME, TBM_GETPOS, NOT_USED, NOT_USED)), (char*)&locBuff, 10);
- SendDlgItemMessage(m_hwnd, IDC_LABEL_LOG_KEYFRAME, WM_SETTEXT, NOT_USED, (LPARAM)&locBuff);
- return (INT_PTR)TRUE;
- }
-
- break;
- } // switch
-
- // Did not handle the message.
- return CBasePropertyPage::OnReceiveMessage(hwnd, uMsg, wParam, lParam);
-}
-
-
+#include "StdAfx.h"
+#include "propstheoraencoder.h"
+
+PropsTheoraEncoder::PropsTheoraEncoder(LPUNKNOWN inUnk, HRESULT* outHR)
+ : CBasePropertyPage(NAME("illiminable Directshow Filters"), inUnk, IDD_THEORA_ENCODE_SETTINGS, IDS_THEORA_ENC_PROPS_STRING)
+ , mTheoraEncodeSettings(NULL)
+
+{
+ //debugLog.open("G:\\logs\\TheoProps.log", ios_base::out);
+ *outHR = S_OK;
+}
+
+PropsTheoraEncoder::~PropsTheoraEncoder(void)
+{
+ //debugLog.close();
+}
+
+CUnknown* PropsTheoraEncoder::CreateInstance(LPUNKNOWN inUnk, HRESULT* outHR)
+{
+ return new PropsTheoraEncoder(inUnk, outHR);
+}
+
+//LRESULT PropsTheoraEncoder::addNumberToCombo(int inComboID, int inNum) {
+// char locStrBuff[16];
+// itoa(inNum, (char*)&locStrBuff, 10);
+// return SendDlgItemMessage(m_Dlg, IDC_COMBO_BITRATE, CB_ADDSTRING, NOT_USED, (LPARAM)&locStrBuff);
+//
+//}
+//
+//void PropsTheoraEncoder::SetupBitrateCombo() {
+// addNumberToCombo(IDC_COMBO_BITRATE, 64000);
+// addNumberToCombo(IDC_COMBO_BITRATE, 96000);
+// addNumberToCombo(IDC_COMBO_BITRATE, 128000);
+// addNumberToCombo(IDC_COMBO_BITRATE, 192000);
+// addNumberToCombo(IDC_COMBO_BITRATE, 256000);
+// addNumberToCombo(IDC_COMBO_BITRATE, 384000);
+// addNumberToCombo(IDC_COMBO_BITRATE, 512000);
+// addNumberToCombo(IDC_COMBO_BITRATE, 768000);
+// addNumberToCombo(IDC_COMBO_BITRATE, 1024000);
+// addNumberToCombo(IDC_COMBO_BITRATE, 1536000);
+// addNumberToCombo(IDC_COMBO_BITRATE, 2000000);
+//
+//}
+//
+//void PropsTheoraEncoder::SetupKeyframeFreqCombo() {
+//
+// addNumberToCombo(IDC_COMBO_LOG_KEYFRAME_FREQ, 1);
+// addNumberToCombo(IDC_COMBO_LOG_KEYFRAME_FREQ, 2);
+// addNumberToCombo(IDC_COMBO_LOG_KEYFRAME_FREQ, 3);
+// addNumberToCombo(IDC_COMBO_LOG_KEYFRAME_FREQ, 4);
+// addNumberToCombo(IDC_COMBO_LOG_KEYFRAME_FREQ, 5);
+// addNumberToCombo(IDC_COMBO_LOG_KEYFRAME_FREQ, 6);
+// addNumberToCombo(IDC_COMBO_LOG_KEYFRAME_FREQ, 7);
+// addNumberToCombo(IDC_COMBO_LOG_KEYFRAME_FREQ, 8);
+// addNumberToCombo(IDC_COMBO_LOG_KEYFRAME_FREQ, 9);
+// addNumberToCombo(IDC_COMBO_LOG_KEYFRAME_FREQ, 10);
+//
+//}
+
+unsigned long PropsTheoraEncoder::log2(unsigned long inNum) {
+ unsigned long ret = 0;
+ while (inNum != 0) {
+ inNum>>=1;
+ ret++;
+ }
+ return ret - 1;
+}
+
+unsigned long PropsTheoraEncoder::pow2(unsigned long inNum) {
+ return 1 << (inNum);
+}
+
+HRESULT PropsTheoraEncoder::OnApplyChanges(void)
+{
+ if (mTheoraEncodeSettings == NULL) {
+ return E_POINTER;
+ }
+
+ mTheoraEncodeSettings->setQuality(SendDlgItemMessage(m_hwnd,IDC_SLIDER_QUALITY, TBM_GETPOS, NOT_USED, NOT_USED));
+ mTheoraEncodeSettings->setKeyframeFreq(pow2(SendDlgItemMessage(m_hwnd,IDC_SLIDER_LOG_KEYFRAME, TBM_GETPOS, NOT_USED, NOT_USED)));
+ mTheoraEncodeSettings->setTargetBitrate(SendDlgItemMessage(m_hwnd,IDC_SLIDER_BITRATE, TBM_GETPOS, NOT_USED, NOT_USED) * 1000);
+ SetClean();
+ return S_OK;
+}
+
+HRESULT PropsTheoraEncoder::OnActivate(void)
+{
+
+ char* locStrBuff = new char[16];
+
+ //SetupBitrateCombo();
+ //SetupKeyframeFreqCombo();
+
+ //Set up the sliders
+ SendDlgItemMessage(m_Dlg, IDC_SLIDER_QUALITY, TBM_SETRANGE, TRUE, MAKELONG(0, 63));
+ SendDlgItemMessage(m_Dlg, IDC_SLIDER_QUALITY, TBM_SETTICFREQ, 1, 0);
+ SendDlgItemMessage(m_Dlg, IDC_SLIDER_QUALITY, TBM_SETPOS, 1, mTheoraEncodeSettings->quality());
+
+ SendDlgItemMessage(m_Dlg, IDC_SLIDER_LOG_KEYFRAME, TBM_SETRANGE, TRUE, MAKELONG(0, 13));
+ SendDlgItemMessage(m_Dlg, IDC_SLIDER_LOG_KEYFRAME, TBM_SETTICFREQ, 1, 0);
+ SendDlgItemMessage(m_Dlg, IDC_SLIDER_LOG_KEYFRAME, TBM_SETPOS, 1, log2(mTheoraEncodeSettings->keyframeFreq()));
+
+ SendDlgItemMessage(m_Dlg, IDC_SLIDER_BITRATE, TBM_SETRANGE, TRUE, MAKELONG(64, 1984));
+ SendDlgItemMessage(m_Dlg, IDC_SLIDER_BITRATE, TBM_SETTICFREQ, 32, 0);
+ SendDlgItemMessage(m_Dlg, IDC_SLIDER_BITRATE, TBM_SETPOS, 1, mTheoraEncodeSettings->targetBitrate() / 1000);
+
+
+ itoa(mTheoraEncodeSettings->quality(), locStrBuff, 10);
+ SendDlgItemMessage(m_Dlg, IDC_LABEL_QUALITY, WM_SETTEXT, NOT_USED, (LPARAM)locStrBuff);
+
+ itoa(mTheoraEncodeSettings->keyframeFreq(), locStrBuff, 10);
+ SendDlgItemMessage(m_Dlg, IDC_LABEL_LOG_KEYFRAME, WM_SETTEXT,NOT_USED, (LPARAM)locStrBuff);
+
+ itoa(mTheoraEncodeSettings->targetBitrate(), locStrBuff, 10);
+ SendDlgItemMessage(m_Dlg, IDC_LABEL_BITRATE, WM_SETTEXT,NOT_USED, (LPARAM)locStrBuff);
+
+ delete[] locStrBuff;
+ return S_OK;
+}
+
+HRESULT PropsTheoraEncoder::OnConnect(IUnknown *pUnk)
+{
+
+ if (mTheoraEncodeSettings != NULL) {
+ //mTheoraEncodeSettings->Release();
+ mTheoraEncodeSettings = NULL;
+ }
+
+ HRESULT locHR;
+ // Query pUnk for the filter's custom interface.
+ locHR = pUnk->QueryInterface(IID_ITheoraEncodeSettings, (void**)(&mTheoraEncodeSettings));
+ return locHR;
+}
+
+HRESULT PropsTheoraEncoder::OnDisconnect(void)
+{
+ if (mTheoraEncodeSettings != NULL) {
+ //mTheoraEncodeSettings->Release();
+ mTheoraEncodeSettings = NULL;
+ }
+ return S_OK;
+}
+void PropsTheoraEncoder::SetDirty()
+{
+ m_bDirty = TRUE;
+ if (m_pPageSite)
+ {
+ m_pPageSite->OnStatusChange(PROPPAGESTATUS_DIRTY);
+ }
+}
+
+void PropsTheoraEncoder::SetClean()
+{
+ m_bDirty = FALSE;
+ if (m_pPageSite)
+ {
+ m_pPageSite->OnStatusChange(PROPPAGESTATUS_CLEAN);
+ }
+}
+INT_PTR PropsTheoraEncoder::OnReceiveMessage(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+ char locBuff[16];
+ switch (uMsg) {
+ case WM_COMMAND:
+
+ case WM_HSCROLL:
+ if (HWND(lParam) == GetDlgItem(m_hwnd, IDC_SLIDER_QUALITY)) {
+ SetDirty();
+ itoa(SendDlgItemMessage(m_hwnd,IDC_SLIDER_QUALITY, TBM_GETPOS, NOT_USED, NOT_USED), (char*)&locBuff, 10);
+ SendDlgItemMessage(m_hwnd, IDC_LABEL_QUALITY, WM_SETTEXT, NOT_USED, (LPARAM)&locBuff);
+ return (INT_PTR)TRUE;
+
+ } else if (HWND(lParam) == GetDlgItem(m_hwnd, IDC_SLIDER_BITRATE)) {
+ SetDirty();
+ itoa(SendDlgItemMessage(m_hwnd,IDC_SLIDER_BITRATE, TBM_GETPOS, NOT_USED, NOT_USED) * 1000, (char*)&locBuff, 10);
+ SendDlgItemMessage(m_hwnd, IDC_LABEL_BITRATE, WM_SETTEXT, NOT_USED, (LPARAM)&locBuff);
+ return (INT_PTR)TRUE;
+
+ } else if (HWND(lParam) == GetDlgItem(m_hwnd, IDC_SLIDER_LOG_KEYFRAME)) {
+ SetDirty();
+ itoa(pow2(SendDlgItemMessage(m_hwnd,IDC_SLIDER_LOG_KEYFRAME, TBM_GETPOS, NOT_USED, NOT_USED)), (char*)&locBuff, 10);
+ SendDlgItemMessage(m_hwnd, IDC_LABEL_LOG_KEYFRAME, WM_SETTEXT, NOT_USED, (LPARAM)&locBuff);
+ return (INT_PTR)TRUE;
+ }
+
+ break;
+ } // switch
+
+ // Did not handle the message.
+ return CBasePropertyPage::OnReceiveMessage(hwnd, uMsg, wParam, lParam);
+}
+
+
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/PropsTheoraEncoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/PropsTheoraEncoder.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/PropsTheoraEncoder.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/PropsTheoraEncoder.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,45 +1,45 @@
-#pragma once
-#include "resource.h"
-
-#include <commctrl.h>
-//Debug
-//#include <fstream>
-using namespace std;
-//
-class PropsTheoraEncoder
- : public CBasePropertyPage
-{
-public:
- static const UINT NOT_USED = 0;
- PropsTheoraEncoder(LPUNKNOWN inUnk, HRESULT* outHR);
- virtual ~PropsTheoraEncoder(void);
-
- static CUnknown* WINAPI CreateInstance(LPUNKNOWN inUnk, HRESULT* outHR);
-
- //CBasePropertyPage Virtual Overrides
- HRESULT OnActivate(void);
- HRESULT OnConnect(IUnknown *pUnk);
- HRESULT OnDisconnect(void);
- INT_PTR OnReceiveMessage(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
- HRESULT OnApplyChanges(void);
-
- static unsigned long log2(unsigned long inNum);
- static unsigned long pow2(unsigned long inNum);
-
-protected:
-
- //
- //void SetupBitrateCombo();
- //void SetupKeyframeFreqCombo();
- //LRESULT addNumberToCombo(int inComboID, int inNum);
-
- void SetDirty();
- void SetClean();
- //
- ITheoraEncodeSettings* mTheoraEncodeSettings;
-
- //Debug
-
- //fstream debugLog;
- //
-};
+#pragma once
+#include "resource.h"
+
+#include <commctrl.h>
+//Debug
+//#include <fstream>
+using namespace std;
+//
+class PropsTheoraEncoder
+ : public CBasePropertyPage
+{
+public:
+ static const UINT NOT_USED = 0;
+ PropsTheoraEncoder(LPUNKNOWN inUnk, HRESULT* outHR);
+ virtual ~PropsTheoraEncoder(void);
+
+ static CUnknown* WINAPI CreateInstance(LPUNKNOWN inUnk, HRESULT* outHR);
+
+ //CBasePropertyPage Virtual Overrides
+ HRESULT OnActivate(void);
+ HRESULT OnConnect(IUnknown *pUnk);
+ HRESULT OnDisconnect(void);
+ INT_PTR OnReceiveMessage(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+ HRESULT OnApplyChanges(void);
+
+ static unsigned long log2(unsigned long inNum);
+ static unsigned long pow2(unsigned long inNum);
+
+protected:
+
+ //
+ //void SetupBitrateCombo();
+ //void SetupKeyframeFreqCombo();
+ //LRESULT addNumberToCombo(int inComboID, int inNum);
+
+ void SetDirty();
+ void SetClean();
+ //
+ ITheoraEncodeSettings* mTheoraEncodeSettings;
+
+ //Debug
+
+ //fstream debugLog;
+ //
+};
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/PropsTheoraEncoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeFilter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeFilter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,231 +1,231 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "Theoraencodefilter.h"
-
-
-//COM Factory Template
-CFactoryTemplate g_Templates[] =
-{
- {
- L"Theora Encode Filter", // Name
- &CLSID_TheoraEncodeFilter, // CLSID
- TheoraEncodeFilter::CreateInstance, // Method to create an instance of MyComponent
- NULL, // Initialization function
- NULL // Set-up information (for filters)
- },
- {
- L"Theora Encode Properties", // Name
- &CLSID_PropsTheoraEncoder, // CLSID
- PropsTheoraEncoder::CreateInstance, // Method to create an instance of MyComponent
- NULL, // Initialization function
- NULL // Set-up information (for filters)
- }
-
-
-};
-
-// Generic way of determining the number of items in the template
-int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
-
-CUnknown* WINAPI TheoraEncodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
-{
- //This routine is the COM implementation to create a new Filter
- TheoraEncodeFilter *pNewObject = new TheoraEncodeFilter();
- if (pNewObject == NULL) {
- *pHr = E_OUTOFMEMORY;
- }
- return pNewObject;
-}
-STDMETHODIMP TheoraEncodeFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
- if (riid == IID_ITheoraEncodeSettings) {
- *ppv = (ITheoraEncodeSettings*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- } else if (riid == IID_ISpecifyPropertyPages) {
- *ppv = (ISpecifyPropertyPages*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- }
-
-
- return AbstractTransformFilter::NonDelegatingQueryInterface(riid, ppv);
-}
-
-TheoraEncodeFilter::TheoraEncodeFilter(void)
- : AbstractTransformFilter(NAME("Theora Encoder"), CLSID_TheoraEncodeFilter)
-{
- bool locWasConstructed = ConstructPins();
-}
-
-TheoraEncodeFilter::~TheoraEncodeFilter(void)
-{
-}
-
-bool TheoraEncodeFilter::ConstructPins()
-{
-
-
- //Inputs Video / Varios / VideoInfoHeader
- //Outputs Video / Theora / THeora
-
- //Vector to hold our set of media types we want to accept.
- vector<CMediaType*> locAcceptableTypes;
-
- //Setup the media types for the output pin.
- CMediaType* locAcceptMediaType = new CMediaType(&MEDIATYPE_Video); //Deleted in pin destructor
- locAcceptMediaType->subtype = MEDIASUBTYPE_Theora;
- locAcceptMediaType->formattype = FORMAT_Theora;
-
- locAcceptableTypes.push_back(locAcceptMediaType);
-
- //Output pin must be done first because it's passed to the input pin.
- mOutputPin = new TheoraEncodeOutputPin(this, m_pLock, locAcceptableTypes); //Deleted in base class destructor
-
- //Clear out the vector, now we've already passed it to the output pin.
- locAcceptableTypes.clear();
-
- //Setup the media Types for the input pin.
- locAcceptMediaType = NULL;
-
- //YV12
- locAcceptMediaType = new CMediaType(&MEDIATYPE_Video); //Deleted by pin
- locAcceptMediaType->subtype = MEDIASUBTYPE_YV12;
- locAcceptMediaType->formattype = FORMAT_VideoInfo;
-
- locAcceptableTypes.push_back(locAcceptMediaType);
-
- //YUY2
- locAcceptMediaType = new CMediaType(&MEDIATYPE_Video); //Deleted by pin
- locAcceptMediaType->subtype = MEDIASUBTYPE_YUY2;
- locAcceptMediaType->formattype = FORMAT_VideoInfo;
-
- locAcceptableTypes.push_back(locAcceptMediaType);
-
- //AYUV
- locAcceptMediaType = new CMediaType(&MEDIATYPE_Video); //Deleted by pin
- locAcceptMediaType->subtype = MEDIASUBTYPE_AYUV;
- locAcceptMediaType->formattype = FORMAT_VideoInfo;
-
- locAcceptableTypes.push_back(locAcceptMediaType);
-
- //RGB24
- locAcceptMediaType = new CMediaType(&MEDIATYPE_Video); //Deleted by pin
- locAcceptMediaType->subtype = MEDIASUBTYPE_RGB24;
- locAcceptMediaType->formattype = FORMAT_VideoInfo;
-
- locAcceptableTypes.push_back(locAcceptMediaType);
-
- //RGB32
- locAcceptMediaType = new CMediaType(&MEDIATYPE_Video); //Deleted by pin
- locAcceptMediaType->subtype = MEDIASUBTYPE_RGB32;
- locAcceptMediaType->formattype = FORMAT_VideoInfo;
-
- locAcceptableTypes.push_back(locAcceptMediaType);
-
- //UYVY
- locAcceptMediaType = new CMediaType(&MEDIATYPE_Video); //Deleted by pin
- locAcceptMediaType->subtype = MEDIASUBTYPE_UYVY;
- locAcceptMediaType->formattype = FORMAT_VideoInfo;
-
- locAcceptableTypes.push_back(locAcceptMediaType);
-
- //YVYU
- locAcceptMediaType = new CMediaType(&MEDIATYPE_Video); //Deleted by pin
- locAcceptMediaType->subtype = MEDIASUBTYPE_YVYU;
- locAcceptMediaType->formattype = FORMAT_VideoInfo;
-
- locAcceptableTypes.push_back(locAcceptMediaType);
-
- //IYUV
- locAcceptMediaType = new CMediaType(&MEDIATYPE_Video); //Deleted by pin
- locAcceptMediaType->subtype = MEDIASUBTYPE_IYUV;
- locAcceptMediaType->formattype = FORMAT_VideoInfo;
-
- locAcceptableTypes.push_back(locAcceptMediaType);
-
- mInputPin = new TheoraEncodeInputPin(this, m_pLock, mOutputPin, locAcceptableTypes); //Deleted in base class filter destructor.
- return true;
-}
-
-//Implementation of ITheoraEncodeSEttings
-STDMETHODIMP_(unsigned long) TheoraEncodeFilter::targetBitrate() {
- return ((TheoraEncodeInputPin*)mInputPin)->theoraInfo()->target_bitrate;
-}
-STDMETHODIMP_(unsigned char) TheoraEncodeFilter::quality() {
- return ((TheoraEncodeInputPin*)mInputPin)->theoraInfo()->quality;
-}
-STDMETHODIMP_(unsigned long) TheoraEncodeFilter::keyframeFreq() {
- return ((TheoraEncodeInputPin*)mInputPin)->theoraInfo()->keyframe_frequency;
-}
-
-STDMETHODIMP_(bool) TheoraEncodeFilter::setTargetBitrate(unsigned long inBitrate) {
- //Needs error checking
- ((TheoraEncodeInputPin*)mInputPin)->theoraInfo()->target_bitrate = inBitrate;
- ((TheoraEncodeInputPin*)mInputPin)->theoraInfo()->keyframe_data_target_bitrate = (inBitrate * 3)/2;
- //mTheoraFormatBlock.targetBitrate = inBitrate;
- //mTheoraFormatBlock.
- return true;
-
-}
-STDMETHODIMP_(bool) TheoraEncodeFilter::setQuality(unsigned char inQuality) {
- //Needs error checking
-
- ((TheoraEncodeInputPin*)mInputPin)->theoraInfo()->quality = inQuality;
- return true;
-}
-STDMETHODIMP_(bool) TheoraEncodeFilter::setKeyframeFreq(unsigned long inKeyframeFreq) {
- //Needs error checking
- ((TheoraEncodeInputPin*)mInputPin)->theoraInfo()->keyframe_frequency = inKeyframeFreq;
- ((TheoraEncodeInputPin*)mInputPin)->theoraInfo()->keyframe_frequency_force = inKeyframeFreq;
- //NOTE: If you ever change it so that _force can be higher... you must use the maximum.
- mTheoraFormatBlock.maxKeyframeInterval = PropsTheoraEncoder::log2(inKeyframeFreq);
- return true;
-}
-
-//SpecifyPropertyPages Implementation
-STDMETHODIMP TheoraEncodeFilter::GetPages(CAUUID* outPropPages) {
- if (outPropPages == NULL) return E_POINTER;
-
- const int NUM_PROP_PAGES = 1;
- outPropPages->cElems = NUM_PROP_PAGES;
- outPropPages->pElems = (GUID*)(CoTaskMemAlloc(sizeof(GUID) * NUM_PROP_PAGES));
- if (outPropPages->pElems == NULL)
- {
- return E_OUTOFMEMORY;
- }
-
- outPropPages->pElems[0] = CLSID_PropsTheoraEncoder;
-
- return S_OK;
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "Theoraencodefilter.h"
+
+
+//COM Factory Template
+CFactoryTemplate g_Templates[] =
+{
+ {
+ L"Theora Encode Filter", // Name
+ &CLSID_TheoraEncodeFilter, // CLSID
+ TheoraEncodeFilter::CreateInstance, // Method to create an instance of MyComponent
+ NULL, // Initialization function
+ NULL // Set-up information (for filters)
+ },
+ {
+ L"Theora Encode Properties", // Name
+ &CLSID_PropsTheoraEncoder, // CLSID
+ PropsTheoraEncoder::CreateInstance, // Method to create an instance of MyComponent
+ NULL, // Initialization function
+ NULL // Set-up information (for filters)
+ }
+
+
+};
+
+// Generic way of determining the number of items in the template
+int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
+
+CUnknown* WINAPI TheoraEncodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
+{
+ //This routine is the COM implementation to create a new Filter
+ TheoraEncodeFilter *pNewObject = new TheoraEncodeFilter();
+ if (pNewObject == NULL) {
+ *pHr = E_OUTOFMEMORY;
+ }
+ return pNewObject;
+}
+STDMETHODIMP TheoraEncodeFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
+ if (riid == IID_ITheoraEncodeSettings) {
+ *ppv = (ITheoraEncodeSettings*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ } else if (riid == IID_ISpecifyPropertyPages) {
+ *ppv = (ISpecifyPropertyPages*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ }
+
+
+ return AbstractTransformFilter::NonDelegatingQueryInterface(riid, ppv);
+}
+
+TheoraEncodeFilter::TheoraEncodeFilter(void)
+ : AbstractTransformFilter(NAME("Theora Encoder"), CLSID_TheoraEncodeFilter)
+{
+ bool locWasConstructed = ConstructPins();
+}
+
+TheoraEncodeFilter::~TheoraEncodeFilter(void)
+{
+}
+
+bool TheoraEncodeFilter::ConstructPins()
+{
+
+
+ //Inputs Video / Varios / VideoInfoHeader
+ //Outputs Video / Theora / THeora
+
+ //Vector to hold our set of media types we want to accept.
+ vector<CMediaType*> locAcceptableTypes;
+
+ //Setup the media types for the output pin.
+ CMediaType* locAcceptMediaType = new CMediaType(&MEDIATYPE_Video); //Deleted in pin destructor
+ locAcceptMediaType->subtype = MEDIASUBTYPE_Theora;
+ locAcceptMediaType->formattype = FORMAT_Theora;
+
+ locAcceptableTypes.push_back(locAcceptMediaType);
+
+ //Output pin must be done first because it's passed to the input pin.
+ mOutputPin = new TheoraEncodeOutputPin(this, m_pLock, locAcceptableTypes); //Deleted in base class destructor
+
+ //Clear out the vector, now we've already passed it to the output pin.
+ locAcceptableTypes.clear();
+
+ //Setup the media Types for the input pin.
+ locAcceptMediaType = NULL;
+
+ //YV12
+ locAcceptMediaType = new CMediaType(&MEDIATYPE_Video); //Deleted by pin
+ locAcceptMediaType->subtype = MEDIASUBTYPE_YV12;
+ locAcceptMediaType->formattype = FORMAT_VideoInfo;
+
+ locAcceptableTypes.push_back(locAcceptMediaType);
+
+ //YUY2
+ locAcceptMediaType = new CMediaType(&MEDIATYPE_Video); //Deleted by pin
+ locAcceptMediaType->subtype = MEDIASUBTYPE_YUY2;
+ locAcceptMediaType->formattype = FORMAT_VideoInfo;
+
+ locAcceptableTypes.push_back(locAcceptMediaType);
+
+ //AYUV
+ locAcceptMediaType = new CMediaType(&MEDIATYPE_Video); //Deleted by pin
+ locAcceptMediaType->subtype = MEDIASUBTYPE_AYUV;
+ locAcceptMediaType->formattype = FORMAT_VideoInfo;
+
+ locAcceptableTypes.push_back(locAcceptMediaType);
+
+ //RGB24
+ locAcceptMediaType = new CMediaType(&MEDIATYPE_Video); //Deleted by pin
+ locAcceptMediaType->subtype = MEDIASUBTYPE_RGB24;
+ locAcceptMediaType->formattype = FORMAT_VideoInfo;
+
+ locAcceptableTypes.push_back(locAcceptMediaType);
+
+ //RGB32
+ locAcceptMediaType = new CMediaType(&MEDIATYPE_Video); //Deleted by pin
+ locAcceptMediaType->subtype = MEDIASUBTYPE_RGB32;
+ locAcceptMediaType->formattype = FORMAT_VideoInfo;
+
+ locAcceptableTypes.push_back(locAcceptMediaType);
+
+ //UYVY
+ locAcceptMediaType = new CMediaType(&MEDIATYPE_Video); //Deleted by pin
+ locAcceptMediaType->subtype = MEDIASUBTYPE_UYVY;
+ locAcceptMediaType->formattype = FORMAT_VideoInfo;
+
+ locAcceptableTypes.push_back(locAcceptMediaType);
+
+ //YVYU
+ locAcceptMediaType = new CMediaType(&MEDIATYPE_Video); //Deleted by pin
+ locAcceptMediaType->subtype = MEDIASUBTYPE_YVYU;
+ locAcceptMediaType->formattype = FORMAT_VideoInfo;
+
+ locAcceptableTypes.push_back(locAcceptMediaType);
+
+ //IYUV
+ locAcceptMediaType = new CMediaType(&MEDIATYPE_Video); //Deleted by pin
+ locAcceptMediaType->subtype = MEDIASUBTYPE_IYUV;
+ locAcceptMediaType->formattype = FORMAT_VideoInfo;
+
+ locAcceptableTypes.push_back(locAcceptMediaType);
+
+ mInputPin = new TheoraEncodeInputPin(this, m_pLock, mOutputPin, locAcceptableTypes); //Deleted in base class filter destructor.
+ return true;
+}
+
+//Implementation of ITheoraEncodeSEttings
+STDMETHODIMP_(unsigned long) TheoraEncodeFilter::targetBitrate() {
+ return ((TheoraEncodeInputPin*)mInputPin)->theoraInfo()->target_bitrate;
+}
+STDMETHODIMP_(unsigned char) TheoraEncodeFilter::quality() {
+ return ((TheoraEncodeInputPin*)mInputPin)->theoraInfo()->quality;
+}
+STDMETHODIMP_(unsigned long) TheoraEncodeFilter::keyframeFreq() {
+ return ((TheoraEncodeInputPin*)mInputPin)->theoraInfo()->keyframe_frequency;
+}
+
+STDMETHODIMP_(bool) TheoraEncodeFilter::setTargetBitrate(unsigned long inBitrate) {
+ //Needs error checking
+ ((TheoraEncodeInputPin*)mInputPin)->theoraInfo()->target_bitrate = inBitrate;
+ ((TheoraEncodeInputPin*)mInputPin)->theoraInfo()->keyframe_data_target_bitrate = (inBitrate * 3)/2;
+ //mTheoraFormatBlock.targetBitrate = inBitrate;
+ //mTheoraFormatBlock.
+ return true;
+
+}
+STDMETHODIMP_(bool) TheoraEncodeFilter::setQuality(unsigned char inQuality) {
+ //Needs error checking
+
+ ((TheoraEncodeInputPin*)mInputPin)->theoraInfo()->quality = inQuality;
+ return true;
+}
+STDMETHODIMP_(bool) TheoraEncodeFilter::setKeyframeFreq(unsigned long inKeyframeFreq) {
+ //Needs error checking
+ ((TheoraEncodeInputPin*)mInputPin)->theoraInfo()->keyframe_frequency = inKeyframeFreq;
+ ((TheoraEncodeInputPin*)mInputPin)->theoraInfo()->keyframe_frequency_force = inKeyframeFreq;
+ //NOTE: If you ever change it so that _force can be higher... you must use the maximum.
+ mTheoraFormatBlock.maxKeyframeInterval = PropsTheoraEncoder::log2(inKeyframeFreq);
+ return true;
+}
+
+//SpecifyPropertyPages Implementation
+STDMETHODIMP TheoraEncodeFilter::GetPages(CAUUID* outPropPages) {
+ if (outPropPages == NULL) return E_POINTER;
+
+ const int NUM_PROP_PAGES = 1;
+ outPropPages->cElems = NUM_PROP_PAGES;
+ outPropPages->pElems = (GUID*)(CoTaskMemAlloc(sizeof(GUID) * NUM_PROP_PAGES));
+ if (outPropPages->pElems == NULL)
+ {
+ return E_OUTOFMEMORY;
+ }
+
+ outPropPages->pElems[0] = CLSID_PropsTheoraEncoder;
+
+ return S_OK;
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeFilter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeFilter.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeFilter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeFilter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,87 +1,87 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-#include "theoraencoderdllstuff.h"
-#include "ITheoraEncodeSettings.h"
-#include "PropsTheoraEncoder.h"
-
-
-//Forward Declarations
-//struct sTheoraFormatBlock;
-class TheoraEncodeInputPin;
-class TheoraEncodeOutputPin;
-
-class TheoraEncodeFilter
- //Base classes
- : public AbstractTransformFilter
- , public ITheoraEncodeSettings
- , public ISpecifyPropertyPages
-{
-public:
- //Friends classes
- friend class TheoraEncodeInputPin;
- friend class TheoraEncodeOutputPin;
-
- //Constructors and Destructors
- TheoraEncodeFilter(void);
- virtual ~TheoraEncodeFilter(void);
-
- //COM Functions
- DECLARE_IUNKNOWN
- static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- //ITheoraEncodeSettings Implementation
- STDMETHODIMP_(unsigned long) targetBitrate();
- STDMETHODIMP_(unsigned char) quality();
- STDMETHODIMP_(unsigned long) keyframeFreq();
-
- STDMETHODIMP_(bool) setTargetBitrate(unsigned long inBitrate);
- STDMETHODIMP_(bool) setQuality(unsigned char inQuality);
- STDMETHODIMP_(bool) setKeyframeFreq(unsigned long inKeyframeFreq);
- //
-
-
-
- //SpecifyPropertyPages Implementation
- STDMETHODIMP TheoraEncodeFilter::GetPages(CAUUID* outPropPages);
-
-protected:
-
- //AbstractVideoEncodeFilter pure virtuals
- virtual bool ConstructPins();
-
- //Member data
- sTheoraFormatBlock mTheoraFormatBlock;
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+#include "theoraencoderdllstuff.h"
+#include "ITheoraEncodeSettings.h"
+#include "PropsTheoraEncoder.h"
+
+
+//Forward Declarations
+//struct sTheoraFormatBlock;
+class TheoraEncodeInputPin;
+class TheoraEncodeOutputPin;
+
+class TheoraEncodeFilter
+ //Base classes
+ : public AbstractTransformFilter
+ , public ITheoraEncodeSettings
+ , public ISpecifyPropertyPages
+{
+public:
+ //Friends classes
+ friend class TheoraEncodeInputPin;
+ friend class TheoraEncodeOutputPin;
+
+ //Constructors and Destructors
+ TheoraEncodeFilter(void);
+ virtual ~TheoraEncodeFilter(void);
+
+ //COM Functions
+ DECLARE_IUNKNOWN
+ static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ //ITheoraEncodeSettings Implementation
+ STDMETHODIMP_(unsigned long) targetBitrate();
+ STDMETHODIMP_(unsigned char) quality();
+ STDMETHODIMP_(unsigned long) keyframeFreq();
+
+ STDMETHODIMP_(bool) setTargetBitrate(unsigned long inBitrate);
+ STDMETHODIMP_(bool) setQuality(unsigned char inQuality);
+ STDMETHODIMP_(bool) setKeyframeFreq(unsigned long inKeyframeFreq);
+ //
+
+
+
+ //SpecifyPropertyPages Implementation
+ STDMETHODIMP TheoraEncodeFilter::GetPages(CAUUID* outPropPages);
+
+protected:
+
+ //AbstractVideoEncodeFilter pure virtuals
+ virtual bool ConstructPins();
+
+ //Member data
+ sTheoraFormatBlock mTheoraFormatBlock;
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeFilter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,1199 +1,1199 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "theoraencodeinputpin.h"
-
-TheoraEncodeInputPin::TheoraEncodeInputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes)
- : AbstractTransformInputPin(inParentFilter, inFilterLock, inOutputPin, NAME("TheoraEncodeInputPin"), L"YV12 In", inAcceptableMediaTypes)
- , mXOffset(0)
- , mYOffset(0)
- , mHeight(0)
- , mWidth(0)
- , mUptoFrame(0)
- , mBegun(false)
- , mVideoFormat(NULL)
-
-
-{
- //debugLog.open("g:\\logs\\theoencfiltinput.log", ios_base::out);
- mYUV.y = NULL;
- mYUV.u = NULL;
- mYUV.v = NULL;
-
-}
-
-TheoraEncodeInputPin::~TheoraEncodeInputPin(void)
-{
- //debugLog.close();
- DestroyCodec();
- delete[] mYUV.y;
- delete[] mYUV.u;
- delete[] mYUV.v;
-
-}
-
-
-HRESULT TheoraEncodeInputPin::deliverData(LONGLONG inStart, LONGLONG inEnd, unsigned char* inBuf, unsigned long inNumBytes) {
- //debugLog <<" deliverData : "<<inStart<<" - "<<inEnd<<" :: size = "<<inNumBytes<<endl;
- //Get a pointer to a new sample stamped with our time
- IMediaSample* locSample;
- HRESULT locHR = mOutputPin->GetDeliveryBuffer(&locSample, &inStart, &inEnd, NULL);
-
- if (locHR != S_OK) {
- //We get here when the application goes into stop mode usually.
- return locHR;
- }
-
- BYTE* locBuffer = NULL;
-
-
- //Make our pointers set to point to the samples buffer
- locSample->GetPointer(&locBuffer);
-
- if (locSample->GetSize() >= inNumBytes) {
-
- memcpy((void*)locBuffer, (const void*)inBuf, inNumBytes);
-
- //Set the sample parameters.
- SetSampleParams(locSample, inNumBytes, &inStart, &inEnd);
-
- {
- CAutoLock locLock(m_pLock);
-
- HRESULT locHR = ((TheoraEncodeOutputPin*)mOutputPin)->mDataQueue->Receive(locSample); //->DownstreamFilter()->Receive(locSample);
- if (locHR != S_OK) {
- return locHR;
- } else {
- }
- }
- //debugLog<<"deliverData : SUCCESS"<<endl;
- return S_OK;
- } else {
- //debugLog<<"Buffer too small !!!! FATALITY !"<<endl;
- throw 0;
- }
-
-}
-
-long TheoraEncodeInputPin::encodeYV12ToYV12(unsigned char* inBuf, long inNumBytes) {
- //Source Buffer all in one buffer
-
- //YV12 memory layout for directshow
- //=================================
- //YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
- //YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
- //YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
- //YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
- //VVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVV
- //UUUUUUUUUUUUUUUUUUUUUUUU UUUUUUUUUUUUUUUUUUUUUUUU
-
-
- //Destination buffer Y, U, V in seperate planes, lowercase are line padding, "." height padding
- //.............................. ..............................
- //.............................. ..............................
- //yyyyyyYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYyyyyyy
- //yyyyyyYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYyyyyyy
- //yyyyyyYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYyyyyyy
- //yyyyyyYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYyyyyyy
- //.............................. ..............................
- //.............................. ..............................
-
- //.............................. ..............................
- //vvvVVVVVVVVVVVVVVVVVVVVVVVVvvv vvvVVVVVVVVVVVVVVVVVVVVVVVVvvv
- //.............................. ..............................
-
- //.............................. ..............................
- //uuuUUUUUUUUUUUUUUUUUUUUUUUUuuu uuuUUUUUUUUUUUUUUUUUUUUUUUUuuu
- //.............................. ..............................
-
- //NOTE : mHeight, mWidth are the actual video sizes and are the sizes of the incoming buffer
- // The yuv width, height parameters are a /16 up rounded size of the output buffer to be sent to libtheora
-
-
- //Setup the source pointer
- unsigned char* locSourceUptoPtr = inBuf; //View only... don't delete locUptoPtr
- //
-
- //========
- //Y DATA |
- //=========================================================================================================
-
- //Setup the destination pointer
- char* locDestUptoPtr = mYUV.y;
- //
-
- //Pad top of Y plane buffer with mYOffset lines of width mYUV.y_width
- if (mYOffset != 0) {
- memset((void*)locDestUptoPtr, NULL, mYOffset * mYUV.y_width); //Is it needed to zero this out ? Or just leave junk ?
- locDestUptoPtr += (mYOffset * mYUV.y_width);
- }
- //Source pointer does not advance
- //
-
- //Add mHeight lines of data of width mWidth plus padding of mXOffset at each end
- if (mXOffset == 0) {
- //Slight optimisation to keep the inner loop tighter
- for (long line = 0; line < mHeight; line++) {
- memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth);
- locSourceUptoPtr += mWidth;
- locDestUptoPtr += mWidth;
- }
- } else {
- for (long line = 0; line < mHeight; line++) {
- //Pad the start of the line with mXOffset bytes
- memset((void*)locDestUptoPtr, NULL, mXOffset);
- locDestUptoPtr += mXOffset;
-
- //Fill in the meaty bit
- memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth);
- locSourceUptoPtr += mWidth;
- locDestUptoPtr += mWidth;
-
- //Pad the end of the line with mXOffset bytes
- memset((void*)locDestUptoPtr, NULL, mXOffset);
- locDestUptoPtr += mXOffset;
- }
-
- }
-
- //Pad bottom of Y plane buffer with mYOffset lines of width mYUV.y_width
- if (mYOffset != 0) {
- memset((void*)locDestUptoPtr, NULL, mYOffset * mYUV.y_width); //Is it needed to zero this out ? Or just leave junk ?
- locDestUptoPtr += (mYOffset * mYUV.y_width);
- //Source pointer does not advance
- }
-
-
-
- //========
- //V DATA |
- //=========================================================================================================
-
- //Set the destination poitner
- locDestUptoPtr = mYUV.v;
- //
-
- //Pad top of V plane buffer with mYOffset/2 lines of width mYUV.uv_width
- if (mYOffset != 0) {
- memset((void*)locDestUptoPtr, NULL, (mYOffset * mYUV.uv_width) / 2); //Is it needed to zero this out ? Or just leave junk ?
- locDestUptoPtr += ((mYOffset * mYUV.uv_width) / 2);
- //Source pointer does not advance
- }
- //
-
- //Add mHeight/2 lines of data of length mWidth/2 plus padded by mXOffset/2 at each end
- if (mXOffset == 0) {
- //Slight optimisation to keep the inner loop tighter
- for (long line = 0; line < mHeight / 2; line++) {
- memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth / 2);
- locSourceUptoPtr += (mWidth / 2);
- locDestUptoPtr += (mWidth / 2);
- }
- } else {
- for (long line = 0; line < mHeight / 2; line++) {
- //Pad the start of the line
- memset((void*)locDestUptoPtr, NULL, mXOffset / 2);
- locDestUptoPtr += (mXOffset / 2);
- //Source pointer does not advance
-
- //Fill in the meaty bit
- memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth / 2);
- locSourceUptoPtr += (mWidth / 2);
- locDestUptoPtr += (mWidth / 2);
-
- //Pad the end of the line
- memset((void*)locDestUptoPtr, NULL, mXOffset / 2);
- locDestUptoPtr += (mXOffset / 2);
- //Source pointer does not advance
- }
-
- }
-
- //Pad bottom of V plane buffer with mYOffset / 2 lines of width mYUV.uv_width
- if (mYOffset != 0) {
- memset((void*)locDestUptoPtr, NULL, (mYOffset * mYUV.uv_width) / 2); //Is it needed to zero this out ? Or just leave junk ?
- locDestUptoPtr += ((mYOffset * mYUV.uv_width) / 2);
- //Source pointer does not advance
- }
-
-
-
-
-
- //========
- //U DATA |
- //=========================================================================================================
-
- //Set the destination pointer
- locDestUptoPtr = mYUV.u;
- //
-
- //Pad top of U plane buffer with mYOffset/2 lines of width mYUV.uv_width
- if (mYOffset != 0) {
- memset((void*)locDestUptoPtr, NULL, (mYOffset * mYUV.uv_width) / 2); //Is it needed to zero this out ? Or just leave junk ?
- locDestUptoPtr += ((mYOffset * mYUV.uv_width) / 2);
- //Source pointer does not advance
- }
- //
-
- //Add mHeight/2 lines of data of length mWidth/2 plus padded by mXOffset/2 at each end
- if (mXOffset == 0) {
- //Slight optimisation to keep the inner loop tighter
- for (long line = 0; line < mHeight / 2; line++) {
- memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth / 2);
- locSourceUptoPtr += (mWidth / 2);
- locDestUptoPtr += (mWidth / 2);
- }
- } else {
- for (long line = 0; line < mHeight / 2; line++) {
- //Pad the start of the line
- memset((void*)locDestUptoPtr, NULL, mXOffset / 2);
- locDestUptoPtr += (mXOffset / 2);
- //Source pointer does not advance
-
- //Fill in the meaty bit
- memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth / 2);
- locSourceUptoPtr += (mWidth / 2);
- locDestUptoPtr += (mWidth / 2);
-
- //Pad the end of the line
- memset((void*)locDestUptoPtr, NULL, mXOffset / 2);
- locDestUptoPtr += (mXOffset / 2);
- //Source pointer does not advance
- }
-
- }
-
- //Pad bottom of U plane buffer with mYOffset / 2 lines of width mYUV.uv_width
- if (mYOffset != 0) {
- memset((void*)locDestUptoPtr, NULL, (mYOffset * mYUV.uv_width) / 2); //Is it needed to zero this out ? Or just leave junk ?
- locDestUptoPtr += ((mYOffset * mYUV.uv_width) / 2);
- //Source pointer does not advance
- }
-
- //======================================================================================================
- return 0;
-
-}
-
-//-------------------------------------------------------------------------
-
-long TheoraEncodeInputPin::encodeIYUVToYV12(unsigned char* inBuf, long inNumBytes) {
- //Same as YV12 but planes U and V are reversed.
-
- //Source Buffer all in one buffer
-
- //IYUV memory layout for directshow
- //=================================
- //YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
- //YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
- //YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
- //YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
-
- //UUUUUUUUUUUUUUUUUUUUUUUU UUUUUUUUUUUUUUUUUUUUUUUU
-
- //VVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVV
-
-
-
- //Destination buffer Y, U, V in seperate planes, lowercase are line padding, "." height padding
- //.............................. ..............................
- //.............................. ..............................
- //yyyyyyYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYyyyyyy
- //yyyyyyYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYyyyyyy
- //yyyyyyYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYyyyyyy
- //yyyyyyYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYyyyyyy
- //.............................. ..............................
- //.............................. ..............................
-
- //.............................. ..............................
- //uuuUUUUUUUUUUUUUUUUUUUUUUUUuuu uuuUUUUUUUUUUUUUUUUUUUUUUUUuuu
- //.............................. ..............................
-
- //.............................. ..............................
- //vvvVVVVVVVVVVVVVVVVVVVVVVVVvvv vvvVVVVVVVVVVVVVVVVVVVVVVVVvvv
- //.............................. ..............................
-
-
-
- //NOTE : mHeight, mWidth are the actual video sizes and are the sizes of the incoming buffer
- // The yuv width, height parameters are a /16 up rounded size of the output buffer to be sent to libtheora
-
-
- //Setup the source pointer
- unsigned char* locSourceUptoPtr = inBuf; //View only... don't delete locUptoPtr
- //
-
- //========
- //Y DATA |
- //=========================================================================================================
-
- //Setup the destination pointer
- char* locDestUptoPtr = mYUV.y;
- //
-
- //Pad top of Y plane buffer with mYOffset lines of width mYUV.y_width
- if (mYOffset != 0) {
- memset((void*)locDestUptoPtr, NULL, mYOffset * mYUV.y_width); //Is it needed to zero this out ? Or just leave junk ?
- locDestUptoPtr += (mYOffset * mYUV.y_width);
- }
- //Source pointer does not advance
- //
-
- //Add mHeight lines of data of width mWidth plus padding of mXOffset at each end
- if (mXOffset == 0) {
- //Slight optimisation to keep the inner loop tighter
- for (long line = 0; line < mHeight; line++) {
- memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth);
- locSourceUptoPtr += mWidth;
- locDestUptoPtr += mWidth;
- }
- } else {
- for (long line = 0; line < mHeight; line++) {
- //Pad the start of the line with mXOffset bytes
- memset((void*)locDestUptoPtr, NULL, mXOffset);
- locDestUptoPtr += mXOffset;
-
- //Fill in the meaty bit
- memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth);
- locSourceUptoPtr += mWidth;
- locDestUptoPtr += mWidth;
-
- //Pad the end of the line with mXOffset bytes
- memset((void*)locDestUptoPtr, NULL, mXOffset);
- locDestUptoPtr += mXOffset;
- }
-
- }
-
- //Pad bottom of Y plane buffer with mYOffset lines of width mYUV.y_width
- if (mYOffset != 0) {
- memset((void*)locDestUptoPtr, NULL, mYOffset * mYUV.y_width); //Is it needed to zero this out ? Or just leave junk ?
- locDestUptoPtr += (mYOffset * mYUV.y_width);
- //Source pointer does not advance
- }
-
- //========
- //U DATA |
- //=========================================================================================================
-
- //Set the destination pointer
- locDestUptoPtr = mYUV.u;
- //
-
- //Pad top of U plane buffer with mYOffset/2 lines of width mYUV.uv_width
- if (mYOffset != 0) {
- memset((void*)locDestUptoPtr, NULL, (mYOffset * mYUV.uv_width) / 2); //Is it needed to zero this out ? Or just leave junk ?
- locDestUptoPtr += ((mYOffset * mYUV.uv_width) / 2);
- //Source pointer does not advance
- }
- //
-
- //Add mHeight/2 lines of data of length mWidth/2 plus padded by mXOffset/2 at each end
- if (mXOffset == 0) {
- //Slight optimisation to keep the inner loop tighter
- for (long line = 0; line < mHeight / 2; line++) {
- memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth / 2);
- locSourceUptoPtr += (mWidth / 2);
- locDestUptoPtr += (mWidth / 2);
- }
- } else {
- for (long line = 0; line < mHeight / 2; line++) {
- //Pad the start of the line
- memset((void*)locDestUptoPtr, NULL, mXOffset / 2);
- locDestUptoPtr += (mXOffset / 2);
- //Source pointer does not advance
-
- //Fill in the meaty bit
- memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth / 2);
- locSourceUptoPtr += (mWidth / 2);
- locDestUptoPtr += (mWidth / 2);
-
- //Pad the end of the line
- memset((void*)locDestUptoPtr, NULL, mXOffset / 2);
- locDestUptoPtr += (mXOffset / 2);
- //Source pointer does not advance
- }
-
- }
-
- //Pad bottom of U plane buffer with mYOffset / 2 lines of width mYUV.uv_width
- if (mYOffset != 0) {
- memset((void*)locDestUptoPtr, NULL, (mYOffset * mYUV.uv_width) / 2); //Is it needed to zero this out ? Or just leave junk ?
- locDestUptoPtr += ((mYOffset * mYUV.uv_width) / 2);
- //Source pointer does not advance
- }
-
-
-
- //========
- //V DATA |
- //=========================================================================================================
-
- //Set the destination poitner
- locDestUptoPtr = mYUV.v;
- //
-
- //Pad top of V plane buffer with mYOffset/2 lines of width mYUV.uv_width
- if (mYOffset != 0) {
- memset((void*)locDestUptoPtr, NULL, (mYOffset * mYUV.uv_width) / 2); //Is it needed to zero this out ? Or just leave junk ?
- locDestUptoPtr += ((mYOffset * mYUV.uv_width) / 2);
- //Source pointer does not advance
- }
- //
-
- //Add mHeight/2 lines of data of length mWidth/2 plus padded by mXOffset/2 at each end
- if (mXOffset == 0) {
- //Slight optimisation to keep the inner loop tighter
- for (long line = 0; line < mHeight / 2; line++) {
- memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth / 2);
- locSourceUptoPtr += (mWidth / 2);
- locDestUptoPtr += (mWidth / 2);
- }
- } else {
- for (long line = 0; line < mHeight / 2; line++) {
- //Pad the start of the line
- memset((void*)locDestUptoPtr, NULL, mXOffset / 2);
- locDestUptoPtr += (mXOffset / 2);
- //Source pointer does not advance
-
- //Fill in the meaty bit
- memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth / 2);
- locSourceUptoPtr += (mWidth / 2);
- locDestUptoPtr += (mWidth / 2);
-
- //Pad the end of the line
- memset((void*)locDestUptoPtr, NULL, mXOffset / 2);
- locDestUptoPtr += (mXOffset / 2);
- //Source pointer does not advance
- }
-
- }
-
- //Pad bottom of V plane buffer with mYOffset / 2 lines of width mYUV.uv_width
- if (mYOffset != 0) {
- memset((void*)locDestUptoPtr, NULL, (mYOffset * mYUV.uv_width) / 2); //Is it needed to zero this out ? Or just leave junk ?
- locDestUptoPtr += ((mYOffset * mYUV.uv_width) / 2);
- //Source pointer does not advance
- }
-
-
-
-
-
-
- //======================================================================================================
- return 0;
-
-}
-//-------------------------------------------------------------------------
-
-long TheoraEncodeInputPin::encodeRGB24toYV12(unsigned char* inBuf, long inNumBytes) {
- //Blue Green Red Blue Green Red.
- unsigned long locNumPixels = (inNumBytes/3);
- unsigned char* locAYUVBuf = new unsigned char[locNumPixels<<2]; //4 bytes per pixel
-
- /*
-
-
-
-
- Conversion from RGB to YUV is defined by starting with the following:
-
- L = Kr * R + Kb * B + (1 Kr Kb) * G
-
- The YUV values are then obtained as follows:
-
- Y = floor(2^(M-8) * (219*(LZ)/S + 16) + 0.5)
- U = clip3(0, 2^M-1, floor(2^(M-8) * (112*(B-L) / ((1-Kb)*S) + 128) + 0.5))
- V = clip3(0, 2^M-1, floor(2^(M-8) * (112*(R-L) / ((1-Kr)*S) + 128) + 0.5))
-
- where Z = 16
- S = 219
- M = 8 bits per sample.
-
- ==>
- Y = floor(L + 0.5)
- U = (112*(B-L) / ((1-Kb)*S) + 128)
-
-
- Kr' = Kr * 65536
- Kb' = Kb * 65536
- G_FACTOR = (1 - Kr - Kb) * 65536
-
- L' = (Kr' * R) + (Kb' * B) + (G_FACTOR * G)
- = 65536 * ( (Kr * R) + (Kb * B) + ((1 - Kr - Kb) * G) )
- = 65536 * L
-
- Y = round( 219 * (L-Z)/S + 16 )
- = round ( L-Z + 16 )
- = round( L )
-
- Y' = L'
- = 65536 * L
-
- Y = L' >> 16
-
- U_FACTOR = ( 1 - Kb) * S
- U_FACTOR' = 12716213
-
- = 65536 * U_FACTOR
-
- V_FACTOR' = 10061022
-
- B' = 65536 * B
- R' = 65536 * R
-
- _U_ = round( 112 * (B-L) / ( (1-Kb)*S ) + 128 )
- = round( (112 * (B-L) / U_FACTOR) + 128 )
- = (112 * (B' - L') / U_FACTOR') + 128
- = (112 * 65536 * (B - L) / (U_FACTOR * 65536)) + 128
- = (112 * (B - L) / U_FACTOR) + 128
-
- Hence integerisation scaling cancels
- ==>
- _U_ = (112 * (B' - L') / U_FACTOR') + 128
-
- _V_ = (112 * (R' - L') / V_FACTOR') + 128
-
- */
-
- /*
- Kr = 0.299
- Kb = 0.114
-
-
- */
-
- //Scaled by factor of 65536 to integerise.
- const int KR = 19596;
- const int KB = 7472;
-
- const int ROUNDER = 32768;
-
- const int G_FACTOR = 38470;
- const int U_FACTOR = 12716213;
- const int V_FACTOR = 10061022;
-
- int locL = 0;
- int locB = 0;
- int locR = 0;
-
- //unsigned char* locSourcePtr = inBuf;
- unsigned char* locDestPtr = locAYUVBuf;
-
- //SOURCE: Blue Green Red Blue Green Red.
- //DEST: v u y a
-
- unsigned char* locSourceEnds = inBuf + (locNumPixels * 3);
-
- //Upside down... Upside down !
- //for (unsigned char* locSourcePtr = inBuf; locSourcePtr < locSourceEnds; locSourcePtr += 3) {
- // locB = locSourcePtr[0]; //Blue
- // locL = KB * (locB); //Blue
- //
- // locL += G_FACTOR * (locSourcePtr[1]); //Green
-
- // locR = locSourcePtr[2]; //Red
- // locL += KR * (locR); //Red
-
- //
- // *(locDestPtr++) = CLIP3(0, 255, ((112 * ( (locR<<16) - locL)) / V_FACTOR) + 128); //V for Victor
- // *(locDestPtr++) = CLIP3(0, 255, ((112 * ( (locB<<16) - locL)) / U_FACTOR) + 128); //U for ugly
- // *(locDestPtr++) = CLIP3(0, 255, locL >> 16); //Y for yellow
- // *(locDestPtr++) = 255; //A for alpha
- //}
-
-
- unsigned char* locColSourcePtr = NULL;
- unsigned char* locColEndPtr = NULL;
- unsigned long locLineLength = mWidth * 3;
- unsigned long col = 0;
- for (unsigned char* locSourcePtr = locSourceEnds - locLineLength; locSourcePtr >= inBuf; locSourcePtr -= locLineLength) {
- //
- //for(unsigned char* locColSourcePtr = locSourcePtr, int i = 0; i < mWidth; i++, locColSourcePtr +=4) {
- //
- locColSourcePtr = locSourcePtr;
- locColEndPtr = locColSourcePtr + locLineLength;
- while (locColSourcePtr < locColEndPtr) {
- locB = locColSourcePtr[0]; //Blue
- locL = KB * (locB); //Blue
-
- locL += G_FACTOR * (locColSourcePtr[1]); //Green
-
- locR = locColSourcePtr[2]; //Red
- locL += KR * (locR); //Red
-
-
- *(locDestPtr++) = CLIP3(0, 255, ((112 * ( (locR<<16) - locL)) / V_FACTOR) + 128); //V for Victor
- *(locDestPtr++) = CLIP3(0, 255, ((112 * ( (locB<<16) - locL)) / U_FACTOR) + 128); //U for ugly
- *(locDestPtr++) = CLIP3(0, 255, locL >> 16); //Y for yellow
- *(locDestPtr++) = 255; //A for alpha
-
- //debugCount++;
- locColSourcePtr+=3;
-
- }
-
-
- }
-
-
- //Still need to pass through to the AYUV conversion.
- encodeAYUVtoYV12(locAYUVBuf, locNumPixels<<2);
- delete[] locAYUVBuf;
- locAYUVBuf = NULL;
-
- return 0;
-}
-
-
-
-long TheoraEncodeInputPin::encodeRGB32toYV12(unsigned char* inBuf, long inNumBytes) {
- //Blue Green Red Alpha Blue Green Red Alpha
- //debugLog<<"EncodeRGB32 To YV12 :"<<endl;
-
- unsigned long locNumPixels = (inNumBytes/4);
-
- //debugLog<<"EncodeRGB32 To YV12 : Num pixels = "<<locNumPixels<<endl;
- //debugLog<<"EncodeRGB32 To YV12 : Num BYtes = "<<inNumBytes<<endl;
- unsigned char* locAYUVBuf = new unsigned char[inNumBytes]; //4 bytes per pixel
-
- //debugLog<<"EncodeRGB32 To YV12 :"<<endl;
-
- //Scaled by factor of 65536 to integerise.
- const int KR = 19596;
- const int KB = 7472;
-
- const int ROUNDER = 32768;
-
- const int G_FACTOR = 38470;
- const int U_FACTOR = 12716213;
- const int V_FACTOR = 10061022;
-
- int locL = 0;
- int locB = 0;
- int locR = 0;
-
- //unsigned char* locSourcePtr = inBuf;
- unsigned char* locDestPtr = locAYUVBuf;
-
- //SOURCE: Blue Green Red Blue Green Red.
- //DEST: v u y a
-
- unsigned char* locSourceEnds = inBuf + (inNumBytes);
- //debugLog<<"EncodeRGB32 To YV12 : Source Starts = "<<(int)inBuf<<endl;
- //debugLog<<"EncodeRGB32 To YV12 : Source Ends = "<<(int)locSourceEnds<<endl;
-
- //Debugging only... all refs to debugCount remove later
- //unsigned long debugCount = 0;
- //
-
- //Upside down !!
- //for (unsigned char* locSourcePtr = inBuf; locSourcePtr < locSourceEnds; locSourcePtr += 4) {
- // locB = locSourcePtr[0]; //Blue
- // locL = KB * (locB); //Blue
- //
- // locL += G_FACTOR * (locSourcePtr[1]); //Green
-
- // locR = locSourcePtr[2]; //Red
- // locL += KR * (locR); //Red
-
- //
- // *(locDestPtr++) = CLIP3(0, 255, ((112 * ( (locR<<16) - locL)) / V_FACTOR) + 128); //V for Victor
- // *(locDestPtr++) = CLIP3(0, 255, ((112 * ( (locB<<16) - locL)) / U_FACTOR) + 128); //U for ugly
- // *(locDestPtr++) = CLIP3(0, 255, locL >> 16); //Y for yellow
- // *(locDestPtr++) = locSourcePtr[3]; //A for alpha
-
- // debugCount++;
- //}
- unsigned char* locColSourcePtr = NULL;
- unsigned char* locColEndPtr = NULL;
- unsigned long locLineLength = mWidth * 4;
- unsigned long col = 0;
- for (unsigned char* locSourcePtr = locSourceEnds - locLineLength; locSourcePtr >= inBuf; locSourcePtr -= locLineLength) {
- //
- //for(unsigned char* locColSourcePtr = locSourcePtr, int i = 0; i < mWidth; i++, locColSourcePtr +=4) {
- //
- locColSourcePtr = locSourcePtr;
- locColEndPtr = locColSourcePtr + locLineLength;
- while (locColSourcePtr < locColEndPtr) {
- locB = locColSourcePtr[0]; //Blue
- locL = KB * (locB); //Blue
-
- locL += G_FACTOR * (locColSourcePtr[1]); //Green
-
- locR = locColSourcePtr[2]; //Red
- locL += KR * (locR); //Red
-
-
- *(locDestPtr++) = CLIP3(0, 255, ((112 * ( (locR<<16) - locL)) / V_FACTOR) + 128); //V for Victor
- *(locDestPtr++) = CLIP3(0, 255, ((112 * ( (locB<<16) - locL)) / U_FACTOR) + 128); //U for ugly
- *(locDestPtr++) = CLIP3(0, 255, locL >> 16); //Y for yellow
- *(locDestPtr++) = locColSourcePtr[3]; //A for alpha
-
- //debugCount++;
- locColSourcePtr+=4;
-
- }
-
-
- }
-
- //debugLog<<"EncodeRGB32 To YV12 : debugCount = "<<debugCount<<endl;
-
- //ASSERT(debugCount == locNumPixels);
-
- ASSERT(locDestPtr == (locAYUVBuf + inNumBytes));
-
- //debugLog<<"EncodeRGB32 To YV12 : Calling AYUV to YV12 conversion"<<endl;
- //Still need to pass through to the AYUV conversion.
-
- encodeAYUVtoYV12(locAYUVBuf, inNumBytes);
- delete[] locAYUVBuf;
- locAYUVBuf = NULL;
-
- return 0;
-}
-
-
-
-
-long TheoraEncodeInputPin::encodeAYUVtoYV12(unsigned char* inBuf, long inNumBytes) {
-
- //Victor Ugly Yellow Alpha --fonts are fuzzy late at night-- (Yellow is not colour yellow)
-
- //AYUV is VUYA VUYA VUYA VUYA 4:4:4 sampling
- // Twice the vertical and horizontal sampling of YV12 in chrominance
-
- //Strategy : Process two lines and 2 cols at a time averaging 4 U and V around the position where a
- // YV12 chroma sample will be... leave luminance samples... ignore alpha samples
-
- //debugLog<<"Encode AYUV To YV12 :"<<endl;
-
- const int PIXEL_BYTE_SIZE = 4;
- ASSERT (mHeight % 2 == 0);
- ASSERT (mWidth % 2 == 0);
-
- unsigned char* locSourceUptoPtr = inBuf; //View only... don't delete locUptoPtr
- unsigned char* locSourceNextLine = locSourceUptoPtr + (mWidth * PIXEL_BYTE_SIZE); //View only don't delete
-
- char* locYUpto = mYUV.y;
- char* locUUpto = mYUV.u;
- char* locVUpto = mYUV.v;
- //Pointer to the same pixel on next line
- char* locDestNextLine = locYUpto + (mWidth); //View only... don't delete
-
- int temp = 0;
-
- //Process 2 lines at a time
- for (int line = 0; line < mHeight; line += 2) {
- //debugLog<<"Encode AYUV To YV12 : ++ Line = "<<line<<endl;
-
- ASSERT (locSourceUptoPtr == (inBuf + (line * (mWidth * PIXEL_BYTE_SIZE))));
- ASSERT (locSourceNextLine == locSourceUptoPtr + (mWidth * PIXEL_BYTE_SIZE));
- ASSERT (locYUpto == (mYUV.y + (line * mWidth)));
- ASSERT (locDestNextLine == locYUpto + (mWidth));
-
-
- //Columns also done 2 at a time
- for (int col = 0; col < mWidth; col += 2) {
- //debugLog<<"Encode AYUV To YV12 : ++++++ Col = "<<col<<endl;
-
-
- // v u y a v u y a
- //SourceUpto ^
- //NextUpto ^
-
- //====================
- //V for Victor samples
- //====================
- temp = *(locSourceUptoPtr++); //Current pixel
-
- // v u y a v u y a
- //SourceUpto ^
- //NextUpto ^
-
- //This is three as we already advanced one and are pointing to a u not a v
- temp += *(locSourceUptoPtr + 3); //Pixel to right
- temp += *(locSourceNextLine++); //Pixel below
-
- // v u y a v u y a
- //SourceUpto ^
- //NextUpto ^
-
- temp += *(locSourceNextLine + 3); //Pixel below right
- temp >>= 2; //Divide by 4 to average.
- *(locVUpto++) = (unsigned char)temp;
-
- // v u y a v u y a
- //SourceUpto ^
- //NextUpto ^
-
- //====================
- //U for Ugly samples
- //====================
- temp = *(locSourceUptoPtr++); //Current pixel
-
- // v u y a v u y a
- //SourceUpto ^
- //NextUpto ^
-
- temp += *(locSourceUptoPtr + 3); //Pixel to right
- temp += *(locSourceNextLine++); //Pixel below
-
-
- // v u y a v u y a
- //SourceUpto ^
- //NextUpto ^
-
- temp += *(locSourceNextLine + 3); //Pixel below right
- temp >>= 2; //Divide by 4 to average.
- *(locUUpto++) = (unsigned char)temp;
-
- // v u y a v u y a
- //SourceUpto ^
- //NextUpto ^
-
- //====================
- //Y for Yellow samples.
- //====================
-
- *(locYUpto++) = *(locSourceUptoPtr++);
- *(locDestNextLine++) = *(locSourceNextLine++);
-
- // v u y a v u y a
- //SourceUpto ^
- //NextUpto ^
-
- //Ignore the alpha channel
- //--
- //locSourceUptoPtr++; //Optimised away... merged into increment below
- //locSourceNextLine++; // " " " " " " " " " " "
-
- // v u y a v u y a
- //SourceUpto ^
- //NextUpto ^
-
-
- //--
- //Source and next pointer have advanced four bytes so far.
- //Added 2 Y for yellows (one from each line) and one each of U and V, ignore an A on each line
- //--
-
- //Current line extra Y for yellows.
- locSourceUptoPtr += 3; //Skip the A and U and V samples
- *(locYUpto++) = *(locSourceUptoPtr); //get the Y for yellow sample
- locSourceUptoPtr += 2; //Advance 1 for the Y for yellow and Skip the A sample.
-
- // v u y a v u y a
- //SourceUpto ^
- //NextUpto ^
-
-
- //Next line extra Y for yellows.
- locSourceNextLine += 3; //Skip the A and U and V samples
- *(locDestNextLine++) = *(locSourceNextLine); //get the Y for yellow sample
- locSourceNextLine += 2; //Advance 1 for the Y for yellow and Skip the A sample.
-
- // v u y a v u y a
- //SourceUpto ^
- //NextUpto ^
-
- //--
- //In total source and next pointer advanced 8 bytes on each line, and we got 4 Y for yellows (2 each line)
- // and one each U, V, ignored 4 A's (2 each line)
- //--
-
-
- }
- //Overall this loop will advance :
- //Sourceupto by = 8 bytes * (mWidth in pixels / 2 pixels at a time) * 2 lines
- // = 8 * mWidth
- // = 2 lines of 4 byte pixels of pixel width mWidth
- //and the same for sourcenextline
- //--
- //At the end of this loop sourceupto points to the end of the current line (start of next line)
- // and nextupto points to the end of the next line
- //
- //On the next iteration we want the sourceupto to point 2 lines down from where it did on the previous one
- // This is the same place that the sourcenextline points at the end of the iteration.
- //--
-
- //Ensures source will point to lines 2, 4, 6 etc.
- locSourceUptoPtr = locSourceNextLine;
- //Ensures nextlinesource is one line ahead of the main source.
- locSourceNextLine += (mWidth * PIXEL_BYTE_SIZE);
-
- //Ensures the current destination buffer skips a line ie points to line 2, 4, 6 etc
- locYUpto = locDestNextLine;
- //Ensures the nextlinedest skips a
- locDestNextLine += (mWidth);
- }
- return 0;
-}
-long TheoraEncodeInputPin::encodeYUY2ToYV12(unsigned char* inBuf, long inNumBytes) {
-
- unsigned char* locSourceUptoPtr = inBuf; //View only... don't delete locUptoPtr
-
- //YUY2 is Y0 U0 Y1 V0 Y2 U1 Y3 V1
- // it has twice as much sampling height as YV12 so downsample it.
-
- char* locYUpto = mYUV.y;
- char* locUUpto = mYUV.u;
- char* locVUpto = mYUV.v;
-
-
-
- //After downsampling... from each block of 8, we get 4 y samples and 1 each of u and v
-
-
- for (int i = 0; i < mHeight / 2; i++) {
- //TO DO: Draw memory layouts.
-
- //***Part of the average method... store the pointer to the last of the previous line
- //locLastUUpto = locUUpto;
- //locLastVUpto = locVUpto;
- //***
-
- for (int j = 0; j < mWidth / 2; j++) {
- *(locYUpto++) = *(locSourceUptoPtr++);
- *(locUUpto++) = *(locSourceUptoPtr++);
- *(locYUpto++) = *(locSourceUptoPtr++);
- *(locVUpto++) = *(locSourceUptoPtr++);
- }
-
-
- //***Drop line method
- for (int j = 0; j < mWidth / 2; j++) {
- //Ignore the second line
- *(locYUpto++) = *(locSourceUptoPtr++);
- locSourceUptoPtr++;
- *(locYUpto++) = *(locSourceUptoPtr++);
- locSourceUptoPtr++;
- }
- //***
-
- //*** PArt of the Alternate method to average...
- //for (int j = 0; j < mWidth / 2; j++) {
- // //Ignore the second line
- // *(locYUpto++) = *(locSourceUptoPtr++);
- // *(locLastUUpto++) = ((short)(*locLastUUpto) + ((short)(*locUUpto))) / 2;
- //
- // *(locYUpto++) = *(locSourceUptoPtr++);
- // *(locLastVUpto++) = ((short)(*locLastVUpto) + ((short)(*locVUpto))) / 2;
- //
- //}
- //***
-
-
-
- }
- return 0;
-}
-
-long TheoraEncodeInputPin::encodeYVYUToYV12(unsigned char* inBuf, long inNumBytes) {
- //YVYU - Yellow Victor Yellow Ugly
- unsigned char* locSourceUptoPtr = inBuf; //View only... don't delete locUptoPtr
-
- //YUY2 is Y0 U0 Y1 V0 Y2 U1 Y3 V1
- //YVYU is Y0 V0 Y1 U0 Y2 V1 Y3 U1
- // it has twice as much sampling height as YV12 so downsample it.
-
- char* locYUpto = mYUV.y;
- char* locUUpto = mYUV.u;
- char* locVUpto = mYUV.v;
-
-
-
- //After downsampling... from each block of 8, we get 4 y samples and 1 each of u and v
-
-
- for (int i = 0; i < mHeight / 2; i++) {
- //TO DO: Draw memory layouts.
-
-
-
- for (int j = 0; j < mWidth / 2; j++) {
- *(locYUpto++) = *(locSourceUptoPtr++); //Y for Yellow
- *(locVUpto++) = *(locSourceUptoPtr++); //V for victor
-
- *(locYUpto++) = *(locSourceUptoPtr++); //Y for Yellow
- *(locUUpto++) = *(locSourceUptoPtr++); //U for Ugly
- }
-
-
- //***Drop line method
- for (int j = 0; j < mWidth / 2; j++) {
- //Ignore the second line
- *(locYUpto++) = *(locSourceUptoPtr++); //Y for Yellow
- locSourceUptoPtr++; //V for victor
- *(locYUpto++) = *(locSourceUptoPtr++); //Y for yellow
- locSourceUptoPtr++; //U for ugly.
- }
-
- }
- return 0;
-}
-
-
-long TheoraEncodeInputPin::encodeUYVYToYV12(unsigned char* inBuf, long inNumBytes) {
- //UYVY :: U0 Y0 V0 Y1 - Ugly Yellow Victor Yello
- unsigned char* locSourceUptoPtr = inBuf; //View only... don't delete locUptoPtr
-
- //UYVY is U0 Y0 V0 Y1 U0 Y2 V0 Y3
- //YUY2 is Y0 U0 Y1 V0 Y2 U1 Y3 V1
- // it has twice as much sampling height as YV12 so downsample it.
-
- char* locYUpto = mYUV.y;
- char* locUUpto = mYUV.u;
- char* locVUpto = mYUV.v;
-
-
-
- //After downsampling... from each block of 8, we get 4 y samples and 1 each of u and v
-
-
- for (int i = 0; i < mHeight / 2; i++) {
- //TO DO: Draw memory layouts.
-
-
- for (int j = 0; j < mWidth / 2; j++) {
- *(locUUpto++) = *(locSourceUptoPtr++); //U for Ugly
- *(locYUpto++) = *(locSourceUptoPtr++); //Y for Yellow
-
- *(locVUpto++) = *(locSourceUptoPtr++); //V for Victor
- *(locYUpto++) = *(locSourceUptoPtr++); //Y for Yellow
-
- }
-
-
- //***Drop line method
- for (int j = 0; j < mWidth / 2; j++) {
- //Ignore the second line
-
- locSourceUptoPtr++; //U for ugly
- *(locYUpto++) = *(locSourceUptoPtr++); //Y for yellow
-
- locSourceUptoPtr++; //V for victor
- *(locYUpto++) = *(locSourceUptoPtr++); //Y for yellow
-
- }
-
-
- }
- return 0;
-}
-
-
-
-//PURE VIRTUALS
-long TheoraEncodeInputPin::TransformData(unsigned char* inBuf, long inNumBytes) {
-
- //TODO::: Break this function up a bit !!
-
- //Time stamps are granule pos not directshow times
- //debugLog<<"Encode data"<<endl;
- LONGLONG locFrameStart = mUptoFrame;
- LONGLONG locFrameEnd = 0;
- HRESULT locHR = S_OK;
- if (!mBegun) {
- //debugLog<<"encodeData : First time"<<endl;
- mBegun = true;
-
- StampedOggPacket** locHeaders;
- locHeaders = mTheoraEncoder.initCodec(mTheoraInfo);
-
- for (int i = 0; i < 3; i++) {
- locHR = deliverData(0,0,locHeaders[i]->packetData(), locHeaders[i]->packetSize());
- if (locHR != S_OK) {
- return locHR;
- }
- }
- }
-
- if (mPinInputType.subtype == MEDIASUBTYPE_YUY2) {
- //debugLog<<"About to encode YUY2 to YV12"<<endl;
- encodeYUY2ToYV12(inBuf, inNumBytes);
- } else if (mPinInputType.subtype == MEDIASUBTYPE_AYUV) {
- encodeAYUVtoYV12(inBuf, inNumBytes);
-
- } else if (mPinInputType.subtype == MEDIASUBTYPE_RGB32) {
- encodeRGB32toYV12(inBuf, inNumBytes);
-
- } else if (mPinInputType.subtype == MEDIASUBTYPE_RGB24) {
- encodeRGB24toYV12(inBuf, inNumBytes);
-
-
- } else if (mPinInputType.subtype == MEDIASUBTYPE_YV12) {
- //Should be more specifc.
- //debugLog<<"About to encode YV12 to YV12"<<endl;
- encodeYV12ToYV12(inBuf, inNumBytes);
- } else if (mPinInputType.subtype == MEDIASUBTYPE_UYVY) {
-
-
- encodeUYVYToYV12(inBuf, inNumBytes);
-
- } else if (mPinInputType.subtype == MEDIASUBTYPE_YVYU) {
-
-
- encodeYVYUToYV12(inBuf, inNumBytes);
- } else if (mPinInputType.subtype == MEDIASUBTYPE_IYUV) {
-
-
- encodeIYUVToYV12(inBuf, inNumBytes);
-
-
- } else {
-
- //FATAL ERROR
- throw 0;
- }
-
-
- StampedOggPacket* locPacket = mTheoraEncoder.encodeTheora(&mYUV);
- if (locPacket == NULL) {
- //debugLog<<"Encode returns NULL"<<endl;
- return S_FALSE;
- }
- locFrameEnd = mUptoFrame
- = locPacket->endTime();
- //debugLog<<"Delivering..."<<endl;
- return deliverData(locFrameStart, locFrameEnd, locPacket->packetData(), locPacket->packetSize());
-
-}
-bool TheoraEncodeInputPin::ConstructCodec() {
-
- //debugLog<<"Contructing codec..."<<endl;
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "theoraencodeinputpin.h"
+
+TheoraEncodeInputPin::TheoraEncodeInputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes)
+ : AbstractTransformInputPin(inParentFilter, inFilterLock, inOutputPin, NAME("TheoraEncodeInputPin"), L"YV12 In", inAcceptableMediaTypes)
+ , mXOffset(0)
+ , mYOffset(0)
+ , mHeight(0)
+ , mWidth(0)
+ , mUptoFrame(0)
+ , mBegun(false)
+ , mVideoFormat(NULL)
+
+
+{
+ //debugLog.open("g:\\logs\\theoencfiltinput.log", ios_base::out);
+ mYUV.y = NULL;
+ mYUV.u = NULL;
+ mYUV.v = NULL;
+
+}
+
+TheoraEncodeInputPin::~TheoraEncodeInputPin(void)
+{
+ //debugLog.close();
+ DestroyCodec();
+ delete[] mYUV.y;
+ delete[] mYUV.u;
+ delete[] mYUV.v;
+
+}
+
+
+HRESULT TheoraEncodeInputPin::deliverData(LONGLONG inStart, LONGLONG inEnd, unsigned char* inBuf, unsigned long inNumBytes) {
+ //debugLog <<" deliverData : "<<inStart<<" - "<<inEnd<<" :: size = "<<inNumBytes<<endl;
+ //Get a pointer to a new sample stamped with our time
+ IMediaSample* locSample;
+ HRESULT locHR = mOutputPin->GetDeliveryBuffer(&locSample, &inStart, &inEnd, NULL);
+
+ if (locHR != S_OK) {
+ //We get here when the application goes into stop mode usually.
+ return locHR;
+ }
+
+ BYTE* locBuffer = NULL;
+
+
+ //Make our pointers set to point to the samples buffer
+ locSample->GetPointer(&locBuffer);
+
+ if (locSample->GetSize() >= inNumBytes) {
+
+ memcpy((void*)locBuffer, (const void*)inBuf, inNumBytes);
+
+ //Set the sample parameters.
+ SetSampleParams(locSample, inNumBytes, &inStart, &inEnd);
+
+ {
+ CAutoLock locLock(m_pLock);
+
+ HRESULT locHR = ((TheoraEncodeOutputPin*)mOutputPin)->mDataQueue->Receive(locSample); //->DownstreamFilter()->Receive(locSample);
+ if (locHR != S_OK) {
+ return locHR;
+ } else {
+ }
+ }
+ //debugLog<<"deliverData : SUCCESS"<<endl;
+ return S_OK;
+ } else {
+ //debugLog<<"Buffer too small !!!! FATALITY !"<<endl;
+ throw 0;
+ }
+
+}
+
+long TheoraEncodeInputPin::encodeYV12ToYV12(unsigned char* inBuf, long inNumBytes) {
+ //Source Buffer all in one buffer
+
+ //YV12 memory layout for directshow
+ //=================================
+ //YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
+ //YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
+ //YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
+ //YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
+ //VVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVV
+ //UUUUUUUUUUUUUUUUUUUUUUUU UUUUUUUUUUUUUUUUUUUUUUUU
+
+
+ //Destination buffer Y, U, V in seperate planes, lowercase are line padding, "." height padding
+ //.............................. ..............................
+ //.............................. ..............................
+ //yyyyyyYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYyyyyyy
+ //yyyyyyYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYyyyyyy
+ //yyyyyyYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYyyyyyy
+ //yyyyyyYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYyyyyyy
+ //.............................. ..............................
+ //.............................. ..............................
+
+ //.............................. ..............................
+ //vvvVVVVVVVVVVVVVVVVVVVVVVVVvvv vvvVVVVVVVVVVVVVVVVVVVVVVVVvvv
+ //.............................. ..............................
+
+ //.............................. ..............................
+ //uuuUUUUUUUUUUUUUUUUUUUUUUUUuuu uuuUUUUUUUUUUUUUUUUUUUUUUUUuuu
+ //.............................. ..............................
+
+ //NOTE : mHeight, mWidth are the actual video sizes and are the sizes of the incoming buffer
+ // The yuv width, height parameters are a /16 up rounded size of the output buffer to be sent to libtheora
+
+
+ //Setup the source pointer
+ unsigned char* locSourceUptoPtr = inBuf; //View only... don't delete locUptoPtr
+ //
+
+ //========
+ //Y DATA |
+ //=========================================================================================================
+
+ //Setup the destination pointer
+ char* locDestUptoPtr = mYUV.y;
+ //
+
+ //Pad top of Y plane buffer with mYOffset lines of width mYUV.y_width
+ if (mYOffset != 0) {
+ memset((void*)locDestUptoPtr, NULL, mYOffset * mYUV.y_width); //Is it needed to zero this out ? Or just leave junk ?
+ locDestUptoPtr += (mYOffset * mYUV.y_width);
+ }
+ //Source pointer does not advance
+ //
+
+ //Add mHeight lines of data of width mWidth plus padding of mXOffset at each end
+ if (mXOffset == 0) {
+ //Slight optimisation to keep the inner loop tighter
+ for (long line = 0; line < mHeight; line++) {
+ memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth);
+ locSourceUptoPtr += mWidth;
+ locDestUptoPtr += mWidth;
+ }
+ } else {
+ for (long line = 0; line < mHeight; line++) {
+ //Pad the start of the line with mXOffset bytes
+ memset((void*)locDestUptoPtr, NULL, mXOffset);
+ locDestUptoPtr += mXOffset;
+
+ //Fill in the meaty bit
+ memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth);
+ locSourceUptoPtr += mWidth;
+ locDestUptoPtr += mWidth;
+
+ //Pad the end of the line with mXOffset bytes
+ memset((void*)locDestUptoPtr, NULL, mXOffset);
+ locDestUptoPtr += mXOffset;
+ }
+
+ }
+
+ //Pad bottom of Y plane buffer with mYOffset lines of width mYUV.y_width
+ if (mYOffset != 0) {
+ memset((void*)locDestUptoPtr, NULL, mYOffset * mYUV.y_width); //Is it needed to zero this out ? Or just leave junk ?
+ locDestUptoPtr += (mYOffset * mYUV.y_width);
+ //Source pointer does not advance
+ }
+
+
+
+ //========
+ //V DATA |
+ //=========================================================================================================
+
+ //Set the destination poitner
+ locDestUptoPtr = mYUV.v;
+ //
+
+ //Pad top of V plane buffer with mYOffset/2 lines of width mYUV.uv_width
+ if (mYOffset != 0) {
+ memset((void*)locDestUptoPtr, NULL, (mYOffset * mYUV.uv_width) / 2); //Is it needed to zero this out ? Or just leave junk ?
+ locDestUptoPtr += ((mYOffset * mYUV.uv_width) / 2);
+ //Source pointer does not advance
+ }
+ //
+
+ //Add mHeight/2 lines of data of length mWidth/2 plus padded by mXOffset/2 at each end
+ if (mXOffset == 0) {
+ //Slight optimisation to keep the inner loop tighter
+ for (long line = 0; line < mHeight / 2; line++) {
+ memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth / 2);
+ locSourceUptoPtr += (mWidth / 2);
+ locDestUptoPtr += (mWidth / 2);
+ }
+ } else {
+ for (long line = 0; line < mHeight / 2; line++) {
+ //Pad the start of the line
+ memset((void*)locDestUptoPtr, NULL, mXOffset / 2);
+ locDestUptoPtr += (mXOffset / 2);
+ //Source pointer does not advance
+
+ //Fill in the meaty bit
+ memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth / 2);
+ locSourceUptoPtr += (mWidth / 2);
+ locDestUptoPtr += (mWidth / 2);
+
+ //Pad the end of the line
+ memset((void*)locDestUptoPtr, NULL, mXOffset / 2);
+ locDestUptoPtr += (mXOffset / 2);
+ //Source pointer does not advance
+ }
+
+ }
+
+ //Pad bottom of V plane buffer with mYOffset / 2 lines of width mYUV.uv_width
+ if (mYOffset != 0) {
+ memset((void*)locDestUptoPtr, NULL, (mYOffset * mYUV.uv_width) / 2); //Is it needed to zero this out ? Or just leave junk ?
+ locDestUptoPtr += ((mYOffset * mYUV.uv_width) / 2);
+ //Source pointer does not advance
+ }
+
+
+
+
+
+ //========
+ //U DATA |
+ //=========================================================================================================
+
+ //Set the destination pointer
+ locDestUptoPtr = mYUV.u;
+ //
+
+ //Pad top of U plane buffer with mYOffset/2 lines of width mYUV.uv_width
+ if (mYOffset != 0) {
+ memset((void*)locDestUptoPtr, NULL, (mYOffset * mYUV.uv_width) / 2); //Is it needed to zero this out ? Or just leave junk ?
+ locDestUptoPtr += ((mYOffset * mYUV.uv_width) / 2);
+ //Source pointer does not advance
+ }
+ //
+
+ //Add mHeight/2 lines of data of length mWidth/2 plus padded by mXOffset/2 at each end
+ if (mXOffset == 0) {
+ //Slight optimisation to keep the inner loop tighter
+ for (long line = 0; line < mHeight / 2; line++) {
+ memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth / 2);
+ locSourceUptoPtr += (mWidth / 2);
+ locDestUptoPtr += (mWidth / 2);
+ }
+ } else {
+ for (long line = 0; line < mHeight / 2; line++) {
+ //Pad the start of the line
+ memset((void*)locDestUptoPtr, NULL, mXOffset / 2);
+ locDestUptoPtr += (mXOffset / 2);
+ //Source pointer does not advance
+
+ //Fill in the meaty bit
+ memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth / 2);
+ locSourceUptoPtr += (mWidth / 2);
+ locDestUptoPtr += (mWidth / 2);
+
+ //Pad the end of the line
+ memset((void*)locDestUptoPtr, NULL, mXOffset / 2);
+ locDestUptoPtr += (mXOffset / 2);
+ //Source pointer does not advance
+ }
+
+ }
+
+ //Pad bottom of U plane buffer with mYOffset / 2 lines of width mYUV.uv_width
+ if (mYOffset != 0) {
+ memset((void*)locDestUptoPtr, NULL, (mYOffset * mYUV.uv_width) / 2); //Is it needed to zero this out ? Or just leave junk ?
+ locDestUptoPtr += ((mYOffset * mYUV.uv_width) / 2);
+ //Source pointer does not advance
+ }
+
+ //======================================================================================================
+ return 0;
+
+}
+
+//-------------------------------------------------------------------------
+
+long TheoraEncodeInputPin::encodeIYUVToYV12(unsigned char* inBuf, long inNumBytes) {
+ //Same as YV12 but planes U and V are reversed.
+
+ //Source Buffer all in one buffer
+
+ //IYUV memory layout for directshow
+ //=================================
+ //YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
+ //YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
+ //YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
+ //YYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYY
+
+ //UUUUUUUUUUUUUUUUUUUUUUUU UUUUUUUUUUUUUUUUUUUUUUUU
+
+ //VVVVVVVVVVVVVVVVVVVVVVVV VVVVVVVVVVVVVVVVVVVVVVVV
+
+
+
+ //Destination buffer Y, U, V in seperate planes, lowercase are line padding, "." height padding
+ //.............................. ..............................
+ //.............................. ..............................
+ //yyyyyyYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYyyyyyy
+ //yyyyyyYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYyyyyyy
+ //yyyyyyYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYyyyyyy
+ //yyyyyyYYYYYYYYYYYYYYYYYYYYYYYY YYYYYYYYYYYYYYYYYYYYYYYYyyyyyy
+ //.............................. ..............................
+ //.............................. ..............................
+
+ //.............................. ..............................
+ //uuuUUUUUUUUUUUUUUUUUUUUUUUUuuu uuuUUUUUUUUUUUUUUUUUUUUUUUUuuu
+ //.............................. ..............................
+
+ //.............................. ..............................
+ //vvvVVVVVVVVVVVVVVVVVVVVVVVVvvv vvvVVVVVVVVVVVVVVVVVVVVVVVVvvv
+ //.............................. ..............................
+
+
+
+ //NOTE : mHeight, mWidth are the actual video sizes and are the sizes of the incoming buffer
+ // The yuv width, height parameters are a /16 up rounded size of the output buffer to be sent to libtheora
+
+
+ //Setup the source pointer
+ unsigned char* locSourceUptoPtr = inBuf; //View only... don't delete locUptoPtr
+ //
+
+ //========
+ //Y DATA |
+ //=========================================================================================================
+
+ //Setup the destination pointer
+ char* locDestUptoPtr = mYUV.y;
+ //
+
+ //Pad top of Y plane buffer with mYOffset lines of width mYUV.y_width
+ if (mYOffset != 0) {
+ memset((void*)locDestUptoPtr, NULL, mYOffset * mYUV.y_width); //Is it needed to zero this out ? Or just leave junk ?
+ locDestUptoPtr += (mYOffset * mYUV.y_width);
+ }
+ //Source pointer does not advance
+ //
+
+ //Add mHeight lines of data of width mWidth plus padding of mXOffset at each end
+ if (mXOffset == 0) {
+ //Slight optimisation to keep the inner loop tighter
+ for (long line = 0; line < mHeight; line++) {
+ memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth);
+ locSourceUptoPtr += mWidth;
+ locDestUptoPtr += mWidth;
+ }
+ } else {
+ for (long line = 0; line < mHeight; line++) {
+ //Pad the start of the line with mXOffset bytes
+ memset((void*)locDestUptoPtr, NULL, mXOffset);
+ locDestUptoPtr += mXOffset;
+
+ //Fill in the meaty bit
+ memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth);
+ locSourceUptoPtr += mWidth;
+ locDestUptoPtr += mWidth;
+
+ //Pad the end of the line with mXOffset bytes
+ memset((void*)locDestUptoPtr, NULL, mXOffset);
+ locDestUptoPtr += mXOffset;
+ }
+
+ }
+
+ //Pad bottom of Y plane buffer with mYOffset lines of width mYUV.y_width
+ if (mYOffset != 0) {
+ memset((void*)locDestUptoPtr, NULL, mYOffset * mYUV.y_width); //Is it needed to zero this out ? Or just leave junk ?
+ locDestUptoPtr += (mYOffset * mYUV.y_width);
+ //Source pointer does not advance
+ }
+
+ //========
+ //U DATA |
+ //=========================================================================================================
+
+ //Set the destination pointer
+ locDestUptoPtr = mYUV.u;
+ //
+
+ //Pad top of U plane buffer with mYOffset/2 lines of width mYUV.uv_width
+ if (mYOffset != 0) {
+ memset((void*)locDestUptoPtr, NULL, (mYOffset * mYUV.uv_width) / 2); //Is it needed to zero this out ? Or just leave junk ?
+ locDestUptoPtr += ((mYOffset * mYUV.uv_width) / 2);
+ //Source pointer does not advance
+ }
+ //
+
+ //Add mHeight/2 lines of data of length mWidth/2 plus padded by mXOffset/2 at each end
+ if (mXOffset == 0) {
+ //Slight optimisation to keep the inner loop tighter
+ for (long line = 0; line < mHeight / 2; line++) {
+ memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth / 2);
+ locSourceUptoPtr += (mWidth / 2);
+ locDestUptoPtr += (mWidth / 2);
+ }
+ } else {
+ for (long line = 0; line < mHeight / 2; line++) {
+ //Pad the start of the line
+ memset((void*)locDestUptoPtr, NULL, mXOffset / 2);
+ locDestUptoPtr += (mXOffset / 2);
+ //Source pointer does not advance
+
+ //Fill in the meaty bit
+ memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth / 2);
+ locSourceUptoPtr += (mWidth / 2);
+ locDestUptoPtr += (mWidth / 2);
+
+ //Pad the end of the line
+ memset((void*)locDestUptoPtr, NULL, mXOffset / 2);
+ locDestUptoPtr += (mXOffset / 2);
+ //Source pointer does not advance
+ }
+
+ }
+
+ //Pad bottom of U plane buffer with mYOffset / 2 lines of width mYUV.uv_width
+ if (mYOffset != 0) {
+ memset((void*)locDestUptoPtr, NULL, (mYOffset * mYUV.uv_width) / 2); //Is it needed to zero this out ? Or just leave junk ?
+ locDestUptoPtr += ((mYOffset * mYUV.uv_width) / 2);
+ //Source pointer does not advance
+ }
+
+
+
+ //========
+ //V DATA |
+ //=========================================================================================================
+
+ //Set the destination poitner
+ locDestUptoPtr = mYUV.v;
+ //
+
+ //Pad top of V plane buffer with mYOffset/2 lines of width mYUV.uv_width
+ if (mYOffset != 0) {
+ memset((void*)locDestUptoPtr, NULL, (mYOffset * mYUV.uv_width) / 2); //Is it needed to zero this out ? Or just leave junk ?
+ locDestUptoPtr += ((mYOffset * mYUV.uv_width) / 2);
+ //Source pointer does not advance
+ }
+ //
+
+ //Add mHeight/2 lines of data of length mWidth/2 plus padded by mXOffset/2 at each end
+ if (mXOffset == 0) {
+ //Slight optimisation to keep the inner loop tighter
+ for (long line = 0; line < mHeight / 2; line++) {
+ memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth / 2);
+ locSourceUptoPtr += (mWidth / 2);
+ locDestUptoPtr += (mWidth / 2);
+ }
+ } else {
+ for (long line = 0; line < mHeight / 2; line++) {
+ //Pad the start of the line
+ memset((void*)locDestUptoPtr, NULL, mXOffset / 2);
+ locDestUptoPtr += (mXOffset / 2);
+ //Source pointer does not advance
+
+ //Fill in the meaty bit
+ memcpy((void*)locDestUptoPtr, (const void*)locSourceUptoPtr, mWidth / 2);
+ locSourceUptoPtr += (mWidth / 2);
+ locDestUptoPtr += (mWidth / 2);
+
+ //Pad the end of the line
+ memset((void*)locDestUptoPtr, NULL, mXOffset / 2);
+ locDestUptoPtr += (mXOffset / 2);
+ //Source pointer does not advance
+ }
+
+ }
+
+ //Pad bottom of V plane buffer with mYOffset / 2 lines of width mYUV.uv_width
+ if (mYOffset != 0) {
+ memset((void*)locDestUptoPtr, NULL, (mYOffset * mYUV.uv_width) / 2); //Is it needed to zero this out ? Or just leave junk ?
+ locDestUptoPtr += ((mYOffset * mYUV.uv_width) / 2);
+ //Source pointer does not advance
+ }
+
+
+
+
+
+
+ //======================================================================================================
+ return 0;
+
+}
+//-------------------------------------------------------------------------
+
+long TheoraEncodeInputPin::encodeRGB24toYV12(unsigned char* inBuf, long inNumBytes) {
+ //Blue Green Red Blue Green Red.
+ unsigned long locNumPixels = (inNumBytes/3);
+ unsigned char* locAYUVBuf = new unsigned char[locNumPixels<<2]; //4 bytes per pixel
+
+ /*
+
+
+
+
+ Conversion from RGB to YUV is defined by starting with the following:
+
+ L = Kr * R + Kb * B + (1 Kr Kb) * G
+
+ The YUV values are then obtained as follows:
+
+ Y = floor(2^(M-8) * (219*(LZ)/S + 16) + 0.5)
+ U = clip3(0, 2^M-1, floor(2^(M-8) * (112*(B-L) / ((1-Kb)*S) + 128) + 0.5))
+ V = clip3(0, 2^M-1, floor(2^(M-8) * (112*(R-L) / ((1-Kr)*S) + 128) + 0.5))
+
+ where Z = 16
+ S = 219
+ M = 8 bits per sample.
+
+ ==>
+ Y = floor(L + 0.5)
+ U = (112*(B-L) / ((1-Kb)*S) + 128)
+
+
+ Kr' = Kr * 65536
+ Kb' = Kb * 65536
+ G_FACTOR = (1 - Kr - Kb) * 65536
+
+ L' = (Kr' * R) + (Kb' * B) + (G_FACTOR * G)
+ = 65536 * ( (Kr * R) + (Kb * B) + ((1 - Kr - Kb) * G) )
+ = 65536 * L
+
+ Y = round( 219 * (L-Z)/S + 16 )
+ = round ( L-Z + 16 )
+ = round( L )
+
+ Y' = L'
+ = 65536 * L
+
+ Y = L' >> 16
+
+ U_FACTOR = ( 1 - Kb) * S
+ U_FACTOR' = 12716213
+
+ = 65536 * U_FACTOR
+
+ V_FACTOR' = 10061022
+
+ B' = 65536 * B
+ R' = 65536 * R
+
+ _U_ = round( 112 * (B-L) / ( (1-Kb)*S ) + 128 )
+ = round( (112 * (B-L) / U_FACTOR) + 128 )
+ = (112 * (B' - L') / U_FACTOR') + 128
+ = (112 * 65536 * (B - L) / (U_FACTOR * 65536)) + 128
+ = (112 * (B - L) / U_FACTOR) + 128
+
+ Hence integerisation scaling cancels
+ ==>
+ _U_ = (112 * (B' - L') / U_FACTOR') + 128
+
+ _V_ = (112 * (R' - L') / V_FACTOR') + 128
+
+ */
+
+ /*
+ Kr = 0.299
+ Kb = 0.114
+
+
+ */
+
+ //Scaled by factor of 65536 to integerise.
+ const int KR = 19596;
+ const int KB = 7472;
+
+ const int ROUNDER = 32768;
+
+ const int G_FACTOR = 38470;
+ const int U_FACTOR = 12716213;
+ const int V_FACTOR = 10061022;
+
+ int locL = 0;
+ int locB = 0;
+ int locR = 0;
+
+ //unsigned char* locSourcePtr = inBuf;
+ unsigned char* locDestPtr = locAYUVBuf;
+
+ //SOURCE: Blue Green Red Blue Green Red.
+ //DEST: v u y a
+
+ unsigned char* locSourceEnds = inBuf + (locNumPixels * 3);
+
+ //Upside down... Upside down !
+ //for (unsigned char* locSourcePtr = inBuf; locSourcePtr < locSourceEnds; locSourcePtr += 3) {
+ // locB = locSourcePtr[0]; //Blue
+ // locL = KB * (locB); //Blue
+ //
+ // locL += G_FACTOR * (locSourcePtr[1]); //Green
+
+ // locR = locSourcePtr[2]; //Red
+ // locL += KR * (locR); //Red
+
+ //
+ // *(locDestPtr++) = CLIP3(0, 255, ((112 * ( (locR<<16) - locL)) / V_FACTOR) + 128); //V for Victor
+ // *(locDestPtr++) = CLIP3(0, 255, ((112 * ( (locB<<16) - locL)) / U_FACTOR) + 128); //U for ugly
+ // *(locDestPtr++) = CLIP3(0, 255, locL >> 16); //Y for yellow
+ // *(locDestPtr++) = 255; //A for alpha
+ //}
+
+
+ unsigned char* locColSourcePtr = NULL;
+ unsigned char* locColEndPtr = NULL;
+ unsigned long locLineLength = mWidth * 3;
+ unsigned long col = 0;
+ for (unsigned char* locSourcePtr = locSourceEnds - locLineLength; locSourcePtr >= inBuf; locSourcePtr -= locLineLength) {
+ //
+ //for(unsigned char* locColSourcePtr = locSourcePtr, int i = 0; i < mWidth; i++, locColSourcePtr +=4) {
+ //
+ locColSourcePtr = locSourcePtr;
+ locColEndPtr = locColSourcePtr + locLineLength;
+ while (locColSourcePtr < locColEndPtr) {
+ locB = locColSourcePtr[0]; //Blue
+ locL = KB * (locB); //Blue
+
+ locL += G_FACTOR * (locColSourcePtr[1]); //Green
+
+ locR = locColSourcePtr[2]; //Red
+ locL += KR * (locR); //Red
+
+
+ *(locDestPtr++) = CLIP3(0, 255, ((112 * ( (locR<<16) - locL)) / V_FACTOR) + 128); //V for Victor
+ *(locDestPtr++) = CLIP3(0, 255, ((112 * ( (locB<<16) - locL)) / U_FACTOR) + 128); //U for ugly
+ *(locDestPtr++) = CLIP3(0, 255, locL >> 16); //Y for yellow
+ *(locDestPtr++) = 255; //A for alpha
+
+ //debugCount++;
+ locColSourcePtr+=3;
+
+ }
+
+
+ }
+
+
+ //Still need to pass through to the AYUV conversion.
+ encodeAYUVtoYV12(locAYUVBuf, locNumPixels<<2);
+ delete[] locAYUVBuf;
+ locAYUVBuf = NULL;
+
+ return 0;
+}
+
+
+
+long TheoraEncodeInputPin::encodeRGB32toYV12(unsigned char* inBuf, long inNumBytes) {
+ //Blue Green Red Alpha Blue Green Red Alpha
+ //debugLog<<"EncodeRGB32 To YV12 :"<<endl;
+
+ unsigned long locNumPixels = (inNumBytes/4);
+
+ //debugLog<<"EncodeRGB32 To YV12 : Num pixels = "<<locNumPixels<<endl;
+ //debugLog<<"EncodeRGB32 To YV12 : Num BYtes = "<<inNumBytes<<endl;
+ unsigned char* locAYUVBuf = new unsigned char[inNumBytes]; //4 bytes per pixel
+
+ //debugLog<<"EncodeRGB32 To YV12 :"<<endl;
+
+ //Scaled by factor of 65536 to integerise.
+ const int KR = 19596;
+ const int KB = 7472;
+
+ const int ROUNDER = 32768;
+
+ const int G_FACTOR = 38470;
+ const int U_FACTOR = 12716213;
+ const int V_FACTOR = 10061022;
+
+ int locL = 0;
+ int locB = 0;
+ int locR = 0;
+
+ //unsigned char* locSourcePtr = inBuf;
+ unsigned char* locDestPtr = locAYUVBuf;
+
+ //SOURCE: Blue Green Red Blue Green Red.
+ //DEST: v u y a
+
+ unsigned char* locSourceEnds = inBuf + (inNumBytes);
+ //debugLog<<"EncodeRGB32 To YV12 : Source Starts = "<<(int)inBuf<<endl;
+ //debugLog<<"EncodeRGB32 To YV12 : Source Ends = "<<(int)locSourceEnds<<endl;
+
+ //Debugging only... all refs to debugCount remove later
+ //unsigned long debugCount = 0;
+ //
+
+ //Upside down !!
+ //for (unsigned char* locSourcePtr = inBuf; locSourcePtr < locSourceEnds; locSourcePtr += 4) {
+ // locB = locSourcePtr[0]; //Blue
+ // locL = KB * (locB); //Blue
+ //
+ // locL += G_FACTOR * (locSourcePtr[1]); //Green
+
+ // locR = locSourcePtr[2]; //Red
+ // locL += KR * (locR); //Red
+
+ //
+ // *(locDestPtr++) = CLIP3(0, 255, ((112 * ( (locR<<16) - locL)) / V_FACTOR) + 128); //V for Victor
+ // *(locDestPtr++) = CLIP3(0, 255, ((112 * ( (locB<<16) - locL)) / U_FACTOR) + 128); //U for ugly
+ // *(locDestPtr++) = CLIP3(0, 255, locL >> 16); //Y for yellow
+ // *(locDestPtr++) = locSourcePtr[3]; //A for alpha
+
+ // debugCount++;
+ //}
+ unsigned char* locColSourcePtr = NULL;
+ unsigned char* locColEndPtr = NULL;
+ unsigned long locLineLength = mWidth * 4;
+ unsigned long col = 0;
+ for (unsigned char* locSourcePtr = locSourceEnds - locLineLength; locSourcePtr >= inBuf; locSourcePtr -= locLineLength) {
+ //
+ //for(unsigned char* locColSourcePtr = locSourcePtr, int i = 0; i < mWidth; i++, locColSourcePtr +=4) {
+ //
+ locColSourcePtr = locSourcePtr;
+ locColEndPtr = locColSourcePtr + locLineLength;
+ while (locColSourcePtr < locColEndPtr) {
+ locB = locColSourcePtr[0]; //Blue
+ locL = KB * (locB); //Blue
+
+ locL += G_FACTOR * (locColSourcePtr[1]); //Green
+
+ locR = locColSourcePtr[2]; //Red
+ locL += KR * (locR); //Red
+
+
+ *(locDestPtr++) = CLIP3(0, 255, ((112 * ( (locR<<16) - locL)) / V_FACTOR) + 128); //V for Victor
+ *(locDestPtr++) = CLIP3(0, 255, ((112 * ( (locB<<16) - locL)) / U_FACTOR) + 128); //U for ugly
+ *(locDestPtr++) = CLIP3(0, 255, locL >> 16); //Y for yellow
+ *(locDestPtr++) = locColSourcePtr[3]; //A for alpha
+
+ //debugCount++;
+ locColSourcePtr+=4;
+
+ }
+
+
+ }
+
+ //debugLog<<"EncodeRGB32 To YV12 : debugCount = "<<debugCount<<endl;
+
+ //ASSERT(debugCount == locNumPixels);
+
+ ASSERT(locDestPtr == (locAYUVBuf + inNumBytes));
+
+ //debugLog<<"EncodeRGB32 To YV12 : Calling AYUV to YV12 conversion"<<endl;
+ //Still need to pass through to the AYUV conversion.
+
+ encodeAYUVtoYV12(locAYUVBuf, inNumBytes);
+ delete[] locAYUVBuf;
+ locAYUVBuf = NULL;
+
+ return 0;
+}
+
+
+
+
+long TheoraEncodeInputPin::encodeAYUVtoYV12(unsigned char* inBuf, long inNumBytes) {
+
+ //Victor Ugly Yellow Alpha --fonts are fuzzy late at night-- (Yellow is not colour yellow)
+
+ //AYUV is VUYA VUYA VUYA VUYA 4:4:4 sampling
+ // Twice the vertical and horizontal sampling of YV12 in chrominance
+
+ //Strategy : Process two lines and 2 cols at a time averaging 4 U and V around the position where a
+ // YV12 chroma sample will be... leave luminance samples... ignore alpha samples
+
+ //debugLog<<"Encode AYUV To YV12 :"<<endl;
+
+ const int PIXEL_BYTE_SIZE = 4;
+ ASSERT (mHeight % 2 == 0);
+ ASSERT (mWidth % 2 == 0);
+
+ unsigned char* locSourceUptoPtr = inBuf; //View only... don't delete locUptoPtr
+ unsigned char* locSourceNextLine = locSourceUptoPtr + (mWidth * PIXEL_BYTE_SIZE); //View only don't delete
+
+ char* locYUpto = mYUV.y;
+ char* locUUpto = mYUV.u;
+ char* locVUpto = mYUV.v;
+ //Pointer to the same pixel on next line
+ char* locDestNextLine = locYUpto + (mWidth); //View only... don't delete
+
+ int temp = 0;
+
+ //Process 2 lines at a time
+ for (int line = 0; line < mHeight; line += 2) {
+ //debugLog<<"Encode AYUV To YV12 : ++ Line = "<<line<<endl;
+
+ ASSERT (locSourceUptoPtr == (inBuf + (line * (mWidth * PIXEL_BYTE_SIZE))));
+ ASSERT (locSourceNextLine == locSourceUptoPtr + (mWidth * PIXEL_BYTE_SIZE));
+ ASSERT (locYUpto == (mYUV.y + (line * mWidth)));
+ ASSERT (locDestNextLine == locYUpto + (mWidth));
+
+
+ //Columns also done 2 at a time
+ for (int col = 0; col < mWidth; col += 2) {
+ //debugLog<<"Encode AYUV To YV12 : ++++++ Col = "<<col<<endl;
+
+
+ // v u y a v u y a
+ //SourceUpto ^
+ //NextUpto ^
+
+ //====================
+ //V for Victor samples
+ //====================
+ temp = *(locSourceUptoPtr++); //Current pixel
+
+ // v u y a v u y a
+ //SourceUpto ^
+ //NextUpto ^
+
+ //This is three as we already advanced one and are pointing to a u not a v
+ temp += *(locSourceUptoPtr + 3); //Pixel to right
+ temp += *(locSourceNextLine++); //Pixel below
+
+ // v u y a v u y a
+ //SourceUpto ^
+ //NextUpto ^
+
+ temp += *(locSourceNextLine + 3); //Pixel below right
+ temp >>= 2; //Divide by 4 to average.
+ *(locVUpto++) = (unsigned char)temp;
+
+ // v u y a v u y a
+ //SourceUpto ^
+ //NextUpto ^
+
+ //====================
+ //U for Ugly samples
+ //====================
+ temp = *(locSourceUptoPtr++); //Current pixel
+
+ // v u y a v u y a
+ //SourceUpto ^
+ //NextUpto ^
+
+ temp += *(locSourceUptoPtr + 3); //Pixel to right
+ temp += *(locSourceNextLine++); //Pixel below
+
+
+ // v u y a v u y a
+ //SourceUpto ^
+ //NextUpto ^
+
+ temp += *(locSourceNextLine + 3); //Pixel below right
+ temp >>= 2; //Divide by 4 to average.
+ *(locUUpto++) = (unsigned char)temp;
+
+ // v u y a v u y a
+ //SourceUpto ^
+ //NextUpto ^
+
+ //====================
+ //Y for Yellow samples.
+ //====================
+
+ *(locYUpto++) = *(locSourceUptoPtr++);
+ *(locDestNextLine++) = *(locSourceNextLine++);
+
+ // v u y a v u y a
+ //SourceUpto ^
+ //NextUpto ^
+
+ //Ignore the alpha channel
+ //--
+ //locSourceUptoPtr++; //Optimised away... merged into increment below
+ //locSourceNextLine++; // " " " " " " " " " " "
+
+ // v u y a v u y a
+ //SourceUpto ^
+ //NextUpto ^
+
+
+ //--
+ //Source and next pointer have advanced four bytes so far.
+ //Added 2 Y for yellows (one from each line) and one each of U and V, ignore an A on each line
+ //--
+
+ //Current line extra Y for yellows.
+ locSourceUptoPtr += 3; //Skip the A and U and V samples
+ *(locYUpto++) = *(locSourceUptoPtr); //get the Y for yellow sample
+ locSourceUptoPtr += 2; //Advance 1 for the Y for yellow and Skip the A sample.
+
+ // v u y a v u y a
+ //SourceUpto ^
+ //NextUpto ^
+
+
+ //Next line extra Y for yellows.
+ locSourceNextLine += 3; //Skip the A and U and V samples
+ *(locDestNextLine++) = *(locSourceNextLine); //get the Y for yellow sample
+ locSourceNextLine += 2; //Advance 1 for the Y for yellow and Skip the A sample.
+
+ // v u y a v u y a
+ //SourceUpto ^
+ //NextUpto ^
+
+ //--
+ //In total source and next pointer advanced 8 bytes on each line, and we got 4 Y for yellows (2 each line)
+ // and one each U, V, ignored 4 A's (2 each line)
+ //--
+
+
+ }
+ //Overall this loop will advance :
+ //Sourceupto by = 8 bytes * (mWidth in pixels / 2 pixels at a time) * 2 lines
+ // = 8 * mWidth
+ // = 2 lines of 4 byte pixels of pixel width mWidth
+ //and the same for sourcenextline
+ //--
+ //At the end of this loop sourceupto points to the end of the current line (start of next line)
+ // and nextupto points to the end of the next line
+ //
+ //On the next iteration we want the sourceupto to point 2 lines down from where it did on the previous one
+ // This is the same place that the sourcenextline points at the end of the iteration.
+ //--
+
+ //Ensures source will point to lines 2, 4, 6 etc.
+ locSourceUptoPtr = locSourceNextLine;
+ //Ensures nextlinesource is one line ahead of the main source.
+ locSourceNextLine += (mWidth * PIXEL_BYTE_SIZE);
+
+ //Ensures the current destination buffer skips a line ie points to line 2, 4, 6 etc
+ locYUpto = locDestNextLine;
+ //Ensures the nextlinedest skips a
+ locDestNextLine += (mWidth);
+ }
+ return 0;
+}
+long TheoraEncodeInputPin::encodeYUY2ToYV12(unsigned char* inBuf, long inNumBytes) {
+
+ unsigned char* locSourceUptoPtr = inBuf; //View only... don't delete locUptoPtr
+
+ //YUY2 is Y0 U0 Y1 V0 Y2 U1 Y3 V1
+ // it has twice as much sampling height as YV12 so downsample it.
+
+ char* locYUpto = mYUV.y;
+ char* locUUpto = mYUV.u;
+ char* locVUpto = mYUV.v;
+
+
+
+ //After downsampling... from each block of 8, we get 4 y samples and 1 each of u and v
+
+
+ for (int i = 0; i < mHeight / 2; i++) {
+ //TO DO: Draw memory layouts.
+
+ //***Part of the average method... store the pointer to the last of the previous line
+ //locLastUUpto = locUUpto;
+ //locLastVUpto = locVUpto;
+ //***
+
+ for (int j = 0; j < mWidth / 2; j++) {
+ *(locYUpto++) = *(locSourceUptoPtr++);
+ *(locUUpto++) = *(locSourceUptoPtr++);
+ *(locYUpto++) = *(locSourceUptoPtr++);
+ *(locVUpto++) = *(locSourceUptoPtr++);
+ }
+
+
+ //***Drop line method
+ for (int j = 0; j < mWidth / 2; j++) {
+ //Ignore the second line
+ *(locYUpto++) = *(locSourceUptoPtr++);
+ locSourceUptoPtr++;
+ *(locYUpto++) = *(locSourceUptoPtr++);
+ locSourceUptoPtr++;
+ }
+ //***
+
+ //*** PArt of the Alternate method to average...
+ //for (int j = 0; j < mWidth / 2; j++) {
+ // //Ignore the second line
+ // *(locYUpto++) = *(locSourceUptoPtr++);
+ // *(locLastUUpto++) = ((short)(*locLastUUpto) + ((short)(*locUUpto))) / 2;
+ //
+ // *(locYUpto++) = *(locSourceUptoPtr++);
+ // *(locLastVUpto++) = ((short)(*locLastVUpto) + ((short)(*locVUpto))) / 2;
+ //
+ //}
+ //***
+
+
+
+ }
+ return 0;
+}
+
+long TheoraEncodeInputPin::encodeYVYUToYV12(unsigned char* inBuf, long inNumBytes) {
+ //YVYU - Yellow Victor Yellow Ugly
+ unsigned char* locSourceUptoPtr = inBuf; //View only... don't delete locUptoPtr
+
+ //YUY2 is Y0 U0 Y1 V0 Y2 U1 Y3 V1
+ //YVYU is Y0 V0 Y1 U0 Y2 V1 Y3 U1
+ // it has twice as much sampling height as YV12 so downsample it.
+
+ char* locYUpto = mYUV.y;
+ char* locUUpto = mYUV.u;
+ char* locVUpto = mYUV.v;
+
+
+
+ //After downsampling... from each block of 8, we get 4 y samples and 1 each of u and v
+
+
+ for (int i = 0; i < mHeight / 2; i++) {
+ //TO DO: Draw memory layouts.
+
+
+
+ for (int j = 0; j < mWidth / 2; j++) {
+ *(locYUpto++) = *(locSourceUptoPtr++); //Y for Yellow
+ *(locVUpto++) = *(locSourceUptoPtr++); //V for victor
+
+ *(locYUpto++) = *(locSourceUptoPtr++); //Y for Yellow
+ *(locUUpto++) = *(locSourceUptoPtr++); //U for Ugly
+ }
+
+
+ //***Drop line method
+ for (int j = 0; j < mWidth / 2; j++) {
+ //Ignore the second line
+ *(locYUpto++) = *(locSourceUptoPtr++); //Y for Yellow
+ locSourceUptoPtr++; //V for victor
+ *(locYUpto++) = *(locSourceUptoPtr++); //Y for yellow
+ locSourceUptoPtr++; //U for ugly.
+ }
+
+ }
+ return 0;
+}
+
+
+long TheoraEncodeInputPin::encodeUYVYToYV12(unsigned char* inBuf, long inNumBytes) {
+ //UYVY :: U0 Y0 V0 Y1 - Ugly Yellow Victor Yello
+ unsigned char* locSourceUptoPtr = inBuf; //View only... don't delete locUptoPtr
+
+ //UYVY is U0 Y0 V0 Y1 U0 Y2 V0 Y3
+ //YUY2 is Y0 U0 Y1 V0 Y2 U1 Y3 V1
+ // it has twice as much sampling height as YV12 so downsample it.
+
+ char* locYUpto = mYUV.y;
+ char* locUUpto = mYUV.u;
+ char* locVUpto = mYUV.v;
+
+
+
+ //After downsampling... from each block of 8, we get 4 y samples and 1 each of u and v
+
+
+ for (int i = 0; i < mHeight / 2; i++) {
+ //TO DO: Draw memory layouts.
+
+
+ for (int j = 0; j < mWidth / 2; j++) {
+ *(locUUpto++) = *(locSourceUptoPtr++); //U for Ugly
+ *(locYUpto++) = *(locSourceUptoPtr++); //Y for Yellow
+
+ *(locVUpto++) = *(locSourceUptoPtr++); //V for Victor
+ *(locYUpto++) = *(locSourceUptoPtr++); //Y for Yellow
+
+ }
+
+
+ //***Drop line method
+ for (int j = 0; j < mWidth / 2; j++) {
+ //Ignore the second line
+
+ locSourceUptoPtr++; //U for ugly
+ *(locYUpto++) = *(locSourceUptoPtr++); //Y for yellow
+
+ locSourceUptoPtr++; //V for victor
+ *(locYUpto++) = *(locSourceUptoPtr++); //Y for yellow
+
+ }
+
+
+ }
+ return 0;
+}
+
+
+
+//PURE VIRTUALS
+long TheoraEncodeInputPin::TransformData(unsigned char* inBuf, long inNumBytes) {
+
+ //TODO::: Break this function up a bit !!
+
+ //Time stamps are granule pos not directshow times
+ //debugLog<<"Encode data"<<endl;
+ LONGLONG locFrameStart = mUptoFrame;
+ LONGLONG locFrameEnd = 0;
+ HRESULT locHR = S_OK;
+ if (!mBegun) {
+ //debugLog<<"encodeData : First time"<<endl;
+ mBegun = true;
+
+ StampedOggPacket** locHeaders;
+ locHeaders = mTheoraEncoder.initCodec(mTheoraInfo);
+
+ for (int i = 0; i < 3; i++) {
+ locHR = deliverData(0,0,locHeaders[i]->packetData(), locHeaders[i]->packetSize());
+ if (locHR != S_OK) {
+ return locHR;
+ }
+ }
+ }
+
+ if (mPinInputType.subtype == MEDIASUBTYPE_YUY2) {
+ //debugLog<<"About to encode YUY2 to YV12"<<endl;
+ encodeYUY2ToYV12(inBuf, inNumBytes);
+ } else if (mPinInputType.subtype == MEDIASUBTYPE_AYUV) {
+ encodeAYUVtoYV12(inBuf, inNumBytes);
+
+ } else if (mPinInputType.subtype == MEDIASUBTYPE_RGB32) {
+ encodeRGB32toYV12(inBuf, inNumBytes);
+
+ } else if (mPinInputType.subtype == MEDIASUBTYPE_RGB24) {
+ encodeRGB24toYV12(inBuf, inNumBytes);
+
+
+ } else if (mPinInputType.subtype == MEDIASUBTYPE_YV12) {
+ //Should be more specifc.
+ //debugLog<<"About to encode YV12 to YV12"<<endl;
+ encodeYV12ToYV12(inBuf, inNumBytes);
+ } else if (mPinInputType.subtype == MEDIASUBTYPE_UYVY) {
+
+
+ encodeUYVYToYV12(inBuf, inNumBytes);
+
+ } else if (mPinInputType.subtype == MEDIASUBTYPE_YVYU) {
+
+
+ encodeYVYUToYV12(inBuf, inNumBytes);
+ } else if (mPinInputType.subtype == MEDIASUBTYPE_IYUV) {
+
+
+ encodeIYUVToYV12(inBuf, inNumBytes);
+
+
+ } else {
+
+ //FATAL ERROR
+ throw 0;
+ }
+
+
+ StampedOggPacket* locPacket = mTheoraEncoder.encodeTheora(&mYUV);
+ if (locPacket == NULL) {
+ //debugLog<<"Encode returns NULL"<<endl;
+ return S_FALSE;
+ }
+ locFrameEnd = mUptoFrame
+ = locPacket->endTime();
+ //debugLog<<"Delivering..."<<endl;
+ return deliverData(locFrameStart, locFrameEnd, locPacket->packetData(), locPacket->packetSize());
+
+}
+bool TheoraEncodeInputPin::ConstructCodec() {
+
+ //debugLog<<"Contructing codec..."<<endl;
theora_info_init(&mTheoraInfo);
//Round up to multiple of 16 for theora
@@ -1297,59 +1297,59 @@
mTheoraInfo.keyframe_data_target_bitrate=mTheoraInfo.target_bitrate*1.5;
mTheoraInfo.keyframe_auto_threshold=80;
mTheoraInfo.keyframe_mindistance=8;
- mTheoraInfo.noise_sensitivity=1;
-
- ((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.frameRateNumerator = mTheoraInfo.fps_numerator;
- ((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.frameRateDenominator = mTheoraInfo.fps_denominator;
- ((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.maxKeyframeInterval = 6; //log2(keyframe_freq) from above
- ((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.frameHeight = mHeight;
- ((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.frameWidth = mWidth;
- ((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.colourSpace = OC_CS_UNSPECIFIED;
- ((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.height = mTheoraInfo.height;
- ((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.width = mTheoraInfo.width;
- ((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.xOffset = mXOffset;
- ((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.yOffset = mYOffset;
- ((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.aspectDenominator = 0;
- ((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.aspectNumerator = 0;
-
- return true;
-
-}
-void TheoraEncodeInputPin::DestroyCodec() {
- //fish_sound_delete(mFishSound);
- //mFishSound = NULL;
-}
-
-
-
-HRESULT TheoraEncodeInputPin::SetMediaType(const CMediaType* inMediaType) {
- //AbstractVideoEncodeInputPin::SetMediaType(inMediaType);
-
- if ( inMediaType->subtype == MEDIASUBTYPE_YV12 ||
- inMediaType->subtype == MEDIASUBTYPE_IYUV ||
- inMediaType->subtype == MEDIASUBTYPE_YUY2 ||
- inMediaType->subtype == MEDIASUBTYPE_UYVY ||
- inMediaType->subtype == MEDIASUBTYPE_YVYU ||
- inMediaType->subtype == MEDIASUBTYPE_AYUV ||
- inMediaType->subtype == MEDIASUBTYPE_RGB32 ||
- inMediaType->subtype == MEDIASUBTYPE_RGB24
- ) {
- mVideoFormat = (VIDEOINFOHEADER*)inMediaType->pbFormat;
- mPinInputType = *inMediaType;
- //mParentFilter->mAudioFormat = AbstractAudioDecodeFilter::VORBIS;
- } else {
- //Failed... should never be here !
- throw 0;
- }
- ConstructCodec();
- return CBaseInputPin::SetMediaType(inMediaType);
-
-
-
- return S_OK;
-
-}
-
-theora_info* TheoraEncodeInputPin::theoraInfo() {
- return &mTheoraInfo;
+ mTheoraInfo.noise_sensitivity=1;
+
+ ((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.frameRateNumerator = mTheoraInfo.fps_numerator;
+ ((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.frameRateDenominator = mTheoraInfo.fps_denominator;
+ ((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.maxKeyframeInterval = 6; //log2(keyframe_freq) from above
+ ((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.frameHeight = mHeight;
+ ((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.frameWidth = mWidth;
+ ((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.colourSpace = OC_CS_UNSPECIFIED;
+ ((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.height = mTheoraInfo.height;
+ ((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.width = mTheoraInfo.width;
+ ((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.xOffset = mXOffset;
+ ((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.yOffset = mYOffset;
+ ((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.aspectDenominator = 0;
+ ((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock.aspectNumerator = 0;
+
+ return true;
+
+}
+void TheoraEncodeInputPin::DestroyCodec() {
+ //fish_sound_delete(mFishSound);
+ //mFishSound = NULL;
+}
+
+
+
+HRESULT TheoraEncodeInputPin::SetMediaType(const CMediaType* inMediaType) {
+ //AbstractVideoEncodeInputPin::SetMediaType(inMediaType);
+
+ if ( inMediaType->subtype == MEDIASUBTYPE_YV12 ||
+ inMediaType->subtype == MEDIASUBTYPE_IYUV ||
+ inMediaType->subtype == MEDIASUBTYPE_YUY2 ||
+ inMediaType->subtype == MEDIASUBTYPE_UYVY ||
+ inMediaType->subtype == MEDIASUBTYPE_YVYU ||
+ inMediaType->subtype == MEDIASUBTYPE_AYUV ||
+ inMediaType->subtype == MEDIASUBTYPE_RGB32 ||
+ inMediaType->subtype == MEDIASUBTYPE_RGB24
+ ) {
+ mVideoFormat = (VIDEOINFOHEADER*)inMediaType->pbFormat;
+ mPinInputType = *inMediaType;
+ //mParentFilter->mAudioFormat = AbstractAudioDecodeFilter::VORBIS;
+ } else {
+ //Failed... should never be here !
+ throw 0;
+ }
+ ConstructCodec();
+ return CBaseInputPin::SetMediaType(inMediaType);
+
+
+
+ return S_OK;
+
+}
+
+theora_info* TheoraEncodeInputPin::theoraInfo() {
+ return &mTheoraInfo;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,115 +1,115 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "theoraencoderdllstuff.h"
-#include "TheoraEncoder.h"
-
-extern "C" {
-#include "theora_cdecl.h"
-}
-
-
-//Mmmmm macrolicious !
-//#define INT_FLOOR(num,scale) (num - (num % scale))
-#define CLIP3(x,y,z) ((z < x) ? x : ((z > y) ? y : z))
-//
-
-//DEBUG ONLY
-#include <fstream>
-using namespace std;
-//
-
-class TheoraEncodeOutputPin;
-class TheoraEncodeInputPin
- : public AbstractTransformInputPin
-{
-public:
- TheoraEncodeInputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes);
- virtual ~TheoraEncodeInputPin(void);
-
-
-
- virtual HRESULT SetMediaType(const CMediaType* inMediaType);
- //
-
- theora_info* theoraInfo();
-
-protected:
-
- //PURE VIRTUALS
- virtual long TransformData(unsigned char* inBuf, long inNumBytes);
- virtual bool ConstructCodec();
- virtual void DestroyCodec();
-
- HRESULT mHR;
- //bool mBegun; //Already in base class !
-
- HRESULT deliverData(LONGLONG inStart, LONGLONG inEnd, unsigned char* inBuf, unsigned long inNumBytes);
-
- long encodeYV12ToYV12(unsigned char* inBuf, long inNumBytes);
- long encodeYUY2ToYV12(unsigned char* inBuf, long inNumBytes);
- long encodeAYUVtoYV12(unsigned char* inBuf, long inNumBytes);
- long encodeRGB24toYV12(unsigned char* inBuf, long inNumBytes);
- long encodeRGB32toYV12(unsigned char* inBuf, long inNumBytes);
- long encodeUYVYToYV12(unsigned char* inBuf, long inNumBytes);
- long encodeYVYUToYV12(unsigned char* inBuf, long inNumBytes);
- long encodeIYUVToYV12(unsigned char* inBuf, long inNumBytes);
- //
-// bool fillTheoraInfo(theora_info* outTheora, sTheoraFormatBlock* inTheoraFormatBlock);
- //
- //TheoraEncodeOutputPin* mOutputPin; //Already in the base class. Naughty c++
- //__int64 mUptoFrame; //Already in base class stupid !
-
- TheoraEncoder mTheoraEncoder;
- theora_info mTheoraInfo;
- yuv_buffer mYUV;
-
- unsigned long mXOffset;
- unsigned long mYOffset;
-
- unsigned long mHeight;
- unsigned long mWidth;
-
- unsigned __int64 mUptoFrame;
-
- CMediaType mPinInputType;
- VIDEOINFOHEADER* mVideoFormat;
-
- bool mBegun;
-
-
- //DEBUG ONLY
- //fstream debugLog;
- //
-
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "theoraencoderdllstuff.h"
+#include "TheoraEncoder.h"
+
+extern "C" {
+#include "theora_cdecl.h"
+}
+
+
+//Mmmmm macrolicious !
+//#define INT_FLOOR(num,scale) (num - (num % scale))
+#define CLIP3(x,y,z) ((z < x) ? x : ((z > y) ? y : z))
+//
+
+//DEBUG ONLY
+#include <fstream>
+using namespace std;
+//
+
+class TheoraEncodeOutputPin;
+class TheoraEncodeInputPin
+ : public AbstractTransformInputPin
+{
+public:
+ TheoraEncodeInputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes);
+ virtual ~TheoraEncodeInputPin(void);
+
+
+
+ virtual HRESULT SetMediaType(const CMediaType* inMediaType);
+ //
+
+ theora_info* theoraInfo();
+
+protected:
+
+ //PURE VIRTUALS
+ virtual long TransformData(unsigned char* inBuf, long inNumBytes);
+ virtual bool ConstructCodec();
+ virtual void DestroyCodec();
+
+ HRESULT mHR;
+ //bool mBegun; //Already in base class !
+
+ HRESULT deliverData(LONGLONG inStart, LONGLONG inEnd, unsigned char* inBuf, unsigned long inNumBytes);
+
+ long encodeYV12ToYV12(unsigned char* inBuf, long inNumBytes);
+ long encodeYUY2ToYV12(unsigned char* inBuf, long inNumBytes);
+ long encodeAYUVtoYV12(unsigned char* inBuf, long inNumBytes);
+ long encodeRGB24toYV12(unsigned char* inBuf, long inNumBytes);
+ long encodeRGB32toYV12(unsigned char* inBuf, long inNumBytes);
+ long encodeUYVYToYV12(unsigned char* inBuf, long inNumBytes);
+ long encodeYVYUToYV12(unsigned char* inBuf, long inNumBytes);
+ long encodeIYUVToYV12(unsigned char* inBuf, long inNumBytes);
+ //
+// bool fillTheoraInfo(theora_info* outTheora, sTheoraFormatBlock* inTheoraFormatBlock);
+ //
+ //TheoraEncodeOutputPin* mOutputPin; //Already in the base class. Naughty c++
+ //__int64 mUptoFrame; //Already in base class stupid !
+
+ TheoraEncoder mTheoraEncoder;
+ theora_info mTheoraInfo;
+ yuv_buffer mYUV;
+
+ unsigned long mXOffset;
+ unsigned long mYOffset;
+
+ unsigned long mHeight;
+ unsigned long mWidth;
+
+ unsigned __int64 mUptoFrame;
+
+ CMediaType mPinInputType;
+ VIDEOINFOHEADER* mVideoFormat;
+
+ bool mBegun;
+
+
+ //DEBUG ONLY
+ //fstream debugLog;
+ //
+
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeInputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeOutputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeOutputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeOutputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,64 +1,64 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "theoraencodeoutputpin.h"
-
-TheoraEncodeOutputPin::TheoraEncodeOutputPin(TheoraEncodeFilter* inParentFilter,CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes)
- : AbstractTransformOutputPin(inParentFilter, inFilterLock,NAME("TheoraEncodeOutputPin"), L"Theora Out", 1024*1024, 3, inAcceptableMediaTypes)
-{
-}
-
-TheoraEncodeOutputPin::~TheoraEncodeOutputPin(void)
-{
-}
-
-//bool TheoraEncodeOutputPin::FillFormatBuffer(BYTE* inFormatBuffer) {
-// TheoraEncodeFilter* locParentFilter = (TheoraEncodeFilter*)mParentFilter;
-// memcpy((void*)inFormatBuffer, (const void*) &(locParentFilter->mTheoraFormatBlock), sizeof(sTheoraFormatBlock));
-// return true;
-//}
-//unsigned long TheoraEncodeOutputPin::FormatBufferSize() {
-// return sizeof(sTheoraFormatBlock);
-//}
-
-HRESULT TheoraEncodeOutputPin::CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition)
-{
- if (inPosition == 0) {
- sTheoraFormatBlock* locTheoraFormat = (sTheoraFormatBlock*)outMediaType->AllocFormatBuffer(sizeof(sTheoraFormatBlock));
- //TODO::: Check for null ?
-
- memcpy((void*)locTheoraFormat, (const void*) &(((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock), sizeof(sTheoraFormatBlock));
- return S_OK;
- } else {
- return S_FALSE;
- }
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "theoraencodeoutputpin.h"
+
+TheoraEncodeOutputPin::TheoraEncodeOutputPin(TheoraEncodeFilter* inParentFilter,CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes)
+ : AbstractTransformOutputPin(inParentFilter, inFilterLock,NAME("TheoraEncodeOutputPin"), L"Theora Out", 1024*1024, 3, inAcceptableMediaTypes)
+{
+}
+
+TheoraEncodeOutputPin::~TheoraEncodeOutputPin(void)
+{
+}
+
+//bool TheoraEncodeOutputPin::FillFormatBuffer(BYTE* inFormatBuffer) {
+// TheoraEncodeFilter* locParentFilter = (TheoraEncodeFilter*)mParentFilter;
+// memcpy((void*)inFormatBuffer, (const void*) &(locParentFilter->mTheoraFormatBlock), sizeof(sTheoraFormatBlock));
+// return true;
+//}
+//unsigned long TheoraEncodeOutputPin::FormatBufferSize() {
+// return sizeof(sTheoraFormatBlock);
+//}
+
+HRESULT TheoraEncodeOutputPin::CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition)
+{
+ if (inPosition == 0) {
+ sTheoraFormatBlock* locTheoraFormat = (sTheoraFormatBlock*)outMediaType->AllocFormatBuffer(sizeof(sTheoraFormatBlock));
+ //TODO::: Check for null ?
+
+ memcpy((void*)locTheoraFormat, (const void*) &(((TheoraEncodeFilter*)mParentFilter)->mTheoraFormatBlock), sizeof(sTheoraFormatBlock));
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeOutputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeOutputPin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeOutputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeOutputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,59 +1,59 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-#include "theoraencoderdllstuff.h"
-
-
-class TheoraEncodeFilter;
-struct sTheoraFormatBlock;
-
-class TheoraEncodeOutputPin
- : public AbstractTransformOutputPin
-{
-public:
-
- friend class TheoraEncodeInputPin;
-
- TheoraEncodeOutputPin(TheoraEncodeFilter* inParentFilter, CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes);
- virtual ~TheoraEncodeOutputPin(void);
-
- //PURE VIRTUAL IMPLEMENTATION
- //virtual bool FillFormatBuffer(BYTE* inFormatBuffer);
- //virtual unsigned long FormatBufferSize();
-
-
-protected:
- HRESULT CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition);
-
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+#include "theoraencoderdllstuff.h"
+
+
+class TheoraEncodeFilter;
+struct sTheoraFormatBlock;
+
+class TheoraEncodeOutputPin
+ : public AbstractTransformOutputPin
+{
+public:
+
+ friend class TheoraEncodeInputPin;
+
+ TheoraEncodeOutputPin(TheoraEncodeFilter* inParentFilter, CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes);
+ virtual ~TheoraEncodeOutputPin(void);
+
+ //PURE VIRTUAL IMPLEMENTATION
+ //virtual bool FillFormatBuffer(BYTE* inFormatBuffer);
+ //virtual unsigned long FormatBufferSize();
+
+
+protected:
+ HRESULT CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition);
+
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/TheoraEncodeOutputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/dsfTheoraEncoder.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/dsfTheoraEncoder.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/dsfTheoraEncoder.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,12 +1,12 @@
-// dsfTheoraEncoder.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- return TRUE;
-}
-
+// dsfTheoraEncoder.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ return TRUE;
+}
+
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/dsfTheoraEncoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/resource.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/resource.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/resource.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,27 +1,27 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by dsfTheoraEncoder.rc
-//
-#define IDD_THEORA_ENCODE_SETTINGS 102
-#define IDS_THEORA_ENC_PROPS_STRING 103
-#define IDC_GROUP_QUALITY 1005
-#define IDC_SLIDER_QUALITY 1006
-#define IDC_GROUP_LOG_KEYFRAME 1014
-#define IDC_SLIDER_LOG_KEYFRAME 1015
-#define IDC_GROUP_BITRATE 1016
-#define IDC_SLIDER_BITRATE 1017
-#define IDC_LABEL_BITRATE 1019
-#define IDC_LABEL_LOG_KEYFRAME 1020
-#define IDC_LABEL_BITRATE3 1021
-#define IDC_LABEL_QUALITY 1021
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 104
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1020
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by dsfTheoraEncoder.rc
+//
+#define IDD_THEORA_ENCODE_SETTINGS 102
+#define IDS_THEORA_ENC_PROPS_STRING 103
+#define IDC_GROUP_QUALITY 1005
+#define IDC_SLIDER_QUALITY 1006
+#define IDC_GROUP_LOG_KEYFRAME 1014
+#define IDC_SLIDER_LOG_KEYFRAME 1015
+#define IDC_GROUP_BITRATE 1016
+#define IDC_SLIDER_BITRATE 1017
+#define IDC_LABEL_BITRATE 1019
+#define IDC_LABEL_LOG_KEYFRAME 1020
+#define IDC_LABEL_BITRATE3 1021
+#define IDC_LABEL_QUALITY 1021
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 104
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1020
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/resource.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// dsfTheoraEncoder.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// dsfTheoraEncoder.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,19 +1,19 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-// TODO: reference additional headers your program requires here
-#include "theoraencoderdllstuff.h"
-#include "AbstractTransformFilter.h"
-#include "AbstractTransformInputPin.h"
-#include "AbstractTransformOutputPin.h"
-#include "TheoraEncodeInputPin.h"
-#include "TheoraEncodeOutputPin.h"
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+// TODO: reference additional headers your program requires here
+#include "theoraencoderdllstuff.h"
+#include "AbstractTransformFilter.h"
+#include "AbstractTransformInputPin.h"
+#include "AbstractTransformOutputPin.h"
+#include "TheoraEncodeInputPin.h"
+#include "TheoraEncodeOutputPin.h"
#include "TheoraEncodeFilter.h"
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/theoraencoderdllstuff.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/theoraencoderdllstuff.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/theoraencoderdllstuff.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,100 +1,100 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-
-#include "theoraencoderdllstuff.h"
-
-extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
-BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
-{
- return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
-}
-
-
-//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
-STDAPI DllRegisterServer()
-{
-
- //TO DO::: Should we be releasing the filter mapper even when we return early ?
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(TRUE);
-
-
-
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
-
-
- hr = locFilterMapper->RegisterFilter(
- CLSID_TheoraEncodeFilter, // Filter CLSID.
- L"Theora Encode Filter", // Filter name.
- NULL, // Device moniker.
- &CLSID_LegacyAmFilterCategory, // Direct Show general category
- L"Theora Encode Filter", // Instance data. ???????
- &TheoraEncodeFilterReg // Pointer to filter information.
- );
-
- locFilterMapper->Release();
-
- return hr;
-
-}
-
-STDAPI DllUnregisterServer()
-{
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(FALSE);
- if (FAILED(hr)) {
-
- return hr;
- }
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
- IID_IFilterMapper2, (void **)&locFilterMapper);
-
- if (FAILED(hr)) {
- return hr;
- }
-
-
- hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, L"Theora Encode Filter", CLSID_TheoraEncodeFilter);
-
-
- //
- locFilterMapper->Release();
- return hr;
-
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+
+#include "theoraencoderdllstuff.h"
+
+extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
+BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+ return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
+}
+
+
+//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
+STDAPI DllRegisterServer()
+{
+
+ //TO DO::: Should we be releasing the filter mapper even when we return early ?
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(TRUE);
+
+
+
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
+
+
+ hr = locFilterMapper->RegisterFilter(
+ CLSID_TheoraEncodeFilter, // Filter CLSID.
+ L"Theora Encode Filter", // Filter name.
+ NULL, // Device moniker.
+ &CLSID_LegacyAmFilterCategory, // Direct Show general category
+ L"Theora Encode Filter", // Instance data. ???????
+ &TheoraEncodeFilterReg // Pointer to filter information.
+ );
+
+ locFilterMapper->Release();
+
+ return hr;
+
+}
+
+STDAPI DllUnregisterServer()
+{
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(FALSE);
+ if (FAILED(hr)) {
+
+ return hr;
+ }
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
+ IID_IFilterMapper2, (void **)&locFilterMapper);
+
+ if (FAILED(hr)) {
+ return hr;
+ }
+
+
+ hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, L"Theora Encode Filter", CLSID_TheoraEncodeFilter);
+
+
+ //
+ locFilterMapper->Release();
+ return hr;
+
+}
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/theoraencoderdllstuff.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/theoraencoderdllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/theoraencoderdllstuff.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/theoraencoderdllstuff.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,132 +1,132 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-
-
-#include <streams.h>
-#include <pullpin.h>
-#include <initguid.h>
-
-
-
-#ifdef LIBOOOGG_EXPORTS
-#define LIBOOOGG_API __declspec(dllexport)
-#else
-#define LIBOOOGG_API __declspec(dllimport)
-#endif
-
-// {121EA765-6D3F-4519-9686-A0BA6E5281A2}
-DEFINE_GUID(CLSID_PropsTheoraEncoder,
-0x121ea765, 0x6d3f, 0x4519, 0x96, 0x86, 0xa0, 0xba, 0x6e, 0x52, 0x81, 0xa2);
-
-// {4F063B3A-B397-4c22-AFF4-2F8DB96D292A}
-DEFINE_GUID(IID_ITheoraEncodeSettings,
-0x4f063b3a, 0xb397, 0x4c22, 0xaf, 0xf4, 0x2f, 0x8d, 0xb9, 0x6d, 0x29, 0x2a);
-
-// {5C769985-C3E1-4f95-BEE7-1101C465F5FC}
-DEFINE_GUID(CLSID_TheoraEncodeFilter,
-0x5c769985, 0xc3e1, 0x4f95, 0xbe, 0xe7, 0x11, 0x1, 0xc4, 0x65, 0xf5, 0xfc);
-
-// {D124B2B1-8968-4ae8-B288-FE16EA34B0CE}
-DEFINE_GUID(MEDIASUBTYPE_Theora,
-0xd124b2b1, 0x8968, 0x4ae8, 0xb2, 0x88, 0xfe, 0x16, 0xea, 0x34, 0xb0, 0xce);
-
-// {A99F116C-DFFA-412c-95DE-725F99874826}
-DEFINE_GUID(FORMAT_Theora,
-0xa99f116c, 0xdffa, 0x412c, 0x95, 0xde, 0x72, 0x5f, 0x99, 0x87, 0x48, 0x26);
-
-const REGPINTYPES TheoraEncodeInputTypes = {
- &MEDIATYPE_Video,
- &MEDIASUBTYPE_YV12
-};
-
-const REGPINTYPES TheoraEncodeOutputTypes = {
- &MEDIATYPE_Video,
- &MEDIASUBTYPE_Theora
-};
-
-const REGFILTERPINS TheoraEncodePinReg[] = {
- {
- L"YV12 Input", //Name (obsoleted)
- FALSE, //Renders from this pin ?? Not sure about this.
- FALSE, //Not an output pin
- FALSE, //Cannot have zero instances of this pin
- FALSE, //Cannot have more than one instance of this pin
- NULL, //Connects to filter (obsoleted)
- NULL, //Connects to pin (obsoleted)
- 1, //upport two media type
- &TheoraEncodeInputTypes //Pointer to media type (Video/VY12)
- } ,
-
- {
- L"Theora Output", //Name (obsoleted)
- FALSE, //Renders from this pin ?? Not sure about this.
- TRUE, //Is an output pin
- FALSE, //Cannot have zero instances of this pin
- FALSE, //Cannot have more than one instance of this pin
- NULL, //Connects to filter (obsoleted)
- NULL, //Connects to pin (obsoleted)
- 1, //Only support one media type
- &TheoraEncodeOutputTypes //Pointer to media type (Audio/PCM)
-
- }
-};
-
-
-
-const REGFILTER2 TheoraEncodeFilterReg = {
- 1,
- MERIT_DO_NOT_USE,
- 2,
- TheoraEncodePinReg
-
-};
-
-struct sTheoraFormatBlock {
- unsigned long theoraVersion;
- unsigned long width;
- unsigned long height;
- unsigned long frameWidth;
- unsigned long frameHeight;
- unsigned long frameRateNumerator;
- unsigned long frameRateDenominator;
- unsigned long aspectNumerator;
- unsigned long aspectDenominator;
- unsigned long maxKeyframeInterval;
- unsigned long targetBitrate;
- unsigned char targetQuality;
- unsigned char xOffset;
- unsigned char yOffset;
- unsigned char colourSpace;
-};
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+
+
+#include <streams.h>
+#include <pullpin.h>
+#include <initguid.h>
+
+
+
+#ifdef LIBOOOGG_EXPORTS
+#define LIBOOOGG_API __declspec(dllexport)
+#else
+#define LIBOOOGG_API __declspec(dllimport)
+#endif
+
+// {121EA765-6D3F-4519-9686-A0BA6E5281A2}
+DEFINE_GUID(CLSID_PropsTheoraEncoder,
+0x121ea765, 0x6d3f, 0x4519, 0x96, 0x86, 0xa0, 0xba, 0x6e, 0x52, 0x81, 0xa2);
+
+// {4F063B3A-B397-4c22-AFF4-2F8DB96D292A}
+DEFINE_GUID(IID_ITheoraEncodeSettings,
+0x4f063b3a, 0xb397, 0x4c22, 0xaf, 0xf4, 0x2f, 0x8d, 0xb9, 0x6d, 0x29, 0x2a);
+
+// {5C769985-C3E1-4f95-BEE7-1101C465F5FC}
+DEFINE_GUID(CLSID_TheoraEncodeFilter,
+0x5c769985, 0xc3e1, 0x4f95, 0xbe, 0xe7, 0x11, 0x1, 0xc4, 0x65, 0xf5, 0xfc);
+
+// {D124B2B1-8968-4ae8-B288-FE16EA34B0CE}
+DEFINE_GUID(MEDIASUBTYPE_Theora,
+0xd124b2b1, 0x8968, 0x4ae8, 0xb2, 0x88, 0xfe, 0x16, 0xea, 0x34, 0xb0, 0xce);
+
+// {A99F116C-DFFA-412c-95DE-725F99874826}
+DEFINE_GUID(FORMAT_Theora,
+0xa99f116c, 0xdffa, 0x412c, 0x95, 0xde, 0x72, 0x5f, 0x99, 0x87, 0x48, 0x26);
+
+const REGPINTYPES TheoraEncodeInputTypes = {
+ &MEDIATYPE_Video,
+ &MEDIASUBTYPE_YV12
+};
+
+const REGPINTYPES TheoraEncodeOutputTypes = {
+ &MEDIATYPE_Video,
+ &MEDIASUBTYPE_Theora
+};
+
+const REGFILTERPINS TheoraEncodePinReg[] = {
+ {
+ L"YV12 Input", //Name (obsoleted)
+ FALSE, //Renders from this pin ?? Not sure about this.
+ FALSE, //Not an output pin
+ FALSE, //Cannot have zero instances of this pin
+ FALSE, //Cannot have more than one instance of this pin
+ NULL, //Connects to filter (obsoleted)
+ NULL, //Connects to pin (obsoleted)
+ 1, //upport two media type
+ &TheoraEncodeInputTypes //Pointer to media type (Video/VY12)
+ } ,
+
+ {
+ L"Theora Output", //Name (obsoleted)
+ FALSE, //Renders from this pin ?? Not sure about this.
+ TRUE, //Is an output pin
+ FALSE, //Cannot have zero instances of this pin
+ FALSE, //Cannot have more than one instance of this pin
+ NULL, //Connects to filter (obsoleted)
+ NULL, //Connects to pin (obsoleted)
+ 1, //Only support one media type
+ &TheoraEncodeOutputTypes //Pointer to media type (Audio/PCM)
+
+ }
+};
+
+
+
+const REGFILTER2 TheoraEncodeFilterReg = {
+ 1,
+ MERIT_DO_NOT_USE,
+ 2,
+ TheoraEncodePinReg
+
+};
+
+struct sTheoraFormatBlock {
+ unsigned long theoraVersion;
+ unsigned long width;
+ unsigned long height;
+ unsigned long frameWidth;
+ unsigned long frameHeight;
+ unsigned long frameRateNumerator;
+ unsigned long frameRateDenominator;
+ unsigned long aspectNumerator;
+ unsigned long aspectDenominator;
+ unsigned long maxKeyframeInterval;
+ unsigned long targetBitrate;
+ unsigned char targetQuality;
+ unsigned char xOffset;
+ unsigned char yOffset;
+ unsigned char colourSpace;
+};
+
Property changes on: trunk/oggdsf/src/lib/codecs/theora/filters/dsfTheoraEncoder/theoraencoderdllstuff.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/TheoraDecoder.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/TheoraDecoder.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/TheoraDecoder.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,108 +1,108 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "theoradecoder.h"
-
-TheoraDecoder::TheoraDecoder(void)
-: mFirstPacket(true)
-, mFirstHeader(true)
-, mPacketCount(0)
-{
-}
-
-TheoraDecoder::~TheoraDecoder(void)
-{
-}
-
-bool TheoraDecoder::initCodec() {
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "theoradecoder.h"
+
+TheoraDecoder::TheoraDecoder(void)
+: mFirstPacket(true)
+, mFirstHeader(true)
+, mPacketCount(0)
+{
+}
+
+TheoraDecoder::~TheoraDecoder(void)
+{
+}
+
+bool TheoraDecoder::initCodec() {
theora_comment_init(&mTheoraComment);
theora_info_init(&mTheoraInfo);
return true;
- }
-
-//This is temporary... get it out of here after testing
-
-yuv_buffer* TheoraDecoder::decodeTheora(StampedOggPacket* inPacket) { //Accepts packet and deletes it.
-
- if (mPacketCount < 3) {
- decodeHeader(inPacket); //Accepts header and deletes it.
-
- return NULL;
- } else {
- if (mFirstPacket) {
- theora_decode_init(&mTheoraState, &mTheoraInfo);
- mFirstPacket = false;
- }
- ogg_packet* locOldPack = simulateOldOggPacket(inPacket); //Accepts the packet and deletes it.
- theora_decode_packetin(&mTheoraState, locOldPack);
- delete locOldPack->packet;
- delete locOldPack;
-
- int locRetVal = theora_decode_YUVout(&mTheoraState, &mYUVBuffer);
- //Error check
- return &mYUVBuffer;
- }
-
-}
-
-ogg_packet* TheoraDecoder::simulateOldOggPacket(StampedOggPacket* inPacket) { //inPacket is accepted and deleted.
- const unsigned char NOT_USED = 0;
- ogg_packet* locOldPacket = new ogg_packet; //Returns this... the caller is responsible for it.
- if (mFirstHeader) {
- locOldPacket->b_o_s = 1;
- mFirstHeader = false;
- } else {
- locOldPacket->b_o_s = NOT_USED;
- }
- locOldPacket->e_o_s = NOT_USED;
- locOldPacket->bytes = inPacket->packetSize();
- locOldPacket->granulepos = inPacket->endTime();
- locOldPacket->packet = inPacket->packetData();
- locOldPacket->packetno = NOT_USED;
-
- //Set this to NULL do it doesn't get deleted by the destructor we are about invoke.
- inPacket->setPacketData(NULL);
- delete inPacket;
-
- return locOldPacket; //Gives a poitner to the caller.
-}
-bool TheoraDecoder::decodeHeader(StampedOggPacket* inHeaderPacket) { //inHeaderPacket is accepted and deleted.
-
- ogg_packet* locOldPack = simulateOldOggPacket(inHeaderPacket); //Accepts packet and deletes it.
- theora_decode_header(&mTheoraInfo, &mTheoraComment, locOldPack);
-
- delete locOldPack->packet;
- delete locOldPack;
- mPacketCount++;
- return true;
+ }
+
+//This is temporary... get it out of here after testing
+
+yuv_buffer* TheoraDecoder::decodeTheora(StampedOggPacket* inPacket) { //Accepts packet and deletes it.
+
+ if (mPacketCount < 3) {
+ decodeHeader(inPacket); //Accepts header and deletes it.
+
+ return NULL;
+ } else {
+ if (mFirstPacket) {
+ theora_decode_init(&mTheoraState, &mTheoraInfo);
+ mFirstPacket = false;
+ }
+ ogg_packet* locOldPack = simulateOldOggPacket(inPacket); //Accepts the packet and deletes it.
+ theora_decode_packetin(&mTheoraState, locOldPack);
+ delete locOldPack->packet;
+ delete locOldPack;
+
+ int locRetVal = theora_decode_YUVout(&mTheoraState, &mYUVBuffer);
+ //Error check
+ return &mYUVBuffer;
+ }
+
+}
+
+ogg_packet* TheoraDecoder::simulateOldOggPacket(StampedOggPacket* inPacket) { //inPacket is accepted and deleted.
+ const unsigned char NOT_USED = 0;
+ ogg_packet* locOldPacket = new ogg_packet; //Returns this... the caller is responsible for it.
+ if (mFirstHeader) {
+ locOldPacket->b_o_s = 1;
+ mFirstHeader = false;
+ } else {
+ locOldPacket->b_o_s = NOT_USED;
+ }
+ locOldPacket->e_o_s = NOT_USED;
+ locOldPacket->bytes = inPacket->packetSize();
+ locOldPacket->granulepos = inPacket->endTime();
+ locOldPacket->packet = inPacket->packetData();
+ locOldPacket->packetno = NOT_USED;
+
+ //Set this to NULL do it doesn't get deleted by the destructor we are about invoke.
+ inPacket->setPacketData(NULL);
+ delete inPacket;
+
+ return locOldPacket; //Gives a poitner to the caller.
+}
+bool TheoraDecoder::decodeHeader(StampedOggPacket* inHeaderPacket) { //inHeaderPacket is accepted and deleted.
+
+ ogg_packet* locOldPack = simulateOldOggPacket(inHeaderPacket); //Accepts packet and deletes it.
+ theora_decode_header(&mTheoraInfo, &mTheoraComment, locOldPack);
+
+ delete locOldPack->packet;
+ delete locOldPack;
+ mPacketCount++;
+ return true;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/TheoraDecoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/TheoraDecoder.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/TheoraDecoder.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/TheoraDecoder.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,69 +1,69 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "libootheora.h"
-#include "dllstuff.h"
-#include "StampedOggPacket.h"
-extern "C" {
-#include "theora_cdecl.h"
-}
-class LIBOOTHEORA_API TheoraDecoder
-{
-public:
- TheoraDecoder(void);
- ~TheoraDecoder(void);
-
- bool initCodec();
- //bool resetPackCount();
- //bool clearAll();
- yuv_buffer* decodeTheora(StampedOggPacket* inPacket);
- bool decodeHeader(StampedOggPacket* inHeaderPacket);
-
- ogg_packet* simulateOldOggPacket(StampedOggPacket* inPacket);
-
-
-
- unsigned char* convertYUV(yuv_buffer* inBuffer, unsigned long inFormat);
- theora_info mTheoraInfo;
-protected:
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "libootheora.h"
+#include "dllstuff.h"
+#include "StampedOggPacket.h"
+extern "C" {
+#include "theora_cdecl.h"
+}
+class LIBOOTHEORA_API TheoraDecoder
+{
+public:
+ TheoraDecoder(void);
+ ~TheoraDecoder(void);
+
+ bool initCodec();
+ //bool resetPackCount();
+ //bool clearAll();
+ yuv_buffer* decodeTheora(StampedOggPacket* inPacket);
+ bool decodeHeader(StampedOggPacket* inHeaderPacket);
+
+ ogg_packet* simulateOldOggPacket(StampedOggPacket* inPacket);
+
+
+
+ unsigned char* convertYUV(yuv_buffer* inBuffer, unsigned long inFormat);
+ theora_info mTheoraInfo;
+protected:
//theora_info mTheoraInfo;
theora_comment mTheoraComment;
- theora_state mTheoraState;
- yuv_buffer mYUVBuffer;
-
- StampedOggPacket* mPartialPacket; //TEMP !!
- unsigned long mHeadersSeen;
- bool mFirstPacket;
- bool mFirstHeader;
- unsigned long mPacketCount;
-
-};
+ theora_state mTheoraState;
+ yuv_buffer mYUVBuffer;
+
+ StampedOggPacket* mPartialPacket; //TEMP !!
+ unsigned long mHeadersSeen;
+ bool mFirstPacket;
+ bool mFirstHeader;
+ unsigned long mPacketCount;
+
+};
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/TheoraDecoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/TheoraEncoder.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/TheoraEncoder.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/TheoraEncoder.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,53 +1,53 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "theoraencoder.h"
-
-TheoraEncoder::TheoraEncoder(void)
-{
-}
-
-TheoraEncoder::~TheoraEncoder(void)
-{
-}
-
-//Not happy about exposing this here... should abstract it later.
-StampedOggPacket** TheoraEncoder::initCodec(theora_info inTheoraInfo) {
- mTheoraInfo = inTheoraInfo;
- theora_encode_init(&mTheoraState,&mTheoraInfo);
-
- StampedOggPacket** locHeaders = new StampedOggPacket*[3];
-
- ogg_packet locOldPacket;
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "theoraencoder.h"
+
+TheoraEncoder::TheoraEncoder(void)
+{
+}
+
+TheoraEncoder::~TheoraEncoder(void)
+{
+}
+
+//Not happy about exposing this here... should abstract it later.
+StampedOggPacket** TheoraEncoder::initCodec(theora_info inTheoraInfo) {
+ mTheoraInfo = inTheoraInfo;
+ theora_encode_init(&mTheoraState,&mTheoraInfo);
+
+ StampedOggPacket** locHeaders = new StampedOggPacket*[3];
+
+ ogg_packet locOldPacket;
theora_encode_header(&mTheoraState, &locOldPacket);
locHeaders[0] = oldToNewPacket(&locOldPacket);
@@ -58,42 +58,42 @@
locHeaders[1] = oldToNewPacket(&locOldPacket);
theora_encode_tables(&mTheoraState, &locOldPacket);
-
- locHeaders[2] = oldToNewPacket(&locOldPacket);
-
- return locHeaders;
-}
-
-
-
-//ogg_packet* TheoraDecoder::simulateOldOggPacket(StampedOggPacket* inPacket) {
-// const unsigned char NOT_USED = 0;
-// ogg_packet* locOldPacket = new ogg_packet;
-// if (mFirstHeader) {
-// locOldPacket->b_o_s = 1;
-// mFirstHeader = false;
-// } else {
-// locOldPacket->b_o_s = NOT_USED;
-// }
-// locOldPacket->e_o_s = NOT_USED;
-// locOldPacket->bytes = inPacket->packetSize();
-// locOldPacket->granulepos = inPacket->endTime();
-// locOldPacket->packet = inPacket->packetData();
-// locOldPacket->packetno = NOT_USED;
-// return locOldPacket;
-//}
-
-StampedOggPacket* TheoraEncoder::oldToNewPacket(ogg_packet* inOldPacket) {
- const unsigned char NOT_USED = 0;
-
- //Need to clone the packet data
- unsigned char* locBuff = new unsigned char[inOldPacket->bytes];
- memcpy((void*)locBuff, (const void*)inOldPacket->packet, inOldPacket->bytes);
- //Not truncated or continued... it's a full packet.
- StampedOggPacket* locOggPacket = new StampedOggPacket(locBuff, inOldPacket->bytes, false, false, NOT_USED, inOldPacket->granulepos, StampedOggPacket::OGG_END_ONLY);
- return locOggPacket;
-
-}
+
+ locHeaders[2] = oldToNewPacket(&locOldPacket);
+
+ return locHeaders;
+}
+
+
+
+//ogg_packet* TheoraDecoder::simulateOldOggPacket(StampedOggPacket* inPacket) {
+// const unsigned char NOT_USED = 0;
+// ogg_packet* locOldPacket = new ogg_packet;
+// if (mFirstHeader) {
+// locOldPacket->b_o_s = 1;
+// mFirstHeader = false;
+// } else {
+// locOldPacket->b_o_s = NOT_USED;
+// }
+// locOldPacket->e_o_s = NOT_USED;
+// locOldPacket->bytes = inPacket->packetSize();
+// locOldPacket->granulepos = inPacket->endTime();
+// locOldPacket->packet = inPacket->packetData();
+// locOldPacket->packetno = NOT_USED;
+// return locOldPacket;
+//}
+
+StampedOggPacket* TheoraEncoder::oldToNewPacket(ogg_packet* inOldPacket) {
+ const unsigned char NOT_USED = 0;
+
+ //Need to clone the packet data
+ unsigned char* locBuff = new unsigned char[inOldPacket->bytes];
+ memcpy((void*)locBuff, (const void*)inOldPacket->packet, inOldPacket->bytes);
+ //Not truncated or continued... it's a full packet.
+ StampedOggPacket* locOggPacket = new StampedOggPacket(locBuff, inOldPacket->bytes, false, false, NOT_USED, inOldPacket->granulepos, StampedOggPacket::OGG_END_ONLY);
+ return locOggPacket;
+
+}
StampedOggPacket* TheoraEncoder::encodeTheora(yuv_buffer* inYUVBuffer) {
const int NOT_LAST_FRAME = 0;
const int IS_LAST_FRAME = 1;
@@ -114,5 +114,5 @@
}
return oldToNewPacket(&locOldOggPacket);
-
-}
+
+}
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/TheoraEncoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/TheoraEncoder.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/TheoraEncoder.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/TheoraEncoder.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,73 +1,73 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "libootheora.h"
-#include "dllstuff.h"
-#include "StampedOggPacket.h"
-extern "C" {
-#include "theora_cdecl.h"
-}
-class LIBOOTHEORA_API TheoraEncoder
-{
-public:
- TheoraEncoder(void);
- ~TheoraEncoder(void);
-
-
-
- StampedOggPacket** initCodec(theora_info inTheoraInfo);
- //bool resetPackCount();
- //bool clearAll();
- StampedOggPacket* encodeTheora(yuv_buffer* inYUVBuffer);
-
-
- StampedOggPacket* oldToNewPacket(ogg_packet* inPacket);
-
-
-
- //unsigned char* convertYUV(yuv_buffer* inBuffer, unsigned long inFormat);
-protected:
- bool encodeHeader();
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "libootheora.h"
+#include "dllstuff.h"
+#include "StampedOggPacket.h"
+extern "C" {
+#include "theora_cdecl.h"
+}
+class LIBOOTHEORA_API TheoraEncoder
+{
+public:
+ TheoraEncoder(void);
+ ~TheoraEncoder(void);
+
+
+
+ StampedOggPacket** initCodec(theora_info inTheoraInfo);
+ //bool resetPackCount();
+ //bool clearAll();
+ StampedOggPacket* encodeTheora(yuv_buffer* inYUVBuffer);
+
+
+ StampedOggPacket* oldToNewPacket(ogg_packet* inPacket);
+
+
+
+ //unsigned char* convertYUV(yuv_buffer* inBuffer, unsigned long inFormat);
+protected:
+ bool encodeHeader();
+
theora_info mTheoraInfo;
theora_comment mTheoraComment;
- theora_state mTheoraState;
-
- yuv_buffer mYUVBuffer; //Needed ??
-
- StampedOggPacket* mPartialPacket; //TEMP !!
-
- unsigned long mHeadersSeen;
- bool mFirstPacket;
- bool mFirstHeader;
- unsigned long mPacketCount;
-};
+ theora_state mTheoraState;
+
+ yuv_buffer mYUVBuffer; //Needed ??
+
+ StampedOggPacket* mPartialPacket; //TEMP !!
+
+ unsigned long mHeadersSeen;
+ bool mFirstPacket;
+ bool mFirstHeader;
+ unsigned long mPacketCount;
+};
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/TheoraEncoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/libOOTheora.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/libOOTheora.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/libOOTheora.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,52 +1,52 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// libOOTheora.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-#include "libOOTheora.h"
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
-}
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// libOOTheora.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+#include "libOOTheora.h"
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ switch (ul_reason_for_call)
+ {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
+}
+
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/libOOTheora.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/libOOTheora.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/libOOTheora.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/libOOTheora.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,43 +1,43 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// The following ifdef block is the standard way of creating macros which make exporting
-// from a DLL simpler. All files within this DLL are compiled with the LIBOOTHEORA_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see
-// LIBOOTHEORA_API functions as being imported from a DLL, whereas this DLL sees symbols
-// defined with this macro as being exported.
-#ifdef LIBOOTHEORA_EXPORTS
-#define LIBOOTHEORA_API __declspec(dllexport)
-#else
-#define LIBOOTHEORA_API __declspec(dllimport)
-#endif
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// The following ifdef block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the LIBOOTHEORA_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// LIBOOTHEORA_API functions as being imported from a DLL, whereas this DLL sees symbols
+// defined with this macro as being exported.
+#ifdef LIBOOTHEORA_EXPORTS
+#define LIBOOTHEORA_API __declspec(dllexport)
+#else
+#define LIBOOTHEORA_API __declspec(dllimport)
+#endif
+
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/libOOTheora.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,39 +1,39 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.cpp : source file that includes just the standard includes
-// libOOTheora.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.cpp : source file that includes just the standard includes
+// libOOTheora.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,43 +1,43 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-// TODO: reference additional headers your program requires here
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libOOTheora/theora_cdecl.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/examples/getopt.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/include/theora/theora.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/lib/block_inline.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/lib/encoder_internal.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/lib/encoder_lookup.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/lib/huffman.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/lib/hufftables.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/lib/mcomp.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/lib/pp.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/lib/quant_lookup.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/lib/toplevel_lookup.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_active.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_audio.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_byteorder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_cdrom.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_copying.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_endian.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_error.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_events.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_getenv.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_joystick.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_keyboard.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_keysym.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_main.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_mouse.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_mutex.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_name.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_opengl.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_quit.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_rwops.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_syswm.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_thread.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_timer.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_types.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_version.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/SDL_video.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/begin_code.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/SDL-1.2.5/include/close_code.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/portaudio/pa_common/pa_host.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/portaudio/pa_common/pa_trace.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/portaudio/pa_common/portaudio.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/portaudio/pablio/pablio.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/splayer/portaudio/pablio/ringbuffer.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/transcoder/avi2vp3/avilib.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/wincompat/getopt.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/experimental/wincompat/unistd.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/libtheora/libtheora.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/libtheora/libtheora.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/libtheora/libtheora.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,12 +1,12 @@
-// libtheora.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- return TRUE;
-}
-
+// libtheora.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ return TRUE;
+}
+
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/libtheora/libtheora.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/libtheora/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/libtheora/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/libtheora/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// libtheora.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// libtheora.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/libtheora/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/libtheora/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/libtheora/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/libtheora/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,12 +1,12 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-// TODO: reference additional headers your program requires here
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/lib/codecs/theora/libs/libtheora/win32/libtheora/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeFilter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeFilter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,205 +1,205 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "vorbisdecodefilter.h"
-
-//Include Files
-#include "StdAfx.h"
-#include "VorbisDecodeFilter.h"
-
-//COM Factory Template
-CFactoryTemplate g_Templates[] =
-{
- {
- L"Vorbis Decode Filter", // Name
- &CLSID_VorbisDecodeFilter, // CLSID
- VorbisDecodeFilter::CreateInstance, // Method to create an instance of MyComponent
- NULL, // Initialization function
- NULL // Set-up information (for filters)
- }
-
-};
-
-// Generic way of determining the number of items in the template
-int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
-
-
-
-//*************************************************************************************************
-VorbisDecodeFilter::VorbisDecodeFilter()
- : AbstractTransformFilter(NAME("Vorbis Decoder"), CLSID_VorbisDecodeFilter)
- , mVorbisFormatInfo(NULL)
-{
-
- bool locWasConstructed = ConstructPins();
- //TODO::: Error check !
-}
-
-bool VorbisDecodeFilter::ConstructPins()
-{
- //Vector to hold our set of media types we want to accept.
- vector<CMediaType*> locAcceptableTypes;
-
- //Setup the media types for the output pin.
- CMediaType* locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted in pin destructor
- locAcceptMediaType->subtype = MEDIASUBTYPE_PCM;
- locAcceptMediaType->formattype = FORMAT_WaveFormatEx;
-
- locAcceptableTypes.push_back(locAcceptMediaType);
-
- //Output pin must be done first because it's passed to the input pin.
- mOutputPin = new VorbisDecodeOutputPin(this, m_pLock, locAcceptableTypes); //Deleted in base class destructor
-
- //Clear out the vector, now we've already passed it to the output pin.
- locAcceptableTypes.clear();
-
- //Setup the media Types for the input pin.
- locAcceptMediaType = NULL;
- locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted by pin
-
- locAcceptMediaType->subtype = MEDIASUBTYPE_Vorbis;
- locAcceptMediaType->formattype = FORMAT_Vorbis;
-
- locAcceptableTypes.push_back(locAcceptMediaType);
-
- mInputPin = new VorbisDecodeInputPin(this, m_pLock, mOutputPin, locAcceptableTypes); //Deleted in base class filter destructor.
- return true;
-}
-
-VorbisDecodeFilter::~VorbisDecodeFilter(void)
-{
- DbgLog((LOG_TRACE,1,TEXT("Vorbis Destructor...")));
- //DestroyPins();
- delete mVorbisFormatInfo;
-}
-
-CUnknown* WINAPI VorbisDecodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
-{
-
- VorbisDecodeFilter *pNewObject = new VorbisDecodeFilter();
- if (pNewObject == NULL) {
- *pHr = E_OUTOFMEMORY;
- }
- return pNewObject;
-}
-
-//QUERY::: Do we need these ? Aren't we all friedns here ??
-//RESULT::: Keep them, set function must be kept... get could go... but keep for consistency
-sVorbisFormatBlock* VorbisDecodeFilter::getVorbisFormatBlock()
-{
- return mVorbisFormatInfo;
-}
-void VorbisDecodeFilter::setVorbisFormat(sVorbisFormatBlock* inFormatBlock)
-{
- delete mVorbisFormatInfo;
- mVorbisFormatInfo = new sVorbisFormatBlock; //Deleted in destructor.
- *mVorbisFormatInfo = *inFormatBlock;
-}
-
-//Old imp
-//******************************************************************
-//#include "StdAfx.h"
-//#include "vorbisdecodefilter.h"
-//
-////Include Files
-//#include "StdAfx.h"
-//#include "VorbisDecodeFilter.h"
-//
-////COM Factory Template
-//CFactoryTemplate g_Templates[] =
-//{
-// {
-// L"Vorbis Decode Filter", // Name
-// &CLSID_VorbisDecodeFilter, // CLSID
-// VorbisDecodeFilter::CreateInstance, // Method to create an instance of MyComponent
-// NULL, // Initialization function
-// NULL // Set-up information (for filters)
-// }
-//
-//};
-//
-//// Generic way of determining the number of items in the template
-//int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
-//
-//
-//
-////*************************************************************************************************
-//VorbisDecodeFilter::VorbisDecodeFilter()
-// : AbstractAudioDecodeFilter(NAME("Vorbis Decoder"), CLSID_VorbisDecodeFilter, VORBIS)
-// , mVorbisFormatInfo(NULL)
-//{
-//
-// bool locWasConstructed = ConstructPins();
-//}
-//
-//bool VorbisDecodeFilter::ConstructPins()
-//{
-// DbgLog((LOG_TRACE,1,TEXT("Vorbis Constructor...")));
-// //Output pin must be done first because it's passed to the input pin.
-// mOutputPin = new VorbisDecodeOutputPin(this, m_pLock); //Deleted in base class destructor
-//
-// CMediaType* locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted in pin destructor
-// locAcceptMediaType->subtype = MEDIASUBTYPE_Vorbis;
-// locAcceptMediaType->formattype = FORMAT_Vorbis;
-// mInputPin = new VorbisDecodeInputPin(this, m_pLock, mOutputPin, locAcceptMediaType); //Deleted in base class filter destructor.
-// return true;
-//}
-//
-//VorbisDecodeFilter::~VorbisDecodeFilter(void)
-//{
-// DbgLog((LOG_TRACE,1,TEXT("Vorbis Destructor...")));
-// //DestroyPins();
-// delete mVorbisFormatInfo;
-//}
-//
-//CUnknown* WINAPI VorbisDecodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
-//{
-//
-// VorbisDecodeFilter *pNewObject = new VorbisDecodeFilter();
-// if (pNewObject == NULL) {
-// *pHr = E_OUTOFMEMORY;
-// }
-// return pNewObject;
-//}
-//
-////QUERY::: Do we need these ? Aren't we all friedns here ??
-////RESULT::: Keep them, set function must be kept... get could go... but keep for consistency
-//sVorbisFormatBlock* VorbisDecodeFilter::getVorbisFormatBlock()
-//{
-// return mVorbisFormatInfo;
-//}
-//void VorbisDecodeFilter::setVorbisFormat(sVorbisFormatBlock* inFormatBlock)
-//{
-// delete mVorbisFormatInfo;
-// mVorbisFormatInfo = new sVorbisFormatBlock; //Deleted in destructor.
-// *mVorbisFormatInfo = *inFormatBlock;
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "vorbisdecodefilter.h"
+
+//Include Files
+#include "StdAfx.h"
+#include "VorbisDecodeFilter.h"
+
+//COM Factory Template
+CFactoryTemplate g_Templates[] =
+{
+ {
+ L"Vorbis Decode Filter", // Name
+ &CLSID_VorbisDecodeFilter, // CLSID
+ VorbisDecodeFilter::CreateInstance, // Method to create an instance of MyComponent
+ NULL, // Initialization function
+ NULL // Set-up information (for filters)
+ }
+
+};
+
+// Generic way of determining the number of items in the template
+int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
+
+
+
+//*************************************************************************************************
+VorbisDecodeFilter::VorbisDecodeFilter()
+ : AbstractTransformFilter(NAME("Vorbis Decoder"), CLSID_VorbisDecodeFilter)
+ , mVorbisFormatInfo(NULL)
+{
+
+ bool locWasConstructed = ConstructPins();
+ //TODO::: Error check !
+}
+
+bool VorbisDecodeFilter::ConstructPins()
+{
+ //Vector to hold our set of media types we want to accept.
+ vector<CMediaType*> locAcceptableTypes;
+
+ //Setup the media types for the output pin.
+ CMediaType* locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted in pin destructor
+ locAcceptMediaType->subtype = MEDIASUBTYPE_PCM;
+ locAcceptMediaType->formattype = FORMAT_WaveFormatEx;
+
+ locAcceptableTypes.push_back(locAcceptMediaType);
+
+ //Output pin must be done first because it's passed to the input pin.
+ mOutputPin = new VorbisDecodeOutputPin(this, m_pLock, locAcceptableTypes); //Deleted in base class destructor
+
+ //Clear out the vector, now we've already passed it to the output pin.
+ locAcceptableTypes.clear();
+
+ //Setup the media Types for the input pin.
+ locAcceptMediaType = NULL;
+ locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted by pin
+
+ locAcceptMediaType->subtype = MEDIASUBTYPE_Vorbis;
+ locAcceptMediaType->formattype = FORMAT_Vorbis;
+
+ locAcceptableTypes.push_back(locAcceptMediaType);
+
+ mInputPin = new VorbisDecodeInputPin(this, m_pLock, mOutputPin, locAcceptableTypes); //Deleted in base class filter destructor.
+ return true;
+}
+
+VorbisDecodeFilter::~VorbisDecodeFilter(void)
+{
+ DbgLog((LOG_TRACE,1,TEXT("Vorbis Destructor...")));
+ //DestroyPins();
+ delete mVorbisFormatInfo;
+}
+
+CUnknown* WINAPI VorbisDecodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
+{
+
+ VorbisDecodeFilter *pNewObject = new VorbisDecodeFilter();
+ if (pNewObject == NULL) {
+ *pHr = E_OUTOFMEMORY;
+ }
+ return pNewObject;
+}
+
+//QUERY::: Do we need these ? Aren't we all friedns here ??
+//RESULT::: Keep them, set function must be kept... get could go... but keep for consistency
+sVorbisFormatBlock* VorbisDecodeFilter::getVorbisFormatBlock()
+{
+ return mVorbisFormatInfo;
+}
+void VorbisDecodeFilter::setVorbisFormat(sVorbisFormatBlock* inFormatBlock)
+{
+ delete mVorbisFormatInfo;
+ mVorbisFormatInfo = new sVorbisFormatBlock; //Deleted in destructor.
+ *mVorbisFormatInfo = *inFormatBlock;
+}
+
+//Old imp
+//******************************************************************
+//#include "StdAfx.h"
+//#include "vorbisdecodefilter.h"
+//
+////Include Files
+//#include "StdAfx.h"
+//#include "VorbisDecodeFilter.h"
+//
+////COM Factory Template
+//CFactoryTemplate g_Templates[] =
+//{
+// {
+// L"Vorbis Decode Filter", // Name
+// &CLSID_VorbisDecodeFilter, // CLSID
+// VorbisDecodeFilter::CreateInstance, // Method to create an instance of MyComponent
+// NULL, // Initialization function
+// NULL // Set-up information (for filters)
+// }
+//
+//};
+//
+//// Generic way of determining the number of items in the template
+//int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
+//
+//
+//
+////*************************************************************************************************
+//VorbisDecodeFilter::VorbisDecodeFilter()
+// : AbstractAudioDecodeFilter(NAME("Vorbis Decoder"), CLSID_VorbisDecodeFilter, VORBIS)
+// , mVorbisFormatInfo(NULL)
+//{
+//
+// bool locWasConstructed = ConstructPins();
+//}
+//
+//bool VorbisDecodeFilter::ConstructPins()
+//{
+// DbgLog((LOG_TRACE,1,TEXT("Vorbis Constructor...")));
+// //Output pin must be done first because it's passed to the input pin.
+// mOutputPin = new VorbisDecodeOutputPin(this, m_pLock); //Deleted in base class destructor
+//
+// CMediaType* locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted in pin destructor
+// locAcceptMediaType->subtype = MEDIASUBTYPE_Vorbis;
+// locAcceptMediaType->formattype = FORMAT_Vorbis;
+// mInputPin = new VorbisDecodeInputPin(this, m_pLock, mOutputPin, locAcceptMediaType); //Deleted in base class filter destructor.
+// return true;
+//}
+//
+//VorbisDecodeFilter::~VorbisDecodeFilter(void)
+//{
+// DbgLog((LOG_TRACE,1,TEXT("Vorbis Destructor...")));
+// //DestroyPins();
+// delete mVorbisFormatInfo;
+//}
+//
+//CUnknown* WINAPI VorbisDecodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
+//{
+//
+// VorbisDecodeFilter *pNewObject = new VorbisDecodeFilter();
+// if (pNewObject == NULL) {
+// *pHr = E_OUTOFMEMORY;
+// }
+// return pNewObject;
+//}
+//
+////QUERY::: Do we need these ? Aren't we all friedns here ??
+////RESULT::: Keep them, set function must be kept... get could go... but keep for consistency
+//sVorbisFormatBlock* VorbisDecodeFilter::getVorbisFormatBlock()
+//{
+// return mVorbisFormatInfo;
+//}
+//void VorbisDecodeFilter::setVorbisFormat(sVorbisFormatBlock* inFormatBlock)
+//{
+// delete mVorbisFormatInfo;
+// mVorbisFormatInfo = new sVorbisFormatBlock; //Deleted in destructor.
+// *mVorbisFormatInfo = *inFormatBlock;
//}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeFilter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeFilter.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeFilter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeFilter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,116 +1,116 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-
-#pragma once
-//Include Files
-#include "vorbisdecoderdllstuff.h"
-#include "AbstractTransformFilter.h"
-
-//Forward Declarations
-struct sVorbisFormatBlock;
-class VorbisDecodeInputPin;
-class VorbisDecodeOutputPin;
-
-//Class Interface
-class VorbisDecodeFilter
- //Base Classes
- : public AbstractTransformFilter
-{
-public:
- //Friends
- friend class VorbisDecodeInputPin;
- friend class VorbisDecodeOutputPin;
-
- //Constructors and Destructors
- VorbisDecodeFilter(void);
- virtual ~VorbisDecodeFilter(void);
-
- //COM Creator Function
- static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
-
- //FIX::: Do we need these ? Aren't they all friends ??
- virtual sVorbisFormatBlock* getVorbisFormatBlock();
- virtual void setVorbisFormat(sVorbisFormatBlock* inFormatBlock);
-
-protected:
- //VIRTUAL FUNCTIONS - AbstractTransformFilter
- virtual bool ConstructPins();
-
- //Format Block
- sVorbisFormatBlock* mVorbisFormatInfo;
-};
-
-
-
-
-//Old implementation
-//**********************************************
-//#pragma once
-////Include Files
-//#include "vorbisdecoderdllstuff.h"
-//#include "AbstractAudioDecodeFilter.h"
-//
-////Forward Declarations
-//struct sVorbisFormatBlock;
-//class VorbisDecodeInputPin;
-//class VorbisDecodeOutputPin;
-//
-////Class Interface
-//class VorbisDecodeFilter
-// //Base Classes
-// : public AbstractAudioDecodeFilter
-//{
-//public:
-// //Friends
-// friend class VorbisDecodeInputPin;
-// friend class VorbisDecodeOutputPin;
-//
-// //Constructors and Destructors
-// VorbisDecodeFilter(void);
-// virtual ~VorbisDecodeFilter(void);
-//
-// //COM Creator Function
-// static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
-//
-//
-//
-// //VIRTUAL FUNCTIONS - AbstractAudioDecodeFilter
-// virtual bool ConstructPins();
-//
-// //FIX::: Do we need these ? Aren't they all friends ??
-// virtual sVorbisFormatBlock* getVorbisFormatBlock();
-// virtual void setVorbisFormat(sVorbisFormatBlock* inFormatBlock);
-//
-//protected:
-// //Format Block
-// sVorbisFormatBlock* mVorbisFormatInfo;
-//};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+
+#pragma once
+//Include Files
+#include "vorbisdecoderdllstuff.h"
+#include "AbstractTransformFilter.h"
+
+//Forward Declarations
+struct sVorbisFormatBlock;
+class VorbisDecodeInputPin;
+class VorbisDecodeOutputPin;
+
+//Class Interface
+class VorbisDecodeFilter
+ //Base Classes
+ : public AbstractTransformFilter
+{
+public:
+ //Friends
+ friend class VorbisDecodeInputPin;
+ friend class VorbisDecodeOutputPin;
+
+ //Constructors and Destructors
+ VorbisDecodeFilter(void);
+ virtual ~VorbisDecodeFilter(void);
+
+ //COM Creator Function
+ static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+
+ //FIX::: Do we need these ? Aren't they all friends ??
+ virtual sVorbisFormatBlock* getVorbisFormatBlock();
+ virtual void setVorbisFormat(sVorbisFormatBlock* inFormatBlock);
+
+protected:
+ //VIRTUAL FUNCTIONS - AbstractTransformFilter
+ virtual bool ConstructPins();
+
+ //Format Block
+ sVorbisFormatBlock* mVorbisFormatInfo;
+};
+
+
+
+
+//Old implementation
+//**********************************************
+//#pragma once
+////Include Files
+//#include "vorbisdecoderdllstuff.h"
+//#include "AbstractAudioDecodeFilter.h"
+//
+////Forward Declarations
+//struct sVorbisFormatBlock;
+//class VorbisDecodeInputPin;
+//class VorbisDecodeOutputPin;
+//
+////Class Interface
+//class VorbisDecodeFilter
+// //Base Classes
+// : public AbstractAudioDecodeFilter
+//{
+//public:
+// //Friends
+// friend class VorbisDecodeInputPin;
+// friend class VorbisDecodeOutputPin;
+//
+// //Constructors and Destructors
+// VorbisDecodeFilter(void);
+// virtual ~VorbisDecodeFilter(void);
+//
+// //COM Creator Function
+// static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+//
+//
+//
+// //VIRTUAL FUNCTIONS - AbstractAudioDecodeFilter
+// virtual bool ConstructPins();
+//
+// //FIX::: Do we need these ? Aren't they all friends ??
+// virtual sVorbisFormatBlock* getVorbisFormatBlock();
+// virtual void setVorbisFormat(sVorbisFormatBlock* inFormatBlock);
+//
+//protected:
+// //Format Block
+// sVorbisFormatBlock* mVorbisFormatInfo;
+//};
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeFilter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,464 +1,464 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-
-#include "VorbisDecodeInputPin.h"
-
-
-VorbisDecodeInputPin::VorbisDecodeInputPin ( AbstractTransformFilter* inFilter
- , CCritSec* inFilterLock
- , AbstractTransformOutputPin* inOutputPin
- , vector<CMediaType*> inAcceptableMediaTypes
- )
-
- : AbstractTransformInputPin ( inFilter
- , inFilterLock
- , inOutputPin
- , NAME("VorbisDecodeInputPin")
- , L"Vorbis In", inAcceptableMediaTypes
- )
- , mBegun(false)
- , mFishSound(NULL)
-
- , mNumChannels(0)
- , mFrameSize(0)
- , mSampleRate(0)
- , mUptoFrame(0)
-
-{
- //debugLog.open("g:\\logs\\vorbislog.log", ios_base::out);
- ConstructCodec();
-}
-
-VorbisDecodeInputPin::~VorbisDecodeInputPin(void)
-{
- //debugLog.close();
- DestroyCodec();
-}
-//Is this needed ??
-STDMETHODIMP VorbisDecodeInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
- if (riid == IID_IMediaSeeking) {
- *ppv = (IMediaSeeking*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- }
-
- return AbstractTransformInputPin::NonDelegatingQueryInterface(riid, ppv);
-}
-bool VorbisDecodeInputPin::ConstructCodec()
-{
- mFishSound = fish_sound_new (FISH_SOUND_DECODE, &mFishInfo); //Deleted by destroycodec from destructor.
-
- int i = 1;
- //FIX::: Use new API for interleave setting
- fish_sound_command(mFishSound, FISH_SOUND_SET_INTERLEAVE, &i, sizeof(int));
-
- fish_sound_set_decoded_callback (mFishSound, VorbisDecodeInputPin::VorbisDecoded, this);
- //FIX::: Proper return value
- return true;
-}
-void VorbisDecodeInputPin::DestroyCodec()
-{
- fish_sound_delete(mFishSound);
- mFishSound = NULL;
-}
-
-
-STDMETHODIMP VorbisDecodeInputPin::NewSegment(REFERENCE_TIME inStartTime, REFERENCE_TIME inStopTime, double inRate)
-{
- CAutoLock locLock(mStreamLock);
- //debugLog<<"New segment "<<inStartTime<<" - "<<inStopTime<<endl;
- mUptoFrame = 0;
- return AbstractTransformInputPin::NewSegment(inStartTime, inStopTime, inRate);
-
-}
-
-int __cdecl VorbisDecodeInputPin::VorbisDecoded (FishSound* inFishSound, float** inPCM, long inFrames, void* inThisPointer)
-{
-
- VorbisDecodeInputPin* locThis = reinterpret_cast<VorbisDecodeInputPin*> (inThisPointer);
- VorbisDecodeFilter* locFilter = reinterpret_cast<VorbisDecodeFilter*>(locThis->m_pFilter);
-
- if (locThis->CheckStreaming() == S_OK) {
- if (! locThis->mBegun) {
- //locThis->debugLog<<"First Time"<<endl;
- //Set up fishsound
- fish_sound_command (locThis->mFishSound, FISH_SOUND_GET_INFO, &(locThis->mFishInfo), sizeof (FishSoundInfo));
- locThis->mBegun = true;
-
- locThis->mNumChannels = locThis->mFishInfo.channels;
- locThis->mFrameSize = locThis->mNumChannels * SIZE_16_BITS;
- locThis->mSampleRate = locThis->mFishInfo.samplerate;
-
- }
-
-
- unsigned long locActualSize = inFrames * locThis->mFrameSize;
- unsigned long locTotalFrameCount = inFrames * locThis->mNumChannels;
-
- //locThis->debugLog<<"m_tStart = "<<locThis->m_tStart<<endl;
- //locThis->debugLog<<"mUptoFrame = "<<locThis->mUptoFrame<<endl;
- //Make the start presentation time
- REFERENCE_TIME locFrameStart = (((__int64)(locThis->mUptoFrame * UNITS)) / locThis->mSampleRate);
-
- //Increment the frame counter
- locThis->mUptoFrame += inFrames;
-
- //Make the end presentation time
- REFERENCE_TIME locFrameEnd = (((__int64)(locThis->mUptoFrame * UNITS)) / locThis->mSampleRate);
-
- //locThis->debugLog<<"Sample time = "<<locFrameStart<<" - "<<locFrameEnd<<endl;
- IMediaSample* locSample;
- HRESULT locHR = locThis->mOutputPin->GetDeliveryBuffer(&locSample, &locFrameStart, &locFrameEnd, NULL);
-
- if (locHR != S_OK) {
- return -1;
- }
-
-
- //Create pointers for the samples buffer to be assigned to
- BYTE* locBuffer = NULL;
- signed short* locShortBuffer = NULL;
-
- locSample->GetPointer(&locBuffer);
- locShortBuffer = (short *) locBuffer;
-
- signed short tempInt = 0;
- float tempFloat = 0;
-
- //FIX:::Move the clipping to the abstract function
-
- if (locSample->GetSize() >= locActualSize) {
- //Do float to int conversion with clipping
- const float SINT_MAX_AS_FLOAT = 32767.0f;
- for (unsigned long i = 0; i < locTotalFrameCount; i++) {
- //Clipping because vorbis puts out floats out of range -1 to 1
- if (((float*)inPCM)[i] <= -1.0f) {
- tempInt = SINT_MIN;
- } else if (((float*)inPCM)[i] >= 1.0f) {
- tempInt = SINT_MAX;
- } else {
- //FIX:::Take out the unnescessary variable.
- tempFloat = ((( (float*) inPCM )[i]) * SINT_MAX_AS_FLOAT);
- //ASSERT((tempFloat <= 32767.0f) && (tempFloat >= -32786.0f));
- tempInt = (signed short)(tempFloat);
- //tempInt = (signed short) ((( (float*) inPCM )[i]) * SINT_MAX_AS_FLOAT);
- }
-
- *locShortBuffer = tempInt;
- locShortBuffer++;
- }
-
- //Set the sample parameters.
- locThis->SetSampleParams(locSample, locActualSize, &locFrameStart, &locFrameEnd);
-
- {
-
- CAutoLock locLock(locThis->m_pLock);
-
- //TODO::: Explain why we don't addref or release.
- HRESULT locHR = ((VorbisDecodeOutputPin*)(locThis->mOutputPin))->mDataQueue->Receive(locSample);
- if (locHR != S_OK) {
- DbgLog((LOG_TRACE,1,TEXT("Queue rejected us...")));
- return -1;
- }
- }
-
-
- return 0;
- } else {
- throw 0;
- }
- } else {
- DbgLog((LOG_TRACE,1,TEXT("Fishsound sending stuff we aren't ready for...")));
- return -1;
- }
-
-}
-
-
-
-HRESULT VorbisDecodeInputPin::TransformData(BYTE* inBuf, long inNumBytes)
-{
- //TODO::: Return types !!!
-
- //debugLog << "Decode called... Last Gran Pos : "<<mLastSeenStartGranPos<<endl;
- DbgLog((LOG_TRACE,1,TEXT("decodeData")));
- long locErr = fish_sound_decode(mFishSound, inBuf, inNumBytes);
- //FIX::: Do something here ?
- if (locErr < 0) {
- //debugLog <<"** Fish Sound error **"<<endl;
- } else {
- //debugLog << "Fish Sound OK >=0 "<<endl;
- }
- return locErr;
-}
-
-
-HRESULT VorbisDecodeInputPin::SetMediaType(const CMediaType* inMediaType) {
- //FIX:::Error checking
- //RESOLVED::: Bit better.
-
- if (inMediaType->subtype == MEDIASUBTYPE_Vorbis) {
- ((VorbisDecodeFilter*)mParentFilter)->setVorbisFormat((sVorbisFormatBlock*)inMediaType->pbFormat);
-
- } else {
- throw 0;
- }
- return CBaseInputPin::SetMediaType(inMediaType);
-}
-
-
-
-
-//Old imp
-//*************************************************
-//#include "StdAfx.h"
-//
-//#include "VorbisDecodeInputPin.h"
-//
-//
-//VorbisDecodeInputPin::VorbisDecodeInputPin(AbstractAudioDecodeFilter* inFilter, CCritSec* inFilterLock, AbstractAudioDecodeOutputPin* inOutputPin, CMediaType* inAcceptMediaType)
-// : AbstractAudioDecodeInputPin(inFilter, inFilterLock, inOutputPin, NAME("VorbisDecodeInputPin"), L"Vorbis In", inAcceptMediaType),
-// mBegun(false)
-// , mFishSound(NULL)
-//
-//{
-// //debugLog.open("g:\\logs\\vorbislog.log", ios_base::out);
-// ConstructCodec();
-//}
-//
-//STDMETHODIMP VorbisDecodeInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-//{
-// if (riid == IID_IMediaSeeking) {
-// *ppv = (IMediaSeeking*)this;
-// ((IUnknown*)*ppv)->AddRef();
-// return NOERROR;
-// }
-//
-// return CBaseInputPin::NonDelegatingQueryInterface(riid, ppv);
-//}
-//bool VorbisDecodeInputPin::ConstructCodec() {
-// mFishSound = fish_sound_new (FISH_SOUND_DECODE, &mFishInfo); //Deleted by destroycodec from destructor.
-//
-// int i = 1;
-// //FIX::: Use new API for interleave setting
-// fish_sound_command(mFishSound, FISH_SOUND_SET_INTERLEAVE, &i, sizeof(int));
-//
-// fish_sound_set_decoded_callback (mFishSound, VorbisDecodeInputPin::VorbisDecoded, this);
-// //FIX::: Proper return value
-// return true;
-//}
-//void VorbisDecodeInputPin::DestroyCodec() {
-// fish_sound_delete(mFishSound);
-// mFishSound = NULL;
-//}
-//VorbisDecodeInputPin::~VorbisDecodeInputPin(void)
-//{
-// //debugLog.close();
-// DestroyCodec();
-//}
-//
-//
-//
-//int __cdecl VorbisDecodeInputPin::VorbisDecoded (FishSound* inFishSound, float** inPCM, long inFrames, void* inThisPointer)
-//{
-//
-// DbgLog((LOG_TRACE,1,TEXT("Decoded... Sending...")));
-// //Do we need to delete the pcm structure ????
-// //More of this can go to the abstract class.
-//
-// //For convenience we do all these cast once and for all here.
-// VorbisDecodeInputPin* locThis = reinterpret_cast<VorbisDecodeInputPin*> (inThisPointer);
-// VorbisDecodeFilter* locFilter = reinterpret_cast<VorbisDecodeFilter*>(locThis->m_pFilter);
-//
-//
-// if (locThis->CheckStreaming() == S_OK) {
-// if (! locThis->mBegun) {
-//
-//
-// fish_sound_command (locThis->mFishSound, FISH_SOUND_GET_INFO, &(locThis->mFishInfo), sizeof (FishSoundInfo));
-// locThis->mBegun = true;
-//
-// locThis->mNumChannels = locThis->mFishInfo.channels;
-// locThis->mFrameSize = locThis->mNumChannels * SIZE_16_BITS;
-// locThis->mSampleRate = locThis->mFishInfo.samplerate;
-//
-// }
-//
-// //FIX::: Most of this will be obselete... the demux does it all.
-//
-//
-// unsigned long locActualSize = inFrames * locThis->mFrameSize;
-// unsigned long locTotalFrameCount = inFrames * locThis->mNumChannels;
-//
-// //REFERENCE_TIME locFrameStart = locThis->CurrentStartTime() + (((__int64)(locThis->mUptoFrame * UNITS)) / locThis->mSampleRate);
-//
-//
-// //New hacks for chaining.
-// if (locThis->mSeekTimeBase == -1) {
-// //locThis->debugLog<<"Chaining was detected... setting chain time base to : "<<locThis->mPreviousEndTime<<endl;
-// //This is our signal this is the start of a chain...
-// // This can only happen on non-seekable streams.
-// locThis->mChainTimeBase = locThis->mPreviousEndTime;
-//
-// locThis->mSeekTimeBase = 0;
-// }
-//
-// //Start time hacks
-// REFERENCE_TIME locTimeBase = ((locThis->mLastSeenStartGranPos * UNITS) / locThis->mSampleRate) - locThis->mSeekTimeBase + locThis->mChainTimeBase;
-//
-//
-//
-// //locThis->aadDebug<<"Last Seen : " <<locThis->mLastSeenStartGranPos<<endl;
-// //locThis->debugLog<<"Last Seen : " << locThis->mLastSeenStartGranPos<<endl;
-// //locThis->debugLog<<"Time Base : " << locTimeBase << endl;
-// //locThis->debugLog<<"FrameCount : " <<locThis->mUptoFrame<<endl;
-// //locThis->debugLog<<"Seek TB : " <<locThis->mSeekTimeBase<<endl;
-//
-// //Temp - this will break seeking
-// REFERENCE_TIME locFrameStart = locTimeBase + (((__int64)(locThis->mUptoFrame * UNITS)) / locThis->mSampleRate);
-// //Increment the frame counter
-// locThis->mUptoFrame += inFrames;
-// //Make the end frame counter
-//
-// //REFERENCE_TIME locFrameEnd = locThis->CurrentStartTime() + (((__int64)(locThis->mUptoFrame * UNITS)) / locThis->mSampleRate);
-// REFERENCE_TIME locFrameEnd = locTimeBase + (((__int64)(locThis->mUptoFrame * UNITS)) / locThis->mSampleRate);
-// locThis->mPreviousEndTime = locFrameEnd;
-//
-//
-//
-// //locThis->debugLog<<"Start : "<<locFrameStart<<endl;
-// //locThis->debugLog<<"End : "<<locFrameEnd<<endl;
-// //locThis->debugLog<<"=================================================="<<endl;
-// IMediaSample* locSample;
-// HRESULT locHR = locThis->mOutputPin->GetDeliveryBuffer(&locSample, &locFrameStart, &locFrameEnd, NULL);
-//
-// if (locHR != S_OK) {
-// return -1;
-// }
-//
-//
-// //Create pointers for the samples buffer to be assigned to
-// BYTE* locBuffer = NULL;
-// signed short* locShortBuffer = NULL;
-//
-// locSample->GetPointer(&locBuffer);
-// locShortBuffer = (short *) locBuffer;
-//
-// signed short tempInt = 0;
-// float tempFloat = 0;
-//
-// //FIX:::Move the clipping to the abstract function
-//
-// if (locSample->GetSize() >= locActualSize) {
-// //Do float to int conversion with clipping
-// const float SINT_MAX_AS_FLOAT = 32767.0f;
-// for (unsigned long i = 0; i < locTotalFrameCount; i++) {
-// //Clipping because vorbis puts out floats out of range -1 to 1
-// if (((float*)inPCM)[i] <= -1.0f) {
-// tempInt = SINT_MIN;
-// } else if (((float*)inPCM)[i] >= 1.0f) {
-// tempInt = SINT_MAX;
-// } else {
-// //FIX:::Take out the unnescessary variable.
-// tempFloat = ((( (float*) inPCM )[i]) * SINT_MAX_AS_FLOAT);
-// //ASSERT((tempFloat <= 32767.0f) && (tempFloat >= -32786.0f));
-// tempInt = (signed short)(tempFloat);
-// //tempInt = (signed short) ((( (float*) inPCM )[i]) * SINT_MAX_AS_FLOAT);
-// }
-//
-// *locShortBuffer = tempInt;
-// locShortBuffer++;
-// }
-//
-// //Set the sample parameters.
-// locThis->SetSampleParams(locSample, locActualSize, &locFrameStart, &locFrameEnd);
-//
-// {
-//
-// CAutoLock locLock(locThis->m_pLock);
-//
-// //Add a reference so it isn't deleted en route.... or not
-// //locSample->AddRef();
-// HRESULT lHR = locThis->mOutputPin->mDataQueue->Receive(locSample);
-// if (lHR != S_OK) {
-// DbgLog((LOG_TRACE,1,TEXT("Queue rejected us...")));
-// return -1;
-// }
-// }
-//
-// //Don't Release the sample it gets done for us !
-// //locSample->Release();
-//
-// return 0;
-// } else {
-// throw 0;
-// }
-// } else {
-// DbgLog((LOG_TRACE,1,TEXT("Fishsound sending stuff we aren't ready for...")));
-// return -1;
-// }
-//
-//}
-//
-//
-//
-//long VorbisDecodeInputPin::decodeData(BYTE* inBuf, long inNumBytes)
-//{
-// //debugLog << "Decode called... Last Gran Pos : "<<mLastSeenStartGranPos<<endl;
-// DbgLog((LOG_TRACE,1,TEXT("decodeData")));
-// long locErr = fish_sound_decode(mFishSound, inBuf, inNumBytes);
-// //FIX::: Do something here ?
-// if (locErr < 0) {
-// //debugLog <<"** Fish Sound error **"<<endl;
-// } else {
-// //debugLog << "Fish Sound OK >=0 "<<endl;
-// }
-// return locErr;
-//}
-//
-//
-//HRESULT VorbisDecodeInputPin::SetMediaType(const CMediaType* inMediaType) {
-// //FIX:::Error checking
-// //RESOLVED::: Bit better.
-//
-// if (inMediaType->subtype == MEDIASUBTYPE_Vorbis) {
-// ((VorbisDecodeFilter*)mParentFilter)->setVorbisFormat((sVorbisFormatBlock*)inMediaType->pbFormat);
-// mParentFilter->mAudioFormat = AbstractAudioDecodeFilter::VORBIS;
-// } else {
-// throw 0;
-// }
-// return CBaseInputPin::SetMediaType(inMediaType);
-//}
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+
+#include "VorbisDecodeInputPin.h"
+
+
+VorbisDecodeInputPin::VorbisDecodeInputPin ( AbstractTransformFilter* inFilter
+ , CCritSec* inFilterLock
+ , AbstractTransformOutputPin* inOutputPin
+ , vector<CMediaType*> inAcceptableMediaTypes
+ )
+
+ : AbstractTransformInputPin ( inFilter
+ , inFilterLock
+ , inOutputPin
+ , NAME("VorbisDecodeInputPin")
+ , L"Vorbis In", inAcceptableMediaTypes
+ )
+ , mBegun(false)
+ , mFishSound(NULL)
+
+ , mNumChannels(0)
+ , mFrameSize(0)
+ , mSampleRate(0)
+ , mUptoFrame(0)
+
+{
+ //debugLog.open("g:\\logs\\vorbislog.log", ios_base::out);
+ ConstructCodec();
+}
+
+VorbisDecodeInputPin::~VorbisDecodeInputPin(void)
+{
+ //debugLog.close();
+ DestroyCodec();
+}
+//Is this needed ??
+STDMETHODIMP VorbisDecodeInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+ if (riid == IID_IMediaSeeking) {
+ *ppv = (IMediaSeeking*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ }
+
+ return AbstractTransformInputPin::NonDelegatingQueryInterface(riid, ppv);
+}
+bool VorbisDecodeInputPin::ConstructCodec()
+{
+ mFishSound = fish_sound_new (FISH_SOUND_DECODE, &mFishInfo); //Deleted by destroycodec from destructor.
+
+ int i = 1;
+ //FIX::: Use new API for interleave setting
+ fish_sound_command(mFishSound, FISH_SOUND_SET_INTERLEAVE, &i, sizeof(int));
+
+ fish_sound_set_decoded_callback (mFishSound, VorbisDecodeInputPin::VorbisDecoded, this);
+ //FIX::: Proper return value
+ return true;
+}
+void VorbisDecodeInputPin::DestroyCodec()
+{
+ fish_sound_delete(mFishSound);
+ mFishSound = NULL;
+}
+
+
+STDMETHODIMP VorbisDecodeInputPin::NewSegment(REFERENCE_TIME inStartTime, REFERENCE_TIME inStopTime, double inRate)
+{
+ CAutoLock locLock(mStreamLock);
+ //debugLog<<"New segment "<<inStartTime<<" - "<<inStopTime<<endl;
+ mUptoFrame = 0;
+ return AbstractTransformInputPin::NewSegment(inStartTime, inStopTime, inRate);
+
+}
+
+int __cdecl VorbisDecodeInputPin::VorbisDecoded (FishSound* inFishSound, float** inPCM, long inFrames, void* inThisPointer)
+{
+
+ VorbisDecodeInputPin* locThis = reinterpret_cast<VorbisDecodeInputPin*> (inThisPointer);
+ VorbisDecodeFilter* locFilter = reinterpret_cast<VorbisDecodeFilter*>(locThis->m_pFilter);
+
+ if (locThis->CheckStreaming() == S_OK) {
+ if (! locThis->mBegun) {
+ //locThis->debugLog<<"First Time"<<endl;
+ //Set up fishsound
+ fish_sound_command (locThis->mFishSound, FISH_SOUND_GET_INFO, &(locThis->mFishInfo), sizeof (FishSoundInfo));
+ locThis->mBegun = true;
+
+ locThis->mNumChannels = locThis->mFishInfo.channels;
+ locThis->mFrameSize = locThis->mNumChannels * SIZE_16_BITS;
+ locThis->mSampleRate = locThis->mFishInfo.samplerate;
+
+ }
+
+
+ unsigned long locActualSize = inFrames * locThis->mFrameSize;
+ unsigned long locTotalFrameCount = inFrames * locThis->mNumChannels;
+
+ //locThis->debugLog<<"m_tStart = "<<locThis->m_tStart<<endl;
+ //locThis->debugLog<<"mUptoFrame = "<<locThis->mUptoFrame<<endl;
+ //Make the start presentation time
+ REFERENCE_TIME locFrameStart = (((__int64)(locThis->mUptoFrame * UNITS)) / locThis->mSampleRate);
+
+ //Increment the frame counter
+ locThis->mUptoFrame += inFrames;
+
+ //Make the end presentation time
+ REFERENCE_TIME locFrameEnd = (((__int64)(locThis->mUptoFrame * UNITS)) / locThis->mSampleRate);
+
+ //locThis->debugLog<<"Sample time = "<<locFrameStart<<" - "<<locFrameEnd<<endl;
+ IMediaSample* locSample;
+ HRESULT locHR = locThis->mOutputPin->GetDeliveryBuffer(&locSample, &locFrameStart, &locFrameEnd, NULL);
+
+ if (locHR != S_OK) {
+ return -1;
+ }
+
+
+ //Create pointers for the samples buffer to be assigned to
+ BYTE* locBuffer = NULL;
+ signed short* locShortBuffer = NULL;
+
+ locSample->GetPointer(&locBuffer);
+ locShortBuffer = (short *) locBuffer;
+
+ signed short tempInt = 0;
+ float tempFloat = 0;
+
+ //FIX:::Move the clipping to the abstract function
+
+ if (locSample->GetSize() >= locActualSize) {
+ //Do float to int conversion with clipping
+ const float SINT_MAX_AS_FLOAT = 32767.0f;
+ for (unsigned long i = 0; i < locTotalFrameCount; i++) {
+ //Clipping because vorbis puts out floats out of range -1 to 1
+ if (((float*)inPCM)[i] <= -1.0f) {
+ tempInt = SINT_MIN;
+ } else if (((float*)inPCM)[i] >= 1.0f) {
+ tempInt = SINT_MAX;
+ } else {
+ //FIX:::Take out the unnescessary variable.
+ tempFloat = ((( (float*) inPCM )[i]) * SINT_MAX_AS_FLOAT);
+ //ASSERT((tempFloat <= 32767.0f) && (tempFloat >= -32786.0f));
+ tempInt = (signed short)(tempFloat);
+ //tempInt = (signed short) ((( (float*) inPCM )[i]) * SINT_MAX_AS_FLOAT);
+ }
+
+ *locShortBuffer = tempInt;
+ locShortBuffer++;
+ }
+
+ //Set the sample parameters.
+ locThis->SetSampleParams(locSample, locActualSize, &locFrameStart, &locFrameEnd);
+
+ {
+
+ CAutoLock locLock(locThis->m_pLock);
+
+ //TODO::: Explain why we don't addref or release.
+ HRESULT locHR = ((VorbisDecodeOutputPin*)(locThis->mOutputPin))->mDataQueue->Receive(locSample);
+ if (locHR != S_OK) {
+ DbgLog((LOG_TRACE,1,TEXT("Queue rejected us...")));
+ return -1;
+ }
+ }
+
+
+ return 0;
+ } else {
+ throw 0;
+ }
+ } else {
+ DbgLog((LOG_TRACE,1,TEXT("Fishsound sending stuff we aren't ready for...")));
+ return -1;
+ }
+
+}
+
+
+
+HRESULT VorbisDecodeInputPin::TransformData(BYTE* inBuf, long inNumBytes)
+{
+ //TODO::: Return types !!!
+
+ //debugLog << "Decode called... Last Gran Pos : "<<mLastSeenStartGranPos<<endl;
+ DbgLog((LOG_TRACE,1,TEXT("decodeData")));
+ long locErr = fish_sound_decode(mFishSound, inBuf, inNumBytes);
+ //FIX::: Do something here ?
+ if (locErr < 0) {
+ //debugLog <<"** Fish Sound error **"<<endl;
+ } else {
+ //debugLog << "Fish Sound OK >=0 "<<endl;
+ }
+ return locErr;
+}
+
+
+HRESULT VorbisDecodeInputPin::SetMediaType(const CMediaType* inMediaType) {
+ //FIX:::Error checking
+ //RESOLVED::: Bit better.
+
+ if (inMediaType->subtype == MEDIASUBTYPE_Vorbis) {
+ ((VorbisDecodeFilter*)mParentFilter)->setVorbisFormat((sVorbisFormatBlock*)inMediaType->pbFormat);
+
+ } else {
+ throw 0;
+ }
+ return CBaseInputPin::SetMediaType(inMediaType);
+}
+
+
+
+
+//Old imp
+//*************************************************
+//#include "StdAfx.h"
+//
+//#include "VorbisDecodeInputPin.h"
+//
+//
+//VorbisDecodeInputPin::VorbisDecodeInputPin(AbstractAudioDecodeFilter* inFilter, CCritSec* inFilterLock, AbstractAudioDecodeOutputPin* inOutputPin, CMediaType* inAcceptMediaType)
+// : AbstractAudioDecodeInputPin(inFilter, inFilterLock, inOutputPin, NAME("VorbisDecodeInputPin"), L"Vorbis In", inAcceptMediaType),
+// mBegun(false)
+// , mFishSound(NULL)
+//
+//{
+// //debugLog.open("g:\\logs\\vorbislog.log", ios_base::out);
+// ConstructCodec();
+//}
+//
+//STDMETHODIMP VorbisDecodeInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+//{
+// if (riid == IID_IMediaSeeking) {
+// *ppv = (IMediaSeeking*)this;
+// ((IUnknown*)*ppv)->AddRef();
+// return NOERROR;
+// }
+//
+// return CBaseInputPin::NonDelegatingQueryInterface(riid, ppv);
+//}
+//bool VorbisDecodeInputPin::ConstructCodec() {
+// mFishSound = fish_sound_new (FISH_SOUND_DECODE, &mFishInfo); //Deleted by destroycodec from destructor.
+//
+// int i = 1;
+// //FIX::: Use new API for interleave setting
+// fish_sound_command(mFishSound, FISH_SOUND_SET_INTERLEAVE, &i, sizeof(int));
+//
+// fish_sound_set_decoded_callback (mFishSound, VorbisDecodeInputPin::VorbisDecoded, this);
+// //FIX::: Proper return value
+// return true;
+//}
+//void VorbisDecodeInputPin::DestroyCodec() {
+// fish_sound_delete(mFishSound);
+// mFishSound = NULL;
+//}
+//VorbisDecodeInputPin::~VorbisDecodeInputPin(void)
+//{
+// //debugLog.close();
+// DestroyCodec();
+//}
+//
+//
+//
+//int __cdecl VorbisDecodeInputPin::VorbisDecoded (FishSound* inFishSound, float** inPCM, long inFrames, void* inThisPointer)
+//{
+//
+// DbgLog((LOG_TRACE,1,TEXT("Decoded... Sending...")));
+// //Do we need to delete the pcm structure ????
+// //More of this can go to the abstract class.
+//
+// //For convenience we do all these cast once and for all here.
+// VorbisDecodeInputPin* locThis = reinterpret_cast<VorbisDecodeInputPin*> (inThisPointer);
+// VorbisDecodeFilter* locFilter = reinterpret_cast<VorbisDecodeFilter*>(locThis->m_pFilter);
+//
+//
+// if (locThis->CheckStreaming() == S_OK) {
+// if (! locThis->mBegun) {
+//
+//
+// fish_sound_command (locThis->mFishSound, FISH_SOUND_GET_INFO, &(locThis->mFishInfo), sizeof (FishSoundInfo));
+// locThis->mBegun = true;
+//
+// locThis->mNumChannels = locThis->mFishInfo.channels;
+// locThis->mFrameSize = locThis->mNumChannels * SIZE_16_BITS;
+// locThis->mSampleRate = locThis->mFishInfo.samplerate;
+//
+// }
+//
+// //FIX::: Most of this will be obselete... the demux does it all.
+//
+//
+// unsigned long locActualSize = inFrames * locThis->mFrameSize;
+// unsigned long locTotalFrameCount = inFrames * locThis->mNumChannels;
+//
+// //REFERENCE_TIME locFrameStart = locThis->CurrentStartTime() + (((__int64)(locThis->mUptoFrame * UNITS)) / locThis->mSampleRate);
+//
+//
+// //New hacks for chaining.
+// if (locThis->mSeekTimeBase == -1) {
+// //locThis->debugLog<<"Chaining was detected... setting chain time base to : "<<locThis->mPreviousEndTime<<endl;
+// //This is our signal this is the start of a chain...
+// // This can only happen on non-seekable streams.
+// locThis->mChainTimeBase = locThis->mPreviousEndTime;
+//
+// locThis->mSeekTimeBase = 0;
+// }
+//
+// //Start time hacks
+// REFERENCE_TIME locTimeBase = ((locThis->mLastSeenStartGranPos * UNITS) / locThis->mSampleRate) - locThis->mSeekTimeBase + locThis->mChainTimeBase;
+//
+//
+//
+// //locThis->aadDebug<<"Last Seen : " <<locThis->mLastSeenStartGranPos<<endl;
+// //locThis->debugLog<<"Last Seen : " << locThis->mLastSeenStartGranPos<<endl;
+// //locThis->debugLog<<"Time Base : " << locTimeBase << endl;
+// //locThis->debugLog<<"FrameCount : " <<locThis->mUptoFrame<<endl;
+// //locThis->debugLog<<"Seek TB : " <<locThis->mSeekTimeBase<<endl;
+//
+// //Temp - this will break seeking
+// REFERENCE_TIME locFrameStart = locTimeBase + (((__int64)(locThis->mUptoFrame * UNITS)) / locThis->mSampleRate);
+// //Increment the frame counter
+// locThis->mUptoFrame += inFrames;
+// //Make the end frame counter
+//
+// //REFERENCE_TIME locFrameEnd = locThis->CurrentStartTime() + (((__int64)(locThis->mUptoFrame * UNITS)) / locThis->mSampleRate);
+// REFERENCE_TIME locFrameEnd = locTimeBase + (((__int64)(locThis->mUptoFrame * UNITS)) / locThis->mSampleRate);
+// locThis->mPreviousEndTime = locFrameEnd;
+//
+//
+//
+// //locThis->debugLog<<"Start : "<<locFrameStart<<endl;
+// //locThis->debugLog<<"End : "<<locFrameEnd<<endl;
+// //locThis->debugLog<<"=================================================="<<endl;
+// IMediaSample* locSample;
+// HRESULT locHR = locThis->mOutputPin->GetDeliveryBuffer(&locSample, &locFrameStart, &locFrameEnd, NULL);
+//
+// if (locHR != S_OK) {
+// return -1;
+// }
+//
+//
+// //Create pointers for the samples buffer to be assigned to
+// BYTE* locBuffer = NULL;
+// signed short* locShortBuffer = NULL;
+//
+// locSample->GetPointer(&locBuffer);
+// locShortBuffer = (short *) locBuffer;
+//
+// signed short tempInt = 0;
+// float tempFloat = 0;
+//
+// //FIX:::Move the clipping to the abstract function
+//
+// if (locSample->GetSize() >= locActualSize) {
+// //Do float to int conversion with clipping
+// const float SINT_MAX_AS_FLOAT = 32767.0f;
+// for (unsigned long i = 0; i < locTotalFrameCount; i++) {
+// //Clipping because vorbis puts out floats out of range -1 to 1
+// if (((float*)inPCM)[i] <= -1.0f) {
+// tempInt = SINT_MIN;
+// } else if (((float*)inPCM)[i] >= 1.0f) {
+// tempInt = SINT_MAX;
+// } else {
+// //FIX:::Take out the unnescessary variable.
+// tempFloat = ((( (float*) inPCM )[i]) * SINT_MAX_AS_FLOAT);
+// //ASSERT((tempFloat <= 32767.0f) && (tempFloat >= -32786.0f));
+// tempInt = (signed short)(tempFloat);
+// //tempInt = (signed short) ((( (float*) inPCM )[i]) * SINT_MAX_AS_FLOAT);
+// }
+//
+// *locShortBuffer = tempInt;
+// locShortBuffer++;
+// }
+//
+// //Set the sample parameters.
+// locThis->SetSampleParams(locSample, locActualSize, &locFrameStart, &locFrameEnd);
+//
+// {
+//
+// CAutoLock locLock(locThis->m_pLock);
+//
+// //Add a reference so it isn't deleted en route.... or not
+// //locSample->AddRef();
+// HRESULT lHR = locThis->mOutputPin->mDataQueue->Receive(locSample);
+// if (lHR != S_OK) {
+// DbgLog((LOG_TRACE,1,TEXT("Queue rejected us...")));
+// return -1;
+// }
+// }
+//
+// //Don't Release the sample it gets done for us !
+// //locSample->Release();
+//
+// return 0;
+// } else {
+// throw 0;
+// }
+// } else {
+// DbgLog((LOG_TRACE,1,TEXT("Fishsound sending stuff we aren't ready for...")));
+// return -1;
+// }
+//
+//}
+//
+//
+//
+//long VorbisDecodeInputPin::decodeData(BYTE* inBuf, long inNumBytes)
+//{
+// //debugLog << "Decode called... Last Gran Pos : "<<mLastSeenStartGranPos<<endl;
+// DbgLog((LOG_TRACE,1,TEXT("decodeData")));
+// long locErr = fish_sound_decode(mFishSound, inBuf, inNumBytes);
+// //FIX::: Do something here ?
+// if (locErr < 0) {
+// //debugLog <<"** Fish Sound error **"<<endl;
+// } else {
+// //debugLog << "Fish Sound OK >=0 "<<endl;
+// }
+// return locErr;
+//}
+//
+//
+//HRESULT VorbisDecodeInputPin::SetMediaType(const CMediaType* inMediaType) {
+// //FIX:::Error checking
+// //RESOLVED::: Bit better.
+//
+// if (inMediaType->subtype == MEDIASUBTYPE_Vorbis) {
+// ((VorbisDecodeFilter*)mParentFilter)->setVorbisFormat((sVorbisFormatBlock*)inMediaType->pbFormat);
+// mParentFilter->mAudioFormat = AbstractAudioDecodeFilter::VORBIS;
+// } else {
+// throw 0;
+// }
+// return CBaseInputPin::SetMediaType(inMediaType);
+//}
+//
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,135 +1,135 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include <vector>
-#include <fstream>
-using namespace std;
-#include "vorbisdecoderdllstuff.h"
-#include "AbstractTransformInputPin.h"
-#include "VorbisDecodeInputPin.h"
-
-#include "VorbisDecodeFilter.h"
-
-extern "C" {
-//#include <fishsound/fishsound.h>
-#include "fish_cdecl.h"
-}
-
-class VorbisDecodeOutputPin;
-
-class VorbisDecodeInputPin
- : public AbstractTransformInputPin
-{
-public:
-
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
- VorbisDecodeInputPin(AbstractTransformFilter* inFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes);
- virtual ~VorbisDecodeInputPin(void);
- static int __cdecl VorbisDecoded (FishSound* inFishSound, float** inPCM, long inFrames, void* inThisPointer);
-
- virtual HRESULT SetMediaType(const CMediaType* inMediaType);
-
- virtual STDMETHODIMP NewSegment(REFERENCE_TIME inStartTime, REFERENCE_TIME inStopTime, double inRate);
-
-
-protected:
- //fstream debugLog;
-
-
-
- //Implementation of virtuals from AbstractTransform Filter
- virtual bool ConstructCodec();
- virtual void DestroyCodec();
- virtual HRESULT TransformData(unsigned char* inBuf, long inNumBytes);
-
- HRESULT mHR;
- bool mBegun;
-
- FishSound* mFishSound;
- FishSoundInfo mFishInfo;
-
- int mNumChannels;
- int mFrameSize;
- int mSampleRate;
- unsigned int mUptoFrame;
-
-};
-
-
-//Old imp
-//************************************************************
-//#pragma once
-//#include <fstream>
-//using namespace std;
-//#include "vorbisdecoderdllstuff.h"
-//#include "AbstractAudioDecodeInputPin.h"
-//#include "VorbisDecodeInputPin.h"
-//
-//#include "VorbisDecodeFilter.h"
-//
-//extern "C" {
-////#include <fishsound/fishsound.h>
-//#include "fish_cdecl.h"
-//}
-//
-//class VorbisDecodeOutputPin;
-//
-//class VorbisDecodeInputPin
-// : public AbstractAudioDecodeInputPin
-//{
-//public:
-//
-// DECLARE_IUNKNOWN
-// STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-// VorbisDecodeInputPin(AbstractAudioDecodeFilter* inFilter, CCritSec* inFilterLock, AbstractAudioDecodeOutputPin* inOutputPin, CMediaType* inAcceptMediaType);
-// virtual ~VorbisDecodeInputPin(void);
-// static int __cdecl VorbisDecoded (FishSound* inFishSound, float** inPCM, long inFrames, void* inThisPointer);
-//
-// virtual HRESULT SetMediaType(const CMediaType* inMediaType);
-//
-// //VIRTUAL FUNCTIONS - AbstractAudioDecodeInputPin
-// //FIX:::These should be protected.
-// virtual bool ConstructCodec();
-// virtual void DestroyCodec();
-//
-// long decodeData(unsigned char* inBuf, long inNumBytes);
-//
-//protected:
-//
-// HRESULT mHR;
-// bool mBegun;
-//
-// FishSound* mFishSound;
-// FishSoundInfo mFishInfo;
-//
-//};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include <vector>
+#include <fstream>
+using namespace std;
+#include "vorbisdecoderdllstuff.h"
+#include "AbstractTransformInputPin.h"
+#include "VorbisDecodeInputPin.h"
+
+#include "VorbisDecodeFilter.h"
+
+extern "C" {
+//#include <fishsound/fishsound.h>
+#include "fish_cdecl.h"
+}
+
+class VorbisDecodeOutputPin;
+
+class VorbisDecodeInputPin
+ : public AbstractTransformInputPin
+{
+public:
+
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+ VorbisDecodeInputPin(AbstractTransformFilter* inFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes);
+ virtual ~VorbisDecodeInputPin(void);
+ static int __cdecl VorbisDecoded (FishSound* inFishSound, float** inPCM, long inFrames, void* inThisPointer);
+
+ virtual HRESULT SetMediaType(const CMediaType* inMediaType);
+
+ virtual STDMETHODIMP NewSegment(REFERENCE_TIME inStartTime, REFERENCE_TIME inStopTime, double inRate);
+
+
+protected:
+ //fstream debugLog;
+
+
+
+ //Implementation of virtuals from AbstractTransform Filter
+ virtual bool ConstructCodec();
+ virtual void DestroyCodec();
+ virtual HRESULT TransformData(unsigned char* inBuf, long inNumBytes);
+
+ HRESULT mHR;
+ bool mBegun;
+
+ FishSound* mFishSound;
+ FishSoundInfo mFishInfo;
+
+ int mNumChannels;
+ int mFrameSize;
+ int mSampleRate;
+ unsigned int mUptoFrame;
+
+};
+
+
+//Old imp
+//************************************************************
+//#pragma once
+//#include <fstream>
+//using namespace std;
+//#include "vorbisdecoderdllstuff.h"
+//#include "AbstractAudioDecodeInputPin.h"
+//#include "VorbisDecodeInputPin.h"
+//
+//#include "VorbisDecodeFilter.h"
+//
+//extern "C" {
+////#include <fishsound/fishsound.h>
+//#include "fish_cdecl.h"
+//}
+//
+//class VorbisDecodeOutputPin;
+//
+//class VorbisDecodeInputPin
+// : public AbstractAudioDecodeInputPin
+//{
+//public:
+//
+// DECLARE_IUNKNOWN
+// STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+// VorbisDecodeInputPin(AbstractAudioDecodeFilter* inFilter, CCritSec* inFilterLock, AbstractAudioDecodeOutputPin* inOutputPin, CMediaType* inAcceptMediaType);
+// virtual ~VorbisDecodeInputPin(void);
+// static int __cdecl VorbisDecoded (FishSound* inFishSound, float** inPCM, long inFrames, void* inThisPointer);
+//
+// virtual HRESULT SetMediaType(const CMediaType* inMediaType);
+//
+// //VIRTUAL FUNCTIONS - AbstractAudioDecodeInputPin
+// //FIX:::These should be protected.
+// virtual bool ConstructCodec();
+// virtual void DestroyCodec();
+//
+// long decodeData(unsigned char* inBuf, long inNumBytes);
+//
+//protected:
+//
+// HRESULT mHR;
+// bool mBegun;
+//
+// FishSound* mFishSound;
+// FishSoundInfo mFishInfo;
+//
+//};
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeInputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeOutputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeOutputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeOutputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,115 +1,115 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "Vorbisdecodeoutputpin.h"
-
-VorbisDecodeOutputPin::VorbisDecodeOutputPin(VorbisDecodeFilter* inParentFilter, CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes)
- : AbstractTransformOutputPin(inParentFilter, inFilterLock,NAME("VorbisDecodeOutputPin"), L"PCM Out", 65536, 20, inAcceptableMediaTypes)
-{
-
-
-}
-VorbisDecodeOutputPin::~VorbisDecodeOutputPin(void)
-{
-
-
-}
-
-STDMETHODIMP VorbisDecodeOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
- if (riid == IID_IMediaSeeking) {
- *ppv = (IMediaSeeking*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- }
-
- return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
-}
-
-HRESULT VorbisDecodeOutputPin::CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition)
-{
- if (inPosition == 0) {
- WAVEFORMATEX* locWaveFormat = (WAVEFORMATEX*)outMediaType->AllocFormatBuffer(sizeof(WAVEFORMATEX));
- //TODO::: Check for null ?
-
- locWaveFormat->wFormatTag = WAVE_FORMAT_PCM;
- locWaveFormat->nChannels = ((VorbisDecodeFilter*)m_pFilter)->mVorbisFormatInfo->numChannels;
- locWaveFormat->nSamplesPerSec = ((VorbisDecodeFilter*)m_pFilter)->mVorbisFormatInfo->samplesPerSec;
- locWaveFormat->wBitsPerSample = 16;
- locWaveFormat->nBlockAlign = (locWaveFormat->nChannels) * (locWaveFormat->wBitsPerSample >> 3);
- locWaveFormat->nAvgBytesPerSec = ((locWaveFormat->nChannels) * (locWaveFormat->wBitsPerSample >> 3)) * locWaveFormat->nSamplesPerSec;
- locWaveFormat->cbSize = 0;
- return S_OK;
- } else {
- return S_FALSE;
- }
-}
-
-
-//Old imp
-//****************************************************
-//#include "StdAfx.h"
-//#include "Vorbisdecodeoutputpin.h"
-//
-//VorbisDecodeOutputPin::VorbisDecodeOutputPin(VorbisDecodeFilter* inParentFilter, CCritSec* inFilterLock)
-// : AbstractAudioDecodeOutputPin(inParentFilter, inFilterLock,NAME("VorbisDecodeOutputPin"), L"PCM Out")
-//{
-//
-//
-//}
-//VorbisDecodeOutputPin::~VorbisDecodeOutputPin(void)
-//{
-//
-//
-//}
-//
-//STDMETHODIMP VorbisDecodeOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-//{
-// if (riid == IID_IMediaSeeking) {
-// *ppv = (IMediaSeeking*)this;
-// ((IUnknown*)*ppv)->AddRef();
-// return NOERROR;
-// }
-//
-// return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
-//}
-//
-//bool VorbisDecodeOutputPin::FillWaveFormatExBuffer(WAVEFORMATEX* inFormatBuffer) {
-// inFormatBuffer->wFormatTag = WAVE_FORMAT_PCM;
-// inFormatBuffer->nChannels = ((VorbisDecodeFilter*)m_pFilter)->mVorbisFormatInfo->numChannels;
-// inFormatBuffer->nSamplesPerSec = ((VorbisDecodeFilter*)m_pFilter)->mVorbisFormatInfo->samplesPerSec;
-// inFormatBuffer->wBitsPerSample = 16;
-// inFormatBuffer->nBlockAlign = (inFormatBuffer->nChannels) * (inFormatBuffer->wBitsPerSample >> 3);
-// inFormatBuffer->nAvgBytesPerSec = ((inFormatBuffer->nChannels) * (inFormatBuffer->wBitsPerSample >> 3)) * inFormatBuffer->nSamplesPerSec;
-// inFormatBuffer->cbSize = 0;
-// return true;
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "Vorbisdecodeoutputpin.h"
+
+VorbisDecodeOutputPin::VorbisDecodeOutputPin(VorbisDecodeFilter* inParentFilter, CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes)
+ : AbstractTransformOutputPin(inParentFilter, inFilterLock,NAME("VorbisDecodeOutputPin"), L"PCM Out", 65536, 20, inAcceptableMediaTypes)
+{
+
+
+}
+VorbisDecodeOutputPin::~VorbisDecodeOutputPin(void)
+{
+
+
+}
+
+STDMETHODIMP VorbisDecodeOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+ if (riid == IID_IMediaSeeking) {
+ *ppv = (IMediaSeeking*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ }
+
+ return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
+}
+
+HRESULT VorbisDecodeOutputPin::CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition)
+{
+ if (inPosition == 0) {
+ WAVEFORMATEX* locWaveFormat = (WAVEFORMATEX*)outMediaType->AllocFormatBuffer(sizeof(WAVEFORMATEX));
+ //TODO::: Check for null ?
+
+ locWaveFormat->wFormatTag = WAVE_FORMAT_PCM;
+ locWaveFormat->nChannels = ((VorbisDecodeFilter*)m_pFilter)->mVorbisFormatInfo->numChannels;
+ locWaveFormat->nSamplesPerSec = ((VorbisDecodeFilter*)m_pFilter)->mVorbisFormatInfo->samplesPerSec;
+ locWaveFormat->wBitsPerSample = 16;
+ locWaveFormat->nBlockAlign = (locWaveFormat->nChannels) * (locWaveFormat->wBitsPerSample >> 3);
+ locWaveFormat->nAvgBytesPerSec = ((locWaveFormat->nChannels) * (locWaveFormat->wBitsPerSample >> 3)) * locWaveFormat->nSamplesPerSec;
+ locWaveFormat->cbSize = 0;
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
+}
+
+
+//Old imp
+//****************************************************
+//#include "StdAfx.h"
+//#include "Vorbisdecodeoutputpin.h"
+//
+//VorbisDecodeOutputPin::VorbisDecodeOutputPin(VorbisDecodeFilter* inParentFilter, CCritSec* inFilterLock)
+// : AbstractAudioDecodeOutputPin(inParentFilter, inFilterLock,NAME("VorbisDecodeOutputPin"), L"PCM Out")
+//{
+//
+//
+//}
+//VorbisDecodeOutputPin::~VorbisDecodeOutputPin(void)
+//{
+//
+//
+//}
+//
+//STDMETHODIMP VorbisDecodeOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+//{
+// if (riid == IID_IMediaSeeking) {
+// *ppv = (IMediaSeeking*)this;
+// ((IUnknown*)*ppv)->AddRef();
+// return NOERROR;
+// }
+//
+// return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
+//}
+//
+//bool VorbisDecodeOutputPin::FillWaveFormatExBuffer(WAVEFORMATEX* inFormatBuffer) {
+// inFormatBuffer->wFormatTag = WAVE_FORMAT_PCM;
+// inFormatBuffer->nChannels = ((VorbisDecodeFilter*)m_pFilter)->mVorbisFormatInfo->numChannels;
+// inFormatBuffer->nSamplesPerSec = ((VorbisDecodeFilter*)m_pFilter)->mVorbisFormatInfo->samplesPerSec;
+// inFormatBuffer->wBitsPerSample = 16;
+// inFormatBuffer->nBlockAlign = (inFormatBuffer->nChannels) * (inFormatBuffer->wBitsPerSample >> 3);
+// inFormatBuffer->nAvgBytesPerSec = ((inFormatBuffer->nChannels) * (inFormatBuffer->wBitsPerSample >> 3)) * inFormatBuffer->nSamplesPerSec;
+// inFormatBuffer->cbSize = 0;
+// return true;
//}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeOutputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeOutputPin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeOutputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeOutputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,74 +1,74 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "vorbisdecoderdllstuff.h"
-#include "AbstractTransformOutputPin.h"
-
-
-class VorbisDecodeFilter;
-class VorbisDecodeOutputPin :
- public AbstractTransformOutputPin
-{
-public:
-
- friend class VorbisDecodeInputPin;
-
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
- VorbisDecodeOutputPin(VorbisDecodeFilter* inParentFilter,CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes);
- virtual ~VorbisDecodeOutputPin(void);
-protected:
- virtual HRESULT CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition);
- //virtual bool FillWaveFormatExBuffer(WAVEFORMATEX* inFormatBuffer);
-};
-
-//Old imp
-//*************************************
-//#pragma once
-//#include "vorbisdecoderdllstuff.h"
-//#include "AbstractAudioDecodeOutputPin.h"
-//
-//
-//class VorbisDecodeFilter;
-//class VorbisDecodeOutputPin :
-// public AbstractAudioDecodeOutputPin
-//{
-//public:
-// DECLARE_IUNKNOWN
-// STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-// VorbisDecodeOutputPin(VorbisDecodeFilter* inParentFilter,CCritSec* inFilterLock);
-// virtual ~VorbisDecodeOutputPin(void);
-//
-// virtual bool FillWaveFormatExBuffer(WAVEFORMATEX* inFormatBuffer);
-//};
-
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "vorbisdecoderdllstuff.h"
+#include "AbstractTransformOutputPin.h"
+
+
+class VorbisDecodeFilter;
+class VorbisDecodeOutputPin :
+ public AbstractTransformOutputPin
+{
+public:
+
+ friend class VorbisDecodeInputPin;
+
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+ VorbisDecodeOutputPin(VorbisDecodeFilter* inParentFilter,CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes);
+ virtual ~VorbisDecodeOutputPin(void);
+protected:
+ virtual HRESULT CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition);
+ //virtual bool FillWaveFormatExBuffer(WAVEFORMATEX* inFormatBuffer);
+};
+
+//Old imp
+//*************************************
+//#pragma once
+//#include "vorbisdecoderdllstuff.h"
+//#include "AbstractAudioDecodeOutputPin.h"
+//
+//
+//class VorbisDecodeFilter;
+//class VorbisDecodeOutputPin :
+// public AbstractAudioDecodeOutputPin
+//{
+//public:
+// DECLARE_IUNKNOWN
+// STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+// VorbisDecodeOutputPin(VorbisDecodeFilter* inParentFilter,CCritSec* inFilterLock);
+// virtual ~VorbisDecodeOutputPin(void);
+//
+// virtual bool FillWaveFormatExBuffer(WAVEFORMATEX* inFormatBuffer);
+//};
+
+
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/VorbisDecodeOutputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/dsfVorbisDecoder.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/dsfVorbisDecoder.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/dsfVorbisDecoder.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,12 +1,12 @@
-// dsfVorbisDecoder.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- return TRUE;
-}
-
+// dsfVorbisDecoder.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ return TRUE;
+}
+
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/dsfVorbisDecoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/fish_cdecl.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,39 +1,39 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.cpp : source file that includes just the standard includes
-// dsfVorbisDecoder.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.cpp : source file that includes just the standard includes
+// dsfVorbisDecoder.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,43 +1,43 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-// TODO: reference additional headers your program requires here
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/vorbisdecoderdllstuff.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/vorbisdecoderdllstuff.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/vorbisdecoderdllstuff.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,98 +1,98 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "vorbisdecoderdllstuff.h"
-
-extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
-BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
-{
- return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
-}
-
-
-//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
-STDAPI DllRegisterServer()
-{
-
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(TRUE);
-
-
-
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
-
-
- hr = locFilterMapper->RegisterFilter(
- CLSID_VorbisDecodeFilter, // Filter CLSID.
- L"Vorbis Decode Filter", // Filter name.
- NULL, // Device moniker.
- &CLSID_LegacyAmFilterCategory, // Direct Show general category
- L"Vorbis Decode Filter", // Instance data. ???????
- &VorbisDecodeFilterReg // Pointer to filter information.
- );
-
- locFilterMapper->Release();
-
- return hr;
-
-}
-
-STDAPI DllUnregisterServer()
-{
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(FALSE);
- if (FAILED(hr)) {
-
- return hr;
- }
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
- IID_IFilterMapper2, (void **)&locFilterMapper);
-
- if (FAILED(hr)) {
- return hr;
- }
-
-
- hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, L"Vorbis Decode Filter", CLSID_VorbisDecodeFilter);
-
-
- //
- locFilterMapper->Release();
- return hr;
-
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "vorbisdecoderdllstuff.h"
+
+extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
+BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+ return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
+}
+
+
+//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
+STDAPI DllRegisterServer()
+{
+
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(TRUE);
+
+
+
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
+
+
+ hr = locFilterMapper->RegisterFilter(
+ CLSID_VorbisDecodeFilter, // Filter CLSID.
+ L"Vorbis Decode Filter", // Filter name.
+ NULL, // Device moniker.
+ &CLSID_LegacyAmFilterCategory, // Direct Show general category
+ L"Vorbis Decode Filter", // Instance data. ???????
+ &VorbisDecodeFilterReg // Pointer to filter information.
+ );
+
+ locFilterMapper->Release();
+
+ return hr;
+
+}
+
+STDAPI DllUnregisterServer()
+{
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(FALSE);
+ if (FAILED(hr)) {
+
+ return hr;
+ }
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
+ IID_IFilterMapper2, (void **)&locFilterMapper);
+
+ if (FAILED(hr)) {
+ return hr;
+ }
+
+
+ hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, L"Vorbis Decode Filter", CLSID_VorbisDecodeFilter);
+
+
+ //
+ locFilterMapper->Release();
+ return hr;
+
+}
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/vorbisdecoderdllstuff.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/vorbisdecoderdllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/vorbisdecoderdllstuff.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/vorbisdecoderdllstuff.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,136 +1,136 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-//***************************** Old imp
-//#ifdef DSFABSTRACOGGAUDIODECODER_EXPORTS
-//#pragma message("----> Exporting from Abstract Library...")
-//#define ABS_AUDIO_DEC_API __declspec(dllexport)
-//#else
-//#pragma message("<---- Importing from Abstract Library...")
-//#define ABS_AUDIO_DEC_API __declspec(dllimport)
-//#endif
-//
-//
-//
-//#include "AbstractAudioDecodeFilter.h"
-//#include "AbstractAudioDecodeInputPin.h"
-//#include "AbstractAudioDecodeOutputPin.h"
-//***************************** Old imp ends
-
-
-//**************************** New imp
-
-#include "AbstractTransformFilter.h"
-#include "AbstractTransformInputPin.h"
-#include "AbstractTransformOutputPin.h"
-//****************************** New imp ends
-
-#include "VorbisDecodeInputPin.h"
-#include "VorbisDecodeOutputPin.h"
-#include "VorbisDecodeFilter.h"
-
-#ifdef LIBOOOGG_EXPORTS
-#define LIBOOOGG_API __declspec(dllexport)
-#else
-#define LIBOOOGG_API __declspec(dllimport)
-#endif
-
-// {05A1D945-A794-44ef-B41A-2F851A117155}
-DEFINE_GUID(CLSID_VorbisDecodeFilter,
-0x5a1d945, 0xa794, 0x44ef, 0xb4, 0x1a, 0x2f, 0x85, 0x1a, 0x11, 0x71, 0x55);
-
-// {8A0566AC-42B3-4ad9-ACA3-93B906DDF98A}
-DEFINE_GUID(MEDIASUBTYPE_Vorbis,
-0x8a0566ac, 0x42b3, 0x4ad9, 0xac, 0xa3, 0x93, 0xb9, 0x6, 0xdd, 0xf9, 0x8a);
-
-// {44E04F43-58B3-4de1-9BAA-8901F852DAE4}
-DEFINE_GUID(FORMAT_Vorbis,
-0x44e04f43, 0x58b3, 0x4de1, 0x9b, 0xaa, 0x89, 0x1, 0xf8, 0x52, 0xda, 0xe4);
-
-
-const REGPINTYPES VorbisDecodeOutputTypes = {
- &MEDIATYPE_Audio,
- &MEDIASUBTYPE_PCM
-};
-
-const REGPINTYPES VorbisDecodeInputTypes = {
- &MEDIATYPE_Audio,
- &MEDIASUBTYPE_Vorbis
-};
-
-const REGFILTERPINS VorbisDecodePinReg[] = {
- {
- L"Vorbis Input", //Name (obsoleted)
- FALSE, //Renders from this pin ?? Not sure about this.
- FALSE, //Not an output pin
- FALSE, //Cannot have zero instances of this pin
- FALSE, //Cannot have more than one instance of this pin
- NULL, //Connects to filter (obsoleted)
- NULL, //Connects to pin (obsoleted)
- 1, //upport two media type
- &VorbisDecodeInputTypes //Pointer to media type (Audio/Vorbis or Audio/Speex)
- } ,
-
- {
- L"PCM Output", //Name (obsoleted)
- FALSE, //Renders from this pin ?? Not sure about this.
- TRUE, //Is an output pin
- FALSE, //Cannot have zero instances of this pin
- FALSE, //Cannot have more than one instance of this pin
- NULL, //Connects to filter (obsoleted)
- NULL, //Connects to pin (obsoleted)
- 1, //Only support one media type
- &VorbisDecodeOutputTypes //Pointer to media type (Audio/PCM)
-
- }
-};
-
-
-
-const REGFILTER2 VorbisDecodeFilterReg = {
- 1,
- MERIT_NORMAL,
- 2,
- VorbisDecodePinReg
-
-};
-
-
-struct sVorbisFormatBlock {
- unsigned long vorbisVersion;
- unsigned long samplesPerSec;
- unsigned long minBitsPerSec;
- unsigned long avgBitsPerSec;
- unsigned long maxBitsPerSec;
- unsigned char numChannels;
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+//***************************** Old imp
+//#ifdef DSFABSTRACOGGAUDIODECODER_EXPORTS
+//#pragma message("----> Exporting from Abstract Library...")
+//#define ABS_AUDIO_DEC_API __declspec(dllexport)
+//#else
+//#pragma message("<---- Importing from Abstract Library...")
+//#define ABS_AUDIO_DEC_API __declspec(dllimport)
+//#endif
+//
+//
+//
+//#include "AbstractAudioDecodeFilter.h"
+//#include "AbstractAudioDecodeInputPin.h"
+//#include "AbstractAudioDecodeOutputPin.h"
+//***************************** Old imp ends
+
+
+//**************************** New imp
+
+#include "AbstractTransformFilter.h"
+#include "AbstractTransformInputPin.h"
+#include "AbstractTransformOutputPin.h"
+//****************************** New imp ends
+
+#include "VorbisDecodeInputPin.h"
+#include "VorbisDecodeOutputPin.h"
+#include "VorbisDecodeFilter.h"
+
+#ifdef LIBOOOGG_EXPORTS
+#define LIBOOOGG_API __declspec(dllexport)
+#else
+#define LIBOOOGG_API __declspec(dllimport)
+#endif
+
+// {05A1D945-A794-44ef-B41A-2F851A117155}
+DEFINE_GUID(CLSID_VorbisDecodeFilter,
+0x5a1d945, 0xa794, 0x44ef, 0xb4, 0x1a, 0x2f, 0x85, 0x1a, 0x11, 0x71, 0x55);
+
+// {8A0566AC-42B3-4ad9-ACA3-93B906DDF98A}
+DEFINE_GUID(MEDIASUBTYPE_Vorbis,
+0x8a0566ac, 0x42b3, 0x4ad9, 0xac, 0xa3, 0x93, 0xb9, 0x6, 0xdd, 0xf9, 0x8a);
+
+// {44E04F43-58B3-4de1-9BAA-8901F852DAE4}
+DEFINE_GUID(FORMAT_Vorbis,
+0x44e04f43, 0x58b3, 0x4de1, 0x9b, 0xaa, 0x89, 0x1, 0xf8, 0x52, 0xda, 0xe4);
+
+
+const REGPINTYPES VorbisDecodeOutputTypes = {
+ &MEDIATYPE_Audio,
+ &MEDIASUBTYPE_PCM
+};
+
+const REGPINTYPES VorbisDecodeInputTypes = {
+ &MEDIATYPE_Audio,
+ &MEDIASUBTYPE_Vorbis
+};
+
+const REGFILTERPINS VorbisDecodePinReg[] = {
+ {
+ L"Vorbis Input", //Name (obsoleted)
+ FALSE, //Renders from this pin ?? Not sure about this.
+ FALSE, //Not an output pin
+ FALSE, //Cannot have zero instances of this pin
+ FALSE, //Cannot have more than one instance of this pin
+ NULL, //Connects to filter (obsoleted)
+ NULL, //Connects to pin (obsoleted)
+ 1, //upport two media type
+ &VorbisDecodeInputTypes //Pointer to media type (Audio/Vorbis or Audio/Speex)
+ } ,
+
+ {
+ L"PCM Output", //Name (obsoleted)
+ FALSE, //Renders from this pin ?? Not sure about this.
+ TRUE, //Is an output pin
+ FALSE, //Cannot have zero instances of this pin
+ FALSE, //Cannot have more than one instance of this pin
+ NULL, //Connects to filter (obsoleted)
+ NULL, //Connects to pin (obsoleted)
+ 1, //Only support one media type
+ &VorbisDecodeOutputTypes //Pointer to media type (Audio/PCM)
+
+ }
+};
+
+
+
+const REGFILTER2 VorbisDecodeFilterReg = {
+ 1,
+ MERIT_NORMAL,
+ 2,
+ VorbisDecodePinReg
+
+};
+
+
+struct sVorbisFormatBlock {
+ unsigned long vorbisVersion;
+ unsigned long samplesPerSec;
+ unsigned long minBitsPerSec;
+ unsigned long avgBitsPerSec;
+ unsigned long maxBitsPerSec;
+ unsigned char numChannels;
};
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisDecoder/vorbisdecoderdllstuff.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeFilter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeFilter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,105 +1,105 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "vorbisencodefilter.h"
-
-
-//COM Factory Template
-CFactoryTemplate g_Templates[] =
-{
- {
- L"Vorbis Encode Filter", // Name
- &CLSID_VorbisEncodeFilter, // CLSID
- VorbisEncodeFilter::CreateInstance, // Method to create an instance of MyComponent
- NULL, // Initialization function
- NULL // Set-up information (for filters)
- }
-
-};
-
-// Generic way of determining the number of items in the template
-int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
-
-CUnknown* WINAPI VorbisEncodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
-{
- //This routine is the COM implementation to create a new Filter
- VorbisEncodeFilter *pNewObject = new VorbisEncodeFilter();
- if (pNewObject == NULL) {
- *pHr = E_OUTOFMEMORY;
- }
- return pNewObject;
-}
-
-VorbisEncodeFilter::VorbisEncodeFilter(void)
- : AbstractTransformFilter(NAME("Vorbis Encoder"), CLSID_VorbisEncodeFilter)
-{
- bool locWasConstructed = ConstructPins();
- //Error checks ??
-}
-
-VorbisEncodeFilter::~VorbisEncodeFilter(void)
-{
-}
-
-bool VorbisEncodeFilter::ConstructPins()
-{
- //Inputs Audio / PCM / WaveFormatEx
- //Outputs Audio / Vorbis / Vorbis
-
- //Vector to hold our set of media types we want to accept.
- vector<CMediaType*> locAcceptableTypes;
-
- //Setup the media types for the output pin.
- CMediaType* locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted in pin destructor
- locAcceptMediaType->subtype = MEDIASUBTYPE_Vorbis;
- locAcceptMediaType->formattype = FORMAT_Vorbis;
-
- locAcceptableTypes.push_back(locAcceptMediaType);
-
- //Output pin must be done first because it's passed to the input pin.
- mOutputPin = new VorbisEncodeOutputPin(this, m_pLock, locAcceptableTypes); //Deleted in base class destructor
-
- //Clear out the vector, now we've already passed it to the output pin.
- locAcceptableTypes.clear();
-
- //Setup the media Types for the input pin.
- locAcceptMediaType = NULL;
- locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted by pin
-
- locAcceptMediaType->subtype = MEDIASUBTYPE_PCM;
- locAcceptMediaType->formattype = FORMAT_WaveFormatEx;
-
- locAcceptableTypes.push_back(locAcceptMediaType);
-
- mInputPin = new VorbisEncodeInputPin(this, m_pLock, mOutputPin, locAcceptableTypes); //Deleted in base class filter destructor.
- return true;
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "vorbisencodefilter.h"
+
+
+//COM Factory Template
+CFactoryTemplate g_Templates[] =
+{
+ {
+ L"Vorbis Encode Filter", // Name
+ &CLSID_VorbisEncodeFilter, // CLSID
+ VorbisEncodeFilter::CreateInstance, // Method to create an instance of MyComponent
+ NULL, // Initialization function
+ NULL // Set-up information (for filters)
+ }
+
+};
+
+// Generic way of determining the number of items in the template
+int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
+
+CUnknown* WINAPI VorbisEncodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
+{
+ //This routine is the COM implementation to create a new Filter
+ VorbisEncodeFilter *pNewObject = new VorbisEncodeFilter();
+ if (pNewObject == NULL) {
+ *pHr = E_OUTOFMEMORY;
+ }
+ return pNewObject;
+}
+
+VorbisEncodeFilter::VorbisEncodeFilter(void)
+ : AbstractTransformFilter(NAME("Vorbis Encoder"), CLSID_VorbisEncodeFilter)
+{
+ bool locWasConstructed = ConstructPins();
+ //Error checks ??
+}
+
+VorbisEncodeFilter::~VorbisEncodeFilter(void)
+{
+}
+
+bool VorbisEncodeFilter::ConstructPins()
+{
+ //Inputs Audio / PCM / WaveFormatEx
+ //Outputs Audio / Vorbis / Vorbis
+
+ //Vector to hold our set of media types we want to accept.
+ vector<CMediaType*> locAcceptableTypes;
+
+ //Setup the media types for the output pin.
+ CMediaType* locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted in pin destructor
+ locAcceptMediaType->subtype = MEDIASUBTYPE_Vorbis;
+ locAcceptMediaType->formattype = FORMAT_Vorbis;
+
+ locAcceptableTypes.push_back(locAcceptMediaType);
+
+ //Output pin must be done first because it's passed to the input pin.
+ mOutputPin = new VorbisEncodeOutputPin(this, m_pLock, locAcceptableTypes); //Deleted in base class destructor
+
+ //Clear out the vector, now we've already passed it to the output pin.
+ locAcceptableTypes.clear();
+
+ //Setup the media Types for the input pin.
+ locAcceptMediaType = NULL;
+ locAcceptMediaType = new CMediaType(&MEDIATYPE_Audio); //Deleted by pin
+
+ locAcceptMediaType->subtype = MEDIASUBTYPE_PCM;
+ locAcceptMediaType->formattype = FORMAT_WaveFormatEx;
+
+ locAcceptableTypes.push_back(locAcceptMediaType);
+
+ mInputPin = new VorbisEncodeInputPin(this, m_pLock, mOutputPin, locAcceptableTypes); //Deleted in base class filter destructor.
+ return true;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeFilter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeFilter.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeFilter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeFilter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,100 +1,100 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-//Local Includes
-#include "vorbisencoderdllstuff.h"
-
-//External Includes
-#include "AbstractTransformFilter.h"
-
-//Forward Declarations
-struct sVorbisFormatBlock;
-class VorbisEncodeInputPin;
-class VorbisEncodeOutputPin;
-
-class VorbisEncodeFilter
- : public AbstractTransformFilter
-{
-public:
- //Friend Classes
- friend class VorbisEncodeInputPin;
- friend class VorbisEncodeOutputPin;
-
- //Constructors
- VorbisEncodeFilter(void);
- virtual ~VorbisEncodeFilter(void);
-
- //COM Creator function
- static CUnknown* WINAPI VorbisEncodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
-
-protected:
-
- //Implementation of pure virtuals from AbstractTransformFilter
- virtual bool ConstructPins();
-
- //Member data
- sVorbisFormatBlock mVorbisFormatBlock;
-
-};
-
-
-//Old imp
-//*************************************
-//#pragma once
-//
-//#include "vorbisencoderdllstuff.h"
-//#include "AbstractAudioEncodeFilter.h"
-//
-////Forward Declarations
-//struct sVorbisFormatBlock;
-//class VorbisEncodeInputPin;
-//class VorbisEncodeOutputPin;
-//
-//class VorbisEncodeFilter
-// : public AbstractAudioEncodeFilter
-//{
-//public:
-// friend class VorbisEncodeInputPin;
-// friend class VorbisEncodeOutputPin;
-// VorbisEncodeFilter(void);
-// virtual ~VorbisEncodeFilter(void);
-//
-// static CUnknown* WINAPI VorbisEncodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
-//
-// //PURE VIRTUAL IMPLEMENTATION
-// virtual bool ConstructPins();
-//
-//protected:
-// sVorbisFormatBlock mVorbisFormatBlock;
-//
-//};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+//Local Includes
+#include "vorbisencoderdllstuff.h"
+
+//External Includes
+#include "AbstractTransformFilter.h"
+
+//Forward Declarations
+struct sVorbisFormatBlock;
+class VorbisEncodeInputPin;
+class VorbisEncodeOutputPin;
+
+class VorbisEncodeFilter
+ : public AbstractTransformFilter
+{
+public:
+ //Friend Classes
+ friend class VorbisEncodeInputPin;
+ friend class VorbisEncodeOutputPin;
+
+ //Constructors
+ VorbisEncodeFilter(void);
+ virtual ~VorbisEncodeFilter(void);
+
+ //COM Creator function
+ static CUnknown* WINAPI VorbisEncodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+
+protected:
+
+ //Implementation of pure virtuals from AbstractTransformFilter
+ virtual bool ConstructPins();
+
+ //Member data
+ sVorbisFormatBlock mVorbisFormatBlock;
+
+};
+
+
+//Old imp
+//*************************************
+//#pragma once
+//
+//#include "vorbisencoderdllstuff.h"
+//#include "AbstractAudioEncodeFilter.h"
+//
+////Forward Declarations
+//struct sVorbisFormatBlock;
+//class VorbisEncodeInputPin;
+//class VorbisEncodeOutputPin;
+//
+//class VorbisEncodeFilter
+// : public AbstractAudioEncodeFilter
+//{
+//public:
+// friend class VorbisEncodeInputPin;
+// friend class VorbisEncodeOutputPin;
+// VorbisEncodeFilter(void);
+// virtual ~VorbisEncodeFilter(void);
+//
+// static CUnknown* WINAPI VorbisEncodeFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+//
+// //PURE VIRTUAL IMPLEMENTATION
+// virtual bool ConstructPins();
+//
+//protected:
+// sVorbisFormatBlock mVorbisFormatBlock;
+//
+//};
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeFilter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeInputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeInputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,330 +1,330 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-
-
-#include "StdAfx.h"
-#include "VorbisEncodeInputPin.h"
-
-VorbisEncodeInputPin::VorbisEncodeInputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes)
- : AbstractTransformInputPin(inParentFilter, inFilterLock, inOutputPin, NAME("VorbisEncodeInputPin"), L"PCM In", inAcceptableMediaTypes)
- , mFishSound(NULL)
- , mWaveFormat(NULL)
- , mUptoFrame(0)
-{
-
-}
-
-VorbisEncodeInputPin::~VorbisEncodeInputPin(void)
-{
- DestroyCodec();
-}
-
-
-//PURE VIRTUALS
-HRESULT VorbisEncodeInputPin::TransformData(unsigned char* inBuf, long inNumBytes)
-{
-
- float* locFloatBuf = new float[inNumBytes/2];
- short locTempShort = 0;
- float locTempFloat = 0;
-
- for (int i = 0; i < inNumBytes; i += 2) {
- locTempShort = *((short*)(inBuf + i));
- locTempFloat = (float)locTempShort;
- locTempFloat /= 32767.0;
- locFloatBuf[i/2] = locTempFloat;;
- }
- //FIX::: The 2 is the size of a sample ie 16 bits
- long locErr = fish_sound_encode(mFishSound, (float**)locFloatBuf, inNumBytes/(mFishInfo.channels*2));
- delete[] locFloatBuf;
- //FIX::: Do something here ?
- if (locErr < 0) {
-
- } else {
-
- }
- return locErr;
-}
-bool VorbisEncodeInputPin::ConstructCodec() {
- mFishInfo.channels = mWaveFormat->nChannels;
- mFishInfo.format = FISH_SOUND_VORBIS;
- mFishInfo.samplerate = mWaveFormat->nSamplesPerSec;
-
- mFishInfo.format = FISH_SOUND_VORBIS;
- mFishSound = fish_sound_new (FISH_SOUND_ENCODE, &mFishInfo);
-
- //Change to fill in vorbis format block so muxer can work
- ((VorbisEncodeFilter*)mParentFilter)->mVorbisFormatBlock.numChannels = mWaveFormat->nChannels;
- ((VorbisEncodeFilter*)mParentFilter)->mVorbisFormatBlock.samplesPerSec = mWaveFormat->nSamplesPerSec;
- //
-
- int i = 1;
- //FIX::: Use new API for interleave setting
- fish_sound_command(mFishSound, FISH_SOUND_SET_INTERLEAVE, &i, sizeof(int));
-
- fish_sound_set_encoded_callback (mFishSound, VorbisEncodeInputPin::VorbisEncoded, this);
- //FIX::: Proper return value
- return true;
-
-}
-void VorbisEncodeInputPin::DestroyCodec()
-{
- fish_sound_delete(mFishSound);
- mFishSound = NULL;
-}
-
-
-//Encoded callback
-int VorbisEncodeInputPin::VorbisEncoded (FishSound* inFishSound, unsigned char* inPacketData, long inNumBytes, void* inThisPointer)
-{
-
- VorbisEncodeInputPin* locThis = reinterpret_cast<VorbisEncodeInputPin*> (inThisPointer);
- VorbisEncodeFilter* locFilter = reinterpret_cast<VorbisEncodeFilter*>(locThis->m_pFilter);
-
-
- //Time stamps are granule pos not directshow times - granule pos in vorbis is equivalent to frame number
-
- LONGLONG locFrameStart = locThis->mUptoFrame;
- LONGLONG locFrameEnd = locThis->mUptoFrame
- = fish_sound_get_frameno(locThis->mFishSound);
- //Get a pointer to a new sample stamped with our time
- IMediaSample* locSample;
- HRESULT locHR = locThis->mOutputPin->GetDeliveryBuffer(&locSample, &locFrameStart, &locFrameEnd, NULL);
-
- if (FAILED(locHR)) {
- //We get here when the application goes into stop mode usually.
- return locHR;
- }
-
- BYTE* locBuffer = NULL;
-
-
- //Make our pointers set to point to the samples buffer
- locSample->GetPointer(&locBuffer);
-
-
-
- if (locSample->GetSize() >= inNumBytes) {
-
- memcpy((void*)locBuffer, (const void*)inPacketData, inNumBytes);
-
- //Set the sample parameters.
- locThis->SetSampleParams(locSample, inNumBytes, &locFrameStart, &locFrameEnd);
-
- {
- CAutoLock locLock(locThis->m_pLock);
-
- //Add a reference so it isn't deleted en route.
- //locSample->AddRef();
- HRESULT locHR = ((VorbisEncodeOutputPin*)(locThis->mOutputPin))->mDataQueue->Receive(locSample); //->DownstreamFilter()->Receive(locSample);
- if (locHR != S_OK) {
-
- } else {
- }
- }
-
- return 0;
- } else {
- throw 0;
- }
-}
-
-
-HRESULT VorbisEncodeInputPin::SetMediaType(const CMediaType* inMediaType) {
- if ( (inMediaType->subtype == MEDIASUBTYPE_PCM) &&
- (inMediaType->formattype == FORMAT_WaveFormatEx)) {
-
- mWaveFormat = (WAVEFORMATEX*)inMediaType->pbFormat;
- //mParentFilter->mAudioFormat = AbstractAudioDecodeFilter::VORBIS;
- } else {
- //Failed... should never be here !
- throw 0;
- }
- //This is here and not the constructor because we need audio params from the
- // input pin to construct properly.
- ConstructCodec();
-
- return CBaseInputPin::SetMediaType(inMediaType);
-
-
-
-
- return S_OK;
-
-}
-
-//Old impl
-//************************************
-//#include "StdAfx.h"
-//#include "vorbisencodeinputpin.h"
-//
-//VorbisEncodeInputPin::VorbisEncodeInputPin(AbstractAudioEncodeFilter* inParentFilter, CCritSec* inFilterLock, AbstractAudioEncodeOutputPin* inOutputPin)
-// : AbstractAudioEncodeInputPin(inParentFilter, inFilterLock, inOutputPin, NAME("VorbisEncodeInputPin"), L"PCM In")
-// , mFishSound(NULL)
-//{
-//
-//}
-//
-//VorbisEncodeInputPin::~VorbisEncodeInputPin(void)
-//{
-// DestroyCodec();
-//}
-//
-//
-////PURE VIRTUALS
-//long VorbisEncodeInputPin::encodeData(unsigned char* inBuf, long inNumBytes) {
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
//
-//
-//
-// float* locFloatBuf = new float[inNumBytes/2];
-// short locTempShort = 0;
-// float locTempFloat = 0;
-//
-// //__int64 locGranPos = 0;
-// //locGranPos = fish_sound_get_frameno(mFishSound);
-// //Removed the hack
-// //fish_sound_command(mFishSound, 7, &locGranPos, sizeof(__int64));
-// //
-//
-// //mUptoFrame = locGranPos;
-// //__int64 locTemp = ((FishSoundVorbisInfo*)mFishSound->codec_data)->vd.pcm_returned;
-// for (int i = 0; i < inNumBytes; i += 2) {
-// locTempShort = *((short*)(inBuf + i));
-// locTempFloat = (float)locTempShort;
-// locTempFloat /= 32767.0;
-// locFloatBuf[i/2] = locTempFloat;;
-// }
-// //FIX::: The 2 is the size of a sample ie 16 bits
-// long locErr = fish_sound_encode(mFishSound, (float**)locFloatBuf, inNumBytes/(mFishInfo.channels*2));
-// delete[] locFloatBuf;
-// //FIX::: Do something here ?
-// if (locErr < 0) {
-//
-// } else {
-//
-// }
-// return locErr;
-//}
-//bool VorbisEncodeInputPin::ConstructCodec() {
-// mFishInfo.channels = mWaveFormat->nChannels;
-// mFishInfo.format = FISH_SOUND_VORBIS;
-// mFishInfo.samplerate = mWaveFormat->nSamplesPerSec;
-//
-// mFishInfo.format = FISH_SOUND_VORBIS;
-// mFishSound = fish_sound_new (FISH_SOUND_ENCODE, &mFishInfo);
-//
-// //Change to fill in vorbis format block so muxer can work
-// ((VorbisEncodeFilter*)mParentFilter)->mVorbisFormatBlock.numChannels = mWaveFormat->nChannels;
-// ((VorbisEncodeFilter*)mParentFilter)->mVorbisFormatBlock.samplesPerSec = mWaveFormat->nSamplesPerSec;
-// //
-//
-// int i = 1;
-// //FIX::: Use new API for interleave setting
-// fish_sound_command(mFishSound, FISH_SOUND_SET_INTERLEAVE, &i, sizeof(int));
-//
-// fish_sound_set_encoded_callback (mFishSound, VorbisEncodeInputPin::VorbisEncoded, this);
-// //FIX::: Proper return value
-// return true;
-//
-//}
-//void VorbisEncodeInputPin::DestroyCodec() {
-// fish_sound_delete(mFishSound);
-// mFishSound = NULL;
-//}
-//
-//
-////Encoded callback
-//int VorbisEncodeInputPin::VorbisEncoded (FishSound* inFishSound, unsigned char* inPacketData, long inNumBytes, void* inThisPointer)
-//{
-//
-// VorbisEncodeInputPin* locThis = reinterpret_cast<VorbisEncodeInputPin*> (inThisPointer);
-// VorbisEncodeFilter* locFilter = reinterpret_cast<VorbisEncodeFilter*>(locThis->m_pFilter);
-//
-//
-// //Time stamps are granule pos not directshow times
-//
-// LONGLONG locFrameStart = locThis->mUptoFrame;
-// LONGLONG locFrameEnd = locThis->mUptoFrame
-// = fish_sound_get_frameno(locThis->mFishSound);
-// //Get a pointer to a new sample stamped with our time
-// IMediaSample* locSample;
-// HRESULT locHR = locThis->mOutputPin->GetDeliveryBuffer(&locSample, &locFrameStart, &locFrameEnd, NULL);
-//
-// if (FAILED(locHR)) {
-// //We get here when the application goes into stop mode usually.
-// return locHR;
-// }
-//
-// BYTE* locBuffer = NULL;
-//
-//
-// //Make our pointers set to point to the samples buffer
-// locSample->GetPointer(&locBuffer);
-//
-//
-//
-// if (locSample->GetSize() >= inNumBytes) {
-//
-// memcpy((void*)locBuffer, (const void*)inPacketData, inNumBytes);
-//
-// //Set the sample parameters.
-// locThis->SetSampleParams(locSample, inNumBytes, &locFrameStart, &locFrameEnd);
-//
-// {
-// CAutoLock locLock(locThis->m_pLock);
-//
-// //Add a reference so it isn't deleted en route.
-// //locSample->AddRef();
-// HRESULT locHR = locThis->mOutputPin->mDataQueue->Receive(locSample); //->DownstreamFilter()->Receive(locSample);
-// if (locHR != S_OK) {
-//
-// } else {
-// }
-// }
-//
-// return 0;
-// } else {
-// throw 0;
-// }
-//}
-//
-//
-//HRESULT VorbisEncodeInputPin::SetMediaType(const CMediaType* inMediaType) {
-// AbstractAudioEncodeInputPin::SetMediaType(inMediaType);
-//
-// ConstructCodec();
-//
-//
-// return S_OK;
-//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+
+
+#include "StdAfx.h"
+#include "VorbisEncodeInputPin.h"
+
+VorbisEncodeInputPin::VorbisEncodeInputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes)
+ : AbstractTransformInputPin(inParentFilter, inFilterLock, inOutputPin, NAME("VorbisEncodeInputPin"), L"PCM In", inAcceptableMediaTypes)
+ , mFishSound(NULL)
+ , mWaveFormat(NULL)
+ , mUptoFrame(0)
+{
+
+}
+
+VorbisEncodeInputPin::~VorbisEncodeInputPin(void)
+{
+ DestroyCodec();
+}
+
+
+//PURE VIRTUALS
+HRESULT VorbisEncodeInputPin::TransformData(unsigned char* inBuf, long inNumBytes)
+{
+
+ float* locFloatBuf = new float[inNumBytes/2];
+ short locTempShort = 0;
+ float locTempFloat = 0;
+
+ for (int i = 0; i < inNumBytes; i += 2) {
+ locTempShort = *((short*)(inBuf + i));
+ locTempFloat = (float)locTempShort;
+ locTempFloat /= 32767.0;
+ locFloatBuf[i/2] = locTempFloat;;
+ }
+ //FIX::: The 2 is the size of a sample ie 16 bits
+ long locErr = fish_sound_encode(mFishSound, (float**)locFloatBuf, inNumBytes/(mFishInfo.channels*2));
+ delete[] locFloatBuf;
+ //FIX::: Do something here ?
+ if (locErr < 0) {
+
+ } else {
+
+ }
+ return locErr;
+}
+bool VorbisEncodeInputPin::ConstructCodec() {
+ mFishInfo.channels = mWaveFormat->nChannels;
+ mFishInfo.format = FISH_SOUND_VORBIS;
+ mFishInfo.samplerate = mWaveFormat->nSamplesPerSec;
+
+ mFishInfo.format = FISH_SOUND_VORBIS;
+ mFishSound = fish_sound_new (FISH_SOUND_ENCODE, &mFishInfo);
+
+ //Change to fill in vorbis format block so muxer can work
+ ((VorbisEncodeFilter*)mParentFilter)->mVorbisFormatBlock.numChannels = mWaveFormat->nChannels;
+ ((VorbisEncodeFilter*)mParentFilter)->mVorbisFormatBlock.samplesPerSec = mWaveFormat->nSamplesPerSec;
+ //
+
+ int i = 1;
+ //FIX::: Use new API for interleave setting
+ fish_sound_command(mFishSound, FISH_SOUND_SET_INTERLEAVE, &i, sizeof(int));
+
+ fish_sound_set_encoded_callback (mFishSound, VorbisEncodeInputPin::VorbisEncoded, this);
+ //FIX::: Proper return value
+ return true;
+
+}
+void VorbisEncodeInputPin::DestroyCodec()
+{
+ fish_sound_delete(mFishSound);
+ mFishSound = NULL;
+}
+
+
+//Encoded callback
+int VorbisEncodeInputPin::VorbisEncoded (FishSound* inFishSound, unsigned char* inPacketData, long inNumBytes, void* inThisPointer)
+{
+
+ VorbisEncodeInputPin* locThis = reinterpret_cast<VorbisEncodeInputPin*> (inThisPointer);
+ VorbisEncodeFilter* locFilter = reinterpret_cast<VorbisEncodeFilter*>(locThis->m_pFilter);
+
+
+ //Time stamps are granule pos not directshow times - granule pos in vorbis is equivalent to frame number
+
+ LONGLONG locFrameStart = locThis->mUptoFrame;
+ LONGLONG locFrameEnd = locThis->mUptoFrame
+ = fish_sound_get_frameno(locThis->mFishSound);
+ //Get a pointer to a new sample stamped with our time
+ IMediaSample* locSample;
+ HRESULT locHR = locThis->mOutputPin->GetDeliveryBuffer(&locSample, &locFrameStart, &locFrameEnd, NULL);
+
+ if (FAILED(locHR)) {
+ //We get here when the application goes into stop mode usually.
+ return locHR;
+ }
+
+ BYTE* locBuffer = NULL;
+
+
+ //Make our pointers set to point to the samples buffer
+ locSample->GetPointer(&locBuffer);
+
+
+
+ if (locSample->GetSize() >= inNumBytes) {
+
+ memcpy((void*)locBuffer, (const void*)inPacketData, inNumBytes);
+
+ //Set the sample parameters.
+ locThis->SetSampleParams(locSample, inNumBytes, &locFrameStart, &locFrameEnd);
+
+ {
+ CAutoLock locLock(locThis->m_pLock);
+
+ //Add a reference so it isn't deleted en route.
+ //locSample->AddRef();
+ HRESULT locHR = ((VorbisEncodeOutputPin*)(locThis->mOutputPin))->mDataQueue->Receive(locSample); //->DownstreamFilter()->Receive(locSample);
+ if (locHR != S_OK) {
+
+ } else {
+ }
+ }
+
+ return 0;
+ } else {
+ throw 0;
+ }
+}
+
+
+HRESULT VorbisEncodeInputPin::SetMediaType(const CMediaType* inMediaType) {
+ if ( (inMediaType->subtype == MEDIASUBTYPE_PCM) &&
+ (inMediaType->formattype == FORMAT_WaveFormatEx)) {
+
+ mWaveFormat = (WAVEFORMATEX*)inMediaType->pbFormat;
+ //mParentFilter->mAudioFormat = AbstractAudioDecodeFilter::VORBIS;
+ } else {
+ //Failed... should never be here !
+ throw 0;
+ }
+ //This is here and not the constructor because we need audio params from the
+ // input pin to construct properly.
+ ConstructCodec();
+
+ return CBaseInputPin::SetMediaType(inMediaType);
+
+
+
+
+ return S_OK;
+
+}
+
+//Old impl
+//************************************
+//#include "StdAfx.h"
+//#include "vorbisencodeinputpin.h"
+//
+//VorbisEncodeInputPin::VorbisEncodeInputPin(AbstractAudioEncodeFilter* inParentFilter, CCritSec* inFilterLock, AbstractAudioEncodeOutputPin* inOutputPin)
+// : AbstractAudioEncodeInputPin(inParentFilter, inFilterLock, inOutputPin, NAME("VorbisEncodeInputPin"), L"PCM In")
+// , mFishSound(NULL)
+//{
+//
+//}
+//
+//VorbisEncodeInputPin::~VorbisEncodeInputPin(void)
+//{
+// DestroyCodec();
+//}
+//
+//
+////PURE VIRTUALS
+//long VorbisEncodeInputPin::encodeData(unsigned char* inBuf, long inNumBytes) {
+//
+//
+//
+//
+// float* locFloatBuf = new float[inNumBytes/2];
+// short locTempShort = 0;
+// float locTempFloat = 0;
+//
+// //__int64 locGranPos = 0;
+// //locGranPos = fish_sound_get_frameno(mFishSound);
+// //Removed the hack
+// //fish_sound_command(mFishSound, 7, &locGranPos, sizeof(__int64));
+// //
+//
+// //mUptoFrame = locGranPos;
+// //__int64 locTemp = ((FishSoundVorbisInfo*)mFishSound->codec_data)->vd.pcm_returned;
+// for (int i = 0; i < inNumBytes; i += 2) {
+// locTempShort = *((short*)(inBuf + i));
+// locTempFloat = (float)locTempShort;
+// locTempFloat /= 32767.0;
+// locFloatBuf[i/2] = locTempFloat;;
+// }
+// //FIX::: The 2 is the size of a sample ie 16 bits
+// long locErr = fish_sound_encode(mFishSound, (float**)locFloatBuf, inNumBytes/(mFishInfo.channels*2));
+// delete[] locFloatBuf;
+// //FIX::: Do something here ?
+// if (locErr < 0) {
+//
+// } else {
+//
+// }
+// return locErr;
+//}
+//bool VorbisEncodeInputPin::ConstructCodec() {
+// mFishInfo.channels = mWaveFormat->nChannels;
+// mFishInfo.format = FISH_SOUND_VORBIS;
+// mFishInfo.samplerate = mWaveFormat->nSamplesPerSec;
+//
+// mFishInfo.format = FISH_SOUND_VORBIS;
+// mFishSound = fish_sound_new (FISH_SOUND_ENCODE, &mFishInfo);
+//
+// //Change to fill in vorbis format block so muxer can work
+// ((VorbisEncodeFilter*)mParentFilter)->mVorbisFormatBlock.numChannels = mWaveFormat->nChannels;
+// ((VorbisEncodeFilter*)mParentFilter)->mVorbisFormatBlock.samplesPerSec = mWaveFormat->nSamplesPerSec;
+// //
+//
+// int i = 1;
+// //FIX::: Use new API for interleave setting
+// fish_sound_command(mFishSound, FISH_SOUND_SET_INTERLEAVE, &i, sizeof(int));
+//
+// fish_sound_set_encoded_callback (mFishSound, VorbisEncodeInputPin::VorbisEncoded, this);
+// //FIX::: Proper return value
+// return true;
+//
+//}
+//void VorbisEncodeInputPin::DestroyCodec() {
+// fish_sound_delete(mFishSound);
+// mFishSound = NULL;
+//}
+//
+//
+////Encoded callback
+//int VorbisEncodeInputPin::VorbisEncoded (FishSound* inFishSound, unsigned char* inPacketData, long inNumBytes, void* inThisPointer)
+//{
+//
+// VorbisEncodeInputPin* locThis = reinterpret_cast<VorbisEncodeInputPin*> (inThisPointer);
+// VorbisEncodeFilter* locFilter = reinterpret_cast<VorbisEncodeFilter*>(locThis->m_pFilter);
+//
+//
+// //Time stamps are granule pos not directshow times
+//
+// LONGLONG locFrameStart = locThis->mUptoFrame;
+// LONGLONG locFrameEnd = locThis->mUptoFrame
+// = fish_sound_get_frameno(locThis->mFishSound);
+// //Get a pointer to a new sample stamped with our time
+// IMediaSample* locSample;
+// HRESULT locHR = locThis->mOutputPin->GetDeliveryBuffer(&locSample, &locFrameStart, &locFrameEnd, NULL);
+//
+// if (FAILED(locHR)) {
+// //We get here when the application goes into stop mode usually.
+// return locHR;
+// }
+//
+// BYTE* locBuffer = NULL;
+//
+//
+// //Make our pointers set to point to the samples buffer
+// locSample->GetPointer(&locBuffer);
+//
+//
+//
+// if (locSample->GetSize() >= inNumBytes) {
+//
+// memcpy((void*)locBuffer, (const void*)inPacketData, inNumBytes);
+//
+// //Set the sample parameters.
+// locThis->SetSampleParams(locSample, inNumBytes, &locFrameStart, &locFrameEnd);
+//
+// {
+// CAutoLock locLock(locThis->m_pLock);
+//
+// //Add a reference so it isn't deleted en route.
+// //locSample->AddRef();
+// HRESULT locHR = locThis->mOutputPin->mDataQueue->Receive(locSample); //->DownstreamFilter()->Receive(locSample);
+// if (locHR != S_OK) {
+//
+// } else {
+// }
+// }
+//
+// return 0;
+// } else {
+// throw 0;
+// }
+//}
+//
+//
+//HRESULT VorbisEncodeInputPin::SetMediaType(const CMediaType* inMediaType) {
+// AbstractAudioEncodeInputPin::SetMediaType(inMediaType);
+//
+// ConstructCodec();
+//
+//
+// return S_OK;
+//
//}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeInputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeInputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeInputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,114 +1,114 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-#include "AbstractTransformInputPin.h"
-#include "VorbisEncodeInputPin.h"
-
-#include "VorbisEncodeFilter.h"
-
-extern "C" {
-//#include <fishsound/fishsound.h>
-#include "fish_cdecl.h"
-}
-
-class VorbisEncodeInputPin
- : public AbstractTransformInputPin
-{
-public:
- VorbisEncodeInputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes);
- virtual ~VorbisEncodeInputPin(void);
-
- static int __cdecl VorbisEncoded (FishSound* inFishSound, unsigned char* inPacketData, long inNumBytes, void* inThisPointer) ;
-
- virtual HRESULT SetMediaType(const CMediaType* inMediaType);
-
-protected:
-
- //Implementation of codec specific pure virtuals from AbstractTransformInputPin
- virtual HRESULT TransformData(unsigned char* inBuf, long inNumBytes);
- virtual bool ConstructCodec();
- virtual void DestroyCodec();
-
- //Member data
- HRESULT mHR;
- bool mBegun;
- WAVEFORMATEX* mWaveFormat;
- __int64 mUptoFrame;
-
- //Fishsound member data
- FishSound* mFishSound;
- FishSoundInfo mFishInfo;
-
-
-};
-
-
-//Old imp
-//****************************************************
-//#pragma once
-//
-//#include "AbstractAudioEncodeInputPin.h"
-//#include "VorbisEncodeInputPin.h"
-//
-//#include "VorbisEncodeFilter.h"
-//
-//extern "C" {
-//#include <fishsound/fishsound.h>
-////#include <../src/libfishsound/private.h>
-//}
-//
-//class VorbisEncodeInputPin
-// : public AbstractAudioEncodeInputPin
-//{
-//public:
-// VorbisEncodeInputPin(AbstractAudioEncodeFilter* inFilter, CCritSec* inFilterLock, AbstractAudioEncodeOutputPin* inOutputPin);
-// virtual ~VorbisEncodeInputPin(void);
-//
-// static int VorbisEncodeInputPin::VorbisEncoded (FishSound* inFishSound, unsigned char* inPacketData, long inNumBytes, void* inThisPointer) ;
-// //PURE VIRTUALS
-// virtual long encodeData(unsigned char* inBuf, long inNumBytes);
-// virtual bool ConstructCodec();
-// virtual void DestroyCodec();
-// virtual HRESULT SetMediaType(const CMediaType* inMediaType);
-//
-//protected:
-// HRESULT mHR;
-// bool mBegun;
-// //VorbisDecodeOutputPin* mOutputPin;
-// //__int64 mUptoFrame;
-//
-// FishSound* mFishSound;
-// FishSoundInfo mFishInfo;
-//
-//
-//};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+#include "AbstractTransformInputPin.h"
+#include "VorbisEncodeInputPin.h"
+
+#include "VorbisEncodeFilter.h"
+
+extern "C" {
+//#include <fishsound/fishsound.h>
+#include "fish_cdecl.h"
+}
+
+class VorbisEncodeInputPin
+ : public AbstractTransformInputPin
+{
+public:
+ VorbisEncodeInputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, vector<CMediaType*> inAcceptableMediaTypes);
+ virtual ~VorbisEncodeInputPin(void);
+
+ static int __cdecl VorbisEncoded (FishSound* inFishSound, unsigned char* inPacketData, long inNumBytes, void* inThisPointer) ;
+
+ virtual HRESULT SetMediaType(const CMediaType* inMediaType);
+
+protected:
+
+ //Implementation of codec specific pure virtuals from AbstractTransformInputPin
+ virtual HRESULT TransformData(unsigned char* inBuf, long inNumBytes);
+ virtual bool ConstructCodec();
+ virtual void DestroyCodec();
+
+ //Member data
+ HRESULT mHR;
+ bool mBegun;
+ WAVEFORMATEX* mWaveFormat;
+ __int64 mUptoFrame;
+
+ //Fishsound member data
+ FishSound* mFishSound;
+ FishSoundInfo mFishInfo;
+
+
+};
+
+
+//Old imp
+//****************************************************
+//#pragma once
+//
+//#include "AbstractAudioEncodeInputPin.h"
+//#include "VorbisEncodeInputPin.h"
+//
+//#include "VorbisEncodeFilter.h"
+//
+//extern "C" {
+//#include <fishsound/fishsound.h>
+////#include <../src/libfishsound/private.h>
+//}
+//
+//class VorbisEncodeInputPin
+// : public AbstractAudioEncodeInputPin
+//{
+//public:
+// VorbisEncodeInputPin(AbstractAudioEncodeFilter* inFilter, CCritSec* inFilterLock, AbstractAudioEncodeOutputPin* inOutputPin);
+// virtual ~VorbisEncodeInputPin(void);
+//
+// static int VorbisEncodeInputPin::VorbisEncoded (FishSound* inFishSound, unsigned char* inPacketData, long inNumBytes, void* inThisPointer) ;
+// //PURE VIRTUALS
+// virtual long encodeData(unsigned char* inBuf, long inNumBytes);
+// virtual bool ConstructCodec();
+// virtual void DestroyCodec();
+// virtual HRESULT SetMediaType(const CMediaType* inMediaType);
+//
+//protected:
+// HRESULT mHR;
+// bool mBegun;
+// //VorbisDecodeOutputPin* mOutputPin;
+// //__int64 mUptoFrame;
+//
+// FishSound* mFishSound;
+// FishSoundInfo mFishInfo;
+//
+//
+//};
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeInputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeOutputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeOutputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeOutputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,92 +1,92 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-
-#include "StdAfx.h"
-#include "VorbisEncodeOutputPin.h"
-
-VorbisEncodeOutputPin::VorbisEncodeOutputPin(VorbisEncodeFilter* inParentFilter,CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes)
- : AbstractTransformOutputPin(inParentFilter, inFilterLock,NAME("VorbisDecodeOutputPin"), L"Vorbis Out", 65536, 5, inAcceptableMediaTypes)
-{
-}
-
-VorbisEncodeOutputPin::~VorbisEncodeOutputPin(void)
-{
-}
-
-HRESULT VorbisEncodeOutputPin::CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition)
-{
- if (inPosition == 0) {
- sVorbisFormatBlock* locVorbisFormat = (sVorbisFormatBlock*)outMediaType->AllocFormatBuffer(sizeof(sVorbisFormatBlock));
- //TODO::: Check for null ?
-
- memcpy((void*)locVorbisFormat, (const void*) &(((VorbisEncodeFilter*)mParentFilter)->mVorbisFormatBlock), sizeof(sVorbisFormatBlock));
- return S_OK;
- } else {
- return S_FALSE;
- }
-}
-
-
-//bool VorbisEncodeOutputPin::FillFormatBuffer(BYTE* inFormatBuffer) {
-// VorbisEncodeFilter* locParentFilter = (VorbisEncodeFilter*)mParentFilter;
-// memcpy((void*)inFormatBuffer, (const void*) &(locParentFilter->mVorbisFormatBlock), sizeof(sVorbisFormatBlock));
-// return true;
-//}
-//unsigned long VorbisEncodeOutputPin::FormatBufferSize() {
-// return sizeof(sVorbisFormatBlock);
-//}
-
-
-
-
-//Old imp
-//*********************************************
-//#include "StdAfx.h"
-//#include "vorbisencodeoutputpin.h"
-//
-//VorbisEncodeOutputPin::VorbisEncodeOutputPin(VorbisEncodeFilter* inParentFilter,CCritSec* inFilterLock, CMediaType* inOutputMediaType)
-// : AbstractAudioEncodeOutputPin(inParentFilter, inFilterLock,NAME("VorbisDecodeOutputPin"), L"Vorbis Out", inOutputMediaType)
-//{
-//}
-//
-//VorbisEncodeOutputPin::~VorbisEncodeOutputPin(void)
-//{
-//}
-//
-//bool VorbisEncodeOutputPin::FillFormatBuffer(BYTE* inFormatBuffer) {
-// VorbisEncodeFilter* locParentFilter = (VorbisEncodeFilter*)mParentFilter;
-// memcpy((void*)inFormatBuffer, (const void*) &(locParentFilter->mVorbisFormatBlock), sizeof(sVorbisFormatBlock));
-// return true;
-//}
-//unsigned long VorbisEncodeOutputPin::FormatBufferSize() {
-// return sizeof(sVorbisFormatBlock);
-//}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+
+#include "StdAfx.h"
+#include "VorbisEncodeOutputPin.h"
+
+VorbisEncodeOutputPin::VorbisEncodeOutputPin(VorbisEncodeFilter* inParentFilter,CCritSec* inFilterLock, vector<CMediaType*> inAcceptableMediaTypes)
+ : AbstractTransformOutputPin(inParentFilter, inFilterLock,NAME("VorbisDecodeOutputPin"), L"Vorbis Out", 65536, 5, inAcceptableMediaTypes)
+{
+}
+
+VorbisEncodeOutputPin::~VorbisEncodeOutputPin(void)
+{
+}
+
+HRESULT VorbisEncodeOutputPin::CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition)
+{
+ if (inPosition == 0) {
+ sVorbisFormatBlock* locVorbisFormat = (sVorbisFormatBlock*)outMediaType->AllocFormatBuffer(sizeof(sVorbisFormatBlock));
+ //TODO::: Check for null ?
+
+ memcpy((void*)locVorbisFormat, (const void*) &(((VorbisEncodeFilter*)mParentFilter)->mVorbisFormatBlock), sizeof(sVorbisFormatBlock));
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
+}
+
+
+//bool VorbisEncodeOutputPin::FillFormatBuffer(BYTE* inFormatBuffer) {
+// VorbisEncodeFilter* locParentFilter = (VorbisEncodeFilter*)mParentFilter;
+// memcpy((void*)inFormatBuffer, (const void*) &(locParentFilter->mVorbisFormatBlock), sizeof(sVorbisFormatBlock));
+// return true;
+//}
+//unsigned long VorbisEncodeOutputPin::FormatBufferSize() {
+// return sizeof(sVorbisFormatBlock);
+//}
+
+
+
+
+//Old imp
+//*********************************************
+//#include "StdAfx.h"
+//#include "vorbisencodeoutputpin.h"
+//
+//VorbisEncodeOutputPin::VorbisEncodeOutputPin(VorbisEncodeFilter* inParentFilter,CCritSec* inFilterLock, CMediaType* inOutputMediaType)
+// : AbstractAudioEncodeOutputPin(inParentFilter, inFilterLock,NAME("VorbisDecodeOutputPin"), L"Vorbis Out", inOutputMediaType)
+//{
+//}
+//
+//VorbisEncodeOutputPin::~VorbisEncodeOutputPin(void)
+//{
+//}
+//
+//bool VorbisEncodeOutputPin::FillFormatBuffer(BYTE* inFormatBuffer) {
+// VorbisEncodeFilter* locParentFilter = (VorbisEncodeFilter*)mParentFilter;
+// memcpy((void*)inFormatBuffer, (const void*) &(locParentFilter->mVorbisFormatBlock), sizeof(sVorbisFormatBlock));
+// return true;
+//}
+//unsigned long VorbisEncodeOutputPin::FormatBufferSize() {
+// return sizeof(sVorbisFormatBlock);
+//}
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeOutputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeOutputPin.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeOutputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeOutputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,85 +1,85 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-#include "vorbisencoderdllstuff.h"
-#include "AbstractTransformOutputPin.h"
-
-class VorbisEncodeFilter;
-struct sVorbisFormatBlock;
-
-class VorbisEncodeOutputPin
- : public AbstractTransformOutputPin
-{
-public:
-
- friend class VorbisEncodeInputPin;
-
- VorbisEncodeOutputPin(VorbisEncodeFilter* inParentFilter, CCritSec* inFilterLock, vector<CMediaType*> inAcceptabletMediaTypes);
- virtual ~VorbisEncodeOutputPin(void);
-
- //PURE VIRTUAL IMPLEMENTATION
- //virtual bool FillFormatBuffer(BYTE* inFormatBuffer);
- //virtual unsigned long FormatBufferSize();
-
-
-protected:
- virtual HRESULT CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition);
-
-};
-
-
-//Old impl
-//*********************************************
-//#pragma once
-//
-//#include "vorbisencoderdllstuff.h"
-//#include "AbstractAudioEncodeOutputPin.h"
-//
-//class VorbisEncodeFilter;
-//struct sVorbisFormatBlock;
-//
-//class VorbisEncodeOutputPin
-// : public AbstractAudioEncodeOutputPin
-//{
-//public:
-// VorbisEncodeOutputPin(VorbisEncodeFilter* inParentFilter, CCritSec* inFilterLock, CMediaType* inOutputMediaType);
-// virtual ~VorbisEncodeOutputPin(void);
-//
-// //PURE VIRTUAL IMPLEMENTATION
-// virtual bool FillFormatBuffer(BYTE* inFormatBuffer);
-// virtual unsigned long FormatBufferSize();
-//
-//
-//protected:
-//
-//};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+#include "vorbisencoderdllstuff.h"
+#include "AbstractTransformOutputPin.h"
+
+class VorbisEncodeFilter;
+struct sVorbisFormatBlock;
+
+class VorbisEncodeOutputPin
+ : public AbstractTransformOutputPin
+{
+public:
+
+ friend class VorbisEncodeInputPin;
+
+ VorbisEncodeOutputPin(VorbisEncodeFilter* inParentFilter, CCritSec* inFilterLock, vector<CMediaType*> inAcceptabletMediaTypes);
+ virtual ~VorbisEncodeOutputPin(void);
+
+ //PURE VIRTUAL IMPLEMENTATION
+ //virtual bool FillFormatBuffer(BYTE* inFormatBuffer);
+ //virtual unsigned long FormatBufferSize();
+
+
+protected:
+ virtual HRESULT CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition);
+
+};
+
+
+//Old impl
+//*********************************************
+//#pragma once
+//
+//#include "vorbisencoderdllstuff.h"
+//#include "AbstractAudioEncodeOutputPin.h"
+//
+//class VorbisEncodeFilter;
+//struct sVorbisFormatBlock;
+//
+//class VorbisEncodeOutputPin
+// : public AbstractAudioEncodeOutputPin
+//{
+//public:
+// VorbisEncodeOutputPin(VorbisEncodeFilter* inParentFilter, CCritSec* inFilterLock, CMediaType* inOutputMediaType);
+// virtual ~VorbisEncodeOutputPin(void);
+//
+// //PURE VIRTUAL IMPLEMENTATION
+// virtual bool FillFormatBuffer(BYTE* inFormatBuffer);
+// virtual unsigned long FormatBufferSize();
+//
+//
+//protected:
+//
+//};
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/VorbisEncodeOutputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/dsfVorbisEncoder.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/dsfVorbisEncoder.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/dsfVorbisEncoder.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,5 +1,5 @@
-// dsfVorbisEncoder.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-
+// dsfVorbisEncoder.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/dsfVorbisEncoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/fish_cdecl.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,39 +1,39 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.cpp : source file that includes just the standard includes
-// dsfVorbisEncoder.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.cpp : source file that includes just the standard includes
+// dsfVorbisEncoder.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,43 +1,43 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-// TODO: reference additional headers your program requires here
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/vorbisencoderdllstuff.cpp
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/vorbisencoderdllstuff.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/vorbisencoderdllstuff.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,99 +1,99 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "vorbisencoderdllstuff.h"
-
-extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
-BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
-{
- return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
-}
-
-
-//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
-STDAPI DllRegisterServer()
-{
-
- //TO DO::: Should we be releasing the filter mapper even when we return early ?
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(TRUE);
-
-
-
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
-
-
- hr = locFilterMapper->RegisterFilter(
- CLSID_VorbisEncodeFilter, // Filter CLSID.
- L"Vorbis Encode Filter", // Filter name.
- NULL, // Device moniker.
- &CLSID_LegacyAmFilterCategory, // Direct Show general category
- L"Vorbis Encode Filter", // Instance data. ???????
- &VorbisEncodeFilterReg // Pointer to filter information.
- );
-
- locFilterMapper->Release();
-
- return hr;
-
-}
-
-STDAPI DllUnregisterServer()
-{
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(FALSE);
- if (FAILED(hr)) {
-
- return hr;
- }
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
- IID_IFilterMapper2, (void **)&locFilterMapper);
-
- if (FAILED(hr)) {
- return hr;
- }
-
-
- hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, L"Vorbis Encode Filter", CLSID_VorbisEncodeFilter);
-
-
- //
- locFilterMapper->Release();
- return hr;
-
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "vorbisencoderdllstuff.h"
+
+extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
+BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+ return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
+}
+
+
+//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
+STDAPI DllRegisterServer()
+{
+
+ //TO DO::: Should we be releasing the filter mapper even when we return early ?
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(TRUE);
+
+
+
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
+
+
+ hr = locFilterMapper->RegisterFilter(
+ CLSID_VorbisEncodeFilter, // Filter CLSID.
+ L"Vorbis Encode Filter", // Filter name.
+ NULL, // Device moniker.
+ &CLSID_LegacyAmFilterCategory, // Direct Show general category
+ L"Vorbis Encode Filter", // Instance data. ???????
+ &VorbisEncodeFilterReg // Pointer to filter information.
+ );
+
+ locFilterMapper->Release();
+
+ return hr;
+
+}
+
+STDAPI DllUnregisterServer()
+{
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(FALSE);
+ if (FAILED(hr)) {
+
+ return hr;
+ }
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
+ IID_IFilterMapper2, (void **)&locFilterMapper);
+
+ if (FAILED(hr)) {
+ return hr;
+ }
+
+
+ hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, L"Vorbis Encode Filter", CLSID_VorbisEncodeFilter);
+
+
+ //
+ locFilterMapper->Release();
+ return hr;
+
+}
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/vorbisencoderdllstuff.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/vorbisencoderdllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/vorbisencoderdllstuff.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/vorbisencoderdllstuff.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,128 +1,128 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-//#ifdef DSFABSTRACOGGAUDIODECODER_EXPORTS
-//#pragma message("----> Exporting from Abstract Library...")
-//#define ABS_AUDIO_DEC_API __declspec(dllexport)
-//#else
-//#pragma message("<---- Importing from Abstract Library...")
-//#define ABS_AUDIO_DEC_API __declspec(dllimport)
-//#endif
-
-struct sVorbisFormatBlock {
- unsigned long vorbisVersion;
- unsigned long samplesPerSec;
- unsigned long minBitsPerSec;
- unsigned long avgBitsPerSec;
- unsigned long maxBitsPerSec;
- unsigned char numChannels;
-};
-
-#include "AbstractTransformFilter.h"
-#include "AbstractTransformInputPin.h"
-#include "AbstractTransformOutputPin.h"
-#include "VorbisEncodeInputPin.h"
-#include "VorbisEncodeOutputPin.h"
-#include "VorbisEncodeFilter.h"
-
-#ifdef LIBOOOGG_EXPORTS
-#define LIBOOOGG_API __declspec(dllexport)
-#else
-#define LIBOOOGG_API __declspec(dllimport)
-#endif
-
-//// {05A1D945-A794-44ef-B41A-2F851A117155}
-//DEFINE_GUID(CLSID_VorbisDecodeFilter,
-//0x5a1d945, 0xa794, 0x44ef, 0xb4, 0x1a, 0x2f, 0x85, 0x1a, 0x11, 0x71, 0x55);
-
-// {5C94FE86-B93B-467f-BFC3-BD6C91416F9B}
-DEFINE_GUID(CLSID_VorbisEncodeFilter,
-0x5c94fe86, 0xb93b, 0x467f, 0xbf, 0xc3, 0xbd, 0x6c, 0x91, 0x41, 0x6f, 0x9b);
-
-// {8A0566AC-42B3-4ad9-ACA3-93B906DDF98A}
-DEFINE_GUID(MEDIASUBTYPE_Vorbis,
-0x8a0566ac, 0x42b3, 0x4ad9, 0xac, 0xa3, 0x93, 0xb9, 0x6, 0xdd, 0xf9, 0x8a);
-
-// {44E04F43-58B3-4de1-9BAA-8901F852DAE4}
-DEFINE_GUID(FORMAT_Vorbis,
-0x44e04f43, 0x58b3, 0x4de1, 0x9b, 0xaa, 0x89, 0x1, 0xf8, 0x52, 0xda, 0xe4);
-
-
-const REGPINTYPES VorbisEncodeInputTypes = {
- &MEDIATYPE_Audio,
- &MEDIASUBTYPE_PCM
-};
-
-const REGPINTYPES VorbisEncodeOutputTypes = {
- &MEDIATYPE_Audio,
- &MEDIASUBTYPE_Vorbis
-};
-
-const REGFILTERPINS VorbisEncodePinReg[] = {
- {
- L"PCM Input", //Name (obsoleted)
- FALSE, //Renders from this pin ?? Not sure about this.
- FALSE, //Not an output pin
- FALSE, //Cannot have zero instances of this pin
- FALSE, //Cannot have more than one instance of this pin
- NULL, //Connects to filter (obsoleted)
- NULL, //Connects to pin (obsoleted)
- 1, //upport two media type
- &VorbisEncodeInputTypes //Pointer to media type (Audio/Vorbis or Audio/Speex)
- } ,
-
- {
- L"Vorbis Output", //Name (obsoleted)
- FALSE, //Renders from this pin ?? Not sure about this.
- TRUE, //Is an output pin
- FALSE, //Cannot have zero instances of this pin
- FALSE, //Cannot have more than one instance of this pin
- NULL, //Connects to filter (obsoleted)
- NULL, //Connects to pin (obsoleted)
- 1, //Only support one media type
- &VorbisEncodeOutputTypes //Pointer to media type (Audio/PCM)
-
- }
-};
-
-
-
-const REGFILTER2 VorbisEncodeFilterReg = {
- 1,
- MERIT_DO_NOT_USE,
- 2,
- VorbisEncodePinReg
-
-};
-
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+//#ifdef DSFABSTRACOGGAUDIODECODER_EXPORTS
+//#pragma message("----> Exporting from Abstract Library...")
+//#define ABS_AUDIO_DEC_API __declspec(dllexport)
+//#else
+//#pragma message("<---- Importing from Abstract Library...")
+//#define ABS_AUDIO_DEC_API __declspec(dllimport)
+//#endif
+
+struct sVorbisFormatBlock {
+ unsigned long vorbisVersion;
+ unsigned long samplesPerSec;
+ unsigned long minBitsPerSec;
+ unsigned long avgBitsPerSec;
+ unsigned long maxBitsPerSec;
+ unsigned char numChannels;
+};
+
+#include "AbstractTransformFilter.h"
+#include "AbstractTransformInputPin.h"
+#include "AbstractTransformOutputPin.h"
+#include "VorbisEncodeInputPin.h"
+#include "VorbisEncodeOutputPin.h"
+#include "VorbisEncodeFilter.h"
+
+#ifdef LIBOOOGG_EXPORTS
+#define LIBOOOGG_API __declspec(dllexport)
+#else
+#define LIBOOOGG_API __declspec(dllimport)
+#endif
+
+//// {05A1D945-A794-44ef-B41A-2F851A117155}
+//DEFINE_GUID(CLSID_VorbisDecodeFilter,
+//0x5a1d945, 0xa794, 0x44ef, 0xb4, 0x1a, 0x2f, 0x85, 0x1a, 0x11, 0x71, 0x55);
+
+// {5C94FE86-B93B-467f-BFC3-BD6C91416F9B}
+DEFINE_GUID(CLSID_VorbisEncodeFilter,
+0x5c94fe86, 0xb93b, 0x467f, 0xbf, 0xc3, 0xbd, 0x6c, 0x91, 0x41, 0x6f, 0x9b);
+
+// {8A0566AC-42B3-4ad9-ACA3-93B906DDF98A}
+DEFINE_GUID(MEDIASUBTYPE_Vorbis,
+0x8a0566ac, 0x42b3, 0x4ad9, 0xac, 0xa3, 0x93, 0xb9, 0x6, 0xdd, 0xf9, 0x8a);
+
+// {44E04F43-58B3-4de1-9BAA-8901F852DAE4}
+DEFINE_GUID(FORMAT_Vorbis,
+0x44e04f43, 0x58b3, 0x4de1, 0x9b, 0xaa, 0x89, 0x1, 0xf8, 0x52, 0xda, 0xe4);
+
+
+const REGPINTYPES VorbisEncodeInputTypes = {
+ &MEDIATYPE_Audio,
+ &MEDIASUBTYPE_PCM
+};
+
+const REGPINTYPES VorbisEncodeOutputTypes = {
+ &MEDIATYPE_Audio,
+ &MEDIASUBTYPE_Vorbis
+};
+
+const REGFILTERPINS VorbisEncodePinReg[] = {
+ {
+ L"PCM Input", //Name (obsoleted)
+ FALSE, //Renders from this pin ?? Not sure about this.
+ FALSE, //Not an output pin
+ FALSE, //Cannot have zero instances of this pin
+ FALSE, //Cannot have more than one instance of this pin
+ NULL, //Connects to filter (obsoleted)
+ NULL, //Connects to pin (obsoleted)
+ 1, //upport two media type
+ &VorbisEncodeInputTypes //Pointer to media type (Audio/Vorbis or Audio/Speex)
+ } ,
+
+ {
+ L"Vorbis Output", //Name (obsoleted)
+ FALSE, //Renders from this pin ?? Not sure about this.
+ TRUE, //Is an output pin
+ FALSE, //Cannot have zero instances of this pin
+ FALSE, //Cannot have more than one instance of this pin
+ NULL, //Connects to filter (obsoleted)
+ NULL, //Connects to pin (obsoleted)
+ 1, //Only support one media type
+ &VorbisEncodeOutputTypes //Pointer to media type (Audio/PCM)
+
+ }
+};
+
+
+
+const REGFILTER2 VorbisEncodeFilterReg = {
+ 1,
+ MERIT_DO_NOT_USE,
+ 2,
+ VorbisEncodePinReg
+
+};
+
+
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/filters/dsfVorbisEncoder/vorbisencoderdllstuff.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/include/vorbis/codec.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/include/vorbis/vorbisenc.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/include/vorbis/vorbisfile.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/backends.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/bitrate.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/books/coupled/res_books_stereo.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/books/floor/floor_books.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/books/uncoupled/res_books_uncoupled.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/codebook.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/codec_internal.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/envelope.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/highlevel.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/lookup.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/lookup_data.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/lpc.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/lsp.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/masking.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/mdct.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/misc.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/floor_all.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/psych_11.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/psych_16.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/psych_44.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/psych_8.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/residue_16.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/residue_44.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/residue_44u.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/residue_8.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/setup_11.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/setup_16.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/setup_22.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/setup_32.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/setup_44.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/setup_44u.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/setup_8.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/modes/setup_X.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/os.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/psy.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/registry.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/scales.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/smallft.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/lib/window.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/macos/compat/sys/types.h
===================================================================
--- trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/macos/compat/sys/types.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/macos/compat/sys/types.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1 +1,29 @@
-#ifndef __SYS_TYPES_H__
#define __SYS_TYPES_H__ 1
#include <MacTypes.h>
#include <alloca.h>
#include <string.h>
typedef short int16_t;
typedef long int32_t;
typedef long long int64_t;
#define vorbis_size32_t long
#if defined(__cplusplus)
extern "C" {
#endif
#pragma options align=power
char *strdup(const char *inStr);
#pragma options align=reset
#if defined(__cplusplus)
}
#endif
#endif /* __SYS_TYPES_H__ */
\ No newline at end of file
+#ifndef __SYS_TYPES_H__
+#define __SYS_TYPES_H__ 1
+
+#include <MacTypes.h>
+#include <alloca.h>
+#include <string.h>
+
+typedef short int16_t;
+typedef long int32_t;
+typedef long long int64_t;
+
+#define vorbis_size32_t long
+
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#pragma options align=power
+
+char *strdup(const char *inStr);
+
+#pragma options align=reset
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* __SYS_TYPES_H__ */
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/macos/compat/sys/types.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/vq/bookutil.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/codecs/vorbis/libs/libvorbis/vq/vqgen.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/AnxPacketMaker.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/AnxPacketMaker.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/AnxPacketMaker.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,185 +1,185 @@
-#include "StdAfx.h"
-#include ".\anxpacketmaker.h"
-
-AnxPacketMaker::AnxPacketMaker(void)
-{
-}
-
-AnxPacketMaker::~AnxPacketMaker(void)
-{
-}
-
-OggPage* AnxPacketMaker::makeAnnodexBOS ( unsigned long inSerialNo
- , unsigned short inVersionMajor
- , unsigned short inVersionMinor
- , unsigned __int64 inTimebaseNum
- , unsigned __int64 inTimebaseDenom
- , const char* inUTC
-
- )
-{
- unsigned char* locBuff = NULL;
- StampedOggPacket* locPack = NULL;
- OggPage* retPage = NULL;
- unsigned char* locSegTable = NULL;
- switch (inVersionMajor) {
- case 2:
- locBuff = new unsigned char[ANX_2_0_ANNODEX_BOS_SIZE];
-
- // 0 - 7 Annodex\0
- // 8 - 9 Version Major
- // 10 - 11 Version Minor
- // 12 - 19 Timebase Num
- // 20 - 27 Timebase Denom
- // 28 = 48 UTC
- locBuff[0] = 'A';
- locBuff[1] = 'n';
- locBuff[2] = 'n';
- locBuff[3] = 'o';
- locBuff[4] = 'd';
- locBuff[5] = 'e';
- locBuff[6] = 'x';
- locBuff[7] = 0;
- iLE_Math::UShortToCharArr(inVersionMajor, locBuff + 8);
- iLE_Math::UShortToCharArr(inVersionMinor, locBuff + 10);
- iLE_Math::Int64ToCharArr(inTimebaseNum, locBuff + 12);
- iLE_Math::Int64ToCharArr(inTimebaseDenom, locBuff + 20);
- for (int i = 0; i < 20; i++) {
- locBuff[28 + i] = inUTC[i];
- }
-
- locPack = new StampedOggPacket(locBuff, ANX_2_0_ANNODEX_BOS_SIZE, false, false, 0, 0, StampedOggPacket::OGG_END_ONLY);
-
- retPage = new OggPage;
- retPage->header()->setHeaderFlags(2);
- retPage->header()->setGranulePos((__int64)0);
- retPage->header()->setNumPageSegments( 1);
- locSegTable = new unsigned char[1];
- locSegTable[0] = ANX_2_0_ANNODEX_BOS_SIZE;
- retPage->header()->setSegmentTable(locSegTable, 1);
- retPage->header()->setHeaderSize(28);
- retPage->header()->setDataSize(ANX_2_0_ANNODEX_BOS_SIZE);
-
- retPage->header()->setStreamSerialNo(inSerialNo);
- retPage->addPacket(locPack);
-
- return retPage;
-
- default:
- return NULL;
-
-
- }
-}
-
-StampedOggPacket* AnxPacketMaker::makeAnxData ( unsigned short inVersionMajor
- , unsigned short inVersionMinor
- , unsigned __int64 inGranuleRateNum
- , unsigned __int64 inGranuleRateDenom
- , unsigned long inNumSecHeaders
- , vector<string> inMessageHeaders
- )
-{
-
- StampedOggPacket* locPack = NULL;
- OggPage* retPage = NULL;
- unsigned char* locBuff = NULL;
- unsigned long locUpto = 0;
- unsigned long locPacketSize = 0;
- switch (inVersionMajor) {
- case 2:
- //ASSERT(inMessageHeaders.size() > 0)
- //THere has to be a content type field.
-
- locPacketSize = 28; //Base header size
- for (int i = 0; i < inMessageHeaders.size(); i++) {
- //2 is the crlf
- locPacketSize += inMessageHeaders[i].size() + 2;
- }
-
- //terminating crlf
- locPacketSize += 2;
-
- locBuff = new unsigned char[locPacketSize];
-
- locBuff[0] = 'A';
- locBuff[1] = 'n';
- locBuff[2] = 'x';
- locBuff[3] = 'D';
- locBuff[4] = 'a';
- locBuff[5] = 't';
- locBuff[6] = 'a';
- locBuff[7] = 0;
-
- iLE_Math::Int64ToCharArr(inGranuleRateNum, locBuff + 8);
- iLE_Math::Int64ToCharArr(inGranuleRateDenom, locBuff + 16);
- iLE_Math::ULongToCharArr(inNumSecHeaders, locBuff + 24);
- locUpto = 28;
- for (int i = 0; i < inMessageHeaders.size(); i++) {
- memcpy((void*)(locBuff + locUpto), (const void*)(inMessageHeaders[i].c_str()), inMessageHeaders[i].size());
- locUpto += inMessageHeaders[i].size();
- //TODO::: How terminated ??
- locBuff[locUpto++] = '\r';
- locBuff[locUpto++] = '\n';
- }
-
- locBuff[locUpto++] = '\r';
- locBuff[locUpto++] = '\n';
-
- locPack = new StampedOggPacket(locBuff, locPacketSize, false, false, 0, 0, StampedOggPacket::OGG_END_ONLY);
- retPage = new OggPage;
-
-
-
-
- default:
- return NULL;
- }
-}
-
-StampedOggPacket* AnxPacketMaker::makeAnxData_2_0 (OggMuxStream* inMuxStream, OggPaginator* inPaginator)
-{
- return makeAnxData( 2
- , 0
- , inMuxStream->granuleNumerator()
- , inMuxStream->granuleDenominator()
- , inPaginator->numHeaders()
- , makeMessageHeaders(inMuxStream));
-}
-
-vector<string> AnxPacketMaker::makeMessageHeaders(OggMuxStream* inMuxStream) {
- string locTempString = "";
- vector<string> retVector;
- switch(OggStreamFactory::IdentifyCodec(inMuxStream->peekFront()->getPacket(0))) {
- case StreamHeaders::VORBIS:
- locTempString = "Content-type: audio/x-vorbis";
- retVector.push_back(locTempString);
- break;
- case StreamHeaders::SPEEX:
- locTempString = "Content-type: audio/x-speex";
- retVector.push_back(locTempString);
- break;
- case StreamHeaders::FLAC:
- locTempString = "Content-type: audio/x-flac";
- retVector.push_back(locTempString);
- break;
- case StreamHeaders::OGG_FLAC_1_0:
- locTempString = "Content-type: audio/x-flac_1_0";
- retVector.push_back(locTempString);
- break;
- case StreamHeaders::THEORA:
- locTempString = "Content-type: video/x-theora";
- retVector.push_back(locTempString);
- break;
- case StreamHeaders::FFDSHOW_VIDEO:
- locTempString = "Content-type: video/x-ogm";
- retVector.push_back(locTempString);
- break;
- case StreamHeaders::NONE:
- default:
- return NULL;
- }
-
- return retVector;
-}
-
+#include "StdAfx.h"
+#include ".\anxpacketmaker.h"
+
+AnxPacketMaker::AnxPacketMaker(void)
+{
+}
+
+AnxPacketMaker::~AnxPacketMaker(void)
+{
+}
+
+OggPage* AnxPacketMaker::makeAnnodexBOS ( unsigned long inSerialNo
+ , unsigned short inVersionMajor
+ , unsigned short inVersionMinor
+ , unsigned __int64 inTimebaseNum
+ , unsigned __int64 inTimebaseDenom
+ , const char* inUTC
+
+ )
+{
+ unsigned char* locBuff = NULL;
+ StampedOggPacket* locPack = NULL;
+ OggPage* retPage = NULL;
+ unsigned char* locSegTable = NULL;
+ switch (inVersionMajor) {
+ case 2:
+ locBuff = new unsigned char[ANX_2_0_ANNODEX_BOS_SIZE];
+
+ // 0 - 7 Annodex\0
+ // 8 - 9 Version Major
+ // 10 - 11 Version Minor
+ // 12 - 19 Timebase Num
+ // 20 - 27 Timebase Denom
+ // 28 = 48 UTC
+ locBuff[0] = 'A';
+ locBuff[1] = 'n';
+ locBuff[2] = 'n';
+ locBuff[3] = 'o';
+ locBuff[4] = 'd';
+ locBuff[5] = 'e';
+ locBuff[6] = 'x';
+ locBuff[7] = 0;
+ iLE_Math::UShortToCharArr(inVersionMajor, locBuff + 8);
+ iLE_Math::UShortToCharArr(inVersionMinor, locBuff + 10);
+ iLE_Math::Int64ToCharArr(inTimebaseNum, locBuff + 12);
+ iLE_Math::Int64ToCharArr(inTimebaseDenom, locBuff + 20);
+ for (int i = 0; i < 20; i++) {
+ locBuff[28 + i] = inUTC[i];
+ }
+
+ locPack = new StampedOggPacket(locBuff, ANX_2_0_ANNODEX_BOS_SIZE, false, false, 0, 0, StampedOggPacket::OGG_END_ONLY);
+
+ retPage = new OggPage;
+ retPage->header()->setHeaderFlags(2);
+ retPage->header()->setGranulePos((__int64)0);
+ retPage->header()->setNumPageSegments( 1);
+ locSegTable = new unsigned char[1];
+ locSegTable[0] = ANX_2_0_ANNODEX_BOS_SIZE;
+ retPage->header()->setSegmentTable(locSegTable, 1);
+ retPage->header()->setHeaderSize(28);
+ retPage->header()->setDataSize(ANX_2_0_ANNODEX_BOS_SIZE);
+
+ retPage->header()->setStreamSerialNo(inSerialNo);
+ retPage->addPacket(locPack);
+
+ return retPage;
+
+ default:
+ return NULL;
+
+
+ }
+}
+
+StampedOggPacket* AnxPacketMaker::makeAnxData ( unsigned short inVersionMajor
+ , unsigned short inVersionMinor
+ , unsigned __int64 inGranuleRateNum
+ , unsigned __int64 inGranuleRateDenom
+ , unsigned long inNumSecHeaders
+ , vector<string> inMessageHeaders
+ )
+{
+
+ StampedOggPacket* locPack = NULL;
+ OggPage* retPage = NULL;
+ unsigned char* locBuff = NULL;
+ unsigned long locUpto = 0;
+ unsigned long locPacketSize = 0;
+ switch (inVersionMajor) {
+ case 2:
+ //ASSERT(inMessageHeaders.size() > 0)
+ //THere has to be a content type field.
+
+ locPacketSize = 28; //Base header size
+ for (int i = 0; i < inMessageHeaders.size(); i++) {
+ //2 is the crlf
+ locPacketSize += inMessageHeaders[i].size() + 2;
+ }
+
+ //terminating crlf
+ locPacketSize += 2;
+
+ locBuff = new unsigned char[locPacketSize];
+
+ locBuff[0] = 'A';
+ locBuff[1] = 'n';
+ locBuff[2] = 'x';
+ locBuff[3] = 'D';
+ locBuff[4] = 'a';
+ locBuff[5] = 't';
+ locBuff[6] = 'a';
+ locBuff[7] = 0;
+
+ iLE_Math::Int64ToCharArr(inGranuleRateNum, locBuff + 8);
+ iLE_Math::Int64ToCharArr(inGranuleRateDenom, locBuff + 16);
+ iLE_Math::ULongToCharArr(inNumSecHeaders, locBuff + 24);
+ locUpto = 28;
+ for (int i = 0; i < inMessageHeaders.size(); i++) {
+ memcpy((void*)(locBuff + locUpto), (const void*)(inMessageHeaders[i].c_str()), inMessageHeaders[i].size());
+ locUpto += inMessageHeaders[i].size();
+ //TODO::: How terminated ??
+ locBuff[locUpto++] = '\r';
+ locBuff[locUpto++] = '\n';
+ }
+
+ locBuff[locUpto++] = '\r';
+ locBuff[locUpto++] = '\n';
+
+ locPack = new StampedOggPacket(locBuff, locPacketSize, false, false, 0, 0, StampedOggPacket::OGG_END_ONLY);
+ retPage = new OggPage;
+
+
+
+
+ default:
+ return NULL;
+ }
+}
+
+StampedOggPacket* AnxPacketMaker::makeAnxData_2_0 (OggMuxStream* inMuxStream, OggPaginator* inPaginator)
+{
+ return makeAnxData( 2
+ , 0
+ , inMuxStream->granuleNumerator()
+ , inMuxStream->granuleDenominator()
+ , inPaginator->numHeaders()
+ , makeMessageHeaders(inMuxStream));
+}
+
+vector<string> AnxPacketMaker::makeMessageHeaders(OggMuxStream* inMuxStream) {
+ string locTempString = "";
+ vector<string> retVector;
+ switch(OggStreamFactory::IdentifyCodec(inMuxStream->peekFront()->getPacket(0))) {
+ case StreamHeaders::VORBIS:
+ locTempString = "Content-type: audio/x-vorbis";
+ retVector.push_back(locTempString);
+ break;
+ case StreamHeaders::SPEEX:
+ locTempString = "Content-type: audio/x-speex";
+ retVector.push_back(locTempString);
+ break;
+ case StreamHeaders::FLAC:
+ locTempString = "Content-type: audio/x-flac";
+ retVector.push_back(locTempString);
+ break;
+ case StreamHeaders::OGG_FLAC_1_0:
+ locTempString = "Content-type: audio/x-flac_1_0";
+ retVector.push_back(locTempString);
+ break;
+ case StreamHeaders::THEORA:
+ locTempString = "Content-type: video/x-theora";
+ retVector.push_back(locTempString);
+ break;
+ case StreamHeaders::FFDSHOW_VIDEO:
+ locTempString = "Content-type: video/x-ogm";
+ retVector.push_back(locTempString);
+ break;
+ case StreamHeaders::NONE:
+ default:
+ return NULL;
+ }
+
+ return retVector;
+}
+
Property changes on: trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/AnxPacketMaker.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/AnxPacketMaker.h
===================================================================
--- trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/AnxPacketMaker.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/AnxPacketMaker.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,35 +1,35 @@
-#pragma once
-
-#include "libOOOgg.h"
-#include "OggStreamFactory.h"
-class AnxPacketMaker
-{
-public:
- AnxPacketMaker(void);
- ~AnxPacketMaker(void);
-
- static const ANX_2_0_ANNODEX_BOS_SIZE = 48;
-
- static OggPage* makeAnnodexBOS ( unsigned long inSerialNo
- , unsigned short inVersionMajor
- , unsigned short inVersionMinor
- , unsigned __int64 inTimebaseNum
- , unsigned __int64 inTimebaseDenom
- , const char* inUTC
- );
-
- static StampedOggPacket* makeAnxData ( unsigned short inVersionMajor
- , unsigned short inVersionMinor
- , unsigned __int64 inGranuleRateNum
- , unsigned __int64 inGranuleDenom
- , unsigned long inNumSecHeaders
- , vector<string> inMessageHeaders
- );
-
- static StampedOggPacket* makeAnxData_2_0 (OggMuxStream* inMuxStream, OggPaginator* inPaginator);
- static StampedOggPacket* makeAnxData (OggMuxStream* inMuxStream, OggPaginator* inPaginator);
-
-
- static vector<string> AnxPacketMaker::makeMessageHeaders(OggMuxStream* inMuxStream);
-
-};
+#pragma once
+
+#include "libOOOgg.h"
+#include "OggStreamFactory.h"
+class AnxPacketMaker
+{
+public:
+ AnxPacketMaker(void);
+ ~AnxPacketMaker(void);
+
+ static const ANX_2_0_ANNODEX_BOS_SIZE = 48;
+
+ static OggPage* makeAnnodexBOS ( unsigned long inSerialNo
+ , unsigned short inVersionMajor
+ , unsigned short inVersionMinor
+ , unsigned __int64 inTimebaseNum
+ , unsigned __int64 inTimebaseDenom
+ , const char* inUTC
+ );
+
+ static StampedOggPacket* makeAnxData ( unsigned short inVersionMajor
+ , unsigned short inVersionMinor
+ , unsigned __int64 inGranuleRateNum
+ , unsigned __int64 inGranuleDenom
+ , unsigned long inNumSecHeaders
+ , vector<string> inMessageHeaders
+ );
+
+ static StampedOggPacket* makeAnxData_2_0 (OggMuxStream* inMuxStream, OggPaginator* inPaginator);
+ static StampedOggPacket* makeAnxData (OggMuxStream* inMuxStream, OggPaginator* inPaginator);
+
+
+ static vector<string> AnxPacketMaker::makeMessageHeaders(OggMuxStream* inMuxStream);
+
+};
Property changes on: trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/AnxPacketMaker.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/AnxPageInterleaver.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/AnxPageInterleaver.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/AnxPageInterleaver.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,84 +1,84 @@
-#include "StdAfx.h"
-#include ".\anxpageinterleaver.h"
-
-AnxPageInterleaver::AnxPageInterleaver(unsigned long inVersionMajor, unsigned long inVersionMinor)
- : mVersionMajor(inVersionMajor)
- , mVersionMinor(inVersionMinor)
- , mIsAnxSetup(false)
-{
- //This is the Annodex Logical Stream
- //mInputStreams.push_back(newStream());
-
- //Just make a random serial number
- mAnxSerialNo = 999;
-}
-
-AnxPageInterleaver::~AnxPageInterleaver(void)
-{
-
-}
-
-void AnxPageInterleaver::addAnnodex_2_0_BOS() {
- //Find the CMML data
- //TODO::: Need to grab the data from CMML page
-
- unsigned char* locUTC = new unsigned char[20];
- memset((void*)locUTC, 0, 20);
-
- OggPage* locBOSPage = AnxPacketMaker::makeAnnodexBOS( mAnxSerialNo
- , 2
- , 0
- , 0
- , 0
- , locUTC);
-
-
- //Put the annodex BOS out to the file.
- mFileWriter->acceptOggPage(locBOSPage);
- delete locUTC;
-
-}
-
-void AnxPageInterleaver::addAllAnxData_2_0_BOS() {
- for (int i = 1; i < mInputStreams.size(); i++) {
- mFileWriter->acceptOggPage(mInputStreams[i]->popFront());
- }
-
-}
-
-void AnxPageInterleaver::addAnnodexEOS() {
- //Make the EOS page and dump it
-
- OggPage* locEOSPage = new OggPage;
-
- locEOSPage->header()->setStreamSerialNo(mAnxSerialNo);
- locEOSPage->header()->setHeaderFlags(4);
- locEOSPage->header()->setHeaderSize(27);
-
- mFileWriter->acceptOggPage(locEOSPage);
-}
-void AnxPageInterleaver::processData()
-{
- if ((mVersionMajor == 2) && (mVersionMinor == 0))) {
- //IF seen all headers
- // CREATE ANNODEX BOS
- // CREATE ANXDATA BOS's
- // CREATE ANNODEX EOS
- //ELSE
- // DO NOTHING
- //ENDIF
- //
-
- if (!isAnxSetup) {
- if (gotAllHeaders()) {
- isAnxSetup = true;
- addAnnodex_2_0_BOS();
- addAllAnxData_2_0_BOS();
- addAnnodexEOS();
- //TODO::: Pump out these start pages.
- }
- } else {
- OggPageInterleaver::processData();
- }
-
-}
+#include "StdAfx.h"
+#include ".\anxpageinterleaver.h"
+
+AnxPageInterleaver::AnxPageInterleaver(unsigned long inVersionMajor, unsigned long inVersionMinor)
+ : mVersionMajor(inVersionMajor)
+ , mVersionMinor(inVersionMinor)
+ , mIsAnxSetup(false)
+{
+ //This is the Annodex Logical Stream
+ //mInputStreams.push_back(newStream());
+
+ //Just make a random serial number
+ mAnxSerialNo = 999;
+}
+
+AnxPageInterleaver::~AnxPageInterleaver(void)
+{
+
+}
+
+void AnxPageInterleaver::addAnnodex_2_0_BOS() {
+ //Find the CMML data
+ //TODO::: Need to grab the data from CMML page
+
+ unsigned char* locUTC = new unsigned char[20];
+ memset((void*)locUTC, 0, 20);
+
+ OggPage* locBOSPage = AnxPacketMaker::makeAnnodexBOS( mAnxSerialNo
+ , 2
+ , 0
+ , 0
+ , 0
+ , locUTC);
+
+
+ //Put the annodex BOS out to the file.
+ mFileWriter->acceptOggPage(locBOSPage);
+ delete locUTC;
+
+}
+
+void AnxPageInterleaver::addAllAnxData_2_0_BOS() {
+ for (int i = 1; i < mInputStreams.size(); i++) {
+ mFileWriter->acceptOggPage(mInputStreams[i]->popFront());
+ }
+
+}
+
+void AnxPageInterleaver::addAnnodexEOS() {
+ //Make the EOS page and dump it
+
+ OggPage* locEOSPage = new OggPage;
+
+ locEOSPage->header()->setStreamSerialNo(mAnxSerialNo);
+ locEOSPage->header()->setHeaderFlags(4);
+ locEOSPage->header()->setHeaderSize(27);
+
+ mFileWriter->acceptOggPage(locEOSPage);
+}
+void AnxPageInterleaver::processData()
+{
+ if ((mVersionMajor == 2) && (mVersionMinor == 0))) {
+ //IF seen all headers
+ // CREATE ANNODEX BOS
+ // CREATE ANXDATA BOS's
+ // CREATE ANNODEX EOS
+ //ELSE
+ // DO NOTHING
+ //ENDIF
+ //
+
+ if (!isAnxSetup) {
+ if (gotAllHeaders()) {
+ isAnxSetup = true;
+ addAnnodex_2_0_BOS();
+ addAllAnxData_2_0_BOS();
+ addAnnodexEOS();
+ //TODO::: Pump out these start pages.
+ }
+ } else {
+ OggPageInterleaver::processData();
+ }
+
+}
Property changes on: trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/AnxPageInterleaver.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/AnxPageInterleaver.h
===================================================================
--- trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/AnxPageInterleaver.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/AnxPageInterleaver.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,20 +1,20 @@
-#pragma once
-
-#include "OggPageInterleaver.h"
-class AnxPageInterleaver
- : public OggPageInterleaver
-{
-public:
- AnxPageInterleaver(unsigned long inVersionMajor, unsigned long inVersionMinor);
- virtual ~AnxPageInterleaver(void);
-
-
- virtual void processData();
-
-
-protected:
- bool mIsAnxSetup;
-
- unsigned long mVersionMajor;
- unsigned long mVersionMinor;
-};
+#pragma once
+
+#include "OggPageInterleaver.h"
+class AnxPageInterleaver
+ : public OggPageInterleaver
+{
+public:
+ AnxPageInterleaver(unsigned long inVersionMajor, unsigned long inVersionMinor);
+ virtual ~AnxPageInterleaver(void);
+
+
+ virtual void processData();
+
+
+protected:
+ bool mIsAnxSetup;
+
+ unsigned long mVersionMajor;
+ unsigned long mVersionMinor;
+};
Property changes on: trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/AnxPageInterleaver.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/libOOAnnodex.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/libOOAnnodex.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/libOOAnnodex.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,20 +1,20 @@
-// libOOAnnodex.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-#include "libOOAnnodex.h"
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
-}
+// libOOAnnodex.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+#include "libOOAnnodex.h"
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ switch (ul_reason_for_call)
+ {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
+}
Property changes on: trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/libOOAnnodex.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/libOOAnnodex.h
===================================================================
--- trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/libOOAnnodex.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/libOOAnnodex.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,11 +1,11 @@
-// The following ifdef block is the standard way of creating macros which make exporting
-// from a DLL simpler. All files within this DLL are compiled with the LIBOOANNODEX_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see
-// LIBOOANNODEX_API functions as being imported from a DLL, whereas this DLL sees symbols
-// defined with this macro as being exported.
-#ifdef LIBOOANNODEX_EXPORTS
-#define LIBOOANNODEX_API __declspec(dllexport)
-#else
-#define LIBOOANNODEX_API __declspec(dllimport)
-#endif
+// The following ifdef block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the LIBOOANNODEX_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// LIBOOANNODEX_API functions as being imported from a DLL, whereas this DLL sees symbols
+// defined with this macro as being exported.
+#ifdef LIBOOANNODEX_EXPORTS
+#define LIBOOANNODEX_API __declspec(dllexport)
+#else
+#define LIBOOANNODEX_API __declspec(dllimport)
+#endif
Property changes on: trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/libOOAnnodex.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// libOOAnnodex.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// libOOAnnodex.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,13 +1,13 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-// TODO: reference additional headers your program requires here
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/lib/core/annodex/libOOAnnodex/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/acconfig.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/doc/anx_read_dox.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/annodex.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/anx_constants.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/anx_core.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/anx_general.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/anx_import.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/anx_int64.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/anx_int64_w32.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/anx_list.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/anx_params.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/anx_read.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/anx_track.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/anx_types.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/include/annodex/anx_write.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/libltdl/ltdl.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/anx_bos.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/anx_byteswap.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/anx_command.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/anx_compat.h
===================================================================
--- trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/anx_compat.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/anx_compat.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -50,7 +50,7 @@
#else
#ifdef WIN32
-#include <io.h>
+#include <io.h>
#include <process.h>
#endif
@@ -65,13 +65,13 @@
#define vsnprintf _vsnprintf
#define random rand
#define srandom srand
-#define lstat stat
-#define getpid _getpid
-
+#define lstat stat
+#define getpid _getpid
+
#include <stdarg.h>
-#include <stdlib.h>
-int vsnprintf(char * str, size_t n, const char * fmt, va_list ap);
-
+#include <stdlib.h>
+int vsnprintf(char * str, size_t n, const char * fmt, va_list ap);
+
#endif
#endif /* __ANX_COMPAT_H__ */
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/anx_compat.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/anx_import_private.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/anx_mapping.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/anx_private.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/anx_snprint.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/anx_tree.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/content_type.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/fix_dl.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/src/libannodex/xtag.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/src/tests/anx_tests.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/src/tools/common.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/win32/config.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/annodex/libannodex/win32/dirent.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeFilter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeFilter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,104 +1,104 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-//
-// AbstractAudioDecodeFilter.cpp : Abstract Audio Decoder Filter Class
-//
-
-
-#include "StdAfx.h"
-#include "abstractaudiodecodefilter.h"
-
-//Constructors
-AbstractAudioDecodeFilter::AbstractAudioDecodeFilter(TCHAR* inFilterName, REFCLSID inFilterGUID, unsigned short inAudioFormat )
- //Base Classes
- : CBaseFilter(inFilterName, NULL, m_pLock, inFilterGUID)
-
- //Member initialisations
- , mAudioFormat(inAudioFormat)
-
-{
- //Create the filter lock.
- m_pLock = new CCritSec; //Deleted in destructor... check what is happening in the base class.
-}
-
-AbstractAudioDecodeFilter::~AbstractAudioDecodeFilter(void)
-{
- DestroyPins();
- delete m_pLock; //Deleting filter lock
-}
-
-void AbstractAudioDecodeFilter::DestroyPins()
-{
- delete mOutputPin;
- delete mInputPin;
-}
-
-//If you want to handle an interface, do it here.
-STDMETHODIMP AbstractAudioDecodeFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
- return CBaseFilter::NonDelegatingQueryInterface(riid, ppv);
-}
-
-CBasePin* AbstractAudioDecodeFilter::GetPin(int inPinNo)
-{
- //Pin Constants
- const int INPUT_PIN = 0;
- const int OUTPUT_PIN = 1;
-
- //Return the pin.
- switch (inPinNo) {
- case INPUT_PIN:
- return mInputPin;
- case OUTPUT_PIN:
- return mOutputPin;
- default:
- return NULL;
- };
-}
-
-STDMETHODIMP AbstractAudioDecodeFilter::Stop()
-{
- //Hold the filter lock
- CAutoLock locLock(m_pLock);
-
- //Reset the
- mInputPin->ResetFrameCount();
- mInputPin->ResetTimeBases();
-
- return CBaseFilter::Stop();
-}
-int AbstractAudioDecodeFilter::GetPinCount(void)
-{
- const long NUM_PINS = 2;
- return NUM_PINS;
-}
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+//
+// AbstractAudioDecodeFilter.cpp : Abstract Audio Decoder Filter Class
+//
+
+
+#include "StdAfx.h"
+#include "abstractaudiodecodefilter.h"
+
+//Constructors
+AbstractAudioDecodeFilter::AbstractAudioDecodeFilter(TCHAR* inFilterName, REFCLSID inFilterGUID, unsigned short inAudioFormat )
+ //Base Classes
+ : CBaseFilter(inFilterName, NULL, m_pLock, inFilterGUID)
+
+ //Member initialisations
+ , mAudioFormat(inAudioFormat)
+
+{
+ //Create the filter lock.
+ m_pLock = new CCritSec; //Deleted in destructor... check what is happening in the base class.
+}
+
+AbstractAudioDecodeFilter::~AbstractAudioDecodeFilter(void)
+{
+ DestroyPins();
+ delete m_pLock; //Deleting filter lock
+}
+
+void AbstractAudioDecodeFilter::DestroyPins()
+{
+ delete mOutputPin;
+ delete mInputPin;
+}
+
+//If you want to handle an interface, do it here.
+STDMETHODIMP AbstractAudioDecodeFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+ return CBaseFilter::NonDelegatingQueryInterface(riid, ppv);
+}
+
+CBasePin* AbstractAudioDecodeFilter::GetPin(int inPinNo)
+{
+ //Pin Constants
+ const int INPUT_PIN = 0;
+ const int OUTPUT_PIN = 1;
+
+ //Return the pin.
+ switch (inPinNo) {
+ case INPUT_PIN:
+ return mInputPin;
+ case OUTPUT_PIN:
+ return mOutputPin;
+ default:
+ return NULL;
+ };
+}
+
+STDMETHODIMP AbstractAudioDecodeFilter::Stop()
+{
+ //Hold the filter lock
+ CAutoLock locLock(m_pLock);
+
+ //Reset the
+ mInputPin->ResetFrameCount();
+ mInputPin->ResetTimeBases();
+
+ return CBaseFilter::Stop();
+}
+int AbstractAudioDecodeFilter::GetPinCount(void)
+{
+ const long NUM_PINS = 2;
+ return NUM_PINS;
+}
+
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeFilter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeFilter.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeFilter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeFilter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,94 +1,94 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-
-#pragma once
-
-//Local Includes
-#include "abstractaudiodllstuff.h"
-#include "BasicSeekable.h"
-
-//Forward Declarations
-class AbstractAudioDecodeInputPin;
-class AbstractAudioDecodeOutputPin;
-
-
-class ABS_AUDIO_DEC_API AbstractAudioDecodeFilter
- //Parent Classes
- : public CBaseFilter
- //http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directshow/htm/cbasefilterclass.asp
-{
-public:
- //Friend Classes
- friend class AbstractAudioDecodeInputPin;
- friend class AbstractAudioDecodeOutputPin;
-
- //COM Setup
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- //Constants and Enumerations
- static const long NUM_PINS = 2;
- enum eAudioFormat {
- NONE = 0,
- VORBIS = 1,
- SPEEX = 2,
- FLAC = 3,
- OTHER = 1000
- };
-
- //Constructors
- AbstractAudioDecodeFilter(TCHAR* inFilterName, REFCLSID inFilterGUID, unsigned short inAudioFormat );
- virtual ~AbstractAudioDecodeFilter(void);
-
- //Pin Methods
- CBasePin* GetPin(int n);
- int GetPinCount(void);
-
- virtual bool ConstructPins() = 0;
- virtual void DestroyPins();
-
-
- //Media Control Methods
- virtual STDMETHODIMP Stop();
-
-
-
- unsigned short mAudioFormat; //TODO::: Make this private at some point
-
- //static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
-protected:
- //Member Data
- AbstractAudioDecodeInputPin* mInputPin;
- AbstractAudioDecodeOutputPin* mOutputPin;
-};
-
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+
+#pragma once
+
+//Local Includes
+#include "abstractaudiodllstuff.h"
+#include "BasicSeekable.h"
+
+//Forward Declarations
+class AbstractAudioDecodeInputPin;
+class AbstractAudioDecodeOutputPin;
+
+
+class ABS_AUDIO_DEC_API AbstractAudioDecodeFilter
+ //Parent Classes
+ : public CBaseFilter
+ //http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directshow/htm/cbasefilterclass.asp
+{
+public:
+ //Friend Classes
+ friend class AbstractAudioDecodeInputPin;
+ friend class AbstractAudioDecodeOutputPin;
+
+ //COM Setup
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ //Constants and Enumerations
+ static const long NUM_PINS = 2;
+ enum eAudioFormat {
+ NONE = 0,
+ VORBIS = 1,
+ SPEEX = 2,
+ FLAC = 3,
+ OTHER = 1000
+ };
+
+ //Constructors
+ AbstractAudioDecodeFilter(TCHAR* inFilterName, REFCLSID inFilterGUID, unsigned short inAudioFormat );
+ virtual ~AbstractAudioDecodeFilter(void);
+
+ //Pin Methods
+ CBasePin* GetPin(int n);
+ int GetPinCount(void);
+
+ virtual bool ConstructPins() = 0;
+ virtual void DestroyPins();
+
+
+ //Media Control Methods
+ virtual STDMETHODIMP Stop();
+
+
+
+ unsigned short mAudioFormat; //TODO::: Make this private at some point
+
+ //static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+protected:
+ //Member Data
+ AbstractAudioDecodeInputPin* mInputPin;
+ AbstractAudioDecodeOutputPin* mOutputPin;
+};
+
+
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeFilter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeInputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeInputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,253 +1,253 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "abstractaudiodecodeinputpin.h"
-
-//#include <mtype.h>
-AbstractAudioDecodeInputPin::AbstractAudioDecodeInputPin (AbstractAudioDecodeFilter* inParentFilter, CCritSec* inFilterLock, AbstractAudioDecodeOutputPin* inOutputPin, CHAR* inObjectName, LPCWSTR inPinDisplayName, CMediaType* inAcceptMediaType)
- : CBaseInputPin (inObjectName, inParentFilter, inFilterLock, &mHR, inPinDisplayName)
- , mOutputPin (inOutputPin)
- , mParentFilter (inParentFilter)
-
- , mBegun (false)
- , mUptoFrame (0)
- , mFrameSize (0)
- , mNumChannels (0)
- , mSampleRate (0)
- //, mFilterLock(inFilterLock)
- , mLastSeenStartGranPos (0)
- , mSeekTimeBase (0)
- , mChainTimeBase (0)
-{
-
- //ConstructCodec();
- //debugLog.open("g:\\logs\\aad.log", ios_base::out);
- mAcceptableMediaType = inAcceptMediaType;
- mStreamLock = new CCritSec; //Deleted in destructor.
-
- //This is causing a problem... since every addref on a pin automatically
- // adds a ref to the filter... we get the situation, where on shutdown
- // the output pin still hold a ref on the input pin due to this bit of code
- // So at shutdown,
- // the input pin has a ref count of 1
- // the output pin has a ref count of 0 (it's released by the downstream filter)
- // the filter has a ref count of 1 by way of the automatic addref from the input pin
- // This means that even when everything else releases all it's refs on the filter
- // it still has a ref count of 1... and since currently the ref that the
- // output pin holds on the input pin isn't release until the output pin is
- // destroyed, and the output pin isn't destroyed until the filter is
- // we get a circular reference.
- //
- //New solution is to attach this reference (from output to input) on the
- // complete connect method of the output pin via mParentfilter
- // and to release it when on the break conncet of the output pin.
- // This means that now as soon as the downstream filter releases the output
- // pin, it will release it's ref on the input pin, leaving the pins and the filer with
- // zero ref counts... well thats the plan anyway.
- //
- //IMediaSeeking* locSeeker = NULL;
- //this->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
- //mOutputPin->SetDelegate(locSeeker);
- //
-}
-
-STDMETHODIMP AbstractAudioDecodeInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
- if (riid == IID_IMediaSeeking) {
- *ppv = (IMediaSeeking*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- }
-
- return CBaseInputPin::NonDelegatingQueryInterface(riid, ppv);
-}
-
-HRESULT AbstractAudioDecodeInputPin::BreakConnect()
-{
- CAutoLock locLock(m_pLock);
- //Release the seeking
- ReleaseDelegate();
- return CBaseInputPin::BreakConnect();
-}
-HRESULT AbstractAudioDecodeInputPin::CompleteConnect (IPin *inReceivePin)
-{
- CAutoLock locLock(m_pLock);
-
- IMediaSeeking* locSeeker = NULL;
- inReceivePin->QueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
- SetDelegate(locSeeker);
- return CBaseInputPin::CompleteConnect(inReceivePin);
-}
-AbstractAudioDecodeInputPin::~AbstractAudioDecodeInputPin(void)
-{
- //DestroyCodec();
- //debugLog.close();
- delete mStreamLock;
- delete mAcceptableMediaType;
- mAcceptableMediaType = NULL;
-}
-
-
-void AbstractAudioDecodeInputPin::ResetFrameCount()
-{
- mUptoFrame = 0;
-
-}
-void AbstractAudioDecodeInputPin::ResetTimeBases()
-{
- mLastSeenStartGranPos = 0;
-}
-bool AbstractAudioDecodeInputPin::SetSampleParams(IMediaSample* outMediaSample, unsigned long inDataSize, REFERENCE_TIME* inStartTime, REFERENCE_TIME* inEndTime)
-{
- outMediaSample->SetTime(inStartTime, inEndTime);
- outMediaSample->SetMediaTime(NULL, NULL);
- outMediaSample->SetActualDataLength(inDataSize);
- outMediaSample->SetPreroll(FALSE);
- outMediaSample->SetDiscontinuity(FALSE);
- outMediaSample->SetSyncPoint(TRUE);
- return true;
-}
-
-
-STDMETHODIMP AbstractAudioDecodeInputPin::Receive(IMediaSample* inSample)
-{
- CAutoLock locLock(mStreamLock);
-
- HRESULT locHR = CheckStreaming();
-
- if (locHR == S_OK) {
- BYTE* locBuff = NULL;
- locHR = inSample->GetPointer(&locBuff);
-
- if (FAILED(locHR)) {
- return locHR;
- } else {
- //New start time hacks
- REFERENCE_TIME locStart = 0;
- REFERENCE_TIME locEnd = 0;
-
- //More work arounds for that stupid granule pos scheme in theora!
- REFERENCE_TIME locTimeBase = 0;
- REFERENCE_TIME locDummy = 0;
- inSample->GetMediaTime(&locTimeBase, &locDummy);
- mSeekTimeBase = locTimeBase;
- //
-
- inSample->GetTime(&locStart, &locEnd);
- //Error chacks needed here
- //debugLog<<"Receive : Start = "<<locStart<<endl;
- //debugLog<<"Receive : End = "<<locEnd<<endl;
- //debugLog<<"Receive : Timebase = "<<locTimeBase<<endl;
-
- if ((mLastSeenStartGranPos != locStart) && (locStart != -1)) {
- //debugLog<<"Receive : RESETTING FRAME COUNT !!"<<endl;
- ResetFrameCount();
- }
- //debugLog<<endl;
- mLastSeenStartGranPos = locStart;
- //End of additions
-
- long locResult = decodeData(locBuff, inSample->GetActualDataLength());
- if (locResult == 0) {
-
- //aadDebug<<"Receive Decode : OK"<<endl;
- return S_OK;
- } else {
- //aadDebug<<"Receive Decode : *** FAILED *** "<<locResult<<endl;
- return S_FALSE;
- }
- }
- } else {
- //debugLog<<"NOT STREAMING.... "<<endl;
- return locHR;
- }
-
- return S_OK;
-}
-
-HRESULT AbstractAudioDecodeInputPin::CheckMediaType(const CMediaType *inMediaType) {
- //TO DO::: Neaten this up.
- if ( (inMediaType->majortype == MEDIATYPE_Audio) &&
- (inMediaType->subtype == mAcceptableMediaType->subtype) && (inMediaType->formattype == mAcceptableMediaType->formattype)
- )
- {
- return S_OK;
- } else {
- return S_FALSE;
- }
-}
-
-STDMETHODIMP AbstractAudioDecodeInputPin::EndOfStream(void) {
- CAutoLock locLock(mStreamLock);
-
- return mParentFilter->mOutputPin->DeliverEndOfStream();
-}
-
-STDMETHODIMP AbstractAudioDecodeInputPin::BeginFlush() {
- CAutoLock locLock(m_pLock);
-
- CBaseInputPin::BeginFlush();
- return mParentFilter->mOutputPin->DeliverBeginFlush();
-}
-STDMETHODIMP AbstractAudioDecodeInputPin::EndFlush() {
- CAutoLock locLock(m_pLock);
-
- mParentFilter->mOutputPin->DeliverEndFlush();
- return CBaseInputPin::EndFlush();
-}
-
-STDMETHODIMP AbstractAudioDecodeInputPin::NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate) {
- CAutoLock locLock(mStreamLock);
- ResetFrameCount();
-
- //BUG::: Why is this on the base pin and not the baseinputpin ?
- CBasePin::NewSegment(tStart, tStop, dRate);
- return mParentFilter->mOutputPin->DeliverNewSegment(tStart, tStop, dRate);
-}
-
-HRESULT AbstractAudioDecodeInputPin::GetMediaType(int inPosition, CMediaType *outMediaType) {
-
- if (inPosition < 0) {
- return E_INVALIDARG;
- }
-
- switch (inPosition) {
- case 0:
-
- outMediaType->SetType(&MEDIATYPE_Audio);
- outMediaType->SetSubtype(&(mAcceptableMediaType->subtype));
- //Don't set the format data here. That's up to our output pin/
- return S_OK;
- default:
- return VFW_S_NO_MORE_ITEMS;
- }
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "abstractaudiodecodeinputpin.h"
+
+//#include <mtype.h>
+AbstractAudioDecodeInputPin::AbstractAudioDecodeInputPin (AbstractAudioDecodeFilter* inParentFilter, CCritSec* inFilterLock, AbstractAudioDecodeOutputPin* inOutputPin, CHAR* inObjectName, LPCWSTR inPinDisplayName, CMediaType* inAcceptMediaType)
+ : CBaseInputPin (inObjectName, inParentFilter, inFilterLock, &mHR, inPinDisplayName)
+ , mOutputPin (inOutputPin)
+ , mParentFilter (inParentFilter)
+
+ , mBegun (false)
+ , mUptoFrame (0)
+ , mFrameSize (0)
+ , mNumChannels (0)
+ , mSampleRate (0)
+ //, mFilterLock(inFilterLock)
+ , mLastSeenStartGranPos (0)
+ , mSeekTimeBase (0)
+ , mChainTimeBase (0)
+{
+
+ //ConstructCodec();
+ //debugLog.open("g:\\logs\\aad.log", ios_base::out);
+ mAcceptableMediaType = inAcceptMediaType;
+ mStreamLock = new CCritSec; //Deleted in destructor.
+
+ //This is causing a problem... since every addref on a pin automatically
+ // adds a ref to the filter... we get the situation, where on shutdown
+ // the output pin still hold a ref on the input pin due to this bit of code
+ // So at shutdown,
+ // the input pin has a ref count of 1
+ // the output pin has a ref count of 0 (it's released by the downstream filter)
+ // the filter has a ref count of 1 by way of the automatic addref from the input pin
+ // This means that even when everything else releases all it's refs on the filter
+ // it still has a ref count of 1... and since currently the ref that the
+ // output pin holds on the input pin isn't release until the output pin is
+ // destroyed, and the output pin isn't destroyed until the filter is
+ // we get a circular reference.
+ //
+ //New solution is to attach this reference (from output to input) on the
+ // complete connect method of the output pin via mParentfilter
+ // and to release it when on the break conncet of the output pin.
+ // This means that now as soon as the downstream filter releases the output
+ // pin, it will release it's ref on the input pin, leaving the pins and the filer with
+ // zero ref counts... well thats the plan anyway.
+ //
+ //IMediaSeeking* locSeeker = NULL;
+ //this->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+ //mOutputPin->SetDelegate(locSeeker);
+ //
+}
+
+STDMETHODIMP AbstractAudioDecodeInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+ if (riid == IID_IMediaSeeking) {
+ *ppv = (IMediaSeeking*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ }
+
+ return CBaseInputPin::NonDelegatingQueryInterface(riid, ppv);
+}
+
+HRESULT AbstractAudioDecodeInputPin::BreakConnect()
+{
+ CAutoLock locLock(m_pLock);
+ //Release the seeking
+ ReleaseDelegate();
+ return CBaseInputPin::BreakConnect();
+}
+HRESULT AbstractAudioDecodeInputPin::CompleteConnect (IPin *inReceivePin)
+{
+ CAutoLock locLock(m_pLock);
+
+ IMediaSeeking* locSeeker = NULL;
+ inReceivePin->QueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+ SetDelegate(locSeeker);
+ return CBaseInputPin::CompleteConnect(inReceivePin);
+}
+AbstractAudioDecodeInputPin::~AbstractAudioDecodeInputPin(void)
+{
+ //DestroyCodec();
+ //debugLog.close();
+ delete mStreamLock;
+ delete mAcceptableMediaType;
+ mAcceptableMediaType = NULL;
+}
+
+
+void AbstractAudioDecodeInputPin::ResetFrameCount()
+{
+ mUptoFrame = 0;
+
+}
+void AbstractAudioDecodeInputPin::ResetTimeBases()
+{
+ mLastSeenStartGranPos = 0;
+}
+bool AbstractAudioDecodeInputPin::SetSampleParams(IMediaSample* outMediaSample, unsigned long inDataSize, REFERENCE_TIME* inStartTime, REFERENCE_TIME* inEndTime)
+{
+ outMediaSample->SetTime(inStartTime, inEndTime);
+ outMediaSample->SetMediaTime(NULL, NULL);
+ outMediaSample->SetActualDataLength(inDataSize);
+ outMediaSample->SetPreroll(FALSE);
+ outMediaSample->SetDiscontinuity(FALSE);
+ outMediaSample->SetSyncPoint(TRUE);
+ return true;
+}
+
+
+STDMETHODIMP AbstractAudioDecodeInputPin::Receive(IMediaSample* inSample)
+{
+ CAutoLock locLock(mStreamLock);
+
+ HRESULT locHR = CheckStreaming();
+
+ if (locHR == S_OK) {
+ BYTE* locBuff = NULL;
+ locHR = inSample->GetPointer(&locBuff);
+
+ if (FAILED(locHR)) {
+ return locHR;
+ } else {
+ //New start time hacks
+ REFERENCE_TIME locStart = 0;
+ REFERENCE_TIME locEnd = 0;
+
+ //More work arounds for that stupid granule pos scheme in theora!
+ REFERENCE_TIME locTimeBase = 0;
+ REFERENCE_TIME locDummy = 0;
+ inSample->GetMediaTime(&locTimeBase, &locDummy);
+ mSeekTimeBase = locTimeBase;
+ //
+
+ inSample->GetTime(&locStart, &locEnd);
+ //Error chacks needed here
+ //debugLog<<"Receive : Start = "<<locStart<<endl;
+ //debugLog<<"Receive : End = "<<locEnd<<endl;
+ //debugLog<<"Receive : Timebase = "<<locTimeBase<<endl;
+
+ if ((mLastSeenStartGranPos != locStart) && (locStart != -1)) {
+ //debugLog<<"Receive : RESETTING FRAME COUNT !!"<<endl;
+ ResetFrameCount();
+ }
+ //debugLog<<endl;
+ mLastSeenStartGranPos = locStart;
+ //End of additions
+
+ long locResult = decodeData(locBuff, inSample->GetActualDataLength());
+ if (locResult == 0) {
+
+ //aadDebug<<"Receive Decode : OK"<<endl;
+ return S_OK;
+ } else {
+ //aadDebug<<"Receive Decode : *** FAILED *** "<<locResult<<endl;
+ return S_FALSE;
+ }
+ }
+ } else {
+ //debugLog<<"NOT STREAMING.... "<<endl;
+ return locHR;
+ }
+
+ return S_OK;
+}
+
+HRESULT AbstractAudioDecodeInputPin::CheckMediaType(const CMediaType *inMediaType) {
+ //TO DO::: Neaten this up.
+ if ( (inMediaType->majortype == MEDIATYPE_Audio) &&
+ (inMediaType->subtype == mAcceptableMediaType->subtype) && (inMediaType->formattype == mAcceptableMediaType->formattype)
+ )
+ {
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
+}
+
+STDMETHODIMP AbstractAudioDecodeInputPin::EndOfStream(void) {
+ CAutoLock locLock(mStreamLock);
+
+ return mParentFilter->mOutputPin->DeliverEndOfStream();
+}
+
+STDMETHODIMP AbstractAudioDecodeInputPin::BeginFlush() {
+ CAutoLock locLock(m_pLock);
+
+ CBaseInputPin::BeginFlush();
+ return mParentFilter->mOutputPin->DeliverBeginFlush();
+}
+STDMETHODIMP AbstractAudioDecodeInputPin::EndFlush() {
+ CAutoLock locLock(m_pLock);
+
+ mParentFilter->mOutputPin->DeliverEndFlush();
+ return CBaseInputPin::EndFlush();
+}
+
+STDMETHODIMP AbstractAudioDecodeInputPin::NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate) {
+ CAutoLock locLock(mStreamLock);
+ ResetFrameCount();
+
+ //BUG::: Why is this on the base pin and not the baseinputpin ?
+ CBasePin::NewSegment(tStart, tStop, dRate);
+ return mParentFilter->mOutputPin->DeliverNewSegment(tStart, tStop, dRate);
+}
+
+HRESULT AbstractAudioDecodeInputPin::GetMediaType(int inPosition, CMediaType *outMediaType) {
+
+ if (inPosition < 0) {
+ return E_INVALIDARG;
+ }
+
+ switch (inPosition) {
+ case 0:
+
+ outMediaType->SetType(&MEDIATYPE_Audio);
+ outMediaType->SetSubtype(&(mAcceptableMediaType->subtype));
+ //Don't set the format data here. That's up to our output pin/
+ return S_OK;
+ default:
+ return VFW_S_NO_MORE_ITEMS;
+ }
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeInputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeInputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeInputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,117 +1,117 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-//Local Includes
-#include "abstractaudiodllstuff.h"
-#include "BasicSeekable.h"
-#include <fstream>
-using namespace std;
-//Forward Declarations
-class AbstractAudioDecodeOutputPin;
-class AbstractAudioDecodeFilter;
-
-//*************************************************************************************************
-class ABS_AUDIO_DEC_API AbstractAudioDecodeInputPin
- //Parent Classes
- : public CBaseInputPin
- , public BasicSeekable
-{
-public:
- //Friend Classes
- friend class AbstractAudioDecodeOutputPin;
-
- //Constants and Enumerations
- static const short SIZE_16_BITS = 2;
- static const signed short SINT_MAX = 32767;
- static const signed short SINT_MIN = -32768;
-
- //COM Setup
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- //Constructors
- AbstractAudioDecodeInputPin(AbstractAudioDecodeFilter* inParentFilter, CCritSec* inFilterLock, AbstractAudioDecodeOutputPin* inOutputPin, CHAR* inObjectName, LPCWSTR inPinDisplayName, CMediaType* inAcceptMediaType);
- virtual ~AbstractAudioDecodeInputPin(void);
-
- //PURE VIRTUALS
- virtual long decodeData(unsigned char* inBuf, long inNumBytes) = 0;
- virtual bool ConstructCodec() = 0;
- virtual void DestroyCodec() = 0;
-
- virtual HRESULT BreakConnect();
- virtual HRESULT CompleteConnect (IPin *inReceivePin);
- STDMETHODIMP Receive(IMediaSample *pSample);
- virtual HRESULT CheckMediaType(const CMediaType *inMediaType);
- virtual HRESULT GetMediaType(int inPosition, CMediaType *outMediaType);
- virtual HRESULT SetMediaType(const CMediaType* inMediaType) = 0;
-
- virtual void ResetFrameCount();
- virtual void ResetTimeBases();
-
- virtual STDMETHODIMP EndOfStream(void);
- virtual STDMETHODIMP BeginFlush();
- virtual STDMETHODIMP EndFlush();
- virtual STDMETHODIMP NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
-
-
- //These really shouldn't be public !!
- //Chaining hackery
- REFERENCE_TIME mChainTimeBase;
- REFERENCE_TIME mPreviousEndTime;
-protected:
-
- virtual bool SetSampleParams(IMediaSample* outMediaSample, unsigned long inDataSize, REFERENCE_TIME* inStartTime, REFERENCE_TIME* inEndTime);
-
-
- HRESULT mHR;
- bool mBegun;
- AbstractAudioDecodeOutputPin* mOutputPin;
- __int64 mUptoFrame;
- __int64 mLastSeenStartGranPos;
- AbstractAudioDecodeFilter* mParentFilter;
- CMediaType* mAcceptableMediaType;
-
- //fstream debugLog;
- CCritSec* mStreamLock;
- //CCritSec* mFilterLock;
-
- unsigned long mFrameSize;
- unsigned long mNumChannels;
- unsigned long mSampleRate;
-
- REFERENCE_TIME mSeekTimeBase;
-
-
-
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+//Local Includes
+#include "abstractaudiodllstuff.h"
+#include "BasicSeekable.h"
+#include <fstream>
+using namespace std;
+//Forward Declarations
+class AbstractAudioDecodeOutputPin;
+class AbstractAudioDecodeFilter;
+
+//*************************************************************************************************
+class ABS_AUDIO_DEC_API AbstractAudioDecodeInputPin
+ //Parent Classes
+ : public CBaseInputPin
+ , public BasicSeekable
+{
+public:
+ //Friend Classes
+ friend class AbstractAudioDecodeOutputPin;
+
+ //Constants and Enumerations
+ static const short SIZE_16_BITS = 2;
+ static const signed short SINT_MAX = 32767;
+ static const signed short SINT_MIN = -32768;
+
+ //COM Setup
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ //Constructors
+ AbstractAudioDecodeInputPin(AbstractAudioDecodeFilter* inParentFilter, CCritSec* inFilterLock, AbstractAudioDecodeOutputPin* inOutputPin, CHAR* inObjectName, LPCWSTR inPinDisplayName, CMediaType* inAcceptMediaType);
+ virtual ~AbstractAudioDecodeInputPin(void);
+
+ //PURE VIRTUALS
+ virtual long decodeData(unsigned char* inBuf, long inNumBytes) = 0;
+ virtual bool ConstructCodec() = 0;
+ virtual void DestroyCodec() = 0;
+
+ virtual HRESULT BreakConnect();
+ virtual HRESULT CompleteConnect (IPin *inReceivePin);
+ STDMETHODIMP Receive(IMediaSample *pSample);
+ virtual HRESULT CheckMediaType(const CMediaType *inMediaType);
+ virtual HRESULT GetMediaType(int inPosition, CMediaType *outMediaType);
+ virtual HRESULT SetMediaType(const CMediaType* inMediaType) = 0;
+
+ virtual void ResetFrameCount();
+ virtual void ResetTimeBases();
+
+ virtual STDMETHODIMP EndOfStream(void);
+ virtual STDMETHODIMP BeginFlush();
+ virtual STDMETHODIMP EndFlush();
+ virtual STDMETHODIMP NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
+
+
+ //These really shouldn't be public !!
+ //Chaining hackery
+ REFERENCE_TIME mChainTimeBase;
+ REFERENCE_TIME mPreviousEndTime;
+protected:
+
+ virtual bool SetSampleParams(IMediaSample* outMediaSample, unsigned long inDataSize, REFERENCE_TIME* inStartTime, REFERENCE_TIME* inEndTime);
+
+
+ HRESULT mHR;
+ bool mBegun;
+ AbstractAudioDecodeOutputPin* mOutputPin;
+ __int64 mUptoFrame;
+ __int64 mLastSeenStartGranPos;
+ AbstractAudioDecodeFilter* mParentFilter;
+ CMediaType* mAcceptableMediaType;
+
+ //fstream debugLog;
+ CCritSec* mStreamLock;
+ //CCritSec* mFilterLock;
+
+ unsigned long mFrameSize;
+ unsigned long mNumChannels;
+ unsigned long mSampleRate;
+
+ REFERENCE_TIME mSeekTimeBase;
+
+
+
+
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeInputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeOutputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeOutputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeOutputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,209 +1,210 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "abstractaudiodecodeoutputpin.h"
-
-AbstractAudioDecodeOutputPin::AbstractAudioDecodeOutputPin(AbstractAudioDecodeFilter* inParentFilter, CCritSec* inFilterLock, CHAR* inObjectName, LPCWSTR inPinDisplayName)
- : CBaseOutputPin(inObjectName, inParentFilter, inFilterLock, &mHR, inPinDisplayName)
- , mParentFilter(inParentFilter)
- //, mFilterLock(inFilterLock)
- , mDataQueue(NULL)
-{
-
-}
-AbstractAudioDecodeOutputPin::~AbstractAudioDecodeOutputPin(void)
-{
- ReleaseDelegate();
- delete mDataQueue;
- mDataQueue = NULL;
-}
-
-STDMETHODIMP AbstractAudioDecodeOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
- if (riid == IID_IMediaSeeking) {
- *ppv = (IMediaSeeking*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- }
-
- return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
-}
-
-HRESULT AbstractAudioDecodeOutputPin::DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES* inPropertyRequest) {
-
//FIX::: Abstract this out properly
-
- HRESULT locHR = S_OK;
-
- ALLOCATOR_PROPERTIES locReqAlloc;
- ALLOCATOR_PROPERTIES locActualAlloc;
-
- const unsigned long MIN_BUFFER_SIZE = 1096;
- const unsigned long DEFAULT_BUFFER_SIZE = 32192;
- const unsigned long MIN_NUM_BUFFERS = 10;
- const unsigned long DEFAULT_NUM_BUFFERS = 20;
-
-
-
-
- if (inPropertyRequest->cbAlign <= 0) {
- locReqAlloc.cbAlign = 1;
- } else {
- locReqAlloc.cbAlign = inPropertyRequest->cbAlign;
- }
-
-
- if (inPropertyRequest->cbBuffer < MIN_BUFFER_SIZE) {
- locReqAlloc.cbBuffer = DEFAULT_BUFFER_SIZE;
- } else {
- locReqAlloc.cbBuffer = inPropertyRequest->cbBuffer;
- }
-
-
- if (inPropertyRequest->cbPrefix < 0) {
- locReqAlloc.cbPrefix = 0;
- } else {
- locReqAlloc.cbPrefix = inPropertyRequest->cbPrefix;
- }
-
-
- if (inPropertyRequest->cBuffers < MIN_NUM_BUFFERS) {
- locReqAlloc.cBuffers = DEFAULT_NUM_BUFFERS;
- } else {
- locReqAlloc.cBuffers = inPropertyRequest->cBuffers;
- }
-
-
- locHR = inAllocator->SetProperties(&locReqAlloc, &locActualAlloc);
-
- if (locHR != S_OK) {
- return locHR;
- }
-
- //Need to save this pointer to decommit in destructor.
-
- locHR = inAllocator->Commit();
-
- return locHR;
-}
-HRESULT AbstractAudioDecodeOutputPin::CheckMediaType(const CMediaType *inMediaType) {
- if ( (inMediaType->majortype == MEDIATYPE_Audio) &&
- (inMediaType->subtype == MEDIASUBTYPE_PCM) &&
- (inMediaType->formattype == FORMAT_WaveFormatEx)) {
- return S_OK;
- } else {
- return S_FALSE;
- }
-
-}
-
-void AbstractAudioDecodeOutputPin::FillMediaType(CMediaType* outMediaType) {
- outMediaType->SetType(&MEDIATYPE_Audio);
- outMediaType->SetSubtype(&MEDIASUBTYPE_PCM);
- outMediaType->SetFormatType(&FORMAT_WaveFormatEx);
- outMediaType->SetTemporalCompression(FALSE);
- outMediaType->SetSampleSize(0);
-
-}
-HRESULT AbstractAudioDecodeOutputPin::GetMediaType(int inPosition, CMediaType *outMediaType) {
-
- if (inPosition < 0) {
- return E_INVALIDARG;
- }
-
- if (inPosition == 0) {
- FillMediaType(outMediaType);
- WAVEFORMATEX* locWaveFormat = (WAVEFORMATEX*)outMediaType->AllocFormatBuffer(sizeof(WAVEFORMATEX));
- FillWaveFormatExBuffer(locWaveFormat);
- return S_OK;
- } else {
- return VFW_S_NO_MORE_ITEMS;
- }
-}
-
-HRESULT AbstractAudioDecodeOutputPin::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate) {
- //TO DO::: Change the naming convention of the params
- mDataQueue->NewSegment(tStart, tStop, dRate);
- return S_OK;
-}
-HRESULT AbstractAudioDecodeOutputPin::DeliverEndOfStream(void) {
-
- mDataQueue->EOS();
- return S_OK;
-}
-
-HRESULT AbstractAudioDecodeOutputPin::DeliverEndFlush(void) {
- CAutoLock locLock(m_pLock);
-
- mDataQueue->EndFlush();
- return S_OK;
-}
-
-HRESULT AbstractAudioDecodeOutputPin::DeliverBeginFlush(void) {
- CAutoLock locLock(m_pLock);
-
-
- mDataQueue->BeginFlush();
- return S_OK;
-
-}
-
-HRESULT AbstractAudioDecodeOutputPin::CompleteConnect (IPin *inReceivePin) {
- CAutoLock locLock(m_pLock);
- HRESULT locHR = S_OK;
-
- //Here when another pin connects to us, we internally connect the seek delegate
- // from this output pin onto the input pin... and we release it on breakconnect.
- //
- IMediaSeeking* locSeeker = NULL;
- mParentFilter->mInputPin->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
- SetDelegate(locSeeker);
- //
- mDataQueue = new COutputQueue (inReceivePin, &locHR, FALSE, FALSE, 1, TRUE, 20); //Deleted in destructor
-
- if (FAILED(locHR)) {
- //Handle data Q failure
-
- }
-
- return CBaseOutputPin::CompleteConnect(inReceivePin);
-}
-
-HRESULT AbstractAudioDecodeOutputPin::BreakConnect(void) {
- CAutoLock locLock(m_pLock);
-
- delete mDataQueue;
- mDataQueue = NULL;
-
- HRESULT locHR = CBaseOutputPin::BreakConnect();
- ReleaseDelegate();
-
- return locHR;
-}
\ No newline at end of file
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "abstractaudiodecodeoutputpin.h"
+
+AbstractAudioDecodeOutputPin::AbstractAudioDecodeOutputPin(AbstractAudioDecodeFilter* inParentFilter, CCritSec* inFilterLock, CHAR* inObjectName, LPCWSTR inPinDisplayName)
+ : CBaseOutputPin(inObjectName, inParentFilter, inFilterLock, &mHR, inPinDisplayName)
+ , mParentFilter(inParentFilter)
+ //, mFilterLock(inFilterLock)
+ , mDataQueue(NULL)
+{
+
+}
+AbstractAudioDecodeOutputPin::~AbstractAudioDecodeOutputPin(void)
+{
+ ReleaseDelegate();
+ delete mDataQueue;
+ mDataQueue = NULL;
+}
+
+STDMETHODIMP AbstractAudioDecodeOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
+ if (riid == IID_IMediaSeeking) {
+ *ppv = (IMediaSeeking*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ }
+
+ return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
+}
+
+HRESULT AbstractAudioDecodeOutputPin::DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES* inPropertyRequest) {
+
+ //FIX::: Abstract this out properly
+
+ HRESULT locHR = S_OK;
+
+ ALLOCATOR_PROPERTIES locReqAlloc;
+ ALLOCATOR_PROPERTIES locActualAlloc;
+
+ const unsigned long MIN_BUFFER_SIZE = 1096;
+ const unsigned long DEFAULT_BUFFER_SIZE = 32192;
+ const unsigned long MIN_NUM_BUFFERS = 10;
+ const unsigned long DEFAULT_NUM_BUFFERS = 20;
+
+
+
+
+ if (inPropertyRequest->cbAlign <= 0) {
+ locReqAlloc.cbAlign = 1;
+ } else {
+ locReqAlloc.cbAlign = inPropertyRequest->cbAlign;
+ }
+
+
+ if (inPropertyRequest->cbBuffer < MIN_BUFFER_SIZE) {
+ locReqAlloc.cbBuffer = DEFAULT_BUFFER_SIZE;
+ } else {
+ locReqAlloc.cbBuffer = inPropertyRequest->cbBuffer;
+ }
+
+
+ if (inPropertyRequest->cbPrefix < 0) {
+ locReqAlloc.cbPrefix = 0;
+ } else {
+ locReqAlloc.cbPrefix = inPropertyRequest->cbPrefix;
+ }
+
+
+ if (inPropertyRequest->cBuffers < MIN_NUM_BUFFERS) {
+ locReqAlloc.cBuffers = DEFAULT_NUM_BUFFERS;
+ } else {
+ locReqAlloc.cBuffers = inPropertyRequest->cBuffers;
+ }
+
+
+ locHR = inAllocator->SetProperties(&locReqAlloc, &locActualAlloc);
+
+ if (locHR != S_OK) {
+ return locHR;
+ }
+
+ //Need to save this pointer to decommit in destructor.
+
+ locHR = inAllocator->Commit();
+
+ return locHR;
+}
+HRESULT AbstractAudioDecodeOutputPin::CheckMediaType(const CMediaType *inMediaType) {
+ if ( (inMediaType->majortype == MEDIATYPE_Audio) &&
+ (inMediaType->subtype == MEDIASUBTYPE_PCM) &&
+ (inMediaType->formattype == FORMAT_WaveFormatEx)) {
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
+
+}
+
+void AbstractAudioDecodeOutputPin::FillMediaType(CMediaType* outMediaType) {
+ outMediaType->SetType(&MEDIATYPE_Audio);
+ outMediaType->SetSubtype(&MEDIASUBTYPE_PCM);
+ outMediaType->SetFormatType(&FORMAT_WaveFormatEx);
+ outMediaType->SetTemporalCompression(FALSE);
+ outMediaType->SetSampleSize(0);
+
+}
+HRESULT AbstractAudioDecodeOutputPin::GetMediaType(int inPosition, CMediaType *outMediaType) {
+
+ if (inPosition < 0) {
+ return E_INVALIDARG;
+ }
+
+ if (inPosition == 0) {
+ FillMediaType(outMediaType);
+ WAVEFORMATEX* locWaveFormat = (WAVEFORMATEX*)outMediaType->AllocFormatBuffer(sizeof(WAVEFORMATEX));
+ FillWaveFormatExBuffer(locWaveFormat);
+ return S_OK;
+ } else {
+ return VFW_S_NO_MORE_ITEMS;
+ }
+}
+
+HRESULT AbstractAudioDecodeOutputPin::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate) {
+ //TO DO::: Change the naming convention of the params
+ mDataQueue->NewSegment(tStart, tStop, dRate);
+ return S_OK;
+}
+HRESULT AbstractAudioDecodeOutputPin::DeliverEndOfStream(void) {
+
+ mDataQueue->EOS();
+ return S_OK;
+}
+
+HRESULT AbstractAudioDecodeOutputPin::DeliverEndFlush(void) {
+ CAutoLock locLock(m_pLock);
+
+ mDataQueue->EndFlush();
+ return S_OK;
+}
+
+HRESULT AbstractAudioDecodeOutputPin::DeliverBeginFlush(void) {
+ CAutoLock locLock(m_pLock);
+
+
+ mDataQueue->BeginFlush();
+ return S_OK;
+
+}
+
+HRESULT AbstractAudioDecodeOutputPin::CompleteConnect (IPin *inReceivePin) {
+ CAutoLock locLock(m_pLock);
+ HRESULT locHR = S_OK;
+
+ //Here when another pin connects to us, we internally connect the seek delegate
+ // from this output pin onto the input pin... and we release it on breakconnect.
+ //
+ IMediaSeeking* locSeeker = NULL;
+ mParentFilter->mInputPin->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+ SetDelegate(locSeeker);
+ //
+ mDataQueue = new COutputQueue (inReceivePin, &locHR, FALSE, FALSE, 1, TRUE, 20); //Deleted in destructor
+
+ if (FAILED(locHR)) {
+ //Handle data Q failure
+
+ }
+
+ return CBaseOutputPin::CompleteConnect(inReceivePin);
+}
+
+HRESULT AbstractAudioDecodeOutputPin::BreakConnect(void) {
+ CAutoLock locLock(m_pLock);
+
+ delete mDataQueue;
+ mDataQueue = NULL;
+
+ HRESULT locHR = CBaseOutputPin::BreakConnect();
+ ReleaseDelegate();
+
+ return locHR;
+}
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeOutputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeOutputPin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeOutputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeOutputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,77 +1,77 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "abstractaudiodllstuff.h"
-#include "BasicSeekable.h"
-class AbstractAudioDecodeFilter;
-
-class ABS_AUDIO_DEC_API AbstractAudioDecodeOutputPin
- : public CBaseOutputPin
- , public BasicSeekable
-{
-public:
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- AbstractAudioDecodeOutputPin(AbstractAudioDecodeFilter* inParentFilter, CCritSec* inFilterLock, CHAR* inObjectName, LPCWSTR inPinDisplayName);
- virtual ~AbstractAudioDecodeOutputPin(void);
-
- virtual HRESULT DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES *inReqAllocProps);
- virtual HRESULT CheckMediaType(const CMediaType *inMediaType);
-
- //PURE VIRTUALS
- virtual bool FillWaveFormatExBuffer(WAVEFORMATEX* inFormatBuffer) = 0;
-
- virtual HRESULT GetMediaType(int inPosition, CMediaType *outMediaType);
-
-
- //Virtuals for data queue
- virtual HRESULT BreakConnect(void);
- virtual HRESULT CompleteConnect (IPin *inReceivePin);
- virtual HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
- virtual HRESULT DeliverEndOfStream(void);
- virtual HRESULT DeliverEndFlush(void);
- virtual HRESULT DeliverBeginFlush(void);
-
- COutputQueue* mDataQueue;
-protected:
- HRESULT mHR;
- AbstractAudioDecodeFilter* mParentFilter;
- void FillMediaType(CMediaType* inMediaType);
-
- //CCritSec* mFilterLock;
-
- static const int BUFF_SIZE = 65536;
static const int BUFF_COUNT = 5;
-
-};
-
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "abstractaudiodllstuff.h"
+#include "BasicSeekable.h"
+class AbstractAudioDecodeFilter;
+
+class ABS_AUDIO_DEC_API AbstractAudioDecodeOutputPin
+ : public CBaseOutputPin
+ , public BasicSeekable
+{
+public:
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ AbstractAudioDecodeOutputPin(AbstractAudioDecodeFilter* inParentFilter, CCritSec* inFilterLock, CHAR* inObjectName, LPCWSTR inPinDisplayName);
+ virtual ~AbstractAudioDecodeOutputPin(void);
+
+ virtual HRESULT DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES *inReqAllocProps);
+ virtual HRESULT CheckMediaType(const CMediaType *inMediaType);
+
+ //PURE VIRTUALS
+ virtual bool FillWaveFormatExBuffer(WAVEFORMATEX* inFormatBuffer) = 0;
+
+ virtual HRESULT GetMediaType(int inPosition, CMediaType *outMediaType);
+
+
+ //Virtuals for data queue
+ virtual HRESULT BreakConnect(void);
+ virtual HRESULT CompleteConnect (IPin *inReceivePin);
+ virtual HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
+ virtual HRESULT DeliverEndOfStream(void);
+ virtual HRESULT DeliverEndFlush(void);
+ virtual HRESULT DeliverBeginFlush(void);
+
+ COutputQueue* mDataQueue;
+protected:
+ HRESULT mHR;
+ AbstractAudioDecodeFilter* mParentFilter;
+ void FillMediaType(CMediaType* inMediaType);
+
+ //CCritSec* mFilterLock;
+
+ static const int BUFF_SIZE = 65536;
+ static const int BUFF_COUNT = 5;
+
+};
+
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/AbstractAudioDecodeOutputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/abstractaudiodllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/abstractaudiodllstuff.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/abstractaudiodllstuff.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,53 +1,53 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include <streams.h>
-#include <pullpin.h>
-#include <initguid.h>
-
-#ifdef DSFABSTRACOGGAUDIODECODER_EXPORTS
-#pragma message("----> Exporting from Abstract Library...")
-#define ABS_AUDIO_DEC_API __declspec(dllexport)
-#else
-#pragma message("<---- Importing from Abstract Library...")
-#define ABS_AUDIO_DEC_API __declspec(dllimport)
-#endif
-
-
-
-//Is this needed ??
-#ifdef LIBOOOGG_EXPORTS
-#define LIBOOOGG_API __declspec(dllexport)
-#else
-#define LIBOOOGG_API __declspec(dllimport)
-#endif
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include <streams.h>
+#include <pullpin.h>
+#include <initguid.h>
+
+#ifdef DSFABSTRACOGGAUDIODECODER_EXPORTS
+#pragma message("----> Exporting from Abstract Library...")
+#define ABS_AUDIO_DEC_API __declspec(dllexport)
+#else
+#pragma message("<---- Importing from Abstract Library...")
+#define ABS_AUDIO_DEC_API __declspec(dllimport)
+#endif
+
+
+
+//Is this needed ??
+#ifdef LIBOOOGG_EXPORTS
+#define LIBOOOGG_API __declspec(dllexport)
+#else
+#define LIBOOOGG_API __declspec(dllimport)
+#endif
+
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/abstractaudiodllstuff.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/dsfAbstracOggAudioDecoder.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/dsfAbstracOggAudioDecoder.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/dsfAbstracOggAudioDecoder.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,36 +1,36 @@
-// dsfAbstracOggAudioDecoder.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-#include "dsfAbstracOggAudioDecoder.h"
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
-}
-
-// This is an example of an exported variable
-DSFABSTRACOGGAUDIODECODER_API int ndsfAbstracOggAudioDecoder=0;
-
-// This is an example of an exported function.
-DSFABSTRACOGGAUDIODECODER_API int fndsfAbstracOggAudioDecoder(void)
-{
- return 42;
-}
-
-// This is the constructor of a class that has been exported.
-// see dsfAbstracOggAudioDecoder.h for the class definition
-CdsfAbstracOggAudioDecoder::CdsfAbstracOggAudioDecoder()
-{
- return;
-}
+// dsfAbstracOggAudioDecoder.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+#include "dsfAbstracOggAudioDecoder.h"
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ switch (ul_reason_for_call)
+ {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
+}
+
+// This is an example of an exported variable
+DSFABSTRACOGGAUDIODECODER_API int ndsfAbstracOggAudioDecoder=0;
+
+// This is an example of an exported function.
+DSFABSTRACOGGAUDIODECODER_API int fndsfAbstracOggAudioDecoder(void)
+{
+ return 42;
+}
+
+// This is the constructor of a class that has been exported.
+// see dsfAbstracOggAudioDecoder.h for the class definition
+CdsfAbstracOggAudioDecoder::CdsfAbstracOggAudioDecoder()
+{
+ return;
+}
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/dsfAbstracOggAudioDecoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/dsfAbstracOggAudioDecoder.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/dsfAbstracOggAudioDecoder.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/dsfAbstracOggAudioDecoder.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,22 +1,22 @@
-// The following ifdef block is the standard way of creating macros which make exporting
-// from a DLL simpler. All files within this DLL are compiled with the DSFABSTRACOGGAUDIODECODER_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see
-// DSFABSTRACOGGAUDIODECODER_API functions as being imported from a DLL, whereas this DLL sees symbols
-// defined with this macro as being exported.
-#ifdef DSFABSTRACOGGAUDIODECODER_EXPORTS
-#define DSFABSTRACOGGAUDIODECODER_API __declspec(dllexport)
-#else
-#define DSFABSTRACOGGAUDIODECODER_API __declspec(dllimport)
-#endif
-
-// This class is exported from the dsfAbstracOggAudioDecoder.dll
-class DSFABSTRACOGGAUDIODECODER_API CdsfAbstracOggAudioDecoder {
-public:
- CdsfAbstracOggAudioDecoder(void);
- // TODO: add your methods here.
-};
-
-extern DSFABSTRACOGGAUDIODECODER_API int ndsfAbstracOggAudioDecoder;
-
-DSFABSTRACOGGAUDIODECODER_API int fndsfAbstracOggAudioDecoder(void);
+// The following ifdef block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the DSFABSTRACOGGAUDIODECODER_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// DSFABSTRACOGGAUDIODECODER_API functions as being imported from a DLL, whereas this DLL sees symbols
+// defined with this macro as being exported.
+#ifdef DSFABSTRACOGGAUDIODECODER_EXPORTS
+#define DSFABSTRACOGGAUDIODECODER_API __declspec(dllexport)
+#else
+#define DSFABSTRACOGGAUDIODECODER_API __declspec(dllimport)
+#endif
+
+// This class is exported from the dsfAbstracOggAudioDecoder.dll
+class DSFABSTRACOGGAUDIODECODER_API CdsfAbstracOggAudioDecoder {
+public:
+ CdsfAbstracOggAudioDecoder(void);
+ // TODO: add your methods here.
+};
+
+extern DSFABSTRACOGGAUDIODECODER_API int ndsfAbstracOggAudioDecoder;
+
+DSFABSTRACOGGAUDIODECODER_API int fndsfAbstracOggAudioDecoder(void);
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/dsfAbstracOggAudioDecoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,40 +1,40 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-
-// stdafx.cpp : source file that includes just the standard includes
-// dsfAbstracOggAudioDecoder.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+
+// stdafx.cpp : source file that includes just the standard includes
+// dsfAbstracOggAudioDecoder.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,46 +1,46 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include "abstractaudiodllstuff.h"
-#include <windows.h>
-#include "AbstractAudioDecodeInputPin.h"
-#include "AbstractAudioDecodeOutputPin.h"
-#include "AbstractAudioDecodeFilter.h"
-// TODO: reference additional headers your program requires here
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include "abstractaudiodllstuff.h"
+#include <windows.h>
+#include "AbstractAudioDecodeInputPin.h"
+#include "AbstractAudioDecodeOutputPin.h"
+#include "AbstractAudioDecodeFilter.h"
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioDecoder/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeFilter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeFilter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,82 +1,82 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "abstractaudioencodefilter.h"
-
-
-
-AbstractAudioEncodeFilter::AbstractAudioEncodeFilter(TCHAR* inFilterName, REFCLSID inFilterGUID, unsigned short inAudioFormat )
- : CBaseFilter(inFilterName, NULL,m_pLock, inFilterGUID),
- mAudioFormat(inAudioFormat)
-{
-
- m_pLock = new CCritSec;
-
-}
-
-AbstractAudioEncodeFilter::~AbstractAudioEncodeFilter(void)
-{
- delete m_pLock;
- DestroyPins();
-}
-
-void AbstractAudioEncodeFilter::DestroyPins() {
- delete mOutputPin;
- delete mInputPin;
-}
-
-STDMETHODIMP AbstractAudioEncodeFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
- return CBaseFilter::NonDelegatingQueryInterface(riid, ppv);
-}
-
-CBasePin* AbstractAudioEncodeFilter::GetPin(int inPinNo) {
- //FIX::: Errors here
- if (inPinNo < 0 ) {
- return NULL;
- } else if (inPinNo == 0) {
- return mInputPin;
- } else if (inPinNo == 1) {
- return mOutputPin;
- } else {
- return NULL;
- }
-}
-
-STDMETHODIMP AbstractAudioEncodeFilter::Stop() {
- CAutoLock locLock(m_pLock);
- mInputPin->ResetFrameCount();
- return CBaseFilter::Stop();
-}
-int AbstractAudioEncodeFilter::GetPinCount(void) {
- const long NUM_PINS = 2;
- return NUM_PINS;
-}
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "abstractaudioencodefilter.h"
+
+
+
+AbstractAudioEncodeFilter::AbstractAudioEncodeFilter(TCHAR* inFilterName, REFCLSID inFilterGUID, unsigned short inAudioFormat )
+ : CBaseFilter(inFilterName, NULL,m_pLock, inFilterGUID),
+ mAudioFormat(inAudioFormat)
+{
+
+ m_pLock = new CCritSec;
+
+}
+
+AbstractAudioEncodeFilter::~AbstractAudioEncodeFilter(void)
+{
+ delete m_pLock;
+ DestroyPins();
+}
+
+void AbstractAudioEncodeFilter::DestroyPins() {
+ delete mOutputPin;
+ delete mInputPin;
+}
+
+STDMETHODIMP AbstractAudioEncodeFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
+ return CBaseFilter::NonDelegatingQueryInterface(riid, ppv);
+}
+
+CBasePin* AbstractAudioEncodeFilter::GetPin(int inPinNo) {
+ //FIX::: Errors here
+ if (inPinNo < 0 ) {
+ return NULL;
+ } else if (inPinNo == 0) {
+ return mInputPin;
+ } else if (inPinNo == 1) {
+ return mOutputPin;
+ } else {
+ return NULL;
+ }
+}
+
+STDMETHODIMP AbstractAudioEncodeFilter::Stop() {
+ CAutoLock locLock(m_pLock);
+ mInputPin->ResetFrameCount();
+ return CBaseFilter::Stop();
+}
+int AbstractAudioEncodeFilter::GetPinCount(void) {
+ const long NUM_PINS = 2;
+ return NUM_PINS;
+}
+
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeFilter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeFilter.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeFilter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeFilter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,80 +1,80 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-#include "abstractaudioencodedllstuff.h"
-
-class AbstractAudioEncodeInputPin;
-class AbstractAudioEncodeOutputPin;
-
-class ABS_AUDIO_ENC_API AbstractAudioEncodeFilter
- : public CBaseFilter
- //, public BasicSeekable
-{
-public:
- friend class AbstractAudioEncodeInputPin;
- friend class AbstractAudioEncodeOutputPin;
- AbstractAudioEncodeFilter(TCHAR* inFilterName, REFCLSID inFilterGUID, unsigned short inAudioFormat );
- virtual ~AbstractAudioEncodeFilter(void);
-
- static const long NUM_PINS = 2;
- enum eAudioFormat {
- NONE = 0,
- VORBIS = 1,
- SPEEX = 2,
- FLAC = 3,
- OTHER = 1000
- };
-
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- //PURE VIRTUALS
- virtual bool ConstructPins() = 0;
- virtual void DestroyPins();
-
- //static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
-
- //CBaseFilter overrides
- CBasePin* GetPin(int n);
- int GetPinCount(void);
-
- virtual STDMETHODIMP Stop();
-
- unsigned short mAudioFormat;
-
-protected:
-
- AbstractAudioEncodeInputPin* mInputPin;
- AbstractAudioEncodeOutputPin* mOutputPin;
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+#include "abstractaudioencodedllstuff.h"
+
+class AbstractAudioEncodeInputPin;
+class AbstractAudioEncodeOutputPin;
+
+class ABS_AUDIO_ENC_API AbstractAudioEncodeFilter
+ : public CBaseFilter
+ //, public BasicSeekable
+{
+public:
+ friend class AbstractAudioEncodeInputPin;
+ friend class AbstractAudioEncodeOutputPin;
+ AbstractAudioEncodeFilter(TCHAR* inFilterName, REFCLSID inFilterGUID, unsigned short inAudioFormat );
+ virtual ~AbstractAudioEncodeFilter(void);
+
+ static const long NUM_PINS = 2;
+ enum eAudioFormat {
+ NONE = 0,
+ VORBIS = 1,
+ SPEEX = 2,
+ FLAC = 3,
+ OTHER = 1000
+ };
+
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ //PURE VIRTUALS
+ virtual bool ConstructPins() = 0;
+ virtual void DestroyPins();
+
+ //static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+
+ //CBaseFilter overrides
+ CBasePin* GetPin(int n);
+ int GetPinCount(void);
+
+ virtual STDMETHODIMP Stop();
+
+ unsigned short mAudioFormat;
+
+protected:
+
+ AbstractAudioEncodeInputPin* mInputPin;
+ AbstractAudioEncodeOutputPin* mOutputPin;
+
};
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeFilter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeInputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeInputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,186 +1,186 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "abstractaudioencodeinputpin.h"
-
-//#include <mtype.h>
-AbstractAudioEncodeInputPin::AbstractAudioEncodeInputPin(AbstractAudioEncodeFilter* inParentFilter, CCritSec* inFilterLock, AbstractAudioEncodeOutputPin* inOutputPin, CHAR* inObjectName, LPCWSTR inPinDisplayName)
- : CBaseInputPin(inObjectName, inParentFilter, inFilterLock, &mHR, inPinDisplayName),
- mOutputPin(inOutputPin),
- mUptoFrame(0),
- mBegun(false),
- mParentFilter(inParentFilter)
-
-{
- //debugLog.open("C:\\temp\\aaein.log", ios_base::out);
- //ConstructCodec();
-
- //Set the seek delegate... make the outpin pin send stuff to this pin.
- IMediaSeeking* locSeeker = NULL;
- this->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
- mOutputPin->SetDelegate(locSeeker);
-
-}
-
-STDMETHODIMP AbstractAudioEncodeInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
- if (riid == IID_IMediaSeeking) {
- *ppv = (IMediaSeeking*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- }
-
- return CBaseInputPin::NonDelegatingQueryInterface(riid, ppv);
-}
-
-HRESULT AbstractAudioEncodeInputPin::CompleteConnect (IPin *inReceivePin) {
- //CAutoLock locLock(mFilterLock);
-
- IMediaSeeking* locSeeker = NULL;
- inReceivePin->QueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
- SetDelegate(locSeeker);
- return CBaseInputPin::CompleteConnect(inReceivePin);
-}
-AbstractAudioEncodeInputPin::~AbstractAudioEncodeInputPin(void)
-{
- //debugLog.close();
- //DestroyCodec();
-}
-
-
-void AbstractAudioEncodeInputPin::ResetFrameCount() {
- mUptoFrame = 0;
-
-}
-bool AbstractAudioEncodeInputPin::SetSampleParams(IMediaSample* outMediaSample, unsigned long inDataSize, REFERENCE_TIME* inStartTime, REFERENCE_TIME* inEndTime)
-{
- outMediaSample->SetTime(inStartTime, inEndTime);
- outMediaSample->SetMediaTime(NULL, NULL);
- outMediaSample->SetActualDataLength(inDataSize);
- outMediaSample->SetPreroll(FALSE);
- outMediaSample->SetDiscontinuity(FALSE);
- outMediaSample->SetSyncPoint(TRUE);
- return true;
-}
-
-
-STDMETHODIMP AbstractAudioEncodeInputPin::Receive(IMediaSample* inSample) {
-
- //debugLog <<endl<< "Received sample..."<<endl;
- HRESULT locHR;
- BYTE* locBuff = NULL;
- locHR = inSample->GetPointer(&locBuff);
-
- if (FAILED(locHR)) {
- //debugLog << "Failed to get pointer... bailing out"<<endl;
- return locHR;
- } else {
-
- long locResult = encodeData(locBuff, inSample->GetActualDataLength());
- if (locResult >= 0) {
- //debugLog << "Encode Data returns 0... OK"<<endl;
- return S_OK;
- } else {
- //debugLog<< "Encode Data returns "<<locResult<<" FAILURE"<<endl;
- return S_FALSE;
- }
- }
-
- //debugLog<<"Receive falls through... returning OK"<<endl;
- return S_OK;
-}
-
-HRESULT AbstractAudioEncodeInputPin::CheckMediaType(const CMediaType *inMediaType) {
- //FIX::: Clean this up !
-
- if ( (inMediaType->majortype == MEDIATYPE_Audio) &&
- (inMediaType->subtype == MEDIASUBTYPE_PCM) &&
- (inMediaType->formattype == FORMAT_WaveFormatEx)
- )
- {
- return S_OK;
- } else {
- return S_FALSE;
- }
-}
-
-STDMETHODIMP AbstractAudioEncodeInputPin::EndOfStream(void) {
- return mParentFilter->mOutputPin->DeliverEndOfStream();
-}
-
-STDMETHODIMP AbstractAudioEncodeInputPin::BeginFlush() {
- CAutoLock locLock(m_pLock);
- CBaseInputPin::BeginFlush();
- return mParentFilter->mOutputPin->DeliverBeginFlush();
-}
-STDMETHODIMP AbstractAudioEncodeInputPin::EndFlush() {
- CAutoLock locLock(m_pLock);
- CBaseInputPin::EndFlush();
- return mParentFilter->mOutputPin->DeliverEndFlush();
-
-}
-
-STDMETHODIMP AbstractAudioEncodeInputPin::NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate) {
- return mParentFilter->mOutputPin->DeliverNewSegment(tStart, tStop, dRate);
-}
-
-HRESULT AbstractAudioEncodeInputPin::SetMediaType(const CMediaType* inMediaType) {
- //FIX:::Error checking
- //RESOLVED::: Bit better.
-
- if (inMediaType->subtype == MEDIASUBTYPE_PCM) {
- mWaveFormat = (WAVEFORMATEX*)inMediaType->pbFormat;
- //mParentFilter->mAudioFormat = AbstractAudioDecodeFilter::VORBIS;
- } else {
- //Failed... should never be here !
- throw 0;
- }
- return CBaseInputPin::SetMediaType(inMediaType);
-}
-
-HRESULT AbstractAudioEncodeInputPin::GetMediaType(int inPosition, CMediaType *outMediaType) {
-
- if (inPosition < 0) {
- return E_INVALIDARG;
- }
-
- switch (inPosition) {
- case 0:
-
- outMediaType->SetType(&MEDIATYPE_Audio);
- outMediaType->SetSubtype(&MEDIASUBTYPE_PCM);
- //Don't set the format data here. That's up to our output pin/
- return S_OK;
- default:
- return VFW_S_NO_MORE_ITEMS;
- }
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "abstractaudioencodeinputpin.h"
+
+//#include <mtype.h>
+AbstractAudioEncodeInputPin::AbstractAudioEncodeInputPin(AbstractAudioEncodeFilter* inParentFilter, CCritSec* inFilterLock, AbstractAudioEncodeOutputPin* inOutputPin, CHAR* inObjectName, LPCWSTR inPinDisplayName)
+ : CBaseInputPin(inObjectName, inParentFilter, inFilterLock, &mHR, inPinDisplayName),
+ mOutputPin(inOutputPin),
+ mUptoFrame(0),
+ mBegun(false),
+ mParentFilter(inParentFilter)
+
+{
+ //debugLog.open("C:\\temp\\aaein.log", ios_base::out);
+ //ConstructCodec();
+
+ //Set the seek delegate... make the outpin pin send stuff to this pin.
+ IMediaSeeking* locSeeker = NULL;
+ this->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+ mOutputPin->SetDelegate(locSeeker);
+
+}
+
+STDMETHODIMP AbstractAudioEncodeInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+ if (riid == IID_IMediaSeeking) {
+ *ppv = (IMediaSeeking*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ }
+
+ return CBaseInputPin::NonDelegatingQueryInterface(riid, ppv);
+}
+
+HRESULT AbstractAudioEncodeInputPin::CompleteConnect (IPin *inReceivePin) {
+ //CAutoLock locLock(mFilterLock);
+
+ IMediaSeeking* locSeeker = NULL;
+ inReceivePin->QueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+ SetDelegate(locSeeker);
+ return CBaseInputPin::CompleteConnect(inReceivePin);
+}
+AbstractAudioEncodeInputPin::~AbstractAudioEncodeInputPin(void)
+{
+ //debugLog.close();
+ //DestroyCodec();
+}
+
+
+void AbstractAudioEncodeInputPin::ResetFrameCount() {
+ mUptoFrame = 0;
+
+}
+bool AbstractAudioEncodeInputPin::SetSampleParams(IMediaSample* outMediaSample, unsigned long inDataSize, REFERENCE_TIME* inStartTime, REFERENCE_TIME* inEndTime)
+{
+ outMediaSample->SetTime(inStartTime, inEndTime);
+ outMediaSample->SetMediaTime(NULL, NULL);
+ outMediaSample->SetActualDataLength(inDataSize);
+ outMediaSample->SetPreroll(FALSE);
+ outMediaSample->SetDiscontinuity(FALSE);
+ outMediaSample->SetSyncPoint(TRUE);
+ return true;
+}
+
+
+STDMETHODIMP AbstractAudioEncodeInputPin::Receive(IMediaSample* inSample) {
+
+ //debugLog <<endl<< "Received sample..."<<endl;
+ HRESULT locHR;
+ BYTE* locBuff = NULL;
+ locHR = inSample->GetPointer(&locBuff);
+
+ if (FAILED(locHR)) {
+ //debugLog << "Failed to get pointer... bailing out"<<endl;
+ return locHR;
+ } else {
+
+ long locResult = encodeData(locBuff, inSample->GetActualDataLength());
+ if (locResult >= 0) {
+ //debugLog << "Encode Data returns 0... OK"<<endl;
+ return S_OK;
+ } else {
+ //debugLog<< "Encode Data returns "<<locResult<<" FAILURE"<<endl;
+ return S_FALSE;
+ }
+ }
+
+ //debugLog<<"Receive falls through... returning OK"<<endl;
+ return S_OK;
+}
+
+HRESULT AbstractAudioEncodeInputPin::CheckMediaType(const CMediaType *inMediaType) {
+ //FIX::: Clean this up !
+
+ if ( (inMediaType->majortype == MEDIATYPE_Audio) &&
+ (inMediaType->subtype == MEDIASUBTYPE_PCM) &&
+ (inMediaType->formattype == FORMAT_WaveFormatEx)
+ )
+ {
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
+}
+
+STDMETHODIMP AbstractAudioEncodeInputPin::EndOfStream(void) {
+ return mParentFilter->mOutputPin->DeliverEndOfStream();
+}
+
+STDMETHODIMP AbstractAudioEncodeInputPin::BeginFlush() {
+ CAutoLock locLock(m_pLock);
+ CBaseInputPin::BeginFlush();
+ return mParentFilter->mOutputPin->DeliverBeginFlush();
+}
+STDMETHODIMP AbstractAudioEncodeInputPin::EndFlush() {
+ CAutoLock locLock(m_pLock);
+ CBaseInputPin::EndFlush();
+ return mParentFilter->mOutputPin->DeliverEndFlush();
+
+}
+
+STDMETHODIMP AbstractAudioEncodeInputPin::NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate) {
+ return mParentFilter->mOutputPin->DeliverNewSegment(tStart, tStop, dRate);
+}
+
+HRESULT AbstractAudioEncodeInputPin::SetMediaType(const CMediaType* inMediaType) {
+ //FIX:::Error checking
+ //RESOLVED::: Bit better.
+
+ if (inMediaType->subtype == MEDIASUBTYPE_PCM) {
+ mWaveFormat = (WAVEFORMATEX*)inMediaType->pbFormat;
+ //mParentFilter->mAudioFormat = AbstractAudioDecodeFilter::VORBIS;
+ } else {
+ //Failed... should never be here !
+ throw 0;
+ }
+ return CBaseInputPin::SetMediaType(inMediaType);
+}
+
+HRESULT AbstractAudioEncodeInputPin::GetMediaType(int inPosition, CMediaType *outMediaType) {
+
+ if (inPosition < 0) {
+ return E_INVALIDARG;
+ }
+
+ switch (inPosition) {
+ case 0:
+
+ outMediaType->SetType(&MEDIATYPE_Audio);
+ outMediaType->SetSubtype(&MEDIASUBTYPE_PCM);
+ //Don't set the format data here. That's up to our output pin/
+ return S_OK;
+ default:
+ return VFW_S_NO_MORE_ITEMS;
+ }
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeInputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeInputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeInputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,105 +1,105 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-#include "abstractaudioencodedllstuff.h"
-
-//Debug Only
-//#include <fstream>
-//
-//using namespace std;
-#include "BasicSeekable.h"
-
-class AbstractAudioEncodeOutputPin;
-class AbstractAudioEncodeFilter;
-
-class ABS_AUDIO_ENC_API AbstractAudioEncodeInputPin
- : public CBaseInputPin
- , public BasicSeekable
-{
-public:
-
- friend class AbstractAudioEncodeOutputPin;
- AbstractAudioEncodeInputPin(AbstractAudioEncodeFilter* inParentFilter, CCritSec* inFilterLock, AbstractAudioEncodeOutputPin* inOutputPin, CHAR* inObjectName, LPCWSTR inPinDisplayName);
- virtual ~AbstractAudioEncodeInputPin(void);
- static const short SIZE_16_BITS = 2;
- static const unsigned long HUNDRED_NANOS = 10000000;
- static const signed short SINT_MAX = 32767;
- static const signed short SINT_MIN = -32768;
-
- //COM Setup
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
-
- //PURE VIRTUALS
- virtual long encodeData(unsigned char* inBuf, long inNumBytes) = 0;
- virtual bool ConstructCodec() = 0;
- virtual void DestroyCodec() = 0;
-
-
- virtual HRESULT CompleteConnect (IPin *inReceivePin);
- STDMETHODIMP Receive(IMediaSample *pSample);
- virtual HRESULT CheckMediaType(const CMediaType *inMediaType);
- virtual HRESULT GetMediaType(int inPosition, CMediaType *outMediaType);
- virtual HRESULT SetMediaType(const CMediaType* inMediaType);
-
- virtual void ResetFrameCount();
-
- virtual STDMETHODIMP EndOfStream(void);
- virtual STDMETHODIMP BeginFlush();
- virtual STDMETHODIMP EndFlush();
- virtual STDMETHODIMP NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
-
-protected:
-
- virtual bool SetSampleParams(IMediaSample* outMediaSample, unsigned long inDataSize, REFERENCE_TIME* inStartTime, REFERENCE_TIME* inEndTime);
-
-
- HRESULT mHR;
- bool mBegun;
- AbstractAudioEncodeOutputPin* mOutputPin;
- __int64 mUptoFrame;
- AbstractAudioEncodeFilter* mParentFilter;
- CMediaType* mAcceptableMediaType;
-
- //Debug only
- //fstream debugLog;
- //
-
- //unsigned long mFrameSize;
- //unsigned long mNumChannels;
- //unsigned long mSampleRate;
-
- WAVEFORMATEX* mWaveFormat;
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+#include "abstractaudioencodedllstuff.h"
+
+//Debug Only
+//#include <fstream>
+//
+//using namespace std;
+#include "BasicSeekable.h"
+
+class AbstractAudioEncodeOutputPin;
+class AbstractAudioEncodeFilter;
+
+class ABS_AUDIO_ENC_API AbstractAudioEncodeInputPin
+ : public CBaseInputPin
+ , public BasicSeekable
+{
+public:
+
+ friend class AbstractAudioEncodeOutputPin;
+ AbstractAudioEncodeInputPin(AbstractAudioEncodeFilter* inParentFilter, CCritSec* inFilterLock, AbstractAudioEncodeOutputPin* inOutputPin, CHAR* inObjectName, LPCWSTR inPinDisplayName);
+ virtual ~AbstractAudioEncodeInputPin(void);
+ static const short SIZE_16_BITS = 2;
+ static const unsigned long HUNDRED_NANOS = 10000000;
+ static const signed short SINT_MAX = 32767;
+ static const signed short SINT_MIN = -32768;
+
+ //COM Setup
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+
+ //PURE VIRTUALS
+ virtual long encodeData(unsigned char* inBuf, long inNumBytes) = 0;
+ virtual bool ConstructCodec() = 0;
+ virtual void DestroyCodec() = 0;
+
+
+ virtual HRESULT CompleteConnect (IPin *inReceivePin);
+ STDMETHODIMP Receive(IMediaSample *pSample);
+ virtual HRESULT CheckMediaType(const CMediaType *inMediaType);
+ virtual HRESULT GetMediaType(int inPosition, CMediaType *outMediaType);
+ virtual HRESULT SetMediaType(const CMediaType* inMediaType);
+
+ virtual void ResetFrameCount();
+
+ virtual STDMETHODIMP EndOfStream(void);
+ virtual STDMETHODIMP BeginFlush();
+ virtual STDMETHODIMP EndFlush();
+ virtual STDMETHODIMP NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
+
+protected:
+
+ virtual bool SetSampleParams(IMediaSample* outMediaSample, unsigned long inDataSize, REFERENCE_TIME* inStartTime, REFERENCE_TIME* inEndTime);
+
+
+ HRESULT mHR;
+ bool mBegun;
+ AbstractAudioEncodeOutputPin* mOutputPin;
+ __int64 mUptoFrame;
+ AbstractAudioEncodeFilter* mParentFilter;
+ CMediaType* mAcceptableMediaType;
+
+ //Debug only
+ //fstream debugLog;
+ //
+
+ //unsigned long mFrameSize;
+ //unsigned long mNumChannels;
+ //unsigned long mSampleRate;
+
+ WAVEFORMATEX* mWaveFormat;
+
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeInputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeOutputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeOutputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeOutputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,192 +1,194 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "abstractaudioencodeoutputpin.h"
-
-
-
-AbstractAudioEncodeOutputPin::AbstractAudioEncodeOutputPin(AbstractAudioEncodeFilter* inParentFilter, CCritSec* inFilterLock, CHAR* inObjectName, LPCWSTR inPinDisplayName, CMediaType* inOutputMediaType)
- : CBaseOutputPin(inObjectName, inParentFilter, inFilterLock, &mHR, inPinDisplayName),
- mParentFilter(inParentFilter)
-
- , mDataQueue(NULL)
-{
- mOutputMediaType = inOutputMediaType;
-}
-AbstractAudioEncodeOutputPin::~AbstractAudioEncodeOutputPin(void)
-{
-
- delete mDataQueue;
-
-}
-STDMETHODIMP AbstractAudioEncodeOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
- if (riid == IID_IMediaSeeking) {
- *ppv = (IMediaSeeking*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- }
-
- return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
-}
-
-HRESULT AbstractAudioEncodeOutputPin::DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES* inPropertyRequest) {
-
//FIX::: Abstract this out properly
-
- HRESULT locHR = S_OK;
-
- //Create the structures for setproperties to use
- ALLOCATOR_PROPERTIES locReqAlloc;
- ALLOCATOR_PROPERTIES locActualAlloc;
-
- const unsigned long MIN_BUFFER_SIZE = 1096; //What should this be ????
- const unsigned long DEFAULT_BUFFER_SIZE = 32192;
- const unsigned long MIN_NUM_BUFFERS = 3;
- const unsigned long DEFAULT_NUM_BUFFERS = 5;
-
-
- //Validate and change what we have been requested to do.
- //Allignment of data
- if (inPropertyRequest->cbAlign <= 0) {
- locReqAlloc.cbAlign = 1;
- } else {
- locReqAlloc.cbAlign = inPropertyRequest->cbAlign;
- }
-
- if (inPropertyRequest->cbBuffer < MIN_BUFFER_SIZE) {
- locReqAlloc.cbBuffer = DEFAULT_BUFFER_SIZE;
- } else {
- locReqAlloc.cbBuffer = inPropertyRequest->cbBuffer;
- }
-
- if (inPropertyRequest->cbPrefix < 0) {
- locReqAlloc.cbPrefix = 0;
- } else {
- locReqAlloc.cbPrefix = inPropertyRequest->cbPrefix;
- }
-
- if (inPropertyRequest->cBuffers < MIN_NUM_BUFFERS) {
- locReqAlloc.cBuffers = DEFAULT_NUM_BUFFERS;
- } else {
-
- locReqAlloc.cBuffers = inPropertyRequest->cBuffers;
- }
-
- locHR = inAllocator->SetProperties(&locReqAlloc, &locActualAlloc);
-
- if (locHR != S_OK) {
- return locHR;
- }
-
-
- locHR = inAllocator->Commit();
-
- return locHR;
-}
-HRESULT AbstractAudioEncodeOutputPin::CheckMediaType(const CMediaType *inMediaType) {
- if ( (inMediaType->majortype == MEDIATYPE_Audio) &&
- (inMediaType->subtype == mOutputMediaType->subtype) && (inMediaType->formattype == mOutputMediaType->formattype)
- )
- {
- return S_OK;
- } else {
- return S_FALSE;
- }
-
-}
-
-HRESULT AbstractAudioEncodeOutputPin::GetMediaType(int inPosition, CMediaType *outMediaType) {
-
- if (inPosition < 0) {
- return E_INVALIDARG;
- }
-
- BYTE* locFormatBuffer = NULL;
- switch (inPosition) {
- case 0:
-
- outMediaType->SetType(&MEDIATYPE_Audio);
- outMediaType->SetSubtype(&(mOutputMediaType->subtype));
- outMediaType->SetFormatType(&(mOutputMediaType->formattype));
- //
- locFormatBuffer = new BYTE[FormatBufferSize()]; //Deleted below. Is this right ? What does set format do ?
- FillFormatBuffer(locFormatBuffer);
- outMediaType->SetFormat(locFormatBuffer, FormatBufferSize());
- delete[] locFormatBuffer;
- //
- return S_OK;
- default:
- return VFW_S_NO_MORE_ITEMS;
- }
-}
-
-
-
-
-
-HRESULT AbstractAudioEncodeOutputPin::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
-{
- //mPartialPacket = NULL;
- mDataQueue->NewSegment(tStart, tStop, dRate);
-
- return S_OK;
-}
-HRESULT AbstractAudioEncodeOutputPin::DeliverEndOfStream(void)
-{
- //mPartialPacket = NULL;
- mDataQueue->EOS();
- return S_OK;
-}
-
-HRESULT AbstractAudioEncodeOutputPin::DeliverEndFlush(void)
-{
- mDataQueue->EndFlush();
- return S_OK;
-}
-
-HRESULT AbstractAudioEncodeOutputPin::DeliverBeginFlush(void)
-{
- //mPartialPacket = NULL;
- mDataQueue->BeginFlush();
- return S_OK;
-}
-
-HRESULT AbstractAudioEncodeOutputPin::CompleteConnect (IPin *inReceivePin)
-{
- HRESULT locHR = S_OK;
- //DELETE in DEStructor
- mDataQueue = new COutputQueue (inReceivePin, &locHR, FALSE, TRUE, 1, TRUE, 10);
- if (FAILED(locHR)) {
- locHR = locHR;
- }
-
- return CBaseOutputPin::CompleteConnect(inReceivePin);
-}
\ No newline at end of file
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "abstractaudioencodeoutputpin.h"
+
+
+
+AbstractAudioEncodeOutputPin::AbstractAudioEncodeOutputPin(AbstractAudioEncodeFilter* inParentFilter, CCritSec* inFilterLock, CHAR* inObjectName, LPCWSTR inPinDisplayName, CMediaType* inOutputMediaType)
+ : CBaseOutputPin(inObjectName, inParentFilter, inFilterLock, &mHR, inPinDisplayName),
+ mParentFilter(inParentFilter)
+
+ , mDataQueue(NULL)
+{
+ mOutputMediaType = inOutputMediaType;
+}
+AbstractAudioEncodeOutputPin::~AbstractAudioEncodeOutputPin(void)
+{
+
+ delete mDataQueue;
+
+}
+STDMETHODIMP AbstractAudioEncodeOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
+ if (riid == IID_IMediaSeeking) {
+ *ppv = (IMediaSeeking*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ }
+
+ return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
+}
+
+HRESULT AbstractAudioEncodeOutputPin::DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES* inPropertyRequest) {
+
+
+ //FIX::: Abstract this out properly
+
+ HRESULT locHR = S_OK;
+
+ //Create the structures for setproperties to use
+ ALLOCATOR_PROPERTIES locReqAlloc;
+ ALLOCATOR_PROPERTIES locActualAlloc;
+
+ const unsigned long MIN_BUFFER_SIZE = 1096; //What should this be ????
+ const unsigned long DEFAULT_BUFFER_SIZE = 32192;
+ const unsigned long MIN_NUM_BUFFERS = 3;
+ const unsigned long DEFAULT_NUM_BUFFERS = 5;
+
+
+ //Validate and change what we have been requested to do.
+ //Allignment of data
+ if (inPropertyRequest->cbAlign <= 0) {
+ locReqAlloc.cbAlign = 1;
+ } else {
+ locReqAlloc.cbAlign = inPropertyRequest->cbAlign;
+ }
+
+ if (inPropertyRequest->cbBuffer < MIN_BUFFER_SIZE) {
+ locReqAlloc.cbBuffer = DEFAULT_BUFFER_SIZE;
+ } else {
+ locReqAlloc.cbBuffer = inPropertyRequest->cbBuffer;
+ }
+
+ if (inPropertyRequest->cbPrefix < 0) {
+ locReqAlloc.cbPrefix = 0;
+ } else {
+ locReqAlloc.cbPrefix = inPropertyRequest->cbPrefix;
+ }
+
+ if (inPropertyRequest->cBuffers < MIN_NUM_BUFFERS) {
+ locReqAlloc.cBuffers = DEFAULT_NUM_BUFFERS;
+ } else {
+
+ locReqAlloc.cBuffers = inPropertyRequest->cBuffers;
+ }
+
+ locHR = inAllocator->SetProperties(&locReqAlloc, &locActualAlloc);
+
+ if (locHR != S_OK) {
+ return locHR;
+ }
+
+
+ locHR = inAllocator->Commit();
+
+ return locHR;
+}
+HRESULT AbstractAudioEncodeOutputPin::CheckMediaType(const CMediaType *inMediaType) {
+ if ( (inMediaType->majortype == MEDIATYPE_Audio) &&
+ (inMediaType->subtype == mOutputMediaType->subtype) && (inMediaType->formattype == mOutputMediaType->formattype)
+ )
+ {
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
+
+}
+
+HRESULT AbstractAudioEncodeOutputPin::GetMediaType(int inPosition, CMediaType *outMediaType) {
+
+ if (inPosition < 0) {
+ return E_INVALIDARG;
+ }
+
+ BYTE* locFormatBuffer = NULL;
+ switch (inPosition) {
+ case 0:
+
+ outMediaType->SetType(&MEDIATYPE_Audio);
+ outMediaType->SetSubtype(&(mOutputMediaType->subtype));
+ outMediaType->SetFormatType(&(mOutputMediaType->formattype));
+ //
+ locFormatBuffer = new BYTE[FormatBufferSize()]; //Deleted below. Is this right ? What does set format do ?
+ FillFormatBuffer(locFormatBuffer);
+ outMediaType->SetFormat(locFormatBuffer, FormatBufferSize());
+ delete[] locFormatBuffer;
+ //
+ return S_OK;
+ default:
+ return VFW_S_NO_MORE_ITEMS;
+ }
+}
+
+
+
+
+
+HRESULT AbstractAudioEncodeOutputPin::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
+{
+ //mPartialPacket = NULL;
+ mDataQueue->NewSegment(tStart, tStop, dRate);
+
+ return S_OK;
+}
+HRESULT AbstractAudioEncodeOutputPin::DeliverEndOfStream(void)
+{
+ //mPartialPacket = NULL;
+ mDataQueue->EOS();
+ return S_OK;
+}
+
+HRESULT AbstractAudioEncodeOutputPin::DeliverEndFlush(void)
+{
+ mDataQueue->EndFlush();
+ return S_OK;
+}
+
+HRESULT AbstractAudioEncodeOutputPin::DeliverBeginFlush(void)
+{
+ //mPartialPacket = NULL;
+ mDataQueue->BeginFlush();
+ return S_OK;
+}
+
+HRESULT AbstractAudioEncodeOutputPin::CompleteConnect (IPin *inReceivePin)
+{
+ HRESULT locHR = S_OK;
+ //DELETE in DEStructor
+ mDataQueue = new COutputQueue (inReceivePin, &locHR, FALSE, TRUE, 1, TRUE, 10);
+ if (FAILED(locHR)) {
+ locHR = locHR;
+ }
+
+ return CBaseOutputPin::CompleteConnect(inReceivePin);
+}
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeOutputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeOutputPin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeOutputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeOutputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,77 +1,78 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-#include "BasicSeekable.h"
-class AbstractAudioEncodeFilter;
-
-class ABS_AUDIO_ENC_API AbstractAudioEncodeOutputPin
- : public CBaseOutputPin
- , public BasicSeekable
-
-{
-public:
- //COM Setup
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- AbstractAudioEncodeOutputPin(AbstractAudioEncodeFilter* inParentFilter, CCritSec* inFilterLock, CHAR* inObjectName, LPCWSTR inPinDisplayName, CMediaType* inOutputMediaType);
- virtual ~AbstractAudioEncodeOutputPin(void);
-
- virtual HRESULT DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES *inReqAllocProps);
- virtual HRESULT CheckMediaType(const CMediaType *inMediaType);
-
- //PURE VIRTUALS
- virtual bool FillFormatBuffer(BYTE* inFormatBuffer) = 0;
- virtual unsigned long FormatBufferSize() = 0;
-
- virtual HRESULT GetMediaType(int inPosition, CMediaType *outMediaType);
-
-
- //Virtuals for data queue
- virtual HRESULT CompleteConnect (IPin *inReceivePin);
- virtual HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
- virtual HRESULT DeliverEndOfStream(void);
- virtual HRESULT DeliverEndFlush(void);
- virtual HRESULT DeliverBeginFlush(void);
-
- COutputQueue* mDataQueue;
-protected:
- HRESULT mHR;
- AbstractAudioEncodeFilter* mParentFilter;
- void FillMediaType(CMediaType* inMediaType);
-
- CMediaType* mOutputMediaType;
-
- static const int BUFF_SIZE = 65536;
static const int BUFF_COUNT = 5;
-
-};
\ No newline at end of file
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+#include "BasicSeekable.h"
+class AbstractAudioEncodeFilter;
+
+class ABS_AUDIO_ENC_API AbstractAudioEncodeOutputPin
+ : public CBaseOutputPin
+ , public BasicSeekable
+
+{
+public:
+ //COM Setup
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ AbstractAudioEncodeOutputPin(AbstractAudioEncodeFilter* inParentFilter, CCritSec* inFilterLock, CHAR* inObjectName, LPCWSTR inPinDisplayName, CMediaType* inOutputMediaType);
+ virtual ~AbstractAudioEncodeOutputPin(void);
+
+ virtual HRESULT DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES *inReqAllocProps);
+ virtual HRESULT CheckMediaType(const CMediaType *inMediaType);
+
+ //PURE VIRTUALS
+ virtual bool FillFormatBuffer(BYTE* inFormatBuffer) = 0;
+ virtual unsigned long FormatBufferSize() = 0;
+
+ virtual HRESULT GetMediaType(int inPosition, CMediaType *outMediaType);
+
+
+ //Virtuals for data queue
+ virtual HRESULT CompleteConnect (IPin *inReceivePin);
+ virtual HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
+ virtual HRESULT DeliverEndOfStream(void);
+ virtual HRESULT DeliverEndFlush(void);
+ virtual HRESULT DeliverBeginFlush(void);
+
+ COutputQueue* mDataQueue;
+protected:
+ HRESULT mHR;
+ AbstractAudioEncodeFilter* mParentFilter;
+ void FillMediaType(CMediaType* inMediaType);
+
+ CMediaType* mOutputMediaType;
+
+ static const int BUFF_SIZE = 65536;
+ static const int BUFF_COUNT = 5;
+
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/AbstractAudioEncodeOutputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/abstractaudioencodedllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/abstractaudioencodedllstuff.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/abstractaudioencodedllstuff.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,55 +1,55 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-
-// The following ifdef block is the standard way of creating macros which make exporting
-// from a DLL simpler. All files within this DLL are compiled with the DSFABSTRACTAUDIOENCODER_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see
-// DSFABSTRACTAUDIOENCODER_API functions as being imported from a DLL, whereas this DLL sees symbols
-// defined with this macro as being exported.
-
-#include <streams.h>
-#include <pullpin.h>
-#include <initguid.h>
-#ifdef DSFABSTRACTAUDIOENCODER_EXPORTS
-#define ABS_AUDIO_ENC_API __declspec(dllexport)
-#else
-#define ABS_AUDIO_ENC_API __declspec(dllimport)
-#endif
-
-//Is this needed ??
-#ifdef LIBOOOGG_EXPORTS
-#define LIBOOOGG_API __declspec(dllexport)
-#else
-#define LIBOOOGG_API __declspec(dllimport)
-#endif
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+
+// The following ifdef block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the DSFABSTRACTAUDIOENCODER_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// DSFABSTRACTAUDIOENCODER_API functions as being imported from a DLL, whereas this DLL sees symbols
+// defined with this macro as being exported.
+
+#include <streams.h>
+#include <pullpin.h>
+#include <initguid.h>
+#ifdef DSFABSTRACTAUDIOENCODER_EXPORTS
+#define ABS_AUDIO_ENC_API __declspec(dllexport)
+#else
+#define ABS_AUDIO_ENC_API __declspec(dllimport)
+#endif
+
+//Is this needed ??
+#ifdef LIBOOOGG_EXPORTS
+#define LIBOOOGG_API __declspec(dllexport)
+#else
+#define LIBOOOGG_API __declspec(dllimport)
+#endif
+
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/abstractaudioencodedllstuff.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/dsfAbstractAudioEncoder.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/dsfAbstractAudioEncoder.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/dsfAbstractAudioEncoder.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,51 +1,51 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// dsfAbstractAudioEncoder.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-#include "dsfAbstractAudioEncoder.h"
-//BOOL APIENTRY DllMain( HANDLE hModule,
-// DWORD ul_reason_for_call,
-// LPVOID lpReserved
-// )
-//{
-// switch (ul_reason_for_call)
-// {
-// case DLL_PROCESS_ATTACH:
-// case DLL_THREAD_ATTACH:
-// case DLL_THREAD_DETACH:
-// case DLL_PROCESS_DETACH:
-// break;
-// }
-// return TRUE;
-//}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// dsfAbstractAudioEncoder.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+#include "dsfAbstractAudioEncoder.h"
+//BOOL APIENTRY DllMain( HANDLE hModule,
+// DWORD ul_reason_for_call,
+// LPVOID lpReserved
+// )
+//{
+// switch (ul_reason_for_call)
+// {
+// case DLL_PROCESS_ATTACH:
+// case DLL_THREAD_ATTACH:
+// case DLL_THREAD_DETACH:
+// case DLL_PROCESS_DETACH:
+// break;
+// }
+// return TRUE;
+//}
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/dsfAbstractAudioEncoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/dsfAbstractAudioEncoder.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/dsfAbstractAudioEncoder.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/dsfAbstractAudioEncoder.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,30 +1,30 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/dsfAbstractAudioEncoder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,39 +1,39 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.cpp : source file that includes just the standard includes
-// dsfAbstractAudioEncoder.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.cpp : source file that includes just the standard includes
+// dsfAbstractAudioEncoder.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,49 +1,49 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-
-#include "abstractaudioencodedllstuff.h"
-#include "AbstractAudioEncodeInputPin.h"
-#include "AbstractAudioEncodeOutputPin.h"
-#include "AbstractAudioEncodeFilter.h"
-// TODO: reference additional headers your program requires here
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+
+#include "abstractaudioencodedllstuff.h"
+#include "AbstractAudioEncodeInputPin.h"
+#include "AbstractAudioEncodeOutputPin.h"
+#include "AbstractAudioEncodeFilter.h"
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractAudioEncoder/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeFilter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeFilter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,95 +1,95 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "abstractVideodecodefilter.h"
-
-AbstractVideoDecodeFilter::AbstractVideoDecodeFilter(TCHAR* inFilterName, REFCLSID inFilterGUID, unsigned short inVideoFormat )
- : CBaseFilter(inFilterName, NULL,m_pLock, inFilterGUID),
- mVideoFormat(inVideoFormat)
-{
- //debugLog.open("G:\\logs\\avdFitler.log", ios_base::out);
- m_pLock = new CCritSec; //Deleted in destructor
-
-}
-
-AbstractVideoDecodeFilter::~AbstractVideoDecodeFilter(void)
-{
- //debugLog.close();
- delete m_pLock;
- DestroyPins();
-}
-
-void AbstractVideoDecodeFilter::DestroyPins() {
- delete mOutputPin;
- delete mInputPin;
-}
-
-STDMETHODIMP AbstractVideoDecodeFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
-
- return CBaseFilter::NonDelegatingQueryInterface(riid, ppv);
-}
-
-CBasePin* AbstractVideoDecodeFilter::GetPin(int inPinNo) {
- //FIX::: Errors here
- if (inPinNo < 0 ) {
- return NULL;
- } else if (inPinNo == 0) {
- return mInputPin;
- } else if (inPinNo == 1) {
- return mOutputPin;
- }
-}
-
-STDMETHODIMP AbstractVideoDecodeFilter::Stop() {
- CAutoLock locLock(m_pLock);
- //debugLog<<"**** STOP ****"<<endl;
- mInputPin->ResetFrameCount();
- return CBaseFilter::Stop();
-}
-
-STDMETHODIMP AbstractVideoDecodeFilter::Pause() {
- CAutoLock locLock(m_pLock);
- //debugLog<<"**** PAUSE ****"<<endl;
- return CBaseFilter::Pause();
-}
-
-STDMETHODIMP AbstractVideoDecodeFilter::Run(REFERENCE_TIME tStart) {
- CAutoLock locLock(m_pLock);
- //debugLog<<"**** RUN ****"<<endl;
- return CBaseFilter::Run(tStart);
-}
-int AbstractVideoDecodeFilter::GetPinCount(void) {
- //TO DO::: Move this somewhere better
- const long NUM_PINS = 2;
- return NUM_PINS;
-}
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "abstractVideodecodefilter.h"
+
+AbstractVideoDecodeFilter::AbstractVideoDecodeFilter(TCHAR* inFilterName, REFCLSID inFilterGUID, unsigned short inVideoFormat )
+ : CBaseFilter(inFilterName, NULL,m_pLock, inFilterGUID),
+ mVideoFormat(inVideoFormat)
+{
+ //debugLog.open("G:\\logs\\avdFitler.log", ios_base::out);
+ m_pLock = new CCritSec; //Deleted in destructor
+
+}
+
+AbstractVideoDecodeFilter::~AbstractVideoDecodeFilter(void)
+{
+ //debugLog.close();
+ delete m_pLock;
+ DestroyPins();
+}
+
+void AbstractVideoDecodeFilter::DestroyPins() {
+ delete mOutputPin;
+ delete mInputPin;
+}
+
+STDMETHODIMP AbstractVideoDecodeFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
+
+ return CBaseFilter::NonDelegatingQueryInterface(riid, ppv);
+}
+
+CBasePin* AbstractVideoDecodeFilter::GetPin(int inPinNo) {
+ //FIX::: Errors here
+ if (inPinNo < 0 ) {
+ return NULL;
+ } else if (inPinNo == 0) {
+ return mInputPin;
+ } else if (inPinNo == 1) {
+ return mOutputPin;
+ }
+}
+
+STDMETHODIMP AbstractVideoDecodeFilter::Stop() {
+ CAutoLock locLock(m_pLock);
+ //debugLog<<"**** STOP ****"<<endl;
+ mInputPin->ResetFrameCount();
+ return CBaseFilter::Stop();
+}
+
+STDMETHODIMP AbstractVideoDecodeFilter::Pause() {
+ CAutoLock locLock(m_pLock);
+ //debugLog<<"**** PAUSE ****"<<endl;
+ return CBaseFilter::Pause();
+}
+
+STDMETHODIMP AbstractVideoDecodeFilter::Run(REFERENCE_TIME tStart) {
+ CAutoLock locLock(m_pLock);
+ //debugLog<<"**** RUN ****"<<endl;
+ return CBaseFilter::Run(tStart);
+}
+int AbstractVideoDecodeFilter::GetPinCount(void) {
+ //TO DO::: Move this somewhere better
+ const long NUM_PINS = 2;
+ return NUM_PINS;
+}
+
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeFilter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeFilter.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeFilter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeFilter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,86 +1,86 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-#include "abstractvideodllstuff.h"
-#include "BasicSeekable.h"
-
-#include <fstream>
-
-using namespace std;
-
-class AbstractVideoDecodeInputPin;
-class AbstractVideoDecodeOutputPin;
-
-class ABS_VIDEO_DEC_API AbstractVideoDecodeFilter
- : public CBaseFilter
- , public BasicSeekable
-{
-public:
- friend class AbstractVideoDecodeInputPin;
- friend class AbstractVideoDecodeOutputPin;
- AbstractVideoDecodeFilter(TCHAR* inFilterName, REFCLSID inFilterGUID, unsigned short inVideoFormat );
- virtual ~AbstractVideoDecodeFilter(void);
-
- static const long NUM_PINS = 2;
- enum eVideoFormat {
- NONE = 0,
- THEORA = 1,
- OTHER = 1000
- };
-
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- //PURE VIRTUALS
- virtual bool ConstructPins() = 0;
- virtual void DestroyPins();
-
- //CBaseFilter overrides
- CBasePin* GetPin(int n);
- int GetPinCount(void);
-
- virtual STDMETHODIMP Stop();
- virtual STDMETHODIMP Pause();
- virtual STDMETHODIMP Run(REFERENCE_TIME tStart);
-
-
- unsigned short mVideoFormat;
-
-protected:
-
- //fstream debugLog;
-
- AbstractVideoDecodeInputPin* mInputPin;
- AbstractVideoDecodeOutputPin* mOutputPin;
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+#include "abstractvideodllstuff.h"
+#include "BasicSeekable.h"
+
+#include <fstream>
+
+using namespace std;
+
+class AbstractVideoDecodeInputPin;
+class AbstractVideoDecodeOutputPin;
+
+class ABS_VIDEO_DEC_API AbstractVideoDecodeFilter
+ : public CBaseFilter
+ , public BasicSeekable
+{
+public:
+ friend class AbstractVideoDecodeInputPin;
+ friend class AbstractVideoDecodeOutputPin;
+ AbstractVideoDecodeFilter(TCHAR* inFilterName, REFCLSID inFilterGUID, unsigned short inVideoFormat );
+ virtual ~AbstractVideoDecodeFilter(void);
+
+ static const long NUM_PINS = 2;
+ enum eVideoFormat {
+ NONE = 0,
+ THEORA = 1,
+ OTHER = 1000
+ };
+
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ //PURE VIRTUALS
+ virtual bool ConstructPins() = 0;
+ virtual void DestroyPins();
+
+ //CBaseFilter overrides
+ CBasePin* GetPin(int n);
+ int GetPinCount(void);
+
+ virtual STDMETHODIMP Stop();
+ virtual STDMETHODIMP Pause();
+ virtual STDMETHODIMP Run(REFERENCE_TIME tStart);
+
+
+ unsigned short mVideoFormat;
+
+protected:
+
+ //fstream debugLog;
+
+ AbstractVideoDecodeInputPin* mInputPin;
+ AbstractVideoDecodeOutputPin* mOutputPin;
+
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeFilter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeInputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeInputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,232 +1,232 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "abstractvideodecodeinputpin.h"
-
-//#include <mtype.h>
-AbstractVideoDecodeInputPin::AbstractVideoDecodeInputPin (AbstractVideoDecodeFilter* inParentFilter, CCritSec* inFilterLock, AbstractVideoDecodeOutputPin* inOutputPin, CHAR* inObjectName, LPCWSTR inPinDisplayName, CMediaType* inAcceptMediaType)
- : CBaseInputPin(inObjectName, inParentFilter, inFilterLock, &mHR, inPinDisplayName)
- , mOutputPin(inOutputPin)
- , mParentFilter(inParentFilter)
-
- , mBegun(false)
-
- , mHeight(0)
- , mWidth(0)
-
- , mFrameDuration(0)
- , mFrameSize(0)
- , mFrameCount(0)
-
- , mStreamLock(NULL)
- , mLastSeenStartGranPos(0)
- , mSeekTimeBase(0)
-
-{
- //debugLog.open("G:\\logs\\avdInputPin.log", ios_base::out);
- //ConstructCodec();
- mStreamLock = new CCritSec; //Deleted in destructor
- mAcceptableMediaType = inAcceptMediaType;
-
- //IMediaSeeking* locSeeker = NULL;
- //this->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
- //mOutputPin->SetDelegate(locSeeker);
-}
-
-AbstractVideoDecodeInputPin::~AbstractVideoDecodeInputPin(void)
-{
- //debugLog.close();
- //DestroyCodec();
- delete mStreamLock;
-
-}
-STDMETHODIMP AbstractVideoDecodeInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
- //debugLog<<"Query Interface"<<endl;
- if (riid == IID_IMediaSeeking) {
- *ppv = (IMediaSeeking*)this;
- ((IUnknown*)*ppv)->AddRef();
- //debugLog<<"Queried for IMediaSeeking"<<endl;
- return NOERROR;
- }
-
- return CBaseInputPin::NonDelegatingQueryInterface(riid, ppv);
-}
-
-HRESULT AbstractVideoDecodeInputPin::BreakConnect() {
- CAutoLock locLock(m_pLock);
- //Need a lock ??
- ReleaseDelegate();
- return CBaseInputPin::BreakConnect();
-}
-HRESULT AbstractVideoDecodeInputPin::CompleteConnect (IPin *inReceivePin) {
- CAutoLock locLock(m_pLock);
-
- IMediaSeeking* locSeeker = NULL;
- inReceivePin->QueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
- SetDelegate(locSeeker);
- return CBaseInputPin::CompleteConnect(inReceivePin);
-}
-void AbstractVideoDecodeInputPin::ResetFrameCount() {
- mFrameCount = 0;
-
-}
-bool AbstractVideoDecodeInputPin::SetSampleParams(IMediaSample* outMediaSample, unsigned long inDataSize, REFERENCE_TIME* inStartTime, REFERENCE_TIME* inEndTime)
-{
- outMediaSample->SetTime(inStartTime, inEndTime);
- outMediaSample->SetMediaTime(NULL, NULL);
- outMediaSample->SetActualDataLength(inDataSize);
- outMediaSample->SetPreroll(FALSE);
- outMediaSample->SetDiscontinuity(FALSE);
- outMediaSample->SetSyncPoint(FALSE);
- return true;
-}
-
-
-STDMETHODIMP AbstractVideoDecodeInputPin::Receive(IMediaSample* inSample) {
- CAutoLock locLock(mStreamLock);
- //debugLog<<"Receive "<<endl;
- HRESULT locHR;
- BYTE* locBuff = NULL;
- locHR = inSample->GetPointer(&locBuff);
-
-
- if (FAILED(locHR)) {
- //debugLog<<"Receive : Get pointer failed..."<<locHR<<endl;
- return locHR;
- } else {
- //debugLog<<"Receive : Get pointer succeeds..."<<endl;
- //New start time hacks
- REFERENCE_TIME locStart = 0;
- REFERENCE_TIME locEnd = 0;
- inSample->GetTime(&locStart, &locEnd);
- //Error chacks needed here
-
- //More work arounds for that stupid granule pos scheme in theora!
- REFERENCE_TIME locTimeBase = 0;
- REFERENCE_TIME locDummy = 0;
- inSample->GetMediaTime(&locTimeBase, &locDummy);
- mSeekTimeBase = locTimeBase;
- //
-
- if ((mLastSeenStartGranPos != locStart) && (locStart != -1)) {
- ResetFrameCount();
- mLastSeenStartGranPos = locStart;
- }
-
- //End of additions
-
-
-
- AM_MEDIA_TYPE* locMediaType = NULL;
- inSample->GetMediaType(&locMediaType);
- if (locMediaType == NULL) {
- //debugLog<<"No dynamic change..."<<endl;
- } else {
- //debugLog<<"Attempting dynamic change..."<<endl;
- }
- //if (locMediaType != NULL) {
-
- //VIDEOINFOHEADER* locVideoHeader = (VIDEOINFOHEADER*)locMediaType->pbFormat;
- //mHeight = 288; //locVideoHeader->bmiHeader.biHeight;
- //mWidth = 384; //locVideoHeader->bmiHeader.biWidth;
- //}
-
-
- long locResult = decodeData(locBuff, inSample->GetActualDataLength(), locStart, locEnd);
- if (locResult == 0) {
- //debugLog<<"Receive : Decode OK"<<endl;
- return S_OK;
- } else {
- //debugLog<<"Receive : Decode OK"<<endl;
- return S_FALSE;
- }
- }
-
-
- return S_OK;
-}
-
-HRESULT AbstractVideoDecodeInputPin::CheckMediaType(const CMediaType *inMediaType) {
- //FIX::: Clean this up !
-
- if ( (inMediaType->majortype == MEDIATYPE_Video) &&
- (inMediaType->subtype == mAcceptableMediaType->subtype) && (inMediaType->formattype == mAcceptableMediaType->formattype)
- )
- {
- return S_OK;
- } else {
- return S_FALSE;
- }
-}
-
-STDMETHODIMP AbstractVideoDecodeInputPin::EndOfStream(void) {
- CAutoLock locLock(mStreamLock);
- return mParentFilter->mOutputPin->DeliverEndOfStream();
-}
-
-STDMETHODIMP AbstractVideoDecodeInputPin::BeginFlush() {
- CAutoLock locLock(m_pLock);
- CBaseInputPin::BeginFlush();
- return mParentFilter->mOutputPin->DeliverBeginFlush();
-}
-STDMETHODIMP AbstractVideoDecodeInputPin::EndFlush() {
- CAutoLock locLock(m_pLock);
- mParentFilter->mOutputPin->DeliverEndFlush();
-
- return CBaseInputPin::EndFlush();
-
-}
-
-STDMETHODIMP AbstractVideoDecodeInputPin::NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate) {
- CAutoLock locLock(mStreamLock);
- //This breaks it for some reason... though something similar in the audio component works fine.
- CBasePin::NewSegment(tStart, tStop, dRate);
- return mParentFilter->mOutputPin->DeliverNewSegment(tStart, tStop, dRate);
-}
-
-HRESULT AbstractVideoDecodeInputPin::GetMediaType(int inPosition, CMediaType *outMediaType) {
-
- if (inPosition < 0) {
- return E_INVALIDARG;
- }
-
- switch (inPosition) {
- case 0:
-
- outMediaType->SetType(&MEDIATYPE_Video);
- outMediaType->SetSubtype(&(mAcceptableMediaType->subtype));
- //Don't set the format data here. That's up to our output pin/
- return S_OK;
- default:
- return VFW_S_NO_MORE_ITEMS;
- }
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "abstractvideodecodeinputpin.h"
+
+//#include <mtype.h>
+AbstractVideoDecodeInputPin::AbstractVideoDecodeInputPin (AbstractVideoDecodeFilter* inParentFilter, CCritSec* inFilterLock, AbstractVideoDecodeOutputPin* inOutputPin, CHAR* inObjectName, LPCWSTR inPinDisplayName, CMediaType* inAcceptMediaType)
+ : CBaseInputPin(inObjectName, inParentFilter, inFilterLock, &mHR, inPinDisplayName)
+ , mOutputPin(inOutputPin)
+ , mParentFilter(inParentFilter)
+
+ , mBegun(false)
+
+ , mHeight(0)
+ , mWidth(0)
+
+ , mFrameDuration(0)
+ , mFrameSize(0)
+ , mFrameCount(0)
+
+ , mStreamLock(NULL)
+ , mLastSeenStartGranPos(0)
+ , mSeekTimeBase(0)
+
+{
+ //debugLog.open("G:\\logs\\avdInputPin.log", ios_base::out);
+ //ConstructCodec();
+ mStreamLock = new CCritSec; //Deleted in destructor
+ mAcceptableMediaType = inAcceptMediaType;
+
+ //IMediaSeeking* locSeeker = NULL;
+ //this->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+ //mOutputPin->SetDelegate(locSeeker);
+}
+
+AbstractVideoDecodeInputPin::~AbstractVideoDecodeInputPin(void)
+{
+ //debugLog.close();
+ //DestroyCodec();
+ delete mStreamLock;
+
+}
+STDMETHODIMP AbstractVideoDecodeInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
+ //debugLog<<"Query Interface"<<endl;
+ if (riid == IID_IMediaSeeking) {
+ *ppv = (IMediaSeeking*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ //debugLog<<"Queried for IMediaSeeking"<<endl;
+ return NOERROR;
+ }
+
+ return CBaseInputPin::NonDelegatingQueryInterface(riid, ppv);
+}
+
+HRESULT AbstractVideoDecodeInputPin::BreakConnect() {
+ CAutoLock locLock(m_pLock);
+ //Need a lock ??
+ ReleaseDelegate();
+ return CBaseInputPin::BreakConnect();
+}
+HRESULT AbstractVideoDecodeInputPin::CompleteConnect (IPin *inReceivePin) {
+ CAutoLock locLock(m_pLock);
+
+ IMediaSeeking* locSeeker = NULL;
+ inReceivePin->QueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+ SetDelegate(locSeeker);
+ return CBaseInputPin::CompleteConnect(inReceivePin);
+}
+void AbstractVideoDecodeInputPin::ResetFrameCount() {
+ mFrameCount = 0;
+
+}
+bool AbstractVideoDecodeInputPin::SetSampleParams(IMediaSample* outMediaSample, unsigned long inDataSize, REFERENCE_TIME* inStartTime, REFERENCE_TIME* inEndTime)
+{
+ outMediaSample->SetTime(inStartTime, inEndTime);
+ outMediaSample->SetMediaTime(NULL, NULL);
+ outMediaSample->SetActualDataLength(inDataSize);
+ outMediaSample->SetPreroll(FALSE);
+ outMediaSample->SetDiscontinuity(FALSE);
+ outMediaSample->SetSyncPoint(FALSE);
+ return true;
+}
+
+
+STDMETHODIMP AbstractVideoDecodeInputPin::Receive(IMediaSample* inSample) {
+ CAutoLock locLock(mStreamLock);
+ //debugLog<<"Receive "<<endl;
+ HRESULT locHR;
+ BYTE* locBuff = NULL;
+ locHR = inSample->GetPointer(&locBuff);
+
+
+ if (FAILED(locHR)) {
+ //debugLog<<"Receive : Get pointer failed..."<<locHR<<endl;
+ return locHR;
+ } else {
+ //debugLog<<"Receive : Get pointer succeeds..."<<endl;
+ //New start time hacks
+ REFERENCE_TIME locStart = 0;
+ REFERENCE_TIME locEnd = 0;
+ inSample->GetTime(&locStart, &locEnd);
+ //Error chacks needed here
+
+ //More work arounds for that stupid granule pos scheme in theora!
+ REFERENCE_TIME locTimeBase = 0;
+ REFERENCE_TIME locDummy = 0;
+ inSample->GetMediaTime(&locTimeBase, &locDummy);
+ mSeekTimeBase = locTimeBase;
+ //
+
+ if ((mLastSeenStartGranPos != locStart) && (locStart != -1)) {
+ ResetFrameCount();
+ mLastSeenStartGranPos = locStart;
+ }
+
+ //End of additions
+
+
+
+ AM_MEDIA_TYPE* locMediaType = NULL;
+ inSample->GetMediaType(&locMediaType);
+ if (locMediaType == NULL) {
+ //debugLog<<"No dynamic change..."<<endl;
+ } else {
+ //debugLog<<"Attempting dynamic change..."<<endl;
+ }
+ //if (locMediaType != NULL) {
+
+ //VIDEOINFOHEADER* locVideoHeader = (VIDEOINFOHEADER*)locMediaType->pbFormat;
+ //mHeight = 288; //locVideoHeader->bmiHeader.biHeight;
+ //mWidth = 384; //locVideoHeader->bmiHeader.biWidth;
+ //}
+
+
+ long locResult = decodeData(locBuff, inSample->GetActualDataLength(), locStart, locEnd);
+ if (locResult == 0) {
+ //debugLog<<"Receive : Decode OK"<<endl;
+ return S_OK;
+ } else {
+ //debugLog<<"Receive : Decode OK"<<endl;
+ return S_FALSE;
+ }
+ }
+
+
+ return S_OK;
+}
+
+HRESULT AbstractVideoDecodeInputPin::CheckMediaType(const CMediaType *inMediaType) {
+ //FIX::: Clean this up !
+
+ if ( (inMediaType->majortype == MEDIATYPE_Video) &&
+ (inMediaType->subtype == mAcceptableMediaType->subtype) && (inMediaType->formattype == mAcceptableMediaType->formattype)
+ )
+ {
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
+}
+
+STDMETHODIMP AbstractVideoDecodeInputPin::EndOfStream(void) {
+ CAutoLock locLock(mStreamLock);
+ return mParentFilter->mOutputPin->DeliverEndOfStream();
+}
+
+STDMETHODIMP AbstractVideoDecodeInputPin::BeginFlush() {
+ CAutoLock locLock(m_pLock);
+ CBaseInputPin::BeginFlush();
+ return mParentFilter->mOutputPin->DeliverBeginFlush();
+}
+STDMETHODIMP AbstractVideoDecodeInputPin::EndFlush() {
+ CAutoLock locLock(m_pLock);
+ mParentFilter->mOutputPin->DeliverEndFlush();
+
+ return CBaseInputPin::EndFlush();
+
+}
+
+STDMETHODIMP AbstractVideoDecodeInputPin::NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate) {
+ CAutoLock locLock(mStreamLock);
+ //This breaks it for some reason... though something similar in the audio component works fine.
+ CBasePin::NewSegment(tStart, tStop, dRate);
+ return mParentFilter->mOutputPin->DeliverNewSegment(tStart, tStop, dRate);
+}
+
+HRESULT AbstractVideoDecodeInputPin::GetMediaType(int inPosition, CMediaType *outMediaType) {
+
+ if (inPosition < 0) {
+ return E_INVALIDARG;
+ }
+
+ switch (inPosition) {
+ case 0:
+
+ outMediaType->SetType(&MEDIATYPE_Video);
+ outMediaType->SetSubtype(&(mAcceptableMediaType->subtype));
+ //Don't set the format data here. That's up to our output pin/
+ return S_OK;
+ default:
+ return VFW_S_NO_MORE_ITEMS;
+ }
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeInputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeInputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeInputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,99 +1,99 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "abstractVideodllstuff.h"
-#include "BasicSeekable.h"
-class AbstractVideoDecodeOutputPin;
-class AbstractVideoDecodeFilter;
-
-class ABS_VIDEO_DEC_API AbstractVideoDecodeInputPin
- : public CBaseInputPin
- , public BasicSeekable
-{
-public:
- friend class AbstractVideoDecodeOutputPin;
- AbstractVideoDecodeInputPin(AbstractVideoDecodeFilter* inParentFilter, CCritSec* inFilterLock, AbstractVideoDecodeOutputPin* inOutputPin, CHAR* inObjectName, LPCWSTR inPinDisplayName, CMediaType* inAcceptMediaType);
- virtual ~AbstractVideoDecodeInputPin(void);
- static const short SIZE_16_BITS = 2;
- static const unsigned long HUNDRED_NANOS = 10000000;
- static const signed short SINT_MAX = 32767;
- static const signed short SINT_MIN = -32768;
-
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- //PURE VIRTUALS
- virtual long decodeData(unsigned char* inBuf, long inNumBytes, LONGLONG inStart, LONGLONG inEnd) = 0;
- virtual bool ConstructCodec() = 0;
- virtual void DestroyCodec() = 0;
-
-
- virtual HRESULT BreakConnect();
- virtual HRESULT CompleteConnect (IPin *inReceivePin);
- STDMETHODIMP Receive(IMediaSample *pSample);
- virtual HRESULT CheckMediaType(const CMediaType *inMediaType);
- virtual HRESULT GetMediaType(int inPosition, CMediaType *outMediaType);
- virtual HRESULT SetMediaType(const CMediaType* inMediaType) = 0;
-
- virtual void ResetFrameCount();
-
- virtual STDMETHODIMP EndOfStream(void);
- virtual STDMETHODIMP BeginFlush();
- virtual STDMETHODIMP EndFlush();
- virtual STDMETHODIMP NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
-
-protected:
-
- virtual bool SetSampleParams(IMediaSample* outMediaSample, unsigned long inDataSize, REFERENCE_TIME* inStartTime, REFERENCE_TIME* inEndTime);
-
- ////fstream debugLog;
-
- HRESULT mHR;
- bool mBegun;
- AbstractVideoDecodeOutputPin* mOutputPin;
- //__int64 mUptoFrame;
- __int64 mLastSeenStartGranPos;
- AbstractVideoDecodeFilter* mParentFilter;
- CMediaType* mAcceptableMediaType;
-
- LONGLONG mFrameDuration;
- LONGLONG mFrameSize;
- LONGLONG mFrameCount;
-
- unsigned long mHeight;
- unsigned long mWidth;
-
- CCritSec* mStreamLock;
-
-
- REFERENCE_TIME mSeekTimeBase;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "abstractVideodllstuff.h"
+#include "BasicSeekable.h"
+class AbstractVideoDecodeOutputPin;
+class AbstractVideoDecodeFilter;
+
+class ABS_VIDEO_DEC_API AbstractVideoDecodeInputPin
+ : public CBaseInputPin
+ , public BasicSeekable
+{
+public:
+ friend class AbstractVideoDecodeOutputPin;
+ AbstractVideoDecodeInputPin(AbstractVideoDecodeFilter* inParentFilter, CCritSec* inFilterLock, AbstractVideoDecodeOutputPin* inOutputPin, CHAR* inObjectName, LPCWSTR inPinDisplayName, CMediaType* inAcceptMediaType);
+ virtual ~AbstractVideoDecodeInputPin(void);
+ static const short SIZE_16_BITS = 2;
+ static const unsigned long HUNDRED_NANOS = 10000000;
+ static const signed short SINT_MAX = 32767;
+ static const signed short SINT_MIN = -32768;
+
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ //PURE VIRTUALS
+ virtual long decodeData(unsigned char* inBuf, long inNumBytes, LONGLONG inStart, LONGLONG inEnd) = 0;
+ virtual bool ConstructCodec() = 0;
+ virtual void DestroyCodec() = 0;
+
+
+ virtual HRESULT BreakConnect();
+ virtual HRESULT CompleteConnect (IPin *inReceivePin);
+ STDMETHODIMP Receive(IMediaSample *pSample);
+ virtual HRESULT CheckMediaType(const CMediaType *inMediaType);
+ virtual HRESULT GetMediaType(int inPosition, CMediaType *outMediaType);
+ virtual HRESULT SetMediaType(const CMediaType* inMediaType) = 0;
+
+ virtual void ResetFrameCount();
+
+ virtual STDMETHODIMP EndOfStream(void);
+ virtual STDMETHODIMP BeginFlush();
+ virtual STDMETHODIMP EndFlush();
+ virtual STDMETHODIMP NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
+
+protected:
+
+ virtual bool SetSampleParams(IMediaSample* outMediaSample, unsigned long inDataSize, REFERENCE_TIME* inStartTime, REFERENCE_TIME* inEndTime);
+
+ ////fstream debugLog;
+
+ HRESULT mHR;
+ bool mBegun;
+ AbstractVideoDecodeOutputPin* mOutputPin;
+ //__int64 mUptoFrame;
+ __int64 mLastSeenStartGranPos;
+ AbstractVideoDecodeFilter* mParentFilter;
+ CMediaType* mAcceptableMediaType;
+
+ LONGLONG mFrameDuration;
+ LONGLONG mFrameSize;
+ LONGLONG mFrameCount;
+
+ unsigned long mHeight;
+ unsigned long mWidth;
+
+ CCritSec* mStreamLock;
+
+
+ REFERENCE_TIME mSeekTimeBase;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeInputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeOutputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeOutputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeOutputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,330 +1,334 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "abstractVideodecodeoutputpin.h"
-
-AbstractVideoDecodeOutputPin::AbstractVideoDecodeOutputPin(AbstractVideoDecodeFilter* inParentFilter, CCritSec* inFilterLock, CHAR* inObjectName, LPCWSTR inPinDisplayName)
- : CBaseOutputPin(inObjectName, inParentFilter, inFilterLock, &mHR, inPinDisplayName),
- mParentFilter(inParentFilter)
- , mDataQueue(NULL)
-{
- //debugLog.open("g:\\logs\\absvidlog.log", ios_base::out|ios_base::binary);
-}
-AbstractVideoDecodeOutputPin::~AbstractVideoDecodeOutputPin(void)
-{
- //debugLog.close();
-
- delete mDataQueue;
- mDataQueue = NULL;
-}
-
-STDMETHODIMP AbstractVideoDecodeOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
- //debugLog<<"QueryInterface : {"<<riid.Data1<<"-"<<riid.Data2<<"-"<<riid.Data3<<"-"<<riid.Data4<<"}"<<endl;
- if (riid == IID_IMediaSeeking) {
- *ppv = (IMediaSeeking*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- }
-
- return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
-}
-HRESULT AbstractVideoDecodeOutputPin::DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES* inPropertyRequest) {
-
//debugLog<<endl;
//FIX::: Abstract this out properly
-
- //debugLog<<"Allocator is "<<(unsigned long)inAllocator<<endl;
- //Our error variable
- HRESULT locHR = S_OK;
-
- //Create the structures for setproperties to use
- ALLOCATOR_PROPERTIES locReqAlloc;
- ALLOCATOR_PROPERTIES locActualAlloc;
-
- //debugLog<<"DecideBufferSize : Requested :"<<endl;
- //debugLog<<"DecideBufferSize : Align : "<<inPropertyRequest->cbAlign<<endl;
- //debugLog<<"DecideBufferSize : BuffSize : "<<inPropertyRequest->cbBuffer<<endl;
- //debugLog<<"DecideBufferSize : Prefix : "<<inPropertyRequest->cbPrefix<<endl;
- //debugLog<<"DecideBufferSize : NumBuffs : "<<inPropertyRequest->cBuffers<<endl;
-
-
- const unsigned long MIN_BUFFER_SIZE = 16*16; //What should this be ????
- const unsigned long DEFAULT_BUFFER_SIZE = 1024*1024;
- const unsigned long MIN_NUM_BUFFERS = 1;
- const unsigned long DEFAULT_NUM_BUFFERS = 1;
-
-
- //Validate and change what we have been requested to do.
- //Allignment of data
- if (inPropertyRequest->cbAlign <= 0) {
- locReqAlloc.cbAlign = 1;
- } else {
- locReqAlloc.cbAlign = inPropertyRequest->cbAlign;
- }
-
- //Size of each buffer
- if (inPropertyRequest->cbBuffer < MIN_BUFFER_SIZE) {
- locReqAlloc.cbBuffer = DEFAULT_BUFFER_SIZE;
- } else {
- locReqAlloc.cbBuffer = inPropertyRequest->cbBuffer;
- }
-
- //How many prefeixed bytes
- if (inPropertyRequest->cbPrefix < 0) {
- locReqAlloc.cbPrefix = 0;
- } else {
- locReqAlloc.cbPrefix = inPropertyRequest->cbPrefix;
- }
-
- //Number of buffers in the allcoator
- if (inPropertyRequest->cBuffers < MIN_NUM_BUFFERS) {
- locReqAlloc.cBuffers = DEFAULT_NUM_BUFFERS;
- } else {
-
- locReqAlloc.cBuffers = inPropertyRequest->cBuffers;
- }
-
- //debugLog<<"DecideBufferSize : Modified Request :"<<endl;
- //debugLog<<"DecideBufferSize : Align : "<<locReqAlloc.cbAlign<<endl;
- //debugLog<<"DecideBufferSize : BuffSize : "<<locReqAlloc.cbBuffer<<endl;
- //debugLog<<"DecideBufferSize : Prefix : "<<locReqAlloc.cbPrefix<<endl;
- //debugLog<<"DecideBufferSize : NumBuffs : "<<locReqAlloc.cBuffers<<endl;
-
-
- //Set the properties in the allocator
- locHR = inAllocator->SetProperties(&locReqAlloc, &locActualAlloc);
-
- //debugLog<<"DecideBufferSize : SetProperties returns "<<locHR<<endl;
- //debugLog<<"DecideBufferSize : Actual Params :"<<endl;
- //debugLog<<"DecideBufferSize : Align : "<<locActualAlloc.cbAlign<<endl;
- //debugLog<<"DecideBufferSize : BuffSize : "<<locActualAlloc.cbBuffer<<endl;
- //debugLog<<"DecideBufferSize : Prefix : "<<locActualAlloc.cbPrefix<<endl;
- //debugLog<<"DecideBufferSize : NumBuffs : "<<locActualAlloc.cBuffers<<endl;
-
- //Check the response
- switch (locHR) {
- case E_POINTER:
- //debugLog<<"DecideBufferSize : SetProperties - NULL POINTER"<<endl;
- return locHR;
-
-
- case VFW_E_ALREADY_COMMITTED:
- //debugLog<<"DecideBufferSize : SetProperties - Already COMMITED"<<endl;
- return locHR;
-
- case VFW_E_BADALIGN:
- //debugLog<<"DecideBufferSize : SetProperties - Bad ALIGN"<<endl;
- return locHR;
-
- case VFW_E_BUFFERS_OUTSTANDING:
- //debugLog<<"DecideBufferSize : SetProperties - BUFFS OUTSTANDING"<<endl;
- return locHR;
-
-
- case S_OK:
-
- break;
- default:
- //debugLog<<"DecideBufferSize : SetProperties - UNKNOWN ERROR"<<endl;
- break;
-
- }
-
-
- //TO DO::: Do we commit ?
- //RESOLVED ::: Yep !
-
- locHR = inAllocator->Commit();
- //debugLog<<"DecideBufferSize : Commit Returned "<<locHR<<endl;
-
-
- switch (locHR) {
- case E_FAIL:
- //debugLog<<"DecideBufferSize : Commit - FAILED "<<endl;
- return locHR;
- case E_POINTER:
- //debugLog<<"DecideBufferSize : Commit - NULL POINTER "<<endl;
- return locHR;
- case E_INVALIDARG:
- //debugLog<<"DecideBufferSize : Commit - INVALID ARG "<<endl;
- return locHR;
- case E_NOTIMPL:
- //debugLog<<"DecideBufferSize : Commit - NOT IMPL"<<endl;
- return locHR;
- case S_OK:
- //debugLog<<"DecideBufferSize : Commit - ** SUCCESS **"<<endl;
- break;
- default:
- //debugLog<<"DecideBufferSize : Commit - UNKNOWN ERROR "<<endl;
- return locHR;
- }
-
-
- return S_OK;
-}
-HRESULT AbstractVideoDecodeOutputPin::CheckMediaType(const CMediaType *inMediaType) {
- //debugLog<<"CheckMediaType : "<<endl;
- if ((inMediaType->majortype == MEDIATYPE_Video) && (inMediaType->subtype == MEDIASUBTYPE_YV12) && (inMediaType->formattype == FORMAT_VideoInfo)) {
-
- //FIX::: SHould this stuff be in a check routine ??? Shouldn't it be in set mediatype ?
-
- //debugLog << "CheckMediaType : Accepting..."<<endl;
-
- VIDEOINFOHEADER* locVideoHeader = (VIDEOINFOHEADER*)inMediaType->Format();
- //debugLog << "CheckMediaType : Height = " << locVideoHeader->bmiHeader.biHeight<<endl;
- //debugLog << "CheckMediaType : Width = " << locVideoHeader->bmiHeader.biWidth<<endl;
- //debugLog << "CheckMediaType : Size = "<<locVideoHeader->bmiHeader.biSizeImage<<endl<<endl;
- //debugLog << "CheckMediaType : mHeight was = " << mParentFilter->mInputPin->mHeight<<endl;
- //debugLog << "CheckMediaType : mWidth was = " << mParentFilter->mInputPin->mWidth<<endl<<endl;
- //debugLog<<"CheckMediaType : Size was = "<<mParentFilter->mInputPin->mFrameSize<<endl<<endl;
- mParentFilter->mInputPin->mHeight = (unsigned long)abs(locVideoHeader->bmiHeader.biHeight);
- mParentFilter->mInputPin->mWidth = (unsigned long)abs(locVideoHeader->bmiHeader.biWidth);
- mParentFilter->mInputPin->mFrameSize = (unsigned long)locVideoHeader->bmiHeader.biSizeImage;
- //debugLog<<"CheckMediaType : SUCCESS"<<endl;
-
- return S_OK;
- } else {
- //debugLog<<"CheckMediaType : FAILURE"<<endl;
- return S_FALSE;
- }
-
-}
-
-void AbstractVideoDecodeOutputPin::FillMediaType(CMediaType* outMediaType) {
- outMediaType->SetType(&MEDIATYPE_Video);
- outMediaType->SetSubtype(&MEDIASUBTYPE_YV12);
- outMediaType->SetFormatType(&FORMAT_VideoInfo);
- outMediaType->SetTemporalCompression(FALSE);
- outMediaType->SetSampleSize(0);
-
-}
-HRESULT AbstractVideoDecodeOutputPin::GetMediaType(int inPosition, CMediaType *outMediaType) {
-
- if (inPosition < 0) {
- return E_INVALIDARG;
- }
-
- if (inPosition == 0) {
- FillMediaType(outMediaType);
- VIDEOINFOHEADER* locVideoFormat = (VIDEOINFOHEADER*)outMediaType->AllocFormatBuffer(sizeof(VIDEOINFOHEADER));
- FillVideoInfoHeader(locVideoFormat);
-
- //debugLog<<"Vid format size "<<locVideoFormat->bmiHeader.biSizeImage<<endl;
- outMediaType->SetSampleSize(locVideoFormat->bmiHeader.biSizeImage);
- //debugLog<<"Returning from GetMediaType"<<endl;
- return S_OK;
- } else {
- return VFW_S_NO_MORE_ITEMS;
- }
-}
-
-
-//Overriden for a data queue
-HRESULT AbstractVideoDecodeOutputPin::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
-{
- //mPartialPacket = NULL;
- //debugLog << "DeliverNewSegment: start"<<endl;
- CBasePin::NewSegment(tStart, tStop, dRate);
- mDataQueue->NewSegment(tStart, tStop, dRate);
- //debugLog << "DeliverNewSegment: end"<<endl;
-
- return S_OK;
-}
-HRESULT AbstractVideoDecodeOutputPin::DeliverEndOfStream(void)
-{
- //debugLog << "DeliverEndOfStream: executed" << endl;
- //mPartialPacket = NULL;
- mDataQueue->EOS();
- return S_OK;
-}
-
-HRESULT AbstractVideoDecodeOutputPin::DeliverEndFlush(void)
-{
- //debugLog << "DeliverEndFlush" << endl;
- mDataQueue->EndFlush();
- return S_OK;
-}
-
-HRESULT AbstractVideoDecodeOutputPin::DeliverBeginFlush(void)
-{
- //mPartialPacket = NULL;
- //debugLog << "DeliverBeginFlush"<<endl;
- mDataQueue->BeginFlush();
- return S_OK;
-}
-
-HRESULT AbstractVideoDecodeOutputPin::CompleteConnect (IPin *inReceivePin)
-{
- //debugLog<<"ComlpeteConnect"<<endl;
- HRESULT locHR = S_OK;
-
- //Here when another pin connects to us, we internally connect the seek delegate
- // from this output pin onto the input pin... and we release it on breakconnect.
- //
- IMediaSeeking* locSeeker = NULL;
- mParentFilter->mInputPin->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
- SetDelegate(locSeeker);
- //
- //This may cause issue if pins are disconnected and reconnected
- //DELETE in DEStructor
- mDataQueue = new COutputQueue (inReceivePin, &locHR, FALSE, TRUE, 1, TRUE, 15); //deleted in destructor
- if (FAILED(locHR)) {
- //debugLog<<"Creating Output Q failed."<<endl;
- locHR = locHR;
- }
-
- return CBaseOutputPin::CompleteConnect(inReceivePin);
-}
-
-HRESULT AbstractVideoDecodeOutputPin::BreakConnect(void) {
- //debugLog<<"Break Connect"<<endl;
- //CAutoLock locLock(mFilterLock);
- HRESULT locHR = CBaseOutputPin::BreakConnect();
- //debugLog<<"Base BreakConnect returns "<<locHR<<endl;
- ReleaseDelegate();
- delete mDataQueue;
- mDataQueue = NULL;
- return locHR;
-}
-
-//Testing
-HRESULT AbstractVideoDecodeOutputPin::InitAllocator(IMemAllocator **ppAlloc) {
- //debugLog<<"InitAllocator Called"<<endl;
- HRESULT locHR = CBaseOutputPin::InitAllocator(ppAlloc);
- //debugLog<<"Base InitAlloc returns "<<locHR<<endl;
- return locHR;
-}
-
-HRESULT AbstractVideoDecodeOutputPin::SetMediaType(const CMediaType *pmt) {
- //debugLog<<"SETTING MEDIA TYPE"<<endl;
- HRESULT locHR = CBaseOutputPin::SetMediaType(pmt);
- //debugLog<<"ase SetMedia Type returns "<<locHR<<endl;
- return locHR;
-}
\ No newline at end of file
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "abstractVideodecodeoutputpin.h"
+
+AbstractVideoDecodeOutputPin::AbstractVideoDecodeOutputPin(AbstractVideoDecodeFilter* inParentFilter, CCritSec* inFilterLock, CHAR* inObjectName, LPCWSTR inPinDisplayName)
+ : CBaseOutputPin(inObjectName, inParentFilter, inFilterLock, &mHR, inPinDisplayName),
+ mParentFilter(inParentFilter)
+ , mDataQueue(NULL)
+{
+ //debugLog.open("g:\\logs\\absvidlog.log", ios_base::out|ios_base::binary);
+}
+AbstractVideoDecodeOutputPin::~AbstractVideoDecodeOutputPin(void)
+{
+ //debugLog.close();
+
+ delete mDataQueue;
+ mDataQueue = NULL;
+}
+
+STDMETHODIMP AbstractVideoDecodeOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
+ //debugLog<<"QueryInterface : {"<<riid.Data1<<"-"<<riid.Data2<<"-"<<riid.Data3<<"-"<<riid.Data4<<"}"<<endl;
+ if (riid == IID_IMediaSeeking) {
+ *ppv = (IMediaSeeking*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ }
+
+ return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
+}
+HRESULT AbstractVideoDecodeOutputPin::DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES* inPropertyRequest) {
+
+ //debugLog<<endl;
+
+
+ //FIX::: Abstract this out properly
+
+ //debugLog<<"Allocator is "<<(unsigned long)inAllocator<<endl;
+ //Our error variable
+ HRESULT locHR = S_OK;
+
+ //Create the structures for setproperties to use
+ ALLOCATOR_PROPERTIES locReqAlloc;
+ ALLOCATOR_PROPERTIES locActualAlloc;
+
+ //debugLog<<"DecideBufferSize : Requested :"<<endl;
+ //debugLog<<"DecideBufferSize : Align : "<<inPropertyRequest->cbAlign<<endl;
+ //debugLog<<"DecideBufferSize : BuffSize : "<<inPropertyRequest->cbBuffer<<endl;
+ //debugLog<<"DecideBufferSize : Prefix : "<<inPropertyRequest->cbPrefix<<endl;
+ //debugLog<<"DecideBufferSize : NumBuffs : "<<inPropertyRequest->cBuffers<<endl;
+
+
+ const unsigned long MIN_BUFFER_SIZE = 16*16; //What should this be ????
+ const unsigned long DEFAULT_BUFFER_SIZE = 1024*1024;
+ const unsigned long MIN_NUM_BUFFERS = 1;
+ const unsigned long DEFAULT_NUM_BUFFERS = 1;
+
+
+ //Validate and change what we have been requested to do.
+ //Allignment of data
+ if (inPropertyRequest->cbAlign <= 0) {
+ locReqAlloc.cbAlign = 1;
+ } else {
+ locReqAlloc.cbAlign = inPropertyRequest->cbAlign;
+ }
+
+ //Size of each buffer
+ if (inPropertyRequest->cbBuffer < MIN_BUFFER_SIZE) {
+ locReqAlloc.cbBuffer = DEFAULT_BUFFER_SIZE;
+ } else {
+ locReqAlloc.cbBuffer = inPropertyRequest->cbBuffer;
+ }
+
+ //How many prefeixed bytes
+ if (inPropertyRequest->cbPrefix < 0) {
+ locReqAlloc.cbPrefix = 0;
+ } else {
+ locReqAlloc.cbPrefix = inPropertyRequest->cbPrefix;
+ }
+
+ //Number of buffers in the allcoator
+ if (inPropertyRequest->cBuffers < MIN_NUM_BUFFERS) {
+ locReqAlloc.cBuffers = DEFAULT_NUM_BUFFERS;
+ } else {
+
+ locReqAlloc.cBuffers = inPropertyRequest->cBuffers;
+ }
+
+ //debugLog<<"DecideBufferSize : Modified Request :"<<endl;
+ //debugLog<<"DecideBufferSize : Align : "<<locReqAlloc.cbAlign<<endl;
+ //debugLog<<"DecideBufferSize : BuffSize : "<<locReqAlloc.cbBuffer<<endl;
+ //debugLog<<"DecideBufferSize : Prefix : "<<locReqAlloc.cbPrefix<<endl;
+ //debugLog<<"DecideBufferSize : NumBuffs : "<<locReqAlloc.cBuffers<<endl;
+
+
+ //Set the properties in the allocator
+ locHR = inAllocator->SetProperties(&locReqAlloc, &locActualAlloc);
+
+ //debugLog<<"DecideBufferSize : SetProperties returns "<<locHR<<endl;
+ //debugLog<<"DecideBufferSize : Actual Params :"<<endl;
+ //debugLog<<"DecideBufferSize : Align : "<<locActualAlloc.cbAlign<<endl;
+ //debugLog<<"DecideBufferSize : BuffSize : "<<locActualAlloc.cbBuffer<<endl;
+ //debugLog<<"DecideBufferSize : Prefix : "<<locActualAlloc.cbPrefix<<endl;
+ //debugLog<<"DecideBufferSize : NumBuffs : "<<locActualAlloc.cBuffers<<endl;
+
+ //Check the response
+ switch (locHR) {
+ case E_POINTER:
+ //debugLog<<"DecideBufferSize : SetProperties - NULL POINTER"<<endl;
+ return locHR;
+
+
+ case VFW_E_ALREADY_COMMITTED:
+ //debugLog<<"DecideBufferSize : SetProperties - Already COMMITED"<<endl;
+ return locHR;
+
+ case VFW_E_BADALIGN:
+ //debugLog<<"DecideBufferSize : SetProperties - Bad ALIGN"<<endl;
+ return locHR;
+
+ case VFW_E_BUFFERS_OUTSTANDING:
+ //debugLog<<"DecideBufferSize : SetProperties - BUFFS OUTSTANDING"<<endl;
+ return locHR;
+
+
+ case S_OK:
+
+ break;
+ default:
+ //debugLog<<"DecideBufferSize : SetProperties - UNKNOWN ERROR"<<endl;
+ break;
+
+ }
+
+
+ //TO DO::: Do we commit ?
+ //RESOLVED ::: Yep !
+
+ locHR = inAllocator->Commit();
+ //debugLog<<"DecideBufferSize : Commit Returned "<<locHR<<endl;
+
+
+ switch (locHR) {
+ case E_FAIL:
+ //debugLog<<"DecideBufferSize : Commit - FAILED "<<endl;
+ return locHR;
+ case E_POINTER:
+ //debugLog<<"DecideBufferSize : Commit - NULL POINTER "<<endl;
+ return locHR;
+ case E_INVALIDARG:
+ //debugLog<<"DecideBufferSize : Commit - INVALID ARG "<<endl;
+ return locHR;
+ case E_NOTIMPL:
+ //debugLog<<"DecideBufferSize : Commit - NOT IMPL"<<endl;
+ return locHR;
+ case S_OK:
+ //debugLog<<"DecideBufferSize : Commit - ** SUCCESS **"<<endl;
+ break;
+ default:
+ //debugLog<<"DecideBufferSize : Commit - UNKNOWN ERROR "<<endl;
+ return locHR;
+ }
+
+
+ return S_OK;
+}
+HRESULT AbstractVideoDecodeOutputPin::CheckMediaType(const CMediaType *inMediaType) {
+ //debugLog<<"CheckMediaType : "<<endl;
+ if ((inMediaType->majortype == MEDIATYPE_Video) && (inMediaType->subtype == MEDIASUBTYPE_YV12) && (inMediaType->formattype == FORMAT_VideoInfo)) {
+
+ //FIX::: SHould this stuff be in a check routine ??? Shouldn't it be in set mediatype ?
+
+ //debugLog << "CheckMediaType : Accepting..."<<endl;
+
+ VIDEOINFOHEADER* locVideoHeader = (VIDEOINFOHEADER*)inMediaType->Format();
+ //debugLog << "CheckMediaType : Height = " << locVideoHeader->bmiHeader.biHeight<<endl;
+ //debugLog << "CheckMediaType : Width = " << locVideoHeader->bmiHeader.biWidth<<endl;
+ //debugLog << "CheckMediaType : Size = "<<locVideoHeader->bmiHeader.biSizeImage<<endl<<endl;
+ //debugLog << "CheckMediaType : mHeight was = " << mParentFilter->mInputPin->mHeight<<endl;
+ //debugLog << "CheckMediaType : mWidth was = " << mParentFilter->mInputPin->mWidth<<endl<<endl;
+ //debugLog<<"CheckMediaType : Size was = "<<mParentFilter->mInputPin->mFrameSize<<endl<<endl;
+ mParentFilter->mInputPin->mHeight = (unsigned long)abs(locVideoHeader->bmiHeader.biHeight);
+ mParentFilter->mInputPin->mWidth = (unsigned long)abs(locVideoHeader->bmiHeader.biWidth);
+ mParentFilter->mInputPin->mFrameSize = (unsigned long)locVideoHeader->bmiHeader.biSizeImage;
+ //debugLog<<"CheckMediaType : SUCCESS"<<endl;
+
+ return S_OK;
+ } else {
+ //debugLog<<"CheckMediaType : FAILURE"<<endl;
+ return S_FALSE;
+ }
+
+}
+
+void AbstractVideoDecodeOutputPin::FillMediaType(CMediaType* outMediaType) {
+ outMediaType->SetType(&MEDIATYPE_Video);
+ outMediaType->SetSubtype(&MEDIASUBTYPE_YV12);
+ outMediaType->SetFormatType(&FORMAT_VideoInfo);
+ outMediaType->SetTemporalCompression(FALSE);
+ outMediaType->SetSampleSize(0);
+
+}
+HRESULT AbstractVideoDecodeOutputPin::GetMediaType(int inPosition, CMediaType *outMediaType) {
+
+ if (inPosition < 0) {
+ return E_INVALIDARG;
+ }
+
+ if (inPosition == 0) {
+ FillMediaType(outMediaType);
+ VIDEOINFOHEADER* locVideoFormat = (VIDEOINFOHEADER*)outMediaType->AllocFormatBuffer(sizeof(VIDEOINFOHEADER));
+ FillVideoInfoHeader(locVideoFormat);
+
+ //debugLog<<"Vid format size "<<locVideoFormat->bmiHeader.biSizeImage<<endl;
+ outMediaType->SetSampleSize(locVideoFormat->bmiHeader.biSizeImage);
+ //debugLog<<"Returning from GetMediaType"<<endl;
+ return S_OK;
+ } else {
+ return VFW_S_NO_MORE_ITEMS;
+ }
+}
+
+
+//Overriden for a data queue
+HRESULT AbstractVideoDecodeOutputPin::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
+{
+ //mPartialPacket = NULL;
+ //debugLog << "DeliverNewSegment: start"<<endl;
+ CBasePin::NewSegment(tStart, tStop, dRate);
+ mDataQueue->NewSegment(tStart, tStop, dRate);
+ //debugLog << "DeliverNewSegment: end"<<endl;
+
+ return S_OK;
+}
+HRESULT AbstractVideoDecodeOutputPin::DeliverEndOfStream(void)
+{
+ //debugLog << "DeliverEndOfStream: executed" << endl;
+ //mPartialPacket = NULL;
+ mDataQueue->EOS();
+ return S_OK;
+}
+
+HRESULT AbstractVideoDecodeOutputPin::DeliverEndFlush(void)
+{
+ //debugLog << "DeliverEndFlush" << endl;
+ mDataQueue->EndFlush();
+ return S_OK;
+}
+
+HRESULT AbstractVideoDecodeOutputPin::DeliverBeginFlush(void)
+{
+ //mPartialPacket = NULL;
+ //debugLog << "DeliverBeginFlush"<<endl;
+ mDataQueue->BeginFlush();
+ return S_OK;
+}
+
+HRESULT AbstractVideoDecodeOutputPin::CompleteConnect (IPin *inReceivePin)
+{
+ //debugLog<<"ComlpeteConnect"<<endl;
+ HRESULT locHR = S_OK;
+
+ //Here when another pin connects to us, we internally connect the seek delegate
+ // from this output pin onto the input pin... and we release it on breakconnect.
+ //
+ IMediaSeeking* locSeeker = NULL;
+ mParentFilter->mInputPin->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+ SetDelegate(locSeeker);
+ //
+ //This may cause issue if pins are disconnected and reconnected
+ //DELETE in DEStructor
+ mDataQueue = new COutputQueue (inReceivePin, &locHR, FALSE, TRUE, 1, TRUE, 15); //deleted in destructor
+ if (FAILED(locHR)) {
+ //debugLog<<"Creating Output Q failed."<<endl;
+ locHR = locHR;
+ }
+
+ return CBaseOutputPin::CompleteConnect(inReceivePin);
+}
+
+HRESULT AbstractVideoDecodeOutputPin::BreakConnect(void) {
+ //debugLog<<"Break Connect"<<endl;
+ //CAutoLock locLock(mFilterLock);
+ HRESULT locHR = CBaseOutputPin::BreakConnect();
+ //debugLog<<"Base BreakConnect returns "<<locHR<<endl;
+ ReleaseDelegate();
+ delete mDataQueue;
+ mDataQueue = NULL;
+ return locHR;
+}
+
+//Testing
+HRESULT AbstractVideoDecodeOutputPin::InitAllocator(IMemAllocator **ppAlloc) {
+ //debugLog<<"InitAllocator Called"<<endl;
+ HRESULT locHR = CBaseOutputPin::InitAllocator(ppAlloc);
+ //debugLog<<"Base InitAlloc returns "<<locHR<<endl;
+ return locHR;
+}
+
+HRESULT AbstractVideoDecodeOutputPin::SetMediaType(const CMediaType *pmt) {
+ //debugLog<<"SETTING MEDIA TYPE"<<endl;
+ HRESULT locHR = CBaseOutputPin::SetMediaType(pmt);
+ //debugLog<<"ase SetMedia Type returns "<<locHR<<endl;
+ return locHR;
+}
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeOutputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeOutputPin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeOutputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeOutputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,89 +1,90 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "abstractVideodllstuff.h"
-#include "BasicSeekable.h"
-#include <fstream>
-using namespace std;
-class AbstractVideoDecodeFilter;
-
-class ABS_VIDEO_DEC_API AbstractVideoDecodeOutputPin
- : public CBaseOutputPin
- , public BasicSeekable
-{
-public:
-
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
- friend class AbstractVideoDecodeInputPin;
- AbstractVideoDecodeOutputPin(AbstractVideoDecodeFilter* inParentFilter, CCritSec* inFilterLock, CHAR* inObjectName, LPCWSTR inPinDisplayName);
- virtual ~AbstractVideoDecodeOutputPin(void);
-
- virtual HRESULT DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES *inReqAllocProps);
- virtual HRESULT CheckMediaType(const CMediaType *inMediaType);
-
- //PURE VIRTUALS
- virtual bool FillVideoInfoHeader(VIDEOINFOHEADER* inFormatBuffer) = 0;
-
- virtual HRESULT GetMediaType(int inPosition, CMediaType *outMediaType);
-
- //Testing.,..
- virtual HRESULT InitAllocator(IMemAllocator **ppAlloc);
- virtual HRESULT SetMediaType(const CMediaType *pmt);
-
-
- virtual HRESULT BreakConnect(void);
- //Virtuals for data queue
-
- virtual HRESULT CompleteConnect (IPin *inReceivePin);
- virtual HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
- virtual HRESULT DeliverEndOfStream(void);
- virtual HRESULT DeliverEndFlush(void);
- virtual HRESULT DeliverBeginFlush(void);
-
-
-
- COutputQueue* mDataQueue;
-protected:
- HRESULT mHR;
- AbstractVideoDecodeFilter* mParentFilter;
- void FillMediaType(CMediaType* inMediaType);
-
- ////fstream debugLog;
-
-
-
- static const int BUFF_SIZE = 65536;
static const int BUFF_COUNT = 5;
-
-};
-
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "abstractVideodllstuff.h"
+#include "BasicSeekable.h"
+#include <fstream>
+using namespace std;
+class AbstractVideoDecodeFilter;
+
+class ABS_VIDEO_DEC_API AbstractVideoDecodeOutputPin
+ : public CBaseOutputPin
+ , public BasicSeekable
+{
+public:
+
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+ friend class AbstractVideoDecodeInputPin;
+ AbstractVideoDecodeOutputPin(AbstractVideoDecodeFilter* inParentFilter, CCritSec* inFilterLock, CHAR* inObjectName, LPCWSTR inPinDisplayName);
+ virtual ~AbstractVideoDecodeOutputPin(void);
+
+ virtual HRESULT DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES *inReqAllocProps);
+ virtual HRESULT CheckMediaType(const CMediaType *inMediaType);
+
+ //PURE VIRTUALS
+ virtual bool FillVideoInfoHeader(VIDEOINFOHEADER* inFormatBuffer) = 0;
+
+ virtual HRESULT GetMediaType(int inPosition, CMediaType *outMediaType);
+
+ //Testing.,..
+ virtual HRESULT InitAllocator(IMemAllocator **ppAlloc);
+ virtual HRESULT SetMediaType(const CMediaType *pmt);
+
+
+ virtual HRESULT BreakConnect(void);
+ //Virtuals for data queue
+
+ virtual HRESULT CompleteConnect (IPin *inReceivePin);
+ virtual HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
+ virtual HRESULT DeliverEndOfStream(void);
+ virtual HRESULT DeliverEndFlush(void);
+ virtual HRESULT DeliverBeginFlush(void);
+
+
+
+ COutputQueue* mDataQueue;
+protected:
+ HRESULT mHR;
+ AbstractVideoDecodeFilter* mParentFilter;
+ void FillMediaType(CMediaType* inMediaType);
+
+ ////fstream debugLog;
+
+
+
+ static const int BUFF_SIZE = 65536;
+ static const int BUFF_COUNT = 5;
+
+};
+
+
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/AbstractVideoDecodeOutputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/abstractvideodllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/abstractvideodllstuff.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/abstractvideodllstuff.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,52 +1,52 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include <streams.h>
-#include <pullpin.h>
-#include <initguid.h>
-
-
-#ifdef DSFABSTRACTOGGVIDEODECODER_EXPORTS
-#pragma message("----> Exporting from Abstract Video Library...")
-#define ABS_VIDEO_DEC_API __declspec(dllexport)
-#else
-#pragma message("<---- Importing from Abstract Video Library...")
-#define ABS_VIDEO_DEC_API __declspec(dllimport)
-#endif
-
-//Is this needed ??
-#ifdef LIBOOOGG_EXPORTS
-#define LIBOOOGG_API __declspec(dllexport)
-#else
-#define LIBOOOGG_API __declspec(dllimport)
-#endif
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include <streams.h>
+#include <pullpin.h>
+#include <initguid.h>
+
+
+#ifdef DSFABSTRACTOGGVIDEODECODER_EXPORTS
+#pragma message("----> Exporting from Abstract Video Library...")
+#define ABS_VIDEO_DEC_API __declspec(dllexport)
+#else
+#pragma message("<---- Importing from Abstract Video Library...")
+#define ABS_VIDEO_DEC_API __declspec(dllimport)
+#endif
+
+//Is this needed ??
+#ifdef LIBOOOGG_EXPORTS
+#define LIBOOOGG_API __declspec(dllexport)
+#else
+#define LIBOOOGG_API __declspec(dllimport)
+#endif
+
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/abstractvideodllstuff.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/dsfAbstractVideoDecoder.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/dsfAbstractVideoDecoder.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/dsfAbstractVideoDecoder.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,35 +1,35 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// dsfAbstractVideoDecoder.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// dsfAbstractVideoDecoder.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/dsfAbstractVideoDecoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,39 +1,39 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.cpp : source file that includes just the standard includes
-// dsfAbstractVideoDecoder.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.cpp : source file that includes just the standard includes
+// dsfAbstractVideoDecoder.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,46 +1,46 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include "abstractvideodllstuff.h"
-#include <windows.h>
-#include "AbstractVideoDecodeInputPin.h"
-#include "AbstractVideoDecodeOutputPin.h"
-#include "AbstractVideoDecodeFilter.h"
-// TODO: reference additional headers your program requires here
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include "abstractvideodllstuff.h"
+#include <windows.h>
+#include "AbstractVideoDecodeInputPin.h"
+#include "AbstractVideoDecodeOutputPin.h"
+#include "AbstractVideoDecodeFilter.h"
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoDecoder/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeFilter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeFilter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,82 +1,82 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "abstractvideoencodefilter.h"
-
-AbstractVideoEncodeFilter::AbstractVideoEncodeFilter(TCHAR* inFilterName, REFCLSID inFilterGUID, unsigned short inVideoFormat )
- : CBaseFilter(inFilterName, NULL,m_pLock, inFilterGUID),
- mVideoFormat(inVideoFormat)
-{
-
- m_pLock = new CCritSec;
-
-}
-
-AbstractVideoEncodeFilter::~AbstractVideoEncodeFilter(void)
-{
- delete m_pLock;
- DestroyPins();
-}
-
-void AbstractVideoEncodeFilter::DestroyPins() {
- delete mOutputPin;
- delete mInputPin;
-}
-
-STDMETHODIMP AbstractVideoEncodeFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
-
- return CBaseFilter::NonDelegatingQueryInterface(riid, ppv);
-}
-
-CBasePin* AbstractVideoEncodeFilter::GetPin(int inPinNo) {
- //FIX::: Errors here
- if (inPinNo < 0 ) {
- return NULL;
- } else if (inPinNo == 0) {
- return mInputPin;
- } else if (inPinNo == 1) {
- return mOutputPin;
- }
-}
-
-STDMETHODIMP AbstractVideoEncodeFilter::Stop() {
- CAutoLock locLock(m_pLock);
- mInputPin->ResetFrameCount();
- return CBaseFilter::Stop();
-}
-
-
-int AbstractVideoEncodeFilter::GetPinCount(void) {
- const long NUM_PINS = 2;
- return NUM_PINS;
-}
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "abstractvideoencodefilter.h"
+
+AbstractVideoEncodeFilter::AbstractVideoEncodeFilter(TCHAR* inFilterName, REFCLSID inFilterGUID, unsigned short inVideoFormat )
+ : CBaseFilter(inFilterName, NULL,m_pLock, inFilterGUID),
+ mVideoFormat(inVideoFormat)
+{
+
+ m_pLock = new CCritSec;
+
+}
+
+AbstractVideoEncodeFilter::~AbstractVideoEncodeFilter(void)
+{
+ delete m_pLock;
+ DestroyPins();
+}
+
+void AbstractVideoEncodeFilter::DestroyPins() {
+ delete mOutputPin;
+ delete mInputPin;
+}
+
+STDMETHODIMP AbstractVideoEncodeFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+
+ return CBaseFilter::NonDelegatingQueryInterface(riid, ppv);
+}
+
+CBasePin* AbstractVideoEncodeFilter::GetPin(int inPinNo) {
+ //FIX::: Errors here
+ if (inPinNo < 0 ) {
+ return NULL;
+ } else if (inPinNo == 0) {
+ return mInputPin;
+ } else if (inPinNo == 1) {
+ return mOutputPin;
+ }
+}
+
+STDMETHODIMP AbstractVideoEncodeFilter::Stop() {
+ CAutoLock locLock(m_pLock);
+ mInputPin->ResetFrameCount();
+ return CBaseFilter::Stop();
+}
+
+
+int AbstractVideoEncodeFilter::GetPinCount(void) {
+ const long NUM_PINS = 2;
+ return NUM_PINS;
+}
+
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeFilter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeFilter.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeFilter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeFilter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,80 +1,80 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "abstractvideoencoderdllstuff.h"
-#include "AbstractVideoEncodeInputPin.h"
-#include "AbstractVideoEncodeOutputPin.h"
-class ABS_VIDEO_ENC_API AbstractVideoEncodeFilter
- : public CBaseFilter
-
-{
-public:
- //Friend Classes
- friend class AbstractVideoEncodeInputPin;
- friend class AbstractVideoEncodeOutputPin;
-
- //Constructors
- AbstractVideoEncodeFilter(TCHAR* inFilterName, REFCLSID inFilterGUID, unsigned short inVideoFormat );
- virtual ~AbstractVideoEncodeFilter(void);
-
- //Constants and enumerations
- static const long NUM_PINS = 2;
- enum eVideoFormat {
- NONE = 0,
- THEORA = 100,
- DIRAC = 101,
- OTHER_VIDEO = 2000
- };
-
- //COM SETUP
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- //PURE VIRTUALS
- virtual bool ConstructPins() = 0;
- virtual void DestroyPins();
-
- //CBaseFilter overrides
- CBasePin* GetPin(int n);
- int GetPinCount(void);
-
- virtual STDMETHODIMP Stop();
-
-
- unsigned short mVideoFormat;
-
-protected:
-
- AbstractVideoEncodeInputPin* mInputPin;
- AbstractVideoEncodeOutputPin* mOutputPin;
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "abstractvideoencoderdllstuff.h"
+#include "AbstractVideoEncodeInputPin.h"
+#include "AbstractVideoEncodeOutputPin.h"
+class ABS_VIDEO_ENC_API AbstractVideoEncodeFilter
+ : public CBaseFilter
+
+{
+public:
+ //Friend Classes
+ friend class AbstractVideoEncodeInputPin;
+ friend class AbstractVideoEncodeOutputPin;
+
+ //Constructors
+ AbstractVideoEncodeFilter(TCHAR* inFilterName, REFCLSID inFilterGUID, unsigned short inVideoFormat );
+ virtual ~AbstractVideoEncodeFilter(void);
+
+ //Constants and enumerations
+ static const long NUM_PINS = 2;
+ enum eVideoFormat {
+ NONE = 0,
+ THEORA = 100,
+ DIRAC = 101,
+ OTHER_VIDEO = 2000
+ };
+
+ //COM SETUP
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ //PURE VIRTUALS
+ virtual bool ConstructPins() = 0;
+ virtual void DestroyPins();
+
+ //CBaseFilter overrides
+ CBasePin* GetPin(int n);
+ int GetPinCount(void);
+
+ virtual STDMETHODIMP Stop();
+
+
+ unsigned short mVideoFormat;
+
+protected:
+
+ AbstractVideoEncodeInputPin* mInputPin;
+ AbstractVideoEncodeOutputPin* mOutputPin;
+
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeFilter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeInputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeInputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,236 +1,236 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "abstractvideoencodeinputpin.h"
-
-AbstractVideoEncodeInputPin::AbstractVideoEncodeInputPin(AbstractVideoEncodeFilter* inParentFilter, CCritSec* inFilterLock, AbstractVideoEncodeOutputPin* inOutputPin, CHAR* inObjectName, LPCWSTR inPinDisplayName)
- : CBaseInputPin(inObjectName, inParentFilter, inFilterLock, &mHR, inPinDisplayName),
- mOutputPin(inOutputPin),
- mUptoFrame(0),
- mBegun(false),
- mParentFilter(inParentFilter)
- , mHeight(0)
- , mWidth(0)
-
-{
- //debugLog.open("C:\\temp\\aaein.log", ios_base::out);
- //ConstructCodec();
-
- //Set up the seeking path... this tells the output to deliver messages to this pin.
- IMediaSeeking* locSeeker = NULL;
- this->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
- mOutputPin->SetDelegate(locSeeker);
-
-}
-
-AbstractVideoEncodeInputPin::~AbstractVideoEncodeInputPin(void)
-{
- //debugLog.close();
- //DestroyCodec();
-}
-
-STDMETHODIMP AbstractVideoEncodeInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
- if (riid == IID_IMediaSeeking) {
- *ppv = (IMediaSeeking*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- }
-
- return CBaseInputPin::NonDelegatingQueryInterface(riid, ppv);
-}
-
-void AbstractVideoEncodeInputPin::ResetFrameCount() {
- mUptoFrame = 0;
-
-}
-bool AbstractVideoEncodeInputPin::SetSampleParams(IMediaSample* outMediaSample, unsigned long inDataSize, REFERENCE_TIME* inStartTime, REFERENCE_TIME* inEndTime)
-{
- outMediaSample->SetTime(inStartTime, inEndTime);
- outMediaSample->SetMediaTime(NULL, NULL);
- outMediaSample->SetActualDataLength(inDataSize);
- outMediaSample->SetPreroll(FALSE);
- outMediaSample->SetDiscontinuity(FALSE);
- outMediaSample->SetSyncPoint(TRUE);
- return true;
-}
-
-HRESULT AbstractVideoEncodeInputPin::CompleteConnect (IPin *inReceivePin) {
- CAutoLock locLock(m_pLock);
-
- //When another filters output pin connects to us, we redirect all outr seek messages to them.
- IMediaSeeking* locSeeker = NULL;
- inReceivePin->QueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
- SetDelegate(locSeeker);
- return CBaseInputPin::CompleteConnect(inReceivePin);
-}
-STDMETHODIMP AbstractVideoEncodeInputPin::Receive(IMediaSample* inSample) {
-
- //debugLog <<endl<< "Received sample..."<<endl;
- HRESULT locHR;
- BYTE* locBuff = NULL;
- locHR = inSample->GetPointer(&locBuff);
-
- if (FAILED(locHR)) {
- //debugLog << "Failed to get pointer... bailing out"<<endl;
- return locHR;
- } else {
- __int64 locTimeStart;
- __int64 locTimeEnd;
- inSample->GetTime(&locTimeStart, &locTimeEnd);
- inSample->GetMediaTime(&locTimeStart, &locTimeEnd);
- long locResult = encodeData(locBuff, inSample->GetActualDataLength());
- if (locResult >= 0) {
- //debugLog << "Encode Data returns 0... OK"<<endl;
- return S_OK;
- } else {
- //debugLog<< "Encode Data returns "<<locResult<<" FAILURE"<<endl;
- return S_FALSE;
- }
- }
-
- //debugLog<<"Receive falls through... returning OK"<<endl;
- return S_OK;
-}
-
-HRESULT AbstractVideoEncodeInputPin::CheckMediaType(const CMediaType *inMediaType) {
- //FIX::: Clean this up !
-
- if ( (inMediaType->majortype == MEDIATYPE_Video) &&
- ( inMediaType->subtype == MEDIASUBTYPE_YV12 ||
- inMediaType->subtype == MEDIASUBTYPE_IYUV ||
- inMediaType->subtype == MEDIASUBTYPE_YUY2 ||
- inMediaType->subtype == MEDIASUBTYPE_UYVY ||
- inMediaType->subtype == MEDIASUBTYPE_YVYU ||
- inMediaType->subtype == MEDIASUBTYPE_AYUV ||
- inMediaType->subtype == MEDIASUBTYPE_RGB32 ||
- inMediaType->subtype == MEDIASUBTYPE_RGB24
- ) &&
- (inMediaType->formattype == FORMAT_VideoInfo)
- )
- {
- return S_OK;
- } else {
- return S_FALSE;
- }
-}
-
-STDMETHODIMP AbstractVideoEncodeInputPin::EndOfStream(void) {
- return mParentFilter->mOutputPin->DeliverEndOfStream();
-}
-
-STDMETHODIMP AbstractVideoEncodeInputPin::BeginFlush() {
- CAutoLock locLock(m_pLock);
- CBaseInputPin::BeginFlush();
- return mParentFilter->mOutputPin->DeliverBeginFlush();
-}
-STDMETHODIMP AbstractVideoEncodeInputPin::EndFlush() {
- CAutoLock locLock(m_pLock);
- CBaseInputPin::EndFlush();
- return mParentFilter->mOutputPin->DeliverEndFlush();
-
-}
-
-STDMETHODIMP AbstractVideoEncodeInputPin::NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate) {
- return mParentFilter->mOutputPin->DeliverNewSegment(tStart, tStop, dRate);
-}
-
-HRESULT AbstractVideoEncodeInputPin::SetMediaType(const CMediaType* inMediaType) {
- //FIX:::Error checking
- //RESOLVED::: Bit better.
-
- if ( inMediaType->subtype == MEDIASUBTYPE_YV12 ||
- inMediaType->subtype == MEDIASUBTYPE_IYUV ||
- inMediaType->subtype == MEDIASUBTYPE_YUY2 ||
- inMediaType->subtype == MEDIASUBTYPE_UYVY ||
- inMediaType->subtype == MEDIASUBTYPE_YVYU ||
- inMediaType->subtype == MEDIASUBTYPE_AYUV ||
- inMediaType->subtype == MEDIASUBTYPE_RGB32 ||
- inMediaType->subtype == MEDIASUBTYPE_RGB24
- ) {
- mVideoFormat = (VIDEOINFOHEADER*)inMediaType->pbFormat;
- mPinInputType = *inMediaType;
- //mParentFilter->mAudioFormat = AbstractAudioDecodeFilter::VORBIS;
- } else {
- //Failed... should never be here !
- throw 0;
- }
- return CBaseInputPin::SetMediaType(inMediaType);
-}
-
-HRESULT AbstractVideoEncodeInputPin::GetMediaType(int inPosition, CMediaType *outMediaType) {
-
- if (inPosition < 0) {
- return E_INVALIDARG;
- }
-
- switch (inPosition) {
- case 0:
-
- outMediaType->SetType(&MEDIATYPE_Video);
- outMediaType->SetSubtype(&MEDIASUBTYPE_YV12);
- //Don't set the format data here. That's up to our output pin/
- return S_OK;
- case 1:
- outMediaType->SetType(&MEDIATYPE_Video);
- outMediaType->SetSubtype(&MEDIASUBTYPE_YUY2);
- return S_OK;
- case 2:
- outMediaType->SetType(&MEDIATYPE_Video);
- outMediaType->SetSubtype(&MEDIASUBTYPE_RGB32);
- return S_OK;
- case 3:
- outMediaType->SetType(&MEDIATYPE_Video);
- outMediaType->SetSubtype(&MEDIASUBTYPE_RGB24);
- return S_OK;
- case 4:
- outMediaType->SetType(&MEDIATYPE_Video);
- outMediaType->SetSubtype(&MEDIASUBTYPE_AYUV);
- return S_OK;
- case 5:
- outMediaType->SetType(&MEDIATYPE_Video);
- outMediaType->SetSubtype(&MEDIASUBTYPE_UYVY);
- return S_OK;
- case 6:
- outMediaType->SetType(&MEDIATYPE_Video);
- outMediaType->SetSubtype(&MEDIASUBTYPE_YVYU);
- return S_OK;
- case 7:
- outMediaType->SetType(&MEDIATYPE_Video);
- outMediaType->SetSubtype(&MEDIASUBTYPE_IYUV);
- return S_OK;
-
-
-
-
- default:
- return VFW_S_NO_MORE_ITEMS;
- }
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "abstractvideoencodeinputpin.h"
+
+AbstractVideoEncodeInputPin::AbstractVideoEncodeInputPin(AbstractVideoEncodeFilter* inParentFilter, CCritSec* inFilterLock, AbstractVideoEncodeOutputPin* inOutputPin, CHAR* inObjectName, LPCWSTR inPinDisplayName)
+ : CBaseInputPin(inObjectName, inParentFilter, inFilterLock, &mHR, inPinDisplayName),
+ mOutputPin(inOutputPin),
+ mUptoFrame(0),
+ mBegun(false),
+ mParentFilter(inParentFilter)
+ , mHeight(0)
+ , mWidth(0)
+
+{
+ //debugLog.open("C:\\temp\\aaein.log", ios_base::out);
+ //ConstructCodec();
+
+ //Set up the seeking path... this tells the output to deliver messages to this pin.
+ IMediaSeeking* locSeeker = NULL;
+ this->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+ mOutputPin->SetDelegate(locSeeker);
+
+}
+
+AbstractVideoEncodeInputPin::~AbstractVideoEncodeInputPin(void)
+{
+ //debugLog.close();
+ //DestroyCodec();
+}
+
+STDMETHODIMP AbstractVideoEncodeInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
+ if (riid == IID_IMediaSeeking) {
+ *ppv = (IMediaSeeking*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ }
+
+ return CBaseInputPin::NonDelegatingQueryInterface(riid, ppv);
+}
+
+void AbstractVideoEncodeInputPin::ResetFrameCount() {
+ mUptoFrame = 0;
+
+}
+bool AbstractVideoEncodeInputPin::SetSampleParams(IMediaSample* outMediaSample, unsigned long inDataSize, REFERENCE_TIME* inStartTime, REFERENCE_TIME* inEndTime)
+{
+ outMediaSample->SetTime(inStartTime, inEndTime);
+ outMediaSample->SetMediaTime(NULL, NULL);
+ outMediaSample->SetActualDataLength(inDataSize);
+ outMediaSample->SetPreroll(FALSE);
+ outMediaSample->SetDiscontinuity(FALSE);
+ outMediaSample->SetSyncPoint(TRUE);
+ return true;
+}
+
+HRESULT AbstractVideoEncodeInputPin::CompleteConnect (IPin *inReceivePin) {
+ CAutoLock locLock(m_pLock);
+
+ //When another filters output pin connects to us, we redirect all outr seek messages to them.
+ IMediaSeeking* locSeeker = NULL;
+ inReceivePin->QueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+ SetDelegate(locSeeker);
+ return CBaseInputPin::CompleteConnect(inReceivePin);
+}
+STDMETHODIMP AbstractVideoEncodeInputPin::Receive(IMediaSample* inSample) {
+
+ //debugLog <<endl<< "Received sample..."<<endl;
+ HRESULT locHR;
+ BYTE* locBuff = NULL;
+ locHR = inSample->GetPointer(&locBuff);
+
+ if (FAILED(locHR)) {
+ //debugLog << "Failed to get pointer... bailing out"<<endl;
+ return locHR;
+ } else {
+ __int64 locTimeStart;
+ __int64 locTimeEnd;
+ inSample->GetTime(&locTimeStart, &locTimeEnd);
+ inSample->GetMediaTime(&locTimeStart, &locTimeEnd);
+ long locResult = encodeData(locBuff, inSample->GetActualDataLength());
+ if (locResult >= 0) {
+ //debugLog << "Encode Data returns 0... OK"<<endl;
+ return S_OK;
+ } else {
+ //debugLog<< "Encode Data returns "<<locResult<<" FAILURE"<<endl;
+ return S_FALSE;
+ }
+ }
+
+ //debugLog<<"Receive falls through... returning OK"<<endl;
+ return S_OK;
+}
+
+HRESULT AbstractVideoEncodeInputPin::CheckMediaType(const CMediaType *inMediaType) {
+ //FIX::: Clean this up !
+
+ if ( (inMediaType->majortype == MEDIATYPE_Video) &&
+ ( inMediaType->subtype == MEDIASUBTYPE_YV12 ||
+ inMediaType->subtype == MEDIASUBTYPE_IYUV ||
+ inMediaType->subtype == MEDIASUBTYPE_YUY2 ||
+ inMediaType->subtype == MEDIASUBTYPE_UYVY ||
+ inMediaType->subtype == MEDIASUBTYPE_YVYU ||
+ inMediaType->subtype == MEDIASUBTYPE_AYUV ||
+ inMediaType->subtype == MEDIASUBTYPE_RGB32 ||
+ inMediaType->subtype == MEDIASUBTYPE_RGB24
+ ) &&
+ (inMediaType->formattype == FORMAT_VideoInfo)
+ )
+ {
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
+}
+
+STDMETHODIMP AbstractVideoEncodeInputPin::EndOfStream(void) {
+ return mParentFilter->mOutputPin->DeliverEndOfStream();
+}
+
+STDMETHODIMP AbstractVideoEncodeInputPin::BeginFlush() {
+ CAutoLock locLock(m_pLock);
+ CBaseInputPin::BeginFlush();
+ return mParentFilter->mOutputPin->DeliverBeginFlush();
+}
+STDMETHODIMP AbstractVideoEncodeInputPin::EndFlush() {
+ CAutoLock locLock(m_pLock);
+ CBaseInputPin::EndFlush();
+ return mParentFilter->mOutputPin->DeliverEndFlush();
+
+}
+
+STDMETHODIMP AbstractVideoEncodeInputPin::NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate) {
+ return mParentFilter->mOutputPin->DeliverNewSegment(tStart, tStop, dRate);
+}
+
+HRESULT AbstractVideoEncodeInputPin::SetMediaType(const CMediaType* inMediaType) {
+ //FIX:::Error checking
+ //RESOLVED::: Bit better.
+
+ if ( inMediaType->subtype == MEDIASUBTYPE_YV12 ||
+ inMediaType->subtype == MEDIASUBTYPE_IYUV ||
+ inMediaType->subtype == MEDIASUBTYPE_YUY2 ||
+ inMediaType->subtype == MEDIASUBTYPE_UYVY ||
+ inMediaType->subtype == MEDIASUBTYPE_YVYU ||
+ inMediaType->subtype == MEDIASUBTYPE_AYUV ||
+ inMediaType->subtype == MEDIASUBTYPE_RGB32 ||
+ inMediaType->subtype == MEDIASUBTYPE_RGB24
+ ) {
+ mVideoFormat = (VIDEOINFOHEADER*)inMediaType->pbFormat;
+ mPinInputType = *inMediaType;
+ //mParentFilter->mAudioFormat = AbstractAudioDecodeFilter::VORBIS;
+ } else {
+ //Failed... should never be here !
+ throw 0;
+ }
+ return CBaseInputPin::SetMediaType(inMediaType);
+}
+
+HRESULT AbstractVideoEncodeInputPin::GetMediaType(int inPosition, CMediaType *outMediaType) {
+
+ if (inPosition < 0) {
+ return E_INVALIDARG;
+ }
+
+ switch (inPosition) {
+ case 0:
+
+ outMediaType->SetType(&MEDIATYPE_Video);
+ outMediaType->SetSubtype(&MEDIASUBTYPE_YV12);
+ //Don't set the format data here. That's up to our output pin/
+ return S_OK;
+ case 1:
+ outMediaType->SetType(&MEDIATYPE_Video);
+ outMediaType->SetSubtype(&MEDIASUBTYPE_YUY2);
+ return S_OK;
+ case 2:
+ outMediaType->SetType(&MEDIATYPE_Video);
+ outMediaType->SetSubtype(&MEDIASUBTYPE_RGB32);
+ return S_OK;
+ case 3:
+ outMediaType->SetType(&MEDIATYPE_Video);
+ outMediaType->SetSubtype(&MEDIASUBTYPE_RGB24);
+ return S_OK;
+ case 4:
+ outMediaType->SetType(&MEDIATYPE_Video);
+ outMediaType->SetSubtype(&MEDIASUBTYPE_AYUV);
+ return S_OK;
+ case 5:
+ outMediaType->SetType(&MEDIATYPE_Video);
+ outMediaType->SetSubtype(&MEDIASUBTYPE_UYVY);
+ return S_OK;
+ case 6:
+ outMediaType->SetType(&MEDIATYPE_Video);
+ outMediaType->SetSubtype(&MEDIASUBTYPE_YVYU);
+ return S_OK;
+ case 7:
+ outMediaType->SetType(&MEDIATYPE_Video);
+ outMediaType->SetSubtype(&MEDIASUBTYPE_IYUV);
+ return S_OK;
+
+
+
+
+ default:
+ return VFW_S_NO_MORE_ITEMS;
+ }
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeInputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeInputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeInputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,97 +1,97 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "abstractvideoencoderdllstuff.h"
-//#include "AbstractVideoEncodeOutputPin.h"
-#include "AbstractVideoEncodeFilter.h"
-#include "BasicSeekable.h"
-class AbstractVideoEncodeOutputPin;
-class AbstractVideoEncodeFilter;
-class ABS_VIDEO_ENC_API AbstractVideoEncodeInputPin
- : public CBaseInputPin
- , public BasicSeekable
-{
-public:
- AbstractVideoEncodeInputPin(AbstractVideoEncodeFilter* inParentFilter, CCritSec* inFilterLock, AbstractVideoEncodeOutputPin* inOutputPin, CHAR* inObjectName, LPCWSTR inPinDisplayName);
- virtual ~AbstractVideoEncodeInputPin(void);
-
- static const short SIZE_16_BITS = 2;
- static const unsigned long HUNDRED_NANOS = 10000000;
- static const signed short SINT_MAX = 32767;
- static const signed short SINT_MIN = -32768;
-
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
-
- //PURE VIRTUALS
- virtual long encodeData(unsigned char* inBuf, long inNumBytes) = 0;
- virtual bool ConstructCodec() = 0;
- virtual void DestroyCodec() = 0;
-
-
- virtual HRESULT CompleteConnect (IPin *inReceivePin);
- STDMETHODIMP Receive(IMediaSample *pSample);
- virtual HRESULT CheckMediaType(const CMediaType *inMediaType);
- virtual HRESULT GetMediaType(int inPosition, CMediaType *outMediaType);
- virtual HRESULT SetMediaType(const CMediaType* inMediaType);
-
- virtual void ResetFrameCount();
-
- virtual STDMETHODIMP EndOfStream(void);
- virtual STDMETHODIMP BeginFlush();
- virtual STDMETHODIMP EndFlush();
- virtual STDMETHODIMP NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
-
-protected:
-
- virtual bool SetSampleParams(IMediaSample* outMediaSample, unsigned long inDataSize, REFERENCE_TIME* inStartTime, REFERENCE_TIME* inEndTime);
-
-
- HRESULT mHR;
- bool mBegun;
- AbstractVideoEncodeOutputPin* mOutputPin;
- __int64 mUptoFrame;
- AbstractVideoEncodeFilter* mParentFilter;
- CMediaType mPinInputType;
-
- //fstream debugLog;
- //unsigned long mFrameSize;
- //unsigned long mNumChannels;
- //unsigned long mSampleRate;
-
- VIDEOINFOHEADER* mVideoFormat;
- long mHeight;
- long mWidth;
-
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "abstractvideoencoderdllstuff.h"
+//#include "AbstractVideoEncodeOutputPin.h"
+#include "AbstractVideoEncodeFilter.h"
+#include "BasicSeekable.h"
+class AbstractVideoEncodeOutputPin;
+class AbstractVideoEncodeFilter;
+class ABS_VIDEO_ENC_API AbstractVideoEncodeInputPin
+ : public CBaseInputPin
+ , public BasicSeekable
+{
+public:
+ AbstractVideoEncodeInputPin(AbstractVideoEncodeFilter* inParentFilter, CCritSec* inFilterLock, AbstractVideoEncodeOutputPin* inOutputPin, CHAR* inObjectName, LPCWSTR inPinDisplayName);
+ virtual ~AbstractVideoEncodeInputPin(void);
+
+ static const short SIZE_16_BITS = 2;
+ static const unsigned long HUNDRED_NANOS = 10000000;
+ static const signed short SINT_MAX = 32767;
+ static const signed short SINT_MIN = -32768;
+
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+
+ //PURE VIRTUALS
+ virtual long encodeData(unsigned char* inBuf, long inNumBytes) = 0;
+ virtual bool ConstructCodec() = 0;
+ virtual void DestroyCodec() = 0;
+
+
+ virtual HRESULT CompleteConnect (IPin *inReceivePin);
+ STDMETHODIMP Receive(IMediaSample *pSample);
+ virtual HRESULT CheckMediaType(const CMediaType *inMediaType);
+ virtual HRESULT GetMediaType(int inPosition, CMediaType *outMediaType);
+ virtual HRESULT SetMediaType(const CMediaType* inMediaType);
+
+ virtual void ResetFrameCount();
+
+ virtual STDMETHODIMP EndOfStream(void);
+ virtual STDMETHODIMP BeginFlush();
+ virtual STDMETHODIMP EndFlush();
+ virtual STDMETHODIMP NewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
+
+protected:
+
+ virtual bool SetSampleParams(IMediaSample* outMediaSample, unsigned long inDataSize, REFERENCE_TIME* inStartTime, REFERENCE_TIME* inEndTime);
+
+
+ HRESULT mHR;
+ bool mBegun;
+ AbstractVideoEncodeOutputPin* mOutputPin;
+ __int64 mUptoFrame;
+ AbstractVideoEncodeFilter* mParentFilter;
+ CMediaType mPinInputType;
+
+ //fstream debugLog;
+ //unsigned long mFrameSize;
+ //unsigned long mNumChannels;
+ //unsigned long mSampleRate;
+
+ VIDEOINFOHEADER* mVideoFormat;
+ long mHeight;
+ long mWidth;
+
+
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeInputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeOutputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeOutputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeOutputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,192 +1,194 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "abstractvideoencodeoutputpin.h"
-
-AbstractVideoEncodeOutputPin::AbstractVideoEncodeOutputPin(AbstractVideoEncodeFilter* inParentFilter, CCritSec* inFilterLock, CHAR* inObjectName, LPCWSTR inPinDisplayName, CMediaType* inOutputMediaType)
- : CBaseOutputPin(inObjectName, inParentFilter, inFilterLock, &mHR, inPinDisplayName),
- mParentFilter(inParentFilter)
-
- , mDataQueue(NULL)
-{
- mOutputMediaType = inOutputMediaType;
-}
-AbstractVideoEncodeOutputPin::~AbstractVideoEncodeOutputPin(void)
-{
-
- delete mDataQueue;
-
-}
-
-STDMETHODIMP AbstractVideoEncodeOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
- if (riid == IID_IMediaSeeking) {
- *ppv = (IMediaSeeking*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- }
-
- return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
-}
-
-HRESULT AbstractVideoEncodeOutputPin::DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES* inPropertyRequest) {
-
//FIX::: Abstract this out properly
-
- HRESULT locHR = S_OK;
-
- //Create the structures for setproperties to use
- ALLOCATOR_PROPERTIES locReqAlloc;
- ALLOCATOR_PROPERTIES locActualAlloc;
-
- const unsigned long MIN_BUFFER_SIZE = 65536; //What should this be ????
- const unsigned long DEFAULT_BUFFER_SIZE = 1024*1024;
- const unsigned long MIN_NUM_BUFFERS = 3;
- const unsigned long DEFAULT_NUM_BUFFERS = 5;
-
-
- //Validate and change what we have been requested to do.
- //Allignment of data
- if (inPropertyRequest->cbAlign <= 0) {
- locReqAlloc.cbAlign = 1;
- } else {
- locReqAlloc.cbAlign = inPropertyRequest->cbAlign;
- }
-
- if (inPropertyRequest->cbBuffer < MIN_BUFFER_SIZE) {
- locReqAlloc.cbBuffer = DEFAULT_BUFFER_SIZE;
- } else {
- locReqAlloc.cbBuffer = inPropertyRequest->cbBuffer;
- }
-
- if (inPropertyRequest->cbPrefix < 0) {
- locReqAlloc.cbPrefix = 0;
- } else {
- locReqAlloc.cbPrefix = inPropertyRequest->cbPrefix;
- }
-
- if (inPropertyRequest->cBuffers < MIN_NUM_BUFFERS) {
- locReqAlloc.cBuffers = DEFAULT_NUM_BUFFERS;
- } else {
-
- locReqAlloc.cBuffers = inPropertyRequest->cBuffers;
- }
-
- locHR = inAllocator->SetProperties(&locReqAlloc, &locActualAlloc);
-
- if (locHR != S_OK) {
- return locHR;
- }
-
-
- locHR = inAllocator->Commit();
-
- return locHR;
-}
-HRESULT AbstractVideoEncodeOutputPin::CheckMediaType(const CMediaType *inMediaType) {
- if ( (inMediaType->majortype == MEDIATYPE_Video) &&
- (inMediaType->subtype == mOutputMediaType->subtype) && (inMediaType->formattype == mOutputMediaType->formattype)
- )
- {
- return S_OK;
- } else {
- return S_FALSE;
- }
-
-}
-
-HRESULT AbstractVideoEncodeOutputPin::GetMediaType(int inPosition, CMediaType *outMediaType) {
-
-
- if (inPosition < 0) {
- return E_INVALIDARG;
- }
-
- BYTE* locFormatBuffer = NULL;
- switch (inPosition) {
- case 0:
-
- outMediaType->SetType(&MEDIATYPE_Video);
- outMediaType->SetSubtype(&(mOutputMediaType->subtype));
- outMediaType->SetFormatType(&(mOutputMediaType->formattype));
- //FillFormatBuffer(outMediaType->pbformat);
- //
- locFormatBuffer = new BYTE[FormatBufferSize()];
- FillFormatBuffer(locFormatBuffer);
- outMediaType->SetFormat(locFormatBuffer, FormatBufferSize());
- delete locFormatBuffer;
- //
- return S_OK;
- default:
- return VFW_S_NO_MORE_ITEMS;
- }
-}
-
-
-
-
-
-HRESULT AbstractVideoEncodeOutputPin::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
-{
- //mPartialPacket = NULL;
- mDataQueue->NewSegment(tStart, tStop, dRate);
-
- return S_OK;
-}
-HRESULT AbstractVideoEncodeOutputPin::DeliverEndOfStream(void)
-{
- //mPartialPacket = NULL;
- mDataQueue->EOS();
- return S_OK;
-}
-
-HRESULT AbstractVideoEncodeOutputPin::DeliverEndFlush(void)
-{
- mDataQueue->EndFlush();
- return S_OK;
-}
-
-HRESULT AbstractVideoEncodeOutputPin::DeliverBeginFlush(void)
-{
- //mPartialPacket = NULL;
- mDataQueue->BeginFlush();
- return S_OK;
-}
-
-HRESULT AbstractVideoEncodeOutputPin::CompleteConnect (IPin *inReceivePin)
-{
- HRESULT locHR = S_OK;
- //DELETE in DEStructor
- mDataQueue = new COutputQueue (inReceivePin, &locHR, FALSE, TRUE, 1, TRUE, 25);
- if (FAILED(locHR)) {
- locHR = locHR;
- }
-
- return CBaseOutputPin::CompleteConnect(inReceivePin);
-}
\ No newline at end of file
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "abstractvideoencodeoutputpin.h"
+
+AbstractVideoEncodeOutputPin::AbstractVideoEncodeOutputPin(AbstractVideoEncodeFilter* inParentFilter, CCritSec* inFilterLock, CHAR* inObjectName, LPCWSTR inPinDisplayName, CMediaType* inOutputMediaType)
+ : CBaseOutputPin(inObjectName, inParentFilter, inFilterLock, &mHR, inPinDisplayName),
+ mParentFilter(inParentFilter)
+
+ , mDataQueue(NULL)
+{
+ mOutputMediaType = inOutputMediaType;
+}
+AbstractVideoEncodeOutputPin::~AbstractVideoEncodeOutputPin(void)
+{
+
+ delete mDataQueue;
+
+}
+
+STDMETHODIMP AbstractVideoEncodeOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv) {
+ if (riid == IID_IMediaSeeking) {
+ *ppv = (IMediaSeeking*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ }
+
+ return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
+}
+
+HRESULT AbstractVideoEncodeOutputPin::DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES* inPropertyRequest) {
+
+
+ //FIX::: Abstract this out properly
+
+ HRESULT locHR = S_OK;
+
+ //Create the structures for setproperties to use
+ ALLOCATOR_PROPERTIES locReqAlloc;
+ ALLOCATOR_PROPERTIES locActualAlloc;
+
+ const unsigned long MIN_BUFFER_SIZE = 65536; //What should this be ????
+ const unsigned long DEFAULT_BUFFER_SIZE = 1024*1024;
+ const unsigned long MIN_NUM_BUFFERS = 3;
+ const unsigned long DEFAULT_NUM_BUFFERS = 5;
+
+
+ //Validate and change what we have been requested to do.
+ //Allignment of data
+ if (inPropertyRequest->cbAlign <= 0) {
+ locReqAlloc.cbAlign = 1;
+ } else {
+ locReqAlloc.cbAlign = inPropertyRequest->cbAlign;
+ }
+
+ if (inPropertyRequest->cbBuffer < MIN_BUFFER_SIZE) {
+ locReqAlloc.cbBuffer = DEFAULT_BUFFER_SIZE;
+ } else {
+ locReqAlloc.cbBuffer = inPropertyRequest->cbBuffer;
+ }
+
+ if (inPropertyRequest->cbPrefix < 0) {
+ locReqAlloc.cbPrefix = 0;
+ } else {
+ locReqAlloc.cbPrefix = inPropertyRequest->cbPrefix;
+ }
+
+ if (inPropertyRequest->cBuffers < MIN_NUM_BUFFERS) {
+ locReqAlloc.cBuffers = DEFAULT_NUM_BUFFERS;
+ } else {
+
+ locReqAlloc.cBuffers = inPropertyRequest->cBuffers;
+ }
+
+ locHR = inAllocator->SetProperties(&locReqAlloc, &locActualAlloc);
+
+ if (locHR != S_OK) {
+ return locHR;
+ }
+
+
+ locHR = inAllocator->Commit();
+
+ return locHR;
+}
+HRESULT AbstractVideoEncodeOutputPin::CheckMediaType(const CMediaType *inMediaType) {
+ if ( (inMediaType->majortype == MEDIATYPE_Video) &&
+ (inMediaType->subtype == mOutputMediaType->subtype) && (inMediaType->formattype == mOutputMediaType->formattype)
+ )
+ {
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
+
+}
+
+HRESULT AbstractVideoEncodeOutputPin::GetMediaType(int inPosition, CMediaType *outMediaType) {
+
+
+ if (inPosition < 0) {
+ return E_INVALIDARG;
+ }
+
+ BYTE* locFormatBuffer = NULL;
+ switch (inPosition) {
+ case 0:
+
+ outMediaType->SetType(&MEDIATYPE_Video);
+ outMediaType->SetSubtype(&(mOutputMediaType->subtype));
+ outMediaType->SetFormatType(&(mOutputMediaType->formattype));
+ //FillFormatBuffer(outMediaType->pbformat);
+ //
+ locFormatBuffer = new BYTE[FormatBufferSize()];
+ FillFormatBuffer(locFormatBuffer);
+ outMediaType->SetFormat(locFormatBuffer, FormatBufferSize());
+ delete locFormatBuffer;
+ //
+ return S_OK;
+ default:
+ return VFW_S_NO_MORE_ITEMS;
+ }
+}
+
+
+
+
+
+HRESULT AbstractVideoEncodeOutputPin::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
+{
+ //mPartialPacket = NULL;
+ mDataQueue->NewSegment(tStart, tStop, dRate);
+
+ return S_OK;
+}
+HRESULT AbstractVideoEncodeOutputPin::DeliverEndOfStream(void)
+{
+ //mPartialPacket = NULL;
+ mDataQueue->EOS();
+ return S_OK;
+}
+
+HRESULT AbstractVideoEncodeOutputPin::DeliverEndFlush(void)
+{
+ mDataQueue->EndFlush();
+ return S_OK;
+}
+
+HRESULT AbstractVideoEncodeOutputPin::DeliverBeginFlush(void)
+{
+ //mPartialPacket = NULL;
+ mDataQueue->BeginFlush();
+ return S_OK;
+}
+
+HRESULT AbstractVideoEncodeOutputPin::CompleteConnect (IPin *inReceivePin)
+{
+ HRESULT locHR = S_OK;
+ //DELETE in DEStructor
+ mDataQueue = new COutputQueue (inReceivePin, &locHR, FALSE, TRUE, 1, TRUE, 25);
+ if (FAILED(locHR)) {
+ locHR = locHR;
+ }
+
+ return CBaseOutputPin::CompleteConnect(inReceivePin);
+}
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeOutputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeOutputPin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeOutputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeOutputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,74 +1,75 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "abstractvideoencoderdllstuff.h"
-#include "AbstractVideoEncodeFilter.h"
-#include "BasicSeekable.h"
-class AbstractVideoEncodeFilter;
-class ABS_VIDEO_ENC_API AbstractVideoEncodeOutputPin
- : public CBaseOutputPin
- , public BasicSeekable
-{
-public:
- AbstractVideoEncodeOutputPin(AbstractVideoEncodeFilter* inParentFilter, CCritSec* inFilterLock, CHAR* inObjectName, LPCWSTR inPinDisplayName, CMediaType* inOutputMediaType);
- virtual ~AbstractVideoEncodeOutputPin(void);
-
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- virtual HRESULT DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES *inReqAllocProps);
- virtual HRESULT CheckMediaType(const CMediaType *inMediaType);
-
- //PURE VIRTUALS
- virtual bool FillFormatBuffer(BYTE* inFormatBuffer) = 0;
- virtual unsigned long FormatBufferSize() = 0;
-
- virtual HRESULT GetMediaType(int inPosition, CMediaType *outMediaType);
-
-
- //Virtuals for data queue
- virtual HRESULT CompleteConnect (IPin *inReceivePin);
- virtual HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
- virtual HRESULT DeliverEndOfStream(void);
- virtual HRESULT DeliverEndFlush(void);
- virtual HRESULT DeliverBeginFlush(void);
-
- COutputQueue* mDataQueue;
-protected:
- HRESULT mHR;
- AbstractVideoEncodeFilter* mParentFilter;
- void FillMediaType(CMediaType* inMediaType);
-
- CMediaType* mOutputMediaType;
-
- static const int BUFF_SIZE = 65536;
static const int BUFF_COUNT = 5;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "abstractvideoencoderdllstuff.h"
+#include "AbstractVideoEncodeFilter.h"
+#include "BasicSeekable.h"
+class AbstractVideoEncodeFilter;
+class ABS_VIDEO_ENC_API AbstractVideoEncodeOutputPin
+ : public CBaseOutputPin
+ , public BasicSeekable
+{
+public:
+ AbstractVideoEncodeOutputPin(AbstractVideoEncodeFilter* inParentFilter, CCritSec* inFilterLock, CHAR* inObjectName, LPCWSTR inPinDisplayName, CMediaType* inOutputMediaType);
+ virtual ~AbstractVideoEncodeOutputPin(void);
+
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ virtual HRESULT DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES *inReqAllocProps);
+ virtual HRESULT CheckMediaType(const CMediaType *inMediaType);
+
+ //PURE VIRTUALS
+ virtual bool FillFormatBuffer(BYTE* inFormatBuffer) = 0;
+ virtual unsigned long FormatBufferSize() = 0;
+
+ virtual HRESULT GetMediaType(int inPosition, CMediaType *outMediaType);
+
+
+ //Virtuals for data queue
+ virtual HRESULT CompleteConnect (IPin *inReceivePin);
+ virtual HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
+ virtual HRESULT DeliverEndOfStream(void);
+ virtual HRESULT DeliverEndFlush(void);
+ virtual HRESULT DeliverBeginFlush(void);
+
+ COutputQueue* mDataQueue;
+protected:
+ HRESULT mHR;
+ AbstractVideoEncodeFilter* mParentFilter;
+ void FillMediaType(CMediaType* inMediaType);
+
+ CMediaType* mOutputMediaType;
+
+ static const int BUFF_SIZE = 65536;
+ static const int BUFF_COUNT = 5;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/AbstractVideoEncodeOutputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/abstractvideoencoderdllstuff.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/abstractvideoencoderdllstuff.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/abstractvideoencoderdllstuff.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,33 +1,33 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "abstractvideoencoderdllstuff.h"
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "abstractvideoencoderdllstuff.h"
+
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/abstractvideoencoderdllstuff.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/abstractvideoencoderdllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/abstractvideoencoderdllstuff.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/abstractvideoencoderdllstuff.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,55 +1,55 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-
-// The following ifdef block is the standard way of creating macros which make exporting
-// from a DLL simpler. All files within this DLL are compiled with the DSFABSTRACTAUDIOENCODER_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see
-// DSFABSTRACTAUDIOENCODER_API functions as being imported from a DLL, whereas this DLL sees symbols
-// defined with this macro as being exported.
-#pragma once
-#include <streams.h>
-#include <pullpin.h>
-#include <initguid.h>
-#ifdef DSFABSTRACTVIDEOENCODER_EXPORTS
-#define ABS_VIDEO_ENC_API __declspec(dllexport)
-#else
-#define ABS_VIDEO_ENC_API __declspec(dllimport)
-#endif
-
-//Is this needed ??
-#ifdef LIBOOOGG_EXPORTS
-#define LIBOOOGG_API __declspec(dllexport)
-#else
-#define LIBOOOGG_API __declspec(dllimport)
-#endif
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+
+// The following ifdef block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the DSFABSTRACTAUDIOENCODER_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// DSFABSTRACTAUDIOENCODER_API functions as being imported from a DLL, whereas this DLL sees symbols
+// defined with this macro as being exported.
+#pragma once
+#include <streams.h>
+#include <pullpin.h>
+#include <initguid.h>
+#ifdef DSFABSTRACTVIDEOENCODER_EXPORTS
+#define ABS_VIDEO_ENC_API __declspec(dllexport)
+#else
+#define ABS_VIDEO_ENC_API __declspec(dllimport)
+#endif
+
+//Is this needed ??
+#ifdef LIBOOOGG_EXPORTS
+#define LIBOOOGG_API __declspec(dllexport)
+#else
+#define LIBOOOGG_API __declspec(dllimport)
+#endif
+
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/abstractvideoencoderdllstuff.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/dsfAbstractVideoEncoder.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/dsfAbstractVideoEncoder.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/dsfAbstractVideoEncoder.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,12 +1,12 @@
-// dsfAbstractVideoEncoder.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- return TRUE;
-}
-
+// dsfAbstractVideoEncoder.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ return TRUE;
+}
+
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/dsfAbstractVideoEncoder.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,39 +1,39 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.cpp : source file that includes just the standard includes
-// dsfAbstractVideoEncoder.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.cpp : source file that includes just the standard includes
+// dsfAbstractVideoEncoder.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,43 +1,43 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-// TODO: reference additional headers your program requires here
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAbstractVideoEncoder/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourceFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourceFilter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourceFilter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,107 +1,107 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2003, 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "anxdemuxsourcefilter.h"
-
-
-//-------------------
-// This template lets the Object factory create us properly and work with COM infrastructure.
-CFactoryTemplate g_Templates[] =
-{
- {
- L"AnxDemuxFilter", // Name
- &CLSID_AnxDemuxSourceFilter, // CLSID
- AnxDemuxSourceFilter::CreateInstance, // Method to create an instance of MyComponent
- NULL, // Initialization function
- NULL // Set-up information (for filters)
- }
-
-};
-
-// Generic way of determining the number of items in the template
-int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
-
-
-
-CUnknown* WINAPI AnxDemuxSourceFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
-{
- AnxDemuxSourceFilter *pNewObject = new AnxDemuxSourceFilter();
- if (pNewObject == NULL) {
- *pHr = E_OUTOFMEMORY;
- }
- return pNewObject;
-}
-AnxDemuxSourceFilter::AnxDemuxSourceFilter(void)
- : OggDemuxSourceFilter(CLSID_AnxDemuxSourceFilter)
-{
- mStreamMapper = new AnxStreamMapper(this);
- //anxDebug.open("G:\\logs\\anxdemux.log", ios_base::out);
-}
-
-AnxDemuxSourceFilter::~AnxDemuxSourceFilter(void)
-{
- //anxDebug<<"Deconstructing anx filter"<<endl;
-}
-
-
-//ANX::: Seek table will need modifying to handle this.
-STDMETHODIMP AnxDemuxSourceFilter::Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType) {
- //Initialise the file here and setup all the streams
- CAutoLock locLock(m_pLock);
-
-
- mFileName = inFileName;
-
- //WARNING::: This nasty hack is to account for the fact that directshow doesn't know how to
- // properly parse url's given to it... because it does a dumb string match for extension at the end of the file,
- // urls with fragments or queries, won't match the extension... so this hack is for the ff plug-in so
- // that it appends another .anx after the fragment/query, which is stripped off here, before sending to the
- // server.
- if (mFileName.find(L"?") != string::npos){
- mFileName = mFileName.substr(0, mFileName.size() - 4);
-
- }
-
-
-
- //ANX::: Needs to override ??? Or just modify the seeker.
- mSeekTable = new AutoAnxSeekTable(StringHelper::toNarrowStr(mFileName));
-
- //anxDebug<<"After seek table instantiation"<<endl;
- mSeekTable->buildTable();
- //anxDebug<<"After build table..."<<endl;
- //debugLog<<"After build table"<<endl;
- return SetUpPins();
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "anxdemuxsourcefilter.h"
+
+
+//-------------------
+// This template lets the Object factory create us properly and work with COM infrastructure.
+CFactoryTemplate g_Templates[] =
+{
+ {
+ L"AnxDemuxFilter", // Name
+ &CLSID_AnxDemuxSourceFilter, // CLSID
+ AnxDemuxSourceFilter::CreateInstance, // Method to create an instance of MyComponent
+ NULL, // Initialization function
+ NULL // Set-up information (for filters)
+ }
+
+};
+
+// Generic way of determining the number of items in the template
+int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
+
+
+
+CUnknown* WINAPI AnxDemuxSourceFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
+{
+ AnxDemuxSourceFilter *pNewObject = new AnxDemuxSourceFilter();
+ if (pNewObject == NULL) {
+ *pHr = E_OUTOFMEMORY;
+ }
+ return pNewObject;
+}
+AnxDemuxSourceFilter::AnxDemuxSourceFilter(void)
+ : OggDemuxSourceFilter(CLSID_AnxDemuxSourceFilter)
+{
+ mStreamMapper = new AnxStreamMapper(this);
+ //anxDebug.open("G:\\logs\\anxdemux.log", ios_base::out);
+}
+
+AnxDemuxSourceFilter::~AnxDemuxSourceFilter(void)
+{
+ //anxDebug<<"Deconstructing anx filter"<<endl;
+}
+
+
+//ANX::: Seek table will need modifying to handle this.
+STDMETHODIMP AnxDemuxSourceFilter::Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType) {
+ //Initialise the file here and setup all the streams
+ CAutoLock locLock(m_pLock);
+
+
+ mFileName = inFileName;
+
+ //WARNING::: This nasty hack is to account for the fact that directshow doesn't know how to
+ // properly parse url's given to it... because it does a dumb string match for extension at the end of the file,
+ // urls with fragments or queries, won't match the extension... so this hack is for the ff plug-in so
+ // that it appends another .anx after the fragment/query, which is stripped off here, before sending to the
+ // server.
+ if (mFileName.find(L"?") != string::npos){
+ mFileName = mFileName.substr(0, mFileName.size() - 4);
+
+ }
+
+
+
+ //ANX::: Needs to override ??? Or just modify the seeker.
+ mSeekTable = new AutoAnxSeekTable(StringHelper::toNarrowStr(mFileName));
+
+ //anxDebug<<"After seek table instantiation"<<endl;
+ mSeekTable->buildTable();
+ //anxDebug<<"After build table..."<<endl;
+ //debugLog<<"After build table"<<endl;
+ return SetUpPins();
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourceFilter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourceFilter.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourceFilter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourceFilter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,60 +1,60 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2003, 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "anxdllstuff.h"
-#include "OggDemuxSourceFilter.h"
-#include "AutoAnxSeekTable.h"
-#include "AnxStreamMapper.h"
-#include "CMMLStream.h"
-#include <fstream>
-using namespace std;
-
-class OggDemuxSourceFilter;
-
-class AnxDemuxSourceFilter
- : public OggDemuxSourceFilter
-{
-public:
- friend class CMMLStream;
- AnxDemuxSourceFilter(void);
- virtual ~AnxDemuxSourceFilter(void);
-
- static CUnknown* WINAPI AnxDemuxSourceFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
-
- STDMETHODIMP Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType);
-
-protected:
- //fstream anxDebug;
-};
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "anxdllstuff.h"
+#include "OggDemuxSourceFilter.h"
+#include "AutoAnxSeekTable.h"
+#include "AnxStreamMapper.h"
+#include "CMMLStream.h"
+#include <fstream>
+using namespace std;
+
+class OggDemuxSourceFilter;
+
+class AnxDemuxSourceFilter
+ : public OggDemuxSourceFilter
+{
+public:
+ friend class CMMLStream;
+ AnxDemuxSourceFilter(void);
+ virtual ~AnxDemuxSourceFilter(void);
+
+ static CUnknown* WINAPI AnxDemuxSourceFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+
+ STDMETHODIMP Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType);
+
+protected:
+ //fstream anxDebug;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourceFilter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourcePin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourcePin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourcePin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,11 +1,11 @@
-#include "StdAfx.h"
-#include "anxdemuxsourcepin.h"
-
-AnxDemuxSourcePin::AnxDemuxSourcePin(AnxDemuxSourceFilter* inParentFilter, CCritSec* inLock)
- : OggDemuxSourcePin(NAME("AnxDemuxSourcePin"), inParentFilter,
-{
-}
-
-AnxDemuxSourcePin::~AnxDemuxSourcePin(void)
-{
-}
+#include "StdAfx.h"
+#include "anxdemuxsourcepin.h"
+
+AnxDemuxSourcePin::AnxDemuxSourcePin(AnxDemuxSourceFilter* inParentFilter, CCritSec* inLock)
+ : OggDemuxSourcePin(NAME("AnxDemuxSourcePin"), inParentFilter,
+{
+}
+
+AnxDemuxSourcePin::~AnxDemuxSourcePin(void)
+{
+}
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourcePin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourcePin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourcePin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourcePin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,10 +1,10 @@
-#pragma once
-#include "anxdllstuff.h"
-#include "OggDemuxSourcePin.h"
-class AnxDemuxSourcePin
- : public OggDemuxSourcePin
-{
-public:
- AnxDemuxSourcePin(void);
- ~AnxDemuxSourcePin(void);
-};
+#pragma once
+#include "anxdllstuff.h"
+#include "OggDemuxSourcePin.h"
+class AnxDemuxSourcePin
+ : public OggDemuxSourcePin
+{
+public:
+ AnxDemuxSourcePin(void);
+ ~AnxDemuxSourcePin(void);
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxDemuxSourcePin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxStreamMapper.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxStreamMapper.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxStreamMapper.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,400 +1,400 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2003, 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "anxstreammapper.h"
-
-AnxStreamMapper::AnxStreamMapper(OggDemuxSourceFilter* inOwningFilter)
- : OggStreamMapper(inOwningFilter)
- , mAnnodexSerial(0)
- , mSeenAnnodexBOS(false)
- , mReadyForCodecs(false)
- , mSeenCMML(false)
- , mDemuxState(eAnxDemuxState::SEEN_NOTHING)
- , mAnxVersion(0)
- , mAnnodexHeader(NULL)
-{
-
- //debugLog.open("G:\\logs\\anxmapper.log", ios_base::out);
-}
-
-AnxStreamMapper::~AnxStreamMapper(void)
-{
- //debugLog.close();
-}
-
-bool AnxStreamMapper::isReady() {
- bool retVal = true;
- bool locWasAny = false;
- //Use 1 instead of 0... cmml is always ready and terminates the graph creation early.
- //We want to know when everything else is ready.
-
- //XXXXXXXXXXXXXX:::: Big dirty hack to deal with badly ordered header packets !!
- //=======================================================================
- //The side effect is... a file will hang if it has unknown streams.
- //=======================================================================
- if (mSeenStreams.size() == 0) {
- retVal = true;
- } else {
- retVal = false;
- }
-
- for (unsigned long i = 1; i < mStreamList.size(); i++) {
- locWasAny = true;
- retVal = retVal && mStreamList[i]->streamReady();
- //debugLog<<"Stream "<<i<<" ";
- if (retVal) {
- //debugLog<<"READY !!!!!!"<<endl;
- } else {
- //debugLog<<"NOT READY !!!!"<<endl;
- }
- }
- //=======================================================================
- if (locWasAny && retVal) {
- //debugLog<<"Streams READY"<<endl;
- } else {
- //debugLog<<"Streams NOT READY"<<endl;
- }
- return locWasAny && retVal;
-}
-
-bool AnxStreamMapper::isAnnodexEOS(OggPage* inOggPage) {
- if ((inOggPage->header()->StreamSerialNo() == mAnnodexSerial) &&
- (inOggPage->header()->isEOS())) {
- return true;
- } else {
- return false;
- }
-
-}
-bool AnxStreamMapper::isAnnodexBOS(OggPage* inOggPage) {
- if ((inOggPage->numPackets() != 1) ||
- (inOggPage->getPacket(0)->packetSize() < 12) ||
- (strncmp((const char*)inOggPage->getPacket(0)->packetData(), "Annodex\0", 8) != 0) ||
- (!inOggPage->header()->isBOS())) {
- return false;
- } else {
- return true;
- }
-}
-
-bool AnxStreamMapper::isAnxDataPage(OggPage* inOggPage, bool inAnxDataAreBOS) {
-
- //isBOS inAnxDataAreBOS isValid
- //
- //true true true
- //true false false
- //false true false
- //false false true
- if ((inOggPage->numPackets() != 1) ||
- (inOggPage->getPacket(0)->packetSize() < 12) ||
- (strncmp((const char*)inOggPage->getPacket(0)->packetData(), "AnxData\0", 8) != 0) ||
-
- ( (inOggPage->header()->isBOS()) != inAnxDataAreBOS )) {
- return false;
- } else {
- return true;
- }
-}
-/**
- * Returns a 32 number indicating the version... major<<16 + minor
- */
-unsigned long AnxStreamMapper::getAnxVersion(OggPage* inOggPage) {
- if (isAnnodexBOS(inOggPage)) {
- //8 and 10 are the offsets into the header for version number.
- return ((iLE_Math::charArrToUShort(inOggPage->getPacket(0)->packetData() + 8)) << 16) + iLE_Math::charArrToUShort(inOggPage->getPacket(0)->packetData() + 10);
- } else {
- return 0;
- }
-
-
-
-}
-
-bool AnxStreamMapper::handleAnxVersion_2_0(OggPage* inOggPage) {
- // LEAK::: Check memory deleting.
- const bool ANXDATA_ARE_BOS = true;
-
- bool locTemp = false;
-
- vector<unsigned long>::iterator it;
- int i = 0;
- switch (mDemuxState) {
- case SEEN_NOTHING:
- //debugLog<<"SEEN_NOTHING"<<endl;
- //We must find an annodex BOS page.
- if (!isAnnodexBOS(inOggPage)) {
- mDemuxState = INVALID_STATE;
- delete inOggPage;
- return false;
- } else {
- delete mAnnodexHeader;
- mAnnodexHeader = inOggPage->getPacket(0)->clone();
- mAnnodexSerial = inOggPage->header()->StreamSerialNo();
- mDemuxState = SEEN_ANNODEX_BOS;
- return true;
- }
- break; //Can never be here.
-
- case SEEN_ANNODEX_BOS:
- //debugLog<<"SEEN_ANNODEX_BOS"<<endl;
- //We should be getting Anxdata headers here.
- if (!isAnxDataPage(inOggPage, ANXDATA_ARE_BOS)) {
- mDemuxState = INVALID_STATE;
- return false;
- } else {
- //This should be the CMML AnxData header.
- mSeenStreams.clear();
- mAnxDataHeaders.clear();
- //mSeenStreams.push_back(inOggPage->header()->StreamSerialNo());
- mAnxDataHeaders.push_back(inOggPage->getPacket(0)->clone());
- mDemuxState = SEEN_AN_ANXDATA;
-
-
- //Add the CMML Stream
- OggStream* locStream = new CMMLStream(inOggPage, mOwningFilter, true); //The page is only given for viewing
- if (locStream != NULL) {
- //debugLog<<"Adding CMML Stream"<<endl;
- mStreamList.push_back(locStream);
- }
-
- return true;
- }
-
-
- break; //Can never be here.
-
- case SEEN_AN_ANXDATA:
- //debugLog<<"SEEN_AN_ANXDATA"<<endl;
- if (isAnnodexEOS(inOggPage)) {
- //This is the end of the stream headers.
- mDemuxState = OGG_STATE;
- //debugLog<<"Found an Annodex EOS... transitioning."<<endl;
- return true;
- } else if (isAnxDataPage(inOggPage, ANXDATA_ARE_BOS)) {
- //handle another anxdata page.
- //debugLog<<"Found another anxdata..."<<endl;
- mSeenStreams.push_back(inOggPage->header()->StreamSerialNo());
- mAnxDataHeaders.push_back(inOggPage->getPacket(0)->clone());
- mDemuxState = SEEN_AN_ANXDATA;
- return true;
- } else {
- mDemuxState = INVALID_STATE;
- return false;
- //Invalid.
- }
- break;
- case OGG_STATE:
- //debugLog<<"OGG_STATE"<<endl;
- //We've seen the annodex EOS... so we can proceed as if it's a normal ogg file.
- // The CMML stream is already made.
-
- for(i = 0, it = mSeenStreams.begin(); it != mSeenStreams.end(); i++, ++it) {
-
- if (mSeenStreams[i] == inOggPage->header()->StreamSerialNo()) {
- //If the page is a BOS we need to start a new stream
- const bool ALLOW_OTHERS_TO_SEEK = true;
- //debugLog<<"Creating strem.... ***"<<endl;
- OggStream* locStream = OggStreamFactory::CreateStream(inOggPage, mOwningFilter, ALLOW_OTHERS_TO_SEEK);
- //FIX::: Need to check for NULL
- if (locStream != NULL) {
- //debugLog<<"Creating strem.... ***"<<endl;
- mStreamList.push_back(locStream);
- } else {
- //debugLog<<"Lost a packet..."<<endl;
- }
- mSeenStreams.erase(it);
- delete inOggPage;
- return true;
- }
- }
-
- //If we are here, the stream is not in the list.
- //At the moment we assume it's because it's been seen, and removed... this is a bad assumption !
- //debugLog<<"Dispatchinig.........."<<endl;
-
- locTemp = dispatchPage(inOggPage);
- if (locTemp) {
- //debugLog<<"Dispatch ok"<<endl;
- } else {
- //debugLog<<"Dispatch failed"<<endl;
- }
- return locTemp;
- break;
- case INVALID_STATE:
- default:
- //debugLog<<"INVALID"<<endl;
- return false;
- break;
-
-
-
- }
-}
-
-bool AnxStreamMapper::handleAnxVersion_3_0(OggPage* inOggPage) {
- switch (mDemuxState) {
- case SEEN_NOTHING:
- //We must find an annodex BOS page.
- break;
- case SEEN_ANNODEX_BOS:
- break;
- case SEEN_AN_ANXDATA:
- break;
- case OGG_STATE:
- break;
- case INVALID_STATE:
- default:
- break;
-
-
-
- }
- return false;
-}
-
-bool AnxStreamMapper::acceptOggPage(OggPage* inOggPage) //Deletes or gives away page.
-{
-
- if (mDemuxState == SEEN_NOTHING) {
- mAnxVersion = getAnxVersion(inOggPage);
- //debugLog<<"Version is "<<mAnxVersion<<endl;
- }
- //debugLog<<"Accepting Page..."<<endl;
- switch (mAnxVersion) {
- case ANX_VERSION_2_0:
- //Potential memory leaks here !
-
- return handleAnxVersion_2_0(inOggPage);
- break;
- case ANX_VERSION_3_0:
- return handleAnxVersion_3_0(inOggPage);
- default:
- mDemuxState = INVALID_STATE;
- return false;
-
- }
-
-
-
- //debugLog<<endl<<"-------- accepting page ------"<<endl;
- //if (!mReadyForCodecs) {
- // if (inOggPage->header()->isBOS()) {
- // if (!mSeenAnnodexBOS) {
- // //This is an annodex BOS page
- // //Need to verify it's an annodex page too
- // mAnnodexSerial = inOggPage->header()->StreamSerialNo();
- // mSeenAnnodexBOS = true;
- //
- // //Need to save the data from the header here.
- // } else {
- // //This is anxdata
- //
-
- // if ( (mSeenCMML == false) ) {
- // //This is a really nasty way to do it ! Fix this up properly later.
- // char* locStr = (char*)(inOggPage->getPacket(0)->packetData() + 28);
- // if (strstr(locStr, "text/x-cmml") != NULL) {
- // mSeenCMML = true;
- // OggStream* locStream = new CMMLStream(inOggPage, mOwningFilter, true); //The page is only given for viewing
- // if (locStream != NULL) {
- // mStreamList.push_back(locStream);
- // }
- // }
- // } else {
- // //Need to save header data here.
- // mSeenStreams.push_back(inOggPage->header()->StreamSerialNo());
- // }
- // }
- // }
-
-
- // if (inOggPage->header()->isEOS()) {
- // if (mSeenAnnodexBOS) {
- // //This is the annodex EOS page
- // mReadyForCodecs = true;
- // } else {
- // //ERROR... got an EOS before we've seen the annodex BOS
- // delete inOggPage;
- // return false;
- // }
- // }
- // delete inOggPage;
- // return true;
- //} else {
- // vector<unsigned long>::iterator it;
- // int i;
- // for(i = 0, it = mSeenStreams.begin(); it != mSeenStreams.end(); i++, ++it) {
- // //for (int i = 0; i < mSeenStreams.size(); i++) {
- // if (mSeenStreams[i] == inOggPage->header()->StreamSerialNo()) {
- // //If the page is a BOS we need to start a new stream
- // const bool ALLOW_OTHERS_TO_SEEK = true;
- // OggStream* locStream = OggStreamFactory::CreateStream(inOggPage, mOwningFilter, ALLOW_OTHERS_TO_SEEK);
- // //FIX::: Need to check for NULL
- // if (locStream != NULL) {
- // mStreamList.push_back(locStream);
- // }
- // mSeenStreams.erase(it);
- // delete inOggPage;
- // return true;
- // }
- // }
-
- // //If we are here, the stream is not in the list.
- // //At the moment we assume it's because it's been seen, and removed... this is a bad assumption !
-
- // return dispatchPage(inOggPage);
- //}
-}
-
-bool AnxStreamMapper::toStartOfData() {
- //Specialise for anx... adds one extra ignore packet to the flush to account for the anxdata pages only
- // if it's 2.0 version.
- //debugLog<<"ANX::: To start of data size = "<<mStreamList.size()<<endl;
- if (isReady()) { //CHECK::: Should check for allow dsipatch ???
- for (unsigned long i = 0; i < mStreamList.size(); i++) {
- //Flush each stream, then ignore the codec headers.
- if (mAnxVersion == ANX_VERSION_2_0) {
- //debugLog<<"Flushing stream "<<i<<" for "<<mStreamList[i]->numCodecHeaders() + 1<<endl;
- mStreamList[i]->flush(mStreamList[i]->numCodecHeaders() + 1); //+1 = AnxData Header...
- } else {
- mStreamList[i]->flush(mStreamList[i]->numCodecHeaders());
- }
- }
- return true;
- } else {
- //debugLog<<"Something bad happened !!!!&&&&"<<endl;
- return false;
- }
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "anxstreammapper.h"
+
+AnxStreamMapper::AnxStreamMapper(OggDemuxSourceFilter* inOwningFilter)
+ : OggStreamMapper(inOwningFilter)
+ , mAnnodexSerial(0)
+ , mSeenAnnodexBOS(false)
+ , mReadyForCodecs(false)
+ , mSeenCMML(false)
+ , mDemuxState(eAnxDemuxState::SEEN_NOTHING)
+ , mAnxVersion(0)
+ , mAnnodexHeader(NULL)
+{
+
+ //debugLog.open("G:\\logs\\anxmapper.log", ios_base::out);
+}
+
+AnxStreamMapper::~AnxStreamMapper(void)
+{
+ //debugLog.close();
+}
+
+bool AnxStreamMapper::isReady() {
+ bool retVal = true;
+ bool locWasAny = false;
+ //Use 1 instead of 0... cmml is always ready and terminates the graph creation early.
+ //We want to know when everything else is ready.
+
+ //XXXXXXXXXXXXXX:::: Big dirty hack to deal with badly ordered header packets !!
+ //=======================================================================
+ //The side effect is... a file will hang if it has unknown streams.
+ //=======================================================================
+ if (mSeenStreams.size() == 0) {
+ retVal = true;
+ } else {
+ retVal = false;
+ }
+
+ for (unsigned long i = 1; i < mStreamList.size(); i++) {
+ locWasAny = true;
+ retVal = retVal && mStreamList[i]->streamReady();
+ //debugLog<<"Stream "<<i<<" ";
+ if (retVal) {
+ //debugLog<<"READY !!!!!!"<<endl;
+ } else {
+ //debugLog<<"NOT READY !!!!"<<endl;
+ }
+ }
+ //=======================================================================
+ if (locWasAny && retVal) {
+ //debugLog<<"Streams READY"<<endl;
+ } else {
+ //debugLog<<"Streams NOT READY"<<endl;
+ }
+ return locWasAny && retVal;
+}
+
+bool AnxStreamMapper::isAnnodexEOS(OggPage* inOggPage) {
+ if ((inOggPage->header()->StreamSerialNo() == mAnnodexSerial) &&
+ (inOggPage->header()->isEOS())) {
+ return true;
+ } else {
+ return false;
+ }
+
+}
+bool AnxStreamMapper::isAnnodexBOS(OggPage* inOggPage) {
+ if ((inOggPage->numPackets() != 1) ||
+ (inOggPage->getPacket(0)->packetSize() < 12) ||
+ (strncmp((const char*)inOggPage->getPacket(0)->packetData(), "Annodex\0", 8) != 0) ||
+ (!inOggPage->header()->isBOS())) {
+ return false;
+ } else {
+ return true;
+ }
+}
+
+bool AnxStreamMapper::isAnxDataPage(OggPage* inOggPage, bool inAnxDataAreBOS) {
+
+ //isBOS inAnxDataAreBOS isValid
+ //
+ //true true true
+ //true false false
+ //false true false
+ //false false true
+ if ((inOggPage->numPackets() != 1) ||
+ (inOggPage->getPacket(0)->packetSize() < 12) ||
+ (strncmp((const char*)inOggPage->getPacket(0)->packetData(), "AnxData\0", 8) != 0) ||
+
+ ( (inOggPage->header()->isBOS()) != inAnxDataAreBOS )) {
+ return false;
+ } else {
+ return true;
+ }
+}
+/**
+ * Returns a 32 number indicating the version... major<<16 + minor
+ */
+unsigned long AnxStreamMapper::getAnxVersion(OggPage* inOggPage) {
+ if (isAnnodexBOS(inOggPage)) {
+ //8 and 10 are the offsets into the header for version number.
+ return ((iLE_Math::charArrToUShort(inOggPage->getPacket(0)->packetData() + 8)) << 16) + iLE_Math::charArrToUShort(inOggPage->getPacket(0)->packetData() + 10);
+ } else {
+ return 0;
+ }
+
+
+
+}
+
+bool AnxStreamMapper::handleAnxVersion_2_0(OggPage* inOggPage) {
+ // LEAK::: Check memory deleting.
+ const bool ANXDATA_ARE_BOS = true;
+
+ bool locTemp = false;
+
+ vector<unsigned long>::iterator it;
+ int i = 0;
+ switch (mDemuxState) {
+ case SEEN_NOTHING:
+ //debugLog<<"SEEN_NOTHING"<<endl;
+ //We must find an annodex BOS page.
+ if (!isAnnodexBOS(inOggPage)) {
+ mDemuxState = INVALID_STATE;
+ delete inOggPage;
+ return false;
+ } else {
+ delete mAnnodexHeader;
+ mAnnodexHeader = inOggPage->getPacket(0)->clone();
+ mAnnodexSerial = inOggPage->header()->StreamSerialNo();
+ mDemuxState = SEEN_ANNODEX_BOS;
+ return true;
+ }
+ break; //Can never be here.
+
+ case SEEN_ANNODEX_BOS:
+ //debugLog<<"SEEN_ANNODEX_BOS"<<endl;
+ //We should be getting Anxdata headers here.
+ if (!isAnxDataPage(inOggPage, ANXDATA_ARE_BOS)) {
+ mDemuxState = INVALID_STATE;
+ return false;
+ } else {
+ //This should be the CMML AnxData header.
+ mSeenStreams.clear();
+ mAnxDataHeaders.clear();
+ //mSeenStreams.push_back(inOggPage->header()->StreamSerialNo());
+ mAnxDataHeaders.push_back(inOggPage->getPacket(0)->clone());
+ mDemuxState = SEEN_AN_ANXDATA;
+
+
+ //Add the CMML Stream
+ OggStream* locStream = new CMMLStream(inOggPage, mOwningFilter, true); //The page is only given for viewing
+ if (locStream != NULL) {
+ //debugLog<<"Adding CMML Stream"<<endl;
+ mStreamList.push_back(locStream);
+ }
+
+ return true;
+ }
+
+
+ break; //Can never be here.
+
+ case SEEN_AN_ANXDATA:
+ //debugLog<<"SEEN_AN_ANXDATA"<<endl;
+ if (isAnnodexEOS(inOggPage)) {
+ //This is the end of the stream headers.
+ mDemuxState = OGG_STATE;
+ //debugLog<<"Found an Annodex EOS... transitioning."<<endl;
+ return true;
+ } else if (isAnxDataPage(inOggPage, ANXDATA_ARE_BOS)) {
+ //handle another anxdata page.
+ //debugLog<<"Found another anxdata..."<<endl;
+ mSeenStreams.push_back(inOggPage->header()->StreamSerialNo());
+ mAnxDataHeaders.push_back(inOggPage->getPacket(0)->clone());
+ mDemuxState = SEEN_AN_ANXDATA;
+ return true;
+ } else {
+ mDemuxState = INVALID_STATE;
+ return false;
+ //Invalid.
+ }
+ break;
+ case OGG_STATE:
+ //debugLog<<"OGG_STATE"<<endl;
+ //We've seen the annodex EOS... so we can proceed as if it's a normal ogg file.
+ // The CMML stream is already made.
+
+ for(i = 0, it = mSeenStreams.begin(); it != mSeenStreams.end(); i++, ++it) {
+
+ if (mSeenStreams[i] == inOggPage->header()->StreamSerialNo()) {
+ //If the page is a BOS we need to start a new stream
+ const bool ALLOW_OTHERS_TO_SEEK = true;
+ //debugLog<<"Creating strem.... ***"<<endl;
+ OggStream* locStream = OggStreamFactory::CreateStream(inOggPage, mOwningFilter, ALLOW_OTHERS_TO_SEEK);
+ //FIX::: Need to check for NULL
+ if (locStream != NULL) {
+ //debugLog<<"Creating strem.... ***"<<endl;
+ mStreamList.push_back(locStream);
+ } else {
+ //debugLog<<"Lost a packet..."<<endl;
+ }
+ mSeenStreams.erase(it);
+ delete inOggPage;
+ return true;
+ }
+ }
+
+ //If we are here, the stream is not in the list.
+ //At the moment we assume it's because it's been seen, and removed... this is a bad assumption !
+ //debugLog<<"Dispatchinig.........."<<endl;
+
+ locTemp = dispatchPage(inOggPage);
+ if (locTemp) {
+ //debugLog<<"Dispatch ok"<<endl;
+ } else {
+ //debugLog<<"Dispatch failed"<<endl;
+ }
+ return locTemp;
+ break;
+ case INVALID_STATE:
+ default:
+ //debugLog<<"INVALID"<<endl;
+ return false;
+ break;
+
+
+
+ }
+}
+
+bool AnxStreamMapper::handleAnxVersion_3_0(OggPage* inOggPage) {
+ switch (mDemuxState) {
+ case SEEN_NOTHING:
+ //We must find an annodex BOS page.
+ break;
+ case SEEN_ANNODEX_BOS:
+ break;
+ case SEEN_AN_ANXDATA:
+ break;
+ case OGG_STATE:
+ break;
+ case INVALID_STATE:
+ default:
+ break;
+
+
+
+ }
+ return false;
+}
+
+bool AnxStreamMapper::acceptOggPage(OggPage* inOggPage) //Deletes or gives away page.
+{
+
+ if (mDemuxState == SEEN_NOTHING) {
+ mAnxVersion = getAnxVersion(inOggPage);
+ //debugLog<<"Version is "<<mAnxVersion<<endl;
+ }
+ //debugLog<<"Accepting Page..."<<endl;
+ switch (mAnxVersion) {
+ case ANX_VERSION_2_0:
+ //Potential memory leaks here !
+
+ return handleAnxVersion_2_0(inOggPage);
+ break;
+ case ANX_VERSION_3_0:
+ return handleAnxVersion_3_0(inOggPage);
+ default:
+ mDemuxState = INVALID_STATE;
+ return false;
+
+ }
+
+
+
+ //debugLog<<endl<<"-------- accepting page ------"<<endl;
+ //if (!mReadyForCodecs) {
+ // if (inOggPage->header()->isBOS()) {
+ // if (!mSeenAnnodexBOS) {
+ // //This is an annodex BOS page
+ // //Need to verify it's an annodex page too
+ // mAnnodexSerial = inOggPage->header()->StreamSerialNo();
+ // mSeenAnnodexBOS = true;
+ //
+ // //Need to save the data from the header here.
+ // } else {
+ // //This is anxdata
+ //
+
+ // if ( (mSeenCMML == false) ) {
+ // //This is a really nasty way to do it ! Fix this up properly later.
+ // char* locStr = (char*)(inOggPage->getPacket(0)->packetData() + 28);
+ // if (strstr(locStr, "text/x-cmml") != NULL) {
+ // mSeenCMML = true;
+ // OggStream* locStream = new CMMLStream(inOggPage, mOwningFilter, true); //The page is only given for viewing
+ // if (locStream != NULL) {
+ // mStreamList.push_back(locStream);
+ // }
+ // }
+ // } else {
+ // //Need to save header data here.
+ // mSeenStreams.push_back(inOggPage->header()->StreamSerialNo());
+ // }
+ // }
+ // }
+
+
+ // if (inOggPage->header()->isEOS()) {
+ // if (mSeenAnnodexBOS) {
+ // //This is the annodex EOS page
+ // mReadyForCodecs = true;
+ // } else {
+ // //ERROR... got an EOS before we've seen the annodex BOS
+ // delete inOggPage;
+ // return false;
+ // }
+ // }
+ // delete inOggPage;
+ // return true;
+ //} else {
+ // vector<unsigned long>::iterator it;
+ // int i;
+ // for(i = 0, it = mSeenStreams.begin(); it != mSeenStreams.end(); i++, ++it) {
+ // //for (int i = 0; i < mSeenStreams.size(); i++) {
+ // if (mSeenStreams[i] == inOggPage->header()->StreamSerialNo()) {
+ // //If the page is a BOS we need to start a new stream
+ // const bool ALLOW_OTHERS_TO_SEEK = true;
+ // OggStream* locStream = OggStreamFactory::CreateStream(inOggPage, mOwningFilter, ALLOW_OTHERS_TO_SEEK);
+ // //FIX::: Need to check for NULL
+ // if (locStream != NULL) {
+ // mStreamList.push_back(locStream);
+ // }
+ // mSeenStreams.erase(it);
+ // delete inOggPage;
+ // return true;
+ // }
+ // }
+
+ // //If we are here, the stream is not in the list.
+ // //At the moment we assume it's because it's been seen, and removed... this is a bad assumption !
+
+ // return dispatchPage(inOggPage);
+ //}
+}
+
+bool AnxStreamMapper::toStartOfData() {
+ //Specialise for anx... adds one extra ignore packet to the flush to account for the anxdata pages only
+ // if it's 2.0 version.
+ //debugLog<<"ANX::: To start of data size = "<<mStreamList.size()<<endl;
+ if (isReady()) { //CHECK::: Should check for allow dsipatch ???
+ for (unsigned long i = 0; i < mStreamList.size(); i++) {
+ //Flush each stream, then ignore the codec headers.
+ if (mAnxVersion == ANX_VERSION_2_0) {
+ //debugLog<<"Flushing stream "<<i<<" for "<<mStreamList[i]->numCodecHeaders() + 1<<endl;
+ mStreamList[i]->flush(mStreamList[i]->numCodecHeaders() + 1); //+1 = AnxData Header...
+ } else {
+ mStreamList[i]->flush(mStreamList[i]->numCodecHeaders());
+ }
+ }
+ return true;
+ } else {
+ //debugLog<<"Something bad happened !!!!&&&&"<<endl;
+ return false;
+ }
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxStreamMapper.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxStreamMapper.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxStreamMapper.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxStreamMapper.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,92 +1,92 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2003, 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-#include "OggStreamMapper.h"
-#include "CMMLStream.h"
-#include "iLE_Math.h"
-
-#include <fstream>
-using namespace std;
-class AnxStreamMapper
- : public OggStreamMapper
-{
-public:
- //Constructors
- AnxStreamMapper(void);
- AnxStreamMapper(OggDemuxSourceFilter* inOwningFilter);
- virtual ~AnxStreamMapper(void);
-
- //Constants and Enumerations
- enum eAnxDemuxState {
- SEEN_NOTHING,
- SEEN_ANNODEX_BOS,
- SEEN_AN_ANXDATA,
- OGG_STATE,
- INVALID_STATE = 1000
- };
-
- enum eAnxVersions {
- ANX_VERSION_2_0 = 2 << 16,
- ANX_VERSION_3_0 = 3 << 16
- };
-
- //Public Methods.
- virtual bool acceptOggPage(OggPage* inOggPage);
-
- virtual bool isReady();
- virtual bool toStartOfData();
-
-protected:
- //Helper Methods
- bool isAnnodexEOS(OggPage* inOggPage);
- bool isAnnodexBOS(OggPage* inOggPage);
- bool isAnxDataPage(OggPage* inOggPage, bool inAnxDataAreBOS);
- unsigned long getAnxVersion(OggPage* inOggPage);
- bool handleAnxVersion_2_0(OggPage* inOggPage);
- bool handleAnxVersion_3_0(OggPage* inOggPage);
-
- //Member Data
- vector<unsigned long> mSeenStreams;
- bool mSeenAnnodexBOS;
- bool mReadyForCodecs;
- bool mSeenCMML;
- unsigned long mAnnodexSerial; //TODO::: May not need this anymore
- OggPacket* mAnnodexHeader;
- vector<OggPacket*> mAnxDataHeaders;
- unsigned long mAnxVersion;
- eAnxDemuxState mDemuxState;
-
-};
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+#include "OggStreamMapper.h"
+#include "CMMLStream.h"
+#include "iLE_Math.h"
+
+#include <fstream>
+using namespace std;
+class AnxStreamMapper
+ : public OggStreamMapper
+{
+public:
+ //Constructors
+ AnxStreamMapper(void);
+ AnxStreamMapper(OggDemuxSourceFilter* inOwningFilter);
+ virtual ~AnxStreamMapper(void);
+
+ //Constants and Enumerations
+ enum eAnxDemuxState {
+ SEEN_NOTHING,
+ SEEN_ANNODEX_BOS,
+ SEEN_AN_ANXDATA,
+ OGG_STATE,
+ INVALID_STATE = 1000
+ };
+
+ enum eAnxVersions {
+ ANX_VERSION_2_0 = 2 << 16,
+ ANX_VERSION_3_0 = 3 << 16
+ };
+
+ //Public Methods.
+ virtual bool acceptOggPage(OggPage* inOggPage);
+
+ virtual bool isReady();
+ virtual bool toStartOfData();
+
+protected:
+ //Helper Methods
+ bool isAnnodexEOS(OggPage* inOggPage);
+ bool isAnnodexBOS(OggPage* inOggPage);
+ bool isAnxDataPage(OggPage* inOggPage, bool inAnxDataAreBOS);
+ unsigned long getAnxVersion(OggPage* inOggPage);
+ bool handleAnxVersion_2_0(OggPage* inOggPage);
+ bool handleAnxVersion_3_0(OggPage* inOggPage);
+
+ //Member Data
+ vector<unsigned long> mSeenStreams;
+ bool mSeenAnnodexBOS;
+ bool mReadyForCodecs;
+ bool mSeenCMML;
+ unsigned long mAnnodexSerial; //TODO::: May not need this anymore
+ OggPacket* mAnnodexHeader;
+ vector<OggPacket*> mAnxDataHeaders;
+ unsigned long mAnxVersion;
+ eAnxDemuxState mDemuxState;
+
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/AnxStreamMapper.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLSourcePin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLSourcePin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLSourcePin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,207 +1,207 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2003, 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "cmmlsourcepin.h"
-
-CMMLSourcePin::CMMLSourcePin( TCHAR* inObjectName,
- OggDemuxSourceFilter* inParentFilter,
- CCritSec* inFilterLock,
- StreamHeaders* inHeaderSource,
- CMediaType* inMediaType,
- wstring inPinName)
- : OggDemuxSourcePin(inObjectName, inParentFilter, inFilterLock, inHeaderSource, inMediaType, inPinName, true)
-{
- //debugLog.open("G:\\logs\\cmml_source_pin.log", ios_base::out);
-}
-
-CMMLSourcePin::~CMMLSourcePin(void)
-{
-}
-
-
-STDMETHODIMP CMMLSourcePin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
- if (riid == IID_IMediaSeeking) {
- *ppv = (IMediaSeeking*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- }
-
- return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
-}
-STDMETHODIMP CMMLSourcePin::Render(IPin* inOutputPin, IGraphBuilder* inGraphBuilder) {
- if (inOutputPin == NULL || inGraphBuilder == NULL) {
- return E_POINTER;
- }
-
-
- IBaseFilter* locCMMLFilter = NULL;
-
-
-
- HRESULT locHR = S_OK;
- //locHR = inGraphBuilder->FindFilterByName(L"CMML Decode Filter", &locRenderer);
- if (locCMMLFilter == NULL) {
- locHR= CoCreateInstance(CLSID_CMMLDecodeFilter, NULL, CLSCTX_INPROC, IID_IBaseFilter, (void **)&locCMMLFilter);
- if (locHR != S_OK) {
- return locHR;
- }
-
- locHR = inGraphBuilder->AddFilter(locCMMLFilter, L"CMML Decode Filter");
- if (locHR != S_OK) {
- locCMMLFilter->Release();
- return locHR;
- }
- }
-
- IEnumPins* locEnumPins;
- IPin* locCMMLInputPin = NULL;
- locHR = locCMMLFilter->EnumPins(&locEnumPins);
-
- if (SUCCEEDED(locHR)) {
- if (S_OK != locEnumPins->Next(1, &locCMMLInputPin, 0)) {
- locHR = E_UNEXPECTED;
- }
- }
-
- if (SUCCEEDED(locHR)) {
- // CConnect VMR9 to the output of the theora decoder
- //CMediaType* locMediaType = new CMediaType;
- //
- //FillMediaType(locMediaType);
- ////Fixes the null format block error
- //VIDEOINFOHEADER* locVideoFormat = (VIDEOINFOHEADER*)locMediaType->AllocFormatBuffer(sizeof(VIDEOINFOHEADER));
- //FillVideoInfoHeader(locVideoFormat);
- locHR = inGraphBuilder->ConnectDirect(inOutputPin, locCMMLInputPin, mMediaType);
- locCMMLInputPin->Release();
- }
- if (FAILED(locHR))
- {
-
- inGraphBuilder->RemoveFilter(locCMMLFilter);
- }
- locCMMLFilter->Release();
-
- return locHR;
-
-
-}
-STDMETHODIMP CMMLSourcePin::Backout(IPin* inOutputPin, IGraphBuilder* inGraphBuilder) {
- //HRESULT locHR = S_OK;
- // if (m_Connected != NULL) // Pointer to the pin we're connected to.
- // {
- // // Find the filter that owns the pin connected to us.
- // FILTER_INFO fi;
- // hr = m_Connected->QueryFilterInfo(&fi);
- // if (SUCCEEDED(hr))
- // {
- // if (fi.pFilter != NULL)
- // {
- // // Disconnect the pins.
- // pGraph->Disconnect(m_Connected);
- // pGraph->Disconnect(pPin);
- // // Remove the filter from the graph.
- // pGraph->RemoveFilter(fi.pFilter);
- // fi.pFilter->Release();
- // }
- // else
- // {
- // hr = E_UNEXPECTED;
- // }
- // }
- // }
- // return hr;
- return S_OK;
-}
-
-bool CMMLSourcePin::deliverOggPacket(StampedOggPacket* inPacket) {
-
- //Modified from the base class so that the times are multiplied by a scaling factor... curently 10000.
- //TODO::: When you properly save annodex header information, you need to account for other time schemes.
- //Probably issues for -1 gran pos here too.
- CAutoLock locStreamLock(mParentFilter->mStreamLock);
- IMediaSample* locSample = NULL;
- REFERENCE_TIME locStart = inPacket->endTime() * 10000; //CMML Changes here.
- REFERENCE_TIME locStop = inPacket->endTime() * 10000;
- //debugLog<<"Start : "<<locStart<<endl;
- //debugLog<<"End : "<<locStop<<endl;
- DbgLog((LOG_TRACE, 2, "Getting Buffer in Source Pin..."));
- //DbgLog((LOG_TRACE, 2, ""));
-
- HRESULT locHR = GetDeliveryBuffer(&locSample, &locStart, &locStop, NULL);
- DbgLog((LOG_TRACE, 2, "* After get Buffer in Source Pin..."));
- //Error checks
- if (locHR != S_OK) {
- DbgLog((LOG_TRACE, 2, "Getting Delivery Buff FAILED"));
- //Stopping, fluching or error
- //debugLog<<"Failure... No buffer"<<endl;
- return false;
- }
-
- //More hacks so we can send a timebase after a seek, since granule pos in theora
- // is not convertible in both directions to time.
-
- //TIMESTAMP FIXING !
- locSample->SetTime(&locStart, &locStop);
-
- //Yes this is way dodgy !
- locSample->SetMediaTime(&mParentFilter->mSeekTimeBase, &mParentFilter->mSeekTimeBase);
- locSample->SetSyncPoint(TRUE);
-
-
- // Create a pointer for the samples buffer
- BYTE* locBuffer = NULL;
- locSample->GetPointer(&locBuffer);
-
- if (locSample->GetSize() >= inPacket->packetSize()) {
-
- memcpy((void*)locBuffer, (const void*)inPacket->packetData(), inPacket->packetSize());
- locSample->SetActualDataLength(inPacket->packetSize());
-
- locHR = mDataQueue->Receive(locSample);
-
- if (locHR != S_OK) {
- //debugLog << "Failure... Queue rejected sample..."<<endl;
- //Stopping ??
- return false;
-
- } else {
- //debugLog<<"Delivery OK"<<endl;
- return true;
- }
- } else {
- throw 0;
- }
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "cmmlsourcepin.h"
+
+CMMLSourcePin::CMMLSourcePin( TCHAR* inObjectName,
+ OggDemuxSourceFilter* inParentFilter,
+ CCritSec* inFilterLock,
+ StreamHeaders* inHeaderSource,
+ CMediaType* inMediaType,
+ wstring inPinName)
+ : OggDemuxSourcePin(inObjectName, inParentFilter, inFilterLock, inHeaderSource, inMediaType, inPinName, true)
+{
+ //debugLog.open("G:\\logs\\cmml_source_pin.log", ios_base::out);
+}
+
+CMMLSourcePin::~CMMLSourcePin(void)
+{
+}
+
+
+STDMETHODIMP CMMLSourcePin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+ if (riid == IID_IMediaSeeking) {
+ *ppv = (IMediaSeeking*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ }
+
+ return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
+}
+STDMETHODIMP CMMLSourcePin::Render(IPin* inOutputPin, IGraphBuilder* inGraphBuilder) {
+ if (inOutputPin == NULL || inGraphBuilder == NULL) {
+ return E_POINTER;
+ }
+
+
+ IBaseFilter* locCMMLFilter = NULL;
+
+
+
+ HRESULT locHR = S_OK;
+ //locHR = inGraphBuilder->FindFilterByName(L"CMML Decode Filter", &locRenderer);
+ if (locCMMLFilter == NULL) {
+ locHR= CoCreateInstance(CLSID_CMMLDecodeFilter, NULL, CLSCTX_INPROC, IID_IBaseFilter, (void **)&locCMMLFilter);
+ if (locHR != S_OK) {
+ return locHR;
+ }
+
+ locHR = inGraphBuilder->AddFilter(locCMMLFilter, L"CMML Decode Filter");
+ if (locHR != S_OK) {
+ locCMMLFilter->Release();
+ return locHR;
+ }
+ }
+
+ IEnumPins* locEnumPins;
+ IPin* locCMMLInputPin = NULL;
+ locHR = locCMMLFilter->EnumPins(&locEnumPins);
+
+ if (SUCCEEDED(locHR)) {
+ if (S_OK != locEnumPins->Next(1, &locCMMLInputPin, 0)) {
+ locHR = E_UNEXPECTED;
+ }
+ }
+
+ if (SUCCEEDED(locHR)) {
+ // CConnect VMR9 to the output of the theora decoder
+ //CMediaType* locMediaType = new CMediaType;
+ //
+ //FillMediaType(locMediaType);
+ ////Fixes the null format block error
+ //VIDEOINFOHEADER* locVideoFormat = (VIDEOINFOHEADER*)locMediaType->AllocFormatBuffer(sizeof(VIDEOINFOHEADER));
+ //FillVideoInfoHeader(locVideoFormat);
+ locHR = inGraphBuilder->ConnectDirect(inOutputPin, locCMMLInputPin, mMediaType);
+ locCMMLInputPin->Release();
+ }
+ if (FAILED(locHR))
+ {
+
+ inGraphBuilder->RemoveFilter(locCMMLFilter);
+ }
+ locCMMLFilter->Release();
+
+ return locHR;
+
+
+}
+STDMETHODIMP CMMLSourcePin::Backout(IPin* inOutputPin, IGraphBuilder* inGraphBuilder) {
+ //HRESULT locHR = S_OK;
+ // if (m_Connected != NULL) // Pointer to the pin we're connected to.
+ // {
+ // // Find the filter that owns the pin connected to us.
+ // FILTER_INFO fi;
+ // hr = m_Connected->QueryFilterInfo(&fi);
+ // if (SUCCEEDED(hr))
+ // {
+ // if (fi.pFilter != NULL)
+ // {
+ // // Disconnect the pins.
+ // pGraph->Disconnect(m_Connected);
+ // pGraph->Disconnect(pPin);
+ // // Remove the filter from the graph.
+ // pGraph->RemoveFilter(fi.pFilter);
+ // fi.pFilter->Release();
+ // }
+ // else
+ // {
+ // hr = E_UNEXPECTED;
+ // }
+ // }
+ // }
+ // return hr;
+ return S_OK;
+}
+
+bool CMMLSourcePin::deliverOggPacket(StampedOggPacket* inPacket) {
+
+ //Modified from the base class so that the times are multiplied by a scaling factor... curently 10000.
+ //TODO::: When you properly save annodex header information, you need to account for other time schemes.
+ //Probably issues for -1 gran pos here too.
+ CAutoLock locStreamLock(mParentFilter->mStreamLock);
+ IMediaSample* locSample = NULL;
+ REFERENCE_TIME locStart = inPacket->endTime() * 10000; //CMML Changes here.
+ REFERENCE_TIME locStop = inPacket->endTime() * 10000;
+ //debugLog<<"Start : "<<locStart<<endl;
+ //debugLog<<"End : "<<locStop<<endl;
+ DbgLog((LOG_TRACE, 2, "Getting Buffer in Source Pin..."));
+ //DbgLog((LOG_TRACE, 2, ""));
+
+ HRESULT locHR = GetDeliveryBuffer(&locSample, &locStart, &locStop, NULL);
+ DbgLog((LOG_TRACE, 2, "* After get Buffer in Source Pin..."));
+ //Error checks
+ if (locHR != S_OK) {
+ DbgLog((LOG_TRACE, 2, "Getting Delivery Buff FAILED"));
+ //Stopping, fluching or error
+ //debugLog<<"Failure... No buffer"<<endl;
+ return false;
+ }
+
+ //More hacks so we can send a timebase after a seek, since granule pos in theora
+ // is not convertible in both directions to time.
+
+ //TIMESTAMP FIXING !
+ locSample->SetTime(&locStart, &locStop);
+
+ //Yes this is way dodgy !
+ locSample->SetMediaTime(&mParentFilter->mSeekTimeBase, &mParentFilter->mSeekTimeBase);
+ locSample->SetSyncPoint(TRUE);
+
+
+ // Create a pointer for the samples buffer
+ BYTE* locBuffer = NULL;
+ locSample->GetPointer(&locBuffer);
+
+ if (locSample->GetSize() >= inPacket->packetSize()) {
+
+ memcpy((void*)locBuffer, (const void*)inPacket->packetData(), inPacket->packetSize());
+ locSample->SetActualDataLength(inPacket->packetSize());
+
+ locHR = mDataQueue->Receive(locSample);
+
+ if (locHR != S_OK) {
+ //debugLog << "Failure... Queue rejected sample..."<<endl;
+ //Stopping ??
+ return false;
+
+ } else {
+ //debugLog<<"Delivery OK"<<endl;
+ return true;
+ }
+ } else {
+ throw 0;
+ }
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLSourcePin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLSourcePin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLSourcePin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLSourcePin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,65 +1,65 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2003, 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "anxdllstuff.h"
-#include "OggDemuxSourcePin.h"
-#include <fstream>
-using namespace std;
-class CMMLSourcePin
- : public OggDemuxSourcePin
- , public IStreamBuilder
-{
-public:
-
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- CMMLSourcePin( TCHAR* inObjectName,
- OggDemuxSourceFilter* inParentFilter,
- CCritSec* inFilterLock,
- StreamHeaders* inHeaderSource,
- CMediaType* inMediaType,
- wstring inPinName);
- virtual ~CMMLSourcePin(void);
-
- //Implements IStreamBuilder to force the pin tothe cmml filter
- STDMETHODIMP Render(IPin* inOutputPin, IGraphBuilder* inGraphBuilder);
- STDMETHODIMP Backout(IPin* inOutputPin, IGraphBuilder* inGraphBuilder);
-
- virtual bool CMMLSourcePin::deliverOggPacket(StampedOggPacket* inPacket);
-
-protected:
- //fstream debugLog;
-};
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "anxdllstuff.h"
+#include "OggDemuxSourcePin.h"
+#include <fstream>
+using namespace std;
+class CMMLSourcePin
+ : public OggDemuxSourcePin
+ , public IStreamBuilder
+{
+public:
+
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ CMMLSourcePin( TCHAR* inObjectName,
+ OggDemuxSourceFilter* inParentFilter,
+ CCritSec* inFilterLock,
+ StreamHeaders* inHeaderSource,
+ CMediaType* inMediaType,
+ wstring inPinName);
+ virtual ~CMMLSourcePin(void);
+
+ //Implements IStreamBuilder to force the pin tothe cmml filter
+ STDMETHODIMP Render(IPin* inOutputPin, IGraphBuilder* inGraphBuilder);
+ STDMETHODIMP Backout(IPin* inOutputPin, IGraphBuilder* inGraphBuilder);
+
+ virtual bool CMMLSourcePin::deliverOggPacket(StampedOggPacket* inPacket);
+
+protected:
+ //fstream debugLog;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLSourcePin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLStream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLStream.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLStream.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,121 +1,121 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2003, 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "cmmlstream.h"
-
-CMMLStream::CMMLStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek)
- : OggStream(inBOSPage, inOwningFilter, inAllowSeek)
- , mCMMLFormatBlock(NULL)
-{
- InitCodec(inBOSPage->getStampedPacket(0));
- //debugLog.open("G:\\logs\\cmmlstream.log", ios_base::out);
-}
-
-CMMLStream::~CMMLStream(void)
-{
- delete mCMMLFormatBlock;
-}
-
-bool CMMLStream::AddPin() {
- createFormatBlock();
- CMediaType* locMediaType = createMediaType( getMajorTypeGUID(),
- getSubtypeGUID(),
- getFormatGUID(),
- getFormatBlockSize(),
- getFormatBlock());
-
- //LEAK CHECK::: Where does this get deleted ?
- OggDemuxSourcePin* locSourcePin = new CMMLSourcePin( NAME("Ogg Source Pin"),
- mOwningFilter,
- mOwningFilter->theLock(),
- mCodecHeaders,
- locMediaType,
- getPinName());
- mStreamReady = true;
- mSourcePin = locSourcePin;
-
- return true;
-
-}
-bool CMMLStream::InitCodec(StampedOggPacket* inOggPacket) {
- mCodecHeaders = new StreamHeaders;
- mCodecHeaders->mCodecType = StreamHeaders::CMML;
- mAnxDataPacket = inOggPacket->clone();
- //mCodecHeaders->addPacket((StampedOggPacket*)inOggPacket->clone());
- mNumHeadersNeeded = 0; //TODO::: This should be 1 ???
- return true;
-}
-
-BYTE* CMMLStream::getFormatBlock() {
-
- return (BYTE*)mCMMLFormatBlock;
-
-}
-bool CMMLStream::createFormatBlock() {
- //Check where this gets deleted
- mCMMLFormatBlock = new sCMMLFormatBlock;
- mCMMLFormatBlock->granuleNumerator = iLE_Math::charArrToULong(mAnxDataPacket->packetData() + 8) + ((iLE_Math::charArrToULong(mAnxDataPacket->packetData() + 12)) << 32);
- mCMMLFormatBlock->granuleDenominator = iLE_Math::charArrToULong(mAnxDataPacket->packetData() + 16) + ((iLE_Math::charArrToULong(mAnxDataPacket->packetData() + 20)) << 32);
-
- return true;
-}
-
-void CMMLStream::setLastEndGranPos(__int64 inPos) {
- //debugLog<<"CMML Stream Reset : inPos = "<<inPos<<" -- last end gran = ";
- //debugLog<<"gran rate = "<<mCMMLFormatBlock->granuleNumerator<<" / "<<mCMMLFormatBlock->granuleDenominator<<endl;
- mLastEndGranulePos = ((inPos * mCMMLFormatBlock->granuleNumerator) / mCMMLFormatBlock->granuleDenominator)/ UNITS;
- //debugLog<<mLastEndGranulePos<<endl;
- //osDebug<<"Vorbis sets End Gran : "<<mLastEndGranulePos<<endl;
-}
-unsigned long CMMLStream::getFormatBlockSize() {
- return sizeof(sCMMLFormatBlock);
-}
-GUID CMMLStream::getFormatGUID() {
- return FORMAT_CMML;
-}
-GUID CMMLStream::getSubtypeGUID() {
- return MEDIASUBTYPE_CMML;
-}
-wstring CMMLStream::getPinName() {
- wstring retName = L"CMML Out";
- return retName;
-}
-GUID CMMLStream::getMajorTypeGUID() {
- return MEDIATYPE_Text;
-}
-
-LONGLONG CMMLStream::getCurrentPos() {
- return (mLastEndGranulePos * UNITS * mCMMLFormatBlock->granuleDenominator) / mCMMLFormatBlock->granuleNumerator;
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "cmmlstream.h"
+
+CMMLStream::CMMLStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek)
+ : OggStream(inBOSPage, inOwningFilter, inAllowSeek)
+ , mCMMLFormatBlock(NULL)
+{
+ InitCodec(inBOSPage->getStampedPacket(0));
+ //debugLog.open("G:\\logs\\cmmlstream.log", ios_base::out);
+}
+
+CMMLStream::~CMMLStream(void)
+{
+ delete mCMMLFormatBlock;
+}
+
+bool CMMLStream::AddPin() {
+ createFormatBlock();
+ CMediaType* locMediaType = createMediaType( getMajorTypeGUID(),
+ getSubtypeGUID(),
+ getFormatGUID(),
+ getFormatBlockSize(),
+ getFormatBlock());
+
+ //LEAK CHECK::: Where does this get deleted ?
+ OggDemuxSourcePin* locSourcePin = new CMMLSourcePin( NAME("Ogg Source Pin"),
+ mOwningFilter,
+ mOwningFilter->theLock(),
+ mCodecHeaders,
+ locMediaType,
+ getPinName());
+ mStreamReady = true;
+ mSourcePin = locSourcePin;
+
+ return true;
+
+}
+bool CMMLStream::InitCodec(StampedOggPacket* inOggPacket) {
+ mCodecHeaders = new StreamHeaders;
+ mCodecHeaders->mCodecType = StreamHeaders::CMML;
+ mAnxDataPacket = inOggPacket->clone();
+ //mCodecHeaders->addPacket((StampedOggPacket*)inOggPacket->clone());
+ mNumHeadersNeeded = 0; //TODO::: This should be 1 ???
+ return true;
+}
+
+BYTE* CMMLStream::getFormatBlock() {
+
+ return (BYTE*)mCMMLFormatBlock;
+
+}
+bool CMMLStream::createFormatBlock() {
+ //Check where this gets deleted
+ mCMMLFormatBlock = new sCMMLFormatBlock;
+ mCMMLFormatBlock->granuleNumerator = iLE_Math::charArrToULong(mAnxDataPacket->packetData() + 8) + ((iLE_Math::charArrToULong(mAnxDataPacket->packetData() + 12)) << 32);
+ mCMMLFormatBlock->granuleDenominator = iLE_Math::charArrToULong(mAnxDataPacket->packetData() + 16) + ((iLE_Math::charArrToULong(mAnxDataPacket->packetData() + 20)) << 32);
+
+ return true;
+}
+
+void CMMLStream::setLastEndGranPos(__int64 inPos) {
+ //debugLog<<"CMML Stream Reset : inPos = "<<inPos<<" -- last end gran = ";
+ //debugLog<<"gran rate = "<<mCMMLFormatBlock->granuleNumerator<<" / "<<mCMMLFormatBlock->granuleDenominator<<endl;
+ mLastEndGranulePos = ((inPos * mCMMLFormatBlock->granuleNumerator) / mCMMLFormatBlock->granuleDenominator)/ UNITS;
+ //debugLog<<mLastEndGranulePos<<endl;
+ //osDebug<<"Vorbis sets End Gran : "<<mLastEndGranulePos<<endl;
+}
+unsigned long CMMLStream::getFormatBlockSize() {
+ return sizeof(sCMMLFormatBlock);
+}
+GUID CMMLStream::getFormatGUID() {
+ return FORMAT_CMML;
+}
+GUID CMMLStream::getSubtypeGUID() {
+ return MEDIASUBTYPE_CMML;
+}
+wstring CMMLStream::getPinName() {
+ wstring retName = L"CMML Out";
+ return retName;
+}
+GUID CMMLStream::getMajorTypeGUID() {
+ return MEDIATYPE_Text;
+}
+
+LONGLONG CMMLStream::getCurrentPos() {
+ return (mLastEndGranulePos * UNITS * mCMMLFormatBlock->granuleDenominator) / mCMMLFormatBlock->granuleNumerator;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLStream.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLStream.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLStream.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLStream.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,68 +1,68 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2003, 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-#include "anxdllstuff.h"
-#include "OggPacket.h"
-#include "OggStream.h"
-#include "CMMLSourcePin.h"
-class CMMLStream
- : public OggStream
-{
-public:
- CMMLStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
- virtual ~CMMLStream(void);
- virtual void setLastEndGranPos(__int64 inGranPos);
-
-
- virtual bool InitCodec(StampedOggPacket* inOggPacket);
- virtual BYTE* getFormatBlock();
- virtual unsigned long getFormatBlockSize();
-
- virtual GUID getMajorTypeGUID();
- virtual GUID getFormatGUID();
- virtual GUID getSubtypeGUID();
- virtual wstring getPinName();
- virtual bool createFormatBlock();
-
- virtual LONGLONG getCurrentPos();
-
- //Override
- virtual bool AddPin();
-
-protected:
- OggPacket* mAnxDataPacket;
- sCMMLFormatBlock* mCMMLFormatBlock;
-};
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+#include "anxdllstuff.h"
+#include "OggPacket.h"
+#include "OggStream.h"
+#include "CMMLSourcePin.h"
+class CMMLStream
+ : public OggStream
+{
+public:
+ CMMLStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
+ virtual ~CMMLStream(void);
+ virtual void setLastEndGranPos(__int64 inGranPos);
+
+
+ virtual bool InitCodec(StampedOggPacket* inOggPacket);
+ virtual BYTE* getFormatBlock();
+ virtual unsigned long getFormatBlockSize();
+
+ virtual GUID getMajorTypeGUID();
+ virtual GUID getFormatGUID();
+ virtual GUID getSubtypeGUID();
+ virtual wstring getPinName();
+ virtual bool createFormatBlock();
+
+ virtual LONGLONG getCurrentPos();
+
+ //Override
+ virtual bool AddPin();
+
+protected:
+ OggPacket* mAnxDataPacket;
+ sCMMLFormatBlock* mCMMLFormatBlock;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/CMMLStream.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/anxdllstuff.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/anxdllstuff.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/anxdllstuff.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,112 +1,112 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2003 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "anxdllstuff.h"
-
-
-
-extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
-BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
-{
- return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
-}
-
-
-//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
-STDAPI DllRegisterServer()
-{
-
- //TO DO::: Should we be releasing the filter mapper even when we return early ?
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(TRUE);
- if (FAILED(hr)) {
-
- return hr;
- }
-
-
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
-
-
- if (FAILED(hr)) {
- return hr;
- }
-
- hr = locFilterMapper->RegisterFilter(
- CLSID_AnxDemuxSourceFilter, // Filter CLSID.
- L"Annodex Demux Source Filter", // Filter name.
- NULL, // Device moniker.
- &CLSID_LegacyAmFilterCategory, // Direct Show general category
- L"Annodex Demux Source Filter", // Instance data. ???????
- &AnxDemuxSourceFilterReg // Pointer to filter information.
- );
-
-
- locFilterMapper->Release();
-
- return hr;
-
-}
-
-STDAPI DllUnregisterServer()
-{
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(FALSE);
- if (FAILED(hr)) {
-
- return hr;
- }
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
- IID_IFilterMapper2, (void **)&locFilterMapper);
-
- if (FAILED(hr)) {
- return hr;
- }
-
-
- hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory,
- L"Annodex Demux Source Filter", CLSID_AnxDemuxSourceFilter);
-
- //
- locFilterMapper->Release();
- return hr;
-
-}
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "anxdllstuff.h"
+
+
+
+extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
+BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+ return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
+}
+
+
+//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
+STDAPI DllRegisterServer()
+{
+
+ //TO DO::: Should we be releasing the filter mapper even when we return early ?
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(TRUE);
+ if (FAILED(hr)) {
+
+ return hr;
+ }
+
+
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
+
+
+ if (FAILED(hr)) {
+ return hr;
+ }
+
+ hr = locFilterMapper->RegisterFilter(
+ CLSID_AnxDemuxSourceFilter, // Filter CLSID.
+ L"Annodex Demux Source Filter", // Filter name.
+ NULL, // Device moniker.
+ &CLSID_LegacyAmFilterCategory, // Direct Show general category
+ L"Annodex Demux Source Filter", // Instance data. ???????
+ &AnxDemuxSourceFilterReg // Pointer to filter information.
+ );
+
+
+ locFilterMapper->Release();
+
+ return hr;
+
+}
+
+STDAPI DllUnregisterServer()
+{
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(FALSE);
+ if (FAILED(hr)) {
+
+ return hr;
+ }
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
+ IID_IFilterMapper2, (void **)&locFilterMapper);
+
+ if (FAILED(hr)) {
+ return hr;
+ }
+
+
+ hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory,
+ L"Annodex Demux Source Filter", CLSID_AnxDemuxSourceFilter);
+
+ //
+ locFilterMapper->Release();
+ return hr;
+
+}
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/anxdllstuff.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/anxdllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/anxdllstuff.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/anxdllstuff.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,68 +1,68 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2003, 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-#include "oggdllstuff.h"
-
-
-// {6F767551-E3E1-461f-A8E5-C8ED36342ED1}
-DEFINE_GUID(CLSID_AnxDemuxSourceFilter,
-0x6f767551, 0xe3e1, 0x461f, 0xa8, 0xe5, 0xc8, 0xed, 0x36, 0x34, 0x2e, 0xd1);
-
-// {53696C76-6961-40b2-B136-436F6E726164}
-DEFINE_GUID(FORMAT_CMML,
-0x53696c76, 0x6961, 0x40b2, 0xb1, 0x36, 0x43, 0x6f, 0x6e, 0x72, 0x61, 0x64);
-
-
-// {5A656E74-6172-6F26-B79C-D6416E647282}
-DEFINE_GUID(MEDIASUBTYPE_CMML,
-0x5a656e74, 0x6172, 0x6f26, 0xb7, 0x9c, 0xd6, 0x41, 0x6e, 0x64, 0x72, 0x82);
-
-// {BF1121D1-8739-45e1-BCD8-90B828F643AB}
-DEFINE_GUID(CLSID_CMMLDecodeFilter,
-0xbf1121d1, 0x8739, 0x45e1, 0xbc, 0xd8, 0x90, 0xb8, 0x28, 0xf6, 0x43, 0xab);
-
-const REGFILTER2 AnxDemuxSourceFilterReg = {
- 1,
- MERIT_NORMAL,
- 0,
- NULL
-
-};
-
-struct sCMMLFormatBlock {
- __int64 granuleNumerator;
- __int64 granuleDenominator;
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+#include "oggdllstuff.h"
+
+
+// {6F767551-E3E1-461f-A8E5-C8ED36342ED1}
+DEFINE_GUID(CLSID_AnxDemuxSourceFilter,
+0x6f767551, 0xe3e1, 0x461f, 0xa8, 0xe5, 0xc8, 0xed, 0x36, 0x34, 0x2e, 0xd1);
+
+// {53696C76-6961-40b2-B136-436F6E726164}
+DEFINE_GUID(FORMAT_CMML,
+0x53696c76, 0x6961, 0x40b2, 0xb1, 0x36, 0x43, 0x6f, 0x6e, 0x72, 0x61, 0x64);
+
+
+// {5A656E74-6172-6F26-B79C-D6416E647282}
+DEFINE_GUID(MEDIASUBTYPE_CMML,
+0x5a656e74, 0x6172, 0x6f26, 0xb7, 0x9c, 0xd6, 0x41, 0x6e, 0x64, 0x72, 0x82);
+
+// {BF1121D1-8739-45e1-BCD8-90B828F643AB}
+DEFINE_GUID(CLSID_CMMLDecodeFilter,
+0xbf1121d1, 0x8739, 0x45e1, 0xbc, 0xd8, 0x90, 0xb8, 0x28, 0xf6, 0x43, 0xab);
+
+const REGFILTER2 AnxDemuxSourceFilterReg = {
+ 1,
+ MERIT_NORMAL,
+ 0,
+ NULL
+
+};
+
+struct sCMMLFormatBlock {
+ __int64 granuleNumerator;
+ __int64 granuleDenominator;
};
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/anxdllstuff.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/dsfAnxDemux.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/dsfAnxDemux.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/dsfAnxDemux.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,12 +1,12 @@
-// dsfAnxDemux.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- return TRUE;
-}
-
+// dsfAnxDemux.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ return TRUE;
+}
+
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/dsfAnxDemux.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,42 +1,42 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2003 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.cpp : source file that includes just the standard includes
-// dsfAnxDemux.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.cpp : source file that includes just the standard includes
+// dsfAnxDemux.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,50 +1,50 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2003 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-// TODO: reference additional headers your program requires here
-#include <vector>
-#include <fstream>
-#include <iostream>
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+// TODO: reference additional headers your program requires here
+#include <vector>
+#include <fstream>
+#include <iostream>
using namespace std;
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxDemux/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxFilter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxFilter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,86 +1,86 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2003, 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include ".\anxmuxfilter.h"
-
-
-
-// This template lets the Object factory create us properly and work with COM infrastructure.
-CFactoryTemplate g_Templates[] =
-{
- {
- L"AnxMuxFilter", // Name
- &CLSID_AnxMuxFilter, // CLSID
- AnxMuxFilter::CreateInstance, // Method to create an instance of MyComponent
- NULL, // Initialization function
- NULL // Set-up information (for filters)
- }
-
-};
-
-// Generic way of determining the number of items in the template
-int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
-
-
-
-CUnknown* WINAPI AnxMuxFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
-{
- AnxMuxFilter *pNewObject = new AnxMuxFilter();
- if (pNewObject == NULL) {
- *pHr = E_OUTOFMEMORY;
- }
- return pNewObject;
-}
-AnxMuxFilter::AnxMuxFilter(void)
- : OggMuxFilter(CLSID_AnxMuxFilter)
-{
-
- mInterleaver = new AnxPageInterleaver(this, this, 2, 0);
- mInputPins.push_back(new AnxMuxInputPin(this, m_pLock, &mHR, mInterleaver->newStream()));
-
-
- //Make our delegate pin[0], the top pin... we send all out requests there.
- IMediaSeeking* locSeeker = NULL;
- mInputPins[0]->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
- SetDelegate(locSeeker);
-}
-
-AnxMuxFilter::~AnxMuxFilter(void)
-{
-}
-
-HRESULT AnxMuxFilter::addAnotherPin() {
- mInputPins.push_back(new AnxMuxInputPin(this, m_pLock, &mHR, mInterleaver->newStream()));
- return S_OK;
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include ".\anxmuxfilter.h"
+
+
+
+// This template lets the Object factory create us properly and work with COM infrastructure.
+CFactoryTemplate g_Templates[] =
+{
+ {
+ L"AnxMuxFilter", // Name
+ &CLSID_AnxMuxFilter, // CLSID
+ AnxMuxFilter::CreateInstance, // Method to create an instance of MyComponent
+ NULL, // Initialization function
+ NULL // Set-up information (for filters)
+ }
+
+};
+
+// Generic way of determining the number of items in the template
+int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
+
+
+
+CUnknown* WINAPI AnxMuxFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
+{
+ AnxMuxFilter *pNewObject = new AnxMuxFilter();
+ if (pNewObject == NULL) {
+ *pHr = E_OUTOFMEMORY;
+ }
+ return pNewObject;
+}
+AnxMuxFilter::AnxMuxFilter(void)
+ : OggMuxFilter(CLSID_AnxMuxFilter)
+{
+
+ mInterleaver = new AnxPageInterleaver(this, this, 2, 0);
+ mInputPins.push_back(new AnxMuxInputPin(this, m_pLock, &mHR, mInterleaver->newStream()));
+
+
+ //Make our delegate pin[0], the top pin... we send all out requests there.
+ IMediaSeeking* locSeeker = NULL;
+ mInputPins[0]->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+ SetDelegate(locSeeker);
+}
+
+AnxMuxFilter::~AnxMuxFilter(void)
+{
+}
+
+HRESULT AnxMuxFilter::addAnotherPin() {
+ mInputPins.push_back(new AnxMuxInputPin(this, m_pLock, &mHR, mInterleaver->newStream()));
+ return S_OK;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxFilter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxFilter.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxFilter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxFilter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,62 +1,62 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2003, 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include "anxmuxdllstuff.h"
-#include "OggMuxFilter.h"
-#include "AnxPageInterleaver.h"
-#include "AnxMuxInputPin.h"
-class AnxMuxFilter
- : public OggMuxFilter
-{
-public:
- AnxMuxFilter(void);
- ~AnxMuxFilter(void);
-
- static CUnknown* WINAPI AnxMuxFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
-
- enum eAnxMuxState {
- ANX_START_STATE = 0,
- WRITTEN_ANNODEX_BOS = 1,
- WRITTEN_A_CMML_ANXDATA = 2,
- WRITTEN_A_CODEC_ANXDATA = 3,
- WRITTEN_ANNODEX_EOS = 4,
- PROCEED_AS_OGG = 5
-
-
- };
-
- virtual HRESULT addAnotherPin();
-protected:
- eAnxMuxState mAnxMuxState;
-};
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+#include "anxmuxdllstuff.h"
+#include "OggMuxFilter.h"
+#include "AnxPageInterleaver.h"
+#include "AnxMuxInputPin.h"
+class AnxMuxFilter
+ : public OggMuxFilter
+{
+public:
+ AnxMuxFilter(void);
+ ~AnxMuxFilter(void);
+
+ static CUnknown* WINAPI AnxMuxFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+
+ enum eAnxMuxState {
+ ANX_START_STATE = 0,
+ WRITTEN_ANNODEX_BOS = 1,
+ WRITTEN_A_CMML_ANXDATA = 2,
+ WRITTEN_A_CODEC_ANXDATA = 3,
+ WRITTEN_ANNODEX_EOS = 4,
+ PROCEED_AS_OGG = 5
+
+
+ };
+
+ virtual HRESULT addAnotherPin();
+protected:
+ eAnxMuxState mAnxMuxState;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxFilter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,207 +1,207 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2003, 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include ".\anxmuxinputpin.h"
-#include "AnxMuxFilter.h"
-AnxMuxInputPin::AnxMuxInputPin(AnxMuxFilter* inOwningFilter, CCritSec* inFilterLock, HRESULT* inHR, OggMuxStream* inMuxStream)
- : OggMuxInputPin(inOwningFilter, inFilterLock, inHR, inMuxStream)
- , mAnxDataPacket(NULL)
-{
- debugLog.open("g:\\logs\\anxmuxinputpin.log", ios_base::out);
-}
-
-AnxMuxInputPin::~AnxMuxInputPin(void)
-{
-}
-
-
-HRESULT AnxMuxInputPin::CompleteConnect(IPin* inReceivePin) {
-
- //Set our delegate to the pin that is connecting to us... we'll send them our seek messages.
- IMediaSeeking* locSeeker = NULL;
- inReceivePin->QueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
- SetDelegate(locSeeker);
-
- mMuxStream->setIsActive(true);
-
- HRESULT locHR = mParentFilter->addAnotherPin();
- if ((locHR == S_OK) && (mAnxDataPacket != NULL)) {
- mPaginator.acceptStampedOggPacket(mAnxDataPacket);
- return S_OK;
- } else {
- return S_FALSE;
- }
-}
-
-
-HRESULT AnxMuxInputPin::SetMediaType(const CMediaType* inMediaType)
-{
-
- bool locWasOK = false;
- unsigned __int64 locGranRateNum = 0;
- unsigned __int64 locGranRateDenom = 0;
- unsigned long locNumHeaders = 0;
- StreamHeaders::eCodecType locCodecID = StreamHeaders::NONE;
-
-
- if ((inMediaType->majortype == MEDIATYPE_Video) && (inMediaType->subtype == MEDIASUBTYPE_Theora)) {
- //Theora
-
- sTheoraFormatBlock* locTheora = (sTheoraFormatBlock*)inMediaType->pbFormat;
- //debugLog<<"Theo sample rate = "<<locTheora->frameRateNumerator<<" / "<<locTheora->frameRateDenominator<<endl;
- //debugLog<<"Theo KFI = "<<locTheora->maxKeyframeInterval<<endl;
- mMuxStream->setConversionParams(locTheora->frameRateNumerator, locTheora->frameRateDenominator, 10000000, locTheora->maxKeyframeInterval);
- mPaginator.setNumHeaders(3);
-
- locWasOK = true;
- locGranRateNum = locTheora->frameRateNumerator;
- locGranRateDenom = locTheora->frameRateDenominator;
- locNumHeaders = 3;
- locCodecID = StreamHeaders::THEORA;
-
- } else if (inMediaType->majortype == MEDIATYPE_Audio) {
- if (inMediaType->subtype == MEDIASUBTYPE_Vorbis) {
- //Vorbis
- sVorbisFormatBlock* locVorbis = (sVorbisFormatBlock*)inMediaType->pbFormat;
- //debugLog<<"Vorbis sample rate = "<<locVorbis->samplesPerSec<<endl;
- mMuxStream->setConversionParams(locVorbis->samplesPerSec, 1, 10000000);
- mPaginator.setNumHeaders(3);
-
- locWasOK = true;
- locGranRateNum = locVorbis->samplesPerSec;
- locGranRateDenom = 1;
- locNumHeaders = 3;
-
- locCodecID = StreamHeaders::VORBIS;
-
-
- } else if (inMediaType->subtype == MEDIASUBTYPE_Speex) {
- //Speex
- sSpeexFormatBlock* locSpeex = (sSpeexFormatBlock*)inMediaType->pbFormat;
- mMuxStream->setConversionParams(locSpeex->samplesPerSec, 1, 10000000);
- mPaginator.setNumHeaders(2);
-
-
- locWasOK = true;
- locGranRateNum = locSpeex->samplesPerSec;
- locGranRateDenom = 1;
- locNumHeaders = 2;
- locCodecID = StreamHeaders::SPEEX;
- }
-
- //TODO::: Add a num headers field to the flac format block.
-
- //} else if (inMediaType->subtype == MEDIASUBTYPE_OggFLAC_1_0) {
- // //We are connected to the encoder nd getting individual metadata packets.
- // sFLACFormatBlock* locFLAC = (sFLACFormatBlock*)inMediaType->pbFormat;
- // mMuxStream->setConversionParams(locFLAC->samplesPerSec, 1, 10000000);
- // //debugLog<<"FLAC sample rate = "<<locFLAC->samplesPerSec<<endl;
- // //mNeedsFLACHeaderTweak = true;
- // mNeedsFLACHeaderCount = true;
- //} else if (inMediaType->subtype == MEDIASUBTYPE_FLAC) {
- // //We are connected directly to the demux and are getting metadata in one block
- // // Need to use the header splitter class.
- // sFLACFormatBlock* locFLAC = (sFLACFormatBlock*)inMediaType->pbFormat;
- // mMuxStream->setConversionParams(locFLAC->samplesPerSec, 1, 10000000);
- // //debugLog<<"FLAC sample rate = "<<locFLAC->samplesPerSec<<endl;
- // mNeedsFLACHeaderTweak = true;
- //}
-
-
- } else if(inMediaType->majortype == MEDIATYPE_Text) {
- if (inMediaType->subtype == MEDIASUBTYPE_CMML) {
- //CMML
- sCMMLFormatBlock* locCMML = (sCMMLFormatBlock*)inMediaType->pbFormat;
- mMuxStream->setConversionParams(locCMML->granuleNumerator, locCMML->granuleDenominator, 10000000);
- mPaginator.setNumHeaders(1);
-
-
- locWasOK = true;
- locGranRateNum = locCMML->granuleNumerator;
- locGranRateDenom = locCMML->granuleDenominator;
- locNumHeaders = 1;
- locCodecID = StreamHeaders::CMML;
- }
- }
- if (locWasOK) {
- //Save the packet, we'll push it into the stream when the connection is established
- mAnxDataPacket = AnxPacketMaker::makeAnxData_2_0(2,0, locGranRateNum, locGranRateDenom, locNumHeaders, AnxPacketMaker::makeMessageHeaders(locCodecID));
- return S_OK;
- } else {
- return S_FALSE;
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ////This pushes an anxdata packet into the stream.
- //HRESULT locHR = OggMuxInputPin::SetMediaType(inMediaType);
-
- //if (locHR == S_OK) {
- // debugLog<<"Set media type ok in base class"<<endl;
- // mPaginator.acceptStampedOggPacket(AnxPacketMaker::makeAnxData_2_0(mMuxStream, &mPaginator));
- //}
-
- //return locHR;
-
-
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include ".\anxmuxinputpin.h"
+#include "AnxMuxFilter.h"
+AnxMuxInputPin::AnxMuxInputPin(AnxMuxFilter* inOwningFilter, CCritSec* inFilterLock, HRESULT* inHR, OggMuxStream* inMuxStream)
+ : OggMuxInputPin(inOwningFilter, inFilterLock, inHR, inMuxStream)
+ , mAnxDataPacket(NULL)
+{
+ debugLog.open("g:\\logs\\anxmuxinputpin.log", ios_base::out);
+}
+
+AnxMuxInputPin::~AnxMuxInputPin(void)
+{
+}
+
+
+HRESULT AnxMuxInputPin::CompleteConnect(IPin* inReceivePin) {
+
+ //Set our delegate to the pin that is connecting to us... we'll send them our seek messages.
+ IMediaSeeking* locSeeker = NULL;
+ inReceivePin->QueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+ SetDelegate(locSeeker);
+
+ mMuxStream->setIsActive(true);
+
+ HRESULT locHR = mParentFilter->addAnotherPin();
+ if ((locHR == S_OK) && (mAnxDataPacket != NULL)) {
+ mPaginator.acceptStampedOggPacket(mAnxDataPacket);
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
+}
+
+
+HRESULT AnxMuxInputPin::SetMediaType(const CMediaType* inMediaType)
+{
+
+ bool locWasOK = false;
+ unsigned __int64 locGranRateNum = 0;
+ unsigned __int64 locGranRateDenom = 0;
+ unsigned long locNumHeaders = 0;
+ StreamHeaders::eCodecType locCodecID = StreamHeaders::NONE;
+
+
+ if ((inMediaType->majortype == MEDIATYPE_Video) && (inMediaType->subtype == MEDIASUBTYPE_Theora)) {
+ //Theora
+
+ sTheoraFormatBlock* locTheora = (sTheoraFormatBlock*)inMediaType->pbFormat;
+ //debugLog<<"Theo sample rate = "<<locTheora->frameRateNumerator<<" / "<<locTheora->frameRateDenominator<<endl;
+ //debugLog<<"Theo KFI = "<<locTheora->maxKeyframeInterval<<endl;
+ mMuxStream->setConversionParams(locTheora->frameRateNumerator, locTheora->frameRateDenominator, 10000000, locTheora->maxKeyframeInterval);
+ mPaginator.setNumHeaders(3);
+
+ locWasOK = true;
+ locGranRateNum = locTheora->frameRateNumerator;
+ locGranRateDenom = locTheora->frameRateDenominator;
+ locNumHeaders = 3;
+ locCodecID = StreamHeaders::THEORA;
+
+ } else if (inMediaType->majortype == MEDIATYPE_Audio) {
+ if (inMediaType->subtype == MEDIASUBTYPE_Vorbis) {
+ //Vorbis
+ sVorbisFormatBlock* locVorbis = (sVorbisFormatBlock*)inMediaType->pbFormat;
+ //debugLog<<"Vorbis sample rate = "<<locVorbis->samplesPerSec<<endl;
+ mMuxStream->setConversionParams(locVorbis->samplesPerSec, 1, 10000000);
+ mPaginator.setNumHeaders(3);
+
+ locWasOK = true;
+ locGranRateNum = locVorbis->samplesPerSec;
+ locGranRateDenom = 1;
+ locNumHeaders = 3;
+
+ locCodecID = StreamHeaders::VORBIS;
+
+
+ } else if (inMediaType->subtype == MEDIASUBTYPE_Speex) {
+ //Speex
+ sSpeexFormatBlock* locSpeex = (sSpeexFormatBlock*)inMediaType->pbFormat;
+ mMuxStream->setConversionParams(locSpeex->samplesPerSec, 1, 10000000);
+ mPaginator.setNumHeaders(2);
+
+
+ locWasOK = true;
+ locGranRateNum = locSpeex->samplesPerSec;
+ locGranRateDenom = 1;
+ locNumHeaders = 2;
+ locCodecID = StreamHeaders::SPEEX;
+ }
+
+ //TODO::: Add a num headers field to the flac format block.
+
+ //} else if (inMediaType->subtype == MEDIASUBTYPE_OggFLAC_1_0) {
+ // //We are connected to the encoder nd getting individual metadata packets.
+ // sFLACFormatBlock* locFLAC = (sFLACFormatBlock*)inMediaType->pbFormat;
+ // mMuxStream->setConversionParams(locFLAC->samplesPerSec, 1, 10000000);
+ // //debugLog<<"FLAC sample rate = "<<locFLAC->samplesPerSec<<endl;
+ // //mNeedsFLACHeaderTweak = true;
+ // mNeedsFLACHeaderCount = true;
+ //} else if (inMediaType->subtype == MEDIASUBTYPE_FLAC) {
+ // //We are connected directly to the demux and are getting metadata in one block
+ // // Need to use the header splitter class.
+ // sFLACFormatBlock* locFLAC = (sFLACFormatBlock*)inMediaType->pbFormat;
+ // mMuxStream->setConversionParams(locFLAC->samplesPerSec, 1, 10000000);
+ // //debugLog<<"FLAC sample rate = "<<locFLAC->samplesPerSec<<endl;
+ // mNeedsFLACHeaderTweak = true;
+ //}
+
+
+ } else if(inMediaType->majortype == MEDIATYPE_Text) {
+ if (inMediaType->subtype == MEDIASUBTYPE_CMML) {
+ //CMML
+ sCMMLFormatBlock* locCMML = (sCMMLFormatBlock*)inMediaType->pbFormat;
+ mMuxStream->setConversionParams(locCMML->granuleNumerator, locCMML->granuleDenominator, 10000000);
+ mPaginator.setNumHeaders(1);
+
+
+ locWasOK = true;
+ locGranRateNum = locCMML->granuleNumerator;
+ locGranRateDenom = locCMML->granuleDenominator;
+ locNumHeaders = 1;
+ locCodecID = StreamHeaders::CMML;
+ }
+ }
+ if (locWasOK) {
+ //Save the packet, we'll push it into the stream when the connection is established
+ mAnxDataPacket = AnxPacketMaker::makeAnxData_2_0(2,0, locGranRateNum, locGranRateDenom, locNumHeaders, AnxPacketMaker::makeMessageHeaders(locCodecID));
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ////This pushes an anxdata packet into the stream.
+ //HRESULT locHR = OggMuxInputPin::SetMediaType(inMediaType);
+
+ //if (locHR == S_OK) {
+ // debugLog<<"Set media type ok in base class"<<endl;
+ // mPaginator.acceptStampedOggPacket(AnxPacketMaker::makeAnxData_2_0(mMuxStream, &mPaginator));
+ //}
+
+ //return locHR;
+
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,60 +1,60 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2003, 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-
-#include "oggmuxdllstuff.h"
-#include "OggMuxInputPin.h"
-#include "AnxMuxFilter.h"
-#include "AnxPacketMaker.h"
-
-
-#include <fstream>
-using namespace std;
-
-class AnxMuxFilter;
-class AnxMuxInputPin
- : public OggMuxInputPin
-{
-public:
- AnxMuxInputPin(AnxMuxFilter* inOwningFilter, CCritSec* inFilterLock, HRESULT* inHR, OggMuxStream* inMuxStream);
- ~AnxMuxInputPin(void);
-
- virtual HRESULT CompleteConnect(IPin* inReceivePin);
- virtual HRESULT SetMediaType(const CMediaType* inMediaType);
-
-protected:
- fstream debugLog;
-
- StampedOggPacket* mAnxDataPacket;
-};
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+
+#include "oggmuxdllstuff.h"
+#include "OggMuxInputPin.h"
+#include "AnxMuxFilter.h"
+#include "AnxPacketMaker.h"
+
+
+#include <fstream>
+using namespace std;
+
+class AnxMuxFilter;
+class AnxMuxInputPin
+ : public OggMuxInputPin
+{
+public:
+ AnxMuxInputPin(AnxMuxFilter* inOwningFilter, CCritSec* inFilterLock, HRESULT* inHR, OggMuxStream* inMuxStream);
+ ~AnxMuxInputPin(void);
+
+ virtual HRESULT CompleteConnect(IPin* inReceivePin);
+ virtual HRESULT SetMediaType(const CMediaType* inMediaType);
+
+protected:
+ fstream debugLog;
+
+ StampedOggPacket* mAnxDataPacket;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxMuxInputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPacketMaker.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPacketMaker.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPacketMaker.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,278 +1,278 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2003, 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include ".\anxpacketmaker.h"
-
-AnxPacketMaker::AnxPacketMaker(void)
-{
-}
-
-AnxPacketMaker::~AnxPacketMaker(void)
-{
-}
-
-OggPage* AnxPacketMaker::makeAnnodexBOS_2_0 ( unsigned long inSerialNo
- , unsigned short inVersionMajor
- , unsigned short inVersionMinor
- , unsigned __int64 inTimebaseNum
- , unsigned __int64 inTimebaseDenom
- , const unsigned char* inUTC
-
- )
-{
- unsigned char* locBuff = NULL;
- StampedOggPacket* locPack = NULL;
- OggPage* retPage = NULL;
- unsigned char* locSegTable = NULL;
- switch (inVersionMajor) {
- case 2:
- locBuff = new unsigned char[ANX_2_0_ANNODEX_BOS_SIZE];
-
- // 0 - 7 Annodex\0
- // 8 - 9 Version Major
- // 10 - 11 Version Minor
- // 12 - 19 Timebase Num
- // 20 - 27 Timebase Denom
- // 28 = 48 UTC
- locBuff[0] = 'A';
- locBuff[1] = 'n';
- locBuff[2] = 'n';
- locBuff[3] = 'o';
- locBuff[4] = 'd';
- locBuff[5] = 'e';
- locBuff[6] = 'x';
- locBuff[7] = 0;
- iLE_Math::UShortToCharArr(inVersionMajor, locBuff + 8);
- iLE_Math::UShortToCharArr(inVersionMinor, locBuff + 10);
- iLE_Math::Int64ToCharArr(inTimebaseNum, locBuff + 12);
- iLE_Math::Int64ToCharArr(inTimebaseDenom, locBuff + 20);
- for (int i = 0; i < 20; i++) {
- locBuff[28 + i] = inUTC[i];
- }
-
- locPack = new StampedOggPacket(locBuff, ANX_2_0_ANNODEX_BOS_SIZE, false, false, 0, 0, StampedOggPacket::OGG_END_ONLY);
-
- retPage = new OggPage;
- retPage->header()->setHeaderFlags(2);
- retPage->header()->setGranulePos((__int64)0);
- retPage->header()->setNumPageSegments( 1);
- locSegTable = new unsigned char[1];
- locSegTable[0] = ANX_2_0_ANNODEX_BOS_SIZE;
- retPage->header()->setSegmentTable(locSegTable, 1);
- retPage->header()->setHeaderSize(28);
- retPage->header()->setDataSize(ANX_2_0_ANNODEX_BOS_SIZE);
-
- retPage->header()->setStreamSerialNo(inSerialNo);
- retPage->addPacket(locPack);
-
- return retPage;
-
- default:
- return NULL;
-
-
- }
-}
-
-StampedOggPacket* AnxPacketMaker::makeAnxData_2_0 ( unsigned short inVersionMajor
- , unsigned short inVersionMinor
- , unsigned __int64 inGranuleRateNum
- , unsigned __int64 inGranuleRateDenom
- , unsigned long inNumSecHeaders
- , vector<string> inMessageHeaders
- )
-{
-
- StampedOggPacket* locPack = NULL;
- //OggPage* retPage = NULL;
- unsigned char* locBuff = NULL;
- unsigned long locUpto = 0;
- unsigned long locPacketSize = 0;
- switch (inVersionMajor) {
- case 2:
- //ASSERT(inMessageHeaders.size() > 0)
- //THere has to be a content type field.
-
- locPacketSize = 28; //Base header size
- for (int i = 0; i < inMessageHeaders.size(); i++) {
- //2 is the crlf
- locPacketSize += inMessageHeaders[i].size() + 2;
- }
-
- //terminating crlf
- locPacketSize += 2;
-
- locBuff = new unsigned char[locPacketSize];
-
- locBuff[0] = 'A';
- locBuff[1] = 'n';
- locBuff[2] = 'x';
- locBuff[3] = 'D';
- locBuff[4] = 'a';
- locBuff[5] = 't';
- locBuff[6] = 'a';
- locBuff[7] = 0;
-
- iLE_Math::Int64ToCharArr(inGranuleRateNum, locBuff + 8);
- iLE_Math::Int64ToCharArr(inGranuleRateDenom, locBuff + 16);
- iLE_Math::ULongToCharArr(inNumSecHeaders, locBuff + 24);
- locUpto = 28;
- for (int i = 0; i < inMessageHeaders.size(); i++) {
- memcpy((void*)(locBuff + locUpto), (const void*)(inMessageHeaders[i].c_str()), inMessageHeaders[i].size());
- locUpto += inMessageHeaders[i].size();
- //TODO::: How terminated ??
- locBuff[locUpto++] = '\r';
- locBuff[locUpto++] = '\n';
- }
-
- locBuff[locUpto++] = '\r';
- locBuff[locUpto++] = '\n';
-
- locPack = new StampedOggPacket(locBuff, locPacketSize, false, false, 0, 0, StampedOggPacket::OGG_END_ONLY);
- return locPack;
-
-
-
-
- default:
- return NULL;
- }
-}
-
-//StampedOggPacket* AnxPacketMaker::makeAnxData_2_0 (OggMuxStream* inMuxStream, OggPaginator* inPaginator)
-//{
-// return makeAnxData_2_0( 2
-// , 0
-// , inMuxStream->granuleNumerator()
-// , inMuxStream->granuleDenominator()
-// , inPaginator->numHeaders()
-// , makeMessageHeaders(inMuxStream));
-//}
-
-//StreamHeaders::eCodecType AnxPacketMaker::IdentifyCodec(OggPacket* inOggPacket) {
-// if (strncmp((char*)inOggPacket->packetData(), "\001vorbis", 7) == 0) {
-// return StreamHeaders::VORBIS;
-// } else if (strncmp((char*)inOggPacket->packetData(), "Speex ", 8) == 0) {
-// return StreamHeaders::SPEEX;
-// } else if ((strncmp((char*)inOggPacket->packetData(), "fLaC", 4)) == 0) {
-// return StreamHeaders::FLAC;
-// } else if ((strncmp((char*)inOggPacket->packetData(), "\177FLAC", 5)) == 0) {
-// return StreamHeaders::OGG_FLAC_1_0;
-// } else if ((strncmp((char*)inOggPacket->packetData(), "\200theora", 7)) == 0) {
-// return StreamHeaders::THEORA;
-// } else if ((strncmp((char*)inOggPacket->packetData(), "\001video\000\000\000", 9)) == 0) {
-// return StreamHeaders::FFDSHOW_VIDEO;
-// }
-//
-// return StreamHeaders::NONE;
-//
-//}
-
-
-//vector<string> AnxPacketMaker::makeMessageHeaders(OggMuxStream* inMuxStream) {
-// string locTempString = "";
-// vector<string> retVector;
-// switch(IdentifyCodec(inMuxStream->peekFront()->getPacket(0))) {
-// case StreamHeaders::VORBIS:
-// locTempString = "Content-type: audio/x-vorbis";
-// retVector.push_back(locTempString);
-// break;
-// case StreamHeaders::SPEEX:
-// locTempString = "Content-type: audio/x-speex";
-// retVector.push_back(locTempString);
-// break;
-// case StreamHeaders::FLAC:
-// locTempString = "Content-type: audio/x-flac";
-// retVector.push_back(locTempString);
-// break;
-// case StreamHeaders::OGG_FLAC_1_0:
-// locTempString = "Content-type: audio/x-flac_1_0";
-// retVector.push_back(locTempString);
-// break;
-// case StreamHeaders::THEORA:
-// locTempString = "Content-type: video/x-theora";
-// retVector.push_back(locTempString);
-// break;
-// case StreamHeaders::FFDSHOW_VIDEO:
-// locTempString = "Content-type: video/x-ogm";
-// retVector.push_back(locTempString);
-// break;
-// case StreamHeaders::NONE:
-// default:
-// break;
-// }
-//
-// return retVector;
-//}
-
-
-vector<string> AnxPacketMaker::makeMessageHeaders(StreamHeaders::eCodecType inCodecType) {
- string locTempString = "";
- vector<string> retVector;
- switch(inCodecType) {
- case StreamHeaders::VORBIS:
- locTempString = "Content-type: audio/x-vorbis";
- retVector.push_back(locTempString);
- break;
- case StreamHeaders::SPEEX:
- locTempString = "Content-type: audio/x-speex";
- retVector.push_back(locTempString);
- break;
- case StreamHeaders::FLAC:
- locTempString = "Content-type: audio/x-flac";
- retVector.push_back(locTempString);
- break;
- case StreamHeaders::OGG_FLAC_1_0:
- locTempString = "Content-type: audio/x-flac_1_0";
- retVector.push_back(locTempString);
- break;
- case StreamHeaders::THEORA:
- locTempString = "Content-type: video/x-theora";
- retVector.push_back(locTempString);
- break;
- case StreamHeaders::FFDSHOW_VIDEO:
- locTempString = "Content-type: video/x-ogm";
- retVector.push_back(locTempString);
- break;
- case StreamHeaders::CMML:
- locTempString = "Content-type: text/x-cmml";
- retVector.push_back(locTempString);
- break;
- case StreamHeaders::NONE:
- default:
- break;
- }
-
- return retVector;
-}
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include ".\anxpacketmaker.h"
+
+AnxPacketMaker::AnxPacketMaker(void)
+{
+}
+
+AnxPacketMaker::~AnxPacketMaker(void)
+{
+}
+
+OggPage* AnxPacketMaker::makeAnnodexBOS_2_0 ( unsigned long inSerialNo
+ , unsigned short inVersionMajor
+ , unsigned short inVersionMinor
+ , unsigned __int64 inTimebaseNum
+ , unsigned __int64 inTimebaseDenom
+ , const unsigned char* inUTC
+
+ )
+{
+ unsigned char* locBuff = NULL;
+ StampedOggPacket* locPack = NULL;
+ OggPage* retPage = NULL;
+ unsigned char* locSegTable = NULL;
+ switch (inVersionMajor) {
+ case 2:
+ locBuff = new unsigned char[ANX_2_0_ANNODEX_BOS_SIZE];
+
+ // 0 - 7 Annodex\0
+ // 8 - 9 Version Major
+ // 10 - 11 Version Minor
+ // 12 - 19 Timebase Num
+ // 20 - 27 Timebase Denom
+ // 28 = 48 UTC
+ locBuff[0] = 'A';
+ locBuff[1] = 'n';
+ locBuff[2] = 'n';
+ locBuff[3] = 'o';
+ locBuff[4] = 'd';
+ locBuff[5] = 'e';
+ locBuff[6] = 'x';
+ locBuff[7] = 0;
+ iLE_Math::UShortToCharArr(inVersionMajor, locBuff + 8);
+ iLE_Math::UShortToCharArr(inVersionMinor, locBuff + 10);
+ iLE_Math::Int64ToCharArr(inTimebaseNum, locBuff + 12);
+ iLE_Math::Int64ToCharArr(inTimebaseDenom, locBuff + 20);
+ for (int i = 0; i < 20; i++) {
+ locBuff[28 + i] = inUTC[i];
+ }
+
+ locPack = new StampedOggPacket(locBuff, ANX_2_0_ANNODEX_BOS_SIZE, false, false, 0, 0, StampedOggPacket::OGG_END_ONLY);
+
+ retPage = new OggPage;
+ retPage->header()->setHeaderFlags(2);
+ retPage->header()->setGranulePos((__int64)0);
+ retPage->header()->setNumPageSegments( 1);
+ locSegTable = new unsigned char[1];
+ locSegTable[0] = ANX_2_0_ANNODEX_BOS_SIZE;
+ retPage->header()->setSegmentTable(locSegTable, 1);
+ retPage->header()->setHeaderSize(28);
+ retPage->header()->setDataSize(ANX_2_0_ANNODEX_BOS_SIZE);
+
+ retPage->header()->setStreamSerialNo(inSerialNo);
+ retPage->addPacket(locPack);
+
+ return retPage;
+
+ default:
+ return NULL;
+
+
+ }
+}
+
+StampedOggPacket* AnxPacketMaker::makeAnxData_2_0 ( unsigned short inVersionMajor
+ , unsigned short inVersionMinor
+ , unsigned __int64 inGranuleRateNum
+ , unsigned __int64 inGranuleRateDenom
+ , unsigned long inNumSecHeaders
+ , vector<string> inMessageHeaders
+ )
+{
+
+ StampedOggPacket* locPack = NULL;
+ //OggPage* retPage = NULL;
+ unsigned char* locBuff = NULL;
+ unsigned long locUpto = 0;
+ unsigned long locPacketSize = 0;
+ switch (inVersionMajor) {
+ case 2:
+ //ASSERT(inMessageHeaders.size() > 0)
+ //THere has to be a content type field.
+
+ locPacketSize = 28; //Base header size
+ for (int i = 0; i < inMessageHeaders.size(); i++) {
+ //2 is the crlf
+ locPacketSize += inMessageHeaders[i].size() + 2;
+ }
+
+ //terminating crlf
+ locPacketSize += 2;
+
+ locBuff = new unsigned char[locPacketSize];
+
+ locBuff[0] = 'A';
+ locBuff[1] = 'n';
+ locBuff[2] = 'x';
+ locBuff[3] = 'D';
+ locBuff[4] = 'a';
+ locBuff[5] = 't';
+ locBuff[6] = 'a';
+ locBuff[7] = 0;
+
+ iLE_Math::Int64ToCharArr(inGranuleRateNum, locBuff + 8);
+ iLE_Math::Int64ToCharArr(inGranuleRateDenom, locBuff + 16);
+ iLE_Math::ULongToCharArr(inNumSecHeaders, locBuff + 24);
+ locUpto = 28;
+ for (int i = 0; i < inMessageHeaders.size(); i++) {
+ memcpy((void*)(locBuff + locUpto), (const void*)(inMessageHeaders[i].c_str()), inMessageHeaders[i].size());
+ locUpto += inMessageHeaders[i].size();
+ //TODO::: How terminated ??
+ locBuff[locUpto++] = '\r';
+ locBuff[locUpto++] = '\n';
+ }
+
+ locBuff[locUpto++] = '\r';
+ locBuff[locUpto++] = '\n';
+
+ locPack = new StampedOggPacket(locBuff, locPacketSize, false, false, 0, 0, StampedOggPacket::OGG_END_ONLY);
+ return locPack;
+
+
+
+
+ default:
+ return NULL;
+ }
+}
+
+//StampedOggPacket* AnxPacketMaker::makeAnxData_2_0 (OggMuxStream* inMuxStream, OggPaginator* inPaginator)
+//{
+// return makeAnxData_2_0( 2
+// , 0
+// , inMuxStream->granuleNumerator()
+// , inMuxStream->granuleDenominator()
+// , inPaginator->numHeaders()
+// , makeMessageHeaders(inMuxStream));
+//}
+
+//StreamHeaders::eCodecType AnxPacketMaker::IdentifyCodec(OggPacket* inOggPacket) {
+// if (strncmp((char*)inOggPacket->packetData(), "\001vorbis", 7) == 0) {
+// return StreamHeaders::VORBIS;
+// } else if (strncmp((char*)inOggPacket->packetData(), "Speex ", 8) == 0) {
+// return StreamHeaders::SPEEX;
+// } else if ((strncmp((char*)inOggPacket->packetData(), "fLaC", 4)) == 0) {
+// return StreamHeaders::FLAC;
+// } else if ((strncmp((char*)inOggPacket->packetData(), "\177FLAC", 5)) == 0) {
+// return StreamHeaders::OGG_FLAC_1_0;
+// } else if ((strncmp((char*)inOggPacket->packetData(), "\200theora", 7)) == 0) {
+// return StreamHeaders::THEORA;
+// } else if ((strncmp((char*)inOggPacket->packetData(), "\001video\000\000\000", 9)) == 0) {
+// return StreamHeaders::FFDSHOW_VIDEO;
+// }
+//
+// return StreamHeaders::NONE;
+//
+//}
+
+
+//vector<string> AnxPacketMaker::makeMessageHeaders(OggMuxStream* inMuxStream) {
+// string locTempString = "";
+// vector<string> retVector;
+// switch(IdentifyCodec(inMuxStream->peekFront()->getPacket(0))) {
+// case StreamHeaders::VORBIS:
+// locTempString = "Content-type: audio/x-vorbis";
+// retVector.push_back(locTempString);
+// break;
+// case StreamHeaders::SPEEX:
+// locTempString = "Content-type: audio/x-speex";
+// retVector.push_back(locTempString);
+// break;
+// case StreamHeaders::FLAC:
+// locTempString = "Content-type: audio/x-flac";
+// retVector.push_back(locTempString);
+// break;
+// case StreamHeaders::OGG_FLAC_1_0:
+// locTempString = "Content-type: audio/x-flac_1_0";
+// retVector.push_back(locTempString);
+// break;
+// case StreamHeaders::THEORA:
+// locTempString = "Content-type: video/x-theora";
+// retVector.push_back(locTempString);
+// break;
+// case StreamHeaders::FFDSHOW_VIDEO:
+// locTempString = "Content-type: video/x-ogm";
+// retVector.push_back(locTempString);
+// break;
+// case StreamHeaders::NONE:
+// default:
+// break;
+// }
+//
+// return retVector;
+//}
+
+
+vector<string> AnxPacketMaker::makeMessageHeaders(StreamHeaders::eCodecType inCodecType) {
+ string locTempString = "";
+ vector<string> retVector;
+ switch(inCodecType) {
+ case StreamHeaders::VORBIS:
+ locTempString = "Content-type: audio/x-vorbis";
+ retVector.push_back(locTempString);
+ break;
+ case StreamHeaders::SPEEX:
+ locTempString = "Content-type: audio/x-speex";
+ retVector.push_back(locTempString);
+ break;
+ case StreamHeaders::FLAC:
+ locTempString = "Content-type: audio/x-flac";
+ retVector.push_back(locTempString);
+ break;
+ case StreamHeaders::OGG_FLAC_1_0:
+ locTempString = "Content-type: audio/x-flac_1_0";
+ retVector.push_back(locTempString);
+ break;
+ case StreamHeaders::THEORA:
+ locTempString = "Content-type: video/x-theora";
+ retVector.push_back(locTempString);
+ break;
+ case StreamHeaders::FFDSHOW_VIDEO:
+ locTempString = "Content-type: video/x-ogm";
+ retVector.push_back(locTempString);
+ break;
+ case StreamHeaders::CMML:
+ locTempString = "Content-type: text/x-cmml";
+ retVector.push_back(locTempString);
+ break;
+ case StreamHeaders::NONE:
+ default:
+ break;
+ }
+
+ return retVector;
+}
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPacketMaker.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPacketMaker.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPacketMaker.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPacketMaker.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,69 +1,69 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2003, 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-
-#include "StreamHeaders.h"
-
-class AnxPacketMaker
-{
-public:
- AnxPacketMaker(void);
- ~AnxPacketMaker(void);
-
- static const ANX_2_0_ANNODEX_BOS_SIZE = 48;
-
- static OggPage* makeAnnodexBOS_2_0 ( unsigned long inSerialNo
- , unsigned short inVersionMajor
- , unsigned short inVersionMinor
- , unsigned __int64 inTimebaseNum
- , unsigned __int64 inTimebaseDenom
- , const unsigned char* inUTC
- );
-
- static StampedOggPacket* makeAnxData_2_0 ( unsigned short inVersionMajor
- , unsigned short inVersionMinor
- , unsigned __int64 inGranuleRateNum
- , unsigned __int64 inGranuleDenom
- , unsigned long inNumSecHeaders
- , vector<string> inMessageHeaders
- );
-
- static StampedOggPacket* makeAnxData_2_0 (OggMuxStream* inMuxStream, OggPaginator* inPaginator);
- //static StampedOggPacket* makeAnxData (OggMuxStream* inMuxStream, OggPaginator* inPaginator);
-
- //static StreamHeaders::eCodecType AnxPacketMaker::IdentifyCodec(OggPacket* inOggPacket);
- //static vector<string> AnxPacketMaker::makeMessageHeaders(OggMuxStream* inMuxStream);
- static vector<string> AnxPacketMaker::makeMessageHeaders(StreamHeaders::eCodecType inCodecType);
-
-};
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+
+#include "StreamHeaders.h"
+
+class AnxPacketMaker
+{
+public:
+ AnxPacketMaker(void);
+ ~AnxPacketMaker(void);
+
+ static const ANX_2_0_ANNODEX_BOS_SIZE = 48;
+
+ static OggPage* makeAnnodexBOS_2_0 ( unsigned long inSerialNo
+ , unsigned short inVersionMajor
+ , unsigned short inVersionMinor
+ , unsigned __int64 inTimebaseNum
+ , unsigned __int64 inTimebaseDenom
+ , const unsigned char* inUTC
+ );
+
+ static StampedOggPacket* makeAnxData_2_0 ( unsigned short inVersionMajor
+ , unsigned short inVersionMinor
+ , unsigned __int64 inGranuleRateNum
+ , unsigned __int64 inGranuleDenom
+ , unsigned long inNumSecHeaders
+ , vector<string> inMessageHeaders
+ );
+
+ static StampedOggPacket* makeAnxData_2_0 (OggMuxStream* inMuxStream, OggPaginator* inPaginator);
+ //static StampedOggPacket* makeAnxData (OggMuxStream* inMuxStream, OggPaginator* inPaginator);
+
+ //static StreamHeaders::eCodecType AnxPacketMaker::IdentifyCodec(OggPacket* inOggPacket);
+ //static vector<string> AnxPacketMaker::makeMessageHeaders(OggMuxStream* inMuxStream);
+ static vector<string> AnxPacketMaker::makeMessageHeaders(StreamHeaders::eCodecType inCodecType);
+
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPacketMaker.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,143 +1,143 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2003, 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include ".\anxpageinterleaver.h"
-
-AnxPageInterleaver::AnxPageInterleaver(IOggCallback* inFileWriter, INotifyComplete* inNotifier, unsigned long inVersionMajor, unsigned long inVersionMinor)
- : OggPageInterleaver(inFileWriter, inNotifier)
- , mVersionMajor(inVersionMajor)
- , mVersionMinor(inVersionMinor)
- , mIsAnxSetup(false)
-{
- //This is the Annodex Logical Stream
- //mInputStreams.push_back(newStream());
-
- //Just make a random serial number
- mAnxSerialNo = 999;
-}
-
-AnxPageInterleaver::~AnxPageInterleaver(void)
-{
-
-}
-
-void AnxPageInterleaver::addAnnodex_2_0_BOS() {
- //Find the CMML data
- //TODO::: Need to grab the data from CMML page
-
- unsigned char* locUTC = new unsigned char[20];
- memset((void*)locUTC, 0, 20);
-
- OggPage* locBOSPage = AnxPacketMaker::makeAnnodexBOS_2_0( mAnxSerialNo
- , 2
- , 0
- , 0
- , 0
- , locUTC);
-
-
- //Put the annodex BOS out to the file.
- mFileWriter->acceptOggPage(locBOSPage);
- delete locUTC;
-
-}
-
-void AnxPageInterleaver::addAllAnxData_2_0_BOS() {
- for (int i = 0; i < mInputStreams.size() - 1; i++) {
- mFileWriter->acceptOggPage(mInputStreams[i]->popFront());
- }
-
-}
-
-void AnxPageInterleaver::addAnnodexEOS() {
- //Make the EOS page and dump it
-
- OggPage* locEOSPage = new OggPage;
-
- locEOSPage->header()->setStreamSerialNo(mAnxSerialNo);
- locEOSPage->header()->setHeaderFlags(4);
- locEOSPage->header()->setHeaderSize(27);
-
- mFileWriter->acceptOggPage(locEOSPage);
-}
-
-bool AnxPageInterleaver::gotAllHeaders() {
- //TODO::: The isActive needs to be clarified so we don't start empty streams because wasany goes to true
-
- bool locWasAny = false;
- bool locIsOK = true;
- for (int i = 0; i < mInputStreams.size(); i++) {
- if (mInputStreams[i]->isActive()) {
- locWasAny = true;
- //if ((mInputStreams[i]->peekFront() != NULL) || (!mInputStreams[i]->isActive())) {
- if (mInputStreams[i]->numAvail() > 1) {
-
- locIsOK = locIsOK && true;
- } else {
- locIsOK = false;
- }
- }
- }
-
- return locWasAny && locIsOK;
-
-
-}
-void AnxPageInterleaver::processData()
-{
- if ((mVersionMajor == 2) && (mVersionMinor == 0)) {
- //IF seen all headers
- // CREATE ANNODEX BOS
- // CREATE ANXDATA BOS's
- // CREATE ANNODEX EOS
- //ELSE
- // DO NOTHING
- //ENDIF
- //
-
- if (!mIsAnxSetup) {
- if (gotAllHeaders()) {
- mIsAnxSetup = true;
- addAnnodex_2_0_BOS();
- addAllAnxData_2_0_BOS();
- addAnnodexEOS();
- //TODO::: Pump out these start pages.
- }
- } else {
- OggPageInterleaver::processData();
- }
- } else {
- throw 0;
- }
-}
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include ".\anxpageinterleaver.h"
+
+AnxPageInterleaver::AnxPageInterleaver(IOggCallback* inFileWriter, INotifyComplete* inNotifier, unsigned long inVersionMajor, unsigned long inVersionMinor)
+ : OggPageInterleaver(inFileWriter, inNotifier)
+ , mVersionMajor(inVersionMajor)
+ , mVersionMinor(inVersionMinor)
+ , mIsAnxSetup(false)
+{
+ //This is the Annodex Logical Stream
+ //mInputStreams.push_back(newStream());
+
+ //Just make a random serial number
+ mAnxSerialNo = 999;
+}
+
+AnxPageInterleaver::~AnxPageInterleaver(void)
+{
+
+}
+
+void AnxPageInterleaver::addAnnodex_2_0_BOS() {
+ //Find the CMML data
+ //TODO::: Need to grab the data from CMML page
+
+ unsigned char* locUTC = new unsigned char[20];
+ memset((void*)locUTC, 0, 20);
+
+ OggPage* locBOSPage = AnxPacketMaker::makeAnnodexBOS_2_0( mAnxSerialNo
+ , 2
+ , 0
+ , 0
+ , 0
+ , locUTC);
+
+
+ //Put the annodex BOS out to the file.
+ mFileWriter->acceptOggPage(locBOSPage);
+ delete locUTC;
+
+}
+
+void AnxPageInterleaver::addAllAnxData_2_0_BOS() {
+ for (int i = 0; i < mInputStreams.size() - 1; i++) {
+ mFileWriter->acceptOggPage(mInputStreams[i]->popFront());
+ }
+
+}
+
+void AnxPageInterleaver::addAnnodexEOS() {
+ //Make the EOS page and dump it
+
+ OggPage* locEOSPage = new OggPage;
+
+ locEOSPage->header()->setStreamSerialNo(mAnxSerialNo);
+ locEOSPage->header()->setHeaderFlags(4);
+ locEOSPage->header()->setHeaderSize(27);
+
+ mFileWriter->acceptOggPage(locEOSPage);
+}
+
+bool AnxPageInterleaver::gotAllHeaders() {
+ //TODO::: The isActive needs to be clarified so we don't start empty streams because wasany goes to true
+
+ bool locWasAny = false;
+ bool locIsOK = true;
+ for (int i = 0; i < mInputStreams.size(); i++) {
+ if (mInputStreams[i]->isActive()) {
+ locWasAny = true;
+ //if ((mInputStreams[i]->peekFront() != NULL) || (!mInputStreams[i]->isActive())) {
+ if (mInputStreams[i]->numAvail() > 1) {
+
+ locIsOK = locIsOK && true;
+ } else {
+ locIsOK = false;
+ }
+ }
+ }
+
+ return locWasAny && locIsOK;
+
+
+}
+void AnxPageInterleaver::processData()
+{
+ if ((mVersionMajor == 2) && (mVersionMinor == 0)) {
+ //IF seen all headers
+ // CREATE ANNODEX BOS
+ // CREATE ANXDATA BOS's
+ // CREATE ANNODEX EOS
+ //ELSE
+ // DO NOTHING
+ //ENDIF
+ //
+
+ if (!mIsAnxSetup) {
+ if (gotAllHeaders()) {
+ mIsAnxSetup = true;
+ addAnnodex_2_0_BOS();
+ addAllAnxData_2_0_BOS();
+ addAnnodexEOS();
+ //TODO::: Pump out these start pages.
+ }
+ } else {
+ OggPageInterleaver::processData();
+ }
+ } else {
+ throw 0;
+ }
+}
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,62 +1,62 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2003, 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-
-#include "OggPageInterleaver.h"
-#include "AnxPacketMaker.h"
-class AnxPageInterleaver
- : public OggPageInterleaver
-{
-public:
- AnxPageInterleaver(IOggCallback* inFileWriter, INotifyComplete* inNotifier, unsigned long inVersionMajor, unsigned long inVersionMinor);
- virtual ~AnxPageInterleaver(void);
-
-
-
- virtual void processData();
-
-
-protected:
- void addAnnodex_2_0_BOS();
- void addAllAnxData_2_0_BOS();
- void addAnnodexEOS();
- bool gotAllHeaders();
-
- bool mIsAnxSetup;
-
- unsigned long mVersionMajor;
- unsigned long mVersionMinor;
-
- unsigned long mAnxSerialNo;
-};
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+
+#include "OggPageInterleaver.h"
+#include "AnxPacketMaker.h"
+class AnxPageInterleaver
+ : public OggPageInterleaver
+{
+public:
+ AnxPageInterleaver(IOggCallback* inFileWriter, INotifyComplete* inNotifier, unsigned long inVersionMajor, unsigned long inVersionMinor);
+ virtual ~AnxPageInterleaver(void);
+
+
+
+ virtual void processData();
+
+
+protected:
+ void addAnnodex_2_0_BOS();
+ void addAllAnxData_2_0_BOS();
+ void addAnnodexEOS();
+ bool gotAllHeaders();
+
+ bool mIsAnxSetup;
+
+ unsigned long mVersionMajor;
+ unsigned long mVersionMinor;
+
+ unsigned long mAnxSerialNo;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/AnxPageInterleaver.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/anxmuxdllstuff.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/anxmuxdllstuff.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/anxmuxdllstuff.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,116 +1,116 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2003 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "anxmuxdllstuff.h"
-
-
-
-extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
-BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
-{
- return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
-}
-
-
-//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
-STDAPI DllRegisterServer()
-{
- fstream debugLog;
- debugLog.open("G:\\logs\\anxmuxreg.log", ios_base::out);
- //TO DO::: Should we be releasing the filter mapper even when we return early ?
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(TRUE);
- if (FAILED(hr)) {
-
- return hr;
- }
-
-
- debugLog<<"Pre - create"<<endl;
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
- debugLog<<"Post - create"<<endl;
-
- if (FAILED(hr)) {
- debugLog<<"Failed Create"<<endl;
- return hr;
- }
-
- debugLog<<"Pre reg"<<endl;
- hr = locFilterMapper->RegisterFilter(
- CLSID_AnxMuxFilter, // Filter CLSID.
- L"Annodex Mux Filter", // Filter name.
- NULL, // Device moniker.
- &CLSID_LegacyAmFilterCategory, // Direct Show general category
- L"Annodex Mux Filter", // Instance data. ???????
- &AnxMuxFilterReg // Pointer to filter information.
- );
- debugLog<<"Post reg"<<endl;
-
-
- locFilterMapper->Release();
-
- return hr;
-
-}
-
-STDAPI DllUnregisterServer()
-{
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(FALSE);
- if (FAILED(hr)) {
-
- return hr;
- }
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
- IID_IFilterMapper2, (void **)&locFilterMapper);
-
- if (FAILED(hr)) {
- return hr;
- }
-
-
- hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory,
- L"Annodex Mux Filter", CLSID_AnxMuxFilter);
-
- //
- locFilterMapper->Release();
- return hr;
-
-}
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "anxmuxdllstuff.h"
+
+
+
+extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
+BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+ return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
+}
+
+
+//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
+STDAPI DllRegisterServer()
+{
+ fstream debugLog;
+ debugLog.open("G:\\logs\\anxmuxreg.log", ios_base::out);
+ //TO DO::: Should we be releasing the filter mapper even when we return early ?
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(TRUE);
+ if (FAILED(hr)) {
+
+ return hr;
+ }
+
+
+ debugLog<<"Pre - create"<<endl;
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
+ debugLog<<"Post - create"<<endl;
+
+ if (FAILED(hr)) {
+ debugLog<<"Failed Create"<<endl;
+ return hr;
+ }
+
+ debugLog<<"Pre reg"<<endl;
+ hr = locFilterMapper->RegisterFilter(
+ CLSID_AnxMuxFilter, // Filter CLSID.
+ L"Annodex Mux Filter", // Filter name.
+ NULL, // Device moniker.
+ &CLSID_LegacyAmFilterCategory, // Direct Show general category
+ L"Annodex Mux Filter", // Instance data. ???????
+ &AnxMuxFilterReg // Pointer to filter information.
+ );
+ debugLog<<"Post reg"<<endl;
+
+
+ locFilterMapper->Release();
+
+ return hr;
+
+}
+
+STDAPI DllUnregisterServer()
+{
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(FALSE);
+ if (FAILED(hr)) {
+
+ return hr;
+ }
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
+ IID_IFilterMapper2, (void **)&locFilterMapper);
+
+ if (FAILED(hr)) {
+ return hr;
+ }
+
+
+ hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory,
+ L"Annodex Mux Filter", CLSID_AnxMuxFilter);
+
+ //
+ locFilterMapper->Release();
+ return hr;
+
+}
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/anxmuxdllstuff.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/anxmuxdllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/anxmuxdllstuff.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/anxmuxdllstuff.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,115 +1,115 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2003, 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-
-//#ifdef DSFANXMUX_EXPORTS
-//#define DSFANXMUX_API __declspec(dllexport)
-//#else
-//#define DSFANXMUX_API __declspec(dllimport)
-//#endif
-#ifdef DSFOGGMUX_EXPORTS
-#pragma message("----> Exporting from Ogg Mux...")
-#define OGG_MUX_API __declspec(dllexport)
-#else
-#pragma message("<---- Importing from Ogg Mux...")
-#define OGG_MUX_API __declspec(dllimport)
-#endif
-
-
-// {6C5746D3-D309-4988-8694-D435AB86460D}
-DEFINE_GUID(CLSID_AnxMuxFilter,
-0x6c5746d3, 0xd309, 0x4988, 0x86, 0x94, 0xd4, 0x35, 0xab, 0x86, 0x46, 0xd);
-
-
-//// {53696C76-6961-40b2-B136-436F6E726164}
-//DEFINE_GUID(FORMAT_CMML,
-//0x53696c76, 0x6961, 0x40b2, 0xb1, 0x36, 0x43, 0x6f, 0x6e, 0x72, 0x61, 0x64);
-//
-//
-//// {5A656E74-6172-6F26-B79C-D6416E647282}
-//DEFINE_GUID(MEDIASUBTYPE_CMML,
-//0x5a656e74, 0x6172, 0x6f26, 0xb7, 0x9c, 0xd6, 0x41, 0x6e, 0x64, 0x72, 0x82);
-
-// {BF1121D1-8739-45e1-BCD8-90B828F643AB}
-DEFINE_GUID(CLSID_CMMLDecodeFilter,
-0xbf1121d1, 0x8739, 0x45e1, 0xbc, 0xd8, 0x90, 0xb8, 0x28, 0xf6, 0x43, 0xab);
-
-
-//const REGPINTYPES AnxMuxInputTypes[] = {
-// {
-// &MEDIATYPE_Audio,
-// &MEDIASUBTYPE_Speex
-// },
-// {
-// &MEDIATYPE_Audio,
-// &MEDIASUBTYPE_Vorbis
-// },
-// {
-// &MEDIATYPE_Audio,
-// &MEDIASUBTYPE_OggFLAC_1_0
-// },
-// {
-// &MEDIATYPE_Video,
-// &MEDIASUBTYPE_Theora
-// },
-// {
-// &MEDIATYPE_Audio,
-// &MEDIASUBTYPE_FLAC
-// }
-//};
-//const REGFILTERPINS AnxMuxPinReg = {
-//
-// L"Ogg Packet Input", //Name (obsoleted)
-// TRUE, //Renders from this pin ?? Not sure about this.
-// FALSE, //Not an output pin
-// FALSE, //Cannot have zero instances of this pin
-// FALSE, //Cannot have more than one instance of this pin
-// NULL, //Connects to filter (obsoleted)
-// NULL, //Connects to pin (obsoleted)
-// 5, //upport two media type
-// AnxMuxInputTypes //Pointer to media type (Audio/Vorbis or Audio/Speex)
-//};
-
-const REGFILTER2 AnxMuxFilterReg = {
- 1,
- MERIT_DO_NOT_USE,
- 1,
- NULL
-
-};
-
-//struct sCMMLFormatBlock {
-// __int64 granuleNumerator;
-// __int64 granuleDenominator;
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+
+//#ifdef DSFANXMUX_EXPORTS
+//#define DSFANXMUX_API __declspec(dllexport)
+//#else
+//#define DSFANXMUX_API __declspec(dllimport)
+//#endif
+#ifdef DSFOGGMUX_EXPORTS
+#pragma message("----> Exporting from Ogg Mux...")
+#define OGG_MUX_API __declspec(dllexport)
+#else
+#pragma message("<---- Importing from Ogg Mux...")
+#define OGG_MUX_API __declspec(dllimport)
+#endif
+
+
+// {6C5746D3-D309-4988-8694-D435AB86460D}
+DEFINE_GUID(CLSID_AnxMuxFilter,
+0x6c5746d3, 0xd309, 0x4988, 0x86, 0x94, 0xd4, 0x35, 0xab, 0x86, 0x46, 0xd);
+
+
+//// {53696C76-6961-40b2-B136-436F6E726164}
+//DEFINE_GUID(FORMAT_CMML,
+//0x53696c76, 0x6961, 0x40b2, 0xb1, 0x36, 0x43, 0x6f, 0x6e, 0x72, 0x61, 0x64);
+//
+//
+//// {5A656E74-6172-6F26-B79C-D6416E647282}
+//DEFINE_GUID(MEDIASUBTYPE_CMML,
+//0x5a656e74, 0x6172, 0x6f26, 0xb7, 0x9c, 0xd6, 0x41, 0x6e, 0x64, 0x72, 0x82);
+
+// {BF1121D1-8739-45e1-BCD8-90B828F643AB}
+DEFINE_GUID(CLSID_CMMLDecodeFilter,
+0xbf1121d1, 0x8739, 0x45e1, 0xbc, 0xd8, 0x90, 0xb8, 0x28, 0xf6, 0x43, 0xab);
+
+
+//const REGPINTYPES AnxMuxInputTypes[] = {
+// {
+// &MEDIATYPE_Audio,
+// &MEDIASUBTYPE_Speex
+// },
+// {
+// &MEDIATYPE_Audio,
+// &MEDIASUBTYPE_Vorbis
+// },
+// {
+// &MEDIATYPE_Audio,
+// &MEDIASUBTYPE_OggFLAC_1_0
+// },
+// {
+// &MEDIATYPE_Video,
+// &MEDIASUBTYPE_Theora
+// },
+// {
+// &MEDIATYPE_Audio,
+// &MEDIASUBTYPE_FLAC
+// }
+//};
+//const REGFILTERPINS AnxMuxPinReg = {
+//
+// L"Ogg Packet Input", //Name (obsoleted)
+// TRUE, //Renders from this pin ?? Not sure about this.
+// FALSE, //Not an output pin
+// FALSE, //Cannot have zero instances of this pin
+// FALSE, //Cannot have more than one instance of this pin
+// NULL, //Connects to filter (obsoleted)
+// NULL, //Connects to pin (obsoleted)
+// 5, //upport two media type
+// AnxMuxInputTypes //Pointer to media type (Audio/Vorbis or Audio/Speex)
+//};
+
+const REGFILTER2 AnxMuxFilterReg = {
+ 1,
+ MERIT_DO_NOT_USE,
+ 1,
+ NULL
+
+};
+
+//struct sCMMLFormatBlock {
+// __int64 granuleNumerator;
+// __int64 granuleDenominator;
//};
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/anxmuxdllstuff.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/dsfAnxMux.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/dsfAnxMux.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/dsfAnxMux.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,21 +1,21 @@
-// dsfAnxMux.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-#include "dsfAnxMux.h"
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
-}
-
+// dsfAnxMux.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+#include "dsfAnxMux.h"
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ switch (ul_reason_for_call)
+ {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
+}
+
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/dsfAnxMux.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/dsfAnxMux.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/dsfAnxMux.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/dsfAnxMux.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,12 +1,12 @@
-// The following ifdef block is the standard way of creating macros which make exporting
-// from a DLL simpler. All files within this DLL are compiled with the DSFANXMUX_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see
-// DSFANXMUX_API functions as being imported from a DLL, whereas this DLL sees symbols
-// defined with this macro as being exported.
-#ifdef DSFANXMUX_EXPORTS
-#define DSFANXMUX_API __declspec(dllexport)
-#else
-#define DSFANXMUX_API __declspec(dllimport)
-#endif
-
+// The following ifdef block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the DSFANXMUX_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// DSFANXMUX_API functions as being imported from a DLL, whereas this DLL sees symbols
+// defined with this macro as being exported.
+#ifdef DSFANXMUX_EXPORTS
+#define DSFANXMUX_API __declspec(dllexport)
+#else
+#define DSFANXMUX_API __declspec(dllimport)
+#endif
+
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/dsfAnxMux.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,42 +1,42 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2003, 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.cpp : source file that includes just the standard includes
-// dsfAnxMux.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.cpp : source file that includes just the standard includes
+// dsfAnxMux.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,51 +1,51 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2003, 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-#include <streams.h>
-#include <initguid.h>
-
-// TODO: reference additional headers your program requires here
-#include "libOOOgg.h"
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+#include <streams.h>
+#include <initguid.h>
+
+// TODO: reference additional headers your program requires here
+#include "libOOOgg.h"
#include "anxmuxdllstuff.h"
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfAnxMux/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPFileSource.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPFileSource.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPFileSource.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,234 +1,234 @@
-#include "StdAfx.h"
-#include ".\cachedhttpfilesource.h"
-
-CachedHTTPFileSource::CachedHTTPFileSource(void)
-
-{
-}
-
-CachedHTTPFileSource::~CachedHTTPFileSource(void)
-{
-}
-
-CachedHTTPFileSource::tMapEntry CachedHTTPFileSource::findNextHoleInData(__int64 inUpto)
-{
-
- tRangeMap::iterator locIt = mRangeMap.upper_bound(inUpto);
-
- //Get the entry correspondingto this value.
- // The decrement is because of the stupid way the bound works in map.
- // The decrement of upper bound gives what you would expect a lower_bound function *should*
- // return... ie the thing lower than the given key.
- tMapEntry locEntry = *(--locIt);
- tMapEntry locNextEntry = *(++locIt);
-
- //If we are in range, then we already have this
- if (inRange(locEntry, inUpto)) {
- bool locDone = false;
-
- while (locIt != mRangeMap.end()) {
- //If the end of this range equals the start of the next range, then there is no hole here !
- if (locEntry.second.first == (locNextEntry.first)) {
- locEntry = *(locIt);
- locNextEntry = *(++locIt);
-
- } else {
- //There is a hole... since the end value of the current range is not the same as the start of the next range
- // So there is a hole from here.end+1 to next.start - 1
- tMapEntry retEntry;
- retEntry.first = locEntry.second.first + 1;
- retEntry.second.first = - 1; //The end becomes -1 until something goes in
- return retEntry;
-
- }
- }
- } else {
- //This upto point is not in a known range.
- tMapEntry retEntry;
- retEntry.first = locEntry.second.first + 1;
- retEntry.second.first = - 1; //The end becomes -1 until something goes in
- return retEntry;
-
- }
-}
-
-bool CachedHTTPFileSource::startThread() {
- if (ThreadExists() == FALSE) {
- Create();
- }
- CallWorker(THREAD_RUN);
- return true;
-}
-
-DWORD CachedHTTPFileSource::ThreadProc(void) {
- //debugLog<<"ThreadProc:"<<endl;
- while(true) {
- DWORD locThreadCommand = GetRequest();
-
- switch(locThreadCommand) {
- case THREAD_EXIT:
-
- Reply(S_OK);
- return S_OK;
-
-
-
- case THREAD_RUN:
-
- Reply(S_OK);
- DataProcessLoop();
- break;
- }
-
-
- }
- return S_OK;
-}
-bool CachedHTTPFileSource::inRange(CachedHTTPFileSource::tMapEntry inTestRange, __int64 inTestValue) {
-
- return ((inTestRange.first <= inTestValue) && (inTestRange.second.first >= inTestValue));
-
-
-}
-
-unsigned long CachedHTTPFileSource::seek(unsigned long inPos) {
- //Close the socket down
- //Open up a new one to the same place.
- //Make the partial content request.
- //debugLog<<"Seeking to "<<inPos<<endl;
- if (mReadFile.readSeek(inPos)) {
- return inPos;
- } else {
- return (unsigned long) -1;
- }
-
-}
-
-unsigned long CachedHTTPFileSource::read(char* outBuffer, unsigned long inNumBytes) {
- //Reads from the buffer, will return 0 if nothing in buffer.
- // If it returns 0 check the isEOF flag to see if it was the end of file or the network is just slow.
-
- { //CRITICAL SECTION - PROTECTING STREAM BUFFER
- CAutoLock locLock(mBufferLock);
-
- //debugLog<<"Read:"<<endl;
- if((mReadFile.bytesAvail() == 0) || mWasError) {
- //debugLog<<"read : Can't read is error or eof"<<endl;
- return 0;
- } else {
- //debugLog<<"Reading from buffer"<<endl;
-
- unsigned long locNumRead = mReadFile.read((unsigned char*)outBuffer, inNumBytes);
- /* if (locNumRead == 0) {
- mStreamBuffer.clear();
- }*/
-
- //debugLog<<locNumRead<<" bytes read from buffer"<<endl;
- return locNumRead;
- }
- } //END CRITICAL SECTION
-}
-
-bool CachedHTTPFileSource::open(string inSourceLocation) {
- //Open network connection and start feeding data into a buffer
- //
- // In sourcelocation is a http url
- //
-
- mSeenResponse = false;
- mLastResponse = "";
- //debugLog<<"Open: "<<inSourceLocation<<endl;
-
- { //CRITICAL SECTION - PROTECTING STREAM BUFFER
- CAutoLock locLock(mBufferLock);
-
- //Init rand number generator
- LARGE_INTEGER locTicks;
- QueryPerformanceCounter(&locTicks);
- srand((unsigned int)locTicks.LowPart);
-
- int locRand = rand();
-
- string locCacheFileName = getenv("TEMP");
- //debugLog<<"Temp = "<<locCacheFileName<<endl;
- locCacheFileName += "\\filecache";
-
- //*****************************************************
- //TODO::: Need to do something about the filename...
- //*****************************************************
- locCacheFileName += StringHelper::numToString(locRand);
- locCacheFileName += ".ogg";
- //debugLog<<"Cache file = "<<locCacheFileName<<endl;
- if(mReadFile.open(locCacheFileName)) {
- //debugLog<<"OPEN : Cach file opened"<<endl;
- }
- } //END CRITICAL SECTION
-
- bool locIsOK = setupSocket(inSourceLocation);
-
- if (!locIsOK) {
- //debugLog<<"Setup socket FAILED"<<endl;
- closeSocket();
- return false;
- }
-
- //debugLog<<"Sending request..."<<endl;
-
- //How is filename already set ??
- httpRequest(assembleRequest(mFileName));
- //debugLog<<"Socket ok... starting thread"<<endl;
- locIsOK = startThread();
-
-
- return locIsOK;
-}
-
-void CachedHTTPFileSource::clear() {
- //Reset flags.
- mIsEOF = false;
- mWasError = false;
-}
-bool CachedHTTPFileSource::isEOF() {
- //{ //CRITICAL SECTION - PROTECTING STREAM BUFFER
- // CAutoLock locLock(mBufferLock);
- // //TODO:::
- // unsigned long locSizeBuffed = mFileCache.bytesAvail();;
- //
-
- // //debugLog<<"isEOF : Amount Buffered avail = "<<locSizeBuffed<<endl;
- // if ((locSizeBuffed == 0) && mIsEOF) {
- // //debugLog<<"isEOF : It is EOF"<<endl;
- // return true;
- // } else {
- // //debugLog<<"isEOF : It's not EOF"<<endl;
- // return false;
- // }
- //} //END CRITICAL SECTION
- return false;
-}
-void CachedHTTPFileSource::close() {
- //Killing thread
- //debugLog<<"HTTPFileSource::close()"<<endl;
- if (ThreadExists() == TRUE) {
- //debugLog<<"Calling Thread to EXIT"<<endl;
- CallWorker(THREAD_EXIT);
- //debugLog<<"Killing thread..."<<endl;
- Close();
- //debugLog<<"After Close called on CAMThread"<<endl;
- }
-
- //debugLog<<"Closing socket..."<<endl;
- //Close the socket down.
- closeSocket();
-}
-void CachedHTTPFileSource::DataProcessLoop() {
- //This loop sits here filling in holes
-
-
- //WHILE still holes
- // hole = findNextHoleInData();
- // requestByteRange(hole)
- //WEND
-
-
+#include "StdAfx.h"
+#include ".\cachedhttpfilesource.h"
+
+CachedHTTPFileSource::CachedHTTPFileSource(void)
+
+{
+}
+
+CachedHTTPFileSource::~CachedHTTPFileSource(void)
+{
+}
+
+CachedHTTPFileSource::tMapEntry CachedHTTPFileSource::findNextHoleInData(__int64 inUpto)
+{
+
+ tRangeMap::iterator locIt = mRangeMap.upper_bound(inUpto);
+
+ //Get the entry correspondingto this value.
+ // The decrement is because of the stupid way the bound works in map.
+ // The decrement of upper bound gives what you would expect a lower_bound function *should*
+ // return... ie the thing lower than the given key.
+ tMapEntry locEntry = *(--locIt);
+ tMapEntry locNextEntry = *(++locIt);
+
+ //If we are in range, then we already have this
+ if (inRange(locEntry, inUpto)) {
+ bool locDone = false;
+
+ while (locIt != mRangeMap.end()) {
+ //If the end of this range equals the start of the next range, then there is no hole here !
+ if (locEntry.second.first == (locNextEntry.first)) {
+ locEntry = *(locIt);
+ locNextEntry = *(++locIt);
+
+ } else {
+ //There is a hole... since the end value of the current range is not the same as the start of the next range
+ // So there is a hole from here.end+1 to next.start - 1
+ tMapEntry retEntry;
+ retEntry.first = locEntry.second.first + 1;
+ retEntry.second.first = - 1; //The end becomes -1 until something goes in
+ return retEntry;
+
+ }
+ }
+ } else {
+ //This upto point is not in a known range.
+ tMapEntry retEntry;
+ retEntry.first = locEntry.second.first + 1;
+ retEntry.second.first = - 1; //The end becomes -1 until something goes in
+ return retEntry;
+
+ }
+}
+
+bool CachedHTTPFileSource::startThread() {
+ if (ThreadExists() == FALSE) {
+ Create();
+ }
+ CallWorker(THREAD_RUN);
+ return true;
+}
+
+DWORD CachedHTTPFileSource::ThreadProc(void) {
+ //debugLog<<"ThreadProc:"<<endl;
+ while(true) {
+ DWORD locThreadCommand = GetRequest();
+
+ switch(locThreadCommand) {
+ case THREAD_EXIT:
+
+ Reply(S_OK);
+ return S_OK;
+
+
+
+ case THREAD_RUN:
+
+ Reply(S_OK);
+ DataProcessLoop();
+ break;
+ }
+
+
+ }
+ return S_OK;
+}
+bool CachedHTTPFileSource::inRange(CachedHTTPFileSource::tMapEntry inTestRange, __int64 inTestValue) {
+
+ return ((inTestRange.first <= inTestValue) && (inTestRange.second.first >= inTestValue));
+
+
+}
+
+unsigned long CachedHTTPFileSource::seek(unsigned long inPos) {
+ //Close the socket down
+ //Open up a new one to the same place.
+ //Make the partial content request.
+ //debugLog<<"Seeking to "<<inPos<<endl;
+ if (mReadFile.readSeek(inPos)) {
+ return inPos;
+ } else {
+ return (unsigned long) -1;
+ }
+
+}
+
+unsigned long CachedHTTPFileSource::read(char* outBuffer, unsigned long inNumBytes) {
+ //Reads from the buffer, will return 0 if nothing in buffer.
+ // If it returns 0 check the isEOF flag to see if it was the end of file or the network is just slow.
+
+ { //CRITICAL SECTION - PROTECTING STREAM BUFFER
+ CAutoLock locLock(mBufferLock);
+
+ //debugLog<<"Read:"<<endl;
+ if((mReadFile.bytesAvail() == 0) || mWasError) {
+ //debugLog<<"read : Can't read is error or eof"<<endl;
+ return 0;
+ } else {
+ //debugLog<<"Reading from buffer"<<endl;
+
+ unsigned long locNumRead = mReadFile.read((unsigned char*)outBuffer, inNumBytes);
+ /* if (locNumRead == 0) {
+ mStreamBuffer.clear();
+ }*/
+
+ //debugLog<<locNumRead<<" bytes read from buffer"<<endl;
+ return locNumRead;
+ }
+ } //END CRITICAL SECTION
+}
+
+bool CachedHTTPFileSource::open(string inSourceLocation) {
+ //Open network connection and start feeding data into a buffer
+ //
+ // In sourcelocation is a http url
+ //
+
+ mSeenResponse = false;
+ mLastResponse = "";
+ //debugLog<<"Open: "<<inSourceLocation<<endl;
+
+ { //CRITICAL SECTION - PROTECTING STREAM BUFFER
+ CAutoLock locLock(mBufferLock);
+
+ //Init rand number generator
+ LARGE_INTEGER locTicks;
+ QueryPerformanceCounter(&locTicks);
+ srand((unsigned int)locTicks.LowPart);
+
+ int locRand = rand();
+
+ string locCacheFileName = getenv("TEMP");
+ //debugLog<<"Temp = "<<locCacheFileName<<endl;
+ locCacheFileName += "\\filecache";
+
+ //*****************************************************
+ //TODO::: Need to do something about the filename...
+ //*****************************************************
+ locCacheFileName += StringHelper::numToString(locRand);
+ locCacheFileName += ".ogg";
+ //debugLog<<"Cache file = "<<locCacheFileName<<endl;
+ if(mReadFile.open(locCacheFileName)) {
+ //debugLog<<"OPEN : Cach file opened"<<endl;
+ }
+ } //END CRITICAL SECTION
+
+ bool locIsOK = setupSocket(inSourceLocation);
+
+ if (!locIsOK) {
+ //debugLog<<"Setup socket FAILED"<<endl;
+ closeSocket();
+ return false;
+ }
+
+ //debugLog<<"Sending request..."<<endl;
+
+ //How is filename already set ??
+ httpRequest(assembleRequest(mFileName));
+ //debugLog<<"Socket ok... starting thread"<<endl;
+ locIsOK = startThread();
+
+
+ return locIsOK;
+}
+
+void CachedHTTPFileSource::clear() {
+ //Reset flags.
+ mIsEOF = false;
+ mWasError = false;
+}
+bool CachedHTTPFileSource::isEOF() {
+ //{ //CRITICAL SECTION - PROTECTING STREAM BUFFER
+ // CAutoLock locLock(mBufferLock);
+ // //TODO:::
+ // unsigned long locSizeBuffed = mFileCache.bytesAvail();;
+ //
+
+ // //debugLog<<"isEOF : Amount Buffered avail = "<<locSizeBuffed<<endl;
+ // if ((locSizeBuffed == 0) && mIsEOF) {
+ // //debugLog<<"isEOF : It is EOF"<<endl;
+ // return true;
+ // } else {
+ // //debugLog<<"isEOF : It's not EOF"<<endl;
+ // return false;
+ // }
+ //} //END CRITICAL SECTION
+ return false;
+}
+void CachedHTTPFileSource::close() {
+ //Killing thread
+ //debugLog<<"HTTPFileSource::close()"<<endl;
+ if (ThreadExists() == TRUE) {
+ //debugLog<<"Calling Thread to EXIT"<<endl;
+ CallWorker(THREAD_EXIT);
+ //debugLog<<"Killing thread..."<<endl;
+ Close();
+ //debugLog<<"After Close called on CAMThread"<<endl;
+ }
+
+ //debugLog<<"Closing socket..."<<endl;
+ //Close the socket down.
+ closeSocket();
+}
+void CachedHTTPFileSource::DataProcessLoop() {
+ //This loop sits here filling in holes
+
+
+ //WHILE still holes
+ // hole = findNextHoleInData();
+ // requestByteRange(hole)
+ //WEND
+
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPFileSource.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPFileSource.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPFileSource.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPFileSource.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,51 +1,51 @@
-#pragma once
-
-
-
-class CachedHTTPFileSource
- : public IFilterDataSource
- , public CAMThread
- , protected HTTPSocket
-{
-public:
- CachedHTTPFileSource(void);
- virtual ~CachedHTTPFileSource(void);
-
- //Thread commands
- static const int THREAD_RUN = 0;
- static const int THREAD_EXIT = 1;
- //
-
- //IFilterDataSource
- virtual unsigned long seek(unsigned long inPos);
- virtual void close();
- virtual bool open(string inSourceLocation);
- virtual void clear();
- virtual bool isEOF();
- virtual unsigned long read(char* outBuffer, unsigned long inNumBytes);
-
- //CAMThread pure virtuals
- DWORD ThreadProc();
-protected:
- typedef pair<__int64, wstring> tMapValue;
- typedef pair<__int64, tMapValue> tMapEntry;
-
- typedef map<__int64, tMapValue> tRangeMap;
-
- tRangeMap mRangeMap;
-
- SingleMediaFileCache mReadFile;
- SingleMediaFileCache mWriteFile;
-
- tMapEntry mCurrentReadRange;
- tMapEntry mCurrentWriteRange;
-
- //Cache helpers
- CachedHTTPFileSource::tMapEntry findNextHoleInData(__int64 inUpto);
- bool inRange(CachedHTTPFileSource::tMapEntry inTestRange, __int64 inTestValue);
-
- bool startThread();
- void DataProcessLoop();
- CCritSec* mBufferLock;
-
-};
+#pragma once
+
+
+
+class CachedHTTPFileSource
+ : public IFilterDataSource
+ , public CAMThread
+ , protected HTTPSocket
+{
+public:
+ CachedHTTPFileSource(void);
+ virtual ~CachedHTTPFileSource(void);
+
+ //Thread commands
+ static const int THREAD_RUN = 0;
+ static const int THREAD_EXIT = 1;
+ //
+
+ //IFilterDataSource
+ virtual unsigned long seek(unsigned long inPos);
+ virtual void close();
+ virtual bool open(string inSourceLocation);
+ virtual void clear();
+ virtual bool isEOF();
+ virtual unsigned long read(char* outBuffer, unsigned long inNumBytes);
+
+ //CAMThread pure virtuals
+ DWORD ThreadProc();
+protected:
+ typedef pair<__int64, wstring> tMapValue;
+ typedef pair<__int64, tMapValue> tMapEntry;
+
+ typedef map<__int64, tMapValue> tRangeMap;
+
+ tRangeMap mRangeMap;
+
+ SingleMediaFileCache mReadFile;
+ SingleMediaFileCache mWriteFile;
+
+ tMapEntry mCurrentReadRange;
+ tMapEntry mCurrentWriteRange;
+
+ //Cache helpers
+ CachedHTTPFileSource::tMapEntry findNextHoleInData(__int64 inUpto);
+ bool inRange(CachedHTTPFileSource::tMapEntry inTestRange, __int64 inTestValue);
+
+ bool startThread();
+ void DataProcessLoop();
+ CCritSec* mBufferLock;
+
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPFileSource.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPMediaFile.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPMediaFile.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPMediaFile.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,10 +1,10 @@
-#include "StdAfx.h"
-#include ".\cachedhttpmediafile.h"
-
-CachedHTTPMediaFile::CachedHTTPMediaFile(void)
-{
-}
-
-CachedHTTPMediaFile::~CachedHTTPMediaFile(void)
-{
-}
+#include "StdAfx.h"
+#include ".\cachedhttpmediafile.h"
+
+CachedHTTPMediaFile::CachedHTTPMediaFile(void)
+{
+}
+
+CachedHTTPMediaFile::~CachedHTTPMediaFile(void)
+{
+}
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPMediaFile.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPMediaFile.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPMediaFile.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPMediaFile.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-#pragma once
-
-class CachedHTTPMediaFile
-{
-public:
- CachedHTTPMediaFile(void);
- ~CachedHTTPMediaFile(void);
-};
+#pragma once
+
+class CachedHTTPMediaFile
+{
+public:
+ CachedHTTPMediaFile(void);
+ ~CachedHTTPMediaFile(void);
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/CachedHTTPMediaFile.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/DataSourceFactory.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/DataSourceFactory.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/DataSourceFactory.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,84 +1,84 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "datasourcefactory.h"
-
-DataSourceFactory::DataSourceFactory(void)
-{
-}
-
-DataSourceFactory::~DataSourceFactory(void)
-{
-}
-
-IFilterDataSource* DataSourceFactory::createDataSource(string inSourceLocation) {
- string locType = identifySourceType(inSourceLocation);
-
- if(locType.length() == 1) {
- //File...
- return new FilterFileSource;
- } else if (locType == "\\\\") {
- //Network share...
- return new FilterFileSource;
- } else if (locType == "http") {
- //Http stream
- return new HTTPFileSource;
- } else {
- //Something else
- return NULL;
- }
-}
-
-string DataSourceFactory::identifySourceType(string inSourceLocation) {
- size_t locPos = inSourceLocation.find(':');
- if (locPos == string::npos) {
- //No colon... not a normal file. See if it's a network share...
-
- //Make sure it's long enough...
- if (inSourceLocation.length() > 2) {
- string retStr = inSourceLocation.substr(0,2);
- if (retStr == "\\\\") {
- //A "\\" is a network share
- return retStr;
- } else {
- //Not a network share.
- return "";
- }
- } else {
- //Too short
- return "";
- }
- } else {
- string retStr = inSourceLocation.substr(0,locPos);
- return retStr;
- }
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "datasourcefactory.h"
+
+DataSourceFactory::DataSourceFactory(void)
+{
+}
+
+DataSourceFactory::~DataSourceFactory(void)
+{
+}
+
+IFilterDataSource* DataSourceFactory::createDataSource(string inSourceLocation) {
+ string locType = identifySourceType(inSourceLocation);
+
+ if(locType.length() == 1) {
+ //File...
+ return new FilterFileSource;
+ } else if (locType == "\\\\") {
+ //Network share...
+ return new FilterFileSource;
+ } else if (locType == "http") {
+ //Http stream
+ return new HTTPFileSource;
+ } else {
+ //Something else
+ return NULL;
+ }
+}
+
+string DataSourceFactory::identifySourceType(string inSourceLocation) {
+ size_t locPos = inSourceLocation.find(':');
+ if (locPos == string::npos) {
+ //No colon... not a normal file. See if it's a network share...
+
+ //Make sure it's long enough...
+ if (inSourceLocation.length() > 2) {
+ string retStr = inSourceLocation.substr(0,2);
+ if (retStr == "\\\\") {
+ //A "\\" is a network share
+ return retStr;
+ } else {
+ //Not a network share.
+ return "";
+ }
+ } else {
+ //Too short
+ return "";
+ }
+ } else {
+ string retStr = inSourceLocation.substr(0,locPos);
+ return retStr;
+ }
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/DataSourceFactory.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/DataSourceFactory.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/DataSourceFactory.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/DataSourceFactory.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,43 +1,43 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include "IFilterDataSource.h"
-#include "FilterFileSource.h"
-#include "HTTPFileSource.h"
-class OGG_DEMUX_API DataSourceFactory
-{
-public:
- DataSourceFactory(void);
- ~DataSourceFactory(void);
-
- static IFilterDataSource* createDataSource(string inSourceLocation);
- static string identifySourceType(string inSourceLocation);
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+#include "IFilterDataSource.h"
+#include "FilterFileSource.h"
+#include "HTTPFileSource.h"
+class OGG_DEMUX_API DataSourceFactory
+{
+public:
+ DataSourceFactory(void);
+ ~DataSourceFactory(void);
+
+ static IFilterDataSource* createDataSource(string inSourceLocation);
+ static string identifySourceType(string inSourceLocation);
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/DataSourceFactory.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,255 +1,255 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "ffdshowvideostream.h"
-
-
-
-FFDShowVideoStream::FFDShowVideoStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek)
- : OggStream(inBOSPage, inOwningFilter, inAllowSeek)
- , mFFDShowVideoFormatBlock(NULL)
- , mLastTimeStamp(0)
- , mLastKnownTimeBase(0)
- , mGranuleOffset(0)
-{
- InitCodec(inBOSPage->getStampedPacket(0));
- //debugLog.open("g:\\logs\\ffd_dump.out", ios_base::out);
-}
-
-FFDShowVideoStream::~FFDShowVideoStream(void)
-{
- //debugLog.close();
- delete mFFDShowVideoFormatBlock;
-}
-
-bool FFDShowVideoStream::InitCodec(StampedOggPacket* inOggPacket) {
- //Can probably abstract this out of here too !
- mCodecHeaders = new StreamHeaders;
- mCodecHeaders->mCodecType = StreamHeaders::FFDSHOW_VIDEO;
- mCodecHeaders->addPacket((StampedOggPacket*)inOggPacket->clone());
- mHeaderPack = (StampedOggPacket*)inOggPacket->clone();
-
- unsigned char* locPackData = inOggPacket->packetData();
- mFourCCCode = MAKEFOURCC(locPackData[9], locPackData[10], locPackData[11], locPackData[12]);
- mMediaSubTypeGUID = (GUID)(FOURCCMap(mFourCCCode));
-
- unsigned char* locFourCCString = new unsigned char[5];
- for (int i = 0; i < 4; i++) {
- locFourCCString[i] = locPackData[9+i];
- }
- locFourCCString[4] = 0;
-
- string locPinName = (char*)locFourCCString;
- locPinName = "FOURCC( " + locPinName + " ) out";
- mPinName = StringHelper::toWStr(locPinName);
-
- //What to do with commment fields ??
- mNumHeadersNeeded = 1;
- //mFirstRun = false;
- return true;
-}
-
-
-bool FFDShowVideoStream::deliverCodecHeaders() {
- StampedOggPacket* locPacket = NULL;
-
- //TODO::: Why 2 ?
- for (unsigned long i = 2; i < mCodecHeaders->numPackets(); i++) {
- locPacket = mCodecHeaders->getPacket(i);
-
- dispatchPacket(locPacket);
- }
- return true;
-
-}
-wstring FFDShowVideoStream::getPinName() {
-
- return mPinName;
-}
-
-bool FFDShowVideoStream::createFormatBlock() {
- mFFDShowVideoFormatBlock = new VIDEOINFOHEADER;
- ////Fix the format block data... use header version and other version.
- //unsigned char* locIdentHeader = mCodecHeaders->getPacket(0)->packetData();
- ////mTheoraFormatBlock->TheoraVersion = OggMath::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 28);
- ////mTheoraFormatBlock->numChannels = OggMath::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 48);
- ////mTheoraFormatBlock->samplesPerSec = OggMath::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 36);
-
- //mTheoraFormatBlock->theoraVersion = (FLACMath::charArrToULong(locIdentHeader + 7)) >>8;
- //mTheoraFormatBlock->width = (FLACMath::charArrToUShort(locIdentHeader + 10)) * 16;
- //mTheoraFormatBlock->height = (FLACMath::charArrToUShort(locIdentHeader + 12)) * 16;
- //mTheoraFormatBlock->frameWidth = (FLACMath::charArrToULong(locIdentHeader + 14)) >>8;
- //mTheoraFormatBlock->frameHeight = (FLACMath::charArrToULong(locIdentHeader + 17)) >>8;
- //mTheoraFormatBlock->xOffset = locIdentHeader[20];
- //mTheoraFormatBlock->yOffset = locIdentHeader[21];
- //mTheoraFormatBlock->frameRateNumerator = FLACMath::charArrToULong(locIdentHeader + 22);
- //mTheoraFormatBlock->frameRateDenominator = FLACMath::charArrToULong(locIdentHeader + 26);
- //mTheoraFormatBlock->aspectNumerator = (FLACMath::charArrToULong(locIdentHeader + 30)) >>8;
- //mTheoraFormatBlock->aspectDenominator = (FLACMath::charArrToULong(locIdentHeader + 33)) >>8;
- //mTheoraFormatBlock->colourSpace = locIdentHeader[36];
- //mTheoraFormatBlock->targetBitrate = (FLACMath::charArrToULong(locIdentHeader + 37)) >>8;
- //mTheoraFormatBlock->targetQuality = (locIdentHeader[40]) >> 2;
- ////FIX:: When you can be bothered spanning bits over bytes.
- //mTheoraFormatBlock->maxKeyframeInterval= 0;
-
-
-
- //FORMAT OF HEADER IN OGG BOS
- //-----------------------------------------
- //0 - 8 = STRING Stream Type (char[8] is NULL)
- //9 - 12 = STRING Sub Type (FOURCC)
- //13 - 16 = INT32 Size of structure ???
- //17 - 24 = INT64 Time per "unit" in DSHOW UNITS
- //25 - 32 = INT64 Samples per "unit"
- //33 - 36 = INT32 Deefault length ????? in media type ?? WTF ?
- //37 - 40 = INT32 Buffer Size
- //41 - 42 = INT16 Bits per sample
- //43 - 44 = ----- HOLE IN DATA
- //45 - 48 = INT32 Video Width
- //49 - 52 = INT32 Video Height
-
-
-
-
- //------------------------------------------
-
-
- __int64 locTimePerBlock = iLE_Math::CharArrToInt64(mHeaderPack->packetData() + 17);
-
-
- __int64 locSamplesPerBlock = iLE_Math::CharArrToInt64(mHeaderPack->packetData() + 25);
-
- //debugLog<<"t/block = "<<locTimePerBlock<<" Sam/block = "<<locSamplesPerBlock<<endl;
-
- mFFDShowVideoFormatBlock->AvgTimePerFrame = locTimePerBlock / locSamplesPerBlock;
-
- //debugLog<<"Time per frame = "<<mFFDShowVideoFormatBlock->AvgTimePerFrame<<endl;
-
- __int64 locFPSec = (UNITS / locTimePerBlock) * locSamplesPerBlock;
-
- //debugLog<<"Rate = "<<locFPSec<<" fps"<<endl;
- unsigned short locBPSample = ((unsigned char)(mHeaderPack->packetData()[41])) + (((unsigned short)(mHeaderPack->packetData()[42])) * 256);
-
-
-
- mFFDShowVideoFormatBlock->bmiHeader.biBitCount = locBPSample;
- mFFDShowVideoFormatBlock->bmiHeader.biClrImportant = 0; //All colours important
- mFFDShowVideoFormatBlock->bmiHeader.biClrUsed = 0; //Use max colour depth
- mFFDShowVideoFormatBlock->bmiHeader.biCompression = mFourCCCode;
-
- unsigned long locHeight = iLE_Math::charArrToULong(mHeaderPack->packetData() + 49);
- unsigned long locWidth = iLE_Math::charArrToULong(mHeaderPack->packetData() + 45);
-
- mFFDShowVideoFormatBlock->dwBitRate = 0;
-
- mFFDShowVideoFormatBlock->bmiHeader.biHeight = locHeight;
- mFFDShowVideoFormatBlock->bmiHeader.biPlanes = 1; //Must be 1
- mFFDShowVideoFormatBlock->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); //????? Size of what ?
- mFFDShowVideoFormatBlock->bmiHeader.biSizeImage = (locHeight * locWidth * locBPSample) / 8; //Size in bytes of image ??
- mFFDShowVideoFormatBlock->bmiHeader.biWidth = locWidth;
- mFFDShowVideoFormatBlock->bmiHeader.biXPelsPerMeter = 2000; //Fuck knows
- mFFDShowVideoFormatBlock->bmiHeader.biYPelsPerMeter = 2000; //" " " " "
-
- mFFDShowVideoFormatBlock->rcSource.top = 0;
- mFFDShowVideoFormatBlock->rcSource.bottom = locHeight;
- mFFDShowVideoFormatBlock->rcSource.left = 0;
- mFFDShowVideoFormatBlock->rcSource.right = locWidth;
-
- mFFDShowVideoFormatBlock->rcTarget.top = 0;
- mFFDShowVideoFormatBlock->rcTarget.bottom = locHeight;
- mFFDShowVideoFormatBlock->rcTarget.left = 0;
- mFFDShowVideoFormatBlock->rcTarget.right = locWidth;
-
- mFFDShowVideoFormatBlock->dwBitErrorRate=0;
- return true;
-}
-
-
-bool FFDShowVideoStream::dispatchPacket(StampedOggPacket* inPacket) {
- //This is to get aroudn the extra mystery byte that ogg encapsulated divx gets at the start :|
- unsigned char* locBuff = new unsigned char[inPacket->packetSize() - 1];
- memcpy((void*)locBuff, (const void*) (inPacket->packetData() + 1), inPacket->packetSize() - 1);
-
-
- //This is to help ffdshow handle timestamps the way it likes them.
- //Everytime, the start time changes, we record it and reset the granule counter (frame count)
- //This lets ogm stuff be seekable cleanly.
- if ((mLastKnownTimeBase != inPacket->startTime()) && (inPacket->startTime() != -1)) {
- mLastKnownTimeBase = inPacket->startTime();
- mLastTimeStamp = mLastKnownTimeBase * mFFDShowVideoFormatBlock->AvgTimePerFrame;
- //debugLog<<"Last Time base set to "<<mLastKnownTimeBase<<endl;
- //debugLog<<"Last time stamp set to "<<mLastTimeStamp<<endl;
-
- //Granule Offset may not be needed any more.
- mGranuleOffset = 0;
- }
-
- //debugLog<<"Packet stamps = "<<inPacket->startTime() << " - "<<inPacket->endTime()<<endl;
-
- //debugLog<<"m_tStart = "<<mSourcePin->CurrentStartTime()<<endl;
- LONGLONG locStart = mLastTimeStamp - mSourcePin->CurrentStartTime();
- LONGLONG locEnd = locStart + mFFDShowVideoFormatBlock->AvgTimePerFrame;
- mGranuleOffset++;
-
- //debugLog<<"Time Stamps = "<<locStart<<" - "<<locEnd<<endl;
- //debugLog<<"Granule offset " << mGranuleOffset<<endl;
-
- mLastTimeStamp = (locEnd >= mLastTimeStamp) ? locEnd
- : mLastTimeStamp;
-
- //debugLog << "Packet : Start = "<<locStart<<" - End = "<<locEnd<<endl;
- //We should only be delivering full packets here.
- StampedOggPacket* locPack = new StampedOggPacket(locBuff, inPacket->packetSize() - 1, false, false, locStart, locEnd, StampedOggPacket::DIRECTSHOW);
- return OggStream::dispatchPacket(locPack);
-}
-BYTE* FFDShowVideoStream::getFormatBlock() {
-
- return (BYTE*)mFFDShowVideoFormatBlock;
-}
-
-GUID FFDShowVideoStream::getMajorTypeGUID() {
- return MEDIATYPE_Video;
-}
-unsigned long FFDShowVideoStream::getFormatBlockSize() {
- //Do something
- return sizeof(VIDEOINFOHEADER);
-}
-GUID FFDShowVideoStream::getFormatGUID() {
- return FORMAT_VideoInfo;
-}
-GUID FFDShowVideoStream::getSubtypeGUID() {
- return mMediaSubTypeGUID;
-}
-
-LONGLONG FFDShowVideoStream::getCurrentPos() {
- return 0;
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "ffdshowvideostream.h"
+
+
+
+FFDShowVideoStream::FFDShowVideoStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek)
+ : OggStream(inBOSPage, inOwningFilter, inAllowSeek)
+ , mFFDShowVideoFormatBlock(NULL)
+ , mLastTimeStamp(0)
+ , mLastKnownTimeBase(0)
+ , mGranuleOffset(0)
+{
+ InitCodec(inBOSPage->getStampedPacket(0));
+ //debugLog.open("g:\\logs\\ffd_dump.out", ios_base::out);
+}
+
+FFDShowVideoStream::~FFDShowVideoStream(void)
+{
+ //debugLog.close();
+ delete mFFDShowVideoFormatBlock;
+}
+
+bool FFDShowVideoStream::InitCodec(StampedOggPacket* inOggPacket) {
+ //Can probably abstract this out of here too !
+ mCodecHeaders = new StreamHeaders;
+ mCodecHeaders->mCodecType = StreamHeaders::FFDSHOW_VIDEO;
+ mCodecHeaders->addPacket((StampedOggPacket*)inOggPacket->clone());
+ mHeaderPack = (StampedOggPacket*)inOggPacket->clone();
+
+ unsigned char* locPackData = inOggPacket->packetData();
+ mFourCCCode = MAKEFOURCC(locPackData[9], locPackData[10], locPackData[11], locPackData[12]);
+ mMediaSubTypeGUID = (GUID)(FOURCCMap(mFourCCCode));
+
+ unsigned char* locFourCCString = new unsigned char[5];
+ for (int i = 0; i < 4; i++) {
+ locFourCCString[i] = locPackData[9+i];
+ }
+ locFourCCString[4] = 0;
+
+ string locPinName = (char*)locFourCCString;
+ locPinName = "FOURCC( " + locPinName + " ) out";
+ mPinName = StringHelper::toWStr(locPinName);
+
+ //What to do with commment fields ??
+ mNumHeadersNeeded = 1;
+ //mFirstRun = false;
+ return true;
+}
+
+
+bool FFDShowVideoStream::deliverCodecHeaders() {
+ StampedOggPacket* locPacket = NULL;
+
+ //TODO::: Why 2 ?
+ for (unsigned long i = 2; i < mCodecHeaders->numPackets(); i++) {
+ locPacket = mCodecHeaders->getPacket(i);
+
+ dispatchPacket(locPacket);
+ }
+ return true;
+
+}
+wstring FFDShowVideoStream::getPinName() {
+
+ return mPinName;
+}
+
+bool FFDShowVideoStream::createFormatBlock() {
+ mFFDShowVideoFormatBlock = new VIDEOINFOHEADER;
+ ////Fix the format block data... use header version and other version.
+ //unsigned char* locIdentHeader = mCodecHeaders->getPacket(0)->packetData();
+ ////mTheoraFormatBlock->TheoraVersion = OggMath::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 28);
+ ////mTheoraFormatBlock->numChannels = OggMath::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 48);
+ ////mTheoraFormatBlock->samplesPerSec = OggMath::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 36);
+
+ //mTheoraFormatBlock->theoraVersion = (FLACMath::charArrToULong(locIdentHeader + 7)) >>8;
+ //mTheoraFormatBlock->width = (FLACMath::charArrToUShort(locIdentHeader + 10)) * 16;
+ //mTheoraFormatBlock->height = (FLACMath::charArrToUShort(locIdentHeader + 12)) * 16;
+ //mTheoraFormatBlock->frameWidth = (FLACMath::charArrToULong(locIdentHeader + 14)) >>8;
+ //mTheoraFormatBlock->frameHeight = (FLACMath::charArrToULong(locIdentHeader + 17)) >>8;
+ //mTheoraFormatBlock->xOffset = locIdentHeader[20];
+ //mTheoraFormatBlock->yOffset = locIdentHeader[21];
+ //mTheoraFormatBlock->frameRateNumerator = FLACMath::charArrToULong(locIdentHeader + 22);
+ //mTheoraFormatBlock->frameRateDenominator = FLACMath::charArrToULong(locIdentHeader + 26);
+ //mTheoraFormatBlock->aspectNumerator = (FLACMath::charArrToULong(locIdentHeader + 30)) >>8;
+ //mTheoraFormatBlock->aspectDenominator = (FLACMath::charArrToULong(locIdentHeader + 33)) >>8;
+ //mTheoraFormatBlock->colourSpace = locIdentHeader[36];
+ //mTheoraFormatBlock->targetBitrate = (FLACMath::charArrToULong(locIdentHeader + 37)) >>8;
+ //mTheoraFormatBlock->targetQuality = (locIdentHeader[40]) >> 2;
+ ////FIX:: When you can be bothered spanning bits over bytes.
+ //mTheoraFormatBlock->maxKeyframeInterval= 0;
+
+
+
+ //FORMAT OF HEADER IN OGG BOS
+ //-----------------------------------------
+ //0 - 8 = STRING Stream Type (char[8] is NULL)
+ //9 - 12 = STRING Sub Type (FOURCC)
+ //13 - 16 = INT32 Size of structure ???
+ //17 - 24 = INT64 Time per "unit" in DSHOW UNITS
+ //25 - 32 = INT64 Samples per "unit"
+ //33 - 36 = INT32 Deefault length ????? in media type ?? WTF ?
+ //37 - 40 = INT32 Buffer Size
+ //41 - 42 = INT16 Bits per sample
+ //43 - 44 = ----- HOLE IN DATA
+ //45 - 48 = INT32 Video Width
+ //49 - 52 = INT32 Video Height
+
+
+
+
+ //------------------------------------------
+
+
+ __int64 locTimePerBlock = iLE_Math::CharArrToInt64(mHeaderPack->packetData() + 17);
+
+
+ __int64 locSamplesPerBlock = iLE_Math::CharArrToInt64(mHeaderPack->packetData() + 25);
+
+ //debugLog<<"t/block = "<<locTimePerBlock<<" Sam/block = "<<locSamplesPerBlock<<endl;
+
+ mFFDShowVideoFormatBlock->AvgTimePerFrame = locTimePerBlock / locSamplesPerBlock;
+
+ //debugLog<<"Time per frame = "<<mFFDShowVideoFormatBlock->AvgTimePerFrame<<endl;
+
+ __int64 locFPSec = (UNITS / locTimePerBlock) * locSamplesPerBlock;
+
+ //debugLog<<"Rate = "<<locFPSec<<" fps"<<endl;
+ unsigned short locBPSample = ((unsigned char)(mHeaderPack->packetData()[41])) + (((unsigned short)(mHeaderPack->packetData()[42])) * 256);
+
+
+
+ mFFDShowVideoFormatBlock->bmiHeader.biBitCount = locBPSample;
+ mFFDShowVideoFormatBlock->bmiHeader.biClrImportant = 0; //All colours important
+ mFFDShowVideoFormatBlock->bmiHeader.biClrUsed = 0; //Use max colour depth
+ mFFDShowVideoFormatBlock->bmiHeader.biCompression = mFourCCCode;
+
+ unsigned long locHeight = iLE_Math::charArrToULong(mHeaderPack->packetData() + 49);
+ unsigned long locWidth = iLE_Math::charArrToULong(mHeaderPack->packetData() + 45);
+
+ mFFDShowVideoFormatBlock->dwBitRate = 0;
+
+ mFFDShowVideoFormatBlock->bmiHeader.biHeight = locHeight;
+ mFFDShowVideoFormatBlock->bmiHeader.biPlanes = 1; //Must be 1
+ mFFDShowVideoFormatBlock->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); //????? Size of what ?
+ mFFDShowVideoFormatBlock->bmiHeader.biSizeImage = (locHeight * locWidth * locBPSample) / 8; //Size in bytes of image ??
+ mFFDShowVideoFormatBlock->bmiHeader.biWidth = locWidth;
+ mFFDShowVideoFormatBlock->bmiHeader.biXPelsPerMeter = 2000; //Fuck knows
+ mFFDShowVideoFormatBlock->bmiHeader.biYPelsPerMeter = 2000; //" " " " "
+
+ mFFDShowVideoFormatBlock->rcSource.top = 0;
+ mFFDShowVideoFormatBlock->rcSource.bottom = locHeight;
+ mFFDShowVideoFormatBlock->rcSource.left = 0;
+ mFFDShowVideoFormatBlock->rcSource.right = locWidth;
+
+ mFFDShowVideoFormatBlock->rcTarget.top = 0;
+ mFFDShowVideoFormatBlock->rcTarget.bottom = locHeight;
+ mFFDShowVideoFormatBlock->rcTarget.left = 0;
+ mFFDShowVideoFormatBlock->rcTarget.right = locWidth;
+
+ mFFDShowVideoFormatBlock->dwBitErrorRate=0;
+ return true;
+}
+
+
+bool FFDShowVideoStream::dispatchPacket(StampedOggPacket* inPacket) {
+ //This is to get aroudn the extra mystery byte that ogg encapsulated divx gets at the start :|
+ unsigned char* locBuff = new unsigned char[inPacket->packetSize() - 1];
+ memcpy((void*)locBuff, (const void*) (inPacket->packetData() + 1), inPacket->packetSize() - 1);
+
+
+ //This is to help ffdshow handle timestamps the way it likes them.
+ //Everytime, the start time changes, we record it and reset the granule counter (frame count)
+ //This lets ogm stuff be seekable cleanly.
+ if ((mLastKnownTimeBase != inPacket->startTime()) && (inPacket->startTime() != -1)) {
+ mLastKnownTimeBase = inPacket->startTime();
+ mLastTimeStamp = mLastKnownTimeBase * mFFDShowVideoFormatBlock->AvgTimePerFrame;
+ //debugLog<<"Last Time base set to "<<mLastKnownTimeBase<<endl;
+ //debugLog<<"Last time stamp set to "<<mLastTimeStamp<<endl;
+
+ //Granule Offset may not be needed any more.
+ mGranuleOffset = 0;
+ }
+
+ //debugLog<<"Packet stamps = "<<inPacket->startTime() << " - "<<inPacket->endTime()<<endl;
+
+ //debugLog<<"m_tStart = "<<mSourcePin->CurrentStartTime()<<endl;
+ LONGLONG locStart = mLastTimeStamp - mSourcePin->CurrentStartTime();
+ LONGLONG locEnd = locStart + mFFDShowVideoFormatBlock->AvgTimePerFrame;
+ mGranuleOffset++;
+
+ //debugLog<<"Time Stamps = "<<locStart<<" - "<<locEnd<<endl;
+ //debugLog<<"Granule offset " << mGranuleOffset<<endl;
+
+ mLastTimeStamp = (locEnd >= mLastTimeStamp) ? locEnd
+ : mLastTimeStamp;
+
+ //debugLog << "Packet : Start = "<<locStart<<" - End = "<<locEnd<<endl;
+ //We should only be delivering full packets here.
+ StampedOggPacket* locPack = new StampedOggPacket(locBuff, inPacket->packetSize() - 1, false, false, locStart, locEnd, StampedOggPacket::DIRECTSHOW);
+ return OggStream::dispatchPacket(locPack);
+}
+BYTE* FFDShowVideoStream::getFormatBlock() {
+
+ return (BYTE*)mFFDShowVideoFormatBlock;
+}
+
+GUID FFDShowVideoStream::getMajorTypeGUID() {
+ return MEDIATYPE_Video;
+}
+unsigned long FFDShowVideoStream::getFormatBlockSize() {
+ //Do something
+ return sizeof(VIDEOINFOHEADER);
+}
+GUID FFDShowVideoStream::getFormatGUID() {
+ return FORMAT_VideoInfo;
+}
+GUID FFDShowVideoStream::getSubtypeGUID() {
+ return mMediaSubTypeGUID;
+}
+
+LONGLONG FFDShowVideoStream::getCurrentPos() {
+ return 0;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,72 +1,72 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include "oggstream.h"
-
-#include <fstream>
-using namespace std;
-
-class FFDShowVideoStream
- : public OggStream
-{
-public:
- FFDShowVideoStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
- virtual ~FFDShowVideoStream(void);
-
- virtual bool InitCodec(StampedOggPacket* inOggPacket);
-
- virtual BYTE* getFormatBlock() ;
- virtual unsigned long getFormatBlockSize();
- virtual GUID getFormatGUID();
- virtual GUID getSubtypeGUID();
- virtual wstring getPinName();
- virtual bool createFormatBlock();
- virtual GUID getMajorTypeGUID();
- virtual LONGLONG getCurrentPos();
-
-
- //Override
- virtual bool dispatchPacket(StampedOggPacket* inPacket);
- virtual bool deliverCodecHeaders();
-
-protected:
- VIDEOINFOHEADER* mFFDShowVideoFormatBlock;
- DWORD mFourCCCode;
- GUID mMediaSubTypeGUID;
- wstring mPinName;
- StampedOggPacket* mHeaderPack;
-
- LONGLONG mLastTimeStamp;
- LONGLONG mLastKnownTimeBase;
- LONGLONG mGranuleOffset;
-
- //fstream debugLog;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+#include "oggstream.h"
+
+#include <fstream>
+using namespace std;
+
+class FFDShowVideoStream
+ : public OggStream
+{
+public:
+ FFDShowVideoStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
+ virtual ~FFDShowVideoStream(void);
+
+ virtual bool InitCodec(StampedOggPacket* inOggPacket);
+
+ virtual BYTE* getFormatBlock() ;
+ virtual unsigned long getFormatBlockSize();
+ virtual GUID getFormatGUID();
+ virtual GUID getSubtypeGUID();
+ virtual wstring getPinName();
+ virtual bool createFormatBlock();
+ virtual GUID getMajorTypeGUID();
+ virtual LONGLONG getCurrentPos();
+
+
+ //Override
+ virtual bool dispatchPacket(StampedOggPacket* inPacket);
+ virtual bool deliverCodecHeaders();
+
+protected:
+ VIDEOINFOHEADER* mFFDShowVideoFormatBlock;
+ DWORD mFourCCCode;
+ GUID mMediaSubTypeGUID;
+ wstring mPinName;
+ StampedOggPacket* mHeaderPack;
+
+ LONGLONG mLastTimeStamp;
+ LONGLONG mLastKnownTimeBase;
+ LONGLONG mGranuleOffset;
+
+ //fstream debugLog;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FFDShowVideoStream.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FLACStream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FLACStream.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FLACStream.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,140 +1,140 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "FLACstream.h"
-//#include "FLACMath.h"
-
-FLACStream::FLACStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek)
- : OggStream(inBOSPage, inOwningFilter, inAllowSeek)
- , mFLACFormatBlock(NULL)
- //, mNumHeaderPackets(0)
-{
- InitCodec(inBOSPage->getStampedPacket(0));
-}
-
-FLACStream::~FLACStream(void)
-{
- delete mFLACFormatBlock;
-}
-
-bool FLACStream::InitCodec(StampedOggPacket* inOggPacket) {
- //Can probably abstract this out of here too !
- mCodecHeaders = new StreamHeaders;
- mCodecHeaders->mCodecType = StreamHeaders::FLAC;
- mCodecHeaders->addPacket((StampedOggPacket*)inOggPacket->clone());
- //What to do with commment fields ??
- //We set this to 1... and we override the header processor
- //When we see the last header packet ie starts with 1xxxxxxx then we decrement it.
- mNumHeadersNeeded = 1;
- return true;
-}
-
-wstring FLACStream::getPinName() {
- wstring locName = L"FLAC Out";
- return locName;
-}
-
-bool FLACStream::createFormatBlock() {
- const unsigned char FLAC_CHANNEL_MASK = 14; //00001110
- const unsigned char FLAC_BPS_START_MASK = 1; //00000001
- const unsigned char FLAC_BPS_END_MASK = 240; //11110000
- mFLACFormatBlock = new sFLACFormatBlock;
- //Fix the format block data... use header version and other version.
- //mFLACFormatBlock->FLACVersion = FLACMath::charArrToULong(mCodecHeaders->getPacket(1)->packetData() + 28);
- mFLACFormatBlock->numChannels = (((mCodecHeaders->getPacket(1)->packetData()[16]) & FLAC_CHANNEL_MASK) >> 1) + 1;
- mFLACFormatBlock->samplesPerSec = (iBE_Math::charArrToULong(mCodecHeaders->getPacket(1)->packetData() + 14)) >> 12;
-
- mFLACFormatBlock->numBitsPerSample = (((mCodecHeaders->getPacket(1)->packetData()[16] & FLAC_BPS_START_MASK) << 4) |
- ((mCodecHeaders->getPacket(1)->packetData()[17] & FLAC_BPS_END_MASK) >> 4)) + 1;
- return true;
-}
-BYTE* FLACStream::getFormatBlock() {
-
- return (BYTE*)mFLACFormatBlock;
-
-
-}
-unsigned long FLACStream::getFormatBlockSize() {
- //Do something
- return sizeof(sFLACFormatBlock);
-}
-GUID FLACStream::getFormatGUID() {
- return FORMAT_FLAC;
-}
-GUID FLACStream::getSubtypeGUID() {
- return MEDIASUBTYPE_FLAC;
-}
-GUID FLACStream::getMajorTypeGUID() {
- return MEDIATYPE_Audio;
-}
-
-//Need to override from oggstream because we have variable number of headers
-bool FLACStream::processHeaderPacket(StampedOggPacket* inPacket) {
- //FIX::: Return values
- const unsigned char MORE_HEADERS_MASK = 128; //10000000
- //We don't delete the packet... the codecheader list will delete when it's done.
- //StampedOggPacket* locPacket = processPacket(inPacket);
- if (inPacket != NULL) {
- //We got a comlpete packet
- mCodecHeaders->addPacket(inPacket);
- if ((inPacket->packetData()[0] & MORE_HEADERS_MASK) != 0) {
- mNumHeadersNeeded--;
- //mNumHeaderPackets++;
- }
- }
- return true;
-}
-void FLACStream::setLastEndGranPos(__int64 inPos) {
- mLastEndGranulePos = (inPos * (__int64)mFLACFormatBlock->samplesPerSec)/ UNITS;
-}
-bool FLACStream::deliverCodecHeaders() {
- StampedOggPacket* locPacket = NULL;
- for (unsigned long i = 0; i < mCodecHeaders->numPackets(); i++) {
- if (i==0) {
- locPacket = (StampedOggPacket*)mCodecHeaders->getPacket(0)->clone();
- } else {
- locPacket->merge(mCodecHeaders->getPacket(i));
- }
- }
- if (mCodecHeaders->numPackets() > 0) {
- dispatchPacket(locPacket);
- }
- return true;
-}
-
-LONGLONG FLACStream::getCurrentPos() {
- return (mLastEndGranulePos * UNITS) / mFLACFormatBlock->samplesPerSec;
-}
-
-//unsigned long FLACStream::numCodecHeaders() {
-// return mNumHeaderPackets; //is this even needed ?
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "FLACstream.h"
+//#include "FLACMath.h"
+
+FLACStream::FLACStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek)
+ : OggStream(inBOSPage, inOwningFilter, inAllowSeek)
+ , mFLACFormatBlock(NULL)
+ //, mNumHeaderPackets(0)
+{
+ InitCodec(inBOSPage->getStampedPacket(0));
+}
+
+FLACStream::~FLACStream(void)
+{
+ delete mFLACFormatBlock;
+}
+
+bool FLACStream::InitCodec(StampedOggPacket* inOggPacket) {
+ //Can probably abstract this out of here too !
+ mCodecHeaders = new StreamHeaders;
+ mCodecHeaders->mCodecType = StreamHeaders::FLAC;
+ mCodecHeaders->addPacket((StampedOggPacket*)inOggPacket->clone());
+ //What to do with commment fields ??
+ //We set this to 1... and we override the header processor
+ //When we see the last header packet ie starts with 1xxxxxxx then we decrement it.
+ mNumHeadersNeeded = 1;
+ return true;
+}
+
+wstring FLACStream::getPinName() {
+ wstring locName = L"FLAC Out";
+ return locName;
+}
+
+bool FLACStream::createFormatBlock() {
+ const unsigned char FLAC_CHANNEL_MASK = 14; //00001110
+ const unsigned char FLAC_BPS_START_MASK = 1; //00000001
+ const unsigned char FLAC_BPS_END_MASK = 240; //11110000
+ mFLACFormatBlock = new sFLACFormatBlock;
+ //Fix the format block data... use header version and other version.
+ //mFLACFormatBlock->FLACVersion = FLACMath::charArrToULong(mCodecHeaders->getPacket(1)->packetData() + 28);
+ mFLACFormatBlock->numChannels = (((mCodecHeaders->getPacket(1)->packetData()[16]) & FLAC_CHANNEL_MASK) >> 1) + 1;
+ mFLACFormatBlock->samplesPerSec = (iBE_Math::charArrToULong(mCodecHeaders->getPacket(1)->packetData() + 14)) >> 12;
+
+ mFLACFormatBlock->numBitsPerSample = (((mCodecHeaders->getPacket(1)->packetData()[16] & FLAC_BPS_START_MASK) << 4) |
+ ((mCodecHeaders->getPacket(1)->packetData()[17] & FLAC_BPS_END_MASK) >> 4)) + 1;
+ return true;
+}
+BYTE* FLACStream::getFormatBlock() {
+
+ return (BYTE*)mFLACFormatBlock;
+
+
+}
+unsigned long FLACStream::getFormatBlockSize() {
+ //Do something
+ return sizeof(sFLACFormatBlock);
+}
+GUID FLACStream::getFormatGUID() {
+ return FORMAT_FLAC;
+}
+GUID FLACStream::getSubtypeGUID() {
+ return MEDIASUBTYPE_FLAC;
+}
+GUID FLACStream::getMajorTypeGUID() {
+ return MEDIATYPE_Audio;
+}
+
+//Need to override from oggstream because we have variable number of headers
+bool FLACStream::processHeaderPacket(StampedOggPacket* inPacket) {
+ //FIX::: Return values
+ const unsigned char MORE_HEADERS_MASK = 128; //10000000
+ //We don't delete the packet... the codecheader list will delete when it's done.
+ //StampedOggPacket* locPacket = processPacket(inPacket);
+ if (inPacket != NULL) {
+ //We got a comlpete packet
+ mCodecHeaders->addPacket(inPacket);
+ if ((inPacket->packetData()[0] & MORE_HEADERS_MASK) != 0) {
+ mNumHeadersNeeded--;
+ //mNumHeaderPackets++;
+ }
+ }
+ return true;
+}
+void FLACStream::setLastEndGranPos(__int64 inPos) {
+ mLastEndGranulePos = (inPos * (__int64)mFLACFormatBlock->samplesPerSec)/ UNITS;
+}
+bool FLACStream::deliverCodecHeaders() {
+ StampedOggPacket* locPacket = NULL;
+ for (unsigned long i = 0; i < mCodecHeaders->numPackets(); i++) {
+ if (i==0) {
+ locPacket = (StampedOggPacket*)mCodecHeaders->getPacket(0)->clone();
+ } else {
+ locPacket->merge(mCodecHeaders->getPacket(i));
+ }
+ }
+ if (mCodecHeaders->numPackets() > 0) {
+ dispatchPacket(locPacket);
+ }
+ return true;
+}
+
+LONGLONG FLACStream::getCurrentPos() {
+ return (mLastEndGranulePos * UNITS) / mFLACFormatBlock->samplesPerSec;
+}
+
+//unsigned long FLACStream::numCodecHeaders() {
+// return mNumHeaderPackets; //is this even needed ?
//}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FLACStream.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FLACStream.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FLACStream.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FLACStream.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,67 +1,67 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include "oggdllstuff.h"
-
-#include "OggPage.h"
-#include "OggPacket.h"
-class OggStream;
-class FLACStream
- : public OggStream
-{
-public:
- FLACStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
- virtual ~FLACStream(void);
-
- //Implementing virtuals in OGgStream
- virtual bool InitCodec(StampedOggPacket* inOggPacket);
-
- virtual BYTE* getFormatBlock() ;
- virtual unsigned long getFormatBlockSize();
- virtual GUID getFormatGUID();
- virtual GUID getSubtypeGUID();
- virtual wstring getPinName();
- virtual bool createFormatBlock();
- virtual GUID getMajorTypeGUID();
- virtual LONGLONG getCurrentPos();
-
- //Override from oggstream to handle dynamic number of headers.
- virtual bool FLACStream::processHeaderPacket(StampedOggPacket* inPacket);
- virtual bool deliverCodecHeaders();
-
-// virtual unsigned long numCodecHeaders();
-
- virtual void setLastEndGranPos(__int64 inPos);
-
-protected:
- //unsigned long mNumHeaderPackets;
- sFLACFormatBlock* mFLACFormatBlock;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+#include "oggdllstuff.h"
+
+#include "OggPage.h"
+#include "OggPacket.h"
+class OggStream;
+class FLACStream
+ : public OggStream
+{
+public:
+ FLACStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
+ virtual ~FLACStream(void);
+
+ //Implementing virtuals in OGgStream
+ virtual bool InitCodec(StampedOggPacket* inOggPacket);
+
+ virtual BYTE* getFormatBlock() ;
+ virtual unsigned long getFormatBlockSize();
+ virtual GUID getFormatGUID();
+ virtual GUID getSubtypeGUID();
+ virtual wstring getPinName();
+ virtual bool createFormatBlock();
+ virtual GUID getMajorTypeGUID();
+ virtual LONGLONG getCurrentPos();
+
+ //Override from oggstream to handle dynamic number of headers.
+ virtual bool FLACStream::processHeaderPacket(StampedOggPacket* inPacket);
+ virtual bool deliverCodecHeaders();
+
+// virtual unsigned long numCodecHeaders();
+
+ virtual void setLastEndGranPos(__int64 inPos);
+
+protected:
+ //unsigned long mNumHeaderPackets;
+ sFLACFormatBlock* mFLACFormatBlock;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FLACStream.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FilterFileSource.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FilterFileSource.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FilterFileSource.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,63 +1,63 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "filterfilesource.h"
-
-FilterFileSource::FilterFileSource(void)
-{
-}
-
-FilterFileSource::~FilterFileSource(void)
-{
- mSourceFile.close();
-}
-
-unsigned long FilterFileSource::seek(unsigned long inPos) {
- mSourceFile.seekg(inPos, ios_base::beg);
- return mSourceFile.tellg();
-}
-void FilterFileSource::close() {
- mSourceFile.close();
-}
-bool FilterFileSource::open(string inSourceLocation) {
- mSourceFile.open(inSourceLocation.c_str(), ios_base::in|ios_base::binary);
- return mSourceFile.is_open();
-}
-void FilterFileSource::clear() {
- mSourceFile.clear();
-}
-bool FilterFileSource::isEOF() {
- return mSourceFile.eof();
-}
-unsigned long FilterFileSource::read(char* outBuffer, unsigned long inNumBytes) {
- mSourceFile.read(outBuffer, inNumBytes);
- return mSourceFile.gcount();
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "filterfilesource.h"
+
+FilterFileSource::FilterFileSource(void)
+{
+}
+
+FilterFileSource::~FilterFileSource(void)
+{
+ mSourceFile.close();
+}
+
+unsigned long FilterFileSource::seek(unsigned long inPos) {
+ mSourceFile.seekg(inPos, ios_base::beg);
+ return mSourceFile.tellg();
+}
+void FilterFileSource::close() {
+ mSourceFile.close();
+}
+bool FilterFileSource::open(string inSourceLocation) {
+ mSourceFile.open(inSourceLocation.c_str(), ios_base::in|ios_base::binary);
+ return mSourceFile.is_open();
+}
+void FilterFileSource::clear() {
+ mSourceFile.clear();
+}
+bool FilterFileSource::isEOF() {
+ return mSourceFile.eof();
+}
+unsigned long FilterFileSource::read(char* outBuffer, unsigned long inNumBytes) {
+ mSourceFile.read(outBuffer, inNumBytes);
+ return mSourceFile.gcount();
+}
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FilterFileSource.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FilterFileSource.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FilterFileSource.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FilterFileSource.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,55 +1,55 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-
-#include <fstream>
-
-using namespace std;
-#include "IFilterDataSource.h"
-class OGG_DEMUX_API FilterFileSource
- : public IFilterDataSource
-{
-public:
- FilterFileSource(void);
- virtual ~FilterFileSource(void);
-
- //IFilterDataSource Interface
- virtual unsigned long seek(unsigned long inPos);
- virtual void close();
- virtual bool open(string inSourceLocation);
- virtual void clear();
- virtual bool isEOF();
- virtual unsigned long read(char* outBuffer, unsigned long inNumBytes);
- //
-
-protected:
- fstream mSourceFile;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+
+#include <fstream>
+
+using namespace std;
+#include "IFilterDataSource.h"
+class OGG_DEMUX_API FilterFileSource
+ : public IFilterDataSource
+{
+public:
+ FilterFileSource(void);
+ virtual ~FilterFileSource(void);
+
+ //IFilterDataSource Interface
+ virtual unsigned long seek(unsigned long inPos);
+ virtual void close();
+ virtual bool open(string inSourceLocation);
+ virtual void clear();
+ virtual bool isEOF();
+ virtual unsigned long read(char* outBuffer, unsigned long inNumBytes);
+ //
+
+protected:
+ fstream mSourceFile;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/FilterFileSource.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,387 +1,387 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "httpfilesource.h"
-
-HTTPFileSource::HTTPFileSource(void)
- : mBufferLock(NULL)
- , mIsChunked(false)
- , mIsFirstChunk(true)
- , mChunkRemains(0)
- , mNumLeftovers(0)
-{
- mBufferLock = new CCritSec;
- debugLog.open("d:\\zen\\logs\\htttp.log", ios_base::out);
- //debugLog<<"==========================================="<<endl;
- fileDump.open("d:\\zen\\logs\\filedump.ogg", ios_base::out|ios_base::binary);
- rawDump.open("D:\\zen\\logs\\rawdump.out", ios_base::out|ios_base::binary);
-
- mInterBuff = new unsigned char[RECV_BUFF_SIZE* 2];
-
-}
-
-HTTPFileSource::~HTTPFileSource(void)
-{
- //debugLog<<"About to close socket"<<endl;
- close();
- //debugLog<<"Winsock ended"<<endl;
- debugLog.close();
- fileDump.close();
- rawDump.close();
- delete mBufferLock;
- delete mInterBuff;
-}
-
-void HTTPFileSource::unChunk(unsigned char* inBuff, unsigned long inNumBytes)
-{
-
- //This method is a bit rough and ready !!
- ASSERT(inNumBytes > 2);
- rawDump.write((char*)inBuff, inNumBytes);
- debugLog<<"UnChunk"<<endl;
- unsigned long locNumBytesLeft = inNumBytes;
-
- memcpy((void*)(mInterBuff + mNumLeftovers), (const void*)inBuff, inNumBytes);
- locNumBytesLeft += mNumLeftovers;
- mNumLeftovers = 0;
- unsigned char* locWorkingBuffPtr = mInterBuff;
-
- debugLog<<"inNumBytes = "<<inNumBytes<<endl;
-
- while (locNumBytesLeft > 8) {
- debugLog<<"---"<<endl;
- debugLog<<"Bytes left = "<<locNumBytesLeft<<endl;
- debugLog<<"ChunkRemaining = "<<mChunkRemains<<endl;
-
- if (mChunkRemains == 0) {
- debugLog<<"Zero bytes of chunk remains"<<endl;
-
- //Assign to a string for easy manipulation of the hex size
- string locTemp;
-
- if (mIsFirstChunk) {
- debugLog<<"It's the first chunk"<<endl;
- mIsFirstChunk = false;
- locTemp = (char*)locWorkingBuffPtr;
- } else {
- debugLog<<"Not the first chunk"<<endl;
- debugLog<<"Skip bytes = "<<(int)locWorkingBuffPtr[0]<<(int)locWorkingBuffPtr[1]<<endl;
- locTemp = (char*)(locWorkingBuffPtr + 2);
- locWorkingBuffPtr+=2;
- locNumBytesLeft -= 2;
- }
-
- /* if (mLeftOver != "") {
- debugLog<<"Sticking the leftovers back together..."<<endl;
- locTemp = mLeftOver + locTemp;
- mLeftOver = "";
- }*/
-
- size_t locChunkSizePos = locTemp.find("\r\n");
-
-
- if (locChunkSizePos != string::npos) {
- debugLog<<"Found the size bytes "<<endl;
- //Get a string representation of the hex string that tells us the size of the chunk
- string locChunkSizeStr = locTemp.substr(0, locChunkSizePos);
- debugLog<<"Sizingbuytes " << locChunkSizeStr<<endl;
- char* locDummyPtr = NULL;
-
- //Convert it to a number
- mChunkRemains = strtol(locChunkSizeStr.c_str(), &locDummyPtr, 16);
-
- debugLog<<"Chunk reamining "<<mChunkRemains<<endl;
- //The size of the crlf 's and the chunk size value
- unsigned long locGuffSize = (locChunkSizeStr.size() + 2);
- locWorkingBuffPtr += locGuffSize;
- locNumBytesLeft -= locGuffSize;
- } else {
- debugLog<<"************************************** "<<endl;
-
-
- }
- }
-
- //This is the end of file
- if (mChunkRemains == 0) {
- debugLog<<"EOF"<<endl;
- return;
- }
-
- //If theres less bytes than the remainder of the chunk
- if (locNumBytesLeft < mChunkRemains) {
- debugLog<<"less bytes remain than the chunk needs"<<endl;
-
- mFileCache.write((const unsigned char*)locWorkingBuffPtr, locNumBytesLeft );
- fileDump.write((char*)locWorkingBuffPtr, locNumBytesLeft);
- locWorkingBuffPtr += locNumBytesLeft;
- mChunkRemains -= locNumBytesLeft;
- locNumBytesLeft = 0;
- } else {
- debugLog<<"more bytes remain than the chunk needs"<<endl;
- mFileCache.write((const unsigned char*)locWorkingBuffPtr, mChunkRemains );
- fileDump.write((char*)locWorkingBuffPtr, mChunkRemains);
- locWorkingBuffPtr += mChunkRemains;
- locNumBytesLeft -= mChunkRemains;
- mChunkRemains = 0;
- }
-
- }
-
- if (locNumBytesLeft != 0) {
- debugLog<<"There is a non- zero amount of bytes leftover... buffer them up for next time..."<<endl;
- memcpy((void*)mInterBuff, (const void*)locWorkingBuffPtr, locNumBytesLeft);
- mNumLeftovers = locNumBytesLeft;
- }
-}
-void HTTPFileSource::DataProcessLoop() {
- //debugLog<<"DataProcessLoop: "<<endl;
- int locNumRead = 0;
- char* locBuff = NULL;
- DWORD locCommand = 0;
- const unsigned long RECV_BUFF_SIZE = 1024;
- locBuff = new char[RECV_BUFF_SIZE];
-
- while(true) {
- if(CheckRequest(&locCommand) == TRUE) {
- //debugLog<<"Thread Data Process loop received breakout signal..."<<endl;
- delete[] locBuff;
- return;
- }
- //debugLog<<"About to call recv"<<endl;
- locNumRead = recv(mSocket, locBuff, RECV_BUFF_SIZE, 0);
- //debugLog<<"recv complete"<<endl;
- if (locNumRead == SOCKET_ERROR) {
- int locErr = WSAGetLastError();
- //debugLog<<"Socket error receiving - Err No = "<<locErr<<endl;
- mWasError = true;
- break;
- }
-
- if (locNumRead == 0) {
- //debugLog<<"Read last bytes..."<<endl;
- mIsEOF = true;
- delete[] locBuff;
- return;
- }
-
- {//CRITICAL SECTION - PROTECTING BUFFER STATE
- CAutoLock locLock(mBufferLock);
- //debugLog <<"Num Read = "<<locNumRead<<endl;
- if (mSeenResponse) {
- //Add to buffer
-
- if (mIsChunked) {
- unChunk((unsigned char*)locBuff, locNumRead);
- } else {
- mFileCache.write((const unsigned char*)locBuff, locNumRead);
- }
-
- //Dump to file
- //fileDump.write(locBuff, locNumRead);
- } else {
- string locTemp = locBuff;
- //debugLog<<"Binary follows... "<<endl<<locTemp<<endl;
- size_t locPos = locTemp.find("\r\n\r\n");
- if (locPos != string::npos) {
- //Found the break
- //debugLog<<"locPos = "<<locPos<<endl;
- mSeenResponse = true;
- mLastResponse = locTemp.substr(0, locPos);
-
- if (locTemp.find("Transfer-Encoding: chunked") != string::npos) {
- mIsChunked = true;
- }
-
- char* locBuff2 = locBuff + locPos + 4; //View only - don't delete.
- locTemp = locBuff2;
-
- if (mIsChunked) {
- unChunk((unsigned char*)locBuff2, locNumRead - locPos - 4);
- } else {
- //debugLog<<"Start of data follows"<<endl<<locTemp<<endl;
- mFileCache.write((const unsigned char*)locBuff2, (locNumRead - (locPos + 4)));
- }
- }
- }
- } //END CRITICAL SECTION
- }
-
- delete[] locBuff;
-}
-
-
-DWORD HTTPFileSource::ThreadProc(void) {
- //debugLog<<"ThreadProc:"<<endl;
- while(true) {
- DWORD locThreadCommand = GetRequest();
-
- switch(locThreadCommand) {
- case THREAD_EXIT:
-
- Reply(S_OK);
- return S_OK;
-
- case THREAD_RUN:
-
- Reply(S_OK);
- DataProcessLoop();
- break;
- }
- }
- return S_OK;
-}
-unsigned long HTTPFileSource::seek(unsigned long inPos) {
- //Close the socket down
- //Open up a new one to the same place.
- //Make the partial content request.
- debugLog<<"Seeking to "<<inPos<<endl;
- if (mFileCache.readSeek(inPos)) {
- return inPos;
- } else {
- return (unsigned long) -1;
- }
-
-}
-
-
-void HTTPFileSource::close() {
- //Killing thread
- debugLog<<"HTTPFileSource::close()"<<endl;
- if (ThreadExists() == TRUE) {
- //debugLog<<"Calling Thread to EXIT"<<endl;
- CallWorker(THREAD_EXIT);
- //debugLog<<"Killing thread..."<<endl;
- Close();
- //debugLog<<"After Close called on CAMThread"<<endl;
- }
-
- //debugLog<<"Closing socket..."<<endl;
- //Close the socket down.
- closeSocket();
-}
-
-bool HTTPFileSource::startThread() {
- if (ThreadExists() == FALSE) {
- Create();
- }
- CallWorker(THREAD_RUN);
- return true;
-}
-bool HTTPFileSource::open(string inSourceLocation) {
- //Open network connection and start feeding data into a buffer
- //
- mSeenResponse = false;
- mLastResponse = "";
- debugLog<<"Open: "<<inSourceLocation<<endl;
-
- { //CRITICAL SECTION - PROTECTING STREAM BUFFER
- CAutoLock locLock(mBufferLock);
-
- //Init rand number generator
- LARGE_INTEGER locTicks;
- QueryPerformanceCounter(&locTicks);
- srand((unsigned int)locTicks.LowPart);
-
- int locRand = rand();
-
- string locCacheFileName = getenv("TEMP");
- //debugLog<<"Temp = "<<locCacheFileName<<endl;
- locCacheFileName += "\\filecache";
-
- locCacheFileName += StringHelper::numToString(locRand);
- locCacheFileName += ".ogg";
- //debugLog<<"Cache file = "<<locCacheFileName<<endl;
- if(mFileCache.open(locCacheFileName)) {
- //debugLog<<"OPEN : Cach file opened"<<endl;
- }
- } //END CRITICAL SECTION
-
- bool locIsOK = setupSocket(inSourceLocation);
-
- if (!locIsOK) {
- //debugLog<<"Setup socket FAILED"<<endl;
- closeSocket();
- return false;
- }
-
- //debugLog<<"Sending request..."<<endl;
-
- //How is filename already set ??
- httpRequest(assembleRequest(mFileName));
- //debugLog<<"Socket ok... starting thread"<<endl;
- locIsOK = startThread();
-
-
- return locIsOK;
-}
-void HTTPFileSource::clear() {
- //Reset flags.
- mIsEOF = false;
- mWasError = false;
-}
-bool HTTPFileSource::isEOF() {
- { //CRITICAL SECTION - PROTECTING STREAM BUFFER
- CAutoLock locLock(mBufferLock);
- unsigned long locSizeBuffed = mFileCache.bytesAvail();;
-
- //debugLog<<"isEOF : Amount Buffered avail = "<<locSizeBuffed<<endl;
- if ((locSizeBuffed == 0) && mIsEOF) {
- debugLog<<"isEOF : It is EOF"<<endl;
- return true;
- } else {
- //debugLog<<"isEOF : It's not EOF"<<endl;
- return false;
- }
- } //END CRITICAL SECTION
-
-}
-unsigned long HTTPFileSource::read(char* outBuffer, unsigned long inNumBytes) {
- //Reads from the buffer, will return 0 if nothing in buffer.
- // If it returns 0 check the isEOF flag to see if it was the end of file or the network is just slow.
-
- { //CRITICAL SECTION - PROTECTING STREAM BUFFER
- CAutoLock locLock(mBufferLock);
-
- //debugLog<<"Read:"<<endl;
- if((mFileCache.bytesAvail() == 0) || mWasError) {
- //debugLog<<"read : Can't read is error or eof"<<endl;
- return 0;
- } else {
- //debugLog<<"Reading from buffer"<<endl;
-
- unsigned long locNumRead = mFileCache.read((unsigned char*)outBuffer, inNumBytes);
-
- //debugLog<<locNumRead<<" bytes read from buffer"<<endl;
- return locNumRead;
- }
- } //END CRITICAL SECTION
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "httpfilesource.h"
+
+HTTPFileSource::HTTPFileSource(void)
+ : mBufferLock(NULL)
+ , mIsChunked(false)
+ , mIsFirstChunk(true)
+ , mChunkRemains(0)
+ , mNumLeftovers(0)
+{
+ mBufferLock = new CCritSec;
+ debugLog.open("d:\\zen\\logs\\htttp.log", ios_base::out);
+ //debugLog<<"==========================================="<<endl;
+ fileDump.open("d:\\zen\\logs\\filedump.ogg", ios_base::out|ios_base::binary);
+ rawDump.open("D:\\zen\\logs\\rawdump.out", ios_base::out|ios_base::binary);
+
+ mInterBuff = new unsigned char[RECV_BUFF_SIZE* 2];
+
+}
+
+HTTPFileSource::~HTTPFileSource(void)
+{
+ //debugLog<<"About to close socket"<<endl;
+ close();
+ //debugLog<<"Winsock ended"<<endl;
+ debugLog.close();
+ fileDump.close();
+ rawDump.close();
+ delete mBufferLock;
+ delete mInterBuff;
+}
+
+void HTTPFileSource::unChunk(unsigned char* inBuff, unsigned long inNumBytes)
+{
+
+ //This method is a bit rough and ready !!
+ ASSERT(inNumBytes > 2);
+ rawDump.write((char*)inBuff, inNumBytes);
+ debugLog<<"UnChunk"<<endl;
+ unsigned long locNumBytesLeft = inNumBytes;
+
+ memcpy((void*)(mInterBuff + mNumLeftovers), (const void*)inBuff, inNumBytes);
+ locNumBytesLeft += mNumLeftovers;
+ mNumLeftovers = 0;
+ unsigned char* locWorkingBuffPtr = mInterBuff;
+
+ debugLog<<"inNumBytes = "<<inNumBytes<<endl;
+
+ while (locNumBytesLeft > 8) {
+ debugLog<<"---"<<endl;
+ debugLog<<"Bytes left = "<<locNumBytesLeft<<endl;
+ debugLog<<"ChunkRemaining = "<<mChunkRemains<<endl;
+
+ if (mChunkRemains == 0) {
+ debugLog<<"Zero bytes of chunk remains"<<endl;
+
+ //Assign to a string for easy manipulation of the hex size
+ string locTemp;
+
+ if (mIsFirstChunk) {
+ debugLog<<"It's the first chunk"<<endl;
+ mIsFirstChunk = false;
+ locTemp = (char*)locWorkingBuffPtr;
+ } else {
+ debugLog<<"Not the first chunk"<<endl;
+ debugLog<<"Skip bytes = "<<(int)locWorkingBuffPtr[0]<<(int)locWorkingBuffPtr[1]<<endl;
+ locTemp = (char*)(locWorkingBuffPtr + 2);
+ locWorkingBuffPtr+=2;
+ locNumBytesLeft -= 2;
+ }
+
+ /* if (mLeftOver != "") {
+ debugLog<<"Sticking the leftovers back together..."<<endl;
+ locTemp = mLeftOver + locTemp;
+ mLeftOver = "";
+ }*/
+
+ size_t locChunkSizePos = locTemp.find("\r\n");
+
+
+ if (locChunkSizePos != string::npos) {
+ debugLog<<"Found the size bytes "<<endl;
+ //Get a string representation of the hex string that tells us the size of the chunk
+ string locChunkSizeStr = locTemp.substr(0, locChunkSizePos);
+ debugLog<<"Sizingbuytes " << locChunkSizeStr<<endl;
+ char* locDummyPtr = NULL;
+
+ //Convert it to a number
+ mChunkRemains = strtol(locChunkSizeStr.c_str(), &locDummyPtr, 16);
+
+ debugLog<<"Chunk reamining "<<mChunkRemains<<endl;
+ //The size of the crlf 's and the chunk size value
+ unsigned long locGuffSize = (locChunkSizeStr.size() + 2);
+ locWorkingBuffPtr += locGuffSize;
+ locNumBytesLeft -= locGuffSize;
+ } else {
+ debugLog<<"************************************** "<<endl;
+
+
+ }
+ }
+
+ //This is the end of file
+ if (mChunkRemains == 0) {
+ debugLog<<"EOF"<<endl;
+ return;
+ }
+
+ //If theres less bytes than the remainder of the chunk
+ if (locNumBytesLeft < mChunkRemains) {
+ debugLog<<"less bytes remain than the chunk needs"<<endl;
+
+ mFileCache.write((const unsigned char*)locWorkingBuffPtr, locNumBytesLeft );
+ fileDump.write((char*)locWorkingBuffPtr, locNumBytesLeft);
+ locWorkingBuffPtr += locNumBytesLeft;
+ mChunkRemains -= locNumBytesLeft;
+ locNumBytesLeft = 0;
+ } else {
+ debugLog<<"more bytes remain than the chunk needs"<<endl;
+ mFileCache.write((const unsigned char*)locWorkingBuffPtr, mChunkRemains );
+ fileDump.write((char*)locWorkingBuffPtr, mChunkRemains);
+ locWorkingBuffPtr += mChunkRemains;
+ locNumBytesLeft -= mChunkRemains;
+ mChunkRemains = 0;
+ }
+
+ }
+
+ if (locNumBytesLeft != 0) {
+ debugLog<<"There is a non- zero amount of bytes leftover... buffer them up for next time..."<<endl;
+ memcpy((void*)mInterBuff, (const void*)locWorkingBuffPtr, locNumBytesLeft);
+ mNumLeftovers = locNumBytesLeft;
+ }
+}
+void HTTPFileSource::DataProcessLoop() {
+ //debugLog<<"DataProcessLoop: "<<endl;
+ int locNumRead = 0;
+ char* locBuff = NULL;
+ DWORD locCommand = 0;
+ const unsigned long RECV_BUFF_SIZE = 1024;
+ locBuff = new char[RECV_BUFF_SIZE];
+
+ while(true) {
+ if(CheckRequest(&locCommand) == TRUE) {
+ //debugLog<<"Thread Data Process loop received breakout signal..."<<endl;
+ delete[] locBuff;
+ return;
+ }
+ //debugLog<<"About to call recv"<<endl;
+ locNumRead = recv(mSocket, locBuff, RECV_BUFF_SIZE, 0);
+ //debugLog<<"recv complete"<<endl;
+ if (locNumRead == SOCKET_ERROR) {
+ int locErr = WSAGetLastError();
+ //debugLog<<"Socket error receiving - Err No = "<<locErr<<endl;
+ mWasError = true;
+ break;
+ }
+
+ if (locNumRead == 0) {
+ //debugLog<<"Read last bytes..."<<endl;
+ mIsEOF = true;
+ delete[] locBuff;
+ return;
+ }
+
+ {//CRITICAL SECTION - PROTECTING BUFFER STATE
+ CAutoLock locLock(mBufferLock);
+ //debugLog <<"Num Read = "<<locNumRead<<endl;
+ if (mSeenResponse) {
+ //Add to buffer
+
+ if (mIsChunked) {
+ unChunk((unsigned char*)locBuff, locNumRead);
+ } else {
+ mFileCache.write((const unsigned char*)locBuff, locNumRead);
+ }
+
+ //Dump to file
+ //fileDump.write(locBuff, locNumRead);
+ } else {
+ string locTemp = locBuff;
+ //debugLog<<"Binary follows... "<<endl<<locTemp<<endl;
+ size_t locPos = locTemp.find("\r\n\r\n");
+ if (locPos != string::npos) {
+ //Found the break
+ //debugLog<<"locPos = "<<locPos<<endl;
+ mSeenResponse = true;
+ mLastResponse = locTemp.substr(0, locPos);
+
+ if (locTemp.find("Transfer-Encoding: chunked") != string::npos) {
+ mIsChunked = true;
+ }
+
+ char* locBuff2 = locBuff + locPos + 4; //View only - don't delete.
+ locTemp = locBuff2;
+
+ if (mIsChunked) {
+ unChunk((unsigned char*)locBuff2, locNumRead - locPos - 4);
+ } else {
+ //debugLog<<"Start of data follows"<<endl<<locTemp<<endl;
+ mFileCache.write((const unsigned char*)locBuff2, (locNumRead - (locPos + 4)));
+ }
+ }
+ }
+ } //END CRITICAL SECTION
+ }
+
+ delete[] locBuff;
+}
+
+
+DWORD HTTPFileSource::ThreadProc(void) {
+ //debugLog<<"ThreadProc:"<<endl;
+ while(true) {
+ DWORD locThreadCommand = GetRequest();
+
+ switch(locThreadCommand) {
+ case THREAD_EXIT:
+
+ Reply(S_OK);
+ return S_OK;
+
+ case THREAD_RUN:
+
+ Reply(S_OK);
+ DataProcessLoop();
+ break;
+ }
+ }
+ return S_OK;
+}
+unsigned long HTTPFileSource::seek(unsigned long inPos) {
+ //Close the socket down
+ //Open up a new one to the same place.
+ //Make the partial content request.
+ debugLog<<"Seeking to "<<inPos<<endl;
+ if (mFileCache.readSeek(inPos)) {
+ return inPos;
+ } else {
+ return (unsigned long) -1;
+ }
+
+}
+
+
+void HTTPFileSource::close() {
+ //Killing thread
+ debugLog<<"HTTPFileSource::close()"<<endl;
+ if (ThreadExists() == TRUE) {
+ //debugLog<<"Calling Thread to EXIT"<<endl;
+ CallWorker(THREAD_EXIT);
+ //debugLog<<"Killing thread..."<<endl;
+ Close();
+ //debugLog<<"After Close called on CAMThread"<<endl;
+ }
+
+ //debugLog<<"Closing socket..."<<endl;
+ //Close the socket down.
+ closeSocket();
+}
+
+bool HTTPFileSource::startThread() {
+ if (ThreadExists() == FALSE) {
+ Create();
+ }
+ CallWorker(THREAD_RUN);
+ return true;
+}
+bool HTTPFileSource::open(string inSourceLocation) {
+ //Open network connection and start feeding data into a buffer
+ //
+ mSeenResponse = false;
+ mLastResponse = "";
+ debugLog<<"Open: "<<inSourceLocation<<endl;
+
+ { //CRITICAL SECTION - PROTECTING STREAM BUFFER
+ CAutoLock locLock(mBufferLock);
+
+ //Init rand number generator
+ LARGE_INTEGER locTicks;
+ QueryPerformanceCounter(&locTicks);
+ srand((unsigned int)locTicks.LowPart);
+
+ int locRand = rand();
+
+ string locCacheFileName = getenv("TEMP");
+ //debugLog<<"Temp = "<<locCacheFileName<<endl;
+ locCacheFileName += "\\filecache";
+
+ locCacheFileName += StringHelper::numToString(locRand);
+ locCacheFileName += ".ogg";
+ //debugLog<<"Cache file = "<<locCacheFileName<<endl;
+ if(mFileCache.open(locCacheFileName)) {
+ //debugLog<<"OPEN : Cach file opened"<<endl;
+ }
+ } //END CRITICAL SECTION
+
+ bool locIsOK = setupSocket(inSourceLocation);
+
+ if (!locIsOK) {
+ //debugLog<<"Setup socket FAILED"<<endl;
+ closeSocket();
+ return false;
+ }
+
+ //debugLog<<"Sending request..."<<endl;
+
+ //How is filename already set ??
+ httpRequest(assembleRequest(mFileName));
+ //debugLog<<"Socket ok... starting thread"<<endl;
+ locIsOK = startThread();
+
+
+ return locIsOK;
+}
+void HTTPFileSource::clear() {
+ //Reset flags.
+ mIsEOF = false;
+ mWasError = false;
+}
+bool HTTPFileSource::isEOF() {
+ { //CRITICAL SECTION - PROTECTING STREAM BUFFER
+ CAutoLock locLock(mBufferLock);
+ unsigned long locSizeBuffed = mFileCache.bytesAvail();;
+
+ //debugLog<<"isEOF : Amount Buffered avail = "<<locSizeBuffed<<endl;
+ if ((locSizeBuffed == 0) && mIsEOF) {
+ debugLog<<"isEOF : It is EOF"<<endl;
+ return true;
+ } else {
+ //debugLog<<"isEOF : It's not EOF"<<endl;
+ return false;
+ }
+ } //END CRITICAL SECTION
+
+}
+unsigned long HTTPFileSource::read(char* outBuffer, unsigned long inNumBytes) {
+ //Reads from the buffer, will return 0 if nothing in buffer.
+ // If it returns 0 check the isEOF flag to see if it was the end of file or the network is just slow.
+
+ { //CRITICAL SECTION - PROTECTING STREAM BUFFER
+ CAutoLock locLock(mBufferLock);
+
+ //debugLog<<"Read:"<<endl;
+ if((mFileCache.bytesAvail() == 0) || mWasError) {
+ //debugLog<<"read : Can't read is error or eof"<<endl;
+ return 0;
+ } else {
+ //debugLog<<"Reading from buffer"<<endl;
+
+ unsigned long locNumRead = mFileCache.read((unsigned char*)outBuffer, inNumBytes);
+
+ //debugLog<<locNumRead<<" bytes read from buffer"<<endl;
+ return locNumRead;
+ }
+ } //END CRITICAL SECTION
+}
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,87 +1,87 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include "oggdllstuff.h"
-#include <winsock.h>
-#include "HTTPSocket.h"
-#include "SingleMediaFileCache.h"
-#include <string>
-#include <sstream>
-#include <fstream>
-
-using namespace std;
-
-class OGG_DEMUX_API HTTPFileSource
- : public IFilterDataSource
- , public CAMThread
- , protected HTTPSocket
-{
-public:
- HTTPFileSource(void);
- virtual ~HTTPFileSource(void);
-
- //Thread commands
- static const int THREAD_RUN = 0;
- static const int THREAD_EXIT = 1;
-
- //IFilterDataSource Interface
- virtual unsigned long seek(unsigned long inPos);
- virtual void close() ;
- virtual bool open(string inSourceLocation);
- virtual void clear();
- virtual bool isEOF();
- virtual unsigned long read(char* outBuffer, unsigned long inNumBytes);
-
- //CAMThread pure virtuals
- DWORD HTTPFileSource::ThreadProc();
-
-protected:
- void unChunk(unsigned char* inBuff, unsigned long inNumBytes);
- bool startThread();
- void DataProcessLoop();
-
- SingleMediaFileCache mFileCache;
-
- bool mIsChunked;
- unsigned long mChunkRemains;
-
- bool mIsFirstChunk;
-
- fstream debugLog;
- fstream fileDump;
- fstream rawDump;
-
- unsigned char* mInterBuff;
- unsigned long mNumLeftovers;
- static const unsigned long RECV_BUFF_SIZE = 1024;
-
- CCritSec* mBufferLock;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+#include "oggdllstuff.h"
+#include <winsock.h>
+#include "HTTPSocket.h"
+#include "SingleMediaFileCache.h"
+#include <string>
+#include <sstream>
+#include <fstream>
+
+using namespace std;
+
+class OGG_DEMUX_API HTTPFileSource
+ : public IFilterDataSource
+ , public CAMThread
+ , protected HTTPSocket
+{
+public:
+ HTTPFileSource(void);
+ virtual ~HTTPFileSource(void);
+
+ //Thread commands
+ static const int THREAD_RUN = 0;
+ static const int THREAD_EXIT = 1;
+
+ //IFilterDataSource Interface
+ virtual unsigned long seek(unsigned long inPos);
+ virtual void close() ;
+ virtual bool open(string inSourceLocation);
+ virtual void clear();
+ virtual bool isEOF();
+ virtual unsigned long read(char* outBuffer, unsigned long inNumBytes);
+
+ //CAMThread pure virtuals
+ DWORD HTTPFileSource::ThreadProc();
+
+protected:
+ void unChunk(unsigned char* inBuff, unsigned long inNumBytes);
+ bool startThread();
+ void DataProcessLoop();
+
+ SingleMediaFileCache mFileCache;
+
+ bool mIsChunked;
+ unsigned long mChunkRemains;
+
+ bool mIsFirstChunk;
+
+ fstream debugLog;
+ fstream fileDump;
+ fstream rawDump;
+
+ unsigned char* mInterBuff;
+ unsigned long mNumLeftovers;
+ static const unsigned long RECV_BUFF_SIZE = 1024;
+
+ CCritSec* mBufferLock;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPFileSource.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPOggSeeking.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPOggSeeking.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPOggSeeking.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,11 +1,11 @@
-#include "StdAfx.h"
-//#include ".\httpoggseeking.h"
-//
-//HTTPOggSeeking::HTTPOggSeeking(CachedHTTPFileSource* inDataSource)
-// : mDataSource(inDataSource)
-//{
-//}
-//
-//HTTPOggSeeking::~HTTPOggSeeking(void)
-//{
-//}
+#include "StdAfx.h"
+//#include ".\httpoggseeking.h"
+//
+//HTTPOggSeeking::HTTPOggSeeking(CachedHTTPFileSource* inDataSource)
+// : mDataSource(inDataSource)
+//{
+//}
+//
+//HTTPOggSeeking::~HTTPOggSeeking(void)
+//{
+//}
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPOggSeeking.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPOggSeeking.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPOggSeeking.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPOggSeeking.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,23 +1,23 @@
-#pragma once
-
-//class HTTPOggSeeking
-// : public AutoOggSeekTable
-//{
-//public:
-// HTTPOggSeeking(CachedHTTPFileSource* inDataSource);
-// virtual ~HTTPOggSeeking(void);
-//
-// virtual bool buildTable();
-//
-// //IOggCallback interface
-// virtual bool acceptOggPage(OggPage* inOggPage);
-//
-// //__int64 fileDuration();
-//
-// //bool addSeekPoint(__int64 inTime, unsigned long mStartPos);
-// tSeekPair getStartPos(__int64 inTime);
-//
-//protected:
-// CachedHTTPFileSource* mDataSource;
-//
-//};
+#pragma once
+
+//class HTTPOggSeeking
+// : public AutoOggSeekTable
+//{
+//public:
+// HTTPOggSeeking(CachedHTTPFileSource* inDataSource);
+// virtual ~HTTPOggSeeking(void);
+//
+// virtual bool buildTable();
+//
+// //IOggCallback interface
+// virtual bool acceptOggPage(OggPage* inOggPage);
+//
+// //__int64 fileDuration();
+//
+// //bool addSeekPoint(__int64 inTime, unsigned long mStartPos);
+// tSeekPair getStartPos(__int64 inTime);
+//
+//protected:
+// CachedHTTPFileSource* mDataSource;
+//
+//};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPOggSeeking.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPSocket.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPSocket.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPSocket.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,208 +1,208 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include ".\httpsocket.h"
-
-HTTPSocket::HTTPSocket(void)
- : mWasError(false)
- , mIsEOF(false)
- , mIsOpen(false)
- , mSeenResponse(false)
-{
- //debugLog2.open("G:\\logs\\httpsocket.log", ios_base::out);
-
- //Setup the socket API
- WORD locWinsockVersion = MAKEWORD(1,1);
- WSADATA locWinsockData;
- int locRet= 0;
-
- locRet = WSAStartup(locWinsockVersion, &locWinsockData);
- if ((locRet != 0) || (locWinsockData.wVersion != locWinsockVersion)) {
- //Failed to setup.
- //debugLog2<<"Failed to start winsock V "<<locWinsockData.wVersion<<endl;
- WSACleanup();
- throw 0;
- }
-
- //debugLog2<<"Winsock started"<<endl;
-}
-
-HTTPSocket::~HTTPSocket(void)
-{
- //debugLog2<<"Winsock ended"<<endl;
- //debugLog2.close();
-
- WSACleanup();
-}
-
-
-bool HTTPSocket::setupSocket(string inSourceLocation) {
-
- //debugLog2<<"Setup Socket:"<<endl;
- IN_ADDR locAddress; //iaHost
- LPHOSTENT locHostData;; //lpHost
-
- bool locValidURL = splitURL(inSourceLocation);
-
- locAddress.S_un.S_addr = inet_addr(mServerName.c_str());
-
-
- if (locAddress.S_un.S_addr == INADDR_NONE) {
- locHostData = gethostbyname(mServerName.c_str());
- } else {
- locHostData = gethostbyaddr((const char*)&locAddress, sizeof(struct in_addr), AF_INET);
- }
-
-
-
- if (locHostData == NULL) {
- //debugLog2<<"LocHostData is NULL"<<endl;
- //Failed
- return false;
- }
-
- mSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
- if (mSocket == INVALID_SOCKET) {
- //debugLog2<<"Socket Invalid"<<endl;
- //Failed
- return false;
- }
-
-
- LPSERVENT locServiceData; //lpServEnt
- SOCKADDR_IN locServiceSocketAddr; //saServer
-
- if (mPort == 0) {
- locServiceData = getservbyname("http", "tcp");
- if (locServiceData == NULL) {
- locServiceSocketAddr.sin_port = htons(80);
- } else {
- locServiceSocketAddr.sin_port = locServiceData->s_port;
- }
- } else {
- //Explicit port
- locServiceSocketAddr.sin_port = htons(mPort);
- }
-
-
-
- locServiceSocketAddr.sin_family = AF_INET;
- locServiceSocketAddr.sin_addr = *((LPIN_ADDR)*locHostData->h_addr_list);
-
-
- int locRetVal = 0;
- locRetVal = connect(mSocket, (LPSOCKADDR)&locServiceSocketAddr, sizeof(SOCKADDR_IN));
- if (locRetVal == SOCKET_ERROR) {
- //debugLog2<<"Failed to connect..."<<endl;
- closesocket(mSocket);
- return false;
- }
-
- return true;
-
-
-}
-
-string HTTPSocket::assembleRequest(string inFilePath) {
- string retRequest;
- retRequest = "GET " + inFilePath+ " HTTP/1.1\n" + "Host: " + mServerName+ "\n" + "Connection: close" + "\n\n";
- //debugLog2<<"Assembled Req : "<<endl<<retRequest<<endl;
- return retRequest;
-}
-
-bool HTTPSocket::httpRequest(string inRequest) {
- //debugLog2<<"Http Request:"<<endl;
- int locRetVal = send(mSocket, inRequest.c_str(), (int)inRequest.length(), 0);
-
- if (locRetVal == SOCKET_ERROR) {
- //debugLog2<<"Socket error on send"<<endl;
- closesocket(mSocket);
- return false;
- }
- return true;
-}
-
-bool HTTPSocket::splitURL(string inURL) {
- //debugLog2<<"Split url:"<<endl;
- string locProtocol;
- string locServerName;
- string locPath;
- string locPort;
- string locTemp;
- size_t locPos2;
- size_t locPos = inURL.find(':');
- if (locPos == string::npos) {
- //No colon... not a url or file... failure.
- return false;
- } else {
- locProtocol = inURL.substr(0, locPos);
- locTemp = inURL.substr(locPos+1);
- locPos = locTemp.find("//");
- if ((locPos == string::npos) || (locPos != 0)) {
- return false;
- } else {
- locTemp = locTemp.substr(locPos+2);
- locPos = locTemp.find('/');
- if (locPos == string::npos) {
- return false;
- } else {
- locPos2 = locTemp.find(':');
- if (locPos2 == string::npos) {
- locServerName = locTemp.substr(0, locPos);
- locPath = locTemp.substr(locPos);
- } else if (locPos2 < locPos) {
- //Explicit port specification
- locPort = locTemp.substr(locPos2 + 1, locPos - locPos2 - 1);
- locServerName = locTemp.substr(0, locPos2);
- locPath = locTemp.substr(locPos);
- }
-
- }
- }
-
- }
-
- mServerName = locServerName;
- mFileName = locPath;
- if (locPort != "") {
- //TODO::: Error checking needed
- mPort = atoi(locPort.c_str());
- } else {
- mPort = 0;
- }
- //debugLog2<<"Proto : "<<locProtocol<<endl<<"Server : "<<locServerName<<endl<<" Path : "<<mFileName<<" Port : "<<mPort<<endl;
- return true;
-
-}
-void HTTPSocket::closeSocket() {
- //debugLog2<<"Close Socket:"<<endl;
- closesocket(mSocket);
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include ".\httpsocket.h"
+
+HTTPSocket::HTTPSocket(void)
+ : mWasError(false)
+ , mIsEOF(false)
+ , mIsOpen(false)
+ , mSeenResponse(false)
+{
+ //debugLog2.open("G:\\logs\\httpsocket.log", ios_base::out);
+
+ //Setup the socket API
+ WORD locWinsockVersion = MAKEWORD(1,1);
+ WSADATA locWinsockData;
+ int locRet= 0;
+
+ locRet = WSAStartup(locWinsockVersion, &locWinsockData);
+ if ((locRet != 0) || (locWinsockData.wVersion != locWinsockVersion)) {
+ //Failed to setup.
+ //debugLog2<<"Failed to start winsock V "<<locWinsockData.wVersion<<endl;
+ WSACleanup();
+ throw 0;
+ }
+
+ //debugLog2<<"Winsock started"<<endl;
+}
+
+HTTPSocket::~HTTPSocket(void)
+{
+ //debugLog2<<"Winsock ended"<<endl;
+ //debugLog2.close();
+
+ WSACleanup();
+}
+
+
+bool HTTPSocket::setupSocket(string inSourceLocation) {
+
+ //debugLog2<<"Setup Socket:"<<endl;
+ IN_ADDR locAddress; //iaHost
+ LPHOSTENT locHostData;; //lpHost
+
+ bool locValidURL = splitURL(inSourceLocation);
+
+ locAddress.S_un.S_addr = inet_addr(mServerName.c_str());
+
+
+ if (locAddress.S_un.S_addr == INADDR_NONE) {
+ locHostData = gethostbyname(mServerName.c_str());
+ } else {
+ locHostData = gethostbyaddr((const char*)&locAddress, sizeof(struct in_addr), AF_INET);
+ }
+
+
+
+ if (locHostData == NULL) {
+ //debugLog2<<"LocHostData is NULL"<<endl;
+ //Failed
+ return false;
+ }
+
+ mSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+ if (mSocket == INVALID_SOCKET) {
+ //debugLog2<<"Socket Invalid"<<endl;
+ //Failed
+ return false;
+ }
+
+
+ LPSERVENT locServiceData; //lpServEnt
+ SOCKADDR_IN locServiceSocketAddr; //saServer
+
+ if (mPort == 0) {
+ locServiceData = getservbyname("http", "tcp");
+ if (locServiceData == NULL) {
+ locServiceSocketAddr.sin_port = htons(80);
+ } else {
+ locServiceSocketAddr.sin_port = locServiceData->s_port;
+ }
+ } else {
+ //Explicit port
+ locServiceSocketAddr.sin_port = htons(mPort);
+ }
+
+
+
+ locServiceSocketAddr.sin_family = AF_INET;
+ locServiceSocketAddr.sin_addr = *((LPIN_ADDR)*locHostData->h_addr_list);
+
+
+ int locRetVal = 0;
+ locRetVal = connect(mSocket, (LPSOCKADDR)&locServiceSocketAddr, sizeof(SOCKADDR_IN));
+ if (locRetVal == SOCKET_ERROR) {
+ //debugLog2<<"Failed to connect..."<<endl;
+ closesocket(mSocket);
+ return false;
+ }
+
+ return true;
+
+
+}
+
+string HTTPSocket::assembleRequest(string inFilePath) {
+ string retRequest;
+ retRequest = "GET " + inFilePath+ " HTTP/1.1\n" + "Host: " + mServerName+ "\n" + "Connection: close" + "\n\n";
+ //debugLog2<<"Assembled Req : "<<endl<<retRequest<<endl;
+ return retRequest;
+}
+
+bool HTTPSocket::httpRequest(string inRequest) {
+ //debugLog2<<"Http Request:"<<endl;
+ int locRetVal = send(mSocket, inRequest.c_str(), (int)inRequest.length(), 0);
+
+ if (locRetVal == SOCKET_ERROR) {
+ //debugLog2<<"Socket error on send"<<endl;
+ closesocket(mSocket);
+ return false;
+ }
+ return true;
+}
+
+bool HTTPSocket::splitURL(string inURL) {
+ //debugLog2<<"Split url:"<<endl;
+ string locProtocol;
+ string locServerName;
+ string locPath;
+ string locPort;
+ string locTemp;
+ size_t locPos2;
+ size_t locPos = inURL.find(':');
+ if (locPos == string::npos) {
+ //No colon... not a url or file... failure.
+ return false;
+ } else {
+ locProtocol = inURL.substr(0, locPos);
+ locTemp = inURL.substr(locPos+1);
+ locPos = locTemp.find("//");
+ if ((locPos == string::npos) || (locPos != 0)) {
+ return false;
+ } else {
+ locTemp = locTemp.substr(locPos+2);
+ locPos = locTemp.find('/');
+ if (locPos == string::npos) {
+ return false;
+ } else {
+ locPos2 = locTemp.find(':');
+ if (locPos2 == string::npos) {
+ locServerName = locTemp.substr(0, locPos);
+ locPath = locTemp.substr(locPos);
+ } else if (locPos2 < locPos) {
+ //Explicit port specification
+ locPort = locTemp.substr(locPos2 + 1, locPos - locPos2 - 1);
+ locServerName = locTemp.substr(0, locPos2);
+ locPath = locTemp.substr(locPos);
+ }
+
+ }
+ }
+
+ }
+
+ mServerName = locServerName;
+ mFileName = locPath;
+ if (locPort != "") {
+ //TODO::: Error checking needed
+ mPort = atoi(locPort.c_str());
+ } else {
+ mPort = 0;
+ }
+ //debugLog2<<"Proto : "<<locProtocol<<endl<<"Server : "<<locServerName<<endl<<" Path : "<<mFileName<<" Port : "<<mPort<<endl;
+ return true;
+
+}
+void HTTPSocket::closeSocket() {
+ //debugLog2<<"Close Socket:"<<endl;
+ closesocket(mSocket);
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPSocket.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPSocket.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPSocket.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPSocket.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,61 +1,61 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include <fstream>
-#include <string>
-using namespace std;
-
-class OGG_DEMUX_API HTTPSocket
-{
-public:
- HTTPSocket(void);
- virtual ~HTTPSocket(void);
-
- virtual bool setupSocket(string inSourceLocation);
- virtual void closeSocket();
- virtual bool splitURL(string inURL);
- virtual string assembleRequest(string inFilePath);
- bool httpRequest(string inRequest);
-protected:
- string mServerName;
- string mFileName;
- unsigned short mPort;
- string mLastResponse;
- SOCKET mSocket;
-
- bool mIsEOF;
- bool mWasError;
- bool mIsOpen;
- bool mSeenResponse;
-
- //fstream debugLog2;
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+#include <fstream>
+#include <string>
+using namespace std;
+
+class OGG_DEMUX_API HTTPSocket
+{
+public:
+ HTTPSocket(void);
+ virtual ~HTTPSocket(void);
+
+ virtual bool setupSocket(string inSourceLocation);
+ virtual void closeSocket();
+ virtual bool splitURL(string inURL);
+ virtual string assembleRequest(string inFilePath);
+ bool httpRequest(string inRequest);
+protected:
+ string mServerName;
+ string mFileName;
+ unsigned short mPort;
+ string mLastResponse;
+ SOCKET mSocket;
+
+ bool mIsEOF;
+ bool mWasError;
+ bool mIsOpen;
+ bool mSeenResponse;
+
+ //fstream debugLog2;
+
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/HTTPSocket.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/IFilterDataSource.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/IFilterDataSource.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/IFilterDataSource.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,3 +1,3 @@
-#include "StdAfx.h"
-#include "ifilterdatasource.h"
-
+#include "StdAfx.h"
+#include "ifilterdatasource.h"
+
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/IFilterDataSource.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/IFilterDataSource.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/IFilterDataSource.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/IFilterDataSource.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,48 +1,48 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include <string>
-using namespace std;
-class OGG_DEMUX_API IFilterDataSource
-{
-public:
- //Empty Constructor and destructor to ensure proper deletion
- IFilterDataSource(void) {}
- virtual ~IFilterDataSource(void) {}
-
- virtual unsigned long seek(unsigned long inPos) = 0;
- virtual void close() = 0;
- virtual bool open(string inSourceLocation) = 0;
- virtual void clear() = 0;
- virtual bool isEOF() = 0;
- virtual unsigned long read(char* outBuffer, unsigned long inNumBytes) = 0;
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+#include <string>
+using namespace std;
+class OGG_DEMUX_API IFilterDataSource
+{
+public:
+ //Empty Constructor and destructor to ensure proper deletion
+ IFilterDataSource(void) {}
+ virtual ~IFilterDataSource(void) {}
+
+ virtual unsigned long seek(unsigned long inPos) = 0;
+ virtual void close() = 0;
+ virtual bool open(string inSourceLocation) = 0;
+ virtual void clear() = 0;
+ virtual bool isEOF() = 0;
+ virtual unsigned long read(char* outBuffer, unsigned long inNumBytes) = 0;
+
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/IFilterDataSource.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxFilter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxFilter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,25 +1,25 @@
-#include "StdAfx.h"
-#include "oggdemuxfilter.h"
-
-OggDemuxFilter::OggDemuxFilter(void)
-{
-}
-
-OggDemuxFilter::~OggDemuxFilter(void)
-{
-}
-
-
-CBasePin* OggDemuxFilter::GetPin(int inPinNo) {
- if ((inPinNo < 0) || (inPinNo >= mPinList.size())) {
- //Out of range
- return NULL;
- } else if (inPinNo == 0) {
- return mInputPin;
- } else {
- return mOutputPinList[inPinNo];
- }
-}
-int OggDemuxFilter::GetPinCount() {
- return mPinList.size() + 1;
-}
+#include "StdAfx.h"
+#include "oggdemuxfilter.h"
+
+OggDemuxFilter::OggDemuxFilter(void)
+{
+}
+
+OggDemuxFilter::~OggDemuxFilter(void)
+{
+}
+
+
+CBasePin* OggDemuxFilter::GetPin(int inPinNo) {
+ if ((inPinNo < 0) || (inPinNo >= mPinList.size())) {
+ //Out of range
+ return NULL;
+ } else if (inPinNo == 0) {
+ return mInputPin;
+ } else {
+ return mOutputPinList[inPinNo];
+ }
+}
+int OggDemuxFilter::GetPinCount() {
+ return mPinList.size() + 1;
+}
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxFilter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxFilter.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxFilter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxFilter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,24 +1,24 @@
-#pragma once
-
-class OggDemuxFilter
- : public CBaseFilter
-{
-public:
- OggDemuxFilter(void);
- ~OggDemuxFilter(void);
-
-
- //CBaseFilter methods
- virtual CBasePin* GetPin(int inPinNo);
- virtual int GetPinCount();
-
- //IMediaFilter methods
- STDMETHODIMP Run( REFERENCE_TIME inBaseRefTime );
- STDMETHODIMP Pause ();
- STDMETHODIMP Stop();
-
-
-protected:
- vector<OggDemuxOutputPin*> mOutputPinList;
-
-};
+#pragma once
+
+class OggDemuxFilter
+ : public CBaseFilter
+{
+public:
+ OggDemuxFilter(void);
+ ~OggDemuxFilter(void);
+
+
+ //CBaseFilter methods
+ virtual CBasePin* GetPin(int inPinNo);
+ virtual int GetPinCount();
+
+ //IMediaFilter methods
+ STDMETHODIMP Run( REFERENCE_TIME inBaseRefTime );
+ STDMETHODIMP Pause ();
+ STDMETHODIMP Stop();
+
+
+protected:
+ vector<OggDemuxOutputPin*> mOutputPinList;
+
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxFilter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxOutputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxOutputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxOutputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,35 +1,35 @@
-#include "StdAfx.h"
-#include "oggdemuxoutputpin.h"
-
-OggDemuxOutputPin::OggDemuxOutputPin(void)
-{
-}
-
-OggDemuxOutputPin::~OggDemuxOutputPin(void)
-{
-}
-
-HRESULT DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES* inPropertyRequest) {
- //PURE VIRTUAL - We must implement this method
- //This is called by the input pin if it wishes to specify the allocator properties.
- //We *should* honour it's request but we don't have to. The output pin gets the final say as it
- //is the one that has to fit it's data in there. If the input pin is not happy with it it should not connect !
-
- //WHAT WE MUST DO:
- //a) Change any properties we see fit.
- //b) Call SetProperties on the IMemAllcoator interface we were given
- //c) Commit the allocator
- //==========================================================================================
-
- //Create the structures for setproperties to use
- ALLOCATOR_PROPERTIES* locReqAlloc = new ALLOCATOR_PROPERTIES;
- ALLOCATOR_PROPERTIES* locActualAlloc = new ALLOCATOR_PROPERTIES;
-
-
-
-
-
-}
-HRESULT CheckMediaType(const CMediaType *pmt) {
-
+#include "StdAfx.h"
+#include "oggdemuxoutputpin.h"
+
+OggDemuxOutputPin::OggDemuxOutputPin(void)
+{
+}
+
+OggDemuxOutputPin::~OggDemuxOutputPin(void)
+{
+}
+
+HRESULT DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES* inPropertyRequest) {
+ //PURE VIRTUAL - We must implement this method
+ //This is called by the input pin if it wishes to specify the allocator properties.
+ //We *should* honour it's request but we don't have to. The output pin gets the final say as it
+ //is the one that has to fit it's data in there. If the input pin is not happy with it it should not connect !
+
+ //WHAT WE MUST DO:
+ //a) Change any properties we see fit.
+ //b) Call SetProperties on the IMemAllcoator interface we were given
+ //c) Commit the allocator
+ //==========================================================================================
+
+ //Create the structures for setproperties to use
+ ALLOCATOR_PROPERTIES* locReqAlloc = new ALLOCATOR_PROPERTIES;
+ ALLOCATOR_PROPERTIES* locActualAlloc = new ALLOCATOR_PROPERTIES;
+
+
+
+
+
+}
+HRESULT CheckMediaType(const CMediaType *pmt) {
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxOutputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxOutputPin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxOutputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxOutputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,19 +1,19 @@
-#pragma once
-
-class OggDemuxOutputPin
-{
-public:
- OggDemuxOutputPin(void);
- ~OggDemuxOutputPin(void);
-
- static const unsigned long BUFFER_SIZE = 98304;
- static const unsigned long NUM_BUFFERS = 3;
-
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
-
- virtual HRESULT DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES* inPropertyRequest);
- virtual HRESULT CheckMediaType(const CMediaType *pmt);
-
-};
+#pragma once
+
+class OggDemuxOutputPin
+{
+public:
+ OggDemuxOutputPin(void);
+ ~OggDemuxOutputPin(void);
+
+ static const unsigned long BUFFER_SIZE = 98304;
+ static const unsigned long NUM_BUFFERS = 3;
+
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+
+ virtual HRESULT DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES* inPropertyRequest);
+ virtual HRESULT CheckMediaType(const CMediaType *pmt);
+
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxOutputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,757 +1,757 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "oggdemuxsourcefilter.h"
-
-//-------------------
-// This template lets the Object factory create us properly and work with COM infrastructure.
-CFactoryTemplate g_Templates[] =
-{
- {
- L"OggDemuxFilter", // Name
- &CLSID_OggDemuxSourceFilter, // CLSID
- OggDemuxSourceFilter::CreateInstance, // Method to create an instance of MyComponent
- NULL, // Initialization function
- NULL // Set-up information (for filters)
- },
-
- {
- L"illiminable About Page", // Name
- &CLSID_PropsAbout, // CLSID
- PropsAbout::CreateInstance, // Method to create an instance of MyComponent
- NULL, // Initialization function
- NULL // Set-up information (for filters)
- }
-
-};
-
-// Generic way of determining the number of items in the template
-int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
-
-
-//COM Creator Function
-CUnknown* WINAPI OggDemuxSourceFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
-{
- OggDemuxSourceFilter *pNewObject = new OggDemuxSourceFilter();
- if (pNewObject == NULL) {
- *pHr = E_OUTOFMEMORY;
- }
- return pNewObject;
-}
-
-//COM Interface query function
-STDMETHODIMP OggDemuxSourceFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
- if (riid == IID_IFileSourceFilter) {
- *ppv = (IFileSourceFilter*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- /*} else if (riid == IID_IMediaSeeking) {
- *ppv = (IMediaSeeking*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;*/
- } else if (riid == IID_ISpecifyPropertyPages) {
- *ppv = (ISpecifyPropertyPages*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- } else if (riid == IID_IAMFilterMiscFlags) {
- *ppv = (IAMFilterMiscFlags*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- } else if (riid == IID_IAMMediaContent) {
- //debugLog<<"Queries for IAMMediaContent///"<<endl;
- *ppv = (IAMMediaContent*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- }
-
- return CBaseFilter::NonDelegatingQueryInterface(riid, ppv);
-}
-
-
-//------------------
-
-//ANX::: This needs to be changed so these details are passed into the constructor. Or add another parametised constructo
-OggDemuxSourceFilter::OggDemuxSourceFilter()
- : CBaseFilter(NAME("OggDemuxSourceFilter"), NULL, m_pLock, CLSID_OggDemuxSourceFilter)
-
- , mSeekTable(NULL)
- , mDataSource(NULL)
- , mSeekTimeBase(0)
- , mJustReset(true)
-{
- //LEAK CHECK:::Both get deleted in constructor.
- m_pLock = new CCritSec;
- mSourceFileLock = new CCritSec;
- mDemuxLock = new CCritSec;
- mStreamLock = new CCritSec;
- mStreamMapper = new OggStreamMapper(this);
- debugLog.open("d:\\zen\\logs\\sourcelog.log", ios_base::out);
- //debugLog<<"Test..."<<endl;
- //debugLog.seekp(0, ios_base::end);
- //debugLog<<"Test2..."<<endl;
- //debugLog << "**************** Starting LOg ********************"<<endl;
-
-}
-
-//Perhaps also pass in the name field.
-OggDemuxSourceFilter::OggDemuxSourceFilter(REFCLSID inFilterGUID)
- : CBaseFilter(NAME("OggDemuxSourceFilter"), NULL, m_pLock, inFilterGUID)
- , mSeekTable(NULL)
- , mStreamMapper(NULL)
- , mSeekTimeBase(0)
- , mJustReset(true)
-{
- //LEAK CHECK:::Both get deleted in constructor.
- m_pLock = new CCritSec;
- mSourceFileLock = new CCritSec;
- mDemuxLock = new CCritSec;
- mStreamLock = new CCritSec;
-
- debugLog.open("d:\\zen\\logs\\anx_base_sourcelog.log", ios_base::out);
- //When it is derived, it's up to the superclass to set this.
- //mStreamMapper = new OggStreamMapper(this);
-
-}
-
-OggDemuxSourceFilter::~OggDemuxSourceFilter(void)
-{
- //TODO::: For some reason, you can't delete these !!
-
- //Clean up all our stuff...
- //delete m_pLock;
- //delete mStreamLock;
- //delete mSourceFileLock;
- //delete mDemuxLock;
- //debugLog<<"Deleting Data Source : "<<(int)mDataSource<<endl;
-
- //Close down the data source and delete it
- mDataSource->close();
- delete mDataSource;
-
- debugLog.close();
-
- //Selete the stream mapper
- delete mStreamMapper;
- mStreamMapper = NULL;
-
- //Shut down the thread
- if (ThreadExists() == TRUE) {
- //DbgLog((LOG_ERROR, 1, TEXT("******** Thread exists - closing *****")));
- Close();
- }
- //Delete the seektable
- delete mSeekTable;
-}
-
-//IAMFilterMiscFlags Interface
-ULONG OggDemuxSourceFilter::GetMiscFlags(void)
-{
- return AM_FILTER_MISC_FLAGS_IS_SOURCE;
-}
-//ISpecifyPropertyPgaes Interface
-STDMETHODIMP OggDemuxSourceFilter::GetPages(CAUUID* outPropPages)
-{
- //This function is to display a property page in graphedit.
- if (outPropPages == NULL) return E_POINTER;
-
- const int NUM_PROP_PAGES = 1;
- outPropPages->cElems = NUM_PROP_PAGES;
- outPropPages->pElems = (GUID*)(CoTaskMemAlloc(sizeof(GUID) * NUM_PROP_PAGES));
- if (outPropPages->pElems == NULL)
- {
- return E_OUTOFMEMORY;
- }
-
- outPropPages->pElems[0] = CLSID_PropsAbout;
-
- return S_OK;
-
-}
-
- //IFileSource Interface
-STDMETHODIMP OggDemuxSourceFilter::GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType)
-{
- //Return the filename and mediatype of the raw data
- LPOLESTR x = SysAllocString(mFileName.c_str());
- *outFileName = x;
-
- return S_OK;
-}
-
-
-STDMETHODIMP OggDemuxSourceFilter::Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType)
-{
- //Initialise the file here and setup all the streams
- CAutoLock locLock(m_pLock);
- mFileName = inFileName;
-
- //debugLog<<"Loading : "<<StringHelper::toNarrowStr(mFileName)<<endl;
-
- //debugLog << "Opening source file : "<<StringHelper::toNarrowStr(mFileName)<<endl;
- mSeekTable = new AutoOggSeekTable(StringHelper::toNarrowStr(mFileName));
- mSeekTable->buildTable();
-
- return SetUpPins();
-}
-
-STDMETHODIMP OggDemuxSourceFilter::GetCapabilities(DWORD* inCapabilities)
-{
- if (mSeekTable->enabled()) {
- //debugLog<<"GetCaps "<<mSeekingCap<<endl;
- *inCapabilities = mSeekingCap;
- return S_OK;
- } else {
- //debugLog<<"Get Caps failed !!!!!!!"<<endl;
- *inCapabilities = 0;
- return S_OK;;
- }
-}
-STDMETHODIMP OggDemuxSourceFilter::GetDuration(LONGLONG* outDuration)
-{
- if (mSeekTable->enabled()) {
- //debugLog<<"GetDuration = " << mSeekTable->fileDuration()<<" ds units"<<endl;
- *outDuration = mSeekTable->fileDuration();
- return S_OK;
- } else {
- return E_NOTIMPL;
- }
-
-}
-
-STDMETHODIMP OggDemuxSourceFilter::CheckCapabilities(DWORD *pCapabilities)
-{
- //debugLog<<"CheckCaps : Not impl"<<endl;
- return E_NOTIMPL;
-}
-STDMETHODIMP OggDemuxSourceFilter::IsFormatSupported(const GUID *pFormat)
-{
- ASSERT(pFormat != NULL);
- if (*pFormat == TIME_FORMAT_MEDIA_TIME) {
- //debugLog<<"IsFormatSupported : TRUE"<<endl;
- return S_OK;
- } else {
- //debugLog<<"IsFormatSupported : FALSE !!!"<<endl;
- return S_FALSE;
- }
-
-
-}
-STDMETHODIMP OggDemuxSourceFilter::QueryPreferredFormat(GUID *pFormat){
- //debugLog<<"QueryPrefferedTimeFormat : MEDIA TIME"<<endl;
- *pFormat = TIME_FORMAT_MEDIA_TIME;
- return S_OK;
-}
-STDMETHODIMP OggDemuxSourceFilter::SetTimeFormat(const GUID *pFormat){
- //debugLog<<"SetTimeForamt : NOT IMPL"<<endl;
- return E_NOTIMPL;
-}
-STDMETHODIMP OggDemuxSourceFilter::GetTimeFormat( GUID *pFormat){
- *pFormat = TIME_FORMAT_MEDIA_TIME;
- return S_OK;
-}
-STDMETHODIMP OggDemuxSourceFilter::GetStopPosition(LONGLONG *pStop){
- if (mSeekTable->enabled()) {
-
- //debugLog<<"GetStopPos = " << mSeekTable->fileDuration()<<" ds units"<<endl;
- *pStop = mSeekTable->fileDuration();
- return S_OK;
- } else {
- //debugLog<<"GetStopPos NOT IMPL"<<endl;
- return E_NOTIMPL;
- }
-}
-STDMETHODIMP OggDemuxSourceFilter::GetCurrentPosition(LONGLONG *pCurrent)
-{
- //TODO::: Implement this properly
-
- //debugLog<<"GetCurrentPos = NOT_IMPL"<<endl;
- return E_NOTIMPL;
-}
-STDMETHODIMP OggDemuxSourceFilter::ConvertTimeFormat(LONGLONG *pTarget, const GUID *pTargetFormat, LONGLONG Source, const GUID *pSourceFormat){
- //debugLog<<"ConvertTimeForamt : NOT IMPL"<<endl;
- return E_NOTIMPL;
-}
-STDMETHODIMP OggDemuxSourceFilter::SetPositions(LONGLONG *pCurrent,DWORD dwCurrentFlags,LONGLONG *pStop,DWORD dwStopFlags){
-
-
- CAutoLock locLock(m_pLock);
- //debugLog<<"Set Positions "<<*pCurrent<<" to "<<*pStop<<" with flags "<<dwCurrentFlags<<" and "<<dwStopFlags<<endl;
- if (mSeekTable->enabled()) {
- //debugLog<<"SetPos : Current = "<<*pCurrent<<" Flags = "<<dwCurrentFlags<<" Stop = "<<*pStop<<" dwStopFlags = "<<dwStopFlags<<endl;
- //debugLog<<" : Delivering begin flush..."<<endl;
-
-
- CAutoLock locSourceLock(mSourceFileLock);
-
- DeliverBeginFlush();
- //debugLog<<" : Begin flush Delviered."<<endl;
-
- //Find the byte position for this time.
- OggSeekTable::tSeekPair locStartPos = mSeekTable->getStartPos(*pCurrent);
- bool locSendExcess = false;
-
- //FIX::: This code needs to be removed, and handle start seek case.
- //.second is the file position.
- //.first is the time in DS units
- if (locStartPos.second == mStreamMapper->startOfData()) {
- locSendExcess = true;
- }
-
-
- //We have to save this here now... since time can't be reverted to granule pos in all cases
- // we have to use granule pos timestamps in order for downstream codecs to work.
- // Because of this we can't factor time bases after seeking into the sample times.
- *pCurrent = mSeekTimeBase
- = locStartPos.first; //Time from seek pair.
-
- //debugLog<<"Corrected pCurrent : "<<mSeekTimeBase<<endl;
- for (unsigned long i = 0; i < mStreamMapper->numStreams(); i++) {
- mStreamMapper->getOggStream(i)->setSendExcess(locSendExcess); //Not needed
- mStreamMapper->getOggStream(i)->setLastEndGranPos(*pCurrent);
- }
- {
- //debugLog<<" : Delivering End Flush..."<<endl;
- DeliverEndFlush();
- //debugLog<<" : End flush Delviered."<<endl;
- DeliverNewSegment(*pCurrent, mSeekTable->fileDuration(), 1.0);
- }
-
- //.second is the file position.
- mDataSource->seek(locStartPos.second);
-
- //debugLog<<" : Seek complete."<<endl;
- } else {
- //debugLog<<"Seek not IMPL"<<endl;
- return E_NOTIMPL;
- }
-
- return S_OK;
-}
-STDMETHODIMP OggDemuxSourceFilter::GetPositions(LONGLONG *pCurrent, LONGLONG *pStop)
-{
- //debugLog<<"Getpos : Not IMPL"<<endl;
- //debugLog<<"GetPos : Current = HARDCODED 2 secs , Stop = "<<mSeekTable->fileDuration()/UNITS <<" secs."<<endl;
- return E_NOTIMPL;
-}
-STDMETHODIMP OggDemuxSourceFilter::GetAvailable(LONGLONG *pEarliest, LONGLONG *pLatest){
- //debugLog<<"****GetAvailable : NOT IMPL"<<endl;
- if (mSeekTable->enabled()) {
- //debugLog<<"Get Avail ok"<<endl;
- *pEarliest = 0;
- //debugLog<<"+++++ Duration is "<<mSeekTable->fileDuration()<<endl;
- *pLatest = mSeekTable->fileDuration();
- return S_OK;
- } else {
- return E_NOTIMPL;
- }
-}
-STDMETHODIMP OggDemuxSourceFilter::SetRate(double dRate)
-{
- //debugLog<<"Set RATE : NOT IMPL"<<endl;
- return E_NOTIMPL;
-}
-STDMETHODIMP OggDemuxSourceFilter::GetRate(double *dRate)
-{
-
- *dRate = 1.0;
- return S_OK;;
-}
-STDMETHODIMP OggDemuxSourceFilter::GetPreroll(LONGLONG *pllPreroll)
-{
-
- *pllPreroll = 0;
- //debugLog<<"GetPreroll : HARD CODED TO 0"<<endl;
- return S_OK;
-}
-STDMETHODIMP OggDemuxSourceFilter::IsUsingTimeFormat(const GUID *pFormat){
- if (*pFormat == TIME_FORMAT_MEDIA_TIME) {
- //debugLog<<"IsUsingTimeFormat : MEDIA TIME TRUE"<<endl;
- return S_OK;
- } else {
- //debugLog<<"IsUsingTimeFormat : MEDIA TIME FALSE !!!!"<<endl;
- return S_FALSE;
- }
-}
-
-
-//BaseFilter Interface
-int OggDemuxSourceFilter::GetPinCount()
-{
- return mStreamMapper->numStreams();
-}
-CBasePin* OggDemuxSourceFilter::GetPin(int inPinNo)
-{
- //The cast in thesecond condition removes a warning C4018 signed/unsigned mismatch.
- // Since the first condition would short circuit if inPinNo was < 0, the cast is safe.
- if ((inPinNo >= 0) && ((unsigned long)inPinNo < mStreamMapper->numStreams())) {
- return mStreamMapper->getOggStream(inPinNo)->getPin();
- } else {
- return NULL;
- }
-}
-
-//CAMThread Stuff
-DWORD OggDemuxSourceFilter::ThreadProc(void) {
- //debugLog << "Thread Proc Called..."<<endl;
- while(true) {
- DWORD locThreadCommand = GetRequest();
- //debugLog << "Command = "<<locThreadCommand<<endl;
- switch(locThreadCommand) {
- case THREAD_EXIT:
- //debugLog << "EXIT ** "<<endl;
- Reply(S_OK);
- return S_OK;
-
- case THREAD_RUN:
- //debugLog << "RUN ** "<<endl;
- Reply(S_OK);
- DataProcessLoop();
- break;
- }
- }
- return S_OK;
-}
-
-//Helper methods
-
-void OggDemuxSourceFilter::resetStream() {
- {
- debugLog<<"Reset stream pre-lock"<<endl;
- CAutoLock locDemuxLock(mDemuxLock);
- CAutoLock locSourceLock(mSourceFileLock);
- debugLog<<"RestStream post-lock"<<endl;
-
- //Close up the data source
- mDataSource->clear();
-
- debugLog<<"Pre close"<<endl;
- mDataSource->close();
- debugLog<<"Post close"<<endl;
-
- //After closing kill the interface
- delete mDataSource;
- mDataSource = NULL;
-
-
- //Clearing the data out of the demuxer
- //mOggBuffer.debugWrite("%%%%%% Clear calling from ResetStream");
- mOggBuffer.clearData();
-
- //Before opening make the interface
- mDataSource = DataSourceFactory::createDataSource(StringHelper::toNarrowStr(mFileName).c_str());
-
- debugLog<<"Pre open"<<endl;
- mDataSource->open(StringHelper::toNarrowStr(mFileName).c_str());
- debugLog<<"Post open"<<endl;
- mDataSource->seek(mStreamMapper->startOfData()); //Should always be zero for now.
-
- //TODO::: Should be doing stuff with the demux state here ? or packetiser ?>?
-
- mJustReset = true; //TODO::: Look into this !
- }
-
- for (unsigned long i = 0; i < mStreamMapper->numStreams(); i++) {
- mStreamMapper->getOggStream(i)->setSendExcess(true);
- }
-}
-
-void OggDemuxSourceFilter::DeliverBeginFlush()
-{
- CAutoLock locLock(m_pLock);
-
- debugLog << "Delivering Begin Flush"<<endl;
- for (unsigned long i = 0; i < mStreamMapper->numStreams(); i++) {
- mStreamMapper->getOggStream(i)->getPin()->DeliverBeginFlush();
- //mStreamMapper->getOggStream(i)->flush();
- }
-
- //Should this be here or endflush or neither ?
- //mOggBuffer.debugWrite("%%%%%% Reset calling from DeliverBegingFlush");
- debugLog<<"Calling reset stream from begin flush"<<endl;
- resetStream();
-}
-
-void OggDemuxSourceFilter::DeliverEndFlush()
-{
- CAutoLock locLock(m_pLock);
- debugLog << "Delivering End Flush"<<endl;
- for (unsigned long i = 0; i < mStreamMapper->numStreams(); i++) {
- mStreamMapper->getOggStream(i)->flush();
- mStreamMapper->getOggStream(i)->getPin()->DeliverEndFlush();
- }
-}
-void OggDemuxSourceFilter::DeliverEOS()
-{
-
- for (unsigned long i = 0; i < mStreamMapper->numStreams(); i++) {
- mStreamMapper->getOggStream(i)->flush();
- mStreamMapper->getOggStream(i)->getPin()->DeliverEndOfStream();
-
- }
- //mOggBuffer.debugWrite("%%%%%% Reset calling from DeliverEOS");
- debugLog<<"Calling reset stream from DeliverEOS"<<endl;
- resetStream();
-}
-
-void OggDemuxSourceFilter::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
-{
- debugLog<<"DeliverNewSegment : Delivering start = "<<tStart<<" end = "<< tStop<<"rate = "<<dRate<<endl;
-
- for (unsigned long i = 0; i < mStreamMapper->numStreams(); i++) {
- mStreamMapper->getOggStream(i)->getPin()->DeliverNewSegment(tStart, tStop, dRate);
- }
-}
-HRESULT OggDemuxSourceFilter::DataProcessLoop()
-{
- //Mess with the locking mechanisms at your own risk.
-
- //debugLog<<"Starting DataProcessLoop :"<<endl;
- DWORD locCommand = 0;
- char* locBuff = new char[4096]; //Deleted before function returns...
- //TODO::: Make this a member variable ^^^^^
- bool locKeepGoing = true;
- unsigned long locBytesRead = 0;
- bool locIsEOF = true;
- {
- CAutoLock locSourceLock(mSourceFileLock);
- locIsEOF = mDataSource->isEOF();
- }
-
- while(true) {
- if(CheckRequest(&locCommand) == TRUE) {
- //debugLog<<"DataProcessLoop : Thread Command issued... leaving loop."<<endl;
- delete[] locBuff;
- return S_OK;
- }
- //debugLog<<"Looping..."<<endl;
- {
- CAutoLock locSourceLock(mSourceFileLock);
-
- locBytesRead = mDataSource->read(locBuff, 4096);
- mJustReset = false;
- }
- //debugLog <<"DataProcessLoop : gcount = "<<locBytesRead<<endl;
- {
- CAutoLock locDemuxLock(mDemuxLock);
- //CAutoLock locStreamLock(mStreamLock);
- if (mJustReset) { //To avoid blocking problems... restart the loop if it was just reset while waiting for lock.
- continue;
- }
- locKeepGoing = ((mOggBuffer.feed((const unsigned char*)locBuff, locBytesRead)) == (OggDataBuffer::FEED_OK));;
- }
- if (!locKeepGoing) {
- //debugLog << "DataProcessLoop : Feed in data buffer said stop"<<endl;
- //debugLog<<"DataProcessLoop : Exiting. Deliver EOS"<<endl;
- DeliverEOS();
- }
- {
- CAutoLock locSourceLock(mSourceFileLock);
- locIsEOF = mDataSource->isEOF();
- }
- if (locIsEOF) {
- //debugLog << "DataProcessLoop : EOF"<<endl;
- //debugLog<<"DataProcessLoop : Exiting. Deliver EOS"<<endl;
- DeliverEOS();
- }
- }
-
- //debugLog<<"DataProcessLoop : Exiting. Deliver EOS"<<endl;
-
- //Shuold we flush ehre ?
- delete[] locBuff;
-
- //return value ??
- return S_OK;
-}
-
-
-HRESULT OggDemuxSourceFilter::SetUpPins()
-{
- CAutoLock locDemuxLock(mDemuxLock);
- CAutoLock locSourceLock(mSourceFileLock);
-
-
- //Create and open a data source
- mDataSource = DataSourceFactory::createDataSource(StringHelper::toNarrowStr(mFileName).c_str());
- mDataSource->open(StringHelper::toNarrowStr(mFileName).c_str());
-
- //Error check
-
- //Register a callback
- mOggBuffer.registerVirtualCallback(this);
-
- char* locBuff = new char[RAW_BUFFER_SIZE];
- unsigned long locNumRead = 0;
-
- //Feed the data in until we have seen all BOS pages.
- while(!mStreamMapper->isReady()) {
-
- locNumRead = mDataSource->read(locBuff, RAW_BUFFER_SIZE);
-
- if (locNumRead > 0) {
- mOggBuffer.feed((const unsigned char*)locBuff, locNumRead);
- }
- }
-
- mStreamMapper->setAllowDispatch(true);
- mStreamMapper->toStartOfData(); //Flushes all streams and sets them to ignore the right number of headers.
- mOggBuffer.clearData();
- mDataSource->seek(0); //TODO::: This is bad for streams.
-
- //debugLog<<"COMPLETED SETUP"<<endl;
- delete[] locBuff;
- return S_OK;
-}
-//IOggCallback Interface
-
-bool OggDemuxSourceFilter::acceptOggPage(OggPage* inOggPage) //Gives away page.
-{
- return mStreamMapper->acceptOggPage(inOggPage);
-}
-
-//IMEdiaStreaming
-STDMETHODIMP OggDemuxSourceFilter::Run(REFERENCE_TIME tStart)
-{
- const REFERENCE_TIME A_LONG_TIME = UNITS * 1000;
- CAutoLock locLock(m_pLock);
- debugLog<<"Run : time = "<<tStart<<endl;
- //DeliverNewSegment(tStart, tStart + A_LONG_TIME, 1.0);
- return CBaseFilter::Run(tStart);
-
-
-}
-STDMETHODIMP OggDemuxSourceFilter::Pause(void)
-{
- CAutoLock locLock(m_pLock);
- debugLog << "** Pause called **"<<endl;
- if (m_State == State_Stopped) {
- //debugLog << "Was in stopped state... starting thread"<<endl;
- if (ThreadExists() == FALSE) {
- Create();
- }
- CallWorker(THREAD_RUN);
- }
- //debugLog<<"Was NOT is stopped state, not doing much at all..."<<endl;
-
- HRESULT locHR = CBaseFilter::Pause();
-
- return locHR;
-
-}
-STDMETHODIMP OggDemuxSourceFilter::Stop(void)
-{
- CAutoLock locLock(m_pLock);
- debugLog<<"** Stop Called ** "<<endl;
- CallWorker(THREAD_EXIT);
- Close();
- DeliverBeginFlush();
- DeliverEndFlush();
-
- return CBaseFilter::Stop();
-}
-
-CCritSec* OggDemuxSourceFilter::theLock()
-{
- return m_pLock;
-}
-
-
-//IAMMediaContent Interface
-STDMETHODIMP OggDemuxSourceFilter::get_AuthorName(BSTR* outAuthorName) {
- return E_NOTIMPL;
-}
-STDMETHODIMP OggDemuxSourceFilter::get_Title(BSTR* outTitle) {
- //debugLog<<"Try to get_Title"<<endl;
- return E_NOTIMPL;
-}
-STDMETHODIMP OggDemuxSourceFilter::get_Rating(BSTR* outRating) {
- return E_NOTIMPL;
-}
-STDMETHODIMP OggDemuxSourceFilter::get_Description(BSTR* outDescription) {
- return E_NOTIMPL;
-}
-STDMETHODIMP OggDemuxSourceFilter::get_Copyright(BSTR* outCopyright) {
- return E_NOTIMPL;
-}
-STDMETHODIMP OggDemuxSourceFilter::get_BaseURL(BSTR* outBaseURL) {
- return E_NOTIMPL;
-}
-STDMETHODIMP OggDemuxSourceFilter::get_LogoURL(BSTR* outLogoURL) {
- return E_NOTIMPL;
-}
-STDMETHODIMP OggDemuxSourceFilter::get_LogoIconURL(BSTR* outLogoIconURL) {
- return E_NOTIMPL;
-}
-STDMETHODIMP OggDemuxSourceFilter::get_WatermarkURL(BSTR* outWatermarkURL) {
- return E_NOTIMPL;
-}
-STDMETHODIMP OggDemuxSourceFilter::get_MoreInfoURL(BSTR* outMoreInfoURL) {
- return E_NOTIMPL;
-}
-STDMETHODIMP OggDemuxSourceFilter::get_MoreInfoBannerImage(BSTR* outMoreInfoBannerImage) {
- return E_NOTIMPL;
-}
-STDMETHODIMP OggDemuxSourceFilter::get_MoreInfoBannerURL(BSTR* outMoreInfoBannerURL) {
- return E_NOTIMPL;
-}
-STDMETHODIMP OggDemuxSourceFilter::get_MoreInfoText(BSTR* outMoreInfoText) {
- return E_NOTIMPL;
-}
-
-//IDispatch Interface
-STDMETHODIMP OggDemuxSourceFilter::GetTypeInfoCount( unsigned int FAR* pctinfo ) {
- return E_NOTIMPL;
-
-}
-STDMETHODIMP OggDemuxSourceFilter::GetIDsOfNames( REFIID riid,
- OLECHAR FAR* FAR* rgszNames,
- unsigned int cNames,
- LCID lcid,
- DISPID FAR* rgDispId ) {
- return E_NOTIMPL;
- }
-STDMETHODIMP OggDemuxSourceFilter::GetTypeInfo( unsigned int iTInfo,
- LCID lcid,
- ITypeInfo FAR* FAR* ppTInfo ) {
- return E_NOTIMPL;
-}
-STDMETHODIMP OggDemuxSourceFilter::Invoke( DISPID dispIdMember,
- REFIID riid,
- LCID lcid,
- WORD wFlags,
- DISPPARAMS FAR* pDispParams,
- VARIANT FAR* pVarResult,
- EXCEPINFO FAR* pExcepInfo,
- unsigned int FAR* puArgErr ) {
- return E_NOTIMPL;
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "oggdemuxsourcefilter.h"
+
+//-------------------
+// This template lets the Object factory create us properly and work with COM infrastructure.
+CFactoryTemplate g_Templates[] =
+{
+ {
+ L"OggDemuxFilter", // Name
+ &CLSID_OggDemuxSourceFilter, // CLSID
+ OggDemuxSourceFilter::CreateInstance, // Method to create an instance of MyComponent
+ NULL, // Initialization function
+ NULL // Set-up information (for filters)
+ },
+
+ {
+ L"illiminable About Page", // Name
+ &CLSID_PropsAbout, // CLSID
+ PropsAbout::CreateInstance, // Method to create an instance of MyComponent
+ NULL, // Initialization function
+ NULL // Set-up information (for filters)
+ }
+
+};
+
+// Generic way of determining the number of items in the template
+int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
+
+
+//COM Creator Function
+CUnknown* WINAPI OggDemuxSourceFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
+{
+ OggDemuxSourceFilter *pNewObject = new OggDemuxSourceFilter();
+ if (pNewObject == NULL) {
+ *pHr = E_OUTOFMEMORY;
+ }
+ return pNewObject;
+}
+
+//COM Interface query function
+STDMETHODIMP OggDemuxSourceFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+ if (riid == IID_IFileSourceFilter) {
+ *ppv = (IFileSourceFilter*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ /*} else if (riid == IID_IMediaSeeking) {
+ *ppv = (IMediaSeeking*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;*/
+ } else if (riid == IID_ISpecifyPropertyPages) {
+ *ppv = (ISpecifyPropertyPages*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ } else if (riid == IID_IAMFilterMiscFlags) {
+ *ppv = (IAMFilterMiscFlags*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ } else if (riid == IID_IAMMediaContent) {
+ //debugLog<<"Queries for IAMMediaContent///"<<endl;
+ *ppv = (IAMMediaContent*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ }
+
+ return CBaseFilter::NonDelegatingQueryInterface(riid, ppv);
+}
+
+
+//------------------
+
+//ANX::: This needs to be changed so these details are passed into the constructor. Or add another parametised constructo
+OggDemuxSourceFilter::OggDemuxSourceFilter()
+ : CBaseFilter(NAME("OggDemuxSourceFilter"), NULL, m_pLock, CLSID_OggDemuxSourceFilter)
+
+ , mSeekTable(NULL)
+ , mDataSource(NULL)
+ , mSeekTimeBase(0)
+ , mJustReset(true)
+{
+ //LEAK CHECK:::Both get deleted in constructor.
+ m_pLock = new CCritSec;
+ mSourceFileLock = new CCritSec;
+ mDemuxLock = new CCritSec;
+ mStreamLock = new CCritSec;
+ mStreamMapper = new OggStreamMapper(this);
+ debugLog.open("d:\\zen\\logs\\sourcelog.log", ios_base::out);
+ //debugLog<<"Test..."<<endl;
+ //debugLog.seekp(0, ios_base::end);
+ //debugLog<<"Test2..."<<endl;
+ //debugLog << "**************** Starting LOg ********************"<<endl;
+
+}
+
+//Perhaps also pass in the name field.
+OggDemuxSourceFilter::OggDemuxSourceFilter(REFCLSID inFilterGUID)
+ : CBaseFilter(NAME("OggDemuxSourceFilter"), NULL, m_pLock, inFilterGUID)
+ , mSeekTable(NULL)
+ , mStreamMapper(NULL)
+ , mSeekTimeBase(0)
+ , mJustReset(true)
+{
+ //LEAK CHECK:::Both get deleted in constructor.
+ m_pLock = new CCritSec;
+ mSourceFileLock = new CCritSec;
+ mDemuxLock = new CCritSec;
+ mStreamLock = new CCritSec;
+
+ debugLog.open("d:\\zen\\logs\\anx_base_sourcelog.log", ios_base::out);
+ //When it is derived, it's up to the superclass to set this.
+ //mStreamMapper = new OggStreamMapper(this);
+
+}
+
+OggDemuxSourceFilter::~OggDemuxSourceFilter(void)
+{
+ //TODO::: For some reason, you can't delete these !!
+
+ //Clean up all our stuff...
+ //delete m_pLock;
+ //delete mStreamLock;
+ //delete mSourceFileLock;
+ //delete mDemuxLock;
+ //debugLog<<"Deleting Data Source : "<<(int)mDataSource<<endl;
+
+ //Close down the data source and delete it
+ mDataSource->close();
+ delete mDataSource;
+
+ debugLog.close();
+
+ //Selete the stream mapper
+ delete mStreamMapper;
+ mStreamMapper = NULL;
+
+ //Shut down the thread
+ if (ThreadExists() == TRUE) {
+ //DbgLog((LOG_ERROR, 1, TEXT("******** Thread exists - closing *****")));
+ Close();
+ }
+ //Delete the seektable
+ delete mSeekTable;
+}
+
+//IAMFilterMiscFlags Interface
+ULONG OggDemuxSourceFilter::GetMiscFlags(void)
+{
+ return AM_FILTER_MISC_FLAGS_IS_SOURCE;
+}
+//ISpecifyPropertyPgaes Interface
+STDMETHODIMP OggDemuxSourceFilter::GetPages(CAUUID* outPropPages)
+{
+ //This function is to display a property page in graphedit.
+ if (outPropPages == NULL) return E_POINTER;
+
+ const int NUM_PROP_PAGES = 1;
+ outPropPages->cElems = NUM_PROP_PAGES;
+ outPropPages->pElems = (GUID*)(CoTaskMemAlloc(sizeof(GUID) * NUM_PROP_PAGES));
+ if (outPropPages->pElems == NULL)
+ {
+ return E_OUTOFMEMORY;
+ }
+
+ outPropPages->pElems[0] = CLSID_PropsAbout;
+
+ return S_OK;
+
+}
+
+ //IFileSource Interface
+STDMETHODIMP OggDemuxSourceFilter::GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType)
+{
+ //Return the filename and mediatype of the raw data
+ LPOLESTR x = SysAllocString(mFileName.c_str());
+ *outFileName = x;
+
+ return S_OK;
+}
+
+
+STDMETHODIMP OggDemuxSourceFilter::Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType)
+{
+ //Initialise the file here and setup all the streams
+ CAutoLock locLock(m_pLock);
+ mFileName = inFileName;
+
+ //debugLog<<"Loading : "<<StringHelper::toNarrowStr(mFileName)<<endl;
+
+ //debugLog << "Opening source file : "<<StringHelper::toNarrowStr(mFileName)<<endl;
+ mSeekTable = new AutoOggSeekTable(StringHelper::toNarrowStr(mFileName));
+ mSeekTable->buildTable();
+
+ return SetUpPins();
+}
+
+STDMETHODIMP OggDemuxSourceFilter::GetCapabilities(DWORD* inCapabilities)
+{
+ if (mSeekTable->enabled()) {
+ //debugLog<<"GetCaps "<<mSeekingCap<<endl;
+ *inCapabilities = mSeekingCap;
+ return S_OK;
+ } else {
+ //debugLog<<"Get Caps failed !!!!!!!"<<endl;
+ *inCapabilities = 0;
+ return S_OK;;
+ }
+}
+STDMETHODIMP OggDemuxSourceFilter::GetDuration(LONGLONG* outDuration)
+{
+ if (mSeekTable->enabled()) {
+ //debugLog<<"GetDuration = " << mSeekTable->fileDuration()<<" ds units"<<endl;
+ *outDuration = mSeekTable->fileDuration();
+ return S_OK;
+ } else {
+ return E_NOTIMPL;
+ }
+
+}
+
+STDMETHODIMP OggDemuxSourceFilter::CheckCapabilities(DWORD *pCapabilities)
+{
+ //debugLog<<"CheckCaps : Not impl"<<endl;
+ return E_NOTIMPL;
+}
+STDMETHODIMP OggDemuxSourceFilter::IsFormatSupported(const GUID *pFormat)
+{
+ ASSERT(pFormat != NULL);
+ if (*pFormat == TIME_FORMAT_MEDIA_TIME) {
+ //debugLog<<"IsFormatSupported : TRUE"<<endl;
+ return S_OK;
+ } else {
+ //debugLog<<"IsFormatSupported : FALSE !!!"<<endl;
+ return S_FALSE;
+ }
+
+
+}
+STDMETHODIMP OggDemuxSourceFilter::QueryPreferredFormat(GUID *pFormat){
+ //debugLog<<"QueryPrefferedTimeFormat : MEDIA TIME"<<endl;
+ *pFormat = TIME_FORMAT_MEDIA_TIME;
+ return S_OK;
+}
+STDMETHODIMP OggDemuxSourceFilter::SetTimeFormat(const GUID *pFormat){
+ //debugLog<<"SetTimeForamt : NOT IMPL"<<endl;
+ return E_NOTIMPL;
+}
+STDMETHODIMP OggDemuxSourceFilter::GetTimeFormat( GUID *pFormat){
+ *pFormat = TIME_FORMAT_MEDIA_TIME;
+ return S_OK;
+}
+STDMETHODIMP OggDemuxSourceFilter::GetStopPosition(LONGLONG *pStop){
+ if (mSeekTable->enabled()) {
+
+ //debugLog<<"GetStopPos = " << mSeekTable->fileDuration()<<" ds units"<<endl;
+ *pStop = mSeekTable->fileDuration();
+ return S_OK;
+ } else {
+ //debugLog<<"GetStopPos NOT IMPL"<<endl;
+ return E_NOTIMPL;
+ }
+}
+STDMETHODIMP OggDemuxSourceFilter::GetCurrentPosition(LONGLONG *pCurrent)
+{
+ //TODO::: Implement this properly
+
+ //debugLog<<"GetCurrentPos = NOT_IMPL"<<endl;
+ return E_NOTIMPL;
+}
+STDMETHODIMP OggDemuxSourceFilter::ConvertTimeFormat(LONGLONG *pTarget, const GUID *pTargetFormat, LONGLONG Source, const GUID *pSourceFormat){
+ //debugLog<<"ConvertTimeForamt : NOT IMPL"<<endl;
+ return E_NOTIMPL;
+}
+STDMETHODIMP OggDemuxSourceFilter::SetPositions(LONGLONG *pCurrent,DWORD dwCurrentFlags,LONGLONG *pStop,DWORD dwStopFlags){
+
+
+ CAutoLock locLock(m_pLock);
+ //debugLog<<"Set Positions "<<*pCurrent<<" to "<<*pStop<<" with flags "<<dwCurrentFlags<<" and "<<dwStopFlags<<endl;
+ if (mSeekTable->enabled()) {
+ //debugLog<<"SetPos : Current = "<<*pCurrent<<" Flags = "<<dwCurrentFlags<<" Stop = "<<*pStop<<" dwStopFlags = "<<dwStopFlags<<endl;
+ //debugLog<<" : Delivering begin flush..."<<endl;
+
+
+ CAutoLock locSourceLock(mSourceFileLock);
+
+ DeliverBeginFlush();
+ //debugLog<<" : Begin flush Delviered."<<endl;
+
+ //Find the byte position for this time.
+ OggSeekTable::tSeekPair locStartPos = mSeekTable->getStartPos(*pCurrent);
+ bool locSendExcess = false;
+
+ //FIX::: This code needs to be removed, and handle start seek case.
+ //.second is the file position.
+ //.first is the time in DS units
+ if (locStartPos.second == mStreamMapper->startOfData()) {
+ locSendExcess = true;
+ }
+
+
+ //We have to save this here now... since time can't be reverted to granule pos in all cases
+ // we have to use granule pos timestamps in order for downstream codecs to work.
+ // Because of this we can't factor time bases after seeking into the sample times.
+ *pCurrent = mSeekTimeBase
+ = locStartPos.first; //Time from seek pair.
+
+ //debugLog<<"Corrected pCurrent : "<<mSeekTimeBase<<endl;
+ for (unsigned long i = 0; i < mStreamMapper->numStreams(); i++) {
+ mStreamMapper->getOggStream(i)->setSendExcess(locSendExcess); //Not needed
+ mStreamMapper->getOggStream(i)->setLastEndGranPos(*pCurrent);
+ }
+ {
+ //debugLog<<" : Delivering End Flush..."<<endl;
+ DeliverEndFlush();
+ //debugLog<<" : End flush Delviered."<<endl;
+ DeliverNewSegment(*pCurrent, mSeekTable->fileDuration(), 1.0);
+ }
+
+ //.second is the file position.
+ mDataSource->seek(locStartPos.second);
+
+ //debugLog<<" : Seek complete."<<endl;
+ } else {
+ //debugLog<<"Seek not IMPL"<<endl;
+ return E_NOTIMPL;
+ }
+
+ return S_OK;
+}
+STDMETHODIMP OggDemuxSourceFilter::GetPositions(LONGLONG *pCurrent, LONGLONG *pStop)
+{
+ //debugLog<<"Getpos : Not IMPL"<<endl;
+ //debugLog<<"GetPos : Current = HARDCODED 2 secs , Stop = "<<mSeekTable->fileDuration()/UNITS <<" secs."<<endl;
+ return E_NOTIMPL;
+}
+STDMETHODIMP OggDemuxSourceFilter::GetAvailable(LONGLONG *pEarliest, LONGLONG *pLatest){
+ //debugLog<<"****GetAvailable : NOT IMPL"<<endl;
+ if (mSeekTable->enabled()) {
+ //debugLog<<"Get Avail ok"<<endl;
+ *pEarliest = 0;
+ //debugLog<<"+++++ Duration is "<<mSeekTable->fileDuration()<<endl;
+ *pLatest = mSeekTable->fileDuration();
+ return S_OK;
+ } else {
+ return E_NOTIMPL;
+ }
+}
+STDMETHODIMP OggDemuxSourceFilter::SetRate(double dRate)
+{
+ //debugLog<<"Set RATE : NOT IMPL"<<endl;
+ return E_NOTIMPL;
+}
+STDMETHODIMP OggDemuxSourceFilter::GetRate(double *dRate)
+{
+
+ *dRate = 1.0;
+ return S_OK;;
+}
+STDMETHODIMP OggDemuxSourceFilter::GetPreroll(LONGLONG *pllPreroll)
+{
+
+ *pllPreroll = 0;
+ //debugLog<<"GetPreroll : HARD CODED TO 0"<<endl;
+ return S_OK;
+}
+STDMETHODIMP OggDemuxSourceFilter::IsUsingTimeFormat(const GUID *pFormat){
+ if (*pFormat == TIME_FORMAT_MEDIA_TIME) {
+ //debugLog<<"IsUsingTimeFormat : MEDIA TIME TRUE"<<endl;
+ return S_OK;
+ } else {
+ //debugLog<<"IsUsingTimeFormat : MEDIA TIME FALSE !!!!"<<endl;
+ return S_FALSE;
+ }
+}
+
+
+//BaseFilter Interface
+int OggDemuxSourceFilter::GetPinCount()
+{
+ return mStreamMapper->numStreams();
+}
+CBasePin* OggDemuxSourceFilter::GetPin(int inPinNo)
+{
+ //The cast in thesecond condition removes a warning C4018 signed/unsigned mismatch.
+ // Since the first condition would short circuit if inPinNo was < 0, the cast is safe.
+ if ((inPinNo >= 0) && ((unsigned long)inPinNo < mStreamMapper->numStreams())) {
+ return mStreamMapper->getOggStream(inPinNo)->getPin();
+ } else {
+ return NULL;
+ }
+}
+
+//CAMThread Stuff
+DWORD OggDemuxSourceFilter::ThreadProc(void) {
+ //debugLog << "Thread Proc Called..."<<endl;
+ while(true) {
+ DWORD locThreadCommand = GetRequest();
+ //debugLog << "Command = "<<locThreadCommand<<endl;
+ switch(locThreadCommand) {
+ case THREAD_EXIT:
+ //debugLog << "EXIT ** "<<endl;
+ Reply(S_OK);
+ return S_OK;
+
+ case THREAD_RUN:
+ //debugLog << "RUN ** "<<endl;
+ Reply(S_OK);
+ DataProcessLoop();
+ break;
+ }
+ }
+ return S_OK;
+}
+
+//Helper methods
+
+void OggDemuxSourceFilter::resetStream() {
+ {
+ debugLog<<"Reset stream pre-lock"<<endl;
+ CAutoLock locDemuxLock(mDemuxLock);
+ CAutoLock locSourceLock(mSourceFileLock);
+ debugLog<<"RestStream post-lock"<<endl;
+
+ //Close up the data source
+ mDataSource->clear();
+
+ debugLog<<"Pre close"<<endl;
+ mDataSource->close();
+ debugLog<<"Post close"<<endl;
+
+ //After closing kill the interface
+ delete mDataSource;
+ mDataSource = NULL;
+
+
+ //Clearing the data out of the demuxer
+ //mOggBuffer.debugWrite("%%%%%% Clear calling from ResetStream");
+ mOggBuffer.clearData();
+
+ //Before opening make the interface
+ mDataSource = DataSourceFactory::createDataSource(StringHelper::toNarrowStr(mFileName).c_str());
+
+ debugLog<<"Pre open"<<endl;
+ mDataSource->open(StringHelper::toNarrowStr(mFileName).c_str());
+ debugLog<<"Post open"<<endl;
+ mDataSource->seek(mStreamMapper->startOfData()); //Should always be zero for now.
+
+ //TODO::: Should be doing stuff with the demux state here ? or packetiser ?>?
+
+ mJustReset = true; //TODO::: Look into this !
+ }
+
+ for (unsigned long i = 0; i < mStreamMapper->numStreams(); i++) {
+ mStreamMapper->getOggStream(i)->setSendExcess(true);
+ }
+}
+
+void OggDemuxSourceFilter::DeliverBeginFlush()
+{
+ CAutoLock locLock(m_pLock);
+
+ debugLog << "Delivering Begin Flush"<<endl;
+ for (unsigned long i = 0; i < mStreamMapper->numStreams(); i++) {
+ mStreamMapper->getOggStream(i)->getPin()->DeliverBeginFlush();
+ //mStreamMapper->getOggStream(i)->flush();
+ }
+
+ //Should this be here or endflush or neither ?
+ //mOggBuffer.debugWrite("%%%%%% Reset calling from DeliverBegingFlush");
+ debugLog<<"Calling reset stream from begin flush"<<endl;
+ resetStream();
+}
+
+void OggDemuxSourceFilter::DeliverEndFlush()
+{
+ CAutoLock locLock(m_pLock);
+ debugLog << "Delivering End Flush"<<endl;
+ for (unsigned long i = 0; i < mStreamMapper->numStreams(); i++) {
+ mStreamMapper->getOggStream(i)->flush();
+ mStreamMapper->getOggStream(i)->getPin()->DeliverEndFlush();
+ }
+}
+void OggDemuxSourceFilter::DeliverEOS()
+{
+
+ for (unsigned long i = 0; i < mStreamMapper->numStreams(); i++) {
+ mStreamMapper->getOggStream(i)->flush();
+ mStreamMapper->getOggStream(i)->getPin()->DeliverEndOfStream();
+
+ }
+ //mOggBuffer.debugWrite("%%%%%% Reset calling from DeliverEOS");
+ debugLog<<"Calling reset stream from DeliverEOS"<<endl;
+ resetStream();
+}
+
+void OggDemuxSourceFilter::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
+{
+ debugLog<<"DeliverNewSegment : Delivering start = "<<tStart<<" end = "<< tStop<<"rate = "<<dRate<<endl;
+
+ for (unsigned long i = 0; i < mStreamMapper->numStreams(); i++) {
+ mStreamMapper->getOggStream(i)->getPin()->DeliverNewSegment(tStart, tStop, dRate);
+ }
+}
+HRESULT OggDemuxSourceFilter::DataProcessLoop()
+{
+ //Mess with the locking mechanisms at your own risk.
+
+ //debugLog<<"Starting DataProcessLoop :"<<endl;
+ DWORD locCommand = 0;
+ char* locBuff = new char[4096]; //Deleted before function returns...
+ //TODO::: Make this a member variable ^^^^^
+ bool locKeepGoing = true;
+ unsigned long locBytesRead = 0;
+ bool locIsEOF = true;
+ {
+ CAutoLock locSourceLock(mSourceFileLock);
+ locIsEOF = mDataSource->isEOF();
+ }
+
+ while(true) {
+ if(CheckRequest(&locCommand) == TRUE) {
+ //debugLog<<"DataProcessLoop : Thread Command issued... leaving loop."<<endl;
+ delete[] locBuff;
+ return S_OK;
+ }
+ //debugLog<<"Looping..."<<endl;
+ {
+ CAutoLock locSourceLock(mSourceFileLock);
+
+ locBytesRead = mDataSource->read(locBuff, 4096);
+ mJustReset = false;
+ }
+ //debugLog <<"DataProcessLoop : gcount = "<<locBytesRead<<endl;
+ {
+ CAutoLock locDemuxLock(mDemuxLock);
+ //CAutoLock locStreamLock(mStreamLock);
+ if (mJustReset) { //To avoid blocking problems... restart the loop if it was just reset while waiting for lock.
+ continue;
+ }
+ locKeepGoing = ((mOggBuffer.feed((const unsigned char*)locBuff, locBytesRead)) == (OggDataBuffer::FEED_OK));;
+ }
+ if (!locKeepGoing) {
+ //debugLog << "DataProcessLoop : Feed in data buffer said stop"<<endl;
+ //debugLog<<"DataProcessLoop : Exiting. Deliver EOS"<<endl;
+ DeliverEOS();
+ }
+ {
+ CAutoLock locSourceLock(mSourceFileLock);
+ locIsEOF = mDataSource->isEOF();
+ }
+ if (locIsEOF) {
+ //debugLog << "DataProcessLoop : EOF"<<endl;
+ //debugLog<<"DataProcessLoop : Exiting. Deliver EOS"<<endl;
+ DeliverEOS();
+ }
+ }
+
+ //debugLog<<"DataProcessLoop : Exiting. Deliver EOS"<<endl;
+
+ //Shuold we flush ehre ?
+ delete[] locBuff;
+
+ //return value ??
+ return S_OK;
+}
+
+
+HRESULT OggDemuxSourceFilter::SetUpPins()
+{
+ CAutoLock locDemuxLock(mDemuxLock);
+ CAutoLock locSourceLock(mSourceFileLock);
+
+
+ //Create and open a data source
+ mDataSource = DataSourceFactory::createDataSource(StringHelper::toNarrowStr(mFileName).c_str());
+ mDataSource->open(StringHelper::toNarrowStr(mFileName).c_str());
+
+ //Error check
+
+ //Register a callback
+ mOggBuffer.registerVirtualCallback(this);
+
+ char* locBuff = new char[RAW_BUFFER_SIZE];
+ unsigned long locNumRead = 0;
+
+ //Feed the data in until we have seen all BOS pages.
+ while(!mStreamMapper->isReady()) {
+
+ locNumRead = mDataSource->read(locBuff, RAW_BUFFER_SIZE);
+
+ if (locNumRead > 0) {
+ mOggBuffer.feed((const unsigned char*)locBuff, locNumRead);
+ }
+ }
+
+ mStreamMapper->setAllowDispatch(true);
+ mStreamMapper->toStartOfData(); //Flushes all streams and sets them to ignore the right number of headers.
+ mOggBuffer.clearData();
+ mDataSource->seek(0); //TODO::: This is bad for streams.
+
+ //debugLog<<"COMPLETED SETUP"<<endl;
+ delete[] locBuff;
+ return S_OK;
+}
+//IOggCallback Interface
+
+bool OggDemuxSourceFilter::acceptOggPage(OggPage* inOggPage) //Gives away page.
+{
+ return mStreamMapper->acceptOggPage(inOggPage);
+}
+
+//IMEdiaStreaming
+STDMETHODIMP OggDemuxSourceFilter::Run(REFERENCE_TIME tStart)
+{
+ const REFERENCE_TIME A_LONG_TIME = UNITS * 1000;
+ CAutoLock locLock(m_pLock);
+ debugLog<<"Run : time = "<<tStart<<endl;
+ //DeliverNewSegment(tStart, tStart + A_LONG_TIME, 1.0);
+ return CBaseFilter::Run(tStart);
+
+
+}
+STDMETHODIMP OggDemuxSourceFilter::Pause(void)
+{
+ CAutoLock locLock(m_pLock);
+ debugLog << "** Pause called **"<<endl;
+ if (m_State == State_Stopped) {
+ //debugLog << "Was in stopped state... starting thread"<<endl;
+ if (ThreadExists() == FALSE) {
+ Create();
+ }
+ CallWorker(THREAD_RUN);
+ }
+ //debugLog<<"Was NOT is stopped state, not doing much at all..."<<endl;
+
+ HRESULT locHR = CBaseFilter::Pause();
+
+ return locHR;
+
+}
+STDMETHODIMP OggDemuxSourceFilter::Stop(void)
+{
+ CAutoLock locLock(m_pLock);
+ debugLog<<"** Stop Called ** "<<endl;
+ CallWorker(THREAD_EXIT);
+ Close();
+ DeliverBeginFlush();
+ DeliverEndFlush();
+
+ return CBaseFilter::Stop();
+}
+
+CCritSec* OggDemuxSourceFilter::theLock()
+{
+ return m_pLock;
+}
+
+
+//IAMMediaContent Interface
+STDMETHODIMP OggDemuxSourceFilter::get_AuthorName(BSTR* outAuthorName) {
+ return E_NOTIMPL;
+}
+STDMETHODIMP OggDemuxSourceFilter::get_Title(BSTR* outTitle) {
+ //debugLog<<"Try to get_Title"<<endl;
+ return E_NOTIMPL;
+}
+STDMETHODIMP OggDemuxSourceFilter::get_Rating(BSTR* outRating) {
+ return E_NOTIMPL;
+}
+STDMETHODIMP OggDemuxSourceFilter::get_Description(BSTR* outDescription) {
+ return E_NOTIMPL;
+}
+STDMETHODIMP OggDemuxSourceFilter::get_Copyright(BSTR* outCopyright) {
+ return E_NOTIMPL;
+}
+STDMETHODIMP OggDemuxSourceFilter::get_BaseURL(BSTR* outBaseURL) {
+ return E_NOTIMPL;
+}
+STDMETHODIMP OggDemuxSourceFilter::get_LogoURL(BSTR* outLogoURL) {
+ return E_NOTIMPL;
+}
+STDMETHODIMP OggDemuxSourceFilter::get_LogoIconURL(BSTR* outLogoIconURL) {
+ return E_NOTIMPL;
+}
+STDMETHODIMP OggDemuxSourceFilter::get_WatermarkURL(BSTR* outWatermarkURL) {
+ return E_NOTIMPL;
+}
+STDMETHODIMP OggDemuxSourceFilter::get_MoreInfoURL(BSTR* outMoreInfoURL) {
+ return E_NOTIMPL;
+}
+STDMETHODIMP OggDemuxSourceFilter::get_MoreInfoBannerImage(BSTR* outMoreInfoBannerImage) {
+ return E_NOTIMPL;
+}
+STDMETHODIMP OggDemuxSourceFilter::get_MoreInfoBannerURL(BSTR* outMoreInfoBannerURL) {
+ return E_NOTIMPL;
+}
+STDMETHODIMP OggDemuxSourceFilter::get_MoreInfoText(BSTR* outMoreInfoText) {
+ return E_NOTIMPL;
+}
+
+//IDispatch Interface
+STDMETHODIMP OggDemuxSourceFilter::GetTypeInfoCount( unsigned int FAR* pctinfo ) {
+ return E_NOTIMPL;
+
+}
+STDMETHODIMP OggDemuxSourceFilter::GetIDsOfNames( REFIID riid,
+ OLECHAR FAR* FAR* rgszNames,
+ unsigned int cNames,
+ LCID lcid,
+ DISPID FAR* rgDispId ) {
+ return E_NOTIMPL;
+ }
+STDMETHODIMP OggDemuxSourceFilter::GetTypeInfo( unsigned int iTInfo,
+ LCID lcid,
+ ITypeInfo FAR* FAR* ppTInfo ) {
+ return E_NOTIMPL;
+}
+STDMETHODIMP OggDemuxSourceFilter::Invoke( DISPID dispIdMember,
+ REFIID riid,
+ LCID lcid,
+ WORD wFlags,
+ DISPPARAMS FAR* pDispParams,
+ VARIANT FAR* pVarResult,
+ EXCEPINFO FAR* pExcepInfo,
+ unsigned int FAR* puArgErr ) {
+ return E_NOTIMPL;
+}
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,202 +1,202 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-
-#include <Dshow.h>
-#include <Initguid.h>
-#include <Qnetwork.h>
-#include "oggdllstuff.h"
-#include "OggDemuxSourcePin.h"
-#include "OggStreamMapper.h"
-#include "AutoOggSeekTable.h"
-#include <OggDataBuffer.h>
-#include "IFilterDataSource.h"
-#include "DataSourceFactory.h"
-#include "PropsAbout.h"
-#include <fstream>
-using namespace std;
-
-
-class OggStreamMapper;
-
-class OGG_DEMUX_API OggDemuxSourceFilter
- : public CBaseFilter,
- public CAMThread,
- public IFileSourceFilter,
- public IOggCallback
- , public BasicSeekPassThrough
- , public ISpecifyPropertyPages
- , public IAMFilterMiscFlags
- , public IAMMediaContent
-
-{
-public:
- friend class OggStream;
- static const unsigned long RAW_BUFFER_SIZE = 24;
- //Com Stuff
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
- static CUnknown * WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
-
- enum eThreadCommands {
- THREAD_EXIT = 0,
- THREAD_PAUSE = 1,
- THREAD_RUN = 2
- };
- //Constructors
- OggDemuxSourceFilter();
- OggDemuxSourceFilter(REFCLSID inFilterGUID);
- virtual ~OggDemuxSourceFilter(void);
-
- //IAMFilterMiscFlags Interface
- ULONG STDMETHODCALLTYPE GetMiscFlags(void);
- //
-
- //IFileSource Interface
- virtual STDMETHODIMP GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType);
- virtual STDMETHODIMP Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType);
-
- //PURE VIRTUALS From CBaseFilter
- virtual int GetPinCount();
- virtual CBasePin* GetPin(int inPinNo);
-
- //IOggCallback Interface
- virtual bool acceptOggPage(OggPage* inOggPage);
-
- //ISpecifyPropertyPages
- virtual STDMETHODIMP GetPages(CAUUID* outPropPages);
-
- //Streaming MEthods
- STDMETHODIMP Run(REFERENCE_TIME tStart);
- STDMETHODIMP Pause(void);
- STDMETHODIMP Stop(void);
-
- //IMediaSeeking
- virtual STDMETHODIMP GetDuration(LONGLONG* outDuration);
- virtual STDMETHODIMP GetCapabilities(DWORD* inCapabilities);
-
- virtual STDMETHODIMP CheckCapabilities(DWORD *pCapabilities);
- virtual STDMETHODIMP IsFormatSupported(const GUID *pFormat);
- virtual STDMETHODIMP QueryPreferredFormat(GUID *pFormat);
- virtual STDMETHODIMP SetTimeFormat(const GUID *pFormat);
- virtual STDMETHODIMP GetTimeFormat( GUID *pFormat);
-
- virtual STDMETHODIMP GetStopPosition(LONGLONG *pStop);
- virtual STDMETHODIMP GetCurrentPosition(LONGLONG *pCurrent);
- virtual STDMETHODIMP ConvertTimeFormat(LONGLONG *pTarget, const GUID *pTargetFormat, LONGLONG Source, const GUID *pSourceFormat);
- virtual STDMETHODIMP SetPositions(LONGLONG *pCurrent,DWORD dwCurrentFlags,LONGLONG *pStop,DWORD dwStopFlags);
- virtual STDMETHODIMP GetPositions(LONGLONG *pCurrent, LONGLONG *pStop);
- virtual STDMETHODIMP GetAvailable(LONGLONG *pEarliest, LONGLONG *pLatest);
- virtual STDMETHODIMP SetRate(double dRate);
- virtual STDMETHODIMP GetRate(double *dRate);
- virtual STDMETHODIMP GetPreroll(LONGLONG *pllPreroll);
- virtual STDMETHODIMP IsUsingTimeFormat(const GUID *pFormat);
-
- //IAMMediaContent Interface
- virtual STDMETHODIMP get_AuthorName(BSTR* outAuthorName);
- virtual STDMETHODIMP get_Title(BSTR* outTitle);
- virtual STDMETHODIMP get_Rating(BSTR* outRating);
- virtual STDMETHODIMP get_Description(BSTR* outDescription);
- virtual STDMETHODIMP get_Copyright(BSTR* outCopyright);
- virtual STDMETHODIMP get_BaseURL(BSTR* outBaseURL);
- virtual STDMETHODIMP get_LogoURL(BSTR* outLogoURL);
- virtual STDMETHODIMP get_LogoIconURL(BSTR* outLogoIconURL);
- virtual STDMETHODIMP get_WatermarkURL(BSTR* outWatermarkURL);
- virtual STDMETHODIMP get_MoreInfoURL(BSTR* outMoreInfoURL);
- virtual STDMETHODIMP get_MoreInfoBannerImage(BSTR* outMoreInfoBannerImage);
- virtual STDMETHODIMP get_MoreInfoBannerURL(BSTR* outMoreInfoBannerURL);
- virtual STDMETHODIMP get_MoreInfoText(BSTR* outMoreInfoText);
-
-
- //IDispatch Interface (Base interface of IAMMediaContent) - evil evil thing.
- // Trying not to implement it ! I'm sure it was all very funny when they came up with it.
- virtual STDMETHODIMP GetTypeInfoCount( unsigned int FAR* pctinfo );
- virtual STDMETHODIMP GetIDsOfNames( REFIID riid,
- OLECHAR FAR* FAR* rgszNames,
- unsigned int cNames,
- LCID lcid,
- DISPID FAR* rgDispId );
- virtual STDMETHODIMP GetTypeInfo( unsigned int iTInfo,
- LCID lcid,
- ITypeInfo FAR* FAR* ppTInfo );
- virtual STDMETHODIMP Invoke( DISPID dispIdMember,
- REFIID riid,
- LCID lcid,
- WORD wFlags,
- DISPPARAMS FAR* pDispParams,
- VARIANT FAR* pVarResult,
- EXCEPINFO FAR* pExcepInfo,
- unsigned int FAR* puArgErr );
-
-
- CCritSec* theLock();
- //CAMThread
- virtual DWORD ThreadProc(void);
-
-
- CCritSec* mStreamLock;
-
- REFERENCE_TIME mSeekTimeBase; //Don't ask !
-
-protected:
- //Internal helper methods
- void resetStream();
- void DeliverEOS();
- void DeliverBeginFlush();
- void DeliverEndFlush();
- void DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
-
- virtual HRESULT DataProcessLoop();
- virtual HRESULT SetUpPins();
- //virtual bool AddPin(OggDemuxSourcePin* inPin, unsigned long inSerialNo);
-
-
- CCritSec* mSourceFileLock;
- CCritSec* mDemuxLock;
- AutoOggSeekTable* mSeekTable;
- wstring mFileName;
-
- OggDataBuffer mOggBuffer;
-
- bool mJustReset; //This is pretty dodgy !
-
- //SOURCE ABSTRACTION::: declaration
- //fstream mSourceFile;
- //
- IFilterDataSource* mDataSource;
-
- OggStreamMapper* mStreamMapper;
-
- //DEBUG
- fstream debugLog;
-
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+
+#include <Dshow.h>
+#include <Initguid.h>
+#include <Qnetwork.h>
+#include "oggdllstuff.h"
+#include "OggDemuxSourcePin.h"
+#include "OggStreamMapper.h"
+#include "AutoOggSeekTable.h"
+#include <OggDataBuffer.h>
+#include "IFilterDataSource.h"
+#include "DataSourceFactory.h"
+#include "PropsAbout.h"
+#include <fstream>
+using namespace std;
+
+
+class OggStreamMapper;
+
+class OGG_DEMUX_API OggDemuxSourceFilter
+ : public CBaseFilter,
+ public CAMThread,
+ public IFileSourceFilter,
+ public IOggCallback
+ , public BasicSeekPassThrough
+ , public ISpecifyPropertyPages
+ , public IAMFilterMiscFlags
+ , public IAMMediaContent
+
+{
+public:
+ friend class OggStream;
+ static const unsigned long RAW_BUFFER_SIZE = 24;
+ //Com Stuff
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+ static CUnknown * WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+
+ enum eThreadCommands {
+ THREAD_EXIT = 0,
+ THREAD_PAUSE = 1,
+ THREAD_RUN = 2
+ };
+ //Constructors
+ OggDemuxSourceFilter();
+ OggDemuxSourceFilter(REFCLSID inFilterGUID);
+ virtual ~OggDemuxSourceFilter(void);
+
+ //IAMFilterMiscFlags Interface
+ ULONG STDMETHODCALLTYPE GetMiscFlags(void);
+ //
+
+ //IFileSource Interface
+ virtual STDMETHODIMP GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType);
+ virtual STDMETHODIMP Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType);
+
+ //PURE VIRTUALS From CBaseFilter
+ virtual int GetPinCount();
+ virtual CBasePin* GetPin(int inPinNo);
+
+ //IOggCallback Interface
+ virtual bool acceptOggPage(OggPage* inOggPage);
+
+ //ISpecifyPropertyPages
+ virtual STDMETHODIMP GetPages(CAUUID* outPropPages);
+
+ //Streaming MEthods
+ STDMETHODIMP Run(REFERENCE_TIME tStart);
+ STDMETHODIMP Pause(void);
+ STDMETHODIMP Stop(void);
+
+ //IMediaSeeking
+ virtual STDMETHODIMP GetDuration(LONGLONG* outDuration);
+ virtual STDMETHODIMP GetCapabilities(DWORD* inCapabilities);
+
+ virtual STDMETHODIMP CheckCapabilities(DWORD *pCapabilities);
+ virtual STDMETHODIMP IsFormatSupported(const GUID *pFormat);
+ virtual STDMETHODIMP QueryPreferredFormat(GUID *pFormat);
+ virtual STDMETHODIMP SetTimeFormat(const GUID *pFormat);
+ virtual STDMETHODIMP GetTimeFormat( GUID *pFormat);
+
+ virtual STDMETHODIMP GetStopPosition(LONGLONG *pStop);
+ virtual STDMETHODIMP GetCurrentPosition(LONGLONG *pCurrent);
+ virtual STDMETHODIMP ConvertTimeFormat(LONGLONG *pTarget, const GUID *pTargetFormat, LONGLONG Source, const GUID *pSourceFormat);
+ virtual STDMETHODIMP SetPositions(LONGLONG *pCurrent,DWORD dwCurrentFlags,LONGLONG *pStop,DWORD dwStopFlags);
+ virtual STDMETHODIMP GetPositions(LONGLONG *pCurrent, LONGLONG *pStop);
+ virtual STDMETHODIMP GetAvailable(LONGLONG *pEarliest, LONGLONG *pLatest);
+ virtual STDMETHODIMP SetRate(double dRate);
+ virtual STDMETHODIMP GetRate(double *dRate);
+ virtual STDMETHODIMP GetPreroll(LONGLONG *pllPreroll);
+ virtual STDMETHODIMP IsUsingTimeFormat(const GUID *pFormat);
+
+ //IAMMediaContent Interface
+ virtual STDMETHODIMP get_AuthorName(BSTR* outAuthorName);
+ virtual STDMETHODIMP get_Title(BSTR* outTitle);
+ virtual STDMETHODIMP get_Rating(BSTR* outRating);
+ virtual STDMETHODIMP get_Description(BSTR* outDescription);
+ virtual STDMETHODIMP get_Copyright(BSTR* outCopyright);
+ virtual STDMETHODIMP get_BaseURL(BSTR* outBaseURL);
+ virtual STDMETHODIMP get_LogoURL(BSTR* outLogoURL);
+ virtual STDMETHODIMP get_LogoIconURL(BSTR* outLogoIconURL);
+ virtual STDMETHODIMP get_WatermarkURL(BSTR* outWatermarkURL);
+ virtual STDMETHODIMP get_MoreInfoURL(BSTR* outMoreInfoURL);
+ virtual STDMETHODIMP get_MoreInfoBannerImage(BSTR* outMoreInfoBannerImage);
+ virtual STDMETHODIMP get_MoreInfoBannerURL(BSTR* outMoreInfoBannerURL);
+ virtual STDMETHODIMP get_MoreInfoText(BSTR* outMoreInfoText);
+
+
+ //IDispatch Interface (Base interface of IAMMediaContent) - evil evil thing.
+ // Trying not to implement it ! I'm sure it was all very funny when they came up with it.
+ virtual STDMETHODIMP GetTypeInfoCount( unsigned int FAR* pctinfo );
+ virtual STDMETHODIMP GetIDsOfNames( REFIID riid,
+ OLECHAR FAR* FAR* rgszNames,
+ unsigned int cNames,
+ LCID lcid,
+ DISPID FAR* rgDispId );
+ virtual STDMETHODIMP GetTypeInfo( unsigned int iTInfo,
+ LCID lcid,
+ ITypeInfo FAR* FAR* ppTInfo );
+ virtual STDMETHODIMP Invoke( DISPID dispIdMember,
+ REFIID riid,
+ LCID lcid,
+ WORD wFlags,
+ DISPPARAMS FAR* pDispParams,
+ VARIANT FAR* pVarResult,
+ EXCEPINFO FAR* pExcepInfo,
+ unsigned int FAR* puArgErr );
+
+
+ CCritSec* theLock();
+ //CAMThread
+ virtual DWORD ThreadProc(void);
+
+
+ CCritSec* mStreamLock;
+
+ REFERENCE_TIME mSeekTimeBase; //Don't ask !
+
+protected:
+ //Internal helper methods
+ void resetStream();
+ void DeliverEOS();
+ void DeliverBeginFlush();
+ void DeliverEndFlush();
+ void DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
+
+ virtual HRESULT DataProcessLoop();
+ virtual HRESULT SetUpPins();
+ //virtual bool AddPin(OggDemuxSourcePin* inPin, unsigned long inSerialNo);
+
+
+ CCritSec* mSourceFileLock;
+ CCritSec* mDemuxLock;
+ AutoOggSeekTable* mSeekTable;
+ wstring mFileName;
+
+ OggDataBuffer mOggBuffer;
+
+ bool mJustReset; //This is pretty dodgy !
+
+ //SOURCE ABSTRACTION::: declaration
+ //fstream mSourceFile;
+ //
+ IFilterDataSource* mDataSource;
+
+ OggStreamMapper* mStreamMapper;
+
+ //DEBUG
+ fstream debugLog;
+
+
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourceFilter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,241 +1,241 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "oggdemuxsourcepin.h"
-
-OggDemuxSourcePin::OggDemuxSourcePin( TCHAR* inObjectName,
- OggDemuxSourceFilter* inParentFilter,
- CCritSec* inFilterLock,
- StreamHeaders* inHeaderSource,
- CMediaType* inMediaType,
- wstring inPinName,
- bool inAllowSeek )
- : CBaseOutputPin( NAME("Ogg Demux Output Pin")
- , inParentFilter
- , inFilterLock
- , &mFilterHR
- , inPinName.c_str() )
- , mHeaders(inHeaderSource)
- , mParentFilter(inParentFilter)
- , mMediaType(inMediaType)
- , mDataQueue(NULL)
- , mFirstRun(true)
- , mPartialPacket(NULL)
-
-{
- //TODO::: Something about this is causing a COM reference leak.
-
- debugLog.open("d:\\zen\\logs\\sourcefilterpin.log", ios_base::out);
- IMediaSeeking* locSeeker = NULL;
- //if (inAllowSeek) {
- //debugLog<<"Allowing seek"<<endl;
- //Subvert COM and do this directly... this way, the source filter won't expose the interface to the
- // graph but we can still delegate to it.
-
- //inParentFilter->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
- locSeeker = (IMediaSeeking*)mParentFilter;
-
- //UNdecided whether this should be adreff or not... if you do you have a cyclic reference, if you don't see below.
- //locSeeker->AddRef(); //If you addref theres a weird destructor infinite loop. See the OggStreamMapper Destructor.
-
-
- //}
- SetDelegate(locSeeker);
-}
-
-OggDemuxSourcePin::~OggDemuxSourcePin(void)
-{
- debugLog.close();
-
- delete mDataQueue;
- mDataQueue = NULL;
-}
-
-STDMETHODIMP OggDemuxSourcePin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
- if (riid == IID_IMediaSeeking) {
- //debugLog<<"Pin queried for IMediaSeeking"<<endl;
- *ppv = (IMediaSeeking*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- }
-
- return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
-}
-bool OggDemuxSourcePin::deliverOggPacket(StampedOggPacket* inPacket)
-{
- CAutoLock locStreamLock(mParentFilter->mStreamLock);
-
-
- IMediaSample* locSample = NULL;
- REFERENCE_TIME locStart = inPacket->startTime();
- REFERENCE_TIME locStop = inPacket->endTime();
- debugLog<<"Delivering packet : "<<locStart<< " - "<<locStop<<endl;
-
-
- HRESULT locHR = GetDeliveryBuffer(&locSample, &locStart, &locStop, NULL);
- DbgLog((LOG_TRACE, 2, "* After get Buffer in Source Pin..."));
- //Error checks
- if (locHR != S_OK) {
- //Stopping, fluching or error
- debugLog<<"Failure... No buffer"<<endl;
- return false;
- }
-
- //More hacks so we can send a timebase after a seek, since granule pos in theora
- // is not convertible in both directions to time.
-
- //TIMESTAMP FIXING !
- locSample->SetTime(&locStart, &locStop);
-
- //TODO::: This style of timestamping should not be necessary anymore.
- //Yes this is way dodgy !
- locSample->SetMediaTime(&mParentFilter->mSeekTimeBase, &mParentFilter->mSeekTimeBase);
- locSample->SetSyncPoint(TRUE);
-
-
- // Create a pointer for the samples buffer
- BYTE* locBuffer = NULL;
- locSample->GetPointer(&locBuffer);
-
- if (locSample->GetSize() >= inPacket->packetSize()) {
-
- memcpy((void*)locBuffer, (const void*)inPacket->packetData(), inPacket->packetSize());
- locSample->SetActualDataLength(inPacket->packetSize());
-
- locHR = mDataQueue->Receive(locSample);
-
- if (locHR != S_OK) {
- debugLog << "Failure... Queue rejected sample..."<<endl;
- //Stopping ??
- return false;
- } else {
- return true;
- }
- } else {
- DbgLog((LOG_TRACE, 2, "* BUFFER TOO SMALL... FATALITY !!"));
- throw 0;
- }
-}
-HRESULT OggDemuxSourcePin::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
-{
- debugLog<<"Delivering new segment"<<endl;
- NewSegment(tStart, tStop, dRate);
-
- mPartialPacket = NULL;
- mDataQueue->NewSegment(tStart, tStop, dRate);
-
- return S_OK;
-}
-HRESULT OggDemuxSourcePin::DeliverEndOfStream(void)
-{
- mPartialPacket = NULL;
- mDataQueue->EOS();
- return S_OK;
-}
-
-HRESULT OggDemuxSourcePin::DeliverEndFlush(void)
-{
- debugLog<<"Delivering End flush"<<endl;
- mDataQueue->EndFlush();
- return S_OK;
-}
-
-HRESULT OggDemuxSourcePin::DeliverBeginFlush(void)
-{
- debugLog<<"Delivering begin flush"<<endl;
- mPartialPacket = NULL;
- mDataQueue->BeginFlush();
- return S_OK;
-}
-
-HRESULT OggDemuxSourcePin::CompleteConnect (IPin *inReceivePin)
-{
- mFilterHR = S_OK;
- //Set the delegate for seeking
- //((BasicSeekable*)(inReceivePin))->SetDelegate(this);
- //This may cause issue if pins are disconnected and reconnected
- //DELETE in DEStructor
- mDataQueue = new COutputQueue (inReceivePin, &mFilterHR, FALSE, TRUE,1,TRUE, NUM_BUFFERS);
-
- return CBaseOutputPin::CompleteConnect(inReceivePin);
-}
-
-HRESULT OggDemuxSourcePin::BreakConnect(void)
-{
- delete mDataQueue;
- mDataQueue = NULL;
- return CBaseOutputPin::BreakConnect();
-}
-
- //CSourceStream virtuals
-HRESULT OggDemuxSourcePin::GetMediaType(int inPosition, CMediaType* outMediaType)
-{
- //Put it in from the info we got in the constructor.
- if (inPosition == 0) {
- *outMediaType = *mMediaType;
- return S_OK;
- } else {
- return VFW_S_NO_MORE_ITEMS;
- }
-}
-HRESULT OggDemuxSourcePin::CheckMediaType(const CMediaType* inMediaType) {
- if (inMediaType->majortype == mMediaType->majortype && inMediaType->subtype == mMediaType->subtype && inMediaType->formattype == mMediaType->formattype) {
- return S_OK;
- } else {
- return E_FAIL;
- }
-}
-HRESULT OggDemuxSourcePin::DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest)
-{
- HRESULT locHR = S_OK;
-
- ALLOCATOR_PROPERTIES locReqAlloc;
- ALLOCATOR_PROPERTIES locActualAlloc;
-
- locReqAlloc.cbAlign = 1;
- locReqAlloc.cbBuffer = BUFFER_SIZE;
- locReqAlloc.cbPrefix = 0;
- locReqAlloc.cBuffers = NUM_BUFFERS;
-
- locHR = inoutAllocator->SetProperties(&locReqAlloc, &locActualAlloc);
-
- if (locHR != S_OK) {
- return locHR;
- }
-
- locHR = inoutAllocator->Commit();
-
- return locHR;
-
-}
-
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "oggdemuxsourcepin.h"
+
+OggDemuxSourcePin::OggDemuxSourcePin( TCHAR* inObjectName,
+ OggDemuxSourceFilter* inParentFilter,
+ CCritSec* inFilterLock,
+ StreamHeaders* inHeaderSource,
+ CMediaType* inMediaType,
+ wstring inPinName,
+ bool inAllowSeek )
+ : CBaseOutputPin( NAME("Ogg Demux Output Pin")
+ , inParentFilter
+ , inFilterLock
+ , &mFilterHR
+ , inPinName.c_str() )
+ , mHeaders(inHeaderSource)
+ , mParentFilter(inParentFilter)
+ , mMediaType(inMediaType)
+ , mDataQueue(NULL)
+ , mFirstRun(true)
+ , mPartialPacket(NULL)
+
+{
+ //TODO::: Something about this is causing a COM reference leak.
+
+ debugLog.open("d:\\zen\\logs\\sourcefilterpin.log", ios_base::out);
+ IMediaSeeking* locSeeker = NULL;
+ //if (inAllowSeek) {
+ //debugLog<<"Allowing seek"<<endl;
+ //Subvert COM and do this directly... this way, the source filter won't expose the interface to the
+ // graph but we can still delegate to it.
+
+ //inParentFilter->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+ locSeeker = (IMediaSeeking*)mParentFilter;
+
+ //UNdecided whether this should be adreff or not... if you do you have a cyclic reference, if you don't see below.
+ //locSeeker->AddRef(); //If you addref theres a weird destructor infinite loop. See the OggStreamMapper Destructor.
+
+
+ //}
+ SetDelegate(locSeeker);
+}
+
+OggDemuxSourcePin::~OggDemuxSourcePin(void)
+{
+ debugLog.close();
+
+ delete mDataQueue;
+ mDataQueue = NULL;
+}
+
+STDMETHODIMP OggDemuxSourcePin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+ if (riid == IID_IMediaSeeking) {
+ //debugLog<<"Pin queried for IMediaSeeking"<<endl;
+ *ppv = (IMediaSeeking*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ }
+
+ return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
+}
+bool OggDemuxSourcePin::deliverOggPacket(StampedOggPacket* inPacket)
+{
+ CAutoLock locStreamLock(mParentFilter->mStreamLock);
+
+
+ IMediaSample* locSample = NULL;
+ REFERENCE_TIME locStart = inPacket->startTime();
+ REFERENCE_TIME locStop = inPacket->endTime();
+ debugLog<<"Delivering packet : "<<locStart<< " - "<<locStop<<endl;
+
+
+ HRESULT locHR = GetDeliveryBuffer(&locSample, &locStart, &locStop, NULL);
+ DbgLog((LOG_TRACE, 2, "* After get Buffer in Source Pin..."));
+ //Error checks
+ if (locHR != S_OK) {
+ //Stopping, fluching or error
+ debugLog<<"Failure... No buffer"<<endl;
+ return false;
+ }
+
+ //More hacks so we can send a timebase after a seek, since granule pos in theora
+ // is not convertible in both directions to time.
+
+ //TIMESTAMP FIXING !
+ locSample->SetTime(&locStart, &locStop);
+
+ //TODO::: This style of timestamping should not be necessary anymore.
+ //Yes this is way dodgy !
+ locSample->SetMediaTime(&mParentFilter->mSeekTimeBase, &mParentFilter->mSeekTimeBase);
+ locSample->SetSyncPoint(TRUE);
+
+
+ // Create a pointer for the samples buffer
+ BYTE* locBuffer = NULL;
+ locSample->GetPointer(&locBuffer);
+
+ if (locSample->GetSize() >= inPacket->packetSize()) {
+
+ memcpy((void*)locBuffer, (const void*)inPacket->packetData(), inPacket->packetSize());
+ locSample->SetActualDataLength(inPacket->packetSize());
+
+ locHR = mDataQueue->Receive(locSample);
+
+ if (locHR != S_OK) {
+ debugLog << "Failure... Queue rejected sample..."<<endl;
+ //Stopping ??
+ return false;
+ } else {
+ return true;
+ }
+ } else {
+ DbgLog((LOG_TRACE, 2, "* BUFFER TOO SMALL... FATALITY !!"));
+ throw 0;
+ }
+}
+HRESULT OggDemuxSourcePin::DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate)
+{
+ debugLog<<"Delivering new segment"<<endl;
+ NewSegment(tStart, tStop, dRate);
+
+ mPartialPacket = NULL;
+ mDataQueue->NewSegment(tStart, tStop, dRate);
+
+ return S_OK;
+}
+HRESULT OggDemuxSourcePin::DeliverEndOfStream(void)
+{
+ mPartialPacket = NULL;
+ mDataQueue->EOS();
+ return S_OK;
+}
+
+HRESULT OggDemuxSourcePin::DeliverEndFlush(void)
+{
+ debugLog<<"Delivering End flush"<<endl;
+ mDataQueue->EndFlush();
+ return S_OK;
+}
+
+HRESULT OggDemuxSourcePin::DeliverBeginFlush(void)
+{
+ debugLog<<"Delivering begin flush"<<endl;
+ mPartialPacket = NULL;
+ mDataQueue->BeginFlush();
+ return S_OK;
+}
+
+HRESULT OggDemuxSourcePin::CompleteConnect (IPin *inReceivePin)
+{
+ mFilterHR = S_OK;
+ //Set the delegate for seeking
+ //((BasicSeekable*)(inReceivePin))->SetDelegate(this);
+ //This may cause issue if pins are disconnected and reconnected
+ //DELETE in DEStructor
+ mDataQueue = new COutputQueue (inReceivePin, &mFilterHR, FALSE, TRUE,1,TRUE, NUM_BUFFERS);
+
+ return CBaseOutputPin::CompleteConnect(inReceivePin);
+}
+
+HRESULT OggDemuxSourcePin::BreakConnect(void)
+{
+ delete mDataQueue;
+ mDataQueue = NULL;
+ return CBaseOutputPin::BreakConnect();
+}
+
+ //CSourceStream virtuals
+HRESULT OggDemuxSourcePin::GetMediaType(int inPosition, CMediaType* outMediaType)
+{
+ //Put it in from the info we got in the constructor.
+ if (inPosition == 0) {
+ *outMediaType = *mMediaType;
+ return S_OK;
+ } else {
+ return VFW_S_NO_MORE_ITEMS;
+ }
+}
+HRESULT OggDemuxSourcePin::CheckMediaType(const CMediaType* inMediaType) {
+ if (inMediaType->majortype == mMediaType->majortype && inMediaType->subtype == mMediaType->subtype && inMediaType->formattype == mMediaType->formattype) {
+ return S_OK;
+ } else {
+ return E_FAIL;
+ }
+}
+HRESULT OggDemuxSourcePin::DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest)
+{
+ HRESULT locHR = S_OK;
+
+ ALLOCATOR_PROPERTIES locReqAlloc;
+ ALLOCATOR_PROPERTIES locActualAlloc;
+
+ locReqAlloc.cbAlign = 1;
+ locReqAlloc.cbBuffer = BUFFER_SIZE;
+ locReqAlloc.cbPrefix = 0;
+ locReqAlloc.cBuffers = NUM_BUFFERS;
+
+ locHR = inoutAllocator->SetProperties(&locReqAlloc, &locActualAlloc);
+
+ if (locHR != S_OK) {
+ return locHR;
+ }
+
+ locHR = inoutAllocator->Commit();
+
+ return locHR;
+
+}
+
+
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,95 +1,95 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include "oggdllstuff.h"
-#include "StreamHeaders.h"
-#include <OggPage.h>
-#include <IOggCallback.h>
-#include "BasicSeekPassThrough.h"
-#include <fstream>
-#include "OggDemuxSourceFilter.h"
-using namespace std;
-
-class OggDemuxSourceFilter;
-
-class OGG_DEMUX_API OggDemuxSourcePin
- : public CBaseOutputPin
- , public BasicSeekPassThrough
-
-{
-public:
-
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
- OggDemuxSourcePin( TCHAR* inObjectName,
- OggDemuxSourceFilter* inParentFilter,
- CCritSec* inFilterLock,
- StreamHeaders* inHeaderSource,
- CMediaType* inMediaType,
- wstring inPinName,
- bool inAllowSeek);
-
-
-
- virtual ~OggDemuxSourcePin(void);
- static const unsigned long BUFFER_SIZE = 1024*512; //What should this be ????
- static const unsigned long NUM_BUFFERS = 75;
-
-
- virtual bool deliverOggPacket(StampedOggPacket* inOggPacket);
-
- //CSourceStream virtuals
- virtual HRESULT GetMediaType(int inPosition, CMediaType* outMediaType);
- virtual HRESULT CheckMediaType(const CMediaType* inMediaType);
- virtual HRESULT DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest);
-
-
- //IOggCallback
- //virtual bool acceptOggPage(OggPage* inOggPage);
-
-
- //IPin
- virtual HRESULT CompleteConnect (IPin *inReceivePin);
- virtual HRESULT BreakConnect(void);
- virtual HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
- virtual HRESULT DeliverEndOfStream(void);
- virtual HRESULT DeliverEndFlush(void);
- virtual HRESULT DeliverBeginFlush(void);
-protected:
- OggDemuxSourceFilter* mParentFilter;
- StreamHeaders* mHeaders;
- CMediaType* mMediaType;
- StampedOggPacket* mPartialPacket;
- HRESULT mFilterHR;
- COutputQueue* mDataQueue;
- fstream debugLog;
- bool mFirstRun;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+#include "oggdllstuff.h"
+#include "StreamHeaders.h"
+#include <OggPage.h>
+#include <IOggCallback.h>
+#include "BasicSeekPassThrough.h"
+#include <fstream>
+#include "OggDemuxSourceFilter.h"
+using namespace std;
+
+class OggDemuxSourceFilter;
+
+class OGG_DEMUX_API OggDemuxSourcePin
+ : public CBaseOutputPin
+ , public BasicSeekPassThrough
+
+{
+public:
+
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+ OggDemuxSourcePin( TCHAR* inObjectName,
+ OggDemuxSourceFilter* inParentFilter,
+ CCritSec* inFilterLock,
+ StreamHeaders* inHeaderSource,
+ CMediaType* inMediaType,
+ wstring inPinName,
+ bool inAllowSeek);
+
+
+
+ virtual ~OggDemuxSourcePin(void);
+ static const unsigned long BUFFER_SIZE = 1024*512; //What should this be ????
+ static const unsigned long NUM_BUFFERS = 75;
+
+
+ virtual bool deliverOggPacket(StampedOggPacket* inOggPacket);
+
+ //CSourceStream virtuals
+ virtual HRESULT GetMediaType(int inPosition, CMediaType* outMediaType);
+ virtual HRESULT CheckMediaType(const CMediaType* inMediaType);
+ virtual HRESULT DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest);
+
+
+ //IOggCallback
+ //virtual bool acceptOggPage(OggPage* inOggPage);
+
+
+ //IPin
+ virtual HRESULT CompleteConnect (IPin *inReceivePin);
+ virtual HRESULT BreakConnect(void);
+ virtual HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
+ virtual HRESULT DeliverEndOfStream(void);
+ virtual HRESULT DeliverEndFlush(void);
+ virtual HRESULT DeliverBeginFlush(void);
+protected:
+ OggDemuxSourceFilter* mParentFilter;
+ StreamHeaders* mHeaders;
+ CMediaType* mMediaType;
+ StampedOggPacket* mPartialPacket;
+ HRESULT mFilterHR;
+ COutputQueue* mDataQueue;
+ fstream debugLog;
+ bool mFirstRun;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxSourcePin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxer.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxer.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxer.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,45 +1,45 @@
-#include "StdAfx.h"
-//#include ".\oggdemuxer.h"
-//
-//OggDemuxer::OggDemuxer(void)
-// : mDataSource(NULL)
-// , mWorkingBuffer(NULL)
-// , mWorkingBufferSize(0)
-//{
-// mWorkingBufferSize = 4096;
-// mWorkingBuffer = new unsigned char[mWorkingBufferSize];
-//
-//}
-//
-//OggDemuxer::~OggDemuxer(void)
-//{
-// delete [] mWorkingBuffer;
-//}
-//
-//bool OggDemuxer::load(string inSourceName) {
-// mSourceName = inSourceName;
-//
-// mDataSource = DataSourceFactory::createDataSource(inSourceName);
-//}
-//
-//__int64 OggDemuxer::seek(__int64 inSeekTime) {
-//
-//}
-//
-//
-//bool OggDemuxer::registerVirtualCallback(IOggCallback* inCallback) {
-// mDataBuffer.registerVirtualCallback(inCallback);
-//}
-//
-//bool OggDemuxer::processChunk(unsigned long inNumBytes) {
-// ASSERT(inNumBytes <= mWorkingBufferSize);
-// unsigned long locNumRead = mDataSource->read(mWorkingBuffer, inNumBytes);
-// if (locNumRead > 0) {
-// mDataBuffer.feed(mWorkingBuffer, locNumRead);
-// return true;
-// } else {
-// return false;
-// }
-//}
-//
-//
+#include "StdAfx.h"
+//#include ".\oggdemuxer.h"
+//
+//OggDemuxer::OggDemuxer(void)
+// : mDataSource(NULL)
+// , mWorkingBuffer(NULL)
+// , mWorkingBufferSize(0)
+//{
+// mWorkingBufferSize = 4096;
+// mWorkingBuffer = new unsigned char[mWorkingBufferSize];
+//
+//}
+//
+//OggDemuxer::~OggDemuxer(void)
+//{
+// delete [] mWorkingBuffer;
+//}
+//
+//bool OggDemuxer::load(string inSourceName) {
+// mSourceName = inSourceName;
+//
+// mDataSource = DataSourceFactory::createDataSource(inSourceName);
+//}
+//
+//__int64 OggDemuxer::seek(__int64 inSeekTime) {
+//
+//}
+//
+//
+//bool OggDemuxer::registerVirtualCallback(IOggCallback* inCallback) {
+// mDataBuffer.registerVirtualCallback(inCallback);
+//}
+//
+//bool OggDemuxer::processChunk(unsigned long inNumBytes) {
+// ASSERT(inNumBytes <= mWorkingBufferSize);
+// unsigned long locNumRead = mDataSource->read(mWorkingBuffer, inNumBytes);
+// if (locNumRead > 0) {
+// mDataBuffer.feed(mWorkingBuffer, locNumRead);
+// return true;
+// } else {
+// return false;
+// }
+//}
+//
+//
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxer.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxer.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxer.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxer.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,24 +1,24 @@
-#pragma once
-
-//
-//class OggDemuxer
-//{
-//public:
-// OggDemuxer(void);
-// ~OggDemuxer(void);
-//
-// bool load(wstring inSourceName);
-// bool registerVirtualCallback(IOggCallback* inCallback);
-//
-// __int64 seek(__int64 inSeekTime);
-//
-// bool processChunk(unsigned long inNumBytes);
-//
-//protected:
-// wstring mSourceName;
-// IFilterDataSource* mDataSource;
-// OggDataBuffer mDataBuffer;
-//
-// unsigned char* mWorkingBuffer;
-// unsigned long mWorkingBufferSize;
-//};
+#pragma once
+
+//
+//class OggDemuxer
+//{
+//public:
+// OggDemuxer(void);
+// ~OggDemuxer(void);
+//
+// bool load(wstring inSourceName);
+// bool registerVirtualCallback(IOggCallback* inCallback);
+//
+// __int64 seek(__int64 inSeekTime);
+//
+// bool processChunk(unsigned long inNumBytes);
+//
+//protected:
+// wstring mSourceName;
+// IFilterDataSource* mDataSource;
+// OggDataBuffer mDataBuffer;
+//
+// unsigned char* mWorkingBuffer;
+// unsigned long mWorkingBufferSize;
+//};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggDemuxer.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggFLAC_1_0_Stream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggFLAC_1_0_Stream.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggFLAC_1_0_Stream.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,171 +1,171 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "OggFLAC_1_0_Stream.h"
-//#include "FLACMath.h"
-
-OggFLAC_1_0_Stream::OggFLAC_1_0_Stream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek)
- : OggStream(inBOSPage, inOwningFilter, inAllowSeek)
- , mFLACFormatBlock(NULL)
- , mIsFixedNumHeaders(false)
- //, mNumHeaderPackets(0)
-{
- InitCodec(inBOSPage->getStampedPacket(0));
-}
-
-OggFLAC_1_0_Stream::~OggFLAC_1_0_Stream(void)
-{
- delete mFLACFormatBlock;
-}
-
-bool OggFLAC_1_0_Stream::InitCodec(StampedOggPacket* inOggPacket) {
- //Can probably abstract this out of here too !
- mCodecHeaders = new StreamHeaders;
- mCodecHeaders->mCodecType = StreamHeaders::FLAC;
- mCodecHeaders->addPacket((StampedOggPacket*)inOggPacket->clone());
- //What to do with commment fields ??
- //We set this to 1... and we override the header processor
- //When we see the last header packet ie starts with 1xxxxxxx then we decrement it.
-
- //NEW::: Since the ogg flac 1.0 mapping there's now another option... if the new first header
- // specifies the number of headers, we can count directly, otherwise we stll use the old
- // method for maximum compatability.
- mNumHeadersNeeded = iBE_Math::charArrToUShort(inOggPacket->packetData() + 7);
- //debugLog<<"Num FLAC Headers needed = "<<mNumHeadersNeeded<<endl;
- if (mNumHeadersNeeded == 0) {
- //Variable number
- // Use the old method of setting this to 1, and then decrementing it when we see the last one.
- mNumHeadersNeeded = 1;
- mIsFixedNumHeaders = false;
- } else {
- mIsFixedNumHeaders = true;
- }
- return true;
-}
-
-wstring OggFLAC_1_0_Stream::getPinName() {
- wstring locName = L"FLAC Out";
- return locName;
-}
-
-bool OggFLAC_1_0_Stream::createFormatBlock() {
- const unsigned char FLAC_CHANNEL_MASK = 14; //00001110
- const unsigned char FLAC_BPS_START_MASK = 1; //00000001
- const unsigned char FLAC_BPS_END_MASK = 240; //11110000
- mFLACFormatBlock = new sFLACFormatBlock;
- //Fix the format block data... use header version and other version.
- //mFLACFormatBlock->FLACVersion = FLACMath::charArrToULong(mCodecHeaders->getPacket(1)->packetData() + 28);
- mFLACFormatBlock->numChannels = (((mCodecHeaders->getPacket(0)->packetData()[29]) & FLAC_CHANNEL_MASK) >> 1) + 1;
- mFLACFormatBlock->samplesPerSec = (iBE_Math::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 27)) >> 12;
-
- mFLACFormatBlock->numBitsPerSample = (((mCodecHeaders->getPacket(0)->packetData()[29] & FLAC_BPS_START_MASK) << 4) |
- ((mCodecHeaders->getPacket(0)->packetData()[30] & FLAC_BPS_END_MASK) >> 4)) + 1;
- return true;
-}
-BYTE* OggFLAC_1_0_Stream::getFormatBlock() {
-
- return (BYTE*)mFLACFormatBlock;
-
-
-}
-unsigned long OggFLAC_1_0_Stream::getFormatBlockSize() {
- //Do something
- return sizeof(sFLACFormatBlock);
-}
-GUID OggFLAC_1_0_Stream::getFormatGUID() {
- return FORMAT_FLAC;
-}
-GUID OggFLAC_1_0_Stream::getSubtypeGUID() {
- return MEDIASUBTYPE_FLAC;
-}
-GUID OggFLAC_1_0_Stream::getMajorTypeGUID() {
- return MEDIATYPE_Audio;
-}
-
-//Need to override from oggstream because we have variable number of headers
-bool OggFLAC_1_0_Stream::processHeaderPacket(StampedOggPacket* inPacket) {
- //FIX::: Return values
- const unsigned char MORE_HEADERS_MASK = 128; //10000000
- //We don't delete the packet... the codecheader list will delete when it's done.
- //StampedOggPacket* locPacket = processPacket(inPacket);
- if (inPacket != NULL) {
- //We got a comlpete packet
- mCodecHeaders->addPacket(inPacket);
- if (mIsFixedNumHeaders) {
- mNumHeadersNeeded--;
- } else {
- if ((inPacket->packetData()[0] & MORE_HEADERS_MASK) != 0) {
- mNumHeadersNeeded--;
- //mNumHeaderPackets++;
- }
- }
- }
- return true;
-}
-void OggFLAC_1_0_Stream::setLastEndGranPos(__int64 inPos) {
- mLastEndGranulePos = (inPos * (__int64)mFLACFormatBlock->samplesPerSec)/ UNITS;
-}
-bool OggFLAC_1_0_Stream::deliverCodecHeaders() {
- //debugLog<<"Delivering Codec Headers... "<<mCodecHeaders->numPackets()<<endl;
- StampedOggPacket* locPacket = NULL;
- for (unsigned long i = 0; i < mCodecHeaders->numPackets(); i++) {
- if (i==0) {
- //Need to reconstruct what the meta-data blocks look like in naked flac,
- // so strip away most of the new header.
- //
- //New part of ogg header is 9 bytes
- //old flac ident is 4 bytes
- //StreamInfoHeader is 38 bytes
- //
- //So we discard the first 9 bytes, and keep the next 42 bytes.
- unsigned char* locPackBuf = new unsigned char[42]; //Given away to the StampedPacket
-
- //locPacket = (StampedOggPacket*)mCodecHeaders->getPacket(0)->clone();
- memcpy((void*)locPackBuf, (const void*)(mCodecHeaders->getPacket(0)->packetData() + 9), 42);
- locPacket = new StampedOggPacket(locPackBuf, 42, false, false, 0, 0, StampedOggPacket::OGG_END_ONLY);
- } else {
- locPacket->merge(mCodecHeaders->getPacket(i));
- }
- }
- if (mCodecHeaders->numPackets() > 0) {
- dispatchPacket(locPacket);
- }
- return true;
-}
-
-LONGLONG OggFLAC_1_0_Stream::getCurrentPos() {
- return (mLastEndGranulePos * UNITS) / mFLACFormatBlock->samplesPerSec;
-}
-
-//unsigned long OggFLAC_1_0_Stream::numCodecHeaders() {
-// return mNumHeaderPackets; //is this even needed ?
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "OggFLAC_1_0_Stream.h"
+//#include "FLACMath.h"
+
+OggFLAC_1_0_Stream::OggFLAC_1_0_Stream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek)
+ : OggStream(inBOSPage, inOwningFilter, inAllowSeek)
+ , mFLACFormatBlock(NULL)
+ , mIsFixedNumHeaders(false)
+ //, mNumHeaderPackets(0)
+{
+ InitCodec(inBOSPage->getStampedPacket(0));
+}
+
+OggFLAC_1_0_Stream::~OggFLAC_1_0_Stream(void)
+{
+ delete mFLACFormatBlock;
+}
+
+bool OggFLAC_1_0_Stream::InitCodec(StampedOggPacket* inOggPacket) {
+ //Can probably abstract this out of here too !
+ mCodecHeaders = new StreamHeaders;
+ mCodecHeaders->mCodecType = StreamHeaders::FLAC;
+ mCodecHeaders->addPacket((StampedOggPacket*)inOggPacket->clone());
+ //What to do with commment fields ??
+ //We set this to 1... and we override the header processor
+ //When we see the last header packet ie starts with 1xxxxxxx then we decrement it.
+
+ //NEW::: Since the ogg flac 1.0 mapping there's now another option... if the new first header
+ // specifies the number of headers, we can count directly, otherwise we stll use the old
+ // method for maximum compatability.
+ mNumHeadersNeeded = iBE_Math::charArrToUShort(inOggPacket->packetData() + 7);
+ //debugLog<<"Num FLAC Headers needed = "<<mNumHeadersNeeded<<endl;
+ if (mNumHeadersNeeded == 0) {
+ //Variable number
+ // Use the old method of setting this to 1, and then decrementing it when we see the last one.
+ mNumHeadersNeeded = 1;
+ mIsFixedNumHeaders = false;
+ } else {
+ mIsFixedNumHeaders = true;
+ }
+ return true;
+}
+
+wstring OggFLAC_1_0_Stream::getPinName() {
+ wstring locName = L"FLAC Out";
+ return locName;
+}
+
+bool OggFLAC_1_0_Stream::createFormatBlock() {
+ const unsigned char FLAC_CHANNEL_MASK = 14; //00001110
+ const unsigned char FLAC_BPS_START_MASK = 1; //00000001
+ const unsigned char FLAC_BPS_END_MASK = 240; //11110000
+ mFLACFormatBlock = new sFLACFormatBlock;
+ //Fix the format block data... use header version and other version.
+ //mFLACFormatBlock->FLACVersion = FLACMath::charArrToULong(mCodecHeaders->getPacket(1)->packetData() + 28);
+ mFLACFormatBlock->numChannels = (((mCodecHeaders->getPacket(0)->packetData()[29]) & FLAC_CHANNEL_MASK) >> 1) + 1;
+ mFLACFormatBlock->samplesPerSec = (iBE_Math::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 27)) >> 12;
+
+ mFLACFormatBlock->numBitsPerSample = (((mCodecHeaders->getPacket(0)->packetData()[29] & FLAC_BPS_START_MASK) << 4) |
+ ((mCodecHeaders->getPacket(0)->packetData()[30] & FLAC_BPS_END_MASK) >> 4)) + 1;
+ return true;
+}
+BYTE* OggFLAC_1_0_Stream::getFormatBlock() {
+
+ return (BYTE*)mFLACFormatBlock;
+
+
+}
+unsigned long OggFLAC_1_0_Stream::getFormatBlockSize() {
+ //Do something
+ return sizeof(sFLACFormatBlock);
+}
+GUID OggFLAC_1_0_Stream::getFormatGUID() {
+ return FORMAT_FLAC;
+}
+GUID OggFLAC_1_0_Stream::getSubtypeGUID() {
+ return MEDIASUBTYPE_FLAC;
+}
+GUID OggFLAC_1_0_Stream::getMajorTypeGUID() {
+ return MEDIATYPE_Audio;
+}
+
+//Need to override from oggstream because we have variable number of headers
+bool OggFLAC_1_0_Stream::processHeaderPacket(StampedOggPacket* inPacket) {
+ //FIX::: Return values
+ const unsigned char MORE_HEADERS_MASK = 128; //10000000
+ //We don't delete the packet... the codecheader list will delete when it's done.
+ //StampedOggPacket* locPacket = processPacket(inPacket);
+ if (inPacket != NULL) {
+ //We got a comlpete packet
+ mCodecHeaders->addPacket(inPacket);
+ if (mIsFixedNumHeaders) {
+ mNumHeadersNeeded--;
+ } else {
+ if ((inPacket->packetData()[0] & MORE_HEADERS_MASK) != 0) {
+ mNumHeadersNeeded--;
+ //mNumHeaderPackets++;
+ }
+ }
+ }
+ return true;
+}
+void OggFLAC_1_0_Stream::setLastEndGranPos(__int64 inPos) {
+ mLastEndGranulePos = (inPos * (__int64)mFLACFormatBlock->samplesPerSec)/ UNITS;
+}
+bool OggFLAC_1_0_Stream::deliverCodecHeaders() {
+ //debugLog<<"Delivering Codec Headers... "<<mCodecHeaders->numPackets()<<endl;
+ StampedOggPacket* locPacket = NULL;
+ for (unsigned long i = 0; i < mCodecHeaders->numPackets(); i++) {
+ if (i==0) {
+ //Need to reconstruct what the meta-data blocks look like in naked flac,
+ // so strip away most of the new header.
+ //
+ //New part of ogg header is 9 bytes
+ //old flac ident is 4 bytes
+ //StreamInfoHeader is 38 bytes
+ //
+ //So we discard the first 9 bytes, and keep the next 42 bytes.
+ unsigned char* locPackBuf = new unsigned char[42]; //Given away to the StampedPacket
+
+ //locPacket = (StampedOggPacket*)mCodecHeaders->getPacket(0)->clone();
+ memcpy((void*)locPackBuf, (const void*)(mCodecHeaders->getPacket(0)->packetData() + 9), 42);
+ locPacket = new StampedOggPacket(locPackBuf, 42, false, false, 0, 0, StampedOggPacket::OGG_END_ONLY);
+ } else {
+ locPacket->merge(mCodecHeaders->getPacket(i));
+ }
+ }
+ if (mCodecHeaders->numPackets() > 0) {
+ dispatchPacket(locPacket);
+ }
+ return true;
+}
+
+LONGLONG OggFLAC_1_0_Stream::getCurrentPos() {
+ return (mLastEndGranulePos * UNITS) / mFLACFormatBlock->samplesPerSec;
+}
+
+//unsigned long OggFLAC_1_0_Stream::numCodecHeaders() {
+// return mNumHeaderPackets; //is this even needed ?
//}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggFLAC_1_0_Stream.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggFLAC_1_0_Stream.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggFLAC_1_0_Stream.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggFLAC_1_0_Stream.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,68 +1,68 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include "oggdllstuff.h"
-
-#include "OggPage.h"
-#include "OggPacket.h"
-class OggStream;
-class OggFLAC_1_0_Stream
- : public OggStream
-{
-public:
- OggFLAC_1_0_Stream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
- virtual ~OggFLAC_1_0_Stream(void);
-
- //Implementing virtuals in OGgStream
- virtual bool InitCodec(StampedOggPacket* inOggPacket);
-
- virtual BYTE* getFormatBlock() ;
- virtual unsigned long getFormatBlockSize();
- virtual GUID getFormatGUID();
- virtual GUID getSubtypeGUID();
- virtual wstring getPinName();
- virtual bool createFormatBlock();
- virtual GUID getMajorTypeGUID();
- virtual LONGLONG getCurrentPos();
-
- //Override from oggstream to handle dynamic number of headers.
- virtual bool OggFLAC_1_0_Stream::processHeaderPacket(StampedOggPacket* inPacket);
- virtual bool deliverCodecHeaders();
-
-// virtual unsigned long numCodecHeaders();
-
- virtual void setLastEndGranPos(__int64 inPos);
-
-protected:
- //unsigned long mNumHeaderPackets;
- sFLACFormatBlock* mFLACFormatBlock;
- bool mIsFixedNumHeaders;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+#include "oggdllstuff.h"
+
+#include "OggPage.h"
+#include "OggPacket.h"
+class OggStream;
+class OggFLAC_1_0_Stream
+ : public OggStream
+{
+public:
+ OggFLAC_1_0_Stream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
+ virtual ~OggFLAC_1_0_Stream(void);
+
+ //Implementing virtuals in OGgStream
+ virtual bool InitCodec(StampedOggPacket* inOggPacket);
+
+ virtual BYTE* getFormatBlock() ;
+ virtual unsigned long getFormatBlockSize();
+ virtual GUID getFormatGUID();
+ virtual GUID getSubtypeGUID();
+ virtual wstring getPinName();
+ virtual bool createFormatBlock();
+ virtual GUID getMajorTypeGUID();
+ virtual LONGLONG getCurrentPos();
+
+ //Override from oggstream to handle dynamic number of headers.
+ virtual bool OggFLAC_1_0_Stream::processHeaderPacket(StampedOggPacket* inPacket);
+ virtual bool deliverCodecHeaders();
+
+// virtual unsigned long numCodecHeaders();
+
+ virtual void setLastEndGranPos(__int64 inPos);
+
+protected:
+ //unsigned long mNumHeaderPackets;
+ sFLACFormatBlock* mFLACFormatBlock;
+ bool mIsFixedNumHeaders;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggFLAC_1_0_Stream.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,274 +1,274 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "oggstream.h"
-
-OggStream::OggStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek)
- : mCodecHeaders(NULL)
- , mOwningFilter(inOwningFilter)
- , mAllowSeek(inAllowSeek)
- , mSerialNo(0)
- , mSourcePin(NULL)
- , mNumHeadersNeeded(0)
- , mStreamReady(false)
- //, mPartialPacket(NULL)
- , mFirstRun(true)
- , mSendExcess(true)
- , mLastEndGranulePos(0)
- , mLastStartGranulePos(0)
- , mStreamLock(NULL)
- , mAllowDispatch(false)
-{
-
- //Need to do something here !
- mSerialNo = inBOSPage->header()->StreamSerialNo();
- //string locLogName = "G:\\logs\\oggstream" + StringHelper::numToString(mSerialNo) + ".log";
- //debugLog.open(locLogName.c_str(), ios_base::out);
- mStreamLock = new CCritSec;
- //This may need to be moved to derived class
- //Yep, Sure did !
- //InitCodec(inBOSPage->getPacket(0));
-
- //Set the packetisers callback to our acceptstampedoggpacket function.
- mPacketiser.setPacketSink(this);
-
-}
-
-OggStream::~OggStream(void)
-{
- //debugLog<<"Destructor..."<<endl;
- //debugLog.close();
- delete mSourcePin;
- delete mCodecHeaders;
- //delete mPartialPacket;
- delete mStreamLock;
- //Don't try to delete owning filter !!
-}
-
-bool OggStream::streamReady() {
- return mStreamReady;
-
-}
-
-unsigned long OggStream::serialNo() {
- return mSerialNo;
-}
-void OggStream::setAllowDispatch(bool inAllowDispatch) {
- mAllowDispatch = inAllowDispatch;
-}
-bool OggStream::acceptStampedOggPacket(StampedOggPacket* inPacket) {
- if (!mStreamReady) {
- //Streams not ready, still headers.
- //Stream is ready when all header packets are seen.
- // Any data packets the are on the same page as the headers are excess packets. ???? Maybe not any more.
- processHeaderPacket(inPacket);
-
- if(mNumHeadersNeeded <= 0) {
- //Make sure we create the pin if we got everything already
- AddPin();
- //Add pin will set streamready to true if it was all good.
- }
- } else {
- //Data packets...
- if (mAllowDispatch) {
- if (mFirstRun) {
- mFirstRun = false;
- //debugLog<<"Delviering codec headers..."<<endl;
- //Deliver the header data
- deliverCodecHeaders();
- }
-
- processDataPacket(inPacket);
- } else {
- //processExcessPacket(inPacket);
- return false;
- }
- }
-
- return true;
-}
-
-
-//ANX::: Need to override here to ensure the anxdata header isn't passed through.
-bool OggStream::processHeaderPacket(StampedOggPacket* inPacket) {
- //FIX::: Return values
-
- //We don't delete the packet... the codecheader list will delete when it's done.
- //StampedOggPacket* locPacket = processPacket(inPacket);
- if (inPacket != NULL) {
- //We got a comlpete packet
- //debugLog<<"Adding codec header..."<<endl;
- mCodecHeaders->addPacket(inPacket);
- mNumHeadersNeeded--;
- //debugLog<<"Headers still needed = "<<mNumHeadersNeeded<<endl;
- }
- return true;
-}
-
-bool OggStream::processDataPacket(StampedOggPacket* inPacket) {
- //We must delete the packet we get back when we have finished
- //StampedOggPacket* locPacket = processPacket(inPacket);
- if (inPacket != NULL) {
- dispatchPacket(inPacket);
- //delete locPacket;
- inPacket = NULL;
- }
-
- return true;
-}
-
-
-OggDemuxSourcePin* OggStream::getPin() {
- return mSourcePin;
-}
-
-
-CMediaType* OggStream::createMediaType(GUID inMajorType, GUID inSubType, GUID inFormatType, unsigned long inFormatSize, BYTE* inFormatBlock) {
- AM_MEDIA_TYPE locAMMediaType;
- locAMMediaType.majortype = inMajorType;
-
- locAMMediaType.subtype = inSubType;
- locAMMediaType.formattype = inFormatType;
- locAMMediaType.cbFormat = inFormatSize; //0;//sizeof(sSpeexFormatBlock);
- locAMMediaType.pbFormat = inFormatBlock; //(BYTE*)locSpeexFormatInfo;
- locAMMediaType.pUnk = NULL;
-
-
- //LEAK CHECK::: Does this get deleted ?
- return new CMediaType(locAMMediaType);
-}
-
-unsigned long OggStream::numCodecHeaders() {
- //TODO::: Check for null.
- //debugLog<<"Num codec headers = "<<mCodecHeaders->numPackets()<<endl;
- return mCodecHeaders->numPackets();
-}
-void OggStream::flush() {
- CAutoLock locLock(mStreamLock);
- //delete mPartialPacket;
- //TODO::: Tell the packetiser to flush.
- //mPartialPacket = NULL;
- mPacketiser.reset();
-}
-
-void OggStream::flush(unsigned short inNumPacketsToIgnore) {
- CAutoLock locLock(mStreamLock);
- //delete mPartialPacket;
- //TODO::: Tell the packetiser to flush.
- //mPartialPacket = NULL;
- //debugLog<<"Flush and ignore "<<inNumPacketsToIgnore<<endl;
- mPacketiser.reset();
- mPacketiser.setNumIgnorePackets(inNumPacketsToIgnore);
-}
-//ANX::: Need to override here to create anx pins
-bool OggStream::AddPin() {
- createFormatBlock();
- CMediaType* locMediaType = createMediaType( getMajorTypeGUID(),
- getSubtypeGUID(),
- getFormatGUID(),
- getFormatBlockSize(),
- getFormatBlock());
-
- //LEAK CHECK::: Where does this get deleted ?
- OggDemuxSourcePin* locSourcePin = new OggDemuxSourcePin( NAME("Ogg Source Pin"),
- mOwningFilter,
- mOwningFilter->m_pLock,
- mCodecHeaders,
- locMediaType,
- getPinName(),
- mAllowSeek);
- mStreamReady = true;
- mSourcePin = locSourcePin;
-
- return true;
-
-}
-
-void OggStream::setLastEndGranPos(__int64 inGranPos) {
- //osDebug<<"*************************** ERROR ERROR ERROR **********************"<<endl;
- //debugLog<<"*************************** ERROR ERROR ERROR **********************"<<endl;
- mLastEndGranulePos = inGranPos;
-}
-bool OggStream::acceptOggPage(OggPage* inOggPage) { //Gives away page.
-
- //debugLog<<"Accepting ogg page..."<<endl;
-
-
- //TODO::: Is this even necessary any more ?????
-
- //Chaining hack for icecast.
- if ( (!mAllowSeek) && (inOggPage->header()->isBOS() )) {
- //debugLog<<"ice case hack"<<endl;
- //A BOS page can only be sent here if it's a chain... otherwise
- // it would have already been stripped by the demux if it was at the
- // start of the file.
- //debugLog<<"Detected chain... setting seek timebase to -1"<<endl;
- mOwningFilter->mSeekTimeBase = -1;
-
- }
-
- //FIX::: Add proper error checking.
-
- //debugLog<<"acceptOggPage : "<<endl<<inOggPage->header()->toString()<<endl<<endl;;
- //StampedOggPacket* locPacket = NULL;
- ////osDebug<<"New page sets start gran to "<<mLastEndGranulePos<<endl;
- mLastStartGranulePos = mLastEndGranulePos;
- mLastEndGranulePos = inOggPage->header()->GranulePos();
-
- //Put the page through the packetiser.
- return mPacketiser.acceptOggPage(inOggPage);
-
-}
-
-void OggStream::setSendExcess(bool inSendExcess) {
- mSendExcess = inSendExcess;
-}
-
-bool OggStream::deliverCodecHeaders() {
- StampedOggPacket* locPacket = NULL;
- for (unsigned long i = 0; i < mCodecHeaders->numPackets(); i++) {
- locPacket = mCodecHeaders->getPacket(i);
-
- dispatchPacket(locPacket);
- }
- return true;
-}
-
-//ANX::: Maybe also needs override. ??
-bool OggStream::dispatchPacket(StampedOggPacket* inPacket) {
- //debugLog<<"Ogg Stream : Packet stamps = "<<inPacket->startTime()<<" - "<<inPacket->endTime()<<endl;
- return mSourcePin->deliverOggPacket(inPacket);
-}
-
-void OggStream::setSerialNo(unsigned long inSerialNo) {
- mSerialNo = inSerialNo;
-}
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "oggstream.h"
+
+OggStream::OggStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek)
+ : mCodecHeaders(NULL)
+ , mOwningFilter(inOwningFilter)
+ , mAllowSeek(inAllowSeek)
+ , mSerialNo(0)
+ , mSourcePin(NULL)
+ , mNumHeadersNeeded(0)
+ , mStreamReady(false)
+ //, mPartialPacket(NULL)
+ , mFirstRun(true)
+ , mSendExcess(true)
+ , mLastEndGranulePos(0)
+ , mLastStartGranulePos(0)
+ , mStreamLock(NULL)
+ , mAllowDispatch(false)
+{
+
+ //Need to do something here !
+ mSerialNo = inBOSPage->header()->StreamSerialNo();
+ //string locLogName = "G:\\logs\\oggstream" + StringHelper::numToString(mSerialNo) + ".log";
+ //debugLog.open(locLogName.c_str(), ios_base::out);
+ mStreamLock = new CCritSec;
+ //This may need to be moved to derived class
+ //Yep, Sure did !
+ //InitCodec(inBOSPage->getPacket(0));
+
+ //Set the packetisers callback to our acceptstampedoggpacket function.
+ mPacketiser.setPacketSink(this);
+
+}
+
+OggStream::~OggStream(void)
+{
+ //debugLog<<"Destructor..."<<endl;
+ //debugLog.close();
+ delete mSourcePin;
+ delete mCodecHeaders;
+ //delete mPartialPacket;
+ delete mStreamLock;
+ //Don't try to delete owning filter !!
+}
+
+bool OggStream::streamReady() {
+ return mStreamReady;
+
+}
+
+unsigned long OggStream::serialNo() {
+ return mSerialNo;
+}
+void OggStream::setAllowDispatch(bool inAllowDispatch) {
+ mAllowDispatch = inAllowDispatch;
+}
+bool OggStream::acceptStampedOggPacket(StampedOggPacket* inPacket) {
+ if (!mStreamReady) {
+ //Streams not ready, still headers.
+ //Stream is ready when all header packets are seen.
+ // Any data packets the are on the same page as the headers are excess packets. ???? Maybe not any more.
+ processHeaderPacket(inPacket);
+
+ if(mNumHeadersNeeded <= 0) {
+ //Make sure we create the pin if we got everything already
+ AddPin();
+ //Add pin will set streamready to true if it was all good.
+ }
+ } else {
+ //Data packets...
+ if (mAllowDispatch) {
+ if (mFirstRun) {
+ mFirstRun = false;
+ //debugLog<<"Delviering codec headers..."<<endl;
+ //Deliver the header data
+ deliverCodecHeaders();
+ }
+
+ processDataPacket(inPacket);
+ } else {
+ //processExcessPacket(inPacket);
+ return false;
+ }
+ }
+
+ return true;
+}
+
+
+//ANX::: Need to override here to ensure the anxdata header isn't passed through.
+bool OggStream::processHeaderPacket(StampedOggPacket* inPacket) {
+ //FIX::: Return values
+
+ //We don't delete the packet... the codecheader list will delete when it's done.
+ //StampedOggPacket* locPacket = processPacket(inPacket);
+ if (inPacket != NULL) {
+ //We got a comlpete packet
+ //debugLog<<"Adding codec header..."<<endl;
+ mCodecHeaders->addPacket(inPacket);
+ mNumHeadersNeeded--;
+ //debugLog<<"Headers still needed = "<<mNumHeadersNeeded<<endl;
+ }
+ return true;
+}
+
+bool OggStream::processDataPacket(StampedOggPacket* inPacket) {
+ //We must delete the packet we get back when we have finished
+ //StampedOggPacket* locPacket = processPacket(inPacket);
+ if (inPacket != NULL) {
+ dispatchPacket(inPacket);
+ //delete locPacket;
+ inPacket = NULL;
+ }
+
+ return true;
+}
+
+
+OggDemuxSourcePin* OggStream::getPin() {
+ return mSourcePin;
+}
+
+
+CMediaType* OggStream::createMediaType(GUID inMajorType, GUID inSubType, GUID inFormatType, unsigned long inFormatSize, BYTE* inFormatBlock) {
+ AM_MEDIA_TYPE locAMMediaType;
+ locAMMediaType.majortype = inMajorType;
+
+ locAMMediaType.subtype = inSubType;
+ locAMMediaType.formattype = inFormatType;
+ locAMMediaType.cbFormat = inFormatSize; //0;//sizeof(sSpeexFormatBlock);
+ locAMMediaType.pbFormat = inFormatBlock; //(BYTE*)locSpeexFormatInfo;
+ locAMMediaType.pUnk = NULL;
+
+
+ //LEAK CHECK::: Does this get deleted ?
+ return new CMediaType(locAMMediaType);
+}
+
+unsigned long OggStream::numCodecHeaders() {
+ //TODO::: Check for null.
+ //debugLog<<"Num codec headers = "<<mCodecHeaders->numPackets()<<endl;
+ return mCodecHeaders->numPackets();
+}
+void OggStream::flush() {
+ CAutoLock locLock(mStreamLock);
+ //delete mPartialPacket;
+ //TODO::: Tell the packetiser to flush.
+ //mPartialPacket = NULL;
+ mPacketiser.reset();
+}
+
+void OggStream::flush(unsigned short inNumPacketsToIgnore) {
+ CAutoLock locLock(mStreamLock);
+ //delete mPartialPacket;
+ //TODO::: Tell the packetiser to flush.
+ //mPartialPacket = NULL;
+ //debugLog<<"Flush and ignore "<<inNumPacketsToIgnore<<endl;
+ mPacketiser.reset();
+ mPacketiser.setNumIgnorePackets(inNumPacketsToIgnore);
+}
+//ANX::: Need to override here to create anx pins
+bool OggStream::AddPin() {
+ createFormatBlock();
+ CMediaType* locMediaType = createMediaType( getMajorTypeGUID(),
+ getSubtypeGUID(),
+ getFormatGUID(),
+ getFormatBlockSize(),
+ getFormatBlock());
+
+ //LEAK CHECK::: Where does this get deleted ?
+ OggDemuxSourcePin* locSourcePin = new OggDemuxSourcePin( NAME("Ogg Source Pin"),
+ mOwningFilter,
+ mOwningFilter->m_pLock,
+ mCodecHeaders,
+ locMediaType,
+ getPinName(),
+ mAllowSeek);
+ mStreamReady = true;
+ mSourcePin = locSourcePin;
+
+ return true;
+
+}
+
+void OggStream::setLastEndGranPos(__int64 inGranPos) {
+ //osDebug<<"*************************** ERROR ERROR ERROR **********************"<<endl;
+ //debugLog<<"*************************** ERROR ERROR ERROR **********************"<<endl;
+ mLastEndGranulePos = inGranPos;
+}
+bool OggStream::acceptOggPage(OggPage* inOggPage) { //Gives away page.
+
+ //debugLog<<"Accepting ogg page..."<<endl;
+
+
+ //TODO::: Is this even necessary any more ?????
+
+ //Chaining hack for icecast.
+ if ( (!mAllowSeek) && (inOggPage->header()->isBOS() )) {
+ //debugLog<<"ice case hack"<<endl;
+ //A BOS page can only be sent here if it's a chain... otherwise
+ // it would have already been stripped by the demux if it was at the
+ // start of the file.
+ //debugLog<<"Detected chain... setting seek timebase to -1"<<endl;
+ mOwningFilter->mSeekTimeBase = -1;
+
+ }
+
+ //FIX::: Add proper error checking.
+
+ //debugLog<<"acceptOggPage : "<<endl<<inOggPage->header()->toString()<<endl<<endl;;
+ //StampedOggPacket* locPacket = NULL;
+ ////osDebug<<"New page sets start gran to "<<mLastEndGranulePos<<endl;
+ mLastStartGranulePos = mLastEndGranulePos;
+ mLastEndGranulePos = inOggPage->header()->GranulePos();
+
+ //Put the page through the packetiser.
+ return mPacketiser.acceptOggPage(inOggPage);
+
+}
+
+void OggStream::setSendExcess(bool inSendExcess) {
+ mSendExcess = inSendExcess;
+}
+
+bool OggStream::deliverCodecHeaders() {
+ StampedOggPacket* locPacket = NULL;
+ for (unsigned long i = 0; i < mCodecHeaders->numPackets(); i++) {
+ locPacket = mCodecHeaders->getPacket(i);
+
+ dispatchPacket(locPacket);
+ }
+ return true;
+}
+
+//ANX::: Maybe also needs override. ??
+bool OggStream::dispatchPacket(StampedOggPacket* inPacket) {
+ //debugLog<<"Ogg Stream : Packet stamps = "<<inPacket->startTime()<<" - "<<inPacket->endTime()<<endl;
+ return mSourcePin->deliverOggPacket(inPacket);
+}
+
+void OggStream::setSerialNo(unsigned long inSerialNo) {
+ mSerialNo = inSerialNo;
+}
+
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,122 +1,122 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-
-#include "oggdllstuff.h"
-#include "StreamHeaders.h"
-#include "IOggCallback.h"
-#include "IStampedOggPacketSink.h"
-#include "OggPacketiser.h"
-
-#include "OggPage.h"
-#include <fstream>
-using namespace std;
-
-
-class OggDemuxSourceFilter;
-class OggDemuxSourcePin;
-class StreamHeaders;
-
-class OGG_DEMUX_API OggStream
- : public IOggCallback
- , protected IStampedOggPacketSink
-
-{
-public:
- OggStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
- virtual ~OggStream(void);
-
- //more hacks
- virtual void setLastEndGranPos(__int64 inGranPos);
- unsigned long serialNo();
- void setSerialNo(unsigned long inSerialNo);
- //virtual bool IdentifyCodec(OggPacket* inOggPacket) = 0;
- virtual bool InitCodec(StampedOggPacket* inOggPacket) = 0;
- virtual BYTE* getFormatBlock() = 0;
- virtual unsigned long getFormatBlockSize() = 0;
-
- virtual GUID getMajorTypeGUID() = 0;
- virtual GUID getFormatGUID() = 0;
- virtual GUID getSubtypeGUID() = 0;
- virtual wstring getPinName() = 0;
- virtual bool createFormatBlock() = 0;
-
- virtual LONGLONG getCurrentPos() = 0;
-
- virtual unsigned long numCodecHeaders();
- void setSendExcess(bool inSendExcess);
-
- virtual CMediaType* createMediaType(GUID inMajorType, GUID inSubType, GUID inFormatType, unsigned long inFormatSize, BYTE* inFormatBlock);
-
- virtual bool dispatchPacket(StampedOggPacket* inPacket);
- virtual bool deliverCodecHeaders();
-
- //IOggcalback Interface
- virtual bool acceptOggPage(OggPage* inOggPage); //Beware if you override this further
-
- virtual OggDemuxSourcePin* getPin();
- virtual bool OggStream::AddPin();
-
- void setAllowDispatch(bool inAllowDispatch);
- bool streamReady();
-
-
- void flush();
- void flush(unsigned short inNumPacketsToIgnore);
-protected:
- virtual bool acceptStampedOggPacket(StampedOggPacket* inPacket);
-
- //virtual bool processPacket(StampedOggPacket* inPacket);
- virtual bool processHeaderPacket(StampedOggPacket* inPacket);
- virtual bool processDataPacket(StampedOggPacket* inPacket);
- //virtual bool processExcessPacket(StampedOggPacket* inPacket);
-
- OggPacketiser mPacketiser;
- //StampedOggPacket* mPartialPacket;
- StreamHeaders* mCodecHeaders;
- vector<StampedOggPacket*> mExcessPackets;
- unsigned long mSerialNo;
- signed long mNumHeadersNeeded;
- bool mStreamReady;
- bool mFirstRun;
- bool mSendExcess;
- bool mAllowSeek;
- bool mAllowDispatch;
-
- __int64 mLastEndGranulePos;
- __int64 mLastStartGranulePos;
-
- OggDemuxSourcePin* mSourcePin;
- OggDemuxSourceFilter* mOwningFilter;
- CCritSec* mStreamLock;
-
- //fstream debugLog;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+
+#include "oggdllstuff.h"
+#include "StreamHeaders.h"
+#include "IOggCallback.h"
+#include "IStampedOggPacketSink.h"
+#include "OggPacketiser.h"
+
+#include "OggPage.h"
+#include <fstream>
+using namespace std;
+
+
+class OggDemuxSourceFilter;
+class OggDemuxSourcePin;
+class StreamHeaders;
+
+class OGG_DEMUX_API OggStream
+ : public IOggCallback
+ , protected IStampedOggPacketSink
+
+{
+public:
+ OggStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
+ virtual ~OggStream(void);
+
+ //more hacks
+ virtual void setLastEndGranPos(__int64 inGranPos);
+ unsigned long serialNo();
+ void setSerialNo(unsigned long inSerialNo);
+ //virtual bool IdentifyCodec(OggPacket* inOggPacket) = 0;
+ virtual bool InitCodec(StampedOggPacket* inOggPacket) = 0;
+ virtual BYTE* getFormatBlock() = 0;
+ virtual unsigned long getFormatBlockSize() = 0;
+
+ virtual GUID getMajorTypeGUID() = 0;
+ virtual GUID getFormatGUID() = 0;
+ virtual GUID getSubtypeGUID() = 0;
+ virtual wstring getPinName() = 0;
+ virtual bool createFormatBlock() = 0;
+
+ virtual LONGLONG getCurrentPos() = 0;
+
+ virtual unsigned long numCodecHeaders();
+ void setSendExcess(bool inSendExcess);
+
+ virtual CMediaType* createMediaType(GUID inMajorType, GUID inSubType, GUID inFormatType, unsigned long inFormatSize, BYTE* inFormatBlock);
+
+ virtual bool dispatchPacket(StampedOggPacket* inPacket);
+ virtual bool deliverCodecHeaders();
+
+ //IOggcalback Interface
+ virtual bool acceptOggPage(OggPage* inOggPage); //Beware if you override this further
+
+ virtual OggDemuxSourcePin* getPin();
+ virtual bool OggStream::AddPin();
+
+ void setAllowDispatch(bool inAllowDispatch);
+ bool streamReady();
+
+
+ void flush();
+ void flush(unsigned short inNumPacketsToIgnore);
+protected:
+ virtual bool acceptStampedOggPacket(StampedOggPacket* inPacket);
+
+ //virtual bool processPacket(StampedOggPacket* inPacket);
+ virtual bool processHeaderPacket(StampedOggPacket* inPacket);
+ virtual bool processDataPacket(StampedOggPacket* inPacket);
+ //virtual bool processExcessPacket(StampedOggPacket* inPacket);
+
+ OggPacketiser mPacketiser;
+ //StampedOggPacket* mPartialPacket;
+ StreamHeaders* mCodecHeaders;
+ vector<StampedOggPacket*> mExcessPackets;
+ unsigned long mSerialNo;
+ signed long mNumHeadersNeeded;
+ bool mStreamReady;
+ bool mFirstRun;
+ bool mSendExcess;
+ bool mAllowSeek;
+ bool mAllowDispatch;
+
+ __int64 mLastEndGranulePos;
+ __int64 mLastStartGranulePos;
+
+ OggDemuxSourcePin* mSourcePin;
+ OggDemuxSourceFilter* mOwningFilter;
+ CCritSec* mStreamLock;
+
+ //fstream debugLog;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStream.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamFactory.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamFactory.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamFactory.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,82 +1,82 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "oggstreamfactory.h"
-
-
-
-OggStreamFactory::OggStreamFactory(void)
-{
-}
-
-OggStreamFactory::~OggStreamFactory(void)
-{
-}
-
-//New codecs need to be added here and write a derived Stream Class.
-OggStream* OggStreamFactory::CreateStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek) {
- switch (OggStreamFactory::IdentifyCodec(inOggPage->getPacket(0))) {
- case StreamHeaders::VORBIS:
- return new VorbisStream(inOggPage, inOwningFilter, inAllowSeek);
- case StreamHeaders::SPEEX:
- return new SpeexStream(inOggPage, inOwningFilter, inAllowSeek);
- case StreamHeaders::FLAC:
- return new FLACStream(inOggPage, inOwningFilter, inAllowSeek);
- case StreamHeaders::OGG_FLAC_1_0:
- return new OggFLAC_1_0_Stream(inOggPage, inOwningFilter, inAllowSeek);
- case StreamHeaders::THEORA:
- return new TheoraStream(inOggPage, inOwningFilter, inAllowSeek);
- case StreamHeaders::FFDSHOW_VIDEO:
- return new FFDShowVideoStream(inOggPage, inOwningFilter, inAllowSeek);
- case StreamHeaders::NONE:
- default:
- return NULL;
- }
-}
-
-StreamHeaders::eCodecType OggStreamFactory::IdentifyCodec(OggPacket* inOggPacket) {
- if (strncmp((char*)inOggPacket->packetData(), "\001vorbis", 7) == 0) {
- return StreamHeaders::VORBIS;
- } else if (strncmp((char*)inOggPacket->packetData(), "Speex ", 8) == 0) {
- return StreamHeaders::SPEEX;
- } else if ((strncmp((char*)inOggPacket->packetData(), "fLaC", 4)) == 0) {
- return StreamHeaders::FLAC;
- } else if ((strncmp((char*)inOggPacket->packetData(), "\177FLAC", 5)) == 0) {
- return StreamHeaders::OGG_FLAC_1_0;
- } else if ((strncmp((char*)inOggPacket->packetData(), "\200theora", 7)) == 0) {
- return StreamHeaders::THEORA;
- } else if ((strncmp((char*)inOggPacket->packetData(), "\001video\000\000\000", 9)) == 0) {
- return StreamHeaders::FFDSHOW_VIDEO;
- }
-
- return StreamHeaders::NONE;
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "oggstreamfactory.h"
+
+
+
+OggStreamFactory::OggStreamFactory(void)
+{
+}
+
+OggStreamFactory::~OggStreamFactory(void)
+{
+}
+
+//New codecs need to be added here and write a derived Stream Class.
+OggStream* OggStreamFactory::CreateStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek) {
+ switch (OggStreamFactory::IdentifyCodec(inOggPage->getPacket(0))) {
+ case StreamHeaders::VORBIS:
+ return new VorbisStream(inOggPage, inOwningFilter, inAllowSeek);
+ case StreamHeaders::SPEEX:
+ return new SpeexStream(inOggPage, inOwningFilter, inAllowSeek);
+ case StreamHeaders::FLAC:
+ return new FLACStream(inOggPage, inOwningFilter, inAllowSeek);
+ case StreamHeaders::OGG_FLAC_1_0:
+ return new OggFLAC_1_0_Stream(inOggPage, inOwningFilter, inAllowSeek);
+ case StreamHeaders::THEORA:
+ return new TheoraStream(inOggPage, inOwningFilter, inAllowSeek);
+ case StreamHeaders::FFDSHOW_VIDEO:
+ return new FFDShowVideoStream(inOggPage, inOwningFilter, inAllowSeek);
+ case StreamHeaders::NONE:
+ default:
+ return NULL;
+ }
+}
+
+StreamHeaders::eCodecType OggStreamFactory::IdentifyCodec(OggPacket* inOggPacket) {
+ if (strncmp((char*)inOggPacket->packetData(), "\001vorbis", 7) == 0) {
+ return StreamHeaders::VORBIS;
+ } else if (strncmp((char*)inOggPacket->packetData(), "Speex ", 8) == 0) {
+ return StreamHeaders::SPEEX;
+ } else if ((strncmp((char*)inOggPacket->packetData(), "fLaC", 4)) == 0) {
+ return StreamHeaders::FLAC;
+ } else if ((strncmp((char*)inOggPacket->packetData(), "\177FLAC", 5)) == 0) {
+ return StreamHeaders::OGG_FLAC_1_0;
+ } else if ((strncmp((char*)inOggPacket->packetData(), "\200theora", 7)) == 0) {
+ return StreamHeaders::THEORA;
+ } else if ((strncmp((char*)inOggPacket->packetData(), "\001video\000\000\000", 9)) == 0) {
+ return StreamHeaders::FFDSHOW_VIDEO;
+ }
+
+ return StreamHeaders::NONE;
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamFactory.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamFactory.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamFactory.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamFactory.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,54 +1,54 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include "oggdllstuff.h"
-#include "VorbisStream.h"
-#include "SpeexStream.h"
-#include "FLACStream.h"
-#include "TheoraStream.h"
-#include "FFDShowVideoStream.h"
-#include "OggFLAC_1_0_Stream.h"
-
-
-#include "OggPage.h"
-#include "OggPacket.h"
-class OggDemuxSourceFilter;
-class StreamHeaders;
-
-class OGG_DEMUX_API OggStreamFactory
-{
-public:
- OggStreamFactory(void);
- ~OggStreamFactory(void);
-
- static OggStream* CreateStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
- static StreamHeaders::eCodecType IdentifyCodec(OggPacket* inPacket);
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+#include "oggdllstuff.h"
+#include "VorbisStream.h"
+#include "SpeexStream.h"
+#include "FLACStream.h"
+#include "TheoraStream.h"
+#include "FFDShowVideoStream.h"
+#include "OggFLAC_1_0_Stream.h"
+
+
+#include "OggPage.h"
+#include "OggPacket.h"
+class OggDemuxSourceFilter;
+class StreamHeaders;
+
+class OGG_DEMUX_API OggStreamFactory
+{
+public:
+ OggStreamFactory(void);
+ ~OggStreamFactory(void);
+
+ static OggStream* CreateStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
+ static StreamHeaders::eCodecType IdentifyCodec(OggPacket* inPacket);
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamFactory.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamMapper.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamMapper.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamMapper.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,168 +1,168 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "oggstreammapper.h"
-
-OggStreamMapper::OggStreamMapper(OggDemuxSourceFilter* inOwningFilter)
- : mOwningFilter(inOwningFilter)
- , mDataStartsAt(0)
-
-{
-
-}
-
-OggStreamMapper::~OggStreamMapper(void)
-{
- for (size_t i = 0; i < mStreamList.size(); i++) {
- //This is to deal with a circular reference. The pin has a ref on the filter and a filter one on the pin.
- //If they are both allowed to normal reference count, neither are deleted and both are left with 1 ref each.
-
- //If the pin just doesn't hold a ref on the filter, an infinite destruction loop occurs.
- //So to combat this... the pin does not have a ref on the filter... the filter controls the pins lifetime.
- // And when this destructor is called (which is in the destructor of the filter), we are just going to NULL
- // out the seekdelegates pointer (which is a apointer to the filter)... since we don't hold a ref on the filter
- // this isn't a leak.
- mStreamList[i]->getPin()->SetDelegate(NULL);
- delete mStreamList[i];
- }
- mStreamList.empty();
- mStreamList.clear();
-}
-
-//Sends the page to *only one* stream if it matches the serial number.
-bool OggStreamMapper::dispatchPage(OggPage* inOggPage) //Gives away or deletes page.
-{
- //debugLog<<"Dispatch page..."<<endl;
- for (unsigned long i = 0; i < mStreamList.size(); i++) {
- if (mStreamList[i]->serialNo() == inOggPage->header()->StreamSerialNo()) {
- //This is the correct stream
- //DbgLog((LOG_TRACE, 2, TEXT("Mapper : Dispatching page to serial %u",inOggPage->header()->StreamSerialNo())));
- //debugLog<<"Dispatch to stream "<<i<<endl;
- return mStreamList[i]->acceptOggPage(inOggPage); //Give away page.
-
- }
- }
- //debugLog<<"Shouldn't be here $$$$$$"<<endl;
-
- //::: CHAINING SUPPORT HACKED IN HERE !!!
- //===================================
- //We only get here if the serial number wasn't in a header... this means either
- // a) It's a chain, and we are going to hack around it
- // b) The file is invalid.
-
- //Only attempt a chain for a single stream (probably vorbis only)
- if (mStreamList.size() == 1) {
- mStreamList[0]->setSerialNo(inOggPage->header()->StreamSerialNo());
- return mStreamList[0]->acceptOggPage(inOggPage); //Give away page.
- }
- //return false;
- delete inOggPage; //Delete page.
- return true;
-}
-
-unsigned long OggStreamMapper::startOfData() {
- return mDataStartsAt;
-}
-bool OggStreamMapper::acceptOggPage(OggPage* inOggPage) //Gives away page.
-{
-
- //FIXED::: Data starts a 0.
- //if(!isReady()) {
- // mDataStartsAt += inOggPage->pageSize();
- //}
-
- if (!isReady() && inOggPage->header()->isBOS()) {
- bool locAllowSeekThrough = false;
-
- //We only want one of the pins to delegate their seek to us.
- //if (mStreamList.size() == 0) {
- // locAllowSeekThrough = true;
- //}
-
- locAllowSeekThrough = true;
- //Above code is changed... due to WMP9 and 10 's non-adherence to directshows standard... it
- // requires all streams to be seekable, in contradiction to directshow which specifies that
- // only 1 or more is required.
-
-
-
- //If the page is a BOS we need to start a new stream
- OggStream* locStream = OggStreamFactory::CreateStream(inOggPage, mOwningFilter, locAllowSeekThrough);
- //FIX::: Need to check for NULL
- if (locStream != NULL) {
- mStreamList.push_back(locStream);
- }
- return true;
- //TODO::: Shuold verify the mapper doesn';t already have a stream with this number !
- } else {
- return dispatchPage(inOggPage); //Gives away page.
- }
-}
-bool OggStreamMapper::toStartOfData() {
- if (isReady()) { //CHECK::: Should check for allow dsipatch ???
- for (unsigned long i = 0; i < mStreamList.size(); i++) {
- //Flush each stream, then ignore the codec headers.
- mStreamList[i]->flush(mStreamList[i]->numCodecHeaders());
- }
- return true;
- } else {
- return false;
- }
-}
-
-void OggStreamMapper::setAllowDispatch(bool inAllowDispatch) {
- //debugLog<<"Setting allow dispatch..."<<endl;
- for (unsigned long i = 0; i < mStreamList.size(); i++) {
- mStreamList[i]->setAllowDispatch(inAllowDispatch);;
- }
-}
-bool OggStreamMapper::isReady() {
- bool retVal = true;
- bool locWasAny = false;
- for (unsigned long i = 0; i < mStreamList.size(); i++) {
- locWasAny = true;
- retVal = retVal && mStreamList[i]->streamReady();
- }
- return locWasAny && retVal;
-}
-
-unsigned long OggStreamMapper::numStreams() {
- return (unsigned long)mStreamList.size();
-}
-
-OggStream* OggStreamMapper::getOggStream(unsigned long inPinNo) {
- if (inPinNo < mStreamList.size()) {
- return mStreamList[inPinNo];
- } else {
- return NULL;
- }
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "oggstreammapper.h"
+
+OggStreamMapper::OggStreamMapper(OggDemuxSourceFilter* inOwningFilter)
+ : mOwningFilter(inOwningFilter)
+ , mDataStartsAt(0)
+
+{
+
+}
+
+OggStreamMapper::~OggStreamMapper(void)
+{
+ for (size_t i = 0; i < mStreamList.size(); i++) {
+ //This is to deal with a circular reference. The pin has a ref on the filter and a filter one on the pin.
+ //If they are both allowed to normal reference count, neither are deleted and both are left with 1 ref each.
+
+ //If the pin just doesn't hold a ref on the filter, an infinite destruction loop occurs.
+ //So to combat this... the pin does not have a ref on the filter... the filter controls the pins lifetime.
+ // And when this destructor is called (which is in the destructor of the filter), we are just going to NULL
+ // out the seekdelegates pointer (which is a apointer to the filter)... since we don't hold a ref on the filter
+ // this isn't a leak.
+ mStreamList[i]->getPin()->SetDelegate(NULL);
+ delete mStreamList[i];
+ }
+ mStreamList.empty();
+ mStreamList.clear();
+}
+
+//Sends the page to *only one* stream if it matches the serial number.
+bool OggStreamMapper::dispatchPage(OggPage* inOggPage) //Gives away or deletes page.
+{
+ //debugLog<<"Dispatch page..."<<endl;
+ for (unsigned long i = 0; i < mStreamList.size(); i++) {
+ if (mStreamList[i]->serialNo() == inOggPage->header()->StreamSerialNo()) {
+ //This is the correct stream
+ //DbgLog((LOG_TRACE, 2, TEXT("Mapper : Dispatching page to serial %u",inOggPage->header()->StreamSerialNo())));
+ //debugLog<<"Dispatch to stream "<<i<<endl;
+ return mStreamList[i]->acceptOggPage(inOggPage); //Give away page.
+
+ }
+ }
+ //debugLog<<"Shouldn't be here $$$$$$"<<endl;
+
+ //::: CHAINING SUPPORT HACKED IN HERE !!!
+ //===================================
+ //We only get here if the serial number wasn't in a header... this means either
+ // a) It's a chain, and we are going to hack around it
+ // b) The file is invalid.
+
+ //Only attempt a chain for a single stream (probably vorbis only)
+ if (mStreamList.size() == 1) {
+ mStreamList[0]->setSerialNo(inOggPage->header()->StreamSerialNo());
+ return mStreamList[0]->acceptOggPage(inOggPage); //Give away page.
+ }
+ //return false;
+ delete inOggPage; //Delete page.
+ return true;
+}
+
+unsigned long OggStreamMapper::startOfData() {
+ return mDataStartsAt;
+}
+bool OggStreamMapper::acceptOggPage(OggPage* inOggPage) //Gives away page.
+{
+
+ //FIXED::: Data starts a 0.
+ //if(!isReady()) {
+ // mDataStartsAt += inOggPage->pageSize();
+ //}
+
+ if (!isReady() && inOggPage->header()->isBOS()) {
+ bool locAllowSeekThrough = false;
+
+ //We only want one of the pins to delegate their seek to us.
+ //if (mStreamList.size() == 0) {
+ // locAllowSeekThrough = true;
+ //}
+
+ locAllowSeekThrough = true;
+ //Above code is changed... due to WMP9 and 10 's non-adherence to directshows standard... it
+ // requires all streams to be seekable, in contradiction to directshow which specifies that
+ // only 1 or more is required.
+
+
+
+ //If the page is a BOS we need to start a new stream
+ OggStream* locStream = OggStreamFactory::CreateStream(inOggPage, mOwningFilter, locAllowSeekThrough);
+ //FIX::: Need to check for NULL
+ if (locStream != NULL) {
+ mStreamList.push_back(locStream);
+ }
+ return true;
+ //TODO::: Shuold verify the mapper doesn';t already have a stream with this number !
+ } else {
+ return dispatchPage(inOggPage); //Gives away page.
+ }
+}
+bool OggStreamMapper::toStartOfData() {
+ if (isReady()) { //CHECK::: Should check for allow dsipatch ???
+ for (unsigned long i = 0; i < mStreamList.size(); i++) {
+ //Flush each stream, then ignore the codec headers.
+ mStreamList[i]->flush(mStreamList[i]->numCodecHeaders());
+ }
+ return true;
+ } else {
+ return false;
+ }
+}
+
+void OggStreamMapper::setAllowDispatch(bool inAllowDispatch) {
+ //debugLog<<"Setting allow dispatch..."<<endl;
+ for (unsigned long i = 0; i < mStreamList.size(); i++) {
+ mStreamList[i]->setAllowDispatch(inAllowDispatch);;
+ }
+}
+bool OggStreamMapper::isReady() {
+ bool retVal = true;
+ bool locWasAny = false;
+ for (unsigned long i = 0; i < mStreamList.size(); i++) {
+ locWasAny = true;
+ retVal = retVal && mStreamList[i]->streamReady();
+ }
+ return locWasAny && retVal;
+}
+
+unsigned long OggStreamMapper::numStreams() {
+ return (unsigned long)mStreamList.size();
+}
+
+OggStream* OggStreamMapper::getOggStream(unsigned long inPinNo) {
+ if (inPinNo < mStreamList.size()) {
+ return mStreamList[inPinNo];
+ } else {
+ return NULL;
+ }
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamMapper.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamMapper.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamMapper.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamMapper.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,70 +1,70 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include "oggdllstuff.h"
-#include "IOggCallback.h"
-#include "OggStream.h"
-#include "OggStreamFactory.h"
-#include "OggDemuxSourceFilter.h"
-
-#include <vector>
-#include <fstream>
-using namespace std;
-
-class OGG_DEMUX_API OggStreamMapper
- : public IOggCallback
-{
-public:
- friend class OggStream;
- OggStreamMapper(OggDemuxSourceFilter* inOwningFilter);
- virtual ~OggStreamMapper(void);
-
- OggStream* getOggStream(unsigned long inPinNo);
- //Also add a get by serial no
- unsigned long numStreams();
- unsigned long startOfData();
-
- bool dispatchPage(OggPage* inOggPage); //Should this be private or protected ?
- //IOggCalback INterface
- virtual bool acceptOggPage(OggPage* inOggPage);
-
- virtual bool isReady();
- virtual void setAllowDispatch(bool inAllowDispatch);
- virtual bool toStartOfData();
-
-protected:
- unsigned long mDataStartsAt;
- bool mSendExcess;
- vector<OggStream*> mStreamList;
-
- OggDemuxSourceFilter* mOwningFilter;
- //fstream debugLog;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+#include "oggdllstuff.h"
+#include "IOggCallback.h"
+#include "OggStream.h"
+#include "OggStreamFactory.h"
+#include "OggDemuxSourceFilter.h"
+
+#include <vector>
+#include <fstream>
+using namespace std;
+
+class OGG_DEMUX_API OggStreamMapper
+ : public IOggCallback
+{
+public:
+ friend class OggStream;
+ OggStreamMapper(OggDemuxSourceFilter* inOwningFilter);
+ virtual ~OggStreamMapper(void);
+
+ OggStream* getOggStream(unsigned long inPinNo);
+ //Also add a get by serial no
+ unsigned long numStreams();
+ unsigned long startOfData();
+
+ bool dispatchPage(OggPage* inOggPage); //Should this be private or protected ?
+ //IOggCalback INterface
+ virtual bool acceptOggPage(OggPage* inOggPage);
+
+ virtual bool isReady();
+ virtual void setAllowDispatch(bool inAllowDispatch);
+ virtual bool toStartOfData();
+
+protected:
+ unsigned long mDataStartsAt;
+ bool mSendExcess;
+ vector<OggStream*> mStreamList;
+
+ OggDemuxSourceFilter* mOwningFilter;
+ //fstream debugLog;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/OggStreamMapper.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/PropsAbout.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/PropsAbout.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/PropsAbout.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,19 +1,19 @@
-#include "StdAfx.h"
-#include "propsabout.h"
-
-
-PropsAbout::PropsAbout(LPUNKNOWN inUnk, HRESULT* outHR)
- : CBasePropertyPage(NAME("illiminable Directshow Filters"), inUnk, IDD_ILLIMINABLE_ABOUT, IDS_ILLI_ABOUT_STRING_TITLE)
-
-{
- *outHR = S_OK;
-}
-
-PropsAbout::~PropsAbout(void)
-{
-}
-
-CUnknown* PropsAbout::CreateInstance(LPUNKNOWN inUnk, HRESULT* outHR)
-{
- return new PropsAbout(inUnk, outHR);
-}
+#include "StdAfx.h"
+#include "propsabout.h"
+
+
+PropsAbout::PropsAbout(LPUNKNOWN inUnk, HRESULT* outHR)
+ : CBasePropertyPage(NAME("illiminable Directshow Filters"), inUnk, IDD_ILLIMINABLE_ABOUT, IDS_ILLI_ABOUT_STRING_TITLE)
+
+{
+ *outHR = S_OK;
+}
+
+PropsAbout::~PropsAbout(void)
+{
+}
+
+CUnknown* PropsAbout::CreateInstance(LPUNKNOWN inUnk, HRESULT* outHR)
+{
+ return new PropsAbout(inUnk, outHR);
+}
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/PropsAbout.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/PropsAbout.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/PropsAbout.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/PropsAbout.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,15 +1,15 @@
-#pragma once
-#include "resource.h"
-
-
-class PropsAbout
- : public CBasePropertyPage
-{
-public:
- PropsAbout(LPUNKNOWN inUnk, HRESULT* outHR);
- virtual ~PropsAbout(void);
-
- static CUnknown* WINAPI CreateInstance(LPUNKNOWN inUnk, HRESULT* outHR);
-
-
-};
+#pragma once
+#include "resource.h"
+
+
+class PropsAbout
+ : public CBasePropertyPage
+{
+public:
+ PropsAbout(LPUNKNOWN inUnk, HRESULT* outHR);
+ virtual ~PropsAbout(void);
+
+ static CUnknown* WINAPI CreateInstance(LPUNKNOWN inUnk, HRESULT* outHR);
+
+
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/PropsAbout.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/RegWrap.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/RegWrap.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/RegWrap.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,255 +1,255 @@
-#include "StdAfx.h"
-#include "regwrap.h"
-
-RegWrap::RegWrap(void)
-{
-}
-
-RegWrap::~RegWrap(void)
-{
-}
-
-LONG RegWrap::addKeyVal(HKEY inHive, string inKeyName, string inValueName, string inValue) {
- //Open or create keyname
- //Add a value called ValueName with value inValue.
-
- //LONG RegCreateKeyEx(
- // HKEY hKey,
- // LPCTSTR lpSubKey,
- // DWORD Reserved,
- // LPTSTR lpClass,
- // DWORD dwOptions,
- // REGSAM samDesired,
- // LPSECURITY_ATTRIBUTES lpSecurityAttributes,
- // PHKEY phkResult,
- // LPDWORD lpdwDisposition
- //);
-
-
- //LONG RegSetValueEx(
- // HKEY hKey,
- // LPCTSTR lpValueName,
- // DWORD Reserved,
- // DWORD dwType,
- // const BYTE* lpData,
- // DWORD cbData
- //);
-
-
- //fstream debugLog;
- //debugLog.open("G:\\reg.log", ios_base::out);
- //debugLog <<"Key = "<<inKeyName<<endl<<"ValueName = "<<inValueName<<endl<<"Value = "<<inValue<<endl;
- HKEY locKey;
- DWORD locDisp;
- LONG retVal = RegCreateKeyEx( inHive,
- inKeyName.c_str(),
- NULL,
- NULL,
- REG_OPTION_NON_VOLATILE,
- KEY_ALL_ACCESS,
- NULL,
- &locKey,
- &locDisp);
-
- if (retVal != ERROR_SUCCESS) {
- //debugLog<<"Create Failed"<<endl;
- return retVal;
- }
-
- retVal = RegSetValueEx( locKey,
- inValueName.c_str(),
- NULL,
- REG_SZ,
- (const BYTE*)inValue.c_str(),
- inValue.length()+1);
-
- if (retVal != ERROR_SUCCESS) {
- //debugLog<<"Set Value Failed"<<endl;
- return retVal;
- }
-
- RegCloseKey(locKey);
-
- //debugLog.close();
- return retVal;
-
-}
-
-bool RegWrap::deleteKeyRecurse(HKEY inHive, string inKeyName, string inSubKeyToDelete) {
- HKEY locKey;
- LONG retVal;
-
- retVal = RegOpenKeyEx( inHive,
- inKeyName.c_str(),
- NULL,
- KEY_ALL_ACCESS,
- &locKey);
-
- if (retVal != ERROR_SUCCESS) {
- //debugLog<<"Key not found"<<endl;
- return false;
- }
-
- retVal = SHDeleteKeyA(locKey, inSubKeyToDelete.c_str());
- RegCloseKey(locKey);
- return true;
-
-}
-
-
-
-bool RegWrap::removeKeyVal(HKEY inHive, string inKeyName, string inValueName) {
- //LONG RegDeleteValue(
- // HKEY hKey,
- // LPCTSTR lpValueName
- //);
-
- HKEY locKey;
- LONG retVal;
-
- retVal = RegOpenKeyEx( inHive,
- inKeyName.c_str(),
- NULL,
- KEY_ALL_ACCESS,
- &locKey);
-
- if (retVal != ERROR_SUCCESS) {
- //debugLog<<"Key not found"<<endl;
- return false;
- }
-
- retVal = RegDeleteValue(locKey, inValueName.c_str());
- RegCloseKey(locKey);
- if (retVal != ERROR_SUCCESS) {
- return false;
- } else {
- return true;
- }
-}
-
-bool RegWrap::valueExists(HKEY inHive, string inKeyName, string inValueName) {
-
- //LONG RegQueryValueEx(
- // HKEY hKey,
- // LPCTSTR lpValueName,
- // LPDWORD lpReserved,
- // LPDWORD lpType,
- // LPBYTE lpData,
- // LPDWORD lpcbData
- //);
-
- //LONG RegOpenKeyEx(
- // HKEY hKey,
- // LPCTSTR lpSubKey,
- // DWORD ulOptions,
- // REGSAM samDesired,
- // PHKEY phkResult
- //);
-
- //fstream debugLog;
- //HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MediaPlayer\Player\Extensions\Descriptions
- //debugLog.open("G:\\val.log", ios_base::out);
- HKEY locKey;
- LONG retVal;
- //debugLog<<"Querying : Key = "<<inKeyName<<endl<<"Value = "<<inValueName<<endl;
-
- retVal = RegOpenKeyEx( inHive,
- inKeyName.c_str(),
- NULL,
- KEY_ALL_ACCESS,
- &locKey);
-
- if (retVal != ERROR_SUCCESS) {
- //debugLog<<"Key not found"<<endl;
- return false;
- }
-
- retVal = RegQueryValueEx( locKey,
- inValueName.c_str(),
- NULL,
- NULL,
- NULL,
- NULL);
-
- RegCloseKey(locKey);
- if (retVal != ERROR_SUCCESS) {
- //debugLog<<"Value not found"<<endl;
- return false;
- } else {
- //debugLog<<"Value found"<<endl;
- return true;
- }
-
-}
-
-string RegWrap::findNextEmptyMediaPlayerDesc() {
- char locNum[6];
- string foundNum = "";
- for (long i = 1; i < 24; i++) {
- itoa(i, (char*)&locNum, 10);
- if (!RegWrap::valueExists(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\MediaPlayer\\Player\\Extensions\\Descriptions", (char*)&locNum)) {
- foundNum = (char*)&locNum;
- break;
- }
-
- }
- return foundNum;
-}
-
-bool RegWrap::removeMediaDesc() {
- HKEY locKey;
- LONG retVal;
-
- retVal = RegOpenKeyEx( HKEY_LOCAL_MACHINE,
- "SOFTWARE\\illiminable\\oggcodecs",
- NULL,
- KEY_ALL_ACCESS,
- &locKey);
-
- if (retVal != ERROR_SUCCESS) {
- //debugLog<<"Key not found"<<endl;
- return false;
- }
-
- DWORD locBuffSize = 16;
- char locBuff[16];
-
- retVal = RegQueryValueEx( locKey,
- "MediaDescNum",
- NULL,
- NULL,
- (BYTE*)&locBuff,
- &locBuffSize);
-
- RegCloseKey(locKey);
- if (retVal != ERROR_SUCCESS) {
- //debugLog<<"Value not found"<<endl;
- return false;
- } else {
- RegWrap::removeKeyVal(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\MediaPlayer\\Player\\Extensions\\Descriptions", locBuff);
- RegWrap::removeKeyVal(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\MediaPlayer\\Player\\Extensions\\MUIDescriptions", locBuff);
- RegWrap::removeKeyVal(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\MediaPlayer\\Player\\Extensions\\Types", locBuff);
- RegWrap::removeKeyVal(HKEY_LOCAL_MACHINE, "SOFTWARE\\illiminable\\oggcodecs", "MediaDescNum");
- //debugLog<<"Value found"<<endl;
- return true;
-
- }
-
-
-}
-bool RegWrap::addMediaPlayerDesc(string inDesc, string inExts) {
- if (!RegWrap::valueExists(HKEY_LOCAL_MACHINE, "SOFTWARE\\illiminable\\oggcodecs", "MediaDescNum")) {
- string locDescNum = "";
- string locFull = inDesc+" ("+inExts+")";
- locDescNum = RegWrap::findNextEmptyMediaPlayerDesc();
- if (locDescNum == "") {
- return false;
- }
- RegWrap::addKeyVal(HKEY_LOCAL_MACHINE, "SOFTWARE\\illiminable\\oggcodecs", "MediaDescNum", locDescNum.c_str());
- RegWrap::addKeyVal(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\MediaPlayer\\Player\\Extensions\\Descriptions", locDescNum, locFull.c_str());
- RegWrap::addKeyVal(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\MediaPlayer\\Player\\Extensions\\MUIDescriptions", locDescNum, inDesc.c_str());
- RegWrap::addKeyVal(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\MediaPlayer\\Player\\Extensions\\Types", locDescNum, inExts.c_str());
- return true;
- }
-
+#include "StdAfx.h"
+#include "regwrap.h"
+
+RegWrap::RegWrap(void)
+{
+}
+
+RegWrap::~RegWrap(void)
+{
+}
+
+LONG RegWrap::addKeyVal(HKEY inHive, string inKeyName, string inValueName, string inValue) {
+ //Open or create keyname
+ //Add a value called ValueName with value inValue.
+
+ //LONG RegCreateKeyEx(
+ // HKEY hKey,
+ // LPCTSTR lpSubKey,
+ // DWORD Reserved,
+ // LPTSTR lpClass,
+ // DWORD dwOptions,
+ // REGSAM samDesired,
+ // LPSECURITY_ATTRIBUTES lpSecurityAttributes,
+ // PHKEY phkResult,
+ // LPDWORD lpdwDisposition
+ //);
+
+
+ //LONG RegSetValueEx(
+ // HKEY hKey,
+ // LPCTSTR lpValueName,
+ // DWORD Reserved,
+ // DWORD dwType,
+ // const BYTE* lpData,
+ // DWORD cbData
+ //);
+
+
+ //fstream debugLog;
+ //debugLog.open("G:\\reg.log", ios_base::out);
+ //debugLog <<"Key = "<<inKeyName<<endl<<"ValueName = "<<inValueName<<endl<<"Value = "<<inValue<<endl;
+ HKEY locKey;
+ DWORD locDisp;
+ LONG retVal = RegCreateKeyEx( inHive,
+ inKeyName.c_str(),
+ NULL,
+ NULL,
+ REG_OPTION_NON_VOLATILE,
+ KEY_ALL_ACCESS,
+ NULL,
+ &locKey,
+ &locDisp);
+
+ if (retVal != ERROR_SUCCESS) {
+ //debugLog<<"Create Failed"<<endl;
+ return retVal;
+ }
+
+ retVal = RegSetValueEx( locKey,
+ inValueName.c_str(),
+ NULL,
+ REG_SZ,
+ (const BYTE*)inValue.c_str(),
+ inValue.length()+1);
+
+ if (retVal != ERROR_SUCCESS) {
+ //debugLog<<"Set Value Failed"<<endl;
+ return retVal;
+ }
+
+ RegCloseKey(locKey);
+
+ //debugLog.close();
+ return retVal;
+
+}
+
+bool RegWrap::deleteKeyRecurse(HKEY inHive, string inKeyName, string inSubKeyToDelete) {
+ HKEY locKey;
+ LONG retVal;
+
+ retVal = RegOpenKeyEx( inHive,
+ inKeyName.c_str(),
+ NULL,
+ KEY_ALL_ACCESS,
+ &locKey);
+
+ if (retVal != ERROR_SUCCESS) {
+ //debugLog<<"Key not found"<<endl;
+ return false;
+ }
+
+ retVal = SHDeleteKeyA(locKey, inSubKeyToDelete.c_str());
+ RegCloseKey(locKey);
+ return true;
+
+}
+
+
+
+bool RegWrap::removeKeyVal(HKEY inHive, string inKeyName, string inValueName) {
+ //LONG RegDeleteValue(
+ // HKEY hKey,
+ // LPCTSTR lpValueName
+ //);
+
+ HKEY locKey;
+ LONG retVal;
+
+ retVal = RegOpenKeyEx( inHive,
+ inKeyName.c_str(),
+ NULL,
+ KEY_ALL_ACCESS,
+ &locKey);
+
+ if (retVal != ERROR_SUCCESS) {
+ //debugLog<<"Key not found"<<endl;
+ return false;
+ }
+
+ retVal = RegDeleteValue(locKey, inValueName.c_str());
+ RegCloseKey(locKey);
+ if (retVal != ERROR_SUCCESS) {
+ return false;
+ } else {
+ return true;
+ }
+}
+
+bool RegWrap::valueExists(HKEY inHive, string inKeyName, string inValueName) {
+
+ //LONG RegQueryValueEx(
+ // HKEY hKey,
+ // LPCTSTR lpValueName,
+ // LPDWORD lpReserved,
+ // LPDWORD lpType,
+ // LPBYTE lpData,
+ // LPDWORD lpcbData
+ //);
+
+ //LONG RegOpenKeyEx(
+ // HKEY hKey,
+ // LPCTSTR lpSubKey,
+ // DWORD ulOptions,
+ // REGSAM samDesired,
+ // PHKEY phkResult
+ //);
+
+ //fstream debugLog;
+ //HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MediaPlayer\Player\Extensions\Descriptions
+ //debugLog.open("G:\\val.log", ios_base::out);
+ HKEY locKey;
+ LONG retVal;
+ //debugLog<<"Querying : Key = "<<inKeyName<<endl<<"Value = "<<inValueName<<endl;
+
+ retVal = RegOpenKeyEx( inHive,
+ inKeyName.c_str(),
+ NULL,
+ KEY_ALL_ACCESS,
+ &locKey);
+
+ if (retVal != ERROR_SUCCESS) {
+ //debugLog<<"Key not found"<<endl;
+ return false;
+ }
+
+ retVal = RegQueryValueEx( locKey,
+ inValueName.c_str(),
+ NULL,
+ NULL,
+ NULL,
+ NULL);
+
+ RegCloseKey(locKey);
+ if (retVal != ERROR_SUCCESS) {
+ //debugLog<<"Value not found"<<endl;
+ return false;
+ } else {
+ //debugLog<<"Value found"<<endl;
+ return true;
+ }
+
+}
+
+string RegWrap::findNextEmptyMediaPlayerDesc() {
+ char locNum[6];
+ string foundNum = "";
+ for (long i = 1; i < 24; i++) {
+ itoa(i, (char*)&locNum, 10);
+ if (!RegWrap::valueExists(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\MediaPlayer\\Player\\Extensions\\Descriptions", (char*)&locNum)) {
+ foundNum = (char*)&locNum;
+ break;
+ }
+
+ }
+ return foundNum;
+}
+
+bool RegWrap::removeMediaDesc() {
+ HKEY locKey;
+ LONG retVal;
+
+ retVal = RegOpenKeyEx( HKEY_LOCAL_MACHINE,
+ "SOFTWARE\\illiminable\\oggcodecs",
+ NULL,
+ KEY_ALL_ACCESS,
+ &locKey);
+
+ if (retVal != ERROR_SUCCESS) {
+ //debugLog<<"Key not found"<<endl;
+ return false;
+ }
+
+ DWORD locBuffSize = 16;
+ char locBuff[16];
+
+ retVal = RegQueryValueEx( locKey,
+ "MediaDescNum",
+ NULL,
+ NULL,
+ (BYTE*)&locBuff,
+ &locBuffSize);
+
+ RegCloseKey(locKey);
+ if (retVal != ERROR_SUCCESS) {
+ //debugLog<<"Value not found"<<endl;
+ return false;
+ } else {
+ RegWrap::removeKeyVal(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\MediaPlayer\\Player\\Extensions\\Descriptions", locBuff);
+ RegWrap::removeKeyVal(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\MediaPlayer\\Player\\Extensions\\MUIDescriptions", locBuff);
+ RegWrap::removeKeyVal(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\MediaPlayer\\Player\\Extensions\\Types", locBuff);
+ RegWrap::removeKeyVal(HKEY_LOCAL_MACHINE, "SOFTWARE\\illiminable\\oggcodecs", "MediaDescNum");
+ //debugLog<<"Value found"<<endl;
+ return true;
+
+ }
+
+
+}
+bool RegWrap::addMediaPlayerDesc(string inDesc, string inExts) {
+ if (!RegWrap::valueExists(HKEY_LOCAL_MACHINE, "SOFTWARE\\illiminable\\oggcodecs", "MediaDescNum")) {
+ string locDescNum = "";
+ string locFull = inDesc+" ("+inExts+")";
+ locDescNum = RegWrap::findNextEmptyMediaPlayerDesc();
+ if (locDescNum == "") {
+ return false;
+ }
+ RegWrap::addKeyVal(HKEY_LOCAL_MACHINE, "SOFTWARE\\illiminable\\oggcodecs", "MediaDescNum", locDescNum.c_str());
+ RegWrap::addKeyVal(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\MediaPlayer\\Player\\Extensions\\Descriptions", locDescNum, locFull.c_str());
+ RegWrap::addKeyVal(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\MediaPlayer\\Player\\Extensions\\MUIDescriptions", locDescNum, inDesc.c_str());
+ RegWrap::addKeyVal(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\MediaPlayer\\Player\\Extensions\\Types", locDescNum, inExts.c_str());
+ return true;
+ }
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/RegWrap.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/RegWrap.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/RegWrap.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/RegWrap.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,19 +1,19 @@
-#pragma once
-#include <shlwapi.h>
-
-//This class really shouldn't be part of this project, but i got lazy !
-//This is a pretty inefficient way to do it but its easy.
-class OGG_DEMUX_API RegWrap
-{
-public:
- RegWrap(void);
- ~RegWrap(void);
-
- static LONG addKeyVal(HKEY inHive, string inKeyName, string inValueName, string inValue);
- static bool valueExists(HKEY inHive, string inKeyName, string inValueName);
- static string findNextEmptyMediaPlayerDesc();
- static bool addMediaPlayerDesc(string inDesc, string inExts);
- static bool removeKeyVal(HKEY inHive, string inKeyName, string inValueName);
- static bool removeMediaDesc();
- static bool deleteKeyRecurse(HKEY inHive, string inKeyName, string inSubKeyToDelete);
-};
+#pragma once
+#include <shlwapi.h>
+
+//This class really shouldn't be part of this project, but i got lazy !
+//This is a pretty inefficient way to do it but its easy.
+class OGG_DEMUX_API RegWrap
+{
+public:
+ RegWrap(void);
+ ~RegWrap(void);
+
+ static LONG addKeyVal(HKEY inHive, string inKeyName, string inValueName, string inValue);
+ static bool valueExists(HKEY inHive, string inKeyName, string inValueName);
+ static string findNextEmptyMediaPlayerDesc();
+ static bool addMediaPlayerDesc(string inDesc, string inExts);
+ static bool removeKeyVal(HKEY inHive, string inKeyName, string inValueName);
+ static bool removeMediaDesc();
+ static bool deleteKeyRecurse(HKEY inHive, string inKeyName, string inSubKeyToDelete);
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/RegWrap.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SingleMediaFileCache.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SingleMediaFileCache.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SingleMediaFileCache.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,125 +1,125 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include ".\singlemediafilecache.h"
-
-SingleMediaFileCache::SingleMediaFileCache(void)
- : mBytesWritten(0)
- , mIsComplete(false)
- , mReadPtr(0)
-{
- //debugLog.open("G:\\logs\\mediacache.log", ios_base::out);
-}
-
-SingleMediaFileCache::~SingleMediaFileCache(void)
-{
- //debugLog.close();
-}
-
-bool SingleMediaFileCache::open(string inFileName) {
- mBytesWritten = 0;
- //debugLog<<"Opening "<<inFileName<<endl;
- mLocalFile.open(inFileName.c_str(), ios_base::in|ios_base::out|ios_base::binary|ios_base::trunc);
-
- if (mLocalFile.is_open()) {
- //debugLog<<"File open...."<<endl;
- } else {
- //debugLog<<"File open FAILED"<<endl;
- }
- return mLocalFile.is_open();
-}
-void SingleMediaFileCache::close() {
- mLocalFile.close();
-
-}
-bool SingleMediaFileCache::write(const unsigned char* inBuff, unsigned long inBuffSize) {
- //debugLog<<"Writeing "<<inBuffSize<<endl;
- //debugLog<<"Read Ptr = "<<mLocalFile.tellg();
- //debugLog<<"Write Ptr = "<<mLocalFile.tellp();
- mLocalFile.seekp(0, ios_base::end);
- if (inBuffSize != 0) {
- mLocalFile.write((const char*)inBuff, inBuffSize);
- mBytesWritten += inBuffSize;
- }
-
- if (mLocalFile.fail()) {
- //debugLog<<"*** Write put into FAIL"<<endl;
- }
- return !(mLocalFile.fail());
-}
-unsigned long SingleMediaFileCache::read(unsigned char* outBuff, unsigned long inBuffSize) {
- //debugLog<<"Read request for "<<inBuffSize<<" got ";
- //debugLog<<"Read Ptr = "<<mLocalFile.tellg();
- //debugLog<<"Write Ptr = "<<mLocalFile.tellp();
- mLocalFile.seekg(mReadPtr);
- unsigned long locBytesAvail = bytesAvail();
- if (locBytesAvail >= inBuffSize) {
- mLocalFile.read((char*)outBuff, inBuffSize);
- //debugLog<<mLocalFile.gcount()<<endl;
- mReadPtr+=mLocalFile.gcount();
- return mLocalFile.gcount();
- } else if (locBytesAvail > 0) {
- mLocalFile.read((char*)outBuff, locBytesAvail);
- //debugLog<<locBytesAvail<<endl;
- mReadPtr += locBytesAvail;
- return locBytesAvail;
- } else {
- //debugLog << "NOTHING"<<endl;
- return 0;
- }
-
-}
-bool SingleMediaFileCache::readSeek(unsigned long inSeekPos) {
- if (inSeekPos < mBytesWritten) {
- //debugLog<<"Seeking to "<<inSeekPos<<endl;
- mReadPtr = inSeekPos;
- return true;
- } else {
- return false;
- }
-}
-
-unsigned long SingleMediaFileCache::totalBytes() {
- return mBytesWritten;
-}
-unsigned long SingleMediaFileCache::bytesAvail() {
- if (mLocalFile.fail()) {
- //debugLog<<"bytesAvail : File is in fail state"<<endl;
- }
- //debugLog<<"bytesAvail : Byteswritten = "<<mBytesWritten<<endl;
- //if ((!mLocalFile.fail()) && (mBytesWritten > 0)) {
- if (mBytesWritten > 0) {
- //debugLog<<"bytes Avail = "<<mBytesWritten - mReadPtr<<endl;
- return mBytesWritten - mReadPtr;
- } else {
- return 0;
- }
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include ".\singlemediafilecache.h"
+
+SingleMediaFileCache::SingleMediaFileCache(void)
+ : mBytesWritten(0)
+ , mIsComplete(false)
+ , mReadPtr(0)
+{
+ //debugLog.open("G:\\logs\\mediacache.log", ios_base::out);
+}
+
+SingleMediaFileCache::~SingleMediaFileCache(void)
+{
+ //debugLog.close();
+}
+
+bool SingleMediaFileCache::open(string inFileName) {
+ mBytesWritten = 0;
+ //debugLog<<"Opening "<<inFileName<<endl;
+ mLocalFile.open(inFileName.c_str(), ios_base::in|ios_base::out|ios_base::binary|ios_base::trunc);
+
+ if (mLocalFile.is_open()) {
+ //debugLog<<"File open...."<<endl;
+ } else {
+ //debugLog<<"File open FAILED"<<endl;
+ }
+ return mLocalFile.is_open();
+}
+void SingleMediaFileCache::close() {
+ mLocalFile.close();
+
+}
+bool SingleMediaFileCache::write(const unsigned char* inBuff, unsigned long inBuffSize) {
+ //debugLog<<"Writeing "<<inBuffSize<<endl;
+ //debugLog<<"Read Ptr = "<<mLocalFile.tellg();
+ //debugLog<<"Write Ptr = "<<mLocalFile.tellp();
+ mLocalFile.seekp(0, ios_base::end);
+ if (inBuffSize != 0) {
+ mLocalFile.write((const char*)inBuff, inBuffSize);
+ mBytesWritten += inBuffSize;
+ }
+
+ if (mLocalFile.fail()) {
+ //debugLog<<"*** Write put into FAIL"<<endl;
+ }
+ return !(mLocalFile.fail());
+}
+unsigned long SingleMediaFileCache::read(unsigned char* outBuff, unsigned long inBuffSize) {
+ //debugLog<<"Read request for "<<inBuffSize<<" got ";
+ //debugLog<<"Read Ptr = "<<mLocalFile.tellg();
+ //debugLog<<"Write Ptr = "<<mLocalFile.tellp();
+ mLocalFile.seekg(mReadPtr);
+ unsigned long locBytesAvail = bytesAvail();
+ if (locBytesAvail >= inBuffSize) {
+ mLocalFile.read((char*)outBuff, inBuffSize);
+ //debugLog<<mLocalFile.gcount()<<endl;
+ mReadPtr+=mLocalFile.gcount();
+ return mLocalFile.gcount();
+ } else if (locBytesAvail > 0) {
+ mLocalFile.read((char*)outBuff, locBytesAvail);
+ //debugLog<<locBytesAvail<<endl;
+ mReadPtr += locBytesAvail;
+ return locBytesAvail;
+ } else {
+ //debugLog << "NOTHING"<<endl;
+ return 0;
+ }
+
+}
+bool SingleMediaFileCache::readSeek(unsigned long inSeekPos) {
+ if (inSeekPos < mBytesWritten) {
+ //debugLog<<"Seeking to "<<inSeekPos<<endl;
+ mReadPtr = inSeekPos;
+ return true;
+ } else {
+ return false;
+ }
+}
+
+unsigned long SingleMediaFileCache::totalBytes() {
+ return mBytesWritten;
+}
+unsigned long SingleMediaFileCache::bytesAvail() {
+ if (mLocalFile.fail()) {
+ //debugLog<<"bytesAvail : File is in fail state"<<endl;
+ }
+ //debugLog<<"bytesAvail : Byteswritten = "<<mBytesWritten<<endl;
+ //if ((!mLocalFile.fail()) && (mBytesWritten > 0)) {
+ if (mBytesWritten > 0) {
+ //debugLog<<"bytes Avail = "<<mBytesWritten - mReadPtr<<endl;
+ return mBytesWritten - mReadPtr;
+ } else {
+ return 0;
+ }
+}
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SingleMediaFileCache.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SingleMediaFileCache.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SingleMediaFileCache.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SingleMediaFileCache.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,67 +1,67 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-
-//This class will be a cache of a single media file.
-//It will only allow a single chunk of data to be cached...
-// ie you can't cache bytes 0-1000 and 2000-3000...
-// only consecutive blocks for now.
-//
-//Data can be read randomly... but only written sequentially.
-//Will act as a buffer so that data read off the network can be put straight
-// into the file and then read as needed.
-
-#include <string>
-#include <fstream>
-using namespace std;
-class OGG_DEMUX_API SingleMediaFileCache
-{
-public:
- SingleMediaFileCache(void);
- ~SingleMediaFileCache(void);
-
- bool open(string inFileName);
- void close();
- bool write(const unsigned char* inBuff, unsigned long inBuffSize);
- unsigned long read(unsigned char* outBuff, unsigned long inBuffSize);
- bool readSeek(unsigned long inSeekPos);
- unsigned long totalBytes();
- unsigned long bytesAvail();
-
-protected:
- fstream mLocalFile;
-
- unsigned long mBytesWritten;
- unsigned long mReadPtr;
-
- //fstream debugLog;
- bool mIsComplete;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+
+//This class will be a cache of a single media file.
+//It will only allow a single chunk of data to be cached...
+// ie you can't cache bytes 0-1000 and 2000-3000...
+// only consecutive blocks for now.
+//
+//Data can be read randomly... but only written sequentially.
+//Will act as a buffer so that data read off the network can be put straight
+// into the file and then read as needed.
+
+#include <string>
+#include <fstream>
+using namespace std;
+class OGG_DEMUX_API SingleMediaFileCache
+{
+public:
+ SingleMediaFileCache(void);
+ ~SingleMediaFileCache(void);
+
+ bool open(string inFileName);
+ void close();
+ bool write(const unsigned char* inBuff, unsigned long inBuffSize);
+ unsigned long read(unsigned char* outBuff, unsigned long inBuffSize);
+ bool readSeek(unsigned long inSeekPos);
+ unsigned long totalBytes();
+ unsigned long bytesAvail();
+
+protected:
+ fstream mLocalFile;
+
+ unsigned long mBytesWritten;
+ unsigned long mReadPtr;
+
+ //fstream debugLog;
+ bool mIsComplete;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SingleMediaFileCache.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SpeexStream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SpeexStream.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SpeexStream.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,98 +1,98 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "speexstream.h"
-
-SpeexStream::SpeexStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek)
- : OggStream(inBOSPage, inOwningFilter, inAllowSeek)
- , mSpeexFormatBlock(NULL)
-{
- InitCodec(inBOSPage->getStampedPacket(0));
-}
-
-SpeexStream::~SpeexStream(void)
-{
- delete mSpeexFormatBlock;
-}
-
-bool SpeexStream::InitCodec(StampedOggPacket* inOggPacket) {
- //Can probably abstract this out of here too !
- mCodecHeaders = new StreamHeaders;
- mCodecHeaders->mCodecType = StreamHeaders::SPEEX;
- mCodecHeaders->addPacket((StampedOggPacket*)inOggPacket->clone());
- //What to do with commment fields ??
- mNumHeadersNeeded = 1;
- return true;
-}
-
-wstring SpeexStream::getPinName() {
- wstring locName = L"Speex Out";
- return locName;
-}
-
-bool SpeexStream::createFormatBlock() {
- mSpeexFormatBlock = new sSpeexFormatBlock;
- //Fix the format block data... use header version and other version.
- mSpeexFormatBlock->speexVersion = iLE_Math::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 28);
- mSpeexFormatBlock->numChannels = iLE_Math::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 48);
- mSpeexFormatBlock->samplesPerSec = iLE_Math::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 36);
- return true;
-}
-BYTE* SpeexStream::getFormatBlock() {
-
- return (BYTE*)mSpeexFormatBlock;
-
-
-}
-
-void SpeexStream::setLastEndGranPos(__int64 inPos) {
-
- mLastEndGranulePos = (inPos * (__int64)mSpeexFormatBlock->samplesPerSec)/ UNITS;
- //osDebug<<"Speex sets End Gran : "<<mLastEndGranulePos<<endl;
-}
-unsigned long SpeexStream::getFormatBlockSize() {
- //Do something
- return sizeof(sSpeexFormatBlock);
-}
-GUID SpeexStream::getFormatGUID() {
- return FORMAT_Speex;
-}
-GUID SpeexStream::getSubtypeGUID() {
- return MEDIASUBTYPE_Speex;
-}
-
-GUID SpeexStream::getMajorTypeGUID() {
- return MEDIATYPE_Audio;
-}
-
-LONGLONG SpeexStream::getCurrentPos() {
- return (mLastEndGranulePos * UNITS) / mSpeexFormatBlock->samplesPerSec;
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "speexstream.h"
+
+SpeexStream::SpeexStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek)
+ : OggStream(inBOSPage, inOwningFilter, inAllowSeek)
+ , mSpeexFormatBlock(NULL)
+{
+ InitCodec(inBOSPage->getStampedPacket(0));
+}
+
+SpeexStream::~SpeexStream(void)
+{
+ delete mSpeexFormatBlock;
+}
+
+bool SpeexStream::InitCodec(StampedOggPacket* inOggPacket) {
+ //Can probably abstract this out of here too !
+ mCodecHeaders = new StreamHeaders;
+ mCodecHeaders->mCodecType = StreamHeaders::SPEEX;
+ mCodecHeaders->addPacket((StampedOggPacket*)inOggPacket->clone());
+ //What to do with commment fields ??
+ mNumHeadersNeeded = 1;
+ return true;
+}
+
+wstring SpeexStream::getPinName() {
+ wstring locName = L"Speex Out";
+ return locName;
+}
+
+bool SpeexStream::createFormatBlock() {
+ mSpeexFormatBlock = new sSpeexFormatBlock;
+ //Fix the format block data... use header version and other version.
+ mSpeexFormatBlock->speexVersion = iLE_Math::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 28);
+ mSpeexFormatBlock->numChannels = iLE_Math::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 48);
+ mSpeexFormatBlock->samplesPerSec = iLE_Math::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 36);
+ return true;
+}
+BYTE* SpeexStream::getFormatBlock() {
+
+ return (BYTE*)mSpeexFormatBlock;
+
+
+}
+
+void SpeexStream::setLastEndGranPos(__int64 inPos) {
+
+ mLastEndGranulePos = (inPos * (__int64)mSpeexFormatBlock->samplesPerSec)/ UNITS;
+ //osDebug<<"Speex sets End Gran : "<<mLastEndGranulePos<<endl;
+}
+unsigned long SpeexStream::getFormatBlockSize() {
+ //Do something
+ return sizeof(sSpeexFormatBlock);
+}
+GUID SpeexStream::getFormatGUID() {
+ return FORMAT_Speex;
+}
+GUID SpeexStream::getSubtypeGUID() {
+ return MEDIASUBTYPE_Speex;
+}
+
+GUID SpeexStream::getMajorTypeGUID() {
+ return MEDIATYPE_Audio;
+}
+
+LONGLONG SpeexStream::getCurrentPos() {
+ return (mLastEndGranulePos * UNITS) / mSpeexFormatBlock->samplesPerSec;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SpeexStream.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SpeexStream.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SpeexStream.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SpeexStream.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,59 +1,59 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include "oggdllstuff.h"
-
-#include "OggPage.h"
-#include "OggPacket.h"
-class OggStream;
-class SpeexStream
- : public OggStream
-{
-public:
- SpeexStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
- virtual ~SpeexStream(void);
-
- virtual bool InitCodec(StampedOggPacket* inOggPacket);
-
- virtual BYTE* getFormatBlock() ;
- virtual unsigned long getFormatBlockSize();
- virtual GUID getFormatGUID();
- virtual GUID getSubtypeGUID();
- virtual wstring getPinName();
- virtual bool createFormatBlock();
- virtual GUID getMajorTypeGUID();
- virtual LONGLONG getCurrentPos();
-
- virtual void setLastEndGranPos(__int64 inPos);
-
-protected:
- sSpeexFormatBlock* mSpeexFormatBlock;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+#include "oggdllstuff.h"
+
+#include "OggPage.h"
+#include "OggPacket.h"
+class OggStream;
+class SpeexStream
+ : public OggStream
+{
+public:
+ SpeexStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
+ virtual ~SpeexStream(void);
+
+ virtual bool InitCodec(StampedOggPacket* inOggPacket);
+
+ virtual BYTE* getFormatBlock() ;
+ virtual unsigned long getFormatBlockSize();
+ virtual GUID getFormatGUID();
+ virtual GUID getSubtypeGUID();
+ virtual wstring getPinName();
+ virtual bool createFormatBlock();
+ virtual GUID getMajorTypeGUID();
+ virtual LONGLONG getCurrentPos();
+
+ virtual void setLastEndGranPos(__int64 inPos);
+
+protected:
+ sSpeexFormatBlock* mSpeexFormatBlock;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/SpeexStream.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/StreamHeaders.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/StreamHeaders.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/StreamHeaders.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,75 +1,75 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "streamheaders.h"
-
-StreamHeaders::StreamHeaders(void)
- : mCodecType(NONE)
-{
-}
-
-StreamHeaders::~StreamHeaders(void)
-{
- for(unsigned long i = 0; i < mPacketList.size(); i ++) {
- delete mPacketList[i];
- }
-}
-
-StampedOggPacket* StreamHeaders::getPacket(unsigned long inPacketNo) {
- if (inPacketNo < mPacketList.size()) {
- StampedOggPacket* loc = mPacketList[inPacketNo];
- return loc;
- } else {
- return NULL;
- }
-}
-
-unsigned long StreamHeaders::numPackets() {
- return (unsigned long)mPacketList.size();
-}
-
-
-bool StreamHeaders::addPacket(StampedOggPacket* inPacket) {
- if (inPacket != NULL) {
- mPacketList.push_back(inPacket);
-
- //This is debugging code !
- StampedOggPacket* loc = NULL;
- for (size_t i = 0; i < mPacketList.size(); i++) {
- loc = mPacketList[i];
- }
- //
-
- return true;
- } else {
- return false;
- }
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "streamheaders.h"
+
+StreamHeaders::StreamHeaders(void)
+ : mCodecType(NONE)
+{
+}
+
+StreamHeaders::~StreamHeaders(void)
+{
+ for(unsigned long i = 0; i < mPacketList.size(); i ++) {
+ delete mPacketList[i];
+ }
+}
+
+StampedOggPacket* StreamHeaders::getPacket(unsigned long inPacketNo) {
+ if (inPacketNo < mPacketList.size()) {
+ StampedOggPacket* loc = mPacketList[inPacketNo];
+ return loc;
+ } else {
+ return NULL;
+ }
+}
+
+unsigned long StreamHeaders::numPackets() {
+ return (unsigned long)mPacketList.size();
+}
+
+
+bool StreamHeaders::addPacket(StampedOggPacket* inPacket) {
+ if (inPacket != NULL) {
+ mPacketList.push_back(inPacket);
+
+ //This is debugging code !
+ StampedOggPacket* loc = NULL;
+ for (size_t i = 0; i < mPacketList.size(); i++) {
+ loc = mPacketList[i];
+ }
+ //
+
+ return true;
+ } else {
+ return false;
+ }
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/StreamHeaders.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/StreamHeaders.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/StreamHeaders.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/StreamHeaders.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,73 +1,73 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-
-#include "oggdllstuff.h"
-
-#include <IOggPackSource.h>
-#include <StampedOggPacket.h>
-//This holds the preliminary headers for a logical stream... then the output pins of the demux can give them to the codec at their leisure.
-//The demux will never present these headers again... seeking to the start of the file will seek to the start
-//of the data. ie the first page after the headers.
-
-//More than likely though, you'll have to parse them yourself in the output pin(demuxer) if you want to be able to connect up the codec filter to
-//something like the directshow audio renderer... it won't connect unless it knows the sample rate etc... and it
-//can't be streamed this data without connecting the filter.
-
-//If the codec needs them again... you have to sort it out from the output pin. The codec should remember !
-
-class OGG_DEMUX_API StreamHeaders
- : public IOggPackSource
-{
-public:
- StreamHeaders(void);
- virtual ~StreamHeaders(void);
-
- enum eCodecType {
- NONE = 0,
- VORBIS = 1,
- SPEEX = 2,
- FLAC = 3,
- THEORA = 4,
- OGG_FLAC_1_0 = 5,
- CMML = 20,
- FFDSHOW_VIDEO = 100
- };
- //IOggPacketSource
- virtual StampedOggPacket* getPacket(unsigned long inPacketNo);
- virtual unsigned long numPackets();
- eCodecType mCodecType;
-
- //Other
- bool addPacket(StampedOggPacket* inPacket);
-protected:
- vector<StampedOggPacket*> mPacketList;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+
+#include "oggdllstuff.h"
+
+#include <IOggPackSource.h>
+#include <StampedOggPacket.h>
+//This holds the preliminary headers for a logical stream... then the output pins of the demux can give them to the codec at their leisure.
+//The demux will never present these headers again... seeking to the start of the file will seek to the start
+//of the data. ie the first page after the headers.
+
+//More than likely though, you'll have to parse them yourself in the output pin(demuxer) if you want to be able to connect up the codec filter to
+//something like the directshow audio renderer... it won't connect unless it knows the sample rate etc... and it
+//can't be streamed this data without connecting the filter.
+
+//If the codec needs them again... you have to sort it out from the output pin. The codec should remember !
+
+class OGG_DEMUX_API StreamHeaders
+ : public IOggPackSource
+{
+public:
+ StreamHeaders(void);
+ virtual ~StreamHeaders(void);
+
+ enum eCodecType {
+ NONE = 0,
+ VORBIS = 1,
+ SPEEX = 2,
+ FLAC = 3,
+ THEORA = 4,
+ OGG_FLAC_1_0 = 5,
+ CMML = 20,
+ FFDSHOW_VIDEO = 100
+ };
+ //IOggPacketSource
+ virtual StampedOggPacket* getPacket(unsigned long inPacketNo);
+ virtual unsigned long numPackets();
+ eCodecType mCodecType;
+
+ //Other
+ bool addPacket(StampedOggPacket* inPacket);
+protected:
+ vector<StampedOggPacket*> mPacketList;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/StreamHeaders.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/StreamMapper.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/StreamMapper.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/StreamMapper.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,10 +1,10 @@
-#include "StdAfx.h"
-#include "streammapper.h"
-
-StreamMapper::StreamMapper(void)
-{
-}
-
-StreamMapper::~StreamMapper(void)
-{
-}
+#include "StdAfx.h"
+#include "streammapper.h"
+
+StreamMapper::StreamMapper(void)
+{
+}
+
+StreamMapper::~StreamMapper(void)
+{
+}
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/StreamMapper.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/StreamMapper.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/TheoraStream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/TheoraStream.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/TheoraStream.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,125 +1,125 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "theorastream.h"
-
-TheoraStream::TheoraStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek)
- : OggStream(inBOSPage, inOwningFilter, inAllowSeek)
- , mTheoraFormatBlock(NULL)
-{
- InitCodec(inBOSPage->getStampedPacket(0));
- //debugLog.open("G:\\logs\\theorastream.log", ios_base::out);
-}
-
-TheoraStream::~TheoraStream(void)
-{
- delete mTheoraFormatBlock;
-}
-
-bool TheoraStream::InitCodec(StampedOggPacket* inOggPacket) {
- //Can probably abstract this out of here too !
- mCodecHeaders = new StreamHeaders;
- mCodecHeaders->mCodecType = StreamHeaders::THEORA;
- mCodecHeaders->addPacket((StampedOggPacket*)inOggPacket->clone());
- //What to do with commment fields ??
- mNumHeadersNeeded = 2;
- return true;
-}
-
-wstring TheoraStream::getPinName() {
- wstring locName = L"Theora Out";
- return locName;
-}
-
-bool TheoraStream::createFormatBlock() {
- mTheoraFormatBlock = new sTheoraFormatBlock;
- //Fix the format block data... use header version and other version.
- unsigned char* locIdentHeader = mCodecHeaders->getPacket(0)->packetData();
- //mTheoraFormatBlock->TheoraVersion = OggMath::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 28);
- //mTheoraFormatBlock->numChannels = OggMath::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 48);
- //mTheoraFormatBlock->samplesPerSec = OggMath::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 36);
-
- mTheoraFormatBlock->theoraVersion = (iBE_Math::charArrToULong(locIdentHeader + 7)) >>8;
- mTheoraFormatBlock->width = (iBE_Math::charArrToUShort(locIdentHeader + 10)) * 16;
- mTheoraFormatBlock->height = (iBE_Math::charArrToUShort(locIdentHeader + 12)) * 16;
- mTheoraFormatBlock->frameWidth = (iBE_Math::charArrToULong(locIdentHeader + 14)) >>8;
- mTheoraFormatBlock->frameHeight = (iBE_Math::charArrToULong(locIdentHeader + 17)) >>8;
- mTheoraFormatBlock->xOffset = locIdentHeader[20];
- mTheoraFormatBlock->yOffset = locIdentHeader[21];
- mTheoraFormatBlock->frameRateNumerator = iBE_Math::charArrToULong(locIdentHeader + 22);
- mTheoraFormatBlock->frameRateDenominator = iBE_Math::charArrToULong(locIdentHeader + 26);
- mTheoraFormatBlock->aspectNumerator = (iBE_Math::charArrToULong(locIdentHeader + 30)) >>8;
- mTheoraFormatBlock->aspectDenominator = (iBE_Math::charArrToULong(locIdentHeader + 33)) >>8;
- mTheoraFormatBlock->colourSpace = locIdentHeader[36];
- mTheoraFormatBlock->targetBitrate = (iBE_Math::charArrToULong(locIdentHeader + 37)) >>8;
- mTheoraFormatBlock->targetQuality = (locIdentHeader[40]) >> 2;
-
- mTheoraFormatBlock->maxKeyframeInterval= (((locIdentHeader[40]) % 4) << 3) + (locIdentHeader[41] >> 5);
-
- return true;
-}
-
-void TheoraStream::setLastEndGranPos(__int64 inPos) {
- //debugLog<<"Theora inPos: "<<inPos<<endl;
- LONGLONG locFrameDuration = (UNITS * mTheoraFormatBlock->frameRateDenominator) / (mTheoraFormatBlock->frameRateNumerator);
-
- LONGLONG locAbsFramePos = inPos / locFrameDuration;
- //Timestamp hacks start here...
- unsigned long locMod = (unsigned long)pow(2, mTheoraFormatBlock->maxKeyframeInterval);
- mLastEndGranulePos = ((locAbsFramePos/locMod) << mTheoraFormatBlock->maxKeyframeInterval) + (locAbsFramePos % locMod);
- //unsigned long locInterFrameNo = (mLastSeenStartGranPos) % locMod);
- //LONGLONG locAbsFramePos = ((mLastSeenStartGranPos >> locFilter->mTheoraFormatInfo->maxKeyframeInterval) * locMod) + locInterFrameNo;
- //REFERENCE_TIME locTimeBase = ((locAbsFramePos * mFrameDuration) - locThis->mSeekTimeBase;
- //mLastEndGranulePos = (inPos * (__int64)mSpeexFormatBlock->samplesPerSec)/ UNITS;
- //debugLog<<"Theora sets End Gran : "<<mLastEndGranulePos<<endl;
-}
-BYTE* TheoraStream::getFormatBlock() {
-
- return (BYTE*)mTheoraFormatBlock;
-}
-
-GUID TheoraStream::getMajorTypeGUID() {
- return MEDIATYPE_Video;
-}
-unsigned long TheoraStream::getFormatBlockSize() {
- //Do something
- return sizeof(sTheoraFormatBlock);
-}
-GUID TheoraStream::getFormatGUID() {
- return FORMAT_Theora;
-}
-GUID TheoraStream::getSubtypeGUID() {
- return MEDIASUBTYPE_Theora;
-}
-
-LONGLONG TheoraStream::getCurrentPos() {
- return 0; //(mLastGranulePos * UNITS) / mVorbisFormatBlock->samplesPerSec;
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "theorastream.h"
+
+TheoraStream::TheoraStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek)
+ : OggStream(inBOSPage, inOwningFilter, inAllowSeek)
+ , mTheoraFormatBlock(NULL)
+{
+ InitCodec(inBOSPage->getStampedPacket(0));
+ //debugLog.open("G:\\logs\\theorastream.log", ios_base::out);
+}
+
+TheoraStream::~TheoraStream(void)
+{
+ delete mTheoraFormatBlock;
+}
+
+bool TheoraStream::InitCodec(StampedOggPacket* inOggPacket) {
+ //Can probably abstract this out of here too !
+ mCodecHeaders = new StreamHeaders;
+ mCodecHeaders->mCodecType = StreamHeaders::THEORA;
+ mCodecHeaders->addPacket((StampedOggPacket*)inOggPacket->clone());
+ //What to do with commment fields ??
+ mNumHeadersNeeded = 2;
+ return true;
+}
+
+wstring TheoraStream::getPinName() {
+ wstring locName = L"Theora Out";
+ return locName;
+}
+
+bool TheoraStream::createFormatBlock() {
+ mTheoraFormatBlock = new sTheoraFormatBlock;
+ //Fix the format block data... use header version and other version.
+ unsigned char* locIdentHeader = mCodecHeaders->getPacket(0)->packetData();
+ //mTheoraFormatBlock->TheoraVersion = OggMath::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 28);
+ //mTheoraFormatBlock->numChannels = OggMath::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 48);
+ //mTheoraFormatBlock->samplesPerSec = OggMath::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 36);
+
+ mTheoraFormatBlock->theoraVersion = (iBE_Math::charArrToULong(locIdentHeader + 7)) >>8;
+ mTheoraFormatBlock->width = (iBE_Math::charArrToUShort(locIdentHeader + 10)) * 16;
+ mTheoraFormatBlock->height = (iBE_Math::charArrToUShort(locIdentHeader + 12)) * 16;
+ mTheoraFormatBlock->frameWidth = (iBE_Math::charArrToULong(locIdentHeader + 14)) >>8;
+ mTheoraFormatBlock->frameHeight = (iBE_Math::charArrToULong(locIdentHeader + 17)) >>8;
+ mTheoraFormatBlock->xOffset = locIdentHeader[20];
+ mTheoraFormatBlock->yOffset = locIdentHeader[21];
+ mTheoraFormatBlock->frameRateNumerator = iBE_Math::charArrToULong(locIdentHeader + 22);
+ mTheoraFormatBlock->frameRateDenominator = iBE_Math::charArrToULong(locIdentHeader + 26);
+ mTheoraFormatBlock->aspectNumerator = (iBE_Math::charArrToULong(locIdentHeader + 30)) >>8;
+ mTheoraFormatBlock->aspectDenominator = (iBE_Math::charArrToULong(locIdentHeader + 33)) >>8;
+ mTheoraFormatBlock->colourSpace = locIdentHeader[36];
+ mTheoraFormatBlock->targetBitrate = (iBE_Math::charArrToULong(locIdentHeader + 37)) >>8;
+ mTheoraFormatBlock->targetQuality = (locIdentHeader[40]) >> 2;
+
+ mTheoraFormatBlock->maxKeyframeInterval= (((locIdentHeader[40]) % 4) << 3) + (locIdentHeader[41] >> 5);
+
+ return true;
+}
+
+void TheoraStream::setLastEndGranPos(__int64 inPos) {
+ //debugLog<<"Theora inPos: "<<inPos<<endl;
+ LONGLONG locFrameDuration = (UNITS * mTheoraFormatBlock->frameRateDenominator) / (mTheoraFormatBlock->frameRateNumerator);
+
+ LONGLONG locAbsFramePos = inPos / locFrameDuration;
+ //Timestamp hacks start here...
+ unsigned long locMod = (unsigned long)pow(2, mTheoraFormatBlock->maxKeyframeInterval);
+ mLastEndGranulePos = ((locAbsFramePos/locMod) << mTheoraFormatBlock->maxKeyframeInterval) + (locAbsFramePos % locMod);
+ //unsigned long locInterFrameNo = (mLastSeenStartGranPos) % locMod);
+ //LONGLONG locAbsFramePos = ((mLastSeenStartGranPos >> locFilter->mTheoraFormatInfo->maxKeyframeInterval) * locMod) + locInterFrameNo;
+ //REFERENCE_TIME locTimeBase = ((locAbsFramePos * mFrameDuration) - locThis->mSeekTimeBase;
+ //mLastEndGranulePos = (inPos * (__int64)mSpeexFormatBlock->samplesPerSec)/ UNITS;
+ //debugLog<<"Theora sets End Gran : "<<mLastEndGranulePos<<endl;
+}
+BYTE* TheoraStream::getFormatBlock() {
+
+ return (BYTE*)mTheoraFormatBlock;
+}
+
+GUID TheoraStream::getMajorTypeGUID() {
+ return MEDIATYPE_Video;
+}
+unsigned long TheoraStream::getFormatBlockSize() {
+ //Do something
+ return sizeof(sTheoraFormatBlock);
+}
+GUID TheoraStream::getFormatGUID() {
+ return FORMAT_Theora;
+}
+GUID TheoraStream::getSubtypeGUID() {
+ return MEDIASUBTYPE_Theora;
+}
+
+LONGLONG TheoraStream::getCurrentPos() {
+ return 0; //(mLastGranulePos * UNITS) / mVorbisFormatBlock->samplesPerSec;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/TheoraStream.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/TheoraStream.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/TheoraStream.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/TheoraStream.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,61 +1,61 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-
-#include "oggdllstuff.h"
-//#include "FLACMath.h"
-#include "OggPage.h"
-#include "OggPacket.h"
-
-class OggStream;
-class TheoraStream
- : public OggStream
-{
-public:
- TheoraStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
- virtual ~TheoraStream(void);
-
- virtual bool InitCodec(StampedOggPacket* inOggPacket);
-
- virtual BYTE* getFormatBlock() ;
- virtual unsigned long getFormatBlockSize();
- virtual GUID getFormatGUID();
- virtual GUID getSubtypeGUID();
- virtual wstring getPinName();
- virtual bool createFormatBlock();
- virtual GUID getMajorTypeGUID();
- virtual LONGLONG getCurrentPos();
-
-
- virtual void setLastEndGranPos(__int64 inPos);
-protected:
- sTheoraFormatBlock* mTheoraFormatBlock;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+
+#include "oggdllstuff.h"
+//#include "FLACMath.h"
+#include "OggPage.h"
+#include "OggPacket.h"
+
+class OggStream;
+class TheoraStream
+ : public OggStream
+{
+public:
+ TheoraStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
+ virtual ~TheoraStream(void);
+
+ virtual bool InitCodec(StampedOggPacket* inOggPacket);
+
+ virtual BYTE* getFormatBlock() ;
+ virtual unsigned long getFormatBlockSize();
+ virtual GUID getFormatGUID();
+ virtual GUID getSubtypeGUID();
+ virtual wstring getPinName();
+ virtual bool createFormatBlock();
+ virtual GUID getMajorTypeGUID();
+ virtual LONGLONG getCurrentPos();
+
+
+ virtual void setLastEndGranPos(__int64 inPos);
+protected:
+ sTheoraFormatBlock* mTheoraFormatBlock;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/TheoraStream.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/VorbisStream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/VorbisStream.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/VorbisStream.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,98 +1,98 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "vorbisstream.h"
-
-VorbisStream::VorbisStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek)
- : OggStream(inBOSPage, inOwningFilter, inAllowSeek)
- , mVorbisFormatBlock(NULL)
-{
- InitCodec(inBOSPage->getStampedPacket(0));
- //debugLog.open("G:\\logs\\vorbisstream.log", ios_base::out);
-}
-
-VorbisStream::~VorbisStream(void)
-{
- delete mVorbisFormatBlock;
-}
-
-
-bool VorbisStream::InitCodec(StampedOggPacket* inOggPacket) {
- mCodecHeaders = new StreamHeaders;
- mCodecHeaders->mCodecType = StreamHeaders::VORBIS;
- mCodecHeaders->addPacket((StampedOggPacket*)inOggPacket->clone());
- mNumHeadersNeeded = 2;
- return true;
-}
-
-BYTE* VorbisStream::getFormatBlock() {
-
- return (BYTE*)mVorbisFormatBlock;
-
-}
-bool VorbisStream::createFormatBlock() {
- //Check where this gets deleted
- mVorbisFormatBlock = new sVorbisFormatBlock;
- mVorbisFormatBlock->vorbisVersion = iLE_Math::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 7);
- mVorbisFormatBlock->numChannels = mCodecHeaders->getPacket(0)->packetData()[11];
- mVorbisFormatBlock->samplesPerSec = iLE_Math::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 12);
- mVorbisFormatBlock->maxBitsPerSec = iLE_Math::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 16);
- mVorbisFormatBlock->avgBitsPerSec = iLE_Math::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 20);
- mVorbisFormatBlock->minBitsPerSec = iLE_Math::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 24);
-
- return true;
-}
-
-void VorbisStream::setLastEndGranPos(__int64 inPos) {
- //debugLog<<"Vorbis inPos = "<<inPos<<endl;
- mLastEndGranulePos = (inPos * (__int64)mVorbisFormatBlock->samplesPerSec)/ UNITS;
- //debugLog<<"Vorbis sets End Gran : "<<mLastEndGranulePos<<endl;
-}
-unsigned long VorbisStream::getFormatBlockSize() {
- return sizeof(sVorbisFormatBlock);
-}
-GUID VorbisStream::getFormatGUID() {
- return FORMAT_Vorbis;
-}
-GUID VorbisStream::getSubtypeGUID() {
- return MEDIASUBTYPE_Vorbis;
-}
-wstring VorbisStream::getPinName() {
- wstring retName = L"Vorbis Out";
- return retName;
-}
-GUID VorbisStream::getMajorTypeGUID() {
- return MEDIATYPE_Audio;
-}
-
-LONGLONG VorbisStream::getCurrentPos() {
- return (mLastEndGranulePos * UNITS) / mVorbisFormatBlock->samplesPerSec;
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "vorbisstream.h"
+
+VorbisStream::VorbisStream(OggPage* inBOSPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek)
+ : OggStream(inBOSPage, inOwningFilter, inAllowSeek)
+ , mVorbisFormatBlock(NULL)
+{
+ InitCodec(inBOSPage->getStampedPacket(0));
+ //debugLog.open("G:\\logs\\vorbisstream.log", ios_base::out);
+}
+
+VorbisStream::~VorbisStream(void)
+{
+ delete mVorbisFormatBlock;
+}
+
+
+bool VorbisStream::InitCodec(StampedOggPacket* inOggPacket) {
+ mCodecHeaders = new StreamHeaders;
+ mCodecHeaders->mCodecType = StreamHeaders::VORBIS;
+ mCodecHeaders->addPacket((StampedOggPacket*)inOggPacket->clone());
+ mNumHeadersNeeded = 2;
+ return true;
+}
+
+BYTE* VorbisStream::getFormatBlock() {
+
+ return (BYTE*)mVorbisFormatBlock;
+
+}
+bool VorbisStream::createFormatBlock() {
+ //Check where this gets deleted
+ mVorbisFormatBlock = new sVorbisFormatBlock;
+ mVorbisFormatBlock->vorbisVersion = iLE_Math::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 7);
+ mVorbisFormatBlock->numChannels = mCodecHeaders->getPacket(0)->packetData()[11];
+ mVorbisFormatBlock->samplesPerSec = iLE_Math::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 12);
+ mVorbisFormatBlock->maxBitsPerSec = iLE_Math::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 16);
+ mVorbisFormatBlock->avgBitsPerSec = iLE_Math::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 20);
+ mVorbisFormatBlock->minBitsPerSec = iLE_Math::charArrToULong(mCodecHeaders->getPacket(0)->packetData() + 24);
+
+ return true;
+}
+
+void VorbisStream::setLastEndGranPos(__int64 inPos) {
+ //debugLog<<"Vorbis inPos = "<<inPos<<endl;
+ mLastEndGranulePos = (inPos * (__int64)mVorbisFormatBlock->samplesPerSec)/ UNITS;
+ //debugLog<<"Vorbis sets End Gran : "<<mLastEndGranulePos<<endl;
+}
+unsigned long VorbisStream::getFormatBlockSize() {
+ return sizeof(sVorbisFormatBlock);
+}
+GUID VorbisStream::getFormatGUID() {
+ return FORMAT_Vorbis;
+}
+GUID VorbisStream::getSubtypeGUID() {
+ return MEDIASUBTYPE_Vorbis;
+}
+wstring VorbisStream::getPinName() {
+ wstring retName = L"Vorbis Out";
+ return retName;
+}
+GUID VorbisStream::getMajorTypeGUID() {
+ return MEDIATYPE_Audio;
+}
+
+LONGLONG VorbisStream::getCurrentPos() {
+ return (mLastEndGranulePos * UNITS) / mVorbisFormatBlock->samplesPerSec;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/VorbisStream.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/VorbisStream.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/VorbisStream.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/VorbisStream.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,63 +1,63 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-
-#include "oggdllstuff.h"
-#include "ds_guids.h"
-#include "OggPacket.h"
-#include "OggPage.h"
-#include "OggStream.h"
-class OggStream;
-class OggDemuxSourceFilter;
-
-class VorbisStream
- : public OggStream
-{
-public:
- VorbisStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
- virtual ~VorbisStream(void);
-
- virtual bool InitCodec(StampedOggPacket* inOggPacket);
- void setLastEndGranPos(__int64 inPos);
-
- virtual BYTE* getFormatBlock() ;
- virtual unsigned long getFormatBlockSize();
- virtual GUID getFormatGUID();
- virtual GUID getSubtypeGUID();
- virtual wstring getPinName();
- virtual bool createFormatBlock();
- virtual GUID getMajorTypeGUID();
- virtual LONGLONG getCurrentPos();
-
-
-protected:
- sVorbisFormatBlock* mVorbisFormatBlock;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+
+#include "oggdllstuff.h"
+#include "ds_guids.h"
+#include "OggPacket.h"
+#include "OggPage.h"
+#include "OggStream.h"
+class OggStream;
+class OggDemuxSourceFilter;
+
+class VorbisStream
+ : public OggStream
+{
+public:
+ VorbisStream(OggPage* inOggPage, OggDemuxSourceFilter* inOwningFilter, bool inAllowSeek);
+ virtual ~VorbisStream(void);
+
+ virtual bool InitCodec(StampedOggPacket* inOggPacket);
+ void setLastEndGranPos(__int64 inPos);
+
+ virtual BYTE* getFormatBlock() ;
+ virtual unsigned long getFormatBlockSize();
+ virtual GUID getFormatGUID();
+ virtual GUID getSubtypeGUID();
+ virtual wstring getPinName();
+ virtual bool createFormatBlock();
+ virtual GUID getMajorTypeGUID();
+ virtual LONGLONG getCurrentPos();
+
+
+protected:
+ sVorbisFormatBlock* mVorbisFormatBlock;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/VorbisStream.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/ds_guids.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/ds_guids.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/ds_guids.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,105 +1,105 @@
-#pragma once
-
-// {4BB64C4A-1674-436b-A49D-D6B3B64DBD60}
-DEFINE_GUID(CLSID_PropsAbout,
-0x4bb64c4a, 0x1674, 0x436b, 0xa4, 0x9d, 0xd6, 0xb3, 0xb6, 0x4d, 0xbd, 0x60);
-
-//New section
-// {31CA0186-1FF0-4181-AA38-3CA4040BD260}
-DEFINE_GUID(CLSID_OggDemuxSourceFilter,
-0x31ca0186, 0x1ff0, 0x4181, 0xaa, 0x38, 0x3c, 0xa4, 0x4, 0xb, 0xd2, 0x60);
-
-// {3913F0AB-E7ED-41c4-979B-1D1FDD983C07}
-DEFINE_GUID(MEDIASUBTYPE_FLAC,
-0x3913f0ab, 0xe7ed, 0x41c4, 0x97, 0x9b, 0x1d, 0x1f, 0xdd, 0x98, 0x3c, 0x7);
-
-
-// {8A0566AC-42B3-4ad9-ACA3-93B906DDF98A}
-DEFINE_GUID(MEDIASUBTYPE_Vorbis,
-0x8a0566ac, 0x42b3, 0x4ad9, 0xac, 0xa3, 0x93, 0xb9, 0x6, 0xdd, 0xf9, 0x8a);
-
-// {25A9729D-12F6-420e-BD53-1D631DC217DF}
-DEFINE_GUID(MEDIASUBTYPE_Speex,
-0x25a9729d, 0x12f6, 0x420e, 0xbd, 0x53, 0x1d, 0x63, 0x1d, 0xc2, 0x17, 0xdf);
-
-// {44E04F43-58B3-4de1-9BAA-8901F852DAE4}
-DEFINE_GUID(FORMAT_Vorbis,
-0x44e04f43, 0x58b3, 0x4de1, 0x9b, 0xaa, 0x89, 0x1, 0xf8, 0x52, 0xda, 0xe4);
-
-// {78701A27-EFB5-4157-9553-38A7854E3E81}
-DEFINE_GUID(FORMAT_Speex,
-0x78701a27, 0xefb5, 0x4157, 0x95, 0x53, 0x38, 0xa7, 0x85, 0x4e, 0x3e, 0x81);
-
-// {1CDC48AC-4C24-4b8b-982B-7007A29D83C4}
-DEFINE_GUID(FORMAT_FLAC,
-0x1cdc48ac, 0x4c24, 0x4b8b, 0x98, 0x2b, 0x70, 0x7, 0xa2, 0x9d, 0x83, 0xc4);
-
-
-// {05187161-5C36-4324-A734-22BF37509F2D}
-DEFINE_GUID(CLSID_TheoraDecodeFilter,
-0x5187161, 0x5c36, 0x4324, 0xa7, 0x34, 0x22, 0xbf, 0x37, 0x50, 0x9f, 0x2d);
-
-// {D124B2B1-8968-4ae8-B288-FE16EA34B0CE}
-DEFINE_GUID(MEDIASUBTYPE_Theora,
-0xd124b2b1, 0x8968, 0x4ae8, 0xb2, 0x88, 0xfe, 0x16, 0xea, 0x34, 0xb0, 0xce);
-
-// {A99F116C-DFFA-412c-95DE-725F99874826}
-DEFINE_GUID(FORMAT_Theora,
-0xa99f116c, 0xdffa, 0x412c, 0x95, 0xde, 0x72, 0x5f, 0x99, 0x87, 0x48, 0x26);
-
-//This structure defines the type of input we accept on the input pin... Stream/Annodex
-
-
-//Structure defining the registration details of the filter
-const REGFILTER2 OggDemuxSourceFilterReg = {
- 1,
- MERIT_NORMAL,
- 0,
- NULL
-
-};
-
-
-struct sVorbisFormatBlock {
- unsigned long vorbisVersion;
- unsigned long samplesPerSec;
- unsigned long minBitsPerSec;
- unsigned long avgBitsPerSec;
- unsigned long maxBitsPerSec;
- unsigned char numChannels;
-};
-
-struct sSpeexFormatBlock {
- unsigned long speexVersion;
- unsigned long samplesPerSec;
- unsigned long minBitsPerSec;
- unsigned long avgBitsPerSec;
- unsigned long maxBitsPerSec;
- unsigned long numChannels;
-
-};
-
-struct sFLACFormatBlock {
- unsigned short numChannels;
- unsigned long numBitsPerSample;
- unsigned long samplesPerSec;
-
-};
-
-struct sTheoraFormatBlock {
- unsigned long theoraVersion;
- unsigned long width;
- unsigned long height;
- unsigned long frameWidth;
- unsigned long frameHeight;
- unsigned long frameRateNumerator;
- unsigned long frameRateDenominator;
- unsigned long aspectNumerator;
- unsigned long aspectDenominator;
- unsigned long maxKeyframeInterval;
- unsigned long targetBitrate;
- unsigned char targetQuality;
- unsigned char xOffset;
- unsigned char yOffset;
- unsigned char colourSpace;
+#pragma once
+
+// {4BB64C4A-1674-436b-A49D-D6B3B64DBD60}
+DEFINE_GUID(CLSID_PropsAbout,
+0x4bb64c4a, 0x1674, 0x436b, 0xa4, 0x9d, 0xd6, 0xb3, 0xb6, 0x4d, 0xbd, 0x60);
+
+//New section
+// {31CA0186-1FF0-4181-AA38-3CA4040BD260}
+DEFINE_GUID(CLSID_OggDemuxSourceFilter,
+0x31ca0186, 0x1ff0, 0x4181, 0xaa, 0x38, 0x3c, 0xa4, 0x4, 0xb, 0xd2, 0x60);
+
+// {3913F0AB-E7ED-41c4-979B-1D1FDD983C07}
+DEFINE_GUID(MEDIASUBTYPE_FLAC,
+0x3913f0ab, 0xe7ed, 0x41c4, 0x97, 0x9b, 0x1d, 0x1f, 0xdd, 0x98, 0x3c, 0x7);
+
+
+// {8A0566AC-42B3-4ad9-ACA3-93B906DDF98A}
+DEFINE_GUID(MEDIASUBTYPE_Vorbis,
+0x8a0566ac, 0x42b3, 0x4ad9, 0xac, 0xa3, 0x93, 0xb9, 0x6, 0xdd, 0xf9, 0x8a);
+
+// {25A9729D-12F6-420e-BD53-1D631DC217DF}
+DEFINE_GUID(MEDIASUBTYPE_Speex,
+0x25a9729d, 0x12f6, 0x420e, 0xbd, 0x53, 0x1d, 0x63, 0x1d, 0xc2, 0x17, 0xdf);
+
+// {44E04F43-58B3-4de1-9BAA-8901F852DAE4}
+DEFINE_GUID(FORMAT_Vorbis,
+0x44e04f43, 0x58b3, 0x4de1, 0x9b, 0xaa, 0x89, 0x1, 0xf8, 0x52, 0xda, 0xe4);
+
+// {78701A27-EFB5-4157-9553-38A7854E3E81}
+DEFINE_GUID(FORMAT_Speex,
+0x78701a27, 0xefb5, 0x4157, 0x95, 0x53, 0x38, 0xa7, 0x85, 0x4e, 0x3e, 0x81);
+
+// {1CDC48AC-4C24-4b8b-982B-7007A29D83C4}
+DEFINE_GUID(FORMAT_FLAC,
+0x1cdc48ac, 0x4c24, 0x4b8b, 0x98, 0x2b, 0x70, 0x7, 0xa2, 0x9d, 0x83, 0xc4);
+
+
+// {05187161-5C36-4324-A734-22BF37509F2D}
+DEFINE_GUID(CLSID_TheoraDecodeFilter,
+0x5187161, 0x5c36, 0x4324, 0xa7, 0x34, 0x22, 0xbf, 0x37, 0x50, 0x9f, 0x2d);
+
+// {D124B2B1-8968-4ae8-B288-FE16EA34B0CE}
+DEFINE_GUID(MEDIASUBTYPE_Theora,
+0xd124b2b1, 0x8968, 0x4ae8, 0xb2, 0x88, 0xfe, 0x16, 0xea, 0x34, 0xb0, 0xce);
+
+// {A99F116C-DFFA-412c-95DE-725F99874826}
+DEFINE_GUID(FORMAT_Theora,
+0xa99f116c, 0xdffa, 0x412c, 0x95, 0xde, 0x72, 0x5f, 0x99, 0x87, 0x48, 0x26);
+
+//This structure defines the type of input we accept on the input pin... Stream/Annodex
+
+
+//Structure defining the registration details of the filter
+const REGFILTER2 OggDemuxSourceFilterReg = {
+ 1,
+ MERIT_NORMAL,
+ 0,
+ NULL
+
+};
+
+
+struct sVorbisFormatBlock {
+ unsigned long vorbisVersion;
+ unsigned long samplesPerSec;
+ unsigned long minBitsPerSec;
+ unsigned long avgBitsPerSec;
+ unsigned long maxBitsPerSec;
+ unsigned char numChannels;
+};
+
+struct sSpeexFormatBlock {
+ unsigned long speexVersion;
+ unsigned long samplesPerSec;
+ unsigned long minBitsPerSec;
+ unsigned long avgBitsPerSec;
+ unsigned long maxBitsPerSec;
+ unsigned long numChannels;
+
+};
+
+struct sFLACFormatBlock {
+ unsigned short numChannels;
+ unsigned long numBitsPerSample;
+ unsigned long samplesPerSec;
+
+};
+
+struct sTheoraFormatBlock {
+ unsigned long theoraVersion;
+ unsigned long width;
+ unsigned long height;
+ unsigned long frameWidth;
+ unsigned long frameHeight;
+ unsigned long frameRateNumerator;
+ unsigned long frameRateDenominator;
+ unsigned long aspectNumerator;
+ unsigned long aspectDenominator;
+ unsigned long maxKeyframeInterval;
+ unsigned long targetBitrate;
+ unsigned char targetQuality;
+ unsigned char xOffset;
+ unsigned char yOffset;
+ unsigned char colourSpace;
};
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/ds_guids.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/oggdllstuff.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/oggdllstuff.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/oggdllstuff.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,120 +1,120 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "oggdllstuff.h"
-#include "RegWrap.h"
-
-
-
-extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
-BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
-{
- return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
-}
-
-
-//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
-STDAPI DllRegisterServer()
-{
-
- //TO DO::: Should we be releasing the filter mapper even when we return early ?
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(TRUE);
- if (FAILED(hr)) {
-
- return hr;
- }
-
-
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
-
-
- if (FAILED(hr)) {
- return hr;
- }
-
- hr = locFilterMapper->RegisterFilter(
- CLSID_OggDemuxSourceFilter, // Filter CLSID.
- L"Ogg Demux Source Filter", // Filter name.
- NULL, // Device moniker.
- &CLSID_LegacyAmFilterCategory, // Direct Show general category
- L"Ogg Demux Source Filter", // Instance data. ???????
- &OggDemuxSourceFilterReg // Pointer to filter information.
- );
-
-
- //Only call once... if you need multiple you have to fix the hack job in RegWrap !
- RegWrap::addMediaPlayerDesc("Ogg File", "*.ogg;*.ogv;*.oga;*.spx");
- RegWrap::deleteKeyRecurse(HKEY_CLASSES_ROOT, ".OGG", "ShellEx");
-
-
-
-
-
- locFilterMapper->Release();
-
- return hr;
-
-}
-
-STDAPI DllUnregisterServer()
-{
- //This is not a general purpose function.
- RegWrap::removeMediaDesc();
-
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(FALSE);
- if (FAILED(hr)) {
-
- return hr;
- }
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
- IID_IFilterMapper2, (void **)&locFilterMapper);
-
- if (FAILED(hr)) {
- return hr;
- }
-
-
- hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory,
- L"Ogg Demux Source Filter", CLSID_OggDemuxSourceFilter);
-
- //
- locFilterMapper->Release();
- return hr;
-
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "oggdllstuff.h"
+#include "RegWrap.h"
+
+
+
+extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
+BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+ return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
+}
+
+
+//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
+STDAPI DllRegisterServer()
+{
+
+ //TO DO::: Should we be releasing the filter mapper even when we return early ?
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(TRUE);
+ if (FAILED(hr)) {
+
+ return hr;
+ }
+
+
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
+
+
+ if (FAILED(hr)) {
+ return hr;
+ }
+
+ hr = locFilterMapper->RegisterFilter(
+ CLSID_OggDemuxSourceFilter, // Filter CLSID.
+ L"Ogg Demux Source Filter", // Filter name.
+ NULL, // Device moniker.
+ &CLSID_LegacyAmFilterCategory, // Direct Show general category
+ L"Ogg Demux Source Filter", // Instance data. ???????
+ &OggDemuxSourceFilterReg // Pointer to filter information.
+ );
+
+
+ //Only call once... if you need multiple you have to fix the hack job in RegWrap !
+ RegWrap::addMediaPlayerDesc("Ogg File", "*.ogg;*.ogv;*.oga;*.spx");
+ RegWrap::deleteKeyRecurse(HKEY_CLASSES_ROOT, ".OGG", "ShellEx");
+
+
+
+
+
+ locFilterMapper->Release();
+
+ return hr;
+
+}
+
+STDAPI DllUnregisterServer()
+{
+ //This is not a general purpose function.
+ RegWrap::removeMediaDesc();
+
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(FALSE);
+ if (FAILED(hr)) {
+
+ return hr;
+ }
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
+ IID_IFilterMapper2, (void **)&locFilterMapper);
+
+ if (FAILED(hr)) {
+ return hr;
+ }
+
+
+ hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory,
+ L"Ogg Demux Source Filter", CLSID_OggDemuxSourceFilter);
+
+ //
+ locFilterMapper->Release();
+ return hr;
+
+}
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/oggdllstuff.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/oggdllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/oggdllstuff.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/oggdllstuff.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,56 +1,56 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-
-#ifndef INC_OGGDLLSTUFF
-#define INC_OGGDLLSTUFF
-#include <streams.h>
-#include <pullpin.h>
-#include <initguid.h>
-
-
-#ifdef LIBOOOGG_EXPORTS
-#define LIBOOOGG_API __declspec(dllexport)
-#else
-#define LIBOOOGG_API __declspec(dllimport)
-#endif
-
-
-#ifdef DSFOGGDEMUX_EXPORTS
-#pragma message("----> Exporting from Ogg Demux...")
-#define OGG_DEMUX_API __declspec(dllexport)
-#else
-#pragma message("<---- Importing from Ogg Demux...")
-#define OGG_DEMUX_API __declspec(dllimport)
-#endif
-
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+
+#ifndef INC_OGGDLLSTUFF
+#define INC_OGGDLLSTUFF
+#include <streams.h>
+#include <pullpin.h>
+#include <initguid.h>
+
+
+#ifdef LIBOOOGG_EXPORTS
+#define LIBOOOGG_API __declspec(dllexport)
+#else
+#define LIBOOOGG_API __declspec(dllimport)
+#endif
+
+
+#ifdef DSFOGGDEMUX_EXPORTS
+#pragma message("----> Exporting from Ogg Demux...")
+#define OGG_DEMUX_API __declspec(dllexport)
+#else
+#pragma message("<---- Importing from Ogg Demux...")
+#define OGG_DEMUX_API __declspec(dllimport)
+#endif
+
+
#endif
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/oggdllstuff.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/resource.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/resource.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/resource.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,19 +1,19 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by dsfOggDemux.rc
-//
-#define IDS_ILLI_ABOUT_STRING_TITLE 101
-#define IDS_ENGLISH_OGG_MEDIA_DESC 102
-#define IDD_ILLIMINABLE_ABOUT 106
-#define IDC_ABOUT_HEADER 1001
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 102
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1003
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by dsfOggDemux.rc
+//
+#define IDS_ILLI_ABOUT_STRING_TITLE 101
+#define IDS_ENGLISH_OGG_MEDIA_DESC 102
+#define IDD_ILLIMINABLE_ABOUT 106
+#define IDC_ABOUT_HEADER 1001
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 102
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1003
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/resource.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,40 +1,40 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-
-// stdafx.cpp : source file that includes just the standard includes
-// dsfOggDemux.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+
+// stdafx.cpp : source file that includes just the standard includes
+// dsfOggDemux.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,64 +1,64 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-// TODO: reference additional headers your program requires here
-#include <vector>
-#include <fstream>
-#include <iostream>
-using namespace std;
-
-#ifdef LIBOOOGG_EXPORTS
-#define LIBOOOGG_API __declspec(dllexport)
-#else
-#define LIBOOOGG_API __declspec(dllimport)
-#endif
-
-#include "oggdemuxsourcefilter.h"
-#include "ds_guids.h"
-#include "OggDemuxSourcePin.h"
-
-
-#include "OggStream.h"
-#include "StreamHeaders.h"
-
-
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+// TODO: reference additional headers your program requires here
+#include <vector>
+#include <fstream>
+#include <iostream>
+using namespace std;
+
+#ifdef LIBOOOGG_EXPORTS
+#define LIBOOOGG_API __declspec(dllexport)
+#else
+#define LIBOOOGG_API __declspec(dllimport)
+#endif
+
+#include "oggdemuxsourcefilter.h"
+#include "ds_guids.h"
+#include "OggDemuxSourcePin.h"
+
+
+#include "OggStream.h"
+#include "StreamHeaders.h"
+
+
+
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggDemux/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/FishSkeleton.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/FishSkeleton.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/FishSkeleton.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,115 +1,115 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include ".\fishskeleton.h"
-
-FishSkeleton::FishSkeleton(void)
-{
-}
-
-FishSkeleton::~FishSkeleton(void)
-{
-}
-OggPage* FishSkeleton::makeFishHeadBOS_3_0 ( unsigned long inSerialNo
- , unsigned short inVersionMajor
- , unsigned short inVersionMinor
- , unsigned __int64 inTimebaseNum
- , unsigned __int64 inTimebaseDenom
- , const unsigned char* inUTC
-
- )
-{
- unsigned char* locBuff = NULL;
- StampedOggPacket* locPack = NULL;
- OggPage* retPage = NULL;
- unsigned char* locSegTable = NULL;
- switch (inVersionMajor) {
- case 2:
- locBuff = new unsigned char[FishSkeleton::FISHEAD_3_0_PACKET_SIZE];
-
- // 0 - 7 fishead\0
- // 8 - 9 Version Major
- // 10 - 11 Version Minor
- // 12 - 19 Timebase Num
- // 20 - 27 Timebase Denom
- // 28 = 48 UTC
- locBuff[0] = 'f';
- locBuff[1] = 'i';
- locBuff[2] = 's';
- locBuff[3] = 'h';
- locBuff[4] = 'e';
- locBuff[5] = 'a';
- locBuff[6] = 'd';
- locBuff[7] = 0;
- iLE_Math::UShortToCharArr(inVersionMajor, locBuff + 8);
- iLE_Math::UShortToCharArr(inVersionMinor, locBuff + 10);
- iLE_Math::Int64ToCharArr(inTimebaseNum, locBuff + 12);
- iLE_Math::Int64ToCharArr(inTimebaseDenom, locBuff + 20);
- for (int i = 0; i < 20; i++) {
- locBuff[28 + i] = inUTC[i];
- }
-
- locPack = new StampedOggPacket(locBuff, FishSkeleton::FISHEAD_3_0_PACKET_SIZE, false, false, 0, 0, StampedOggPacket::OGG_END_ONLY);
-
- retPage = new OggPage;
- retPage->header()->setHeaderFlags(2);
- retPage->header()->setGranulePos((__int64)0);
- retPage->header()->setNumPageSegments( 1);
- locSegTable = new unsigned char[1];
- locSegTable[0] = FishSkeleton::FISHEAD_3_0_PACKET_SIZE;
- retPage->header()->setSegmentTable(locSegTable, 1);
- retPage->header()->setHeaderSize(28);
- retPage->header()->setDataSize(FishSkeleton::FISHEAD_3_0_PACKET_SIZE);
-
- retPage->header()->setStreamSerialNo(inSerialNo);
- retPage->addPacket(locPack);
-
- return retPage;
-
- default:
- return NULL;
-
-
- }
-}
-
- static StampedOggPacket* makeFishBone_3_0 ( unsigned __int64 inGranuleRateNum
- , unsigned __int64 inGranuleDenom
- , unsigned long inNumSecHeaders
- , unsigned short inGranuleShift
- , vector<string> inMessageHeaders
- ) {
-
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include ".\fishskeleton.h"
+
+FishSkeleton::FishSkeleton(void)
+{
+}
+
+FishSkeleton::~FishSkeleton(void)
+{
+}
+OggPage* FishSkeleton::makeFishHeadBOS_3_0 ( unsigned long inSerialNo
+ , unsigned short inVersionMajor
+ , unsigned short inVersionMinor
+ , unsigned __int64 inTimebaseNum
+ , unsigned __int64 inTimebaseDenom
+ , const unsigned char* inUTC
+
+ )
+{
+ unsigned char* locBuff = NULL;
+ StampedOggPacket* locPack = NULL;
+ OggPage* retPage = NULL;
+ unsigned char* locSegTable = NULL;
+ switch (inVersionMajor) {
+ case 2:
+ locBuff = new unsigned char[FishSkeleton::FISHEAD_3_0_PACKET_SIZE];
+
+ // 0 - 7 fishead\0
+ // 8 - 9 Version Major
+ // 10 - 11 Version Minor
+ // 12 - 19 Timebase Num
+ // 20 - 27 Timebase Denom
+ // 28 = 48 UTC
+ locBuff[0] = 'f';
+ locBuff[1] = 'i';
+ locBuff[2] = 's';
+ locBuff[3] = 'h';
+ locBuff[4] = 'e';
+ locBuff[5] = 'a';
+ locBuff[6] = 'd';
+ locBuff[7] = 0;
+ iLE_Math::UShortToCharArr(inVersionMajor, locBuff + 8);
+ iLE_Math::UShortToCharArr(inVersionMinor, locBuff + 10);
+ iLE_Math::Int64ToCharArr(inTimebaseNum, locBuff + 12);
+ iLE_Math::Int64ToCharArr(inTimebaseDenom, locBuff + 20);
+ for (int i = 0; i < 20; i++) {
+ locBuff[28 + i] = inUTC[i];
+ }
+
+ locPack = new StampedOggPacket(locBuff, FishSkeleton::FISHEAD_3_0_PACKET_SIZE, false, false, 0, 0, StampedOggPacket::OGG_END_ONLY);
+
+ retPage = new OggPage;
+ retPage->header()->setHeaderFlags(2);
+ retPage->header()->setGranulePos((__int64)0);
+ retPage->header()->setNumPageSegments( 1);
+ locSegTable = new unsigned char[1];
+ locSegTable[0] = FishSkeleton::FISHEAD_3_0_PACKET_SIZE;
+ retPage->header()->setSegmentTable(locSegTable, 1);
+ retPage->header()->setHeaderSize(28);
+ retPage->header()->setDataSize(FishSkeleton::FISHEAD_3_0_PACKET_SIZE);
+
+ retPage->header()->setStreamSerialNo(inSerialNo);
+ retPage->addPacket(locPack);
+
+ return retPage;
+
+ default:
+ return NULL;
+
+
+ }
+}
+
+ static StampedOggPacket* makeFishBone_3_0 ( unsigned __int64 inGranuleRateNum
+ , unsigned __int64 inGranuleDenom
+ , unsigned long inNumSecHeaders
+ , unsigned short inGranuleShift
+ , vector<string> inMessageHeaders
+ ) {
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/FishSkeleton.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/FishSkeleton.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/FishSkeleton.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/FishSkeleton.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,58 +1,58 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include "oggmuxdllstuff.h"
-#include "OggPage.h"
-class FishSkeleton
-{
-public:
- FishSkeleton(void);
- ~FishSkeleton(void);
-
- static const int FISHEAD_3_0_PACKET_SIZE = 48;
- static OggPage* makeFishHeadBOS_3_0 ( unsigned long inSerialNo
- , unsigned short inVersionMajor
- , unsigned short inVersionMinor
- , unsigned __int64 inTimebaseNum
- , unsigned __int64 inTimebaseDenom
- , const unsigned char* inUTC
- );
-
- static StampedOggPacket* makeFishBone_3_0 ( unsigned __int64 inGranuleRateNum
- , unsigned __int64 inGranuleDenom
- , unsigned long inNumSecHeaders
- , unsigned short inGranuleShift
- , vector<string> inMessageHeaders
- );
-};
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+#include "oggmuxdllstuff.h"
+#include "OggPage.h"
+class FishSkeleton
+{
+public:
+ FishSkeleton(void);
+ ~FishSkeleton(void);
+
+ static const int FISHEAD_3_0_PACKET_SIZE = 48;
+ static OggPage* makeFishHeadBOS_3_0 ( unsigned long inSerialNo
+ , unsigned short inVersionMajor
+ , unsigned short inVersionMinor
+ , unsigned __int64 inTimebaseNum
+ , unsigned __int64 inTimebaseDenom
+ , const unsigned char* inUTC
+ );
+
+ static StampedOggPacket* makeFishBone_3_0 ( unsigned __int64 inGranuleRateNum
+ , unsigned __int64 inGranuleDenom
+ , unsigned long inNumSecHeaders
+ , unsigned short inGranuleShift
+ , vector<string> inMessageHeaders
+ );
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/FishSkeleton.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,346 +1,346 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "oggmuxfilter.h"
-
-
-//+++++++++++++++++++++++++++++++++
-//-------------------
-// This template lets the Object factory create us properly and work with COM infrastructure.
-CFactoryTemplate g_Templates[] =
-{
- {
- L"OggMuxFilter", // Name
- &CLSID_OggMuxFilter, // CLSID
- OggMuxFilter::CreateInstance, // Method to create an instance of MyComponent
- NULL, // Initialization function
- NULL // Set-up information (for filters)
- }
-
-};
-
-// Generic way of determining the number of items in the template
-int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
-
-
-
-CUnknown* WINAPI OggMuxFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
-{
- OggMuxFilter *pNewObject = new OggMuxFilter();
- if (pNewObject == NULL) {
- *pHr = E_OUTOFMEMORY;
- }
- return pNewObject;
-}
-
-void OggMuxFilter::NotifyComplete() {
- HRESULT locHR = NotifyEvent(EC_COMPLETE, S_OK, NULL);
-
-}
-
-STDMETHODIMP OggMuxFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
- if (riid == IID_IFileSinkFilter) {
- *ppv = (IFileSinkFilter*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- } else if (riid == IID_IAMFilterMiscFlags) {
- *ppv = (IAMFilterMiscFlags*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- } else if (riid == IID_IMediaSeeking) {
- *ppv = (IMediaSeeking*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- }
-
- return CBaseFilter::NonDelegatingQueryInterface(riid, ppv);
-}
-
-ULONG OggMuxFilter::GetMiscFlags(void) {
- return AM_FILTER_MISC_FLAGS_IS_RENDERER;
-}
-
-//------------------
-
-OggMuxFilter::OggMuxFilter()
- : CBaseFilter(NAME("OggMuxFilter"), NULL, m_pLock, CLSID_OggMuxFilter)
- , mInterleaver(NULL)
-{
- mInterleaver = new OggPageInterleaver(this, this);
- //LEAK CHECK:::Both get deleted in constructor.
-
- m_pLock = new CCritSec;
- mInputPins.push_back(new OggMuxInputPin(this, m_pLock, &mHR, mInterleaver->newStream()));
- //debugLog.open("C:\\temp\\muxer.log", ios_base::out);
-
- //Make our delegate pin[0], the top pin... we send all out requests there.
- IMediaSeeking* locSeeker = NULL;
- mInputPins[0]->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
- SetDelegate(locSeeker);
-
-}
-
-OggMuxFilter::OggMuxFilter(REFCLSID inFilterGUID)
- : CBaseFilter(NAME("OggMuxFilter"), NULL, m_pLock, inFilterGUID)
- , mInterleaver(NULL)
-{
- //Do this in derived class
- //mInterleaver = new OggPageInterleaver(this, this);
-
-
- m_pLock = new CCritSec;
-
- //In the derived class
- //mInputPins.push_back(new OggMuxInputPin(this, m_pLock, &mHR, mInterleaver->newStream()));
- //debugLog.open("C:\\temp\\muxer.log", ios_base::out);
-
- //Make our delegate pin[0], the top pin... we send all out requests there.
- //IMediaSeeking* locSeeker = NULL;
- //mInputPins[0]->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
- //SetDelegate(locSeeker);
-
-}
-
-OggMuxFilter::~OggMuxFilter(void)
-{
- //debugLog.close();
- //DbgLog((LOG_ERROR, 1, TEXT("****************** DESTRUCTOR **********************")));
- delete m_pLock;
-
- //Need to delete the pins !!
-
-
- //if (ThreadExists() == TRUE) {
- // //DbgLog((LOG_ERROR, 1, TEXT("******** Thread exists - closing *****")));
- // Close();
- //}
-
-}
-
-HRESULT OggMuxFilter::addAnotherPin() {
- mInputPins.push_back(new OggMuxInputPin(this, m_pLock, &mHR, mInterleaver->newStream()));
- return S_OK;
-}
-
- //IFileSinkFilter Implementation
-HRESULT OggMuxFilter::SetFileName(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType) {
- CAutoLock locLock(m_pLock);
- mFileName = inFileName;
-
- SetupOutput();
- return S_OK;
-}
-HRESULT OggMuxFilter::GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType) {
- //Return the filename and mediatype of the raw data
-
-
- LPOLESTR x = SysAllocString(mFileName.c_str());
- *outFileName = x;
-
- return S_OK;
-}
-
-bool OggMuxFilter::acceptOggPage(OggPage* inOggPage) { //Deletes Page correctly.
- //debugLog<<"Page accepted... writing..."<<endl;
- unsigned char* locPageData = inOggPage->createRawPageData();
- mOutputFile.write((char*)locPageData, inOggPage->pageSize());
-
- delete inOggPage;
- delete[] locPageData;
- return true;
-}
-bool OggMuxFilter::SetupOutput() {
- mOutputFile.open(StringHelper::toNarrowStr(mFileName).c_str(), ios_base::out | ios_base::binary);
- return mOutputFile.is_open();
-}
-bool OggMuxFilter::CloseOutput() {
- mOutputFile.close();
- return true;
-
-}
-
-// //IFileSource Interface
-//STDMETHODIMP OggMuxFilter::GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType) {
-// //Return the filename and mediatype of the raw data
-//
-//
-// LPOLESTR x = SysAllocString(mFileName.c_str());
-// *outFileName = x;
-//
-// return S_OK;
-//}
-//STDMETHODIMP OggMuxFilter::Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType) {
-// //Initialise the file here and setup all the streams
-// CAutoLock locLock(m_pLock);
-// mFileName = inFileName;
-//
-// return SetUpPins();
-//}
-
-//BaseFilter Interface
-int OggMuxFilter::GetPinCount() {
- //TO DO::: Change this for multiple streams
- return (int)mInputPins.size();
-}
-CBasePin* OggMuxFilter::GetPin(int inPinNo) {
-
- if ((inPinNo < mInputPins.size()) && (inPinNo >= 0)) {
- return mInputPins[inPinNo];
- } else {
- return NULL;
- }
- //if (inPinNo >= 0 && inPinNo < mStreamMapper->numStreams()) {
- // return mStreamMapper->getOggStream(inPinNo)->getPin();
- //} else {
- // return NULL;
- //}
-}
-
-//CAMThread Stuff
-//DWORD OggMuxFilter::ThreadProc(void) {
-// while(true) {
-// DWORD locThreadCommand = GetRequest();
-// switch(locThreadCommand) {
-// case THREAD_EXIT:
-// Reply(S_OK);
-// return S_OK;
-//
-// //case THREAD_PAUSE:
-// // // we are paused already
-// // Reply(S_OK);
-// // break;
-//
-// case THREAD_RUN:
-// Reply(S_OK);
-// DataProcessLoop();
-// break;
-// }
-//
-//
-// }
-// return S_OK;
-//}
-
-//Helper methods
-
-//void OggMuxFilter::resetStream() {
-//
-// mSourceFile.clear();
-// mSourceFile.close();
-// mOggBuffer.clearData();
-// mSourceFile.open(StringHelper::toNarrowStr(mFileName).c_str(), ios_base::in|ios_base::binary);
-//
-// mSourceFile.seekg(mStreamMapper->startOfData(), ios_base::beg);
-// for (unsigned long i = 0; i < mStreamMapper->numStreams(); i++) {
-// mStreamMapper->getOggStream(i)->setSendExcess(true);
-// }
-//}
-
-//HRESULT OggMuxFilter::DataProcessLoop() {
-// DWORD locCommand = 0;
-// char* locBuff = new char[4096];
-// bool locKeepGoing = true;;
-// while (!mSourceFile.eof() && locKeepGoing) {
-// if(CheckRequest(&locCommand) == TRUE) {
-// return S_OK;
-// }
-//
-// mSourceFile.read(locBuff, 4096);
-// unsigned long locBytesRead = mSourceFile.gcount();
-// locKeepGoing = mOggBuffer.feed(locBuff, locBytesRead);
-// }
-// DeliverEOS();
-// delete locBuff;
-// //Memory leak
-// //FIXED
-//
-//
-//}
-//HRESULT OggMuxFilter::SetUpPins() {
-// mSourceFile.open(StringHelper::toNarrowStr(mFileName).c_str(), ios_base::in|ios_base::binary);
-// //Error check
-//
-// //Register a callback
-// mOggBuffer.registerVirtualCallback(this);
-//
-// char* locBuff = new char[RAW_BUFFER_SIZE];
-//
-// //Feed the data in until we have seen all BOS pages.
-// while(!mStreamMapper->isReady()) {
-// mSourceFile.read(locBuff, RAW_BUFFER_SIZE);
-// mOggBuffer.feed(locBuff, RAW_BUFFER_SIZE);
-//
-// }
-// //Memory leak
-// //FIXED
-// delete locBuff;
-// return S_OK;
-//}
-//IOggCallback Interface
-
-//bool OggMuxFilter::acceptOggPage(OggPage* inOggPage) {
-// return mStreamMapper->acceptOggPage(inOggPage);
-//}
-
-//IMEdiaStreaming
-STDMETHODIMP OggMuxFilter::Run(REFERENCE_TIME tStart) {
- //const REFERENCE_TIME A_LONG_TIME = UNITS * 1000;
- CAutoLock locLock(m_pLock);
- //DeliverNewSegment(tStart, tStart + A_LONG_TIME, 1.0);
- return CBaseFilter::Run(tStart);
-
-
-}
-STDMETHODIMP OggMuxFilter::Pause(void) {
- CAutoLock locLock(m_pLock);
- //if (m_State == State_Stopped) {
- // if (ThreadExists() == FALSE) {
- // Create();
- // }
- // CallWorker(THREAD_RUN);
- //}
-
- HRESULT locHR = CBaseFilter::Pause();
-
- return locHR;
-
-}
-STDMETHODIMP OggMuxFilter::Stop(void) {
- CAutoLock locLock(m_pLock);
- //CallWorker(THREAD_EXIT);
- //Close();
- //DeliverBeginFlush();
- //DeliverEndFlush();
-
- CloseOutput();
- return CBaseFilter::Stop();
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "oggmuxfilter.h"
+
+
+//+++++++++++++++++++++++++++++++++
+//-------------------
+// This template lets the Object factory create us properly and work with COM infrastructure.
+CFactoryTemplate g_Templates[] =
+{
+ {
+ L"OggMuxFilter", // Name
+ &CLSID_OggMuxFilter, // CLSID
+ OggMuxFilter::CreateInstance, // Method to create an instance of MyComponent
+ NULL, // Initialization function
+ NULL // Set-up information (for filters)
+ }
+
+};
+
+// Generic way of determining the number of items in the template
+int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
+
+
+
+CUnknown* WINAPI OggMuxFilter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
+{
+ OggMuxFilter *pNewObject = new OggMuxFilter();
+ if (pNewObject == NULL) {
+ *pHr = E_OUTOFMEMORY;
+ }
+ return pNewObject;
+}
+
+void OggMuxFilter::NotifyComplete() {
+ HRESULT locHR = NotifyEvent(EC_COMPLETE, S_OK, NULL);
+
+}
+
+STDMETHODIMP OggMuxFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+ if (riid == IID_IFileSinkFilter) {
+ *ppv = (IFileSinkFilter*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ } else if (riid == IID_IAMFilterMiscFlags) {
+ *ppv = (IAMFilterMiscFlags*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ } else if (riid == IID_IMediaSeeking) {
+ *ppv = (IMediaSeeking*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ }
+
+ return CBaseFilter::NonDelegatingQueryInterface(riid, ppv);
+}
+
+ULONG OggMuxFilter::GetMiscFlags(void) {
+ return AM_FILTER_MISC_FLAGS_IS_RENDERER;
+}
+
+//------------------
+
+OggMuxFilter::OggMuxFilter()
+ : CBaseFilter(NAME("OggMuxFilter"), NULL, m_pLock, CLSID_OggMuxFilter)
+ , mInterleaver(NULL)
+{
+ mInterleaver = new OggPageInterleaver(this, this);
+ //LEAK CHECK:::Both get deleted in constructor.
+
+ m_pLock = new CCritSec;
+ mInputPins.push_back(new OggMuxInputPin(this, m_pLock, &mHR, mInterleaver->newStream()));
+ //debugLog.open("C:\\temp\\muxer.log", ios_base::out);
+
+ //Make our delegate pin[0], the top pin... we send all out requests there.
+ IMediaSeeking* locSeeker = NULL;
+ mInputPins[0]->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+ SetDelegate(locSeeker);
+
+}
+
+OggMuxFilter::OggMuxFilter(REFCLSID inFilterGUID)
+ : CBaseFilter(NAME("OggMuxFilter"), NULL, m_pLock, inFilterGUID)
+ , mInterleaver(NULL)
+{
+ //Do this in derived class
+ //mInterleaver = new OggPageInterleaver(this, this);
+
+
+ m_pLock = new CCritSec;
+
+ //In the derived class
+ //mInputPins.push_back(new OggMuxInputPin(this, m_pLock, &mHR, mInterleaver->newStream()));
+ //debugLog.open("C:\\temp\\muxer.log", ios_base::out);
+
+ //Make our delegate pin[0], the top pin... we send all out requests there.
+ //IMediaSeeking* locSeeker = NULL;
+ //mInputPins[0]->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+ //SetDelegate(locSeeker);
+
+}
+
+OggMuxFilter::~OggMuxFilter(void)
+{
+ //debugLog.close();
+ //DbgLog((LOG_ERROR, 1, TEXT("****************** DESTRUCTOR **********************")));
+ delete m_pLock;
+
+ //Need to delete the pins !!
+
+
+ //if (ThreadExists() == TRUE) {
+ // //DbgLog((LOG_ERROR, 1, TEXT("******** Thread exists - closing *****")));
+ // Close();
+ //}
+
+}
+
+HRESULT OggMuxFilter::addAnotherPin() {
+ mInputPins.push_back(new OggMuxInputPin(this, m_pLock, &mHR, mInterleaver->newStream()));
+ return S_OK;
+}
+
+ //IFileSinkFilter Implementation
+HRESULT OggMuxFilter::SetFileName(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType) {
+ CAutoLock locLock(m_pLock);
+ mFileName = inFileName;
+
+ SetupOutput();
+ return S_OK;
+}
+HRESULT OggMuxFilter::GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType) {
+ //Return the filename and mediatype of the raw data
+
+
+ LPOLESTR x = SysAllocString(mFileName.c_str());
+ *outFileName = x;
+
+ return S_OK;
+}
+
+bool OggMuxFilter::acceptOggPage(OggPage* inOggPage) { //Deletes Page correctly.
+ //debugLog<<"Page accepted... writing..."<<endl;
+ unsigned char* locPageData = inOggPage->createRawPageData();
+ mOutputFile.write((char*)locPageData, inOggPage->pageSize());
+
+ delete inOggPage;
+ delete[] locPageData;
+ return true;
+}
+bool OggMuxFilter::SetupOutput() {
+ mOutputFile.open(StringHelper::toNarrowStr(mFileName).c_str(), ios_base::out | ios_base::binary);
+ return mOutputFile.is_open();
+}
+bool OggMuxFilter::CloseOutput() {
+ mOutputFile.close();
+ return true;
+
+}
+
+// //IFileSource Interface
+//STDMETHODIMP OggMuxFilter::GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType) {
+// //Return the filename and mediatype of the raw data
+//
+//
+// LPOLESTR x = SysAllocString(mFileName.c_str());
+// *outFileName = x;
+//
+// return S_OK;
+//}
+//STDMETHODIMP OggMuxFilter::Load(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType) {
+// //Initialise the file here and setup all the streams
+// CAutoLock locLock(m_pLock);
+// mFileName = inFileName;
+//
+// return SetUpPins();
+//}
+
+//BaseFilter Interface
+int OggMuxFilter::GetPinCount() {
+ //TO DO::: Change this for multiple streams
+ return (int)mInputPins.size();
+}
+CBasePin* OggMuxFilter::GetPin(int inPinNo) {
+
+ if ((inPinNo < mInputPins.size()) && (inPinNo >= 0)) {
+ return mInputPins[inPinNo];
+ } else {
+ return NULL;
+ }
+ //if (inPinNo >= 0 && inPinNo < mStreamMapper->numStreams()) {
+ // return mStreamMapper->getOggStream(inPinNo)->getPin();
+ //} else {
+ // return NULL;
+ //}
+}
+
+//CAMThread Stuff
+//DWORD OggMuxFilter::ThreadProc(void) {
+// while(true) {
+// DWORD locThreadCommand = GetRequest();
+// switch(locThreadCommand) {
+// case THREAD_EXIT:
+// Reply(S_OK);
+// return S_OK;
+//
+// //case THREAD_PAUSE:
+// // // we are paused already
+// // Reply(S_OK);
+// // break;
+//
+// case THREAD_RUN:
+// Reply(S_OK);
+// DataProcessLoop();
+// break;
+// }
+//
+//
+// }
+// return S_OK;
+//}
+
+//Helper methods
+
+//void OggMuxFilter::resetStream() {
+//
+// mSourceFile.clear();
+// mSourceFile.close();
+// mOggBuffer.clearData();
+// mSourceFile.open(StringHelper::toNarrowStr(mFileName).c_str(), ios_base::in|ios_base::binary);
+//
+// mSourceFile.seekg(mStreamMapper->startOfData(), ios_base::beg);
+// for (unsigned long i = 0; i < mStreamMapper->numStreams(); i++) {
+// mStreamMapper->getOggStream(i)->setSendExcess(true);
+// }
+//}
+
+//HRESULT OggMuxFilter::DataProcessLoop() {
+// DWORD locCommand = 0;
+// char* locBuff = new char[4096];
+// bool locKeepGoing = true;;
+// while (!mSourceFile.eof() && locKeepGoing) {
+// if(CheckRequest(&locCommand) == TRUE) {
+// return S_OK;
+// }
+//
+// mSourceFile.read(locBuff, 4096);
+// unsigned long locBytesRead = mSourceFile.gcount();
+// locKeepGoing = mOggBuffer.feed(locBuff, locBytesRead);
+// }
+// DeliverEOS();
+// delete locBuff;
+// //Memory leak
+// //FIXED
+//
+//
+//}
+//HRESULT OggMuxFilter::SetUpPins() {
+// mSourceFile.open(StringHelper::toNarrowStr(mFileName).c_str(), ios_base::in|ios_base::binary);
+// //Error check
+//
+// //Register a callback
+// mOggBuffer.registerVirtualCallback(this);
+//
+// char* locBuff = new char[RAW_BUFFER_SIZE];
+//
+// //Feed the data in until we have seen all BOS pages.
+// while(!mStreamMapper->isReady()) {
+// mSourceFile.read(locBuff, RAW_BUFFER_SIZE);
+// mOggBuffer.feed(locBuff, RAW_BUFFER_SIZE);
+//
+// }
+// //Memory leak
+// //FIXED
+// delete locBuff;
+// return S_OK;
+//}
+//IOggCallback Interface
+
+//bool OggMuxFilter::acceptOggPage(OggPage* inOggPage) {
+// return mStreamMapper->acceptOggPage(inOggPage);
+//}
+
+//IMEdiaStreaming
+STDMETHODIMP OggMuxFilter::Run(REFERENCE_TIME tStart) {
+ //const REFERENCE_TIME A_LONG_TIME = UNITS * 1000;
+ CAutoLock locLock(m_pLock);
+ //DeliverNewSegment(tStart, tStart + A_LONG_TIME, 1.0);
+ return CBaseFilter::Run(tStart);
+
+
+}
+STDMETHODIMP OggMuxFilter::Pause(void) {
+ CAutoLock locLock(m_pLock);
+ //if (m_State == State_Stopped) {
+ // if (ThreadExists() == FALSE) {
+ // Create();
+ // }
+ // CallWorker(THREAD_RUN);
+ //}
+
+ HRESULT locHR = CBaseFilter::Pause();
+
+ return locHR;
+
+}
+STDMETHODIMP OggMuxFilter::Stop(void) {
+ CAutoLock locLock(m_pLock);
+ //CallWorker(THREAD_EXIT);
+ //Close();
+ //DeliverBeginFlush();
+ //DeliverEndFlush();
+
+ CloseOutput();
+ return CBaseFilter::Stop();
+}
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,103 +1,103 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "oggmuxdllstuff.h"
-#include "OggMuxInputPin.h"
-#include "BasicSeekPassThrough.h"
-#include "OggPageInterleaver.h"
-#include "INotifyComplete.h"
-
-#include <string>
-
-#include <fstream>
-#include "IOggCallback.h"
-using namespace std;
-#include "StringHelper.h"
-class OggMuxInputPin;
-
-class OGG_MUX_API OggMuxFilter
- : public IFileSinkFilter
- , public CBaseFilter
- , public IOggCallback
- , public IAMFilterMiscFlags
- , public BasicSeekPassThrough
- , public INotifyComplete
-{
-public:
- OggMuxFilter(void);
- OggMuxFilter(REFCLSID inFilterGUID);
- virtual ~OggMuxFilter(void);
-
-
- //Com Stuff
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
- static CUnknown * WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
-
- //IAMFilterMiscFlags Implementation
- ULONG STDMETHODCALLTYPE GetMiscFlags(void);
-
- //IOggCallback Implementation
- virtual bool acceptOggPage(OggPage* inOggPage);
- //IFileSinkFilter Implementation
- STDMETHODIMP SetFileName(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType);
- STDMETHODIMP GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType);
-
- //IPin Interface (i Think ?? From CBAseFilter)
- virtual int GetPinCount();
- virtual CBasePin* GetPin(int inPinNo);
-
- //Streaming MEthods
- STDMETHODIMP Run(REFERENCE_TIME tStart);
- STDMETHODIMP Pause(void);
- STDMETHODIMP Stop(void);
-
- //Helpers
- virtual HRESULT addAnotherPin();
- virtual void NotifyComplete();
-
-protected:
-
- bool SetupOutput();
- bool CloseOutput();
-
- wstring mFileName;
- vector<OggMuxInputPin*> mInputPins;
-
- OggPageInterleaver* mInterleaver;
-
- fstream mOutputFile;
- //fstream debugLog;
- HRESULT mHR;
-
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "oggmuxdllstuff.h"
+#include "OggMuxInputPin.h"
+#include "BasicSeekPassThrough.h"
+#include "OggPageInterleaver.h"
+#include "INotifyComplete.h"
+
+#include <string>
+
+#include <fstream>
+#include "IOggCallback.h"
+using namespace std;
+#include "StringHelper.h"
+class OggMuxInputPin;
+
+class OGG_MUX_API OggMuxFilter
+ : public IFileSinkFilter
+ , public CBaseFilter
+ , public IOggCallback
+ , public IAMFilterMiscFlags
+ , public BasicSeekPassThrough
+ , public INotifyComplete
+{
+public:
+ OggMuxFilter(void);
+ OggMuxFilter(REFCLSID inFilterGUID);
+ virtual ~OggMuxFilter(void);
+
+
+ //Com Stuff
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+ static CUnknown * WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+
+ //IAMFilterMiscFlags Implementation
+ ULONG STDMETHODCALLTYPE GetMiscFlags(void);
+
+ //IOggCallback Implementation
+ virtual bool acceptOggPage(OggPage* inOggPage);
+ //IFileSinkFilter Implementation
+ STDMETHODIMP SetFileName(LPCOLESTR inFileName, const AM_MEDIA_TYPE* inMediaType);
+ STDMETHODIMP GetCurFile(LPOLESTR* outFileName, AM_MEDIA_TYPE* outMediaType);
+
+ //IPin Interface (i Think ?? From CBAseFilter)
+ virtual int GetPinCount();
+ virtual CBasePin* GetPin(int inPinNo);
+
+ //Streaming MEthods
+ STDMETHODIMP Run(REFERENCE_TIME tStart);
+ STDMETHODIMP Pause(void);
+ STDMETHODIMP Stop(void);
+
+ //Helpers
+ virtual HRESULT addAnotherPin();
+ virtual void NotifyComplete();
+
+protected:
+
+ bool SetupOutput();
+ bool CloseOutput();
+
+ wstring mFileName;
+ vector<OggMuxInputPin*> mInputPins;
+
+ OggPageInterleaver* mInterleaver;
+
+ fstream mOutputFile;
+ //fstream debugLog;
+ HRESULT mHR;
+
+
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxFilter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,301 +1,301 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "oggmuxinputpin.h"
-
-OggMuxInputPin::OggMuxInputPin(OggMuxFilter* inParentFilter, CCritSec* inFilterLock, HRESULT* inHR, OggMuxStream* inMuxStream)
- : CBaseInputPin(NAME("OggMuxInputPin"), inParentFilter, inFilterLock, inHR, L"Ogg Packet In")
- , mParentFilter(inParentFilter)
- , mMuxStream(inMuxStream)
- , mNeedsFLACHeaderTweak(false)
- , mNeedsFLACHeaderCount(false)
-
-{
-
-
- OggPaginatorSettings* locSettings = new OggPaginatorSettings;
- locSettings->mMinPageSize = 4096;
- locSettings->mMaxPageSize = 8192;
-
- LARGE_INTEGER locTicks;
- QueryPerformanceCounter(&locTicks);
- srand((unsigned int)locTicks.LowPart);
- locSettings->mSerialNo = ((unsigned long)(rand() + 1)) * ((unsigned long)(rand() + 1));
- //string x = "G:\\logs\\muxinput_";
- //char* ser = new char[10];
- //itoa(locSettings->mSerialNo, ser, 10);
- //x = x + ser;
- //x = x +".log";
-
- //debugLog.open(x.c_str(), ios_base::out);
- //locSettings->mSerialNo = 13130;
-
- mPaginator.setParameters(locSettings);
- mPaginator.setPageCallback(mMuxStream);
-
-
-}
-
-OggMuxInputPin::~OggMuxInputPin(void)
-{
- //debugLog.close();
-}
-
-STDMETHODIMP OggMuxInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
- if (riid == IID_IMediaSeeking) {
- *ppv = (IMediaSeeking*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- }
-
- return CBaseInputPin::NonDelegatingQueryInterface(riid, ppv);
-}
-
-//ANX::: Override and insert an anxdata into the stream.
-HRESULT OggMuxInputPin::SetMediaType(const CMediaType* inMediaType) {
- //debugLog.open("G:\\logs\\oggmuxinpin.log", ios_base::out);
- //debugLog<<"Set media type..."<<endl;
- if ((inMediaType->majortype == MEDIATYPE_Video) && (inMediaType->subtype == MEDIASUBTYPE_Theora)) {
- //Theora
-
- sTheoraFormatBlock* locTheora = (sTheoraFormatBlock*)inMediaType->pbFormat;
- //debugLog<<"Theo sample rate = "<<locTheora->frameRateNumerator<<" / "<<locTheora->frameRateDenominator<<endl;
- //debugLog<<"Theo KFI = "<<locTheora->maxKeyframeInterval<<endl;
- mMuxStream->setConversionParams(locTheora->frameRateNumerator, locTheora->frameRateDenominator, 10000000, locTheora->maxKeyframeInterval);
- mPaginator.setNumHeaders(3);
- } else if (inMediaType->majortype == MEDIATYPE_Audio) {
- if (inMediaType->subtype == MEDIASUBTYPE_Vorbis) {
- //Vorbis
- sVorbisFormatBlock* locVorbis = (sVorbisFormatBlock*)inMediaType->pbFormat;
- //debugLog<<"Vorbis sample rate = "<<locVorbis->samplesPerSec<<endl;
- mMuxStream->setConversionParams(locVorbis->samplesPerSec, 1, 10000000);
- mPaginator.setNumHeaders(3);
-
- } else if (inMediaType->subtype == MEDIASUBTYPE_Speex) {
- //Speex
- sSpeexFormatBlock* locSpeex = (sSpeexFormatBlock*)inMediaType->pbFormat;
- mMuxStream->setConversionParams(locSpeex->samplesPerSec, 1, 10000000);
- mPaginator.setNumHeaders(2);
- } else if (inMediaType->subtype == MEDIASUBTYPE_OggFLAC_1_0) {
- //We are connected to the encoder nd getting individual metadata packets.
- sFLACFormatBlock* locFLAC = (sFLACFormatBlock*)inMediaType->pbFormat;
- mMuxStream->setConversionParams(locFLAC->samplesPerSec, 1, 10000000);
- //debugLog<<"FLAC sample rate = "<<locFLAC->samplesPerSec<<endl;
- //mNeedsFLACHeaderTweak = true;
- mNeedsFLACHeaderCount = true;
- } else if (inMediaType->subtype == MEDIASUBTYPE_FLAC) {
- //We are connected directly to the demux and are getting metadata in one block
- // Need to use the header splitter class.
- sFLACFormatBlock* locFLAC = (sFLACFormatBlock*)inMediaType->pbFormat;
- mMuxStream->setConversionParams(locFLAC->samplesPerSec, 1, 10000000);
- //debugLog<<"FLAC sample rate = "<<locFLAC->samplesPerSec<<endl;
- mNeedsFLACHeaderTweak = true;
- }
-
-
- } else if (inMediaType->majortype == MEDIATYPE_Text) {
- if (inMediaType->subtype == MEDIASUBTYPE_CMML) {
- sCMMLFormatBlock* locCMML = (sCMMLFormatBlock*)inMediaType->pbFormat;
- mMuxStream->setConversionParams(locCMML->granuleNumerator,locCMML->granuleDenominator, 10000000);
- mPaginator.setNumHeaders(1);
-
- }
-
- }
- return S_OK;
-}
-
-HRESULT OggMuxInputPin::GetMediaType(int inPosition, CMediaType* outMediaType) {
- switch(inPosition) {
- case 0:
- outMediaType->majortype = MEDIATYPE_Video;
- outMediaType->subtype = MEDIASUBTYPE_Theora;
- return S_OK;
- case 1:
- outMediaType->majortype = MEDIATYPE_Audio;
- outMediaType->subtype = MEDIASUBTYPE_Vorbis;
- return S_OK;
- case 2:
- outMediaType->majortype = MEDIATYPE_Audio;
- outMediaType->subtype = MEDIASUBTYPE_Speex;
- return S_OK;
- case 3:
- outMediaType->majortype = MEDIATYPE_Audio;
- outMediaType->subtype = MEDIASUBTYPE_OggFLAC_1_0;
- return S_OK;
- case 4:
- outMediaType->majortype = MEDIATYPE_Audio;
- outMediaType->subtype = MEDIASUBTYPE_FLAC;
- return S_OK;
-
- case 5:
- outMediaType->majortype = MEDIATYPE_Text;
- outMediaType->subtype = MEDIASUBTYPE_CMML;
- return S_OK;
-
-
- default:
- return VFW_S_NO_MORE_ITEMS;
-
- }
-}
-HRESULT OggMuxInputPin::CheckMediaType(const CMediaType* inMediaType) {
- if ( (inMediaType->majortype == MEDIATYPE_Video
- && inMediaType->subtype == MEDIASUBTYPE_Theora
- && inMediaType->formattype == FORMAT_Theora)
- ||
- (inMediaType->majortype == MEDIATYPE_Audio
- && inMediaType->subtype == MEDIASUBTYPE_Vorbis
- && inMediaType->formattype == FORMAT_Vorbis)
- ||
- (inMediaType->majortype == MEDIATYPE_Audio
- && inMediaType->subtype == MEDIASUBTYPE_Speex
- && inMediaType->formattype == FORMAT_Speex)
- ||
- (inMediaType->majortype == MEDIATYPE_Audio
- && inMediaType->subtype == MEDIASUBTYPE_OggFLAC_1_0
- && inMediaType->formattype == FORMAT_FLAC)
- ||
- (inMediaType->majortype == MEDIATYPE_Audio
- && inMediaType->subtype == MEDIASUBTYPE_FLAC
- && inMediaType->formattype == FORMAT_FLAC)
- ||
- (inMediaType->majortype == MEDIATYPE_Text
- && inMediaType->subtype == MEDIASUBTYPE_CMML
- && inMediaType->formattype == FORMAT_CMML)
-
- ) {
- return S_OK;
- } else {
- return E_FAIL;
- }
-}
-
-STDMETHODIMP OggMuxInputPin::Receive(IMediaSample* inSample) {
- LONGLONG locStart = 0;
- LONGLONG locEnd = 0;
- BYTE* locSampleBuff;
- inSample->GetPointer(&locSampleBuff);
- HRESULT locHR = inSample->GetTime(&locStart, &locEnd);
-
- //debugLog <<"Received "<<locStart<<" - "<<locEnd<<endl;
- long locBuffSize = inSample->GetActualDataLength();
- unsigned char* locBuff = new unsigned char[locBuffSize];
- memcpy((void*)locBuff, (const void*)locSampleBuff, inSample->GetActualDataLength());
- StampedOggPacket* locPacket = new StampedOggPacket(locBuff, inSample->GetActualDataLength(), false, false, locStart, locEnd, StampedOggPacket::OGG_END_ONLY);
-
- if (mNeedsFLACHeaderCount) {
- mNeedsFLACHeaderCount = false;
- //This is to set the number of headers on the paginator for OggFLAC_1_0
- mPaginator.setNumHeaders( (locPacket->packetData()[8]) + 1 );
- }
- if ((mNeedsFLACHeaderTweak)) {
- //The first packet in FLAC has all the metadata in one block...
- // It needs to be broken up for correct muxing....
-
- //A note about the header formats used for flac in directshow.
- //
- //MEDIASUBTYPE_FLAC
- // The first packet is all the meta data in one block.
- // The only filter to output this is the demux.
- // The demux never outputs type MEDIASUBTYPE_OGG_FLAC_1_0
- // Even if the input is a new FLAC stream, it is translated before leaving the filter.
- //
- //MEDIASUBTYPE_OggFLAC_1_0
- // The metadata packets are all seperated.
- // This is the only format outputted by the encoder
- //
- //
-
- //If we are in this section of code... it means that the demux has
- // been connected directly to the mux.
- //This could be to mux multi stream flac.
- //Alternatively this configuration could be used to convert the old format to the new.
-
- //debugLog<<"In the header tweak section..."<<endl;
- FLACMetadataSplitter* locFLACSplitter = new FLACMetadataSplitter;
-
- //debugLog<<"Feeding metadata..."<<endl;
- locFLACSplitter->loadMetadata(locPacket->clone());
-
- //delete locPacket; //Don't delete the splitter will delete when it's done.
-
- for (int i = 0; i < locFLACSplitter->numHeaders(); i++) {
- //debugLog<<"Giving pager, packet "<<i<<endl;
- //debugLog<<locFLACSplitter->getHeader(i)->toPackDumpString()<<endl; //This is a leak !!
- if (i==0) {
- //Set the number of headers in the paginator for FLAC classic.
- StampedOggPacket* locHeadPack = locFLACSplitter->getHeader(i);
- mPaginator.setNumHeaders((locHeadPack->packetData()[8]) + 1);
- delete locHeadPack;
- }
- mPaginator.acceptStampedOggPacket(locFLACSplitter->getHeader(i)); //This get function returns our copy which we give away.
- //debugLog<<"After paginator feed..."<<endl;
- }
- mNeedsFLACHeaderTweak = false;
- //debugLog<<"Pre delete of splitter..."<<endl;
- delete locFLACSplitter;
- //debugLog<<"Post delete of splitter"<<endl;
-
- } else {
- //Not truncated or contuned... its a full packet.
-
- //debugLog<<"Normal add packet..."<<endl;
- mPaginator.acceptStampedOggPacket(locPacket);
- }
-
- return S_OK;
-
-
-
-}
-
-HRESULT OggMuxInputPin::CompleteConnect(IPin* inReceivePin) {
-
- //Set our delegate to the pin that is connecting to us... we'll send them our seek messages.
- IMediaSeeking* locSeeker = NULL;
- inReceivePin->QueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
- SetDelegate(locSeeker);
-
- mMuxStream->setIsActive(true);
- return mParentFilter->addAnotherPin();
-}
-STDMETHODIMP OggMuxInputPin::EndOfStream(void) {
-
- mPaginator.finishStream();
- mMuxStream->setIsEOS(true);
-
-
- //HRESULT locHR = mParentFilter->NotifyEvent(EC_COMPLETE, S_OK, NULL);
- return S_OK;
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "oggmuxinputpin.h"
+
+OggMuxInputPin::OggMuxInputPin(OggMuxFilter* inParentFilter, CCritSec* inFilterLock, HRESULT* inHR, OggMuxStream* inMuxStream)
+ : CBaseInputPin(NAME("OggMuxInputPin"), inParentFilter, inFilterLock, inHR, L"Ogg Packet In")
+ , mParentFilter(inParentFilter)
+ , mMuxStream(inMuxStream)
+ , mNeedsFLACHeaderTweak(false)
+ , mNeedsFLACHeaderCount(false)
+
+{
+
+
+ OggPaginatorSettings* locSettings = new OggPaginatorSettings;
+ locSettings->mMinPageSize = 4096;
+ locSettings->mMaxPageSize = 8192;
+
+ LARGE_INTEGER locTicks;
+ QueryPerformanceCounter(&locTicks);
+ srand((unsigned int)locTicks.LowPart);
+ locSettings->mSerialNo = ((unsigned long)(rand() + 1)) * ((unsigned long)(rand() + 1));
+ //string x = "G:\\logs\\muxinput_";
+ //char* ser = new char[10];
+ //itoa(locSettings->mSerialNo, ser, 10);
+ //x = x + ser;
+ //x = x +".log";
+
+ //debugLog.open(x.c_str(), ios_base::out);
+ //locSettings->mSerialNo = 13130;
+
+ mPaginator.setParameters(locSettings);
+ mPaginator.setPageCallback(mMuxStream);
+
+
+}
+
+OggMuxInputPin::~OggMuxInputPin(void)
+{
+ //debugLog.close();
+}
+
+STDMETHODIMP OggMuxInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+ if (riid == IID_IMediaSeeking) {
+ *ppv = (IMediaSeeking*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ }
+
+ return CBaseInputPin::NonDelegatingQueryInterface(riid, ppv);
+}
+
+//ANX::: Override and insert an anxdata into the stream.
+HRESULT OggMuxInputPin::SetMediaType(const CMediaType* inMediaType) {
+ //debugLog.open("G:\\logs\\oggmuxinpin.log", ios_base::out);
+ //debugLog<<"Set media type..."<<endl;
+ if ((inMediaType->majortype == MEDIATYPE_Video) && (inMediaType->subtype == MEDIASUBTYPE_Theora)) {
+ //Theora
+
+ sTheoraFormatBlock* locTheora = (sTheoraFormatBlock*)inMediaType->pbFormat;
+ //debugLog<<"Theo sample rate = "<<locTheora->frameRateNumerator<<" / "<<locTheora->frameRateDenominator<<endl;
+ //debugLog<<"Theo KFI = "<<locTheora->maxKeyframeInterval<<endl;
+ mMuxStream->setConversionParams(locTheora->frameRateNumerator, locTheora->frameRateDenominator, 10000000, locTheora->maxKeyframeInterval);
+ mPaginator.setNumHeaders(3);
+ } else if (inMediaType->majortype == MEDIATYPE_Audio) {
+ if (inMediaType->subtype == MEDIASUBTYPE_Vorbis) {
+ //Vorbis
+ sVorbisFormatBlock* locVorbis = (sVorbisFormatBlock*)inMediaType->pbFormat;
+ //debugLog<<"Vorbis sample rate = "<<locVorbis->samplesPerSec<<endl;
+ mMuxStream->setConversionParams(locVorbis->samplesPerSec, 1, 10000000);
+ mPaginator.setNumHeaders(3);
+
+ } else if (inMediaType->subtype == MEDIASUBTYPE_Speex) {
+ //Speex
+ sSpeexFormatBlock* locSpeex = (sSpeexFormatBlock*)inMediaType->pbFormat;
+ mMuxStream->setConversionParams(locSpeex->samplesPerSec, 1, 10000000);
+ mPaginator.setNumHeaders(2);
+ } else if (inMediaType->subtype == MEDIASUBTYPE_OggFLAC_1_0) {
+ //We are connected to the encoder nd getting individual metadata packets.
+ sFLACFormatBlock* locFLAC = (sFLACFormatBlock*)inMediaType->pbFormat;
+ mMuxStream->setConversionParams(locFLAC->samplesPerSec, 1, 10000000);
+ //debugLog<<"FLAC sample rate = "<<locFLAC->samplesPerSec<<endl;
+ //mNeedsFLACHeaderTweak = true;
+ mNeedsFLACHeaderCount = true;
+ } else if (inMediaType->subtype == MEDIASUBTYPE_FLAC) {
+ //We are connected directly to the demux and are getting metadata in one block
+ // Need to use the header splitter class.
+ sFLACFormatBlock* locFLAC = (sFLACFormatBlock*)inMediaType->pbFormat;
+ mMuxStream->setConversionParams(locFLAC->samplesPerSec, 1, 10000000);
+ //debugLog<<"FLAC sample rate = "<<locFLAC->samplesPerSec<<endl;
+ mNeedsFLACHeaderTweak = true;
+ }
+
+
+ } else if (inMediaType->majortype == MEDIATYPE_Text) {
+ if (inMediaType->subtype == MEDIASUBTYPE_CMML) {
+ sCMMLFormatBlock* locCMML = (sCMMLFormatBlock*)inMediaType->pbFormat;
+ mMuxStream->setConversionParams(locCMML->granuleNumerator,locCMML->granuleDenominator, 10000000);
+ mPaginator.setNumHeaders(1);
+
+ }
+
+ }
+ return S_OK;
+}
+
+HRESULT OggMuxInputPin::GetMediaType(int inPosition, CMediaType* outMediaType) {
+ switch(inPosition) {
+ case 0:
+ outMediaType->majortype = MEDIATYPE_Video;
+ outMediaType->subtype = MEDIASUBTYPE_Theora;
+ return S_OK;
+ case 1:
+ outMediaType->majortype = MEDIATYPE_Audio;
+ outMediaType->subtype = MEDIASUBTYPE_Vorbis;
+ return S_OK;
+ case 2:
+ outMediaType->majortype = MEDIATYPE_Audio;
+ outMediaType->subtype = MEDIASUBTYPE_Speex;
+ return S_OK;
+ case 3:
+ outMediaType->majortype = MEDIATYPE_Audio;
+ outMediaType->subtype = MEDIASUBTYPE_OggFLAC_1_0;
+ return S_OK;
+ case 4:
+ outMediaType->majortype = MEDIATYPE_Audio;
+ outMediaType->subtype = MEDIASUBTYPE_FLAC;
+ return S_OK;
+
+ case 5:
+ outMediaType->majortype = MEDIATYPE_Text;
+ outMediaType->subtype = MEDIASUBTYPE_CMML;
+ return S_OK;
+
+
+ default:
+ return VFW_S_NO_MORE_ITEMS;
+
+ }
+}
+HRESULT OggMuxInputPin::CheckMediaType(const CMediaType* inMediaType) {
+ if ( (inMediaType->majortype == MEDIATYPE_Video
+ && inMediaType->subtype == MEDIASUBTYPE_Theora
+ && inMediaType->formattype == FORMAT_Theora)
+ ||
+ (inMediaType->majortype == MEDIATYPE_Audio
+ && inMediaType->subtype == MEDIASUBTYPE_Vorbis
+ && inMediaType->formattype == FORMAT_Vorbis)
+ ||
+ (inMediaType->majortype == MEDIATYPE_Audio
+ && inMediaType->subtype == MEDIASUBTYPE_Speex
+ && inMediaType->formattype == FORMAT_Speex)
+ ||
+ (inMediaType->majortype == MEDIATYPE_Audio
+ && inMediaType->subtype == MEDIASUBTYPE_OggFLAC_1_0
+ && inMediaType->formattype == FORMAT_FLAC)
+ ||
+ (inMediaType->majortype == MEDIATYPE_Audio
+ && inMediaType->subtype == MEDIASUBTYPE_FLAC
+ && inMediaType->formattype == FORMAT_FLAC)
+ ||
+ (inMediaType->majortype == MEDIATYPE_Text
+ && inMediaType->subtype == MEDIASUBTYPE_CMML
+ && inMediaType->formattype == FORMAT_CMML)
+
+ ) {
+ return S_OK;
+ } else {
+ return E_FAIL;
+ }
+}
+
+STDMETHODIMP OggMuxInputPin::Receive(IMediaSample* inSample) {
+ LONGLONG locStart = 0;
+ LONGLONG locEnd = 0;
+ BYTE* locSampleBuff;
+ inSample->GetPointer(&locSampleBuff);
+ HRESULT locHR = inSample->GetTime(&locStart, &locEnd);
+
+ //debugLog <<"Received "<<locStart<<" - "<<locEnd<<endl;
+ long locBuffSize = inSample->GetActualDataLength();
+ unsigned char* locBuff = new unsigned char[locBuffSize];
+ memcpy((void*)locBuff, (const void*)locSampleBuff, inSample->GetActualDataLength());
+ StampedOggPacket* locPacket = new StampedOggPacket(locBuff, inSample->GetActualDataLength(), false, false, locStart, locEnd, StampedOggPacket::OGG_END_ONLY);
+
+ if (mNeedsFLACHeaderCount) {
+ mNeedsFLACHeaderCount = false;
+ //This is to set the number of headers on the paginator for OggFLAC_1_0
+ mPaginator.setNumHeaders( (locPacket->packetData()[8]) + 1 );
+ }
+ if ((mNeedsFLACHeaderTweak)) {
+ //The first packet in FLAC has all the metadata in one block...
+ // It needs to be broken up for correct muxing....
+
+ //A note about the header formats used for flac in directshow.
+ //
+ //MEDIASUBTYPE_FLAC
+ // The first packet is all the meta data in one block.
+ // The only filter to output this is the demux.
+ // The demux never outputs type MEDIASUBTYPE_OGG_FLAC_1_0
+ // Even if the input is a new FLAC stream, it is translated before leaving the filter.
+ //
+ //MEDIASUBTYPE_OggFLAC_1_0
+ // The metadata packets are all seperated.
+ // This is the only format outputted by the encoder
+ //
+ //
+
+ //If we are in this section of code... it means that the demux has
+ // been connected directly to the mux.
+ //This could be to mux multi stream flac.
+ //Alternatively this configuration could be used to convert the old format to the new.
+
+ //debugLog<<"In the header tweak section..."<<endl;
+ FLACMetadataSplitter* locFLACSplitter = new FLACMetadataSplitter;
+
+ //debugLog<<"Feeding metadata..."<<endl;
+ locFLACSplitter->loadMetadata(locPacket->clone());
+
+ //delete locPacket; //Don't delete the splitter will delete when it's done.
+
+ for (int i = 0; i < locFLACSplitter->numHeaders(); i++) {
+ //debugLog<<"Giving pager, packet "<<i<<endl;
+ //debugLog<<locFLACSplitter->getHeader(i)->toPackDumpString()<<endl; //This is a leak !!
+ if (i==0) {
+ //Set the number of headers in the paginator for FLAC classic.
+ StampedOggPacket* locHeadPack = locFLACSplitter->getHeader(i);
+ mPaginator.setNumHeaders((locHeadPack->packetData()[8]) + 1);
+ delete locHeadPack;
+ }
+ mPaginator.acceptStampedOggPacket(locFLACSplitter->getHeader(i)); //This get function returns our copy which we give away.
+ //debugLog<<"After paginator feed..."<<endl;
+ }
+ mNeedsFLACHeaderTweak = false;
+ //debugLog<<"Pre delete of splitter..."<<endl;
+ delete locFLACSplitter;
+ //debugLog<<"Post delete of splitter"<<endl;
+
+ } else {
+ //Not truncated or contuned... its a full packet.
+
+ //debugLog<<"Normal add packet..."<<endl;
+ mPaginator.acceptStampedOggPacket(locPacket);
+ }
+
+ return S_OK;
+
+
+
+}
+
+HRESULT OggMuxInputPin::CompleteConnect(IPin* inReceivePin) {
+
+ //Set our delegate to the pin that is connecting to us... we'll send them our seek messages.
+ IMediaSeeking* locSeeker = NULL;
+ inReceivePin->QueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+ SetDelegate(locSeeker);
+
+ mMuxStream->setIsActive(true);
+ return mParentFilter->addAnotherPin();
+}
+STDMETHODIMP OggMuxInputPin::EndOfStream(void) {
+
+ mPaginator.finishStream();
+ mMuxStream->setIsEOS(true);
+
+
+ //HRESULT locHR = mParentFilter->NotifyEvent(EC_COMPLETE, S_OK, NULL);
+ return S_OK;
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,88 +1,88 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include "oggmuxdllstuff.h"
-#include "OggMuxFilter.h"
-#include "OggPaginator.h"
-#include "OggMuxStream.h"
-#include "BasicSeekPassThrough.h"
-#include "FLACMetadataSplitter.h"
-#include <time.h>
-#include <fstream>
-#include <windows.h>
-using namespace std;
-
-class OggMuxFilter;
-
-class OGG_MUX_API OggMuxInputPin
- : public CBaseInputPin
- , public BasicSeekPassThrough
-{
-public:
- OggMuxInputPin(OggMuxFilter* inParentFilter, CCritSec* inFilterLock, HRESULT* inHR, OggMuxStream* inMuxStream);
- virtual ~OggMuxInputPin(void);
-
- //COM Setup
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- virtual HRESULT GetMediaType(int inPosition, CMediaType* outMediaType);
- virtual HRESULT CheckMediaType(const CMediaType* inMediaType);
- //virtual HRESULT DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest);
- virtual HRESULT SetMediaType(const CMediaType* inMediaType);
-
-
-
- //IOggCallback
- //virtual bool acceptOggPage(OggPage* inOggPage);
-
-
- STDMETHODIMP Receive(IMediaSample* inSample);
- //IPin
- //virtual HRESULT CompleteConnect (IPin *inReceivePin);
- //virtual HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
- virtual STDMETHODIMP EndOfStream(void);
- virtual HRESULT CompleteConnect(IPin* inReceivePin);
-
-
- //virtual HRESULT DeliverEndFlush(void);
- //virtual HRESULT DeliverBeginFlush(void);
-
-protected:
- OggMuxFilter* mParentFilter;
-
- bool mNeedsFLACHeaderTweak;
- bool mNeedsFLACHeaderCount;
-
- OggPaginator mPaginator;
- OggMuxStream* mMuxStream;
- //fstream debugLog;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+#include "oggmuxdllstuff.h"
+#include "OggMuxFilter.h"
+#include "OggPaginator.h"
+#include "OggMuxStream.h"
+#include "BasicSeekPassThrough.h"
+#include "FLACMetadataSplitter.h"
+#include <time.h>
+#include <fstream>
+#include <windows.h>
+using namespace std;
+
+class OggMuxFilter;
+
+class OGG_MUX_API OggMuxInputPin
+ : public CBaseInputPin
+ , public BasicSeekPassThrough
+{
+public:
+ OggMuxInputPin(OggMuxFilter* inParentFilter, CCritSec* inFilterLock, HRESULT* inHR, OggMuxStream* inMuxStream);
+ virtual ~OggMuxInputPin(void);
+
+ //COM Setup
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ virtual HRESULT GetMediaType(int inPosition, CMediaType* outMediaType);
+ virtual HRESULT CheckMediaType(const CMediaType* inMediaType);
+ //virtual HRESULT DecideBufferSize(IMemAllocator* inoutAllocator, ALLOCATOR_PROPERTIES* inoutInputRequest);
+ virtual HRESULT SetMediaType(const CMediaType* inMediaType);
+
+
+
+ //IOggCallback
+ //virtual bool acceptOggPage(OggPage* inOggPage);
+
+
+ STDMETHODIMP Receive(IMediaSample* inSample);
+ //IPin
+ //virtual HRESULT CompleteConnect (IPin *inReceivePin);
+ //virtual HRESULT DeliverNewSegment(REFERENCE_TIME tStart, REFERENCE_TIME tStop, double dRate);
+ virtual STDMETHODIMP EndOfStream(void);
+ virtual HRESULT CompleteConnect(IPin* inReceivePin);
+
+
+ //virtual HRESULT DeliverEndFlush(void);
+ //virtual HRESULT DeliverBeginFlush(void);
+
+protected:
+ OggMuxFilter* mParentFilter;
+
+ bool mNeedsFLACHeaderTweak;
+ bool mNeedsFLACHeaderCount;
+
+ OggPaginator mPaginator;
+ OggMuxStream* mMuxStream;
+ //fstream debugLog;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/OggMuxInputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/dsfOggMux.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/dsfOggMux.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/dsfOggMux.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,43 +1,43 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// dsfOggMux.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-//BOOL APIENTRY DllMain( HANDLE hModule,
-// DWORD ul_reason_for_call,
-// LPVOID lpReserved
-// )
-//{
-// return TRUE;
-//}
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// dsfOggMux.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+//BOOL APIENTRY DllMain( HANDLE hModule,
+// DWORD ul_reason_for_call,
+// LPVOID lpReserved
+// )
+//{
+// return TRUE;
+//}
+//
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/dsfOggMux.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,105 +1,105 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "oggmuxdllstuff.h"
-
-extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
-BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
-{
- return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
-}
-
-
-//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
-STDAPI DllRegisterServer()
-{
-
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(TRUE);
- if (FAILED(hr)) {
-
- return hr;
- }
-
-
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
-
-
- if (FAILED(hr)) {
- return hr;
- }
-
- hr = locFilterMapper->RegisterFilter(
- CLSID_OggMuxFilter, // Filter CLSID.
- L"Ogg Mux Filter", // Filter name.
- NULL, // Device moniker.
- &CLSID_LegacyAmFilterCategory, // Direct Show general category
- L"Ogg Mux Filter", // Instance data. ???????
- &OggMuxFilterReg // Pointer to filter information.
- );
-
-
- locFilterMapper->Release();
-
- return hr;
-
-}
-
-STDAPI DllUnregisterServer()
-{
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(FALSE);
- if (FAILED(hr)) {
-
- return hr;
- }
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
- IID_IFilterMapper2, (void **)&locFilterMapper);
-
- if (FAILED(hr)) {
- return hr;
- }
-
-
- hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory,
- L"Ogg Mux Filter", CLSID_OggMuxFilter);
-
- //
- locFilterMapper->Release();
- return hr;
-
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "oggmuxdllstuff.h"
+
+extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
+BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+ return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
+}
+
+
+//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
+STDAPI DllRegisterServer()
+{
+
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(TRUE);
+ if (FAILED(hr)) {
+
+ return hr;
+ }
+
+
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
+
+
+ if (FAILED(hr)) {
+ return hr;
+ }
+
+ hr = locFilterMapper->RegisterFilter(
+ CLSID_OggMuxFilter, // Filter CLSID.
+ L"Ogg Mux Filter", // Filter name.
+ NULL, // Device moniker.
+ &CLSID_LegacyAmFilterCategory, // Direct Show general category
+ L"Ogg Mux Filter", // Instance data. ???????
+ &OggMuxFilterReg // Pointer to filter information.
+ );
+
+
+ locFilterMapper->Release();
+
+ return hr;
+
+}
+
+STDAPI DllUnregisterServer()
+{
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(FALSE);
+ if (FAILED(hr)) {
+
+ return hr;
+ }
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
+ IID_IFilterMapper2, (void **)&locFilterMapper);
+
+ if (FAILED(hr)) {
+ return hr;
+ }
+
+
+ hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory,
+ L"Ogg Mux Filter", CLSID_OggMuxFilter);
+
+ //
+ locFilterMapper->Release();
+ return hr;
+
+}
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,218 +1,218 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-
-#pragma once
-#include <streams.h>
-#include <pullpin.h>
-#include <initguid.h>
-
-
-#ifdef DSFOGGMUX_EXPORTS
-#pragma message("----> Exporting from Ogg Mux...")
-#define OGG_MUX_API __declspec(dllexport)
-#else
-#pragma message("<---- Importing from Ogg Mux...")
-#define OGG_MUX_API __declspec(dllimport)
-#endif
-
-#ifdef LIBOOOGG_EXPORTS
-#define LIBOOOGG_API __declspec(dllexport)
-#else
-#define LIBOOOGG_API __declspec(dllimport)
-#endif
-
-
-
-
-
-//New section
-// {31CA0186-1FF0-4181-AA38-3CA4040BD260}
-DEFINE_GUID(CLSID_OggDemuxSourceFilter,
-0x31ca0186, 0x1ff0, 0x4181, 0xaa, 0x38, 0x3c, 0xa4, 0x4, 0xb, 0xd2, 0x60);
-
-// {1F3EFFE4-0E70-47c7-9C48-05EB99E20011}
-DEFINE_GUID(CLSID_OggMuxFilter,
-0x1f3effe4, 0xe70, 0x47c7, 0x9c, 0x48, 0x5, 0xeb, 0x99, 0xe2, 0x0, 0x11);
-
-// {3913F0AB-E7ED-41c4-979B-1D1FDD983C07}
-DEFINE_GUID(MEDIASUBTYPE_FLAC,
-0x3913f0ab, 0xe7ed, 0x41c4, 0x97, 0x9b, 0x1d, 0x1f, 0xdd, 0x98, 0x3c, 0x7);
-
-// {2C409DB0-95BF-47ba-B0F5-587256F1EDCF}
-DEFINE_GUID(MEDIASUBTYPE_OggFLAC_1_0,
-0x2c409db0, 0x95bf, 0x47ba, 0xb0, 0xf5, 0x58, 0x72, 0x56, 0xf1, 0xed, 0xcf);
-
-
-// {8A0566AC-42B3-4ad9-ACA3-93B906DDF98A}
-DEFINE_GUID(MEDIASUBTYPE_Vorbis,
-0x8a0566ac, 0x42b3, 0x4ad9, 0xac, 0xa3, 0x93, 0xb9, 0x6, 0xdd, 0xf9, 0x8a);
-
-// {25A9729D-12F6-420e-BD53-1D631DC217DF}
-DEFINE_GUID(MEDIASUBTYPE_Speex,
-0x25a9729d, 0x12f6, 0x420e, 0xbd, 0x53, 0x1d, 0x63, 0x1d, 0xc2, 0x17, 0xdf);
-
-// {44E04F43-58B3-4de1-9BAA-8901F852DAE4}
-DEFINE_GUID(FORMAT_Vorbis,
-0x44e04f43, 0x58b3, 0x4de1, 0x9b, 0xaa, 0x89, 0x1, 0xf8, 0x52, 0xda, 0xe4);
-
-// {78701A27-EFB5-4157-9553-38A7854E3E81}
-DEFINE_GUID(FORMAT_Speex,
-0x78701a27, 0xefb5, 0x4157, 0x95, 0x53, 0x38, 0xa7, 0x85, 0x4e, 0x3e, 0x81);
-
-// {1CDC48AC-4C24-4b8b-982B-7007A29D83C4}
-DEFINE_GUID(FORMAT_FLAC,
-0x1cdc48ac, 0x4c24, 0x4b8b, 0x98, 0x2b, 0x70, 0x7, 0xa2, 0x9d, 0x83, 0xc4);
-
-
-// {05187161-5C36-4324-A734-22BF37509F2D}
-DEFINE_GUID(CLSID_TheoraDecodeFilter,
-0x5187161, 0x5c36, 0x4324, 0xa7, 0x34, 0x22, 0xbf, 0x37, 0x50, 0x9f, 0x2d);
-
-// {D124B2B1-8968-4ae8-B288-FE16EA34B0CE}
-DEFINE_GUID(MEDIASUBTYPE_Theora,
-0xd124b2b1, 0x8968, 0x4ae8, 0xb2, 0x88, 0xfe, 0x16, 0xea, 0x34, 0xb0, 0xce);
-
-// {A99F116C-DFFA-412c-95DE-725F99874826}
-DEFINE_GUID(FORMAT_Theora,
-0xa99f116c, 0xdffa, 0x412c, 0x95, 0xde, 0x72, 0x5f, 0x99, 0x87, 0x48, 0x26);
-
-//This structure defines the type of input we accept on the input pin... Stream/Annodex
-
-// {53696C76-6961-40b2-B136-436F6E726164}
-DEFINE_GUID(FORMAT_CMML,
-0x53696c76, 0x6961, 0x40b2, 0xb1, 0x36, 0x43, 0x6f, 0x6e, 0x72, 0x61, 0x64);
-
-
-// {5A656E74-6172-6F26-B79C-D6416E647282}
-DEFINE_GUID(MEDIASUBTYPE_CMML,
-0x5a656e74, 0x6172, 0x6f26, 0xb7, 0x9c, 0xd6, 0x41, 0x6e, 0x64, 0x72, 0x82);
-//Structure defining the registration details of the filter
-
-
-const REGPINTYPES OggMuxInputTypes[] = {
- {
- &MEDIATYPE_Audio,
- &MEDIASUBTYPE_Speex
- },
- {
- &MEDIATYPE_Audio,
- &MEDIASUBTYPE_Vorbis
- },
- {
- &MEDIATYPE_Audio,
- &MEDIASUBTYPE_OggFLAC_1_0
- },
- {
- &MEDIATYPE_Video,
- &MEDIASUBTYPE_Theora
- },
- {
- &MEDIATYPE_Audio,
- &MEDIASUBTYPE_FLAC
- },
- {
- &MEDIATYPE_Text,
- &MEDIASUBTYPE_CMML
- }
-
-};
-const REGFILTERPINS OggMuxPinReg = {
-
- L"Ogg Packet Input", //Name (obsoleted)
- TRUE, //Renders from this pin ?? Not sure about this.
- FALSE, //Not an output pin
- FALSE, //Cannot have zero instances of this pin
- FALSE, //Cannot have more than one instance of this pin
- NULL, //Connects to filter (obsoleted)
- NULL, //Connects to pin (obsoleted)
- 6, //upport two media type
- OggMuxInputTypes //Pointer to media type (Audio/Vorbis or Audio/Speex)
-};
-
-const REGFILTER2 OggMuxFilterReg = {
- 1,
- MERIT_DO_NOT_USE,
- 1,
- &OggMuxPinReg
-
-};
-
-
-
-struct sVorbisFormatBlock {
- unsigned long vorbisVersion;
- unsigned long samplesPerSec;
- unsigned long minBitsPerSec;
- unsigned long avgBitsPerSec;
- unsigned long maxBitsPerSec;
- unsigned char numChannels;
-};
-
-struct sSpeexFormatBlock {
- unsigned long speexVersion;
- unsigned long samplesPerSec;
- unsigned long minBitsPerSec;
- unsigned long avgBitsPerSec;
- unsigned long maxBitsPerSec;
- unsigned long numChannels;
-
-};
-
-struct sFLACFormatBlock {
- unsigned short numChannels;
- unsigned long numBitsPerSample;
- unsigned long samplesPerSec;
-
-};
-
-struct sTheoraFormatBlock {
- unsigned long theoraVersion;
- unsigned long width;
- unsigned long height;
- unsigned long frameWidth;
- unsigned long frameHeight;
- unsigned long frameRateNumerator;
- unsigned long frameRateDenominator;
- unsigned long aspectNumerator;
- unsigned long aspectDenominator;
- unsigned long maxKeyframeInterval;
- unsigned long targetBitrate;
- unsigned char targetQuality;
- unsigned char xOffset;
- unsigned char yOffset;
- unsigned char colourSpace;
-};
-
-struct sCMMLFormatBlock {
- __int64 granuleNumerator;
- __int64 granuleDenominator;
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+
+#pragma once
+#include <streams.h>
+#include <pullpin.h>
+#include <initguid.h>
+
+
+#ifdef DSFOGGMUX_EXPORTS
+#pragma message("----> Exporting from Ogg Mux...")
+#define OGG_MUX_API __declspec(dllexport)
+#else
+#pragma message("<---- Importing from Ogg Mux...")
+#define OGG_MUX_API __declspec(dllimport)
+#endif
+
+#ifdef LIBOOOGG_EXPORTS
+#define LIBOOOGG_API __declspec(dllexport)
+#else
+#define LIBOOOGG_API __declspec(dllimport)
+#endif
+
+
+
+
+
+//New section
+// {31CA0186-1FF0-4181-AA38-3CA4040BD260}
+DEFINE_GUID(CLSID_OggDemuxSourceFilter,
+0x31ca0186, 0x1ff0, 0x4181, 0xaa, 0x38, 0x3c, 0xa4, 0x4, 0xb, 0xd2, 0x60);
+
+// {1F3EFFE4-0E70-47c7-9C48-05EB99E20011}
+DEFINE_GUID(CLSID_OggMuxFilter,
+0x1f3effe4, 0xe70, 0x47c7, 0x9c, 0x48, 0x5, 0xeb, 0x99, 0xe2, 0x0, 0x11);
+
+// {3913F0AB-E7ED-41c4-979B-1D1FDD983C07}
+DEFINE_GUID(MEDIASUBTYPE_FLAC,
+0x3913f0ab, 0xe7ed, 0x41c4, 0x97, 0x9b, 0x1d, 0x1f, 0xdd, 0x98, 0x3c, 0x7);
+
+// {2C409DB0-95BF-47ba-B0F5-587256F1EDCF}
+DEFINE_GUID(MEDIASUBTYPE_OggFLAC_1_0,
+0x2c409db0, 0x95bf, 0x47ba, 0xb0, 0xf5, 0x58, 0x72, 0x56, 0xf1, 0xed, 0xcf);
+
+
+// {8A0566AC-42B3-4ad9-ACA3-93B906DDF98A}
+DEFINE_GUID(MEDIASUBTYPE_Vorbis,
+0x8a0566ac, 0x42b3, 0x4ad9, 0xac, 0xa3, 0x93, 0xb9, 0x6, 0xdd, 0xf9, 0x8a);
+
+// {25A9729D-12F6-420e-BD53-1D631DC217DF}
+DEFINE_GUID(MEDIASUBTYPE_Speex,
+0x25a9729d, 0x12f6, 0x420e, 0xbd, 0x53, 0x1d, 0x63, 0x1d, 0xc2, 0x17, 0xdf);
+
+// {44E04F43-58B3-4de1-9BAA-8901F852DAE4}
+DEFINE_GUID(FORMAT_Vorbis,
+0x44e04f43, 0x58b3, 0x4de1, 0x9b, 0xaa, 0x89, 0x1, 0xf8, 0x52, 0xda, 0xe4);
+
+// {78701A27-EFB5-4157-9553-38A7854E3E81}
+DEFINE_GUID(FORMAT_Speex,
+0x78701a27, 0xefb5, 0x4157, 0x95, 0x53, 0x38, 0xa7, 0x85, 0x4e, 0x3e, 0x81);
+
+// {1CDC48AC-4C24-4b8b-982B-7007A29D83C4}
+DEFINE_GUID(FORMAT_FLAC,
+0x1cdc48ac, 0x4c24, 0x4b8b, 0x98, 0x2b, 0x70, 0x7, 0xa2, 0x9d, 0x83, 0xc4);
+
+
+// {05187161-5C36-4324-A734-22BF37509F2D}
+DEFINE_GUID(CLSID_TheoraDecodeFilter,
+0x5187161, 0x5c36, 0x4324, 0xa7, 0x34, 0x22, 0xbf, 0x37, 0x50, 0x9f, 0x2d);
+
+// {D124B2B1-8968-4ae8-B288-FE16EA34B0CE}
+DEFINE_GUID(MEDIASUBTYPE_Theora,
+0xd124b2b1, 0x8968, 0x4ae8, 0xb2, 0x88, 0xfe, 0x16, 0xea, 0x34, 0xb0, 0xce);
+
+// {A99F116C-DFFA-412c-95DE-725F99874826}
+DEFINE_GUID(FORMAT_Theora,
+0xa99f116c, 0xdffa, 0x412c, 0x95, 0xde, 0x72, 0x5f, 0x99, 0x87, 0x48, 0x26);
+
+//This structure defines the type of input we accept on the input pin... Stream/Annodex
+
+// {53696C76-6961-40b2-B136-436F6E726164}
+DEFINE_GUID(FORMAT_CMML,
+0x53696c76, 0x6961, 0x40b2, 0xb1, 0x36, 0x43, 0x6f, 0x6e, 0x72, 0x61, 0x64);
+
+
+// {5A656E74-6172-6F26-B79C-D6416E647282}
+DEFINE_GUID(MEDIASUBTYPE_CMML,
+0x5a656e74, 0x6172, 0x6f26, 0xb7, 0x9c, 0xd6, 0x41, 0x6e, 0x64, 0x72, 0x82);
+//Structure defining the registration details of the filter
+
+
+const REGPINTYPES OggMuxInputTypes[] = {
+ {
+ &MEDIATYPE_Audio,
+ &MEDIASUBTYPE_Speex
+ },
+ {
+ &MEDIATYPE_Audio,
+ &MEDIASUBTYPE_Vorbis
+ },
+ {
+ &MEDIATYPE_Audio,
+ &MEDIASUBTYPE_OggFLAC_1_0
+ },
+ {
+ &MEDIATYPE_Video,
+ &MEDIASUBTYPE_Theora
+ },
+ {
+ &MEDIATYPE_Audio,
+ &MEDIASUBTYPE_FLAC
+ },
+ {
+ &MEDIATYPE_Text,
+ &MEDIASUBTYPE_CMML
+ }
+
+};
+const REGFILTERPINS OggMuxPinReg = {
+
+ L"Ogg Packet Input", //Name (obsoleted)
+ TRUE, //Renders from this pin ?? Not sure about this.
+ FALSE, //Not an output pin
+ FALSE, //Cannot have zero instances of this pin
+ FALSE, //Cannot have more than one instance of this pin
+ NULL, //Connects to filter (obsoleted)
+ NULL, //Connects to pin (obsoleted)
+ 6, //upport two media type
+ OggMuxInputTypes //Pointer to media type (Audio/Vorbis or Audio/Speex)
+};
+
+const REGFILTER2 OggMuxFilterReg = {
+ 1,
+ MERIT_DO_NOT_USE,
+ 1,
+ &OggMuxPinReg
+
+};
+
+
+
+struct sVorbisFormatBlock {
+ unsigned long vorbisVersion;
+ unsigned long samplesPerSec;
+ unsigned long minBitsPerSec;
+ unsigned long avgBitsPerSec;
+ unsigned long maxBitsPerSec;
+ unsigned char numChannels;
+};
+
+struct sSpeexFormatBlock {
+ unsigned long speexVersion;
+ unsigned long samplesPerSec;
+ unsigned long minBitsPerSec;
+ unsigned long avgBitsPerSec;
+ unsigned long maxBitsPerSec;
+ unsigned long numChannels;
+
+};
+
+struct sFLACFormatBlock {
+ unsigned short numChannels;
+ unsigned long numBitsPerSample;
+ unsigned long samplesPerSec;
+
+};
+
+struct sTheoraFormatBlock {
+ unsigned long theoraVersion;
+ unsigned long width;
+ unsigned long height;
+ unsigned long frameWidth;
+ unsigned long frameHeight;
+ unsigned long frameRateNumerator;
+ unsigned long frameRateDenominator;
+ unsigned long aspectNumerator;
+ unsigned long aspectDenominator;
+ unsigned long maxKeyframeInterval;
+ unsigned long targetBitrate;
+ unsigned char targetQuality;
+ unsigned char xOffset;
+ unsigned char yOffset;
+ unsigned char colourSpace;
+};
+
+struct sCMMLFormatBlock {
+ __int64 granuleNumerator;
+ __int64 granuleDenominator;
};
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/oggmuxdllstuff.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,40 +1,40 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-
-// stdafx.cpp : source file that includes just the standard includes
-// dsfOggMux.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+
+// stdafx.cpp : source file that includes just the standard includes
+// dsfOggMux.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfOggMux/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfOggMux/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,45 +1,45 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-// TODO: reference additional headers your program requires here
-#include "oggmuxdllstuff.h"
-#include "StringHelper.h"
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+// TODO: reference additional headers your program requires here
+#include "oggmuxdllstuff.h"
+#include "StringHelper.h"
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfOggMux/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfSeeking/BasicSeekable.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfSeeking/BasicSeekable.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfSeeking/BasicSeekable.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,302 +1,302 @@
-#include "StdAfx.h"
-#include ".\basicseekable.h"
-
-BasicSeekable::BasicSeekable(IMediaSeeking* inDelegate)
- //: CUnknown(NAME("Basic Seekable Thing"), NULL, &mHR)
-{
- mSeekDelegate = inDelegate;
- //mSeekTimeBase = 0;
-
- mSeekingCap = 0;
- mSeekingCap = AM_SEEKING_CanSeekAbsolute |
- AM_SEEKING_CanSeekForwards |
- AM_SEEKING_CanSeekBackwards |
- //AM_SEEKING_CanGetCurrentPos |
- AM_SEEKING_CanGetStopPos |
- AM_SEEKING_CanGetDuration;
-
- //string x = "g:\\logs\\seeker.log";
- //seekDebug.open(x.c_str(), ios_base::out);
-
-}
-
-BasicSeekable::BasicSeekable(void)
- //: CUnknown(NAME("Basic Seekable Thing"), NULL, &mHR)
-{
- //mSeekTimeBase = 0;
- mSeekDelegate = NULL;
- mSeekingCap = AM_SEEKING_CanSeekAbsolute |
- AM_SEEKING_CanSeekForwards |
- AM_SEEKING_CanSeekBackwards |
- //AM_SEEKING_CanGetCurrentPos |
- AM_SEEKING_CanGetStopPos |
- AM_SEEKING_CanGetDuration;
-
- //string x = "g:\\logs\\seeker.log";
- //seekDebug.open(x.c_str(), ios_base::out);
-
-
-}
-
-bool BasicSeekable::ReleaseDelegate() {
- if (mSeekDelegate != NULL) {
- mSeekDelegate->Release();
- mSeekDelegate = NULL;
- }
- return true;
-}
-
-bool BasicSeekable::SetDelegate(IMediaSeeking* inDelegate) {
- mSeekDelegate = inDelegate;
- return true;
-}
-BasicSeekable::~BasicSeekable(void)
-{
- //TODO::: FActor this... use the new releasedelegate function.
- if (mSeekDelegate != NULL) {
- mSeekDelegate->Release();
- mSeekDelegate = NULL;
- }
- //seekDebug.close();
-}
-//IMediaSeeking Interface
-STDMETHODIMP BasicSeekable::GetCapabilities(DWORD* inCapabilities) {
-//typedef
-//enum AM_SEEKING_SeekingCapabilities {
-// AM_SEEKING_CanSeekAbsolute = 0x1,
-// AM_SEEKING_CanSeekForwards = 0x2,
-// AM_SEEKING_CanSeekBackwards = 0x4,
-// AM_SEEKING_CanGetCurrentPos = 0x8,
-// AM_SEEKING_CanGetStopPos = 0x10,
-// AM_SEEKING_CanGetDuration = 0x20,
-// AM_SEEKING_CanPlayBackwards = 0x40,
-// AM_SEEKING_CanDoSegments = 0x80,
-// AM_SEEKING_Source = 0x100
-//} AM_SEEKING_SEEKING_CAPABILITIES;
-
-
- //*inCapabilities = mSeekingCap;
- //return S_OK;
-
- if (mSeekDelegate != NULL) {
- //seekDebug<<"GetCaps : Passed on..."<<endl;
- return mSeekDelegate->GetCapabilities(inCapabilities);
- } else {
- //seekDebug<<"GetCaps : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-
-}
-STDMETHODIMP BasicSeekable::CheckCapabilities(DWORD* outCapabilities) {
-
-
- //if (inCapabilities == NULL) {
- // return E_POINTER;
- //}
- //*inCapabilities &= mSeekingCap;
-
- //if (*inCapabilities == mSeekingCap) {
- // return S_OK;
- //} else {
- // return E_NOTIMPL;
- //}
-
-
- if (mSeekDelegate != NULL) {
- //seekDebug<<"CheckCaps : Passed on..."<<endl;
- return mSeekDelegate->CheckCapabilities(outCapabilities);
- } else {
- //seekDebug<<"CheckCaps : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-
-}
-STDMETHODIMP BasicSeekable::IsFormatSupported(const GUID* inFormat) {
-
- //if (inFormat == NULL) {
- // return E_POINTER;
- //}
- //if (*inFormat == TIME_FORMAT_MEDIA_TIME) {
- // return S_OK;
- //} else {
- // return S_FALSE;
- //}
-
- if (mSeekDelegate != NULL) {
- //seekDebug<<"IsFromatsupp : Passed on..."<<endl;
- return mSeekDelegate->IsFormatSupported(inFormat);
- } else {
- //seekDebug<<"IsFromatsupp : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-
-}
-STDMETHODIMP BasicSeekable::QueryPreferredFormat(GUID* outFormat) {
- //if (inFormat == NULL) {
- // return E_POINTER;
- //}
-
- //*outFormat = TIME_FORMAT_MEDIA_TIME;
-
- //return S_OK;
- if (mSeekDelegate != NULL) {
- //seekDebug<<"Query preff : Passed on..."<<endl;
- return mSeekDelegate->QueryPreferredFormat(outFormat);
- } else {
- //seekDebug<<"Query preff : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-
-}
-STDMETHODIMP BasicSeekable::SetTimeFormat(const GUID* inFormat) {
-
- if (mSeekDelegate != NULL) {
- //seekDebug<<"SetTimeformat :Passed on..."<<endl;
- return mSeekDelegate->SetTimeFormat(inFormat);
- } else {
- //seekDebug<<"SetTimeformat : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-}
-
-STDMETHODIMP BasicSeekable::GetTimeFormat( GUID *outFormat) {
- if (mSeekDelegate != NULL) {
- //seekDebug<<"Gettimeformat : Passed on..."<<endl;
- return mSeekDelegate->GetTimeFormat(outFormat);
- } else {
- //seekDebug<<"Gettimeformat : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-}
-STDMETHODIMP BasicSeekable::GetDuration(LONGLONG* outDuration) {
-
- if (mSeekDelegate != NULL) {
- //seekDebug<<"Getdureation : Passed on..."<<endl;
- return mSeekDelegate->GetDuration(outDuration);
- } else {
- //seekDebug<<"Getdureation : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
- //return E_NOTIMPL;
-}
-STDMETHODIMP BasicSeekable::GetStopPosition(LONGLONG* inStop) {
- if (mSeekDelegate != NULL) {
- //seekDebug<<"Getstoppos : Passed on..."<<endl;
- return mSeekDelegate->GetStopPosition(inStop);
- } else {
- //seekDebug<<"Getstoppos : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
- //return E_NOTIMPL;
-}
-STDMETHODIMP BasicSeekable::GetCurrentPosition(LONGLONG* outCurrent) {
- //return E_NOTIMPL;
-
- if (mSeekDelegate != NULL) {
- //seekDebug<<"Getcurrpos : Passed on..."<<endl;
- return mSeekDelegate->GetCurrentPosition(outCurrent);
- } else {
- //seekDebug<<"Getcurrpos : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-}
-STDMETHODIMP BasicSeekable::ConvertTimeFormat(LONGLONG* outTarget, const GUID* inTargetFormat, LONGLONG inSource, const GUID* inSourceFormat) {
- //return E_NOTIMPL;
- if (mSeekDelegate != NULL) {
- //seekDebug<<"ConvTimeformat : Passed on..."<<endl;
- return mSeekDelegate->ConvertTimeFormat(outTarget, inTargetFormat, inSource, inSourceFormat);
- } else {
- //seekDebug<<"ConvTimeformat : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-}
-STDMETHODIMP BasicSeekable::SetPositions(LONGLONG* inoutCurrent, DWORD inCurrentFlags, LONGLONG* inStop, DWORD inStopFlags) {
- if (mSeekDelegate != NULL) {
- //seekDebug<<"Set pos : Requested Time : "<<*inoutCurrent<<endl;
- HRESULT locHR = mSeekDelegate->SetPositions(inoutCurrent, inCurrentFlags, inStop, inStopFlags);
- if (locHR == S_OK) {
- //mSeekTimeBase = *inoutCurrent;
- //seekDebug<<"Set Pos : Actual Time : "<<*inoutCurrent<<endl;
-
- }
- return locHR;
- } else {
- //seekDebug<<"Set pos : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-
-}
-STDMETHODIMP BasicSeekable::GetPositions(LONGLONG* outCurrent, LONGLONG* outStop) {
- if (mSeekDelegate != NULL) {
- //seekDebug<<"GetPos : Passed on..."<<endl;
- return mSeekDelegate->GetPositions(outCurrent, outStop);
- } else {
- //seekDebug<<"GetPos : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-
-}
-STDMETHODIMP BasicSeekable::GetAvailable(LONGLONG* outEarliest, LONGLONG* outLatest) {
- if (mSeekDelegate != NULL) {
- //seekDebug<<"Getavail : Passed on..."<<endl;
- return mSeekDelegate->GetAvailable(outEarliest, outLatest);
- } else {
- //seekDebug<<"Getavail : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-}
-STDMETHODIMP BasicSeekable::SetRate(double inRate) {
-
- if (mSeekDelegate != NULL) {
- //seekDebug<<"Setrate : Passed on..."<<endl;
- return mSeekDelegate->SetRate(inRate);
- } else {
- //seekDebug<<"Setrate : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-}
-STDMETHODIMP BasicSeekable::GetRate(double* outRate) {
- if (mSeekDelegate != NULL) {
- //seekDebug<<"Getrate : Passed on..."<<endl;
- return mSeekDelegate->GetRate(outRate);
- } else {
- //seekDebug<<"Getrate : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-}
-STDMETHODIMP BasicSeekable::GetPreroll(LONGLONG* outPreroll) {
- if (mSeekDelegate != NULL) {
- //seekDebug<<"Getpreroll : Passed on..."<<endl;
- return mSeekDelegate->GetPreroll(outPreroll);
- } else {
- //seekDebug<<"Getpreroll : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-}
-STDMETHODIMP BasicSeekable::IsUsingTimeFormat(const GUID* inFormat) {
-if (mSeekDelegate != NULL) {
- //seekDebug<<"Isusingtimeformat : Passed on..."<<endl;
- return mSeekDelegate->IsUsingTimeFormat(inFormat);
- } else {
- //seekDebug<<"Isusingtimeformat : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-}
+#include "StdAfx.h"
+#include ".\basicseekable.h"
+
+BasicSeekable::BasicSeekable(IMediaSeeking* inDelegate)
+ //: CUnknown(NAME("Basic Seekable Thing"), NULL, &mHR)
+{
+ mSeekDelegate = inDelegate;
+ //mSeekTimeBase = 0;
+
+ mSeekingCap = 0;
+ mSeekingCap = AM_SEEKING_CanSeekAbsolute |
+ AM_SEEKING_CanSeekForwards |
+ AM_SEEKING_CanSeekBackwards |
+ //AM_SEEKING_CanGetCurrentPos |
+ AM_SEEKING_CanGetStopPos |
+ AM_SEEKING_CanGetDuration;
+
+ //string x = "g:\\logs\\seeker.log";
+ //seekDebug.open(x.c_str(), ios_base::out);
+
+}
+
+BasicSeekable::BasicSeekable(void)
+ //: CUnknown(NAME("Basic Seekable Thing"), NULL, &mHR)
+{
+ //mSeekTimeBase = 0;
+ mSeekDelegate = NULL;
+ mSeekingCap = AM_SEEKING_CanSeekAbsolute |
+ AM_SEEKING_CanSeekForwards |
+ AM_SEEKING_CanSeekBackwards |
+ //AM_SEEKING_CanGetCurrentPos |
+ AM_SEEKING_CanGetStopPos |
+ AM_SEEKING_CanGetDuration;
+
+ //string x = "g:\\logs\\seeker.log";
+ //seekDebug.open(x.c_str(), ios_base::out);
+
+
+}
+
+bool BasicSeekable::ReleaseDelegate() {
+ if (mSeekDelegate != NULL) {
+ mSeekDelegate->Release();
+ mSeekDelegate = NULL;
+ }
+ return true;
+}
+
+bool BasicSeekable::SetDelegate(IMediaSeeking* inDelegate) {
+ mSeekDelegate = inDelegate;
+ return true;
+}
+BasicSeekable::~BasicSeekable(void)
+{
+ //TODO::: FActor this... use the new releasedelegate function.
+ if (mSeekDelegate != NULL) {
+ mSeekDelegate->Release();
+ mSeekDelegate = NULL;
+ }
+ //seekDebug.close();
+}
+//IMediaSeeking Interface
+STDMETHODIMP BasicSeekable::GetCapabilities(DWORD* inCapabilities) {
+//typedef
+//enum AM_SEEKING_SeekingCapabilities {
+// AM_SEEKING_CanSeekAbsolute = 0x1,
+// AM_SEEKING_CanSeekForwards = 0x2,
+// AM_SEEKING_CanSeekBackwards = 0x4,
+// AM_SEEKING_CanGetCurrentPos = 0x8,
+// AM_SEEKING_CanGetStopPos = 0x10,
+// AM_SEEKING_CanGetDuration = 0x20,
+// AM_SEEKING_CanPlayBackwards = 0x40,
+// AM_SEEKING_CanDoSegments = 0x80,
+// AM_SEEKING_Source = 0x100
+//} AM_SEEKING_SEEKING_CAPABILITIES;
+
+
+ //*inCapabilities = mSeekingCap;
+ //return S_OK;
+
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"GetCaps : Passed on..."<<endl;
+ return mSeekDelegate->GetCapabilities(inCapabilities);
+ } else {
+ //seekDebug<<"GetCaps : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+
+}
+STDMETHODIMP BasicSeekable::CheckCapabilities(DWORD* outCapabilities) {
+
+
+ //if (inCapabilities == NULL) {
+ // return E_POINTER;
+ //}
+ //*inCapabilities &= mSeekingCap;
+
+ //if (*inCapabilities == mSeekingCap) {
+ // return S_OK;
+ //} else {
+ // return E_NOTIMPL;
+ //}
+
+
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"CheckCaps : Passed on..."<<endl;
+ return mSeekDelegate->CheckCapabilities(outCapabilities);
+ } else {
+ //seekDebug<<"CheckCaps : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+
+}
+STDMETHODIMP BasicSeekable::IsFormatSupported(const GUID* inFormat) {
+
+ //if (inFormat == NULL) {
+ // return E_POINTER;
+ //}
+ //if (*inFormat == TIME_FORMAT_MEDIA_TIME) {
+ // return S_OK;
+ //} else {
+ // return S_FALSE;
+ //}
+
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"IsFromatsupp : Passed on..."<<endl;
+ return mSeekDelegate->IsFormatSupported(inFormat);
+ } else {
+ //seekDebug<<"IsFromatsupp : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+
+}
+STDMETHODIMP BasicSeekable::QueryPreferredFormat(GUID* outFormat) {
+ //if (inFormat == NULL) {
+ // return E_POINTER;
+ //}
+
+ //*outFormat = TIME_FORMAT_MEDIA_TIME;
+
+ //return S_OK;
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"Query preff : Passed on..."<<endl;
+ return mSeekDelegate->QueryPreferredFormat(outFormat);
+ } else {
+ //seekDebug<<"Query preff : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+
+}
+STDMETHODIMP BasicSeekable::SetTimeFormat(const GUID* inFormat) {
+
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"SetTimeformat :Passed on..."<<endl;
+ return mSeekDelegate->SetTimeFormat(inFormat);
+ } else {
+ //seekDebug<<"SetTimeformat : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+}
+
+STDMETHODIMP BasicSeekable::GetTimeFormat( GUID *outFormat) {
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"Gettimeformat : Passed on..."<<endl;
+ return mSeekDelegate->GetTimeFormat(outFormat);
+ } else {
+ //seekDebug<<"Gettimeformat : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+}
+STDMETHODIMP BasicSeekable::GetDuration(LONGLONG* outDuration) {
+
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"Getdureation : Passed on..."<<endl;
+ return mSeekDelegate->GetDuration(outDuration);
+ } else {
+ //seekDebug<<"Getdureation : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+ //return E_NOTIMPL;
+}
+STDMETHODIMP BasicSeekable::GetStopPosition(LONGLONG* inStop) {
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"Getstoppos : Passed on..."<<endl;
+ return mSeekDelegate->GetStopPosition(inStop);
+ } else {
+ //seekDebug<<"Getstoppos : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+ //return E_NOTIMPL;
+}
+STDMETHODIMP BasicSeekable::GetCurrentPosition(LONGLONG* outCurrent) {
+ //return E_NOTIMPL;
+
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"Getcurrpos : Passed on..."<<endl;
+ return mSeekDelegate->GetCurrentPosition(outCurrent);
+ } else {
+ //seekDebug<<"Getcurrpos : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+}
+STDMETHODIMP BasicSeekable::ConvertTimeFormat(LONGLONG* outTarget, const GUID* inTargetFormat, LONGLONG inSource, const GUID* inSourceFormat) {
+ //return E_NOTIMPL;
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"ConvTimeformat : Passed on..."<<endl;
+ return mSeekDelegate->ConvertTimeFormat(outTarget, inTargetFormat, inSource, inSourceFormat);
+ } else {
+ //seekDebug<<"ConvTimeformat : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+}
+STDMETHODIMP BasicSeekable::SetPositions(LONGLONG* inoutCurrent, DWORD inCurrentFlags, LONGLONG* inStop, DWORD inStopFlags) {
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"Set pos : Requested Time : "<<*inoutCurrent<<endl;
+ HRESULT locHR = mSeekDelegate->SetPositions(inoutCurrent, inCurrentFlags, inStop, inStopFlags);
+ if (locHR == S_OK) {
+ //mSeekTimeBase = *inoutCurrent;
+ //seekDebug<<"Set Pos : Actual Time : "<<*inoutCurrent<<endl;
+
+ }
+ return locHR;
+ } else {
+ //seekDebug<<"Set pos : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+
+}
+STDMETHODIMP BasicSeekable::GetPositions(LONGLONG* outCurrent, LONGLONG* outStop) {
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"GetPos : Passed on..."<<endl;
+ return mSeekDelegate->GetPositions(outCurrent, outStop);
+ } else {
+ //seekDebug<<"GetPos : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+
+}
+STDMETHODIMP BasicSeekable::GetAvailable(LONGLONG* outEarliest, LONGLONG* outLatest) {
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"Getavail : Passed on..."<<endl;
+ return mSeekDelegate->GetAvailable(outEarliest, outLatest);
+ } else {
+ //seekDebug<<"Getavail : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+}
+STDMETHODIMP BasicSeekable::SetRate(double inRate) {
+
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"Setrate : Passed on..."<<endl;
+ return mSeekDelegate->SetRate(inRate);
+ } else {
+ //seekDebug<<"Setrate : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+}
+STDMETHODIMP BasicSeekable::GetRate(double* outRate) {
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"Getrate : Passed on..."<<endl;
+ return mSeekDelegate->GetRate(outRate);
+ } else {
+ //seekDebug<<"Getrate : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+}
+STDMETHODIMP BasicSeekable::GetPreroll(LONGLONG* outPreroll) {
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"Getpreroll : Passed on..."<<endl;
+ return mSeekDelegate->GetPreroll(outPreroll);
+ } else {
+ //seekDebug<<"Getpreroll : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+}
+STDMETHODIMP BasicSeekable::IsUsingTimeFormat(const GUID* inFormat) {
+if (mSeekDelegate != NULL) {
+ //seekDebug<<"Isusingtimeformat : Passed on..."<<endl;
+ return mSeekDelegate->IsUsingTimeFormat(inFormat);
+ } else {
+ //seekDebug<<"Isusingtimeformat : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+}
//
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfSeeking/BasicSeekable.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfSeeking/BasicSeekable.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfSeeking/BasicSeekable.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfSeeking/BasicSeekable.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,51 +1,51 @@
-#pragma once
-
-//Local Includes
-#include "dsfseeking.h"
-
-//STL Includes
-#include <fstream>
-using namespace std;
-
-class DSFSEEKING_API BasicSeekable
- //Base classes.
- : public IMediaSeeking
-{
-public:
- //Constructors
- BasicSeekable(void);
- BasicSeekable(IMediaSeeking* inDelegate);
- virtual ~BasicSeekable(void);
-
- //Delegate Control Methods.
- bool SetDelegate(IMediaSeeking* inDelegate);
- bool ReleaseDelegate();
-
- //IMediaSeeking Interface
- virtual STDMETHODIMP GetCapabilities(DWORD *pCapabilities);
- virtual STDMETHODIMP CheckCapabilities(DWORD *pCapabilities);
- virtual STDMETHODIMP IsFormatSupported(const GUID *pFormat);
- virtual STDMETHODIMP QueryPreferredFormat(GUID *pFormat);
- virtual STDMETHODIMP SetTimeFormat(const GUID *pFormat);
- virtual STDMETHODIMP GetTimeFormat( GUID *pFormat);
- virtual STDMETHODIMP GetDuration(LONGLONG *pDuration);
- virtual STDMETHODIMP GetStopPosition(LONGLONG *pStop);
- virtual STDMETHODIMP GetCurrentPosition(LONGLONG *pCurrent);
- virtual STDMETHODIMP ConvertTimeFormat(LONGLONG *pTarget, const GUID *pTargetFormat, LONGLONG Source, const GUID *pSourceFormat);
- virtual STDMETHODIMP SetPositions(LONGLONG *pCurrent,DWORD dwCurrentFlags,LONGLONG *pStop,DWORD dwStopFlags);
- virtual STDMETHODIMP GetPositions(LONGLONG *pCurrent, LONGLONG *pStop);
- virtual STDMETHODIMP GetAvailable(LONGLONG *pEarliest, LONGLONG *pLatest);
- virtual STDMETHODIMP SetRate(double dRate);
- virtual STDMETHODIMP GetRate(double *dRate);
- virtual STDMETHODIMP GetPreroll(LONGLONG *pllPreroll);
- virtual STDMETHODIMP IsUsingTimeFormat(const GUID *pFormat);
-
-protected:
- //Member data
- IMediaSeeking* mSeekDelegate;
- HRESULT mHR;
- DWORD mSeekingCap;
-
- //Debug only.
- //fstream seekDebug;
-};
+#pragma once
+
+//Local Includes
+#include "dsfseeking.h"
+
+//STL Includes
+#include <fstream>
+using namespace std;
+
+class DSFSEEKING_API BasicSeekable
+ //Base classes.
+ : public IMediaSeeking
+{
+public:
+ //Constructors
+ BasicSeekable(void);
+ BasicSeekable(IMediaSeeking* inDelegate);
+ virtual ~BasicSeekable(void);
+
+ //Delegate Control Methods.
+ bool SetDelegate(IMediaSeeking* inDelegate);
+ bool ReleaseDelegate();
+
+ //IMediaSeeking Interface
+ virtual STDMETHODIMP GetCapabilities(DWORD *pCapabilities);
+ virtual STDMETHODIMP CheckCapabilities(DWORD *pCapabilities);
+ virtual STDMETHODIMP IsFormatSupported(const GUID *pFormat);
+ virtual STDMETHODIMP QueryPreferredFormat(GUID *pFormat);
+ virtual STDMETHODIMP SetTimeFormat(const GUID *pFormat);
+ virtual STDMETHODIMP GetTimeFormat( GUID *pFormat);
+ virtual STDMETHODIMP GetDuration(LONGLONG *pDuration);
+ virtual STDMETHODIMP GetStopPosition(LONGLONG *pStop);
+ virtual STDMETHODIMP GetCurrentPosition(LONGLONG *pCurrent);
+ virtual STDMETHODIMP ConvertTimeFormat(LONGLONG *pTarget, const GUID *pTargetFormat, LONGLONG Source, const GUID *pSourceFormat);
+ virtual STDMETHODIMP SetPositions(LONGLONG *pCurrent,DWORD dwCurrentFlags,LONGLONG *pStop,DWORD dwStopFlags);
+ virtual STDMETHODIMP GetPositions(LONGLONG *pCurrent, LONGLONG *pStop);
+ virtual STDMETHODIMP GetAvailable(LONGLONG *pEarliest, LONGLONG *pLatest);
+ virtual STDMETHODIMP SetRate(double dRate);
+ virtual STDMETHODIMP GetRate(double *dRate);
+ virtual STDMETHODIMP GetPreroll(LONGLONG *pllPreroll);
+ virtual STDMETHODIMP IsUsingTimeFormat(const GUID *pFormat);
+
+protected:
+ //Member data
+ IMediaSeeking* mSeekDelegate;
+ HRESULT mHR;
+ DWORD mSeekingCap;
+
+ //Debug only.
+ //fstream seekDebug;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfSeeking/BasicSeekable.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfSeeking/dsfSeeking.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfSeeking/dsfSeeking.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfSeeking/dsfSeeking.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,21 +1,21 @@
-// dsfSeeking.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-#include "dsfSeeking.h"
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
-}
-
+// dsfSeeking.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+#include "dsfSeeking.h"
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ switch (ul_reason_for_call)
+ {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
+}
+
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfSeeking/dsfSeeking.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfSeeking/dsfSeeking.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfSeeking/dsfSeeking.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfSeeking/dsfSeeking.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,12 +1,12 @@
-// The following ifdef block is the standard way of creating macros which make exporting
-// from a DLL simpler. All files within this DLL are compiled with the DSFSEEKING_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see
-// DSFSEEKING_API functions as being imported from a DLL, whereas this DLL sees symbols
-// defined with this macro as being exported.
-#ifdef DSFSEEKING_EXPORTS
-#define DSFSEEKING_API __declspec(dllexport)
-#else
-#define DSFSEEKING_API __declspec(dllimport)
-#endif
-
+// The following ifdef block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the DSFSEEKING_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// DSFSEEKING_API functions as being imported from a DLL, whereas this DLL sees symbols
+// defined with this macro as being exported.
+#ifdef DSFSEEKING_EXPORTS
+#define DSFSEEKING_API __declspec(dllexport)
+#else
+#define DSFSEEKING_API __declspec(dllimport)
+#endif
+
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfSeeking/dsfSeeking.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfSeeking/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfSeeking/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfSeeking/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// dsfSeeking.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// dsfSeeking.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfSeeking/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfSeeking/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfSeeking/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfSeeking/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,13 +1,13 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-// TODO: reference additional headers your program requires here
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+// TODO: reference additional headers your program requires here
#include <streams.h>
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfSeeking/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9Filter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9Filter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9Filter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,413 +1,413 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "subtitlevmr9filter.h"
-
-
-//COM Factory Template
-CFactoryTemplate g_Templates[] =
-{
- {
- L"Subtitle VMR9 Filter", // Name
- &CLSID_SubtitleVMR9Filter, // CLSID
- SubtitleVMR9Filter::CreateInstance, // Method to create an instance of Speex Decoder
- NULL, // Initialization function
- NULL // Set-up information (for filters)
- }
-
-};
-
-// Generic way of determining the number of items in the template
-int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
-
-CUnknown* WINAPI SubtitleVMR9Filter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
-{
- //This routine is the COM implementation to create a new Filter
- SubtitleVMR9Filter *pNewObject = new SubtitleVMR9Filter();
- if (pNewObject == NULL) {
- *pHr = E_OUTOFMEMORY;
- }
- return pNewObject;
-}
-
-SubtitleVMR9Filter::SubtitleVMR9Filter(void)
- : CBaseRenderer(CLSID_SubtitleVMR9Filter, NAME("Subtitle VMR9 Filter") ,NULL,&mHR)
- , mBitmapMixer(NULL)
- , mVideoWindow(NULL)
- , mWindowLess(NULL)
-{
- //debugLog.open("G:\\logs\\vmr9_subs.log", ios_base::out);
- //mOutputPin = new SubtitleVMR9OutputPin(this, m_pLock, NAME("SubtitleVMR9OutputPin"), L"Subtitle Out");
-}
-
-SubtitleVMR9Filter::~SubtitleVMR9Filter(void)
-{
- //debugLog<<"Destructor for subtitle renderer"<<endl;
- //debugLog.close();
-
- if (mBitmapMixer != NULL) {
- mBitmapMixer->Release();
- }
-
- if (mVideoWindow != NULL) {
- mVideoWindow->Release();
- }
-
- if (mWindowLess != NULL) {
- mWindowLess->Release();
- }
-}
-
-STDMETHODIMP SubtitleVMR9Filter::GetState(DWORD dw, FILTER_STATE *pState)
-{
- CheckPointer(pState, E_POINTER);
- *pState = m_State;
- if (m_State == State_Paused) {
- return VFW_S_CANT_CUE;
- } else {
- return S_OK;
- }
-}
-int SubtitleVMR9Filter::GetPinCount(void) {
- return 1;
-}
-CBasePin* SubtitleVMR9Filter::GetPin(int inPinNo) {
- if (inPinNo == 0) {
- return CBaseRenderer::GetPin(inPinNo);
- } else {
- return NULL;
- }
-}
-
-HRESULT SubtitleVMR9Filter::CheckMediaType(const CMediaType* inMediaType) {
- return S_OK;
-}
-HRESULT SubtitleVMR9Filter::DoRenderSample(IMediaSample* inMediaSample) {
- //debugLog<<"DoRenderSample : "<<endl;
- LONGLONG locStart, locEnd;
- inMediaSample->GetTime(&locStart, &locEnd);
- //debugLog<<"DoRenderSample : Time = "<<locStart<<" to "<<locEnd<<endl;
- inMediaSample->GetMediaTime(&locStart, &locEnd);
- //debugLog<<"DoRenderSample : Media Time = "<<locStart<<" to "<<locEnd<<endl;
- static int c = 0;
- const int hm = 50;
- if (mBitmapMixer == NULL) {
- IFilterGraph* locFilterGraph = NULL;
- locFilterGraph = GetFilterGraph();
-
-
- IBaseFilter* locVMR9 = NULL;
- HRESULT locHR = locFilterGraph->FindFilterByName(L"Video Mixing Renderer 9", &locVMR9);
- if (locVMR9 != NULL) {
- //debugLog<<"DoRenderSample : Getting VMR9 pointer..."<<endl;
- HRESULT locHR = locVMR9->QueryInterface(IID_IVMRMixerBitmap9, (void**)&mBitmapMixer);
- locHR = locVMR9->QueryInterface(IID_IVMRWindowlessControl9, (void**)&mWindowLess);
-
- locHR = locVMR9->QueryInterface(IID_IVideoWindow, (void**)&mVideoWindow);
- locVMR9->Release();
- } else {
- return S_OK;
- }
- } else {
- /*c++;
- string x;
- switch ((c / hm) % 4) {
- case 0:
- x = "One";
- SetSubtitle(x);
- break;
- case 1:
- x = "Two";
- SetSubtitle(x);
- break;
-
- case 2:
- x = "Three";
- SetSubtitle(x);
- break;
- case 3:
- x = "Four";
- SetSubtitle(x);
- break;
- default:
- break;
-
-
- }*/
-
- if (inMediaSample->GetActualDataLength() > 0) {
- wchar_t* locStr = NULL;
- BYTE* locBuff = NULL;
- inMediaSample->GetPointer(&locBuff);
- locStr = new wchar_t[inMediaSample->GetActualDataLength() / sizeof(wchar_t)];
- memcpy((void*)locStr, (const void*) locBuff, inMediaSample->GetActualDataLength());
- wstring x = locStr;
- //debugLog<<"DoRenderSample : Subtile = "<<x<<endl;
- SetSubtitle(x);
- //debugLog<<"DoRenderSample : SetSubtitle Returns"<<endl<<endl;
- delete locStr;
- } else {
- //debugLog<<"DoRenderSample : Clearing Subtitle..."<<endl;
- SetSubtitle(L"");
- }
-
-
- return S_OK;
- }
- //debugLog<<"DoRenderSample : NEVER SHOULD BE HERE !!!!!!"<<endl;
-}
-
-
-
-
-HRESULT SubtitleVMR9Filter::SetSubtitle(wstring inSubtitle) {
- // LONG cx, cy;
- // HRESULT locHR;
-
- // // Read the default video size
- // //hr = pWC->GetNativeVideoSize(&cx, &cy, NULL, NULL);
- // //if (FAILED(hr))
- // //{
- // // Msg(TEXT("GetNativeVideoSize FAILED! hr=0x%x\r\n"), hr);
- // // return hr;
- // //}
-
- // // Create a device context compatible with the current window
-
- //locHR = mBitmapMixer->GetAlphaBitmapParameters(&mAlphaBitmap);
- // //HDC hdc = GetDC(hwndApp);
- // HDC locHDCBitmap = CreateCompatibleDC(mAlphaBitmap.hdc);
-
- // // Write with a known font by selecting it into our HDC
- // HFONT locFontHandle = (HFONT) SelectObject(locHDCBitmap, g_hFont);
-
- // // Determine the length of the string, then determine the
- // // dimensions (in pixels) of the character string using the
- // // currently selected font. These dimensions are used to create
- // // a bitmap below.
- // int locLength, locTextBmpWidth, locTextBmpHeight;
- // SIZE sz={0};
- // locLength = inSubtitle.size();
- // GetTextExtentPoint32(locHDCBitmap, inSubtitle.c_str(), locLength, &sz);
- // locTextBmpHeight = sz.cy;
- // locTextBmpWidth = sz.cx;
-
- // // Create a new bitmap that is compatible with the current window
- // HBITMAP locBitmapHandle = CreateCompatibleBitmap(mAlphaBitmap.hdc, locTextBmpWidth, locTextBmpHeight);
- // //ReleaseDC(hwndApp, hdc);
-
- // // Select our bitmap into the device context and save the old one
- // BITMAP locBitmap;
- // HBITMAP locOldBitmapHandle;
- // GetObject(locBitmapHandle, sizeof(locBitmap), &locBitmap);
- // locOldBitmapHandle = (HBITMAP)SelectObject(locBitmapHandle, locBitmapHandle);
-
- // // Set initial bitmap settings
- // RECT rcText;
- // SetRect(&rcText, 0, 0, nTextBmpWidth, nTextBmpHeight);
- // SetBkColor(locBitmapHandle, RGB(255, 255, 255)); // Pure white background
- // SetTextColor(locBitmapHandle, g_rgbColors); // Write text with requested color
-
- // // Draw the requested text string onto the bitmap
- // TextOut(locBitmapHandle, 0, 0, inSubtitle.c_str(), locLength);
-
- // // Configure the VMR's bitmap structure
- // //VMR9AlphaBitmap bmpInfo;
- // ZeroMemory(&mAlphaBitmap, sizeof(mAlphaBitmap) );
- // mAlphaBitmap.dwFlags = VMRBITMAP_HDC;
- // mAlphaBitmap.hdc = locHDCBitmap; // DC which has selected our bitmap
-
- // // Remember the width of this new bitmap
- // g_nImageWidth = bm.bmWidth;
-
- // // Save the ratio of the bitmap's width to the width of the video file.
- // // This value is used to reposition the bitmap in composition space.
- // g_fBitmapCompWidth = (float)g_nImageWidth / (float)cx;
-
- // // Display the bitmap in the bottom right corner.
- // // rSrc specifies the source rectangle in the GDI device context
- // // rDest specifies the destination rectangle in composition space (0.0f to 1.0f)
- // mAlphaBitmap.rDest.left = 0.0f + X_EDGE_BUFFER;
- // mAlphaBitmap.rDest.right = 1.0f - X_EDGE_BUFFER;
- // mAlphaBitmap.rDest.top = (float)(cy - bm.bmHeight) / (float)cy - Y_EDGE_BUFFER;
- // bmAlphaBitmap.rDest.bottom = 1.0f - Y_EDGE_BUFFER;
- // mAlphaBitmap.rSrc = rcText;
-
- // // Transparency value 1.0 is opaque, 0.0 is transparent.
- // mAlphaBitmap.fAlpha = TRANSPARENCY_VALUE;
-
- // // Set the COLORREF so that the bitmap outline will be transparent
- // SetColorRef(mAlphaBitmap);
-
- // // Give the bitmap to the VMR for display
- // locHR = mBitmapMixer->SetAlphaBitmap(&mAlphaBitmap);
- // if (FAILED(hr))
- // Msg(TEXT("SetAlphaBitmap FAILED! hr=0x%x\r\n\r\n%s\0"), hr,
- // STR_VMR_DISPLAY_WARNING);
-
- // // Select the initial objects back into our device context
- // DeleteObject(SelectObject(locBitmapHDC,locOldBitmapHandle ));
- // SelectObject(locHDCBitmap, locFont);
-
- // // Clean up resources
- // DeleteObject(hbm);
- // DeleteDC(hdcBmp);
-
- // return hr;
-
-
- // Text font information
- HFONT g_hFont=0;
- LONG g_lFontPointSize = DEFAULT_FONT_SIZE;
- COLORREF g_rgbColors = DEFAULT_FONT_COLOR;
- TCHAR g_szFontName[100] = {DEFAULT_FONT_NAME};
- TCHAR g_szFontStyle[32] = {DEFAULT_FONT_STYLE};
-
- LONG cx, cy;
- HRESULT hr;
-
- // Read the default video size
- if (mWindowLess != NULL) {
- hr = mWindowLess->GetNativeVideoSize(&cx, &cy, NULL, NULL);
- } else {
- mVideoWindow->get_Width(&cx);
- mVideoWindow->get_Height(&cy);
- }
- //if (FAILED(hr))
- //{
- // Msg(TEXT("GetNativeVideoSize FAILED! hr=0x%x\r\n"), hr);
- // return hr;
- //}
-
- // Create a device context compatible with the current window
- hr = mBitmapMixer->GetAlphaBitmapParameters(&mAlphaBitmap);
- //HWND hwndApp;
- //OAHWND oah;
- //mVideoWindow->get_Owner(&oah);
- HDC hdc = GetDC(NULL);
- //HDC hdc = mAlphaBitmap.hdc;
- HDC hdcBmp = CreateCompatibleDC(hdc);
-
- // Write with a known font by selecting it into our HDC
- HFONT hOldFont = (HFONT) SelectObject(hdcBmp, g_hFont);
-
- // Determine the length of the string, then determine the
- // dimensions (in pixels) of the character string using the
- // currently selected font. These dimensions are used to create
- // a bitmap below.
- int nLength, nTextBmpWidth, nTextBmpHeight;
- SIZE sz={0};
-
- TCHAR* szNewText = (TCHAR*)inSubtitle.c_str();//_T("Annodex Me Baby !");//inSubtitle.c_str();
- nLength = _tcslen(szNewText); ;//(int) inSubtitle.size();
-
- GetTextExtentPoint32(hdcBmp, szNewText, nLength, &sz);
- nTextBmpHeight = sz.cy;
- nTextBmpWidth = sz.cx;
-
- // Create a new bitmap that is compatible with the current window
- HBITMAP hbm = CreateCompatibleBitmap(hdc, nTextBmpWidth, nTextBmpHeight);
- //ReleaseDC(hwndApp, hdc);
-
- // Select our bitmap into the device context and save the old one
- BITMAP bm;
- HBITMAP hbmOld;
- GetObject(hbm, sizeof(bm), &bm);
- hbmOld = (HBITMAP)SelectObject(hdcBmp, hbm);
-
- // Set initial bitmap settings
- RECT rcText;
- SetRect(&rcText, 0, 0, nTextBmpWidth, nTextBmpHeight);
- SetBkColor(hdcBmp, RGB(255, 255, 255)); // Pure white background
- SetTextColor(hdcBmp, g_rgbColors); // Write text with requested color
-
- // Draw the requested text string onto the bitmap
- BOOL ret = TextOut(hdcBmp, 0, 0, szNewText, nLength);
-
- // Configure the VMR's bitmap structure
- VMR9AlphaBitmap bmpInfo;
- ZeroMemory(&bmpInfo, sizeof(bmpInfo) );
- bmpInfo.dwFlags = VMRBITMAP_HDC;
- bmpInfo.hdc = hdcBmp; // DC which has selected our bitmap
-
- // Remember the width of this new bitmap
- //g_nImageWidth = bm.bmWidth;
-
- // Save the ratio of the bitmap's width to the width of the video file.
- // This value is used to reposition the bitmap in composition space.
- //g_fBitmapCompWidth = (float)g_nImageWidth / (float)cx;
-
- // Display the bitmap in the bottom right corner.
- // rSrc specifies the source rectangle in the GDI device context
- // rDest specifies the destination rectangle in composition space (0.0f to 1.0f)
-
- const float X_EDGE_BUFFER=0.05f; // Pixel buffer between bitmap and window edge
- // (represented in composition space [0 - 1.0f])
- const float Y_EDGE_BUFFER=0.05f;
-
- bmpInfo.rDest.left = 0.0f + X_EDGE_BUFFER;
- bmpInfo.rDest.right = 1.0f - X_EDGE_BUFFER;
- bmpInfo.rDest.top = (float)(cy - bm.bmHeight) / (float)cy - Y_EDGE_BUFFER;
- //bmpInfo.rDest.top = (float)(200.0f - bm.bmHeight) / (float)200.0f - Y_EDGE_BUFFER;
- //bmpInfo.rDest.top = 0.8f;//(float)(200.0f - bm.bmHeight) / (float)200.0f - Y_EDGE_BUFFER;
- bmpInfo.rDest.bottom = 1.0f - Y_EDGE_BUFFER;
- bmpInfo.rSrc = rcText;
-
- // Transparency value 1.0 is opaque, 0.0 is transparent.
- bmpInfo.fAlpha = TRANSPARENCY_VALUE;
-
- // Set the COLORREF so that the bitmap outline will be transparent
- SetColorRef(bmpInfo);
-
- // Give the bitmap to the VMR for display
- hr = mBitmapMixer->SetAlphaBitmap(&bmpInfo);
- //if (FAILED(hr))
- //Msg(TEXT("SetAlphaBitmap FAILED! hr=0x%x\r\n\r\n%s\0"), hr,
- // STR_VMR_DISPLAY_WARNING);
-
- // Select the initial objects back into our device context
- DeleteObject(SelectObject(hdcBmp, hbmOld));
- SelectObject(hdc, hOldFont);
-
- // Clean up resources
- DeleteObject(hbm);
- DeleteDC(hdcBmp);
-
- //debugLog<<"SetSubtitle : End of method: hr = "<<hr<<endl;
- return hr;
-}
-
-void SubtitleVMR9Filter::SetColorRef(VMR9AlphaBitmap& bmpInfo)
-{
- // Set the COLORREF so that the bitmap outline will be transparent
- bmpInfo.clrSrcKey = RGB(255, 255, 255); // Pure white
- bmpInfo.dwFlags |= VMRBITMAP_SRCCOLORKEY;
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "subtitlevmr9filter.h"
+
+
+//COM Factory Template
+CFactoryTemplate g_Templates[] =
+{
+ {
+ L"Subtitle VMR9 Filter", // Name
+ &CLSID_SubtitleVMR9Filter, // CLSID
+ SubtitleVMR9Filter::CreateInstance, // Method to create an instance of Speex Decoder
+ NULL, // Initialization function
+ NULL // Set-up information (for filters)
+ }
+
+};
+
+// Generic way of determining the number of items in the template
+int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
+
+CUnknown* WINAPI SubtitleVMR9Filter::CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr)
+{
+ //This routine is the COM implementation to create a new Filter
+ SubtitleVMR9Filter *pNewObject = new SubtitleVMR9Filter();
+ if (pNewObject == NULL) {
+ *pHr = E_OUTOFMEMORY;
+ }
+ return pNewObject;
+}
+
+SubtitleVMR9Filter::SubtitleVMR9Filter(void)
+ : CBaseRenderer(CLSID_SubtitleVMR9Filter, NAME("Subtitle VMR9 Filter") ,NULL,&mHR)
+ , mBitmapMixer(NULL)
+ , mVideoWindow(NULL)
+ , mWindowLess(NULL)
+{
+ //debugLog.open("G:\\logs\\vmr9_subs.log", ios_base::out);
+ //mOutputPin = new SubtitleVMR9OutputPin(this, m_pLock, NAME("SubtitleVMR9OutputPin"), L"Subtitle Out");
+}
+
+SubtitleVMR9Filter::~SubtitleVMR9Filter(void)
+{
+ //debugLog<<"Destructor for subtitle renderer"<<endl;
+ //debugLog.close();
+
+ if (mBitmapMixer != NULL) {
+ mBitmapMixer->Release();
+ }
+
+ if (mVideoWindow != NULL) {
+ mVideoWindow->Release();
+ }
+
+ if (mWindowLess != NULL) {
+ mWindowLess->Release();
+ }
+}
+
+STDMETHODIMP SubtitleVMR9Filter::GetState(DWORD dw, FILTER_STATE *pState)
+{
+ CheckPointer(pState, E_POINTER);
+ *pState = m_State;
+ if (m_State == State_Paused) {
+ return VFW_S_CANT_CUE;
+ } else {
+ return S_OK;
+ }
+}
+int SubtitleVMR9Filter::GetPinCount(void) {
+ return 1;
+}
+CBasePin* SubtitleVMR9Filter::GetPin(int inPinNo) {
+ if (inPinNo == 0) {
+ return CBaseRenderer::GetPin(inPinNo);
+ } else {
+ return NULL;
+ }
+}
+
+HRESULT SubtitleVMR9Filter::CheckMediaType(const CMediaType* inMediaType) {
+ return S_OK;
+}
+HRESULT SubtitleVMR9Filter::DoRenderSample(IMediaSample* inMediaSample) {
+ //debugLog<<"DoRenderSample : "<<endl;
+ LONGLONG locStart, locEnd;
+ inMediaSample->GetTime(&locStart, &locEnd);
+ //debugLog<<"DoRenderSample : Time = "<<locStart<<" to "<<locEnd<<endl;
+ inMediaSample->GetMediaTime(&locStart, &locEnd);
+ //debugLog<<"DoRenderSample : Media Time = "<<locStart<<" to "<<locEnd<<endl;
+ static int c = 0;
+ const int hm = 50;
+ if (mBitmapMixer == NULL) {
+ IFilterGraph* locFilterGraph = NULL;
+ locFilterGraph = GetFilterGraph();
+
+
+ IBaseFilter* locVMR9 = NULL;
+ HRESULT locHR = locFilterGraph->FindFilterByName(L"Video Mixing Renderer 9", &locVMR9);
+ if (locVMR9 != NULL) {
+ //debugLog<<"DoRenderSample : Getting VMR9 pointer..."<<endl;
+ HRESULT locHR = locVMR9->QueryInterface(IID_IVMRMixerBitmap9, (void**)&mBitmapMixer);
+ locHR = locVMR9->QueryInterface(IID_IVMRWindowlessControl9, (void**)&mWindowLess);
+
+ locHR = locVMR9->QueryInterface(IID_IVideoWindow, (void**)&mVideoWindow);
+ locVMR9->Release();
+ } else {
+ return S_OK;
+ }
+ } else {
+ /*c++;
+ string x;
+ switch ((c / hm) % 4) {
+ case 0:
+ x = "One";
+ SetSubtitle(x);
+ break;
+ case 1:
+ x = "Two";
+ SetSubtitle(x);
+ break;
+
+ case 2:
+ x = "Three";
+ SetSubtitle(x);
+ break;
+ case 3:
+ x = "Four";
+ SetSubtitle(x);
+ break;
+ default:
+ break;
+
+
+ }*/
+
+ if (inMediaSample->GetActualDataLength() > 0) {
+ wchar_t* locStr = NULL;
+ BYTE* locBuff = NULL;
+ inMediaSample->GetPointer(&locBuff);
+ locStr = new wchar_t[inMediaSample->GetActualDataLength() / sizeof(wchar_t)];
+ memcpy((void*)locStr, (const void*) locBuff, inMediaSample->GetActualDataLength());
+ wstring x = locStr;
+ //debugLog<<"DoRenderSample : Subtile = "<<x<<endl;
+ SetSubtitle(x);
+ //debugLog<<"DoRenderSample : SetSubtitle Returns"<<endl<<endl;
+ delete locStr;
+ } else {
+ //debugLog<<"DoRenderSample : Clearing Subtitle..."<<endl;
+ SetSubtitle(L"");
+ }
+
+
+ return S_OK;
+ }
+ //debugLog<<"DoRenderSample : NEVER SHOULD BE HERE !!!!!!"<<endl;
+}
+
+
+
+
+HRESULT SubtitleVMR9Filter::SetSubtitle(wstring inSubtitle) {
+ // LONG cx, cy;
+ // HRESULT locHR;
+
+ // // Read the default video size
+ // //hr = pWC->GetNativeVideoSize(&cx, &cy, NULL, NULL);
+ // //if (FAILED(hr))
+ // //{
+ // // Msg(TEXT("GetNativeVideoSize FAILED! hr=0x%x\r\n"), hr);
+ // // return hr;
+ // //}
+
+ // // Create a device context compatible with the current window
+
+ //locHR = mBitmapMixer->GetAlphaBitmapParameters(&mAlphaBitmap);
+ // //HDC hdc = GetDC(hwndApp);
+ // HDC locHDCBitmap = CreateCompatibleDC(mAlphaBitmap.hdc);
+
+ // // Write with a known font by selecting it into our HDC
+ // HFONT locFontHandle = (HFONT) SelectObject(locHDCBitmap, g_hFont);
+
+ // // Determine the length of the string, then determine the
+ // // dimensions (in pixels) of the character string using the
+ // // currently selected font. These dimensions are used to create
+ // // a bitmap below.
+ // int locLength, locTextBmpWidth, locTextBmpHeight;
+ // SIZE sz={0};
+ // locLength = inSubtitle.size();
+ // GetTextExtentPoint32(locHDCBitmap, inSubtitle.c_str(), locLength, &sz);
+ // locTextBmpHeight = sz.cy;
+ // locTextBmpWidth = sz.cx;
+
+ // // Create a new bitmap that is compatible with the current window
+ // HBITMAP locBitmapHandle = CreateCompatibleBitmap(mAlphaBitmap.hdc, locTextBmpWidth, locTextBmpHeight);
+ // //ReleaseDC(hwndApp, hdc);
+
+ // // Select our bitmap into the device context and save the old one
+ // BITMAP locBitmap;
+ // HBITMAP locOldBitmapHandle;
+ // GetObject(locBitmapHandle, sizeof(locBitmap), &locBitmap);
+ // locOldBitmapHandle = (HBITMAP)SelectObject(locBitmapHandle, locBitmapHandle);
+
+ // // Set initial bitmap settings
+ // RECT rcText;
+ // SetRect(&rcText, 0, 0, nTextBmpWidth, nTextBmpHeight);
+ // SetBkColor(locBitmapHandle, RGB(255, 255, 255)); // Pure white background
+ // SetTextColor(locBitmapHandle, g_rgbColors); // Write text with requested color
+
+ // // Draw the requested text string onto the bitmap
+ // TextOut(locBitmapHandle, 0, 0, inSubtitle.c_str(), locLength);
+
+ // // Configure the VMR's bitmap structure
+ // //VMR9AlphaBitmap bmpInfo;
+ // ZeroMemory(&mAlphaBitmap, sizeof(mAlphaBitmap) );
+ // mAlphaBitmap.dwFlags = VMRBITMAP_HDC;
+ // mAlphaBitmap.hdc = locHDCBitmap; // DC which has selected our bitmap
+
+ // // Remember the width of this new bitmap
+ // g_nImageWidth = bm.bmWidth;
+
+ // // Save the ratio of the bitmap's width to the width of the video file.
+ // // This value is used to reposition the bitmap in composition space.
+ // g_fBitmapCompWidth = (float)g_nImageWidth / (float)cx;
+
+ // // Display the bitmap in the bottom right corner.
+ // // rSrc specifies the source rectangle in the GDI device context
+ // // rDest specifies the destination rectangle in composition space (0.0f to 1.0f)
+ // mAlphaBitmap.rDest.left = 0.0f + X_EDGE_BUFFER;
+ // mAlphaBitmap.rDest.right = 1.0f - X_EDGE_BUFFER;
+ // mAlphaBitmap.rDest.top = (float)(cy - bm.bmHeight) / (float)cy - Y_EDGE_BUFFER;
+ // bmAlphaBitmap.rDest.bottom = 1.0f - Y_EDGE_BUFFER;
+ // mAlphaBitmap.rSrc = rcText;
+
+ // // Transparency value 1.0 is opaque, 0.0 is transparent.
+ // mAlphaBitmap.fAlpha = TRANSPARENCY_VALUE;
+
+ // // Set the COLORREF so that the bitmap outline will be transparent
+ // SetColorRef(mAlphaBitmap);
+
+ // // Give the bitmap to the VMR for display
+ // locHR = mBitmapMixer->SetAlphaBitmap(&mAlphaBitmap);
+ // if (FAILED(hr))
+ // Msg(TEXT("SetAlphaBitmap FAILED! hr=0x%x\r\n\r\n%s\0"), hr,
+ // STR_VMR_DISPLAY_WARNING);
+
+ // // Select the initial objects back into our device context
+ // DeleteObject(SelectObject(locBitmapHDC,locOldBitmapHandle ));
+ // SelectObject(locHDCBitmap, locFont);
+
+ // // Clean up resources
+ // DeleteObject(hbm);
+ // DeleteDC(hdcBmp);
+
+ // return hr;
+
+
+ // Text font information
+ HFONT g_hFont=0;
+ LONG g_lFontPointSize = DEFAULT_FONT_SIZE;
+ COLORREF g_rgbColors = DEFAULT_FONT_COLOR;
+ TCHAR g_szFontName[100] = {DEFAULT_FONT_NAME};
+ TCHAR g_szFontStyle[32] = {DEFAULT_FONT_STYLE};
+
+ LONG cx, cy;
+ HRESULT hr;
+
+ // Read the default video size
+ if (mWindowLess != NULL) {
+ hr = mWindowLess->GetNativeVideoSize(&cx, &cy, NULL, NULL);
+ } else {
+ mVideoWindow->get_Width(&cx);
+ mVideoWindow->get_Height(&cy);
+ }
+ //if (FAILED(hr))
+ //{
+ // Msg(TEXT("GetNativeVideoSize FAILED! hr=0x%x\r\n"), hr);
+ // return hr;
+ //}
+
+ // Create a device context compatible with the current window
+ hr = mBitmapMixer->GetAlphaBitmapParameters(&mAlphaBitmap);
+ //HWND hwndApp;
+ //OAHWND oah;
+ //mVideoWindow->get_Owner(&oah);
+ HDC hdc = GetDC(NULL);
+ //HDC hdc = mAlphaBitmap.hdc;
+ HDC hdcBmp = CreateCompatibleDC(hdc);
+
+ // Write with a known font by selecting it into our HDC
+ HFONT hOldFont = (HFONT) SelectObject(hdcBmp, g_hFont);
+
+ // Determine the length of the string, then determine the
+ // dimensions (in pixels) of the character string using the
+ // currently selected font. These dimensions are used to create
+ // a bitmap below.
+ int nLength, nTextBmpWidth, nTextBmpHeight;
+ SIZE sz={0};
+
+ TCHAR* szNewText = (TCHAR*)inSubtitle.c_str();//_T("Annodex Me Baby !");//inSubtitle.c_str();
+ nLength = _tcslen(szNewText); ;//(int) inSubtitle.size();
+
+ GetTextExtentPoint32(hdcBmp, szNewText, nLength, &sz);
+ nTextBmpHeight = sz.cy;
+ nTextBmpWidth = sz.cx;
+
+ // Create a new bitmap that is compatible with the current window
+ HBITMAP hbm = CreateCompatibleBitmap(hdc, nTextBmpWidth, nTextBmpHeight);
+ //ReleaseDC(hwndApp, hdc);
+
+ // Select our bitmap into the device context and save the old one
+ BITMAP bm;
+ HBITMAP hbmOld;
+ GetObject(hbm, sizeof(bm), &bm);
+ hbmOld = (HBITMAP)SelectObject(hdcBmp, hbm);
+
+ // Set initial bitmap settings
+ RECT rcText;
+ SetRect(&rcText, 0, 0, nTextBmpWidth, nTextBmpHeight);
+ SetBkColor(hdcBmp, RGB(255, 255, 255)); // Pure white background
+ SetTextColor(hdcBmp, g_rgbColors); // Write text with requested color
+
+ // Draw the requested text string onto the bitmap
+ BOOL ret = TextOut(hdcBmp, 0, 0, szNewText, nLength);
+
+ // Configure the VMR's bitmap structure
+ VMR9AlphaBitmap bmpInfo;
+ ZeroMemory(&bmpInfo, sizeof(bmpInfo) );
+ bmpInfo.dwFlags = VMRBITMAP_HDC;
+ bmpInfo.hdc = hdcBmp; // DC which has selected our bitmap
+
+ // Remember the width of this new bitmap
+ //g_nImageWidth = bm.bmWidth;
+
+ // Save the ratio of the bitmap's width to the width of the video file.
+ // This value is used to reposition the bitmap in composition space.
+ //g_fBitmapCompWidth = (float)g_nImageWidth / (float)cx;
+
+ // Display the bitmap in the bottom right corner.
+ // rSrc specifies the source rectangle in the GDI device context
+ // rDest specifies the destination rectangle in composition space (0.0f to 1.0f)
+
+ const float X_EDGE_BUFFER=0.05f; // Pixel buffer between bitmap and window edge
+ // (represented in composition space [0 - 1.0f])
+ const float Y_EDGE_BUFFER=0.05f;
+
+ bmpInfo.rDest.left = 0.0f + X_EDGE_BUFFER;
+ bmpInfo.rDest.right = 1.0f - X_EDGE_BUFFER;
+ bmpInfo.rDest.top = (float)(cy - bm.bmHeight) / (float)cy - Y_EDGE_BUFFER;
+ //bmpInfo.rDest.top = (float)(200.0f - bm.bmHeight) / (float)200.0f - Y_EDGE_BUFFER;
+ //bmpInfo.rDest.top = 0.8f;//(float)(200.0f - bm.bmHeight) / (float)200.0f - Y_EDGE_BUFFER;
+ bmpInfo.rDest.bottom = 1.0f - Y_EDGE_BUFFER;
+ bmpInfo.rSrc = rcText;
+
+ // Transparency value 1.0 is opaque, 0.0 is transparent.
+ bmpInfo.fAlpha = TRANSPARENCY_VALUE;
+
+ // Set the COLORREF so that the bitmap outline will be transparent
+ SetColorRef(bmpInfo);
+
+ // Give the bitmap to the VMR for display
+ hr = mBitmapMixer->SetAlphaBitmap(&bmpInfo);
+ //if (FAILED(hr))
+ //Msg(TEXT("SetAlphaBitmap FAILED! hr=0x%x\r\n\r\n%s\0"), hr,
+ // STR_VMR_DISPLAY_WARNING);
+
+ // Select the initial objects back into our device context
+ DeleteObject(SelectObject(hdcBmp, hbmOld));
+ SelectObject(hdc, hOldFont);
+
+ // Clean up resources
+ DeleteObject(hbm);
+ DeleteDC(hdcBmp);
+
+ //debugLog<<"SetSubtitle : End of method: hr = "<<hr<<endl;
+ return hr;
+}
+
+void SubtitleVMR9Filter::SetColorRef(VMR9AlphaBitmap& bmpInfo)
+{
+ // Set the COLORREF so that the bitmap outline will be transparent
+ bmpInfo.clrSrcKey = RGB(255, 255, 255); // Pure white
+ bmpInfo.dwFlags |= VMRBITMAP_SRCCOLORKEY;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9Filter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9Filter.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9Filter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9Filter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,94 +1,94 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "subtitledllstuff.h"
-#include <d3d9.h>
-#include <vmr9.h>
-#include <tchar.h>
-#include <string>
-//Debug only
-#include <fstream>
-//
-using namespace std;
-
-#define TRANSPARENCY_VALUE (0.8f)
-
-#define PURE_WHITE RGB(255,255,255)
-#define ALMOST_WHITE RGB(250,250,250)
-
-#define BLEND_TEXT TEXT("This is a demonstration of alpha-blended dynamic text.\0")
-#define DYNAMIC_TEXT_SIZE 255
-
-#define DEFAULT_FONT_NAME TEXT("Impact\0")
-#define DEFAULT_FONT_STYLE TEXT("Regular\0")
-#define DEFAULT_FONT_SIZE 12
-#define DEFAULT_FONT_COLOR RGB(255,0,0)
-#define MAX_FONT_SIZE 25
-
-class SubtitleVMR9OutputPin;
-
-class SubtitleVMR9Filter
- : public CBaseRenderer
-{
-public:
- DECLARE_IUNKNOWN
- static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
- SubtitleVMR9Filter(void);
- virtual ~SubtitleVMR9Filter(void);
-
- //Base Filter Implementation
- virtual int GetPinCount(void);
- virtual CBasePin* GetPin(int inPinNo);
-
- HRESULT CheckMediaType(const CMediaType* inMediaType);
- HRESULT DoRenderSample(IMediaSample *pMediaSample);
-
- //IMediaFilter OVerride - This lets us tell the graph we may not produce data in pause state so don't block.
- virtual STDMETHODIMP GetState(DWORD dw, FILTER_STATE *pState);
-
-
-
-
-protected:
- void SetColorRef(VMR9AlphaBitmap& bmpInfo);
- HRESULT mHR;
- //SubtitleVMR9OutputPin* mOutputPin;
- virtual HRESULT SetSubtitle(wstring inSubtitle);
- IVideoWindow* mVideoWindow;
- IVMRMixerBitmap9* mBitmapMixer;
- IVMRWindowlessControl9* mWindowLess;
- VMR9AlphaBitmap mAlphaBitmap;
-
- //debug only
- //fstream debugLog;
- //
-};
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "subtitledllstuff.h"
+#include <d3d9.h>
+#include <vmr9.h>
+#include <tchar.h>
+#include <string>
+//Debug only
+#include <fstream>
+//
+using namespace std;
+
+#define TRANSPARENCY_VALUE (0.8f)
+
+#define PURE_WHITE RGB(255,255,255)
+#define ALMOST_WHITE RGB(250,250,250)
+
+#define BLEND_TEXT TEXT("This is a demonstration of alpha-blended dynamic text.\0")
+#define DYNAMIC_TEXT_SIZE 255
+
+#define DEFAULT_FONT_NAME TEXT("Impact\0")
+#define DEFAULT_FONT_STYLE TEXT("Regular\0")
+#define DEFAULT_FONT_SIZE 12
+#define DEFAULT_FONT_COLOR RGB(255,0,0)
+#define MAX_FONT_SIZE 25
+
+class SubtitleVMR9OutputPin;
+
+class SubtitleVMR9Filter
+ : public CBaseRenderer
+{
+public:
+ DECLARE_IUNKNOWN
+ static CUnknown* WINAPI CreateInstance(LPUNKNOWN pUnk, HRESULT *pHr);
+ SubtitleVMR9Filter(void);
+ virtual ~SubtitleVMR9Filter(void);
+
+ //Base Filter Implementation
+ virtual int GetPinCount(void);
+ virtual CBasePin* GetPin(int inPinNo);
+
+ HRESULT CheckMediaType(const CMediaType* inMediaType);
+ HRESULT DoRenderSample(IMediaSample *pMediaSample);
+
+ //IMediaFilter OVerride - This lets us tell the graph we may not produce data in pause state so don't block.
+ virtual STDMETHODIMP GetState(DWORD dw, FILTER_STATE *pState);
+
+
+
+
+protected:
+ void SetColorRef(VMR9AlphaBitmap& bmpInfo);
+ HRESULT mHR;
+ //SubtitleVMR9OutputPin* mOutputPin;
+ virtual HRESULT SetSubtitle(wstring inSubtitle);
+ IVideoWindow* mVideoWindow;
+ IVMRMixerBitmap9* mBitmapMixer;
+ IVMRWindowlessControl9* mWindowLess;
+ VMR9AlphaBitmap mAlphaBitmap;
+
+ //debug only
+ //fstream debugLog;
+ //
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9Filter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9InputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9InputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9InputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,48 +1,48 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "subtitlevmr9inputpin.h"
-
-SubtitleVMR9InputPin::SubtitleVMR9InputPin(SubtitleVMR9Filter* inParentFilter, HRESULT* inHR, LPCWSTR inPinName)
- : CRendererInputPin(inParentFilter, inHR, inPinName)
- , mParentFilter(inParentFilter)
-{
-}
-
-SubtitleVMR9InputPin::~SubtitleVMR9InputPin(void)
-{
-}
-
-HRESULT SubtitleVMR9InputPin::CheckMediaType(const CMediaType *pmt) {
- //Fix this up after testing.
- return S_OK;
-}
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "subtitlevmr9inputpin.h"
+
+SubtitleVMR9InputPin::SubtitleVMR9InputPin(SubtitleVMR9Filter* inParentFilter, HRESULT* inHR, LPCWSTR inPinName)
+ : CRendererInputPin(inParentFilter, inHR, inPinName)
+ , mParentFilter(inParentFilter)
+{
+}
+
+SubtitleVMR9InputPin::~SubtitleVMR9InputPin(void)
+{
+}
+
+HRESULT SubtitleVMR9InputPin::CheckMediaType(const CMediaType *pmt) {
+ //Fix this up after testing.
+ return S_OK;
+}
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9InputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9InputPin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9InputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9InputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,44 +1,44 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "subtitledllstuff.h"
-class SubtitleVMR9InputPin
- : public CRendererInputPin
-{
-public:
- SubtitleVMR9InputPin(SubtitleVMR9Filter* inParentFilter, HRESULT* inHR, LPCWSTR inPinName);
- virtual ~SubtitleVMR9InputPin(void);
-
- HRESULT SubtitleVMR9InputPin::CheckMediaType(const CMediaType *pmt);
-protected:
- SubtitleVMR9Filter* mParentFilter;
-};
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "subtitledllstuff.h"
+class SubtitleVMR9InputPin
+ : public CRendererInputPin
+{
+public:
+ SubtitleVMR9InputPin(SubtitleVMR9Filter* inParentFilter, HRESULT* inHR, LPCWSTR inPinName);
+ virtual ~SubtitleVMR9InputPin(void);
+
+ HRESULT SubtitleVMR9InputPin::CheckMediaType(const CMediaType *pmt);
+protected:
+ SubtitleVMR9Filter* mParentFilter;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9InputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9OutputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9OutputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9OutputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,332 +1,332 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "subtitlevmr9outputpin.h"
-
-SubtitleVMR9OutputPin::SubtitleVMR9OutputPin(SubtitleVMR9Filter* inParentFilter, CCritSec* inFilterLock, CHAR* inObjectName, LPCWSTR inPinDisplayName)
- : CBasePin(inObjectName, inParentFilter, inFilterLock, &mHR, inPinDisplayName, PINDIR_OUTPUT)
- , mParentFilter(inParentFilter)
- , mBitmapMixer(NULL)
-{
-}
-
-SubtitleVMR9OutputPin::~SubtitleVMR9OutputPin(void)
-{
-}
-
-HRESULT SubtitleVMR9OutputPin::CheckConnect(IPin* inPin) {
- //Query for the video mixing bitmap interface
- //HRESULT locHR = inPin->QueryInterface(IID_IVMRMixerBitmap9, (void**)&mBitmapMixer);
- //if (locHR == S_OK) {
- return S_OK;
- //} else {
- // return S_FALSE;
- //}
-
-
-}
-void SubtitleVMR9OutputPin::FillMediaType(CMediaType* outMediaType) {
- outMediaType->SetType(&MEDIATYPE_Video);
- outMediaType->SetSubtype(&MEDIASUBTYPE_YV12);
- outMediaType->SetFormatType(&FORMAT_VideoInfo);
- outMediaType->SetTemporalCompression(FALSE);
- outMediaType->SetSampleSize(0);
-
-}
-HRESULT SubtitleVMR9OutputPin::GetMediaType(int inPosition, CMediaType *outMediaType) {
-
- if (inPosition < 0) {
- return E_INVALIDARG;
- }
-
- if (inPosition == 0) {
- FillMediaType(outMediaType);
- VIDEOINFOHEADER* locVideoFormat = (VIDEOINFOHEADER*)outMediaType->AllocFormatBuffer(sizeof(VIDEOINFOHEADER));
- FillVideoInfoHeader(locVideoFormat);
- return S_OK;
- } else {
- return VFW_S_NO_MORE_ITEMS;
- }
-}
-
-bool SubtitleVMR9OutputPin::FillVideoInfoHeader(VIDEOINFOHEADER* inFormatBuffer) {
-
-
- inFormatBuffer->AvgTimePerFrame = (UNITS * 1) / 25;
- inFormatBuffer->dwBitRate = 0;
-
- inFormatBuffer->bmiHeader.biBitCount = 12; //12 bits per pixel
- inFormatBuffer->bmiHeader.biClrImportant = 0; //All colours important
- inFormatBuffer->bmiHeader.biClrUsed = 0; //Use max colour depth
- inFormatBuffer->bmiHeader.biCompression = MAKEFOURCC('Y','V','1','2');
- inFormatBuffer->bmiHeader.biHeight = 0; //Not sure
- inFormatBuffer->bmiHeader.biPlanes = 1; //Must be 1
- inFormatBuffer->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); //????? Size of what ?
- inFormatBuffer->bmiHeader.biSizeImage = 0; //Size in bytes of image ??
- inFormatBuffer->bmiHeader.biWidth = 0;
- inFormatBuffer->bmiHeader.biXPelsPerMeter = 2000; //Fuck knows
- inFormatBuffer->bmiHeader.biYPelsPerMeter = 2000; //" " " " "
-
- inFormatBuffer->rcSource.top = 0;
- inFormatBuffer->rcSource.bottom = 0;
- inFormatBuffer->rcSource.left = 0;
- inFormatBuffer->rcSource.right = 0;
-
- inFormatBuffer->rcTarget.top = 0;
- inFormatBuffer->rcTarget.bottom = 0;
- inFormatBuffer->rcTarget.left = 0;
- inFormatBuffer->rcTarget.right = 0;
-
- inFormatBuffer->dwBitErrorRate=0;
- return true;
-}
-HRESULT SubtitleVMR9OutputPin::CheckMediaType(const CMediaType *pmt) {
- //Fix this up after testing.
- return S_OK;
-}
-
-STDMETHODIMP SubtitleVMR9OutputPin::BeginFlush() {
- return S_OK;
-}
-STDMETHODIMP SubtitleVMR9OutputPin::EndFlush() {
- return S_OK;
-}
-
-HRESULT SubtitleVMR9OutputPin::SetSubtitle(wstring inSubtitle) {
- // LONG cx, cy;
- // HRESULT locHR;
-
- // // Read the default video size
- // //hr = pWC->GetNativeVideoSize(&cx, &cy, NULL, NULL);
- // //if (FAILED(hr))
- // //{
- // // Msg(TEXT("GetNativeVideoSize FAILED! hr=0x%x\r\n"), hr);
- // // return hr;
- // //}
-
- // // Create a device context compatible with the current window
-
- //locHR = mBitmapMixer->GetAlphaBitmapParameters(&mAlphaBitmap);
- // //HDC hdc = GetDC(hwndApp);
- // HDC locHDCBitmap = CreateCompatibleDC(mAlphaBitmap.hdc);
-
- // // Write with a known font by selecting it into our HDC
- // HFONT locFontHandle = (HFONT) SelectObject(locHDCBitmap, g_hFont);
-
- // // Determine the length of the string, then determine the
- // // dimensions (in pixels) of the character string using the
- // // currently selected font. These dimensions are used to create
- // // a bitmap below.
- // int locLength, locTextBmpWidth, locTextBmpHeight;
- // SIZE sz={0};
- // locLength = inSubtitle.size();
- // GetTextExtentPoint32(locHDCBitmap, inSubtitle.c_str(), locLength, &sz);
- // locTextBmpHeight = sz.cy;
- // locTextBmpWidth = sz.cx;
-
- // // Create a new bitmap that is compatible with the current window
- // HBITMAP locBitmapHandle = CreateCompatibleBitmap(mAlphaBitmap.hdc, locTextBmpWidth, locTextBmpHeight);
- // //ReleaseDC(hwndApp, hdc);
-
- // // Select our bitmap into the device context and save the old one
- // BITMAP locBitmap;
- // HBITMAP locOldBitmapHandle;
- // GetObject(locBitmapHandle, sizeof(locBitmap), &locBitmap);
- // locOldBitmapHandle = (HBITMAP)SelectObject(locBitmapHandle, locBitmapHandle);
-
- // // Set initial bitmap settings
- // RECT rcText;
- // SetRect(&rcText, 0, 0, nTextBmpWidth, nTextBmpHeight);
- // SetBkColor(locBitmapHandle, RGB(255, 255, 255)); // Pure white background
- // SetTextColor(locBitmapHandle, g_rgbColors); // Write text with requested color
-
- // // Draw the requested text string onto the bitmap
- // TextOut(locBitmapHandle, 0, 0, inSubtitle.c_str(), locLength);
-
- // // Configure the VMR's bitmap structure
- // //VMR9AlphaBitmap bmpInfo;
- // ZeroMemory(&mAlphaBitmap, sizeof(mAlphaBitmap) );
- // mAlphaBitmap.dwFlags = VMRBITMAP_HDC;
- // mAlphaBitmap.hdc = locHDCBitmap; // DC which has selected our bitmap
-
- // // Remember the width of this new bitmap
- // g_nImageWidth = bm.bmWidth;
-
- // // Save the ratio of the bitmap's width to the width of the video file.
- // // This value is used to reposition the bitmap in composition space.
- // g_fBitmapCompWidth = (float)g_nImageWidth / (float)cx;
-
- // // Display the bitmap in the bottom right corner.
- // // rSrc specifies the source rectangle in the GDI device context
- // // rDest specifies the destination rectangle in composition space (0.0f to 1.0f)
- // mAlphaBitmap.rDest.left = 0.0f + X_EDGE_BUFFER;
- // mAlphaBitmap.rDest.right = 1.0f - X_EDGE_BUFFER;
- // mAlphaBitmap.rDest.top = (float)(cy - bm.bmHeight) / (float)cy - Y_EDGE_BUFFER;
- // bmAlphaBitmap.rDest.bottom = 1.0f - Y_EDGE_BUFFER;
- // mAlphaBitmap.rSrc = rcText;
-
- // // Transparency value 1.0 is opaque, 0.0 is transparent.
- // mAlphaBitmap.fAlpha = TRANSPARENCY_VALUE;
-
- // // Set the COLORREF so that the bitmap outline will be transparent
- // SetColorRef(mAlphaBitmap);
-
- // // Give the bitmap to the VMR for display
- // locHR = mBitmapMixer->SetAlphaBitmap(&mAlphaBitmap);
- // if (FAILED(hr))
- // Msg(TEXT("SetAlphaBitmap FAILED! hr=0x%x\r\n\r\n%s\0"), hr,
- // STR_VMR_DISPLAY_WARNING);
-
- // // Select the initial objects back into our device context
- // DeleteObject(SelectObject(locBitmapHDC,locOldBitmapHandle ));
- // SelectObject(locHDCBitmap, locFont);
-
- // // Clean up resources
- // DeleteObject(hbm);
- // DeleteDC(hdcBmp);
-
- // return hr;
-
-
- // Text font information
- HFONT g_hFont=0;
- LONG g_lFontPointSize = DEFAULT_FONT_SIZE;
- COLORREF g_rgbColors = DEFAULT_FONT_COLOR;
- TCHAR g_szFontName[100] = {DEFAULT_FONT_NAME};
- TCHAR g_szFontStyle[32] = {DEFAULT_FONT_STYLE};
-
- LONG cx, cy;
- HRESULT hr;
-
- // Read the default video size
- //hr = pWC->GetNativeVideoSize(&cx, &cy, NULL, NULL);
- //if (FAILED(hr))
- //{
- // Msg(TEXT("GetNativeVideoSize FAILED! hr=0x%x\r\n"), hr);
- // return hr;
- //}
-
- // Create a device context compatible with the current window
- hr = mBitmapMixer->GetAlphaBitmapParameters(&mAlphaBitmap);
- HDC hdc = mAlphaBitmap.hdc;
- HDC hdcBmp = CreateCompatibleDC(hdc);
-
- // Write with a known font by selecting it into our HDC
- HFONT hOldFont = (HFONT) SelectObject(hdcBmp, g_hFont);
-
- // Determine the length of the string, then determine the
- // dimensions (in pixels) of the character string using the
- // currently selected font. These dimensions are used to create
- // a bitmap below.
- int nLength, nTextBmpWidth, nTextBmpHeight;
- SIZE sz={0};
- nLength = (int) inSubtitle.size();
- TCHAR* szNewText = _T("Blah blah");//inSubtitle.c_str();
- GetTextExtentPoint32(hdcBmp, szNewText, nLength, &sz);
- nTextBmpHeight = sz.cy;
- nTextBmpWidth = sz.cx;
-
- // Create a new bitmap that is compatible with the current window
- HBITMAP hbm = CreateCompatibleBitmap(hdc, nTextBmpWidth, nTextBmpHeight);
- //ReleaseDC(hwndApp, hdc);
-
- // Select our bitmap into the device context and save the old one
- BITMAP bm;
- HBITMAP hbmOld;
- GetObject(hbm, sizeof(bm), &bm);
- hbmOld = (HBITMAP)SelectObject(hdcBmp, hbm);
-
- // Set initial bitmap settings
- RECT rcText;
- SetRect(&rcText, 0, 0, nTextBmpWidth, nTextBmpHeight);
- SetBkColor(hdcBmp, RGB(255, 255, 255)); // Pure white background
- SetTextColor(hdcBmp, g_rgbColors); // Write text with requested color
-
- // Draw the requested text string onto the bitmap
- TextOut(hdcBmp, 0, 0, szNewText, nLength);
-
- // Configure the VMR's bitmap structure
- VMR9AlphaBitmap bmpInfo;
- ZeroMemory(&bmpInfo, sizeof(bmpInfo) );
- bmpInfo.dwFlags = VMRBITMAP_HDC;
- bmpInfo.hdc = hdcBmp; // DC which has selected our bitmap
-
- // Remember the width of this new bitmap
- //g_nImageWidth = bm.bmWidth;
-
- // Save the ratio of the bitmap's width to the width of the video file.
- // This value is used to reposition the bitmap in composition space.
- //g_fBitmapCompWidth = (float)g_nImageWidth / (float)cx;
-
- // Display the bitmap in the bottom right corner.
- // rSrc specifies the source rectangle in the GDI device context
- // rDest specifies the destination rectangle in composition space (0.0f to 1.0f)
-
- const float X_EDGE_BUFFER=0.05f; // Pixel buffer between bitmap and window edge
- // (represented in composition space [0 - 1.0f])
- const float Y_EDGE_BUFFER=0.05f;
-
- bmpInfo.rDest.left = 0.0f + X_EDGE_BUFFER;
- bmpInfo.rDest.right = 1.0f - X_EDGE_BUFFER;
- bmpInfo.rDest.top = (float)(cy - bm.bmHeight) / (float)cy - Y_EDGE_BUFFER;
- bmpInfo.rDest.bottom = 1.0f - Y_EDGE_BUFFER;
- bmpInfo.rSrc = rcText;
-
- // Transparency value 1.0 is opaque, 0.0 is transparent.
- bmpInfo.fAlpha = TRANSPARENCY_VALUE;
-
- // Set the COLORREF so that the bitmap outline will be transparent
- SetColorRef(bmpInfo);
-
- // Give the bitmap to the VMR for display
- hr = mBitmapMixer->SetAlphaBitmap(&bmpInfo);
- if (FAILED(hr))
- //Msg(TEXT("SetAlphaBitmap FAILED! hr=0x%x\r\n\r\n%s\0"), hr,
- // STR_VMR_DISPLAY_WARNING);
-
- // Select the initial objects back into our device context
- DeleteObject(SelectObject(hdcBmp, hbmOld));
- SelectObject(hdc, hOldFont);
-
- // Clean up resources
- DeleteObject(hbm);
- DeleteDC(hdcBmp);
-
- return hr;
-}
-
-void SubtitleVMR9OutputPin::SetColorRef(VMR9AlphaBitmap& bmpInfo)
-{
- // Set the COLORREF so that the bitmap outline will be transparent
- bmpInfo.clrSrcKey = RGB(255, 255, 255); // Pure white
- bmpInfo.dwFlags |= VMRBITMAP_SRCCOLORKEY;
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "subtitlevmr9outputpin.h"
+
+SubtitleVMR9OutputPin::SubtitleVMR9OutputPin(SubtitleVMR9Filter* inParentFilter, CCritSec* inFilterLock, CHAR* inObjectName, LPCWSTR inPinDisplayName)
+ : CBasePin(inObjectName, inParentFilter, inFilterLock, &mHR, inPinDisplayName, PINDIR_OUTPUT)
+ , mParentFilter(inParentFilter)
+ , mBitmapMixer(NULL)
+{
+}
+
+SubtitleVMR9OutputPin::~SubtitleVMR9OutputPin(void)
+{
+}
+
+HRESULT SubtitleVMR9OutputPin::CheckConnect(IPin* inPin) {
+ //Query for the video mixing bitmap interface
+ //HRESULT locHR = inPin->QueryInterface(IID_IVMRMixerBitmap9, (void**)&mBitmapMixer);
+ //if (locHR == S_OK) {
+ return S_OK;
+ //} else {
+ // return S_FALSE;
+ //}
+
+
+}
+void SubtitleVMR9OutputPin::FillMediaType(CMediaType* outMediaType) {
+ outMediaType->SetType(&MEDIATYPE_Video);
+ outMediaType->SetSubtype(&MEDIASUBTYPE_YV12);
+ outMediaType->SetFormatType(&FORMAT_VideoInfo);
+ outMediaType->SetTemporalCompression(FALSE);
+ outMediaType->SetSampleSize(0);
+
+}
+HRESULT SubtitleVMR9OutputPin::GetMediaType(int inPosition, CMediaType *outMediaType) {
+
+ if (inPosition < 0) {
+ return E_INVALIDARG;
+ }
+
+ if (inPosition == 0) {
+ FillMediaType(outMediaType);
+ VIDEOINFOHEADER* locVideoFormat = (VIDEOINFOHEADER*)outMediaType->AllocFormatBuffer(sizeof(VIDEOINFOHEADER));
+ FillVideoInfoHeader(locVideoFormat);
+ return S_OK;
+ } else {
+ return VFW_S_NO_MORE_ITEMS;
+ }
+}
+
+bool SubtitleVMR9OutputPin::FillVideoInfoHeader(VIDEOINFOHEADER* inFormatBuffer) {
+
+
+ inFormatBuffer->AvgTimePerFrame = (UNITS * 1) / 25;
+ inFormatBuffer->dwBitRate = 0;
+
+ inFormatBuffer->bmiHeader.biBitCount = 12; //12 bits per pixel
+ inFormatBuffer->bmiHeader.biClrImportant = 0; //All colours important
+ inFormatBuffer->bmiHeader.biClrUsed = 0; //Use max colour depth
+ inFormatBuffer->bmiHeader.biCompression = MAKEFOURCC('Y','V','1','2');
+ inFormatBuffer->bmiHeader.biHeight = 0; //Not sure
+ inFormatBuffer->bmiHeader.biPlanes = 1; //Must be 1
+ inFormatBuffer->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); //????? Size of what ?
+ inFormatBuffer->bmiHeader.biSizeImage = 0; //Size in bytes of image ??
+ inFormatBuffer->bmiHeader.biWidth = 0;
+ inFormatBuffer->bmiHeader.biXPelsPerMeter = 2000; //Fuck knows
+ inFormatBuffer->bmiHeader.biYPelsPerMeter = 2000; //" " " " "
+
+ inFormatBuffer->rcSource.top = 0;
+ inFormatBuffer->rcSource.bottom = 0;
+ inFormatBuffer->rcSource.left = 0;
+ inFormatBuffer->rcSource.right = 0;
+
+ inFormatBuffer->rcTarget.top = 0;
+ inFormatBuffer->rcTarget.bottom = 0;
+ inFormatBuffer->rcTarget.left = 0;
+ inFormatBuffer->rcTarget.right = 0;
+
+ inFormatBuffer->dwBitErrorRate=0;
+ return true;
+}
+HRESULT SubtitleVMR9OutputPin::CheckMediaType(const CMediaType *pmt) {
+ //Fix this up after testing.
+ return S_OK;
+}
+
+STDMETHODIMP SubtitleVMR9OutputPin::BeginFlush() {
+ return S_OK;
+}
+STDMETHODIMP SubtitleVMR9OutputPin::EndFlush() {
+ return S_OK;
+}
+
+HRESULT SubtitleVMR9OutputPin::SetSubtitle(wstring inSubtitle) {
+ // LONG cx, cy;
+ // HRESULT locHR;
+
+ // // Read the default video size
+ // //hr = pWC->GetNativeVideoSize(&cx, &cy, NULL, NULL);
+ // //if (FAILED(hr))
+ // //{
+ // // Msg(TEXT("GetNativeVideoSize FAILED! hr=0x%x\r\n"), hr);
+ // // return hr;
+ // //}
+
+ // // Create a device context compatible with the current window
+
+ //locHR = mBitmapMixer->GetAlphaBitmapParameters(&mAlphaBitmap);
+ // //HDC hdc = GetDC(hwndApp);
+ // HDC locHDCBitmap = CreateCompatibleDC(mAlphaBitmap.hdc);
+
+ // // Write with a known font by selecting it into our HDC
+ // HFONT locFontHandle = (HFONT) SelectObject(locHDCBitmap, g_hFont);
+
+ // // Determine the length of the string, then determine the
+ // // dimensions (in pixels) of the character string using the
+ // // currently selected font. These dimensions are used to create
+ // // a bitmap below.
+ // int locLength, locTextBmpWidth, locTextBmpHeight;
+ // SIZE sz={0};
+ // locLength = inSubtitle.size();
+ // GetTextExtentPoint32(locHDCBitmap, inSubtitle.c_str(), locLength, &sz);
+ // locTextBmpHeight = sz.cy;
+ // locTextBmpWidth = sz.cx;
+
+ // // Create a new bitmap that is compatible with the current window
+ // HBITMAP locBitmapHandle = CreateCompatibleBitmap(mAlphaBitmap.hdc, locTextBmpWidth, locTextBmpHeight);
+ // //ReleaseDC(hwndApp, hdc);
+
+ // // Select our bitmap into the device context and save the old one
+ // BITMAP locBitmap;
+ // HBITMAP locOldBitmapHandle;
+ // GetObject(locBitmapHandle, sizeof(locBitmap), &locBitmap);
+ // locOldBitmapHandle = (HBITMAP)SelectObject(locBitmapHandle, locBitmapHandle);
+
+ // // Set initial bitmap settings
+ // RECT rcText;
+ // SetRect(&rcText, 0, 0, nTextBmpWidth, nTextBmpHeight);
+ // SetBkColor(locBitmapHandle, RGB(255, 255, 255)); // Pure white background
+ // SetTextColor(locBitmapHandle, g_rgbColors); // Write text with requested color
+
+ // // Draw the requested text string onto the bitmap
+ // TextOut(locBitmapHandle, 0, 0, inSubtitle.c_str(), locLength);
+
+ // // Configure the VMR's bitmap structure
+ // //VMR9AlphaBitmap bmpInfo;
+ // ZeroMemory(&mAlphaBitmap, sizeof(mAlphaBitmap) );
+ // mAlphaBitmap.dwFlags = VMRBITMAP_HDC;
+ // mAlphaBitmap.hdc = locHDCBitmap; // DC which has selected our bitmap
+
+ // // Remember the width of this new bitmap
+ // g_nImageWidth = bm.bmWidth;
+
+ // // Save the ratio of the bitmap's width to the width of the video file.
+ // // This value is used to reposition the bitmap in composition space.
+ // g_fBitmapCompWidth = (float)g_nImageWidth / (float)cx;
+
+ // // Display the bitmap in the bottom right corner.
+ // // rSrc specifies the source rectangle in the GDI device context
+ // // rDest specifies the destination rectangle in composition space (0.0f to 1.0f)
+ // mAlphaBitmap.rDest.left = 0.0f + X_EDGE_BUFFER;
+ // mAlphaBitmap.rDest.right = 1.0f - X_EDGE_BUFFER;
+ // mAlphaBitmap.rDest.top = (float)(cy - bm.bmHeight) / (float)cy - Y_EDGE_BUFFER;
+ // bmAlphaBitmap.rDest.bottom = 1.0f - Y_EDGE_BUFFER;
+ // mAlphaBitmap.rSrc = rcText;
+
+ // // Transparency value 1.0 is opaque, 0.0 is transparent.
+ // mAlphaBitmap.fAlpha = TRANSPARENCY_VALUE;
+
+ // // Set the COLORREF so that the bitmap outline will be transparent
+ // SetColorRef(mAlphaBitmap);
+
+ // // Give the bitmap to the VMR for display
+ // locHR = mBitmapMixer->SetAlphaBitmap(&mAlphaBitmap);
+ // if (FAILED(hr))
+ // Msg(TEXT("SetAlphaBitmap FAILED! hr=0x%x\r\n\r\n%s\0"), hr,
+ // STR_VMR_DISPLAY_WARNING);
+
+ // // Select the initial objects back into our device context
+ // DeleteObject(SelectObject(locBitmapHDC,locOldBitmapHandle ));
+ // SelectObject(locHDCBitmap, locFont);
+
+ // // Clean up resources
+ // DeleteObject(hbm);
+ // DeleteDC(hdcBmp);
+
+ // return hr;
+
+
+ // Text font information
+ HFONT g_hFont=0;
+ LONG g_lFontPointSize = DEFAULT_FONT_SIZE;
+ COLORREF g_rgbColors = DEFAULT_FONT_COLOR;
+ TCHAR g_szFontName[100] = {DEFAULT_FONT_NAME};
+ TCHAR g_szFontStyle[32] = {DEFAULT_FONT_STYLE};
+
+ LONG cx, cy;
+ HRESULT hr;
+
+ // Read the default video size
+ //hr = pWC->GetNativeVideoSize(&cx, &cy, NULL, NULL);
+ //if (FAILED(hr))
+ //{
+ // Msg(TEXT("GetNativeVideoSize FAILED! hr=0x%x\r\n"), hr);
+ // return hr;
+ //}
+
+ // Create a device context compatible with the current window
+ hr = mBitmapMixer->GetAlphaBitmapParameters(&mAlphaBitmap);
+ HDC hdc = mAlphaBitmap.hdc;
+ HDC hdcBmp = CreateCompatibleDC(hdc);
+
+ // Write with a known font by selecting it into our HDC
+ HFONT hOldFont = (HFONT) SelectObject(hdcBmp, g_hFont);
+
+ // Determine the length of the string, then determine the
+ // dimensions (in pixels) of the character string using the
+ // currently selected font. These dimensions are used to create
+ // a bitmap below.
+ int nLength, nTextBmpWidth, nTextBmpHeight;
+ SIZE sz={0};
+ nLength = (int) inSubtitle.size();
+ TCHAR* szNewText = _T("Blah blah");//inSubtitle.c_str();
+ GetTextExtentPoint32(hdcBmp, szNewText, nLength, &sz);
+ nTextBmpHeight = sz.cy;
+ nTextBmpWidth = sz.cx;
+
+ // Create a new bitmap that is compatible with the current window
+ HBITMAP hbm = CreateCompatibleBitmap(hdc, nTextBmpWidth, nTextBmpHeight);
+ //ReleaseDC(hwndApp, hdc);
+
+ // Select our bitmap into the device context and save the old one
+ BITMAP bm;
+ HBITMAP hbmOld;
+ GetObject(hbm, sizeof(bm), &bm);
+ hbmOld = (HBITMAP)SelectObject(hdcBmp, hbm);
+
+ // Set initial bitmap settings
+ RECT rcText;
+ SetRect(&rcText, 0, 0, nTextBmpWidth, nTextBmpHeight);
+ SetBkColor(hdcBmp, RGB(255, 255, 255)); // Pure white background
+ SetTextColor(hdcBmp, g_rgbColors); // Write text with requested color
+
+ // Draw the requested text string onto the bitmap
+ TextOut(hdcBmp, 0, 0, szNewText, nLength);
+
+ // Configure the VMR's bitmap structure
+ VMR9AlphaBitmap bmpInfo;
+ ZeroMemory(&bmpInfo, sizeof(bmpInfo) );
+ bmpInfo.dwFlags = VMRBITMAP_HDC;
+ bmpInfo.hdc = hdcBmp; // DC which has selected our bitmap
+
+ // Remember the width of this new bitmap
+ //g_nImageWidth = bm.bmWidth;
+
+ // Save the ratio of the bitmap's width to the width of the video file.
+ // This value is used to reposition the bitmap in composition space.
+ //g_fBitmapCompWidth = (float)g_nImageWidth / (float)cx;
+
+ // Display the bitmap in the bottom right corner.
+ // rSrc specifies the source rectangle in the GDI device context
+ // rDest specifies the destination rectangle in composition space (0.0f to 1.0f)
+
+ const float X_EDGE_BUFFER=0.05f; // Pixel buffer between bitmap and window edge
+ // (represented in composition space [0 - 1.0f])
+ const float Y_EDGE_BUFFER=0.05f;
+
+ bmpInfo.rDest.left = 0.0f + X_EDGE_BUFFER;
+ bmpInfo.rDest.right = 1.0f - X_EDGE_BUFFER;
+ bmpInfo.rDest.top = (float)(cy - bm.bmHeight) / (float)cy - Y_EDGE_BUFFER;
+ bmpInfo.rDest.bottom = 1.0f - Y_EDGE_BUFFER;
+ bmpInfo.rSrc = rcText;
+
+ // Transparency value 1.0 is opaque, 0.0 is transparent.
+ bmpInfo.fAlpha = TRANSPARENCY_VALUE;
+
+ // Set the COLORREF so that the bitmap outline will be transparent
+ SetColorRef(bmpInfo);
+
+ // Give the bitmap to the VMR for display
+ hr = mBitmapMixer->SetAlphaBitmap(&bmpInfo);
+ if (FAILED(hr))
+ //Msg(TEXT("SetAlphaBitmap FAILED! hr=0x%x\r\n\r\n%s\0"), hr,
+ // STR_VMR_DISPLAY_WARNING);
+
+ // Select the initial objects back into our device context
+ DeleteObject(SelectObject(hdcBmp, hbmOld));
+ SelectObject(hdc, hOldFont);
+
+ // Clean up resources
+ DeleteObject(hbm);
+ DeleteDC(hdcBmp);
+
+ return hr;
+}
+
+void SubtitleVMR9OutputPin::SetColorRef(VMR9AlphaBitmap& bmpInfo)
+{
+ // Set the COLORREF so that the bitmap outline will be transparent
+ bmpInfo.clrSrcKey = RGB(255, 255, 255); // Pure white
+ bmpInfo.dwFlags |= VMRBITMAP_SRCCOLORKEY;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9OutputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9OutputPin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9OutputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9OutputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,83 +1,83 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "subtitledllstuff.h"
-#include <d3d9.h>
-#include <vmr9.h>
-#include <tchar.h>
-#include <string>
-using namespace std;
-
-#define TRANSPARENCY_VALUE (0.8f)
-
-#define PURE_WHITE RGB(255,255,255)
-#define ALMOST_WHITE RGB(250,250,250)
-
-#define BLEND_TEXT TEXT("This is a demonstration of alpha-blended dynamic text.\0")
-#define DYNAMIC_TEXT_SIZE 255
-
-#define DEFAULT_FONT_NAME TEXT("Impact\0")
-#define DEFAULT_FONT_STYLE TEXT("Regular\0")
-#define DEFAULT_FONT_SIZE 12
-#define DEFAULT_FONT_COLOR RGB(250,250,250)
-#define MAX_FONT_SIZE 25
-
-
-class SubtitleVMR9OutputPin
- : public CBasePin
-{
-public:
- SubtitleVMR9OutputPin(SubtitleVMR9Filter* inParentFilter, CCritSec* inFilterLock, CHAR* inObjectName, LPCWSTR inPinDisplayName);
- virtual ~SubtitleVMR9OutputPin(void);
-
-
-
- virtual HRESULT CheckConnect(IPin *pPin);
- virtual HRESULT CheckMediaType(const CMediaType *pmt);
- virtual STDMETHODIMP BeginFlush();
- virtual STDMETHODIMP EndFlush();
-
- virtual HRESULT SetSubtitle(wstring inSubtitle);
-
- HRESULT SubtitleVMR9OutputPin::GetMediaType(int inPosition, CMediaType *outMediaType);
- bool SubtitleVMR9OutputPin::FillVideoInfoHeader(VIDEOINFOHEADER* inFormatBuffer);
- void SubtitleVMR9OutputPin::FillMediaType(CMediaType* outMediaType);
-
-
-
-protected:
- void SetColorRef(VMR9AlphaBitmap& bmpInfo);
- SubtitleVMR9Filter* mParentFilter;
- HRESULT mHR;
- IVMRMixerBitmap9* mBitmapMixer;
- VMR9AlphaBitmap mAlphaBitmap;
-};
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "subtitledllstuff.h"
+#include <d3d9.h>
+#include <vmr9.h>
+#include <tchar.h>
+#include <string>
+using namespace std;
+
+#define TRANSPARENCY_VALUE (0.8f)
+
+#define PURE_WHITE RGB(255,255,255)
+#define ALMOST_WHITE RGB(250,250,250)
+
+#define BLEND_TEXT TEXT("This is a demonstration of alpha-blended dynamic text.\0")
+#define DYNAMIC_TEXT_SIZE 255
+
+#define DEFAULT_FONT_NAME TEXT("Impact\0")
+#define DEFAULT_FONT_STYLE TEXT("Regular\0")
+#define DEFAULT_FONT_SIZE 12
+#define DEFAULT_FONT_COLOR RGB(250,250,250)
+#define MAX_FONT_SIZE 25
+
+
+class SubtitleVMR9OutputPin
+ : public CBasePin
+{
+public:
+ SubtitleVMR9OutputPin(SubtitleVMR9Filter* inParentFilter, CCritSec* inFilterLock, CHAR* inObjectName, LPCWSTR inPinDisplayName);
+ virtual ~SubtitleVMR9OutputPin(void);
+
+
+
+ virtual HRESULT CheckConnect(IPin *pPin);
+ virtual HRESULT CheckMediaType(const CMediaType *pmt);
+ virtual STDMETHODIMP BeginFlush();
+ virtual STDMETHODIMP EndFlush();
+
+ virtual HRESULT SetSubtitle(wstring inSubtitle);
+
+ HRESULT SubtitleVMR9OutputPin::GetMediaType(int inPosition, CMediaType *outMediaType);
+ bool SubtitleVMR9OutputPin::FillVideoInfoHeader(VIDEOINFOHEADER* inFormatBuffer);
+ void SubtitleVMR9OutputPin::FillMediaType(CMediaType* outMediaType);
+
+
+
+protected:
+ void SetColorRef(VMR9AlphaBitmap& bmpInfo);
+ SubtitleVMR9Filter* mParentFilter;
+ HRESULT mHR;
+ IVMRMixerBitmap9* mBitmapMixer;
+ VMR9AlphaBitmap mAlphaBitmap;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/SubtitleVMR9OutputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/dsfSubtitleVMR9.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/dsfSubtitleVMR9.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/dsfSubtitleVMR9.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,12 +1,12 @@
-// dsfSubtitleVMR9.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- return TRUE;
-}
-
+// dsfSubtitleVMR9.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ return TRUE;
+}
+
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/dsfSubtitleVMR9.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,39 +1,39 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.cpp : source file that includes just the standard includes
-// dsfSubtitleVMR9.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.cpp : source file that includes just the standard includes
+// dsfSubtitleVMR9.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,46 +1,46 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-// TODO: reference additional headers your program requires here
-#include "SubtitleVMR9Filter.h"
-#include "SubtitleVMR9OutputPin.h"
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+// TODO: reference additional headers your program requires here
+#include "SubtitleVMR9Filter.h"
+#include "SubtitleVMR9OutputPin.h"
#include "SubtitleVMR9InputPin.h"
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/subtitledllstuff.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/subtitledllstuff.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/subtitledllstuff.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,99 +1,99 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-
-#include "StdAfx.h"
-#include "subtitledllstuff.h"
-
-extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
-BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
-{
- return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
-}
-
-
-//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
-STDAPI DllRegisterServer()
-{
-
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(TRUE);
-
-
-
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
-
-
- hr = locFilterMapper->RegisterFilter(
- CLSID_SubtitleVMR9Filter, // Filter CLSID.
- L"Subtitle VMR9 Filter", // Filter name.
- NULL, // Device moniker.
- &CLSID_LegacyAmFilterCategory, // Direct Show general category
- L"Subtitle VMR9 Filter", // Instance data. ???????
- &SubtitleVMR9FilterReg // Pointer to filter information.
- );
-
- locFilterMapper->Release();
-
- return hr;
-
-}
-
-STDAPI DllUnregisterServer()
-{
- HRESULT hr;
- IFilterMapper2* locFilterMapper = NULL;
-
- hr = AMovieDllRegisterServer2(FALSE);
- if (FAILED(hr)) {
-
- return hr;
- }
-
- hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
- IID_IFilterMapper2, (void **)&locFilterMapper);
-
- if (FAILED(hr)) {
- return hr;
- }
-
-
- hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, L"Vorbis Decode Filter", CLSID_SubtitleVMR9Filter);
-
-
- //
- locFilterMapper->Release();
- return hr;
-
-}
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+
+#include "StdAfx.h"
+#include "subtitledllstuff.h"
+
+extern "C" BOOL WINAPI DllEntryPoint(HINSTANCE, ULONG, LPVOID);
+BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+ return DllEntryPoint((HINSTANCE)(hModule), dwReason, lpReserved);
+}
+
+
+//The folowing two functions do the registration and deregistration of the dll and it's contained com objects.
+STDAPI DllRegisterServer()
+{
+
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(TRUE);
+
+
+
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER, IID_IFilterMapper2, (void **)&locFilterMapper);
+
+
+ hr = locFilterMapper->RegisterFilter(
+ CLSID_SubtitleVMR9Filter, // Filter CLSID.
+ L"Subtitle VMR9 Filter", // Filter name.
+ NULL, // Device moniker.
+ &CLSID_LegacyAmFilterCategory, // Direct Show general category
+ L"Subtitle VMR9 Filter", // Instance data. ???????
+ &SubtitleVMR9FilterReg // Pointer to filter information.
+ );
+
+ locFilterMapper->Release();
+
+ return hr;
+
+}
+
+STDAPI DllUnregisterServer()
+{
+ HRESULT hr;
+ IFilterMapper2* locFilterMapper = NULL;
+
+ hr = AMovieDllRegisterServer2(FALSE);
+ if (FAILED(hr)) {
+
+ return hr;
+ }
+
+ hr = CoCreateInstance(CLSID_FilterMapper2, NULL, CLSCTX_INPROC_SERVER,
+ IID_IFilterMapper2, (void **)&locFilterMapper);
+
+ if (FAILED(hr)) {
+ return hr;
+ }
+
+
+ hr = locFilterMapper->UnregisterFilter(&CLSID_LegacyAmFilterCategory, L"Vorbis Decode Filter", CLSID_SubtitleVMR9Filter);
+
+
+ //
+ locFilterMapper->Release();
+ return hr;
+
+}
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/subtitledllstuff.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/subtitledllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/subtitledllstuff.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/subtitledllstuff.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,99 +1,99 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include <streams.h>
-#include <initguid.h>
-// {966D76B4-7D2F-4f01-B840-94E425D2214F}
-DEFINE_GUID(MEDIASUBTYPE_SubtitleVMR9,
-0x966d76b4, 0x7d2f, 0x4f01, 0xb8, 0x40, 0x94, 0xe4, 0x25, 0xd2, 0x21, 0x4f);
-
-// {5709E326-01D8-49ad-9D08-F8723112D82E}
-DEFINE_GUID(CLSID_SubtitleVMR9Filter,
-0x5709e326, 0x1d8, 0x49ad, 0x9d, 0x8, 0xf8, 0x72, 0x31, 0x12, 0xd8, 0x2e);
-
-
-const REGPINTYPES SubtitleVMR9OutputTypes = {
- &MEDIATYPE_Video,
- &MEDIASUBTYPE_YV12
-};
-
-const REGPINTYPES SubtitleVMR9InputTypes = {
- &MEDIATYPE_Text,
- &MEDIASUBTYPE_SubtitleVMR9
-};
-
-const REGFILTERPINS SubtitleVMR9PinReg[] = {
- {
- L"Subtitle Input", //Name (obsoleted)
- FALSE, //Renders from this pin ?? Not sure about this.
- FALSE, //Not an output pin
- FALSE, //Cannot have zero instances of this pin
- FALSE, //Cannot have more than one instance of this pin
- NULL, //Connects to filter (obsoleted)
- NULL, //Connects to pin (obsoleted)
- 1, //upport two media type
- &SubtitleVMR9InputTypes //Pointer to media type (Audio/Vorbis or Audio/Speex)
- } ,
-
- {
- L"Subtitle Output", //Name (obsoleted)
- FALSE, //Renders from this pin ?? Not sure about this.
- TRUE, //Is an output pin
- FALSE, //Cannot have zero instances of this pin
- FALSE, //Cannot have more than one instance of this pin
- NULL, //Connects to filter (obsoleted)
- NULL, //Connects to pin (obsoleted)
- 1, //Only support one media type
- &SubtitleVMR9OutputTypes //Pointer to media type (Audio/PCM)
-
- }
-};
-
-
-
-const REGFILTER2 SubtitleVMR9FilterReg = {
- 1,
- MERIT_PREFERRED + 2,
- 2,
- SubtitleVMR9PinReg
-
-};
-
-
-struct sVorbisFormatBlock {
- unsigned long vorbisVersion;
- unsigned long samplesPerSec;
- unsigned long minBitsPerSec;
- unsigned long avgBitsPerSec;
- unsigned long maxBitsPerSec;
- unsigned char numChannels;
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include <streams.h>
+#include <initguid.h>
+// {966D76B4-7D2F-4f01-B840-94E425D2214F}
+DEFINE_GUID(MEDIASUBTYPE_SubtitleVMR9,
+0x966d76b4, 0x7d2f, 0x4f01, 0xb8, 0x40, 0x94, 0xe4, 0x25, 0xd2, 0x21, 0x4f);
+
+// {5709E326-01D8-49ad-9D08-F8723112D82E}
+DEFINE_GUID(CLSID_SubtitleVMR9Filter,
+0x5709e326, 0x1d8, 0x49ad, 0x9d, 0x8, 0xf8, 0x72, 0x31, 0x12, 0xd8, 0x2e);
+
+
+const REGPINTYPES SubtitleVMR9OutputTypes = {
+ &MEDIATYPE_Video,
+ &MEDIASUBTYPE_YV12
+};
+
+const REGPINTYPES SubtitleVMR9InputTypes = {
+ &MEDIATYPE_Text,
+ &MEDIASUBTYPE_SubtitleVMR9
+};
+
+const REGFILTERPINS SubtitleVMR9PinReg[] = {
+ {
+ L"Subtitle Input", //Name (obsoleted)
+ FALSE, //Renders from this pin ?? Not sure about this.
+ FALSE, //Not an output pin
+ FALSE, //Cannot have zero instances of this pin
+ FALSE, //Cannot have more than one instance of this pin
+ NULL, //Connects to filter (obsoleted)
+ NULL, //Connects to pin (obsoleted)
+ 1, //upport two media type
+ &SubtitleVMR9InputTypes //Pointer to media type (Audio/Vorbis or Audio/Speex)
+ } ,
+
+ {
+ L"Subtitle Output", //Name (obsoleted)
+ FALSE, //Renders from this pin ?? Not sure about this.
+ TRUE, //Is an output pin
+ FALSE, //Cannot have zero instances of this pin
+ FALSE, //Cannot have more than one instance of this pin
+ NULL, //Connects to filter (obsoleted)
+ NULL, //Connects to pin (obsoleted)
+ 1, //Only support one media type
+ &SubtitleVMR9OutputTypes //Pointer to media type (Audio/PCM)
+
+ }
+};
+
+
+
+const REGFILTER2 SubtitleVMR9FilterReg = {
+ 1,
+ MERIT_PREFERRED + 2,
+ 2,
+ SubtitleVMR9PinReg
+
+};
+
+
+struct sVorbisFormatBlock {
+ unsigned long vorbisVersion;
+ unsigned long samplesPerSec;
+ unsigned long minBitsPerSec;
+ unsigned long avgBitsPerSec;
+ unsigned long maxBitsPerSec;
+ unsigned char numChannels;
};
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/dsfSubtitleVMR9/subtitledllstuff.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformFilter.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformFilter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformFilter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,94 +1,94 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-//
-// AbstracttransformFilter.cpp : Abstract Filter Class for transform filters.
-//
-
-
-#include "StdAfx.h"
-#include "AbstractTransformFilter.h"
-
-//Constructors
-AbstractTransformFilter::AbstractTransformFilter(TCHAR* inFilterName, REFCLSID inFilterGUID)
- : CBaseFilter(inFilterName, NULL, m_pLock, inFilterGUID)
-
- , mInputPin(NULL)
- , mOutputPin(NULL)
-
-{
- //Create the filter lock.
- m_pLock = new CCritSec; //Deleted in destructor... check what is happening in the base class.
-}
-
-AbstractTransformFilter::~AbstractTransformFilter(void)
-{
- DestroyPins();
- delete m_pLock; //Deleting filter lock
-}
-
-void AbstractTransformFilter::DestroyPins()
-{
- delete mOutputPin;
- delete mInputPin;
-}
-
-//If you want to handle an interface, do it here.
-STDMETHODIMP AbstractTransformFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
-
- //May just get rid of this !!
- return CBaseFilter::NonDelegatingQueryInterface(riid, ppv);
-}
-
-CBasePin* AbstractTransformFilter::GetPin(int inPinNo)
-{
- //Pin Constants
- const int INPUT_PIN = 0;
- const int OUTPUT_PIN = 1;
-
- //Return the pin.
- switch (inPinNo) {
- case INPUT_PIN:
- return mInputPin;
- case OUTPUT_PIN:
- return mOutputPin;
- default:
- return NULL;
- };
-}
-
-int AbstractTransformFilter::GetPinCount(void)
-{
- const long NUM_PINS = 2;
- return NUM_PINS;
-}
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+//
+// AbstracttransformFilter.cpp : Abstract Filter Class for transform filters.
+//
+
+
+#include "StdAfx.h"
+#include "AbstractTransformFilter.h"
+
+//Constructors
+AbstractTransformFilter::AbstractTransformFilter(TCHAR* inFilterName, REFCLSID inFilterGUID)
+ : CBaseFilter(inFilterName, NULL, m_pLock, inFilterGUID)
+
+ , mInputPin(NULL)
+ , mOutputPin(NULL)
+
+{
+ //Create the filter lock.
+ m_pLock = new CCritSec; //Deleted in destructor... check what is happening in the base class.
+}
+
+AbstractTransformFilter::~AbstractTransformFilter(void)
+{
+ DestroyPins();
+ delete m_pLock; //Deleting filter lock
+}
+
+void AbstractTransformFilter::DestroyPins()
+{
+ delete mOutputPin;
+ delete mInputPin;
+}
+
+//If you want to handle an interface, do it here.
+STDMETHODIMP AbstractTransformFilter::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+
+ //May just get rid of this !!
+ return CBaseFilter::NonDelegatingQueryInterface(riid, ppv);
+}
+
+CBasePin* AbstractTransformFilter::GetPin(int inPinNo)
+{
+ //Pin Constants
+ const int INPUT_PIN = 0;
+ const int OUTPUT_PIN = 1;
+
+ //Return the pin.
+ switch (inPinNo) {
+ case INPUT_PIN:
+ return mInputPin;
+ case OUTPUT_PIN:
+ return mOutputPin;
+ default:
+ return NULL;
+ };
+}
+
+int AbstractTransformFilter::GetPinCount(void)
+{
+ const long NUM_PINS = 2;
+ return NUM_PINS;
+}
+
Property changes on: trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformFilter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformFilter.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformFilter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformFilter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,74 +1,74 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-
-#pragma once
-
-//Local Includes
-#include "directshowabstractsdllstuff.h"
-
-
-//Forward Declarations
-class AbstractTransformInputPin;
-class AbstractTransformOutputPin;
-
-
-class AbstractTransformFilter
- //Parent Classes
- : public CBaseFilter
- //http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directshow/htm/cbasefilterclass.asp
-{
-public:
- //Friend Classes
- friend class AbstractTransformInputPin;
- friend class AbstractTransformOutputPin;
-
- //COM Initialisation
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- //Constructors
- AbstractTransformFilter(TCHAR* inFilterName, REFCLSID inFilterGUID);
- virtual ~AbstractTransformFilter(void);
-
- //Pin Access Methods
- CBasePin* GetPin(int inPinNo);
- int GetPinCount(void);
-
-protected:
- //Pin Creation Methods
- virtual bool ConstructPins() = 0;
- virtual void DestroyPins();
-
- //Pin Member Data
- AbstractTransformInputPin* mInputPin;
- AbstractTransformOutputPin* mOutputPin;
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+
+#pragma once
+
+//Local Includes
+#include "directshowabstractsdllstuff.h"
+
+
+//Forward Declarations
+class AbstractTransformInputPin;
+class AbstractTransformOutputPin;
+
+
+class AbstractTransformFilter
+ //Parent Classes
+ : public CBaseFilter
+ //http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directshow/htm/cbasefilterclass.asp
+{
+public:
+ //Friend Classes
+ friend class AbstractTransformInputPin;
+ friend class AbstractTransformOutputPin;
+
+ //COM Initialisation
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ //Constructors
+ AbstractTransformFilter(TCHAR* inFilterName, REFCLSID inFilterGUID);
+ virtual ~AbstractTransformFilter(void);
+
+ //Pin Access Methods
+ CBasePin* GetPin(int inPinNo);
+ int GetPinCount(void);
+
+protected:
+ //Pin Creation Methods
+ virtual bool ConstructPins() = 0;
+ virtual void DestroyPins();
+
+ //Pin Member Data
+ AbstractTransformInputPin* mInputPin;
+ AbstractTransformOutputPin* mOutputPin;
};
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformFilter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformInputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformInputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformInputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,185 +1,185 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "AbstractTransformInputPin.h"
-
-
-AbstractTransformInputPin::AbstractTransformInputPin (AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, CHAR* inObjectName, LPCWSTR inPinDisplayName, vector<CMediaType*> inAcceptableMediaTypes)
- : CBaseInputPin (inObjectName, inParentFilter, inFilterLock, &mHR, inPinDisplayName)
-
- , mOutputPin (inOutputPin)
- , mParentFilter (inParentFilter)
-
- , mAcceptableMediaTypes(inAcceptableMediaTypes)
-
-
-{
- mStreamLock = new CCritSec; //Deleted in destructor.
-}
-
-STDMETHODIMP AbstractTransformInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
- //TODO::: This really shouldn't be exposed on an input pin
- if (riid == IID_IMediaSeeking) {
- *ppv = (IMediaSeeking*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- }
-
- return CBaseInputPin::NonDelegatingQueryInterface(riid, ppv);
-}
-
-HRESULT AbstractTransformInputPin::BreakConnect()
-{
- CAutoLock locLock(m_pLock);
- //Release the seeking delegate
- ReleaseDelegate();
- return CBaseInputPin::BreakConnect();
-}
-HRESULT AbstractTransformInputPin::CompleteConnect (IPin *inReceivePin)
-{
- CAutoLock locLock(m_pLock);
-
- IMediaSeeking* locSeeker = NULL;
- inReceivePin->QueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
- SetDelegate(locSeeker);
- return CBaseInputPin::CompleteConnect(inReceivePin);
-}
-AbstractTransformInputPin::~AbstractTransformInputPin(void)
-{
-
- delete mStreamLock;
- for (int i = 0; i < mAcceptableMediaTypes.size(); i++) {
- delete mAcceptableMediaTypes[i];
- }
-
-}
-
-
-bool AbstractTransformInputPin::SetSampleParams(IMediaSample* outMediaSample, unsigned long inDataSize, REFERENCE_TIME* inStartTime, REFERENCE_TIME* inEndTime)
-{
- outMediaSample->SetTime(inStartTime, inEndTime);
- outMediaSample->SetMediaTime(NULL, NULL);
- outMediaSample->SetActualDataLength(inDataSize);
- outMediaSample->SetPreroll(FALSE);
- outMediaSample->SetDiscontinuity(FALSE);
- outMediaSample->SetSyncPoint(TRUE);
- return true;
-}
-
-
-STDMETHODIMP AbstractTransformInputPin::Receive(IMediaSample* inSample)
-{
- CAutoLock locLock(mStreamLock);
-
- HRESULT locHR = CheckStreaming();
-
- if (locHR == S_OK) {
- BYTE* locBuff = NULL;
- locHR = inSample->GetPointer(&locBuff);
-
- if (locHR != S_OK) {
- //TODO::: Do a debug dump or something here with specific error info.
- return locHR;
- } else {
- HRESULT locResult = TransformData(locBuff, inSample->GetActualDataLength());
- if (locResult == S_OK) {
- return S_OK;
- } else {
- return S_FALSE;
- }
- }
- } else {
- //Not streaming - Bail out.
- return locHR;
- }
-}
-
-HRESULT AbstractTransformInputPin::CheckMediaType(const CMediaType *inMediaType)
-{
- //TO DO::: Neaten this up.
- for (int i = 0; i < mAcceptableMediaTypes.size(); i++) {
- if ( (inMediaType->majortype == mAcceptableMediaTypes[i]->majortype)
- && (inMediaType->subtype == mAcceptableMediaTypes[i]->subtype)
- && (inMediaType->formattype == mAcceptableMediaTypes[i]->formattype)
- )
- {
- return S_OK;
- }
- }
- //If it matched none... return false.
- return S_FALSE;
-}
-
-STDMETHODIMP AbstractTransformInputPin::EndOfStream(void) {
- CAutoLock locLock(mStreamLock);
-
- return mParentFilter->mOutputPin->DeliverEndOfStream();
-}
-
-STDMETHODIMP AbstractTransformInputPin::BeginFlush() {
- CAutoLock locLock(m_pLock);
-
- CBaseInputPin::BeginFlush();
- return mParentFilter->mOutputPin->DeliverBeginFlush();
-}
-STDMETHODIMP AbstractTransformInputPin::EndFlush() {
- CAutoLock locLock(m_pLock);
-
- mParentFilter->mOutputPin->DeliverEndFlush();
- return CBaseInputPin::EndFlush();
-}
-
-STDMETHODIMP AbstractTransformInputPin::NewSegment(REFERENCE_TIME inStartTime, REFERENCE_TIME inStopTime, double inRate) {
- CAutoLock locLock(mStreamLock);
-
- //This is called on BasePin and not BaseInputPin because the implementation is not overriden in BaseOutputPin.
- CBasePin::NewSegment(inStartTime, inStopTime, inRate);
- return mParentFilter->mOutputPin->DeliverNewSegment(inStartTime, inStopTime, inRate);
-}
-
-HRESULT AbstractTransformInputPin::GetMediaType(int inPosition, CMediaType *outMediaType)
-{
- //TODO::: Check for NULL Pointer.
- if (inPosition < 0) {
- return E_INVALIDARG;
- } else if (inPosition < mAcceptableMediaTypes.size()) {
- outMediaType->SetType(&(mAcceptableMediaTypes[inPosition]->majortype));
- outMediaType->SetSubtype(&(mAcceptableMediaTypes[inPosition]->subtype));
- //Don't set the format data here... its up to the connecting output pin
- // to do this, and we will verify it in CheckMediaType
- return S_OK;
- } else {
- return VFW_S_NO_MORE_ITEMS;
- }
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "AbstractTransformInputPin.h"
+
+
+AbstractTransformInputPin::AbstractTransformInputPin (AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, CHAR* inObjectName, LPCWSTR inPinDisplayName, vector<CMediaType*> inAcceptableMediaTypes)
+ : CBaseInputPin (inObjectName, inParentFilter, inFilterLock, &mHR, inPinDisplayName)
+
+ , mOutputPin (inOutputPin)
+ , mParentFilter (inParentFilter)
+
+ , mAcceptableMediaTypes(inAcceptableMediaTypes)
+
+
+{
+ mStreamLock = new CCritSec; //Deleted in destructor.
+}
+
+STDMETHODIMP AbstractTransformInputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+ //TODO::: This really shouldn't be exposed on an input pin
+ if (riid == IID_IMediaSeeking) {
+ *ppv = (IMediaSeeking*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ }
+
+ return CBaseInputPin::NonDelegatingQueryInterface(riid, ppv);
+}
+
+HRESULT AbstractTransformInputPin::BreakConnect()
+{
+ CAutoLock locLock(m_pLock);
+ //Release the seeking delegate
+ ReleaseDelegate();
+ return CBaseInputPin::BreakConnect();
+}
+HRESULT AbstractTransformInputPin::CompleteConnect (IPin *inReceivePin)
+{
+ CAutoLock locLock(m_pLock);
+
+ IMediaSeeking* locSeeker = NULL;
+ inReceivePin->QueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+ SetDelegate(locSeeker);
+ return CBaseInputPin::CompleteConnect(inReceivePin);
+}
+AbstractTransformInputPin::~AbstractTransformInputPin(void)
+{
+
+ delete mStreamLock;
+ for (int i = 0; i < mAcceptableMediaTypes.size(); i++) {
+ delete mAcceptableMediaTypes[i];
+ }
+
+}
+
+
+bool AbstractTransformInputPin::SetSampleParams(IMediaSample* outMediaSample, unsigned long inDataSize, REFERENCE_TIME* inStartTime, REFERENCE_TIME* inEndTime)
+{
+ outMediaSample->SetTime(inStartTime, inEndTime);
+ outMediaSample->SetMediaTime(NULL, NULL);
+ outMediaSample->SetActualDataLength(inDataSize);
+ outMediaSample->SetPreroll(FALSE);
+ outMediaSample->SetDiscontinuity(FALSE);
+ outMediaSample->SetSyncPoint(TRUE);
+ return true;
+}
+
+
+STDMETHODIMP AbstractTransformInputPin::Receive(IMediaSample* inSample)
+{
+ CAutoLock locLock(mStreamLock);
+
+ HRESULT locHR = CheckStreaming();
+
+ if (locHR == S_OK) {
+ BYTE* locBuff = NULL;
+ locHR = inSample->GetPointer(&locBuff);
+
+ if (locHR != S_OK) {
+ //TODO::: Do a debug dump or something here with specific error info.
+ return locHR;
+ } else {
+ HRESULT locResult = TransformData(locBuff, inSample->GetActualDataLength());
+ if (locResult == S_OK) {
+ return S_OK;
+ } else {
+ return S_FALSE;
+ }
+ }
+ } else {
+ //Not streaming - Bail out.
+ return locHR;
+ }
+}
+
+HRESULT AbstractTransformInputPin::CheckMediaType(const CMediaType *inMediaType)
+{
+ //TO DO::: Neaten this up.
+ for (int i = 0; i < mAcceptableMediaTypes.size(); i++) {
+ if ( (inMediaType->majortype == mAcceptableMediaTypes[i]->majortype)
+ && (inMediaType->subtype == mAcceptableMediaTypes[i]->subtype)
+ && (inMediaType->formattype == mAcceptableMediaTypes[i]->formattype)
+ )
+ {
+ return S_OK;
+ }
+ }
+ //If it matched none... return false.
+ return S_FALSE;
+}
+
+STDMETHODIMP AbstractTransformInputPin::EndOfStream(void) {
+ CAutoLock locLock(mStreamLock);
+
+ return mParentFilter->mOutputPin->DeliverEndOfStream();
+}
+
+STDMETHODIMP AbstractTransformInputPin::BeginFlush() {
+ CAutoLock locLock(m_pLock);
+
+ CBaseInputPin::BeginFlush();
+ return mParentFilter->mOutputPin->DeliverBeginFlush();
+}
+STDMETHODIMP AbstractTransformInputPin::EndFlush() {
+ CAutoLock locLock(m_pLock);
+
+ mParentFilter->mOutputPin->DeliverEndFlush();
+ return CBaseInputPin::EndFlush();
+}
+
+STDMETHODIMP AbstractTransformInputPin::NewSegment(REFERENCE_TIME inStartTime, REFERENCE_TIME inStopTime, double inRate) {
+ CAutoLock locLock(mStreamLock);
+
+ //This is called on BasePin and not BaseInputPin because the implementation is not overriden in BaseOutputPin.
+ CBasePin::NewSegment(inStartTime, inStopTime, inRate);
+ return mParentFilter->mOutputPin->DeliverNewSegment(inStartTime, inStopTime, inRate);
+}
+
+HRESULT AbstractTransformInputPin::GetMediaType(int inPosition, CMediaType *outMediaType)
+{
+ //TODO::: Check for NULL Pointer.
+ if (inPosition < 0) {
+ return E_INVALIDARG;
+ } else if (inPosition < mAcceptableMediaTypes.size()) {
+ outMediaType->SetType(&(mAcceptableMediaTypes[inPosition]->majortype));
+ outMediaType->SetSubtype(&(mAcceptableMediaTypes[inPosition]->subtype));
+ //Don't set the format data here... its up to the connecting output pin
+ // to do this, and we will verify it in CheckMediaType
+ return S_OK;
+ } else {
+ return VFW_S_NO_MORE_ITEMS;
+ }
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformInputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformInputPin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformInputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformInputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,107 +1,107 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-//Local Includes
-#include "directshowabstractsdllstuff.h"
-#include "BasicSeekPassThrough.h"
-
-//STL Includes
-#include <vector>
-//Debug only !
-#include <fstream>
-//
-using namespace std;
-
-//Forward Declarations
-class AbstractTransformOutputPin;
-class AbstractTransformFilter;
-
-class AbstractTransformInputPin
- //Base Classes
- : public CBaseInputPin
- //http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directshow/htm/cbaseinputpinclass.asp
- , public BasicSeekPassThrough
-{
-public:
- //Friend Classes
- friend class AbstractTransformOutputPin;
-
- //COM Setup
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- //Constructors
- AbstractTransformInputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, CHAR* inObjectName, LPCWSTR inPinDisplayName, vector<CMediaType*> inAcceptableMediaTypes);
- virtual ~AbstractTransformInputPin(void);
-
- //Pin Conenction Methods
- virtual HRESULT BreakConnect();
- virtual HRESULT CompleteConnect(IPin *inReceivePin);
-
- //Media Type control methods
- virtual HRESULT CheckMediaType(const CMediaType *inMediaType);
- virtual HRESULT GetMediaType(int inPosition, CMediaType *outMediaType);
- virtual HRESULT SetMediaType(const CMediaType* inMediaType) = 0;
-
- //TODO::: Should be virtual ??
- virtual STDMETHODIMP Receive(IMediaSample *pSample);
-
- //Stream Messaging methods
- virtual STDMETHODIMP EndOfStream(void);
- virtual STDMETHODIMP BeginFlush();
- virtual STDMETHODIMP EndFlush();
- virtual STDMETHODIMP NewSegment(REFERENCE_TIME inStartTime, REFERENCE_TIME inStopTime, double inRate);
-
-protected:
- //Constants and Enumerations
- static const short SIZE_16_BITS = 2;
- static const signed short SINT_MAX = 32767;
- static const signed short SINT_MIN = -32768;
-
- //Pure Virtuals for codec specific methods
- virtual HRESULT TransformData(unsigned char* inBuf, long inNumBytes) = 0;
- virtual bool ConstructCodec() = 0;
- virtual void DestroyCodec() = 0;
-
- virtual bool SetSampleParams(IMediaSample* outMediaSample, unsigned long inDataSize, REFERENCE_TIME* inStartTime, REFERENCE_TIME* inEndTime);
-
- HRESULT mHR;
-
- //TODO::: Couldn't this be gotten from the parent filter if we make them friends ??
- AbstractTransformOutputPin* mOutputPin;
- AbstractTransformFilter* mParentFilter;
- vector<CMediaType*> mAcceptableMediaTypes;
-
- //fstream debugLog;
- CCritSec* mStreamLock;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+//Local Includes
+#include "directshowabstractsdllstuff.h"
+#include "BasicSeekPassThrough.h"
+
+//STL Includes
+#include <vector>
+//Debug only !
+#include <fstream>
+//
+using namespace std;
+
+//Forward Declarations
+class AbstractTransformOutputPin;
+class AbstractTransformFilter;
+
+class AbstractTransformInputPin
+ //Base Classes
+ : public CBaseInputPin
+ //http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directshow/htm/cbaseinputpinclass.asp
+ , public BasicSeekPassThrough
+{
+public:
+ //Friend Classes
+ friend class AbstractTransformOutputPin;
+
+ //COM Setup
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ //Constructors
+ AbstractTransformInputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, AbstractTransformOutputPin* inOutputPin, CHAR* inObjectName, LPCWSTR inPinDisplayName, vector<CMediaType*> inAcceptableMediaTypes);
+ virtual ~AbstractTransformInputPin(void);
+
+ //Pin Conenction Methods
+ virtual HRESULT BreakConnect();
+ virtual HRESULT CompleteConnect(IPin *inReceivePin);
+
+ //Media Type control methods
+ virtual HRESULT CheckMediaType(const CMediaType *inMediaType);
+ virtual HRESULT GetMediaType(int inPosition, CMediaType *outMediaType);
+ virtual HRESULT SetMediaType(const CMediaType* inMediaType) = 0;
+
+ //TODO::: Should be virtual ??
+ virtual STDMETHODIMP Receive(IMediaSample *pSample);
+
+ //Stream Messaging methods
+ virtual STDMETHODIMP EndOfStream(void);
+ virtual STDMETHODIMP BeginFlush();
+ virtual STDMETHODIMP EndFlush();
+ virtual STDMETHODIMP NewSegment(REFERENCE_TIME inStartTime, REFERENCE_TIME inStopTime, double inRate);
+
+protected:
+ //Constants and Enumerations
+ static const short SIZE_16_BITS = 2;
+ static const signed short SINT_MAX = 32767;
+ static const signed short SINT_MIN = -32768;
+
+ //Pure Virtuals for codec specific methods
+ virtual HRESULT TransformData(unsigned char* inBuf, long inNumBytes) = 0;
+ virtual bool ConstructCodec() = 0;
+ virtual void DestroyCodec() = 0;
+
+ virtual bool SetSampleParams(IMediaSample* outMediaSample, unsigned long inDataSize, REFERENCE_TIME* inStartTime, REFERENCE_TIME* inEndTime);
+
+ HRESULT mHR;
+
+ //TODO::: Couldn't this be gotten from the parent filter if we make them friends ??
+ AbstractTransformOutputPin* mOutputPin;
+ AbstractTransformFilter* mParentFilter;
+ vector<CMediaType*> mAcceptableMediaTypes;
+
+ //fstream debugLog;
+ CCritSec* mStreamLock;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformInputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformOutputPin.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformOutputPin.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformOutputPin.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,232 +1,232 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "AbstractTransformOutputPin.h"
-
-
-AbstractTransformOutputPin::AbstractTransformOutputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, CHAR* inObjectName, LPCWSTR inPinDisplayName, int inBuffSize, int inNumBuffs, vector<CMediaType*> inAcceptableMediaTypes)
- : CBaseOutputPin(inObjectName, inParentFilter, inFilterLock, &mHR, inPinDisplayName)
-
- , mParentFilter(inParentFilter)
- , mDataQueue(NULL)
-
- , mDesiredBufferSize(inBuffSize)
- , mDesiredBufferCount(inNumBuffs)
-
- , mActualBufferSize(0)
- , mActualBufferCount(0)
-
- , mAcceptableMediaTypes(inAcceptableMediaTypes)
-{
-
-}
-AbstractTransformOutputPin::~AbstractTransformOutputPin(void)
-{
- ReleaseDelegate();
- delete mDataQueue;
- mDataQueue = NULL;
-
- for (int i = 0; i < mAcceptableMediaTypes.size(); i++) {
- delete mAcceptableMediaTypes[i];
- }
-}
-
-STDMETHODIMP AbstractTransformOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
-{
- if (riid == IID_IMediaSeeking) {
- *ppv = (IMediaSeeking*)this;
- ((IUnknown*)*ppv)->AddRef();
- return NOERROR;
- }
-
- return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
-}
-
-HRESULT AbstractTransformOutputPin::DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES* inPropertyRequest)
-{
- HRESULT locHR = S_OK;
-
- ALLOCATOR_PROPERTIES locReqAlloc;
- ALLOCATOR_PROPERTIES locActualAlloc;
-
- if (inPropertyRequest->cbAlign <= 0) {
- locReqAlloc.cbAlign = 1;
- } else {
- locReqAlloc.cbAlign = inPropertyRequest->cbAlign;
- }
-
- if (inPropertyRequest->cbBuffer < mDesiredBufferSize) {
- locReqAlloc.cbBuffer = mDesiredBufferSize;
- } else {
- locReqAlloc.cbBuffer = inPropertyRequest->cbBuffer;
- }
-
- if (inPropertyRequest->cbPrefix < 0) {
- locReqAlloc.cbPrefix = 0;
- } else {
- locReqAlloc.cbPrefix = inPropertyRequest->cbPrefix;
- }
-
- if (inPropertyRequest->cBuffers < mDesiredBufferCount) {
- locReqAlloc.cBuffers = mDesiredBufferCount;
- } else {
- locReqAlloc.cBuffers = inPropertyRequest->cBuffers;
- }
-
- locHR = inAllocator->SetProperties(&locReqAlloc, &locActualAlloc);
-
- if (locHR != S_OK) {
- //TODO::: Handle a fail state here.
- return locHR;
- } else {
- //TODO::: Need to save this pointer to decommit in destructor ???
- locHR = inAllocator->Commit();
-
- if (locHR == S_OK) {
- mActualBufferCount = locActualAlloc.cBuffers;
- mActualBufferSize = locActualAlloc.cbBuffer;
- } else {
- //TODO::: Handle commit failure.
- }
-
- return locHR;
- }
-}
-HRESULT AbstractTransformOutputPin::CheckMediaType(const CMediaType *inMediaType)
-{
- for (int i = 0; i < mAcceptableMediaTypes.size(); i++) {
- if ( (inMediaType->majortype == mAcceptableMediaTypes[i]->majortype)
- && (inMediaType->subtype == mAcceptableMediaTypes[i]->subtype)
- && (inMediaType->formattype == mAcceptableMediaTypes[i]->formattype)
- )
- {
- return S_OK;
-
- }
- }
-
- //If it was none of them return false.
- return S_FALSE;
-}
-
-void AbstractTransformOutputPin::FillMediaType(CMediaType* outMediaType, int inPosition)
-{
- //We are gauranteed that inPosition is within the range of the vector (See GetMediaType)
- // If you override the mediaformat functions you must ensure this yourself before calling.
-
- outMediaType->SetType(&(mAcceptableMediaTypes[inPosition]->majortype));
- outMediaType->SetSubtype(&(mAcceptableMediaTypes[inPosition]->subtype));
- outMediaType->SetFormatType(&(mAcceptableMediaTypes[inPosition]->formattype));
-
- //If you want something different you need to override this yourself.
- // Sample size of 0 means variable size... so that is almost always acceptable.
- outMediaType->SetTemporalCompression(FALSE);
- outMediaType->SetSampleSize(0);
-}
-
-HRESULT AbstractTransformOutputPin::GetMediaType(int inPosition, CMediaType *outMediaType)
-{
- if (inPosition < 0) {
- return E_INVALIDARG;
- }
-
- if (inPosition < mAcceptableMediaTypes.size()) {
- FillMediaType(outMediaType, inPosition);
- CreateAndFillFormatBuffer(outMediaType, inPosition);
- return S_OK;
- } else {
- return VFW_S_NO_MORE_ITEMS;
- }
-}
-
-HRESULT AbstractTransformOutputPin::DeliverNewSegment(REFERENCE_TIME inStartTime, REFERENCE_TIME inStopTime, double inRate)
-{
- mDataQueue->NewSegment(inStartTime, inStopTime, inRate);
- return S_OK;
-}
-HRESULT AbstractTransformOutputPin::DeliverEndOfStream(void)
-{
- //Lock ?????
- mDataQueue->EOS();
- return S_OK;
-}
-
-HRESULT AbstractTransformOutputPin::DeliverEndFlush(void)
-{
- CAutoLock locLock(m_pLock);
-
- mDataQueue->EndFlush();
- return S_OK;
-}
-
-HRESULT AbstractTransformOutputPin::DeliverBeginFlush(void)
-{
- CAutoLock locLock(m_pLock);
-
- mDataQueue->BeginFlush();
- return S_OK;
-}
-
-HRESULT AbstractTransformOutputPin::CompleteConnect(IPin *inReceivePin)
-{
- CAutoLock locLock(m_pLock);
- HRESULT locHR = S_OK;
-
- //Here when another pin connects to us, we internally connect the seek delegate
- // from this output pin onto the input pin... and we release it on breakconnect.
- //
- IMediaSeeking* locSeeker = NULL;
- mParentFilter->mInputPin->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
- SetDelegate(locSeeker);
-
- mDataQueue = new COutputQueue (inReceivePin, &locHR, FALSE, FALSE, 1, TRUE, mActualBufferCount); //Deleted in destructor
-
- if (FAILED(locHR)) {
- //Handle data Q failure
-
- }
-
- return CBaseOutputPin::CompleteConnect(inReceivePin);
-}
-
-HRESULT AbstractTransformOutputPin::BreakConnect(void)
-{
- CAutoLock locLock(m_pLock);
-
- delete mDataQueue;
- mDataQueue = NULL;
-
- HRESULT locHR = CBaseOutputPin::BreakConnect();
- ReleaseDelegate();
-
- return locHR;
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "AbstractTransformOutputPin.h"
+
+
+AbstractTransformOutputPin::AbstractTransformOutputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, CHAR* inObjectName, LPCWSTR inPinDisplayName, int inBuffSize, int inNumBuffs, vector<CMediaType*> inAcceptableMediaTypes)
+ : CBaseOutputPin(inObjectName, inParentFilter, inFilterLock, &mHR, inPinDisplayName)
+
+ , mParentFilter(inParentFilter)
+ , mDataQueue(NULL)
+
+ , mDesiredBufferSize(inBuffSize)
+ , mDesiredBufferCount(inNumBuffs)
+
+ , mActualBufferSize(0)
+ , mActualBufferCount(0)
+
+ , mAcceptableMediaTypes(inAcceptableMediaTypes)
+{
+
+}
+AbstractTransformOutputPin::~AbstractTransformOutputPin(void)
+{
+ ReleaseDelegate();
+ delete mDataQueue;
+ mDataQueue = NULL;
+
+ for (int i = 0; i < mAcceptableMediaTypes.size(); i++) {
+ delete mAcceptableMediaTypes[i];
+ }
+}
+
+STDMETHODIMP AbstractTransformOutputPin::NonDelegatingQueryInterface(REFIID riid, void **ppv)
+{
+ if (riid == IID_IMediaSeeking) {
+ *ppv = (IMediaSeeking*)this;
+ ((IUnknown*)*ppv)->AddRef();
+ return NOERROR;
+ }
+
+ return CBaseOutputPin::NonDelegatingQueryInterface(riid, ppv);
+}
+
+HRESULT AbstractTransformOutputPin::DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES* inPropertyRequest)
+{
+ HRESULT locHR = S_OK;
+
+ ALLOCATOR_PROPERTIES locReqAlloc;
+ ALLOCATOR_PROPERTIES locActualAlloc;
+
+ if (inPropertyRequest->cbAlign <= 0) {
+ locReqAlloc.cbAlign = 1;
+ } else {
+ locReqAlloc.cbAlign = inPropertyRequest->cbAlign;
+ }
+
+ if (inPropertyRequest->cbBuffer < mDesiredBufferSize) {
+ locReqAlloc.cbBuffer = mDesiredBufferSize;
+ } else {
+ locReqAlloc.cbBuffer = inPropertyRequest->cbBuffer;
+ }
+
+ if (inPropertyRequest->cbPrefix < 0) {
+ locReqAlloc.cbPrefix = 0;
+ } else {
+ locReqAlloc.cbPrefix = inPropertyRequest->cbPrefix;
+ }
+
+ if (inPropertyRequest->cBuffers < mDesiredBufferCount) {
+ locReqAlloc.cBuffers = mDesiredBufferCount;
+ } else {
+ locReqAlloc.cBuffers = inPropertyRequest->cBuffers;
+ }
+
+ locHR = inAllocator->SetProperties(&locReqAlloc, &locActualAlloc);
+
+ if (locHR != S_OK) {
+ //TODO::: Handle a fail state here.
+ return locHR;
+ } else {
+ //TODO::: Need to save this pointer to decommit in destructor ???
+ locHR = inAllocator->Commit();
+
+ if (locHR == S_OK) {
+ mActualBufferCount = locActualAlloc.cBuffers;
+ mActualBufferSize = locActualAlloc.cbBuffer;
+ } else {
+ //TODO::: Handle commit failure.
+ }
+
+ return locHR;
+ }
+}
+HRESULT AbstractTransformOutputPin::CheckMediaType(const CMediaType *inMediaType)
+{
+ for (int i = 0; i < mAcceptableMediaTypes.size(); i++) {
+ if ( (inMediaType->majortype == mAcceptableMediaTypes[i]->majortype)
+ && (inMediaType->subtype == mAcceptableMediaTypes[i]->subtype)
+ && (inMediaType->formattype == mAcceptableMediaTypes[i]->formattype)
+ )
+ {
+ return S_OK;
+
+ }
+ }
+
+ //If it was none of them return false.
+ return S_FALSE;
+}
+
+void AbstractTransformOutputPin::FillMediaType(CMediaType* outMediaType, int inPosition)
+{
+ //We are gauranteed that inPosition is within the range of the vector (See GetMediaType)
+ // If you override the mediaformat functions you must ensure this yourself before calling.
+
+ outMediaType->SetType(&(mAcceptableMediaTypes[inPosition]->majortype));
+ outMediaType->SetSubtype(&(mAcceptableMediaTypes[inPosition]->subtype));
+ outMediaType->SetFormatType(&(mAcceptableMediaTypes[inPosition]->formattype));
+
+ //If you want something different you need to override this yourself.
+ // Sample size of 0 means variable size... so that is almost always acceptable.
+ outMediaType->SetTemporalCompression(FALSE);
+ outMediaType->SetSampleSize(0);
+}
+
+HRESULT AbstractTransformOutputPin::GetMediaType(int inPosition, CMediaType *outMediaType)
+{
+ if (inPosition < 0) {
+ return E_INVALIDARG;
+ }
+
+ if (inPosition < mAcceptableMediaTypes.size()) {
+ FillMediaType(outMediaType, inPosition);
+ CreateAndFillFormatBuffer(outMediaType, inPosition);
+ return S_OK;
+ } else {
+ return VFW_S_NO_MORE_ITEMS;
+ }
+}
+
+HRESULT AbstractTransformOutputPin::DeliverNewSegment(REFERENCE_TIME inStartTime, REFERENCE_TIME inStopTime, double inRate)
+{
+ mDataQueue->NewSegment(inStartTime, inStopTime, inRate);
+ return S_OK;
+}
+HRESULT AbstractTransformOutputPin::DeliverEndOfStream(void)
+{
+ //Lock ?????
+ mDataQueue->EOS();
+ return S_OK;
+}
+
+HRESULT AbstractTransformOutputPin::DeliverEndFlush(void)
+{
+ CAutoLock locLock(m_pLock);
+
+ mDataQueue->EndFlush();
+ return S_OK;
+}
+
+HRESULT AbstractTransformOutputPin::DeliverBeginFlush(void)
+{
+ CAutoLock locLock(m_pLock);
+
+ mDataQueue->BeginFlush();
+ return S_OK;
+}
+
+HRESULT AbstractTransformOutputPin::CompleteConnect(IPin *inReceivePin)
+{
+ CAutoLock locLock(m_pLock);
+ HRESULT locHR = S_OK;
+
+ //Here when another pin connects to us, we internally connect the seek delegate
+ // from this output pin onto the input pin... and we release it on breakconnect.
+ //
+ IMediaSeeking* locSeeker = NULL;
+ mParentFilter->mInputPin->NonDelegatingQueryInterface(IID_IMediaSeeking, (void**)&locSeeker);
+ SetDelegate(locSeeker);
+
+ mDataQueue = new COutputQueue (inReceivePin, &locHR, FALSE, FALSE, 1, TRUE, mActualBufferCount); //Deleted in destructor
+
+ if (FAILED(locHR)) {
+ //Handle data Q failure
+
+ }
+
+ return CBaseOutputPin::CompleteConnect(inReceivePin);
+}
+
+HRESULT AbstractTransformOutputPin::BreakConnect(void)
+{
+ CAutoLock locLock(m_pLock);
+
+ delete mDataQueue;
+ mDataQueue = NULL;
+
+ HRESULT locHR = CBaseOutputPin::BreakConnect();
+ ReleaseDelegate();
+
+ return locHR;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformOutputPin.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformOutputPin.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformOutputPin.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformOutputPin.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,98 +1,98 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-//Local Includes
-#include "directshowabstractsdllstuff.h"
-#include "BasicSeekPassThrough.h"
-
-//STL Includes
-#include <vector>
-using namespace std;
-
-//Forward Declarations
-class AbstractTransformFilter;
-
-class AbstractTransformOutputPin
- //Base Classes
- : public CBaseOutputPin
- //http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directshow/htm/cbaseoutputpinclass.asp
- , public BasicSeekPassThrough
-{
-public:
- //COM Initialisation
- DECLARE_IUNKNOWN
- STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
-
- //Constructors
- AbstractTransformOutputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, CHAR* inObjectName, LPCWSTR inPinDisplayName, int inBuffSize, int inNumBuffs, vector<CMediaType*> inAcceptableMediaTypes);
- virtual ~AbstractTransformOutputPin(void);
-
- //Buffer control method
- virtual HRESULT DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES *inReqAllocProps);
-
- //Media Type control methods.
- virtual HRESULT CheckMediaType(const CMediaType *inMediaType);
- virtual HRESULT GetMediaType(int inPosition, CMediaType *outMediaType);
-
- //Pure virtuals for codec specific format data
- virtual HRESULT CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition) = 0;
-
- //Virtuals for data queue delegation
- virtual HRESULT BreakConnect(void);
- virtual HRESULT CompleteConnect (IPin *inReceivePin);
- virtual HRESULT DeliverNewSegment(REFERENCE_TIME inStartTime, REFERENCE_TIME inStopTime, double inRate);
- virtual HRESULT DeliverEndOfStream(void);
- virtual HRESULT DeliverEndFlush(void);
- virtual HRESULT DeliverBeginFlush(void);
-
-protected:
- //Helper methods
- void FillMediaType(CMediaType* outMediaType, int inPosition);
-
- //Pin member data
- AbstractTransformFilter* mParentFilter;
- COutputQueue* mDataQueue;
- vector<CMediaType*> mAcceptableMediaTypes;
-
- HRESULT mHR; //Is this even used ??
-
- //Buffer parameter member data
- int mDesiredBufferSize;
- int mDesiredBufferCount;
- int mActualBufferSize;
- int mActualBufferCount;
-
-
-};
-
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+//Local Includes
+#include "directshowabstractsdllstuff.h"
+#include "BasicSeekPassThrough.h"
+
+//STL Includes
+#include <vector>
+using namespace std;
+
+//Forward Declarations
+class AbstractTransformFilter;
+
+class AbstractTransformOutputPin
+ //Base Classes
+ : public CBaseOutputPin
+ //http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directshow/htm/cbaseoutputpinclass.asp
+ , public BasicSeekPassThrough
+{
+public:
+ //COM Initialisation
+ DECLARE_IUNKNOWN
+ STDMETHODIMP NonDelegatingQueryInterface(REFIID riid, void **ppv);
+
+ //Constructors
+ AbstractTransformOutputPin(AbstractTransformFilter* inParentFilter, CCritSec* inFilterLock, CHAR* inObjectName, LPCWSTR inPinDisplayName, int inBuffSize, int inNumBuffs, vector<CMediaType*> inAcceptableMediaTypes);
+ virtual ~AbstractTransformOutputPin(void);
+
+ //Buffer control method
+ virtual HRESULT DecideBufferSize(IMemAllocator* inAllocator, ALLOCATOR_PROPERTIES *inReqAllocProps);
+
+ //Media Type control methods.
+ virtual HRESULT CheckMediaType(const CMediaType *inMediaType);
+ virtual HRESULT GetMediaType(int inPosition, CMediaType *outMediaType);
+
+ //Pure virtuals for codec specific format data
+ virtual HRESULT CreateAndFillFormatBuffer(CMediaType* outMediaType, int inPosition) = 0;
+
+ //Virtuals for data queue delegation
+ virtual HRESULT BreakConnect(void);
+ virtual HRESULT CompleteConnect (IPin *inReceivePin);
+ virtual HRESULT DeliverNewSegment(REFERENCE_TIME inStartTime, REFERENCE_TIME inStopTime, double inRate);
+ virtual HRESULT DeliverEndOfStream(void);
+ virtual HRESULT DeliverEndFlush(void);
+ virtual HRESULT DeliverBeginFlush(void);
+
+protected:
+ //Helper methods
+ void FillMediaType(CMediaType* outMediaType, int inPosition);
+
+ //Pin member data
+ AbstractTransformFilter* mParentFilter;
+ COutputQueue* mDataQueue;
+ vector<CMediaType*> mAcceptableMediaTypes;
+
+ HRESULT mHR; //Is this even used ??
+
+ //Buffer parameter member data
+ int mDesiredBufferSize;
+ int mDesiredBufferCount;
+ int mActualBufferSize;
+ int mActualBufferCount;
+
+
+};
+
+
Property changes on: trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/AbstractTransformOutputPin.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/BasicSeekPassThrough.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/BasicSeekPassThrough.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/BasicSeekPassThrough.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -29,308 +29,308 @@
//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "BasicSeekPassThrough.h"
-
-BasicSeekPassThrough::BasicSeekPassThrough(IMediaSeeking* inDelegate)
- //: CUnknown(NAME("Basic Seekable Thing"), NULL, &mHR)
-{
- mSeekDelegate = inDelegate;
- //mSeekTimeBase = 0;
-
- mSeekingCap = 0;
- mSeekingCap = AM_SEEKING_CanSeekAbsolute |
- AM_SEEKING_CanSeekForwards |
- AM_SEEKING_CanSeekBackwards |
- //AM_SEEKING_CanGetCurrentPos |
- AM_SEEKING_CanGetStopPos |
- AM_SEEKING_CanGetDuration;
-
- //string x = "g:\\logs\\seeker.log";
- //seekDebug.open(x.c_str(), ios_base::out);
-
-}
-
-BasicSeekPassThrough::BasicSeekPassThrough(void)
- //: CUnknown(NAME("Basic Seekable Thing"), NULL, &mHR)
-{
- //mSeekTimeBase = 0;
- mSeekDelegate = NULL;
- mSeekingCap = AM_SEEKING_CanSeekAbsolute |
- AM_SEEKING_CanSeekForwards |
- AM_SEEKING_CanSeekBackwards |
- //AM_SEEKING_CanGetCurrentPos |
- AM_SEEKING_CanGetStopPos |
- AM_SEEKING_CanGetDuration;
-
- //string x = "g:\\logs\\seeker.log";
- //seekDebug.open(x.c_str(), ios_base::out);
-
-
-}
-
-bool BasicSeekPassThrough::ReleaseDelegate() {
- if (mSeekDelegate != NULL) {
- mSeekDelegate->Release();
- mSeekDelegate = NULL;
- }
- return true;
-}
-
-bool BasicSeekPassThrough::SetDelegate(IMediaSeeking* inDelegate) {
- mSeekDelegate = inDelegate;
- return true;
-}
-BasicSeekPassThrough::~BasicSeekPassThrough(void)
-{
- //TODO::: FActor this... use the new releasedelegate function.
- if (mSeekDelegate != NULL) {
- mSeekDelegate->Release();
- mSeekDelegate = NULL;
- }
- //seekDebug.close();
-}
-//IMediaSeeking Interface
-STDMETHODIMP BasicSeekPassThrough::GetCapabilities(DWORD* inCapabilities) {
-//typedef
-//enum AM_SEEKING_SeekingCapabilities {
-// AM_SEEKING_CanSeekAbsolute = 0x1,
-// AM_SEEKING_CanSeekForwards = 0x2,
-// AM_SEEKING_CanSeekBackwards = 0x4,
-// AM_SEEKING_CanGetCurrentPos = 0x8,
-// AM_SEEKING_CanGetStopPos = 0x10,
-// AM_SEEKING_CanGetDuration = 0x20,
-// AM_SEEKING_CanPlayBackwards = 0x40,
-// AM_SEEKING_CanDoSegments = 0x80,
-// AM_SEEKING_Source = 0x100
-//} AM_SEEKING_SEEKING_CAPABILITIES;
-
-
- //*inCapabilities = mSeekingCap;
- //return S_OK;
-
- if (mSeekDelegate != NULL) {
- //seekDebug<<"GetCaps : Passed on..."<<endl;
- return mSeekDelegate->GetCapabilities(inCapabilities);
- } else {
- //seekDebug<<"GetCaps : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-
-}
-STDMETHODIMP BasicSeekPassThrough::CheckCapabilities(DWORD* outCapabilities) {
-
-
- //if (inCapabilities == NULL) {
- // return E_POINTER;
- //}
- //*inCapabilities &= mSeekingCap;
-
- //if (*inCapabilities == mSeekingCap) {
- // return S_OK;
- //} else {
- // return E_NOTIMPL;
- //}
-
-
- if (mSeekDelegate != NULL) {
- //seekDebug<<"CheckCaps : Passed on..."<<endl;
- return mSeekDelegate->CheckCapabilities(outCapabilities);
- } else {
- //seekDebug<<"CheckCaps : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-
-}
-STDMETHODIMP BasicSeekPassThrough::IsFormatSupported(const GUID* inFormat) {
-
- //if (inFormat == NULL) {
- // return E_POINTER;
- //}
- //if (*inFormat == TIME_FORMAT_MEDIA_TIME) {
- // return S_OK;
- //} else {
- // return S_FALSE;
- //}
-
- if (mSeekDelegate != NULL) {
- //seekDebug<<"IsFromatsupp : Passed on..."<<endl;
- return mSeekDelegate->IsFormatSupported(inFormat);
- } else {
- //seekDebug<<"IsFromatsupp : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-
-}
-STDMETHODIMP BasicSeekPassThrough::QueryPreferredFormat(GUID* outFormat) {
- //if (inFormat == NULL) {
- // return E_POINTER;
- //}
-
- //*outFormat = TIME_FORMAT_MEDIA_TIME;
-
- //return S_OK;
- if (mSeekDelegate != NULL) {
- //seekDebug<<"Query preff : Passed on..."<<endl;
- return mSeekDelegate->QueryPreferredFormat(outFormat);
- } else {
- //seekDebug<<"Query preff : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-
-}
-STDMETHODIMP BasicSeekPassThrough::SetTimeFormat(const GUID* inFormat) {
-
- if (mSeekDelegate != NULL) {
- //seekDebug<<"SetTimeformat :Passed on..."<<endl;
- return mSeekDelegate->SetTimeFormat(inFormat);
- } else {
- //seekDebug<<"SetTimeformat : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-}
-
-STDMETHODIMP BasicSeekPassThrough::GetTimeFormat( GUID *outFormat) {
- if (mSeekDelegate != NULL) {
- //seekDebug<<"Gettimeformat : Passed on..."<<endl;
- return mSeekDelegate->GetTimeFormat(outFormat);
- } else {
- //seekDebug<<"Gettimeformat : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-}
-STDMETHODIMP BasicSeekPassThrough::GetDuration(LONGLONG* outDuration) {
-
- if (mSeekDelegate != NULL) {
- //seekDebug<<"Getdureation : Passed on..."<<endl;
- return mSeekDelegate->GetDuration(outDuration);
- } else {
- //seekDebug<<"Getdureation : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
- //return E_NOTIMPL;
-}
-STDMETHODIMP BasicSeekPassThrough::GetStopPosition(LONGLONG* inStop) {
- if (mSeekDelegate != NULL) {
- //seekDebug<<"Getstoppos : Passed on..."<<endl;
- return mSeekDelegate->GetStopPosition(inStop);
- } else {
- //seekDebug<<"Getstoppos : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
- //return E_NOTIMPL;
-}
-STDMETHODIMP BasicSeekPassThrough::GetCurrentPosition(LONGLONG* outCurrent) {
- //return E_NOTIMPL;
-
- if (mSeekDelegate != NULL) {
- //seekDebug<<"Getcurrpos : Passed on..."<<endl;
- return mSeekDelegate->GetCurrentPosition(outCurrent);
- } else {
- //seekDebug<<"Getcurrpos : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-}
-STDMETHODIMP BasicSeekPassThrough::ConvertTimeFormat(LONGLONG* outTarget, const GUID* inTargetFormat, LONGLONG inSource, const GUID* inSourceFormat) {
- //return E_NOTIMPL;
- if (mSeekDelegate != NULL) {
- //seekDebug<<"ConvTimeformat : Passed on..."<<endl;
- return mSeekDelegate->ConvertTimeFormat(outTarget, inTargetFormat, inSource, inSourceFormat);
- } else {
- //seekDebug<<"ConvTimeformat : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-}
-STDMETHODIMP BasicSeekPassThrough::SetPositions(LONGLONG* inoutCurrent, DWORD inCurrentFlags, LONGLONG* inStop, DWORD inStopFlags) {
- if (mSeekDelegate != NULL) {
- //seekDebug<<"Set pos : Requested Time : "<<*inoutCurrent<<endl;
- HRESULT locHR = mSeekDelegate->SetPositions(inoutCurrent, inCurrentFlags, inStop, inStopFlags);
- if (locHR == S_OK) {
- //mSeekTimeBase = *inoutCurrent;
- //seekDebug<<"Set Pos : Actual Time : "<<*inoutCurrent<<endl;
-
- }
- return locHR;
- } else {
- //seekDebug<<"Set pos : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-
-}
-STDMETHODIMP BasicSeekPassThrough::GetPositions(LONGLONG* outCurrent, LONGLONG* outStop) {
- if (mSeekDelegate != NULL) {
- //seekDebug<<"GetPos : Passed on..."<<endl;
- return mSeekDelegate->GetPositions(outCurrent, outStop);
- } else {
- //seekDebug<<"GetPos : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-
-}
-STDMETHODIMP BasicSeekPassThrough::GetAvailable(LONGLONG* outEarliest, LONGLONG* outLatest) {
- if (mSeekDelegate != NULL) {
- //seekDebug<<"Getavail : Passed on..."<<endl;
- return mSeekDelegate->GetAvailable(outEarliest, outLatest);
- } else {
- //seekDebug<<"Getavail : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-}
-STDMETHODIMP BasicSeekPassThrough::SetRate(double inRate) {
-
- if (mSeekDelegate != NULL) {
- //seekDebug<<"Setrate : Passed on..."<<endl;
- return mSeekDelegate->SetRate(inRate);
- } else {
- //seekDebug<<"Setrate : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-}
-STDMETHODIMP BasicSeekPassThrough::GetRate(double* outRate) {
- if (mSeekDelegate != NULL) {
- //seekDebug<<"Getrate : Passed on..."<<endl;
- return mSeekDelegate->GetRate(outRate);
- } else {
- //seekDebug<<"Getrate : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-}
-STDMETHODIMP BasicSeekPassThrough::GetPreroll(LONGLONG* outPreroll) {
- if (mSeekDelegate != NULL) {
- //seekDebug<<"Getpreroll : Passed on..."<<endl;
- return mSeekDelegate->GetPreroll(outPreroll);
- } else {
- //seekDebug<<"Getpreroll : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-}
-STDMETHODIMP BasicSeekPassThrough::IsUsingTimeFormat(const GUID* inFormat) {
-if (mSeekDelegate != NULL) {
- //seekDebug<<"Isusingtimeformat : Passed on..."<<endl;
- return mSeekDelegate->IsUsingTimeFormat(inFormat);
- } else {
- //seekDebug<<"Isusingtimeformat : NULL Delegate"<<endl;
- //This is probably wrong.
- return E_NOTIMPL;
- }
-}
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "BasicSeekPassThrough.h"
+
+BasicSeekPassThrough::BasicSeekPassThrough(IMediaSeeking* inDelegate)
+ //: CUnknown(NAME("Basic Seekable Thing"), NULL, &mHR)
+{
+ mSeekDelegate = inDelegate;
+ //mSeekTimeBase = 0;
+
+ mSeekingCap = 0;
+ mSeekingCap = AM_SEEKING_CanSeekAbsolute |
+ AM_SEEKING_CanSeekForwards |
+ AM_SEEKING_CanSeekBackwards |
+ //AM_SEEKING_CanGetCurrentPos |
+ AM_SEEKING_CanGetStopPos |
+ AM_SEEKING_CanGetDuration;
+
+ //string x = "g:\\logs\\seeker.log";
+ //seekDebug.open(x.c_str(), ios_base::out);
+
+}
+
+BasicSeekPassThrough::BasicSeekPassThrough(void)
+ //: CUnknown(NAME("Basic Seekable Thing"), NULL, &mHR)
+{
+ //mSeekTimeBase = 0;
+ mSeekDelegate = NULL;
+ mSeekingCap = AM_SEEKING_CanSeekAbsolute |
+ AM_SEEKING_CanSeekForwards |
+ AM_SEEKING_CanSeekBackwards |
+ //AM_SEEKING_CanGetCurrentPos |
+ AM_SEEKING_CanGetStopPos |
+ AM_SEEKING_CanGetDuration;
+
+ //string x = "g:\\logs\\seeker.log";
+ //seekDebug.open(x.c_str(), ios_base::out);
+
+
+}
+
+bool BasicSeekPassThrough::ReleaseDelegate() {
+ if (mSeekDelegate != NULL) {
+ mSeekDelegate->Release();
+ mSeekDelegate = NULL;
+ }
+ return true;
+}
+
+bool BasicSeekPassThrough::SetDelegate(IMediaSeeking* inDelegate) {
+ mSeekDelegate = inDelegate;
+ return true;
+}
+BasicSeekPassThrough::~BasicSeekPassThrough(void)
+{
+ //TODO::: FActor this... use the new releasedelegate function.
+ if (mSeekDelegate != NULL) {
+ mSeekDelegate->Release();
+ mSeekDelegate = NULL;
+ }
+ //seekDebug.close();
+}
+//IMediaSeeking Interface
+STDMETHODIMP BasicSeekPassThrough::GetCapabilities(DWORD* inCapabilities) {
+//typedef
+//enum AM_SEEKING_SeekingCapabilities {
+// AM_SEEKING_CanSeekAbsolute = 0x1,
+// AM_SEEKING_CanSeekForwards = 0x2,
+// AM_SEEKING_CanSeekBackwards = 0x4,
+// AM_SEEKING_CanGetCurrentPos = 0x8,
+// AM_SEEKING_CanGetStopPos = 0x10,
+// AM_SEEKING_CanGetDuration = 0x20,
+// AM_SEEKING_CanPlayBackwards = 0x40,
+// AM_SEEKING_CanDoSegments = 0x80,
+// AM_SEEKING_Source = 0x100
+//} AM_SEEKING_SEEKING_CAPABILITIES;
+
+
+ //*inCapabilities = mSeekingCap;
+ //return S_OK;
+
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"GetCaps : Passed on..."<<endl;
+ return mSeekDelegate->GetCapabilities(inCapabilities);
+ } else {
+ //seekDebug<<"GetCaps : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+
+}
+STDMETHODIMP BasicSeekPassThrough::CheckCapabilities(DWORD* outCapabilities) {
+
+
+ //if (inCapabilities == NULL) {
+ // return E_POINTER;
+ //}
+ //*inCapabilities &= mSeekingCap;
+
+ //if (*inCapabilities == mSeekingCap) {
+ // return S_OK;
+ //} else {
+ // return E_NOTIMPL;
+ //}
+
+
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"CheckCaps : Passed on..."<<endl;
+ return mSeekDelegate->CheckCapabilities(outCapabilities);
+ } else {
+ //seekDebug<<"CheckCaps : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+
+}
+STDMETHODIMP BasicSeekPassThrough::IsFormatSupported(const GUID* inFormat) {
+
+ //if (inFormat == NULL) {
+ // return E_POINTER;
+ //}
+ //if (*inFormat == TIME_FORMAT_MEDIA_TIME) {
+ // return S_OK;
+ //} else {
+ // return S_FALSE;
+ //}
+
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"IsFromatsupp : Passed on..."<<endl;
+ return mSeekDelegate->IsFormatSupported(inFormat);
+ } else {
+ //seekDebug<<"IsFromatsupp : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+
+}
+STDMETHODIMP BasicSeekPassThrough::QueryPreferredFormat(GUID* outFormat) {
+ //if (inFormat == NULL) {
+ // return E_POINTER;
+ //}
+
+ //*outFormat = TIME_FORMAT_MEDIA_TIME;
+
+ //return S_OK;
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"Query preff : Passed on..."<<endl;
+ return mSeekDelegate->QueryPreferredFormat(outFormat);
+ } else {
+ //seekDebug<<"Query preff : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+
+}
+STDMETHODIMP BasicSeekPassThrough::SetTimeFormat(const GUID* inFormat) {
+
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"SetTimeformat :Passed on..."<<endl;
+ return mSeekDelegate->SetTimeFormat(inFormat);
+ } else {
+ //seekDebug<<"SetTimeformat : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+}
+
+STDMETHODIMP BasicSeekPassThrough::GetTimeFormat( GUID *outFormat) {
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"Gettimeformat : Passed on..."<<endl;
+ return mSeekDelegate->GetTimeFormat(outFormat);
+ } else {
+ //seekDebug<<"Gettimeformat : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+}
+STDMETHODIMP BasicSeekPassThrough::GetDuration(LONGLONG* outDuration) {
+
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"Getdureation : Passed on..."<<endl;
+ return mSeekDelegate->GetDuration(outDuration);
+ } else {
+ //seekDebug<<"Getdureation : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+ //return E_NOTIMPL;
+}
+STDMETHODIMP BasicSeekPassThrough::GetStopPosition(LONGLONG* inStop) {
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"Getstoppos : Passed on..."<<endl;
+ return mSeekDelegate->GetStopPosition(inStop);
+ } else {
+ //seekDebug<<"Getstoppos : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+ //return E_NOTIMPL;
+}
+STDMETHODIMP BasicSeekPassThrough::GetCurrentPosition(LONGLONG* outCurrent) {
+ //return E_NOTIMPL;
+
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"Getcurrpos : Passed on..."<<endl;
+ return mSeekDelegate->GetCurrentPosition(outCurrent);
+ } else {
+ //seekDebug<<"Getcurrpos : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+}
+STDMETHODIMP BasicSeekPassThrough::ConvertTimeFormat(LONGLONG* outTarget, const GUID* inTargetFormat, LONGLONG inSource, const GUID* inSourceFormat) {
+ //return E_NOTIMPL;
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"ConvTimeformat : Passed on..."<<endl;
+ return mSeekDelegate->ConvertTimeFormat(outTarget, inTargetFormat, inSource, inSourceFormat);
+ } else {
+ //seekDebug<<"ConvTimeformat : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+}
+STDMETHODIMP BasicSeekPassThrough::SetPositions(LONGLONG* inoutCurrent, DWORD inCurrentFlags, LONGLONG* inStop, DWORD inStopFlags) {
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"Set pos : Requested Time : "<<*inoutCurrent<<endl;
+ HRESULT locHR = mSeekDelegate->SetPositions(inoutCurrent, inCurrentFlags, inStop, inStopFlags);
+ if (locHR == S_OK) {
+ //mSeekTimeBase = *inoutCurrent;
+ //seekDebug<<"Set Pos : Actual Time : "<<*inoutCurrent<<endl;
+
+ }
+ return locHR;
+ } else {
+ //seekDebug<<"Set pos : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+
+}
+STDMETHODIMP BasicSeekPassThrough::GetPositions(LONGLONG* outCurrent, LONGLONG* outStop) {
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"GetPos : Passed on..."<<endl;
+ return mSeekDelegate->GetPositions(outCurrent, outStop);
+ } else {
+ //seekDebug<<"GetPos : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+
+}
+STDMETHODIMP BasicSeekPassThrough::GetAvailable(LONGLONG* outEarliest, LONGLONG* outLatest) {
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"Getavail : Passed on..."<<endl;
+ return mSeekDelegate->GetAvailable(outEarliest, outLatest);
+ } else {
+ //seekDebug<<"Getavail : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+}
+STDMETHODIMP BasicSeekPassThrough::SetRate(double inRate) {
+
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"Setrate : Passed on..."<<endl;
+ return mSeekDelegate->SetRate(inRate);
+ } else {
+ //seekDebug<<"Setrate : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+}
+STDMETHODIMP BasicSeekPassThrough::GetRate(double* outRate) {
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"Getrate : Passed on..."<<endl;
+ return mSeekDelegate->GetRate(outRate);
+ } else {
+ //seekDebug<<"Getrate : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+}
+STDMETHODIMP BasicSeekPassThrough::GetPreroll(LONGLONG* outPreroll) {
+ if (mSeekDelegate != NULL) {
+ //seekDebug<<"Getpreroll : Passed on..."<<endl;
+ return mSeekDelegate->GetPreroll(outPreroll);
+ } else {
+ //seekDebug<<"Getpreroll : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+}
+STDMETHODIMP BasicSeekPassThrough::IsUsingTimeFormat(const GUID* inFormat) {
+if (mSeekDelegate != NULL) {
+ //seekDebug<<"Isusingtimeformat : Passed on..."<<endl;
+ return mSeekDelegate->IsUsingTimeFormat(inFormat);
+ } else {
+ //seekDebug<<"Isusingtimeformat : NULL Delegate"<<endl;
+ //This is probably wrong.
+ return E_NOTIMPL;
+ }
+}
//
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/BasicSeekPassThrough.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/BasicSeekPassThrough.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/BasicSeekPassThrough.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/BasicSeekPassThrough.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -29,53 +29,53 @@
//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-
-//STL Includes
-#include <fstream>
-using namespace std;
-
-class BasicSeekPassThrough
- //Base classes.
- : public IMediaSeeking
-{
-public:
- //Constructors
- BasicSeekPassThrough(void);
- BasicSeekPassThrough(IMediaSeeking* inDelegate);
- virtual ~BasicSeekPassThrough(void);
-
- //Delegate Control Methods.
- bool SetDelegate(IMediaSeeking* inDelegate);
- bool ReleaseDelegate();
-
- //IMediaSeeking Interface
- virtual STDMETHODIMP GetCapabilities(DWORD *pCapabilities);
- virtual STDMETHODIMP CheckCapabilities(DWORD *pCapabilities);
- virtual STDMETHODIMP IsFormatSupported(const GUID *pFormat);
- virtual STDMETHODIMP QueryPreferredFormat(GUID *pFormat);
- virtual STDMETHODIMP SetTimeFormat(const GUID *pFormat);
- virtual STDMETHODIMP GetTimeFormat( GUID *pFormat);
- virtual STDMETHODIMP GetDuration(LONGLONG *pDuration);
- virtual STDMETHODIMP GetStopPosition(LONGLONG *pStop);
- virtual STDMETHODIMP GetCurrentPosition(LONGLONG *pCurrent);
- virtual STDMETHODIMP ConvertTimeFormat(LONGLONG *pTarget, const GUID *pTargetFormat, LONGLONG Source, const GUID *pSourceFormat);
- virtual STDMETHODIMP SetPositions(LONGLONG *pCurrent,DWORD dwCurrentFlags,LONGLONG *pStop,DWORD dwStopFlags);
- virtual STDMETHODIMP GetPositions(LONGLONG *pCurrent, LONGLONG *pStop);
- virtual STDMETHODIMP GetAvailable(LONGLONG *pEarliest, LONGLONG *pLatest);
- virtual STDMETHODIMP SetRate(double dRate);
- virtual STDMETHODIMP GetRate(double *dRate);
- virtual STDMETHODIMP GetPreroll(LONGLONG *pllPreroll);
- virtual STDMETHODIMP IsUsingTimeFormat(const GUID *pFormat);
-
-protected:
- //Member data
- IMediaSeeking* mSeekDelegate;
- HRESULT mHR;
- DWORD mSeekingCap;
-
- //Debug only.
- //fstream seekDebug;
-};
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+
+//STL Includes
+#include <fstream>
+using namespace std;
+
+class BasicSeekPassThrough
+ //Base classes.
+ : public IMediaSeeking
+{
+public:
+ //Constructors
+ BasicSeekPassThrough(void);
+ BasicSeekPassThrough(IMediaSeeking* inDelegate);
+ virtual ~BasicSeekPassThrough(void);
+
+ //Delegate Control Methods.
+ bool SetDelegate(IMediaSeeking* inDelegate);
+ bool ReleaseDelegate();
+
+ //IMediaSeeking Interface
+ virtual STDMETHODIMP GetCapabilities(DWORD *pCapabilities);
+ virtual STDMETHODIMP CheckCapabilities(DWORD *pCapabilities);
+ virtual STDMETHODIMP IsFormatSupported(const GUID *pFormat);
+ virtual STDMETHODIMP QueryPreferredFormat(GUID *pFormat);
+ virtual STDMETHODIMP SetTimeFormat(const GUID *pFormat);
+ virtual STDMETHODIMP GetTimeFormat( GUID *pFormat);
+ virtual STDMETHODIMP GetDuration(LONGLONG *pDuration);
+ virtual STDMETHODIMP GetStopPosition(LONGLONG *pStop);
+ virtual STDMETHODIMP GetCurrentPosition(LONGLONG *pCurrent);
+ virtual STDMETHODIMP ConvertTimeFormat(LONGLONG *pTarget, const GUID *pTargetFormat, LONGLONG Source, const GUID *pSourceFormat);
+ virtual STDMETHODIMP SetPositions(LONGLONG *pCurrent,DWORD dwCurrentFlags,LONGLONG *pStop,DWORD dwStopFlags);
+ virtual STDMETHODIMP GetPositions(LONGLONG *pCurrent, LONGLONG *pStop);
+ virtual STDMETHODIMP GetAvailable(LONGLONG *pEarliest, LONGLONG *pLatest);
+ virtual STDMETHODIMP SetRate(double dRate);
+ virtual STDMETHODIMP GetRate(double *dRate);
+ virtual STDMETHODIMP GetPreroll(LONGLONG *pllPreroll);
+ virtual STDMETHODIMP IsUsingTimeFormat(const GUID *pFormat);
+
+protected:
+ //Member data
+ IMediaSeeking* mSeekDelegate;
+ HRESULT mHR;
+ DWORD mSeekingCap;
+
+ //Debug only.
+ //fstream seekDebug;
+};
Property changes on: trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/BasicSeekPassThrough.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/directshowabstractsdllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/directshowabstractsdllstuff.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/directshowabstractsdllstuff.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,35 +1,35 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include <streams.h>
-#include <pullpin.h>
-#include <initguid.h>
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include <streams.h>
+#include <pullpin.h>
+#include <initguid.h>
Property changes on: trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/directshowabstractsdllstuff.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// libDirectshowAbstracts.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// libDirectshowAbstracts.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,15 +1,15 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-
-// TODO: reference additional headers your program requires here
-
-#include "AbstractTransformInputPin.h"
-#include "AbstractTransformOutputPin.h"
-#include "AbstractTransformFilter.h"
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+
+// TODO: reference additional headers your program requires here
+
+#include "AbstractTransformInputPin.h"
+#include "AbstractTransformOutputPin.h"
+#include "AbstractTransformFilter.h"
Property changes on: trunk/oggdsf/src/lib/core/directshow/libDirectshowAbstracts/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,188 +1,188 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "stdafx.h"
-#include "CircularBuffer.h"
-
-//Leak checked : 20041017 - OK
-CircularBuffer::CircularBuffer(unsigned long inBufferSize)
- : mBufferSize(inBufferSize)
- , mBuffer(NULL)
- , mReadPtr(0)
- , mWritePtr(0)
-
-{
- mBuffer = new unsigned char[inBufferSize + 1]; //Deleted in destructor.
-}
-
-CircularBuffer::~CircularBuffer(void)
-{
- delete[] mBuffer;
-}
-
-unsigned long CircularBuffer::read(unsigned char* outData, unsigned long inBytesToRead) {
-
- //Returns early.
- if (inBytesToRead > spaceLeft()) {
- return 0;
- }
-
- unsigned long locBytesToRead = inBytesToRead;
-
- bufASSERT(locBytesToRead <= mBufferSize);
- // (inBytesToRead <= numBytesAvail()) ? inBytesToRead
- // : numBytesAvail();
- //locBytesToRead = the lower of numBytesAvail() and inBytesToRead
- bufASSERT(locBytesToRead <= inBytesToRead);
- bufASSERT(locBytesToRead <= numBytesAvail());
-
-
- //When mReadPtr = 0, there are mBufferSize + 1 bytes from the end, but we are only allowed to
- // write mBufferSize. Below where locEndDistabnce is used as a parameter to memcpy
- // but that branch is only taken where locEndDistance is less than the number of bytes to
- // read. Because we have already established above that the number of bytes to read is less
- // than the size of the buffer, this should not be a problem.
- unsigned long locEndDistance = (mBufferSize + 1 - mReadPtr);
-
- //bufASSERT(locEndDistance <= mBufferSize);
- if (locEndDistance >= locBytesToRead) {
- //Within the buffer
- bufASSERT(mReadPtr <= mBufferSize);
-
- memcpy((void*)outData, (const void*)(mBuffer + mReadPtr), locBytesToRead);
- } else {
- bufASSERT(locEndDistance <= mBufferSize);
-
- //Copy from the end of the raw buffer as much as we can into outdtata
- memcpy((void*)outData, (const void*)(mBuffer + mReadPtr), locEndDistance);
-
- //Copy from the start of the raw buffer whatever is left
- memcpy((void*)(outData + locEndDistance), (const void*)(mBuffer), locBytesToRead - locEndDistance);
- }
- mReadPtr = (mReadPtr + locBytesToRead) % (mBufferSize + 1);
-
- return locBytesToRead;
-}
-
-unsigned long CircularBuffer::write(const unsigned char* inData, unsigned long inBytesToWrite) {
- if (inBytesToWrite > spaceLeft()) {
- return 0;
- }
-
- unsigned long locBytesToWrite = inBytesToWrite;
-
- // (inBytesToWrite > spaceLeft()) ? spaceLeft()
- // : inBytesToWrite;
-
- bufASSERT(locBytesToWrite <= spaceLeft());
- bufASSERT(locBytesToWrite <= inBytesToWrite);
- bufASSERT(locBytesToWrite <= mBufferSize);
- bufASSERT(mWritePtr <= mBufferSize);
-
- unsigned long locEndDistance = (mBufferSize + 1 - mWritePtr);
-
- //bufASSERT(locEndDistance <= mBufferSize + 1);
- //Where we will be, in relation to the end of the raw buffer if we wrote the buffer out from here.
- //Negative values indicate bytes past the end ofthe buffer.
- //signed long locEndOffset = locEndDistance - locBytesToWrite;
-
-
- if (locEndDistance >= locBytesToWrite) {
- //Within the buffer
- memcpy((void*)(mBuffer + mWritePtr), ((const void*)inData), locBytesToWrite);
- } else {
- bufASSERT(locEndDistance <= mBufferSize);
-
- //Copy from the end of the raw buffer as much as we can into outdtata
- memcpy((void*)(mBuffer + mWritePtr), (const void*)inData, locEndDistance);
-
- //Copy from the start of the raw buffer whatever is left
- memcpy((void*)(mBuffer), (const void*)(inData + locEndDistance), locBytesToWrite - locEndDistance);
-
- //Advance the write pointer wrapping voer the end.
-
- }
- mWritePtr = (mWritePtr + locBytesToWrite) % (mBufferSize + 1);
-
- return locBytesToWrite;
-
-
-
-}
-
-unsigned long CircularBuffer::spaceLeft() {
- bufASSERT(mReadPtr <= mBufferSize);
- bufASSERT(mWritePtr <= mBufferSize);
-
- //The write pointer is always treated as being equal to or in front of the read pointer.
- //return mBufferSize - numBytesAvail() - 1;
- if (mReadPtr > mWritePtr) {
- //Read pointer is to the right of the Write pointer
- // Since the write pointer is always in front, this means all the data from the read ptr
- // to the end of the buffer, plus everything from the start up to the write pointer is
- // available
- //
- ////
-
- bufASSERT(mReadPtr > mWritePtr);
- return (mReadPtr - mWritePtr - 1);
- } else {
- bufASSERT(mReadPtr <= mWritePtr);
- return mBufferSize + mReadPtr - mWritePtr ;
- }
-}
-unsigned long CircularBuffer::numBytesAvail() {
- bufASSERT(mReadPtr <= mBufferSize);
- bufASSERT(mWritePtr <= mBufferSize);
-
- if (mReadPtr > mWritePtr) {
- //Read pointer is to the right of the Write pointer
- // Since the write pointer is always in front, this means all the data from the read ptr
- // to the end of the buffer, plus everything from the start up to the write pointer is
- // available
- //
- ////
-
- bufASSERT(mReadPtr > mWritePtr);
-
- //Here
- return (mBufferSize + 1 + mWritePtr - mReadPtr);
- } else {
- //if (mReadPtr <= mWritePtr)
- return mWritePtr - mReadPtr;
- }
-}
-
-void CircularBuffer::reset() {
- mWritePtr = 0;
- mReadPtr = 0;
-}
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "stdafx.h"
+#include "CircularBuffer.h"
+
+//Leak checked : 20041017 - OK
+CircularBuffer::CircularBuffer(unsigned long inBufferSize)
+ : mBufferSize(inBufferSize)
+ , mBuffer(NULL)
+ , mReadPtr(0)
+ , mWritePtr(0)
+
+{
+ mBuffer = new unsigned char[inBufferSize + 1]; //Deleted in destructor.
+}
+
+CircularBuffer::~CircularBuffer(void)
+{
+ delete[] mBuffer;
+}
+
+unsigned long CircularBuffer::read(unsigned char* outData, unsigned long inBytesToRead) {
+
+ //Returns early.
+ if (inBytesToRead > spaceLeft()) {
+ return 0;
+ }
+
+ unsigned long locBytesToRead = inBytesToRead;
+
+ bufASSERT(locBytesToRead <= mBufferSize);
+ // (inBytesToRead <= numBytesAvail()) ? inBytesToRead
+ // : numBytesAvail();
+ //locBytesToRead = the lower of numBytesAvail() and inBytesToRead
+ bufASSERT(locBytesToRead <= inBytesToRead);
+ bufASSERT(locBytesToRead <= numBytesAvail());
+
+
+ //When mReadPtr = 0, there are mBufferSize + 1 bytes from the end, but we are only allowed to
+ // write mBufferSize. Below where locEndDistabnce is used as a parameter to memcpy
+ // but that branch is only taken where locEndDistance is less than the number of bytes to
+ // read. Because we have already established above that the number of bytes to read is less
+ // than the size of the buffer, this should not be a problem.
+ unsigned long locEndDistance = (mBufferSize + 1 - mReadPtr);
+
+ //bufASSERT(locEndDistance <= mBufferSize);
+ if (locEndDistance >= locBytesToRead) {
+ //Within the buffer
+ bufASSERT(mReadPtr <= mBufferSize);
+
+ memcpy((void*)outData, (const void*)(mBuffer + mReadPtr), locBytesToRead);
+ } else {
+ bufASSERT(locEndDistance <= mBufferSize);
+
+ //Copy from the end of the raw buffer as much as we can into outdtata
+ memcpy((void*)outData, (const void*)(mBuffer + mReadPtr), locEndDistance);
+
+ //Copy from the start of the raw buffer whatever is left
+ memcpy((void*)(outData + locEndDistance), (const void*)(mBuffer), locBytesToRead - locEndDistance);
+ }
+ mReadPtr = (mReadPtr + locBytesToRead) % (mBufferSize + 1);
+
+ return locBytesToRead;
+}
+
+unsigned long CircularBuffer::write(const unsigned char* inData, unsigned long inBytesToWrite) {
+ if (inBytesToWrite > spaceLeft()) {
+ return 0;
+ }
+
+ unsigned long locBytesToWrite = inBytesToWrite;
+
+ // (inBytesToWrite > spaceLeft()) ? spaceLeft()
+ // : inBytesToWrite;
+
+ bufASSERT(locBytesToWrite <= spaceLeft());
+ bufASSERT(locBytesToWrite <= inBytesToWrite);
+ bufASSERT(locBytesToWrite <= mBufferSize);
+ bufASSERT(mWritePtr <= mBufferSize);
+
+ unsigned long locEndDistance = (mBufferSize + 1 - mWritePtr);
+
+ //bufASSERT(locEndDistance <= mBufferSize + 1);
+ //Where we will be, in relation to the end of the raw buffer if we wrote the buffer out from here.
+ //Negative values indicate bytes past the end ofthe buffer.
+ //signed long locEndOffset = locEndDistance - locBytesToWrite;
+
+
+ if (locEndDistance >= locBytesToWrite) {
+ //Within the buffer
+ memcpy((void*)(mBuffer + mWritePtr), ((const void*)inData), locBytesToWrite);
+ } else {
+ bufASSERT(locEndDistance <= mBufferSize);
+
+ //Copy from the end of the raw buffer as much as we can into outdtata
+ memcpy((void*)(mBuffer + mWritePtr), (const void*)inData, locEndDistance);
+
+ //Copy from the start of the raw buffer whatever is left
+ memcpy((void*)(mBuffer), (const void*)(inData + locEndDistance), locBytesToWrite - locEndDistance);
+
+ //Advance the write pointer wrapping voer the end.
+
+ }
+ mWritePtr = (mWritePtr + locBytesToWrite) % (mBufferSize + 1);
+
+ return locBytesToWrite;
+
+
+
+}
+
+unsigned long CircularBuffer::spaceLeft() {
+ bufASSERT(mReadPtr <= mBufferSize);
+ bufASSERT(mWritePtr <= mBufferSize);
+
+ //The write pointer is always treated as being equal to or in front of the read pointer.
+ //return mBufferSize - numBytesAvail() - 1;
+ if (mReadPtr > mWritePtr) {
+ //Read pointer is to the right of the Write pointer
+ // Since the write pointer is always in front, this means all the data from the read ptr
+ // to the end of the buffer, plus everything from the start up to the write pointer is
+ // available
+ //
+ ////
+
+ bufASSERT(mReadPtr > mWritePtr);
+ return (mReadPtr - mWritePtr - 1);
+ } else {
+ bufASSERT(mReadPtr <= mWritePtr);
+ return mBufferSize + mReadPtr - mWritePtr ;
+ }
+}
+unsigned long CircularBuffer::numBytesAvail() {
+ bufASSERT(mReadPtr <= mBufferSize);
+ bufASSERT(mWritePtr <= mBufferSize);
+
+ if (mReadPtr > mWritePtr) {
+ //Read pointer is to the right of the Write pointer
+ // Since the write pointer is always in front, this means all the data from the read ptr
+ // to the end of the buffer, plus everything from the start up to the write pointer is
+ // available
+ //
+ ////
+
+ bufASSERT(mReadPtr > mWritePtr);
+
+ //Here
+ return (mBufferSize + 1 + mWritePtr - mReadPtr);
+ } else {
+ //if (mReadPtr <= mWritePtr)
+ return mWritePtr - mReadPtr;
+ }
+}
+
+void CircularBuffer::reset() {
+ mWritePtr = 0;
+ mReadPtr = 0;
+}
+
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,153 +1,153 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include "dllstuff.h"
-#include "IFIFOBuffer.h"
-
-
-//Empty Buffer
-//==============
-//
-// <--------------- Buffer Size -------------------->
-//
-// 0123456789 123456789 123456789 123456789 123456789*
-// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-// R
-// W
-//
-//
-// 0123456789 123456789 123456789 123456789 123456789*
-// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-// R
-// W
-//
-//When R = W Buffer is empty
-//
-// when R = W: available bytes = 0
-// when R = W: space left = buffer size
-////
-
-//Full Buffer
-//===========
-//
-//
-//
-// <--------------- Buffer Size -------------------->
-//
-// 0123456789 123456789 123456789 123456789 123456789*
-// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-// R
-// W
-//
-//
-// <--------------- Buffer Size -------------------->
-//
-// 0123456789 123456789 123456789 123456789 123456789*
-// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-// R
-// W
-//
-//Buffer is full when R = (W + 1) MOD (bufferSize + 1)
-//
-// when R = (W + 1) MOD (bufferSize + 1): available bytes = buffer size
-// when R = (W + 1) MOD (bufferSize + 1): space left = 0
-//
-//
-//
-//
-//////
-
-//Partial Buffers
-//===============
-//
-//Case 1
-//======
-//
-//
-// <--------------- Buffer Size -------------------->
-//
-// 0123456789 123456789 123456789 123456789 123456789*
-// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-// R
-// W
-//
-//
-// when W > R: available bytes = W - R
-// when W > R: space left = buffer size - available bytes = buffer size + R - W
-//
-//
-//Case 2
-//======
-//
-//
-// <--------------- Buffer Size -------------------->
-// 1 2 3 4
-// 0123456789 123456789 123456789 123456789 123456789*
-// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-// R
-// W
-//
-// when R > W: available bytes = buffer size + 1 - R + W
-// when R > W: space left = buffer size - available bytes = R - W - 1
-//
-//
-//
-//
-//
-
-class LIBOOOGG_API CircularBuffer
- : public IFIFOBuffer
-{
-public:
- CircularBuffer(unsigned long inBufferSize);
- virtual ~CircularBuffer(void);
-
- //IFIFOBuffer Implementation
- virtual unsigned long read(unsigned char* outData, unsigned long inBytesToRead);
- virtual unsigned long write(const unsigned char* inData, unsigned long inBytesToWrite);
-
- virtual unsigned long numBytesAvail();
- virtual unsigned long spaceLeft();
-
- virtual void reset();
- //
-protected:
- unsigned long mBufferSize;
- unsigned long mReadPtr;
- unsigned long mWritePtr;
-
- void bufASSERT(bool inBool) { if (!inBool) throw 0; };
- unsigned char* mBuffer;
-
-private:
- CircularBuffer& operator=(const CircularBuffer& other); /* Don't assign me */
- CircularBuffer(const CircularBuffer& other); /* Don't copy me */
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+#include "dllstuff.h"
+#include "IFIFOBuffer.h"
+
+
+//Empty Buffer
+//==============
+//
+// <--------------- Buffer Size -------------------->
+//
+// 0123456789 123456789 123456789 123456789 123456789*
+// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+// R
+// W
+//
+//
+// 0123456789 123456789 123456789 123456789 123456789*
+// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+// R
+// W
+//
+//When R = W Buffer is empty
+//
+// when R = W: available bytes = 0
+// when R = W: space left = buffer size
+////
+
+//Full Buffer
+//===========
+//
+//
+//
+// <--------------- Buffer Size -------------------->
+//
+// 0123456789 123456789 123456789 123456789 123456789*
+// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+// R
+// W
+//
+//
+// <--------------- Buffer Size -------------------->
+//
+// 0123456789 123456789 123456789 123456789 123456789*
+// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+// R
+// W
+//
+//Buffer is full when R = (W + 1) MOD (bufferSize + 1)
+//
+// when R = (W + 1) MOD (bufferSize + 1): available bytes = buffer size
+// when R = (W + 1) MOD (bufferSize + 1): space left = 0
+//
+//
+//
+//
+//////
+
+//Partial Buffers
+//===============
+//
+//Case 1
+//======
+//
+//
+// <--------------- Buffer Size -------------------->
+//
+// 0123456789 123456789 123456789 123456789 123456789*
+// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+// R
+// W
+//
+//
+// when W > R: available bytes = W - R
+// when W > R: space left = buffer size - available bytes = buffer size + R - W
+//
+//
+//Case 2
+//======
+//
+//
+// <--------------- Buffer Size -------------------->
+// 1 2 3 4
+// 0123456789 123456789 123456789 123456789 123456789*
+// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
+// R
+// W
+//
+// when R > W: available bytes = buffer size + 1 - R + W
+// when R > W: space left = buffer size - available bytes = R - W - 1
+//
+//
+//
+//
+//
+
+class LIBOOOGG_API CircularBuffer
+ : public IFIFOBuffer
+{
+public:
+ CircularBuffer(unsigned long inBufferSize);
+ virtual ~CircularBuffer(void);
+
+ //IFIFOBuffer Implementation
+ virtual unsigned long read(unsigned char* outData, unsigned long inBytesToRead);
+ virtual unsigned long write(const unsigned char* inData, unsigned long inBytesToWrite);
+
+ virtual unsigned long numBytesAvail();
+ virtual unsigned long spaceLeft();
+
+ virtual void reset();
+ //
+protected:
+ unsigned long mBufferSize;
+ unsigned long mReadPtr;
+ unsigned long mWritePtr;
+
+ void bufASSERT(bool inBool) { if (!inBool) throw 0; };
+ unsigned char* mBuffer;
+
+private:
+ CircularBuffer& operator=(const CircularBuffer& other); /* Don't assign me */
+ CircularBuffer(const CircularBuffer& other); /* Don't copy me */
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/CircularBuffer.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/IDataSource.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/IFIFOBuffer.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/IFIFOBuffer.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/IFIFOBuffer.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,46 +1,46 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include "dllstuff.h"
-class LIBOOOGG_API IFIFOBuffer {
-public:
- //Empty Constructor and destructor to ensure proper deletion
- IFIFOBuffer(void) {}
- virtual ~IFIFOBuffer(void) {}
-
- virtual unsigned long read(unsigned char* outData, unsigned long inBytesToRead) = 0;
- virtual unsigned long write(const unsigned char* inData, unsigned long inBytesToWrite) = 0;
-
- virtual unsigned long numBytesAvail() = 0;
- virtual unsigned long spaceLeft() = 0;
-
- virtual void reset() = 0;
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+#include "dllstuff.h"
+class LIBOOOGG_API IFIFOBuffer {
+public:
+ //Empty Constructor and destructor to ensure proper deletion
+ IFIFOBuffer(void) {}
+ virtual ~IFIFOBuffer(void) {}
+
+ virtual unsigned long read(unsigned char* outData, unsigned long inBytesToRead) = 0;
+ virtual unsigned long write(const unsigned char* inData, unsigned long inBytesToWrite) = 0;
+
+ virtual unsigned long numBytesAvail() = 0;
+ virtual unsigned long spaceLeft() = 0;
+
+ virtual void reset() = 0;
};
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/IFIFOBuffer.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/INotifyArrival.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/INotifyArrival.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/INotifyArrival.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,40 +1,40 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-
-class LIBOOOGG_API INotifyArrival
-{
-public:
- //Empty Constructor and destructor to ensure proper deletion
- INotifyArrival(void) {}
- virtual ~INotifyArrival(void) {}
- virtual void notifyArrival() = 0;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+
+class LIBOOOGG_API INotifyArrival
+{
+public:
+ //Empty Constructor and destructor to ensure proper deletion
+ INotifyArrival(void) {}
+ virtual ~INotifyArrival(void) {}
+ virtual void notifyArrival() = 0;
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/INotifyArrival.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/INotifyComplete.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/INotifyComplete.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/INotifyComplete.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,42 +1,42 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-
-class LIBOOOGG_API INotifyComplete
-{
-public:
- //Empty Constructor and destructor to ensure proper deletion
- INotifyComplete(void) {}
- virtual ~INotifyComplete(void) {}
-
-
- virtual void NotifyComplete() = 0;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+
+class LIBOOOGG_API INotifyComplete
+{
+public:
+ //Empty Constructor and destructor to ensure proper deletion
+ INotifyComplete(void) {}
+ virtual ~INotifyComplete(void) {}
+
+
+ virtual void NotifyComplete() = 0;
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/INotifyComplete.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/IOggCallback.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/IOggCallback.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/IOggCallback.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,50 +1,50 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "OggPage.h"
-//TODO::: Consider changing the return type to allow better feedback.
-class LIBOOOGG_API IOggCallback
-{
-public:
- //Empty Constructor and destructor to ensure proper deletion
- IOggCallback(void) {}
- virtual ~IOggCallback(void) {}
-
-
- //All callers to acceptOggPage give away their pointer
- // to this function. All methods implementing this interface
- // are responsible for deleting this page. All callers
- // should NULL their pointer immediately after calling
- // to avoid reusing them.
- //
- virtual bool acceptOggPage(OggPage* inOggPage) = 0;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "OggPage.h"
+//TODO::: Consider changing the return type to allow better feedback.
+class LIBOOOGG_API IOggCallback
+{
+public:
+ //Empty Constructor and destructor to ensure proper deletion
+ IOggCallback(void) {}
+ virtual ~IOggCallback(void) {}
+
+
+ //All callers to acceptOggPage give away their pointer
+ // to this function. All methods implementing this interface
+ // are responsible for deleting this page. All callers
+ // should NULL their pointer immediately after calling
+ // to avoid reusing them.
+ //
+ virtual bool acceptOggPage(OggPage* inOggPage) = 0;
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/IOggCallback.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/IOggPackSource.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/IOggPackSource.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/IOggPackSource.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,44 +1,44 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "OggPacket.h"
-
-class LIBOOOGG_API IOggPackSource
-{
-public:
- //Empty Constructor and destructor to ensure proper deletion
- IOggPackSource(void) {}
- virtual ~IOggPackSource(void) {}
-
- virtual OggPacket* getPacket(unsigned long inPacketNo) = 0;
- virtual unsigned long numPackets() = 0;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "OggPacket.h"
+
+class LIBOOOGG_API IOggPackSource
+{
+public:
+ //Empty Constructor and destructor to ensure proper deletion
+ IOggPackSource(void) {}
+ virtual ~IOggPackSource(void) {}
+
+ virtual OggPacket* getPacket(unsigned long inPacketNo) = 0;
+ virtual unsigned long numPackets() = 0;
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/IOggPackSource.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/IStampedOggPacketSink.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/IStampedOggPacketSink.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/IStampedOggPacketSink.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,50 +1,50 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-#include "StampedOggPacket.h"
-
-class LIBOOOGG_API IStampedOggPacketSink
-{
-public:
- //Empty Constructor and destructor to ensure proper deletion
- IStampedOggPacketSink(void) {}
- virtual ~IStampedOggPacketSink(void) {}
-
- //All callers to acceptStampedOggPacket give away their pointer
- // to this function. All methods implementing this interface
- // are responsible for deleting this packet. All callers
- // should NULL their pointer immediately after calling
- // to avoid reusing them.
- //
- virtual bool acceptStampedOggPacket(StampedOggPacket* inPacket) = 0;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+#include "StampedOggPacket.h"
+
+class LIBOOOGG_API IStampedOggPacketSink
+{
+public:
+ //Empty Constructor and destructor to ensure proper deletion
+ IStampedOggPacketSink(void) {}
+ virtual ~IStampedOggPacketSink(void) {}
+
+ //All callers to acceptStampedOggPacket give away their pointer
+ // to this function. All methods implementing this interface
+ // are responsible for deleting this packet. All callers
+ // should NULL their pointer immediately after calling
+ // to avoid reusing them.
+ //
+ virtual bool acceptStampedOggPacket(StampedOggPacket* inPacket) = 0;
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/IStampedOggPacketSink.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,470 +1,470 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "stdafx.h"
-#include "OggDataBuffer.h"
-
-
-//LEAK CHECKED - 2004/10/17 - OK.
-//LEAK FOUND - 2004/11/29 - acceptOggPage
-OggDataBuffer::OggDataBuffer(void)
- : mBuffer(NULL)
- , mPrevGranPos(0)
- , pendingPage(NULL)
- , mState(AWAITING_BASE_HEADER)
- , mNumBytesNeeded(OggPageHeader::OGG_BASE_HEADER_SIZE)
-{
- mBuffer = new CircularBuffer(MAX_OGG_PAGE_SIZE); //Deleted in destructor
- //debugLog.open("G:\\logs\\OggDataBuffer.log", ios_base::out);
-}
-
-//Debug only
-//OggDataBuffer::OggDataBuffer(bool x)
-// : mBuffer(NULL)
-// , mPrevGranPos(0)
-//{
-// mBuffer = new CircularBuffer(MAX_OGG_PAGE_SIZE); //Deleted in destructor
-//
-// //debugLog.open("G:\\logs\\OggDataBufferSeek.log", ios_base::out);
-// pendingPage = NULL;
-// mState = AWAITING_BASE_HEADER;
-// mNumBytesNeeded = OggPageHeader::OGG_BASE_HEADER_SIZE;
-//}
-//
-
-OggDataBuffer::~OggDataBuffer(void)
-{
- delete mBuffer;
- delete pendingPage;
- //debugLog.close();
-
-}
-
-bool OggDataBuffer::registerStaticCallback(fPageCallback inPageCallback) {
- //Holds the static callback and nulls the virtual one.
- mStaticCallback = inPageCallback;
- mVirtualCallback = NULL;
-
- return true;
-}
-//bool OggDataBuffer::registerSerialNo(SerialNoRego* inSerialRego) {
-// if (inSerialRego != NULL) {
-// mSerialNoCallList.push_back(inSerialRego);
-// return true;
-// } else {
-// return false;
-// }
-//}
-
-bool OggDataBuffer::registerVirtualCallback(IOggCallback* inPageCallback) {
- //Holds the virtual callback and nulls the static one.
- mVirtualCallback = inPageCallback;
- mStaticCallback = NULL;
-
- return true;
-
-}
-
-
-unsigned long OggDataBuffer::numBytesAvail() {
- //Returns how many bytes are available in the buffer
- unsigned long locBytesAvail = mBuffer->numBytesAvail();
-
- //debugLog<<"Bytes avail = "<<locBytesAvail<<endl;
- return locBytesAvail;
-}
-
-OggDataBuffer::eState OggDataBuffer::state() {
- //returns the state of the stream
- return mState;
-}
-//This function accepts the responsibility for the incoming page.
-OggDataBuffer::eDispatchResult OggDataBuffer::dispatch(OggPage* inOggPage) {
- //TODO::: Who owns this pointer inOggPage ?
-
- //debugLog<<"Dispatching page..."<<endl<<endl;
-
- //Fire off the oggpage to whoever is registered to get it
- if (mVirtualCallback != NULL) {
- if (mVirtualCallback->acceptOggPage(inOggPage) == true) { //Page given away, never used again.
- return DISPATCH_OK;
- } else {
- return DISPATCH_FALSE;
- }
- } else if (mStaticCallback != NULL) {
- if (mStaticCallback(inOggPage) == true) {
- return DISPATCH_OK;
- } else {
- return DISPATCH_FALSE;
- }
- }
-
- //Delete the page... if the called functions wanted a copy they should have taken one for themsselves.
- //Not any more acceptOggPage takes responsibility for the memory you pass into it. See IOggCallback.h
- //delete inOggPage;
- pendingPage = NULL;
- return DISPATCH_NO_CALLBACK;
-}
-
-OggDataBuffer::eFeedResult OggDataBuffer::feed(const unsigned char* inData, unsigned long inNumBytes) {
- if (inNumBytes != 0) {
- if (inData != NULL) {
- //Buffer is not null and there is at least 1 byte of data.
-
- //debugLog<<"Fed "<<inNumBytes<<" bytes..."<<endl;
- unsigned long locNumWritten = mBuffer->write(inData, inNumBytes);
-
- if (locNumWritten < inNumBytes) {
- //TODO::: What does happen in this case.
-
- //Handle this case... you lose data.
- //Buffer is full
-
- //debugLog<<"Feed : Could count feed in " <<inNumBytes<<" bytes"<<endl
- // <<"Feed : ** "<<mBuffer->numBytesAvail()<<" avail, "<<mBuffer->spaceLeft()<<" space left."<<endl;
-
- locNumWritten = locNumWritten;
- }
- return (eFeedResult)processBuffer();
- } else {
- //Numbytes not equal to zero but inData pointer is NULL
-
- //debugLog<<"Feed : Fed NULL Pointer"<<endl;
- return FEED_NULL_POINTER;
- }
- } else {
- //numbytes was zero... we do nothing and it's not an error.
-
- //debugLog<<"Feed : Fed *zero* bytes... Not an error, do nothing, return ok."<<endl;
- return FEED_OK;
- }
-
-
-}
-OggDataBuffer::eProcessResult OggDataBuffer::processBaseHeader()
-{
- //debugLog<<"Processing base header..."<<endl;
-
- //Delete the previous page
- delete pendingPage;
-
- //Make a fresh ogg page
- pendingPage = new OggPage; //Either deleted in destructor, or given away by virtue of dispatch method.
-
- //Make a local buffer for the header
- unsigned char* locBuff = new unsigned char[OggPageHeader::OGG_BASE_HEADER_SIZE]; //deleted before this function returns
-
- //debugLog<<"ProcessBaseHeader : Reading from stream..."<<endl;
-
- //STREAM ACCESS::: Read
- unsigned long locNumRead = mBuffer->read(locBuff, OggPageHeader::OGG_BASE_HEADER_SIZE);
-
- if (locNumRead < OggPageHeader::OGG_BASE_HEADER_SIZE) {
- //TODO::: Handle this case... we read less than we expected.
-
- //debugLog<<"ProcessBaseHeader : ###### Read was short."<<endl;
- //debugLog<<"ProcessBaseHeader : ** "<<mBuffer->numBytesAvail()<<" avail, "<<mBuffer->spaceLeft()<<" space left."<<endl;
- locNumRead = locNumRead;
- }
-
- bool locRetVal = pendingPage->header()->setBaseHeader((unsigned char*)locBuff); //Views pointer only.
- if (locRetVal == false) {
- delete[] locBuff;
- return PROCESS_FAILED_TO_SET_HEADER;
- }
-
- //Set the number of bytes we want for next time
- mNumBytesNeeded = pendingPage->header()->NumPageSegments();
-
- //debugLog<<"Setting state to AWAITING_SEG_TABLE"<<endl;
- //Change the state.
- mState = AWAITING_SEG_TABLE;
-
- delete[] locBuff;
- //debugLog<<"Bytes needed for seg table = "<<mNumBytesNeeded<<endl;
- return PROCESS_OK;
-}
-OggDataBuffer::eProcessResult OggDataBuffer::processSegTable()
-{
- ///
- // Gets the number segments from from the page header, reads in that much data,
- //
- //
- //
- //Assumes a valid pending page, with numPagesegments set in the header already.
- //creates a chunk of memory size numpagesegments and stores it,.
-
- //debugLog<<"Processing Segment Table..."<<endl;
-
- //TODAY::: What happens when numpage segments is zero.
-
- //Save a local copy of the number of page segments - Get this from the already set header.
- unsigned char locNumSegs = pendingPage->header()->NumPageSegments();
-
- //debugLog<<"Num segments = "<<(int)locNumSegs<<endl;
-
- //Make a local buffer the size of the segment table. 0 - 255
- unsigned char* locBuff = new unsigned char[locNumSegs]; //Given to setSegmentTable. Not deleted here.
-
- ////debugLog<<"ProcessSegTable : Reading from buffer..."<<endl;
-
- //Read the segment table from the buffer to locBuff
- unsigned long locNumRead = mBuffer->read(locBuff, (unsigned long)locNumSegs);
-
- if (locNumRead < locNumSegs) {
- //TODO::: Handle this case
-
- //debugLog<<"ProcessSegTable : ##### Short read"<<endl;
- //debugLog<<"ProcessSegTable : ** "<<mBuffer->numBytesAvail()<<" avail, "<<mBuffer->spaceLeft()<<" space left."<<endl;
-
- }
-
-
- //Make a new segment table from the bufferd data.
- pendingPage->header()->setSegmentTable(locBuff); //This function accepts responsibility for the pointer.
- locBuff = NULL;
-
- //Set the number of bytes we want for next time - which is the size of the page data.
- mNumBytesNeeded = pendingPage->header()->calculateDataSize();
-
- //debugLog<<"Num bytes needed for data = "<< mNumBytesNeeded<<endl;
- //debugLog<<"Transition to AWAITING_DATA"<<endl;
-
- mState = AWAITING_DATA;
- return PROCESS_OK;
-
-}
-
-OggDataBuffer::eProcessResult OggDataBuffer::processDataSegment()
-{
- unsigned long locPageDataSize = pendingPage->header()->dataSize();
-
- //debugLog<<"ProcessDataSegment : Page data size = "<<locPageDataSize<<endl;
- unsigned char* locBuff = NULL;
- //unsigned long locPacketOffset = 0;
-
- //TODO::: Should this be const ?
- //THis is a raw pointer into the segment table, don't delete it.
- unsigned char* locSegTable = pendingPage->header()->SegmentTable(); //View only don't delete.
- unsigned int locNumSegs = pendingPage->header()->NumPageSegments();
-
- //debugLog<<"ProcessDataSegment : Num segs = "<<locNumSegs<<endl;
-
-
- unsigned long locCurrPackSize = 0;
- bool locIsFirstPacket = true;
- LOOG_INT64 locPrevGranPos = 0;
-
- for (unsigned long i = 0; i < locNumSegs; i++) {
- //Packet sums the lacing values of the segment table.
- locCurrPackSize += locSegTable[i];
-
- //If its the last segment in the page or if the lacing value is not 255(ie packet boundary.
-
- /* TRUTH TABLE:
- last lacing value lacing value is *not* 255
- ================= =========================
- true true } If its the last one or a packet boundary(255 lacing value) we add it.
- true false }
- false true }
- false false If it is a 255 (packet continues) and it's not the last one do nothibng
- it is the last lacing value on the page
-
-
- Lacing values for a Packet never end with 255... if multiple of 255 have a next 0 lacing value.
- */
-
- if ( (locSegTable[i] != 255) || (locNumSegs - 1 == i) ) {
- //If its the last lacing value or the the lacing value is not 255 (ie packet boundry)
-
- //This pointer is given to the packet... it deletes it.
- locBuff = new unsigned char[locCurrPackSize]; //Given away to constructor of StampedOggPacket.
-
- //STREAM ACCESS:::
- //Read data from the stream into the local buffer.
-
- unsigned long locNumRead = mBuffer->read(locBuff, locCurrPackSize);
-
- if (locNumRead < locCurrPackSize) {
- //TODO::: Handle this case.
-
- //debugLog<<"ProcessDataSegment : ###### Short read"<<endl;
- //debugLog<<"ProcessDataSegment : ** "<<mBuffer->numBytesAvail()<<" avail, "<<mBuffer->spaceLeft()<<" space left."<<endl;
- locNumRead = locNumRead;
- }
-
- //debugLog<<"Adding packet - size = "<<locCurrPackSize<<endl;
-
- //A packet ends when a lacing value is not 255. So the check for != 255 means the isComplete property of the packet is not set unless the
- // lacing value is not equal to 255.
- //ERROR CHECK:::
- bool locIsContinuation = false;
-
- if (locIsFirstPacket) {
- locIsFirstPacket = false;
-
- //Remember what the granule pos was and get it from the new page.
- locPrevGranPos = mPrevGranPos;
- mPrevGranPos = pendingPage->header()->GranulePos();
-
- //First packet, check if the continuation flag is set.
- if ((pendingPage->header()->HeaderFlags() & OggPageHeader::CONTINUATION) == OggPageHeader::CONTINUATION) {
- //Continuation flag is set.
- locIsContinuation = true;
- }
- }
- //locBuff is given to the constructor of Stamped Ogg Packet... it deletes it.
- //The new StampedPacket is given to the page... it deletes it
- pendingPage->addPacket( new StampedOggPacket(locBuff, locCurrPackSize, (locSegTable[i] == 255), locIsContinuation, locPrevGranPos, pendingPage->header()->GranulePos(), StampedOggPacket::OGG_BOTH ) );
- locBuff = NULL; //We've given this away.
- //Reset the packet size counter.
- locCurrPackSize = 0;
- }
- }
-
-
- //Update the state for how many bytes are now needed
- mNumBytesNeeded = OggPageHeader::OGG_BASE_HEADER_SIZE;
-
- //debugLog<<"ProcessDataSegment : num bytes needed = "<<mNumBytesNeeded<<endl;
-
- //Dispatch the finished pagbve
- eDispatchResult locRet = dispatch(pendingPage); //The dispatch function takes responsibility for this page.
- pendingPage = NULL; //We give away the pointer
-
- if (locRet == DISPATCH_OK) {
- //debugLog<<"ProcessDataSegment : Transition to AWAITING_BASE_HEADER"<<endl;
- mState = AWAITING_BASE_HEADER;
- return PROCESS_OK;
- } else if (locRet == DISPATCH_FALSE) {
- mState = AWAITING_BASE_HEADER;
- return PROCESS_DISPATCH_FALSE;
- } else {
- //debugLog<<"ProcessDataSegment : Dispatch failed."<<endl;
- return PROCESS_DISPATCH_FAILED;
- }
-
-}
-void OggDataBuffer::clearData() {
- mBuffer->reset();
- mPrevGranPos = 0;
- //debugLog<<"ClearData : Transition back to AWAITING_BASE_HEADER"<<endl;
-
-
- mNumBytesNeeded = OggPageHeader::OGG_BASE_HEADER_SIZE;
- mState = AWAITING_BASE_HEADER;
-
- ////debugLog<<"ClearData : Num bytes needed = "<<mNumBytesNeeded<<endl;
-}
-
-OggDataBuffer::eProcessResult OggDataBuffer::processBuffer() {
-
- eProcessResult locResult = PROCESS_OK;
-
- while (numBytesAvail() >= mNumBytesNeeded) {
- ////debugLog<<"ProcessBuffer : Bytes Needed = "<<mNumBytesNeeded<<" --- "<<"Bytes avail = "<<numBytesAvail()<<endl;
- switch (mState) {
-
- //QUERY::: Should it be a bug when the if state inside the switch falls through,... potential for infinite loop.
- case AWAITING_BASE_HEADER:
- //debugLog<<"ProcessBuffer : State = AWAITING_BASE_HEADER"<<endl;
-
- //If theres enough data to form the base header
- if (numBytesAvail() >= OggPageHeader::OGG_BASE_HEADER_SIZE) {
- //debugLog<<"ProcessBuffer : Enough to process..."<<endl;
-
- locResult = processBaseHeader();
-
- if (locResult != PROCESS_OK) {
- mState = LOST_PAGE_SYNC;
- //Base header process failed
- return locResult;
- }
- }
- break;
-
- case AWAITING_SEG_TABLE:
- //debugLog<<"ProcessBuffer : State = AWAITING_SEG_TABLE"<<endl;
-
- //If there is enough data to get the segt table
- if (numBytesAvail() >= pendingPage->header()->NumPageSegments()) {
- //debugLog<<"ProcessBuffer : Enough to process..."<<endl;
-
- locResult = processSegTable();
-
- if (locResult != PROCESS_OK) {
- mState = LOST_PAGE_SYNC;
- //segment table process failed
- return locResult;
- }
- }
- break;
-
- case AWAITING_DATA:
- //debugLog<<"ProcessBuffer : State = AWAITING_DATA"<<endl;
- //If all the data segment is available
- if (numBytesAvail() >= pendingPage->header()->dataSize()) {
- //debugLog<<"ProcessBuffer : Enough to process..."<<endl;
-
- //FIX::: Need error check.
- locResult = processDataSegment();
-
- if (locResult == PROCESS_DISPATCH_FAILED) {
- mState = LOST_PAGE_SYNC;
- //segment table process failed
- return locResult;
- }
-
- }
- break;
- case LOST_PAGE_SYNC:
- //TODO::: Insert resync code here.
-
- //debugLog<<"ProcessBuffer : State = LOST_PAGE_SYNC"<<endl;
- return PROCESS_LOST_SYNC;
- default:
- //TODO::: What are we supposed to do with this. Anything need cleaning up ?
-
- //debugLog<<"ProcessBuffer : Ogg Buffer Error"<<endl;
- return PROCESS_UNKNOWN_INTERNAL_ERROR;
- break;
- }
- }
-
- //There wasn't enough data to progress if we are here.
- return locResult;
-
-}
-
-//Debug Only
-void OggDataBuffer::debugWrite(string inString) {
- //debugLog<<inString<<endl;
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "stdafx.h"
+#include "OggDataBuffer.h"
+
+
+//LEAK CHECKED - 2004/10/17 - OK.
+//LEAK FOUND - 2004/11/29 - acceptOggPage
+OggDataBuffer::OggDataBuffer(void)
+ : mBuffer(NULL)
+ , mPrevGranPos(0)
+ , pendingPage(NULL)
+ , mState(AWAITING_BASE_HEADER)
+ , mNumBytesNeeded(OggPageHeader::OGG_BASE_HEADER_SIZE)
+{
+ mBuffer = new CircularBuffer(MAX_OGG_PAGE_SIZE); //Deleted in destructor
+ //debugLog.open("G:\\logs\\OggDataBuffer.log", ios_base::out);
+}
+
+//Debug only
+//OggDataBuffer::OggDataBuffer(bool x)
+// : mBuffer(NULL)
+// , mPrevGranPos(0)
+//{
+// mBuffer = new CircularBuffer(MAX_OGG_PAGE_SIZE); //Deleted in destructor
+//
+// //debugLog.open("G:\\logs\\OggDataBufferSeek.log", ios_base::out);
+// pendingPage = NULL;
+// mState = AWAITING_BASE_HEADER;
+// mNumBytesNeeded = OggPageHeader::OGG_BASE_HEADER_SIZE;
+//}
+//
+
+OggDataBuffer::~OggDataBuffer(void)
+{
+ delete mBuffer;
+ delete pendingPage;
+ //debugLog.close();
+
+}
+
+bool OggDataBuffer::registerStaticCallback(fPageCallback inPageCallback) {
+ //Holds the static callback and nulls the virtual one.
+ mStaticCallback = inPageCallback;
+ mVirtualCallback = NULL;
+
+ return true;
+}
+//bool OggDataBuffer::registerSerialNo(SerialNoRego* inSerialRego) {
+// if (inSerialRego != NULL) {
+// mSerialNoCallList.push_back(inSerialRego);
+// return true;
+// } else {
+// return false;
+// }
+//}
+
+bool OggDataBuffer::registerVirtualCallback(IOggCallback* inPageCallback) {
+ //Holds the virtual callback and nulls the static one.
+ mVirtualCallback = inPageCallback;
+ mStaticCallback = NULL;
+
+ return true;
+
+}
+
+
+unsigned long OggDataBuffer::numBytesAvail() {
+ //Returns how many bytes are available in the buffer
+ unsigned long locBytesAvail = mBuffer->numBytesAvail();
+
+ //debugLog<<"Bytes avail = "<<locBytesAvail<<endl;
+ return locBytesAvail;
+}
+
+OggDataBuffer::eState OggDataBuffer::state() {
+ //returns the state of the stream
+ return mState;
+}
+//This function accepts the responsibility for the incoming page.
+OggDataBuffer::eDispatchResult OggDataBuffer::dispatch(OggPage* inOggPage) {
+ //TODO::: Who owns this pointer inOggPage ?
+
+ //debugLog<<"Dispatching page..."<<endl<<endl;
+
+ //Fire off the oggpage to whoever is registered to get it
+ if (mVirtualCallback != NULL) {
+ if (mVirtualCallback->acceptOggPage(inOggPage) == true) { //Page given away, never used again.
+ return DISPATCH_OK;
+ } else {
+ return DISPATCH_FALSE;
+ }
+ } else if (mStaticCallback != NULL) {
+ if (mStaticCallback(inOggPage) == true) {
+ return DISPATCH_OK;
+ } else {
+ return DISPATCH_FALSE;
+ }
+ }
+
+ //Delete the page... if the called functions wanted a copy they should have taken one for themsselves.
+ //Not any more acceptOggPage takes responsibility for the memory you pass into it. See IOggCallback.h
+ //delete inOggPage;
+ pendingPage = NULL;
+ return DISPATCH_NO_CALLBACK;
+}
+
+OggDataBuffer::eFeedResult OggDataBuffer::feed(const unsigned char* inData, unsigned long inNumBytes) {
+ if (inNumBytes != 0) {
+ if (inData != NULL) {
+ //Buffer is not null and there is at least 1 byte of data.
+
+ //debugLog<<"Fed "<<inNumBytes<<" bytes..."<<endl;
+ unsigned long locNumWritten = mBuffer->write(inData, inNumBytes);
+
+ if (locNumWritten < inNumBytes) {
+ //TODO::: What does happen in this case.
+
+ //Handle this case... you lose data.
+ //Buffer is full
+
+ //debugLog<<"Feed : Could count feed in " <<inNumBytes<<" bytes"<<endl
+ // <<"Feed : ** "<<mBuffer->numBytesAvail()<<" avail, "<<mBuffer->spaceLeft()<<" space left."<<endl;
+
+ locNumWritten = locNumWritten;
+ }
+ return (eFeedResult)processBuffer();
+ } else {
+ //Numbytes not equal to zero but inData pointer is NULL
+
+ //debugLog<<"Feed : Fed NULL Pointer"<<endl;
+ return FEED_NULL_POINTER;
+ }
+ } else {
+ //numbytes was zero... we do nothing and it's not an error.
+
+ //debugLog<<"Feed : Fed *zero* bytes... Not an error, do nothing, return ok."<<endl;
+ return FEED_OK;
+ }
+
+
+}
+OggDataBuffer::eProcessResult OggDataBuffer::processBaseHeader()
+{
+ //debugLog<<"Processing base header..."<<endl;
+
+ //Delete the previous page
+ delete pendingPage;
+
+ //Make a fresh ogg page
+ pendingPage = new OggPage; //Either deleted in destructor, or given away by virtue of dispatch method.
+
+ //Make a local buffer for the header
+ unsigned char* locBuff = new unsigned char[OggPageHeader::OGG_BASE_HEADER_SIZE]; //deleted before this function returns
+
+ //debugLog<<"ProcessBaseHeader : Reading from stream..."<<endl;
+
+ //STREAM ACCESS::: Read
+ unsigned long locNumRead = mBuffer->read(locBuff, OggPageHeader::OGG_BASE_HEADER_SIZE);
+
+ if (locNumRead < OggPageHeader::OGG_BASE_HEADER_SIZE) {
+ //TODO::: Handle this case... we read less than we expected.
+
+ //debugLog<<"ProcessBaseHeader : ###### Read was short."<<endl;
+ //debugLog<<"ProcessBaseHeader : ** "<<mBuffer->numBytesAvail()<<" avail, "<<mBuffer->spaceLeft()<<" space left."<<endl;
+ locNumRead = locNumRead;
+ }
+
+ bool locRetVal = pendingPage->header()->setBaseHeader((unsigned char*)locBuff); //Views pointer only.
+ if (locRetVal == false) {
+ delete[] locBuff;
+ return PROCESS_FAILED_TO_SET_HEADER;
+ }
+
+ //Set the number of bytes we want for next time
+ mNumBytesNeeded = pendingPage->header()->NumPageSegments();
+
+ //debugLog<<"Setting state to AWAITING_SEG_TABLE"<<endl;
+ //Change the state.
+ mState = AWAITING_SEG_TABLE;
+
+ delete[] locBuff;
+ //debugLog<<"Bytes needed for seg table = "<<mNumBytesNeeded<<endl;
+ return PROCESS_OK;
+}
+OggDataBuffer::eProcessResult OggDataBuffer::processSegTable()
+{
+ ///
+ // Gets the number segments from from the page header, reads in that much data,
+ //
+ //
+ //
+ //Assumes a valid pending page, with numPagesegments set in the header already.
+ //creates a chunk of memory size numpagesegments and stores it,.
+
+ //debugLog<<"Processing Segment Table..."<<endl;
+
+ //TODAY::: What happens when numpage segments is zero.
+
+ //Save a local copy of the number of page segments - Get this from the already set header.
+ unsigned char locNumSegs = pendingPage->header()->NumPageSegments();
+
+ //debugLog<<"Num segments = "<<(int)locNumSegs<<endl;
+
+ //Make a local buffer the size of the segment table. 0 - 255
+ unsigned char* locBuff = new unsigned char[locNumSegs]; //Given to setSegmentTable. Not deleted here.
+
+ ////debugLog<<"ProcessSegTable : Reading from buffer..."<<endl;
+
+ //Read the segment table from the buffer to locBuff
+ unsigned long locNumRead = mBuffer->read(locBuff, (unsigned long)locNumSegs);
+
+ if (locNumRead < locNumSegs) {
+ //TODO::: Handle this case
+
+ //debugLog<<"ProcessSegTable : ##### Short read"<<endl;
+ //debugLog<<"ProcessSegTable : ** "<<mBuffer->numBytesAvail()<<" avail, "<<mBuffer->spaceLeft()<<" space left."<<endl;
+
+ }
+
+
+ //Make a new segment table from the bufferd data.
+ pendingPage->header()->setSegmentTable(locBuff); //This function accepts responsibility for the pointer.
+ locBuff = NULL;
+
+ //Set the number of bytes we want for next time - which is the size of the page data.
+ mNumBytesNeeded = pendingPage->header()->calculateDataSize();
+
+ //debugLog<<"Num bytes needed for data = "<< mNumBytesNeeded<<endl;
+ //debugLog<<"Transition to AWAITING_DATA"<<endl;
+
+ mState = AWAITING_DATA;
+ return PROCESS_OK;
+
+}
+
+OggDataBuffer::eProcessResult OggDataBuffer::processDataSegment()
+{
+ unsigned long locPageDataSize = pendingPage->header()->dataSize();
+
+ //debugLog<<"ProcessDataSegment : Page data size = "<<locPageDataSize<<endl;
+ unsigned char* locBuff = NULL;
+ //unsigned long locPacketOffset = 0;
+
+ //TODO::: Should this be const ?
+ //THis is a raw pointer into the segment table, don't delete it.
+ unsigned char* locSegTable = pendingPage->header()->SegmentTable(); //View only don't delete.
+ unsigned int locNumSegs = pendingPage->header()->NumPageSegments();
+
+ //debugLog<<"ProcessDataSegment : Num segs = "<<locNumSegs<<endl;
+
+
+ unsigned long locCurrPackSize = 0;
+ bool locIsFirstPacket = true;
+ LOOG_INT64 locPrevGranPos = 0;
+
+ for (unsigned long i = 0; i < locNumSegs; i++) {
+ //Packet sums the lacing values of the segment table.
+ locCurrPackSize += locSegTable[i];
+
+ //If its the last segment in the page or if the lacing value is not 255(ie packet boundary.
+
+ /* TRUTH TABLE:
+ last lacing value lacing value is *not* 255
+ ================= =========================
+ true true } If its the last one or a packet boundary(255 lacing value) we add it.
+ true false }
+ false true }
+ false false If it is a 255 (packet continues) and it's not the last one do nothibng
+ it is the last lacing value on the page
+
+
+ Lacing values for a Packet never end with 255... if multiple of 255 have a next 0 lacing value.
+ */
+
+ if ( (locSegTable[i] != 255) || (locNumSegs - 1 == i) ) {
+ //If its the last lacing value or the the lacing value is not 255 (ie packet boundry)
+
+ //This pointer is given to the packet... it deletes it.
+ locBuff = new unsigned char[locCurrPackSize]; //Given away to constructor of StampedOggPacket.
+
+ //STREAM ACCESS:::
+ //Read data from the stream into the local buffer.
+
+ unsigned long locNumRead = mBuffer->read(locBuff, locCurrPackSize);
+
+ if (locNumRead < locCurrPackSize) {
+ //TODO::: Handle this case.
+
+ //debugLog<<"ProcessDataSegment : ###### Short read"<<endl;
+ //debugLog<<"ProcessDataSegment : ** "<<mBuffer->numBytesAvail()<<" avail, "<<mBuffer->spaceLeft()<<" space left."<<endl;
+ locNumRead = locNumRead;
+ }
+
+ //debugLog<<"Adding packet - size = "<<locCurrPackSize<<endl;
+
+ //A packet ends when a lacing value is not 255. So the check for != 255 means the isComplete property of the packet is not set unless the
+ // lacing value is not equal to 255.
+ //ERROR CHECK:::
+ bool locIsContinuation = false;
+
+ if (locIsFirstPacket) {
+ locIsFirstPacket = false;
+
+ //Remember what the granule pos was and get it from the new page.
+ locPrevGranPos = mPrevGranPos;
+ mPrevGranPos = pendingPage->header()->GranulePos();
+
+ //First packet, check if the continuation flag is set.
+ if ((pendingPage->header()->HeaderFlags() & OggPageHeader::CONTINUATION) == OggPageHeader::CONTINUATION) {
+ //Continuation flag is set.
+ locIsContinuation = true;
+ }
+ }
+ //locBuff is given to the constructor of Stamped Ogg Packet... it deletes it.
+ //The new StampedPacket is given to the page... it deletes it
+ pendingPage->addPacket( new StampedOggPacket(locBuff, locCurrPackSize, (locSegTable[i] == 255), locIsContinuation, locPrevGranPos, pendingPage->header()->GranulePos(), StampedOggPacket::OGG_BOTH ) );
+ locBuff = NULL; //We've given this away.
+ //Reset the packet size counter.
+ locCurrPackSize = 0;
+ }
+ }
+
+
+ //Update the state for how many bytes are now needed
+ mNumBytesNeeded = OggPageHeader::OGG_BASE_HEADER_SIZE;
+
+ //debugLog<<"ProcessDataSegment : num bytes needed = "<<mNumBytesNeeded<<endl;
+
+ //Dispatch the finished pagbve
+ eDispatchResult locRet = dispatch(pendingPage); //The dispatch function takes responsibility for this page.
+ pendingPage = NULL; //We give away the pointer
+
+ if (locRet == DISPATCH_OK) {
+ //debugLog<<"ProcessDataSegment : Transition to AWAITING_BASE_HEADER"<<endl;
+ mState = AWAITING_BASE_HEADER;
+ return PROCESS_OK;
+ } else if (locRet == DISPATCH_FALSE) {
+ mState = AWAITING_BASE_HEADER;
+ return PROCESS_DISPATCH_FALSE;
+ } else {
+ //debugLog<<"ProcessDataSegment : Dispatch failed."<<endl;
+ return PROCESS_DISPATCH_FAILED;
+ }
+
+}
+void OggDataBuffer::clearData() {
+ mBuffer->reset();
+ mPrevGranPos = 0;
+ //debugLog<<"ClearData : Transition back to AWAITING_BASE_HEADER"<<endl;
+
+
+ mNumBytesNeeded = OggPageHeader::OGG_BASE_HEADER_SIZE;
+ mState = AWAITING_BASE_HEADER;
+
+ ////debugLog<<"ClearData : Num bytes needed = "<<mNumBytesNeeded<<endl;
+}
+
+OggDataBuffer::eProcessResult OggDataBuffer::processBuffer() {
+
+ eProcessResult locResult = PROCESS_OK;
+
+ while (numBytesAvail() >= mNumBytesNeeded) {
+ ////debugLog<<"ProcessBuffer : Bytes Needed = "<<mNumBytesNeeded<<" --- "<<"Bytes avail = "<<numBytesAvail()<<endl;
+ switch (mState) {
+
+ //QUERY::: Should it be a bug when the if state inside the switch falls through,... potential for infinite loop.
+ case AWAITING_BASE_HEADER:
+ //debugLog<<"ProcessBuffer : State = AWAITING_BASE_HEADER"<<endl;
+
+ //If theres enough data to form the base header
+ if (numBytesAvail() >= OggPageHeader::OGG_BASE_HEADER_SIZE) {
+ //debugLog<<"ProcessBuffer : Enough to process..."<<endl;
+
+ locResult = processBaseHeader();
+
+ if (locResult != PROCESS_OK) {
+ mState = LOST_PAGE_SYNC;
+ //Base header process failed
+ return locResult;
+ }
+ }
+ break;
+
+ case AWAITING_SEG_TABLE:
+ //debugLog<<"ProcessBuffer : State = AWAITING_SEG_TABLE"<<endl;
+
+ //If there is enough data to get the segt table
+ if (numBytesAvail() >= pendingPage->header()->NumPageSegments()) {
+ //debugLog<<"ProcessBuffer : Enough to process..."<<endl;
+
+ locResult = processSegTable();
+
+ if (locResult != PROCESS_OK) {
+ mState = LOST_PAGE_SYNC;
+ //segment table process failed
+ return locResult;
+ }
+ }
+ break;
+
+ case AWAITING_DATA:
+ //debugLog<<"ProcessBuffer : State = AWAITING_DATA"<<endl;
+ //If all the data segment is available
+ if (numBytesAvail() >= pendingPage->header()->dataSize()) {
+ //debugLog<<"ProcessBuffer : Enough to process..."<<endl;
+
+ //FIX::: Need error check.
+ locResult = processDataSegment();
+
+ if (locResult == PROCESS_DISPATCH_FAILED) {
+ mState = LOST_PAGE_SYNC;
+ //segment table process failed
+ return locResult;
+ }
+
+ }
+ break;
+ case LOST_PAGE_SYNC:
+ //TODO::: Insert resync code here.
+
+ //debugLog<<"ProcessBuffer : State = LOST_PAGE_SYNC"<<endl;
+ return PROCESS_LOST_SYNC;
+ default:
+ //TODO::: What are we supposed to do with this. Anything need cleaning up ?
+
+ //debugLog<<"ProcessBuffer : Ogg Buffer Error"<<endl;
+ return PROCESS_UNKNOWN_INTERNAL_ERROR;
+ break;
+ }
+ }
+
+ //There wasn't enough data to progress if we are here.
+ return locResult;
+
+}
+
+//Debug Only
+void OggDataBuffer::debugWrite(string inString) {
+ //debugLog<<inString<<endl;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,133 +1,133 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-//#include <sstream>
-#include "CircularBuffer.h"
-#include "OggPage.h"
-#include "OggTypeDefs.h"
-#include "IOggCallback.h"
-#include "IFIFOBuffer.h"
-
-//Only needed for debugging
-//#include <fstream>
-//
-using namespace std;
-
-class LIBOOOGG_API OggDataBuffer {
-public:
- //Public Constants and enums
- enum eState {
- EOS,
- AWAITING_BASE_HEADER = 32,
- AWAITING_SEG_TABLE,
- AWAITING_DATA,
- LOST_PAGE_SYNC
- };
-
- enum eFeedResult {
- FEED_OK,
- FEED_NULL_POINTER = 64,
- FEED_BUFFER_WRITE_ERROR
- };
-
- enum eDispatchResult {
- DISPATCH_OK,
- DISPATCH_NO_CALLBACK = 256,
- DISPATCH_FALSE
- };
-
- enum eProcessResult {
- PROCESS_OK,
- PROCESS_UNKNOWN_INTERNAL_ERROR = 512,
- PROCESS_STREAM_READ_ERROR,
- PROCESS_DISPATCH_FALSE,
- PROCESS_DISPATCH_FAILED,
- PROCESS_FAILED_TO_SET_HEADER,
- PROCESS_LOST_SYNC = 4096
-
- };
-
- static const int MAX_OGG_PAGE_SIZE = OggPageHeader::OGG_BASE_HEADER_SIZE + //Header
- (OggPageHeader::MAX_NUM_SEGMENTS * OggPageHeader::MAX_SEGMENT_SIZE) + //Page Data
- (OggPageHeader::SEGMENT_WIDTH * OggPageHeader::MAX_NUM_SEGMENTS); //Segment table
-
- //Debug only
- //OggDataBuffer::OggDataBuffer(bool x);
- void debugWrite(string inString);
- //
-
- //Constructors
- OggDataBuffer(void);
- virtual ~OggDataBuffer(void);
-
- //Setting callbacks
- bool registerStaticCallback(fPageCallback inPageCallback);
- bool registerVirtualCallback(IOggCallback* inPageCallback);
-
- //Buffer Control
- eFeedResult feed(const unsigned char* inData, unsigned long inNumBytes);
- void clearData();
-
- //Buffer state
- unsigned long numBytesAvail();
- eState state();
-
-protected:
- //FIFO Buffer
- IFIFOBuffer* mBuffer;
-
- //Buffer State
- unsigned long mNumBytesNeeded;
- eState mState;
- OggPage* pendingPage;
- LOOG_INT64 mPrevGranPos;
-
- //Callback pointers
- IOggCallback* mVirtualCallback;
- fPageCallback mStaticCallback;
-
- //Internal processing
- eProcessResult processBuffer();
- eProcessResult processBaseHeader();
- eProcessResult processSegTable();
- eProcessResult processDataSegment();
-
- //Internal dispatch
- virtual eDispatchResult dispatch(OggPage* inOggPage);
-
- //DEBUG
- //fstream debugLog;
- //
-private:
- OggDataBuffer& operator=(const OggDataBuffer& other); /* Don't assign me */
- OggDataBuffer(const OggDataBuffer& other); /* Don't copy me */
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+//#include <sstream>
+#include "CircularBuffer.h"
+#include "OggPage.h"
+#include "OggTypeDefs.h"
+#include "IOggCallback.h"
+#include "IFIFOBuffer.h"
+
+//Only needed for debugging
+//#include <fstream>
+//
+using namespace std;
+
+class LIBOOOGG_API OggDataBuffer {
+public:
+ //Public Constants and enums
+ enum eState {
+ EOS,
+ AWAITING_BASE_HEADER = 32,
+ AWAITING_SEG_TABLE,
+ AWAITING_DATA,
+ LOST_PAGE_SYNC
+ };
+
+ enum eFeedResult {
+ FEED_OK,
+ FEED_NULL_POINTER = 64,
+ FEED_BUFFER_WRITE_ERROR
+ };
+
+ enum eDispatchResult {
+ DISPATCH_OK,
+ DISPATCH_NO_CALLBACK = 256,
+ DISPATCH_FALSE
+ };
+
+ enum eProcessResult {
+ PROCESS_OK,
+ PROCESS_UNKNOWN_INTERNAL_ERROR = 512,
+ PROCESS_STREAM_READ_ERROR,
+ PROCESS_DISPATCH_FALSE,
+ PROCESS_DISPATCH_FAILED,
+ PROCESS_FAILED_TO_SET_HEADER,
+ PROCESS_LOST_SYNC = 4096
+
+ };
+
+ static const int MAX_OGG_PAGE_SIZE = OggPageHeader::OGG_BASE_HEADER_SIZE + //Header
+ (OggPageHeader::MAX_NUM_SEGMENTS * OggPageHeader::MAX_SEGMENT_SIZE) + //Page Data
+ (OggPageHeader::SEGMENT_WIDTH * OggPageHeader::MAX_NUM_SEGMENTS); //Segment table
+
+ //Debug only
+ //OggDataBuffer::OggDataBuffer(bool x);
+ void debugWrite(string inString);
+ //
+
+ //Constructors
+ OggDataBuffer(void);
+ virtual ~OggDataBuffer(void);
+
+ //Setting callbacks
+ bool registerStaticCallback(fPageCallback inPageCallback);
+ bool registerVirtualCallback(IOggCallback* inPageCallback);
+
+ //Buffer Control
+ eFeedResult feed(const unsigned char* inData, unsigned long inNumBytes);
+ void clearData();
+
+ //Buffer state
+ unsigned long numBytesAvail();
+ eState state();
+
+protected:
+ //FIFO Buffer
+ IFIFOBuffer* mBuffer;
+
+ //Buffer State
+ unsigned long mNumBytesNeeded;
+ eState mState;
+ OggPage* pendingPage;
+ LOOG_INT64 mPrevGranPos;
+
+ //Callback pointers
+ IOggCallback* mVirtualCallback;
+ fPageCallback mStaticCallback;
+
+ //Internal processing
+ eProcessResult processBuffer();
+ eProcessResult processBaseHeader();
+ eProcessResult processSegTable();
+ eProcessResult processDataSegment();
+
+ //Internal dispatch
+ virtual eDispatchResult dispatch(OggPage* inOggPage);
+
+ //DEBUG
+ //fstream debugLog;
+ //
+private:
+ OggDataBuffer& operator=(const OggDataBuffer& other); /* Don't assign me */
+ OggDataBuffer(const OggDataBuffer& other); /* Don't copy me */
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggDataBuffer.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,170 +1,170 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "stdafx.h"
-#include "OggMuxStream.h"
-
-OggMuxStream::OggMuxStream(INotifyArrival* inNotifier)
- : mIsEOS(false)
- , mIsActive(false)
- , mNotifier(inNotifier)
- , mIsSensibleTime(true)
- , mConvNumerator(1)
- , mConvDenominator(1)
- , mConvScaleFactor(1)
- , mConvTheoraLogKeyFrameInterval(0)
-{
- //debugLog.open("G:\\logs\\oggmuxstream.log", ios_base::out);
-}
-
-OggMuxStream::~OggMuxStream(void)
-{
- //LEAK::: Need to delete the contents of the queue later.
-}
-
-LOOG_INT64 OggMuxStream::granuleNumerator() {
- return mConvNumerator;
-}
-LOOG_INT64 OggMuxStream::granuleDenominator() {
- return mConvDenominator;
-}
-unsigned long OggMuxStream::numAvail() {
- return mPageQueue.size();
-}
-bool OggMuxStream::acceptOggPage(OggPage* inOggPage) { //Holds page for later... still needs deleting in destructor
- mIsEOS = false;
- mPageQueue.push_back(inOggPage); //AOP::: Clone not required.
- mNotifier->notifyArrival();
- return true;
-}
-
-bool OggMuxStream::pushFront(OggPage* inOggPage) {
- mIsEOS = false;
- mPageQueue.push_front(inOggPage);
- mNotifier->notifyArrival();
- return true;
-}
-
-OggPage* OggMuxStream::popFront() {
- OggPage* retPage = NULL;
- if (!mPageQueue.empty()) {
- retPage = mPageQueue.front();
- mPageQueue.pop_front();
- }
- return retPage;
-}
-OggPage* OggMuxStream::peekFront() {
- OggPage* retPage = NULL;
- if (!mPageQueue.empty()) {
- retPage = mPageQueue.front();
-
- }
- return retPage;
-}
-LOOG_INT64 OggMuxStream::frontTime() {
- LOOG_INT64 retTime = INT64_MAX;
- if (!mPageQueue.empty()) {
- retTime = mPageQueue.front()->header()->GranulePos();;
- }
- return retTime;
-}
-
-LOOG_INT64 OggMuxStream::scaledFrontTime() {
-
- return convertTime(frontTime());
-}
-
-LOOG_INT64 OggMuxStream::convertTime(LOOG_INT64 inGranulePos) {
- LOOG_INT64 retTime = INT64_MAX;
- if (inGranulePos != INT64_MAX) {
- if (mIsSensibleTime) {
- retTime = (inGranulePos * mConvScaleFactor * mConvDenominator) / mConvNumerator;
- } else {
- //Timestamp hacks start here...
- unsigned long locMod = (unsigned long)pow((double) 2, (double) mConvTheoraLogKeyFrameInterval);
-
- unsigned long locInterFrameNo = (inGranulePos) % locMod;
-
- LOOG_INT64 locAbsFramePos = (inGranulePos >> mConvTheoraLogKeyFrameInterval) + locInterFrameNo;
-
- retTime = (locAbsFramePos * mConvScaleFactor * mConvDenominator) / mConvNumerator;
-
-
- }
- }
- return retTime;
-
-
-}
-
-bool OggMuxStream::setConversionParams(LOOG_INT64 inNumerator, LOOG_INT64 inDenominator, LOOG_INT64 inScaleFactor) {
- mConvNumerator = inNumerator;
- mConvDenominator = inDenominator;
- mConvScaleFactor = inScaleFactor;
- mIsSensibleTime = true;
- return true;
-}
-
-bool OggMuxStream::setConversionParams(LOOG_INT64 inNumerator, LOOG_INT64 inDenominator, LOOG_INT64 inScaleFactor, LOOG_INT64 inTheoraLogKFI) {
- mConvNumerator = inNumerator;
- mConvDenominator = inDenominator;
- mConvScaleFactor = inScaleFactor;
- mConvTheoraLogKeyFrameInterval = inTheoraLogKFI;
- mIsSensibleTime = false;
- return true;
-}
-
-bool OggMuxStream::isEmpty() {
- return mPageQueue.empty();
-}
-bool OggMuxStream::isEOS() {
- return mIsEOS;
-}
-
-bool OggMuxStream::isProcessable() {
- if (isEmpty() && !isEOS() && isActive()) {
- return false;
- } else {
- return true;
- }
-}
-void OggMuxStream::setIsEOS(bool inIsEOS) {
- mIsEOS = inIsEOS;
- //Notify that the streams are in new state.
- mNotifier->notifyArrival();
-}
-
-bool OggMuxStream::isActive() {
- return mIsActive;
-}
-void OggMuxStream::setIsActive(bool inIsActive) {
- mIsActive = inIsActive;
-}
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "stdafx.h"
+#include "OggMuxStream.h"
+
+OggMuxStream::OggMuxStream(INotifyArrival* inNotifier)
+ : mIsEOS(false)
+ , mIsActive(false)
+ , mNotifier(inNotifier)
+ , mIsSensibleTime(true)
+ , mConvNumerator(1)
+ , mConvDenominator(1)
+ , mConvScaleFactor(1)
+ , mConvTheoraLogKeyFrameInterval(0)
+{
+ //debugLog.open("G:\\logs\\oggmuxstream.log", ios_base::out);
+}
+
+OggMuxStream::~OggMuxStream(void)
+{
+ //LEAK::: Need to delete the contents of the queue later.
+}
+
+LOOG_INT64 OggMuxStream::granuleNumerator() {
+ return mConvNumerator;
+}
+LOOG_INT64 OggMuxStream::granuleDenominator() {
+ return mConvDenominator;
+}
+unsigned long OggMuxStream::numAvail() {
+ return mPageQueue.size();
+}
+bool OggMuxStream::acceptOggPage(OggPage* inOggPage) { //Holds page for later... still needs deleting in destructor
+ mIsEOS = false;
+ mPageQueue.push_back(inOggPage); //AOP::: Clone not required.
+ mNotifier->notifyArrival();
+ return true;
+}
+
+bool OggMuxStream::pushFront(OggPage* inOggPage) {
+ mIsEOS = false;
+ mPageQueue.push_front(inOggPage);
+ mNotifier->notifyArrival();
+ return true;
+}
+
+OggPage* OggMuxStream::popFront() {
+ OggPage* retPage = NULL;
+ if (!mPageQueue.empty()) {
+ retPage = mPageQueue.front();
+ mPageQueue.pop_front();
+ }
+ return retPage;
+}
+OggPage* OggMuxStream::peekFront() {
+ OggPage* retPage = NULL;
+ if (!mPageQueue.empty()) {
+ retPage = mPageQueue.front();
+
+ }
+ return retPage;
+}
+LOOG_INT64 OggMuxStream::frontTime() {
+ LOOG_INT64 retTime = INT64_MAX;
+ if (!mPageQueue.empty()) {
+ retTime = mPageQueue.front()->header()->GranulePos();;
+ }
+ return retTime;
+}
+
+LOOG_INT64 OggMuxStream::scaledFrontTime() {
+
+ return convertTime(frontTime());
+}
+
+LOOG_INT64 OggMuxStream::convertTime(LOOG_INT64 inGranulePos) {
+ LOOG_INT64 retTime = INT64_MAX;
+ if (inGranulePos != INT64_MAX) {
+ if (mIsSensibleTime) {
+ retTime = (inGranulePos * mConvScaleFactor * mConvDenominator) / mConvNumerator;
+ } else {
+ //Timestamp hacks start here...
+ unsigned long locMod = (unsigned long)pow((double) 2, (double) mConvTheoraLogKeyFrameInterval);
+
+ unsigned long locInterFrameNo = (inGranulePos) % locMod;
+
+ LOOG_INT64 locAbsFramePos = (inGranulePos >> mConvTheoraLogKeyFrameInterval) + locInterFrameNo;
+
+ retTime = (locAbsFramePos * mConvScaleFactor * mConvDenominator) / mConvNumerator;
+
+
+ }
+ }
+ return retTime;
+
+
+}
+
+bool OggMuxStream::setConversionParams(LOOG_INT64 inNumerator, LOOG_INT64 inDenominator, LOOG_INT64 inScaleFactor) {
+ mConvNumerator = inNumerator;
+ mConvDenominator = inDenominator;
+ mConvScaleFactor = inScaleFactor;
+ mIsSensibleTime = true;
+ return true;
+}
+
+bool OggMuxStream::setConversionParams(LOOG_INT64 inNumerator, LOOG_INT64 inDenominator, LOOG_INT64 inScaleFactor, LOOG_INT64 inTheoraLogKFI) {
+ mConvNumerator = inNumerator;
+ mConvDenominator = inDenominator;
+ mConvScaleFactor = inScaleFactor;
+ mConvTheoraLogKeyFrameInterval = inTheoraLogKFI;
+ mIsSensibleTime = false;
+ return true;
+}
+
+bool OggMuxStream::isEmpty() {
+ return mPageQueue.empty();
+}
+bool OggMuxStream::isEOS() {
+ return mIsEOS;
+}
+
+bool OggMuxStream::isProcessable() {
+ if (isEmpty() && !isEOS() && isActive()) {
+ return false;
+ } else {
+ return true;
+ }
+}
+void OggMuxStream::setIsEOS(bool inIsEOS) {
+ mIsEOS = inIsEOS;
+ //Notify that the streams are in new state.
+ mNotifier->notifyArrival();
+}
+
+bool OggMuxStream::isActive() {
+ return mIsActive;
+}
+void OggMuxStream::setIsActive(bool inIsActive) {
+ mIsActive = inIsActive;
+}
+
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,94 +1,94 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-
-#include "OggPage.h"
-#include "IOggCallback.h"
-#include "INotifyArrival.h"
-#include <math.h>
-#include <deque>
-#include <fstream>
-using namespace std;
-class LIBOOOGG_API OggMuxStream
- : public IOggCallback
-{
-public:
- OggMuxStream(INotifyArrival* inNotifier);
- virtual ~OggMuxStream(void);
-
- static const LOOG_INT64 INT64_MAX = 9223372036854775807LL;
-
- //IOggCallback implementaion.
- virtual bool acceptOggPage(OggPage* inOggPage);
-
- virtual bool pushFront(OggPage* inOggPage);
-
- virtual OggPage* popFront();
- virtual OggPage* peekFront();
-
- virtual unsigned long numAvail();
-
- virtual LOOG_INT64 frontTime();
- virtual LOOG_INT64 scaledFrontTime();
-
- virtual bool isEmpty();
- virtual bool isEOS();
- virtual bool isProcessable();
- virtual void setIsEOS(bool inIsEOS);
- virtual bool isActive();
- virtual void setIsActive(bool inIsActive);
-
- virtual bool setConversionParams(LOOG_INT64 inNumerator, LOOG_INT64 inDenominator, LOOG_INT64 inScaleFactor, LOOG_INT64 inTheoraLogKFI);
- bool setConversionParams(LOOG_INT64 inNumerator, LOOG_INT64 inDenominator, LOOG_INT64 inScaleFactor);
-
-
- LOOG_INT64 granuleNumerator();
- LOOG_INT64 granuleDenominator();
-
-protected:
- INotifyArrival* mNotifier;
- LOOG_INT64 convertTime(LOOG_INT64 inGranulePos);
-
- bool mIsEOS;
- bool mIsActive;
- bool mIsSensibleTime;
-
- LOOG_INT64 mConvNumerator;
- LOOG_INT64 mConvDenominator;
- LOOG_INT64 mConvScaleFactor;
- LOOG_INT64 mConvTheoraLogKeyFrameInterval;
-
- //fstream debugLog;
- deque<OggPage*> mPageQueue;
-private:
- OggMuxStream& operator=(const OggMuxStream& other); /* Don't assign me */
- OggMuxStream(const OggMuxStream& other); /* Don't copy me */
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+
+#include "OggPage.h"
+#include "IOggCallback.h"
+#include "INotifyArrival.h"
+#include <math.h>
+#include <deque>
+#include <fstream>
+using namespace std;
+class LIBOOOGG_API OggMuxStream
+ : public IOggCallback
+{
+public:
+ OggMuxStream(INotifyArrival* inNotifier);
+ virtual ~OggMuxStream(void);
+
+ static const LOOG_INT64 INT64_MAX = 9223372036854775807LL;
+
+ //IOggCallback implementaion.
+ virtual bool acceptOggPage(OggPage* inOggPage);
+
+ virtual bool pushFront(OggPage* inOggPage);
+
+ virtual OggPage* popFront();
+ virtual OggPage* peekFront();
+
+ virtual unsigned long numAvail();
+
+ virtual LOOG_INT64 frontTime();
+ virtual LOOG_INT64 scaledFrontTime();
+
+ virtual bool isEmpty();
+ virtual bool isEOS();
+ virtual bool isProcessable();
+ virtual void setIsEOS(bool inIsEOS);
+ virtual bool isActive();
+ virtual void setIsActive(bool inIsActive);
+
+ virtual bool setConversionParams(LOOG_INT64 inNumerator, LOOG_INT64 inDenominator, LOOG_INT64 inScaleFactor, LOOG_INT64 inTheoraLogKFI);
+ bool setConversionParams(LOOG_INT64 inNumerator, LOOG_INT64 inDenominator, LOOG_INT64 inScaleFactor);
+
+
+ LOOG_INT64 granuleNumerator();
+ LOOG_INT64 granuleDenominator();
+
+protected:
+ INotifyArrival* mNotifier;
+ LOOG_INT64 convertTime(LOOG_INT64 inGranulePos);
+
+ bool mIsEOS;
+ bool mIsActive;
+ bool mIsSensibleTime;
+
+ LOOG_INT64 mConvNumerator;
+ LOOG_INT64 mConvDenominator;
+ LOOG_INT64 mConvScaleFactor;
+ LOOG_INT64 mConvTheoraLogKeyFrameInterval;
+
+ //fstream debugLog;
+ deque<OggPage*> mPageQueue;
+private:
+ OggMuxStream& operator=(const OggMuxStream& other); /* Don't assign me */
+ OggMuxStream(const OggMuxStream& other); /* Don't copy me */
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggMuxStream.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPacket.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPacket.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPacket.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,224 +1,224 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "stdafx.h"
-#include "OggPacket.h"
-
-//LEAK CHECK::: 20041018 - OK.
-OggPacket::OggPacket(void)
- : mPacketSize(0)
- , mPacketData(NULL)
- , mIsContinuation(false)
- , mIsTruncated(false)
-
-{
-
-}
-
-//Accepts responsibility for inPackData pointer - deletes it in destructor.
-OggPacket::OggPacket(unsigned char* inPackData, unsigned long inPacketSize, bool inIsTruncated, bool inIsContinuation)
- : mPacketSize(inPacketSize)
- , mPacketData(inPackData)
- , mIsContinuation(inIsContinuation)
- , mIsTruncated(inIsTruncated)
-
-{
-}
-
-//This method creates a pointer which the caller is responsible for.
-OggPacket* OggPacket::clone() {
- //Make a new buffer for packet data
- unsigned char* locBuff = new unsigned char[mPacketSize]; //Given to constructor of OggPacket
-
- //Copy the packet data into the new buffer
- memcpy((void*)locBuff, (const void*)mPacketData, mPacketSize);
-
- //Create the new packet - accepts locBuff poitner
- OggPacket* retPack = new OggPacket(locBuff, mPacketSize, mIsTruncated, mIsContinuation); //Gives this pointer to the caller.
- return retPack;
-}
-
-
-OggPacket::~OggPacket(void)
-{
- //Now deletes the packetData
- delete[] mPacketData;
-
- //Should be careful about allowing this to be copied...
-}
-
-string OggPacket::toPackDumpString() {
- string retStr = "";
-
-
- ///NOTE::: ShOuld be reworked.
- //Needs dataSize and data pointer
-
- //Put the stream in hex mode with a fill character of 0
-
- //cout << setfill('0');
-
- //Loop through every character of data
- for (unsigned long i = 0; i < mPacketSize; i++) {
- //If it is the end of the previous hex dump line or first line)
- if ( (i % HEX_DUMP_LINE_LENGTH == 0) ) {
- //And this is not the first line
- if ( i != 0 ) {
- //Put the characters on the end
- retStr.append(dumpNCharsToString( &mPacketData[i - HEX_DUMP_LINE_LENGTH], HEX_DUMP_LINE_LENGTH));
- }
-
- //At the start of the line write out the base address in an 8 hex-digit field
- //NOTE::: Just decimal for now.
- //cout << setw(8) << i << ": ";
- retStr.append(padField(StringHelper::numToString(i), 8, '0') + ": ");
- }
-
- //Write out the value of the character in a 2 hex-digit field
- //cout << setw(2) << (int)mPageData[i] << " ";
- retStr.append(StringHelper::charToHexString(mPacketData[i]) + " ");
- }
-
- //Find out how many leftover charcters didn't get written out.
- unsigned long locLeftovers = (mPacketSize % HEX_DUMP_LINE_LENGTH);
-
- locLeftovers = (locLeftovers > 0) ? (locLeftovers)
- : (HEX_DUMP_LINE_LENGTH);
-
-
- //If there was any data in this dump
- if ( mPacketSize > 0 ) {
- //Dump the last part out
- retStr.append(dumpNCharsToString( &mPacketData[mPacketSize - locLeftovers], locLeftovers ));
- }
-
- retStr+= "==============================================================================\n" ;
- //Put the stream back to decimal mode
- //dec(cout);
-
- return retStr;
-}
-
-string OggPacket::padField(string inString, unsigned long inPadWidth, unsigned char inPadChar) {
- //NOTE::: Need check for string being bigger than pad space
- string retStr = "";
- retStr.append(inPadWidth - inString.length(), inPadChar);
- retStr.append(inString);
-
- return retStr;
-}
-string OggPacket::dumpNCharsToString(unsigned char* inStartPoint, unsigned long inNumChars) {
- //NOTE::: Also needs reworking
- const unsigned char BELL = 7;
- //Set the fill character back to space ' '
- //cout << setfill(' ');
-
-
- //Put some space after the hex section
- unsigned long locPadding = 3 * (HEX_DUMP_LINE_LENGTH - inNumChars) + 4;
- //cout << setw(locPadding) << " ";
-
- string retStr = padField(" ", locPadding, ' ');
-
- //Loop through the characters
- for (unsigned long i = 0; i < inNumChars; i++) {
-
- //If they are *not* going to mess up the layout (\r, \n or \t or bell(7))
- if ( (inStartPoint[i] != '\n') && (inStartPoint[i] != '\r') && (inStartPoint[i] != '\t') && (inStartPoint[i] != BELL )) {
- //Write them out
- retStr += (char)inStartPoint[i];
- } else {
- //Otherwise just write a null char
- retStr += ((char) 0);
- }
- }
- retStr += "\n";
-
- return retStr;
-
-}
-
-
-
-unsigned long OggPacket::packetSize() const {
- return mPacketSize;
-}
-
-unsigned char* OggPacket::packetData() {
- return mPacketData;
-}
-bool OggPacket::isTruncated() const {
- return mIsTruncated;
-}
-bool OggPacket::isContinuation() const {
- return mIsContinuation;
-}
-
-//bool OggPacket::isComplete() const {
-// return mIsComplete;
-//}
-
-//void OggPacket::setIsComplete(bool inIsComplete) {
-// mIsComplete = inIsComplete;
-//}
-void OggPacket::setPacketSize(unsigned long inPacketSize) {
- mPacketSize = inPacketSize;
-}
-
-//This function accepts responsibility for the pointer it is passed, and it deletes it in the destructor.
-void OggPacket::setPacketData(unsigned char* inPacketData) {
- mPacketData = inPacketData;
-}
-
-//Only views the incoming pointer.
-void OggPacket::merge(const OggPacket* inMorePacket) {
- //Make a new buffer the size of both data segs together
- unsigned char* locBuff = new unsigned char[mPacketSize + inMorePacket->mPacketSize]; //This is put into the member vvariable, where it will be deleted in destructor.
- //Copy this packets data to the start
- memcpy((void*)locBuff, (const void*)mPacketData, mPacketSize);
- //Copy the next packets data after it
- memcpy((void*)(locBuff + mPacketSize), (const void*)inMorePacket->mPacketData, inMorePacket->mPacketSize);
- //Delete our original packet data
- delete[] mPacketData;
- //Now make our data be the combined data
- mPacketData = locBuff;
- //Make the size the sum of both packets
- mPacketSize += inMorePacket->mPacketSize;
-
- //If the next part of the packet isn't complete then this packet is not complete.
- //mIsComplete = inMorePacket->mIsComplete;
- //The new packet is truncated only if the incoming packet is
- mIsTruncated = inMorePacket->mIsTruncated; //->isTruncated();
-
- //This is not a continuation... a continuation is a packet that does not start at the start of the real packet.
- mIsContinuation = false;
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "stdafx.h"
+#include "OggPacket.h"
+
+//LEAK CHECK::: 20041018 - OK.
+OggPacket::OggPacket(void)
+ : mPacketSize(0)
+ , mPacketData(NULL)
+ , mIsContinuation(false)
+ , mIsTruncated(false)
+
+{
+
+}
+
+//Accepts responsibility for inPackData pointer - deletes it in destructor.
+OggPacket::OggPacket(unsigned char* inPackData, unsigned long inPacketSize, bool inIsTruncated, bool inIsContinuation)
+ : mPacketSize(inPacketSize)
+ , mPacketData(inPackData)
+ , mIsContinuation(inIsContinuation)
+ , mIsTruncated(inIsTruncated)
+
+{
+}
+
+//This method creates a pointer which the caller is responsible for.
+OggPacket* OggPacket::clone() {
+ //Make a new buffer for packet data
+ unsigned char* locBuff = new unsigned char[mPacketSize]; //Given to constructor of OggPacket
+
+ //Copy the packet data into the new buffer
+ memcpy((void*)locBuff, (const void*)mPacketData, mPacketSize);
+
+ //Create the new packet - accepts locBuff poitner
+ OggPacket* retPack = new OggPacket(locBuff, mPacketSize, mIsTruncated, mIsContinuation); //Gives this pointer to the caller.
+ return retPack;
+}
+
+
+OggPacket::~OggPacket(void)
+{
+ //Now deletes the packetData
+ delete[] mPacketData;
+
+ //Should be careful about allowing this to be copied...
+}
+
+string OggPacket::toPackDumpString() {
+ string retStr = "";
+
+
+ ///NOTE::: ShOuld be reworked.
+ //Needs dataSize and data pointer
+
+ //Put the stream in hex mode with a fill character of 0
+
+ //cout << setfill('0');
+
+ //Loop through every character of data
+ for (unsigned long i = 0; i < mPacketSize; i++) {
+ //If it is the end of the previous hex dump line or first line)
+ if ( (i % HEX_DUMP_LINE_LENGTH == 0) ) {
+ //And this is not the first line
+ if ( i != 0 ) {
+ //Put the characters on the end
+ retStr.append(dumpNCharsToString( &mPacketData[i - HEX_DUMP_LINE_LENGTH], HEX_DUMP_LINE_LENGTH));
+ }
+
+ //At the start of the line write out the base address in an 8 hex-digit field
+ //NOTE::: Just decimal for now.
+ //cout << setw(8) << i << ": ";
+ retStr.append(padField(StringHelper::numToString(i), 8, '0') + ": ");
+ }
+
+ //Write out the value of the character in a 2 hex-digit field
+ //cout << setw(2) << (int)mPageData[i] << " ";
+ retStr.append(StringHelper::charToHexString(mPacketData[i]) + " ");
+ }
+
+ //Find out how many leftover charcters didn't get written out.
+ unsigned long locLeftovers = (mPacketSize % HEX_DUMP_LINE_LENGTH);
+
+ locLeftovers = (locLeftovers > 0) ? (locLeftovers)
+ : (HEX_DUMP_LINE_LENGTH);
+
+
+ //If there was any data in this dump
+ if ( mPacketSize > 0 ) {
+ //Dump the last part out
+ retStr.append(dumpNCharsToString( &mPacketData[mPacketSize - locLeftovers], locLeftovers ));
+ }
+
+ retStr+= "==============================================================================\n" ;
+ //Put the stream back to decimal mode
+ //dec(cout);
+
+ return retStr;
+}
+
+string OggPacket::padField(string inString, unsigned long inPadWidth, unsigned char inPadChar) {
+ //NOTE::: Need check for string being bigger than pad space
+ string retStr = "";
+ retStr.append(inPadWidth - inString.length(), inPadChar);
+ retStr.append(inString);
+
+ return retStr;
+}
+string OggPacket::dumpNCharsToString(unsigned char* inStartPoint, unsigned long inNumChars) {
+ //NOTE::: Also needs reworking
+ const unsigned char BELL = 7;
+ //Set the fill character back to space ' '
+ //cout << setfill(' ');
+
+
+ //Put some space after the hex section
+ unsigned long locPadding = 3 * (HEX_DUMP_LINE_LENGTH - inNumChars) + 4;
+ //cout << setw(locPadding) << " ";
+
+ string retStr = padField(" ", locPadding, ' ');
+
+ //Loop through the characters
+ for (unsigned long i = 0; i < inNumChars; i++) {
+
+ //If they are *not* going to mess up the layout (\r, \n or \t or bell(7))
+ if ( (inStartPoint[i] != '\n') && (inStartPoint[i] != '\r') && (inStartPoint[i] != '\t') && (inStartPoint[i] != BELL )) {
+ //Write them out
+ retStr += (char)inStartPoint[i];
+ } else {
+ //Otherwise just write a null char
+ retStr += ((char) 0);
+ }
+ }
+ retStr += "\n";
+
+ return retStr;
+
+}
+
+
+
+unsigned long OggPacket::packetSize() const {
+ return mPacketSize;
+}
+
+unsigned char* OggPacket::packetData() {
+ return mPacketData;
+}
+bool OggPacket::isTruncated() const {
+ return mIsTruncated;
+}
+bool OggPacket::isContinuation() const {
+ return mIsContinuation;
+}
+
+//bool OggPacket::isComplete() const {
+// return mIsComplete;
+//}
+
+//void OggPacket::setIsComplete(bool inIsComplete) {
+// mIsComplete = inIsComplete;
+//}
+void OggPacket::setPacketSize(unsigned long inPacketSize) {
+ mPacketSize = inPacketSize;
+}
+
+//This function accepts responsibility for the pointer it is passed, and it deletes it in the destructor.
+void OggPacket::setPacketData(unsigned char* inPacketData) {
+ mPacketData = inPacketData;
+}
+
+//Only views the incoming pointer.
+void OggPacket::merge(const OggPacket* inMorePacket) {
+ //Make a new buffer the size of both data segs together
+ unsigned char* locBuff = new unsigned char[mPacketSize + inMorePacket->mPacketSize]; //This is put into the member vvariable, where it will be deleted in destructor.
+ //Copy this packets data to the start
+ memcpy((void*)locBuff, (const void*)mPacketData, mPacketSize);
+ //Copy the next packets data after it
+ memcpy((void*)(locBuff + mPacketSize), (const void*)inMorePacket->mPacketData, inMorePacket->mPacketSize);
+ //Delete our original packet data
+ delete[] mPacketData;
+ //Now make our data be the combined data
+ mPacketData = locBuff;
+ //Make the size the sum of both packets
+ mPacketSize += inMorePacket->mPacketSize;
+
+ //If the next part of the packet isn't complete then this packet is not complete.
+ //mIsComplete = inMorePacket->mIsComplete;
+ //The new packet is truncated only if the incoming packet is
+ mIsTruncated = inMorePacket->mIsTruncated; //->isTruncated();
+
+ //This is not a continuation... a continuation is a packet that does not start at the start of the real packet.
+ mIsContinuation = false;
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPacket.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPacket.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPacket.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPacket.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,86 +1,86 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-#include <string>
-using namespace std;
-#include "StringHelper.h"
-
-class LIBOOOGG_API OggPacket
-{
-public:
- //Constructors
- OggPacket(void);
- OggPacket(unsigned char* inPackData, unsigned long inPacketSize, bool inIsTruncated, bool inIsContinuation);
- virtual ~OggPacket(void);
- virtual OggPacket* clone();
-
- static const unsigned long HEX_DUMP_LINE_LENGTH = 16;
-
- //Packet accessors
- unsigned long packetSize() const;
- unsigned char* packetData();
- //bool isComplete() const;
- bool isTruncated() const;
- bool isContinuation() const;
-
- //Packet Mutators
- //void setIsComplete (bool inIsComplete );
-
- void setIsTruncated(bool inIsTruncated);
- void setIsContinuation(bool inIsContinuation);
- void setPacketSize (unsigned long inPacketSize );
- void setPacketData (unsigned char* inPacketData );
-
- //Merge function
- virtual void merge(const OggPacket* inMorePacket);
-
- //TODO::: Should this be here ?
- string toPackDumpString();
-
-protected:
- //Packet member data
- unsigned long mPacketSize;
- unsigned char* mPacketData;
- //bool mIsComplete;
- bool mIsTruncated;
- bool mIsContinuation;
-
- //TODO::Should these be here ?
- string OggPacket::dumpNCharsToString(unsigned char* inStartPoint, unsigned long inNumChars) ;
- string OggPacket::padField(string inString, unsigned long inPadWidth, unsigned char inPadChar);
-
-private:
- OggPacket& operator=(const OggPacket& other); /* Don't assign me */
- OggPacket(const OggPacket& other); /* Don't copy me */
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+#include <string>
+using namespace std;
+#include "StringHelper.h"
+
+class LIBOOOGG_API OggPacket
+{
+public:
+ //Constructors
+ OggPacket(void);
+ OggPacket(unsigned char* inPackData, unsigned long inPacketSize, bool inIsTruncated, bool inIsContinuation);
+ virtual ~OggPacket(void);
+ virtual OggPacket* clone();
+
+ static const unsigned long HEX_DUMP_LINE_LENGTH = 16;
+
+ //Packet accessors
+ unsigned long packetSize() const;
+ unsigned char* packetData();
+ //bool isComplete() const;
+ bool isTruncated() const;
+ bool isContinuation() const;
+
+ //Packet Mutators
+ //void setIsComplete (bool inIsComplete );
+
+ void setIsTruncated(bool inIsTruncated);
+ void setIsContinuation(bool inIsContinuation);
+ void setPacketSize (unsigned long inPacketSize );
+ void setPacketData (unsigned char* inPacketData );
+
+ //Merge function
+ virtual void merge(const OggPacket* inMorePacket);
+
+ //TODO::: Should this be here ?
+ string toPackDumpString();
+
+protected:
+ //Packet member data
+ unsigned long mPacketSize;
+ unsigned char* mPacketData;
+ //bool mIsComplete;
+ bool mIsTruncated;
+ bool mIsContinuation;
+
+ //TODO::Should these be here ?
+ string OggPacket::dumpNCharsToString(unsigned char* inStartPoint, unsigned long inNumChars) ;
+ string OggPacket::padField(string inString, unsigned long inPadWidth, unsigned char inPadChar);
+
+private:
+ OggPacket& operator=(const OggPacket& other); /* Don't assign me */
+ OggPacket(const OggPacket& other); /* Don't copy me */
+
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPacket.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPacketiser.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPacketiser.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPacketiser.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,353 +1,353 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "stdafx.h"
-#include "OggPacketiser.h"
-
-OggPacketiser::OggPacketiser(void)
- : mPacketSink(NULL)
- , mPendingPacket(NULL)
- , mPacketiserState(PKRSTATE_OK)
- , mLooseMode(true) //FIX::: This affects the validator.
- , mNumIgnorePackets(0)
- , mPrevGranPos(0)
- , mCurrentGranPos(0)
-{
- //debugLog.open("g:\\logs\\packetise.log", ios_base::out);
-
-}
-OggPacketiser::OggPacketiser(IStampedOggPacketSink* inPacketSink)
- : mPacketSink(inPacketSink)
- , mPendingPacket(NULL)
- , mPacketiserState(PKRSTATE_OK)
- , mLooseMode(true) //FIX::: This affects the validator.
- , mNumIgnorePackets(0)
- , mPrevGranPos(0)
- , mCurrentGranPos(0)
-{
- //debugLog.open("g:\\logs\\packetise.log", ios_base::out);
-}
-
-OggPacketiser::~OggPacketiser(void)
-{
- //Don't delete the packet sink
- //debugLog.close();
-}
-
-IStampedOggPacketSink* OggPacketiser::packetSink() {
- return mPacketSink;
-}
-void OggPacketiser::setPacketSink(IStampedOggPacketSink* inPacketSink) {
- mPacketSink = inPacketSink;
-}
-bool OggPacketiser::reset() {
- //debugLog<<"Reset : "<<endl;
- delete mPendingPacket;
- mPendingPacket = NULL;
- mNumIgnorePackets = 0;
- mPacketiserState = PKRSTATE_OK;
- mPrevGranPos = 0;
- mCurrentGranPos = 0;
- return true;
-}
-bool OggPacketiser::acceptOggPage(OggPage* inOggPage) { //AOP::: Needs closer look
- //All callers to acceptOggPage give away their pointer
- // to this function. All functions implementing this interface
- // are responsible for deleting this page. All callers
- // should NULL their pointer immediately after calling
- // to avoid reusing them.
- //
-
- //debugLog<<"acceptOggPage : Gran = "<<inOggPage->header()->GranulePos()<<"Num packs = "<<inOggPage->numPackets()<<endl;
-
- //If the page isn't a -1 page and it's got a different granpos save it.
- if ( (inOggPage->header()->GranulePos() != -1) && (inOggPage->header()->GranulePos() != mCurrentGranPos)) {
- mPrevGranPos = mCurrentGranPos;
-
- //If the previous is higher than the
- if (mPrevGranPos > mCurrentGranPos) {
- mPrevGranPos = -1;
- }
- mCurrentGranPos = inOggPage->header()->GranulePos();
- }
-
- //If the page header says its a continuation page...
- if ((inOggPage->header()->HeaderFlags() & 1) == 1) {
- //debugLog<<"acceptOggPage : Page says cont..."<<endl;
- ///... and there is at least 1 packet...
- if (inOggPage->numPackets() > 0) {
- //debugLog<<"acceptOggPage : ...and there is at least 1 packet..."<<endl;
- //... and we were expecting a continuation...
- if (mPacketiserState == PKRSTATE_AWAITING_CONTINUATION) {
- //debugLog<<"acceptOggPage : ... and we were waiting for a cont..."<<endl;
- //... and the first packet is marked as a continuation...
- if (inOggPage->getStampedPacket(0)->isContinuation()) {
- //debugLog<<"acceptOggPage : ... and the first packet is a cont..."<<endl;
- //... merge this packet into our pending page.
- //ASSERT when mPacketiserState = PKRSTATE_AWAITING_CONTINUATION, mPending page != NULL
- mPendingPacket->merge(inOggPage->getStampedPacket(0));
-
- //If even after merging this packet is still truncated...
- if (mPendingPacket->isTruncated()) {
- //debugLog<<"acceptOggPage : ... but the pending packet is still truncated..."<<endl;
- //Packet still not full. special case full page.
- //===
- // The only way the the pending packet can be truncated is if
- // the first packet in the page is truncated, and the first
- // packet in a page can only be truncated if it's also the
- // only packet on the page.
- //Considering it is incomplete ending a page the granule pos
- // will be -1.
- //This is a special type of page :
- // 1 incomlpete packet on the page
- // Continuation flag set
- // No complete packets end on this page
- // Granule pos is -1
-
- //debugLog<<"acceptOggPage : Go to cont state."<<endl;
- //We are still waiting for another continuation...
- mPacketiserState = PKRSTATE_AWAITING_CONTINUATION; //This should be redundant, we should already be in this state.
- //First packet on page is now merged into pending packet.
- } else {
- //debugLog<<"acceptOggPage : ... now we can deliver it..."<<endl;
- //... the pending packet is now complete.
-
- //TODO::: Static alternative here ?
-
- //Deliver the packet to the packet sink...
- if (dispatchStampedOggPacket(mPendingPacket) == false) {
- //debugLog<<"acceptOggPage : DELIVERY FAILED !"<<endl;
- delete inOggPage;
- return false;
- }
- //debugLog<<"acceptOggPage : ... delivery sucessful..."<<endl;
- //debugLog<<"acceptOggPage : Back to OK State..."<<endl;
- //Go back to OK state
- mPacketiserState = PKRSTATE_OK;
- mPendingPacket = NULL;
- //First packet on page is merged and delivered.
- }
- //debugLog<<"acceptOggPage : Send all the other packets besides first and last..."<<endl;
- //Send every packet except the first and last to the packet sink.
- processPage(inOggPage, false, false);
- } else {
- //debugLog<<"acceptOggPage : INTERNAL ERROR - Header says cont but packet doesn't."<<endl;
- //Header flag says continuation but first packet is not continued.
- mPacketiserState = PKRSTATE_INVALID_STREAM;
- delete inOggPage;
- throw 0;
- }
- } else {
- //debugLog<<"acceptOggPage : UNEXPECTED CONT !"<<endl;
- if (mLooseMode == true) {
- //debugLog<<"acceptOggPage : ... but we are ignoring it !"<<endl;
- //Just ignore when we get continuation pages, just drop the broken bit of packet.
-
- mPendingPacket = NULL; //MEMCHECK::: Did i just leak memory ?
- mPacketiserState = PKRSTATE_OK;
-
- //TODO::: Should really return false here if this returns false.
- if( processPage(inOggPage, false, false) == false) {
- //TODO::: State change ???
- delete inOggPage;
- return false;
- }
- } else {
- //debugLog<<"acceptOggPage : FAILURE !!!!"<<endl;
- //Unexpected continuation
- mPacketiserState = PKRSTATE_INVALID_STREAM;
- throw 0;
- }
- }
- } else {
- //debugLog<<"acceptOggPage : UNKNOWN CASE"<<endl;
- //Is this something ?
- //UNKNOWN CASE::: Header continuation flag set, but no packets on page.
- mPacketiserState = PKRSTATE_INVALID_STREAM;
- delete inOggPage;
- throw 0;
- }
- } else {
- //debugLog<<"acceptOggPage : We have a normal page... dumping all but the last..."<<endl;
- //Normal page, no continuations... just dump the packets, except the last one
- if (inOggPage->numPackets() == 1) {
-
- //I think the bug is here... by sending a trunc packet and not updating state.
-
- //debugLog<<"acceptOggPage : Only one packet on this normal page..."<<endl;
-
- if (inOggPage->getPacket(0)->isTruncated()) {
- //debugLog<<"acceptOggPage : ...and it's truncated... so we save it."<<endl;
- //ASSERT : mPending packet is NULL, because this is not a continuation page.
- mPendingPacket = (StampedOggPacket*)inOggPage->getStampedPacket(0)->clone();
- //debugLog<<"acceptOggPage : Moving to CONT state."<<endl;
- mPacketiserState = PKRSTATE_AWAITING_CONTINUATION;
-
- } else {
- //debugLog<<"acceptOggPage : Only one packet on this normal page..."<<endl;
- if (processPage(inOggPage, true, true) == false ) { //If there was only one pack process it.
- //debugLog<<"acceptOggPage : FAIL STATE DELIVERY"<<endl;
- //TODO::: State change
- delete inOggPage;
- return false;
- }
-
- //We should never go into the if below now as the packet is taken care of.
- }
- } else {
- //debugLog<<"acceptOggPage : More than one packet so dumping all but last..."<<endl;
- if (processPage(inOggPage, true, false) == false ) { //If there was only one packet, no packets would be written
- //debugLog<<"acceptOggPage : FAIL STATE DELIVERY"<<endl;
- //TODO::: State change
- delete inOggPage;
- return false;
- }
- }
-
- //The first packet is delivered.
- }
-
- //debugLog<<"acceptOggPage : First pack should be delivered..."<<endl;
- //ASSERT: By this point something has been done with the first packet.
-
- // It was either merged with pending page and possibly delivered
- // or it was delivered by process page.
- //Code following assumes the first packet is dealt with already.
-
- //Now we deal with the last packet...
- //ASSERT : The last packet has only been sent if there was 1 or less packets.
-
- //If there is at least two packet on the page... ie at least one more packet we haven't processed.
- if (inOggPage->numPackets() > 1) {
- //debugLog<<"acceptOggPage : There is at least one packet on the page we haven't processed"<<endl;
- //... and we are in the OK state
- if (mPacketiserState == PKRSTATE_OK) {
- //debugLog<<"acceptOggPage : ... and we are in the OK state..."<<endl;
- //If the last packet is truncated.
- if (inOggPage->getPacket(inOggPage->numPackets() - 1)->isTruncated()) {
- //debugLog<<"acceptOggPage : ... but the last packet is trunced... so we save it and wait for cont..."<<endl;
- //The last packet is truncated. Save it and await continuation.
-
- //debugLog<<"acceptOggPage : Moving to CONT state..."<<endl;
- mPacketiserState = PKRSTATE_AWAITING_CONTINUATION;
-
- //ASSERT when mPacketiserState = OK, mPendingPacket = NULL
- mPendingPacket = (StampedOggPacket*)(inOggPage->getStampedPacket(inOggPage->numPackets() - 1)->clone());
- //This packet is not delivered, it waits for a continuation.
- } else {
- //We are in the OK state, with no pending packets, and the last packet is not truncated.
- //debugLog<<"acceptOggPage : The last page is not trunc so we send it..."<<endl;
- //Deliver to the packet sink.
- if ( dispatchStampedOggPacket( (StampedOggPacket*)(inOggPage->getStampedPacket(inOggPage->numPackets() - 1)->clone()) ) == false ) {
- //debugLog<<"acceptOggPage : Delivery failed..."<<endl;
- //TODO::: State change ?
- delete inOggPage;
- return false;
- }
- //The last packet is complete. So send it.
- }
- } else if (mPacketiserState == PKRSTATE_AWAITING_CONTINUATION) {
- //FIX::: This case should never occur.
- //debugLog<<"acceptOggPage : NEVER BE HERE 1"<<endl;
-
- //Packetiser state is not ok... what to do abo8ut it.
-
- //See special page case above.
- //This can only happen when we went through the special case above, and kept
- // the state in the continuation state. But by definition it is impossible
- // for a subsequent packet on this page to be a continuation packet
- // as continuation packets can only be the first packet on the page.
- //This is more likely to be due to inconsistency of state code than invalidaity
- // of file.
- mPacketiserState = PKRSTATE_INVALID_STREAM;
- delete inOggPage;
- throw 0;
- } else {
- //debugLog<<"acceptOggPage : NEVER BE HERE 2"<<endl;
- //Shouldn't be here
- mPacketiserState = PKRSTATE_INVALID_STREAM;
- delete inOggPage;
- throw 0;
- }
- } else {
- //debugLog<<"acceptOggPage : 1 packet on page only, and we've taken care of it."<<endl;
- //Zero packets on page.
- }
- //debugLog<<"acceptOggPage : All ok... returning..."<<endl<<endl;
- delete inOggPage;
- return true;
-}
-
-bool OggPacketiser::processPage(OggPage* inOggPage, bool inIncludeFirst, bool inIncludeLast) {
- //Returns false only if one of the acceptStampedOggPacket calls return false... means we should stop sending stuff and return.
- bool locIsOK = true;
- //debugLog<<"processPage : "<<endl;
- //Adjusts the loop parameters so that only packets excluding those specified are written.
- for ( int i = ((inIncludeFirst) ? 0 : 1);
- i < ((int)inOggPage->numPackets()) - ((inIncludeLast) ? 0 : 1);
- i++)
- {
- //debugLog<<"processPage : Packet "<< i <<endl;
- locIsOK = (locIsOK && dispatchStampedOggPacket((StampedOggPacket*)inOggPage->getStampedPacket(i)->clone())); //Gives away new packet.
- if (!locIsOK) {
- //debugLog<<"processPage : FAIL STATE"<<endl;
- //TODO::: State change ???
- return false;
- }
- }
- //debugLog<<"processPage : returning..."<<endl;
- return true;
-
-}
-
-bool OggPacketiser::dispatchStampedOggPacket(StampedOggPacket* inPacket) { //Accepts packet... and gives it away or deletes it.
- if (mNumIgnorePackets > 0) {
- //Ignore this packet.
- mNumIgnorePackets--;
-
- //MEMCHECK::: Should probably delete this packet here.]
- delete inPacket;
- return true;
- } else {
- //Modify the header packet to include the gran pos of previous page.
- if (mPrevGranPos != -1) {
- inPacket->setTimeStamp(mPrevGranPos, mCurrentGranPos, StampedOggPacket::OGG_BOTH);
- }
- //Dispatch it.
- return mPacketSink->acceptStampedOggPacket(inPacket);
- }
-}
-
-void OggPacketiser::setNumIgnorePackets(unsigned long inNumIgnorePackets) {
- mNumIgnorePackets = inNumIgnorePackets;
-}
-unsigned long OggPacketiser::numIgnorePackets() {
- return mNumIgnorePackets;
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "stdafx.h"
+#include "OggPacketiser.h"
+
+OggPacketiser::OggPacketiser(void)
+ : mPacketSink(NULL)
+ , mPendingPacket(NULL)
+ , mPacketiserState(PKRSTATE_OK)
+ , mLooseMode(true) //FIX::: This affects the validator.
+ , mNumIgnorePackets(0)
+ , mPrevGranPos(0)
+ , mCurrentGranPos(0)
+{
+ //debugLog.open("g:\\logs\\packetise.log", ios_base::out);
+
+}
+OggPacketiser::OggPacketiser(IStampedOggPacketSink* inPacketSink)
+ : mPacketSink(inPacketSink)
+ , mPendingPacket(NULL)
+ , mPacketiserState(PKRSTATE_OK)
+ , mLooseMode(true) //FIX::: This affects the validator.
+ , mNumIgnorePackets(0)
+ , mPrevGranPos(0)
+ , mCurrentGranPos(0)
+{
+ //debugLog.open("g:\\logs\\packetise.log", ios_base::out);
+}
+
+OggPacketiser::~OggPacketiser(void)
+{
+ //Don't delete the packet sink
+ //debugLog.close();
+}
+
+IStampedOggPacketSink* OggPacketiser::packetSink() {
+ return mPacketSink;
+}
+void OggPacketiser::setPacketSink(IStampedOggPacketSink* inPacketSink) {
+ mPacketSink = inPacketSink;
+}
+bool OggPacketiser::reset() {
+ //debugLog<<"Reset : "<<endl;
+ delete mPendingPacket;
+ mPendingPacket = NULL;
+ mNumIgnorePackets = 0;
+ mPacketiserState = PKRSTATE_OK;
+ mPrevGranPos = 0;
+ mCurrentGranPos = 0;
+ return true;
+}
+bool OggPacketiser::acceptOggPage(OggPage* inOggPage) { //AOP::: Needs closer look
+ //All callers to acceptOggPage give away their pointer
+ // to this function. All functions implementing this interface
+ // are responsible for deleting this page. All callers
+ // should NULL their pointer immediately after calling
+ // to avoid reusing them.
+ //
+
+ //debugLog<<"acceptOggPage : Gran = "<<inOggPage->header()->GranulePos()<<"Num packs = "<<inOggPage->numPackets()<<endl;
+
+ //If the page isn't a -1 page and it's got a different granpos save it.
+ if ( (inOggPage->header()->GranulePos() != -1) && (inOggPage->header()->GranulePos() != mCurrentGranPos)) {
+ mPrevGranPos = mCurrentGranPos;
+
+ //If the previous is higher than the
+ if (mPrevGranPos > mCurrentGranPos) {
+ mPrevGranPos = -1;
+ }
+ mCurrentGranPos = inOggPage->header()->GranulePos();
+ }
+
+ //If the page header says its a continuation page...
+ if ((inOggPage->header()->HeaderFlags() & 1) == 1) {
+ //debugLog<<"acceptOggPage : Page says cont..."<<endl;
+ ///... and there is at least 1 packet...
+ if (inOggPage->numPackets() > 0) {
+ //debugLog<<"acceptOggPage : ...and there is at least 1 packet..."<<endl;
+ //... and we were expecting a continuation...
+ if (mPacketiserState == PKRSTATE_AWAITING_CONTINUATION) {
+ //debugLog<<"acceptOggPage : ... and we were waiting for a cont..."<<endl;
+ //... and the first packet is marked as a continuation...
+ if (inOggPage->getStampedPacket(0)->isContinuation()) {
+ //debugLog<<"acceptOggPage : ... and the first packet is a cont..."<<endl;
+ //... merge this packet into our pending page.
+ //ASSERT when mPacketiserState = PKRSTATE_AWAITING_CONTINUATION, mPending page != NULL
+ mPendingPacket->merge(inOggPage->getStampedPacket(0));
+
+ //If even after merging this packet is still truncated...
+ if (mPendingPacket->isTruncated()) {
+ //debugLog<<"acceptOggPage : ... but the pending packet is still truncated..."<<endl;
+ //Packet still not full. special case full page.
+ //===
+ // The only way the the pending packet can be truncated is if
+ // the first packet in the page is truncated, and the first
+ // packet in a page can only be truncated if it's also the
+ // only packet on the page.
+ //Considering it is incomplete ending a page the granule pos
+ // will be -1.
+ //This is a special type of page :
+ // 1 incomlpete packet on the page
+ // Continuation flag set
+ // No complete packets end on this page
+ // Granule pos is -1
+
+ //debugLog<<"acceptOggPage : Go to cont state."<<endl;
+ //We are still waiting for another continuation...
+ mPacketiserState = PKRSTATE_AWAITING_CONTINUATION; //This should be redundant, we should already be in this state.
+ //First packet on page is now merged into pending packet.
+ } else {
+ //debugLog<<"acceptOggPage : ... now we can deliver it..."<<endl;
+ //... the pending packet is now complete.
+
+ //TODO::: Static alternative here ?
+
+ //Deliver the packet to the packet sink...
+ if (dispatchStampedOggPacket(mPendingPacket) == false) {
+ //debugLog<<"acceptOggPage : DELIVERY FAILED !"<<endl;
+ delete inOggPage;
+ return false;
+ }
+ //debugLog<<"acceptOggPage : ... delivery sucessful..."<<endl;
+ //debugLog<<"acceptOggPage : Back to OK State..."<<endl;
+ //Go back to OK state
+ mPacketiserState = PKRSTATE_OK;
+ mPendingPacket = NULL;
+ //First packet on page is merged and delivered.
+ }
+ //debugLog<<"acceptOggPage : Send all the other packets besides first and last..."<<endl;
+ //Send every packet except the first and last to the packet sink.
+ processPage(inOggPage, false, false);
+ } else {
+ //debugLog<<"acceptOggPage : INTERNAL ERROR - Header says cont but packet doesn't."<<endl;
+ //Header flag says continuation but first packet is not continued.
+ mPacketiserState = PKRSTATE_INVALID_STREAM;
+ delete inOggPage;
+ throw 0;
+ }
+ } else {
+ //debugLog<<"acceptOggPage : UNEXPECTED CONT !"<<endl;
+ if (mLooseMode == true) {
+ //debugLog<<"acceptOggPage : ... but we are ignoring it !"<<endl;
+ //Just ignore when we get continuation pages, just drop the broken bit of packet.
+
+ mPendingPacket = NULL; //MEMCHECK::: Did i just leak memory ?
+ mPacketiserState = PKRSTATE_OK;
+
+ //TODO::: Should really return false here if this returns false.
+ if( processPage(inOggPage, false, false) == false) {
+ //TODO::: State change ???
+ delete inOggPage;
+ return false;
+ }
+ } else {
+ //debugLog<<"acceptOggPage : FAILURE !!!!"<<endl;
+ //Unexpected continuation
+ mPacketiserState = PKRSTATE_INVALID_STREAM;
+ throw 0;
+ }
+ }
+ } else {
+ //debugLog<<"acceptOggPage : UNKNOWN CASE"<<endl;
+ //Is this something ?
+ //UNKNOWN CASE::: Header continuation flag set, but no packets on page.
+ mPacketiserState = PKRSTATE_INVALID_STREAM;
+ delete inOggPage;
+ throw 0;
+ }
+ } else {
+ //debugLog<<"acceptOggPage : We have a normal page... dumping all but the last..."<<endl;
+ //Normal page, no continuations... just dump the packets, except the last one
+ if (inOggPage->numPackets() == 1) {
+
+ //I think the bug is here... by sending a trunc packet and not updating state.
+
+ //debugLog<<"acceptOggPage : Only one packet on this normal page..."<<endl;
+
+ if (inOggPage->getPacket(0)->isTruncated()) {
+ //debugLog<<"acceptOggPage : ...and it's truncated... so we save it."<<endl;
+ //ASSERT : mPending packet is NULL, because this is not a continuation page.
+ mPendingPacket = (StampedOggPacket*)inOggPage->getStampedPacket(0)->clone();
+ //debugLog<<"acceptOggPage : Moving to CONT state."<<endl;
+ mPacketiserState = PKRSTATE_AWAITING_CONTINUATION;
+
+ } else {
+ //debugLog<<"acceptOggPage : Only one packet on this normal page..."<<endl;
+ if (processPage(inOggPage, true, true) == false ) { //If there was only one pack process it.
+ //debugLog<<"acceptOggPage : FAIL STATE DELIVERY"<<endl;
+ //TODO::: State change
+ delete inOggPage;
+ return false;
+ }
+
+ //We should never go into the if below now as the packet is taken care of.
+ }
+ } else {
+ //debugLog<<"acceptOggPage : More than one packet so dumping all but last..."<<endl;
+ if (processPage(inOggPage, true, false) == false ) { //If there was only one packet, no packets would be written
+ //debugLog<<"acceptOggPage : FAIL STATE DELIVERY"<<endl;
+ //TODO::: State change
+ delete inOggPage;
+ return false;
+ }
+ }
+
+ //The first packet is delivered.
+ }
+
+ //debugLog<<"acceptOggPage : First pack should be delivered..."<<endl;
+ //ASSERT: By this point something has been done with the first packet.
+
+ // It was either merged with pending page and possibly delivered
+ // or it was delivered by process page.
+ //Code following assumes the first packet is dealt with already.
+
+ //Now we deal with the last packet...
+ //ASSERT : The last packet has only been sent if there was 1 or less packets.
+
+ //If there is at least two packet on the page... ie at least one more packet we haven't processed.
+ if (inOggPage->numPackets() > 1) {
+ //debugLog<<"acceptOggPage : There is at least one packet on the page we haven't processed"<<endl;
+ //... and we are in the OK state
+ if (mPacketiserState == PKRSTATE_OK) {
+ //debugLog<<"acceptOggPage : ... and we are in the OK state..."<<endl;
+ //If the last packet is truncated.
+ if (inOggPage->getPacket(inOggPage->numPackets() - 1)->isTruncated()) {
+ //debugLog<<"acceptOggPage : ... but the last packet is trunced... so we save it and wait for cont..."<<endl;
+ //The last packet is truncated. Save it and await continuation.
+
+ //debugLog<<"acceptOggPage : Moving to CONT state..."<<endl;
+ mPacketiserState = PKRSTATE_AWAITING_CONTINUATION;
+
+ //ASSERT when mPacketiserState = OK, mPendingPacket = NULL
+ mPendingPacket = (StampedOggPacket*)(inOggPage->getStampedPacket(inOggPage->numPackets() - 1)->clone());
+ //This packet is not delivered, it waits for a continuation.
+ } else {
+ //We are in the OK state, with no pending packets, and the last packet is not truncated.
+ //debugLog<<"acceptOggPage : The last page is not trunc so we send it..."<<endl;
+ //Deliver to the packet sink.
+ if ( dispatchStampedOggPacket( (StampedOggPacket*)(inOggPage->getStampedPacket(inOggPage->numPackets() - 1)->clone()) ) == false ) {
+ //debugLog<<"acceptOggPage : Delivery failed..."<<endl;
+ //TODO::: State change ?
+ delete inOggPage;
+ return false;
+ }
+ //The last packet is complete. So send it.
+ }
+ } else if (mPacketiserState == PKRSTATE_AWAITING_CONTINUATION) {
+ //FIX::: This case should never occur.
+ //debugLog<<"acceptOggPage : NEVER BE HERE 1"<<endl;
+
+ //Packetiser state is not ok... what to do abo8ut it.
+
+ //See special page case above.
+ //This can only happen when we went through the special case above, and kept
+ // the state in the continuation state. But by definition it is impossible
+ // for a subsequent packet on this page to be a continuation packet
+ // as continuation packets can only be the first packet on the page.
+ //This is more likely to be due to inconsistency of state code than invalidaity
+ // of file.
+ mPacketiserState = PKRSTATE_INVALID_STREAM;
+ delete inOggPage;
+ throw 0;
+ } else {
+ //debugLog<<"acceptOggPage : NEVER BE HERE 2"<<endl;
+ //Shouldn't be here
+ mPacketiserState = PKRSTATE_INVALID_STREAM;
+ delete inOggPage;
+ throw 0;
+ }
+ } else {
+ //debugLog<<"acceptOggPage : 1 packet on page only, and we've taken care of it."<<endl;
+ //Zero packets on page.
+ }
+ //debugLog<<"acceptOggPage : All ok... returning..."<<endl<<endl;
+ delete inOggPage;
+ return true;
+}
+
+bool OggPacketiser::processPage(OggPage* inOggPage, bool inIncludeFirst, bool inIncludeLast) {
+ //Returns false only if one of the acceptStampedOggPacket calls return false... means we should stop sending stuff and return.
+ bool locIsOK = true;
+ //debugLog<<"processPage : "<<endl;
+ //Adjusts the loop parameters so that only packets excluding those specified are written.
+ for ( int i = ((inIncludeFirst) ? 0 : 1);
+ i < ((int)inOggPage->numPackets()) - ((inIncludeLast) ? 0 : 1);
+ i++)
+ {
+ //debugLog<<"processPage : Packet "<< i <<endl;
+ locIsOK = (locIsOK && dispatchStampedOggPacket((StampedOggPacket*)inOggPage->getStampedPacket(i)->clone())); //Gives away new packet.
+ if (!locIsOK) {
+ //debugLog<<"processPage : FAIL STATE"<<endl;
+ //TODO::: State change ???
+ return false;
+ }
+ }
+ //debugLog<<"processPage : returning..."<<endl;
+ return true;
+
+}
+
+bool OggPacketiser::dispatchStampedOggPacket(StampedOggPacket* inPacket) { //Accepts packet... and gives it away or deletes it.
+ if (mNumIgnorePackets > 0) {
+ //Ignore this packet.
+ mNumIgnorePackets--;
+
+ //MEMCHECK::: Should probably delete this packet here.]
+ delete inPacket;
+ return true;
+ } else {
+ //Modify the header packet to include the gran pos of previous page.
+ if (mPrevGranPos != -1) {
+ inPacket->setTimeStamp(mPrevGranPos, mCurrentGranPos, StampedOggPacket::OGG_BOTH);
+ }
+ //Dispatch it.
+ return mPacketSink->acceptStampedOggPacket(inPacket);
+ }
+}
+
+void OggPacketiser::setNumIgnorePackets(unsigned long inNumIgnorePackets) {
+ mNumIgnorePackets = inNumIgnorePackets;
+}
+unsigned long OggPacketiser::numIgnorePackets() {
+ return mNumIgnorePackets;
+}
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPacketiser.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPacketiser.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPacketiser.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPacketiser.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,89 +1,89 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include "IOggCallback.h"
-#include "IStampedOggPacketSink.h"
-#include "OggPage.h"
-
-//Debug only
-#include <fstream>
-using namespace std;
-//
-
-//TODO::: Loose mode controls
-class LIBOOOGG_API OggPacketiser
- : public IOggCallback
-{
-public:
- //Constants
- enum ePacketiserState {
- PKRSTATE_OK,
- PKRSTATE_AWAITING_CONTINUATION,
- PKRSTATE_INVALID_STREAM
- };
-
- //Constructors
- OggPacketiser(void);
- OggPacketiser(IStampedOggPacketSink* inPacketSink);
- virtual ~OggPacketiser(void);
-
- //IOggCallback implementation
- virtual bool acceptOggPage(OggPage* inOggPage);
-
- //Packet sink control
- void setPacketSink(IStampedOggPacketSink* inPacketSink);
- IStampedOggPacketSink* packetSink();
-
- //Ignore packets controls.
- void setNumIgnorePackets(unsigned long inNumIgnorePackets);
- unsigned long numIgnorePackets();
-
- //Packetiser state control
- bool reset();
-
-protected:
- IStampedOggPacketSink* mPacketSink;
- StampedOggPacket* mPendingPacket;
-
- virtual bool dispatchStampedOggPacket(StampedOggPacket* inPacket);
-
- bool mLooseMode;
- unsigned long mNumIgnorePackets;
- LOOG_INT64 mPrevGranPos;
- LOOG_INT64 mCurrentGranPos;
- bool processPage(OggPage* inOggPage, bool inIncludeFirst, bool inIncludeLast);
- ePacketiserState mPacketiserState;
-
- //fstream debugLog;
-private:
- OggPacketiser& operator=(const OggPacketiser& other); /* Don't assign me */
- OggPacketiser(const OggPacketiser& other); /* Don't copy me */
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+#include "IOggCallback.h"
+#include "IStampedOggPacketSink.h"
+#include "OggPage.h"
+
+//Debug only
+#include <fstream>
+using namespace std;
+//
+
+//TODO::: Loose mode controls
+class LIBOOOGG_API OggPacketiser
+ : public IOggCallback
+{
+public:
+ //Constants
+ enum ePacketiserState {
+ PKRSTATE_OK,
+ PKRSTATE_AWAITING_CONTINUATION,
+ PKRSTATE_INVALID_STREAM
+ };
+
+ //Constructors
+ OggPacketiser(void);
+ OggPacketiser(IStampedOggPacketSink* inPacketSink);
+ virtual ~OggPacketiser(void);
+
+ //IOggCallback implementation
+ virtual bool acceptOggPage(OggPage* inOggPage);
+
+ //Packet sink control
+ void setPacketSink(IStampedOggPacketSink* inPacketSink);
+ IStampedOggPacketSink* packetSink();
+
+ //Ignore packets controls.
+ void setNumIgnorePackets(unsigned long inNumIgnorePackets);
+ unsigned long numIgnorePackets();
+
+ //Packetiser state control
+ bool reset();
+
+protected:
+ IStampedOggPacketSink* mPacketSink;
+ StampedOggPacket* mPendingPacket;
+
+ virtual bool dispatchStampedOggPacket(StampedOggPacket* inPacket);
+
+ bool mLooseMode;
+ unsigned long mNumIgnorePackets;
+ LOOG_INT64 mPrevGranPos;
+ LOOG_INT64 mCurrentGranPos;
+ bool processPage(OggPage* inOggPage, bool inIncludeFirst, bool inIncludeLast);
+ ePacketiserState mPacketiserState;
+
+ //fstream debugLog;
+private:
+ OggPacketiser& operator=(const OggPacketiser& other); /* Don't assign me */
+ OggPacketiser(const OggPacketiser& other); /* Don't copy me */
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPacketiser.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPage.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPage.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPage.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,122 +1,122 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "stdafx.h"
-#include "OggPage.h"
-//LEACK CHECKED::: 20041018 - OK.
-OggPage::OggPage(void)
-{
- mHeader = new OggPageHeader; //Deleted in destructor.
-
-
-}
-OggPage::~OggPage(void)
-{
- delete mHeader;
- for (unsigned long i = 0; i < mPacketList.size(); i++) {
- delete mPacketList[i];
- }
-}
-
-//Retusn a view on the header only
-OggPageHeader* OggPage::header() {
- return mHeader;
-}
-
-//returns a view on the packet only.
-OggPacket* OggPage::getPacket(unsigned long inPacketNo) {
- if (inPacketNo < numPackets()) {
- return mPacketList[inPacketNo];
- } else {
- return NULL;
- }
-}
-//Returns a view on the packet only
-StampedOggPacket* OggPage::getStampedPacket(unsigned long inPacketNo) {
- if (inPacketNo < numPackets()) {
- return mPacketList[inPacketNo];
- } else {
- return NULL;
- }
-}
-
-//Gives away a pointer to the caller.
-OggPage* OggPage::clone() {
- OggPage* retClone = new OggPage;
- retClone->mHeader = mHeader->clone();
- for (size_t i = 0; i < mPacketList.size(); i++) {
- retClone->mPacketList.push_back((StampedOggPacket*)mPacketList[i]->clone()); //The cloned new packet is deleted in the destructor
- }
-
- return retClone;
-}
-
-unsigned long OggPage::numPackets() {
- return (unsigned long)mPacketList.size();
-}
-
-//Gives a pointer to the caller, it must delete it.
-unsigned char* OggPage::createRawPageData() {
- unsigned char* locPage = new unsigned char[mHeader->pageSize()]; //Given to the caller
- mHeader->rawData(locPage, mHeader->pageSize());
-
- unsigned long locOffset = mHeader->headerSize();
- for (size_t i = 0; i < mPacketList.size(); i++) {
- OggPacket* locPack = mPacketList[i];
- memcpy((void*)(locPage + locOffset), (const void*)(locPack->packetData()), locPack->packetSize());
- locOffset += locPack->packetSize();
- }
- return locPage;
-}
-
-bool OggPage::addPacket(StampedOggPacket* inPacket) {
- if (inPacket != NULL) {
- mPacketList.push_back(inPacket);
- return true;
- } else {
- return false;
- }
-}
-
-
-
-unsigned long OggPage::pageSize()
-{
- return mHeader->pageSize();
-}
-unsigned long OggPage::headerSize()
-{
- return mHeader->headerSize();
-}
-unsigned long OggPage::dataSize()
-{
- return mHeader->dataSize();
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "stdafx.h"
+#include "OggPage.h"
+//LEACK CHECKED::: 20041018 - OK.
+OggPage::OggPage(void)
+{
+ mHeader = new OggPageHeader; //Deleted in destructor.
+
+
+}
+OggPage::~OggPage(void)
+{
+ delete mHeader;
+ for (unsigned long i = 0; i < mPacketList.size(); i++) {
+ delete mPacketList[i];
+ }
+}
+
+//Retusn a view on the header only
+OggPageHeader* OggPage::header() {
+ return mHeader;
+}
+
+//returns a view on the packet only.
+OggPacket* OggPage::getPacket(unsigned long inPacketNo) {
+ if (inPacketNo < numPackets()) {
+ return mPacketList[inPacketNo];
+ } else {
+ return NULL;
+ }
+}
+//Returns a view on the packet only
+StampedOggPacket* OggPage::getStampedPacket(unsigned long inPacketNo) {
+ if (inPacketNo < numPackets()) {
+ return mPacketList[inPacketNo];
+ } else {
+ return NULL;
+ }
+}
+
+//Gives away a pointer to the caller.
+OggPage* OggPage::clone() {
+ OggPage* retClone = new OggPage;
+ retClone->mHeader = mHeader->clone();
+ for (size_t i = 0; i < mPacketList.size(); i++) {
+ retClone->mPacketList.push_back((StampedOggPacket*)mPacketList[i]->clone()); //The cloned new packet is deleted in the destructor
+ }
+
+ return retClone;
+}
+
+unsigned long OggPage::numPackets() {
+ return (unsigned long)mPacketList.size();
+}
+
+//Gives a pointer to the caller, it must delete it.
+unsigned char* OggPage::createRawPageData() {
+ unsigned char* locPage = new unsigned char[mHeader->pageSize()]; //Given to the caller
+ mHeader->rawData(locPage, mHeader->pageSize());
+
+ unsigned long locOffset = mHeader->headerSize();
+ for (size_t i = 0; i < mPacketList.size(); i++) {
+ OggPacket* locPack = mPacketList[i];
+ memcpy((void*)(locPage + locOffset), (const void*)(locPack->packetData()), locPack->packetSize());
+ locOffset += locPack->packetSize();
+ }
+ return locPage;
+}
+
+bool OggPage::addPacket(StampedOggPacket* inPacket) {
+ if (inPacket != NULL) {
+ mPacketList.push_back(inPacket);
+ return true;
+ } else {
+ return false;
+ }
+}
+
+
+
+unsigned long OggPage::pageSize()
+{
+ return mHeader->pageSize();
+}
+unsigned long OggPage::headerSize()
+{
+ return mHeader->headerSize();
+}
+unsigned long OggPage::dataSize()
+{
+ return mHeader->dataSize();
+}
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPage.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPage.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPage.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPage.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,85 +1,85 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-//STL Includes
-#include <vector>
-using namespace std;
-
-//Class Includes
-#include "StampedOggPacket.h"
-#include "OggPageHeader.h"
-#include "IOggPackSource.h"
-
-//OggPage represents an Ogg Encapsulation Format page
-class LIBOOOGG_API OggPage
- : public IOggPackSource
-{
-public:
- //Constants
- static const unsigned long HEX_DUMP_LINE_LENGTH = 16;
-
- //Constructors
- OggPage(void);
- virtual ~OggPage(void);
-
- //Cloning
- OggPage* clone();
-
- //Size functions
- unsigned long pageSize();
- unsigned long headerSize();
- unsigned long dataSize();
-
- //IOggPackSource Implementation
- virtual OggPacket* getPacket(unsigned long inPacketNo);
- virtual unsigned long numPackets();
-
- //Packet access
- StampedOggPacket* getStampedPacket(unsigned long inPacketNo);
- bool addPacket(StampedOggPacket* inPacket);
-
- //Header access
- OggPageHeader* header();
-
- //Serialise
- unsigned char* createRawPageData();
-
-protected:
- //Member data of packets and header.
- vector<StampedOggPacket*> mPacketList;
- OggPageHeader* mHeader;
-
-private:
- OggPage& operator=(const OggPage& other); /* Don't assign me */
- OggPage(const OggPage& other); /* Don't copy me */
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+//STL Includes
+#include <vector>
+using namespace std;
+
+//Class Includes
+#include "StampedOggPacket.h"
+#include "OggPageHeader.h"
+#include "IOggPackSource.h"
+
+//OggPage represents an Ogg Encapsulation Format page
+class LIBOOOGG_API OggPage
+ : public IOggPackSource
+{
+public:
+ //Constants
+ static const unsigned long HEX_DUMP_LINE_LENGTH = 16;
+
+ //Constructors
+ OggPage(void);
+ virtual ~OggPage(void);
+
+ //Cloning
+ OggPage* clone();
+
+ //Size functions
+ unsigned long pageSize();
+ unsigned long headerSize();
+ unsigned long dataSize();
+
+ //IOggPackSource Implementation
+ virtual OggPacket* getPacket(unsigned long inPacketNo);
+ virtual unsigned long numPackets();
+
+ //Packet access
+ StampedOggPacket* getStampedPacket(unsigned long inPacketNo);
+ bool addPacket(StampedOggPacket* inPacket);
+
+ //Header access
+ OggPageHeader* header();
+
+ //Serialise
+ unsigned char* createRawPageData();
+
+protected:
+ //Member data of packets and header.
+ vector<StampedOggPacket*> mPacketList;
+ OggPageHeader* mHeader;
+
+private:
+ OggPage& operator=(const OggPage& other); /* Don't assign me */
+ OggPage(const OggPage& other); /* Don't copy me */
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPage.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageHeader.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageHeader.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageHeader.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,368 +1,368 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "stdafx.h"
-#include "OggPageHeader.h"
-
-
-OggPageHeader::OggPageHeader(void)
- : mPageSize(0)
- , mHeaderSize(0)
- , mDataSize(0)
- , mStructureVersion(0)
- , mHeaderFlags(0)
- , mStreamSerialNo(0)
- , mPageSequenceNo(0)
- , mCRCChecksum(0)
- , mPageState(BLANK)
- , mGranulePos(0)
- , mSegmentTable(NULL)
- , mNumPageSegments(0)
-
-{
-
-}
-
-OggPageHeader::~OggPageHeader(void)
-{
- delete[] mSegmentTable;
-}
-
-//Gives a pointer to the caller.
-OggPageHeader* OggPageHeader::clone() {
-
- OggPageHeader* retClone = new OggPageHeader();
- retClone->mCRCChecksum = mCRCChecksum;
- retClone->mDataSize = mDataSize;
- retClone->mGranulePos = mGranulePos;
- retClone->mHeaderFlags = mHeaderFlags;
- retClone->mHeaderSize = mHeaderSize;
- retClone->mNumPageSegments = mNumPageSegments;
- retClone->mPageSequenceNo = mPageSequenceNo;
- retClone->mPageSize = mPageSize;
- retClone->mPageState = mPageState;
- retClone->mStreamSerialNo = mStreamSerialNo;
- retClone->mStructureVersion = mStructureVersion;
-
- //Copy the segment table.
- unsigned char* locBuff = new unsigned char[mNumPageSegments]; //Stored in the returned classes member variable, deleted in it's destructor
- memcpy((void*)locBuff, (const void*)mSegmentTable, mNumPageSegments);
- retClone->mSegmentTable = locBuff;
- locBuff = NULL; //Given away.
- //
-
- return retClone;
-}
-
-
-unsigned long OggPageHeader::calculateDataSize() {
- //Sums the bytes in the segment table to calculate the size of data.
- //FIX::: ??? No checks on pointers.
-
- unsigned long retDataSize = 0;
- for (int i = 0; i < mNumPageSegments; i++) {
- retDataSize += mSegmentTable[i];
- }
-
- setDataSize(retDataSize);
- return retDataSize;
-}
-//Views pointer data only
-bool OggPageHeader::setBaseHeader(const unsigned char* inBaseHeader) {
- //This now does not delete the buffer
-
- unsigned long locOffset = 0;
-
- //Check if the page has the correct capture pattern
- if (strncmp((const char*)inBaseHeader, "OggS", OGG_CAPTURE_PATTERN_SIZE) == 0) {
- mStructureVersion = inBaseHeader[STRUCTURE_VERSION];
- mHeaderFlags = inBaseHeader[HEADER_FLAGS];
- mGranulePos = iLE_Math::CharArrToInt64(inBaseHeader + GRANULE_POS);
- mStreamSerialNo = iLE_Math::charArrToULong(inBaseHeader + SERIAL_NO);
- mCRCChecksum = iLE_Math::charArrToULong(inBaseHeader + OGG_CHECKSUM);
- mNumPageSegments = inBaseHeader[NUM_SEGMENTS];
- mHeaderSize = OGG_BASE_HEADER_SIZE + mNumPageSegments;
-
- mPageSize = mHeaderSize + mDataSize;
- mPageState = BASE_HEAD_SET;
- return true;
- } else {
- return false;
- }
-
- ////Assign the structure version
- //setStructureVersion(inBaseHeader[locOffset]);
- //locOffset++;
-
- ////Assign the header flags
- //setHeaderFlags(inBaseHeader[locOffset]);
- //locOffset++;
-
- ////Assign the granule pos
- //setGranulePos((const unsigned char*)(inBaseHeader + locOffset));
- //locOffset += 8;
-
- ////Assign Serial No
- //setStreamSerialNo((const unsigned char*)(inBaseHeader + locOffset));
- //locOffset += 4;
-
- ////Assign Page Seq No
- //setPageSequenceNo(inBaseHeader + locOffset);
- //locOffset += 4;
-
- ////Assign CheckSum
- //setCRCChecksum(inBaseHeader + locOffset);
- //locOffset += 4;
-
- ////Assign Num Page Segments
- //setNumPageSegments(inBaseHeader[locOffset]);
- //locOffset++;
-
- ////Set the size of the header
- //setHeaderSize(OGG_BASE_HEADER_SIZE + mNumPageSegments);
-
- //mPageState = BASE_HEAD_SET;
-
-
-
-
-}
-
-
-void OggPageHeader::setPageState(ePageState inPageState)
-{
- mPageState = inPageState;
-}
-unsigned char OggPageHeader::StructureVersion()
-{
- return mStructureVersion;
-}
-
-unsigned char OggPageHeader::HeaderFlags()
-{
- return mHeaderFlags;
-}
-
-LOOG_INT64 OggPageHeader::GranulePos()
-{
- return mGranulePos;
-}
-
-unsigned long OggPageHeader::StreamSerialNo()
-{
- return mStreamSerialNo;
-}
-unsigned long OggPageHeader::PageSequenceNo()
-{
- return mPageSequenceNo;
-}
-unsigned long OggPageHeader::CRCChecksum()
-{
- return mCRCChecksum;
-}
-
-unsigned char OggPageHeader::NumPageSegments()
-{
- return mNumPageSegments;
-}
-unsigned char* OggPageHeader::SegmentTable()
-{
- return mSegmentTable;
-}
-
-
-
-void OggPageHeader::setStructureVersion(unsigned char inVal)
-{
- mStructureVersion = inVal;
-}
-
-void OggPageHeader::setHeaderFlags(unsigned char inVal)
-{
- mHeaderFlags = inVal;
-}
-
-void OggPageHeader::setGranulePos(LOOG_INT64 inGranulePos)
-{
- mGranulePos = inGranulePos;
-}
-void OggPageHeader::setGranulePos(const unsigned char* inPtr)
-{
- mGranulePos = iLE_Math::CharArrToInt64(inPtr);
-}
-
-void OggPageHeader::setStreamSerialNo(unsigned long inVal)
-{
- mStreamSerialNo = inVal;
-}
-void OggPageHeader::setStreamSerialNo(const unsigned char* inPtr)
-{
- mStreamSerialNo = iLE_Math::charArrToULong(inPtr);
-}
-void OggPageHeader::setPageSequenceNo(unsigned long inVal)
-{
- mPageSequenceNo = inVal;
-}
-void OggPageHeader::setPageSequenceNo(const unsigned char* inPtr)
-{
- mPageSequenceNo = iLE_Math::charArrToULong(inPtr);;
-}
-void OggPageHeader::setCRCChecksum(unsigned long inVal)
-{
- mCRCChecksum = inVal;
-}
-void OggPageHeader::setCRCChecksum(const unsigned char* inPtr)
-{
- mCRCChecksum = iLE_Math::charArrToULong(inPtr);;
-}
-
-void OggPageHeader::setNumPageSegments(unsigned char inVal)
-{
- if (mSegmentTable == NULL) {
- mNumPageSegments = inVal;
- }
-}
-///
-// Copies the data from the pointer it is given.
-//
-void OggPageHeader::setSegmentTable(const unsigned char* inPtr, unsigned char inNumSegs)
-{
- unsigned char* locSegTable = new unsigned char[inNumSegs]; //This is stored in the member variable and deleted in the destructor.
- memcpy((void*)locSegTable, (const void*)inPtr, inNumSegs);
- delete[] mSegmentTable;
- mSegmentTable = locSegTable;
- mNumPageSegments = inNumSegs;
- setHeaderSize(OggPageHeader::OGG_BASE_HEADER_SIZE + inNumSegs);
-}
-void OggPageHeader::setSegmentTable(unsigned char* inPtr) {
- delete[] mSegmentTable;
- mSegmentTable = inPtr;
-
-}
-
-OggPageHeader::ePageState OggPageHeader::pageState() {
- return mPageState;
-}
-unsigned long OggPageHeader::pageSize()
-{
- return mPageSize;
-}
-unsigned long OggPageHeader::headerSize()
-{
- return mHeaderSize;
-}
-unsigned long OggPageHeader::dataSize()
-{
- return mDataSize;
-}
-bool OggPageHeader::rawData(unsigned char* outData, unsigned long inBuffSize) {
-
- //0-3 CapPattern "OggS"
- //4 Struct Ver
- //5 Head Flags
- //6-13 Granule Pos
- //14-17 Stream Serial No
- //18-21 Page Seq No
- //22-25 CheckSum
- //26 Num Segments
- //27... SegmentTable
- //
-
- if (mHeaderSize > inBuffSize) {
- return false;
- }
- outData[0] = 'O';
- outData[1] = 'g';
- outData[2] = 'g';
- outData[3] = 'S';
- outData[4] = mStructureVersion;
- outData[5] = mHeaderFlags;
- iLE_Math::Int64ToCharArr(mGranulePos, &outData[6]);
- iLE_Math::ULongToCharArr(mStreamSerialNo, &outData[14]);
- iLE_Math::ULongToCharArr(mPageSequenceNo, &outData[18]);
- iLE_Math::ULongToCharArr(mCRCChecksum, &outData[22]);
- outData[26] = mNumPageSegments;
-
- //TODO::: Validate the length of all this.
- memcpy((void*)(outData + 27), (const void*)mSegmentTable, mNumPageSegments);
-
- return true;
-}
-
-//unsigned long OggPageHeader::headerCheckSum()
-//{
-//
-//
-//}
-
-
-bool OggPageHeader::isBOS() {
- return ((mHeaderFlags & BOS) != 0 );
-}
-bool OggPageHeader::isEOS() {
- return ((mHeaderFlags & EOS) != 0 );
-}
-
-bool OggPageHeader::isContinuation() {
- return ((mHeaderFlags & CONTINUATION) != 0 );
-}
-
-
-string OggPageHeader::toString() {
-
- string retStr = "Ver No : " + StringHelper::numToString((unsigned int)mStructureVersion) + "\n";
- retStr += "Head Flags : " + StringHelper::numToString((unsigned int)mHeaderFlags) +"\n";
- retStr += "Granule Pos : " + StringHelper::numToString(mGranulePos) + "\n";
- retStr += "Serial No : " + StringHelper::numToString(mStreamSerialNo) + "\n";
- retStr += "Seq No : " + StringHelper::numToString(mPageSequenceNo) + "\n";
- retStr += "Checksum : " + StringHelper::numToString(mCRCChecksum) + "\n";
- retStr += "Num Segs : " + StringHelper::numToString((unsigned int)mNumPageSegments) + "\n";
- retStr += "------------------------\n";
- retStr += "Head Size : " + StringHelper::numToString(mHeaderSize) + "\n";
- retStr += "Data Size : " + StringHelper::numToString(mDataSize) + "\n";
- retStr += "Page Size : " + StringHelper::numToString(mPageSize) +"\n";
-
- return retStr;
-}
-
-
-//This could be unsigned short.
-void OggPageHeader::setHeaderSize(unsigned long inVal)
-{
- mHeaderSize = inVal;
- mPageSize = mHeaderSize + mDataSize;
-}
-void OggPageHeader::setDataSize(unsigned long inVal)
-{
- mDataSize = inVal;
- mPageSize = mHeaderSize + mDataSize;
-}
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "stdafx.h"
+#include "OggPageHeader.h"
+
+
+OggPageHeader::OggPageHeader(void)
+ : mPageSize(0)
+ , mHeaderSize(0)
+ , mDataSize(0)
+ , mStructureVersion(0)
+ , mHeaderFlags(0)
+ , mStreamSerialNo(0)
+ , mPageSequenceNo(0)
+ , mCRCChecksum(0)
+ , mPageState(BLANK)
+ , mGranulePos(0)
+ , mSegmentTable(NULL)
+ , mNumPageSegments(0)
+
+{
+
+}
+
+OggPageHeader::~OggPageHeader(void)
+{
+ delete[] mSegmentTable;
+}
+
+//Gives a pointer to the caller.
+OggPageHeader* OggPageHeader::clone() {
+
+ OggPageHeader* retClone = new OggPageHeader();
+ retClone->mCRCChecksum = mCRCChecksum;
+ retClone->mDataSize = mDataSize;
+ retClone->mGranulePos = mGranulePos;
+ retClone->mHeaderFlags = mHeaderFlags;
+ retClone->mHeaderSize = mHeaderSize;
+ retClone->mNumPageSegments = mNumPageSegments;
+ retClone->mPageSequenceNo = mPageSequenceNo;
+ retClone->mPageSize = mPageSize;
+ retClone->mPageState = mPageState;
+ retClone->mStreamSerialNo = mStreamSerialNo;
+ retClone->mStructureVersion = mStructureVersion;
+
+ //Copy the segment table.
+ unsigned char* locBuff = new unsigned char[mNumPageSegments]; //Stored in the returned classes member variable, deleted in it's destructor
+ memcpy((void*)locBuff, (const void*)mSegmentTable, mNumPageSegments);
+ retClone->mSegmentTable = locBuff;
+ locBuff = NULL; //Given away.
+ //
+
+ return retClone;
+}
+
+
+unsigned long OggPageHeader::calculateDataSize() {
+ //Sums the bytes in the segment table to calculate the size of data.
+ //FIX::: ??? No checks on pointers.
+
+ unsigned long retDataSize = 0;
+ for (int i = 0; i < mNumPageSegments; i++) {
+ retDataSize += mSegmentTable[i];
+ }
+
+ setDataSize(retDataSize);
+ return retDataSize;
+}
+//Views pointer data only
+bool OggPageHeader::setBaseHeader(const unsigned char* inBaseHeader) {
+ //This now does not delete the buffer
+
+ unsigned long locOffset = 0;
+
+ //Check if the page has the correct capture pattern
+ if (strncmp((const char*)inBaseHeader, "OggS", OGG_CAPTURE_PATTERN_SIZE) == 0) {
+ mStructureVersion = inBaseHeader[STRUCTURE_VERSION];
+ mHeaderFlags = inBaseHeader[HEADER_FLAGS];
+ mGranulePos = iLE_Math::CharArrToInt64(inBaseHeader + GRANULE_POS);
+ mStreamSerialNo = iLE_Math::charArrToULong(inBaseHeader + SERIAL_NO);
+ mCRCChecksum = iLE_Math::charArrToULong(inBaseHeader + OGG_CHECKSUM);
+ mNumPageSegments = inBaseHeader[NUM_SEGMENTS];
+ mHeaderSize = OGG_BASE_HEADER_SIZE + mNumPageSegments;
+
+ mPageSize = mHeaderSize + mDataSize;
+ mPageState = BASE_HEAD_SET;
+ return true;
+ } else {
+ return false;
+ }
+
+ ////Assign the structure version
+ //setStructureVersion(inBaseHeader[locOffset]);
+ //locOffset++;
+
+ ////Assign the header flags
+ //setHeaderFlags(inBaseHeader[locOffset]);
+ //locOffset++;
+
+ ////Assign the granule pos
+ //setGranulePos((const unsigned char*)(inBaseHeader + locOffset));
+ //locOffset += 8;
+
+ ////Assign Serial No
+ //setStreamSerialNo((const unsigned char*)(inBaseHeader + locOffset));
+ //locOffset += 4;
+
+ ////Assign Page Seq No
+ //setPageSequenceNo(inBaseHeader + locOffset);
+ //locOffset += 4;
+
+ ////Assign CheckSum
+ //setCRCChecksum(inBaseHeader + locOffset);
+ //locOffset += 4;
+
+ ////Assign Num Page Segments
+ //setNumPageSegments(inBaseHeader[locOffset]);
+ //locOffset++;
+
+ ////Set the size of the header
+ //setHeaderSize(OGG_BASE_HEADER_SIZE + mNumPageSegments);
+
+ //mPageState = BASE_HEAD_SET;
+
+
+
+
+}
+
+
+void OggPageHeader::setPageState(ePageState inPageState)
+{
+ mPageState = inPageState;
+}
+unsigned char OggPageHeader::StructureVersion()
+{
+ return mStructureVersion;
+}
+
+unsigned char OggPageHeader::HeaderFlags()
+{
+ return mHeaderFlags;
+}
+
+LOOG_INT64 OggPageHeader::GranulePos()
+{
+ return mGranulePos;
+}
+
+unsigned long OggPageHeader::StreamSerialNo()
+{
+ return mStreamSerialNo;
+}
+unsigned long OggPageHeader::PageSequenceNo()
+{
+ return mPageSequenceNo;
+}
+unsigned long OggPageHeader::CRCChecksum()
+{
+ return mCRCChecksum;
+}
+
+unsigned char OggPageHeader::NumPageSegments()
+{
+ return mNumPageSegments;
+}
+unsigned char* OggPageHeader::SegmentTable()
+{
+ return mSegmentTable;
+}
+
+
+
+void OggPageHeader::setStructureVersion(unsigned char inVal)
+{
+ mStructureVersion = inVal;
+}
+
+void OggPageHeader::setHeaderFlags(unsigned char inVal)
+{
+ mHeaderFlags = inVal;
+}
+
+void OggPageHeader::setGranulePos(LOOG_INT64 inGranulePos)
+{
+ mGranulePos = inGranulePos;
+}
+void OggPageHeader::setGranulePos(const unsigned char* inPtr)
+{
+ mGranulePos = iLE_Math::CharArrToInt64(inPtr);
+}
+
+void OggPageHeader::setStreamSerialNo(unsigned long inVal)
+{
+ mStreamSerialNo = inVal;
+}
+void OggPageHeader::setStreamSerialNo(const unsigned char* inPtr)
+{
+ mStreamSerialNo = iLE_Math::charArrToULong(inPtr);
+}
+void OggPageHeader::setPageSequenceNo(unsigned long inVal)
+{
+ mPageSequenceNo = inVal;
+}
+void OggPageHeader::setPageSequenceNo(const unsigned char* inPtr)
+{
+ mPageSequenceNo = iLE_Math::charArrToULong(inPtr);;
+}
+void OggPageHeader::setCRCChecksum(unsigned long inVal)
+{
+ mCRCChecksum = inVal;
+}
+void OggPageHeader::setCRCChecksum(const unsigned char* inPtr)
+{
+ mCRCChecksum = iLE_Math::charArrToULong(inPtr);;
+}
+
+void OggPageHeader::setNumPageSegments(unsigned char inVal)
+{
+ if (mSegmentTable == NULL) {
+ mNumPageSegments = inVal;
+ }
+}
+///
+// Copies the data from the pointer it is given.
+//
+void OggPageHeader::setSegmentTable(const unsigned char* inPtr, unsigned char inNumSegs)
+{
+ unsigned char* locSegTable = new unsigned char[inNumSegs]; //This is stored in the member variable and deleted in the destructor.
+ memcpy((void*)locSegTable, (const void*)inPtr, inNumSegs);
+ delete[] mSegmentTable;
+ mSegmentTable = locSegTable;
+ mNumPageSegments = inNumSegs;
+ setHeaderSize(OggPageHeader::OGG_BASE_HEADER_SIZE + inNumSegs);
+}
+void OggPageHeader::setSegmentTable(unsigned char* inPtr) {
+ delete[] mSegmentTable;
+ mSegmentTable = inPtr;
+
+}
+
+OggPageHeader::ePageState OggPageHeader::pageState() {
+ return mPageState;
+}
+unsigned long OggPageHeader::pageSize()
+{
+ return mPageSize;
+}
+unsigned long OggPageHeader::headerSize()
+{
+ return mHeaderSize;
+}
+unsigned long OggPageHeader::dataSize()
+{
+ return mDataSize;
+}
+bool OggPageHeader::rawData(unsigned char* outData, unsigned long inBuffSize) {
+
+ //0-3 CapPattern "OggS"
+ //4 Struct Ver
+ //5 Head Flags
+ //6-13 Granule Pos
+ //14-17 Stream Serial No
+ //18-21 Page Seq No
+ //22-25 CheckSum
+ //26 Num Segments
+ //27... SegmentTable
+ //
+
+ if (mHeaderSize > inBuffSize) {
+ return false;
+ }
+ outData[0] = 'O';
+ outData[1] = 'g';
+ outData[2] = 'g';
+ outData[3] = 'S';
+ outData[4] = mStructureVersion;
+ outData[5] = mHeaderFlags;
+ iLE_Math::Int64ToCharArr(mGranulePos, &outData[6]);
+ iLE_Math::ULongToCharArr(mStreamSerialNo, &outData[14]);
+ iLE_Math::ULongToCharArr(mPageSequenceNo, &outData[18]);
+ iLE_Math::ULongToCharArr(mCRCChecksum, &outData[22]);
+ outData[26] = mNumPageSegments;
+
+ //TODO::: Validate the length of all this.
+ memcpy((void*)(outData + 27), (const void*)mSegmentTable, mNumPageSegments);
+
+ return true;
+}
+
+//unsigned long OggPageHeader::headerCheckSum()
+//{
+//
+//
+//}
+
+
+bool OggPageHeader::isBOS() {
+ return ((mHeaderFlags & BOS) != 0 );
+}
+bool OggPageHeader::isEOS() {
+ return ((mHeaderFlags & EOS) != 0 );
+}
+
+bool OggPageHeader::isContinuation() {
+ return ((mHeaderFlags & CONTINUATION) != 0 );
+}
+
+
+string OggPageHeader::toString() {
+
+ string retStr = "Ver No : " + StringHelper::numToString((unsigned int)mStructureVersion) + "\n";
+ retStr += "Head Flags : " + StringHelper::numToString((unsigned int)mHeaderFlags) +"\n";
+ retStr += "Granule Pos : " + StringHelper::numToString(mGranulePos) + "\n";
+ retStr += "Serial No : " + StringHelper::numToString(mStreamSerialNo) + "\n";
+ retStr += "Seq No : " + StringHelper::numToString(mPageSequenceNo) + "\n";
+ retStr += "Checksum : " + StringHelper::numToString(mCRCChecksum) + "\n";
+ retStr += "Num Segs : " + StringHelper::numToString((unsigned int)mNumPageSegments) + "\n";
+ retStr += "------------------------\n";
+ retStr += "Head Size : " + StringHelper::numToString(mHeaderSize) + "\n";
+ retStr += "Data Size : " + StringHelper::numToString(mDataSize) + "\n";
+ retStr += "Page Size : " + StringHelper::numToString(mPageSize) +"\n";
+
+ return retStr;
+}
+
+
+//This could be unsigned short.
+void OggPageHeader::setHeaderSize(unsigned long inVal)
+{
+ mHeaderSize = inVal;
+ mPageSize = mHeaderSize + mDataSize;
+}
+void OggPageHeader::setDataSize(unsigned long inVal)
+{
+ mDataSize = inVal;
+ mPageSize = mHeaderSize + mDataSize;
+}
+
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageHeader.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageHeader.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageHeader.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageHeader.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,169 +1,169 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "iLE_Math.h"
-#include "StringHelper.h"
-//#include "OggSegmentTable.h"
-//#include "OggInt64.h"
-//#include "OggMath.h"
-
-
-using namespace std;
-
-#define OGG_CAPTURE_PATTERN "Oggs"
-class LIBOOOGG_API OggPageHeader //Do not derive - or needs virtual destructor.
-{
-public:
- OggPageHeader(void);
- ~OggPageHeader(void);
- OggPageHeader* clone();
- //0-3 CapPattern "Oggs"
- //4 Struct Ver
- //5 Head Flags
- //6-13 Granule Pos
- //14-17 Stream Serial No
- //18-21 Page Seq No
- //22-25 CheckSum
- //26 Num Segments
- //27... SegmentTable
-
- static const int MAX_NUM_SEGMENTS = 255;
- static const int MAX_SEGMENT_SIZE = 255;
- static const int SEGMENT_WIDTH = 1;
-
- static const unsigned char OGG_CAPTURE_PATTERN_SIZE = 4;
- static const unsigned char OGG_BASE_HEADER_SIZE = 27;
- static const LOOG_INT64 UNKNOWN_GRANULE_POS = -1;
- enum ePageState {
- INVALID,
- BLANK,
- BASE_HEAD_SET,
- FULL_HEAD_SET,
- COMPLETE
- };
-
- enum eHeadFlags {
- NO_FLAGS = 0,
- CONTINUATION = 1,
- BOS = 2,
- EOS = 4
- };
-
-
- enum eFieldOffsets {
- CAPTURE_PATTURN = 0,
- STRUCTURE_VERSION = 4,
- HEADER_FLAGS = 5,
- GRANULE_POS = 6,
- SERIAL_NO = 14,
- SEQUENCE_NO = 18,
- OGG_CHECKSUM = 22,
- NUM_SEGMENTS = 26,
- SEGMENT_TABLE = 27
- };
-
-
- bool rawData(unsigned char* outData, unsigned long inBuffSize);
-
- //State variables
- ePageState pageState();
- void setPageState(ePageState inPageState);
-
- //Access header flags
- bool isContinuation();
- bool isBOS();
- bool isEOS();
-
- //Size variables
- unsigned long pageSize();
- unsigned long headerSize();
- unsigned long dataSize();
- unsigned long calculateDataSize();
-
- //Bulk Mutators
- bool setBaseHeader(const unsigned char* inBaseHeader);
-
- //Accesors
- unsigned char StructureVersion();
- unsigned char HeaderFlags();
- LOOG_INT64 GranulePos();
- unsigned long StreamSerialNo();
- unsigned long PageSequenceNo();
- unsigned long CRCChecksum();
- unsigned char NumPageSegments();
- unsigned char* SegmentTable();
-
- //Mutators
- void setStructureVersion(unsigned char inVal);
- void setHeaderFlags(unsigned char inVal);
- void setGranulePos(LOOG_INT64 inPtr);
- void setGranulePos(const unsigned char* inPtr);
- void setStreamSerialNo(unsigned long inVal);
- void setStreamSerialNo(const unsigned char* inPtr);
- void setPageSequenceNo(unsigned long inVal);
- void setPageSequenceNo(const unsigned char* inPtr);
- void setCRCChecksum(unsigned long inVal);
- void setCRCChecksum(const unsigned char* inPtr);
- void setNumPageSegments(unsigned char inVal);
- void setSegmentTable(unsigned char* inPtr);
- void setSegmentTable(const unsigned char* inPtr, unsigned char inNumSegs);
-
- void setHeaderSize(unsigned long inVal);
- void setDataSize(unsigned long inVal);
-
-
- //unsigned long headerCheckSum();
- string toString();
-protected:
- //Size fields
- unsigned long mPageSize;
- unsigned long mHeaderSize;
- unsigned long mDataSize;
-
- //Header fields
- unsigned char mStructureVersion;
- unsigned char mHeaderFlags;
- LOOG_INT64 mGranulePos;
- unsigned long mStreamSerialNo;
- unsigned long mPageSequenceNo;
- unsigned long mCRCChecksum;
- unsigned char mNumPageSegments;
-
- //Segment table
- unsigned char* mSegmentTable;
-
- //Page state
- ePageState mPageState;
-private:
- OggPageHeader& operator=(const OggPageHeader& other); /* Don't assign me */
- OggPageHeader(const OggPageHeader& other); /* Don't copy me */
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "iLE_Math.h"
+#include "StringHelper.h"
+//#include "OggSegmentTable.h"
+//#include "OggInt64.h"
+//#include "OggMath.h"
+
+
+using namespace std;
+
+#define OGG_CAPTURE_PATTERN "Oggs"
+class LIBOOOGG_API OggPageHeader //Do not derive - or needs virtual destructor.
+{
+public:
+ OggPageHeader(void);
+ ~OggPageHeader(void);
+ OggPageHeader* clone();
+ //0-3 CapPattern "Oggs"
+ //4 Struct Ver
+ //5 Head Flags
+ //6-13 Granule Pos
+ //14-17 Stream Serial No
+ //18-21 Page Seq No
+ //22-25 CheckSum
+ //26 Num Segments
+ //27... SegmentTable
+
+ static const int MAX_NUM_SEGMENTS = 255;
+ static const int MAX_SEGMENT_SIZE = 255;
+ static const int SEGMENT_WIDTH = 1;
+
+ static const unsigned char OGG_CAPTURE_PATTERN_SIZE = 4;
+ static const unsigned char OGG_BASE_HEADER_SIZE = 27;
+ static const LOOG_INT64 UNKNOWN_GRANULE_POS = -1;
+ enum ePageState {
+ INVALID,
+ BLANK,
+ BASE_HEAD_SET,
+ FULL_HEAD_SET,
+ COMPLETE
+ };
+
+ enum eHeadFlags {
+ NO_FLAGS = 0,
+ CONTINUATION = 1,
+ BOS = 2,
+ EOS = 4
+ };
+
+
+ enum eFieldOffsets {
+ CAPTURE_PATTURN = 0,
+ STRUCTURE_VERSION = 4,
+ HEADER_FLAGS = 5,
+ GRANULE_POS = 6,
+ SERIAL_NO = 14,
+ SEQUENCE_NO = 18,
+ OGG_CHECKSUM = 22,
+ NUM_SEGMENTS = 26,
+ SEGMENT_TABLE = 27
+ };
+
+
+ bool rawData(unsigned char* outData, unsigned long inBuffSize);
+
+ //State variables
+ ePageState pageState();
+ void setPageState(ePageState inPageState);
+
+ //Access header flags
+ bool isContinuation();
+ bool isBOS();
+ bool isEOS();
+
+ //Size variables
+ unsigned long pageSize();
+ unsigned long headerSize();
+ unsigned long dataSize();
+ unsigned long calculateDataSize();
+
+ //Bulk Mutators
+ bool setBaseHeader(const unsigned char* inBaseHeader);
+
+ //Accesors
+ unsigned char StructureVersion();
+ unsigned char HeaderFlags();
+ LOOG_INT64 GranulePos();
+ unsigned long StreamSerialNo();
+ unsigned long PageSequenceNo();
+ unsigned long CRCChecksum();
+ unsigned char NumPageSegments();
+ unsigned char* SegmentTable();
+
+ //Mutators
+ void setStructureVersion(unsigned char inVal);
+ void setHeaderFlags(unsigned char inVal);
+ void setGranulePos(LOOG_INT64 inPtr);
+ void setGranulePos(const unsigned char* inPtr);
+ void setStreamSerialNo(unsigned long inVal);
+ void setStreamSerialNo(const unsigned char* inPtr);
+ void setPageSequenceNo(unsigned long inVal);
+ void setPageSequenceNo(const unsigned char* inPtr);
+ void setCRCChecksum(unsigned long inVal);
+ void setCRCChecksum(const unsigned char* inPtr);
+ void setNumPageSegments(unsigned char inVal);
+ void setSegmentTable(unsigned char* inPtr);
+ void setSegmentTable(const unsigned char* inPtr, unsigned char inNumSegs);
+
+ void setHeaderSize(unsigned long inVal);
+ void setDataSize(unsigned long inVal);
+
+
+ //unsigned long headerCheckSum();
+ string toString();
+protected:
+ //Size fields
+ unsigned long mPageSize;
+ unsigned long mHeaderSize;
+ unsigned long mDataSize;
+
+ //Header fields
+ unsigned char mStructureVersion;
+ unsigned char mHeaderFlags;
+ LOOG_INT64 mGranulePos;
+ unsigned long mStreamSerialNo;
+ unsigned long mPageSequenceNo;
+ unsigned long mCRCChecksum;
+ unsigned char mNumPageSegments;
+
+ //Segment table
+ unsigned char* mSegmentTable;
+
+ //Page state
+ ePageState mPageState;
+private:
+ OggPageHeader& operator=(const OggPageHeader& other); /* Don't assign me */
+ OggPageHeader(const OggPageHeader& other); /* Don't copy me */
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageHeader.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageInterleaver.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageInterleaver.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageInterleaver.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,188 +1,188 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "stdafx.h"
-#include "OggPageInterleaver.h"
-
-OggPageInterleaver::OggPageInterleaver(IOggCallback* inFileWriter, INotifyComplete* inNotifier)
- : mFileWriter(inFileWriter)
- , mNotifier(inNotifier)
-{
- //debugLog.open("G:\\logs\\interleaver.log", ios_base::out);
-}
-
-OggPageInterleaver::~OggPageInterleaver(void)
-{
- //debugLog.close();
-
- //Need to delete stream objects
-}
-
-OggMuxStream* OggPageInterleaver::newStream() {
- OggMuxStream* retStream = new OggMuxStream(this);
- mInputStreams.push_back(retStream);
- return retStream;
-}
-
-void OggPageInterleaver::notifyArrival() {
- processData();
-}
-void OggPageInterleaver::processData() {
- /*
- IF ALL EOS THEN
- FINSH UP
- SIGNAL END OF STREAMS
- ELSE
- WHILE IS PROCESSABLE
- lowestStream = NULL
- FOR EACH stream in mInputStreams
- IF NOT stream IS EMPTY THEN
- IF lowestStream = NULL THEN
- lowestStream = stream
- ELSE IF stream.frontTime < lowestStream.frontTime THEN
- lowestStream = stream
- END IF
- END IF
- NEXT stream
- IF lowestStream = NULL THEN
- CURSE LOUDLY
- ELSE
- WRITE lowestStream.frontPage
- END IF
- WEND
- END IF
- */
- //
- //Temp
-
-
- //debugLog<<endl<<"Process Data : "<<endl;
- //debugLog<<"==============="<<endl;
- if (isAllEOS()) {
- //debugLog<<"Process Data : All are EOS."<<endl;
- //Finish up
- while (!isAllEmpty()) {
- //debugLog<<"Process Data : Finishing - Still not empty..."<<endl;
- writeLowest();
- }
- //debugLog<<"Process Data : Notifying completion... 1"<<endl;
- mNotifier->NotifyComplete();
- } else {
- //debugLog<<"Process Data : *NOT* all EOS"<<endl;
- while (isProcessable()) {
- //debugLog<<"Process Data : Still processable data..."<<endl;
- writeLowest();
- }
- //debugLog<<"Process Data : No more processable data..."<<endl;
- if (isAllEOS() && isAllEmpty()) {
- //debugLog<<"Process Data : All EOS and all Empty... Notifying complete 2..."<<endl;
- mNotifier->NotifyComplete();
- }
- }
- //debugLog<<"==============="<<endl;
-
-}
-
-void OggPageInterleaver::writeLowest() {
- OggMuxStream* locLowestStream = NULL;
- for (size_t i = 0; i < mInputStreams.size(); i++) {
- if (!mInputStreams[i]->isEmpty() && mInputStreams[i]->isActive()) {
- if (locLowestStream == NULL) {
- locLowestStream = mInputStreams[i];
- //debugLog<<"writeLowest : Defaulting stream "<<i<<" @ Gran = "<<locLowestStream->frontTime()<<" & Time = "<<locLowestStream->scaledFrontTime()<<endl;
- //debugLog<<"writeLowest : Defaulting stream "<<i<<endl;
- } else {
- LOOG_INT64 locCurrLowTime = locLowestStream->scaledFrontTime();
- LOOG_INT64 locTestLowTime = mInputStreams[i]->scaledFrontTime();
-
- //__int64 locCurrLowTimeUNS = locLowestStream->frontTime();
- //__int64 locTestLowTimeUNS = mInputStreams[i]->frontTime();
-
-
- //debugLog<<"writeLowest Scaled : Curr = "<<locCurrLowTime<<" -- Test["<<i<<"] = "<<locTestLowTime<<endl;
- //debugLog<<"writeLowest UNSCAL : Curr = "<<locCurrLowTimeUNS<<" -- Test["<<i<<"] = "<<locTestLowTimeUNS<<endl;
-
-
- //In english this means... any bos pages go first... then any no gran pos pages (-1 gran pos).. then
- // whoevers got the lowest time.
- if (
- ( (mInputStreams[i]->peekFront() != NULL) &&
- (mInputStreams[i]->peekFront()->header()->isBOS()) ) ||
-
- ( (mInputStreams[i]->peekFront() != NULL) &&
- ((mInputStreams[i]->peekFront()->header()->GranulePos()) == -1) ) ||
- (locTestLowTime < locCurrLowTime)
- )
- {
-
- locLowestStream = mInputStreams[i];
- //debugLog<<"writeLowest : Selecting stream "<<i<<" @ Gran = "<<locLowestStream->frontTime()<<" & Time = "<<locLowestStream->scaledFrontTime()<<endl;
- }
- }
- }
- }
- if (locLowestStream == NULL) {
- throw 0;
- } else {
- //debugLog<<"writeLowest : Writing..."<<endl;
- mFileWriter->acceptOggPage(locLowestStream->popFront()); //Gives away page
- }
-
-}
-bool OggPageInterleaver::isProcessable() {
- bool retVal = true;
- //ASSERT(mInputStreams.size() >= 1)
- for (size_t i = 0; i < mInputStreams.size(); i++) {
- retVal = retVal && (mInputStreams[i]->isProcessable());
- }
- return retVal;
-}
-bool OggPageInterleaver::isAllEOS() {
- bool retVal = true;
- //ASSERT(mInputStreams.size() >= 1)
- for (size_t i = 0; i < mInputStreams.size(); i++) {
- if (mInputStreams[i]->isEOS()) {
- //debugLog<<"***** Stream "<<i<<" is EOS"<<endl;
- } else {
- //debugLog<<"***** Stream "<<i<<" not EOS"<<endl;
- }
- retVal = retVal && (mInputStreams[i]->isEOS() || !mInputStreams[i]->isActive());
- }
- return retVal;
-}
-
-bool OggPageInterleaver::isAllEmpty() {
- bool retVal = true;
- //ASSERT(mInputStreams.size() >= 1)
- for (size_t i = 0; i < mInputStreams.size(); i++) {
- retVal = retVal && (mInputStreams[i]->isEmpty());
- }
- return retVal;
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "stdafx.h"
+#include "OggPageInterleaver.h"
+
+OggPageInterleaver::OggPageInterleaver(IOggCallback* inFileWriter, INotifyComplete* inNotifier)
+ : mFileWriter(inFileWriter)
+ , mNotifier(inNotifier)
+{
+ //debugLog.open("G:\\logs\\interleaver.log", ios_base::out);
+}
+
+OggPageInterleaver::~OggPageInterleaver(void)
+{
+ //debugLog.close();
+
+ //Need to delete stream objects
+}
+
+OggMuxStream* OggPageInterleaver::newStream() {
+ OggMuxStream* retStream = new OggMuxStream(this);
+ mInputStreams.push_back(retStream);
+ return retStream;
+}
+
+void OggPageInterleaver::notifyArrival() {
+ processData();
+}
+void OggPageInterleaver::processData() {
+ /*
+ IF ALL EOS THEN
+ FINSH UP
+ SIGNAL END OF STREAMS
+ ELSE
+ WHILE IS PROCESSABLE
+ lowestStream = NULL
+ FOR EACH stream in mInputStreams
+ IF NOT stream IS EMPTY THEN
+ IF lowestStream = NULL THEN
+ lowestStream = stream
+ ELSE IF stream.frontTime < lowestStream.frontTime THEN
+ lowestStream = stream
+ END IF
+ END IF
+ NEXT stream
+ IF lowestStream = NULL THEN
+ CURSE LOUDLY
+ ELSE
+ WRITE lowestStream.frontPage
+ END IF
+ WEND
+ END IF
+ */
+ //
+ //Temp
+
+
+ //debugLog<<endl<<"Process Data : "<<endl;
+ //debugLog<<"==============="<<endl;
+ if (isAllEOS()) {
+ //debugLog<<"Process Data : All are EOS."<<endl;
+ //Finish up
+ while (!isAllEmpty()) {
+ //debugLog<<"Process Data : Finishing - Still not empty..."<<endl;
+ writeLowest();
+ }
+ //debugLog<<"Process Data : Notifying completion... 1"<<endl;
+ mNotifier->NotifyComplete();
+ } else {
+ //debugLog<<"Process Data : *NOT* all EOS"<<endl;
+ while (isProcessable()) {
+ //debugLog<<"Process Data : Still processable data..."<<endl;
+ writeLowest();
+ }
+ //debugLog<<"Process Data : No more processable data..."<<endl;
+ if (isAllEOS() && isAllEmpty()) {
+ //debugLog<<"Process Data : All EOS and all Empty... Notifying complete 2..."<<endl;
+ mNotifier->NotifyComplete();
+ }
+ }
+ //debugLog<<"==============="<<endl;
+
+}
+
+void OggPageInterleaver::writeLowest() {
+ OggMuxStream* locLowestStream = NULL;
+ for (size_t i = 0; i < mInputStreams.size(); i++) {
+ if (!mInputStreams[i]->isEmpty() && mInputStreams[i]->isActive()) {
+ if (locLowestStream == NULL) {
+ locLowestStream = mInputStreams[i];
+ //debugLog<<"writeLowest : Defaulting stream "<<i<<" @ Gran = "<<locLowestStream->frontTime()<<" & Time = "<<locLowestStream->scaledFrontTime()<<endl;
+ //debugLog<<"writeLowest : Defaulting stream "<<i<<endl;
+ } else {
+ LOOG_INT64 locCurrLowTime = locLowestStream->scaledFrontTime();
+ LOOG_INT64 locTestLowTime = mInputStreams[i]->scaledFrontTime();
+
+ //__int64 locCurrLowTimeUNS = locLowestStream->frontTime();
+ //__int64 locTestLowTimeUNS = mInputStreams[i]->frontTime();
+
+
+ //debugLog<<"writeLowest Scaled : Curr = "<<locCurrLowTime<<" -- Test["<<i<<"] = "<<locTestLowTime<<endl;
+ //debugLog<<"writeLowest UNSCAL : Curr = "<<locCurrLowTimeUNS<<" -- Test["<<i<<"] = "<<locTestLowTimeUNS<<endl;
+
+
+ //In english this means... any bos pages go first... then any no gran pos pages (-1 gran pos).. then
+ // whoevers got the lowest time.
+ if (
+ ( (mInputStreams[i]->peekFront() != NULL) &&
+ (mInputStreams[i]->peekFront()->header()->isBOS()) ) ||
+
+ ( (mInputStreams[i]->peekFront() != NULL) &&
+ ((mInputStreams[i]->peekFront()->header()->GranulePos()) == -1) ) ||
+ (locTestLowTime < locCurrLowTime)
+ )
+ {
+
+ locLowestStream = mInputStreams[i];
+ //debugLog<<"writeLowest : Selecting stream "<<i<<" @ Gran = "<<locLowestStream->frontTime()<<" & Time = "<<locLowestStream->scaledFrontTime()<<endl;
+ }
+ }
+ }
+ }
+ if (locLowestStream == NULL) {
+ throw 0;
+ } else {
+ //debugLog<<"writeLowest : Writing..."<<endl;
+ mFileWriter->acceptOggPage(locLowestStream->popFront()); //Gives away page
+ }
+
+}
+bool OggPageInterleaver::isProcessable() {
+ bool retVal = true;
+ //ASSERT(mInputStreams.size() >= 1)
+ for (size_t i = 0; i < mInputStreams.size(); i++) {
+ retVal = retVal && (mInputStreams[i]->isProcessable());
+ }
+ return retVal;
+}
+bool OggPageInterleaver::isAllEOS() {
+ bool retVal = true;
+ //ASSERT(mInputStreams.size() >= 1)
+ for (size_t i = 0; i < mInputStreams.size(); i++) {
+ if (mInputStreams[i]->isEOS()) {
+ //debugLog<<"***** Stream "<<i<<" is EOS"<<endl;
+ } else {
+ //debugLog<<"***** Stream "<<i<<" not EOS"<<endl;
+ }
+ retVal = retVal && (mInputStreams[i]->isEOS() || !mInputStreams[i]->isActive());
+ }
+ return retVal;
+}
+
+bool OggPageInterleaver::isAllEmpty() {
+ bool retVal = true;
+ //ASSERT(mInputStreams.size() >= 1)
+ for (size_t i = 0; i < mInputStreams.size(); i++) {
+ retVal = retVal && (mInputStreams[i]->isEmpty());
+ }
+ return retVal;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageInterleaver.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageInterleaver.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageInterleaver.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageInterleaver.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,71 +1,71 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#pragma once
-#include "IOggCallback.h"
-#include "INotifyComplete.h"
-#include "OggMuxStream.h"
-#include <vector>
-
-//DEBUG ONLY
-//#include <fstream>
-//
-using namespace std;
-class LIBOOOGG_API OggPageInterleaver
- : public INotifyArrival
-{
-public:
- //TODO::: Shuoldn't be called file writer... just output or something.
- OggPageInterleaver(IOggCallback* inFileWriter, INotifyComplete* inNotifier);
- virtual ~OggPageInterleaver(void);
-
- virtual OggMuxStream* newStream();
- virtual void processData();
- virtual void writeLowest();
-
- virtual bool isProcessable();
- virtual bool isAllEOS();
- virtual bool isAllEmpty();
-
- //INotifyArrival Implementation
- virtual void notifyArrival();
-
-protected:
- vector<OggMuxStream*> mInputStreams;
- IOggCallback* mFileWriter; //TODO::: Shuoldn't be called filewriter.
- INotifyComplete* mNotifier;
-
- //DEBUG ONLY
- //fstream debugLog;
- //
-private:
- OggPageInterleaver& operator=(const OggPageInterleaver& other); /* Don't assign me */
- OggPageInterleaver(const OggPageInterleaver& other); /* Don't copy me */
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#pragma once
+#include "IOggCallback.h"
+#include "INotifyComplete.h"
+#include "OggMuxStream.h"
+#include <vector>
+
+//DEBUG ONLY
+//#include <fstream>
+//
+using namespace std;
+class LIBOOOGG_API OggPageInterleaver
+ : public INotifyArrival
+{
+public:
+ //TODO::: Shuoldn't be called file writer... just output or something.
+ OggPageInterleaver(IOggCallback* inFileWriter, INotifyComplete* inNotifier);
+ virtual ~OggPageInterleaver(void);
+
+ virtual OggMuxStream* newStream();
+ virtual void processData();
+ virtual void writeLowest();
+
+ virtual bool isProcessable();
+ virtual bool isAllEOS();
+ virtual bool isAllEmpty();
+
+ //INotifyArrival Implementation
+ virtual void notifyArrival();
+
+protected:
+ vector<OggMuxStream*> mInputStreams;
+ IOggCallback* mFileWriter; //TODO::: Shuoldn't be called filewriter.
+ INotifyComplete* mNotifier;
+
+ //DEBUG ONLY
+ //fstream debugLog;
+ //
+private:
+ OggPageInterleaver& operator=(const OggPageInterleaver& other); /* Don't assign me */
+ OggPageInterleaver(const OggPageInterleaver& other); /* Don't copy me */
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPageInterleaver.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,39 +1,39 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "stdafx.h"
-#include "OggPaginator.h"
-//LEAK CHECK::: Potential for leak based on mPendingPage. if setSettings is called. and also the last page won't get deleted. 20041018
-
-//Checksum tables from libogg
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "stdafx.h"
+#include "OggPaginator.h"
+//LEAK CHECK::: Potential for leak based on mPendingPage. if setSettings is called. and also the last page won't get deleted. 20041018
+
+//Checksum tables from libogg
static unsigned long crc_lookup[256]={
0x00000000,0x04c11db7,0x09823b6e,0x0d4326d9,
0x130476dc,0x17c56b6b,0x1a864db2,0x1e475005,
@@ -98,71 +98,71 @@
0x89b8fd09,0x8d79e0be,0x803ac667,0x84fbdbd0,
0x9abc8bd5,0x9e7d9662,0x933eb0bb,0x97ffad0c,
0xafb010b1,0xab710d06,0xa6322bdf,0xa2f33668,
- 0xbcb4666d,0xb8757bda,0xb5365d03,0xb1f740b4
-};
-
- //End libogg tables
-
-OggPaginator::OggPaginator(void)
- : mPageCallback(NULL)
- , mSettings(NULL)
- , mPendingPage(NULL)
- , mCurrentPageSize(0)
- , mSegmentTableSize(0)
- , mPendingPageHasData(false)
- , mSequenceNo(0)
- , mPacketCount(0)
- , mLastGranulePos(0)
-{
- //debugLog.open("G:\\logs\\paginator.log", ios_base::out);
-
- mHeaderBuff = new unsigned char[300]; //Deleted in destructor.
-
-}
-
-OggPaginator::~OggPaginator(void)
-{
- delete mHeaderBuff;
- mHeaderBuff = NULL;
- //debugLog.close();
-}
-
-//Calling this after you have fed in packets will cause lost data and memory leak (mPending page)
-bool OggPaginator::setParameters(OggPaginatorSettings* inSettings) {
- delete mSettings;
- mSettings = inSettings;
- createFreshPage();
- return true;
-}
-
-//Keeps packet.
-bool OggPaginator::acceptStampedOggPacket(StampedOggPacket* inOggPacket)
-{
-
- //debugLog<<"Accepting packet"<<endl;
- addPacketToPage(inOggPacket);
-
- return true;
-}
-bool OggPaginator::finishStream()
-{
- //When we get a signal to finish a stream, we set the EOS Flag on the current page pending
- // which may be empty, and then deliver it.
-
- //This makes sure if our last page is empty and we want to send the EOS page, we stamp it with the previous granule pos
- // since if this page has no packets it must be the same. Makes it easier to find the stream duration.
- if (mPendingPage->numPackets() == 0) {
- mPendingPage->header()->setGranulePos(mLastGranulePos);
-
- }
-
- mPendingPage->header()->setHeaderFlags(mPendingPage->header()->HeaderFlags() | 4);
- deliverCurrentPage();
- return true;
-}
-
-bool OggPaginator::setChecksum()
-{
+ 0xbcb4666d,0xb8757bda,0xb5365d03,0xb1f740b4
+};
+
+ //End libogg tables
+
+OggPaginator::OggPaginator(void)
+ : mPageCallback(NULL)
+ , mSettings(NULL)
+ , mPendingPage(NULL)
+ , mCurrentPageSize(0)
+ , mSegmentTableSize(0)
+ , mPendingPageHasData(false)
+ , mSequenceNo(0)
+ , mPacketCount(0)
+ , mLastGranulePos(0)
+{
+ //debugLog.open("G:\\logs\\paginator.log", ios_base::out);
+
+ mHeaderBuff = new unsigned char[300]; //Deleted in destructor.
+
+}
+
+OggPaginator::~OggPaginator(void)
+{
+ delete mHeaderBuff;
+ mHeaderBuff = NULL;
+ //debugLog.close();
+}
+
+//Calling this after you have fed in packets will cause lost data and memory leak (mPending page)
+bool OggPaginator::setParameters(OggPaginatorSettings* inSettings) {
+ delete mSettings;
+ mSettings = inSettings;
+ createFreshPage();
+ return true;
+}
+
+//Keeps packet.
+bool OggPaginator::acceptStampedOggPacket(StampedOggPacket* inOggPacket)
+{
+
+ //debugLog<<"Accepting packet"<<endl;
+ addPacketToPage(inOggPacket);
+
+ return true;
+}
+bool OggPaginator::finishStream()
+{
+ //When we get a signal to finish a stream, we set the EOS Flag on the current page pending
+ // which may be empty, and then deliver it.
+
+ //This makes sure if our last page is empty and we want to send the EOS page, we stamp it with the previous granule pos
+ // since if this page has no packets it must be the same. Makes it easier to find the stream duration.
+ if (mPendingPage->numPackets() == 0) {
+ mPendingPage->header()->setGranulePos(mLastGranulePos);
+
+ }
+
+ mPendingPage->header()->setHeaderFlags(mPendingPage->header()->HeaderFlags() | 4);
+ deliverCurrentPage();
+ return true;
+}
+
+bool OggPaginator::setChecksum()
+{
unsigned long locChecksum = 0;
unsigned long locTemp = 0;
@@ -189,264 +189,264 @@
locChecksum = (locChecksum << 8) ^ crc_lookup[locTemp];
}
}
-
- mPendingPage->header()->setCRCChecksum(locChecksum);
- }
- return true;
-
-}
-bool OggPaginator::deliverCurrentPage() {
- //debugLog<<"Delivering page"<<endl;
- mPendingPage->header()->setSegmentTable((const unsigned char*)mSegmentTable, mSegmentTableSize);
-
- mPendingPage->header()->setDataSize(mCurrentPageSize - mPendingPage->headerSize()); //This is odd
-
- setChecksum();
-
- //We save this in case we need to send an empty EOS page, and we can stamp it with this value.
- mLastGranulePos = mPendingPage->header()->GranulePos();
-
- //TODO::: Should catch and propagate return value.
- mPageCallback->acceptOggPage(mPendingPage); //Gives away page.
- mPendingPage = NULL;
- createFreshPage();
- return true;
-
-}
-bool OggPaginator::createFreshPage() {
- //debugLog<<"Creating fresh page"<<endl;
- mPendingPage = new OggPage; //Potential for leak here if setsettings called. Otherwise deleted in destructor or dispatched
- mCurrentPageSize = OggPageHeader::OGG_BASE_HEADER_SIZE;
- mPendingPageHasData = false;
- mSegmentTableSize = 0;
-
- mPendingPage->header()->setStreamSerialNo(mSettings->mSerialNo);
- mPendingPage->header()->setPageSequenceNo(mSequenceNo);
-
- //If it's the first page it gets the BOS Flag
- if (mSequenceNo == 0) {
- mPendingPage->header()->setHeaderFlags(OggPageHeader::BOS);
- } else {
- mPendingPage->header()->setHeaderFlags(OggPageHeader::NO_FLAGS);
- }
-
- mPendingPage->header()->setGranulePos(OggPageHeader::UNKNOWN_GRANULE_POS);
- mSequenceNo++;
- return true;
-
-}
-bool OggPaginator::addPacketToPage(StampedOggPacket* inOggPacket) {
-
- //debugLog<<"Add packet to page"<<endl;
- mPendingPageHasData = true;
- //while some packet left
- // add as much as possible
- // update how much packet is left
- //wend
-
-
- //ADD AS MUCH AS POSSIBLE
- //howmuchToAdd = MIN(numSegsLeft * 255, maxsize - current size)
- //add part of packet
- //if page has enough deliver it
- //return how much was added.
-
- //Get some counter variables ready
- long locPacketRemaining = inOggPacket->packetSize();
- unsigned long locPacketStartPoint = 0;
- unsigned long locConsumed = 0;
-
- //While there is still more packet not added to the page add as much as it will take.
- while (locPacketRemaining > 0) {
- //debugLog<<"Packet remaining = "<<locPacketRemaining<<endl;
-
- locConsumed = addAsMuchPacketAsPossible(inOggPacket, locPacketStartPoint, locPacketRemaining);
-
- //debugLog<<"Consumed = "<<locConsumed<<endl;
-
- locPacketStartPoint += locConsumed;
- locPacketRemaining -= locConsumed;
- }
-
-
- //This will ensure that any header packet appears on it's own page...
- //
-
- //Every header gets it's own page.
- if ((mPacketCount < mSettings->mNumHeaders) && (mPendingPageHasData)) {
- //debugLog<<"Flushing a header page..."<<endl;
- //debugLog<<"PacketCount = "<<mPacketCount<<endl;
- //debugLog<<"Num Headers = "<<mSettings->mNumHeaders<<endl;
- deliverCurrentPage();
- }
- mPacketCount++;
- return true;
-}
-
-
-unsigned long OggPaginator::addAsMuchPacketAsPossible(StampedOggPacket* inOggPacket, unsigned long inStartAt, long inRemaining)
-{
- //debugLog<<"Remains in packet = "<<inRemaining<<endl;
- //debugLog<<"Start at = "<<inStartAt<<endl;
- //debugLog<<"Segtable size = "<<mSegmentTableSize<<endl;
- //debugLog<<"Max page size = "<<mSettings->mMaxPageSize<<endl;
- //debugLog<<"Current page size = "<<mCurrentPageSize<<endl;
-
- //The amount of space left in the page is the minimum of
- // a) The (number of segments left * 255) take 1.
- // b) The number of bytes less than the desired maximum page size.
-
- //TODO::: What happens when mSegmentTableSize is 255 ?
-
- //Take 1 so when it adds the packet it doesn't try to consume one extra segment which doesn't exist.
- unsigned long locSpaceLeft = MIN(((255 - mSegmentTableSize) * 255) - 1, mSettings->mMaxPageSize - mCurrentPageSize);
-
- //debugLog<<"Space left = "<<locSpaceLeft<<endl;
- //debugLog<<"Space left = "<<locSpaceLeft<<endl;
- //Round down to nearest multiple of 255
- //
-
- //This is important when the packet gets broken because inRemaining is gt locSpace left
- // In this case where the packet gets broken the final segment on the page must be 255.
- locSpaceLeft -= (locSpaceLeft % 255);
- //ASSERT(locSpaceLeft >=0);
-
- //debugLog<<"Adjust space left = "<<locSpaceLeft<<endl;
-
- //How much we add is the minimum of
- // a) How much space is left
- // b) The amount of packet remaining.
-
- //If (a) is the minimum then we know that the how much we are adding is a multiple of 255.
- unsigned long locHowMuchToAdd = MIN(locSpaceLeft, inRemaining);
-
- //debugLog<<"How much to add..."<<endl;
- //debugLog<<"How much to add = "<<locHowMuchToAdd<<endl;
-
- //mPending page has data is useless, it was set before this function is called... need to fix that. maybe move into add part of pack into apge
- if ((!mPendingPageHasData) && (inStartAt != 0)) {
- mPendingPage->header()->setHeaderFlags(mPendingPage->header()->HeaderFlags() | OggPageHeader::CONTINUATION);
-
- }
-
- if (locHowMuchToAdd > 0) {
- addPartOfPacketToPage(inOggPacket, inStartAt, locHowMuchToAdd);
- }
-
-
- //This puts only a single packet on the first page...
- if ((mCurrentPageSize >= mSettings->mMinPageSize) || (mPendingPage->header()->PageSequenceNo() == 0) || (locHowMuchToAdd == 0)) {
- deliverCurrentPage();
- }
- return locHowMuchToAdd;
-
-}
-
-bool OggPaginator::addPartOfPacketToPage(StampedOggPacket* inOggPacket, unsigned long inStartFrom, unsigned long inLength) {
-
- //debugLog<<"Add part of packet to page"<<endl;
-
- //Buffer the amount of the packet we are going to add.
- unsigned char* locBuff = new unsigned char[inLength]; //Given to constructor of stampedpacket.
- memcpy((void*)locBuff, (const void*)(inOggPacket->packetData() + inStartFrom), inLength);
-
- //unsigned long locBytesOfPacketRemaining = inOggPacket->packetSize() - (((locNumSegsNeeded - (255 - mSegmentTableSize)) * 255);
- //unsigned long locRemainingPacketStartsAt = inOggPacket->packetSize() - locBytesOfPacketRemaining + 1;
- //
-
- //Its the last part of the packet start point plus how much we are adding of it is the same
- // as the total packet size.
- bool locIsLastOfPacket = (inStartFrom + inLength == inOggPacket->packetSize());
-
- //Create a new packet
- StampedOggPacket* locPartialPacket = new StampedOggPacket( locBuff,
- inLength,
- locIsLastOfPacket,
- false, //Not continuation
- inOggPacket->startTime(),
- inOggPacket->endTime(),
- inOggPacket->mStampType); //Given to page.
-
- //Add the packet to the page.
- mPendingPage->addPacket(locPartialPacket);
-
- //CASES
- //========
- //length segs segs if not end
- // 0 1 N/A
- // 1 1 N/A
- // 255 2 1
- // 256 2
- // 510 3 2
- // n (n / 255) + 1
-
- //Now do the segment table bookkeeping.
- unsigned long locNumSegsNeeded = (inLength / 255);
-
- //debugLog<<"Amount to add = "<<inLength<<endl;
- //debugLog<<"Segs needed = "<<locNumSegsNeeded<<endl;
-
- //Always do one less than the total... the last segment is a special case
- //We fill all but the last segemnt with 255
- for (unsigned long i = 0; i < locNumSegsNeeded; i++) {
- mSegmentTable[mSegmentTableSize] = 255;
- mSegmentTableSize++;
- }
-
- //If it's not the last of the packet, it will be a multiple of 255, hence we don't put a terminating 0 on.
- //If it is the last of the packet this last segment will be between 0 and 254 inclusive.
- if (locIsLastOfPacket) {
- //Its the last part of the packet... so we need one extra segemnt... to hold the last part.
- // The last part will be between 0-254
- //debugLog<<"Is last of packet... adding terminator "<<(unsigned long)(inLength % 255)<<endl;
- mSegmentTable[mSegmentTableSize] = (unsigned char)(inLength % 255);
- mSegmentTableSize++;
-
- //This is used in a calculation below.
- locNumSegsNeeded++;
- } else {
- //If it's not the last part of the packet it should be a multiple of 255. the calling function needs to ensure this.
- //Since if it was the last part of the packet we've already added all the segments, then we do nothing.
-
- //ASSERT((inLength % 255) == 0);
- //if ((inLength % 255) != 0) {
- // debugLog<<"ASSERTION FAILED !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"<<endl;
- //}
- //mSegmentTable[mSegmentTableSize] = (unsigned char)(255);
- //mSegmentTableSize++;
- //locNumSegsNeeded++;
- }
-
-
- //debugLog<<"Seg table is "<<(unsigned long)mSegmentTableSize<<endl;
-
- mCurrentPageSize += (locNumSegsNeeded + inLength);
-
- //debugLog<<"Page is now "<<mCurrentPageSize<<endl;
- if (locIsLastOfPacket) {
- //debugLog<<"Setting time for end of page"<<endl;
- mPendingPage->header()->setGranulePos(inOggPacket->endTime());
- }
-
- return true;
-}
-
-
-
-
-
-
-
-bool OggPaginator::setPageCallback(IOggCallback* inPageCallback) {
- mPageCallback = inPageCallback;
- return true;
-}
-
-void OggPaginator::setNumHeaders(unsigned long inNumHeaders) {
- mSettings->mNumHeaders = inNumHeaders;
-}
-unsigned long OggPaginator::numHeaders() {
- return mSettings->mNumHeaders;
-
-}
-
+
+ mPendingPage->header()->setCRCChecksum(locChecksum);
+ }
+ return true;
+
+}
+bool OggPaginator::deliverCurrentPage() {
+ //debugLog<<"Delivering page"<<endl;
+ mPendingPage->header()->setSegmentTable((const unsigned char*)mSegmentTable, mSegmentTableSize);
+
+ mPendingPage->header()->setDataSize(mCurrentPageSize - mPendingPage->headerSize()); //This is odd
+
+ setChecksum();
+
+ //We save this in case we need to send an empty EOS page, and we can stamp it with this value.
+ mLastGranulePos = mPendingPage->header()->GranulePos();
+
+ //TODO::: Should catch and propagate return value.
+ mPageCallback->acceptOggPage(mPendingPage); //Gives away page.
+ mPendingPage = NULL;
+ createFreshPage();
+ return true;
+
+}
+bool OggPaginator::createFreshPage() {
+ //debugLog<<"Creating fresh page"<<endl;
+ mPendingPage = new OggPage; //Potential for leak here if setsettings called. Otherwise deleted in destructor or dispatched
+ mCurrentPageSize = OggPageHeader::OGG_BASE_HEADER_SIZE;
+ mPendingPageHasData = false;
+ mSegmentTableSize = 0;
+
+ mPendingPage->header()->setStreamSerialNo(mSettings->mSerialNo);
+ mPendingPage->header()->setPageSequenceNo(mSequenceNo);
+
+ //If it's the first page it gets the BOS Flag
+ if (mSequenceNo == 0) {
+ mPendingPage->header()->setHeaderFlags(OggPageHeader::BOS);
+ } else {
+ mPendingPage->header()->setHeaderFlags(OggPageHeader::NO_FLAGS);
+ }
+
+ mPendingPage->header()->setGranulePos(OggPageHeader::UNKNOWN_GRANULE_POS);
+ mSequenceNo++;
+ return true;
+
+}
+bool OggPaginator::addPacketToPage(StampedOggPacket* inOggPacket) {
+
+ //debugLog<<"Add packet to page"<<endl;
+ mPendingPageHasData = true;
+ //while some packet left
+ // add as much as possible
+ // update how much packet is left
+ //wend
+
+
+ //ADD AS MUCH AS POSSIBLE
+ //howmuchToAdd = MIN(numSegsLeft * 255, maxsize - current size)
+ //add part of packet
+ //if page has enough deliver it
+ //return how much was added.
+
+ //Get some counter variables ready
+ long locPacketRemaining = inOggPacket->packetSize();
+ unsigned long locPacketStartPoint = 0;
+ unsigned long locConsumed = 0;
+
+ //While there is still more packet not added to the page add as much as it will take.
+ while (locPacketRemaining > 0) {
+ //debugLog<<"Packet remaining = "<<locPacketRemaining<<endl;
+
+ locConsumed = addAsMuchPacketAsPossible(inOggPacket, locPacketStartPoint, locPacketRemaining);
+
+ //debugLog<<"Consumed = "<<locConsumed<<endl;
+
+ locPacketStartPoint += locConsumed;
+ locPacketRemaining -= locConsumed;
+ }
+
+
+ //This will ensure that any header packet appears on it's own page...
+ //
+
+ //Every header gets it's own page.
+ if ((mPacketCount < mSettings->mNumHeaders) && (mPendingPageHasData)) {
+ //debugLog<<"Flushing a header page..."<<endl;
+ //debugLog<<"PacketCount = "<<mPacketCount<<endl;
+ //debugLog<<"Num Headers = "<<mSettings->mNumHeaders<<endl;
+ deliverCurrentPage();
+ }
+ mPacketCount++;
+ return true;
+}
+
+
+unsigned long OggPaginator::addAsMuchPacketAsPossible(StampedOggPacket* inOggPacket, unsigned long inStartAt, long inRemaining)
+{
+ //debugLog<<"Remains in packet = "<<inRemaining<<endl;
+ //debugLog<<"Start at = "<<inStartAt<<endl;
+ //debugLog<<"Segtable size = "<<mSegmentTableSize<<endl;
+ //debugLog<<"Max page size = "<<mSettings->mMaxPageSize<<endl;
+ //debugLog<<"Current page size = "<<mCurrentPageSize<<endl;
+
+ //The amount of space left in the page is the minimum of
+ // a) The (number of segments left * 255) take 1.
+ // b) The number of bytes less than the desired maximum page size.
+
+ //TODO::: What happens when mSegmentTableSize is 255 ?
+
+ //Take 1 so when it adds the packet it doesn't try to consume one extra segment which doesn't exist.
+ unsigned long locSpaceLeft = MIN(((255 - mSegmentTableSize) * 255) - 1, mSettings->mMaxPageSize - mCurrentPageSize);
+
+ //debugLog<<"Space left = "<<locSpaceLeft<<endl;
+ //debugLog<<"Space left = "<<locSpaceLeft<<endl;
+ //Round down to nearest multiple of 255
+ //
+
+ //This is important when the packet gets broken because inRemaining is gt locSpace left
+ // In this case where the packet gets broken the final segment on the page must be 255.
+ locSpaceLeft -= (locSpaceLeft % 255);
+ //ASSERT(locSpaceLeft >=0);
+
+ //debugLog<<"Adjust space left = "<<locSpaceLeft<<endl;
+
+ //How much we add is the minimum of
+ // a) How much space is left
+ // b) The amount of packet remaining.
+
+ //If (a) is the minimum then we know that the how much we are adding is a multiple of 255.
+ unsigned long locHowMuchToAdd = MIN(locSpaceLeft, inRemaining);
+
+ //debugLog<<"How much to add..."<<endl;
+ //debugLog<<"How much to add = "<<locHowMuchToAdd<<endl;
+
+ //mPending page has data is useless, it was set before this function is called... need to fix that. maybe move into add part of pack into apge
+ if ((!mPendingPageHasData) && (inStartAt != 0)) {
+ mPendingPage->header()->setHeaderFlags(mPendingPage->header()->HeaderFlags() | OggPageHeader::CONTINUATION);
+
+ }
+
+ if (locHowMuchToAdd > 0) {
+ addPartOfPacketToPage(inOggPacket, inStartAt, locHowMuchToAdd);
+ }
+
+
+ //This puts only a single packet on the first page...
+ if ((mCurrentPageSize >= mSettings->mMinPageSize) || (mPendingPage->header()->PageSequenceNo() == 0) || (locHowMuchToAdd == 0)) {
+ deliverCurrentPage();
+ }
+ return locHowMuchToAdd;
+
+}
+
+bool OggPaginator::addPartOfPacketToPage(StampedOggPacket* inOggPacket, unsigned long inStartFrom, unsigned long inLength) {
+
+ //debugLog<<"Add part of packet to page"<<endl;
+
+ //Buffer the amount of the packet we are going to add.
+ unsigned char* locBuff = new unsigned char[inLength]; //Given to constructor of stampedpacket.
+ memcpy((void*)locBuff, (const void*)(inOggPacket->packetData() + inStartFrom), inLength);
+
+ //unsigned long locBytesOfPacketRemaining = inOggPacket->packetSize() - (((locNumSegsNeeded - (255 - mSegmentTableSize)) * 255);
+ //unsigned long locRemainingPacketStartsAt = inOggPacket->packetSize() - locBytesOfPacketRemaining + 1;
+ //
+
+ //Its the last part of the packet start point plus how much we are adding of it is the same
+ // as the total packet size.
+ bool locIsLastOfPacket = (inStartFrom + inLength == inOggPacket->packetSize());
+
+ //Create a new packet
+ StampedOggPacket* locPartialPacket = new StampedOggPacket( locBuff,
+ inLength,
+ locIsLastOfPacket,
+ false, //Not continuation
+ inOggPacket->startTime(),
+ inOggPacket->endTime(),
+ inOggPacket->mStampType); //Given to page.
+
+ //Add the packet to the page.
+ mPendingPage->addPacket(locPartialPacket);
+
+ //CASES
+ //========
+ //length segs segs if not end
+ // 0 1 N/A
+ // 1 1 N/A
+ // 255 2 1
+ // 256 2
+ // 510 3 2
+ // n (n / 255) + 1
+
+ //Now do the segment table bookkeeping.
+ unsigned long locNumSegsNeeded = (inLength / 255);
+
+ //debugLog<<"Amount to add = "<<inLength<<endl;
+ //debugLog<<"Segs needed = "<<locNumSegsNeeded<<endl;
+
+ //Always do one less than the total... the last segment is a special case
+ //We fill all but the last segemnt with 255
+ for (unsigned long i = 0; i < locNumSegsNeeded; i++) {
+ mSegmentTable[mSegmentTableSize] = 255;
+ mSegmentTableSize++;
+ }
+
+ //If it's not the last of the packet, it will be a multiple of 255, hence we don't put a terminating 0 on.
+ //If it is the last of the packet this last segment will be between 0 and 254 inclusive.
+ if (locIsLastOfPacket) {
+ //Its the last part of the packet... so we need one extra segemnt... to hold the last part.
+ // The last part will be between 0-254
+ //debugLog<<"Is last of packet... adding terminator "<<(unsigned long)(inLength % 255)<<endl;
+ mSegmentTable[mSegmentTableSize] = (unsigned char)(inLength % 255);
+ mSegmentTableSize++;
+
+ //This is used in a calculation below.
+ locNumSegsNeeded++;
+ } else {
+ //If it's not the last part of the packet it should be a multiple of 255. the calling function needs to ensure this.
+ //Since if it was the last part of the packet we've already added all the segments, then we do nothing.
+
+ //ASSERT((inLength % 255) == 0);
+ //if ((inLength % 255) != 0) {
+ // debugLog<<"ASSERTION FAILED !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"<<endl;
+ //}
+ //mSegmentTable[mSegmentTableSize] = (unsigned char)(255);
+ //mSegmentTableSize++;
+ //locNumSegsNeeded++;
+ }
+
+
+ //debugLog<<"Seg table is "<<(unsigned long)mSegmentTableSize<<endl;
+
+ mCurrentPageSize += (locNumSegsNeeded + inLength);
+
+ //debugLog<<"Page is now "<<mCurrentPageSize<<endl;
+ if (locIsLastOfPacket) {
+ //debugLog<<"Setting time for end of page"<<endl;
+ mPendingPage->header()->setGranulePos(inOggPacket->endTime());
+ }
+
+ return true;
+}
+
+
+
+
+
+
+
+bool OggPaginator::setPageCallback(IOggCallback* inPageCallback) {
+ mPageCallback = inPageCallback;
+ return true;
+}
+
+void OggPaginator::setNumHeaders(unsigned long inNumHeaders) {
+ mSettings->mNumHeaders = inNumHeaders;
+}
+unsigned long OggPaginator::numHeaders() {
+ return mSettings->mNumHeaders;
+
+}
+
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,95 +1,95 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
#undef MIN
-#define MIN(a,b) (((a)<(b))?(a):(b))
-
-#include "IStampedOggPacketSink.h"
-#include "OggPaginatorSettings.h"
-#include "IOggCallback.h"
-#include "StampedOggPacket.h"
-
-#include <fstream>
-using namespace std;
-
-class LIBOOOGG_API OggPaginator
- : public IStampedOggPacketSink
-{
-public:
- //TODO::: Have a constructor that lets you set the numheaders.
- OggPaginator(void);
- virtual ~OggPaginator(void);
-
- bool setParameters(OggPaginatorSettings* inSettings);
-
- //IStampedOggPacketSink
- virtual bool acceptStampedOggPacket(StampedOggPacket* inOggPacket);
-
- bool setPageCallback(IOggCallback* inPageCallback);
- bool finishStream();
-
- void setNumHeaders(unsigned long inNumHeaders);
- unsigned long numHeaders();
-
-protected:
- bool deliverCurrentPage();
- bool setChecksum();
- bool createFreshPage();
-
- bool addPacketToPage(StampedOggPacket* inOggPacket);
- unsigned long addAsMuchPacketAsPossible(StampedOggPacket* inOggPacket, unsigned long inStartAt, long inRemaining);
- bool addPartOfPacketToPage(StampedOggPacket* inOggPacket, unsigned long inStartFrom, unsigned long inLength);
- //bool addPartOfPacketToPage(StampedOggPacket* inOggPacket, unsigned long inStartFrom);
-
- unsigned long mPacketCount;
- unsigned long mNumHeaders;
-
- unsigned long mCurrentPageSize;
- unsigned char mSegmentTable[255];
- unsigned char mSegmentTableSize;
- unsigned long mSequenceNo;
- bool mPendingPageHasData;
-
- IOggCallback* mPageCallback;
- OggPaginatorSettings* mSettings;
- OggPage* mPendingPage;
-
- unsigned char* mHeaderBuff;
- //fstream debugLog;
-
- unsigned long mLastGranulePos;
-
-private:
- OggPaginator& operator=(const OggPaginator& other); /* Don't assign me */
- OggPaginator(const OggPaginator& other); /* Don't copy me */
-};
+#define MIN(a,b) (((a)<(b))?(a):(b))
+
+#include "IStampedOggPacketSink.h"
+#include "OggPaginatorSettings.h"
+#include "IOggCallback.h"
+#include "StampedOggPacket.h"
+
+#include <fstream>
+using namespace std;
+
+class LIBOOOGG_API OggPaginator
+ : public IStampedOggPacketSink
+{
+public:
+ //TODO::: Have a constructor that lets you set the numheaders.
+ OggPaginator(void);
+ virtual ~OggPaginator(void);
+
+ bool setParameters(OggPaginatorSettings* inSettings);
+
+ //IStampedOggPacketSink
+ virtual bool acceptStampedOggPacket(StampedOggPacket* inOggPacket);
+
+ bool setPageCallback(IOggCallback* inPageCallback);
+ bool finishStream();
+
+ void setNumHeaders(unsigned long inNumHeaders);
+ unsigned long numHeaders();
+
+protected:
+ bool deliverCurrentPage();
+ bool setChecksum();
+ bool createFreshPage();
+
+ bool addPacketToPage(StampedOggPacket* inOggPacket);
+ unsigned long addAsMuchPacketAsPossible(StampedOggPacket* inOggPacket, unsigned long inStartAt, long inRemaining);
+ bool addPartOfPacketToPage(StampedOggPacket* inOggPacket, unsigned long inStartFrom, unsigned long inLength);
+ //bool addPartOfPacketToPage(StampedOggPacket* inOggPacket, unsigned long inStartFrom);
+
+ unsigned long mPacketCount;
+ unsigned long mNumHeaders;
+
+ unsigned long mCurrentPageSize;
+ unsigned char mSegmentTable[255];
+ unsigned char mSegmentTableSize;
+ unsigned long mSequenceNo;
+ bool mPendingPageHasData;
+
+ IOggCallback* mPageCallback;
+ OggPaginatorSettings* mSettings;
+ OggPage* mPendingPage;
+
+ unsigned char* mHeaderBuff;
+ //fstream debugLog;
+
+ unsigned long mLastGranulePos;
+
+private:
+ OggPaginator& operator=(const OggPaginator& other); /* Don't assign me */
+ OggPaginator(const OggPaginator& other); /* Don't copy me */
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginator.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginatorSettings.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginatorSettings.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginatorSettings.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,46 +1,46 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "stdafx.h"
-#include "OggPaginatorSettings.h"
-
-OggPaginatorSettings::OggPaginatorSettings(void)
- : mSerialNo(0)
- , mMaxPageSize(8192)
- , mTargetPageSize(4096)
- , mMinPageSize(4096)
- , mNumHeaders(0)
-{
-}
-
-OggPaginatorSettings::~OggPaginatorSettings(void)
-{
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "stdafx.h"
+#include "OggPaginatorSettings.h"
+
+OggPaginatorSettings::OggPaginatorSettings(void)
+ : mSerialNo(0)
+ , mMaxPageSize(8192)
+ , mTargetPageSize(4096)
+ , mMinPageSize(4096)
+ , mNumHeaders(0)
+{
+}
+
+OggPaginatorSettings::~OggPaginatorSettings(void)
+{
+}
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginatorSettings.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginatorSettings.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginatorSettings.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginatorSettings.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,46 +1,46 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-class LIBOOOGG_API OggPaginatorSettings
-{
-public:
- OggPaginatorSettings(void);
- ~OggPaginatorSettings(void);
-
- unsigned long mSerialNo;
- unsigned long mMaxPageSize;
- unsigned long mTargetPageSize;
- unsigned long mMinPageSize;
- unsigned long mNumHeaders;
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+class LIBOOOGG_API OggPaginatorSettings
+{
+public:
+ OggPaginatorSettings(void);
+ ~OggPaginatorSettings(void);
+
+ unsigned long mSerialNo;
+ unsigned long mMaxPageSize;
+ unsigned long mTargetPageSize;
+ unsigned long mMinPageSize;
+ unsigned long mNumHeaders;
+
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggPaginatorSettings.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggTypeDefs.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggTypeDefs.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggTypeDefs.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,35 +1,35 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-//Callback function for oggpages.
-#pragma once
-#include "OggPage.h"
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+//Callback function for oggpages.
+#pragma once
+#include "OggPage.h"
typedef bool (*fPageCallback) (OggPage* inOggPage);
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/OggTypeDefs.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/StampedOggPacket.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/StampedOggPacket.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/StampedOggPacket.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,124 +1,124 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "stdafx.h"
-#include "StampedOggPacket.h"
-
-StampedOggPacket::StampedOggPacket(void)
- //: OggPacket()
- : mStampType(NONE)
- , mStartTime(0)
- , mEndTime(0)
-
-{
-}
-
-StampedOggPacket::~StampedOggPacket(void)
-{
-}
-
-StampedOggPacket::StampedOggPacket(unsigned char* inPackData, unsigned long inPacketSize, bool inIsTruncated, bool inIsContinuation, LOOG_INT64 inStartTime = 0, LOOG_INT64 inEndTime = 0, unsigned short inStampType = 0)
- : OggPacket(inPackData, inPacketSize, inIsTruncated, inIsContinuation)
- , mStartTime(inStartTime)
- , mEndTime(inEndTime)
- , mStampType(inStampType)
-
-
-{
- //mStampType =inStampType;
-}
-
-void StampedOggPacket::merge(const StampedOggPacket* inMorePacket) {
-
- //Make a new buffer the size of both data segs together
- unsigned char* locBuff = new unsigned char[mPacketSize + inMorePacket->mPacketSize]; //Stored in the member var and deleted by base destructor
- //Copy this packets data to the start
- memcpy((void*)locBuff, (const void*)mPacketData, mPacketSize);
- //Copy the next packets data after it
- memcpy((void*)(locBuff + mPacketSize), (const void*)inMorePacket->mPacketData, inMorePacket->mPacketSize);
- //Delete our original packet data
- delete[] mPacketData;
- //Now make our data be the combined data
- mPacketData = locBuff;
- //Make the size the sum of both packets
- mPacketSize += inMorePacket->mPacketSize;
-
- //Copy time stamping
-
-
- //Don't copy start stamp, keep the current packets start stamp.
- //mStartTime = inMorePacket->startTime();
- //
- mEndTime = inMorePacket->mEndTime;
- mStampType = inMorePacket->mStampType;
-
- //---::: Changed, uses two flags no.
- //If the next part of the packet isn't complete then this packet is not complete.
- //mIsComplete = inMorePacket->mIsComplete;
-
- //The new packet is truncated only if the incoming packet is
- mIsTruncated = inMorePacket->mIsTruncated;
-
- //This is not a continuation... a continuation is a packet that does not start at the start of the real packet.
- mIsContinuation = false;
-}
-
-//Returns a packet the caller is responsible for.
-OggPacket* StampedOggPacket::clone() {
- //Make a new buffer for packet data
- unsigned char* locBuff = new unsigned char[mPacketSize]; //Given to constructor of stamped packet... it deletes it.
-
- //Copy the packet data into the new buffer
- memcpy((void*)locBuff, (const void*)mPacketData, mPacketSize);
-
- //Create the new packet
- StampedOggPacket* retPack = new StampedOggPacket(locBuff, mPacketSize, mIsTruncated, mIsContinuation, mStartTime, mEndTime, mStampType); //Caller takes responsibiility for this.
- return retPack;
-}
-LOOG_INT64 StampedOggPacket::startTime() {
- return mStartTime;
-}
-LOOG_INT64 StampedOggPacket::endTime() {
- return mEndTime;
-}
-
-void StampedOggPacket::setStartTime(LOOG_INT64 inStartTime) {
- mStartTime = inStartTime;
-}
-void StampedOggPacket::setEndTime(LOOG_INT64 inEndTime) {
- mEndTime = inEndTime;
-}
-
-void StampedOggPacket::setTimeStamp(LOOG_INT64 inStartTime, LOOG_INT64 inEndTime, StampedOggPacket::eStampType inStampType) {
- mStartTime = inStartTime;
- mEndTime = inEndTime;
- mStampType = inStampType;
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "stdafx.h"
+#include "StampedOggPacket.h"
+
+StampedOggPacket::StampedOggPacket(void)
+ //: OggPacket()
+ : mStampType(NONE)
+ , mStartTime(0)
+ , mEndTime(0)
+
+{
+}
+
+StampedOggPacket::~StampedOggPacket(void)
+{
+}
+
+StampedOggPacket::StampedOggPacket(unsigned char* inPackData, unsigned long inPacketSize, bool inIsTruncated, bool inIsContinuation, LOOG_INT64 inStartTime = 0, LOOG_INT64 inEndTime = 0, unsigned short inStampType = 0)
+ : OggPacket(inPackData, inPacketSize, inIsTruncated, inIsContinuation)
+ , mStartTime(inStartTime)
+ , mEndTime(inEndTime)
+ , mStampType(inStampType)
+
+
+{
+ //mStampType =inStampType;
+}
+
+void StampedOggPacket::merge(const StampedOggPacket* inMorePacket) {
+
+ //Make a new buffer the size of both data segs together
+ unsigned char* locBuff = new unsigned char[mPacketSize + inMorePacket->mPacketSize]; //Stored in the member var and deleted by base destructor
+ //Copy this packets data to the start
+ memcpy((void*)locBuff, (const void*)mPacketData, mPacketSize);
+ //Copy the next packets data after it
+ memcpy((void*)(locBuff + mPacketSize), (const void*)inMorePacket->mPacketData, inMorePacket->mPacketSize);
+ //Delete our original packet data
+ delete[] mPacketData;
+ //Now make our data be the combined data
+ mPacketData = locBuff;
+ //Make the size the sum of both packets
+ mPacketSize += inMorePacket->mPacketSize;
+
+ //Copy time stamping
+
+
+ //Don't copy start stamp, keep the current packets start stamp.
+ //mStartTime = inMorePacket->startTime();
+ //
+ mEndTime = inMorePacket->mEndTime;
+ mStampType = inMorePacket->mStampType;
+
+ //---::: Changed, uses two flags no.
+ //If the next part of the packet isn't complete then this packet is not complete.
+ //mIsComplete = inMorePacket->mIsComplete;
+
+ //The new packet is truncated only if the incoming packet is
+ mIsTruncated = inMorePacket->mIsTruncated;
+
+ //This is not a continuation... a continuation is a packet that does not start at the start of the real packet.
+ mIsContinuation = false;
+}
+
+//Returns a packet the caller is responsible for.
+OggPacket* StampedOggPacket::clone() {
+ //Make a new buffer for packet data
+ unsigned char* locBuff = new unsigned char[mPacketSize]; //Given to constructor of stamped packet... it deletes it.
+
+ //Copy the packet data into the new buffer
+ memcpy((void*)locBuff, (const void*)mPacketData, mPacketSize);
+
+ //Create the new packet
+ StampedOggPacket* retPack = new StampedOggPacket(locBuff, mPacketSize, mIsTruncated, mIsContinuation, mStartTime, mEndTime, mStampType); //Caller takes responsibiility for this.
+ return retPack;
+}
+LOOG_INT64 StampedOggPacket::startTime() {
+ return mStartTime;
+}
+LOOG_INT64 StampedOggPacket::endTime() {
+ return mEndTime;
+}
+
+void StampedOggPacket::setStartTime(LOOG_INT64 inStartTime) {
+ mStartTime = inStartTime;
+}
+void StampedOggPacket::setEndTime(LOOG_INT64 inEndTime) {
+ mEndTime = inEndTime;
+}
+
+void StampedOggPacket::setTimeStamp(LOOG_INT64 inStartTime, LOOG_INT64 inEndTime, StampedOggPacket::eStampType inStampType) {
+ mStartTime = inStartTime;
+ mEndTime = inEndTime;
+ mStampType = inStampType;
+}
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/StampedOggPacket.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/StampedOggPacket.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/StampedOggPacket.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/StampedOggPacket.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,74 +1,74 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "stdafx.h"
-#include "oggpacket.h"
-
-class LIBOOOGG_API StampedOggPacket
- : public OggPacket
-{
-public:
- //Constructors
- StampedOggPacket(void);
- StampedOggPacket(unsigned char* inPackData, unsigned long inPacketSize, bool inIsTruncated, bool inIsContinuation, LOOG_INT64 inStartTime, LOOG_INT64 inEndTime, unsigned short inStampType);
- virtual ~StampedOggPacket(void);
- virtual OggPacket* clone();
-
- //Public Constants and Enums
- enum eStampType {
- NONE = 0,
- OGG_END_ONLY = 1,
- OGG_BOTH = 2,
- DIRECTSHOW = 3
- };
- //TODO::: should not be global.
- unsigned short mStampType;
-
- //Time stamp access
- LOOG_INT64 startTime();
- LOOG_INT64 endTime();
-
- void setStartTime(LOOG_INT64 inStartTime);
- void setEndTime(LOOG_INT64 inEndTime);
- void StampedOggPacket::setTimeStamp(LOOG_INT64 inStartTime, LOOG_INT64 inEndTime, StampedOggPacket::eStampType inStampType);
-
- //Merge function
- virtual void merge(const StampedOggPacket* inMorePacket);
-
-protected:
- LOOG_INT64 mStartTime;
- LOOG_INT64 mEndTime;
-
-private:
- StampedOggPacket& operator=(const StampedOggPacket& other); /* Don't assign me */
- StampedOggPacket(const StampedOggPacket& other); /* Don't copy me */
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "stdafx.h"
+#include "oggpacket.h"
+
+class LIBOOOGG_API StampedOggPacket
+ : public OggPacket
+{
+public:
+ //Constructors
+ StampedOggPacket(void);
+ StampedOggPacket(unsigned char* inPackData, unsigned long inPacketSize, bool inIsTruncated, bool inIsContinuation, LOOG_INT64 inStartTime, LOOG_INT64 inEndTime, unsigned short inStampType);
+ virtual ~StampedOggPacket(void);
+ virtual OggPacket* clone();
+
+ //Public Constants and Enums
+ enum eStampType {
+ NONE = 0,
+ OGG_END_ONLY = 1,
+ OGG_BOTH = 2,
+ DIRECTSHOW = 3
+ };
+ //TODO::: should not be global.
+ unsigned short mStampType;
+
+ //Time stamp access
+ LOOG_INT64 startTime();
+ LOOG_INT64 endTime();
+
+ void setStartTime(LOOG_INT64 inStartTime);
+ void setEndTime(LOOG_INT64 inEndTime);
+ void StampedOggPacket::setTimeStamp(LOOG_INT64 inStartTime, LOOG_INT64 inEndTime, StampedOggPacket::eStampType inStampType);
+
+ //Merge function
+ virtual void merge(const StampedOggPacket* inMorePacket);
+
+protected:
+ LOOG_INT64 mStartTime;
+ LOOG_INT64 mEndTime;
+
+private:
+ StampedOggPacket& operator=(const StampedOggPacket& other); /* Don't assign me */
+ StampedOggPacket(const StampedOggPacket& other); /* Don't copy me */
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/StampedOggPacket.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/dllstuff.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/dllstuff.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/dllstuff.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,67 +1,67 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// The following ifdef block is the standard way of creating macros which make exporting
-// from a DLL simpler. All files within this DLL are compiled with the LIBOOOGG_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see
-// LIBOOOGG_API functions as being imported from a DLL, whereas this DLL sees symbols
-// defined with this macro as being exported.
-#pragma once
-
-#ifdef WIN32
-# ifdef LIBOOOGG_EXPORTS
-# define LIBOOOGG_API __declspec(dllexport)
-# else
-# define LIBOOOGG_API __declspec(dllimport)
-# endif
-# include <windows.h>
-#else /* assume POSIX */
-# define LIBOOOGG_API
-# include <stdint.h>
-#endif
-
-#ifndef LOOG_INT64
-# ifdef WIN32
-# define LOOG_INT64 signed __int64
-# else /* assume POSIX */
-# define LOOG_INT64 int64_t
-# endif
-#endif
-
-#ifndef LOOG_UINT64
-# ifdef WIN32
-# define LOOG_UINT64 unsigned __int64
-# else /* assume POSIX */
-# define LOOG_UINT64 uint64_t
-# endif
-#endif
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// The following ifdef block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the LIBOOOGG_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// LIBOOOGG_API functions as being imported from a DLL, whereas this DLL sees symbols
+// defined with this macro as being exported.
+#pragma once
+
+#ifdef WIN32
+# ifdef LIBOOOGG_EXPORTS
+# define LIBOOOGG_API __declspec(dllexport)
+# else
+# define LIBOOOGG_API __declspec(dllimport)
+# endif
+# include <windows.h>
+#else /* assume POSIX */
+# define LIBOOOGG_API
+# include <stdint.h>
+#endif
+
+#ifndef LOOG_INT64
+# ifdef WIN32
+# define LOOG_INT64 signed __int64
+# else /* assume POSIX */
+# define LOOG_INT64 int64_t
+# endif
+#endif
+
+#ifndef LOOG_UINT64
+# ifdef WIN32
+# define LOOG_UINT64 unsigned __int64
+# else /* assume POSIX */
+# define LOOG_UINT64 uint64_t
+# endif
+#endif
+
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/dllstuff.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/libOOOgg.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/libOOOgg.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/libOOOgg.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,52 +1,52 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// libOOOgg.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-#include "libOOOgg.h"
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
-}
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// libOOOgg.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+#include "libOOOgg.h"
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ switch (ul_reason_for_call)
+ {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
+}
+
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/libOOOgg.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/libOOOgg.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/libOOOgg.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/libOOOgg.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,54 +1,54 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "dllstuff.h"
-
-
-
-#include "OggTypeDefs.h"
-#include "IOggCallback.h"
-#include "IStampedOggPacketSink.h"
-
-#include "OggPageHeader.h"
-#include "OggPage.h"
-#include "OggPacket.h"
-#include "StampedOggPacket.h"
-
-#include "OggPacketiser.h"
-#include "OggPaginatorSettings.h"
-#include "OggPaginator.h"
-#include "OggPageInterleaver.h"
-
-#include "OggDataBuffer.h"
-
-
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "dllstuff.h"
+
+
+
+#include "OggTypeDefs.h"
+#include "IOggCallback.h"
+#include "IStampedOggPacketSink.h"
+
+#include "OggPageHeader.h"
+#include "OggPage.h"
+#include "OggPacket.h"
+#include "StampedOggPacket.h"
+
+#include "OggPacketiser.h"
+#include "OggPaginatorSettings.h"
+#include "OggPaginator.h"
+#include "OggPageInterleaver.h"
+
+#include "OggDataBuffer.h"
+
+
+
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/libOOOgg.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,39 +1,39 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.cpp : source file that includes just the standard includes
-// libOOOgg.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.cpp : source file that includes just the standard includes
+// libOOOgg.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOgg/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOgg/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOgg/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,52 +1,52 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-//This disables the numerous warnings due to having stl classes on interfaces. It just means that
-// any program that uses these libraries must already have the headers for the stl classes. They
-// are not exposed by the dll itself.
-#pragma warning (disable:4251)
-#include "dllstuff.h"
-
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-
-#include <string>
-#include <vector>
-
-using namespace std;
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+//This disables the numerous warnings due to having stl classes on interfaces. It just means that
+// any program that uses these libraries must already have the headers for the stl classes. They
+// are not exposed by the dll itself.
+#pragma warning (disable:4251)
+#include "dllstuff.h"
+
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+
+#include <string>
+#include <vector>
+
+using namespace std;
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOgg/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoAnxSeekTable.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoAnxSeekTable.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoAnxSeekTable.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,68 +1,68 @@
-#include "StdAfx.h"
-#include "autoanxseektable.h"
-
-AutoAnxSeekTable::AutoAnxSeekTable(string inFileName)
- : AutoOggSeekTable(inFileName)
- , mAnxPackets(0)
- , mSeenAnything(false)
- , mAnnodexSerialNo(0)
- , mReadyForOgg(false)
- , mSkippedCMML(false)
-{
-}
-
-AutoAnxSeekTable::~AutoAnxSeekTable(void)
-{
- mFile.close();
-}
-
-//IOggCallback interface
-bool AutoAnxSeekTable::acceptOggPage(OggPage* inOggPage) {
- //FIX::: This is serious mess !
- if (mSeenAnything == false) {
- if (strncmp((const char*)inOggPage->getPacket(0)->packetData(), "Annodex", 7) == 0) {
- mAnnodexSerialNo = inOggPage->header()->StreamSerialNo();
- mSeenAnything = true;
- mFilePos += inOggPage->pageSize();
- delete inOggPage;
- return true;
- //Need to grab other info here.
- } else {
- delete inOggPage;
- return false;
- }
- }
-
- if ((mAnnodexSerialNo == inOggPage->header()->StreamSerialNo()) && ((inOggPage->header()->HeaderFlags() & 4) != 0)) {
- //This is the EOS o the annodex section... everything that follows is ogg like
- mReadyForOgg = true;
- mFilePos += inOggPage->pageSize();
- delete inOggPage;
- return true;
- }
-
- //if (mAnnodexSerialNo == inOggPage->header()->StreamSerialNo()) {
- // //Ignore this stuff.
- // return true;
- //} else if (strncmp((const char*)inOggPage->getPacket(0)->packetData(), "AnxData", 7) == 0) {
- // //Seen all the annodex stuff.
- // mReadyForOgg = true;
- // return true;
- //}
-
- if (mReadyForOgg) {
- if (mSkippedCMML == false) {
- mSkippedCMML = true;
- mFilePos += inOggPage->pageSize();
- delete inOggPage;
- return true;
- } else {
- return AutoOggSeekTable::acceptOggPage(inOggPage); //Gives away page.
- }
- } else {
- mFilePos += inOggPage->pageSize();
- }
- delete inOggPage;
- return true;
-
-}
+#include "StdAfx.h"
+#include "autoanxseektable.h"
+
+AutoAnxSeekTable::AutoAnxSeekTable(string inFileName)
+ : AutoOggSeekTable(inFileName)
+ , mAnxPackets(0)
+ , mSeenAnything(false)
+ , mAnnodexSerialNo(0)
+ , mReadyForOgg(false)
+ , mSkippedCMML(false)
+{
+}
+
+AutoAnxSeekTable::~AutoAnxSeekTable(void)
+{
+ mFile.close();
+}
+
+//IOggCallback interface
+bool AutoAnxSeekTable::acceptOggPage(OggPage* inOggPage) {
+ //FIX::: This is serious mess !
+ if (mSeenAnything == false) {
+ if (strncmp((const char*)inOggPage->getPacket(0)->packetData(), "Annodex", 7) == 0) {
+ mAnnodexSerialNo = inOggPage->header()->StreamSerialNo();
+ mSeenAnything = true;
+ mFilePos += inOggPage->pageSize();
+ delete inOggPage;
+ return true;
+ //Need to grab other info here.
+ } else {
+ delete inOggPage;
+ return false;
+ }
+ }
+
+ if ((mAnnodexSerialNo == inOggPage->header()->StreamSerialNo()) && ((inOggPage->header()->HeaderFlags() & 4) != 0)) {
+ //This is the EOS o the annodex section... everything that follows is ogg like
+ mReadyForOgg = true;
+ mFilePos += inOggPage->pageSize();
+ delete inOggPage;
+ return true;
+ }
+
+ //if (mAnnodexSerialNo == inOggPage->header()->StreamSerialNo()) {
+ // //Ignore this stuff.
+ // return true;
+ //} else if (strncmp((const char*)inOggPage->getPacket(0)->packetData(), "AnxData", 7) == 0) {
+ // //Seen all the annodex stuff.
+ // mReadyForOgg = true;
+ // return true;
+ //}
+
+ if (mReadyForOgg) {
+ if (mSkippedCMML == false) {
+ mSkippedCMML = true;
+ mFilePos += inOggPage->pageSize();
+ delete inOggPage;
+ return true;
+ } else {
+ return AutoOggSeekTable::acceptOggPage(inOggPage); //Gives away page.
+ }
+ } else {
+ mFilePos += inOggPage->pageSize();
+ }
+ delete inOggPage;
+ return true;
+
+}
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoAnxSeekTable.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoAnxSeekTable.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoAnxSeekTable.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoAnxSeekTable.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,24 +1,24 @@
-#pragma once
-#include "AutoOggSeekTable.h"
-
-class LIBOOOGGSEEK_API AutoAnxSeekTable
- : public AutoOggSeekTable
-{
-public:
- AutoAnxSeekTable(string inFileName);
- virtual ~AutoAnxSeekTable(void);
-
- //virtual bool buildTable();
-
- //IOggCallback interface
- virtual bool acceptOggPage(OggPage* inOggPage);
-
-protected:
- unsigned long mAnxPackets;
- bool mSeenAnything;
- unsigned long mAnnodexSerialNo;
- bool mReadyForOgg;
- bool mSkippedCMML;
-
-
-};
+#pragma once
+#include "AutoOggSeekTable.h"
+
+class LIBOOOGGSEEK_API AutoAnxSeekTable
+ : public AutoOggSeekTable
+{
+public:
+ AutoAnxSeekTable(string inFileName);
+ virtual ~AutoAnxSeekTable(void);
+
+ //virtual bool buildTable();
+
+ //IOggCallback interface
+ virtual bool acceptOggPage(OggPage* inOggPage);
+
+protected:
+ unsigned long mAnxPackets;
+ bool mSeenAnything;
+ unsigned long mAnnodexSerialNo;
+ bool mReadyForOgg;
+ bool mSkippedCMML;
+
+
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoAnxSeekTable.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,272 +1,272 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "autooggseektable.h"
-
-AutoOggSeekTable::AutoOggSeekTable(string inFileName)
- : mFilePos(0)
- , mLastSeekTime(0)
- , mPacketCount(0)
- , mSampleRate(0)
- , mFileDuration(0)
- , mNumHeaders(0)
- , mSerialNoToTrack(LINT_MAX)
- , isTheora(false)
- , isFLAC(false)
- , isOggFLAC_1_0(false)
- , mFoundStreamInfo(false)
- , mGranulePosShift(0)
- , mLastIsSeekable(false)
-
-{
-
- mFileName = inFileName;
- mOggDemux = new OggDataBuffer(); //Deleted in destructor.
- mOggDemux->registerVirtualCallback(this);
- //debugLog.open("G:\\logs\\seektable.log", ios_base::out);
- //debugLog<<"Constructing seek table for "<<inFileName<<endl;
-}
-
-AutoOggSeekTable::~AutoOggSeekTable(void)
-{
- //debugLog<<"Closing file (Constructor)..."<<endl;
- //debugLog.close();
- mFile.close();
- delete mOggDemux;
-}
-
-bool AutoOggSeekTable::acceptOggPage(OggPage* inOggPage) { //Correctly deletes page.
-
-
- //TODO ::: Some of this could be shared from other places.
- if (!mFoundStreamInfo) {
- if (strncmp((const char*)inOggPage->getPacket(0)->packetData(), "\001vorbis", 7) == 0) {
- mSampleRate = iLE_Math::charArrToULong(inOggPage->getPacket(0)->packetData() + 12);
- mNumHeaders = 3;
- mSerialNoToTrack = inOggPage->header()->StreamSerialNo();
- mFoundStreamInfo = true;
- } else if (strncmp((const char*)inOggPage->getPacket(0)->packetData(), "Speex ", 8) == 0) {
- mSampleRate = iLE_Math::charArrToULong(inOggPage->getPacket(0)->packetData() + 36);
- mNumHeaders = 2;
- mSerialNoToTrack = inOggPage->header()->StreamSerialNo();
- mFoundStreamInfo = true;
- } else if ((strncmp((char*)inOggPage->getPacket(0)->packetData(), "\200theora", 7)) == 0){
- //FIX ::: Dunno what this is... do something better than this later !!
- //mEnabled = false;
- //mPacketCount == 0;
- isTheora = true;
- mSerialNoToTrack = inOggPage->header()->StreamSerialNo();
- mGranulePosShift = (((inOggPage->getPacket(0)->packetData()[40]) % 4) << 3) + ((inOggPage->getPacket(0)->packetData()[41]) >> 5);
- mSampleRate = iBE_Math::charArrToULong(inOggPage->getPacket(0)->packetData() + 22) / iBE_Math::charArrToULong(inOggPage->getPacket(0)->packetData() + 26);
- mNumHeaders = 3;
- mFoundStreamInfo = true;
-
- //Need denominators
- //mTheoraFormatBlock->frameRateDenominator = FLACMath::charArrToULong(locIdentHeader + 26);
- } else if ((strncmp((char*)inOggPage->getPacket(0)->packetData(), "fLaC", 4) == 0)) {
- //mPacketCount--;
- mNumHeaders = 1;
- mSerialNoToTrack = inOggPage->header()->StreamSerialNo();
- isFLAC = true;
- } else if (isFLAC && (mSerialNoToTrack == inOggPage->header()->StreamSerialNo()) ) {
- //Loop any other packets
-
- const int FLAC_LAST_HEADERS_FLAG = 128;
- const int FLAC_HEADER_MASK = 127;
- const int FLAC_STREAM_INFO_ID = 0;
-
- //Note ::: Secondary condition in for statement.
- for (int i = 0; i < inOggPage->numPackets(), !mFoundStreamInfo; i++) {
- mNumHeaders++;
- if ((inOggPage->getPacket(i)->packetData()[0] & FLAC_HEADER_MASK) == FLAC_STREAM_INFO_ID) {
- //Catch the stream info packet.
- mSampleRate = iBE_Math::charArrToULong(inOggPage->getPacket(0)->packetData() + 14) >> 12;
- //mFoundStreamInfo = true;
- }
- if ((inOggPage->getPacket(i)->packetData()[0] & FLAC_LAST_HEADERS_FLAG)) {
- mFoundStreamInfo = true;
- }
- }
- } else if ((strncmp((char*)inOggPage->getPacket(0)->packetData(), "\177FLAC", 5) == 0)) {
- //debugLog<<"Identified new flac..."<<endl;
- //mPacketCount--;
- //POTENTIAL BUG::: Only looks at low order byte
- mNumHeaders = inOggPage->getPacket(0)->packetData()[8] + 1;
- //debugLog<<"Header says there are this many headers "<<mNumHeaders<<endl;
- mSerialNoToTrack = inOggPage->header()->StreamSerialNo();
- if (mNumHeaders == 0) {
- //Variable number of headers... need to pick it up again...
- //debugLog<<"Variable number of headers... 1 so far..."<<endl;
- mNumHeaders = 1;
- isOggFLAC_1_0 = true;
- } else {
- //debugLog<<"Fixed number of headers..."<<endl;
- mFoundStreamInfo = true;
- }
- mSampleRate = iBE_Math::charArrToULong(inOggPage->getPacket(0)->packetData() + 27) >> 12;
- } else if (isOggFLAC_1_0 && (mSerialNoToTrack == inOggPage->header()->StreamSerialNo()) ) {
- //Loop any other packets
-
- const int FLAC_LAST_HEADERS_FLAG = 128;
- const int FLAC_HEADER_MASK = 127;
- const int FLAC_STREAM_INFO_ID = 0;
-
- //Note ::: Secondary condition in for statement.
- for (int i = 0; i < inOggPage->numPackets(), !mFoundStreamInfo; i++) {
- mNumHeaders++;
-
- //Don't need this, we already got this data... we're just counting headers.
- //if ((inOggPage->getPacket(i)->packetData()[0] & FLAC_HEADER_MASK) == FLAC_STREAM_INFO_ID) {
- // //Catch the stream info packet.
- // mSampleRate = iBE_Math::charArrToULong(inOggPage->getPacket(0)->packetData() + 14) >> 12;
- //}
- if ((inOggPage->getPacket(i)->packetData()[0] & FLAC_LAST_HEADERS_FLAG)) {
- mFoundStreamInfo = true;
- }
- }
-
- } else if ((strncmp((char*)inOggPage->getPacket(0)->packetData(), "\001video\000\000\000", 9)) == 0) {
- //FFDSHOW
- LOOG_INT64 locTimePerBlock = iLE_Math::CharArrToInt64(inOggPage->getPacket(0)->packetData() + 17);
- LOOG_INT64 locSamplesPerBlock = iLE_Math::CharArrToInt64(inOggPage->getPacket(0)->packetData() + 25);
-
- mSampleRate = (10000000 / locTimePerBlock) * locSamplesPerBlock;
- mFoundStreamInfo = true;
- mSerialNoToTrack = inOggPage->header()->StreamSerialNo();
- mNumHeaders = 1;
-
- } else {
- mFoundStreamInfo = true; //Why do this ?
- mEnabled = false;
- mSampleRate = 1;
-
- }
- }
-
- if (mSerialNoToTrack == inOggPage->header()->StreamSerialNo()) {
- mPacketCount += inOggPage->numPackets();
- }
-
-
- if ((mFoundStreamInfo) && (mSerialNoToTrack == inOggPage->header()->StreamSerialNo()) && (inOggPage->header()->GranulePos() != -1)) {
- //if ((mPacketCount > 3) && (mLastIsSeekable == true)) {
- //debugLog<<"Stream headers complete..."<<endl;
- //debugLog<<"Num Headers = "<<mNumHeaders<<endl;
- //debugLog<<"Packet COunt = "<<mPacketCount<<endl;
- if ((mPacketCount > mNumHeaders) && ((inOggPage->header()->HeaderFlags() & 1) != 1)) {
- //debugLog<<"Adding seek point Time = "<<mLastSeekTime<<" -- File pos = "<<mFilePos<<endl;
- addSeekPoint(mLastSeekTime, mFilePos);
-
- }
-
- mLastIsSeekable = true;
-
- if (isTheora) {
- unsigned long locMod = (unsigned long)pow((double) 2, (double) mGranulePosShift);
- unsigned long locInterFrameNo = ((inOggPage->header()->GranulePos()) % locMod);
-
- //if (locInterFrameNo == 0) {
- // mLastIsSeekable = true;
- //} else {
- // mLastIsSeekable = false;
- //}
- mLastSeekTime = ((((inOggPage->header()->GranulePos()) >> mGranulePosShift) + locInterFrameNo) * DS_UNITS) / mSampleRate;
- } else {
- mLastSeekTime = ((inOggPage->header()->GranulePos()) * DS_UNITS) / mSampleRate;
- //stDebug<<"Last Seek Time : "<<mLastSeekTime;
- }
- if (((inOggPage->header()->HeaderFlags() & 1) == 1)) {
- //stDebug <<" NOT SEEKABLE";
- mLastIsSeekable = false;
- }
- //stDebug<<endl;
- mFileDuration = mLastSeekTime;
- }
- mFilePos += inOggPage->pageSize();
- //stDebug<<"File Pos : "<<mFilePos<<endl;
-
- //Memory leak ::: Need to delete the page.
- delete inOggPage;
-
- return true;
-}
-unsigned long AutoOggSeekTable::serialisedSize() {
- return mSeekMap.size() * 12;
-
-}
-bool AutoOggSeekTable::serialiseInto(unsigned char* inBuff, unsigned long inBuffSize) {
- if (inBuffSize >= serialisedSize()) {
- unsigned long locUpto = 0;
- for (tSeekMap::const_iterator i = mSeekMap.begin(); i != mSeekMap.end(); i++) {
-
- //Time is .first
- iLE_Math::Int64ToCharArr((*i).first, inBuff + locUpto);
- locUpto += 8;
-
- //Byte offset is .second
- iLE_Math::ULongToCharArr((*i).second, inBuff + locUpto);
- locUpto += 4;
- }
- return true;
- } else {
- return false;
- }
-}
-
-LOOG_INT64 AutoOggSeekTable::fileDuration() {
- return mFileDuration;
-}
-bool AutoOggSeekTable::buildTable() {
- //HACK::: To ensure we don't try and build a table on the network file.
- //debugLog<<"Anx Build table : "<<mFileName<<endl;
- if (mFileName.find("http") != 0) {
-
- //debugLog<<"Opening file... "<<endl;
- mFile.open(mFileName.c_str(), ios_base::in | ios_base::binary);
- const unsigned long BUFF_SIZE = 4096;
- unsigned char* locBuff = new unsigned char[BUFF_SIZE]; //Deleted this function.
- while (!mFile.eof()) {
- mFile.read((char*)locBuff, BUFF_SIZE);
- mOggDemux->feed((const unsigned char*)locBuff, mFile.gcount());
- }
- delete[] locBuff;
- //debugLog<<"Closing File..."<<endl;
- mFile.close();
-
- } else {
- //debugLog<<"Not SEEKABLE"<<endl;
- mEnabled = false;
- mSampleRate = 1;
- }
-
- return true;
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "autooggseektable.h"
+
+AutoOggSeekTable::AutoOggSeekTable(string inFileName)
+ : mFilePos(0)
+ , mLastSeekTime(0)
+ , mPacketCount(0)
+ , mSampleRate(0)
+ , mFileDuration(0)
+ , mNumHeaders(0)
+ , mSerialNoToTrack(LINT_MAX)
+ , isTheora(false)
+ , isFLAC(false)
+ , isOggFLAC_1_0(false)
+ , mFoundStreamInfo(false)
+ , mGranulePosShift(0)
+ , mLastIsSeekable(false)
+
+{
+
+ mFileName = inFileName;
+ mOggDemux = new OggDataBuffer(); //Deleted in destructor.
+ mOggDemux->registerVirtualCallback(this);
+ //debugLog.open("G:\\logs\\seektable.log", ios_base::out);
+ //debugLog<<"Constructing seek table for "<<inFileName<<endl;
+}
+
+AutoOggSeekTable::~AutoOggSeekTable(void)
+{
+ //debugLog<<"Closing file (Constructor)..."<<endl;
+ //debugLog.close();
+ mFile.close();
+ delete mOggDemux;
+}
+
+bool AutoOggSeekTable::acceptOggPage(OggPage* inOggPage) { //Correctly deletes page.
+
+
+ //TODO ::: Some of this could be shared from other places.
+ if (!mFoundStreamInfo) {
+ if (strncmp((const char*)inOggPage->getPacket(0)->packetData(), "\001vorbis", 7) == 0) {
+ mSampleRate = iLE_Math::charArrToULong(inOggPage->getPacket(0)->packetData() + 12);
+ mNumHeaders = 3;
+ mSerialNoToTrack = inOggPage->header()->StreamSerialNo();
+ mFoundStreamInfo = true;
+ } else if (strncmp((const char*)inOggPage->getPacket(0)->packetData(), "Speex ", 8) == 0) {
+ mSampleRate = iLE_Math::charArrToULong(inOggPage->getPacket(0)->packetData() + 36);
+ mNumHeaders = 2;
+ mSerialNoToTrack = inOggPage->header()->StreamSerialNo();
+ mFoundStreamInfo = true;
+ } else if ((strncmp((char*)inOggPage->getPacket(0)->packetData(), "\200theora", 7)) == 0){
+ //FIX ::: Dunno what this is... do something better than this later !!
+ //mEnabled = false;
+ //mPacketCount == 0;
+ isTheora = true;
+ mSerialNoToTrack = inOggPage->header()->StreamSerialNo();
+ mGranulePosShift = (((inOggPage->getPacket(0)->packetData()[40]) % 4) << 3) + ((inOggPage->getPacket(0)->packetData()[41]) >> 5);
+ mSampleRate = iBE_Math::charArrToULong(inOggPage->getPacket(0)->packetData() + 22) / iBE_Math::charArrToULong(inOggPage->getPacket(0)->packetData() + 26);
+ mNumHeaders = 3;
+ mFoundStreamInfo = true;
+
+ //Need denominators
+ //mTheoraFormatBlock->frameRateDenominator = FLACMath::charArrToULong(locIdentHeader + 26);
+ } else if ((strncmp((char*)inOggPage->getPacket(0)->packetData(), "fLaC", 4) == 0)) {
+ //mPacketCount--;
+ mNumHeaders = 1;
+ mSerialNoToTrack = inOggPage->header()->StreamSerialNo();
+ isFLAC = true;
+ } else if (isFLAC && (mSerialNoToTrack == inOggPage->header()->StreamSerialNo()) ) {
+ //Loop any other packets
+
+ const int FLAC_LAST_HEADERS_FLAG = 128;
+ const int FLAC_HEADER_MASK = 127;
+ const int FLAC_STREAM_INFO_ID = 0;
+
+ //Note ::: Secondary condition in for statement.
+ for (int i = 0; i < inOggPage->numPackets(), !mFoundStreamInfo; i++) {
+ mNumHeaders++;
+ if ((inOggPage->getPacket(i)->packetData()[0] & FLAC_HEADER_MASK) == FLAC_STREAM_INFO_ID) {
+ //Catch the stream info packet.
+ mSampleRate = iBE_Math::charArrToULong(inOggPage->getPacket(0)->packetData() + 14) >> 12;
+ //mFoundStreamInfo = true;
+ }
+ if ((inOggPage->getPacket(i)->packetData()[0] & FLAC_LAST_HEADERS_FLAG)) {
+ mFoundStreamInfo = true;
+ }
+ }
+ } else if ((strncmp((char*)inOggPage->getPacket(0)->packetData(), "\177FLAC", 5) == 0)) {
+ //debugLog<<"Identified new flac..."<<endl;
+ //mPacketCount--;
+ //POTENTIAL BUG::: Only looks at low order byte
+ mNumHeaders = inOggPage->getPacket(0)->packetData()[8] + 1;
+ //debugLog<<"Header says there are this many headers "<<mNumHeaders<<endl;
+ mSerialNoToTrack = inOggPage->header()->StreamSerialNo();
+ if (mNumHeaders == 0) {
+ //Variable number of headers... need to pick it up again...
+ //debugLog<<"Variable number of headers... 1 so far..."<<endl;
+ mNumHeaders = 1;
+ isOggFLAC_1_0 = true;
+ } else {
+ //debugLog<<"Fixed number of headers..."<<endl;
+ mFoundStreamInfo = true;
+ }
+ mSampleRate = iBE_Math::charArrToULong(inOggPage->getPacket(0)->packetData() + 27) >> 12;
+ } else if (isOggFLAC_1_0 && (mSerialNoToTrack == inOggPage->header()->StreamSerialNo()) ) {
+ //Loop any other packets
+
+ const int FLAC_LAST_HEADERS_FLAG = 128;
+ const int FLAC_HEADER_MASK = 127;
+ const int FLAC_STREAM_INFO_ID = 0;
+
+ //Note ::: Secondary condition in for statement.
+ for (int i = 0; i < inOggPage->numPackets(), !mFoundStreamInfo; i++) {
+ mNumHeaders++;
+
+ //Don't need this, we already got this data... we're just counting headers.
+ //if ((inOggPage->getPacket(i)->packetData()[0] & FLAC_HEADER_MASK) == FLAC_STREAM_INFO_ID) {
+ // //Catch the stream info packet.
+ // mSampleRate = iBE_Math::charArrToULong(inOggPage->getPacket(0)->packetData() + 14) >> 12;
+ //}
+ if ((inOggPage->getPacket(i)->packetData()[0] & FLAC_LAST_HEADERS_FLAG)) {
+ mFoundStreamInfo = true;
+ }
+ }
+
+ } else if ((strncmp((char*)inOggPage->getPacket(0)->packetData(), "\001video\000\000\000", 9)) == 0) {
+ //FFDSHOW
+ LOOG_INT64 locTimePerBlock = iLE_Math::CharArrToInt64(inOggPage->getPacket(0)->packetData() + 17);
+ LOOG_INT64 locSamplesPerBlock = iLE_Math::CharArrToInt64(inOggPage->getPacket(0)->packetData() + 25);
+
+ mSampleRate = (10000000 / locTimePerBlock) * locSamplesPerBlock;
+ mFoundStreamInfo = true;
+ mSerialNoToTrack = inOggPage->header()->StreamSerialNo();
+ mNumHeaders = 1;
+
+ } else {
+ mFoundStreamInfo = true; //Why do this ?
+ mEnabled = false;
+ mSampleRate = 1;
+
+ }
+ }
+
+ if (mSerialNoToTrack == inOggPage->header()->StreamSerialNo()) {
+ mPacketCount += inOggPage->numPackets();
+ }
+
+
+ if ((mFoundStreamInfo) && (mSerialNoToTrack == inOggPage->header()->StreamSerialNo()) && (inOggPage->header()->GranulePos() != -1)) {
+ //if ((mPacketCount > 3) && (mLastIsSeekable == true)) {
+ //debugLog<<"Stream headers complete..."<<endl;
+ //debugLog<<"Num Headers = "<<mNumHeaders<<endl;
+ //debugLog<<"Packet COunt = "<<mPacketCount<<endl;
+ if ((mPacketCount > mNumHeaders) && ((inOggPage->header()->HeaderFlags() & 1) != 1)) {
+ //debugLog<<"Adding seek point Time = "<<mLastSeekTime<<" -- File pos = "<<mFilePos<<endl;
+ addSeekPoint(mLastSeekTime, mFilePos);
+
+ }
+
+ mLastIsSeekable = true;
+
+ if (isTheora) {
+ unsigned long locMod = (unsigned long)pow((double) 2, (double) mGranulePosShift);
+ unsigned long locInterFrameNo = ((inOggPage->header()->GranulePos()) % locMod);
+
+ //if (locInterFrameNo == 0) {
+ // mLastIsSeekable = true;
+ //} else {
+ // mLastIsSeekable = false;
+ //}
+ mLastSeekTime = ((((inOggPage->header()->GranulePos()) >> mGranulePosShift) + locInterFrameNo) * DS_UNITS) / mSampleRate;
+ } else {
+ mLastSeekTime = ((inOggPage->header()->GranulePos()) * DS_UNITS) / mSampleRate;
+ //stDebug<<"Last Seek Time : "<<mLastSeekTime;
+ }
+ if (((inOggPage->header()->HeaderFlags() & 1) == 1)) {
+ //stDebug <<" NOT SEEKABLE";
+ mLastIsSeekable = false;
+ }
+ //stDebug<<endl;
+ mFileDuration = mLastSeekTime;
+ }
+ mFilePos += inOggPage->pageSize();
+ //stDebug<<"File Pos : "<<mFilePos<<endl;
+
+ //Memory leak ::: Need to delete the page.
+ delete inOggPage;
+
+ return true;
+}
+unsigned long AutoOggSeekTable::serialisedSize() {
+ return mSeekMap.size() * 12;
+
+}
+bool AutoOggSeekTable::serialiseInto(unsigned char* inBuff, unsigned long inBuffSize) {
+ if (inBuffSize >= serialisedSize()) {
+ unsigned long locUpto = 0;
+ for (tSeekMap::const_iterator i = mSeekMap.begin(); i != mSeekMap.end(); i++) {
+
+ //Time is .first
+ iLE_Math::Int64ToCharArr((*i).first, inBuff + locUpto);
+ locUpto += 8;
+
+ //Byte offset is .second
+ iLE_Math::ULongToCharArr((*i).second, inBuff + locUpto);
+ locUpto += 4;
+ }
+ return true;
+ } else {
+ return false;
+ }
+}
+
+LOOG_INT64 AutoOggSeekTable::fileDuration() {
+ return mFileDuration;
+}
+bool AutoOggSeekTable::buildTable() {
+ //HACK::: To ensure we don't try and build a table on the network file.
+ //debugLog<<"Anx Build table : "<<mFileName<<endl;
+ if (mFileName.find("http") != 0) {
+
+ //debugLog<<"Opening file... "<<endl;
+ mFile.open(mFileName.c_str(), ios_base::in | ios_base::binary);
+ const unsigned long BUFF_SIZE = 4096;
+ unsigned char* locBuff = new unsigned char[BUFF_SIZE]; //Deleted this function.
+ while (!mFile.eof()) {
+ mFile.read((char*)locBuff, BUFF_SIZE);
+ mOggDemux->feed((const unsigned char*)locBuff, mFile.gcount());
+ }
+ delete[] locBuff;
+ //debugLog<<"Closing File..."<<endl;
+ mFile.close();
+
+ } else {
+ //debugLog<<"Not SEEKABLE"<<endl;
+ mEnabled = false;
+ mSampleRate = 1;
+ }
+
+ return true;
+}
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,86 +1,86 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "oggseektable.h"
-#include "dllstuff.h"
-#include "IOggCallback.h"
-#include "OggDataBuffer.h"
-#include "iBE_Math.h"
-#include "iLE_Math.h"
-//#include "FLACMath.h"
-#include "math.h"
-#include <fstream>
-using namespace std;
-class LIBOOOGGSEEK_API AutoOggSeekTable
- : public OggSeekTable
- , public IOggCallback
-{
-public:
- AutoOggSeekTable(string inFileName);
- virtual ~AutoOggSeekTable(void);
-
- static const LOOG_INT64 DS_UNITS = 10000000;
- static const unsigned long LINT_MAX = 4294967295UL;
-
- virtual bool buildTable();
-
- //IOggCallback interface
- virtual bool acceptOggPage(OggPage* inOggPage);
-
- LOOG_INT64 fileDuration();
-
- unsigned long serialisedSize();
- bool serialiseInto(unsigned char* inBuff, unsigned long inBuffSize);
-
-protected:
- unsigned long mFilePos;
- unsigned long mPacketCount;
- unsigned long mSampleRate;
- unsigned long mNumHeaders;
-
- unsigned long mSerialNoToTrack;
- unsigned long mGranulePosShift;
- bool mLastIsSeekable;
- bool isTheora;
- bool isFLAC;
- bool isOggFLAC_1_0;
- bool mFoundStreamInfo;
- LOOG_INT64 mLastSeekTime;
- LOOG_INT64 mFileDuration;
- fstream mFile;
- string mFileName;
- //Changed for debugging to *
- OggDataBuffer* mOggDemux;
-
- //fstream debugLog;
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "oggseektable.h"
+#include "dllstuff.h"
+#include "IOggCallback.h"
+#include "OggDataBuffer.h"
+#include "iBE_Math.h"
+#include "iLE_Math.h"
+//#include "FLACMath.h"
+#include "math.h"
+#include <fstream>
+using namespace std;
+class LIBOOOGGSEEK_API AutoOggSeekTable
+ : public OggSeekTable
+ , public IOggCallback
+{
+public:
+ AutoOggSeekTable(string inFileName);
+ virtual ~AutoOggSeekTable(void);
+
+ static const LOOG_INT64 DS_UNITS = 10000000;
+ static const unsigned long LINT_MAX = 4294967295UL;
+
+ virtual bool buildTable();
+
+ //IOggCallback interface
+ virtual bool acceptOggPage(OggPage* inOggPage);
+
+ LOOG_INT64 fileDuration();
+
+ unsigned long serialisedSize();
+ bool serialiseInto(unsigned char* inBuff, unsigned long inBuffSize);
+
+protected:
+ unsigned long mFilePos;
+ unsigned long mPacketCount;
+ unsigned long mSampleRate;
+ unsigned long mNumHeaders;
+
+ unsigned long mSerialNoToTrack;
+ unsigned long mGranulePosShift;
+ bool mLastIsSeekable;
+ bool isTheora;
+ bool isFLAC;
+ bool isOggFLAC_1_0;
+ bool mFoundStreamInfo;
+ LOOG_INT64 mLastSeekTime;
+ LOOG_INT64 mFileDuration;
+ fstream mFile;
+ string mFileName;
+ //Changed for debugging to *
+ OggDataBuffer* mOggDemux;
+
+ //fstream debugLog;
+
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/AutoOggSeekTable.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/IOggSeeker.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/IOggSeeker.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/IOggSeeker.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,17 +1,17 @@
-class IOggSeeker {
-
- IOggSeeker();
- virtual ~IOggSeeker();
-
- typedef pair<__int64, unsigned long> tSeekPair;
- virtual bool buildTable();
-
- //IOggCallback interface
- virtual bool acceptOggPage(OggPage* inOggPage);
-
- __int64 fileDuration();
-
- bool addSeekPoint(__int64 inTime, unsigned long mStartPos);
- tSeekPair getStartPos(__int64 inTime);
- bool enabled();
+class IOggSeeker {
+
+ IOggSeeker();
+ virtual ~IOggSeeker();
+
+ typedef pair<__int64, unsigned long> tSeekPair;
+ virtual bool buildTable();
+
+ //IOggCallback interface
+ virtual bool acceptOggPage(OggPage* inOggPage);
+
+ __int64 fileDuration();
+
+ bool addSeekPoint(__int64 inTime, unsigned long mStartPos);
+ tSeekPair getStartPos(__int64 inTime);
+ bool enabled();
};
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/IOggSeeker.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OGGSRecogniser.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OGGSRecogniser.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OGGSRecogniser.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,60 +1,60 @@
-#include "StdAfx.h"
-#include "oggsrecogniser.h"
-
-OGGSRecogniser::OGGSRecogniser(void)
-: mState(OGGSRecogniser::STATE_START)
-{
-}
-
-OGGSRecogniser::~OGGSRecogniser(void)
-{
-}
-
-
-long OGGSRecogniser::feed(unsigned char* inBuff, unsigned long inNumBytes) {
-
- for (unsigned long i = 0; i < inNumBytes; i++) {
- switch (mState) {
- case STATE_START:
- //Haven't matched anything
- if (inBuff[i] == 'O') {
- mState = STATE_O;
- }
- break;
- case STATE_O:
- //Already matched an O
- if (inBuff[i] == 'g') {
- //Now advance t the g state
- mState = STATE_G1;
- } else {
- //Anything but a g and we move back to the start state.
- mState = STATE_START;
- }
- break;
- case STATE_G1:
- if (inBuff[i] == 'g') {
- mState = STATE_G2;
- } else {
- mState = STATE_START;
- }
- break;
- case STATE_G2:
- if (inBuff[i] == 'S') {
- mState = STATE_START;
- return (i);
- } else {
- mState = STATE_START;
- }
-
- break;
- default:
- //Should never be in an invalid state.
- throw 0;
- }
- }
-
- return -1;
-}
-void OGGSRecogniser::resetState() {
- mState = STATE_START;
-}
+#include "StdAfx.h"
+#include "oggsrecogniser.h"
+
+OGGSRecogniser::OGGSRecogniser(void)
+: mState(OGGSRecogniser::STATE_START)
+{
+}
+
+OGGSRecogniser::~OGGSRecogniser(void)
+{
+}
+
+
+long OGGSRecogniser::feed(unsigned char* inBuff, unsigned long inNumBytes) {
+
+ for (unsigned long i = 0; i < inNumBytes; i++) {
+ switch (mState) {
+ case STATE_START:
+ //Haven't matched anything
+ if (inBuff[i] == 'O') {
+ mState = STATE_O;
+ }
+ break;
+ case STATE_O:
+ //Already matched an O
+ if (inBuff[i] == 'g') {
+ //Now advance t the g state
+ mState = STATE_G1;
+ } else {
+ //Anything but a g and we move back to the start state.
+ mState = STATE_START;
+ }
+ break;
+ case STATE_G1:
+ if (inBuff[i] == 'g') {
+ mState = STATE_G2;
+ } else {
+ mState = STATE_START;
+ }
+ break;
+ case STATE_G2:
+ if (inBuff[i] == 'S') {
+ mState = STATE_START;
+ return (i);
+ } else {
+ mState = STATE_START;
+ }
+
+ break;
+ default:
+ //Should never be in an invalid state.
+ throw 0;
+ }
+ }
+
+ return -1;
+}
+void OGGSRecogniser::resetState() {
+ mState = STATE_START;
+}
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OGGSRecogniser.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OGGSRecogniser.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OGGSRecogniser.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OGGSRecogniser.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,24 +1,24 @@
-#pragma once
-
-class OGGSRecogniser
-{
-public:
- OGGSRecogniser(void);
- ~OGGSRecogniser(void);
-
- enum eOggRecogState {
- STATE_START = 0,
- STATE_O,
- STATE_G1,
- STATE_G2
-
-
- };
-
- long feed(unsigned char* inBuff, unsigned long inNumBytes);
- void resetState();
-
-protected:
- eOggRecogState mState;
-
-};
+#pragma once
+
+class OGGSRecogniser
+{
+public:
+ OGGSRecogniser(void);
+ ~OGGSRecogniser(void);
+
+ enum eOggRecogState {
+ STATE_START = 0,
+ STATE_O,
+ STATE_G1,
+ STATE_G2
+
+
+ };
+
+ long feed(unsigned char* inBuff, unsigned long inNumBytes);
+ void resetState();
+
+protected:
+ eOggRecogState mState;
+
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OGGSRecogniser.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,16 +1,16 @@
-#include "StdAfx.h"
-#include "oggbinaryseeker.h"
-
-OggBinarySeeker::OggBinarySeeker(void)
-{
-}
-
-OggBinarySeeker::~OggBinarySeeker(void)
-{
-}
-
-OggSeekTable::tSeekPair OggBinarySeeker::getStartPos(LOOG_INT64 inTime) {
-
-
-
-}
+#include "StdAfx.h"
+#include "oggbinaryseeker.h"
+
+OggBinarySeeker::OggBinarySeeker(void)
+{
+}
+
+OggBinarySeeker::~OggBinarySeeker(void)
+{
+}
+
+OggSeekTable::tSeekPair OggBinarySeeker::getStartPos(LOOG_INT64 inTime) {
+
+
+
+}
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,12 +1,12 @@
-#pragma once
-#include "oggseektable.h"
-
-class OggBinarySeeker :
- public OggSeekTable
-{
-public:
- OggBinarySeeker(void);
- virtual ~OggBinarySeeker(void);
-
- tSeekPair getStartPos(LOOG_INT64 inTime);
-};
+#pragma once
+#include "oggseektable.h"
+
+class OggBinarySeeker :
+ public OggSeekTable
+{
+public:
+ OggBinarySeeker(void);
+ virtual ~OggBinarySeeker(void);
+
+ tSeekPair getStartPos(LOOG_INT64 inTime);
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggBinarySeeker.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekPoint.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekPoint.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekPoint.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,43 +1,43 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "oggseekpoint.h"
-
-OggSeekPoint::OggSeekPoint(void)
- : mTime(0)
- , mStartPos(0)
-{
-}
-
-OggSeekPoint::~OggSeekPoint(void)
-{
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "oggseekpoint.h"
+
+OggSeekPoint::OggSeekPoint(void)
+ : mTime(0)
+ , mStartPos(0)
+{
+}
+
+OggSeekPoint::~OggSeekPoint(void)
+{
+}
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekPoint.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekPoint.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekPoint.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekPoint.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,46 +1,46 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-#include "libillicore.h"
-
-class OggSeekPoint
-{
-public:
- OggSeekPoint(void);
- ~OggSeekPoint(void);
-
- LOOG_INT64 mTime;
- unsigned long mStartPos;
-
-protected:
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+#include "libillicore.h"
+
+class OggSeekPoint
+{
+public:
+ OggSeekPoint(void);
+ ~OggSeekPoint(void);
+
+ LOOG_INT64 mTime;
+ unsigned long mStartPos;
+
+protected:
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekPoint.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,71 +1,71 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "oggseektable.h"
-
-OggSeekTable::OggSeekTable(void)
- : mEnabled(true)
- , mRealStartPos(0)
-{
- mSeekMap.clear();
- mSeekMap.empty();
- //stDebug.open("G:\\logs\\sktable.log", ios_base::out);
-}
-
-OggSeekTable::~OggSeekTable(void)
-{
- //stDebug.close();
-}
-
-bool OggSeekTable::enabled() {
- return mEnabled;
-}
-bool OggSeekTable::addSeekPoint(LOOG_INT64 inTime, unsigned long mStartPos) {
- //stDebug<< "Add Point : Time = "<<inTime<<" -- Byte Pos : "<<mStartPos<<endl;
- mSeekMap.insert(tSeekMap::value_type(inTime, mStartPos));
-
- return true;
-
-}
-
-LOOG_INT64 OggSeekTable::getRealStartPos() {
-
- return mRealStartPos;
-
-}
-OggSeekTable::tSeekPair OggSeekTable::getStartPos(LOOG_INT64 inTime) {
- return *(mSeekMap.lower_bound(inTime));
- //mRealStartPos = locValue.first;
- //stDebug<<"Get Point : Time Req = "<<inTime<<" -- Time Given = "<<mRealStartPos<<" -- Byte Pos : "<<locValue.second<<endl;
- //return locValue.second;
-
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "oggseektable.h"
+
+OggSeekTable::OggSeekTable(void)
+ : mEnabled(true)
+ , mRealStartPos(0)
+{
+ mSeekMap.clear();
+ mSeekMap.empty();
+ //stDebug.open("G:\\logs\\sktable.log", ios_base::out);
+}
+
+OggSeekTable::~OggSeekTable(void)
+{
+ //stDebug.close();
+}
+
+bool OggSeekTable::enabled() {
+ return mEnabled;
+}
+bool OggSeekTable::addSeekPoint(LOOG_INT64 inTime, unsigned long mStartPos) {
+ //stDebug<< "Add Point : Time = "<<inTime<<" -- Byte Pos : "<<mStartPos<<endl;
+ mSeekMap.insert(tSeekMap::value_type(inTime, mStartPos));
+
+ return true;
+
+}
+
+LOOG_INT64 OggSeekTable::getRealStartPos() {
+
+ return mRealStartPos;
+
+}
+OggSeekTable::tSeekPair OggSeekTable::getStartPos(LOOG_INT64 inTime) {
+ return *(mSeekMap.lower_bound(inTime));
+ //mRealStartPos = locValue.first;
+ //stDebug<<"Get Point : Time Req = "<<inTime<<" -- Time Given = "<<mRealStartPos<<" -- Byte Pos : "<<locValue.second<<endl;
+ //return locValue.second;
+
+}
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,62 +1,62 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "libillicore.h"
-#include "libOOOggSeek.h"
-#include <fstream>
-#include <map>
-using namespace std;
-
-class LIBOOOGGSEEK_API OggSeekTable
-{
-public:
- OggSeekTable(void);
- virtual ~OggSeekTable(void);
-
- typedef pair<LOOG_INT64, unsigned long> tSeekPair;
-
- bool addSeekPoint(LOOG_INT64 inTime, unsigned long mStartPos);
- tSeekPair getStartPos(LOOG_INT64 inTime);
- LOOG_INT64 getRealStartPos();
-
- bool enabled();
-
-
-protected:
- typedef map<LOOG_INT64, unsigned long> tSeekMap;
- tSeekMap mSeekMap;
- tSeekMap::value_type mSeekValue;
- LOOG_INT64 mRealStartPos;
-
- //fstream stDebug;
- bool mEnabled;
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "libillicore.h"
+#include "libOOOggSeek.h"
+#include <fstream>
+#include <map>
+using namespace std;
+
+class LIBOOOGGSEEK_API OggSeekTable
+{
+public:
+ OggSeekTable(void);
+ virtual ~OggSeekTable(void);
+
+ typedef pair<LOOG_INT64, unsigned long> tSeekPair;
+
+ bool addSeekPoint(LOOG_INT64 inTime, unsigned long mStartPos);
+ tSeekPair getStartPos(LOOG_INT64 inTime);
+ LOOG_INT64 getRealStartPos();
+
+ bool enabled();
+
+
+protected:
+ typedef map<LOOG_INT64, unsigned long> tSeekMap;
+ tSeekMap mSeekMap;
+ tSeekMap::value_type mSeekValue;
+ LOOG_INT64 mRealStartPos;
+
+ //fstream stDebug;
+ bool mEnabled;
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/OggSeekTable.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,52 +1,52 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// libOOOggSeek.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-#include "libOOOggSeek.h"
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
-}
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// libOOOggSeek.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+#include "libOOOggSeek.h"
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ switch (ul_reason_for_call)
+ {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
+}
+
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,47 +1,47 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// The following ifdef block is the standard way of creating macros which make exporting
-// from a DLL simpler. All files within this DLL are compiled with the LIBOOOGGSEEK_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see
-// LIBOOOGGSEEK_API functions as being imported from a DLL, whereas this DLL sees symbols
-// defined with this macro as being exported.
-#ifdef WIN32
-# ifdef LIBOOOGGSEEK_EXPORTS
-# define LIBOOOGGSEEK_API __declspec(dllexport)
-# else
-# define LIBOOOGGSEEK_API __declspec(dllimport)
-# endif
-#else
-# define LIBOOOGGSEEK_API
-#endif
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// The following ifdef block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the LIBOOOGGSEEK_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// LIBOOOGGSEEK_API functions as being imported from a DLL, whereas this DLL sees symbols
+// defined with this macro as being exported.
+#ifdef WIN32
+# ifdef LIBOOOGGSEEK_EXPORTS
+# define LIBOOOGGSEEK_API __declspec(dllexport)
+# else
+# define LIBOOOGGSEEK_API __declspec(dllimport)
+# endif
+#else
+# define LIBOOOGGSEEK_API
+#endif
+
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/libOOOggSeek.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,39 +1,39 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.cpp : source file that includes just the standard includes
-// libOOOggSeek.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.cpp : source file that includes just the standard includes
+// libOOOggSeek.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,43 +1,43 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-
-#ifdef WIN32
-# include <windows.h>
-#endif
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+
+#ifdef WIN32
+# include <windows.h>
+#endif
Property changes on: trunk/oggdsf/src/lib/core/ogg/libOOOggSeek/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/FileComments.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisComment/FileComments.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisComment/FileComments.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,142 +1,142 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "filecomments.h"
-
-FileComments::FileComments(void)
- : mMinorStreamCount(0)
-{
-}
-
-FileComments::~FileComments(void)
-{
-}
-
-bool FileComments::acceptOggPage(OggPage* inOggPage) { //Correctly deletes page.
- //Get a callback... check whether we have a comment.
- VorbisComments* locVorbisComments = NULL;
- StreamCommentInfo* locStreamInfo = NULL;
- for (unsigned long i = 0; i < inOggPage->numPackets(); i++) {
- OggPacket* locPacket = NULL;
- locPacket = inOggPage->getPacket(i);
- if (strncmp((const char*)locPacket->packetData(), "\003vorbis", 7) == 0) {
- //Comment Packet
- locVorbisComments = new VorbisComments;
- locStreamInfo = new StreamCommentInfo;
- bool locIsOK = locVorbisComments->parseOggPacket(locPacket, 7);
-
- locStreamInfo->setCodecID(StreamCommentInfo::VORBIS);
- locStreamInfo->setPageStart(mBytePos);
- locStreamInfo->setComments(locVorbisComments);
- locStreamInfo->setMajorStreamNo(0); //Temp... increase for chaining
- locStreamInfo->setMinorStreamNo(mMinorStreamCount);
- mStreams.push_back(locStreamInfo);
- mMinorStreamCount++;
-
-
- } else if ((strncmp((char*)locPacket->packetData(), "\201theora", 7)) == 0) {
- locVorbisComments = new VorbisComments;
- locStreamInfo = new StreamCommentInfo;
- bool locIsOK = locVorbisComments->parseOggPacket(locPacket, 7);
- locStreamInfo->setCodecID(StreamCommentInfo::THEORA);
- locStreamInfo->setPageStart(mBytePos);
- locStreamInfo->setComments(locVorbisComments);
- locStreamInfo->setMajorStreamNo(0); //Temp... increase for chaining
- locStreamInfo->setMinorStreamNo(mMinorStreamCount);
- mStreams.push_back(locStreamInfo);
-
- mMinorStreamCount++;
- }
- }
- mBytePos += inOggPage->pageSize();
-
- delete inOggPage;
- return true;
-
-}
-bool FileComments::loadFile(string inFileName) {
- mBytePos = 0;
- const unsigned long BUFF_SIZE = 4096;
- OggDataBuffer locOggBuff;
-
- locOggBuff.registerVirtualCallback(this);
-
- fstream locFile;
- locFile.open(inFileName.c_str(), ios_base::in | ios_base::binary);
- if (locFile.is_open() != true) {
- return false;
- }
- char* locBuff = new char[BUFF_SIZE];
- unsigned long locBytesRead = 0;
- while (!locFile.eof()) {
- locFile.read(locBuff, BUFF_SIZE);
- locBytesRead = locFile.gcount();
- locOggBuff.feed((const unsigned char*)locBuff, locBytesRead);
- }
-
- delete[] locBuff;
-
-}
-string FileComments::fileName() {
- return mFileName;
-}
-
-bool FileComments::writeOutAll(string inFileName) {
-
- fstream locFile;
- locFile.open(inFileName.c_str(), ios_base::out | ios_base::in | ios_base::binary);
-
- if (locFile.is_open()) {
-
-
- }
- return false;
-}
-bool FileComments::writeOutStream(unsigned long inIndex) {
- return false;
-}
-
-bool FileComments::addStreamComment(StreamCommentInfo* inStreamComment) {
- mStreams.push_back(inStreamComment);
- return true;
-}
-StreamCommentInfo* FileComments::getStreamComment(unsigned long inIndex) {
- if (inIndex < mStreams.size()) {
- return mStreams[inIndex];
- } else {
- return NULL;
- }
-}
-
-unsigned long FileComments::streamCount() {
- return (unsigned long)mStreams.size();
-}
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "filecomments.h"
+
+FileComments::FileComments(void)
+ : mMinorStreamCount(0)
+{
+}
+
+FileComments::~FileComments(void)
+{
+}
+
+bool FileComments::acceptOggPage(OggPage* inOggPage) { //Correctly deletes page.
+ //Get a callback... check whether we have a comment.
+ VorbisComments* locVorbisComments = NULL;
+ StreamCommentInfo* locStreamInfo = NULL;
+ for (unsigned long i = 0; i < inOggPage->numPackets(); i++) {
+ OggPacket* locPacket = NULL;
+ locPacket = inOggPage->getPacket(i);
+ if (strncmp((const char*)locPacket->packetData(), "\003vorbis", 7) == 0) {
+ //Comment Packet
+ locVorbisComments = new VorbisComments;
+ locStreamInfo = new StreamCommentInfo;
+ bool locIsOK = locVorbisComments->parseOggPacket(locPacket, 7);
+
+ locStreamInfo->setCodecID(StreamCommentInfo::VORBIS);
+ locStreamInfo->setPageStart(mBytePos);
+ locStreamInfo->setComments(locVorbisComments);
+ locStreamInfo->setMajorStreamNo(0); //Temp... increase for chaining
+ locStreamInfo->setMinorStreamNo(mMinorStreamCount);
+ mStreams.push_back(locStreamInfo);
+ mMinorStreamCount++;
+
+
+ } else if ((strncmp((char*)locPacket->packetData(), "\201theora", 7)) == 0) {
+ locVorbisComments = new VorbisComments;
+ locStreamInfo = new StreamCommentInfo;
+ bool locIsOK = locVorbisComments->parseOggPacket(locPacket, 7);
+ locStreamInfo->setCodecID(StreamCommentInfo::THEORA);
+ locStreamInfo->setPageStart(mBytePos);
+ locStreamInfo->setComments(locVorbisComments);
+ locStreamInfo->setMajorStreamNo(0); //Temp... increase for chaining
+ locStreamInfo->setMinorStreamNo(mMinorStreamCount);
+ mStreams.push_back(locStreamInfo);
+
+ mMinorStreamCount++;
+ }
+ }
+ mBytePos += inOggPage->pageSize();
+
+ delete inOggPage;
+ return true;
+
+}
+bool FileComments::loadFile(string inFileName) {
+ mBytePos = 0;
+ const unsigned long BUFF_SIZE = 4096;
+ OggDataBuffer locOggBuff;
+
+ locOggBuff.registerVirtualCallback(this);
+
+ fstream locFile;
+ locFile.open(inFileName.c_str(), ios_base::in | ios_base::binary);
+ if (locFile.is_open() != true) {
+ return false;
+ }
+ char* locBuff = new char[BUFF_SIZE];
+ unsigned long locBytesRead = 0;
+ while (!locFile.eof()) {
+ locFile.read(locBuff, BUFF_SIZE);
+ locBytesRead = locFile.gcount();
+ locOggBuff.feed((const unsigned char*)locBuff, locBytesRead);
+ }
+
+ delete[] locBuff;
+
+}
+string FileComments::fileName() {
+ return mFileName;
+}
+
+bool FileComments::writeOutAll(string inFileName) {
+
+ fstream locFile;
+ locFile.open(inFileName.c_str(), ios_base::out | ios_base::in | ios_base::binary);
+
+ if (locFile.is_open()) {
+
+
+ }
+ return false;
+}
+bool FileComments::writeOutStream(unsigned long inIndex) {
+ return false;
+}
+
+bool FileComments::addStreamComment(StreamCommentInfo* inStreamComment) {
+ mStreams.push_back(inStreamComment);
+ return true;
+}
+StreamCommentInfo* FileComments::getStreamComment(unsigned long inIndex) {
+ if (inIndex < mStreams.size()) {
+ return mStreams[inIndex];
+ } else {
+ return NULL;
+ }
+}
+
+unsigned long FileComments::streamCount() {
+ return (unsigned long)mStreams.size();
+}
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/FileComments.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/FileComments.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisComment/FileComments.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisComment/FileComments.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,70 +1,70 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "IOggCallback.h"
-#include "StreamCommentInfo.h"
-#include "OggPage.h"
-#include "OggDataBuffer.h"
-#include <string>
-#include <vector>
-#include <fstream>
-
-using namespace std;
-
-class LIBVORBISCOMMENT_API FileComments
- : public IOggCallback
-{
-public:
- FileComments(void);
- ~FileComments(void);
-
-
-
- bool loadFile(string inFileName);
- string fileName();
-
- bool writeOutAll(string inFileName);
- bool writeOutStream(unsigned long inIndex);
-
- bool addStreamComment(StreamCommentInfo* inStreamComment);
- StreamCommentInfo* getStreamComment(unsigned long inIndex);
-
- unsigned long streamCount();
-
- //IOggCallback implementation
- virtual bool acceptOggPage(OggPage* inOggPage);
-protected:
- vector<StreamCommentInfo*> mStreams;
- string mFileName;
- unsigned long mMinorStreamCount;
- LOOG_INT64 mBytePos;
-};
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "IOggCallback.h"
+#include "StreamCommentInfo.h"
+#include "OggPage.h"
+#include "OggDataBuffer.h"
+#include <string>
+#include <vector>
+#include <fstream>
+
+using namespace std;
+
+class LIBVORBISCOMMENT_API FileComments
+ : public IOggCallback
+{
+public:
+ FileComments(void);
+ ~FileComments(void);
+
+
+
+ bool loadFile(string inFileName);
+ string fileName();
+
+ bool writeOutAll(string inFileName);
+ bool writeOutStream(unsigned long inIndex);
+
+ bool addStreamComment(StreamCommentInfo* inStreamComment);
+ StreamCommentInfo* getStreamComment(unsigned long inIndex);
+
+ unsigned long streamCount();
+
+ //IOggCallback implementation
+ virtual bool acceptOggPage(OggPage* inOggPage);
+protected:
+ vector<StreamCommentInfo*> mStreams;
+ string mFileName;
+ unsigned long mMinorStreamCount;
+ LOOG_INT64 mBytePos;
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/FileComments.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/SingleVorbisComment.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisComment/SingleVorbisComment.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisComment/SingleVorbisComment.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,94 +1,94 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "singlevorbiscomment.h"
-
-SingleVorbisComment::SingleVorbisComment(void)
-{
-}
-
-SingleVorbisComment::~SingleVorbisComment(void)
-{
-}
-
-
-string SingleVorbisComment::key() {
- return mKey;
-}
-bool SingleVorbisComment::setKey(string inKey) {
- //FIX::: Need to do a check here for invalid chars
- mKey = inKey;
- return true;
-}
-
-string SingleVorbisComment::value() {
- return mValue;
-}
-bool SingleVorbisComment::setValue(string inValue) {
- //FIX::: Need to do a check here for invalid chars
- mValue = inValue;
- return true;
-}
-
-string SingleVorbisComment::toString() {
- string retStr = mKey+"="+mValue;
- return retStr;
-}
-
-unsigned long SingleVorbisComment::length() {
- //FIX::: This would be faster to add them manually.
- return toString().length();
-}
-
-bool SingleVorbisComment::parseComment(string inCommentString) {
- size_t pos = 0;
- size_t pos2 = 0;
- pos = inCommentString.find('=');
- if ((pos == string::npos) && (pos != 0)) {
- //FAILED - No equals sign
- return false;
- } else {
- pos2 = inCommentString.find('=', pos + 1);
- if (pos2 == string::npos) {
- //OK - no other equals signs
- mKey = inCommentString.substr(0, pos);
- mValue = inCommentString.substr(pos + 1);
- } else {
- //FAILED : Too many = signs
- return false;
- }
-
- return true;
- }
-
-
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "singlevorbiscomment.h"
+
+SingleVorbisComment::SingleVorbisComment(void)
+{
+}
+
+SingleVorbisComment::~SingleVorbisComment(void)
+{
+}
+
+
+string SingleVorbisComment::key() {
+ return mKey;
+}
+bool SingleVorbisComment::setKey(string inKey) {
+ //FIX::: Need to do a check here for invalid chars
+ mKey = inKey;
+ return true;
+}
+
+string SingleVorbisComment::value() {
+ return mValue;
+}
+bool SingleVorbisComment::setValue(string inValue) {
+ //FIX::: Need to do a check here for invalid chars
+ mValue = inValue;
+ return true;
+}
+
+string SingleVorbisComment::toString() {
+ string retStr = mKey+"="+mValue;
+ return retStr;
+}
+
+unsigned long SingleVorbisComment::length() {
+ //FIX::: This would be faster to add them manually.
+ return toString().length();
+}
+
+bool SingleVorbisComment::parseComment(string inCommentString) {
+ size_t pos = 0;
+ size_t pos2 = 0;
+ pos = inCommentString.find('=');
+ if ((pos == string::npos) && (pos != 0)) {
+ //FAILED - No equals sign
+ return false;
+ } else {
+ pos2 = inCommentString.find('=', pos + 1);
+ if (pos2 == string::npos) {
+ //OK - no other equals signs
+ mKey = inCommentString.substr(0, pos);
+ mValue = inCommentString.substr(pos + 1);
+ } else {
+ //FAILED : Too many = signs
+ return false;
+ }
+
+ return true;
+ }
+
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/SingleVorbisComment.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/SingleVorbisComment.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisComment/SingleVorbisComment.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisComment/SingleVorbisComment.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,60 +1,60 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "libVorbisComment.h"
-#include <string>
-
-using namespace std;
-
-
-class LIBVORBISCOMMENT_API SingleVorbisComment
-{
-public:
- SingleVorbisComment(void);
- ~SingleVorbisComment(void);
-
- string key();
- bool setKey(string inKey);
-
- string value();
- bool setValue(string inValue);
-
- string toString();
-
- unsigned long length();
-
- bool parseComment(string inCommentString);
-
-protected:
- string mKey;
- string mValue;
-};
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "libVorbisComment.h"
+#include <string>
+
+using namespace std;
+
+
+class LIBVORBISCOMMENT_API SingleVorbisComment
+{
+public:
+ SingleVorbisComment(void);
+ ~SingleVorbisComment(void);
+
+ string key();
+ bool setKey(string inKey);
+
+ string value();
+ bool setValue(string inValue);
+
+ string toString();
+
+ unsigned long length();
+
+ bool parseComment(string inCommentString);
+
+protected:
+ string mKey;
+ string mValue;
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/SingleVorbisComment.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/StreamCommentInfo.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisComment/StreamCommentInfo.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisComment/StreamCommentInfo.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,88 +1,88 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "streamcommentinfo.h"
-
-StreamCommentInfo::StreamCommentInfo(void)
- : mIsDirty(false)
- , mPageStart(0)
- , mCodecID(NO_CODEC)
- , mComments(NULL)
-{
-}
-
-StreamCommentInfo::~StreamCommentInfo(void)
-{
- delete mComments;
-}
-
-
-VorbisComments* StreamCommentInfo::comments() {
- return mComments;
-}
-void StreamCommentInfo::setComments(VorbisComments* inComments) {
- mComments = inComments;
-}
-LOOG_INT64 StreamCommentInfo::pageStart() {
- return mPageStart;
-
-}
-void StreamCommentInfo::setPageStart(LOOG_INT64 inPageStart) {
- mPageStart = inPageStart;
-}
-unsigned short StreamCommentInfo::codecID() {
- return mCodecID;
-}
-void StreamCommentInfo::setCodecID(unsigned short inCodecID) {
- mCodecID = inCodecID;
-}
-
-bool StreamCommentInfo::isDirty() {
- return mIsDirty;
-}
-void StreamCommentInfo::setIsDirty(bool inIsDirty) {
- mIsDirty = inIsDirty;
-}
-
-unsigned long StreamCommentInfo::majorStreamNo() {
- return mMajorStreamNo;
-}
-void StreamCommentInfo::setMajorStreamNo(unsigned long inMajorStreamNo) {
- mMajorStreamNo = inMajorStreamNo;
-}
-
-unsigned long StreamCommentInfo::minorStreamNo() {
- return mMinorStreamNo;
-}
-void StreamCommentInfo::setMinorStreamNo(unsigned long inMinorStreamNo) {
- mMinorStreamNo = inMinorStreamNo;
-}
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "streamcommentinfo.h"
+
+StreamCommentInfo::StreamCommentInfo(void)
+ : mIsDirty(false)
+ , mPageStart(0)
+ , mCodecID(NO_CODEC)
+ , mComments(NULL)
+{
+}
+
+StreamCommentInfo::~StreamCommentInfo(void)
+{
+ delete mComments;
+}
+
+
+VorbisComments* StreamCommentInfo::comments() {
+ return mComments;
+}
+void StreamCommentInfo::setComments(VorbisComments* inComments) {
+ mComments = inComments;
+}
+LOOG_INT64 StreamCommentInfo::pageStart() {
+ return mPageStart;
+
+}
+void StreamCommentInfo::setPageStart(LOOG_INT64 inPageStart) {
+ mPageStart = inPageStart;
+}
+unsigned short StreamCommentInfo::codecID() {
+ return mCodecID;
+}
+void StreamCommentInfo::setCodecID(unsigned short inCodecID) {
+ mCodecID = inCodecID;
+}
+
+bool StreamCommentInfo::isDirty() {
+ return mIsDirty;
+}
+void StreamCommentInfo::setIsDirty(bool inIsDirty) {
+ mIsDirty = inIsDirty;
+}
+
+unsigned long StreamCommentInfo::majorStreamNo() {
+ return mMajorStreamNo;
+}
+void StreamCommentInfo::setMajorStreamNo(unsigned long inMajorStreamNo) {
+ mMajorStreamNo = inMajorStreamNo;
+}
+
+unsigned long StreamCommentInfo::minorStreamNo() {
+ return mMinorStreamNo;
+}
+void StreamCommentInfo::setMinorStreamNo(unsigned long inMinorStreamNo) {
+ mMinorStreamNo = inMinorStreamNo;
+}
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/StreamCommentInfo.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/StreamCommentInfo.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisComment/StreamCommentInfo.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisComment/StreamCommentInfo.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,73 +1,73 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "VorbisComments.h"
-class LIBVORBISCOMMENT_API StreamCommentInfo
-{
-public:
- StreamCommentInfo(void);
- ~StreamCommentInfo(void);
-
- enum eCodecIDs {
- NO_CODEC = 0,
- VORBIS = 1,
- THEORA = 2
-
- };
- VorbisComments* comments();
- void setComments(VorbisComments* inComments);
-
- LOOG_INT64 pageStart();
- void setPageStart(LOOG_INT64 inPageStart);
-
- unsigned short codecID();
- void setCodecID(unsigned short inCodecID);
-
- bool isDirty();
- void setIsDirty(bool inIsDirty);
-
- unsigned long majorStreamNo();
- void setMajorStreamNo(unsigned long inMajorStreamNo);
-
- unsigned long minorStreamNo();
- void setMinorStreamNo(unsigned long inMinorStreamNo);
-
-protected:
- VorbisComments* mComments;
- LOOG_INT64 mPageStart;
- unsigned short mCodecID;
-
- bool mIsDirty;
-
- unsigned long mMajorStreamNo;
- unsigned long mMinorStreamNo;
-};
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "VorbisComments.h"
+class LIBVORBISCOMMENT_API StreamCommentInfo
+{
+public:
+ StreamCommentInfo(void);
+ ~StreamCommentInfo(void);
+
+ enum eCodecIDs {
+ NO_CODEC = 0,
+ VORBIS = 1,
+ THEORA = 2
+
+ };
+ VorbisComments* comments();
+ void setComments(VorbisComments* inComments);
+
+ LOOG_INT64 pageStart();
+ void setPageStart(LOOG_INT64 inPageStart);
+
+ unsigned short codecID();
+ void setCodecID(unsigned short inCodecID);
+
+ bool isDirty();
+ void setIsDirty(bool inIsDirty);
+
+ unsigned long majorStreamNo();
+ void setMajorStreamNo(unsigned long inMajorStreamNo);
+
+ unsigned long minorStreamNo();
+ void setMinorStreamNo(unsigned long inMinorStreamNo);
+
+protected:
+ VorbisComments* mComments;
+ LOOG_INT64 mPageStart;
+ unsigned short mCodecID;
+
+ bool mIsDirty;
+
+ unsigned long mMajorStreamNo;
+ unsigned long mMinorStreamNo;
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/StreamCommentInfo.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/VorbisComments.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisComment/VorbisComments.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisComment/VorbisComments.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,273 +1,273 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "vorbiscomments.h"
-
-VorbisComments::VorbisComments(void)
-{
-}
-
-VorbisComments::~VorbisComments(void)
-{
-}
-
-string VorbisComments::vendorString() {
- return mVendorString;
-}
-bool VorbisComments::setVendorString(string inVendorString) {
- //FIX::: Validation needed
- mVendorString = inVendorString;
- return true;
-}
-
-unsigned long VorbisComments::numUserComments() {
- return (unsigned long)mCommentList.size();
-}
-SingleVorbisComment* VorbisComments::getUserComment(unsigned long inIndex) {
- //FIX::: Bounds checking
- return mCommentList[inIndex];
-}
-
-vector<SingleVorbisComment*> VorbisComments::getCommentsByKey(string inKey) {
- //FIX::: Probably faster not to iterate... but who cares for now.. there aren't many.
- vector<SingleVorbisComment*> retComments;
- SingleVorbisComment* locCurrComment = NULL;
-
- for (size_t i = 0; i < mCommentList.size(); i++) {
- locCurrComment = mCommentList[i];
- //FIX::: Need to upcase everything
- if (locCurrComment->key() == inKey) {
- retComments.push_back(locCurrComment);
- }
- }
- return retComments;
-}
-
-bool VorbisComments::addComment(SingleVorbisComment* inComment) {
- mCommentList.push_back(inComment);
- return true;
-}
-bool VorbisComments::addComment(string inKey, string inValue) {
- SingleVorbisComment* locComment = new SingleVorbisComment;
- locComment->setKey(inKey);
- locComment->setValue(inValue);
- mCommentList.push_back(locComment);
- return true;
-}
-
-bool VorbisComments::parseOggPacket(OggPacket* inPacket, unsigned long inStartOffset) {
- //FIX::: Validate it is a comment packet
- unsigned long locPackSize = inPacket->packetSize();
-
- //Account for header ident stuff
- unsigned long locUpto = inStartOffset;
- unsigned long locVendorLength = 0;
- string locVendorString;
- char* tempBuff = NULL;
- unsigned char* locPackBuff = inPacket->packetData();
- unsigned long locNumComments = 0;
- vector<SingleVorbisComment*> locCommentList;
-
- if (locPackSize < locUpto + 4 - 1) {
- //FAILED - No vendor length
- return false;
- }
-
- locVendorLength = iLE_Math::charArrToULong(inPacket->packetData() + locUpto);
- locUpto+=4;
-
- if (locPackSize < locUpto + locVendorLength - 1) {
- //FAILED - Vendor string not present
- return false;
- }
-
- tempBuff = new char[locVendorLength + 1];
-
- if (tempBuff == NULL) {
- //FAILED - Vendor length too big, out of memory
- return false;
- }
-
- memcpy((void*)tempBuff, (const void*)(locPackBuff + locUpto), locVendorLength);
- tempBuff[locVendorLength] = '\0';
-
- locVendorString = tempBuff;
- delete[] tempBuff;
- tempBuff = NULL;
-
- locUpto += locVendorLength;
-
- if (locPackSize < locUpto + 4 - 1) {
- //FAILED - User comment list length not present
- return false;
- }
-
- locNumComments = iLE_Math::charArrToULong(locPackBuff + locUpto);
- locUpto += 4;
-
- unsigned long locUserCommentLength = 0;
- bool locFailed = false;
- string locUserComment;
- unsigned long i = 0;
- while (!locFailed && (i < locNumComments)) {
- if (locPackSize < locUpto + 4 -1) {
- //FAILED - User comment string length not present
- return false;
- }
-
- locUserCommentLength = iLE_Math::charArrToULong(locPackBuff + locUpto);
- locUpto += 4;
-
-
- if (locPackSize < locUpto + locUserCommentLength - 1) {
- //FAILED - User comment string not present
- return false;
- }
-
- tempBuff = new char[locUserCommentLength+1];
-
- memcpy((void*)tempBuff, (const void*)(locPackBuff + locUpto), locUserCommentLength);
- tempBuff[locUserCommentLength] = '\0';
-
- locUserComment = tempBuff;
- delete[] tempBuff;
- locUpto += locUserCommentLength;
-
-
- SingleVorbisComment* locComment = new SingleVorbisComment;
- if (locComment->parseComment(locUserComment)) {
- locCommentList.push_back(locComment);
- } else {
- //FAILED - Comment not parsable
- return false;
- }
-
- i++;
-
- }
-
- //Check the bit.
- if (locPackSize < locUpto) {
- //FAILED - No check bit
- return false;
- }
-
- //Everythings ok... put it into the class fields
- if ((locPackBuff[locUpto] & 1) == 1) {
- //OK
- mVendorString = locVendorString;
-
- mCommentList.empty();
- mCommentList.clear();
- for (size_t j = 0; j < locCommentList.size(); j++) {
- mCommentList.push_back(locCommentList[j]);
- }
- } else {
- //FAILED - Check bit not set
- return false;
- }
-
- return true;
-
-
-
-
-
-
-}
-
-string VorbisComments::toString() {
- string retStr;
-
- retStr = "VENDOR : " + mVendorString + "\n";
- for (size_t i = 0; i < mCommentList.size(); i++) {
- retStr += "-- " + mCommentList[i]->toString() + "\n";
- }
- retStr += "\n";
- return retStr;
-
-}
-unsigned long VorbisComments::size() {
- unsigned long locPackSize = 0;
-
- locPackSize = (unsigned long)mVendorString.size() + 4;
-
- for (size_t i = 0; i < mCommentList.size(); i++) {
- locPackSize += mCommentList[i]->length() + 4;
- }
-
- //Check bit
- locPackSize++;
-
- return locPackSize;
-}
-OggPacket* VorbisComments::toOggPacket(unsigned char* inPrefixBuff, unsigned long inPrefixBuffSize) {
-
- unsigned long locPackSize = size();
- unsigned long locUpto = 0;
- unsigned char* locPackData = NULL;
-
- if (inPrefixBuff != NULL && inPrefixBuffSize != 0) {
- locPackSize += inPrefixBuffSize;
- locPackData = new unsigned char[locPackSize];
- memcpy((void*)locPackData, (const void*)inPrefixBuff, inPrefixBuffSize);
- locUpto += inPrefixBuffSize;
- } else {
- locPackData = new unsigned char[locPackSize];
- }
-
- iLE_Math::ULongToCharArr((unsigned long)mVendorString.length(), locPackData + locUpto);
- locUpto += 4;
-
- memcpy((void*)(locPackData + locUpto), (const void*)mVendorString.c_str(), mVendorString.length());
- locUpto += (unsigned long)mVendorString.length();
-
- iLE_Math::ULongToCharArr((unsigned long)mCommentList.size(), locPackData + locUpto);
- locUpto += 4;
-
- for (size_t i = 0; i < mCommentList.size(); i++) {
- iLE_Math::ULongToCharArr(mCommentList[i]->length(), locPackData + locUpto);
- locUpto += 4;
-
- memcpy((void*)(locPackData + locUpto), (const void*)mCommentList[i]->toString().c_str(), mCommentList[i]->length());
- locUpto += mCommentList[i]->length();
- }
-
- locPackData[locUpto] = 1;
-
- OggPacket* locPacket = NULL;
- //Full packet not truncated or continued.
- locPacket = new OggPacket(locPackData, locPackSize, false, false);
-
- return locPacket;
-
-}
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "vorbiscomments.h"
+
+VorbisComments::VorbisComments(void)
+{
+}
+
+VorbisComments::~VorbisComments(void)
+{
+}
+
+string VorbisComments::vendorString() {
+ return mVendorString;
+}
+bool VorbisComments::setVendorString(string inVendorString) {
+ //FIX::: Validation needed
+ mVendorString = inVendorString;
+ return true;
+}
+
+unsigned long VorbisComments::numUserComments() {
+ return (unsigned long)mCommentList.size();
+}
+SingleVorbisComment* VorbisComments::getUserComment(unsigned long inIndex) {
+ //FIX::: Bounds checking
+ return mCommentList[inIndex];
+}
+
+vector<SingleVorbisComment*> VorbisComments::getCommentsByKey(string inKey) {
+ //FIX::: Probably faster not to iterate... but who cares for now.. there aren't many.
+ vector<SingleVorbisComment*> retComments;
+ SingleVorbisComment* locCurrComment = NULL;
+
+ for (size_t i = 0; i < mCommentList.size(); i++) {
+ locCurrComment = mCommentList[i];
+ //FIX::: Need to upcase everything
+ if (locCurrComment->key() == inKey) {
+ retComments.push_back(locCurrComment);
+ }
+ }
+ return retComments;
+}
+
+bool VorbisComments::addComment(SingleVorbisComment* inComment) {
+ mCommentList.push_back(inComment);
+ return true;
+}
+bool VorbisComments::addComment(string inKey, string inValue) {
+ SingleVorbisComment* locComment = new SingleVorbisComment;
+ locComment->setKey(inKey);
+ locComment->setValue(inValue);
+ mCommentList.push_back(locComment);
+ return true;
+}
+
+bool VorbisComments::parseOggPacket(OggPacket* inPacket, unsigned long inStartOffset) {
+ //FIX::: Validate it is a comment packet
+ unsigned long locPackSize = inPacket->packetSize();
+
+ //Account for header ident stuff
+ unsigned long locUpto = inStartOffset;
+ unsigned long locVendorLength = 0;
+ string locVendorString;
+ char* tempBuff = NULL;
+ unsigned char* locPackBuff = inPacket->packetData();
+ unsigned long locNumComments = 0;
+ vector<SingleVorbisComment*> locCommentList;
+
+ if (locPackSize < locUpto + 4 - 1) {
+ //FAILED - No vendor length
+ return false;
+ }
+
+ locVendorLength = iLE_Math::charArrToULong(inPacket->packetData() + locUpto);
+ locUpto+=4;
+
+ if (locPackSize < locUpto + locVendorLength - 1) {
+ //FAILED - Vendor string not present
+ return false;
+ }
+
+ tempBuff = new char[locVendorLength + 1];
+
+ if (tempBuff == NULL) {
+ //FAILED - Vendor length too big, out of memory
+ return false;
+ }
+
+ memcpy((void*)tempBuff, (const void*)(locPackBuff + locUpto), locVendorLength);
+ tempBuff[locVendorLength] = '\0';
+
+ locVendorString = tempBuff;
+ delete[] tempBuff;
+ tempBuff = NULL;
+
+ locUpto += locVendorLength;
+
+ if (locPackSize < locUpto + 4 - 1) {
+ //FAILED - User comment list length not present
+ return false;
+ }
+
+ locNumComments = iLE_Math::charArrToULong(locPackBuff + locUpto);
+ locUpto += 4;
+
+ unsigned long locUserCommentLength = 0;
+ bool locFailed = false;
+ string locUserComment;
+ unsigned long i = 0;
+ while (!locFailed && (i < locNumComments)) {
+ if (locPackSize < locUpto + 4 -1) {
+ //FAILED - User comment string length not present
+ return false;
+ }
+
+ locUserCommentLength = iLE_Math::charArrToULong(locPackBuff + locUpto);
+ locUpto += 4;
+
+
+ if (locPackSize < locUpto + locUserCommentLength - 1) {
+ //FAILED - User comment string not present
+ return false;
+ }
+
+ tempBuff = new char[locUserCommentLength+1];
+
+ memcpy((void*)tempBuff, (const void*)(locPackBuff + locUpto), locUserCommentLength);
+ tempBuff[locUserCommentLength] = '\0';
+
+ locUserComment = tempBuff;
+ delete[] tempBuff;
+ locUpto += locUserCommentLength;
+
+
+ SingleVorbisComment* locComment = new SingleVorbisComment;
+ if (locComment->parseComment(locUserComment)) {
+ locCommentList.push_back(locComment);
+ } else {
+ //FAILED - Comment not parsable
+ return false;
+ }
+
+ i++;
+
+ }
+
+ //Check the bit.
+ if (locPackSize < locUpto) {
+ //FAILED - No check bit
+ return false;
+ }
+
+ //Everythings ok... put it into the class fields
+ if ((locPackBuff[locUpto] & 1) == 1) {
+ //OK
+ mVendorString = locVendorString;
+
+ mCommentList.empty();
+ mCommentList.clear();
+ for (size_t j = 0; j < locCommentList.size(); j++) {
+ mCommentList.push_back(locCommentList[j]);
+ }
+ } else {
+ //FAILED - Check bit not set
+ return false;
+ }
+
+ return true;
+
+
+
+
+
+
+}
+
+string VorbisComments::toString() {
+ string retStr;
+
+ retStr = "VENDOR : " + mVendorString + "\n";
+ for (size_t i = 0; i < mCommentList.size(); i++) {
+ retStr += "-- " + mCommentList[i]->toString() + "\n";
+ }
+ retStr += "\n";
+ return retStr;
+
+}
+unsigned long VorbisComments::size() {
+ unsigned long locPackSize = 0;
+
+ locPackSize = (unsigned long)mVendorString.size() + 4;
+
+ for (size_t i = 0; i < mCommentList.size(); i++) {
+ locPackSize += mCommentList[i]->length() + 4;
+ }
+
+ //Check bit
+ locPackSize++;
+
+ return locPackSize;
+}
+OggPacket* VorbisComments::toOggPacket(unsigned char* inPrefixBuff, unsigned long inPrefixBuffSize) {
+
+ unsigned long locPackSize = size();
+ unsigned long locUpto = 0;
+ unsigned char* locPackData = NULL;
+
+ if (inPrefixBuff != NULL && inPrefixBuffSize != 0) {
+ locPackSize += inPrefixBuffSize;
+ locPackData = new unsigned char[locPackSize];
+ memcpy((void*)locPackData, (const void*)inPrefixBuff, inPrefixBuffSize);
+ locUpto += inPrefixBuffSize;
+ } else {
+ locPackData = new unsigned char[locPackSize];
+ }
+
+ iLE_Math::ULongToCharArr((unsigned long)mVendorString.length(), locPackData + locUpto);
+ locUpto += 4;
+
+ memcpy((void*)(locPackData + locUpto), (const void*)mVendorString.c_str(), mVendorString.length());
+ locUpto += (unsigned long)mVendorString.length();
+
+ iLE_Math::ULongToCharArr((unsigned long)mCommentList.size(), locPackData + locUpto);
+ locUpto += 4;
+
+ for (size_t i = 0; i < mCommentList.size(); i++) {
+ iLE_Math::ULongToCharArr(mCommentList[i]->length(), locPackData + locUpto);
+ locUpto += 4;
+
+ memcpy((void*)(locPackData + locUpto), (const void*)mCommentList[i]->toString().c_str(), mCommentList[i]->length());
+ locUpto += mCommentList[i]->length();
+ }
+
+ locPackData[locUpto] = 1;
+
+ OggPacket* locPacket = NULL;
+ //Full packet not truncated or continued.
+ locPacket = new OggPacket(locPackData, locPackSize, false, false);
+
+ return locPacket;
+
+}
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/VorbisComments.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/VorbisComments.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisComment/VorbisComments.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisComment/VorbisComments.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,67 +1,67 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "libVorbisComment.h"
-#include <string>
-#include <vector>
-
-using namespace std;
-#include "SingleVorbisComment.h"
-#include "OggPacket.h"
-#include "iLE_Math.h"
-
-class LIBVORBISCOMMENT_API VorbisComments
-{
-public:
- VorbisComments(void);
- ~VorbisComments(void);
-
- string vendorString();
- bool setVendorString(string inVendorString);
-
- unsigned long numUserComments();
- SingleVorbisComment* getUserComment(unsigned long inIndex);
-
- vector<SingleVorbisComment*> getCommentsByKey(string inKey);
-
- bool addComment(SingleVorbisComment* inComment);
- bool addComment(string inKey, string inValue);
-
- bool parseOggPacket(OggPacket* inPacket, unsigned long inStartOffset);
- OggPacket* toOggPacket(unsigned char* inPrefixBuff, unsigned long inPrefixBuffSize);
- string toString();
-
- unsigned long size();
-protected:
- string mVendorString;
- vector<SingleVorbisComment*> mCommentList;
-};
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "libVorbisComment.h"
+#include <string>
+#include <vector>
+
+using namespace std;
+#include "SingleVorbisComment.h"
+#include "OggPacket.h"
+#include "iLE_Math.h"
+
+class LIBVORBISCOMMENT_API VorbisComments
+{
+public:
+ VorbisComments(void);
+ ~VorbisComments(void);
+
+ string vendorString();
+ bool setVendorString(string inVendorString);
+
+ unsigned long numUserComments();
+ SingleVorbisComment* getUserComment(unsigned long inIndex);
+
+ vector<SingleVorbisComment*> getCommentsByKey(string inKey);
+
+ bool addComment(SingleVorbisComment* inComment);
+ bool addComment(string inKey, string inValue);
+
+ bool parseOggPacket(OggPacket* inPacket, unsigned long inStartOffset);
+ OggPacket* toOggPacket(unsigned char* inPrefixBuff, unsigned long inPrefixBuffSize);
+ string toString();
+
+ unsigned long size();
+protected:
+ string mVendorString;
+ vector<SingleVorbisComment*> mCommentList;
+};
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/VorbisComments.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/libVorbisComment.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisComment/libVorbisComment.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisComment/libVorbisComment.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,52 +1,52 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// libVorbisComment.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-#include "libVorbisComment.h"
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
-}
-
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// libVorbisComment.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+#include "libVorbisComment.h"
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ switch (ul_reason_for_call)
+ {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
+}
+
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/libVorbisComment.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/libVorbisComment.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisComment/libVorbisComment.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisComment/libVorbisComment.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,46 +1,46 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// The following ifdef block is the standard way of creating macros which make exporting
-// from a DLL simpler. All files within this DLL are compiled with the LIBVORBISCOMMENT_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see
-// LIBVORBISCOMMENT_API functions as being imported from a DLL, whereas this DLL sees symbols
-// defined with this macro as being exported.
-#ifdef WIN32
-# ifdef LIBVORBISCOMMENT_EXPORTS
-# define LIBVORBISCOMMENT_API __declspec(dllexport)
-# else
-# define LIBVORBISCOMMENT_API __declspec(dllimport)
-# endif
-#else
-# define LIBVORBISCOMMENT_API
-#endif
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// The following ifdef block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the LIBVORBISCOMMENT_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// LIBVORBISCOMMENT_API functions as being imported from a DLL, whereas this DLL sees symbols
+// defined with this macro as being exported.
+#ifdef WIN32
+# ifdef LIBVORBISCOMMENT_EXPORTS
+# define LIBVORBISCOMMENT_API __declspec(dllexport)
+# else
+# define LIBVORBISCOMMENT_API __declspec(dllimport)
+# endif
+#else
+# define LIBVORBISCOMMENT_API
+#endif
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/libVorbisComment.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisComment/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisComment/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,39 +1,39 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.cpp : source file that includes just the standard includes
-// libVorbisComment.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.cpp : source file that includes just the standard includes
+// libVorbisComment.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisComment/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisComment/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,55 +1,55 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#ifdef WIN32
-# include <windows.h>
-#endif
-
-// TODO: reference additional headers your program requires here
-#ifdef WIN32
-# ifdef LIBOOOGG_EXPORTS
-# define LIBOOOGG_API __declspec(dllexport)
-# else
-# define LIBOOOGG_API __declspec(dllimport)
-# endif
-#else /* assume POSIX */
-# define LIBOOOGG_API
-#endif
-
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#ifdef WIN32
+# include <windows.h>
+#endif
+
+// TODO: reference additional headers your program requires here
+#ifdef WIN32
+# ifdef LIBOOOGG_EXPORTS
+# define LIBOOOGG_API __declspec(dllexport)
+# else
+# define LIBOOOGG_API __declspec(dllimport)
+# endif
+#else /* assume POSIX */
+# define LIBOOOGG_API
+#endif
+
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisComment/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/AssemblyInfo.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/AssemblyInfo.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/AssemblyInfo.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,58 +1,58 @@
-#include "stdafx.h"
-
-using namespace System::Reflection;
-using namespace System::Runtime::CompilerServices;
-
-//
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-//
-[assembly:AssemblyTitleAttribute("")];
-[assembly:AssemblyDescriptionAttribute("")];
-[assembly:AssemblyConfigurationAttribute("")];
-[assembly:AssemblyCompanyAttribute("")];
-[assembly:AssemblyProductAttribute("")];
-[assembly:AssemblyCopyrightAttribute("")];
-[assembly:AssemblyTrademarkAttribute("")];
-[assembly:AssemblyCultureAttribute("")];
-
-//
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the value or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-
-[assembly:AssemblyVersionAttribute("1.0.*")];
-
-//
-// In order to sign your assembly you must specify a key to use. Refer to the
-// Microsoft .NET Framework documentation for more information on assembly signing.
-//
-// Use the attributes below to control which key is used for signing.
-//
-// Notes:
-// (*) If no key is specified, the assembly is not signed.
-// (*) KeyName refers to a key that has been installed in the Crypto Service
-// Provider (CSP) on your machine. KeyFile refers to a file which contains
-// a key.
-// (*) If the KeyFile and the KeyName values are both specified, the
-// following processing occurs:
-// (1) If the KeyName can be found in the CSP, that key is used.
-// (2) If the KeyName does not exist and the KeyFile does exist, the key
-// in the KeyFile is installed into the CSP and used.
-// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
-// When specifying the KeyFile, the location of the KeyFile should be
-// relative to the project directory.
-// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
-// documentation for more information on this.
-//
-[assembly:AssemblyDelaySignAttribute(false)];
-[assembly:AssemblyKeyFileAttribute("")];
-[assembly:AssemblyKeyNameAttribute("")];
-
+#include "stdafx.h"
+
+using namespace System::Reflection;
+using namespace System::Runtime::CompilerServices;
+
+//
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly:AssemblyTitleAttribute("")];
+[assembly:AssemblyDescriptionAttribute("")];
+[assembly:AssemblyConfigurationAttribute("")];
+[assembly:AssemblyCompanyAttribute("")];
+[assembly:AssemblyProductAttribute("")];
+[assembly:AssemblyCopyrightAttribute("")];
+[assembly:AssemblyTrademarkAttribute("")];
+[assembly:AssemblyCultureAttribute("")];
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the value or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly:AssemblyVersionAttribute("1.0.*")];
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing.
+//
+// Notes:
+// (*) If no key is specified, the assembly is not signed.
+// (*) KeyName refers to a key that has been installed in the Crypto Service
+// Provider (CSP) on your machine. KeyFile refers to a file which contains
+// a key.
+// (*) If the KeyFile and the KeyName values are both specified, the
+// following processing occurs:
+// (1) If the KeyName can be found in the CSP, that key is used.
+// (2) If the KeyName does not exist and the KeyFile does exist, the key
+// in the KeyFile is installed into the CSP and used.
+// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+// When specifying the KeyFile, the location of the KeyFile should be
+// relative to the project directory.
+// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+// documentation for more information on this.
+//
+[assembly:AssemblyDelaySignAttribute(false)];
+[assembly:AssemblyKeyFileAttribute("")];
+[assembly:AssemblyKeyNameAttribute("")];
+
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/AssemblyInfo.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNFileComments.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNFileComments.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNFileComments.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,57 +1,57 @@
-#include "StdAfx.h"
-#include ".\DNFileComments.h"
-#using <mscorlib.dll>
-
-
-namespace illiminable {
- namespace Ogg {
- namespace libVorbisCommentDotNET {
-
-DNFileComments::DNFileComments(void)
-{
- mNativeClass = new ::FileComments;
-}
-
-DNFileComments::~DNFileComments(void)
-{
- delete mNativeClass;
-}
-
-
-
-bool DNFileComments::loadFile(String* inFileName) {
- char* locCS = Wrappers::netStrToCStr(inFileName);
- string locStr = locCS;
- bool locRet = mNativeClass->loadFile(locStr);
- Wrappers::releaseCStr(locCS);
- return locRet;
-}
-String* DNFileComments::fileName() {
- return Wrappers::CStrToNetStr(mNativeClass->fileName().c_str());
-}
-
-bool DNFileComments::writeOutAll(String* inFileName) {
- char* locCS = Wrappers::netStrToCStr(inFileName);
- string locStr = locCS;
- bool locRet = mNativeClass->writeOutAll(locStr);
- Wrappers::releaseCStr(locCS);
- return locRet;
-
-}
-bool DNFileComments::writeOutStream(Int64 inIndex) {
- return mNativeClass->writeOutStream((unsigned long)inIndex);
-}
-
-//bool DNFileComments::addStreamComment(DNStreamCommentInfo* inStreamComment) {
-//
-//}
-DNStreamCommentInfo* DNFileComments::getStreamComment(Int64 inIndex) {
- return new illiminable::Ogg::libVorbisCommentDotNET::DNStreamCommentInfo(mNativeClass->getStreamComment((unsigned long)inIndex));
-}
-
-Int64 DNFileComments::streamCount() {
- return mNativeClass->streamCount();
-}
-
-
+#include "StdAfx.h"
+#include ".\DNFileComments.h"
+#using <mscorlib.dll>
+
+
+namespace illiminable {
+ namespace Ogg {
+ namespace libVorbisCommentDotNET {
+
+DNFileComments::DNFileComments(void)
+{
+ mNativeClass = new ::FileComments;
+}
+
+DNFileComments::~DNFileComments(void)
+{
+ delete mNativeClass;
+}
+
+
+
+bool DNFileComments::loadFile(String* inFileName) {
+ char* locCS = Wrappers::netStrToCStr(inFileName);
+ string locStr = locCS;
+ bool locRet = mNativeClass->loadFile(locStr);
+ Wrappers::releaseCStr(locCS);
+ return locRet;
+}
+String* DNFileComments::fileName() {
+ return Wrappers::CStrToNetStr(mNativeClass->fileName().c_str());
+}
+
+bool DNFileComments::writeOutAll(String* inFileName) {
+ char* locCS = Wrappers::netStrToCStr(inFileName);
+ string locStr = locCS;
+ bool locRet = mNativeClass->writeOutAll(locStr);
+ Wrappers::releaseCStr(locCS);
+ return locRet;
+
+}
+bool DNFileComments::writeOutStream(Int64 inIndex) {
+ return mNativeClass->writeOutStream((unsigned long)inIndex);
+}
+
+//bool DNFileComments::addStreamComment(DNStreamCommentInfo* inStreamComment) {
+//
+//}
+DNStreamCommentInfo* DNFileComments::getStreamComment(Int64 inIndex) {
+ return new illiminable::Ogg::libVorbisCommentDotNET::DNStreamCommentInfo(mNativeClass->getStreamComment((unsigned long)inIndex));
+}
+
+Int64 DNFileComments::streamCount() {
+ return mNativeClass->streamCount();
+}
+
+
}}}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNFileComments.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNFileComments.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNFileComments.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNFileComments.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,69 +1,69 @@
-#pragma once
-#pragma unmanaged
-#include "dllstuff.h"
-#include "libVorbisComment/FileComments.h"
-
-#pragma managed
-#include "DNStreamCommentInfo.h"
-using namespace System;
-using namespace illiminable::libiWrapper;
-namespace illiminable {
- namespace Ogg {
- namespace libVorbisCommentDotNET {
-
-
-//class LIBVORBISCOMMENT_API FileComments
-// : public IOggCallback
-//{
-//public:
-// FileComments(void);
-// ~FileComments(void);
-//
-//
-//
-// bool loadFile(string inFileName);
-// string fileName();
-//
-// bool writeOutAll(string inFileName);
-// bool writeOutStream(unsigned long inIndex);
-//
-// bool addStreamComment(StreamCommentInfo* inStreamComment);
-// StreamCommentInfo* getStreamComment(unsigned long inIndex);
-//
-// unsigned long streamCount();
-//
-// //IOggCallback implementation
-// virtual bool acceptOggPage(OggPage* inOggPage);
-//protected:
-// vector<StreamCommentInfo*> mStreams;
-// string mFileName;
-// unsigned long mMinorStreamCount;
-// __int64 mBytePos;
-//};
-
-
-
-
-public __gc class DNFileComments
-{
-public:
- DNFileComments(void);
- ~DNFileComments(void);
-
-
- bool loadFile(String* inFileName);
- String* fileName();
-
- bool writeOutAll(String* inFileName);
- bool writeOutStream(Int64 inIndex);
-
- //bool addStreamComment(DNStreamCommentInfo* inStreamComment);
- DNStreamCommentInfo* getStreamComment(Int64 inIndex);
-
- Int64 streamCount();
-
-protected:
- ::FileComments* mNativeClass;
-};
-
+#pragma once
+#pragma unmanaged
+#include "dllstuff.h"
+#include "libVorbisComment/FileComments.h"
+
+#pragma managed
+#include "DNStreamCommentInfo.h"
+using namespace System;
+using namespace illiminable::libiWrapper;
+namespace illiminable {
+ namespace Ogg {
+ namespace libVorbisCommentDotNET {
+
+
+//class LIBVORBISCOMMENT_API FileComments
+// : public IOggCallback
+//{
+//public:
+// FileComments(void);
+// ~FileComments(void);
+//
+//
+//
+// bool loadFile(string inFileName);
+// string fileName();
+//
+// bool writeOutAll(string inFileName);
+// bool writeOutStream(unsigned long inIndex);
+//
+// bool addStreamComment(StreamCommentInfo* inStreamComment);
+// StreamCommentInfo* getStreamComment(unsigned long inIndex);
+//
+// unsigned long streamCount();
+//
+// //IOggCallback implementation
+// virtual bool acceptOggPage(OggPage* inOggPage);
+//protected:
+// vector<StreamCommentInfo*> mStreams;
+// string mFileName;
+// unsigned long mMinorStreamCount;
+// __int64 mBytePos;
+//};
+
+
+
+
+public __gc class DNFileComments
+{
+public:
+ DNFileComments(void);
+ ~DNFileComments(void);
+
+
+ bool loadFile(String* inFileName);
+ String* fileName();
+
+ bool writeOutAll(String* inFileName);
+ bool writeOutStream(Int64 inIndex);
+
+ //bool addStreamComment(DNStreamCommentInfo* inStreamComment);
+ DNStreamCommentInfo* getStreamComment(Int64 inIndex);
+
+ Int64 streamCount();
+
+protected:
+ ::FileComments* mNativeClass;
+};
+
}}}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNFileComments.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNSingleVorbisComment.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNSingleVorbisComment.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNSingleVorbisComment.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,58 +1,58 @@
-#include "StdAfx.h"
-#include ".\DNsinglevorbiscomment.h"
-#using <mscorlib.dll>
-
-namespace illiminable {
- namespace Ogg {
- namespace libVorbisCommentDotNET {
-DNSingleVorbisComment::DNSingleVorbisComment(void)
- : mNativeClass(NULL)
-{
- mNativeClass = new ::SingleVorbisComment;
-}
-
-DNSingleVorbisComment::DNSingleVorbisComment(::SingleVorbisComment* inNativeClass) {
- mNativeClass = inNativeClass;
-}
-DNSingleVorbisComment::~DNSingleVorbisComment(void)
-{
- delete mNativeClass;
-}
-
-
-
-String* DNSingleVorbisComment::key() {
- return Wrappers::CStrToNetStr(mNativeClass->key().c_str());
-}
-bool DNSingleVorbisComment::setKey(String* inKey) {
- char* locCS = Wrappers::netStrToCStr(inKey);
- mNativeClass->setKey(locCS);
- Wrappers::releaseCStr(locCS);
- return true;
-}
-
-String* DNSingleVorbisComment::value() {
- return Wrappers::CStrToNetStr(mNativeClass->value().c_str());
-}
-bool DNSingleVorbisComment::setValue(String* inValue) {
- char* locCS = Wrappers::netStrToCStr(inValue);
- mNativeClass->setValue(locCS);
- Wrappers::releaseCStr(locCS);
- return true;
-}
-
-String* DNSingleVorbisComment::toString() {
- return Wrappers::CStrToNetStr(mNativeClass->toString().c_str());
-}
-
-Int64 DNSingleVorbisComment::length() {
- Int64 locLength = mNativeClass->length();
- return locLength;
-}
-
-
-
-
-
-
+#include "StdAfx.h"
+#include ".\DNsinglevorbiscomment.h"
+#using <mscorlib.dll>
+
+namespace illiminable {
+ namespace Ogg {
+ namespace libVorbisCommentDotNET {
+DNSingleVorbisComment::DNSingleVorbisComment(void)
+ : mNativeClass(NULL)
+{
+ mNativeClass = new ::SingleVorbisComment;
+}
+
+DNSingleVorbisComment::DNSingleVorbisComment(::SingleVorbisComment* inNativeClass) {
+ mNativeClass = inNativeClass;
+}
+DNSingleVorbisComment::~DNSingleVorbisComment(void)
+{
+ delete mNativeClass;
+}
+
+
+
+String* DNSingleVorbisComment::key() {
+ return Wrappers::CStrToNetStr(mNativeClass->key().c_str());
+}
+bool DNSingleVorbisComment::setKey(String* inKey) {
+ char* locCS = Wrappers::netStrToCStr(inKey);
+ mNativeClass->setKey(locCS);
+ Wrappers::releaseCStr(locCS);
+ return true;
+}
+
+String* DNSingleVorbisComment::value() {
+ return Wrappers::CStrToNetStr(mNativeClass->value().c_str());
+}
+bool DNSingleVorbisComment::setValue(String* inValue) {
+ char* locCS = Wrappers::netStrToCStr(inValue);
+ mNativeClass->setValue(locCS);
+ Wrappers::releaseCStr(locCS);
+ return true;
+}
+
+String* DNSingleVorbisComment::toString() {
+ return Wrappers::CStrToNetStr(mNativeClass->toString().c_str());
+}
+
+Int64 DNSingleVorbisComment::length() {
+ Int64 locLength = mNativeClass->length();
+ return locLength;
+}
+
+
+
+
+
+
}}}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNSingleVorbisComment.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNSingleVorbisComment.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNSingleVorbisComment.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNSingleVorbisComment.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,65 +1,65 @@
-#pragma once
-
-#pragma unmanaged
-//The directory is necessary to avoid recursive inclusion. native and DN class have same names.
-#include "libVorbisComment/SingleVorbisComment.h"
-
-#pragma managed
-
-using namespace illiminable::libiWrapper;
-using namespace System;
-
-namespace illiminable {
- namespace Ogg {
- namespace libVorbisCommentDotNET {
-
-//NATIVE CLASS
-//class LIBVORBISCOMMENT_API SingleVorbisComment
-//{
-//public:
-// SingleVorbisComment(void);
-// ~SingleVorbisComment(void);
-//
-// string key();
-// bool setKey(string inKey);
-//
-// string value();
-// bool setValue(string inValue);
-//
-// string toString();
-//
-// unsigned long length();
-//
-// bool parseComment(string inCommentString);
-//
-//protected:
-// string mKey;
-// string mValue;
-//};
-
-
-public __gc class DNSingleVorbisComment
-{
-public:
- DNSingleVorbisComment(void);
- DNSingleVorbisComment(::SingleVorbisComment* inNativeClass);
- ~DNSingleVorbisComment(void);
-
- String* key();
- bool setKey(String* inKey);
-
- String* value();
- bool setValue(String* inValue);
-
- String* toString();
-
- Int64 length();
-
-protected:
-
- ::SingleVorbisComment* mNativeClass;
- //bool parseComment(String inCommentString);
-};
-
-
+#pragma once
+
+#pragma unmanaged
+//The directory is necessary to avoid recursive inclusion. native and DN class have same names.
+#include "libVorbisComment/SingleVorbisComment.h"
+
+#pragma managed
+
+using namespace illiminable::libiWrapper;
+using namespace System;
+
+namespace illiminable {
+ namespace Ogg {
+ namespace libVorbisCommentDotNET {
+
+//NATIVE CLASS
+//class LIBVORBISCOMMENT_API SingleVorbisComment
+//{
+//public:
+// SingleVorbisComment(void);
+// ~SingleVorbisComment(void);
+//
+// string key();
+// bool setKey(string inKey);
+//
+// string value();
+// bool setValue(string inValue);
+//
+// string toString();
+//
+// unsigned long length();
+//
+// bool parseComment(string inCommentString);
+//
+//protected:
+// string mKey;
+// string mValue;
+//};
+
+
+public __gc class DNSingleVorbisComment
+{
+public:
+ DNSingleVorbisComment(void);
+ DNSingleVorbisComment(::SingleVorbisComment* inNativeClass);
+ ~DNSingleVorbisComment(void);
+
+ String* key();
+ bool setKey(String* inKey);
+
+ String* value();
+ bool setValue(String* inValue);
+
+ String* toString();
+
+ Int64 length();
+
+protected:
+
+ ::SingleVorbisComment* mNativeClass;
+ //bool parseComment(String inCommentString);
+};
+
+
}}}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNSingleVorbisComment.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNStreamCommentInfo.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNStreamCommentInfo.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNStreamCommentInfo.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,73 +1,73 @@
-#include "StdAfx.h"
-#include ".\DNStreamCommentInfo.h"
-#using <mscorlib.dll>
-
-
-
-namespace illiminable {
- namespace Ogg {
- namespace libVorbisCommentDotNET {
-
-DNStreamCommentInfo::DNStreamCommentInfo(void)
-{
- mNativeClass = new ::StreamCommentInfo;
-}
-
-DNStreamCommentInfo::DNStreamCommentInfo(::StreamCommentInfo* inNativeClass) {
- mNativeClass = inNativeClass;
-}
-
-DNStreamCommentInfo::~DNStreamCommentInfo(void)
-{
- delete mNativeClass;
-}
-
-
-
-
-DNVorbisComments* DNStreamCommentInfo::comments() {
-
- return new illiminable::Ogg::libVorbisCommentDotNET::DNVorbisComments((::VorbisComments*)mNativeClass->comments());
-}
- //void setComments(VorbisComments* inComments);
-
-Int64 DNStreamCommentInfo::pageStart() {
- Int64 locNum = mNativeClass->pageStart();
- return locNum;
-}
-void DNStreamCommentInfo::setPageStart(Int64 inPageStart) {
- mNativeClass->setPageStart(inPageStart);
-}
-
-Int32 DNStreamCommentInfo::codecID() {
- Int32 locNum = mNativeClass->codecID();
- return locNum;
-}
-void DNStreamCommentInfo::setCodecID(Int32 inCodecID) {
- mNativeClass->setCodecID(inCodecID);
-}
-
-bool DNStreamCommentInfo::isDirty() {
- return mNativeClass->isDirty();
-}
-void DNStreamCommentInfo::setIsDirty(bool inIsDirty) {
- mNativeClass->setIsDirty(inIsDirty);
-}
-
-Int64 DNStreamCommentInfo::majorStreamNo() {
- Int64 locNum = mNativeClass->majorStreamNo();
- return locNum;
-}
-void DNStreamCommentInfo::setMajorStreamNo(Int64 inMajorStreamNo) {
- mNativeClass->setMajorStreamNo(inMajorStreamNo);
-}
-
-Int64 DNStreamCommentInfo::minorStreamNo() {
- Int64 locNum = mNativeClass->minorStreamNo();
- return locNum;
-}
-void DNStreamCommentInfo::setMinorStreamNo(Int64 inMinorStreamNo) {
- mNativeClass->setMinorStreamNo(inMinorStreamNo);
-}
-
+#include "StdAfx.h"
+#include ".\DNStreamCommentInfo.h"
+#using <mscorlib.dll>
+
+
+
+namespace illiminable {
+ namespace Ogg {
+ namespace libVorbisCommentDotNET {
+
+DNStreamCommentInfo::DNStreamCommentInfo(void)
+{
+ mNativeClass = new ::StreamCommentInfo;
+}
+
+DNStreamCommentInfo::DNStreamCommentInfo(::StreamCommentInfo* inNativeClass) {
+ mNativeClass = inNativeClass;
+}
+
+DNStreamCommentInfo::~DNStreamCommentInfo(void)
+{
+ delete mNativeClass;
+}
+
+
+
+
+DNVorbisComments* DNStreamCommentInfo::comments() {
+
+ return new illiminable::Ogg::libVorbisCommentDotNET::DNVorbisComments((::VorbisComments*)mNativeClass->comments());
+}
+ //void setComments(VorbisComments* inComments);
+
+Int64 DNStreamCommentInfo::pageStart() {
+ Int64 locNum = mNativeClass->pageStart();
+ return locNum;
+}
+void DNStreamCommentInfo::setPageStart(Int64 inPageStart) {
+ mNativeClass->setPageStart(inPageStart);
+}
+
+Int32 DNStreamCommentInfo::codecID() {
+ Int32 locNum = mNativeClass->codecID();
+ return locNum;
+}
+void DNStreamCommentInfo::setCodecID(Int32 inCodecID) {
+ mNativeClass->setCodecID(inCodecID);
+}
+
+bool DNStreamCommentInfo::isDirty() {
+ return mNativeClass->isDirty();
+}
+void DNStreamCommentInfo::setIsDirty(bool inIsDirty) {
+ mNativeClass->setIsDirty(inIsDirty);
+}
+
+Int64 DNStreamCommentInfo::majorStreamNo() {
+ Int64 locNum = mNativeClass->majorStreamNo();
+ return locNum;
+}
+void DNStreamCommentInfo::setMajorStreamNo(Int64 inMajorStreamNo) {
+ mNativeClass->setMajorStreamNo(inMajorStreamNo);
+}
+
+Int64 DNStreamCommentInfo::minorStreamNo() {
+ Int64 locNum = mNativeClass->minorStreamNo();
+ return locNum;
+}
+void DNStreamCommentInfo::setMinorStreamNo(Int64 inMinorStreamNo) {
+ mNativeClass->setMinorStreamNo(inMinorStreamNo);
+}
+
}}}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNStreamCommentInfo.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNStreamCommentInfo.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNStreamCommentInfo.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNStreamCommentInfo.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,100 +1,100 @@
-#pragma once
-
-#pragma unmanaged
-#include "dllstuff.h"
-#include "libVorbisComment/VorbisComments.h"
-#include "libVorbisComment/StreamCommentInfo.h"
-
-#pragma managed
-#include "DNVorbisComments.h"
-using namespace System;
-using namespace illiminable::libiWrapper;
-namespace illiminable {
- namespace Ogg {
- namespace libVorbisCommentDotNET {
-
-//NATIVE CLASS
-//class LIBVORBISCOMMENT_API StreamCommentInfo
-//{
-//public:
-// StreamCommentInfo(void);
-// ~StreamCommentInfo(void);
-//
-// enum eCodecIDs {
-// NO_CODEC = 0,
-// VORBIS = 1,
-// THEORA = 2
-//
-// };
-// VorbisComments* comments();
-// void setComments(VorbisComments* inComments);
-//
-// __int64 pageStart();
-// void setPageStart(__int64 inPageStart);
-//
-// unsigned short codecID();
-// void setCodecID(unsigned short inCodecID);
-//
-// bool isDirty();
-// void setIsDirty(bool inIsDirty);
-//
-// unsigned long majorStreamNo();
-// void setMajorStreamNo(unsigned long inMajorStreamNo);
-//
-// unsigned long minorStreamNo();
-// void setMinorStreamNo(unsigned long inMinorStreamNo);
-//
-//protected:
-// VorbisComments* mComments;
-// __int64 mPageStart;
-// unsigned short mCodecID;
-//
-// bool mIsDirty;
-//
-// unsigned long mMajorStreamNo;
-// unsigned long mMinorStreamNo;
-//};
-
-
-
-
-
-
-public __gc class DNStreamCommentInfo
-{
-public:
- DNStreamCommentInfo(void);
- DNStreamCommentInfo(::StreamCommentInfo* inNativeClass);
- ~DNStreamCommentInfo(void);
-
-
-
- /*const Int32 NO_CODEC = 0;
- const Int32 VORBIS = 1;
- const Int32 THEORA = 2;*/
-
- DNVorbisComments* comments();
- //void setComments(VorbisComments* inComments);
-
- Int64 pageStart();
- void setPageStart(Int64 inPageStart);
-
- Int32 codecID();
- void setCodecID(Int32 inCodecID);
-
- bool isDirty();
- void setIsDirty(bool inIsDirty);
-
- Int64 majorStreamNo();
- void setMajorStreamNo(Int64 inMajorStreamNo);
-
- Int64 minorStreamNo();
- void setMinorStreamNo(Int64 inMinorStreamNo);
-
-protected:
- ::StreamCommentInfo* mNativeClass;
-};
-
-
-
+#pragma once
+
+#pragma unmanaged
+#include "dllstuff.h"
+#include "libVorbisComment/VorbisComments.h"
+#include "libVorbisComment/StreamCommentInfo.h"
+
+#pragma managed
+#include "DNVorbisComments.h"
+using namespace System;
+using namespace illiminable::libiWrapper;
+namespace illiminable {
+ namespace Ogg {
+ namespace libVorbisCommentDotNET {
+
+//NATIVE CLASS
+//class LIBVORBISCOMMENT_API StreamCommentInfo
+//{
+//public:
+// StreamCommentInfo(void);
+// ~StreamCommentInfo(void);
+//
+// enum eCodecIDs {
+// NO_CODEC = 0,
+// VORBIS = 1,
+// THEORA = 2
+//
+// };
+// VorbisComments* comments();
+// void setComments(VorbisComments* inComments);
+//
+// __int64 pageStart();
+// void setPageStart(__int64 inPageStart);
+//
+// unsigned short codecID();
+// void setCodecID(unsigned short inCodecID);
+//
+// bool isDirty();
+// void setIsDirty(bool inIsDirty);
+//
+// unsigned long majorStreamNo();
+// void setMajorStreamNo(unsigned long inMajorStreamNo);
+//
+// unsigned long minorStreamNo();
+// void setMinorStreamNo(unsigned long inMinorStreamNo);
+//
+//protected:
+// VorbisComments* mComments;
+// __int64 mPageStart;
+// unsigned short mCodecID;
+//
+// bool mIsDirty;
+//
+// unsigned long mMajorStreamNo;
+// unsigned long mMinorStreamNo;
+//};
+
+
+
+
+
+
+public __gc class DNStreamCommentInfo
+{
+public:
+ DNStreamCommentInfo(void);
+ DNStreamCommentInfo(::StreamCommentInfo* inNativeClass);
+ ~DNStreamCommentInfo(void);
+
+
+
+ /*const Int32 NO_CODEC = 0;
+ const Int32 VORBIS = 1;
+ const Int32 THEORA = 2;*/
+
+ DNVorbisComments* comments();
+ //void setComments(VorbisComments* inComments);
+
+ Int64 pageStart();
+ void setPageStart(Int64 inPageStart);
+
+ Int32 codecID();
+ void setCodecID(Int32 inCodecID);
+
+ bool isDirty();
+ void setIsDirty(bool inIsDirty);
+
+ Int64 majorStreamNo();
+ void setMajorStreamNo(Int64 inMajorStreamNo);
+
+ Int64 minorStreamNo();
+ void setMinorStreamNo(Int64 inMinorStreamNo);
+
+protected:
+ ::StreamCommentInfo* mNativeClass;
+};
+
+
+
}}}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNStreamCommentInfo.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNVorbisComments.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNVorbisComments.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNVorbisComments.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,72 +1,72 @@
-#include "StdAfx.h"
-#include ".\DNVorbisComments.h"
-#using <mscorlib.dll>
-
-
-namespace illiminable {
- namespace Ogg {
- namespace libVorbisCommentDotNET {
-DNVorbisComments::DNVorbisComments(void)
- : mNativeClass(NULL)
-{
- mNativeClass = new ::VorbisComments;
-}
-
-DNVorbisComments::DNVorbisComments(::VorbisComments* inNativeClass) {
- mNativeClass = inNativeClass;
-}
-
-DNVorbisComments::~DNVorbisComments(void)
-{
- delete mNativeClass;
-}
-
-
-
-String* DNVorbisComments::vendorString() {
- return Wrappers::CStrToNetStr(mNativeClass->vendorString().c_str());
-}
-bool DNVorbisComments::setVendorString(String* inVendorString) {
- char* locCS = Wrappers::netStrToCStr(inVendorString);
- mNativeClass->setVendorString(locCS);
- Wrappers::releaseCStr(locCS);
- return true;
-}
-
-Int64 DNVorbisComments::numUserComments() {
- Int64 locNum = mNativeClass->numUserComments();
- return locNum;
-}
-DNSingleVorbisComment* DNVorbisComments::getUserComment(Int64 inIndex) {
- unsigned long locIndex = inIndex;
-
- //FIX::: Need to clone this... or bad things will happen when garbage colelcted.
- return new illiminable::Ogg::libVorbisCommentDotNET::DNSingleVorbisComment((::SingleVorbisComment*)mNativeClass->getUserComment(locIndex));
-}
-
- //vector<SingleVorbisComment> getCommentsByKey(String* inKey);
-
-//bool DNVorbisComments::addComment(SingleVorbisComment* inComment) {
-//
-//}
-bool DNVorbisComments::addComment(String* inKey, String* inValue) {
- char* locCS1 = Wrappers::netStrToCStr(inKey);
- char* locCS2 = Wrappers::netStrToCStr(inValue);
- mNativeClass->addComment(locCS1, locCS2);
- Wrappers::releaseCStr(locCS1);
- Wrappers::releaseCStr(locCS2);
- return true;
-}
-
- //bool parseOggPacket(OggPacket* inPacket, unsigned long inStartOffset);
- //OggPacket* toOggPacket();
-String* DNVorbisComments::toString() {
- return Wrappers::CStrToNetStr(mNativeClass->toString().c_str());
-}
-
-Int64 DNVorbisComments::size() {
- Int64 locNum = mNativeClass->size();
- return locNum;
-}
-
+#include "StdAfx.h"
+#include ".\DNVorbisComments.h"
+#using <mscorlib.dll>
+
+
+namespace illiminable {
+ namespace Ogg {
+ namespace libVorbisCommentDotNET {
+DNVorbisComments::DNVorbisComments(void)
+ : mNativeClass(NULL)
+{
+ mNativeClass = new ::VorbisComments;
+}
+
+DNVorbisComments::DNVorbisComments(::VorbisComments* inNativeClass) {
+ mNativeClass = inNativeClass;
+}
+
+DNVorbisComments::~DNVorbisComments(void)
+{
+ delete mNativeClass;
+}
+
+
+
+String* DNVorbisComments::vendorString() {
+ return Wrappers::CStrToNetStr(mNativeClass->vendorString().c_str());
+}
+bool DNVorbisComments::setVendorString(String* inVendorString) {
+ char* locCS = Wrappers::netStrToCStr(inVendorString);
+ mNativeClass->setVendorString(locCS);
+ Wrappers::releaseCStr(locCS);
+ return true;
+}
+
+Int64 DNVorbisComments::numUserComments() {
+ Int64 locNum = mNativeClass->numUserComments();
+ return locNum;
+}
+DNSingleVorbisComment* DNVorbisComments::getUserComment(Int64 inIndex) {
+ unsigned long locIndex = inIndex;
+
+ //FIX::: Need to clone this... or bad things will happen when garbage colelcted.
+ return new illiminable::Ogg::libVorbisCommentDotNET::DNSingleVorbisComment((::SingleVorbisComment*)mNativeClass->getUserComment(locIndex));
+}
+
+ //vector<SingleVorbisComment> getCommentsByKey(String* inKey);
+
+//bool DNVorbisComments::addComment(SingleVorbisComment* inComment) {
+//
+//}
+bool DNVorbisComments::addComment(String* inKey, String* inValue) {
+ char* locCS1 = Wrappers::netStrToCStr(inKey);
+ char* locCS2 = Wrappers::netStrToCStr(inValue);
+ mNativeClass->addComment(locCS1, locCS2);
+ Wrappers::releaseCStr(locCS1);
+ Wrappers::releaseCStr(locCS2);
+ return true;
+}
+
+ //bool parseOggPacket(OggPacket* inPacket, unsigned long inStartOffset);
+ //OggPacket* toOggPacket();
+String* DNVorbisComments::toString() {
+ return Wrappers::CStrToNetStr(mNativeClass->toString().c_str());
+}
+
+Int64 DNVorbisComments::size() {
+ Int64 locNum = mNativeClass->size();
+ return locNum;
+}
+
}}}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNVorbisComments.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNVorbisComments.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNVorbisComments.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNVorbisComments.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,77 +1,77 @@
-#pragma once
-#pragma unmanaged
-#include "dllstuff.h"
-#include "libVorbisComment/VorbisComments.h"
-
-#pragma managed
-#include "DNSingleVorbisComment.h"
-using namespace System;
-using namespace illiminable::libiWrapper;
-namespace illiminable {
- namespace Ogg {
- namespace libVorbisCommentDotNET {
-
-//NATIVE CLASS
-//class LIBVORBISCOMMENT_API VorbisComments
-//{
-//public:
-// VorbisComments(void);
-// ~VorbisComments(void);
-//
-// string vendorString();
-// bool setVendorString(string inVendorString);
-//
-// unsigned long numUserComments();
-// SingleVorbisComment getUserComment(unsigned long inIndex);
-//
-// vector<SingleVorbisComment> getCommentsByKey(string inKey);
-//
-// bool addComment(SingleVorbisComment inComment);
-// bool addComment(string inKey, string inValue);
-//
-// bool parseOggPacket(OggPacket* inPacket, unsigned long inStartOffset);
-// OggPacket* toOggPacket();
-// string toString();
-//
-// unsigned long size();
-//protected:
-// string mVendorString;
-// vector<SingleVorbisComment> mCommentList;
-//};
-
-
-
-
-public __gc class DNVorbisComments
-{
-public:
- DNVorbisComments(void);
- DNVorbisComments(::VorbisComments* inNativeClass);
- ~DNVorbisComments(void);
-
- String* vendorString();
- bool setVendorString(String* inVendorString);
-
- Int64 numUserComments();
- DNSingleVorbisComment* getUserComment(Int64 inIndex);
-
- //vector<SingleVorbisComment> getCommentsByKey(String* inKey);
-
- //bool addComment(SingleVorbisComment* inComment);
- bool addComment(String* inKey, String* inValue);
-
- //bool parseOggPacket(OggPacket* inPacket, unsigned long inStartOffset);
- //OggPacket* toOggPacket();
- String* toString();
-
- Int64 size();
-
-protected:
- ::VorbisComments* mNativeClass;
-
-private:
-
-};
-
-
+#pragma once
+#pragma unmanaged
+#include "dllstuff.h"
+#include "libVorbisComment/VorbisComments.h"
+
+#pragma managed
+#include "DNSingleVorbisComment.h"
+using namespace System;
+using namespace illiminable::libiWrapper;
+namespace illiminable {
+ namespace Ogg {
+ namespace libVorbisCommentDotNET {
+
+//NATIVE CLASS
+//class LIBVORBISCOMMENT_API VorbisComments
+//{
+//public:
+// VorbisComments(void);
+// ~VorbisComments(void);
+//
+// string vendorString();
+// bool setVendorString(string inVendorString);
+//
+// unsigned long numUserComments();
+// SingleVorbisComment getUserComment(unsigned long inIndex);
+//
+// vector<SingleVorbisComment> getCommentsByKey(string inKey);
+//
+// bool addComment(SingleVorbisComment inComment);
+// bool addComment(string inKey, string inValue);
+//
+// bool parseOggPacket(OggPacket* inPacket, unsigned long inStartOffset);
+// OggPacket* toOggPacket();
+// string toString();
+//
+// unsigned long size();
+//protected:
+// string mVendorString;
+// vector<SingleVorbisComment> mCommentList;
+//};
+
+
+
+
+public __gc class DNVorbisComments
+{
+public:
+ DNVorbisComments(void);
+ DNVorbisComments(::VorbisComments* inNativeClass);
+ ~DNVorbisComments(void);
+
+ String* vendorString();
+ bool setVendorString(String* inVendorString);
+
+ Int64 numUserComments();
+ DNSingleVorbisComment* getUserComment(Int64 inIndex);
+
+ //vector<SingleVorbisComment> getCommentsByKey(String* inKey);
+
+ //bool addComment(SingleVorbisComment* inComment);
+ bool addComment(String* inKey, String* inValue);
+
+ //bool parseOggPacket(OggPacket* inPacket, unsigned long inStartOffset);
+ //OggPacket* toOggPacket();
+ String* toString();
+
+ Int64 size();
+
+protected:
+ ::VorbisComments* mNativeClass;
+
+private:
+
+};
+
+
}}}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/DNVorbisComments.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/Stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/Stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/Stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,5 +1,5 @@
-// stdafx.cpp : source file that includes just the standard includes
-// libVorbisCommentDotNET.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
+// stdafx.cpp : source file that includes just the standard includes
+// libVorbisCommentDotNET.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/Stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/Stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/Stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/Stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently,
-// but are changed infrequently
-
-#pragma once
-
-#using <mscorlib.dll>
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently,
+// but are changed infrequently
+
+#pragma once
+
+#using <mscorlib.dll>
#using "libiWrapper.dll"
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/Stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/libVorbisCommentDotNET.cpp
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/libVorbisCommentDotNET.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/libVorbisCommentDotNET.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,6 +1,6 @@
-// This is the main DLL file.
-
-#include "stdafx.h"
-
-#include "libVorbisCommentDotNET.h"
-
+// This is the main DLL file.
+
+#include "stdafx.h"
+
+#include "libVorbisCommentDotNET.h"
+
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/libVorbisCommentDotNET.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/libVorbisCommentDotNET.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/libVorbisCommentDotNET.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/libVorbisCommentDotNET.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,13 +1,13 @@
-// libVorbisCommentDotNET.h
-
-#pragma once
-
-using namespace System;
-
-namespace libVorbisCommentDotNET
-{
- public __gc class Class1
- {
- // TODO: Add your methods for this class here.
- };
-}
+// libVorbisCommentDotNET.h
+
+#pragma once
+
+using namespace System;
+
+namespace libVorbisCommentDotNET
+{
+ public __gc class Class1
+ {
+ // TODO: Add your methods for this class here.
+ };
+}
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/libVorbisCommentDotNET.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/resource.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/resource.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/resource.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,3 +1,3 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by app.rc
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by app.rc
Property changes on: trunk/oggdsf/src/lib/core/ogg/libVorbisCommentDotNET/resource.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/ogg/libogg/include/ogg/ogg.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/ogg/libogg/include/ogg/os_types.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/core/ogg/libogg/macos/compat/sys/types.h
===================================================================
--- trunk/oggdsf/src/lib/core/ogg/libogg/macos/compat/sys/types.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/core/ogg/libogg/macos/compat/sys/types.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1 +1,29 @@
-#ifndef __SYS_TYPES_H__
#define __SYS_TYPES_H__ 1
#include <MacTypes.h>
#include <alloca.h>
#include <string.h>
typedef short int16_t;
typedef long int32_t;
typedef long long int64_t;
#define vorbis_size32_t long
#if defined(__cplusplus)
extern "C" {
#endif
#pragma options align=power
char *strdup(const char *inStr);
#pragma options align=reset
#if defined(__cplusplus)
}
#endif
#endif /* __SYS_TYPES_H__ */
\ No newline at end of file
+#ifndef __SYS_TYPES_H__
+#define __SYS_TYPES_H__ 1
+
+#include <MacTypes.h>
+#include <alloca.h>
+#include <string.h>
+
+typedef short int16_t;
+typedef long int32_t;
+typedef long long int64_t;
+
+#define vorbis_size32_t long
+
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#pragma options align=power
+
+char *strdup(const char *inStr);
+
+#pragma options align=reset
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* __SYS_TYPES_H__ */
Property changes on: trunk/oggdsf/src/lib/core/ogg/libogg/macos/compat/sys/types.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/ogg/liboggz/include/oggz/oggz.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/ogg/liboggz/include/oggz/oggz_constants.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/ogg/liboggz/include/oggz/oggz_io.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/ogg/liboggz/include/oggz/oggz_table.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/ogg/liboggz/src/liboggz/oggz_auto.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/ogg/liboggz/src/liboggz/oggz_byteorder.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/ogg/liboggz/src/liboggz/oggz_compat.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/ogg/liboggz/src/liboggz/oggz_macros.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/ogg/liboggz/src/liboggz/oggz_private.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/ogg/liboggz/src/liboggz/oggz_vector.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/ogg/liboggz/src/tests/oggz_tests.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/ogg/liboggz/win32/config.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/core/ogg/liboggz/win32/getopt.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/iDSHelper/DSStringer.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/iDSHelper/DSStringer.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/iDSHelper/DSStringer.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,16 +1,16 @@
-#include "StdAfx.h"
-#include ".\dsstringer.h"
-#include "StringHelper.h"
-string DSStringer::GUID2String(const GUID* inGUID) {
- string retStr = "{" + StringHelper::numToString(inGUID->Data1) +
- "-" + StringHelper::numToString(inGUID->Data2) +
- "-" + StringHelper::numToString(inGUID->Data3) +
- "-";
-
- for (int i = 0; i < 8; i++) {
- retStr += inGUID->Data4[i];
- }
- retStr += "}";
- return retStr;
-
+#include "StdAfx.h"
+#include ".\dsstringer.h"
+#include "StringHelper.h"
+string DSStringer::GUID2String(const GUID* inGUID) {
+ string retStr = "{" + StringHelper::numToString(inGUID->Data1) +
+ "-" + StringHelper::numToString(inGUID->Data2) +
+ "-" + StringHelper::numToString(inGUID->Data3) +
+ "-";
+
+ for (int i = 0; i < 8; i++) {
+ retStr += inGUID->Data4[i];
+ }
+ retStr += "}";
+ return retStr;
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/helper/iDSHelper/DSStringer.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/iDSHelper/DSStringer.h
===================================================================
--- trunk/oggdsf/src/lib/helper/iDSHelper/DSStringer.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/iDSHelper/DSStringer.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,12 +1,12 @@
-#pragma once
-#include "iDSHelper.h"
-#include <string>
-
-using namespace std;
-
-class IDSHELPER_API DSStringer
-{
-public:
-
- static string GUID2String(const GUID* inGUID);
-};
+#pragma once
+#include "iDSHelper.h"
+#include <string>
+
+using namespace std;
+
+class IDSHELPER_API DSStringer
+{
+public:
+
+ static string GUID2String(const GUID* inGUID);
+};
Property changes on: trunk/oggdsf/src/lib/helper/iDSHelper/DSStringer.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/iDSHelper/iDSHelper.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/iDSHelper/iDSHelper.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/iDSHelper/iDSHelper.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,20 +1,20 @@
-// iDSHelper.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-#include "iDSHelper.h"
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
-}
+// iDSHelper.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+#include "iDSHelper.h"
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ switch (ul_reason_for_call)
+ {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
+}
Property changes on: trunk/oggdsf/src/lib/helper/iDSHelper/iDSHelper.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/iDSHelper/iDSHelper.h
===================================================================
--- trunk/oggdsf/src/lib/helper/iDSHelper/iDSHelper.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/iDSHelper/iDSHelper.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,12 +1,12 @@
-// The following ifdef block is the standard way of creating macros which make exporting
-// from a DLL simpler. All files within this DLL are compiled with the IDSHELPER_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see
-// IDSHELPER_API functions as being imported from a DLL, whereas this DLL sees symbols
-// defined with this macro as being exported.
-#ifdef IDSHELPER_EXPORTS
-#define IDSHELPER_API __declspec(dllexport)
-#else
-#define IDSHELPER_API __declspec(dllimport)
-#endif
-
+// The following ifdef block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the IDSHELPER_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// IDSHELPER_API functions as being imported from a DLL, whereas this DLL sees symbols
+// defined with this macro as being exported.
+#ifdef IDSHELPER_EXPORTS
+#define IDSHELPER_API __declspec(dllexport)
+#else
+#define IDSHELPER_API __declspec(dllimport)
+#endif
+
Property changes on: trunk/oggdsf/src/lib/helper/iDSHelper/iDSHelper.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/iDSHelper/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/iDSHelper/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/iDSHelper/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// iDSHelper.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// iDSHelper.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/helper/iDSHelper/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/iDSHelper/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/helper/iDSHelper/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/iDSHelper/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,13 +1,13 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-// TODO: reference additional headers your program requires here
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/lib/helper/iDSHelper/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/libCDROM/CDROM.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libCDROM/CDROM.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/libCDROM/CDROM.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,192 +1,192 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "cdrom.h"
-
-CDROM::CDROM(void)
- : mDriveHandle(INVALID_HANDLE_VALUE)
-{
-}
-
-CDROM::~CDROM(void)
-{
-}
-
-//IOCTL_CDROM_GET_DRIVE_GEOMETRY
-
-DISK_GEOMETRY* CDROM::getDiskGeom() {
-
- if (mDriveHandle == INVALID_HANDLE_VALUE) {
- return NULL;
- }
-
- DWORD locBytesRead = 0;
-
- BOOL locRet = DeviceIoControl( mDriveHandle,
- IOCTL_CDROM_GET_DRIVE_GEOMETRY,
- NULL,
- 0,
- &mGeom,
- sizeof(mGeom),
- &locBytesRead,
- NULL);
-
- if (locRet == FALSE) {
- CloseHandle(mDriveHandle);
- mDriveHandle = INVALID_HANDLE_VALUE;
- return NULL;
- }
-
- return &mGeom;
-
-}
-int CDROM::ejectDraw() {
- if (mDriveHandle == INVALID_HANDLE_VALUE) {
- return NO_DRIVE_HANDLE;
- }
-
- DWORD locBytesRead = 0;
- BOOL locRet = DeviceIoControl( mDriveHandle,
- IOCTL_STORAGE_EJECT_MEDIA,
- NULL,
- 0,
- NULL,
- 0,
- &locBytesRead,
- NULL);
-
- if (locRet == FALSE) {
- CloseHandle(mDriveHandle);
- mDriveHandle = INVALID_HANDLE_VALUE;
- return READ_TOC_FAILED;
- }
- return 0;
-}
-int CDROM::closeDraw() {
- return 0;
-}
-
-
-int CDROM::initDrive(string inDrive) {
- //http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/createfile.asp
-
- //HANDLE CreateFile(
- // LPCTSTR lpFileName,
- // DWORD dwDesiredAccess,
- // DWORD dwShareMode,
- // LPSECURITY_ATTRIBUTES lpSecurityAttributes,
- // DWORD dwCreationDisposition,
- // DWORD dwFlagsAndAttributes,
- // HANDLE hTemplateFile
- //);
-
- if ((inDrive.length() != 2) || (inDrive[1] != ':')) {
- return INVALID_DRIVE_STRING;
- }
-
- if (mDriveHandle != INVALID_HANDLE_VALUE) {
- CloseHandle(mDriveHandle);
- mDriveHandle = INVALID_HANDLE_VALUE;
- }
-
- string locDeviceString = "\\\\.\\"+inDrive;
-
- mDriveHandle = CreateFile( locDeviceString.c_str(),
- GENERIC_READ,
- FILE_SHARE_READ,
- NULL,
- OPEN_EXISTING,
- FILE_ATTRIBUTE_READONLY,
- NULL);
-
- if (mDriveHandle == INVALID_HANDLE_VALUE) {
- return CREATE_HANDLE_FAILED;
- }
-
-
- return 0;
-}
-
-int CDROM::readTOC() {
-
- //http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/deviceiocontrol.asp
-
- //BOOL DeviceIoControl(
- // HANDLE hDevice,
- // DWORD dwIoControlCode,
- // LPVOID lpInBuffer,
- // DWORD nInBufferSize,
- // LPVOID lpOutBuffer,
- // DWORD nOutBufferSize,
- // LPDWORD lpBytesReturned,
- // LPOVERLAPPED lpOverlapped
- //);
-
- //http://msdn.microsoft.com/library/default.asp?url=/library/en-us/storage/hh/storage/k307_8e0f2b70-edd0-424e-abb4-a81ea9f382fe.xml.asp
-
- //typedef struct _CDROM_TOC {
- // UCHAR Length[2];
- // UCHAR FirstTrack;
- // UCHAR LastTrack;
- // TRACK_DATA TrackData[MAXIMUM_NUMBER_TRACKS];
- //} CDROM_TOC, *PCDROM_TOC;
-
- if (mDriveHandle == INVALID_HANDLE_VALUE) {
- return NO_DRIVE_HANDLE;
- }
-
- DWORD locBytesRead = 0;
- BOOL locRet = DeviceIoControl( mDriveHandle,
- IOCTL_CDROM_READ_TOC,
- NULL,
- 0,
- &mTOC,
- sizeof(CDROM_TOC),
- &locBytesRead,
- NULL);
-
- if (locRet == FALSE) {
- CloseHandle(mDriveHandle);
- mDriveHandle = INVALID_HANDLE_VALUE;
- return READ_TOC_FAILED;
- }
-
- return 0;
-
-
-}
-
-CDROM_TOC* CDROM::getTOC() {
- return &mTOC;
-
-
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "cdrom.h"
+
+CDROM::CDROM(void)
+ : mDriveHandle(INVALID_HANDLE_VALUE)
+{
+}
+
+CDROM::~CDROM(void)
+{
+}
+
+//IOCTL_CDROM_GET_DRIVE_GEOMETRY
+
+DISK_GEOMETRY* CDROM::getDiskGeom() {
+
+ if (mDriveHandle == INVALID_HANDLE_VALUE) {
+ return NULL;
+ }
+
+ DWORD locBytesRead = 0;
+
+ BOOL locRet = DeviceIoControl( mDriveHandle,
+ IOCTL_CDROM_GET_DRIVE_GEOMETRY,
+ NULL,
+ 0,
+ &mGeom,
+ sizeof(mGeom),
+ &locBytesRead,
+ NULL);
+
+ if (locRet == FALSE) {
+ CloseHandle(mDriveHandle);
+ mDriveHandle = INVALID_HANDLE_VALUE;
+ return NULL;
+ }
+
+ return &mGeom;
+
+}
+int CDROM::ejectDraw() {
+ if (mDriveHandle == INVALID_HANDLE_VALUE) {
+ return NO_DRIVE_HANDLE;
+ }
+
+ DWORD locBytesRead = 0;
+ BOOL locRet = DeviceIoControl( mDriveHandle,
+ IOCTL_STORAGE_EJECT_MEDIA,
+ NULL,
+ 0,
+ NULL,
+ 0,
+ &locBytesRead,
+ NULL);
+
+ if (locRet == FALSE) {
+ CloseHandle(mDriveHandle);
+ mDriveHandle = INVALID_HANDLE_VALUE;
+ return READ_TOC_FAILED;
+ }
+ return 0;
+}
+int CDROM::closeDraw() {
+ return 0;
+}
+
+
+int CDROM::initDrive(string inDrive) {
+ //http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/createfile.asp
+
+ //HANDLE CreateFile(
+ // LPCTSTR lpFileName,
+ // DWORD dwDesiredAccess,
+ // DWORD dwShareMode,
+ // LPSECURITY_ATTRIBUTES lpSecurityAttributes,
+ // DWORD dwCreationDisposition,
+ // DWORD dwFlagsAndAttributes,
+ // HANDLE hTemplateFile
+ //);
+
+ if ((inDrive.length() != 2) || (inDrive[1] != ':')) {
+ return INVALID_DRIVE_STRING;
+ }
+
+ if (mDriveHandle != INVALID_HANDLE_VALUE) {
+ CloseHandle(mDriveHandle);
+ mDriveHandle = INVALID_HANDLE_VALUE;
+ }
+
+ string locDeviceString = "\\\\.\\"+inDrive;
+
+ mDriveHandle = CreateFile( locDeviceString.c_str(),
+ GENERIC_READ,
+ FILE_SHARE_READ,
+ NULL,
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_READONLY,
+ NULL);
+
+ if (mDriveHandle == INVALID_HANDLE_VALUE) {
+ return CREATE_HANDLE_FAILED;
+ }
+
+
+ return 0;
+}
+
+int CDROM::readTOC() {
+
+ //http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/deviceiocontrol.asp
+
+ //BOOL DeviceIoControl(
+ // HANDLE hDevice,
+ // DWORD dwIoControlCode,
+ // LPVOID lpInBuffer,
+ // DWORD nInBufferSize,
+ // LPVOID lpOutBuffer,
+ // DWORD nOutBufferSize,
+ // LPDWORD lpBytesReturned,
+ // LPOVERLAPPED lpOverlapped
+ //);
+
+ //http://msdn.microsoft.com/library/default.asp?url=/library/en-us/storage/hh/storage/k307_8e0f2b70-edd0-424e-abb4-a81ea9f382fe.xml.asp
+
+ //typedef struct _CDROM_TOC {
+ // UCHAR Length[2];
+ // UCHAR FirstTrack;
+ // UCHAR LastTrack;
+ // TRACK_DATA TrackData[MAXIMUM_NUMBER_TRACKS];
+ //} CDROM_TOC, *PCDROM_TOC;
+
+ if (mDriveHandle == INVALID_HANDLE_VALUE) {
+ return NO_DRIVE_HANDLE;
+ }
+
+ DWORD locBytesRead = 0;
+ BOOL locRet = DeviceIoControl( mDriveHandle,
+ IOCTL_CDROM_READ_TOC,
+ NULL,
+ 0,
+ &mTOC,
+ sizeof(CDROM_TOC),
+ &locBytesRead,
+ NULL);
+
+ if (locRet == FALSE) {
+ CloseHandle(mDriveHandle);
+ mDriveHandle = INVALID_HANDLE_VALUE;
+ return READ_TOC_FAILED;
+ }
+
+ return 0;
+
+
+}
+
+CDROM_TOC* CDROM::getTOC() {
+ return &mTOC;
+
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/helper/libCDROM/CDROM.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/libCDROM/CDROM.h
===================================================================
--- trunk/oggdsf/src/lib/helper/libCDROM/CDROM.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/libCDROM/CDROM.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,70 +1,70 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-#include <string>
-using namespace std;
-//#include <ntddcdrm.h>
-#include "cdwin32api.h"
-#include <winioctl.h>
-class LIBCDROM_API CDROM
-{
-public:
- CDROM(void);
- ~CDROM(void);
-
- enum eInitErrors {
- INVALID_DRIVE_STRING = 1,
- CREATE_HANDLE_FAILED = 2
- };
-
- enum eTOCErrors {
- NO_DRIVE_HANDLE = 1,
- READ_TOC_FAILED = 2
-
- };
- int initDrive(string inDrive);
-
- int readTOC();
- CDROM_TOC* getTOC();
-
- DISK_GEOMETRY* getDiskGeom();
-
- int ejectDraw();
- int closeDraw();
-
-
-protected:
- HANDLE mDriveHandle;
- CDROM_TOC mTOC;
- DISK_GEOMETRY mGeom;
-};
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+#include <string>
+using namespace std;
+//#include <ntddcdrm.h>
+#include "cdwin32api.h"
+#include <winioctl.h>
+class LIBCDROM_API CDROM
+{
+public:
+ CDROM(void);
+ ~CDROM(void);
+
+ enum eInitErrors {
+ INVALID_DRIVE_STRING = 1,
+ CREATE_HANDLE_FAILED = 2
+ };
+
+ enum eTOCErrors {
+ NO_DRIVE_HANDLE = 1,
+ READ_TOC_FAILED = 2
+
+ };
+ int initDrive(string inDrive);
+
+ int readTOC();
+ CDROM_TOC* getTOC();
+
+ DISK_GEOMETRY* getDiskGeom();
+
+ int ejectDraw();
+ int closeDraw();
+
+
+protected:
+ HANDLE mDriveHandle;
+ CDROM_TOC mTOC;
+ DISK_GEOMETRY mGeom;
+};
Property changes on: trunk/oggdsf/src/lib/helper/libCDROM/CDROM.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/libCDROM/cdwin32api.h
===================================================================
--- trunk/oggdsf/src/lib/helper/libCDROM/cdwin32api.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/libCDROM/cdwin32api.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,72 +1,72 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-//BOOL WINAPI DeviceIoControl(
-// HANDLE hDevice,
-// DWORD dwIoControlCode,
-// LPVOID lpInBuffer,
-// DWORD nInBufferSize,
-// LPVOID lpOutBuffer,
-// DWORD nOutBufferSize,
-// LPDWORD lpBytesReturned,
-// LPOVERLAPPED lpOverlapped
-//);
-
-#define MAXIMUM_NUMBER_TRACKS 100
-#define IOCTL_CDROM_READ_TOC 0x00024000
-#define IOCTL_GET_CONTROL 0x00024034
-#define IOCTL_CDROM_GET_DRIVE_GEOMETRY 0x0002404C
-#define IOCTL_CDROM_RAW_READ 0x0002403E
-
-//typedef struct _DISK_GEOMETRY {
-// LARGE_INTEGER Cylinders;
-// MEDIA_TYPE MediaType;
-// ULONG TracksPerCylinder;
-// ULONG SectorsPerTrack;
-// ULONG BytesPerSector;
-//} DISK_GEOMETRY, *PDISK_GEOMETRY;
-
-typedef struct _TRACK_DATA {
- UCHAR Reserved;
- UCHAR Control : 4;
- UCHAR Adr : 4;
- UCHAR TrackNumber;
- UCHAR Reserved1;
- UCHAR Address[4];
-} TRACK_DATA, *PTRACK_DATA;
-
-typedef struct _CDROM_TOC {
- UCHAR Length[2];
- UCHAR FirstTrack;
- UCHAR LastTrack;
- TRACK_DATA TrackData[MAXIMUM_NUMBER_TRACKS];
-} CDROM_TOC, *PCDROM_TOC;
-
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+//BOOL WINAPI DeviceIoControl(
+// HANDLE hDevice,
+// DWORD dwIoControlCode,
+// LPVOID lpInBuffer,
+// DWORD nInBufferSize,
+// LPVOID lpOutBuffer,
+// DWORD nOutBufferSize,
+// LPDWORD lpBytesReturned,
+// LPOVERLAPPED lpOverlapped
+//);
+
+#define MAXIMUM_NUMBER_TRACKS 100
+#define IOCTL_CDROM_READ_TOC 0x00024000
+#define IOCTL_GET_CONTROL 0x00024034
+#define IOCTL_CDROM_GET_DRIVE_GEOMETRY 0x0002404C
+#define IOCTL_CDROM_RAW_READ 0x0002403E
+
+//typedef struct _DISK_GEOMETRY {
+// LARGE_INTEGER Cylinders;
+// MEDIA_TYPE MediaType;
+// ULONG TracksPerCylinder;
+// ULONG SectorsPerTrack;
+// ULONG BytesPerSector;
+//} DISK_GEOMETRY, *PDISK_GEOMETRY;
+
+typedef struct _TRACK_DATA {
+ UCHAR Reserved;
+ UCHAR Control : 4;
+ UCHAR Adr : 4;
+ UCHAR TrackNumber;
+ UCHAR Reserved1;
+ UCHAR Address[4];
+} TRACK_DATA, *PTRACK_DATA;
+
+typedef struct _CDROM_TOC {
+ UCHAR Length[2];
+ UCHAR FirstTrack;
+ UCHAR LastTrack;
+ TRACK_DATA TrackData[MAXIMUM_NUMBER_TRACKS];
+} CDROM_TOC, *PCDROM_TOC;
+
Property changes on: trunk/oggdsf/src/lib/helper/libCDROM/cdwin32api.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/libCDROM/libCDROM.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libCDROM/libCDROM.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/libCDROM/libCDROM.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,52 +1,52 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// libCDROM.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-#include "libCDROM.h"
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
-}
-
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// libCDROM.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+#include "libCDROM.h"
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ switch (ul_reason_for_call)
+ {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
+}
+
Property changes on: trunk/oggdsf/src/lib/helper/libCDROM/libCDROM.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/libCDROM/libCDROM.h
===================================================================
--- trunk/oggdsf/src/lib/helper/libCDROM/libCDROM.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/libCDROM/libCDROM.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,43 +1,43 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// The following ifdef block is the standard way of creating macros which make exporting
-// from a DLL simpler. All files within this DLL are compiled with the LIBCDROM_EXPORTS
-// symbol defined on the command line. this symbol should not be defined on any project
-// that uses this DLL. This way any other project whose source files include this file see
-// LIBCDROM_API functions as being imported from a DLL, whereas this DLL sees symbols
-// defined with this macro as being exported.
-#ifdef LIBCDROM_EXPORTS
-#define LIBCDROM_API __declspec(dllexport)
-#else
-#define LIBCDROM_API __declspec(dllimport)
-#endif
-
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// The following ifdef block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the LIBCDROM_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// LIBCDROM_API functions as being imported from a DLL, whereas this DLL sees symbols
+// defined with this macro as being exported.
+#ifdef LIBCDROM_EXPORTS
+#define LIBCDROM_API __declspec(dllexport)
+#else
+#define LIBCDROM_API __declspec(dllimport)
+#endif
+
Property changes on: trunk/oggdsf/src/lib/helper/libCDROM/libCDROM.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/libCDROM/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libCDROM/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/libCDROM/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,40 +1,40 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-
-// stdafx.cpp : source file that includes just the standard includes
-// libCDROM.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+
+// stdafx.cpp : source file that includes just the standard includes
+// libCDROM.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/helper/libCDROM/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/libCDROM/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/helper/libCDROM/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/libCDROM/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,48 +1,48 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-#include <windows.h>
-
-// TODO: reference additional headers your program requires here
-#ifdef LIBCDROM_EXPORTS
-#define LIBCDROM_API __declspec(dllexport)
-#else
-#define LIBCDROM_API __declspec(dllimport)
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+#include <windows.h>
+
+// TODO: reference additional headers your program requires here
+#ifdef LIBCDROM_EXPORTS
+#define LIBCDROM_API __declspec(dllexport)
+#else
+#define LIBCDROM_API __declspec(dllimport)
#endif
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/helper/libCDROM/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/libiWrapper/AssemblyInfo.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libiWrapper/AssemblyInfo.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/libiWrapper/AssemblyInfo.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,64 +30,64 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-
-#include "stdafx.h"
-
-using namespace System::Reflection;
-using namespace System::Runtime::CompilerServices;
-
-//
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-//
-[assembly:AssemblyTitleAttribute("")];
-[assembly:AssemblyDescriptionAttribute("")];
-[assembly:AssemblyConfigurationAttribute("")];
-[assembly:AssemblyCompanyAttribute("")];
-[assembly:AssemblyProductAttribute("")];
-[assembly:AssemblyCopyrightAttribute("")];
-[assembly:AssemblyTrademarkAttribute("")];
-[assembly:AssemblyCultureAttribute("")];
-
-//
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the value or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-
-[assembly:AssemblyVersionAttribute("1.0.*")];
-
-//
-// In order to sign your assembly you must specify a key to use. Refer to the
-// Microsoft .NET Framework documentation for more information on assembly signing.
-//
-// Use the attributes below to control which key is used for signing.
-//
-// Notes:
-// (*) If no key is specified, the assembly is not signed.
-// (*) KeyName refers to a key that has been installed in the Crypto Service
-// Provider (CSP) on your machine. KeyFile refers to a file which contains
-// a key.
-// (*) If the KeyFile and the KeyName values are both specified, the
-// following processing occurs:
-// (1) If the KeyName can be found in the CSP, that key is used.
-// (2) If the KeyName does not exist and the KeyFile does exist, the key
-// in the KeyFile is installed into the CSP and used.
-// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
-// When specifying the KeyFile, the location of the KeyFile should be
-// relative to the project directory.
-// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
-// documentation for more information on this.
-//
-[assembly:AssemblyDelaySignAttribute(false)];
-[assembly:AssemblyKeyFileAttribute("")];
-[assembly:AssemblyKeyNameAttribute("")];
-
+*/
+
+
+#include "stdafx.h"
+
+using namespace System::Reflection;
+using namespace System::Runtime::CompilerServices;
+
+//
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly:AssemblyTitleAttribute("")];
+[assembly:AssemblyDescriptionAttribute("")];
+[assembly:AssemblyConfigurationAttribute("")];
+[assembly:AssemblyCompanyAttribute("")];
+[assembly:AssemblyProductAttribute("")];
+[assembly:AssemblyCopyrightAttribute("")];
+[assembly:AssemblyTrademarkAttribute("")];
+[assembly:AssemblyCultureAttribute("")];
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the value or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly:AssemblyVersionAttribute("1.0.*")];
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing.
+//
+// Notes:
+// (*) If no key is specified, the assembly is not signed.
+// (*) KeyName refers to a key that has been installed in the Crypto Service
+// Provider (CSP) on your machine. KeyFile refers to a file which contains
+// a key.
+// (*) If the KeyFile and the KeyName values are both specified, the
+// following processing occurs:
+// (1) If the KeyName can be found in the CSP, that key is used.
+// (2) If the KeyName does not exist and the KeyFile does exist, the key
+// in the KeyFile is installed into the CSP and used.
+// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+// When specifying the KeyFile, the location of the KeyFile should be
+// relative to the project directory.
+// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+// documentation for more information on this.
+//
+[assembly:AssemblyDelaySignAttribute(false)];
+[assembly:AssemblyKeyFileAttribute("")];
+[assembly:AssemblyKeyNameAttribute("")];
+
Property changes on: trunk/oggdsf/src/lib/helper/libiWrapper/AssemblyInfo.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/libiWrapper/Stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libiWrapper/Stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/libiWrapper/Stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,11 +30,11 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-
-// stdafx.cpp : source file that includes just the standard includes
-// libiWrapper.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
+*/
+
+
+// stdafx.cpp : source file that includes just the standard includes
+// libiWrapper.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
Property changes on: trunk/oggdsf/src/lib/helper/libiWrapper/Stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/libiWrapper/Stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/helper/libiWrapper/Stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/libiWrapper/Stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,14 +30,14 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently,
-// but are changed infrequently
-
-#pragma once
-
-#using <mscorlib.dll>
-
+*/
+
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently,
+// but are changed infrequently
+
+#pragma once
+
+#using <mscorlib.dll>
+
Property changes on: trunk/oggdsf/src/lib/helper/libiWrapper/Stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/libiWrapper/Wrappers.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libiWrapper/Wrappers.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/libiWrapper/Wrappers.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,55 +30,55 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-#include "StdAfx.h"
-
-#include "wrappers.h"
-
-
-
-namespace illiminable {
- namespace libiWrapper {
- Wrappers::Wrappers(void)
- {
- }
-
- Wrappers::~Wrappers(void)
- {
- }
-
-
- char* Wrappers::netStrToCStr(String* inNetString) {
- char* locCStr = (char*)Marshal::StringToHGlobalAnsi(inNetString).ToPointer();
- return locCStr;
- }
-
- void Wrappers::releaseCStr(char* inCStr) {
- Marshal::FreeHGlobal((int)inCStr);
- }
-
- wchar_t* Wrappers::netStrToWStr(String* inNetString) {
- wchar_t* locWStr = (wchar_t*)Marshal::StringToHGlobalUni(inNetString).ToPointer();
- return locWStr;
- }
-
- void Wrappers::releaseWStr(wchar_t* inWStr) {
- Marshal::FreeHGlobal((int)inWStr);
- }
- String* Wrappers::CStrToNetStr(const char* inCStr) {
- String* retStr;
- retStr = Marshal::PtrToStringAnsi((char*)inCStr);
- return retStr;
- }
-
- String* Wrappers::WStrToNetStr(const wchar_t* inWStr) {
- String* retStr;
- //retStr = Marshal::PtrToStringUni((wchar_t*)inWStr);
- retStr = new String(inWStr);
- return retStr;
- }
-
-
-}
+*/
+
+#include "StdAfx.h"
+
+#include "wrappers.h"
+
+
+
+namespace illiminable {
+ namespace libiWrapper {
+ Wrappers::Wrappers(void)
+ {
+ }
+
+ Wrappers::~Wrappers(void)
+ {
+ }
+
+
+ char* Wrappers::netStrToCStr(String* inNetString) {
+ char* locCStr = (char*)Marshal::StringToHGlobalAnsi(inNetString).ToPointer();
+ return locCStr;
+ }
+
+ void Wrappers::releaseCStr(char* inCStr) {
+ Marshal::FreeHGlobal((int)inCStr);
+ }
+
+ wchar_t* Wrappers::netStrToWStr(String* inNetString) {
+ wchar_t* locWStr = (wchar_t*)Marshal::StringToHGlobalUni(inNetString).ToPointer();
+ return locWStr;
+ }
+
+ void Wrappers::releaseWStr(wchar_t* inWStr) {
+ Marshal::FreeHGlobal((int)inWStr);
+ }
+ String* Wrappers::CStrToNetStr(const char* inCStr) {
+ String* retStr;
+ retStr = Marshal::PtrToStringAnsi((char*)inCStr);
+ return retStr;
+ }
+
+ String* Wrappers::WStrToNetStr(const wchar_t* inWStr) {
+ String* retStr;
+ //retStr = Marshal::PtrToStringUni((wchar_t*)inWStr);
+ retStr = new String(inWStr);
+ return retStr;
+ }
+
+
+}
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/helper/libiWrapper/Wrappers.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/libiWrapper/Wrappers.h
===================================================================
--- trunk/oggdsf/src/lib/helper/libiWrapper/Wrappers.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/libiWrapper/Wrappers.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,31 +30,31 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-
-#pragma once
-using namespace System::Runtime::InteropServices;
-using namespace System;
-
-
-//This is a small subset of the full wrappers marshalling class. It only includes the string
-// marshalling functions.
-namespace illiminable {
-namespace libiWrapper {
- public __gc class Wrappers
- {
- public:
- Wrappers(void);
- ~Wrappers(void);
- static char* netStrToCStr(String* inNetString);
-
- static void releaseCStr(char* inCStr);
- static String* CStrToNetStr(const char* inCStr);
- static String* WStrToNetStr(const wchar_t* inWStr);
- static wchar_t* netStrToWStr(String* inNetString);
- static void releaseWStr(wchar_t* inWStr);
-
- };
-}
+*/
+
+
+#pragma once
+using namespace System::Runtime::InteropServices;
+using namespace System;
+
+
+//This is a small subset of the full wrappers marshalling class. It only includes the string
+// marshalling functions.
+namespace illiminable {
+namespace libiWrapper {
+ public __gc class Wrappers
+ {
+ public:
+ Wrappers(void);
+ ~Wrappers(void);
+ static char* netStrToCStr(String* inNetString);
+
+ static void releaseCStr(char* inCStr);
+ static String* CStrToNetStr(const char* inCStr);
+ static String* WStrToNetStr(const wchar_t* inWStr);
+ static wchar_t* netStrToWStr(String* inNetString);
+ static void releaseWStr(wchar_t* inWStr);
+
+ };
+}
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/helper/libiWrapper/Wrappers.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/libiWrapper/libiWrapper.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libiWrapper/libiWrapper.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/libiWrapper/libiWrapper.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,12 +30,12 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-
-// This is the main DLL file.
-
-#include "stdafx.h"
-
-#include "libiWrapper.h"
-
+*/
+
+
+// This is the main DLL file.
+
+#include "stdafx.h"
+
+#include "libiWrapper.h"
+
Property changes on: trunk/oggdsf/src/lib/helper/libiWrapper/libiWrapper.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/libiWrapper/libiWrapper.h
===================================================================
--- trunk/oggdsf/src/lib/helper/libiWrapper/libiWrapper.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/libiWrapper/libiWrapper.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -30,17 +30,17 @@
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-
-// libiWrapper.h
-
-#pragma once
-
-using namespace System;
-
-namespace illiminable {
-namespace libiWrapper {
-
-}
+*/
+
+
+// libiWrapper.h
+
+#pragma once
+
+using namespace System;
+
+namespace illiminable {
+namespace libiWrapper {
+
+}
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/helper/libiWrapper/libiWrapper.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/libilliCore/StringHelper.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libilliCore/StringHelper.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/libilliCore/StringHelper.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,123 +1,123 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "stringhelper.h"
-
-StringHelper::StringHelper(void)
-{
-}
-
-StringHelper::~StringHelper(void)
-{
-}
-
-wstring StringHelper::toWStr(string inString) {
- wstring retVal;
-
- //LPCWSTR retPtr = new wchar_t[retVal.length() + 1];
- for (std::string::const_iterator i = inString.begin(); i != inString.end(); i++) {
- retVal.append(1, *i);
- }
-
-
- return retVal;
-}
-
-
-string StringHelper::toNarrowStr(wstring inString) {
- string retVal;
-
- //LPCWSTR retPtr = new wchar_t[retVal.length() + 1];
- for (std::wstring::const_iterator i = inString.begin(); i != inString.end(); i++) {
- retVal.append(1, *i);
- }
-
-
- return retVal;
-}
-
-string StringHelper::numToString(LOOG_UINT64 inNum) {
- char locDigit = 0;
- string retStr = "";
- string temp = "";
-
- if (inNum == 0) return "0";
-
- while (inNum > 0) {
- locDigit = ((char)(inNum % 10)) + '0';
- inNum /= 10;
- temp = locDigit;
- temp.append(retStr);
- retStr = temp;
- //retStr.append(1, locDigit);
- }
- return retStr;
-}
-
-LOOG_UINT64 StringHelper::stringToNum(string inString) {
- int locDigit = 0;
- LOOG_UINT64 retVal = 0;
- size_t locStrLen = inString.length();
-
- for (unsigned long i = 0; i < locStrLen; i++) {
- locDigit = inString[i] - '0';
- //If it's not in the range 0-9 we bail out
- if ( !((locDigit >= 0) && (locDigit <=9)) ) {
- //FIX::: throw exception
- throw 0;
- }
- retVal *= 10;
- retVal += locDigit;
-
- }
- return retVal;
-
-}
-
-//These should go out to the string helper.
-unsigned char StringHelper::digitToHex(unsigned char inDigit) {
-
- unsigned char locDigit = (inDigit > 9) ? (inDigit - 10) + A_BASE
- : (inDigit) + ZERO_BASE;
- return locDigit;
-
-}
-
-string StringHelper::charToHexString(unsigned char inChar) {
-
- string retStr ="";
- retStr +=digitToHex(inChar / 16);
-
- retStr+= digitToHex(inChar % 16);
- return retStr;
-}
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "stringhelper.h"
+
+StringHelper::StringHelper(void)
+{
+}
+
+StringHelper::~StringHelper(void)
+{
+}
+
+wstring StringHelper::toWStr(string inString) {
+ wstring retVal;
+
+ //LPCWSTR retPtr = new wchar_t[retVal.length() + 1];
+ for (std::string::const_iterator i = inString.begin(); i != inString.end(); i++) {
+ retVal.append(1, *i);
+ }
+
+
+ return retVal;
+}
+
+
+string StringHelper::toNarrowStr(wstring inString) {
+ string retVal;
+
+ //LPCWSTR retPtr = new wchar_t[retVal.length() + 1];
+ for (std::wstring::const_iterator i = inString.begin(); i != inString.end(); i++) {
+ retVal.append(1, *i);
+ }
+
+
+ return retVal;
+}
+
+string StringHelper::numToString(LOOG_UINT64 inNum) {
+ char locDigit = 0;
+ string retStr = "";
+ string temp = "";
+
+ if (inNum == 0) return "0";
+
+ while (inNum > 0) {
+ locDigit = ((char)(inNum % 10)) + '0';
+ inNum /= 10;
+ temp = locDigit;
+ temp.append(retStr);
+ retStr = temp;
+ //retStr.append(1, locDigit);
+ }
+ return retStr;
+}
+
+LOOG_UINT64 StringHelper::stringToNum(string inString) {
+ int locDigit = 0;
+ LOOG_UINT64 retVal = 0;
+ size_t locStrLen = inString.length();
+
+ for (unsigned long i = 0; i < locStrLen; i++) {
+ locDigit = inString[i] - '0';
+ //If it's not in the range 0-9 we bail out
+ if ( !((locDigit >= 0) && (locDigit <=9)) ) {
+ //FIX::: throw exception
+ throw 0;
+ }
+ retVal *= 10;
+ retVal += locDigit;
+
+ }
+ return retVal;
+
+}
+
+//These should go out to the string helper.
+unsigned char StringHelper::digitToHex(unsigned char inDigit) {
+
+ unsigned char locDigit = (inDigit > 9) ? (inDigit - 10) + A_BASE
+ : (inDigit) + ZERO_BASE;
+ return locDigit;
+
+}
+
+string StringHelper::charToHexString(unsigned char inChar) {
+
+ string retStr ="";
+ retStr +=digitToHex(inChar / 16);
+
+ retStr+= digitToHex(inChar % 16);
+ return retStr;
+}
+
Property changes on: trunk/oggdsf/src/lib/helper/libilliCore/StringHelper.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/libilliCore/StringHelper.h
===================================================================
--- trunk/oggdsf/src/lib/helper/libilliCore/StringHelper.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/libilliCore/StringHelper.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,56 +1,56 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-
-#include "illicoreconfig.h"
-#include <string>
-using namespace std;
-
-class StringHelper
-{
-public:
- StringHelper(void);
- ~StringHelper(void);
- static const unsigned char A_BASE = 65; //A in ASCII
- static const unsigned char ZERO_BASE = 48;
-
- static unsigned char digitToHex(unsigned char inChar);
- static string charToHexString(unsigned char inChar);
-
- static string numToString(LOOG_UINT64 inNum);
- static LOOG_UINT64 stringToNum(string inString);
- static wstring StringHelper::toWStr(string inString);
- static string StringHelper::toNarrowStr(wstring inString);
-
- //static string numToHexString(unsigned __int64 inNum, unsigned char inWidth);
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+
+#include "illicoreconfig.h"
+#include <string>
+using namespace std;
+
+class StringHelper
+{
+public:
+ StringHelper(void);
+ ~StringHelper(void);
+ static const unsigned char A_BASE = 65; //A in ASCII
+ static const unsigned char ZERO_BASE = 48;
+
+ static unsigned char digitToHex(unsigned char inChar);
+ static string charToHexString(unsigned char inChar);
+
+ static string numToString(LOOG_UINT64 inNum);
+ static LOOG_UINT64 stringToNum(string inString);
+ static wstring StringHelper::toWStr(string inString);
+ static string StringHelper::toNarrowStr(wstring inString);
+
+ //static string numToHexString(unsigned __int64 inNum, unsigned char inWidth);
+
+};
Property changes on: trunk/oggdsf/src/lib/helper/libilliCore/StringHelper.h
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/helper/libilliCore/config.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/libilliCore/iBE_Math.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libilliCore/iBE_Math.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/libilliCore/iBE_Math.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,69 +1,69 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include "iBE_Math.h"
-
-iBE_Math::iBE_Math(void)
-{
-}
-
-iBE_Math::~iBE_Math(void)
-{
-}
-
-unsigned long iBE_Math::charArrToULong(unsigned char* inCharArray)
-{
- //Turns the next four bytes from the pointer in a long MSB (most sig. byte first/leftmost)
- unsigned long locVal = 0;
- for (int i = 0; i < 4; i++) {
- locVal <<= 8;
- locVal += inCharArray[i];
- }
- return locVal;
-}
-void iBE_Math::ULongToCharArr(unsigned long inLong, unsigned char* outCharArray)
-{
- //Writes a long MSB (Most sig. byte first/leftmost) out to the char arr
- unsigned long locLong = inLong;
- outCharArray[0] = (unsigned char) (inLong >> 24);
- outCharArray[1] = (unsigned char) ((inLong << 8) >> 24);
- outCharArray[2] = (unsigned char) ((inLong << 16) >> 24);
- outCharArray[3] = (unsigned char) ((inLong << 24) >> 24);
-
-}
-
-unsigned short iBE_Math::charArrToUShort(unsigned char* inCharArray) {
- unsigned short retShort = inCharArray[0];
- retShort = (retShort << 8) + inCharArray[1];
- return retShort;
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include "iBE_Math.h"
+
+iBE_Math::iBE_Math(void)
+{
+}
+
+iBE_Math::~iBE_Math(void)
+{
+}
+
+unsigned long iBE_Math::charArrToULong(unsigned char* inCharArray)
+{
+ //Turns the next four bytes from the pointer in a long MSB (most sig. byte first/leftmost)
+ unsigned long locVal = 0;
+ for (int i = 0; i < 4; i++) {
+ locVal <<= 8;
+ locVal += inCharArray[i];
+ }
+ return locVal;
+}
+void iBE_Math::ULongToCharArr(unsigned long inLong, unsigned char* outCharArray)
+{
+ //Writes a long MSB (Most sig. byte first/leftmost) out to the char arr
+ unsigned long locLong = inLong;
+ outCharArray[0] = (unsigned char) (inLong >> 24);
+ outCharArray[1] = (unsigned char) ((inLong << 8) >> 24);
+ outCharArray[2] = (unsigned char) ((inLong << 16) >> 24);
+ outCharArray[3] = (unsigned char) ((inLong << 24) >> 24);
+
+}
+
+unsigned short iBE_Math::charArrToUShort(unsigned char* inCharArray) {
+ unsigned short retShort = inCharArray[0];
+ retShort = (retShort << 8) + inCharArray[1];
+ return retShort;
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/helper/libilliCore/iBE_Math.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/libilliCore/iBE_Math.h
===================================================================
--- trunk/oggdsf/src/lib/helper/libilliCore/iBE_Math.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/libilliCore/iBE_Math.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,43 +1,43 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "illicoreconfig.h"
-class iBE_Math
-{
-public:
- iBE_Math(void);
- ~iBE_Math(void);
- static unsigned long charArrToULong(unsigned char* inCharArray);
- static void ULongToCharArr(unsigned long inLong, unsigned char* outCharArray);
- static unsigned short charArrToUShort(unsigned char* inCharArray);
-
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "illicoreconfig.h"
+class iBE_Math
+{
+public:
+ iBE_Math(void);
+ ~iBE_Math(void);
+ static unsigned long charArrToULong(unsigned char* inCharArray);
+ static void ULongToCharArr(unsigned long inLong, unsigned char* outCharArray);
+ static unsigned short charArrToUShort(unsigned char* inCharArray);
+
+};
Property changes on: trunk/oggdsf/src/lib/helper/libilliCore/iBE_Math.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/libilliCore/iLE_Math.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libilliCore/iLE_Math.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/libilliCore/iLE_Math.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,86 +1,86 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "stdafx.h"
-#include "iLE_Math.h"
-
-iLE_Math::iLE_Math(void)
-{
-}
-
-iLE_Math::~iLE_Math(void)
-{
-}
-
-unsigned long iLE_Math::charArrToULong(const unsigned char* inCharArray)
-{
- //Turns the next four bytes from the pointer in a long LSB (least sig. byte first/leftmost)
- unsigned long locVal = 0;
- for (int i = 3; i >= 0; i--) {
- locVal <<= 8;
- locVal += inCharArray[i];
- }
- return locVal;
-}
-void iLE_Math::ULongToCharArr(unsigned long inLong, unsigned char* outCharArray)
-{
- //Writes a long LSB (least sig. byte first/leftmost) out to the char arr
-
- outCharArray[3] = (unsigned char) (inLong >> 24);
- outCharArray[2] = (unsigned char) ((inLong << 8) >> 24);
- outCharArray[1] = (unsigned char) ((inLong << 16) >> 24);
- outCharArray[0] = (unsigned char) ((inLong << 24) >> 24);
-
-}
-
-void iLE_Math::UShortToCharArr(unsigned short inShort, unsigned char* outCharArray) {
- outCharArray[0] = inShort % 256;
- outCharArray[1] = inShort / 256;
-}
-unsigned short iLE_Math::charArrToUShort(const unsigned char* inCharArray) {
- return (inCharArray[1] << 8) + inCharArray[0];
-}
-LOOG_INT64 iLE_Math::CharArrToInt64(const unsigned char* inCharArray) {
- LOOG_INT64 locData = 0;
-
- for (int i = 7; i >= 0; i--) {
- locData <<= 8;
- locData += inCharArray[i];
- }
- return locData;
-}
-
-void iLE_Math::Int64ToCharArr(LOOG_INT64 inInt64, unsigned char* outCharArray) {
- for (unsigned char i = 0; i < 8; i++) {
- //This way sux !
- outCharArray[i] = (unsigned char)((inInt64 << ((7 - i) * 8)) >> 56);
- }
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "stdafx.h"
+#include "iLE_Math.h"
+
+iLE_Math::iLE_Math(void)
+{
+}
+
+iLE_Math::~iLE_Math(void)
+{
+}
+
+unsigned long iLE_Math::charArrToULong(const unsigned char* inCharArray)
+{
+ //Turns the next four bytes from the pointer in a long LSB (least sig. byte first/leftmost)
+ unsigned long locVal = 0;
+ for (int i = 3; i >= 0; i--) {
+ locVal <<= 8;
+ locVal += inCharArray[i];
+ }
+ return locVal;
+}
+void iLE_Math::ULongToCharArr(unsigned long inLong, unsigned char* outCharArray)
+{
+ //Writes a long LSB (least sig. byte first/leftmost) out to the char arr
+
+ outCharArray[3] = (unsigned char) (inLong >> 24);
+ outCharArray[2] = (unsigned char) ((inLong << 8) >> 24);
+ outCharArray[1] = (unsigned char) ((inLong << 16) >> 24);
+ outCharArray[0] = (unsigned char) ((inLong << 24) >> 24);
+
+}
+
+void iLE_Math::UShortToCharArr(unsigned short inShort, unsigned char* outCharArray) {
+ outCharArray[0] = inShort % 256;
+ outCharArray[1] = inShort / 256;
+}
+unsigned short iLE_Math::charArrToUShort(const unsigned char* inCharArray) {
+ return (inCharArray[1] << 8) + inCharArray[0];
+}
+LOOG_INT64 iLE_Math::CharArrToInt64(const unsigned char* inCharArray) {
+ LOOG_INT64 locData = 0;
+
+ for (int i = 7; i >= 0; i--) {
+ locData <<= 8;
+ locData += inCharArray[i];
+ }
+ return locData;
+}
+
+void iLE_Math::Int64ToCharArr(LOOG_INT64 inInt64, unsigned char* outCharArray) {
+ for (unsigned char i = 0; i < 8; i++) {
+ //This way sux !
+ outCharArray[i] = (unsigned char)((inInt64 << ((7 - i) * 8)) >> 56);
+ }
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/helper/libilliCore/iLE_Math.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/libilliCore/iLE_Math.h
===================================================================
--- trunk/oggdsf/src/lib/helper/libilliCore/iLE_Math.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/libilliCore/iLE_Math.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,47 +1,47 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "illicoreconfig.h"
-
-class iLE_Math
-{
-public:
- iLE_Math(void);
- ~iLE_Math(void);
- static unsigned long charArrToULong(const unsigned char* inCharArray);
- static void ULongToCharArr(unsigned long inLong, unsigned char* outCharArray);
- static void UShortToCharArr(unsigned short inShort, unsigned char* outCharArray);
-
- static LOOG_INT64 CharArrToInt64(const unsigned char* inCharArray);
- static void Int64ToCharArr(LOOG_INT64 inInt64, unsigned char* outCharArray);
- static unsigned short charArrToUShort(const unsigned char* inCharArray);
-};
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "illicoreconfig.h"
+
+class iLE_Math
+{
+public:
+ iLE_Math(void);
+ ~iLE_Math(void);
+ static unsigned long charArrToULong(const unsigned char* inCharArray);
+ static void ULongToCharArr(unsigned long inLong, unsigned char* outCharArray);
+ static void UShortToCharArr(unsigned short inShort, unsigned char* outCharArray);
+
+ static LOOG_INT64 CharArrToInt64(const unsigned char* inCharArray);
+ static void Int64ToCharArr(LOOG_INT64 inInt64, unsigned char* outCharArray);
+ static unsigned short charArrToUShort(const unsigned char* inCharArray);
+};
Property changes on: trunk/oggdsf/src/lib/helper/libilliCore/iLE_Math.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/libilliCore/illicoreconfig.h
===================================================================
--- trunk/oggdsf/src/lib/helper/libilliCore/illicoreconfig.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/libilliCore/illicoreconfig.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,24 +1,24 @@
-#pragma once
-
-#ifdef WIN32
-# include <windows.h>
-#else /* assume POSIX */
-# include <stdint.h>
-#endif
-
-#ifndef LOOG_INT64
-# ifdef WIN32
-# define LOOG_INT64 signed __int64
-# else /* assume POSIX */
-# define LOOG_INT64 int64_t
-# endif
-#endif
-
-#ifndef LOOG_UINT64
-# ifdef WIN32
-# define LOOG_UINT64 unsigned __int64
-# else /* assume POSIX */
-# define LOOG_UINT64 uint64_t
-# endif
-#endif
-
+#pragma once
+
+#ifdef WIN32
+# include <windows.h>
+#else /* assume POSIX */
+# include <stdint.h>
+#endif
+
+#ifndef LOOG_INT64
+# ifdef WIN32
+# define LOOG_INT64 signed __int64
+# else /* assume POSIX */
+# define LOOG_INT64 int64_t
+# endif
+#endif
+
+#ifndef LOOG_UINT64
+# ifdef WIN32
+# define LOOG_UINT64 unsigned __int64
+# else /* assume POSIX */
+# define LOOG_UINT64 uint64_t
+# endif
+#endif
+
Property changes on: trunk/oggdsf/src/lib/helper/libilliCore/illicoreconfig.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/libilliCore/libilliCore.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libilliCore/libilliCore.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/libilliCore/libilliCore.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,20 +1,20 @@
-// libilliCore.cpp : Defines the entry point for the DLL application.
-//
-
-#include "stdafx.h"
-
-BOOL APIENTRY DllMain( HANDLE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved
- )
-{
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- case DLL_PROCESS_DETACH:
- break;
- }
- return TRUE;
-}
+// libilliCore.cpp : Defines the entry point for the DLL application.
+//
+
+#include "stdafx.h"
+
+BOOL APIENTRY DllMain( HANDLE hModule,
+ DWORD ul_reason_for_call,
+ LPVOID lpReserved
+ )
+{
+ switch (ul_reason_for_call)
+ {
+ case DLL_PROCESS_ATTACH:
+ case DLL_THREAD_ATTACH:
+ case DLL_THREAD_DETACH:
+ case DLL_PROCESS_DETACH:
+ break;
+ }
+ return TRUE;
+}
Property changes on: trunk/oggdsf/src/lib/helper/libilliCore/libilliCore.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/lib/helper/libilliCore/libilliCore.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/libilliCore/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/helper/libilliCore/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/libilliCore/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// libilliCore.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// libilliCore.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/lib/helper/libilliCore/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/helper/libilliCore/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/helper/libilliCore/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/helper/libilliCore/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,21 +1,21 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-// Windows Header Files:
-
-
-// TODO: reference additional headers your program requires here
-#ifdef WIN32
-#include <windows.h>
-# define LOOG_INT64 signed __int64
-# define LOOG_UINT64 unsigned __int64
-#else
-# define LOOG_INT64 int64_t
-# define LOOG_UINT64 uint64_t
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+// Windows Header Files:
+
+
+// TODO: reference additional headers your program requires here
+#ifdef WIN32
+#include <windows.h>
+# define LOOG_INT64 signed __int64
+# define LOOG_UINT64 unsigned __int64
+#else
+# define LOOG_INT64 int64_t
+# define LOOG_UINT64 uint64_t
#endif
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/helper/libilliCore/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/player/libDSPlayDotNET/AssemblyInfo.cpp
===================================================================
--- trunk/oggdsf/src/lib/player/libDSPlayDotNET/AssemblyInfo.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/player/libDSPlayDotNET/AssemblyInfo.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,91 +1,91 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
-// Orgainisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "stdafx.h"
-
-using namespace System::Reflection;
-using namespace System::Runtime::CompilerServices;
-
-//
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-//
-[assembly:AssemblyTitleAttribute("")];
-[assembly:AssemblyDescriptionAttribute("")];
-[assembly:AssemblyConfigurationAttribute("")];
-[assembly:AssemblyCompanyAttribute("")];
-[assembly:AssemblyProductAttribute("")];
-[assembly:AssemblyCopyrightAttribute("")];
-[assembly:AssemblyTrademarkAttribute("")];
-[assembly:AssemblyCultureAttribute("")];
-
-//
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the value or you can default the Revision and Build Numbers
-// by using the '*' as shown below:
-
-[assembly:AssemblyVersionAttribute("1.0.*")];
-
-//
-// In order to sign your assembly you must specify a key to use. Refer to the
-// Microsoft .NET Framework documentation for more information on assembly signing.
-//
-// Use the attributes below to control which key is used for signing.
-//
-// Notes:
-// (*) If no key is specified, the assembly is not signed.
-// (*) KeyName refers to a key that has been installed in the Crypto Service
-// Provider (CSP) on your machine. KeyFile refers to a file which contains
-// a key.
-// (*) If the KeyFile and the KeyName values are both specified, the
-// following processing occurs:
-// (1) If the KeyName can be found in the CSP, that key is used.
-// (2) If the KeyName does not exist and the KeyFile does exist, the key
-// in the KeyFile is installed into the CSP and used.
-// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
-// When specifying the KeyFile, the location of the KeyFile should be
-// relative to the project directory.
-// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
-// documentation for more information on this.
-//
-[assembly:AssemblyDelaySignAttribute(false)];
-[assembly:AssemblyKeyFileAttribute("")];
-[assembly:AssemblyKeyNameAttribute("")];
-
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
+// Orgainisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "stdafx.h"
+
+using namespace System::Reflection;
+using namespace System::Runtime::CompilerServices;
+
+//
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+//
+[assembly:AssemblyTitleAttribute("")];
+[assembly:AssemblyDescriptionAttribute("")];
+[assembly:AssemblyConfigurationAttribute("")];
+[assembly:AssemblyCompanyAttribute("")];
+[assembly:AssemblyProductAttribute("")];
+[assembly:AssemblyCopyrightAttribute("")];
+[assembly:AssemblyTrademarkAttribute("")];
+[assembly:AssemblyCultureAttribute("")];
+
+//
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the value or you can default the Revision and Build Numbers
+// by using the '*' as shown below:
+
+[assembly:AssemblyVersionAttribute("1.0.*")];
+
+//
+// In order to sign your assembly you must specify a key to use. Refer to the
+// Microsoft .NET Framework documentation for more information on assembly signing.
+//
+// Use the attributes below to control which key is used for signing.
+//
+// Notes:
+// (*) If no key is specified, the assembly is not signed.
+// (*) KeyName refers to a key that has been installed in the Crypto Service
+// Provider (CSP) on your machine. KeyFile refers to a file which contains
+// a key.
+// (*) If the KeyFile and the KeyName values are both specified, the
+// following processing occurs:
+// (1) If the KeyName can be found in the CSP, that key is used.
+// (2) If the KeyName does not exist and the KeyFile does exist, the key
+// in the KeyFile is installed into the CSP and used.
+// (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
+// When specifying the KeyFile, the location of the KeyFile should be
+// relative to the project directory.
+// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
+// documentation for more information on this.
+//
+[assembly:AssemblyDelaySignAttribute(false)];
+[assembly:AssemblyKeyFileAttribute("")];
+[assembly:AssemblyKeyNameAttribute("")];
+
Property changes on: trunk/oggdsf/src/lib/player/libDSPlayDotNET/AssemblyInfo.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/player/libDSPlayDotNET/CMMLCallbackProxy.cpp
===================================================================
--- trunk/oggdsf/src/lib/player/libDSPlayDotNET/CMMLCallbackProxy.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/player/libDSPlayDotNET/CMMLCallbackProxy.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,69 +1,69 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
-// Orgainisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include ".\cmmlcallbackproxy.h"
-#using <mscorlib.dll>
-
-CMMLCallbackProxy::CMMLCallbackProxy(void)
- : mDNCMMLCallbacks(NULL)
-{
-}
-
-CMMLCallbackProxy::~CMMLCallbackProxy(void)
-{
-}
-
-bool CMMLCallbackProxy::setManagedDelegate(gcroot<IDNCMMLCallbacks*> inManagedCallbacks) {
- mDNCMMLCallbacks = inManagedCallbacks;
-
-}
-bool CMMLCallbackProxy::clipCallback(C_ClipTag* inClipTag) {
- if (mDNCMMLCallbacks != NULL) {
- gcroot<ClipTag*> locClip = new ClipTag(inClipTag->clone(), true);
-
- return mDNCMMLCallbacks->clipCallback(locClip);
- } else {
- return false;
- }
-}
-bool CMMLCallbackProxy::headCallback(C_HeadTag* inHeadTag) {
- if (mDNCMMLCallbacks != NULL) {
- gcroot<HeadTag*> locHead = new HeadTag(inHeadTag->clone(), true);
-
- return mDNCMMLCallbacks->headCallback(locHead);
- } else {
- return false;
- }
-
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
+// Orgainisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include ".\cmmlcallbackproxy.h"
+#using <mscorlib.dll>
+
+CMMLCallbackProxy::CMMLCallbackProxy(void)
+ : mDNCMMLCallbacks(NULL)
+{
+}
+
+CMMLCallbackProxy::~CMMLCallbackProxy(void)
+{
+}
+
+bool CMMLCallbackProxy::setManagedDelegate(gcroot<IDNCMMLCallbacks*> inManagedCallbacks) {
+ mDNCMMLCallbacks = inManagedCallbacks;
+
+}
+bool CMMLCallbackProxy::clipCallback(C_ClipTag* inClipTag) {
+ if (mDNCMMLCallbacks != NULL) {
+ gcroot<ClipTag*> locClip = new ClipTag(inClipTag->clone(), true);
+
+ return mDNCMMLCallbacks->clipCallback(locClip);
+ } else {
+ return false;
+ }
+}
+bool CMMLCallbackProxy::headCallback(C_HeadTag* inHeadTag) {
+ if (mDNCMMLCallbacks != NULL) {
+ gcroot<HeadTag*> locHead = new HeadTag(inHeadTag->clone(), true);
+
+ return mDNCMMLCallbacks->headCallback(locHead);
+ } else {
+ return false;
+ }
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/player/libDSPlayDotNET/CMMLCallbackProxy.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/player/libDSPlayDotNET/CMMLCallbackProxy.h
===================================================================
--- trunk/oggdsf/src/lib/player/libDSPlayDotNET/CMMLCallbackProxy.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/player/libDSPlayDotNET/CMMLCallbackProxy.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,56 +1,56 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
-// Orgainisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#include "ICMMLCallbacks.h"
-#include "libCMMLTags.h"
-#include "IDNCMMLCallbacks.h"
-#include <vcclr.h>
-
-using namespace illiminable::libDSPlayDotNET;
-class CMMLCallbackProxy
- : public ICMMLCallbacks
-{
-public:
- CMMLCallbackProxy(void);
- ~CMMLCallbackProxy(void);
-
- virtual bool clipCallback(C_ClipTag* inClipTag);
- virtual bool headCallback(C_HeadTag* inHeadTag);
-
- bool setManagedDelegate(gcroot<IDNCMMLCallbacks*> inManagedCallbacks);
-
-protected:
- gcroot<IDNCMMLCallbacks*> mDNCMMLCallbacks;
-};
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
+// Orgainisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#include "ICMMLCallbacks.h"
+#include "libCMMLTags.h"
+#include "IDNCMMLCallbacks.h"
+#include <vcclr.h>
+
+using namespace illiminable::libDSPlayDotNET;
+class CMMLCallbackProxy
+ : public ICMMLCallbacks
+{
+public:
+ CMMLCallbackProxy(void);
+ ~CMMLCallbackProxy(void);
+
+ virtual bool clipCallback(C_ClipTag* inClipTag);
+ virtual bool headCallback(C_HeadTag* inHeadTag);
+
+ bool setManagedDelegate(gcroot<IDNCMMLCallbacks*> inManagedCallbacks);
+
+protected:
+ gcroot<IDNCMMLCallbacks*> mDNCMMLCallbacks;
+};
Property changes on: trunk/oggdsf/src/lib/player/libDSPlayDotNET/CMMLCallbackProxy.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.cpp
===================================================================
--- trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,439 +1,439 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
-// Orgainisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-#include "StdAfx.h"
-#include "dsplay.h"
-
-#pragma managed
-namespace illiminable {
-namespace libDSPlayDotNET {
- //class __gc DSPlayer {
- // public:
- // bool loadFile(String inFileName);
- // bool play();
- // bool pause();
- // bool stop();
- // bool seek(Int64 inTime);
- // Int64 queryPosition();
- //};
-
-
-
-DSPlay::DSPlay(void)
- : mGraphBuilder(NULL)
- , mMediaControl(NULL)
- , mMediaSeeking(NULL)
- , mMediaEvent(NULL)
- , mEventHandle(INVALID_HANDLE_VALUE)
- //, mDNCMMLCallbacks(NULL)
- , mDNMediaEvent(NULL)
- , mCMMLAppControl(NULL)
- , mWindowHandle(NULL)
- , mVideoWindow(NULL)
- , mLeft(0)
- , mTop(0)
- , mWidth(0)
- , mHeight(0)
-
-{
- CoInitialize(NULL);
- mCMMLProxy = new CMMLCallbackProxy; //Need to delete this !
- debugLog = new fstream;
- debugLog->open("G:\\logs\\dsplay.log", ios_base::out);
-}
-
-DSPlay::DSPlay(IntPtr inWindowHandle, Int32 inLeft, Int32 inTop, Int32 inWidth, Int32 inHeight)
- : mGraphBuilder(NULL)
- , mMediaControl(NULL)
- , mMediaSeeking(NULL)
- , mMediaEvent(NULL)
- , mEventHandle(INVALID_HANDLE_VALUE)
- //, mDNCMMLCallbacks(NULL)
- , mDNMediaEvent(NULL)
- , mCMMLAppControl(NULL)
- , mWindowHandle(inWindowHandle)
- , mVideoWindow(NULL)
- , mLeft(inLeft)
- , mTop(inTop)
- , mWidth(inWidth)
- , mHeight(inHeight)
-{
- CoInitialize(NULL);
- mCMMLProxy = new CMMLCallbackProxy; //Need to delete this !
- debugLog = new fstream;
- debugLog->open("G:\\logs\\dsplay.log", ios_base::out);
-}
-
-bool DSPlay::checkEvents() {
- const DWORD TIMEOUT_WAIT = 0; //Wait this many ms for handle
- long locEventCode = 0;
- long locParam1 = 0;
- long locParam2 = 0;
- HRESULT locHR = S_OK;
-
- if (WAIT_OBJECT_0 == WaitForSingleObject(mEventHandle, TIMEOUT_WAIT)) {
- while (locHR = mMediaEvent->GetEvent(&locEventCode, &locParam1, &locParam2, 0), SUCCEEDED(locHR))
- {
-
- //cout<<"Event : "<<evCode<<" Params : "<<param1<<", "<<param2<<endl;
-
- //This is dodgy ! param1 and 2 are actually pointers !!
- if (mDNMediaEvent != NULL) {
- mDNMediaEvent->eventNotification(locEventCode, locParam1, locParam2);
- }
-
- mMediaEvent->FreeEventParams(locEventCode, locParam1, locParam2);
- }
- }
- return true;
-}
-
-
-DSPlay::~DSPlay(void) {
- *debugLog<<"Killing DSPlay"<<endl;
- debugLog->close();
- delete debugLog;
- releaseInterfaces();
- CoUninitialize();
-}
-
-void DSPlay::releaseInterfaces() {
- *debugLog<<"Releasing interfaces"<<endl;
- ULONG numRef = 0;
- if (mMediaControl != NULL) {
- numRef =
- mMediaControl->Release();
- *debugLog<<"Media Control count = "<<numRef<<endl;
- mMediaControl = NULL;
- }
-
- if (mMediaSeeking != NULL) {
- numRef =
- mMediaSeeking->Release();
-
- *debugLog<<"Media Seeking count = "<<numRef<<endl;
- mMediaSeeking = NULL;
- }
-
- if (mMediaEvent != NULL) {
- numRef =
- mMediaEvent->Release();
-
- *debugLog<<"Media Event count = "<<numRef<<endl;
- mMediaEvent = NULL;
- }
-
- if (mCMMLAppControl != NULL) {
- numRef =
- mCMMLAppControl->Release();
-
- *debugLog<<"CMML App control count = "<<numRef<<endl;
- mCMMLAppControl = NULL;
- }
-
- *debugLog<<"Before Graph release..."<<endl;
- if (mGraphBuilder != NULL) {
- numRef =
- mGraphBuilder->Release();
-
- *debugLog<<"Graph Builder count = "<<numRef<<endl;
- mGraphBuilder = NULL;
- }
-
- if (mVideoWindow != NULL) {
- numRef =
- mVideoWindow->Release();
-
- *debugLog<<"Video Window count = "<<numRef<<endl;
- mVideoWindow = NULL;
- }
-
-
- *debugLog<<"After graph release>.."<<endl;
- //TODO::: Release everything !
-}
-
-bool DSPlay::loadFile(String* inFileName) {
-
- //Debugging only
- ULONG numRef = 0;
- //
-
-
- releaseInterfaces();
- HRESULT locHR = S_OK;
-
- char* locFileName = Wrappers::netStrToCStr(inFileName);
- *debugLog<<"File = "<<locFileName<<endl;
- wstring locWFileName = illiminable::libDSPlayDotNET::toWStr(locFileName);
-
- Wrappers::releaseCStr(locFileName);
- locFileName = NULL;
-
- //Have to use a local pointer or taking the adress of a member function makes the second level
- // of indirection a __gc pointer.
- IGraphBuilder* locGraphBuilder = NULL;
- locHR = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&locGraphBuilder);
- mGraphBuilder = locGraphBuilder;
-
- if (locHR != S_OK) {
- mIsLoaded = false;
- return false;
- }
-
-
- //If it's an annodex file, then put the VMR 9 in the graph.
- if (isFileAnnodex(inFileName)) {
- *debugLog<<"Is annodex"<<endl;
- IBaseFilter* locVMR9 = NULL;
-
- HRESULT locHR2 = S_OK;
- locHR2 = mGraphBuilder->FindFilterByName(L"Video Mixing Renderer 9", &locVMR9);
- if (locVMR9 == NULL) {
- *debugLog<<"Not in graph... making it !"<<endl;
- locHR2= CoCreateInstance(CLSID_VideoMixingRenderer9, NULL, CLSCTX_INPROC, IID_IBaseFilter, (void **)&locVMR9);
- if (locHR2 == S_OK) {
- locHR2 = mGraphBuilder->AddFilter(locVMR9, L"Video Mixing Renderer 9");
- numRef =
- locVMR9->Release();
- *debugLog<<"VMR9 ref count = "<<numRef<<endl;
-
- }
- } else {
- numRef =
- locVMR9->Release();
-
- *debugLog<<"VMR9 ref count = "<<numRef<<endl;
- }
-
-
-
-
- }
-
- *debugLog<<"About to call render on "<<endl;
- //Build the graph
- locHR = mGraphBuilder->RenderFile(locWFileName.c_str(), NULL);
-
- if (locHR != S_OK) {
- *debugLog<<"Render File FAILED !!"<<endl;
- mIsLoaded = false;
- return false;
- }
-
- *debugLog<<"Render must have been ok"<<endl;
- if (isFileAnnodex(inFileName)) {
- *debugLog<<"Is annodex"<<endl;
- //Get the app control interface for CMML.
- IBaseFilter* locCMMLFilter = NULL;
- locHR = mGraphBuilder->FindFilterByName(L"CMML Decode Filter", &locCMMLFilter);
-
-
- if (locCMMLFilter != NULL) {
- ICMMLAppControl* locCMMLAppControl = NULL;
-
- locHR = locCMMLFilter->QueryInterface(X_IID_ICMMLAppControl, (void**)&locCMMLAppControl);
- if (locCMMLAppControl != NULL) {
- mCMMLAppControl = locCMMLAppControl;
- mCMMLAppControl->setCallbacks(mCMMLProxy);
- }
- numRef =
- locCMMLFilter->Release();
-
- *debugLog<<"CMML Filter ref Count = "<<numRef<<endl;
- }
-
- }
- *debugLog<<"After CMML Code..."<<endl;
-
- //Get the media control interface
- IMediaControl* locMediaControl = NULL;
- locHR = mGraphBuilder->QueryInterface(IID_IMediaControl, (void**)&locMediaControl);
- mMediaControl = locMediaControl;
-
- if (locHR != S_OK) {
- mIsLoaded = false;
- return false;
- } else {
- mIsLoaded = true;
- }
-
- //get the media seeking interface if its available.
- IMediaSeeking* locMediaSeeking = NULL;
- locHR = mGraphBuilder->QueryInterface(IID_IMediaSeeking, (void**)&locMediaSeeking);
- mMediaSeeking = locMediaSeeking;
-
- //Get the media event interface
- IMediaEvent* locMediaEvent = NULL;
- locHR = locGraphBuilder->QueryInterface(IID_IMediaEvent, (void**)&locMediaEvent);
-
- if (locHR == S_OK) {
- mMediaEvent = locMediaEvent;
- HANDLE locEventHandle = INVALID_HANDLE_VALUE;
- locHR = locMediaEvent->GetEventHandle((OAEVENT*)&locEventHandle);
- mEventHandle = locEventHandle;
- }
-
- if (mWindowHandle != NULL) {
- //Get the IVideoWindow interface.
- IVideoWindow* locVideoWindow = NULL;
- locHR = mGraphBuilder->QueryInterface(IID_IVideoWindow, (void**)&locVideoWindow);
-
- if (locHR == S_OK) {
- mVideoWindow = locVideoWindow;
- mVideoWindow->put_Owner((int)mWindowHandle);
- mVideoWindow->SetWindowPosition(mLeft, mTop, mWidth, mHeight);
- mVideoWindow->put_WindowStyle(WS_CHILD | WS_CLIPCHILDREN);
- }
- }
-
-
-// if (FAILED(hr))
-
- return true;
-
-
-}
-
-bool DSPlay::setCMMLCallbacks(IDNCMMLCallbacks* inCMMLCallbacks) {
- return mCMMLProxy->setManagedDelegate(inCMMLCallbacks);
-}
-
-bool DSPlay::isLoaded() {
- return mIsLoaded;
-}
-bool DSPlay::play() {
- if (mIsLoaded) {
- HRESULT locHR = mMediaControl->Run();
- if (SUCCEEDED(locHR)) {
- return false;
- } else {
- return true;
- }
- } else {
- return false;
- }
-}
-
-bool DSPlay::pause() {
- if (mIsLoaded) {
- HRESULT locHR = mMediaControl->Pause();
- if (locHR != S_OK) {
- return false;
- } else {
- return true;
- }
- } else {
- return false;
- }
-}
-
-bool DSPlay::stop() {
- if (mIsLoaded) {
- HRESULT locHR = mMediaControl->Stop();
- if (locHR != S_OK) {
- return false;
- } else {
- seek(0);
- return true;
- }
- } else {
- return false;
- }
-}
-
-Int64 DSPlay::seek(Int64 inTime) {
- if (mIsLoaded && (mMediaSeeking != NULL)) {
- LONGLONG locCurrent = inTime;
- LONGLONG locStop = 0;
- HRESULT locHR = mMediaSeeking->SetPositions(&locCurrent, AM_SEEKING_AbsolutePositioning | AM_SEEKING_ReturnTime,
- &locStop, AM_SEEKING_NoPositioning);
-
- if (SUCCEEDED(locHR)) {
- return locCurrent;
- } else {
- return -1;
- }
- } else {
- return -1;
- }
-
-}
-
-Int64 DSPlay::seekStart() {
- return 0;
-}
-
-Int64 DSPlay::queryPosition() {
- return 0;
-}
-
-Int64 DSPlay::fileSize() {
- return -1;
-}
-Int64 DSPlay::fileDuration() {
- if (mIsLoaded && (mMediaSeeking != NULL)) {
- LONGLONG locDuration = 0;
- HRESULT locHR = mMediaSeeking->GetDuration(&locDuration);
-
- if (locHR != S_OK) {
- return -1;
- } else {
- return locDuration;
- }
- } else {
- return -1;
- }
-}
-
-bool DSPlay::isFileAnnodex(String* inFilename)
-{
- String* locExt = (inFilename->Substring(inFilename->Length - 4, 4))->ToUpper();
- if (locExt->Equals(".ANX")) {
- return true;
- } else {
- return false;
- }
-}
-
-bool DSPlay::setMediaEventCallback(IDNMediaEvent* inMediaEventCallback) {
- mDNMediaEvent = inMediaEventCallback;
- return true;
-}
-IDNMediaEvent* DSPlay::getMediaEventCallback() {
- return mDNMediaEvent;
-}
-
-
-} //end namespace libDSPlayDotNET
-} //end namespace illiminable
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
+// Orgainisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+#include "StdAfx.h"
+#include "dsplay.h"
+
+#pragma managed
+namespace illiminable {
+namespace libDSPlayDotNET {
+ //class __gc DSPlayer {
+ // public:
+ // bool loadFile(String inFileName);
+ // bool play();
+ // bool pause();
+ // bool stop();
+ // bool seek(Int64 inTime);
+ // Int64 queryPosition();
+ //};
+
+
+
+DSPlay::DSPlay(void)
+ : mGraphBuilder(NULL)
+ , mMediaControl(NULL)
+ , mMediaSeeking(NULL)
+ , mMediaEvent(NULL)
+ , mEventHandle(INVALID_HANDLE_VALUE)
+ //, mDNCMMLCallbacks(NULL)
+ , mDNMediaEvent(NULL)
+ , mCMMLAppControl(NULL)
+ , mWindowHandle(NULL)
+ , mVideoWindow(NULL)
+ , mLeft(0)
+ , mTop(0)
+ , mWidth(0)
+ , mHeight(0)
+
+{
+ CoInitialize(NULL);
+ mCMMLProxy = new CMMLCallbackProxy; //Need to delete this !
+ debugLog = new fstream;
+ debugLog->open("G:\\logs\\dsplay.log", ios_base::out);
+}
+
+DSPlay::DSPlay(IntPtr inWindowHandle, Int32 inLeft, Int32 inTop, Int32 inWidth, Int32 inHeight)
+ : mGraphBuilder(NULL)
+ , mMediaControl(NULL)
+ , mMediaSeeking(NULL)
+ , mMediaEvent(NULL)
+ , mEventHandle(INVALID_HANDLE_VALUE)
+ //, mDNCMMLCallbacks(NULL)
+ , mDNMediaEvent(NULL)
+ , mCMMLAppControl(NULL)
+ , mWindowHandle(inWindowHandle)
+ , mVideoWindow(NULL)
+ , mLeft(inLeft)
+ , mTop(inTop)
+ , mWidth(inWidth)
+ , mHeight(inHeight)
+{
+ CoInitialize(NULL);
+ mCMMLProxy = new CMMLCallbackProxy; //Need to delete this !
+ debugLog = new fstream;
+ debugLog->open("G:\\logs\\dsplay.log", ios_base::out);
+}
+
+bool DSPlay::checkEvents() {
+ const DWORD TIMEOUT_WAIT = 0; //Wait this many ms for handle
+ long locEventCode = 0;
+ long locParam1 = 0;
+ long locParam2 = 0;
+ HRESULT locHR = S_OK;
+
+ if (WAIT_OBJECT_0 == WaitForSingleObject(mEventHandle, TIMEOUT_WAIT)) {
+ while (locHR = mMediaEvent->GetEvent(&locEventCode, &locParam1, &locParam2, 0), SUCCEEDED(locHR))
+ {
+
+ //cout<<"Event : "<<evCode<<" Params : "<<param1<<", "<<param2<<endl;
+
+ //This is dodgy ! param1 and 2 are actually pointers !!
+ if (mDNMediaEvent != NULL) {
+ mDNMediaEvent->eventNotification(locEventCode, locParam1, locParam2);
+ }
+
+ mMediaEvent->FreeEventParams(locEventCode, locParam1, locParam2);
+ }
+ }
+ return true;
+}
+
+
+DSPlay::~DSPlay(void) {
+ *debugLog<<"Killing DSPlay"<<endl;
+ debugLog->close();
+ delete debugLog;
+ releaseInterfaces();
+ CoUninitialize();
+}
+
+void DSPlay::releaseInterfaces() {
+ *debugLog<<"Releasing interfaces"<<endl;
+ ULONG numRef = 0;
+ if (mMediaControl != NULL) {
+ numRef =
+ mMediaControl->Release();
+ *debugLog<<"Media Control count = "<<numRef<<endl;
+ mMediaControl = NULL;
+ }
+
+ if (mMediaSeeking != NULL) {
+ numRef =
+ mMediaSeeking->Release();
+
+ *debugLog<<"Media Seeking count = "<<numRef<<endl;
+ mMediaSeeking = NULL;
+ }
+
+ if (mMediaEvent != NULL) {
+ numRef =
+ mMediaEvent->Release();
+
+ *debugLog<<"Media Event count = "<<numRef<<endl;
+ mMediaEvent = NULL;
+ }
+
+ if (mCMMLAppControl != NULL) {
+ numRef =
+ mCMMLAppControl->Release();
+
+ *debugLog<<"CMML App control count = "<<numRef<<endl;
+ mCMMLAppControl = NULL;
+ }
+
+ *debugLog<<"Before Graph release..."<<endl;
+ if (mGraphBuilder != NULL) {
+ numRef =
+ mGraphBuilder->Release();
+
+ *debugLog<<"Graph Builder count = "<<numRef<<endl;
+ mGraphBuilder = NULL;
+ }
+
+ if (mVideoWindow != NULL) {
+ numRef =
+ mVideoWindow->Release();
+
+ *debugLog<<"Video Window count = "<<numRef<<endl;
+ mVideoWindow = NULL;
+ }
+
+
+ *debugLog<<"After graph release>.."<<endl;
+ //TODO::: Release everything !
+}
+
+bool DSPlay::loadFile(String* inFileName) {
+
+ //Debugging only
+ ULONG numRef = 0;
+ //
+
+
+ releaseInterfaces();
+ HRESULT locHR = S_OK;
+
+ char* locFileName = Wrappers::netStrToCStr(inFileName);
+ *debugLog<<"File = "<<locFileName<<endl;
+ wstring locWFileName = illiminable::libDSPlayDotNET::toWStr(locFileName);
+
+ Wrappers::releaseCStr(locFileName);
+ locFileName = NULL;
+
+ //Have to use a local pointer or taking the adress of a member function makes the second level
+ // of indirection a __gc pointer.
+ IGraphBuilder* locGraphBuilder = NULL;
+ locHR = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&locGraphBuilder);
+ mGraphBuilder = locGraphBuilder;
+
+ if (locHR != S_OK) {
+ mIsLoaded = false;
+ return false;
+ }
+
+
+ //If it's an annodex file, then put the VMR 9 in the graph.
+ if (isFileAnnodex(inFileName)) {
+ *debugLog<<"Is annodex"<<endl;
+ IBaseFilter* locVMR9 = NULL;
+
+ HRESULT locHR2 = S_OK;
+ locHR2 = mGraphBuilder->FindFilterByName(L"Video Mixing Renderer 9", &locVMR9);
+ if (locVMR9 == NULL) {
+ *debugLog<<"Not in graph... making it !"<<endl;
+ locHR2= CoCreateInstance(CLSID_VideoMixingRenderer9, NULL, CLSCTX_INPROC, IID_IBaseFilter, (void **)&locVMR9);
+ if (locHR2 == S_OK) {
+ locHR2 = mGraphBuilder->AddFilter(locVMR9, L"Video Mixing Renderer 9");
+ numRef =
+ locVMR9->Release();
+ *debugLog<<"VMR9 ref count = "<<numRef<<endl;
+
+ }
+ } else {
+ numRef =
+ locVMR9->Release();
+
+ *debugLog<<"VMR9 ref count = "<<numRef<<endl;
+ }
+
+
+
+
+ }
+
+ *debugLog<<"About to call render on "<<endl;
+ //Build the graph
+ locHR = mGraphBuilder->RenderFile(locWFileName.c_str(), NULL);
+
+ if (locHR != S_OK) {
+ *debugLog<<"Render File FAILED !!"<<endl;
+ mIsLoaded = false;
+ return false;
+ }
+
+ *debugLog<<"Render must have been ok"<<endl;
+ if (isFileAnnodex(inFileName)) {
+ *debugLog<<"Is annodex"<<endl;
+ //Get the app control interface for CMML.
+ IBaseFilter* locCMMLFilter = NULL;
+ locHR = mGraphBuilder->FindFilterByName(L"CMML Decode Filter", &locCMMLFilter);
+
+
+ if (locCMMLFilter != NULL) {
+ ICMMLAppControl* locCMMLAppControl = NULL;
+
+ locHR = locCMMLFilter->QueryInterface(X_IID_ICMMLAppControl, (void**)&locCMMLAppControl);
+ if (locCMMLAppControl != NULL) {
+ mCMMLAppControl = locCMMLAppControl;
+ mCMMLAppControl->setCallbacks(mCMMLProxy);
+ }
+ numRef =
+ locCMMLFilter->Release();
+
+ *debugLog<<"CMML Filter ref Count = "<<numRef<<endl;
+ }
+
+ }
+ *debugLog<<"After CMML Code..."<<endl;
+
+ //Get the media control interface
+ IMediaControl* locMediaControl = NULL;
+ locHR = mGraphBuilder->QueryInterface(IID_IMediaControl, (void**)&locMediaControl);
+ mMediaControl = locMediaControl;
+
+ if (locHR != S_OK) {
+ mIsLoaded = false;
+ return false;
+ } else {
+ mIsLoaded = true;
+ }
+
+ //get the media seeking interface if its available.
+ IMediaSeeking* locMediaSeeking = NULL;
+ locHR = mGraphBuilder->QueryInterface(IID_IMediaSeeking, (void**)&locMediaSeeking);
+ mMediaSeeking = locMediaSeeking;
+
+ //Get the media event interface
+ IMediaEvent* locMediaEvent = NULL;
+ locHR = locGraphBuilder->QueryInterface(IID_IMediaEvent, (void**)&locMediaEvent);
+
+ if (locHR == S_OK) {
+ mMediaEvent = locMediaEvent;
+ HANDLE locEventHandle = INVALID_HANDLE_VALUE;
+ locHR = locMediaEvent->GetEventHandle((OAEVENT*)&locEventHandle);
+ mEventHandle = locEventHandle;
+ }
+
+ if (mWindowHandle != NULL) {
+ //Get the IVideoWindow interface.
+ IVideoWindow* locVideoWindow = NULL;
+ locHR = mGraphBuilder->QueryInterface(IID_IVideoWindow, (void**)&locVideoWindow);
+
+ if (locHR == S_OK) {
+ mVideoWindow = locVideoWindow;
+ mVideoWindow->put_Owner((int)mWindowHandle);
+ mVideoWindow->SetWindowPosition(mLeft, mTop, mWidth, mHeight);
+ mVideoWindow->put_WindowStyle(WS_CHILD | WS_CLIPCHILDREN);
+ }
+ }
+
+
+// if (FAILED(hr))
+
+ return true;
+
+
+}
+
+bool DSPlay::setCMMLCallbacks(IDNCMMLCallbacks* inCMMLCallbacks) {
+ return mCMMLProxy->setManagedDelegate(inCMMLCallbacks);
+}
+
+bool DSPlay::isLoaded() {
+ return mIsLoaded;
+}
+bool DSPlay::play() {
+ if (mIsLoaded) {
+ HRESULT locHR = mMediaControl->Run();
+ if (SUCCEEDED(locHR)) {
+ return false;
+ } else {
+ return true;
+ }
+ } else {
+ return false;
+ }
+}
+
+bool DSPlay::pause() {
+ if (mIsLoaded) {
+ HRESULT locHR = mMediaControl->Pause();
+ if (locHR != S_OK) {
+ return false;
+ } else {
+ return true;
+ }
+ } else {
+ return false;
+ }
+}
+
+bool DSPlay::stop() {
+ if (mIsLoaded) {
+ HRESULT locHR = mMediaControl->Stop();
+ if (locHR != S_OK) {
+ return false;
+ } else {
+ seek(0);
+ return true;
+ }
+ } else {
+ return false;
+ }
+}
+
+Int64 DSPlay::seek(Int64 inTime) {
+ if (mIsLoaded && (mMediaSeeking != NULL)) {
+ LONGLONG locCurrent = inTime;
+ LONGLONG locStop = 0;
+ HRESULT locHR = mMediaSeeking->SetPositions(&locCurrent, AM_SEEKING_AbsolutePositioning | AM_SEEKING_ReturnTime,
+ &locStop, AM_SEEKING_NoPositioning);
+
+ if (SUCCEEDED(locHR)) {
+ return locCurrent;
+ } else {
+ return -1;
+ }
+ } else {
+ return -1;
+ }
+
+}
+
+Int64 DSPlay::seekStart() {
+ return 0;
+}
+
+Int64 DSPlay::queryPosition() {
+ return 0;
+}
+
+Int64 DSPlay::fileSize() {
+ return -1;
+}
+Int64 DSPlay::fileDuration() {
+ if (mIsLoaded && (mMediaSeeking != NULL)) {
+ LONGLONG locDuration = 0;
+ HRESULT locHR = mMediaSeeking->GetDuration(&locDuration);
+
+ if (locHR != S_OK) {
+ return -1;
+ } else {
+ return locDuration;
+ }
+ } else {
+ return -1;
+ }
+}
+
+bool DSPlay::isFileAnnodex(String* inFilename)
+{
+ String* locExt = (inFilename->Substring(inFilename->Length - 4, 4))->ToUpper();
+ if (locExt->Equals(".ANX")) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+bool DSPlay::setMediaEventCallback(IDNMediaEvent* inMediaEventCallback) {
+ mDNMediaEvent = inMediaEventCallback;
+ return true;
+}
+IDNMediaEvent* DSPlay::getMediaEventCallback() {
+ return mDNMediaEvent;
+}
+
+
+} //end namespace libDSPlayDotNET
+} //end namespace illiminable
Property changes on: trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.h
===================================================================
--- trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,124 +1,124 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
-// Orgainisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#pragma unmanaged
-//#include "CMMLDecoderIIDs.h"
-#include <uuids.h>
-#include <dshow.h>
-
-#include <d3d9.h>
-#include <vmr9.h>
-#include <string>
-
-#include "ICMMLCallbacks.h"
-#include "ICMMLAppControl.h"
-#include "libCMMLTags.h"
-#include "CMMLCallbackProxy.h"
-
-
-#include <fstream>
-
-#pragma managed
-#using "libCMMLTagsDotNET.dll"
-using namespace illiminable::libCMMLTagsDotNET;
-#include "libDSPlayDotNet.h"
-#include "IDNCMMLCallbacks.h"
-#include "IDNMediaEvent.h"
-//#include "Wrappers.h"
-using namespace illiminable::libiWrapper;
-using namespace std;
-
-namespace illiminable {
-namespace libDSPlayDotNET
-{
-
- public __gc class DSPlay
- {
- public:
- DSPlay(void);
- DSPlay(IntPtr inWindowHandle, Int32 inLeft, Int32 inTop, Int32 inWidth, Int32 inHeight);
- ~DSPlay(void);
-
- bool loadFile(String* inFileName);
- bool play();
- bool pause();
- bool stop();
- Int64 seek(Int64 inTime);
- Int64 seekStart();
- Int64 queryPosition();
-
- bool isLoaded();
- Int64 fileSize();
- Int64 fileDuration();
-
-
- bool setMediaEventCallback(IDNMediaEvent* inMediaEventCallback);
- IDNMediaEvent* getMediaEventCallback();
-
- bool setCMMLCallbacks(IDNCMMLCallbacks* inCMMLCallbacks);
- bool checkEvents();
-
- void releaseInterfaces();
- protected:
- //static wstring toWStr(std::string inString);
- IGraphBuilder* mGraphBuilder;
- IMediaControl* mMediaControl;
- IMediaSeeking* mMediaSeeking;
- IMediaEvent* mMediaEvent;
- ICMMLAppControl* mCMMLAppControl;
- IVideoWindow* mVideoWindow;
-
- Int32 mLeft;
- Int32 mTop;
- Int32 mWidth;
- Int32 mHeight;
-
- HANDLE mEventHandle;
- IntPtr mWindowHandle;
-
- //IDNCMMLCallbacks* mDNCMMLCallbacks;
- CMMLCallbackProxy* mCMMLProxy;
- IDNMediaEvent* mDNMediaEvent;
-
- bool mIsLoaded;
- bool isFileAnnodex(String* inFilename);
-
-
- fstream* debugLog;
-
-
- };
-}
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
+// Orgainisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#pragma unmanaged
+//#include "CMMLDecoderIIDs.h"
+#include <uuids.h>
+#include <dshow.h>
+
+#include <d3d9.h>
+#include <vmr9.h>
+#include <string>
+
+#include "ICMMLCallbacks.h"
+#include "ICMMLAppControl.h"
+#include "libCMMLTags.h"
+#include "CMMLCallbackProxy.h"
+
+
+#include <fstream>
+
+#pragma managed
+#using "libCMMLTagsDotNET.dll"
+using namespace illiminable::libCMMLTagsDotNET;
+#include "libDSPlayDotNet.h"
+#include "IDNCMMLCallbacks.h"
+#include "IDNMediaEvent.h"
+//#include "Wrappers.h"
+using namespace illiminable::libiWrapper;
+using namespace std;
+
+namespace illiminable {
+namespace libDSPlayDotNET
+{
+
+ public __gc class DSPlay
+ {
+ public:
+ DSPlay(void);
+ DSPlay(IntPtr inWindowHandle, Int32 inLeft, Int32 inTop, Int32 inWidth, Int32 inHeight);
+ ~DSPlay(void);
+
+ bool loadFile(String* inFileName);
+ bool play();
+ bool pause();
+ bool stop();
+ Int64 seek(Int64 inTime);
+ Int64 seekStart();
+ Int64 queryPosition();
+
+ bool isLoaded();
+ Int64 fileSize();
+ Int64 fileDuration();
+
+
+ bool setMediaEventCallback(IDNMediaEvent* inMediaEventCallback);
+ IDNMediaEvent* getMediaEventCallback();
+
+ bool setCMMLCallbacks(IDNCMMLCallbacks* inCMMLCallbacks);
+ bool checkEvents();
+
+ void releaseInterfaces();
+ protected:
+ //static wstring toWStr(std::string inString);
+ IGraphBuilder* mGraphBuilder;
+ IMediaControl* mMediaControl;
+ IMediaSeeking* mMediaSeeking;
+ IMediaEvent* mMediaEvent;
+ ICMMLAppControl* mCMMLAppControl;
+ IVideoWindow* mVideoWindow;
+
+ Int32 mLeft;
+ Int32 mTop;
+ Int32 mWidth;
+ Int32 mHeight;
+
+ HANDLE mEventHandle;
+ IntPtr mWindowHandle;
+
+ //IDNCMMLCallbacks* mDNCMMLCallbacks;
+ CMMLCallbackProxy* mCMMLProxy;
+ IDNMediaEvent* mDNMediaEvent;
+
+ bool mIsLoaded;
+ bool isFileAnnodex(String* inFilename);
+
+
+ fstream* debugLog;
+
+
+ };
+}
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/player/libDSPlayDotNET/DSPlay.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/player/libDSPlayDotNET/IDNCMMLCallbacks.h
===================================================================
--- trunk/oggdsf/src/lib/player/libDSPlayDotNET/IDNCMMLCallbacks.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/player/libDSPlayDotNET/IDNCMMLCallbacks.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,63 +1,63 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
-// Orgainisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#pragma unmanaged
-#include "libCMMLTags.h"
-
-#pragma managed
-#using "libCMMLTagsDotNET.dll"
-using namespace illiminable::libCMMLTagsDotNET;
-
-namespace illiminable {
-namespace libDSPlayDotNET {
-public __gc __interface IDNCMMLCallbacks {
- //class ICMMLCallbacks
- //{
- //public:
- // virtual bool clipCallback(C_ClipTag* inClipTag) = 0;
- // virtual bool headCallback(C_HeadTag* inHeadTag) = 0;
- //};
-public:
- virtual bool clipCallback(ClipTag* inClipTag) = 0;
- virtual bool headCallback(HeadTag* inHeadTag) = 0;
-
-
-
-
-
-};
-
-}
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
+// Orgainisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#pragma unmanaged
+#include "libCMMLTags.h"
+
+#pragma managed
+#using "libCMMLTagsDotNET.dll"
+using namespace illiminable::libCMMLTagsDotNET;
+
+namespace illiminable {
+namespace libDSPlayDotNET {
+public __gc __interface IDNCMMLCallbacks {
+ //class ICMMLCallbacks
+ //{
+ //public:
+ // virtual bool clipCallback(C_ClipTag* inClipTag) = 0;
+ // virtual bool headCallback(C_HeadTag* inHeadTag) = 0;
+ //};
+public:
+ virtual bool clipCallback(ClipTag* inClipTag) = 0;
+ virtual bool headCallback(HeadTag* inHeadTag) = 0;
+
+
+
+
+
+};
+
+}
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/player/libDSPlayDotNET/IDNCMMLCallbacks.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/player/libDSPlayDotNET/IDNMediaEvent.h
===================================================================
--- trunk/oggdsf/src/lib/player/libDSPlayDotNET/IDNMediaEvent.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/player/libDSPlayDotNET/IDNMediaEvent.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,53 +1,53 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
-// Orgainisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#pragma once
-#pragma unmanaged
-
-#pragma managed
-
-
-
-namespace illiminable {
-namespace libDSPlayDotNET {
-
-public __gc __interface IDNMediaEvent {
-
-public:
- virtual bool eventNotification(Int32 inEventCode, Int32 inParam1, Int32 inParam2) = 0;
-
-};
-
-}
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
+// Orgainisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#pragma once
+#pragma unmanaged
+
+#pragma managed
+
+
+
+namespace illiminable {
+namespace libDSPlayDotNET {
+
+public __gc __interface IDNMediaEvent {
+
+public:
+ virtual bool eventNotification(Int32 inEventCode, Int32 inParam1, Int32 inParam2) = 0;
+
+};
+
+}
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/player/libDSPlayDotNET/IDNMediaEvent.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/player/libDSPlayDotNET/Stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/player/libDSPlayDotNET/Stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/player/libDSPlayDotNET/Stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,41 +1,41 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
-// Orgainisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-
-// stdafx.cpp : source file that includes just the standard includes
-// libDSPlayDotNET.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-// {6188AD0C-62CB-4658-A14E-CD23CF84EC31}
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
+// Orgainisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+
+// stdafx.cpp : source file that includes just the standard includes
+// libDSPlayDotNET.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+// {6188AD0C-62CB-4658-A14E-CD23CF84EC31}
Property changes on: trunk/oggdsf/src/lib/player/libDSPlayDotNET/Stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/player/libDSPlayDotNET/Stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/player/libDSPlayDotNET/Stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/player/libDSPlayDotNET/Stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,49 +1,49 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
-// Orgainisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently,
-// but are changed infrequently
-
-#pragma once
-
-#using <mscorlib.dll>
-
-#pragma unmanaged
-#include <dshow.h>
-//#include <windows.h>
-
-//#include <guiddef.h>
-// {6188AD0C-62CB-4658-A14E-CD23CF84EC31}
-#pragma managed
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
+// Orgainisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently,
+// but are changed infrequently
+
+#pragma once
+
+#using <mscorlib.dll>
+
+#pragma unmanaged
+#include <dshow.h>
+//#include <windows.h>
+
+//#include <guiddef.h>
+// {6188AD0C-62CB-4658-A14E-CD23CF84EC31}
+#pragma managed
Property changes on: trunk/oggdsf/src/lib/player/libDSPlayDotNET/Stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/player/libDSPlayDotNET/libDSPlayDotNET.cpp
===================================================================
--- trunk/oggdsf/src/lib/player/libDSPlayDotNET/libDSPlayDotNET.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/player/libDSPlayDotNET/libDSPlayDotNET.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,60 +1,60 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
-// Orgainisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// This is the main DLL file.
-
-#include "stdafx.h"
-
-#include "libDSPlayDotNET.h"
-
-#pragma managed
-namespace illiminable {
-namespace libDSPlayDotNET {
- //static wstring toWStr(std::string inString) {
-
- // //This is frmo the String Helper class.
-
- // wstring retVal;
-
- // //LPCWSTR retPtr = new wchar_t[retVal.length() + 1];
- // for (std::string::const_iterator i = inString.begin(); i != inString.end(); i++) {
- // retVal.append(1, *i);
- // }
- //
-
- // return retVal;
- //}
-
-}
-}
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
+// Orgainisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// This is the main DLL file.
+
+#include "stdafx.h"
+
+#include "libDSPlayDotNET.h"
+
+#pragma managed
+namespace illiminable {
+namespace libDSPlayDotNET {
+ //static wstring toWStr(std::string inString) {
+
+ // //This is frmo the String Helper class.
+
+ // wstring retVal;
+
+ // //LPCWSTR retPtr = new wchar_t[retVal.length() + 1];
+ // for (std::string::const_iterator i = inString.begin(); i != inString.end(); i++) {
+ // retVal.append(1, *i);
+ // }
+ //
+
+ // return retVal;
+ //}
+
+}
+}
Property changes on: trunk/oggdsf/src/lib/player/libDSPlayDotNET/libDSPlayDotNET.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/player/libDSPlayDotNET/libDSPlayDotNET.h
===================================================================
--- trunk/oggdsf/src/lib/player/libDSPlayDotNET/libDSPlayDotNET.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/player/libDSPlayDotNET/libDSPlayDotNET.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,77 +1,77 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
-// Orgainisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// libDSPlayDotNET.h
-
-#pragma once
-#pragma unmanaged
-#include <string>
-
-#pragma managed
-#using "libiWrapper.dll"
-#using "libCMMLTagsDotNET.dll"
-using namespace illiminable::libCMMLTagsDotNET;
-using namespace std;
-using namespace System;
-
-namespace illiminable {
-namespace libDSPlayDotNET {
-// /*class __gc DSPlayer {
-// public:
-// bool loadFile(String inFileName);
-// bool play();
-// bool pause();
-// bool stop();
-// bool seek(Int64 inTime);
-// Int64 queryPosition();
-// }*/
-
- static const GUID X_IID_ICMMLAppControl = {0x6188ad0c, 0x62cb, 0x4658, {0xa1, 0x4e, 0xcd, 0x23, 0xcf, 0x84, 0xec, 0x31}};
- //DEFINE_GUID(IID_ICMMLAppControl, 0x6188ad0c, 0x62cb, 0x4658, 0xa1, 0x4e, 0xcd, 0x23, 0xcf, 0x84, 0xec, 0x31);
- static wstring toWStr(std::string inString) {
-
- //This is frmo the String Helper class.
-
- wstring retVal;
-
- //LPCWSTR retPtr = new wchar_t[retVal.length() + 1];
- for (std::string::const_iterator i = inString.begin(); i != inString.end(); i++) {
- retVal.append(1, *i);
- }
-
-
- return retVal;
- }
-}
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
+// Orgainisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// libDSPlayDotNET.h
+
+#pragma once
+#pragma unmanaged
+#include <string>
+
+#pragma managed
+#using "libiWrapper.dll"
+#using "libCMMLTagsDotNET.dll"
+using namespace illiminable::libCMMLTagsDotNET;
+using namespace std;
+using namespace System;
+
+namespace illiminable {
+namespace libDSPlayDotNET {
+// /*class __gc DSPlayer {
+// public:
+// bool loadFile(String inFileName);
+// bool play();
+// bool pause();
+// bool stop();
+// bool seek(Int64 inTime);
+// Int64 queryPosition();
+// }*/
+
+ static const GUID X_IID_ICMMLAppControl = {0x6188ad0c, 0x62cb, 0x4658, {0xa1, 0x4e, 0xcd, 0x23, 0xcf, 0x84, 0xec, 0x31}};
+ //DEFINE_GUID(IID_ICMMLAppControl, 0x6188ad0c, 0x62cb, 0x4658, 0xa1, 0x4e, 0xcd, 0x23, 0xcf, 0x84, 0xec, 0x31);
+ static wstring toWStr(std::string inString) {
+
+ //This is frmo the String Helper class.
+
+ wstring retVal;
+
+ //LPCWSTR retPtr = new wchar_t[retVal.length() + 1];
+ for (std::string::const_iterator i = inString.begin(); i != inString.end(); i++) {
+ retVal.append(1, *i);
+ }
+
+
+ return retVal;
+ }
+}
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/lib/player/libDSPlayDotNET/libDSPlayDotNET.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/ControlDialog.cpp
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/ControlDialog.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/ControlDialog.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,76 +1,76 @@
-// ControlDialog.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include "axAnxOggPlayer.h"
-#include "ControlDialog.h"
-#include ".\controldialog.h"
-
-
-// CControlDialog dialog
-
-IMPLEMENT_DYNAMIC(CControlDialog, CDialog)
-CControlDialog::CControlDialog(CWnd* pParent /*=NULL*/)
- : CDialog(CControlDialog::IDD, pParent)
- , mBrowser(NULL)
-{
- debugLog.open("G:\\logs\\axanx.log", ios_base::out);
-}
-
-CControlDialog::~CControlDialog()
-{
- debugLog.close();
- if (mBrowser != NULL) {
- mBrowser->Release();
- }
-}
-
-void CControlDialog::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
-}
-
-
-BEGIN_MESSAGE_MAP(CControlDialog, CDialog)
- ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton1)
- ON_BN_CLICKED(IDC_BUTTON2, OnBnClickedButton2)
- ON_BN_CLICKED(IDC_BUTTON3, OnBnClickedButton3)
-END_MESSAGE_MAP()
-
-
-// CControlDialog message handlers
-
-void CControlDialog::OnBnClickedButton1()
-{
- //PLay button.
- debugLog<<"Play button pushed"<<endl;
- mPlayer.loadFile(L"G:\\a.ogg", this->m_hWnd, 10, 100, 384, 240);
- //mPlayer.loadFile("G:\\h.ogv");
- mPlayer.play();
-}
-
-void CControlDialog::setBrowser(IWebBrowser2* inBrowser) {
- debugLog<<"Setting browser instance to "<<(int)inBrowser<<endl;
- mBrowser = inBrowser;
-
- BSTR locURL = NULL;
- mBrowser->get_LocationURL(&locURL);
- wstring locS = locURL;
- SysFreeString(locURL);
- mPlayer.loadFile(locS);
- mPlayer.play();
-
-}
-
-void CControlDialog::OnBnClickedButton2()
-{
- //Pause button
- debugLog<<"Pause button pushed..."<<endl;
- mPlayer.pause();
-}
-
-void CControlDialog::OnBnClickedButton3()
-{
- //Stop button
- debugLog<<"Stop button pushed.."<<endl;
-}
+// ControlDialog.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "axAnxOggPlayer.h"
+#include "ControlDialog.h"
+#include ".\controldialog.h"
+
+
+// CControlDialog dialog
+
+IMPLEMENT_DYNAMIC(CControlDialog, CDialog)
+CControlDialog::CControlDialog(CWnd* pParent /*=NULL*/)
+ : CDialog(CControlDialog::IDD, pParent)
+ , mBrowser(NULL)
+{
+ debugLog.open("G:\\logs\\axanx.log", ios_base::out);
+}
+
+CControlDialog::~CControlDialog()
+{
+ debugLog.close();
+ if (mBrowser != NULL) {
+ mBrowser->Release();
+ }
+}
+
+void CControlDialog::DoDataExchange(CDataExchange* pDX)
+{
+ CDialog::DoDataExchange(pDX);
+}
+
+
+BEGIN_MESSAGE_MAP(CControlDialog, CDialog)
+ ON_BN_CLICKED(IDC_BUTTON1, OnBnClickedButton1)
+ ON_BN_CLICKED(IDC_BUTTON2, OnBnClickedButton2)
+ ON_BN_CLICKED(IDC_BUTTON3, OnBnClickedButton3)
+END_MESSAGE_MAP()
+
+
+// CControlDialog message handlers
+
+void CControlDialog::OnBnClickedButton1()
+{
+ //PLay button.
+ debugLog<<"Play button pushed"<<endl;
+ mPlayer.loadFile(L"G:\\a.ogg", this->m_hWnd, 10, 100, 384, 240);
+ //mPlayer.loadFile("G:\\h.ogv");
+ mPlayer.play();
+}
+
+void CControlDialog::setBrowser(IWebBrowser2* inBrowser) {
+ debugLog<<"Setting browser instance to "<<(int)inBrowser<<endl;
+ mBrowser = inBrowser;
+
+ BSTR locURL = NULL;
+ mBrowser->get_LocationURL(&locURL);
+ wstring locS = locURL;
+ SysFreeString(locURL);
+ mPlayer.loadFile(locS);
+ mPlayer.play();
+
+}
+
+void CControlDialog::OnBnClickedButton2()
+{
+ //Pause button
+ debugLog<<"Pause button pushed..."<<endl;
+ mPlayer.pause();
+}
+
+void CControlDialog::OnBnClickedButton3()
+{
+ //Stop button
+ debugLog<<"Stop button pushed.."<<endl;
+}
Property changes on: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/ControlDialog.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/ControlDialog.h
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/ControlDialog.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/ControlDialog.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,30 +1,30 @@
-#pragma once
-#include "DSPlayer.h"
-#include <fstream>
-using namespace std;
-// CControlDialog dialog
-
-class CControlDialog : public CDialog
-{
- DECLARE_DYNAMIC(CControlDialog)
-
-public:
- CControlDialog(CWnd* pParent = NULL); // standard constructor
- virtual ~CControlDialog();
-
-// Dialog Data
- enum { IDD = IDD_DIALOG1 };
-
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- IWebBrowser2* mBrowser;
- fstream debugLog;
- DSPlayer mPlayer;
- DECLARE_MESSAGE_MAP()
-public:
- afx_msg void OnBnClickedButton1();
-
- void setBrowser(IWebBrowser2* inBrowser);
- afx_msg void OnBnClickedButton2();
- afx_msg void OnBnClickedButton3();
-};
+#pragma once
+#include "DSPlayer.h"
+#include <fstream>
+using namespace std;
+// CControlDialog dialog
+
+class CControlDialog : public CDialog
+{
+ DECLARE_DYNAMIC(CControlDialog)
+
+public:
+ CControlDialog(CWnd* pParent = NULL); // standard constructor
+ virtual ~CControlDialog();
+
+// Dialog Data
+ enum { IDD = IDD_DIALOG1 };
+
+protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+ IWebBrowser2* mBrowser;
+ fstream debugLog;
+ DSPlayer mPlayer;
+ DECLARE_MESSAGE_MAP()
+public:
+ afx_msg void OnBnClickedButton1();
+
+ void setBrowser(IWebBrowser2* inBrowser);
+ afx_msg void OnBnClickedButton2();
+ afx_msg void OnBnClickedButton3();
+};
Property changes on: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/ControlDialog.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.cpp
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,557 +1,557 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-#include "StdAfx.h"
-#include ".\dsplayer.h"
-
-
-
-
-DSPlayer::DSPlayer(void)
- : mGraphBuilder(NULL)
- , mMediaControl(NULL)
- , mMediaSeeking(NULL)
- , mMediaEvent(NULL)
- , mEventHandle(INVALID_HANDLE_VALUE)
- , mCMMLCallback(NULL)
- , mMediaEventNotify(NULL)
- //, mDNCMMLCallbacks(NULL)
- //, mDNMediaEvent(NULL)
- , mCMMLAppControl(NULL)
-{
- CoInitialize(NULL);
- //mCMMLProxy = new CMMLCallbackProxy; //Need to delete this !
-
- debugLog.open("G:\\logs\\DSPlayer.log", ios_base::out);
-
- //Something about the way the activeX control links won't let us do the normal
- // DEFINE_GUID macro... so this is manually assigning it to a memeber variable so it links.
- Y_IID_ICMMLAppControl.Data1 = 0x6188ad0c;
- Y_IID_ICMMLAppControl.Data2 = 0x62cb;
- Y_IID_ICMMLAppControl.Data3 = 0x4658;
- Y_IID_ICMMLAppControl.Data4[0] = 0xa1;
- Y_IID_ICMMLAppControl.Data4[1] = 0x4e;
- Y_IID_ICMMLAppControl.Data4[2] = 0xcd;
- Y_IID_ICMMLAppControl.Data4[3] = 0x23;
- Y_IID_ICMMLAppControl.Data4[4] = 0xcf;
- Y_IID_ICMMLAppControl.Data4[5] = 0x84;
- Y_IID_ICMMLAppControl.Data4[6] = 0xec;
- Y_IID_ICMMLAppControl.Data4[7] = 0x31;
-
-}
-// // {6188AD0C-62CB-4658-A14E-CD23CF84EC31}
-//DEFINE_GUID(Y_IID_ICMMLAppControl,
-//0x6188ad0c, 0x62cb, 0x4658, 0xa1, 0x4e, 0xcd, 0x23, 0xcf, 0x84, 0xec, 0x31);
-//}
-
-bool DSPlayer::checkEvents() {
- const DWORD TIMEOUT_WAIT = 0; //Wait this many ms for handle
- long locEventCode = 0;
- long locParam1 = 0;
- long locParam2 = 0;
- HRESULT locHR = S_OK;
-
- if (WAIT_OBJECT_0 == WaitForSingleObject(mEventHandle, TIMEOUT_WAIT)) {
- while (locHR = mMediaEvent->GetEvent(&locEventCode, &locParam1, &locParam2, 0), SUCCEEDED(locHR))
- {
-
- debugLog<<"Event : "<<locEventCode<<" Params : "<<locParam1<<", "<<locParam2<<endl;
-
-
- if (mMediaEventNotify != NULL) {
- mMediaEventNotify->eventNotification(locEventCode, locParam1, locParam2);
- }
-
- mMediaEvent->FreeEventParams(locEventCode, locParam1, locParam2);
- }
- }
- return true;
-}
-
-
-DSPlayer::~DSPlayer(void) {
- debugLog<<"Killing DSPlayer"<<endl;
- debugLog.close();
-
- releaseInterfaces();
- CoUninitialize();
-}
-
-void DSPlayer::releaseInterfaces() {
- debugLog<<"Releasing interfaces"<<endl;
- ULONG numRef = 0;
- if (mMediaControl != NULL) {
- numRef =
- mMediaControl->Release();
- debugLog<<"Media Control count = "<<numRef<<endl;
- mMediaControl = NULL;
- }
-
- if (mMediaSeeking != NULL) {
- numRef =
- mMediaSeeking->Release();
-
- debugLog<<"Media Seeking count = "<<numRef<<endl;
- mMediaSeeking = NULL;
- }
-
- if (mMediaEvent != NULL) {
- numRef =
- mMediaEvent->Release();
-
- debugLog<<"Media Event count = "<<numRef<<endl;
- mMediaEvent = NULL;
- }
-
- if (mCMMLAppControl != NULL) {
- numRef =
- mCMMLAppControl->Release();
-
- debugLog<<"CMML App control count = "<<numRef<<endl;
- mCMMLAppControl = NULL;
- }
-
- debugLog<<"Before Graph release..."<<endl;
- if (mGraphBuilder != NULL) {
- numRef =
- mGraphBuilder->Release();
-
- debugLog<<"Graph Builder count = "<<numRef<<endl;
- mGraphBuilder = NULL;
- }
-
-
- debugLog<<"After graph release>.."<<endl;
- //TODO::: Release everything !
-}
-wstring DSPlayer::toWStr(string inString) {
- wstring retVal;
-
- //LPCWSTR retPtr = new wchar_t[retVal.length() + 1];
- for (std::string::const_iterator i = inString.begin(); i != inString.end(); i++) {
- retVal.append(1, *i);
- }
-
-
- return retVal;
-}
-
-bool DSPlayer::loadFile(wstring inFileName, HWND inWindow, int inLeft, int inTop, int inWidth, int inHeight) {
- //Debugging only
- ULONG numRef = 0;
- //
-
-
- releaseInterfaces();
- HRESULT locHR = S_OK;
-
-
- //debugLog<<"File = "<<inFileName<<endl;
- wstring locWFileName = inFileName; //toWStr(inFileName);
-
-
-
-
- //Have to use a local pointer or taking the adress of a member function makes the second level
- // of indirection a __gc pointer.
- IGraphBuilder* locGraphBuilder = NULL;
- locHR = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&locGraphBuilder);
- mGraphBuilder = locGraphBuilder;
-
- if (locHR != S_OK) {
- mIsLoaded = false;
- debugLog<<"Faild to make graph"<<endl;
- return false;
- }
-
-
- //If it's an annodex file, then put the VMR 9 in the graph.
- if (isFileAnnodex(inFileName)) {
- debugLog<<"Is annodex"<<endl;
- IBaseFilter* locVMR9 = NULL;
-
- HRESULT locHR2 = S_OK;
- locHR2 = mGraphBuilder->FindFilterByName(L"Video Mixing Renderer 9", &locVMR9);
- if (locVMR9 == NULL) {
- debugLog<<"Not in graph... making it !"<<endl;
- locHR2= CoCreateInstance(CLSID_VideoMixingRenderer9, NULL, CLSCTX_INPROC, IID_IBaseFilter, (void **)&locVMR9);
- if (locHR2 == S_OK) {
- locHR2 = mGraphBuilder->AddFilter(locVMR9, L"Video Mixing Renderer 9");
- numRef =
- locVMR9->Release();
- debugLog<<"VMR9 ref count = "<<numRef<<endl;
-
- }
- } else {
- numRef =
- locVMR9->Release();
-
- debugLog<<"VMR9 ref count = "<<numRef<<endl;
- }
-
-
-
-
- }
-
- debugLog<<"About to call render on "<<endl;
- //Build the graph
- locHR = mGraphBuilder->RenderFile(locWFileName.c_str(), NULL);
- debugLog<<"After render call..."<<endl;
- if (locHR != S_OK) {
- debugLog<<"Render File FAILED !!"<<endl;
- mIsLoaded = false;
- return false;
- }
-
-
- //CHANGES HERE FOR EMBEDDED WINDOW
- debugLog<<"Looking for IVideo Window"<<endl;
- IVideoWindow* locVW = NULL;
- locHR = locGraphBuilder->QueryInterface(IID_IVideoWindow, (void **)&locVW);
-
- if (locHR == S_OK) {
- debugLog<<"We got the IVideoWindow"<<endl;
-
-
- //locVW->put_MessageDrain((OAHWND)inWindow);
-
-
- locVW->put_Owner((OAHWND)inWindow);
- debugLog<<"Setting stuff..."<<endl;
- locVW->SetWindowPosition(inLeft, inTop, inWidth, inHeight);
- debugLog<<"Releasing windows"<<endl;
- locVW->Release();
-
- debugLog<<"Post release"<<endl;
- }
-
- //
-
- debugLog<<"Render must have been ok"<<endl;
- if (isFileAnnodex(inFileName)) {
- debugLog<<"Is annodex"<<endl;
- //Get the app control interface for CMML.
- IBaseFilter* locCMMLFilter = NULL;
- locHR = mGraphBuilder->FindFilterByName(L"CMML Decode Filter", &locCMMLFilter);
-
-
- if (locCMMLFilter != NULL) {
- ICMMLAppControl* locCMMLAppControl = NULL;
-
- locHR = locCMMLFilter->QueryInterface(Y_IID_ICMMLAppControl, (void**)&locCMMLAppControl);
- if (locCMMLAppControl != NULL) {
- mCMMLAppControl = locCMMLAppControl;
-
- mCMMLAppControl->setCallbacks(mCMMLCallback);
- }
- numRef =
- locCMMLFilter->Release();
-
- debugLog<<"CMML Filter ref Count = "<<numRef<<endl;
- }
-
- }
- debugLog<<"After CMML Code..."<<endl;
-
- //Get the media control interface
- IMediaControl* locMediaControl = NULL;
- locHR = mGraphBuilder->QueryInterface(IID_IMediaControl, (void**)&locMediaControl);
- mMediaControl = locMediaControl;
-
- if (locHR != S_OK) {
- mIsLoaded = false;
- return false;
- } else {
- mIsLoaded = true;
- }
-
- //get the media seeking interface if its available.
- IMediaSeeking* locMediaSeeking = NULL;
- locHR = mGraphBuilder->QueryInterface(IID_IMediaSeeking, (void**)&locMediaSeeking);
- mMediaSeeking = locMediaSeeking;
-
- //Get the media event interface
- IMediaEvent* locMediaEvent = NULL;
- locHR = locGraphBuilder->QueryInterface(IID_IMediaEvent, (void**)&locMediaEvent);
-
- if (locHR == S_OK) {
- mMediaEvent = locMediaEvent;
- HANDLE locEventHandle = INVALID_HANDLE_VALUE;
- locHR = locMediaEvent->GetEventHandle((OAEVENT*)&locEventHandle);
- mEventHandle = locEventHandle;
- }
-
-// if (FAILED(hr))
-
- return true;
-}
-bool DSPlayer::loadFile(wstring inFileName) {
-
- //Debugging only
- ULONG numRef = 0;
- //
-
-
- releaseInterfaces();
- HRESULT locHR = S_OK;
-
-
- //debugLog<<"File = "<<inFileName<<endl;
- wstring locWFileName = inFileName; //toWStr(inFileName);
-
-
-
-
- //Have to use a local pointer or taking the adress of a member function makes the second level
- // of indirection a __gc pointer.
- IGraphBuilder* locGraphBuilder = NULL;
- locHR = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&locGraphBuilder);
- mGraphBuilder = locGraphBuilder;
-
- if (locHR != S_OK) {
- mIsLoaded = false;
- return false;
- }
-
-
- //If it's an annodex file, then put the VMR 9 in the graph.
- if (isFileAnnodex(inFileName)) {
- debugLog<<"Is annodex"<<endl;
- IBaseFilter* locVMR9 = NULL;
-
- HRESULT locHR2 = S_OK;
- locHR2 = mGraphBuilder->FindFilterByName(L"Video Mixing Renderer 9", &locVMR9);
- if (locVMR9 == NULL) {
- debugLog<<"Not in graph... making it !"<<endl;
- locHR2= CoCreateInstance(CLSID_VideoMixingRenderer9, NULL, CLSCTX_INPROC, IID_IBaseFilter, (void **)&locVMR9);
- if (locHR2 == S_OK) {
- locHR2 = mGraphBuilder->AddFilter(locVMR9, L"Video Mixing Renderer 9");
- numRef =
- locVMR9->Release();
- debugLog<<"VMR9 ref count = "<<numRef<<endl;
-
- }
- } else {
- numRef =
- locVMR9->Release();
-
- debugLog<<"VMR9 ref count = "<<numRef<<endl;
- }
-
-
-
-
- }
-
- debugLog<<"About to call render on "<<endl;
- //Build the graph
- locHR = mGraphBuilder->RenderFile(locWFileName.c_str(), NULL);
-
- if (locHR != S_OK) {
- debugLog<<"Render File FAILED !!"<<endl;
- mIsLoaded = false;
- return false;
- }
-
- debugLog<<"Render must have been ok"<<endl;
- if (isFileAnnodex(inFileName)) {
- debugLog<<"Is annodex"<<endl;
- //Get the app control interface for CMML.
- IBaseFilter* locCMMLFilter = NULL;
- locHR = mGraphBuilder->FindFilterByName(L"CMML Decode Filter", &locCMMLFilter);
-
-
- if (locCMMLFilter != NULL) {
- ICMMLAppControl* locCMMLAppControl = NULL;
-
- locHR = locCMMLFilter->QueryInterface(Y_IID_ICMMLAppControl, (void**)&locCMMLAppControl);
- if (locCMMLAppControl != NULL) {
- mCMMLAppControl = locCMMLAppControl;
-
- mCMMLAppControl->setCallbacks(mCMMLCallback);
- }
- numRef =
- locCMMLFilter->Release();
-
- debugLog<<"CMML Filter ref Count = "<<numRef<<endl;
- }
-
- }
- debugLog<<"After CMML Code..."<<endl;
-
- //Get the media control interface
- IMediaControl* locMediaControl = NULL;
- locHR = mGraphBuilder->QueryInterface(IID_IMediaControl, (void**)&locMediaControl);
- mMediaControl = locMediaControl;
-
- if (locHR != S_OK) {
- mIsLoaded = false;
- return false;
- } else {
- mIsLoaded = true;
- }
-
- //get the media seeking interface if its available.
- IMediaSeeking* locMediaSeeking = NULL;
- locHR = mGraphBuilder->QueryInterface(IID_IMediaSeeking, (void**)&locMediaSeeking);
- mMediaSeeking = locMediaSeeking;
-
- //Get the media event interface
- IMediaEvent* locMediaEvent = NULL;
- locHR = locGraphBuilder->QueryInterface(IID_IMediaEvent, (void**)&locMediaEvent);
-
- if (locHR == S_OK) {
- mMediaEvent = locMediaEvent;
- HANDLE locEventHandle = INVALID_HANDLE_VALUE;
- locHR = locMediaEvent->GetEventHandle((OAEVENT*)&locEventHandle);
- mEventHandle = locEventHandle;
- }
-
-// if (FAILED(hr))
-
- return true;
-
-
-}
-
-//bool DSPlayer::setCMMLCallbacks(IDNCMMLCallbacks* inCMMLCallbacks) {
-// return mCMMLProxy->setManagedDelegate(inCMMLCallbacks);
-//}
-
-bool DSPlayer::isLoaded() {
- return mIsLoaded;
-}
-bool DSPlayer::play() {
- if (mIsLoaded) {
- HRESULT locHR = mMediaControl->Run();
- if (SUCCEEDED(locHR)) {
- return false;
- } else {
- return true;
- }
- } else {
- return false;
- }
-}
-
-bool DSPlayer::pause() {
- if (mIsLoaded) {
- HRESULT locHR = mMediaControl->Pause();
- if (locHR != S_OK) {
- return false;
- } else {
- return true;
- }
- } else {
- return false;
- }
-}
-
-bool DSPlayer::stop() {
- if (mIsLoaded) {
- HRESULT locHR = mMediaControl->Stop();
- if (locHR != S_OK) {
- return false;
- } else {
- return true;
- }
- } else {
- return false;
- }
-}
-
-__int64 DSPlayer::seek(__int64 inTime) {
- if (mIsLoaded && (mMediaSeeking != NULL)) {
- LONGLONG locCurrent = inTime;
- LONGLONG locStop = 0;
- HRESULT locHR = mMediaSeeking->SetPositions(&locCurrent, AM_SEEKING_AbsolutePositioning | AM_SEEKING_ReturnTime,
- &locStop, AM_SEEKING_NoPositioning);
-
- if (SUCCEEDED(locHR)) {
- return locCurrent;
- } else {
- return -1;
- }
- } else {
- return -1;
- }
-
-}
-
-__int64 DSPlayer::seekStart() {
- return 0;
-}
-
-__int64 DSPlayer::queryPosition() {
- return 0;
-}
-
-__int64 DSPlayer::fileSize() {
- return -1;
-}
-__int64 DSPlayer::fileDuration() {
- if (mIsLoaded && (mMediaSeeking != NULL)) {
- LONGLONG locDuration = 0;
- HRESULT locHR = mMediaSeeking->GetDuration(&locDuration);
-
- if (locHR != S_OK) {
- return -1;
- } else {
- return locDuration;
- }
- } else {
- return -1;
- }
-}
-
-bool DSPlayer::isFileAnnodex(wstring inFilename)
-{
- //BUG::: Case sensitive
- wstring locExt = inFilename.substr(inFilename.size() - 4, 4);
-
- if (locExt == L".anx") {
- return true;
- } else {
- return false;
- }
-}
-
-bool DSPlayer::setMediaEventCallback(IMediaEventNotification* inMediaEventCallback) {
- mMediaEventNotify = inMediaEventCallback;
- return true;
-}
-IMediaEventNotification* DSPlayer::getMediaEventCallback() {
- return mMediaEventNotify;
-}
-
-
-
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+#include "StdAfx.h"
+#include ".\dsplayer.h"
+
+
+
+
+DSPlayer::DSPlayer(void)
+ : mGraphBuilder(NULL)
+ , mMediaControl(NULL)
+ , mMediaSeeking(NULL)
+ , mMediaEvent(NULL)
+ , mEventHandle(INVALID_HANDLE_VALUE)
+ , mCMMLCallback(NULL)
+ , mMediaEventNotify(NULL)
+ //, mDNCMMLCallbacks(NULL)
+ //, mDNMediaEvent(NULL)
+ , mCMMLAppControl(NULL)
+{
+ CoInitialize(NULL);
+ //mCMMLProxy = new CMMLCallbackProxy; //Need to delete this !
+
+ debugLog.open("G:\\logs\\DSPlayer.log", ios_base::out);
+
+ //Something about the way the activeX control links won't let us do the normal
+ // DEFINE_GUID macro... so this is manually assigning it to a memeber variable so it links.
+ Y_IID_ICMMLAppControl.Data1 = 0x6188ad0c;
+ Y_IID_ICMMLAppControl.Data2 = 0x62cb;
+ Y_IID_ICMMLAppControl.Data3 = 0x4658;
+ Y_IID_ICMMLAppControl.Data4[0] = 0xa1;
+ Y_IID_ICMMLAppControl.Data4[1] = 0x4e;
+ Y_IID_ICMMLAppControl.Data4[2] = 0xcd;
+ Y_IID_ICMMLAppControl.Data4[3] = 0x23;
+ Y_IID_ICMMLAppControl.Data4[4] = 0xcf;
+ Y_IID_ICMMLAppControl.Data4[5] = 0x84;
+ Y_IID_ICMMLAppControl.Data4[6] = 0xec;
+ Y_IID_ICMMLAppControl.Data4[7] = 0x31;
+
+}
+// // {6188AD0C-62CB-4658-A14E-CD23CF84EC31}
+//DEFINE_GUID(Y_IID_ICMMLAppControl,
+//0x6188ad0c, 0x62cb, 0x4658, 0xa1, 0x4e, 0xcd, 0x23, 0xcf, 0x84, 0xec, 0x31);
+//}
+
+bool DSPlayer::checkEvents() {
+ const DWORD TIMEOUT_WAIT = 0; //Wait this many ms for handle
+ long locEventCode = 0;
+ long locParam1 = 0;
+ long locParam2 = 0;
+ HRESULT locHR = S_OK;
+
+ if (WAIT_OBJECT_0 == WaitForSingleObject(mEventHandle, TIMEOUT_WAIT)) {
+ while (locHR = mMediaEvent->GetEvent(&locEventCode, &locParam1, &locParam2, 0), SUCCEEDED(locHR))
+ {
+
+ debugLog<<"Event : "<<locEventCode<<" Params : "<<locParam1<<", "<<locParam2<<endl;
+
+
+ if (mMediaEventNotify != NULL) {
+ mMediaEventNotify->eventNotification(locEventCode, locParam1, locParam2);
+ }
+
+ mMediaEvent->FreeEventParams(locEventCode, locParam1, locParam2);
+ }
+ }
+ return true;
+}
+
+
+DSPlayer::~DSPlayer(void) {
+ debugLog<<"Killing DSPlayer"<<endl;
+ debugLog.close();
+
+ releaseInterfaces();
+ CoUninitialize();
+}
+
+void DSPlayer::releaseInterfaces() {
+ debugLog<<"Releasing interfaces"<<endl;
+ ULONG numRef = 0;
+ if (mMediaControl != NULL) {
+ numRef =
+ mMediaControl->Release();
+ debugLog<<"Media Control count = "<<numRef<<endl;
+ mMediaControl = NULL;
+ }
+
+ if (mMediaSeeking != NULL) {
+ numRef =
+ mMediaSeeking->Release();
+
+ debugLog<<"Media Seeking count = "<<numRef<<endl;
+ mMediaSeeking = NULL;
+ }
+
+ if (mMediaEvent != NULL) {
+ numRef =
+ mMediaEvent->Release();
+
+ debugLog<<"Media Event count = "<<numRef<<endl;
+ mMediaEvent = NULL;
+ }
+
+ if (mCMMLAppControl != NULL) {
+ numRef =
+ mCMMLAppControl->Release();
+
+ debugLog<<"CMML App control count = "<<numRef<<endl;
+ mCMMLAppControl = NULL;
+ }
+
+ debugLog<<"Before Graph release..."<<endl;
+ if (mGraphBuilder != NULL) {
+ numRef =
+ mGraphBuilder->Release();
+
+ debugLog<<"Graph Builder count = "<<numRef<<endl;
+ mGraphBuilder = NULL;
+ }
+
+
+ debugLog<<"After graph release>.."<<endl;
+ //TODO::: Release everything !
+}
+wstring DSPlayer::toWStr(string inString) {
+ wstring retVal;
+
+ //LPCWSTR retPtr = new wchar_t[retVal.length() + 1];
+ for (std::string::const_iterator i = inString.begin(); i != inString.end(); i++) {
+ retVal.append(1, *i);
+ }
+
+
+ return retVal;
+}
+
+bool DSPlayer::loadFile(wstring inFileName, HWND inWindow, int inLeft, int inTop, int inWidth, int inHeight) {
+ //Debugging only
+ ULONG numRef = 0;
+ //
+
+
+ releaseInterfaces();
+ HRESULT locHR = S_OK;
+
+
+ //debugLog<<"File = "<<inFileName<<endl;
+ wstring locWFileName = inFileName; //toWStr(inFileName);
+
+
+
+
+ //Have to use a local pointer or taking the adress of a member function makes the second level
+ // of indirection a __gc pointer.
+ IGraphBuilder* locGraphBuilder = NULL;
+ locHR = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&locGraphBuilder);
+ mGraphBuilder = locGraphBuilder;
+
+ if (locHR != S_OK) {
+ mIsLoaded = false;
+ debugLog<<"Faild to make graph"<<endl;
+ return false;
+ }
+
+
+ //If it's an annodex file, then put the VMR 9 in the graph.
+ if (isFileAnnodex(inFileName)) {
+ debugLog<<"Is annodex"<<endl;
+ IBaseFilter* locVMR9 = NULL;
+
+ HRESULT locHR2 = S_OK;
+ locHR2 = mGraphBuilder->FindFilterByName(L"Video Mixing Renderer 9", &locVMR9);
+ if (locVMR9 == NULL) {
+ debugLog<<"Not in graph... making it !"<<endl;
+ locHR2= CoCreateInstance(CLSID_VideoMixingRenderer9, NULL, CLSCTX_INPROC, IID_IBaseFilter, (void **)&locVMR9);
+ if (locHR2 == S_OK) {
+ locHR2 = mGraphBuilder->AddFilter(locVMR9, L"Video Mixing Renderer 9");
+ numRef =
+ locVMR9->Release();
+ debugLog<<"VMR9 ref count = "<<numRef<<endl;
+
+ }
+ } else {
+ numRef =
+ locVMR9->Release();
+
+ debugLog<<"VMR9 ref count = "<<numRef<<endl;
+ }
+
+
+
+
+ }
+
+ debugLog<<"About to call render on "<<endl;
+ //Build the graph
+ locHR = mGraphBuilder->RenderFile(locWFileName.c_str(), NULL);
+ debugLog<<"After render call..."<<endl;
+ if (locHR != S_OK) {
+ debugLog<<"Render File FAILED !!"<<endl;
+ mIsLoaded = false;
+ return false;
+ }
+
+
+ //CHANGES HERE FOR EMBEDDED WINDOW
+ debugLog<<"Looking for IVideo Window"<<endl;
+ IVideoWindow* locVW = NULL;
+ locHR = locGraphBuilder->QueryInterface(IID_IVideoWindow, (void **)&locVW);
+
+ if (locHR == S_OK) {
+ debugLog<<"We got the IVideoWindow"<<endl;
+
+
+ //locVW->put_MessageDrain((OAHWND)inWindow);
+
+
+ locVW->put_Owner((OAHWND)inWindow);
+ debugLog<<"Setting stuff..."<<endl;
+ locVW->SetWindowPosition(inLeft, inTop, inWidth, inHeight);
+ debugLog<<"Releasing windows"<<endl;
+ locVW->Release();
+
+ debugLog<<"Post release"<<endl;
+ }
+
+ //
+
+ debugLog<<"Render must have been ok"<<endl;
+ if (isFileAnnodex(inFileName)) {
+ debugLog<<"Is annodex"<<endl;
+ //Get the app control interface for CMML.
+ IBaseFilter* locCMMLFilter = NULL;
+ locHR = mGraphBuilder->FindFilterByName(L"CMML Decode Filter", &locCMMLFilter);
+
+
+ if (locCMMLFilter != NULL) {
+ ICMMLAppControl* locCMMLAppControl = NULL;
+
+ locHR = locCMMLFilter->QueryInterface(Y_IID_ICMMLAppControl, (void**)&locCMMLAppControl);
+ if (locCMMLAppControl != NULL) {
+ mCMMLAppControl = locCMMLAppControl;
+
+ mCMMLAppControl->setCallbacks(mCMMLCallback);
+ }
+ numRef =
+ locCMMLFilter->Release();
+
+ debugLog<<"CMML Filter ref Count = "<<numRef<<endl;
+ }
+
+ }
+ debugLog<<"After CMML Code..."<<endl;
+
+ //Get the media control interface
+ IMediaControl* locMediaControl = NULL;
+ locHR = mGraphBuilder->QueryInterface(IID_IMediaControl, (void**)&locMediaControl);
+ mMediaControl = locMediaControl;
+
+ if (locHR != S_OK) {
+ mIsLoaded = false;
+ return false;
+ } else {
+ mIsLoaded = true;
+ }
+
+ //get the media seeking interface if its available.
+ IMediaSeeking* locMediaSeeking = NULL;
+ locHR = mGraphBuilder->QueryInterface(IID_IMediaSeeking, (void**)&locMediaSeeking);
+ mMediaSeeking = locMediaSeeking;
+
+ //Get the media event interface
+ IMediaEvent* locMediaEvent = NULL;
+ locHR = locGraphBuilder->QueryInterface(IID_IMediaEvent, (void**)&locMediaEvent);
+
+ if (locHR == S_OK) {
+ mMediaEvent = locMediaEvent;
+ HANDLE locEventHandle = INVALID_HANDLE_VALUE;
+ locHR = locMediaEvent->GetEventHandle((OAEVENT*)&locEventHandle);
+ mEventHandle = locEventHandle;
+ }
+
+// if (FAILED(hr))
+
+ return true;
+}
+bool DSPlayer::loadFile(wstring inFileName) {
+
+ //Debugging only
+ ULONG numRef = 0;
+ //
+
+
+ releaseInterfaces();
+ HRESULT locHR = S_OK;
+
+
+ //debugLog<<"File = "<<inFileName<<endl;
+ wstring locWFileName = inFileName; //toWStr(inFileName);
+
+
+
+
+ //Have to use a local pointer or taking the adress of a member function makes the second level
+ // of indirection a __gc pointer.
+ IGraphBuilder* locGraphBuilder = NULL;
+ locHR = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&locGraphBuilder);
+ mGraphBuilder = locGraphBuilder;
+
+ if (locHR != S_OK) {
+ mIsLoaded = false;
+ return false;
+ }
+
+
+ //If it's an annodex file, then put the VMR 9 in the graph.
+ if (isFileAnnodex(inFileName)) {
+ debugLog<<"Is annodex"<<endl;
+ IBaseFilter* locVMR9 = NULL;
+
+ HRESULT locHR2 = S_OK;
+ locHR2 = mGraphBuilder->FindFilterByName(L"Video Mixing Renderer 9", &locVMR9);
+ if (locVMR9 == NULL) {
+ debugLog<<"Not in graph... making it !"<<endl;
+ locHR2= CoCreateInstance(CLSID_VideoMixingRenderer9, NULL, CLSCTX_INPROC, IID_IBaseFilter, (void **)&locVMR9);
+ if (locHR2 == S_OK) {
+ locHR2 = mGraphBuilder->AddFilter(locVMR9, L"Video Mixing Renderer 9");
+ numRef =
+ locVMR9->Release();
+ debugLog<<"VMR9 ref count = "<<numRef<<endl;
+
+ }
+ } else {
+ numRef =
+ locVMR9->Release();
+
+ debugLog<<"VMR9 ref count = "<<numRef<<endl;
+ }
+
+
+
+
+ }
+
+ debugLog<<"About to call render on "<<endl;
+ //Build the graph
+ locHR = mGraphBuilder->RenderFile(locWFileName.c_str(), NULL);
+
+ if (locHR != S_OK) {
+ debugLog<<"Render File FAILED !!"<<endl;
+ mIsLoaded = false;
+ return false;
+ }
+
+ debugLog<<"Render must have been ok"<<endl;
+ if (isFileAnnodex(inFileName)) {
+ debugLog<<"Is annodex"<<endl;
+ //Get the app control interface for CMML.
+ IBaseFilter* locCMMLFilter = NULL;
+ locHR = mGraphBuilder->FindFilterByName(L"CMML Decode Filter", &locCMMLFilter);
+
+
+ if (locCMMLFilter != NULL) {
+ ICMMLAppControl* locCMMLAppControl = NULL;
+
+ locHR = locCMMLFilter->QueryInterface(Y_IID_ICMMLAppControl, (void**)&locCMMLAppControl);
+ if (locCMMLAppControl != NULL) {
+ mCMMLAppControl = locCMMLAppControl;
+
+ mCMMLAppControl->setCallbacks(mCMMLCallback);
+ }
+ numRef =
+ locCMMLFilter->Release();
+
+ debugLog<<"CMML Filter ref Count = "<<numRef<<endl;
+ }
+
+ }
+ debugLog<<"After CMML Code..."<<endl;
+
+ //Get the media control interface
+ IMediaControl* locMediaControl = NULL;
+ locHR = mGraphBuilder->QueryInterface(IID_IMediaControl, (void**)&locMediaControl);
+ mMediaControl = locMediaControl;
+
+ if (locHR != S_OK) {
+ mIsLoaded = false;
+ return false;
+ } else {
+ mIsLoaded = true;
+ }
+
+ //get the media seeking interface if its available.
+ IMediaSeeking* locMediaSeeking = NULL;
+ locHR = mGraphBuilder->QueryInterface(IID_IMediaSeeking, (void**)&locMediaSeeking);
+ mMediaSeeking = locMediaSeeking;
+
+ //Get the media event interface
+ IMediaEvent* locMediaEvent = NULL;
+ locHR = locGraphBuilder->QueryInterface(IID_IMediaEvent, (void**)&locMediaEvent);
+
+ if (locHR == S_OK) {
+ mMediaEvent = locMediaEvent;
+ HANDLE locEventHandle = INVALID_HANDLE_VALUE;
+ locHR = locMediaEvent->GetEventHandle((OAEVENT*)&locEventHandle);
+ mEventHandle = locEventHandle;
+ }
+
+// if (FAILED(hr))
+
+ return true;
+
+
+}
+
+//bool DSPlayer::setCMMLCallbacks(IDNCMMLCallbacks* inCMMLCallbacks) {
+// return mCMMLProxy->setManagedDelegate(inCMMLCallbacks);
+//}
+
+bool DSPlayer::isLoaded() {
+ return mIsLoaded;
+}
+bool DSPlayer::play() {
+ if (mIsLoaded) {
+ HRESULT locHR = mMediaControl->Run();
+ if (SUCCEEDED(locHR)) {
+ return false;
+ } else {
+ return true;
+ }
+ } else {
+ return false;
+ }
+}
+
+bool DSPlayer::pause() {
+ if (mIsLoaded) {
+ HRESULT locHR = mMediaControl->Pause();
+ if (locHR != S_OK) {
+ return false;
+ } else {
+ return true;
+ }
+ } else {
+ return false;
+ }
+}
+
+bool DSPlayer::stop() {
+ if (mIsLoaded) {
+ HRESULT locHR = mMediaControl->Stop();
+ if (locHR != S_OK) {
+ return false;
+ } else {
+ return true;
+ }
+ } else {
+ return false;
+ }
+}
+
+__int64 DSPlayer::seek(__int64 inTime) {
+ if (mIsLoaded && (mMediaSeeking != NULL)) {
+ LONGLONG locCurrent = inTime;
+ LONGLONG locStop = 0;
+ HRESULT locHR = mMediaSeeking->SetPositions(&locCurrent, AM_SEEKING_AbsolutePositioning | AM_SEEKING_ReturnTime,
+ &locStop, AM_SEEKING_NoPositioning);
+
+ if (SUCCEEDED(locHR)) {
+ return locCurrent;
+ } else {
+ return -1;
+ }
+ } else {
+ return -1;
+ }
+
+}
+
+__int64 DSPlayer::seekStart() {
+ return 0;
+}
+
+__int64 DSPlayer::queryPosition() {
+ return 0;
+}
+
+__int64 DSPlayer::fileSize() {
+ return -1;
+}
+__int64 DSPlayer::fileDuration() {
+ if (mIsLoaded && (mMediaSeeking != NULL)) {
+ LONGLONG locDuration = 0;
+ HRESULT locHR = mMediaSeeking->GetDuration(&locDuration);
+
+ if (locHR != S_OK) {
+ return -1;
+ } else {
+ return locDuration;
+ }
+ } else {
+ return -1;
+ }
+}
+
+bool DSPlayer::isFileAnnodex(wstring inFilename)
+{
+ //BUG::: Case sensitive
+ wstring locExt = inFilename.substr(inFilename.size() - 4, 4);
+
+ if (locExt == L".anx") {
+ return true;
+ } else {
+ return false;
+ }
+}
+
+bool DSPlayer::setMediaEventCallback(IMediaEventNotification* inMediaEventCallback) {
+ mMediaEventNotify = inMediaEventCallback;
+ return true;
+}
+IMediaEventNotification* DSPlayer::getMediaEventCallback() {
+ return mMediaEventNotify;
+}
+
+
+
Property changes on: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.h
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,81 +1,81 @@
-#pragma once
-
-
-#include <uuids.h>
-#include <dshow.h>
-
-//
-#include <d3d9.h>
-#include <vmr9.h>
-
-
-#include <string>
-
-#include "ICMMLCallbacks.h"
-#include "ICMMLAppControl.h"
-#include "libCMMLTags.h"
-#include "IMediaEventNotification.h"
-
-
-
-
-
-#include <fstream>
-#include <string>
-
-
-
-using namespace std;
-
-
-class DSPlayer
-{
-public:
-
- DSPlayer(void);
- ~DSPlayer(void);
-
-
- bool loadFile(wstring inFileName);
- bool loadFile(wstring inFileName, HWND inWindow, int inLeft, int inTop, int inWidth, int inHeight);
- bool play();
- bool pause();
- bool stop();
- __int64 seek(__int64 inTime);
- __int64 seekStart();
- __int64 queryPosition();
-
- bool isLoaded();
- __int64 fileSize();
- __int64 fileDuration();
-
-
- bool setMediaEventCallback(IMediaEventNotification* inMediaEventCallback);
- IMediaEventNotification* getMediaEventCallback();
-
- //bool setCMMLCallbacks(IDNCMMLCallbacks* inCMMLCallbacks);
- bool checkEvents();
-
- void releaseInterfaces();
- protected:
- //static wstring toWStr(std::string inString);
- IGraphBuilder* mGraphBuilder;
- IMediaControl* mMediaControl;
- IMediaSeeking* mMediaSeeking;
- IMediaEvent* mMediaEvent;
- ICMMLAppControl* mCMMLAppControl;
- ICMMLCallbacks* mCMMLCallback;
- IMediaEventNotification* mMediaEventNotify;
-
- HANDLE mEventHandle;
-
- bool mIsLoaded;
- bool isFileAnnodex(wstring inFilename);
-
- wstring toWStr(string inString);
-
- GUID Y_IID_ICMMLAppControl;
- fstream debugLog;
-};
-
-
+#pragma once
+
+
+#include <uuids.h>
+#include <dshow.h>
+
+//
+#include <d3d9.h>
+#include <vmr9.h>
+
+
+#include <string>
+
+#include "ICMMLCallbacks.h"
+#include "ICMMLAppControl.h"
+#include "libCMMLTags.h"
+#include "IMediaEventNotification.h"
+
+
+
+
+
+#include <fstream>
+#include <string>
+
+
+
+using namespace std;
+
+
+class DSPlayer
+{
+public:
+
+ DSPlayer(void);
+ ~DSPlayer(void);
+
+
+ bool loadFile(wstring inFileName);
+ bool loadFile(wstring inFileName, HWND inWindow, int inLeft, int inTop, int inWidth, int inHeight);
+ bool play();
+ bool pause();
+ bool stop();
+ __int64 seek(__int64 inTime);
+ __int64 seekStart();
+ __int64 queryPosition();
+
+ bool isLoaded();
+ __int64 fileSize();
+ __int64 fileDuration();
+
+
+ bool setMediaEventCallback(IMediaEventNotification* inMediaEventCallback);
+ IMediaEventNotification* getMediaEventCallback();
+
+ //bool setCMMLCallbacks(IDNCMMLCallbacks* inCMMLCallbacks);
+ bool checkEvents();
+
+ void releaseInterfaces();
+ protected:
+ //static wstring toWStr(std::string inString);
+ IGraphBuilder* mGraphBuilder;
+ IMediaControl* mMediaControl;
+ IMediaSeeking* mMediaSeeking;
+ IMediaEvent* mMediaEvent;
+ ICMMLAppControl* mCMMLAppControl;
+ ICMMLCallbacks* mCMMLCallback;
+ IMediaEventNotification* mMediaEventNotify;
+
+ HANDLE mEventHandle;
+
+ bool mIsLoaded;
+ bool isFileAnnodex(wstring inFilename);
+
+ wstring toWStr(string inString);
+
+ GUID Y_IID_ICMMLAppControl;
+ fstream debugLog;
+};
+
+
Property changes on: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/DSPlayer.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/IMediaEventNotification.cpp
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/IMediaEventNotification.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/IMediaEventNotification.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,10 +1,10 @@
-#include "StdAfx.h"
-#include ".\imediaeventnotification.h"
-
-IMediaEventNotification::IMediaEventNotification(void)
-{
-}
-
-IMediaEventNotification::~IMediaEventNotification(void)
-{
-}
+#include "StdAfx.h"
+#include ".\imediaeventnotification.h"
+
+IMediaEventNotification::IMediaEventNotification(void)
+{
+}
+
+IMediaEventNotification::~IMediaEventNotification(void)
+{
+}
Property changes on: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/IMediaEventNotification.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/IMediaEventNotification.h
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/IMediaEventNotification.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/IMediaEventNotification.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,10 +1,10 @@
-#pragma once
-
-class IMediaEventNotification
-{
-public:
- IMediaEventNotification(void);
- virtual ~IMediaEventNotification(void);
-
- virtual bool eventNotification(int inEventCode, int inParam1, int inParam2) = 0;
-};
+#pragma once
+
+class IMediaEventNotification
+{
+public:
+ IMediaEventNotification(void);
+ virtual ~IMediaEventNotification(void);
+
+ virtual bool eventNotification(int inEventCode, int inParam1, int inParam2) = 0;
+};
Property changes on: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/IMediaEventNotification.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/Resource.h
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/Resource.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/Resource.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,26 +1,26 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Visual C++ generated include file.
-// Used by axAnxOggPlayer.rc
-//
-#define IDS_AXANXOGGPLAYER 1
-#define IDD_ABOUTBOX_AXANXOGGPLAYER 1
-#define IDB_AXANXOGGPLAYER 1
-#define IDI_ABOUTDLL 1
-#define IDS_AXANXOGGPLAYER_PPG 2
-#define IDS_AXANXOGGPLAYER_PPG_CAPTION 200
-#define IDD_PROPPAGE_AXANXOGGPLAYER 200
-#define IDD_DIALOG1 201
-#define IDC_BUTTON1 201
-#define IDC_BUTTON2 202
-#define IDC_BUTTON3 203
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 202
-#define _APS_NEXT_COMMAND_VALUE 32768
-#define _APS_NEXT_CONTROL_VALUE 204
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by axAnxOggPlayer.rc
+//
+#define IDS_AXANXOGGPLAYER 1
+#define IDD_ABOUTBOX_AXANXOGGPLAYER 1
+#define IDB_AXANXOGGPLAYER 1
+#define IDI_ABOUTDLL 1
+#define IDS_AXANXOGGPLAYER_PPG 2
+#define IDS_AXANXOGGPLAYER_PPG_CAPTION 200
+#define IDD_PROPPAGE_AXANXOGGPLAYER 200
+#define IDD_DIALOG1 201
+#define IDC_BUTTON1 201
+#define IDC_BUTTON2 202
+#define IDC_BUTTON3 203
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 202
+#define _APS_NEXT_COMMAND_VALUE 32768
+#define _APS_NEXT_CONTROL_VALUE 204
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
Property changes on: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/Resource.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayer.cpp
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayer.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayer.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,77 +1,77 @@
-// axAnxOggPlayer.cpp : Implementation of CaxAnxOggPlayerApp and DLL registration.
-
-#include "stdafx.h"
-#include "axAnxOggPlayer.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#endif
-
-
-CaxAnxOggPlayerApp NEAR theApp;
-
-const GUID CDECL BASED_CODE _tlid =
- { 0x375E2E46, 0x3968, 0x41FA, { 0x99, 0xBE, 0x35, 0x52, 0x3D, 0xC5, 0x7B, 0x4E } };
-const WORD _wVerMajor = 1;
-const WORD _wVerMinor = 0;
-
-
-
-// CaxAnxOggPlayerApp::InitInstance - DLL initialization
-
-BOOL CaxAnxOggPlayerApp::InitInstance()
-{
- BOOL bInit = COleControlModule::InitInstance();
-
- if (bInit)
- {
- // TODO: Add your own module initialization code here.
- }
-
- return bInit;
-}
-
-
-
-// CaxAnxOggPlayerApp::ExitInstance - DLL termination
-
-int CaxAnxOggPlayerApp::ExitInstance()
-{
- // TODO: Add your own module termination code here.
-
- return COleControlModule::ExitInstance();
-}
-
-
-
-// DllRegisterServer - Adds entries to the system registry
-
-STDAPI DllRegisterServer(void)
-{
- AFX_MANAGE_STATE(_afxModuleAddrThis);
-
- if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid))
- return ResultFromScode(SELFREG_E_TYPELIB);
-
- if (!COleObjectFactoryEx::UpdateRegistryAll(TRUE))
- return ResultFromScode(SELFREG_E_CLASS);
-
- return NOERROR;
-}
-
-
-
-// DllUnregisterServer - Removes entries from the system registry
-
-STDAPI DllUnregisterServer(void)
-{
- AFX_MANAGE_STATE(_afxModuleAddrThis);
-
- if (!AfxOleUnregisterTypeLib(_tlid, _wVerMajor, _wVerMinor))
- return ResultFromScode(SELFREG_E_TYPELIB);
-
- if (!COleObjectFactoryEx::UpdateRegistryAll(FALSE))
- return ResultFromScode(SELFREG_E_CLASS);
-
- return NOERROR;
-}
+// axAnxOggPlayer.cpp : Implementation of CaxAnxOggPlayerApp and DLL registration.
+
+#include "stdafx.h"
+#include "axAnxOggPlayer.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#endif
+
+
+CaxAnxOggPlayerApp NEAR theApp;
+
+const GUID CDECL BASED_CODE _tlid =
+ { 0x375E2E46, 0x3968, 0x41FA, { 0x99, 0xBE, 0x35, 0x52, 0x3D, 0xC5, 0x7B, 0x4E } };
+const WORD _wVerMajor = 1;
+const WORD _wVerMinor = 0;
+
+
+
+// CaxAnxOggPlayerApp::InitInstance - DLL initialization
+
+BOOL CaxAnxOggPlayerApp::InitInstance()
+{
+ BOOL bInit = COleControlModule::InitInstance();
+
+ if (bInit)
+ {
+ // TODO: Add your own module initialization code here.
+ }
+
+ return bInit;
+}
+
+
+
+// CaxAnxOggPlayerApp::ExitInstance - DLL termination
+
+int CaxAnxOggPlayerApp::ExitInstance()
+{
+ // TODO: Add your own module termination code here.
+
+ return COleControlModule::ExitInstance();
+}
+
+
+
+// DllRegisterServer - Adds entries to the system registry
+
+STDAPI DllRegisterServer(void)
+{
+ AFX_MANAGE_STATE(_afxModuleAddrThis);
+
+ if (!AfxOleRegisterTypeLib(AfxGetInstanceHandle(), _tlid))
+ return ResultFromScode(SELFREG_E_TYPELIB);
+
+ if (!COleObjectFactoryEx::UpdateRegistryAll(TRUE))
+ return ResultFromScode(SELFREG_E_CLASS);
+
+ return NOERROR;
+}
+
+
+
+// DllUnregisterServer - Removes entries from the system registry
+
+STDAPI DllUnregisterServer(void)
+{
+ AFX_MANAGE_STATE(_afxModuleAddrThis);
+
+ if (!AfxOleUnregisterTypeLib(_tlid, _wVerMajor, _wVerMinor))
+ return ResultFromScode(SELFREG_E_TYPELIB);
+
+ if (!COleObjectFactoryEx::UpdateRegistryAll(FALSE))
+ return ResultFromScode(SELFREG_E_CLASS);
+
+ return NOERROR;
+}
Property changes on: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayer.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayer.h
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayer.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayer.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,24 +1,24 @@
-#pragma once
-
-// axAnxOggPlayer.h : main header file for axAnxOggPlayer.DLL
-
-#if !defined( __AFXCTL_H__ )
-#error include 'afxctl.h' before including this file
-#endif
-
-#include "resource.h" // main symbols
-
-
-// CaxAnxOggPlayerApp : See axAnxOggPlayer.cpp for implementation.
-
-class CaxAnxOggPlayerApp : public COleControlModule
-{
-public:
- BOOL InitInstance();
- int ExitInstance();
-};
-
-extern const GUID CDECL _tlid;
-extern const WORD _wVerMajor;
-extern const WORD _wVerMinor;
-
+#pragma once
+
+// axAnxOggPlayer.h : main header file for axAnxOggPlayer.DLL
+
+#if !defined( __AFXCTL_H__ )
+#error include 'afxctl.h' before including this file
+#endif
+
+#include "resource.h" // main symbols
+
+
+// CaxAnxOggPlayerApp : See axAnxOggPlayer.cpp for implementation.
+
+class CaxAnxOggPlayerApp : public COleControlModule
+{
+public:
+ BOOL InitInstance();
+ int ExitInstance();
+};
+
+extern const GUID CDECL _tlid;
+extern const WORD _wVerMajor;
+extern const WORD _wVerMinor;
+
Property changes on: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayer.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayerCtrl.cpp
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayerCtrl.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayerCtrl.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,248 +1,248 @@
-// axAnxOggPlayerCtrl.cpp : Implementation of the CaxAnxOggPlayerCtrl ActiveX Control class.
-
-#include "stdafx.h"
-#include "axAnxOggPlayer.h"
-#include "axAnxOggPlayerCtrl.h"
-#include "axAnxOggPlayerPropPage.h"
-#include ".\axanxoggplayerctrl.h"
-
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#endif
-
-
-IMPLEMENT_DYNCREATE(CaxAnxOggPlayerCtrl, COleControl)
-
-
-
-// Message map
-
-BEGIN_MESSAGE_MAP(CaxAnxOggPlayerCtrl, COleControl)
- ON_MESSAGE(OCM_COMMAND, OnOcmCommand)
- ON_OLEVERB(AFX_IDS_VERB_PROPERTIES, OnProperties)
- ON_WM_CREATE()
-END_MESSAGE_MAP()
-
-
-
-// Dispatch map
-
-BEGIN_DISPATCH_MAP(CaxAnxOggPlayerCtrl, COleControl)
- DISP_FUNCTION_ID(CaxAnxOggPlayerCtrl, "AboutBox", DISPID_ABOUTBOX, AboutBox, VT_EMPTY, VTS_NONE)
-END_DISPATCH_MAP()
-
-
-
-// Event map
-
-BEGIN_EVENT_MAP(CaxAnxOggPlayerCtrl, COleControl)
-END_EVENT_MAP()
-
-
-
-// Property pages
-
-// TODO: Add more property pages as needed. Remember to increase the count!
-BEGIN_PROPPAGEIDS(CaxAnxOggPlayerCtrl, 1)
- PROPPAGEID(CaxAnxOggPlayerPropPage::guid)
-END_PROPPAGEIDS(CaxAnxOggPlayerCtrl)
-
-
-
-// Initialize class factory and guid
-
-IMPLEMENT_OLECREATE_EX(CaxAnxOggPlayerCtrl, "AXANXOGGPLAYER.axAnxOggPlayerCtrl.1",
- 0x9b80daa5, 0xbcfa, 0x44f8, 0xb2, 0xaa, 0xb2, 0xec, 0xf8, 0x6, 0x2, 0xa1)
-
-
-
-// Type library ID and version
-
-IMPLEMENT_OLETYPELIB(CaxAnxOggPlayerCtrl, _tlid, _wVerMajor, _wVerMinor)
-
-
-
-// Interface IDs
-
-const IID BASED_CODE IID_DaxAnxOggPlayer =
- { 0xB878657F, 0xFA23, 0x4915, { 0x8E, 0x80, 0x66, 0x64, 0xF1, 0x73, 0x8B, 0xEF } };
-const IID BASED_CODE IID_DaxAnxOggPlayerEvents =
- { 0x380DE0F9, 0x5B8, 0x4D01, { 0x92, 0x21, 0xC6, 0x48, 0xBC, 0x43, 0x24, 0x23 } };
-
-
-
-// Control type information
-
-static const DWORD BASED_CODE _dwaxAnxOggPlayerOleMisc =
- OLEMISC_ACTIVATEWHENVISIBLE |
- OLEMISC_SETCLIENTSITEFIRST |
- OLEMISC_INSIDEOUT |
- OLEMISC_CANTLINKINSIDE |
- OLEMISC_RECOMPOSEONRESIZE;
-
-IMPLEMENT_OLECTLTYPE(CaxAnxOggPlayerCtrl, IDS_AXANXOGGPLAYER, _dwaxAnxOggPlayerOleMisc)
-
-
-
-// CaxAnxOggPlayerCtrl::CaxAnxOggPlayerCtrlFactory::UpdateRegistry -
-// Adds or removes system registry entries for CaxAnxOggPlayerCtrl
-
-BOOL CaxAnxOggPlayerCtrl::CaxAnxOggPlayerCtrlFactory::UpdateRegistry(BOOL bRegister)
-{
- // TODO: Verify that your control follows apartment-model threading rules.
- // Refer to MFC TechNote 64 for more information.
- // If your control does not conform to the apartment-model rules, then
- // you must modify the code below, changing the 6th parameter from
- // afxRegApartmentThreading to 0.
-
- if (bRegister)
- return AfxOleRegisterControlClass(
- AfxGetInstanceHandle(),
- m_clsid,
- m_lpszProgID,
- IDS_AXANXOGGPLAYER,
- IDB_AXANXOGGPLAYER,
- afxRegApartmentThreading,
- _dwaxAnxOggPlayerOleMisc,
- _tlid,
- _wVerMajor,
- _wVerMinor);
- else
- return AfxOleUnregisterClass(m_clsid, m_lpszProgID);
-}
-
-
-
-// CaxAnxOggPlayerCtrl::CaxAnxOggPlayerCtrl - Constructor
-
-CaxAnxOggPlayerCtrl::CaxAnxOggPlayerCtrl()
-{
- InitializeIIDs(&IID_DaxAnxOggPlayer, &IID_DaxAnxOggPlayerEvents);
- // TODO: Initialize your control's instance data here.
- debugLog.open("G:\\logs\\ax_cntrol.log", ios_base::out);
- debugLog<<"Control activated..."<<endl;
-}
-
-
-
-// CaxAnxOggPlayerCtrl::~CaxAnxOggPlayerCtrl - Destructor
-
-CaxAnxOggPlayerCtrl::~CaxAnxOggPlayerCtrl()
-{
- // TODO: Cleanup your control's instance data here.
-}
-
-
-
-// CaxAnxOggPlayerCtrl::OnDraw - Drawing function
-
-void CaxAnxOggPlayerCtrl::OnDraw(
- CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
-{
- if (!pdc)
- return;
-
- DoSuperclassPaint(pdc, rcBounds);
-}
-
-
-
-// CaxAnxOggPlayerCtrl::DoPropExchange - Persistence support
-
-void CaxAnxOggPlayerCtrl::DoPropExchange(CPropExchange* pPX)
-{
- ExchangeVersion(pPX, MAKELONG(_wVerMinor, _wVerMajor));
- COleControl::DoPropExchange(pPX);
-
- // TODO: Call PX_ functions for each persistent custom property.
-}
-
-
-
-// CaxAnxOggPlayerCtrl::OnResetState - Reset control to default state
-
-void CaxAnxOggPlayerCtrl::OnResetState()
-{
- COleControl::OnResetState(); // Resets defaults found in DoPropExchange
-
- // TODO: Reset any other control state here.
-}
-
-
-
-// CaxAnxOggPlayerCtrl::AboutBox - Display an "About" box to the user
-
-void CaxAnxOggPlayerCtrl::AboutBox()
-{
- CDialog dlgAbout(IDD_ABOUTBOX_AXANXOGGPLAYER);
- dlgAbout.DoModal();
-}
-
-
-
-// CaxAnxOggPlayerCtrl::PreCreateWindow - Modify parameters for CreateWindowEx
-
-BOOL CaxAnxOggPlayerCtrl::PreCreateWindow(CREATESTRUCT& cs)
-{
- debugLog<<"Pre create..."<<endl;
- cs.lpszClass = _T("STATIC");
- return COleControl::PreCreateWindow(cs);
-}
-
-
-
-// CaxAnxOggPlayerCtrl::IsSubclassedControl - This is a subclassed control
-
-BOOL CaxAnxOggPlayerCtrl::IsSubclassedControl()
-{
- return TRUE;
-}
-
-
-
-// CaxAnxOggPlayerCtrl::OnOcmCommand - Handle command messages
-
-LRESULT CaxAnxOggPlayerCtrl::OnOcmCommand(WPARAM wParam, LPARAM lParam)
-{
-#ifdef _WIN32
- WORD wNotifyCode = HIWORD(wParam);
-#else
- WORD wNotifyCode = HIWORD(lParam);
-#endif
-
- // TODO: Switch on wNotifyCode here.
-
- return 0;
-}
-
-
-
-// CaxAnxOggPlayerCtrl message handlers
-
-int CaxAnxOggPlayerCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
-{
- debugLog<<"On create..."<<endl;
- if (COleControl::OnCreate(lpCreateStruct) == -1)
- return -1;
-
-
- // TODO: Add your specialized creation code here
- mDialog.Create(IDD_DIALOG1, this);
- mDialog.ShowWindow(TRUE);
-
-
- IServiceProvider* locISP = NULL;
- IWebBrowser2* locBrowser = NULL;
-
- HRESULT locHR = GetClientSite()->QueryInterface(IID_IServiceProvider, (void **)&locISP);
- if (locHR == S_OK) {
- locHR = locISP->QueryService(IID_IWebBrowserApp, IID_IWebBrowser2, (void **)&locBrowser);
- if (locHR == S_OK) {
- mDialog.setBrowser(locBrowser);
-
- }
- locISP->Release();
- }
- return 0;
-}
+// axAnxOggPlayerCtrl.cpp : Implementation of the CaxAnxOggPlayerCtrl ActiveX Control class.
+
+#include "stdafx.h"
+#include "axAnxOggPlayer.h"
+#include "axAnxOggPlayerCtrl.h"
+#include "axAnxOggPlayerPropPage.h"
+#include ".\axanxoggplayerctrl.h"
+
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#endif
+
+
+IMPLEMENT_DYNCREATE(CaxAnxOggPlayerCtrl, COleControl)
+
+
+
+// Message map
+
+BEGIN_MESSAGE_MAP(CaxAnxOggPlayerCtrl, COleControl)
+ ON_MESSAGE(OCM_COMMAND, OnOcmCommand)
+ ON_OLEVERB(AFX_IDS_VERB_PROPERTIES, OnProperties)
+ ON_WM_CREATE()
+END_MESSAGE_MAP()
+
+
+
+// Dispatch map
+
+BEGIN_DISPATCH_MAP(CaxAnxOggPlayerCtrl, COleControl)
+ DISP_FUNCTION_ID(CaxAnxOggPlayerCtrl, "AboutBox", DISPID_ABOUTBOX, AboutBox, VT_EMPTY, VTS_NONE)
+END_DISPATCH_MAP()
+
+
+
+// Event map
+
+BEGIN_EVENT_MAP(CaxAnxOggPlayerCtrl, COleControl)
+END_EVENT_MAP()
+
+
+
+// Property pages
+
+// TODO: Add more property pages as needed. Remember to increase the count!
+BEGIN_PROPPAGEIDS(CaxAnxOggPlayerCtrl, 1)
+ PROPPAGEID(CaxAnxOggPlayerPropPage::guid)
+END_PROPPAGEIDS(CaxAnxOggPlayerCtrl)
+
+
+
+// Initialize class factory and guid
+
+IMPLEMENT_OLECREATE_EX(CaxAnxOggPlayerCtrl, "AXANXOGGPLAYER.axAnxOggPlayerCtrl.1",
+ 0x9b80daa5, 0xbcfa, 0x44f8, 0xb2, 0xaa, 0xb2, 0xec, 0xf8, 0x6, 0x2, 0xa1)
+
+
+
+// Type library ID and version
+
+IMPLEMENT_OLETYPELIB(CaxAnxOggPlayerCtrl, _tlid, _wVerMajor, _wVerMinor)
+
+
+
+// Interface IDs
+
+const IID BASED_CODE IID_DaxAnxOggPlayer =
+ { 0xB878657F, 0xFA23, 0x4915, { 0x8E, 0x80, 0x66, 0x64, 0xF1, 0x73, 0x8B, 0xEF } };
+const IID BASED_CODE IID_DaxAnxOggPlayerEvents =
+ { 0x380DE0F9, 0x5B8, 0x4D01, { 0x92, 0x21, 0xC6, 0x48, 0xBC, 0x43, 0x24, 0x23 } };
+
+
+
+// Control type information
+
+static const DWORD BASED_CODE _dwaxAnxOggPlayerOleMisc =
+ OLEMISC_ACTIVATEWHENVISIBLE |
+ OLEMISC_SETCLIENTSITEFIRST |
+ OLEMISC_INSIDEOUT |
+ OLEMISC_CANTLINKINSIDE |
+ OLEMISC_RECOMPOSEONRESIZE;
+
+IMPLEMENT_OLECTLTYPE(CaxAnxOggPlayerCtrl, IDS_AXANXOGGPLAYER, _dwaxAnxOggPlayerOleMisc)
+
+
+
+// CaxAnxOggPlayerCtrl::CaxAnxOggPlayerCtrlFactory::UpdateRegistry -
+// Adds or removes system registry entries for CaxAnxOggPlayerCtrl
+
+BOOL CaxAnxOggPlayerCtrl::CaxAnxOggPlayerCtrlFactory::UpdateRegistry(BOOL bRegister)
+{
+ // TODO: Verify that your control follows apartment-model threading rules.
+ // Refer to MFC TechNote 64 for more information.
+ // If your control does not conform to the apartment-model rules, then
+ // you must modify the code below, changing the 6th parameter from
+ // afxRegApartmentThreading to 0.
+
+ if (bRegister)
+ return AfxOleRegisterControlClass(
+ AfxGetInstanceHandle(),
+ m_clsid,
+ m_lpszProgID,
+ IDS_AXANXOGGPLAYER,
+ IDB_AXANXOGGPLAYER,
+ afxRegApartmentThreading,
+ _dwaxAnxOggPlayerOleMisc,
+ _tlid,
+ _wVerMajor,
+ _wVerMinor);
+ else
+ return AfxOleUnregisterClass(m_clsid, m_lpszProgID);
+}
+
+
+
+// CaxAnxOggPlayerCtrl::CaxAnxOggPlayerCtrl - Constructor
+
+CaxAnxOggPlayerCtrl::CaxAnxOggPlayerCtrl()
+{
+ InitializeIIDs(&IID_DaxAnxOggPlayer, &IID_DaxAnxOggPlayerEvents);
+ // TODO: Initialize your control's instance data here.
+ debugLog.open("G:\\logs\\ax_cntrol.log", ios_base::out);
+ debugLog<<"Control activated..."<<endl;
+}
+
+
+
+// CaxAnxOggPlayerCtrl::~CaxAnxOggPlayerCtrl - Destructor
+
+CaxAnxOggPlayerCtrl::~CaxAnxOggPlayerCtrl()
+{
+ // TODO: Cleanup your control's instance data here.
+}
+
+
+
+// CaxAnxOggPlayerCtrl::OnDraw - Drawing function
+
+void CaxAnxOggPlayerCtrl::OnDraw(
+ CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid)
+{
+ if (!pdc)
+ return;
+
+ DoSuperclassPaint(pdc, rcBounds);
+}
+
+
+
+// CaxAnxOggPlayerCtrl::DoPropExchange - Persistence support
+
+void CaxAnxOggPlayerCtrl::DoPropExchange(CPropExchange* pPX)
+{
+ ExchangeVersion(pPX, MAKELONG(_wVerMinor, _wVerMajor));
+ COleControl::DoPropExchange(pPX);
+
+ // TODO: Call PX_ functions for each persistent custom property.
+}
+
+
+
+// CaxAnxOggPlayerCtrl::OnResetState - Reset control to default state
+
+void CaxAnxOggPlayerCtrl::OnResetState()
+{
+ COleControl::OnResetState(); // Resets defaults found in DoPropExchange
+
+ // TODO: Reset any other control state here.
+}
+
+
+
+// CaxAnxOggPlayerCtrl::AboutBox - Display an "About" box to the user
+
+void CaxAnxOggPlayerCtrl::AboutBox()
+{
+ CDialog dlgAbout(IDD_ABOUTBOX_AXANXOGGPLAYER);
+ dlgAbout.DoModal();
+}
+
+
+
+// CaxAnxOggPlayerCtrl::PreCreateWindow - Modify parameters for CreateWindowEx
+
+BOOL CaxAnxOggPlayerCtrl::PreCreateWindow(CREATESTRUCT& cs)
+{
+ debugLog<<"Pre create..."<<endl;
+ cs.lpszClass = _T("STATIC");
+ return COleControl::PreCreateWindow(cs);
+}
+
+
+
+// CaxAnxOggPlayerCtrl::IsSubclassedControl - This is a subclassed control
+
+BOOL CaxAnxOggPlayerCtrl::IsSubclassedControl()
+{
+ return TRUE;
+}
+
+
+
+// CaxAnxOggPlayerCtrl::OnOcmCommand - Handle command messages
+
+LRESULT CaxAnxOggPlayerCtrl::OnOcmCommand(WPARAM wParam, LPARAM lParam)
+{
+#ifdef _WIN32
+ WORD wNotifyCode = HIWORD(wParam);
+#else
+ WORD wNotifyCode = HIWORD(lParam);
+#endif
+
+ // TODO: Switch on wNotifyCode here.
+
+ return 0;
+}
+
+
+
+// CaxAnxOggPlayerCtrl message handlers
+
+int CaxAnxOggPlayerCtrl::OnCreate(LPCREATESTRUCT lpCreateStruct)
+{
+ debugLog<<"On create..."<<endl;
+ if (COleControl::OnCreate(lpCreateStruct) == -1)
+ return -1;
+
+
+ // TODO: Add your specialized creation code here
+ mDialog.Create(IDD_DIALOG1, this);
+ mDialog.ShowWindow(TRUE);
+
+
+ IServiceProvider* locISP = NULL;
+ IWebBrowser2* locBrowser = NULL;
+
+ HRESULT locHR = GetClientSite()->QueryInterface(IID_IServiceProvider, (void **)&locISP);
+ if (locHR == S_OK) {
+ locHR = locISP->QueryService(IID_IWebBrowserApp, IID_IWebBrowser2, (void **)&locBrowser);
+ if (locHR == S_OK) {
+ mDialog.setBrowser(locBrowser);
+
+ }
+ locISP->Release();
+ }
+ return 0;
+}
Property changes on: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayerCtrl.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayerCtrl.h
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayerCtrl.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayerCtrl.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,61 +1,61 @@
-#pragma once
-#include "controldialog.h"
-#include <fstream>
-
-using namespace std;
-
-// axAnxOggPlayerCtrl.h : Declaration of the CaxAnxOggPlayerCtrl ActiveX Control class.
-
-
-// CaxAnxOggPlayerCtrl : See axAnxOggPlayerCtrl.cpp for implementation.
-
-class CaxAnxOggPlayerCtrl : public COleControl
-{
- DECLARE_DYNCREATE(CaxAnxOggPlayerCtrl)
-
-// Constructor
-public:
- CaxAnxOggPlayerCtrl();
-
-// Overrides
-public:
- virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
- virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
- virtual void DoPropExchange(CPropExchange* pPX);
- virtual void OnResetState();
-
-// Implementation
-protected:
- ~CaxAnxOggPlayerCtrl();
-
- DECLARE_OLECREATE_EX(CaxAnxOggPlayerCtrl) // Class factory and guid
- DECLARE_OLETYPELIB(CaxAnxOggPlayerCtrl) // GetTypeInfo
- DECLARE_PROPPAGEIDS(CaxAnxOggPlayerCtrl) // Property page IDs
- DECLARE_OLECTLTYPE(CaxAnxOggPlayerCtrl) // Type name and misc status
-
- // Subclassed control support
- BOOL IsSubclassedControl();
- LRESULT OnOcmCommand(WPARAM wParam, LPARAM lParam);
-
-// Message maps
- DECLARE_MESSAGE_MAP()
-
-// Dispatch maps
- DECLARE_DISPATCH_MAP()
-
- afx_msg void AboutBox();
-
-// Event maps
- DECLARE_EVENT_MAP()
-
-// Dispatch and event IDs
-public:
- enum {
- };
-protected:
- CControlDialog mDialog;
- fstream debugLog;
-public:
- afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
-};
-
+#pragma once
+#include "controldialog.h"
+#include <fstream>
+
+using namespace std;
+
+// axAnxOggPlayerCtrl.h : Declaration of the CaxAnxOggPlayerCtrl ActiveX Control class.
+
+
+// CaxAnxOggPlayerCtrl : See axAnxOggPlayerCtrl.cpp for implementation.
+
+class CaxAnxOggPlayerCtrl : public COleControl
+{
+ DECLARE_DYNCREATE(CaxAnxOggPlayerCtrl)
+
+// Constructor
+public:
+ CaxAnxOggPlayerCtrl();
+
+// Overrides
+public:
+ virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
+ virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
+ virtual void DoPropExchange(CPropExchange* pPX);
+ virtual void OnResetState();
+
+// Implementation
+protected:
+ ~CaxAnxOggPlayerCtrl();
+
+ DECLARE_OLECREATE_EX(CaxAnxOggPlayerCtrl) // Class factory and guid
+ DECLARE_OLETYPELIB(CaxAnxOggPlayerCtrl) // GetTypeInfo
+ DECLARE_PROPPAGEIDS(CaxAnxOggPlayerCtrl) // Property page IDs
+ DECLARE_OLECTLTYPE(CaxAnxOggPlayerCtrl) // Type name and misc status
+
+ // Subclassed control support
+ BOOL IsSubclassedControl();
+ LRESULT OnOcmCommand(WPARAM wParam, LPARAM lParam);
+
+// Message maps
+ DECLARE_MESSAGE_MAP()
+
+// Dispatch maps
+ DECLARE_DISPATCH_MAP()
+
+ afx_msg void AboutBox();
+
+// Event maps
+ DECLARE_EVENT_MAP()
+
+// Dispatch and event IDs
+public:
+ enum {
+ };
+protected:
+ CControlDialog mDialog;
+ fstream debugLog;
+public:
+ afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
+};
+
Property changes on: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayerCtrl.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayerPropPage.cpp
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayerPropPage.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayerPropPage.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,62 +1,62 @@
-// axAnxOggPlayerPropPage.cpp : Implementation of the CaxAnxOggPlayerPropPage property page class.
-
-#include "stdafx.h"
-#include "axAnxOggPlayer.h"
-#include "axAnxOggPlayerPropPage.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#endif
-
-
-IMPLEMENT_DYNCREATE(CaxAnxOggPlayerPropPage, COlePropertyPage)
-
-
-
-// Message map
-
-BEGIN_MESSAGE_MAP(CaxAnxOggPlayerPropPage, COlePropertyPage)
-END_MESSAGE_MAP()
-
-
-
-// Initialize class factory and guid
-
-IMPLEMENT_OLECREATE_EX(CaxAnxOggPlayerPropPage, "AXANXOGGPLAYER.axAnxOggPlayerPropPage.1",
- 0x82de93ec, 0x2644, 0x4b7f, 0xa9, 0xde, 0x37, 0x85, 0x83, 0x46, 0x36, 0x3e)
-
-
-
-// CaxAnxOggPlayerPropPage::CaxAnxOggPlayerPropPageFactory::UpdateRegistry -
-// Adds or removes system registry entries for CaxAnxOggPlayerPropPage
-
-BOOL CaxAnxOggPlayerPropPage::CaxAnxOggPlayerPropPageFactory::UpdateRegistry(BOOL bRegister)
-{
- if (bRegister)
- return AfxOleRegisterPropertyPageClass(AfxGetInstanceHandle(),
- m_clsid, IDS_AXANXOGGPLAYER_PPG);
- else
- return AfxOleUnregisterClass(m_clsid, NULL);
-}
-
-
-
-// CaxAnxOggPlayerPropPage::CaxAnxOggPlayerPropPage - Constructor
-
-CaxAnxOggPlayerPropPage::CaxAnxOggPlayerPropPage() :
- COlePropertyPage(IDD, IDS_AXANXOGGPLAYER_PPG_CAPTION)
-{
-}
-
-
-
-// CaxAnxOggPlayerPropPage::DoDataExchange - Moves data between page and properties
-
-void CaxAnxOggPlayerPropPage::DoDataExchange(CDataExchange* pDX)
-{
- DDP_PostProcessing(pDX);
-}
-
-
-
-// CaxAnxOggPlayerPropPage message handlers
+// axAnxOggPlayerPropPage.cpp : Implementation of the CaxAnxOggPlayerPropPage property page class.
+
+#include "stdafx.h"
+#include "axAnxOggPlayer.h"
+#include "axAnxOggPlayerPropPage.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#endif
+
+
+IMPLEMENT_DYNCREATE(CaxAnxOggPlayerPropPage, COlePropertyPage)
+
+
+
+// Message map
+
+BEGIN_MESSAGE_MAP(CaxAnxOggPlayerPropPage, COlePropertyPage)
+END_MESSAGE_MAP()
+
+
+
+// Initialize class factory and guid
+
+IMPLEMENT_OLECREATE_EX(CaxAnxOggPlayerPropPage, "AXANXOGGPLAYER.axAnxOggPlayerPropPage.1",
+ 0x82de93ec, 0x2644, 0x4b7f, 0xa9, 0xde, 0x37, 0x85, 0x83, 0x46, 0x36, 0x3e)
+
+
+
+// CaxAnxOggPlayerPropPage::CaxAnxOggPlayerPropPageFactory::UpdateRegistry -
+// Adds or removes system registry entries for CaxAnxOggPlayerPropPage
+
+BOOL CaxAnxOggPlayerPropPage::CaxAnxOggPlayerPropPageFactory::UpdateRegistry(BOOL bRegister)
+{
+ if (bRegister)
+ return AfxOleRegisterPropertyPageClass(AfxGetInstanceHandle(),
+ m_clsid, IDS_AXANXOGGPLAYER_PPG);
+ else
+ return AfxOleUnregisterClass(m_clsid, NULL);
+}
+
+
+
+// CaxAnxOggPlayerPropPage::CaxAnxOggPlayerPropPage - Constructor
+
+CaxAnxOggPlayerPropPage::CaxAnxOggPlayerPropPage() :
+ COlePropertyPage(IDD, IDS_AXANXOGGPLAYER_PPG_CAPTION)
+{
+}
+
+
+
+// CaxAnxOggPlayerPropPage::DoDataExchange - Moves data between page and properties
+
+void CaxAnxOggPlayerPropPage::DoDataExchange(CDataExchange* pDX)
+{
+ DDP_PostProcessing(pDX);
+}
+
+
+
+// CaxAnxOggPlayerPropPage message handlers
Property changes on: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayerPropPage.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayerPropPage.h
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayerPropPage.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayerPropPage.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,28 +1,28 @@
-#pragma once
-
-// axAnxOggPlayerPropPage.h : Declaration of the CaxAnxOggPlayerPropPage property page class.
-
-
-// CaxAnxOggPlayerPropPage : See axAnxOggPlayerPropPage.cpp for implementation.
-
-class CaxAnxOggPlayerPropPage : public COlePropertyPage
-{
- DECLARE_DYNCREATE(CaxAnxOggPlayerPropPage)
- DECLARE_OLECREATE_EX(CaxAnxOggPlayerPropPage)
-
-// Constructor
-public:
- CaxAnxOggPlayerPropPage();
-
-// Dialog Data
- enum { IDD = IDD_PROPPAGE_AXANXOGGPLAYER };
-
-// Implementation
-protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
-
-// Message maps
-protected:
- DECLARE_MESSAGE_MAP()
-};
-
+#pragma once
+
+// axAnxOggPlayerPropPage.h : Declaration of the CaxAnxOggPlayerPropPage property page class.
+
+
+// CaxAnxOggPlayerPropPage : See axAnxOggPlayerPropPage.cpp for implementation.
+
+class CaxAnxOggPlayerPropPage : public COlePropertyPage
+{
+ DECLARE_DYNCREATE(CaxAnxOggPlayerPropPage)
+ DECLARE_OLECREATE_EX(CaxAnxOggPlayerPropPage)
+
+// Constructor
+public:
+ CaxAnxOggPlayerPropPage();
+
+// Dialog Data
+ enum { IDD = IDD_PROPPAGE_AXANXOGGPLAYER };
+
+// Implementation
+protected:
+ virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
+
+// Message maps
+protected:
+ DECLARE_MESSAGE_MAP()
+};
+
Property changes on: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/axAnxOggPlayerPropPage.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,5 +1,5 @@
-// stdafx.cpp : source file that includes just the standard includes
-// axAnxOggPlayer.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
+// stdafx.cpp : source file that includes just the standard includes
+// axAnxOggPlayer.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
Property changes on: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/stdafx.h
===================================================================
--- trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,44 +1,44 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently,
-// but are changed infrequently
-
-#pragma once
-
-#ifndef VC_EXTRALEAN
-#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
-#endif
-
-// Modify the following defines if you have to target a platform prior to the ones specified below.
-// Refer to MSDN for the latest info on corresponding values for different platforms.
-#ifndef WINVER // Allow use of features specific to Windows 95 and Windows NT 4 or later.
-#define WINVER 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
-#endif
-
-#ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later.
-#define _WIN32_WINNT 0x0400 // Change this to the appropriate value to target Windows 2000 or later.
-#endif
-
-#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
-#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
-#endif
-
-#ifndef _WIN32_IE // Allow use of features specific to IE 4.0 or later.
-#define _WIN32_IE 0x0400 // Change this to the appropriate value to target IE 5.0 or later.
-#endif
-
-#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
-
-#include <afxctl.h> // MFC support for ActiveX Controls
-#include <afxext.h> // MFC extensions
-#include <afxdtctl.h> // MFC support for Internet Explorer 4 Comon Controls
-#ifndef _AFX_NO_AFXCMN_SUPPORT
-#include <afxcmn.h> // MFC support for Windows Common Controls
-#endif // _AFX_NO_AFXCMN_SUPPORT
-
-// Delete the two includes below if you do not wish to use the MFC
-// database classes
-#include <afxdb.h> // MFC database classes
-#include <afxdao.h> // MFC DAO database classes
-#include <afxwin.h>
-
-
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently,
+// but are changed infrequently
+
+#pragma once
+
+#ifndef VC_EXTRALEAN
+#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
+#endif
+
+// Modify the following defines if you have to target a platform prior to the ones specified below.
+// Refer to MSDN for the latest info on corresponding values for different platforms.
+#ifndef WINVER // Allow use of features specific to Windows 95 and Windows NT 4 or later.
+#define WINVER 0x0400 // Change this to the appropriate value to target Windows 98 and Windows 2000 or later.
+#endif
+
+#ifndef _WIN32_WINNT // Allow use of features specific to Windows NT 4 or later.
+#define _WIN32_WINNT 0x0400 // Change this to the appropriate value to target Windows 2000 or later.
+#endif
+
+#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
+#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
+#endif
+
+#ifndef _WIN32_IE // Allow use of features specific to IE 4.0 or later.
+#define _WIN32_IE 0x0400 // Change this to the appropriate value to target IE 5.0 or later.
+#endif
+
+#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
+
+#include <afxctl.h> // MFC support for ActiveX Controls
+#include <afxext.h> // MFC extensions
+#include <afxdtctl.h> // MFC support for Internet Explorer 4 Comon Controls
+#ifndef _AFX_NO_AFXCMN_SUPPORT
+#include <afxcmn.h> // MFC support for Windows Common Controls
+#endif // _AFX_NO_AFXCMN_SUPPORT
+
+// Delete the two includes below if you do not wish to use the MFC
+// database classes
+#include <afxdb.h> // MFC database classes
+#include <afxdao.h> // MFC DAO database classes
+#include <afxwin.h>
+
+
Property changes on: trunk/oggdsf/src/lib/plugin/axAnxOggPlayer/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testCDROM/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/tests/testCDROM/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testCDROM/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// testCDROM.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// testCDROM.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/tests/testCDROM/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testCDROM/stdafx.h
===================================================================
--- trunk/oggdsf/src/tests/testCDROM/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testCDROM/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,19 +1,19 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-#include <stdio.h>
-#include <tchar.h>
-
-// TODO: reference additional headers your program requires here
-#include <windows.h>
-
-#ifdef LIBCDROM_EXPORTS
-#define LIBCDROM_API __declspec(dllexport)
-#else
-#define LIBCDROM_API __declspec(dllimport)
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+#include <stdio.h>
+#include <tchar.h>
+
+// TODO: reference additional headers your program requires here
+#include <windows.h>
+
+#ifdef LIBCDROM_EXPORTS
+#define LIBCDROM_API __declspec(dllexport)
+#else
+#define LIBCDROM_API __declspec(dllimport)
#endif
\ No newline at end of file
Property changes on: trunk/oggdsf/src/tests/testCDROM/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testCDROM/testCDROM.cpp
===================================================================
--- trunk/oggdsf/src/tests/testCDROM/testCDROM.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testCDROM/testCDROM.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,59 +1,59 @@
-// testCDROM.cpp : Defines the entry point for the console application.
-//
-
-
-
-#include "stdafx.h"
-#include "CDROM.h"
-#include <string>
-#include <iostream>
-using namespace std;
-int __cdecl _tmain(int argc, _TCHAR* argv[])
-{
- CDROM testCD;
-
- string locDrive = "h:";
- int locRes = testCD.initDrive(locDrive);
-
- locRes = testCD.readTOC();
-
- CDROM_TOC* locTOC = testCD.getTOC();
-
- cout<<"Drive "<<locDrive<<endl;
- cout<<"Header Length - "<< locTOC->Length<<endl;
- cout<<"Num Tracks - "<<locTOC->LastTrack - locTOC->FirstTrack<<endl;
- DISK_GEOMETRY* locGeom = testCD.getDiskGeom();
-
-
- cout<<"---------------------------"<<endl;
- cout<<"Bytes/Sector - "<<locGeom->BytesPerSector<<endl;
- cout<<"Num. Cyylinders- "<<locGeom->Cylinders.QuadPart<<endl;
- cout<<"Sectors/Track - "<<locGeom->SectorsPerTrack<<endl;
- cout<<"Track/Cyl - "<<locGeom->TracksPerCylinder<<endl;
- cout<<"Media type - "<<locGeom->MediaType<<endl;
- cout<<"---------------------------"<<endl;
-
- unsigned long locAddress = 0;
- for (int i = locTOC->FirstTrack - 1; i < locTOC->LastTrack; i++) {
- cout<<"Track "<<i+1<<endl;
- cout<<"======="<<endl;
- locAddress = 0;
- for (int j = 0; j < 4; j++) {
- locAddress <<= 8;
- locAddress += locTOC->TrackData[i].Address[j];
-
- }
- cout<<"Adress - "<<locAddress<<endl;
- cout<<"Adr - "<<(int)locTOC->TrackData[i].Adr<<endl;
- cout<<"Control - "<<(int)locTOC->TrackData[i].Control<<endl;
- cout<<"Track No - "<<(int)locTOC->TrackData[i].TrackNumber<<endl<<endl;
- }
-
-
-
- int x;
- cin >> x;
-
- return 0;
-}
-
+// testCDROM.cpp : Defines the entry point for the console application.
+//
+
+
+
+#include "stdafx.h"
+#include "CDROM.h"
+#include <string>
+#include <iostream>
+using namespace std;
+int __cdecl _tmain(int argc, _TCHAR* argv[])
+{
+ CDROM testCD;
+
+ string locDrive = "h:";
+ int locRes = testCD.initDrive(locDrive);
+
+ locRes = testCD.readTOC();
+
+ CDROM_TOC* locTOC = testCD.getTOC();
+
+ cout<<"Drive "<<locDrive<<endl;
+ cout<<"Header Length - "<< locTOC->Length<<endl;
+ cout<<"Num Tracks - "<<locTOC->LastTrack - locTOC->FirstTrack<<endl;
+ DISK_GEOMETRY* locGeom = testCD.getDiskGeom();
+
+
+ cout<<"---------------------------"<<endl;
+ cout<<"Bytes/Sector - "<<locGeom->BytesPerSector<<endl;
+ cout<<"Num. Cyylinders- "<<locGeom->Cylinders.QuadPart<<endl;
+ cout<<"Sectors/Track - "<<locGeom->SectorsPerTrack<<endl;
+ cout<<"Track/Cyl - "<<locGeom->TracksPerCylinder<<endl;
+ cout<<"Media type - "<<locGeom->MediaType<<endl;
+ cout<<"---------------------------"<<endl;
+
+ unsigned long locAddress = 0;
+ for (int i = locTOC->FirstTrack - 1; i < locTOC->LastTrack; i++) {
+ cout<<"Track "<<i+1<<endl;
+ cout<<"======="<<endl;
+ locAddress = 0;
+ for (int j = 0; j < 4; j++) {
+ locAddress <<= 8;
+ locAddress += locTOC->TrackData[i].Address[j];
+
+ }
+ cout<<"Adress - "<<locAddress<<endl;
+ cout<<"Adr - "<<(int)locTOC->TrackData[i].Adr<<endl;
+ cout<<"Control - "<<(int)locTOC->TrackData[i].Control<<endl;
+ cout<<"Track No - "<<(int)locTOC->TrackData[i].TrackNumber<<endl<<endl;
+ }
+
+
+
+ int x;
+ cin >> x;
+
+ return 0;
+}
+
Property changes on: trunk/oggdsf/src/tests/testCDROM/testCDROM.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testCMMLParser/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/tests/testCMMLParser/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testCMMLParser/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// testCMMLParser.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// testCMMLParser.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/tests/testCMMLParser/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testCMMLParser/stdafx.h
===================================================================
--- trunk/oggdsf/src/tests/testCMMLParser/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testCMMLParser/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,12 +1,12 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-#include <iostream>
-#include <tchar.h>
-
-// TODO: reference additional headers your program requires here
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#include <iostream>
+#include <tchar.h>
+
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/tests/testCMMLParser/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testCMMLParser/testCMMLParser.cpp
===================================================================
--- trunk/oggdsf/src/tests/testCMMLParser/testCMMLParser.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testCMMLParser/testCMMLParser.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,168 +1,168 @@
-// testCMMLParser.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-
-#include "libCMMLTags.h"
-
-#include "libWinCMMLParse.h"
-#include "CMMLParser.h"
-
-
-bool testHeadParse(wstring inHeadString) {
- CMMLParser locParser;
-
- wcout << "Original"<<endl<<inHeadString<<endl<<endl;
-
- C_HeadTag locHead;
-
- bool locWasOK = locParser.parseHeadTag(inHeadString, &locHead);
-
- if (locWasOK) {
- wcout<<"Parsed OK"<<endl<<endl<<locHead.toString()<<endl<<endl;
- } else {
- wcout<<"*** PARSE FAILED ***"<<endl<<endl;
- }
-
- return locWasOK;
-}
-
-bool testClipParse(wstring inClipString) {
- CMMLParser locParser;
-
- wcout << "Original"<<endl<<inClipString<<endl<<endl;
-
- C_ClipTag locClip;
-
- bool locWasOK = locParser.parseClipTag(inClipString, &locClip);
-
- if (locWasOK) {
- wcout<<"Parsed OK"<<endl<<endl<<locClip.toString()<<endl<<endl;
- } else {
- wcout<<"*** PARSE FAILED ***"<<endl<<endl;
- }
-
- return locWasOK;
-}
-
-bool testCMMLRootParse(wstring inCMMLRootString) {
- CMMLParser locParser;
-
- wcout << "Original"<<endl<<inCMMLRootString<<endl<<endl;
-
- C_CMMLRootTag locCMMLRoot;
-
- bool locWasOK = locParser.parseCMMLRootTag(inCMMLRootString, &locCMMLRoot);
-
- if (locWasOK) {
- wcout<<"Parsed OK"<<endl<<endl<<locCMMLRoot.toString()<<endl<<endl;
- } else {
- wcout<<"*** PARSE FAILED ***"<<endl<<endl;
- }
-
- return locWasOK;
-
-}
-
-bool testCMMLFileParse(wstring inFilename) {
- CMMLParser locParser;
-
- C_CMMLDoc locDoc;
- bool locWasOK = locParser.parseDocFromFile(inFilename, &locDoc);
-
- wcout<<"Trying to parse "<<inFilename<<endl;
-
- if (locWasOK) {
- wcout<<locDoc.toString()<<endl;
- } else {
- wcout<<"*** PARSE FAILED ***"<<endl;
- }
-
- return locWasOK;
-
-}
-
-int __cdecl _tmain(int argc, _TCHAR* argv[])
-{
- //Valid minimal
- wstring head_1 = L"<head><title>Types of fish</title><meta name=\"Producer\" content=\"Joe Ordinary\"/><meta name=\"DC.Author\" content=\"Joe's friend\"/></head>";
- testHeadParse(head_1);
-
- //INVALID: Random data
- wstring head_2 = L"asdfasdfasdfasdf";
- testHeadParse(head_2);
-
- //INVALID: Valid xml, invalid cmml
- wstring head_3 = L"<blue><red>random stuff</red><green>But still valid XML</green></blue>";
- testHeadParse(head_3);
-
- //INVALID: No title tag
- wstring head_4 = L"<head><meta name=\"Producer\" content=\"Joe Ordinary\"/><meta name=\"DC.Author\" content=\"Joe's friend\"/></head>";
- testHeadParse(head_4);
-
- //Valid use most
- wstring head_5 = L"<head id=\"headID\" lang=\"en\" dir=\"ltr\" profile=\"some profile\"><base href=\"http://baseurl.com\"/><title lang=\"fr\">Types of fish</title><meta name=\"Producer\" content=\"Joe Ordinary\" scheme=\"some scheme\"/><meta name=\"DC.Author\" content=\"Joe's friend\"/></head>";
- testHeadParse(head_5);
-
- //INVALID: Missing closing xml tag on option element.
- wstring head_6 = L"<head id=\"headID\" lang=\"en\" dir=\"ltr\" profile=\"some profile\"><base href=\"http://baseurl.com\"/><title lang=\"fr\">Types of fish</title><meta name=\"Producer\" content=\"Joe Ordinary\" scheme=\"some scheme\"/><meta name=\"DC.Author\" content=\"Joe's friend\"></head>";
- testHeadParse(head_6);
-
-
- //Valid minimal
- wstring clip_1 = L"<clip id=\"dolphin\" start=\"npt:3.5\" end=\"npt:5:5.9\"><img src=\"dolphin.jpg\"/><desc>Here, Joe caught sight of a dolphin in the ocean.</desc><meta name=\"Subject\" content=\"dolphin\"/></clip>";
- testClipParse(clip_1);
-
- //INVALID: Random data
- wstring clip_2 = L"asdjhaskdljfhksladf";
- testClipParse(clip_2);
-
- //INVALID: valid xml but invalid cmml
- wstring clip_3 = L"<blue><red>random stuff</red><green>But still valid XML</green></blue>";
- testClipParse(clip_3);
-
- //Valid
- wstring clip_4 = L"<clip id=\"dolphin\" lang=\"en\" start=\"npt:3.5\" end=\"npt:5:5.9\"><img alt=\"Picture of dolphin\" src=\"dolphin.jpg\"/><desc id=\"descID\" lang=\"fr\">Here, Joe caught sight of a dolphin in the ocean.</desc><meta name=\"Subject\" content=\"dolphin\"/></clip>";
- testClipParse(clip_4);
-
- //INVALID: Missing equals on href=
- wstring clip_5 = L"<clip id=\"dolphin\" start=\"npt:3.5\" end=\"npt:5:5.9\"><a href\"http:\\linktome.com\" class=\"someClass\">Random anchor text</a><img src=\"dolphin.jpg\"/><desc>Here, Joe caught sight of a dolphin in the ocean.</desc><meta name=\"Subject\" content=\"dolphin\"/></clip>";
- testClipParse(clip_5);
-
- //Valid
- wstring clip_6 = L"<clip id=\"dolphin\" start=\"npt:3.5\" end=\"npt:5:5.9\"><a href=\"http:\\linktome.com\" class=\"someClass\">Random anchor text</a><img src=\"dolphin.jpg\"/><desc>Here, Joe caught sight of a dolphin in the ocean.</desc><meta name=\"Subject\" content=\"dolphin\"/></clip>";
- testClipParse(clip_6);
-
-
- //Valid
- wstring cmml_1 = L"<cmml lang=\"en\"><head id=\"headID\" lang=\"en\" dir=\"ltr\" profile=\"some profile\"><base href=\"http://baseurl.com\"/><title lang=\"fr\">Types of fish</title><meta name=\"Producer\" content=\"Joe Ordinary\" scheme=\"some scheme\"/><meta name=\"DC.Author\" content=\"Joe's friend\"/></head><clip id=\"dolphin\" lang=\"en\" start=\"npt:3.5\" end=\"npt:5:5.9\"><img alt=\"Picture of dolphin\" src=\"dolphin.jpg\"/><desc id=\"descID\" lang=\"fr\">Here, Joe caught sight of a dolphin in the ocean.</desc><meta name=\"Subject\" content=\"dolphin\"/></clip></cmml>";
- testCMMLRootParse(cmml_1);
-
- //INVALID: No title
- wstring cmml_2 = L"<cmml lang=\"en\"><head id=\"headID\" lang=\"en\" dir=\"ltr\" profile=\"some profile\"><base href=\"http://baseurl.com\"/><meta name=\"Producer\" content=\"Joe Ordinary\" scheme=\"some scheme\"/><meta name=\"DC.Author\" content=\"Joe's friend\"/></head><clip id=\"dolphin\" lang=\"en\" start=\"npt:3.5\" end=\"npt:5:5.9\"><img alt=\"Picture of dolphin\" src=\"dolphin.jpg\"/><desc id=\"descID\" lang=\"fr\">Here, Joe caught sight of a dolphin in the ocean.</desc><meta name=\"Subject\" content=\"dolphin\"/></clip></cmml>";
- testCMMLRootParse(cmml_2);
-
- //INVALID: No head
- wstring cmml_3 = L"<cmml lang=\"en\"><clip id=\"dolphin\" lang=\"en\" start=\"npt:3.5\" end=\"npt:5:5.9\"><img alt=\"Picture of dolphin\" src=\"dolphin.jpg\"/><desc id=\"descID\" lang=\"fr\">Here, Joe caught sight of a dolphin in the ocean.</desc><meta name=\"Subject\" content=\"dolphin\"/></clip></cmml>";
- testCMMLRootParse(cmml_3);
-
- //INVALID: Random data
- wstring cmml_4 = L"asdfasd fasd fasdf ds ";
- testCMMLRootParse(cmml_4);
-
- //INVALID: valid xml but invalid cmml
- wstring cmml_5 = L"<blue><red>random stuff</red><green>But still valid XML</green></blue>";
- testCMMLRootParse(cmml_5);
-
- int x;
- cin>>x;
-
- wstring file_1 = L"testcmml.xml";
- testCMMLFileParse(file_1);
-
-
-
-
- return 0;
-}
-
+// testCMMLParser.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+
+#include "libCMMLTags.h"
+
+#include "libWinCMMLParse.h"
+#include "CMMLParser.h"
+
+
+bool testHeadParse(wstring inHeadString) {
+ CMMLParser locParser;
+
+ wcout << "Original"<<endl<<inHeadString<<endl<<endl;
+
+ C_HeadTag locHead;
+
+ bool locWasOK = locParser.parseHeadTag(inHeadString, &locHead);
+
+ if (locWasOK) {
+ wcout<<"Parsed OK"<<endl<<endl<<locHead.toString()<<endl<<endl;
+ } else {
+ wcout<<"*** PARSE FAILED ***"<<endl<<endl;
+ }
+
+ return locWasOK;
+}
+
+bool testClipParse(wstring inClipString) {
+ CMMLParser locParser;
+
+ wcout << "Original"<<endl<<inClipString<<endl<<endl;
+
+ C_ClipTag locClip;
+
+ bool locWasOK = locParser.parseClipTag(inClipString, &locClip);
+
+ if (locWasOK) {
+ wcout<<"Parsed OK"<<endl<<endl<<locClip.toString()<<endl<<endl;
+ } else {
+ wcout<<"*** PARSE FAILED ***"<<endl<<endl;
+ }
+
+ return locWasOK;
+}
+
+bool testCMMLRootParse(wstring inCMMLRootString) {
+ CMMLParser locParser;
+
+ wcout << "Original"<<endl<<inCMMLRootString<<endl<<endl;
+
+ C_CMMLRootTag locCMMLRoot;
+
+ bool locWasOK = locParser.parseCMMLRootTag(inCMMLRootString, &locCMMLRoot);
+
+ if (locWasOK) {
+ wcout<<"Parsed OK"<<endl<<endl<<locCMMLRoot.toString()<<endl<<endl;
+ } else {
+ wcout<<"*** PARSE FAILED ***"<<endl<<endl;
+ }
+
+ return locWasOK;
+
+}
+
+bool testCMMLFileParse(wstring inFilename) {
+ CMMLParser locParser;
+
+ C_CMMLDoc locDoc;
+ bool locWasOK = locParser.parseDocFromFile(inFilename, &locDoc);
+
+ wcout<<"Trying to parse "<<inFilename<<endl;
+
+ if (locWasOK) {
+ wcout<<locDoc.toString()<<endl;
+ } else {
+ wcout<<"*** PARSE FAILED ***"<<endl;
+ }
+
+ return locWasOK;
+
+}
+
+int __cdecl _tmain(int argc, _TCHAR* argv[])
+{
+ //Valid minimal
+ wstring head_1 = L"<head><title>Types of fish</title><meta name=\"Producer\" content=\"Joe Ordinary\"/><meta name=\"DC.Author\" content=\"Joe's friend\"/></head>";
+ testHeadParse(head_1);
+
+ //INVALID: Random data
+ wstring head_2 = L"asdfasdfasdfasdf";
+ testHeadParse(head_2);
+
+ //INVALID: Valid xml, invalid cmml
+ wstring head_3 = L"<blue><red>random stuff</red><green>But still valid XML</green></blue>";
+ testHeadParse(head_3);
+
+ //INVALID: No title tag
+ wstring head_4 = L"<head><meta name=\"Producer\" content=\"Joe Ordinary\"/><meta name=\"DC.Author\" content=\"Joe's friend\"/></head>";
+ testHeadParse(head_4);
+
+ //Valid use most
+ wstring head_5 = L"<head id=\"headID\" lang=\"en\" dir=\"ltr\" profile=\"some profile\"><base href=\"http://baseurl.com\"/><title lang=\"fr\">Types of fish</title><meta name=\"Producer\" content=\"Joe Ordinary\" scheme=\"some scheme\"/><meta name=\"DC.Author\" content=\"Joe's friend\"/></head>";
+ testHeadParse(head_5);
+
+ //INVALID: Missing closing xml tag on option element.
+ wstring head_6 = L"<head id=\"headID\" lang=\"en\" dir=\"ltr\" profile=\"some profile\"><base href=\"http://baseurl.com\"/><title lang=\"fr\">Types of fish</title><meta name=\"Producer\" content=\"Joe Ordinary\" scheme=\"some scheme\"/><meta name=\"DC.Author\" content=\"Joe's friend\"></head>";
+ testHeadParse(head_6);
+
+
+ //Valid minimal
+ wstring clip_1 = L"<clip id=\"dolphin\" start=\"npt:3.5\" end=\"npt:5:5.9\"><img src=\"dolphin.jpg\"/><desc>Here, Joe caught sight of a dolphin in the ocean.</desc><meta name=\"Subject\" content=\"dolphin\"/></clip>";
+ testClipParse(clip_1);
+
+ //INVALID: Random data
+ wstring clip_2 = L"asdjhaskdljfhksladf";
+ testClipParse(clip_2);
+
+ //INVALID: valid xml but invalid cmml
+ wstring clip_3 = L"<blue><red>random stuff</red><green>But still valid XML</green></blue>";
+ testClipParse(clip_3);
+
+ //Valid
+ wstring clip_4 = L"<clip id=\"dolphin\" lang=\"en\" start=\"npt:3.5\" end=\"npt:5:5.9\"><img alt=\"Picture of dolphin\" src=\"dolphin.jpg\"/><desc id=\"descID\" lang=\"fr\">Here, Joe caught sight of a dolphin in the ocean.</desc><meta name=\"Subject\" content=\"dolphin\"/></clip>";
+ testClipParse(clip_4);
+
+ //INVALID: Missing equals on href=
+ wstring clip_5 = L"<clip id=\"dolphin\" start=\"npt:3.5\" end=\"npt:5:5.9\"><a href\"http:\\linktome.com\" class=\"someClass\">Random anchor text</a><img src=\"dolphin.jpg\"/><desc>Here, Joe caught sight of a dolphin in the ocean.</desc><meta name=\"Subject\" content=\"dolphin\"/></clip>";
+ testClipParse(clip_5);
+
+ //Valid
+ wstring clip_6 = L"<clip id=\"dolphin\" start=\"npt:3.5\" end=\"npt:5:5.9\"><a href=\"http:\\linktome.com\" class=\"someClass\">Random anchor text</a><img src=\"dolphin.jpg\"/><desc>Here, Joe caught sight of a dolphin in the ocean.</desc><meta name=\"Subject\" content=\"dolphin\"/></clip>";
+ testClipParse(clip_6);
+
+
+ //Valid
+ wstring cmml_1 = L"<cmml lang=\"en\"><head id=\"headID\" lang=\"en\" dir=\"ltr\" profile=\"some profile\"><base href=\"http://baseurl.com\"/><title lang=\"fr\">Types of fish</title><meta name=\"Producer\" content=\"Joe Ordinary\" scheme=\"some scheme\"/><meta name=\"DC.Author\" content=\"Joe's friend\"/></head><clip id=\"dolphin\" lang=\"en\" start=\"npt:3.5\" end=\"npt:5:5.9\"><img alt=\"Picture of dolphin\" src=\"dolphin.jpg\"/><desc id=\"descID\" lang=\"fr\">Here, Joe caught sight of a dolphin in the ocean.</desc><meta name=\"Subject\" content=\"dolphin\"/></clip></cmml>";
+ testCMMLRootParse(cmml_1);
+
+ //INVALID: No title
+ wstring cmml_2 = L"<cmml lang=\"en\"><head id=\"headID\" lang=\"en\" dir=\"ltr\" profile=\"some profile\"><base href=\"http://baseurl.com\"/><meta name=\"Producer\" content=\"Joe Ordinary\" scheme=\"some scheme\"/><meta name=\"DC.Author\" content=\"Joe's friend\"/></head><clip id=\"dolphin\" lang=\"en\" start=\"npt:3.5\" end=\"npt:5:5.9\"><img alt=\"Picture of dolphin\" src=\"dolphin.jpg\"/><desc id=\"descID\" lang=\"fr\">Here, Joe caught sight of a dolphin in the ocean.</desc><meta name=\"Subject\" content=\"dolphin\"/></clip></cmml>";
+ testCMMLRootParse(cmml_2);
+
+ //INVALID: No head
+ wstring cmml_3 = L"<cmml lang=\"en\"><clip id=\"dolphin\" lang=\"en\" start=\"npt:3.5\" end=\"npt:5:5.9\"><img alt=\"Picture of dolphin\" src=\"dolphin.jpg\"/><desc id=\"descID\" lang=\"fr\">Here, Joe caught sight of a dolphin in the ocean.</desc><meta name=\"Subject\" content=\"dolphin\"/></clip></cmml>";
+ testCMMLRootParse(cmml_3);
+
+ //INVALID: Random data
+ wstring cmml_4 = L"asdfasd fasd fasdf ds ";
+ testCMMLRootParse(cmml_4);
+
+ //INVALID: valid xml but invalid cmml
+ wstring cmml_5 = L"<blue><red>random stuff</red><green>But still valid XML</green></blue>";
+ testCMMLRootParse(cmml_5);
+
+ int x;
+ cin>>x;
+
+ wstring file_1 = L"testcmml.xml";
+ testCMMLFileParse(file_1);
+
+
+
+
+ return 0;
+}
+
Property changes on: trunk/oggdsf/src/tests/testCMMLParser/testCMMLParser.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testCircleBuffer/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/tests/testCircleBuffer/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testCircleBuffer/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// testCircleBuffer.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// testCircleBuffer.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/tests/testCircleBuffer/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testCircleBuffer/stdafx.h
===================================================================
--- trunk/oggdsf/src/tests/testCircleBuffer/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testCircleBuffer/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,12 +1,12 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-#include <iostream>
-#include <tchar.h>
-
-// TODO: reference additional headers your program requires here
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#include <iostream>
+#include <tchar.h>
+
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/tests/testCircleBuffer/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testCircleBuffer/testCircleBuffer.cpp
===================================================================
--- trunk/oggdsf/src/tests/testCircleBuffer/testCircleBuffer.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testCircleBuffer/testCircleBuffer.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,89 +1,89 @@
-// testCircleBuffer.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-#include "CircularBuffer.h"
-
-#include <iostream>
-using namespace std;
-
-int __cdecl _tmain(int argc, _TCHAR* argv[])
-{
-
- int x;
- cin>>x;
- const int CIRC_BUFF_SIZE = 4000;
- const int LOC_BUFF_SIZE = 300;
-
- const int LOC_READ_BUFF_BIG_SIZE = 1000;
- const int LOC_READ_BUFF_SMALL_SIZE = 50;
- const int TIMES_TO_LOOP = 300;
- CircularBuffer* locCircBuf = new CircularBuffer(CIRC_BUFF_SIZE);
-
- unsigned char* locBuf = new unsigned char[LOC_BUFF_SIZE];
-
-
- cout<<"* Testing fill to limit"<<endl;
- unsigned long locNumWritten = 0;
- for (int i = 0; i < (CIRC_BUFF_SIZE/LOC_BUFF_SIZE) + 2; i++) {
- locNumWritten = locCircBuf->write(locBuf, LOC_BUFF_SIZE);
- if (locNumWritten == 0) {
- cout<<"Buffer full... Wrote 0"<<endl;
- } else {
- cout<<"Wrote "<<locNumWritten<<" bytes to buffer"<<endl;
- }
-
- cout<< "Space Left : "<<locCircBuf->spaceLeft()<<" --- Avail : "<<locCircBuf->numBytesAvail()<<endl;
- }
-
- locCircBuf->reset();
-
- cout<<"* Testing rolling alternate read write"<<endl;
-
- unsigned char* locReadBuf = new unsigned char[LOC_READ_BUFF_BIG_SIZE];
- unsigned long locNumRead = 0;
- locNumWritten = 0;
- //Assert buffersize > LOC_BUFF_SIZE
- //Assert buffersize > LOC_READ_BUFF_SMALL_SIZE
- //Assert buffersize > LOC_READ_BUFF_BIG_SIZE
-
- //buffersize = 0;
- for (int i = 0; i < TIMES_TO_LOOP; i++) {
-
- cout<<"Round : "<<i<<endl;
- locNumWritten = locCircBuf->write(locBuf, LOC_BUFF_SIZE);
- cout<<"Write attempted "<<LOC_BUFF_SIZE<<" got "<<locNumWritten<<endl;
- cout<<"Avail : "<<locCircBuf->numBytesAvail()<<" -- Space Left : "<<locCircBuf->spaceLeft()<<endl<<endl;
- //buffersize = LOC_BUFF_SIZE
-
- cout<<"** Short read test"<<endl;
- locNumRead = locCircBuf->read(locReadBuf, LOC_READ_BUFF_SMALL_SIZE);
- cout<<"Read attempted "<<LOC_READ_BUFF_SMALL_SIZE<<" got "<<locNumRead<<endl;
- cout<<"Avail : "<<locCircBuf->numBytesAvail()<<" -- Space Left : "<<locCircBuf->spaceLeft()<<endl<<endl;
- //buffersize = LOC_BUFF_SIZE - LOC_READ_BUFF_SMALL_SIZE
-
- locNumWritten = locCircBuf->write(locBuf, LOC_BUFF_SIZE);
- cout<<"Write attempted "<<LOC_BUFF_SIZE<<" got "<<locNumWritten<<endl;
- cout<<"Avail : "<<locCircBuf->numBytesAvail()<<" -- Space Left : "<<locCircBuf->spaceLeft()<<endl<<endl;
- //buffersize = (2 * LOC_BUFF_SIZE) - LOC_READ_BUFF_SMALL_SIZE
-
- cout<<"** Long read / Empty Buffer test"<<endl;
- locNumRead = locCircBuf->read(locReadBuf, LOC_READ_BUFF_BIG_SIZE);
- cout<<"Read attempted "<<LOC_READ_BUFF_BIG_SIZE<<" got "<<locNumRead<<endl;
- cout<<"Avail : "<<locCircBuf->numBytesAvail()<<" -- Space Left : "<<locCircBuf->spaceLeft()<<endl<<endl;
- //buffersize = (2 * LOC_BUFF_SIZE) - LOC_READ_BUFF_SMALL_SIZE - LOC_READ_BUFF_BIG_SIZE
-
- cout<<"** Read while empty test"<<endl;
- locNumRead = locCircBuf->read(locReadBuf, LOC_READ_BUFF_BIG_SIZE);
- cout<<"Read attempted "<<LOC_READ_BUFF_BIG_SIZE<<" got "<<locNumRead<<endl;
- cout<<"Avail : "<<locCircBuf->numBytesAvail()<<" -- Space Left : "<<locCircBuf->spaceLeft()<<endl<<endl;
- //buffersize = (2 * LOC_BUFF_SIZE) - LOC_READ_BUFF_SMALL_SIZE - (2 * LOC_READ_BUFF_BIG_SIZE)
-
- }
-
- delete locCircBuf;
- delete[] locBuf;
- delete[] locReadBuf;
- return 0;
-}
-
+// testCircleBuffer.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+#include "CircularBuffer.h"
+
+#include <iostream>
+using namespace std;
+
+int __cdecl _tmain(int argc, _TCHAR* argv[])
+{
+
+ int x;
+ cin>>x;
+ const int CIRC_BUFF_SIZE = 4000;
+ const int LOC_BUFF_SIZE = 300;
+
+ const int LOC_READ_BUFF_BIG_SIZE = 1000;
+ const int LOC_READ_BUFF_SMALL_SIZE = 50;
+ const int TIMES_TO_LOOP = 300;
+ CircularBuffer* locCircBuf = new CircularBuffer(CIRC_BUFF_SIZE);
+
+ unsigned char* locBuf = new unsigned char[LOC_BUFF_SIZE];
+
+
+ cout<<"* Testing fill to limit"<<endl;
+ unsigned long locNumWritten = 0;
+ for (int i = 0; i < (CIRC_BUFF_SIZE/LOC_BUFF_SIZE) + 2; i++) {
+ locNumWritten = locCircBuf->write(locBuf, LOC_BUFF_SIZE);
+ if (locNumWritten == 0) {
+ cout<<"Buffer full... Wrote 0"<<endl;
+ } else {
+ cout<<"Wrote "<<locNumWritten<<" bytes to buffer"<<endl;
+ }
+
+ cout<< "Space Left : "<<locCircBuf->spaceLeft()<<" --- Avail : "<<locCircBuf->numBytesAvail()<<endl;
+ }
+
+ locCircBuf->reset();
+
+ cout<<"* Testing rolling alternate read write"<<endl;
+
+ unsigned char* locReadBuf = new unsigned char[LOC_READ_BUFF_BIG_SIZE];
+ unsigned long locNumRead = 0;
+ locNumWritten = 0;
+ //Assert buffersize > LOC_BUFF_SIZE
+ //Assert buffersize > LOC_READ_BUFF_SMALL_SIZE
+ //Assert buffersize > LOC_READ_BUFF_BIG_SIZE
+
+ //buffersize = 0;
+ for (int i = 0; i < TIMES_TO_LOOP; i++) {
+
+ cout<<"Round : "<<i<<endl;
+ locNumWritten = locCircBuf->write(locBuf, LOC_BUFF_SIZE);
+ cout<<"Write attempted "<<LOC_BUFF_SIZE<<" got "<<locNumWritten<<endl;
+ cout<<"Avail : "<<locCircBuf->numBytesAvail()<<" -- Space Left : "<<locCircBuf->spaceLeft()<<endl<<endl;
+ //buffersize = LOC_BUFF_SIZE
+
+ cout<<"** Short read test"<<endl;
+ locNumRead = locCircBuf->read(locReadBuf, LOC_READ_BUFF_SMALL_SIZE);
+ cout<<"Read attempted "<<LOC_READ_BUFF_SMALL_SIZE<<" got "<<locNumRead<<endl;
+ cout<<"Avail : "<<locCircBuf->numBytesAvail()<<" -- Space Left : "<<locCircBuf->spaceLeft()<<endl<<endl;
+ //buffersize = LOC_BUFF_SIZE - LOC_READ_BUFF_SMALL_SIZE
+
+ locNumWritten = locCircBuf->write(locBuf, LOC_BUFF_SIZE);
+ cout<<"Write attempted "<<LOC_BUFF_SIZE<<" got "<<locNumWritten<<endl;
+ cout<<"Avail : "<<locCircBuf->numBytesAvail()<<" -- Space Left : "<<locCircBuf->spaceLeft()<<endl<<endl;
+ //buffersize = (2 * LOC_BUFF_SIZE) - LOC_READ_BUFF_SMALL_SIZE
+
+ cout<<"** Long read / Empty Buffer test"<<endl;
+ locNumRead = locCircBuf->read(locReadBuf, LOC_READ_BUFF_BIG_SIZE);
+ cout<<"Read attempted "<<LOC_READ_BUFF_BIG_SIZE<<" got "<<locNumRead<<endl;
+ cout<<"Avail : "<<locCircBuf->numBytesAvail()<<" -- Space Left : "<<locCircBuf->spaceLeft()<<endl<<endl;
+ //buffersize = (2 * LOC_BUFF_SIZE) - LOC_READ_BUFF_SMALL_SIZE - LOC_READ_BUFF_BIG_SIZE
+
+ cout<<"** Read while empty test"<<endl;
+ locNumRead = locCircBuf->read(locReadBuf, LOC_READ_BUFF_BIG_SIZE);
+ cout<<"Read attempted "<<LOC_READ_BUFF_BIG_SIZE<<" got "<<locNumRead<<endl;
+ cout<<"Avail : "<<locCircBuf->numBytesAvail()<<" -- Space Left : "<<locCircBuf->spaceLeft()<<endl<<endl;
+ //buffersize = (2 * LOC_BUFF_SIZE) - LOC_READ_BUFF_SMALL_SIZE - (2 * LOC_READ_BUFF_BIG_SIZE)
+
+ }
+
+ delete locCircBuf;
+ delete[] locBuf;
+ delete[] locReadBuf;
+ return 0;
+}
+
Property changes on: trunk/oggdsf/src/tests/testCircleBuffer/testCircleBuffer.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testLibOOOgg/OggPageFileWriter.cpp
===================================================================
--- trunk/oggdsf/src/tests/testLibOOOgg/OggPageFileWriter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testLibOOOgg/OggPageFileWriter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,22 +1,22 @@
-#include "StdAfx.h"
-#include ".\oggpagefilewriter.h"
-
-OggPageFileWriter::OggPageFileWriter(string inFileName)
-{
- mFile.open(inFileName.c_str(), ios_base::out|ios_base::binary);
-}
-
-OggPageFileWriter::~OggPageFileWriter(void)
-{
- mFile.close();
-}
-
-bool OggPageFileWriter::acceptOggPage(OggPage* inOggPage) {
-
- unsigned char* locPageBytes = inOggPage->createRawPageData();
- mFile.write((const char*) locPageBytes, inOggPage->pageSize());
-
- delete inOggPage;
- delete [] locPageBytes;
- return true;
+#include "StdAfx.h"
+#include ".\oggpagefilewriter.h"
+
+OggPageFileWriter::OggPageFileWriter(string inFileName)
+{
+ mFile.open(inFileName.c_str(), ios_base::out|ios_base::binary);
+}
+
+OggPageFileWriter::~OggPageFileWriter(void)
+{
+ mFile.close();
+}
+
+bool OggPageFileWriter::acceptOggPage(OggPage* inOggPage) {
+
+ unsigned char* locPageBytes = inOggPage->createRawPageData();
+ mFile.write((const char*) locPageBytes, inOggPage->pageSize());
+
+ delete inOggPage;
+ delete [] locPageBytes;
+ return true;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/tests/testLibOOOgg/OggPageFileWriter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testLibOOOgg/OggPageFileWriter.h
===================================================================
--- trunk/oggdsf/src/tests/testLibOOOgg/OggPageFileWriter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testLibOOOgg/OggPageFileWriter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,19 +1,19 @@
-#pragma once
-
-//#include "dllstuff.h"
-#include "libOOOgg.h"
-#include <fstream>
-using namespace std;
-//#include "IOggCallback.h"
-class OggPageFileWriter
- : public IOggCallback
-{
-public:
- OggPageFileWriter(string inFileName);
- ~OggPageFileWriter(void);
-
- virtual bool acceptOggPage(OggPage* inOggPage);
-
-protected:
- fstream mFile;
-};
+#pragma once
+
+//#include "dllstuff.h"
+#include "libOOOgg.h"
+#include <fstream>
+using namespace std;
+//#include "IOggCallback.h"
+class OggPageFileWriter
+ : public IOggCallback
+{
+public:
+ OggPageFileWriter(string inFileName);
+ ~OggPageFileWriter(void);
+
+ virtual bool acceptOggPage(OggPage* inOggPage);
+
+protected:
+ fstream mFile;
+};
Property changes on: trunk/oggdsf/src/tests/testLibOOOgg/OggPageFileWriter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPacketChecker.cpp
===================================================================
--- trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPacketChecker.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPacketChecker.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,58 +1,58 @@
-#include "StdAfx.h"
-#include ".\testpatternoggpacketchecker.h"
-
-TestPatternOggPacketChecker::TestPatternOggPacketChecker(void)
-{
-}
-
-TestPatternOggPacketChecker::~TestPatternOggPacketChecker(void)
-{
-}
-
-bool TestPatternOggPacketChecker::acceptStampedOggPacket(StampedOggPacket* inPacket)
-{
- unsigned long locPacketSize = inPacket->packetSize();
-
- const unsigned char* locPackBuff = inPacket->packetData(); //Don't delete
-
- bool retVal = false;
-
- if (locPacketSize == 0) {
- retVal = true;
- } else if (locPacketSize < 8) {
- for (int i = 0; i < 8; i++) {
- if (locPackBuff[i] != i) {
- retVal = false;
- }
- }
- return true;
- } else {
- for (int i = 0; i < 4; i++) {
- if (locPackBuff[i] != '[') {
- retVal = false;
- }
- }
-
- for (int i = 4; i < locPacketSize - 4; i++) {
- if (locPackBuff[i] != ('a' + (unsigned char)(i % 26))) {
- retVal = false;
- }
- }
-
- for (int i = 1; i <=4; i++) {
- if (locPackBuff[locPacketSize - i] != ']') {
- retVal = false;
- }
- }
- retVal = true;
- }
-
- cout<<"Check Packet Granule "<<inPacket->endTime()<<" Size = "<<inPacket->packetSize()<<" ";
- if (retVal) {
- cout<<"OK"<<endl;
- } else {
- cout<<"FAILED"<<endl;
- }
- delete inPacket;
- return retVal;
+#include "StdAfx.h"
+#include ".\testpatternoggpacketchecker.h"
+
+TestPatternOggPacketChecker::TestPatternOggPacketChecker(void)
+{
+}
+
+TestPatternOggPacketChecker::~TestPatternOggPacketChecker(void)
+{
+}
+
+bool TestPatternOggPacketChecker::acceptStampedOggPacket(StampedOggPacket* inPacket)
+{
+ unsigned long locPacketSize = inPacket->packetSize();
+
+ const unsigned char* locPackBuff = inPacket->packetData(); //Don't delete
+
+ bool retVal = false;
+
+ if (locPacketSize == 0) {
+ retVal = true;
+ } else if (locPacketSize < 8) {
+ for (int i = 0; i < 8; i++) {
+ if (locPackBuff[i] != i) {
+ retVal = false;
+ }
+ }
+ return true;
+ } else {
+ for (int i = 0; i < 4; i++) {
+ if (locPackBuff[i] != '[') {
+ retVal = false;
+ }
+ }
+
+ for (int i = 4; i < locPacketSize - 4; i++) {
+ if (locPackBuff[i] != ('a' + (unsigned char)(i % 26))) {
+ retVal = false;
+ }
+ }
+
+ for (int i = 1; i <=4; i++) {
+ if (locPackBuff[locPacketSize - i] != ']') {
+ retVal = false;
+ }
+ }
+ retVal = true;
+ }
+
+ cout<<"Check Packet Granule "<<inPacket->endTime()<<" Size = "<<inPacket->packetSize()<<" ";
+ if (retVal) {
+ cout<<"OK"<<endl;
+ } else {
+ cout<<"FAILED"<<endl;
+ }
+ delete inPacket;
+ return retVal;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPacketChecker.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPacketChecker.h
===================================================================
--- trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPacketChecker.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPacketChecker.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,13 +1,13 @@
-#pragma once
-
-#include "IStampedOggPacketSink.h"
-class TestPatternOggPacketChecker
- : public IStampedOggPacketSink
-{
-public:
- TestPatternOggPacketChecker(void);
- ~TestPatternOggPacketChecker(void);
-
- //IStampedOggPacketSink
- virtual bool acceptStampedOggPacket(StampedOggPacket* inPacket);
-};
+#pragma once
+
+#include "IStampedOggPacketSink.h"
+class TestPatternOggPacketChecker
+ : public IStampedOggPacketSink
+{
+public:
+ TestPatternOggPacketChecker(void);
+ ~TestPatternOggPacketChecker(void);
+
+ //IStampedOggPacketSink
+ virtual bool acceptStampedOggPacket(StampedOggPacket* inPacket);
+};
Property changes on: trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPacketChecker.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPacketGenerator.cpp
===================================================================
--- trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPacketGenerator.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPacketGenerator.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,49 +1,49 @@
-#include "StdAfx.h"
-#include ".\testpatternoggpacketgenerator.h"
-
-TestPatternOggPacketGenerator::TestPatternOggPacketGenerator(void)
-{
-}
-
-TestPatternOggPacketGenerator::~TestPatternOggPacketGenerator(void)
-{
-}
-
-StampedOggPacket* TestPatternOggPacketGenerator::generatePacket(unsigned long inPacketSize, __int64 inGranulePos)
-{
- cout<<"Generating packet of size "<<inPacketSize<<" with gran pos "<<inGranulePos<<endl;
- if (inPacketSize == 0) {
-
- return new StampedOggPacket(NULL, 0, false, false, 0, inGranulePos, StampedOggPacket::OGG_END_ONLY);
- }
- if (inPacketSize <= 8) {
- unsigned char* locBuff = new unsigned char[inPacketSize];
-
- //Numbers 01234567
- for (int i = 0; i < inPacketSize; i++) {
- locBuff[i] = ('0' + (unsigned char)i);;
- }
- return new StampedOggPacket(locBuff, inPacketSize, false, false, 0, inGranulePos, StampedOggPacket::OGG_END_ONLY);
-
- } else {
-
- // [[[[abcdefghij...abcde...]]]]
- unsigned char* locBuff = new unsigned char[inPacketSize];
-
- for (int i = 0; i < 4; i++) {
- locBuff[i] = '[';
- }
-
- for (int i = 4; i < inPacketSize - 4; i++) {
- locBuff[i] = 'a' + (unsigned char)(i % 26);
- }
-
- for (int i = 1; i <= 4; i++) {
- locBuff[inPacketSize - i] = ']';
- }
-
- return new StampedOggPacket(locBuff, inPacketSize, false, false, 0, inGranulePos, StampedOggPacket::OGG_END_ONLY);
-
- }
-
+#include "StdAfx.h"
+#include ".\testpatternoggpacketgenerator.h"
+
+TestPatternOggPacketGenerator::TestPatternOggPacketGenerator(void)
+{
+}
+
+TestPatternOggPacketGenerator::~TestPatternOggPacketGenerator(void)
+{
+}
+
+StampedOggPacket* TestPatternOggPacketGenerator::generatePacket(unsigned long inPacketSize, __int64 inGranulePos)
+{
+ cout<<"Generating packet of size "<<inPacketSize<<" with gran pos "<<inGranulePos<<endl;
+ if (inPacketSize == 0) {
+
+ return new StampedOggPacket(NULL, 0, false, false, 0, inGranulePos, StampedOggPacket::OGG_END_ONLY);
+ }
+ if (inPacketSize <= 8) {
+ unsigned char* locBuff = new unsigned char[inPacketSize];
+
+ //Numbers 01234567
+ for (int i = 0; i < inPacketSize; i++) {
+ locBuff[i] = ('0' + (unsigned char)i);;
+ }
+ return new StampedOggPacket(locBuff, inPacketSize, false, false, 0, inGranulePos, StampedOggPacket::OGG_END_ONLY);
+
+ } else {
+
+ // [[[[abcdefghij...abcde...]]]]
+ unsigned char* locBuff = new unsigned char[inPacketSize];
+
+ for (int i = 0; i < 4; i++) {
+ locBuff[i] = '[';
+ }
+
+ for (int i = 4; i < inPacketSize - 4; i++) {
+ locBuff[i] = 'a' + (unsigned char)(i % 26);
+ }
+
+ for (int i = 1; i <= 4; i++) {
+ locBuff[inPacketSize - i] = ']';
+ }
+
+ return new StampedOggPacket(locBuff, inPacketSize, false, false, 0, inGranulePos, StampedOggPacket::OGG_END_ONLY);
+
+ }
+
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPacketGenerator.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPacketGenerator.h
===================================================================
--- trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPacketGenerator.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPacketGenerator.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,27 +1,27 @@
-#pragma once
-
-class TestPatternOggPacketGenerator
-{
-public:
- TestPatternOggPacketGenerator(void);
- ~TestPatternOggPacketGenerator(void);
-
- //Test pattern will be...
- //
- // 50 byte packet
-
- //Packet
- //======
- //All packets start with [[[[
- //All packets end with ]]]]
- //Will rotate through lowercase alphabetical letters.
- //Packets shorter than 8 bytes are filled with 012345... etc.
-
- //eg. [[[[abcdefghij...abcde...]]]]
-
- StampedOggPacket* generatePacket(unsigned long inPacketSize, __int64 inGranulePos);
-
-protected:
-
-
-};
+#pragma once
+
+class TestPatternOggPacketGenerator
+{
+public:
+ TestPatternOggPacketGenerator(void);
+ ~TestPatternOggPacketGenerator(void);
+
+ //Test pattern will be...
+ //
+ // 50 byte packet
+
+ //Packet
+ //======
+ //All packets start with [[[[
+ //All packets end with ]]]]
+ //Will rotate through lowercase alphabetical letters.
+ //Packets shorter than 8 bytes are filled with 012345... etc.
+
+ //eg. [[[[abcdefghij...abcde...]]]]
+
+ StampedOggPacket* generatePacket(unsigned long inPacketSize, __int64 inGranulePos);
+
+protected:
+
+
+};
Property changes on: trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPacketGenerator.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPageChecker.cpp
===================================================================
--- trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPageChecker.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPageChecker.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,28 +1,28 @@
-#include "StdAfx.h"
-#include ".\testpatternoggpagechecker.h"
-
-TestPatternOggPageChecker::TestPatternOggPageChecker(void)
-{
-}
-
-TestPatternOggPageChecker::~TestPatternOggPageChecker(void)
-{
-}
-
-bool TestPatternOggPageChecker::acceptOggPage(OggPage* inOggPage)
-{
- bool locIsOK = true;
- for (int i = 0; i < inOggPage->numPackets(); i++) {
- locIsOK = locIsOK && (mPacketChecker.acceptStampedOggPacket( (StampedOggPacket*)(inOggPage->getStampedPacket(i)->clone()) ) );
- }
-
- cout<<"Check Page "<<inOggPage->header()->PageSequenceNo()<<" @ "<<inOggPage->header()->GranulePos()<<" Size = "<<inOggPage->pageSize()<<" Num Packs = "<<inOggPage->numPackets()<<" ";
- if (locIsOK) {
- cout<<"OK"<<endl;
- } else {
- cout<<"FAILED"<<endl;
- }
- cout<<endl;
- delete inOggPage;
- return (locIsOK);
+#include "StdAfx.h"
+#include ".\testpatternoggpagechecker.h"
+
+TestPatternOggPageChecker::TestPatternOggPageChecker(void)
+{
+}
+
+TestPatternOggPageChecker::~TestPatternOggPageChecker(void)
+{
+}
+
+bool TestPatternOggPageChecker::acceptOggPage(OggPage* inOggPage)
+{
+ bool locIsOK = true;
+ for (int i = 0; i < inOggPage->numPackets(); i++) {
+ locIsOK = locIsOK && (mPacketChecker.acceptStampedOggPacket( (StampedOggPacket*)(inOggPage->getStampedPacket(i)->clone()) ) );
+ }
+
+ cout<<"Check Page "<<inOggPage->header()->PageSequenceNo()<<" @ "<<inOggPage->header()->GranulePos()<<" Size = "<<inOggPage->pageSize()<<" Num Packs = "<<inOggPage->numPackets()<<" ";
+ if (locIsOK) {
+ cout<<"OK"<<endl;
+ } else {
+ cout<<"FAILED"<<endl;
+ }
+ cout<<endl;
+ delete inOggPage;
+ return (locIsOK);
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPageChecker.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPageChecker.h
===================================================================
--- trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPageChecker.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPageChecker.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,16 +1,16 @@
-#pragma once
-
-#include "IOggCallback.h"
-#include "TestPatternOggPacketChecker.h"
-class TestPatternOggPageChecker
- : public IOggCallback
-{
-public:
- TestPatternOggPageChecker(void);
- ~TestPatternOggPageChecker(void);
-
- virtual bool acceptOggPage(OggPage* inOggPage);
-
-protected:
- TestPatternOggPacketChecker mPacketChecker;
-};
+#pragma once
+
+#include "IOggCallback.h"
+#include "TestPatternOggPacketChecker.h"
+class TestPatternOggPageChecker
+ : public IOggCallback
+{
+public:
+ TestPatternOggPageChecker(void);
+ ~TestPatternOggPageChecker(void);
+
+ virtual bool acceptOggPage(OggPage* inOggPage);
+
+protected:
+ TestPatternOggPacketChecker mPacketChecker;
+};
Property changes on: trunk/oggdsf/src/tests/testLibOOOgg/TestPatternOggPageChecker.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testLibOOOgg/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/tests/testLibOOOgg/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testLibOOOgg/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// testLibOOOgg.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// testLibOOOgg.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/tests/testLibOOOgg/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testLibOOOgg/stdafx.h
===================================================================
--- trunk/oggdsf/src/tests/testLibOOOgg/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testLibOOOgg/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,13 +1,13 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-#include <iostream>
-#include <tchar.h>
-#include "dllstuff.h"
-#include "libOOOgg.h"
-// TODO: reference additional headers your program requires here
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#include <iostream>
+#include <tchar.h>
+#include "dllstuff.h"
+#include "libOOOgg.h"
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/tests/testLibOOOgg/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testLibOOOgg/testLibOOOgg.cpp
===================================================================
--- trunk/oggdsf/src/tests/testLibOOOgg/testLibOOOgg.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testLibOOOgg/testLibOOOgg.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,164 +1,164 @@
-// testLibOOOgg.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-
-#include "TestPatternOggPacketGenerator.h"
-#include "TestPatternOggPageChecker.h"
-#include "OggPageFileWriter.h"
-
-
-#include <iostream>
-using namespace std;
-
-bool testRandomPacketSizes(string inFileName, unsigned long inNumPackets) {
-
- TestPatternOggPacketGenerator locPackGen;
- TestPatternOggPageChecker locPageChecker;
- OggPaginator locPaginator;
-
- OggPaginatorSettings* locSettings = new OggPaginatorSettings;
- ;
- locSettings->mMaxPageSize = 20000;
- locSettings->mMinPageSize = 4096;
- locSettings->mTargetPageSize = 10000;
- locSettings->mSerialNo = 77;
- locSettings->mNumHeaders = 6;
- locPaginator.setParameters(locSettings);
-
- locPaginator.setPageCallback(&locPageChecker);
-
- const unsigned long MAX_PACK_SIZE = 100000;
- unsigned long locPacketSize = 0;
- StampedOggPacket* locTestPacket;
-
- for (int i = 0; i < inNumPackets; i++) {
- locPacketSize = rand() % MAX_PACK_SIZE;
- locTestPacket = locPackGen.generatePacket(locPacketSize, i);
- locPaginator.acceptStampedOggPacket(locTestPacket);
- }
- locPaginator.finishStream();
- return true;
-
-}
-
-
-bool testSmallPacketSizes(string inFileName, unsigned long inNumPackets) {
-
- TestPatternOggPacketGenerator locPackGen;
- TestPatternOggPageChecker locPageChecker;
- OggPaginator locPaginator;
-
- OggPaginatorSettings* locSettings = new OggPaginatorSettings;
-
- locSettings->mMaxPageSize = 20000;
- locSettings->mMinPageSize = 4096;
- locSettings->mTargetPageSize = 8192;
- locSettings->mSerialNo = 77;
- locSettings->mNumHeaders = 6;
- locPaginator.setParameters(locSettings);
-
- locPaginator.setPageCallback(&locPageChecker);
-
- const unsigned long MAX_PACK_SIZE = 200;
- unsigned long locPacketSize = 0;
- StampedOggPacket* locTestPacket;
-
- for (int i = 0; i < inNumPackets; i++) {
- locPacketSize = rand() % MAX_PACK_SIZE;
- locTestPacket = locPackGen.generatePacket(locPacketSize, i);
- locPaginator.acceptStampedOggPacket(locTestPacket);
- }
- locPaginator.finishStream();
- return true;
-
-}
-
-//bool testPagination(string inFileName) {
-// TestPatternOggPacketGenerator locPackGen;
-// TestPatternOggPageChecker locPageChecker;
-// OggPaginator locPaginator;
-// locPaginator.setPageCallback(&locPageChecker);
-//
-// for (int i = 0; i <
-//
-//}
-
-
-
-bool test255MultPacketSizes(string inFileName, unsigned long inNumPackets) {
-
- TestPatternOggPacketGenerator locPackGen;
- TestPatternOggPageChecker locPageChecker;
- OggPaginator locPaginator;
-
- OggPaginatorSettings* locSettings = new OggPaginatorSettings;
-
- locSettings->mMaxPageSize = 20000;
- locSettings->mMinPageSize = 4096;
- locSettings->mTargetPageSize = 8192;
- locSettings->mSerialNo = 77;
- locSettings->mNumHeaders = 6;
- locPaginator.setParameters(locSettings);
-
- locPaginator.setPageCallback(&locPageChecker);
-
- const unsigned long MAX_MULTIPLE_SIZE = 100;
- unsigned long locPacketSize = 0;
- StampedOggPacket* locTestPacket;
-
- for (int i = 0; i < inNumPackets; i++) {
- locPacketSize = (rand() % MAX_MULTIPLE_SIZE) * 255;
- locTestPacket = locPackGen.generatePacket(locPacketSize, i);
- locPaginator.acceptStampedOggPacket(locTestPacket);
- }
- locPaginator.finishStream();
- return true;
-
-}
-
-
-
-bool test255MultPacketSizesToFile(string inFileName, unsigned long inNumPackets) {
-
- TestPatternOggPacketGenerator locPackGen;
- //TestPatternOggPageChecker locPageChecker;
- OggPageFileWriter locFileWriter(inFileName);
-
- OggPaginator locPaginator;
-
- OggPaginatorSettings* locSettings = new OggPaginatorSettings;
-
- locSettings->mMaxPageSize = 20000;
- locSettings->mMinPageSize = 4096;
- locSettings->mTargetPageSize = 8192;
- locSettings->mSerialNo = 77;
- locSettings->mNumHeaders = 6;
- locPaginator.setParameters(locSettings);
-
- locPaginator.setPageCallback(&locFileWriter);
-
- const unsigned long MAX_MULTIPLE_SIZE = 100;
- unsigned long locPacketSize = 0;
- StampedOggPacket* locTestPacket;
-
- for (int i = 0; i < inNumPackets; i++) {
- locPacketSize = (rand() % MAX_MULTIPLE_SIZE) * 255;
- locTestPacket = locPackGen.generatePacket(locPacketSize, i);
- locPaginator.acceptStampedOggPacket(locTestPacket);
- }
- locPaginator.finishStream();
- return true;
-
-}
-
-int _tmain(int argc, _TCHAR* argv[])
-{
- int x;
- cin>>x;
- //testRandomPacketSizes("", 100);
- //testSmallPacketSizes("", 10000);
- test255MultPacketSizesToFile("d:\\Zen\\tests\\test.ogg", 500);
- return 0;
-}
-
+// testLibOOOgg.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+
+#include "TestPatternOggPacketGenerator.h"
+#include "TestPatternOggPageChecker.h"
+#include "OggPageFileWriter.h"
+
+
+#include <iostream>
+using namespace std;
+
+bool testRandomPacketSizes(string inFileName, unsigned long inNumPackets) {
+
+ TestPatternOggPacketGenerator locPackGen;
+ TestPatternOggPageChecker locPageChecker;
+ OggPaginator locPaginator;
+
+ OggPaginatorSettings* locSettings = new OggPaginatorSettings;
+ ;
+ locSettings->mMaxPageSize = 20000;
+ locSettings->mMinPageSize = 4096;
+ locSettings->mTargetPageSize = 10000;
+ locSettings->mSerialNo = 77;
+ locSettings->mNumHeaders = 6;
+ locPaginator.setParameters(locSettings);
+
+ locPaginator.setPageCallback(&locPageChecker);
+
+ const unsigned long MAX_PACK_SIZE = 100000;
+ unsigned long locPacketSize = 0;
+ StampedOggPacket* locTestPacket;
+
+ for (int i = 0; i < inNumPackets; i++) {
+ locPacketSize = rand() % MAX_PACK_SIZE;
+ locTestPacket = locPackGen.generatePacket(locPacketSize, i);
+ locPaginator.acceptStampedOggPacket(locTestPacket);
+ }
+ locPaginator.finishStream();
+ return true;
+
+}
+
+
+bool testSmallPacketSizes(string inFileName, unsigned long inNumPackets) {
+
+ TestPatternOggPacketGenerator locPackGen;
+ TestPatternOggPageChecker locPageChecker;
+ OggPaginator locPaginator;
+
+ OggPaginatorSettings* locSettings = new OggPaginatorSettings;
+
+ locSettings->mMaxPageSize = 20000;
+ locSettings->mMinPageSize = 4096;
+ locSettings->mTargetPageSize = 8192;
+ locSettings->mSerialNo = 77;
+ locSettings->mNumHeaders = 6;
+ locPaginator.setParameters(locSettings);
+
+ locPaginator.setPageCallback(&locPageChecker);
+
+ const unsigned long MAX_PACK_SIZE = 200;
+ unsigned long locPacketSize = 0;
+ StampedOggPacket* locTestPacket;
+
+ for (int i = 0; i < inNumPackets; i++) {
+ locPacketSize = rand() % MAX_PACK_SIZE;
+ locTestPacket = locPackGen.generatePacket(locPacketSize, i);
+ locPaginator.acceptStampedOggPacket(locTestPacket);
+ }
+ locPaginator.finishStream();
+ return true;
+
+}
+
+//bool testPagination(string inFileName) {
+// TestPatternOggPacketGenerator locPackGen;
+// TestPatternOggPageChecker locPageChecker;
+// OggPaginator locPaginator;
+// locPaginator.setPageCallback(&locPageChecker);
+//
+// for (int i = 0; i <
+//
+//}
+
+
+
+bool test255MultPacketSizes(string inFileName, unsigned long inNumPackets) {
+
+ TestPatternOggPacketGenerator locPackGen;
+ TestPatternOggPageChecker locPageChecker;
+ OggPaginator locPaginator;
+
+ OggPaginatorSettings* locSettings = new OggPaginatorSettings;
+
+ locSettings->mMaxPageSize = 20000;
+ locSettings->mMinPageSize = 4096;
+ locSettings->mTargetPageSize = 8192;
+ locSettings->mSerialNo = 77;
+ locSettings->mNumHeaders = 6;
+ locPaginator.setParameters(locSettings);
+
+ locPaginator.setPageCallback(&locPageChecker);
+
+ const unsigned long MAX_MULTIPLE_SIZE = 100;
+ unsigned long locPacketSize = 0;
+ StampedOggPacket* locTestPacket;
+
+ for (int i = 0; i < inNumPackets; i++) {
+ locPacketSize = (rand() % MAX_MULTIPLE_SIZE) * 255;
+ locTestPacket = locPackGen.generatePacket(locPacketSize, i);
+ locPaginator.acceptStampedOggPacket(locTestPacket);
+ }
+ locPaginator.finishStream();
+ return true;
+
+}
+
+
+
+bool test255MultPacketSizesToFile(string inFileName, unsigned long inNumPackets) {
+
+ TestPatternOggPacketGenerator locPackGen;
+ //TestPatternOggPageChecker locPageChecker;
+ OggPageFileWriter locFileWriter(inFileName);
+
+ OggPaginator locPaginator;
+
+ OggPaginatorSettings* locSettings = new OggPaginatorSettings;
+
+ locSettings->mMaxPageSize = 20000;
+ locSettings->mMinPageSize = 4096;
+ locSettings->mTargetPageSize = 8192;
+ locSettings->mSerialNo = 77;
+ locSettings->mNumHeaders = 6;
+ locPaginator.setParameters(locSettings);
+
+ locPaginator.setPageCallback(&locFileWriter);
+
+ const unsigned long MAX_MULTIPLE_SIZE = 100;
+ unsigned long locPacketSize = 0;
+ StampedOggPacket* locTestPacket;
+
+ for (int i = 0; i < inNumPackets; i++) {
+ locPacketSize = (rand() % MAX_MULTIPLE_SIZE) * 255;
+ locTestPacket = locPackGen.generatePacket(locPacketSize, i);
+ locPaginator.acceptStampedOggPacket(locTestPacket);
+ }
+ locPaginator.finishStream();
+ return true;
+
+}
+
+int _tmain(int argc, _TCHAR* argv[])
+{
+ int x;
+ cin>>x;
+ //testRandomPacketSizes("", 100);
+ //testSmallPacketSizes("", 10000);
+ test255MultPacketSizesToFile("d:\\Zen\\tests\\test.ogg", 500);
+ return 0;
+}
+
Property changes on: trunk/oggdsf/src/tests/testLibOOOgg/testLibOOOgg.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testMuxDemux/OggPageFileWriter.cpp
===================================================================
--- trunk/oggdsf/src/tests/testMuxDemux/OggPageFileWriter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testMuxDemux/OggPageFileWriter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,21 +1,21 @@
-#include "StdAfx.h"
-#include ".\oggpagefilewriter.h"
-
-OggPageFileWriter::OggPageFileWriter(string inFileName)
-{
- mFile.open(inFileName.c_str(), ios_base::out|ios_base::binary);
-}
-
-OggPageFileWriter::~OggPageFileWriter(void)
-{
-}
-
-bool OggPageFileWriter::acceptOggPage(OggPage* inOggPage) {
-
- unsigned char* locPageBytes = inOggPage->createRawPageData();
- mFile.write((const char*) locPageBytes, inOggPage->pageSize());
-
- delete inOggPage;
- delete [] locPageBytes;
- return true;
+#include "StdAfx.h"
+#include ".\oggpagefilewriter.h"
+
+OggPageFileWriter::OggPageFileWriter(string inFileName)
+{
+ mFile.open(inFileName.c_str(), ios_base::out|ios_base::binary);
+}
+
+OggPageFileWriter::~OggPageFileWriter(void)
+{
+}
+
+bool OggPageFileWriter::acceptOggPage(OggPage* inOggPage) {
+
+ unsigned char* locPageBytes = inOggPage->createRawPageData();
+ mFile.write((const char*) locPageBytes, inOggPage->pageSize());
+
+ delete inOggPage;
+ delete [] locPageBytes;
+ return true;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/tests/testMuxDemux/OggPageFileWriter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testMuxDemux/OggPageFileWriter.h
===================================================================
--- trunk/oggdsf/src/tests/testMuxDemux/OggPageFileWriter.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testMuxDemux/OggPageFileWriter.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,19 +1,19 @@
-#pragma once
-
-//#include "dllstuff.h"
-#include "libOOOgg.h"
-#include <fstream>
-using namespace std;
-//#include "IOggCallback.h"
-class OggPageFileWriter
- : public IOggCallback
-{
-public:
- OggPageFileWriter(string inFileName);
- ~OggPageFileWriter(void);
-
- virtual bool acceptOggPage(OggPage* inOggPage);
-
-protected:
- fstream mFile;
-};
+#pragma once
+
+//#include "dllstuff.h"
+#include "libOOOgg.h"
+#include <fstream>
+using namespace std;
+//#include "IOggCallback.h"
+class OggPageFileWriter
+ : public IOggCallback
+{
+public:
+ OggPageFileWriter(string inFileName);
+ ~OggPageFileWriter(void);
+
+ virtual bool acceptOggPage(OggPage* inOggPage);
+
+protected:
+ fstream mFile;
+};
Property changes on: trunk/oggdsf/src/tests/testMuxDemux/OggPageFileWriter.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testMuxDemux/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/tests/testMuxDemux/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testMuxDemux/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// testMuxDemux.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// testMuxDemux.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/tests/testMuxDemux/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testMuxDemux/stdafx.h
===================================================================
--- trunk/oggdsf/src/tests/testMuxDemux/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testMuxDemux/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,12 +1,12 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-#include <iostream>
-#include <tchar.h>
-
-// TODO: reference additional headers your program requires here
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#include <iostream>
+#include <tchar.h>
+
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/tests/testMuxDemux/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testMuxDemux/testMuxDemux.cpp
===================================================================
--- trunk/oggdsf/src/tests/testMuxDemux/testMuxDemux.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testMuxDemux/testMuxDemux.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,124 +1,124 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// OOOggStat.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-#include "libOOOgg.h"
-#include "dllstuff.h"
-#include "OggPageFileWriter.h"
-#include <iostream>
-
-
-#include <fstream>
-
-const BUFF_SIZE = 8092;
-
-
-int testPagination(string inOutputFileName) {
- int NUM_PACKS = 100;
- int PACK_BUFF_SIZE = 100000;
- unsigned char* locBuff = NULL;
-
-
- OggPaginatorSettings sets;
- sets.mMaxPageSize = 8192;
- sets.mMinPageSize = 4096;
- sets.mSerialNo = 8877;
- sets.mTargetPageSize = 4096;
-
- OggPageFileWriter* writer = new OggPageFileWriter(inOutputFileName);
-
- OggPaginator pager;
- pager.setParameters(&sets);
- pager.setPageCallback(writer);
-
- StampedOggPacket* pack = NULL;
-
- for (int i=0; i < NUM_PACKS; i++) {
- locBuff = new unsigned char[ PACK_BUFF_SIZE];
- memset((void*)locBuff, 99, PACK_BUFF_SIZE);
-
- locBuff[0] = 88;
- locBuff[PACK_BUFF_SIZE-1] = 77;
- pack = new StampedOggPacket(locBuff, PACK_BUFF_SIZE, false, false, i, i, StampedOggPacket::OGG_BOTH);
- pager.acceptStampedOggPacket(pack);
-
-
- }
- return 0;
-}
-
-
-int testPageWriter(string inReadFile, string inWriteFile) {
- //Reads a file, demuxes it at page level and then writes it out again
- OggDataBuffer testOggBuff;
-
- //Set up the file writer and set the callback on the demux buffer
- OggPageFileWriter testOggPageWriter(inWriteFile);
- testOggBuff.registerVirtualCallback(&testOggPageWriter);
-
- //Source File read and let it all fire away.
- fstream testFile;
- testFile.open(inReadFile.c_str(), ios_base::in | ios_base::binary);
- char* locBuff = new char[BUFF_SIZE];
- while (!testFile.eof()) {
- testFile.read(locBuff, BUFF_SIZE);
- unsigned long locBytesRead = testFile.gcount();
- testOggBuff.feed((const unsigned char*)locBuff, locBytesRead);
- }
-
- delete[] locBuff;
-
- return 0;
-}
-
-int __cdecl _tmain(int argc, _TCHAR* argv[])
-{
-
- //if (argc != 3) {
- // cout<<"Usage : testMuxDemux <inputFilename> <outputFilename>"<<endl;
- // return 1;
- //} else {
- cout<<"Testing libOOOgg Mux and Demux..."<<endl;
- cout<<"================================="<<endl;
- unsigned long numTests = 0;
-
- testPagination("G:\\logs\\dumpage.out");
- //cout<<numTests<<" : "<<"Testing page level demux chained to page file writer..."<<endl;
- //testPageWriter(argv[1], argv[2]);
- //cout<<numTests<<" : "<<"Complete."<<endl;
- return 0;
- //}
-}
-
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// OOOggStat.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+#include "libOOOgg.h"
+#include "dllstuff.h"
+#include "OggPageFileWriter.h"
+#include <iostream>
+
+
+#include <fstream>
+
+const BUFF_SIZE = 8092;
+
+
+int testPagination(string inOutputFileName) {
+ int NUM_PACKS = 100;
+ int PACK_BUFF_SIZE = 100000;
+ unsigned char* locBuff = NULL;
+
+
+ OggPaginatorSettings sets;
+ sets.mMaxPageSize = 8192;
+ sets.mMinPageSize = 4096;
+ sets.mSerialNo = 8877;
+ sets.mTargetPageSize = 4096;
+
+ OggPageFileWriter* writer = new OggPageFileWriter(inOutputFileName);
+
+ OggPaginator pager;
+ pager.setParameters(&sets);
+ pager.setPageCallback(writer);
+
+ StampedOggPacket* pack = NULL;
+
+ for (int i=0; i < NUM_PACKS; i++) {
+ locBuff = new unsigned char[ PACK_BUFF_SIZE];
+ memset((void*)locBuff, 99, PACK_BUFF_SIZE);
+
+ locBuff[0] = 88;
+ locBuff[PACK_BUFF_SIZE-1] = 77;
+ pack = new StampedOggPacket(locBuff, PACK_BUFF_SIZE, false, false, i, i, StampedOggPacket::OGG_BOTH);
+ pager.acceptStampedOggPacket(pack);
+
+
+ }
+ return 0;
+}
+
+
+int testPageWriter(string inReadFile, string inWriteFile) {
+ //Reads a file, demuxes it at page level and then writes it out again
+ OggDataBuffer testOggBuff;
+
+ //Set up the file writer and set the callback on the demux buffer
+ OggPageFileWriter testOggPageWriter(inWriteFile);
+ testOggBuff.registerVirtualCallback(&testOggPageWriter);
+
+ //Source File read and let it all fire away.
+ fstream testFile;
+ testFile.open(inReadFile.c_str(), ios_base::in | ios_base::binary);
+ char* locBuff = new char[BUFF_SIZE];
+ while (!testFile.eof()) {
+ testFile.read(locBuff, BUFF_SIZE);
+ unsigned long locBytesRead = testFile.gcount();
+ testOggBuff.feed((const unsigned char*)locBuff, locBytesRead);
+ }
+
+ delete[] locBuff;
+
+ return 0;
+}
+
+int __cdecl _tmain(int argc, _TCHAR* argv[])
+{
+
+ //if (argc != 3) {
+ // cout<<"Usage : testMuxDemux <inputFilename> <outputFilename>"<<endl;
+ // return 1;
+ //} else {
+ cout<<"Testing libOOOgg Mux and Demux..."<<endl;
+ cout<<"================================="<<endl;
+ unsigned long numTests = 0;
+
+ testPagination("G:\\logs\\dumpage.out");
+ //cout<<numTests<<" : "<<"Testing page level demux chained to page file writer..."<<endl;
+ //testPageWriter(argv[1], argv[2]);
+ //cout<<numTests<<" : "<<"Complete."<<endl;
+ return 0;
+ //}
+}
+
+
Property changes on: trunk/oggdsf/src/tests/testMuxDemux/testMuxDemux.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testOOOggMux/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/tests/testOOOggMux/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testOOOggMux/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// testOOOggMux.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// testOOOggMux.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/tests/testOOOggMux/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testOOOggMux/stdafx.h
===================================================================
--- trunk/oggdsf/src/tests/testOOOggMux/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testOOOggMux/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,12 +1,12 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-#include <iostream>
-#include <tchar.h>
-
-// TODO: reference additional headers your program requires here
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#include <iostream>
+#include <tchar.h>
+
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/tests/testOOOggMux/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testOOOggMux/testOOOggMux.cpp
===================================================================
--- trunk/oggdsf/src/tests/testOOOggMux/testOOOggMux.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testOOOggMux/testOOOggMux.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,67 +1,67 @@
-// testOOOggMux.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-
-#include <libOOOgg.h>
-#include <dllstuff.h>
-
-#include <iostream>
-#include <fstream>
-
-unsigned long bytePos;
-
-//This will be called by the callback
-bool pageCB(OggPage* inOggPage) {
- cout<<"Page Location : "<<bytePos;
- bytePos += inOggPage->pageSize();
- cout<<" to "<<bytePos<<endl;
- OggPacket* locPack = NULL;
- cout << inOggPage->header()->toString();
- cout << "Num Packets : " << inOggPage->numPackets() << endl;;
- for (unsigned long i = 0; i < inOggPage->numPackets(); i++) {
- locPack = inOggPage->getPacket(i);
- cout << "------ Packet " << i << " (" << locPack->packetSize() << " bytes) -------";
-
- if (locPack->isContinuation()) {
- cout<<" ** CONT **";
- }
- if (locPack->isTruncated()) {
- cout<<" ** TRUNC **";
- }
- cout<<endl;
- cout << locPack->toPackDumpString();
- }
-
- return true;
-}
-
-
-int __cdecl _tmain(int argc, _TCHAR* argv[])
-{
- //This program just dumps the pages out of a file in ogg format.
- // Currently does not error checking. Check your command line carefully !
- // USAGE :: OggDump <OggFile>
- //
-
- bytePos = 0;
-
-
-
-
-
-
- const unsigned short BUFF_SIZE = 8092;
- char* locBuff = new char[BUFF_SIZE];
- while (!testFile.eof()) {
- testFile.read(locBuff, BUFF_SIZE);
- unsigned long locBytesRead = testFile.gcount();
- testOggBuff.feed((const unsigned char*)locBuff, locBytesRead);
- }
-
- delete[] locBuff;
- }
-
- return 0;
-}
-
+// testOOOggMux.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+
+#include <libOOOgg.h>
+#include <dllstuff.h>
+
+#include <iostream>
+#include <fstream>
+
+unsigned long bytePos;
+
+//This will be called by the callback
+bool pageCB(OggPage* inOggPage) {
+ cout<<"Page Location : "<<bytePos;
+ bytePos += inOggPage->pageSize();
+ cout<<" to "<<bytePos<<endl;
+ OggPacket* locPack = NULL;
+ cout << inOggPage->header()->toString();
+ cout << "Num Packets : " << inOggPage->numPackets() << endl;;
+ for (unsigned long i = 0; i < inOggPage->numPackets(); i++) {
+ locPack = inOggPage->getPacket(i);
+ cout << "------ Packet " << i << " (" << locPack->packetSize() << " bytes) -------";
+
+ if (locPack->isContinuation()) {
+ cout<<" ** CONT **";
+ }
+ if (locPack->isTruncated()) {
+ cout<<" ** TRUNC **";
+ }
+ cout<<endl;
+ cout << locPack->toPackDumpString();
+ }
+
+ return true;
+}
+
+
+int __cdecl _tmain(int argc, _TCHAR* argv[])
+{
+ //This program just dumps the pages out of a file in ogg format.
+ // Currently does not error checking. Check your command line carefully !
+ // USAGE :: OggDump <OggFile>
+ //
+
+ bytePos = 0;
+
+
+
+
+
+
+ const unsigned short BUFF_SIZE = 8092;
+ char* locBuff = new char[BUFF_SIZE];
+ while (!testFile.eof()) {
+ testFile.read(locBuff, BUFF_SIZE);
+ unsigned long locBytesRead = testFile.gcount();
+ testOggBuff.feed((const unsigned char*)locBuff, locBytesRead);
+ }
+
+ delete[] locBuff;
+ }
+
+ return 0;
+}
+
Property changes on: trunk/oggdsf/src/tests/testOOOggMux/testOOOggMux.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testlibOOOggSpeed1/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/tests/testlibOOOggSpeed1/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testlibOOOggSpeed1/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// testlibOOOggSpeed1.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// testlibOOOggSpeed1.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/tests/testlibOOOggSpeed1/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testlibOOOggSpeed1/stdafx.h
===================================================================
--- trunk/oggdsf/src/tests/testlibOOOggSpeed1/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testlibOOOggSpeed1/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,12 +1,12 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#include <windows.h>
-#include <iostream>
-#include <tchar.h>
-
-// TODO: reference additional headers your program requires here
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#include <windows.h>
+#include <iostream>
+#include <tchar.h>
+
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/tests/testlibOOOggSpeed1/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testlibOOOggSpeed1/testlibOOOggSpeed1.cpp
===================================================================
--- trunk/oggdsf/src/tests/testlibOOOggSpeed1/testlibOOOggSpeed1.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testlibOOOggSpeed1/testlibOOOggSpeed1.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,94 +1,94 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// OggDump.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-#include <libOOOgg.h>
-#include <dllstuff.h>
-
-#include <iostream>
-#include <fstream>
-
-unsigned long bytePos;
-unsigned long sumPageSize;
-unsigned long pageCount;
-unsigned long packetCount;
-//This will be called by the callback
-bool pageCB(OggPage* inOggPage) {
- pageCount++;
- packetCount += inOggPage->numPackets();
- return true;
-}
-
-
-int __cdecl _tmain(int argc, _TCHAR* argv[])
-{
- //This program just dumps the pages out of a file in ogg format.
- // Currently does not error checking. Check your command line carefully !
- // USAGE :: OggDump <OggFile>
- //
-
- pageCount = 0;
- packetCount = 0;
- LARGE_INTEGER perfStart;
- LARGE_INTEGER perfEnd;
- if (argc < 2) {
- cout<<"Usage : testlibOOOggSpeed1 <filename>"<<endl;
- } else {
-
- QueryPerformanceCounter(&perfStart);
- OggDataBuffer testOggBuff;
-
- testOggBuff.registerStaticCallback(&pageCB);
-
- fstream testFile;
- testFile.open(argv[1], ios_base::in | ios_base::binary);
-
- const unsigned short BUFF_SIZE = 8092;
- char* locBuff = new char[BUFF_SIZE];
- while (!testFile.eof()) {
- testFile.read(locBuff, BUFF_SIZE);
- unsigned long locBytesRead = testFile.gcount();
- testOggBuff.feed((const unsigned char*)locBuff, locBytesRead);
- }
-
- delete[] locBuff;
- }
- QueryPerformanceCounter(&perfEnd);
- cout<<"Packet count = "<<packetCount<<endl;
- cout<<"Page count = "<<pageCount<<endl;
- cout<<perfStart.QuadPart<<" - "<<perfEnd.QuadPart<<endl;
- cout<<"Time = "<<perfEnd.QuadPart - perfStart.QuadPart<<endl;
-
- return 0;
-}
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// OggDump.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+#include <libOOOgg.h>
+#include <dllstuff.h>
+
+#include <iostream>
+#include <fstream>
+
+unsigned long bytePos;
+unsigned long sumPageSize;
+unsigned long pageCount;
+unsigned long packetCount;
+//This will be called by the callback
+bool pageCB(OggPage* inOggPage) {
+ pageCount++;
+ packetCount += inOggPage->numPackets();
+ return true;
+}
+
+
+int __cdecl _tmain(int argc, _TCHAR* argv[])
+{
+ //This program just dumps the pages out of a file in ogg format.
+ // Currently does not error checking. Check your command line carefully !
+ // USAGE :: OggDump <OggFile>
+ //
+
+ pageCount = 0;
+ packetCount = 0;
+ LARGE_INTEGER perfStart;
+ LARGE_INTEGER perfEnd;
+ if (argc < 2) {
+ cout<<"Usage : testlibOOOggSpeed1 <filename>"<<endl;
+ } else {
+
+ QueryPerformanceCounter(&perfStart);
+ OggDataBuffer testOggBuff;
+
+ testOggBuff.registerStaticCallback(&pageCB);
+
+ fstream testFile;
+ testFile.open(argv[1], ios_base::in | ios_base::binary);
+
+ const unsigned short BUFF_SIZE = 8092;
+ char* locBuff = new char[BUFF_SIZE];
+ while (!testFile.eof()) {
+ testFile.read(locBuff, BUFF_SIZE);
+ unsigned long locBytesRead = testFile.gcount();
+ testOggBuff.feed((const unsigned char*)locBuff, locBytesRead);
+ }
+
+ delete[] locBuff;
+ }
+ QueryPerformanceCounter(&perfEnd);
+ cout<<"Packet count = "<<packetCount<<endl;
+ cout<<"Page count = "<<pageCount<<endl;
+ cout<<perfStart.QuadPart<<" - "<<perfEnd.QuadPart<<endl;
+ cout<<"Time = "<<perfEnd.QuadPart - perfStart.QuadPart<<endl;
+
+ return 0;
+}
Property changes on: trunk/oggdsf/src/tests/testlibOOOggSpeed1/testlibOOOggSpeed1.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testliboggSpeed1/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/tests/testliboggSpeed1/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testliboggSpeed1/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// testliboggSpeed1.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// testliboggSpeed1.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/tests/testliboggSpeed1/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testliboggSpeed1/stdafx.h
===================================================================
--- trunk/oggdsf/src/tests/testliboggSpeed1/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testliboggSpeed1/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,12 +1,12 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#include <windows.h>
-#include <iostream>
-#include <tchar.h>
-
-// TODO: reference additional headers your program requires here
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#include <windows.h>
+#include <iostream>
+#include <tchar.h>
+
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/tests/testliboggSpeed1/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testliboggSpeed1/testliboggSpeed1.cpp
===================================================================
--- trunk/oggdsf/src/tests/testliboggSpeed1/testliboggSpeed1.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testliboggSpeed1/testliboggSpeed1.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,66 +1,66 @@
-// testliboggSpeed1.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-
-#include "ogg\ogg.h"
-#include <fstream>
-#include <iostream>
-
-using namespace std;
-int __cdecl _tmain(int argc, _TCHAR* argv[])
-{
- LARGE_INTEGER perfStart;
- LARGE_INTEGER perfEnd;
- QueryPerformanceCounter(&perfStart);
- int pageCount = 0;
- int packetCount = 0;
- const unsigned short BUFF_SIZE = 8092;
+// testliboggSpeed1.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+
+#include "ogg\ogg.h"
+#include <fstream>
+#include <iostream>
+
+using namespace std;
+int __cdecl _tmain(int argc, _TCHAR* argv[])
+{
+ LARGE_INTEGER perfStart;
+ LARGE_INTEGER perfEnd;
+ QueryPerformanceCounter(&perfStart);
+ int pageCount = 0;
+ int packetCount = 0;
+ const unsigned short BUFF_SIZE = 8092;
ogg_sync_state syncState; /* sync and verify incoming physical bitstream */
ogg_page oggPage; /* one Ogg bitstream page. Vorbis packets are inside */
- ogg_packet oggPacket; /* one raw packet of data for decode */
- ogg_stream_state streamState;
- char* buffer;
- int bytes;
-
-
-
- ogg_sync_init( &syncState );
-
-
-
- fstream testFile;
- testFile.open(argv[1], ios_base::in | ios_base::binary);
-
- buffer = ogg_sync_buffer(&syncState, BUFF_SIZE);
- testFile.read(buffer, BUFF_SIZE);
-
- ogg_sync_wrote(&syncState, testFile.gcount());
- ogg_sync_pageout(&syncState, &oggPage);
- ogg_stream_init(&streamState,ogg_page_serialno(&oggPage));
-
- while (!testFile.eof()) {
- buffer = ogg_sync_buffer(&syncState, BUFF_SIZE);
- testFile.read(buffer, BUFF_SIZE);
-
- ogg_sync_wrote(&syncState, testFile.gcount());
- while ( ogg_sync_pageout(&syncState, &oggPage) > 0) {
- ogg_stream_pagein(&streamState, &oggPage);
- while (ogg_stream_packetout(&streamState, &oggPacket) > 0) {
- packetCount++;
- }
- pageCount++;
-
- }
- }
- QueryPerformanceCounter(&perfEnd);
- cout<<"Packet Count = "<<packetCount<<endl;
- cout<<"Page count = "<<pageCount<<endl;
- cout<<perfStart.QuadPart<<" - "<<perfEnd.QuadPart<<endl;
- cout<<"Time = "<<perfEnd.QuadPart - perfStart.QuadPart<<endl;
-
- cout<<"PageCount = "<<pageCount<<endl;
- return 0;
-}
-
+ ogg_packet oggPacket; /* one raw packet of data for decode */
+ ogg_stream_state streamState;
+ char* buffer;
+ int bytes;
+
+
+
+ ogg_sync_init( &syncState );
+
+
+
+ fstream testFile;
+ testFile.open(argv[1], ios_base::in | ios_base::binary);
+
+ buffer = ogg_sync_buffer(&syncState, BUFF_SIZE);
+ testFile.read(buffer, BUFF_SIZE);
+
+ ogg_sync_wrote(&syncState, testFile.gcount());
+ ogg_sync_pageout(&syncState, &oggPage);
+ ogg_stream_init(&streamState,ogg_page_serialno(&oggPage));
+
+ while (!testFile.eof()) {
+ buffer = ogg_sync_buffer(&syncState, BUFF_SIZE);
+ testFile.read(buffer, BUFF_SIZE);
+
+ ogg_sync_wrote(&syncState, testFile.gcount());
+ while ( ogg_sync_pageout(&syncState, &oggPage) > 0) {
+ ogg_stream_pagein(&streamState, &oggPage);
+ while (ogg_stream_packetout(&streamState, &oggPacket) > 0) {
+ packetCount++;
+ }
+ pageCount++;
+
+ }
+ }
+ QueryPerformanceCounter(&perfEnd);
+ cout<<"Packet Count = "<<packetCount<<endl;
+ cout<<"Page count = "<<pageCount<<endl;
+ cout<<perfStart.QuadPart<<" - "<<perfEnd.QuadPart<<endl;
+ cout<<"Time = "<<perfEnd.QuadPart - perfStart.QuadPart<<endl;
+
+ cout<<"PageCount = "<<pageCount<<endl;
+ return 0;
+}
+
Property changes on: trunk/oggdsf/src/tests/testliboggSpeed1/testliboggSpeed1.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testliboggzSpeed1/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/tests/testliboggzSpeed1/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testliboggzSpeed1/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// testliboggzSpeed1.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// testliboggzSpeed1.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/tests/testliboggzSpeed1/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testliboggzSpeed1/stdafx.h
===================================================================
--- trunk/oggdsf/src/tests/testliboggzSpeed1/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testliboggzSpeed1/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,12 +1,12 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-#include <iostream>
-#include <tchar.h>
-
-// TODO: reference additional headers your program requires here
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#include <iostream>
+#include <tchar.h>
+
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/tests/testliboggzSpeed1/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tests/testliboggzSpeed1/testliboggzSpeed1.cpp
===================================================================
--- trunk/oggdsf/src/tests/testliboggzSpeed1/testliboggzSpeed1.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tests/testliboggzSpeed1/testliboggzSpeed1.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,10 +1,10 @@
-// testliboggzSpeed1.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-
-int _tmain(int argc, _TCHAR* argv[])
-{
- return 0;
-}
-
+// testliboggzSpeed1.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+
+int _tmain(int argc, _TCHAR* argv[])
+{
+ return 0;
+}
+
Property changes on: trunk/oggdsf/src/tests/testliboggzSpeed1/testliboggzSpeed1.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/AnxCutter/AnxCutter.cpp
===================================================================
--- trunk/oggdsf/src/tools/AnxCutter/AnxCutter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/AnxCutter/AnxCutter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,205 +1,205 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
//Copyright (C) 2004 Commonwealth Scientific and Industrial Research
-// Organisation (CSIRO) Australia
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// AnxCutter.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-#include "libOOOgg.h"
-#include "dllstuff.h"
-
-#include <iostream>
-#include <fstream>
-
-typedef pair<unsigned long, unsigned long> tSerial_HeadCountPair;
-
-unsigned long bytePos;
-
-bool gotAllHeaders;
-
-fstream outputFile;
-vector<tSerial_HeadCountPair> theStreams;
-
-enum eDemuxState {
- SEEN_NOTHING,
- SEEN_ANNODEX_BOS,
- SEEN_ANNODEX_EOS,
- SEEN_ALL_CODEC_HEADERS,
- INVALID = 100
-};
-
-eDemuxState demuxState;
-
-unsigned long annodexSerialNo;
-
-bool writePageToOutputFile(OggPage* inOggPage) {
- outputFile.write((char*)inOggPage->createRawPageData(), inOggPage->pageSize());
- return true;
-}
-
-unsigned long headerCount(OggPacket* inPacket) {
- const unsigned short NUM_SEC_HEADERS_OFFSET = 24;
- return iLE_Math::charArrToULong(inPacket->packetData() + NUM_SEC_HEADERS_OFFSET);
-
-}
-//This will be called by the callback
-bool pageCB(OggPage* inOggPage) {
-
- bool allEmpty = true;
-
- switch (demuxState) {
-
- case SEEN_NOTHING:
- if ( (inOggPage->numPackets() == 1)
- && (inOggPage->header()->isBOS())
- && (strncmp((char*)inOggPage->getPacket(0)->packetData(), "Annodex\0", 8) == 0)) {
-
- //Advance the state
- demuxState = SEEN_ANNODEX_BOS;
-
- //Remember the annodex streams serial no
- annodexSerialNo = inOggPage->header()->StreamSerialNo();
-
- //Write out the page.
- writePageToOutputFile(inOggPage);
- } else {
-
- demuxState = INVALID;
- }
-
- break;
- case SEEN_ANNODEX_BOS:
- if ( (inOggPage->numPackets() == 1)
- && (inOggPage->header()->isBOS())
- && (strncmp((char*)inOggPage->getPacket(0)->packetData(), "AnxData\0", 8) == 0)) {
-
-
- //Create an association of serial no and num headers
- tSerial_HeadCountPair locMap;
- locMap.first = inOggPage->header()->StreamSerialNo();
- locMap.second = headerCount(inOggPage->getPacket(0));
-
- //Add the association to the list
- theStreams.push_back(locMap);
-
- //Write the page out to the output file.
- writePageToOutputFile(inOggPage);
- } else if ( (inOggPage->header()->isEOS())
- && (inOggPage->header()->StreamSerialNo() == annodexSerialNo)) {
-
- //It's the Annodex EOS.
- demuxState = SEEN_ANNODEX_EOS;
- } else {
- demuxState = INVALID;
- }
- break;
- case SEEN_ANNODEX_EOS:
- for (int i = 0; i < theStreams.size(); i++) {
- if (theStreams[i].first == inOggPage->header()->StreamSerialNo()) {
- if (theStreams[i].second >= 1) {
- theStreams[i].second--;
- } else {
- demuxState = INVALID;
- }
- }
- }
-
-
- for (int i = 0; i < theStreams.size(); i++) {
- if (theStreams[i].second != 0) {
- allEmpty = false;
- }
- }
-
- if (allEmpty) {
-
- demuxState = SEEN_ALL_CODEC_HEADERS;
- }
- break;
- case SEEN_ALL_CODEC_HEADERS:
- break;
- case INVALID:
- break;
- default:
- break;
- }
-
-
- if (demuxState == INVALID) {
- cout << "Invalid file. Broken = very yes."<<endl;
- }
- delete inOggPage;
-
- return true;
-}
-
-
-int __cdecl _tmain(int argc, _TCHAR* argv[])
-{
- demuxState = SEEN_NOTHING;
-
- bytePos = 0;
- gotAllHeaders = false;
-
- int x;
- cin>>x;
- if (argc < 2) {
- cout<<"Usage : AnxCutter <input_filename> <output_filename> <start_time> <end_time>"<<endl;
- } else {
- OggDataBuffer testOggBuff;
-
- testOggBuff.registerStaticCallback(&pageCB);
-
- fstream inputFile;
-
- inputFile.open(argv[1], ios_base::in | ios_base::binary);
- outputFile.open(argv[2], ios_base::out | ios_base::binary);
-
- const unsigned short BUFF_SIZE = 8092;
- char* locBuff = new char[BUFF_SIZE];
- while (demuxState < SEEN_ALL_CODEC_HEADERS) {
- inputFile.read(locBuff, BUFF_SIZE);
- unsigned long locBytesRead = inputFile.gcount();
- testOggBuff.feed((const unsigned char*)locBuff, locBytesRead);
- }
-
-
- inputFile.close();
- outputFile.close();
- delete[] locBuff;
- }
-
- return 0;
-}
-
+// Organisation (CSIRO) Australia
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// AnxCutter.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+#include "libOOOgg.h"
+#include "dllstuff.h"
+
+#include <iostream>
+#include <fstream>
+
+typedef pair<unsigned long, unsigned long> tSerial_HeadCountPair;
+
+unsigned long bytePos;
+
+bool gotAllHeaders;
+
+fstream outputFile;
+vector<tSerial_HeadCountPair> theStreams;
+
+enum eDemuxState {
+ SEEN_NOTHING,
+ SEEN_ANNODEX_BOS,
+ SEEN_ANNODEX_EOS,
+ SEEN_ALL_CODEC_HEADERS,
+ INVALID = 100
+};
+
+eDemuxState demuxState;
+
+unsigned long annodexSerialNo;
+
+bool writePageToOutputFile(OggPage* inOggPage) {
+ outputFile.write((char*)inOggPage->createRawPageData(), inOggPage->pageSize());
+ return true;
+}
+
+unsigned long headerCount(OggPacket* inPacket) {
+ const unsigned short NUM_SEC_HEADERS_OFFSET = 24;
+ return iLE_Math::charArrToULong(inPacket->packetData() + NUM_SEC_HEADERS_OFFSET);
+
+}
+//This will be called by the callback
+bool pageCB(OggPage* inOggPage) {
+
+ bool allEmpty = true;
+
+ switch (demuxState) {
+
+ case SEEN_NOTHING:
+ if ( (inOggPage->numPackets() == 1)
+ && (inOggPage->header()->isBOS())
+ && (strncmp((char*)inOggPage->getPacket(0)->packetData(), "Annodex\0", 8) == 0)) {
+
+ //Advance the state
+ demuxState = SEEN_ANNODEX_BOS;
+
+ //Remember the annodex streams serial no
+ annodexSerialNo = inOggPage->header()->StreamSerialNo();
+
+ //Write out the page.
+ writePageToOutputFile(inOggPage);
+ } else {
+
+ demuxState = INVALID;
+ }
+
+ break;
+ case SEEN_ANNODEX_BOS:
+ if ( (inOggPage->numPackets() == 1)
+ && (inOggPage->header()->isBOS())
+ && (strncmp((char*)inOggPage->getPacket(0)->packetData(), "AnxData\0", 8) == 0)) {
+
+
+ //Create an association of serial no and num headers
+ tSerial_HeadCountPair locMap;
+ locMap.first = inOggPage->header()->StreamSerialNo();
+ locMap.second = headerCount(inOggPage->getPacket(0));
+
+ //Add the association to the list
+ theStreams.push_back(locMap);
+
+ //Write the page out to the output file.
+ writePageToOutputFile(inOggPage);
+ } else if ( (inOggPage->header()->isEOS())
+ && (inOggPage->header()->StreamSerialNo() == annodexSerialNo)) {
+
+ //It's the Annodex EOS.
+ demuxState = SEEN_ANNODEX_EOS;
+ } else {
+ demuxState = INVALID;
+ }
+ break;
+ case SEEN_ANNODEX_EOS:
+ for (int i = 0; i < theStreams.size(); i++) {
+ if (theStreams[i].first == inOggPage->header()->StreamSerialNo()) {
+ if (theStreams[i].second >= 1) {
+ theStreams[i].second--;
+ } else {
+ demuxState = INVALID;
+ }
+ }
+ }
+
+
+ for (int i = 0; i < theStreams.size(); i++) {
+ if (theStreams[i].second != 0) {
+ allEmpty = false;
+ }
+ }
+
+ if (allEmpty) {
+
+ demuxState = SEEN_ALL_CODEC_HEADERS;
+ }
+ break;
+ case SEEN_ALL_CODEC_HEADERS:
+ break;
+ case INVALID:
+ break;
+ default:
+ break;
+ }
+
+
+ if (demuxState == INVALID) {
+ cout << "Invalid file. Broken = very yes."<<endl;
+ }
+ delete inOggPage;
+
+ return true;
+}
+
+
+int __cdecl _tmain(int argc, _TCHAR* argv[])
+{
+ demuxState = SEEN_NOTHING;
+
+ bytePos = 0;
+ gotAllHeaders = false;
+
+ int x;
+ cin>>x;
+ if (argc < 2) {
+ cout<<"Usage : AnxCutter <input_filename> <output_filename> <start_time> <end_time>"<<endl;
+ } else {
+ OggDataBuffer testOggBuff;
+
+ testOggBuff.registerStaticCallback(&pageCB);
+
+ fstream inputFile;
+
+ inputFile.open(argv[1], ios_base::in | ios_base::binary);
+ outputFile.open(argv[2], ios_base::out | ios_base::binary);
+
+ const unsigned short BUFF_SIZE = 8092;
+ char* locBuff = new char[BUFF_SIZE];
+ while (demuxState < SEEN_ALL_CODEC_HEADERS) {
+ inputFile.read(locBuff, BUFF_SIZE);
+ unsigned long locBytesRead = inputFile.gcount();
+ testOggBuff.feed((const unsigned char*)locBuff, locBytesRead);
+ }
+
+
+ inputFile.close();
+ outputFile.close();
+ delete[] locBuff;
+ }
+
+ return 0;
+}
+
Property changes on: trunk/oggdsf/src/tools/AnxCutter/AnxCutter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/AnxCutter/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/tools/AnxCutter/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/AnxCutter/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// AnxCutter.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// AnxCutter.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/tools/AnxCutter/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/AnxCutter/stdafx.h
===================================================================
--- trunk/oggdsf/src/tools/AnxCutter/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/AnxCutter/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,12 +1,12 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-#include <iostream>
-#include <tchar.h>
-
-// TODO: reference additional headers your program requires here
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#include <iostream>
+#include <tchar.h>
+
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/tools/AnxCutter/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/CLOgg/CLOgg.cpp
===================================================================
--- trunk/oggdsf/src/tools/CLOgg/CLOgg.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/CLOgg/CLOgg.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,92 +1,92 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-//
-// CLOgg.cpp : Command line minimalist audio player.
-//
-
-#include "stdafx.h"
-#include <dshow.h>
-#include <windows.h>
-#include <iostream>
-using namespace std;
-
-int __cdecl _tmain(int argc, _TCHAR* argv[])
-{
- //
- IGraphBuilder* locGraphBuilder = NULL;
- IMediaControl* locMediaControl = NULL;
- HRESULT locHR = S_FALSE;;
- CoInitialize(NULL);
- locHR = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&locGraphBuilder);
- locHR = locGraphBuilder->RenderFile(L"g:\\a.ogg", NULL);
-
- locHR = locGraphBuilder->QueryInterface(IID_IMediaControl, (void**)&locMediaControl);
-
-
- locHR = locMediaControl->Run();
-
- IMediaEvent* locMediaEvent = NULL;
- locHR = locGraphBuilder->QueryInterface(IID_IMediaEvent, (void**)&locMediaEvent);
-
- HANDLE hEvent;
- long evCode, param1, param2;
- BOOLEAN bDone = FALSE;
- HRESULT hr = S_OK;
- hr = locMediaEvent->GetEventHandle((OAEVENT*)&hEvent);
- if (FAILED(hr))
- {
- /* Insert failure-handling code here. */
- }
- while(true) //!bDone)
- {
- if (WAIT_OBJECT_0 == WaitForSingleObject(hEvent, 100))
- {
- while (hr = locMediaEvent->GetEvent(&evCode, ¶m1, ¶m2, 0), SUCCEEDED(hr))
- {
- //printf("Event code: %#04x\n Params: %d, %d\n", evCode, param1, param2);
- cout<<"Event : "<<evCode<<" Params : "<<param1<<", "<<param2<<endl;
- locMediaEvent->FreeEventParams(evCode, param1, param2);
- bDone = (EC_COMPLETE == evCode);
- }
- }
- }
-
- cout<<"Finished..."<<endl;
- int x;
- cin>>x;
- locMediaControl->Release();
- locGraphBuilder->Release();
- CoUninitialize();
-
- return 0;
-}
-
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+//
+// CLOgg.cpp : Command line minimalist audio player.
+//
+
+#include "stdafx.h"
+#include <dshow.h>
+#include <windows.h>
+#include <iostream>
+using namespace std;
+
+int __cdecl _tmain(int argc, _TCHAR* argv[])
+{
+ //
+ IGraphBuilder* locGraphBuilder = NULL;
+ IMediaControl* locMediaControl = NULL;
+ HRESULT locHR = S_FALSE;;
+ CoInitialize(NULL);
+ locHR = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&locGraphBuilder);
+ locHR = locGraphBuilder->RenderFile(L"g:\\a.ogg", NULL);
+
+ locHR = locGraphBuilder->QueryInterface(IID_IMediaControl, (void**)&locMediaControl);
+
+
+ locHR = locMediaControl->Run();
+
+ IMediaEvent* locMediaEvent = NULL;
+ locHR = locGraphBuilder->QueryInterface(IID_IMediaEvent, (void**)&locMediaEvent);
+
+ HANDLE hEvent;
+ long evCode, param1, param2;
+ BOOLEAN bDone = FALSE;
+ HRESULT hr = S_OK;
+ hr = locMediaEvent->GetEventHandle((OAEVENT*)&hEvent);
+ if (FAILED(hr))
+ {
+ /* Insert failure-handling code here. */
+ }
+ while(true) //!bDone)
+ {
+ if (WAIT_OBJECT_0 == WaitForSingleObject(hEvent, 100))
+ {
+ while (hr = locMediaEvent->GetEvent(&evCode, ¶m1, ¶m2, 0), SUCCEEDED(hr))
+ {
+ //printf("Event code: %#04x\n Params: %d, %d\n", evCode, param1, param2);
+ cout<<"Event : "<<evCode<<" Params : "<<param1<<", "<<param2<<endl;
+ locMediaEvent->FreeEventParams(evCode, param1, param2);
+ bDone = (EC_COMPLETE == evCode);
+ }
+ }
+ }
+
+ cout<<"Finished..."<<endl;
+ int x;
+ cin>>x;
+ locMediaControl->Release();
+ locGraphBuilder->Release();
+ CoUninitialize();
+
+ return 0;
+}
+
Property changes on: trunk/oggdsf/src/tools/CLOgg/CLOgg.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/CLOgg/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/tools/CLOgg/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/CLOgg/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,39 +1,39 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.cpp : source file that includes just the standard includes
-// CLOgg.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.cpp : source file that includes just the standard includes
+// CLOgg.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/tools/CLOgg/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/CLOgg/stdafx.h
===================================================================
--- trunk/oggdsf/src/tools/CLOgg/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/CLOgg/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,43 +1,43 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-#include <stdio.h>
-#include <tchar.h>
-
-// TODO: reference additional headers your program requires here
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+#include <stdio.h>
+#include <tchar.h>
+
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/tools/CLOgg/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggCommentDump/OOOggCommentDump.cpp
===================================================================
--- trunk/oggdsf/src/tools/OOOggCommentDump/OOOggCommentDump.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggCommentDump/OOOggCommentDump.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,108 +1,108 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-
-// OOOggCommentDump.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-#include <libOOOgg.h>
-#include <dllstuff.h>
-#include <VorbisComments.h>
-#include "FileComments.h"
-#include "StreamCommentInfo.h"
-
-#include <iostream>
-
-
-#include <fstream>
-
-////This will be called by the callback
-//unsigned long bytePos;
-//VorbisComments gComments;
-//
-//bool pageCB(OggPage* inOggPage) {
-//
-// for (unsigned long i = 0; i < inOggPage->numPackets(); i++) {
-// OggPacket* locPacket = NULL;
-// locPacket = inOggPage->getPacket(i);
-// if (strncmp((const char*)locPacket->packetData(), "\003vorbis", 7) == 0) {
-// //Comment Packet
-//
-// bool locIsOK = gComments.parseOggPacket(locPacket, 7);
-// cout<<"Vorbis Comments"<<endl;
-// cout<<gComments.toString();
-// } else if ((strncmp((char*)locPacket->packetData(), "\201theora", 7)) == 0) {
-// bool locIsOK = gComments.parseOggPacket(locPacket, 7);
-// cout<<"Theora Comments"<<endl;
-// cout<<gComments.toString();
-//
-// }
-// }
-//
-// return true;
-//}
-
-#ifdef WIN32
-int __cdecl _tmain(int argc, _TCHAR* argv[])
-#else
-int main(int argc, char * argv[])
-#endif
-{
-
-
- //This program just dumps the pages out of a file in ogg format.
- // Currently does not error checking. Check your command line carefully !
- // USAGE :: OOOggCommentDump <OggFile>
- //
-
-
-
- if (argc < 2) {
- cout<<"Usage : OOOggCommentDump <filename>"<<endl;
- } else {
-
- FileComments locFileComments;
- StreamCommentInfo* locStreamInfo = NULL;
- locFileComments.loadFile(argv[1]);
- for (unsigned long i = 0; i < locFileComments.streamCount(); i++) {
- locStreamInfo = locFileComments.getStreamComment(i);
-
- cout<<"Stream "<<locStreamInfo->majorStreamNo()<<":"<<locStreamInfo->minorStreamNo()<<endl;
- cout<<"Starts "<<locStreamInfo->pageStart()<<endl;
- cout<<locStreamInfo->comments()->toString()<<endl<<endl;
-
- }
- }
-
-
- return 0;
-}
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+
+// OOOggCommentDump.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+#include <libOOOgg.h>
+#include <dllstuff.h>
+#include <VorbisComments.h>
+#include "FileComments.h"
+#include "StreamCommentInfo.h"
+
+#include <iostream>
+
+
+#include <fstream>
+
+////This will be called by the callback
+//unsigned long bytePos;
+//VorbisComments gComments;
+//
+//bool pageCB(OggPage* inOggPage) {
+//
+// for (unsigned long i = 0; i < inOggPage->numPackets(); i++) {
+// OggPacket* locPacket = NULL;
+// locPacket = inOggPage->getPacket(i);
+// if (strncmp((const char*)locPacket->packetData(), "\003vorbis", 7) == 0) {
+// //Comment Packet
+//
+// bool locIsOK = gComments.parseOggPacket(locPacket, 7);
+// cout<<"Vorbis Comments"<<endl;
+// cout<<gComments.toString();
+// } else if ((strncmp((char*)locPacket->packetData(), "\201theora", 7)) == 0) {
+// bool locIsOK = gComments.parseOggPacket(locPacket, 7);
+// cout<<"Theora Comments"<<endl;
+// cout<<gComments.toString();
+//
+// }
+// }
+//
+// return true;
+//}
+
+#ifdef WIN32
+int __cdecl _tmain(int argc, _TCHAR* argv[])
+#else
+int main(int argc, char * argv[])
+#endif
+{
+
+
+ //This program just dumps the pages out of a file in ogg format.
+ // Currently does not error checking. Check your command line carefully !
+ // USAGE :: OOOggCommentDump <OggFile>
+ //
+
+
+
+ if (argc < 2) {
+ cout<<"Usage : OOOggCommentDump <filename>"<<endl;
+ } else {
+
+ FileComments locFileComments;
+ StreamCommentInfo* locStreamInfo = NULL;
+ locFileComments.loadFile(argv[1]);
+ for (unsigned long i = 0; i < locFileComments.streamCount(); i++) {
+ locStreamInfo = locFileComments.getStreamComment(i);
+
+ cout<<"Stream "<<locStreamInfo->majorStreamNo()<<":"<<locStreamInfo->minorStreamNo()<<endl;
+ cout<<"Starts "<<locStreamInfo->pageStart()<<endl;
+ cout<<locStreamInfo->comments()->toString()<<endl<<endl;
+
+ }
+ }
+
+
+ return 0;
+}
Property changes on: trunk/oggdsf/src/tools/OOOggCommentDump/OOOggCommentDump.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggCommentDump/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/tools/OOOggCommentDump/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggCommentDump/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,38 +1,38 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-// stdafx.cpp : source file that includes just the standard includes
-// OOOggCommentDump.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+// stdafx.cpp : source file that includes just the standard includes
+// OOOggCommentDump.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/tools/OOOggCommentDump/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggCommentDump/stdafx.h
===================================================================
--- trunk/oggdsf/src/tools/OOOggCommentDump/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggCommentDump/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,44 +1,44 @@
-//===========================================================================
-//Copyright (C) 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-#include <stdio.h>
-
-#ifdef WIN32
-# include <tchar.h>
-#endif
+//===========================================================================
+//Copyright (C) 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+#include <stdio.h>
+
+#ifdef WIN32
+# include <tchar.h>
+#endif
Property changes on: trunk/oggdsf/src/tools/OOOggCommentDump/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggDump/OOOggDump.cpp
===================================================================
--- trunk/oggdsf/src/tools/OOOggDump/OOOggDump.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggDump/OOOggDump.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,106 +1,106 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// OggDump.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-#include <libOOOgg.h>
-#include <dllstuff.h>
-
-#include <iostream>
-#include <fstream>
-
-unsigned long bytePos;
-
-//This will be called by the callback
-bool pageCB(OggPage* inOggPage) {
- cout<<"Page Location : "<<bytePos;
- bytePos += inOggPage->pageSize();
- cout<<" to "<<bytePos<<endl;
- OggPacket* locPack = NULL;
- cout << inOggPage->header()->toString();
- cout << "Num Packets : " << inOggPage->numPackets() << endl;;
- for (unsigned long i = 0; i < inOggPage->numPackets(); i++) {
- locPack = inOggPage->getPacket(i);
- cout << "------ Packet " << i << " (" << locPack->packetSize() << " bytes) -------";
-
- if (locPack->isContinuation()) {
- cout<<" ** CONT **";
- }
- if (locPack->isTruncated()) {
- cout<<" ** TRUNC **";
- }
- cout<<endl;
- cout << locPack->toPackDumpString();
- }
-
- return true;
-}
-
-
-#ifdef WIN32
-int __cdecl _tmain(int argc, _TCHAR* argv[])
-#else
-int main (int argc, char * argv[])
-#endif
-{
- //This program just dumps the pages out of a file in ogg format.
- // Currently does not error checking. Check your command line carefully !
- // USAGE :: OggDump <OggFile>
- //
-
- bytePos = 0;
-
- if (argc < 2) {
- cout<<"Usage : OOOggDump <filename>"<<endl;
- } else {
- OggDataBuffer testOggBuff;
-
- testOggBuff.registerStaticCallback(&pageCB);
-
- fstream testFile;
- testFile.open(argv[1], ios_base::in | ios_base::binary);
-
- const unsigned short BUFF_SIZE = 8092;
- char* locBuff = new char[BUFF_SIZE];
- while (!testFile.eof()) {
- testFile.read(locBuff, BUFF_SIZE);
- unsigned long locBytesRead = testFile.gcount();
- testOggBuff.feed((const unsigned char*)locBuff, locBytesRead);
- }
-
- delete[] locBuff;
- }
-
- return 0;
-}
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// OggDump.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+#include <libOOOgg.h>
+#include <dllstuff.h>
+
+#include <iostream>
+#include <fstream>
+
+unsigned long bytePos;
+
+//This will be called by the callback
+bool pageCB(OggPage* inOggPage) {
+ cout<<"Page Location : "<<bytePos;
+ bytePos += inOggPage->pageSize();
+ cout<<" to "<<bytePos<<endl;
+ OggPacket* locPack = NULL;
+ cout << inOggPage->header()->toString();
+ cout << "Num Packets : " << inOggPage->numPackets() << endl;;
+ for (unsigned long i = 0; i < inOggPage->numPackets(); i++) {
+ locPack = inOggPage->getPacket(i);
+ cout << "------ Packet " << i << " (" << locPack->packetSize() << " bytes) -------";
+
+ if (locPack->isContinuation()) {
+ cout<<" ** CONT **";
+ }
+ if (locPack->isTruncated()) {
+ cout<<" ** TRUNC **";
+ }
+ cout<<endl;
+ cout << locPack->toPackDumpString();
+ }
+
+ return true;
+}
+
+
+#ifdef WIN32
+int __cdecl _tmain(int argc, _TCHAR* argv[])
+#else
+int main (int argc, char * argv[])
+#endif
+{
+ //This program just dumps the pages out of a file in ogg format.
+ // Currently does not error checking. Check your command line carefully !
+ // USAGE :: OggDump <OggFile>
+ //
+
+ bytePos = 0;
+
+ if (argc < 2) {
+ cout<<"Usage : OOOggDump <filename>"<<endl;
+ } else {
+ OggDataBuffer testOggBuff;
+
+ testOggBuff.registerStaticCallback(&pageCB);
+
+ fstream testFile;
+ testFile.open(argv[1], ios_base::in | ios_base::binary);
+
+ const unsigned short BUFF_SIZE = 8092;
+ char* locBuff = new char[BUFF_SIZE];
+ while (!testFile.eof()) {
+ testFile.read(locBuff, BUFF_SIZE);
+ unsigned long locBytesRead = testFile.gcount();
+ testOggBuff.feed((const unsigned char*)locBuff, locBytesRead);
+ }
+
+ delete[] locBuff;
+ }
+
+ return 0;
+}
+
Property changes on: trunk/oggdsf/src/tools/OOOggDump/OOOggDump.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggDump/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/tools/OOOggDump/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggDump/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,39 +1,39 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.cpp : source file that includes just the standard includes
-// OOOggDump.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.cpp : source file that includes just the standard includes
+// OOOggDump.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/tools/OOOggDump/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggDump/stdafx.h
===================================================================
--- trunk/oggdsf/src/tools/OOOggDump/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggDump/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,46 +1,46 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-#include <stdio.h>
-
-#ifdef WIN32
-# include <tchar.h>
-#endif
-
-// TODO: reference additional headers your program requires here
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+#include <stdio.h>
+
+#ifdef WIN32
+# include <tchar.h>
+#endif
+
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/tools/OOOggDump/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggPacketise/OOOggPacketDumper.cpp
===================================================================
--- trunk/oggdsf/src/tools/OOOggPacketise/OOOggPacketDumper.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggPacketise/OOOggPacketDumper.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,24 +1,24 @@
-#include "StdAfx.h"
-#include ".\oooggpacketdumper.h"
-
-OOOggPacketDumper::OOOggPacketDumper(void)
-{
-}
-
-OOOggPacketDumper::~OOOggPacketDumper(void)
-{
-}
-bool OOOggPacketDumper::acceptStampedOggPacket(StampedOggPacket* inPacket) {
-
- cout << "------ Packet : Gran Pos = "<<inPacket->endTime()<<", Size = "<< inPacket->packetSize() << " bytes -------";
-
- if (inPacket->isContinuation()) {
- cout<<" ** CONT **"; ///These should be here if you use the packetiser
- }
- if (inPacket->isTruncated()) {
- cout<<" ** TRUNC **"; ////These sohuldn't be here if using the packetiser
- }
- cout<<endl;
- cout << inPacket->toPackDumpString();
- return true;
+#include "StdAfx.h"
+#include ".\oooggpacketdumper.h"
+
+OOOggPacketDumper::OOOggPacketDumper(void)
+{
+}
+
+OOOggPacketDumper::~OOOggPacketDumper(void)
+{
+}
+bool OOOggPacketDumper::acceptStampedOggPacket(StampedOggPacket* inPacket) {
+
+ cout << "------ Packet : Gran Pos = "<<inPacket->endTime()<<", Size = "<< inPacket->packetSize() << " bytes -------";
+
+ if (inPacket->isContinuation()) {
+ cout<<" ** CONT **"; ///These should be here if you use the packetiser
+ }
+ if (inPacket->isTruncated()) {
+ cout<<" ** TRUNC **"; ////These sohuldn't be here if using the packetiser
+ }
+ cout<<endl;
+ cout << inPacket->toPackDumpString();
+ return true;
}
\ No newline at end of file
Property changes on: trunk/oggdsf/src/tools/OOOggPacketise/OOOggPacketDumper.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggPacketise/OOOggPacketDumper.h
===================================================================
--- trunk/oggdsf/src/tools/OOOggPacketise/OOOggPacketDumper.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggPacketise/OOOggPacketDumper.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,13 +1,13 @@
-#pragma once
-#include "libOOOgg.h"
-#include "IStampedOggPacketSink.h"
-class OOOggPacketDumper
- : public IStampedOggPacketSink
-{
-public:
- OOOggPacketDumper(void);
- ~OOOggPacketDumper(void);
-
- //IStampedOggPacketSink Implementation
- bool acceptStampedOggPacket(StampedOggPacket* inPacket);
-};
+#pragma once
+#include "libOOOgg.h"
+#include "IStampedOggPacketSink.h"
+class OOOggPacketDumper
+ : public IStampedOggPacketSink
+{
+public:
+ OOOggPacketDumper(void);
+ ~OOOggPacketDumper(void);
+
+ //IStampedOggPacketSink Implementation
+ bool acceptStampedOggPacket(StampedOggPacket* inPacket);
+};
Property changes on: trunk/oggdsf/src/tools/OOOggPacketise/OOOggPacketDumper.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggPacketise/OOOggPacketise.cpp
===================================================================
--- trunk/oggdsf/src/tools/OOOggPacketise/OOOggPacketise.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggPacketise/OOOggPacketise.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,102 +1,102 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// OOOggStat.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-#include <libOOOgg.h>
-#include <dllstuff.h>
-#include "OggPacketiser.h"
-#include "OOOggPacketDumper.h"
-#include <iostream>
-
-
-#include <fstream>
-
-//This will be called by the callback
-
-unsigned long streamNo;
-
-bool pageCB(OggPage* inOggPage) {
- //if (inOggPage->header()->isBOS()) {
- // streamNo++;
- //}
-
-
-
-
-
- return true;
-}
-
-
-int __cdecl _tmain(int argc, _TCHAR* argv[])
-{
-
-
- int x;
- cin>>x;
- //This program just dumps the packets out of a file in ogg format.
- // Currently does not error checking. Check your command line carefully !
- // USAGE :: OOOggPacketise <OggFile>
- //
- if (argc < 2) {
- cout<<"Usage : OOOggPacketise <filename>"<<endl;
- } else {
- streamNo = 0;
- OggDataBuffer testOggBuff;
- OOOggPacketDumper testPacketDumper;
- OggPacketiser* testPacketiser = new OggPacketiser(&testPacketDumper);
-
- testOggBuff.registerVirtualCallback(testPacketiser);
-
-
- const BUFF_SIZE = 8092;
- //testOggBuff.registerStaticCallback(&pageCB);
-
- fstream testFile;
- testFile.open(argv[1], ios_base::in | ios_base::binary);
- char* locBuff = new char[BUFF_SIZE];
- while (!testFile.eof()) {
- testFile.read(locBuff, BUFF_SIZE);
- unsigned long locBytesRead = testFile.gcount();
- testOggBuff.feed((const unsigned char*)locBuff, locBytesRead);
- }
-
- delete locBuff;
- }
-
-
- return 0;
-}
-
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// OOOggStat.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+#include <libOOOgg.h>
+#include <dllstuff.h>
+#include "OggPacketiser.h"
+#include "OOOggPacketDumper.h"
+#include <iostream>
+
+
+#include <fstream>
+
+//This will be called by the callback
+
+unsigned long streamNo;
+
+bool pageCB(OggPage* inOggPage) {
+ //if (inOggPage->header()->isBOS()) {
+ // streamNo++;
+ //}
+
+
+
+
+
+ return true;
+}
+
+
+int __cdecl _tmain(int argc, _TCHAR* argv[])
+{
+
+
+ int x;
+ cin>>x;
+ //This program just dumps the packets out of a file in ogg format.
+ // Currently does not error checking. Check your command line carefully !
+ // USAGE :: OOOggPacketise <OggFile>
+ //
+ if (argc < 2) {
+ cout<<"Usage : OOOggPacketise <filename>"<<endl;
+ } else {
+ streamNo = 0;
+ OggDataBuffer testOggBuff;
+ OOOggPacketDumper testPacketDumper;
+ OggPacketiser* testPacketiser = new OggPacketiser(&testPacketDumper);
+
+ testOggBuff.registerVirtualCallback(testPacketiser);
+
+
+ const BUFF_SIZE = 8092;
+ //testOggBuff.registerStaticCallback(&pageCB);
+
+ fstream testFile;
+ testFile.open(argv[1], ios_base::in | ios_base::binary);
+ char* locBuff = new char[BUFF_SIZE];
+ while (!testFile.eof()) {
+ testFile.read(locBuff, BUFF_SIZE);
+ unsigned long locBytesRead = testFile.gcount();
+ testOggBuff.feed((const unsigned char*)locBuff, locBytesRead);
+ }
+
+ delete locBuff;
+ }
+
+
+ return 0;
+}
+
+
Property changes on: trunk/oggdsf/src/tools/OOOggPacketise/OOOggPacketise.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggPacketise/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/tools/OOOggPacketise/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggPacketise/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// OOOggPacketise.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// OOOggPacketise.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/tools/OOOggPacketise/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggPacketise/stdafx.h
===================================================================
--- trunk/oggdsf/src/tools/OOOggPacketise/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggPacketise/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,12 +1,12 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-#include <iostream>
-#include <tchar.h>
-
-// TODO: reference additional headers your program requires here
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#include <iostream>
+#include <tchar.h>
+
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/tools/OOOggPacketise/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggSeekFileMaker/OOOggSeekFileMaker.cpp
===================================================================
--- trunk/oggdsf/src/tools/OOOggSeekFileMaker/OOOggSeekFileMaker.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggSeekFileMaker/OOOggSeekFileMaker.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,75 +1,75 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// OggDump.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-#include "AutoOggSeekTable.h"
-
-
-#include <iostream>
-#include <fstream>
-
-#ifdef WIN32
-int __cdecl _tmain(int argc, _TCHAR* argv[])
-#else
-int main(int argc, char * argv[])
-#endif
-{
-
-
-
- if (argc < 3) {
- cout<<"Usage : OOOggSeekFileMaker <in_ogg_file> <out_seek_table_file>"<<endl;
- } else {
-
-
- AutoOggSeekTable* locSeekTable = new AutoOggSeekTable(argv[1]);
- locSeekTable->buildTable();
-
- fstream outputFile;
- outputFile.open(argv[2], ios_base::out | ios_base::binary);
-
- unsigned char* locBuff = new unsigned char[locSeekTable->serialisedSize()];
- locSeekTable->serialiseInto(locBuff, locSeekTable->serialisedSize());
-
- outputFile.write((char*)locBuff, locSeekTable->serialisedSize());
-
- outputFile.close();
-
- delete [] locBuff;
- delete locSeekTable;
- }
-
- return 0;
-}
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// OggDump.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+#include "AutoOggSeekTable.h"
+
+
+#include <iostream>
+#include <fstream>
+
+#ifdef WIN32
+int __cdecl _tmain(int argc, _TCHAR* argv[])
+#else
+int main(int argc, char * argv[])
+#endif
+{
+
+
+
+ if (argc < 3) {
+ cout<<"Usage : OOOggSeekFileMaker <in_ogg_file> <out_seek_table_file>"<<endl;
+ } else {
+
+
+ AutoOggSeekTable* locSeekTable = new AutoOggSeekTable(argv[1]);
+ locSeekTable->buildTable();
+
+ fstream outputFile;
+ outputFile.open(argv[2], ios_base::out | ios_base::binary);
+
+ unsigned char* locBuff = new unsigned char[locSeekTable->serialisedSize()];
+ locSeekTable->serialiseInto(locBuff, locSeekTable->serialisedSize());
+
+ outputFile.write((char*)locBuff, locSeekTable->serialisedSize());
+
+ outputFile.close();
+
+ delete [] locBuff;
+ delete locSeekTable;
+ }
+
+ return 0;
+}
+
Property changes on: trunk/oggdsf/src/tools/OOOggSeekFileMaker/OOOggSeekFileMaker.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggSeekFileMaker/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/tools/OOOggSeekFileMaker/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggSeekFileMaker/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// OOOggSeekFileMaker.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// OOOggSeekFileMaker.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/tools/OOOggSeekFileMaker/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggSeekFileMaker/stdafx.h
===================================================================
--- trunk/oggdsf/src/tools/OOOggSeekFileMaker/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggSeekFileMaker/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,13 +1,13 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-#include <iostream>
-
-#ifdef WIN32
-# include <tchar.h>
-#endif
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#include <iostream>
+
+#ifdef WIN32
+# include <tchar.h>
+#endif
Property changes on: trunk/oggdsf/src/tools/OOOggSeekFileMaker/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggSeekFileReader/OOOggSeekFileReader.cpp
===================================================================
--- trunk/oggdsf/src/tools/OOOggSeekFileReader/OOOggSeekFileReader.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggSeekFileReader/OOOggSeekFileReader.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,49 +1,49 @@
-// OOOggSeekFileReader.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-
-#include "illicoreconfig.h"
-#include "iLE_Math.h"
-#include <iostream>
-#include <fstream>
-using namespace std;
-
-#ifdef WIN32
-int __cdecl _tmain(int argc, _TCHAR* argv[])
-#else
-int main(int argc, char * argv[])
-#endif
-{
-
- if (argc < 2) {
- cout << "Usage : OOOggSeekFileReader <seek_table_file>"<<endl;
-
- } else {
- LOOG_INT64 timePoint;
- unsigned long bytePos;
-
- fstream seekFile;
- seekFile.open(argv[1], ios_base::in | ios_base::binary);
-
- unsigned char* buff = new unsigned char[16];
- unsigned long pointCount = 0;
- while (!seekFile.eof()) {
- //Read the time
- seekFile.read((char*)buff, 8);
- timePoint = iLE_Math::CharArrToInt64(buff);
-
- //Read the byte offset
- seekFile.read((char*)buff, 4);
- bytePos = iLE_Math::charArrToULong(buff);
-
- cout << "Seek point "<<pointCount<<" : Time = "<<timePoint<<", Byte Offset = "<<bytePos<<endl;
-
-
- }
-
- delete buff;
- }
- return 0;
-}
-
+// OOOggSeekFileReader.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+
+#include "illicoreconfig.h"
+#include "iLE_Math.h"
+#include <iostream>
+#include <fstream>
+using namespace std;
+
+#ifdef WIN32
+int __cdecl _tmain(int argc, _TCHAR* argv[])
+#else
+int main(int argc, char * argv[])
+#endif
+{
+
+ if (argc < 2) {
+ cout << "Usage : OOOggSeekFileReader <seek_table_file>"<<endl;
+
+ } else {
+ LOOG_INT64 timePoint;
+ unsigned long bytePos;
+
+ fstream seekFile;
+ seekFile.open(argv[1], ios_base::in | ios_base::binary);
+
+ unsigned char* buff = new unsigned char[16];
+ unsigned long pointCount = 0;
+ while (!seekFile.eof()) {
+ //Read the time
+ seekFile.read((char*)buff, 8);
+ timePoint = iLE_Math::CharArrToInt64(buff);
+
+ //Read the byte offset
+ seekFile.read((char*)buff, 4);
+ bytePos = iLE_Math::charArrToULong(buff);
+
+ cout << "Seek point "<<pointCount<<" : Time = "<<timePoint<<", Byte Offset = "<<bytePos<<endl;
+
+
+ }
+
+ delete buff;
+ }
+ return 0;
+}
+
Property changes on: trunk/oggdsf/src/tools/OOOggSeekFileReader/OOOggSeekFileReader.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggSeekFileReader/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/tools/OOOggSeekFileReader/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggSeekFileReader/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// OOOggSeekFileReader.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// OOOggSeekFileReader.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/tools/OOOggSeekFileReader/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggSeekFileReader/stdafx.h
===================================================================
--- trunk/oggdsf/src/tools/OOOggSeekFileReader/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggSeekFileReader/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,13 +1,13 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-#include <iostream>
-
-#ifdef WIN32
-# include <tchar.h>
-#endif
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#include <iostream>
+
+#ifdef WIN32
+# include <tchar.h>
+#endif
Property changes on: trunk/oggdsf/src/tools/OOOggSeekFileReader/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggStat/OOOggStat.cpp
===================================================================
--- trunk/oggdsf/src/tools/OOOggStat/OOOggStat.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggStat/OOOggStat.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,128 +1,128 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// OOOggStat.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-#include <libOOOgg.h>
-#include <dllstuff.h>
-
-#include <iostream>
-
-
-#include <fstream>
-
-//This will be called by the callback
-
-unsigned long streamNo;
-
-bool pageCB(OggPage* inOggPage) {
- if ((inOggPage->numPackets() > 0) && (inOggPage->header()->isBOS())) {
- streamNo++;
- OggPacket* locFirstPack = inOggPage->getPacket(0);
-
- if (strncmp((char*)locFirstPack->packetData(), "\001vorbis", 7) == 0) {
- cout<<"Stream "<<streamNo<<" : Audio/Vorbis "<<endl;
- } else if (strncmp((char*)locFirstPack->packetData(), "Speex ", 8) == 0) {
- cout<<"Stream "<<streamNo<<" : Audio/Speex "<<endl;
- } else if ((strncmp((char*)locFirstPack->packetData(), "fLaC", 4)) == 0) {
- cout<<"Stream "<<streamNo<<" : Audio/FLAC "<<endl;
- } else if ((strncmp((char*)locFirstPack->packetData(), "\200theora", 7)) == 0) {
- cout<<"Stream "<<streamNo<<" : Video/Theora "<<endl;
- } else if ((strncmp((char*)locFirstPack->packetData(), "\001video\000\000\000", 9)) == 0) {
- unsigned char* locPackData = locFirstPack->packetData();
- unsigned char* locFourCCString = new unsigned char[5];
- for (int i = 0; i < 4; i++) {
- locFourCCString[i] = locPackData[9+i];
- }
- locFourCCString[4] = 0;
-
- string locPinName = (char*)locFourCCString;
- cout<<"Stream "<<streamNo<<" : Video/"<<locPinName<<endl;
- } else {
- cout<<"Stream "<<streamNo<<" : Unknown Stream"<<endl;
- }
- }
-
-
- //cout << inOggPage->header()->toString();
- //cout << "Num Packets : " << inOggPage->numPackets() << endl;;
- //for (unsigned long i = 0; i < inOggPage->numPackets(); i++) {
- // locPack = inOggPage->getPacket(i);
- // cout << "------ Packet "<< i <<" (";
- // cout<<locPack->packetSize()<< " bytes) -------";
- //
- // if (!locPack->isComplete()) {
- // cout<<" ** INCOMPLETE **";
- // }
- // cout<<endl;
- // cout << locPack->toPackDumpString();
- //}
-
- return true;
-}
-
-#ifdef WIN32
-int __cdecl _tmain(int argc, _TCHAR* argv[])
-#else
-int main(int argc, char * argv[])
-#endif
-{
-
-
-
- if (argc < 2) {
- cout<<"Usage : OOOggStat <filename>"<<endl;
- } else {
- streamNo = 0;
- OggDataBuffer testOggBuff;
- //OggCallbackRego* locCBRego = new OggCallbackRego(&pageCB);
- const BUFF_SIZE = 8092;
- testOggBuff.registerStaticCallback(&pageCB);
-
- fstream testFile;
- testFile.open(argv[1], ios_base::in | ios_base::binary);
- char* locBuff = new char[BUFF_SIZE];
- while (!testFile.eof()) {
- testFile.read(locBuff, BUFF_SIZE);
- unsigned long locBytesRead = testFile.gcount();
- testOggBuff.feed((const unsigned char*)locBuff, locBytesRead);
- }
-
- delete[] locBuff;
- }
-
-
- return 0;
-}
-
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// OOOggStat.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+#include <libOOOgg.h>
+#include <dllstuff.h>
+
+#include <iostream>
+
+
+#include <fstream>
+
+//This will be called by the callback
+
+unsigned long streamNo;
+
+bool pageCB(OggPage* inOggPage) {
+ if ((inOggPage->numPackets() > 0) && (inOggPage->header()->isBOS())) {
+ streamNo++;
+ OggPacket* locFirstPack = inOggPage->getPacket(0);
+
+ if (strncmp((char*)locFirstPack->packetData(), "\001vorbis", 7) == 0) {
+ cout<<"Stream "<<streamNo<<" : Audio/Vorbis "<<endl;
+ } else if (strncmp((char*)locFirstPack->packetData(), "Speex ", 8) == 0) {
+ cout<<"Stream "<<streamNo<<" : Audio/Speex "<<endl;
+ } else if ((strncmp((char*)locFirstPack->packetData(), "fLaC", 4)) == 0) {
+ cout<<"Stream "<<streamNo<<" : Audio/FLAC "<<endl;
+ } else if ((strncmp((char*)locFirstPack->packetData(), "\200theora", 7)) == 0) {
+ cout<<"Stream "<<streamNo<<" : Video/Theora "<<endl;
+ } else if ((strncmp((char*)locFirstPack->packetData(), "\001video\000\000\000", 9)) == 0) {
+ unsigned char* locPackData = locFirstPack->packetData();
+ unsigned char* locFourCCString = new unsigned char[5];
+ for (int i = 0; i < 4; i++) {
+ locFourCCString[i] = locPackData[9+i];
+ }
+ locFourCCString[4] = 0;
+
+ string locPinName = (char*)locFourCCString;
+ cout<<"Stream "<<streamNo<<" : Video/"<<locPinName<<endl;
+ } else {
+ cout<<"Stream "<<streamNo<<" : Unknown Stream"<<endl;
+ }
+ }
+
+
+ //cout << inOggPage->header()->toString();
+ //cout << "Num Packets : " << inOggPage->numPackets() << endl;;
+ //for (unsigned long i = 0; i < inOggPage->numPackets(); i++) {
+ // locPack = inOggPage->getPacket(i);
+ // cout << "------ Packet "<< i <<" (";
+ // cout<<locPack->packetSize()<< " bytes) -------";
+ //
+ // if (!locPack->isComplete()) {
+ // cout<<" ** INCOMPLETE **";
+ // }
+ // cout<<endl;
+ // cout << locPack->toPackDumpString();
+ //}
+
+ return true;
+}
+
+#ifdef WIN32
+int __cdecl _tmain(int argc, _TCHAR* argv[])
+#else
+int main(int argc, char * argv[])
+#endif
+{
+
+
+
+ if (argc < 2) {
+ cout<<"Usage : OOOggStat <filename>"<<endl;
+ } else {
+ streamNo = 0;
+ OggDataBuffer testOggBuff;
+ //OggCallbackRego* locCBRego = new OggCallbackRego(&pageCB);
+ const BUFF_SIZE = 8092;
+ testOggBuff.registerStaticCallback(&pageCB);
+
+ fstream testFile;
+ testFile.open(argv[1], ios_base::in | ios_base::binary);
+ char* locBuff = new char[BUFF_SIZE];
+ while (!testFile.eof()) {
+ testFile.read(locBuff, BUFF_SIZE);
+ unsigned long locBytesRead = testFile.gcount();
+ testOggBuff.feed((const unsigned char*)locBuff, locBytesRead);
+ }
+
+ delete[] locBuff;
+ }
+
+
+ return 0;
+}
+
+
Property changes on: trunk/oggdsf/src/tools/OOOggStat/OOOggStat.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggStat/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/tools/OOOggStat/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggStat/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// OOOggStat.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// OOOggStat.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/tools/OOOggStat/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggStat/stdafx.h
===================================================================
--- trunk/oggdsf/src/tools/OOOggStat/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggStat/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,13 +1,13 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
-#include <stdio.h>
-
-#ifdef WIN32
-# include <tchar.h>
-#endif
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
+#include <stdio.h>
+
+#ifdef WIN32
+# include <tchar.h>
+#endif
Property changes on: trunk/oggdsf/src/tools/OOOggStat/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggValidate/OOOggValidate.cpp
===================================================================
--- trunk/oggdsf/src/tools/OOOggValidate/OOOggValidate.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggValidate/OOOggValidate.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,86 +1,86 @@
-// OOOggValidate.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-#include "OggValidationState.h"
-#include "libOOOgg.h"
-#include <fstream>
-using namespace std;
-
-
-
-
-#ifdef WIN32
-int __cdecl _tmain(int argc, _TCHAR* argv[])
-#else
-int main(int argc, char * argv[])
-#endif
-{
- //This program just dumps the pages out of a file in ogg format.
- // Currently does not error checking. Check your command line carefully !
- // USAGE :: OOOggValidate <OggFile>
- //
- //bytePos = 0;
-
-
-
- if (argc < 2) {
- cout<<"Usage : OOOggValidate <filename>"<<endl;
- } else {
- OggValidationState testValidator;
- OggDataBuffer testOggBuff;
- testOggBuff.registerVirtualCallback(&testValidator);
-
-
- const BUFF_SIZE = 8092;
-
- fstream testFile;
- testFile.open(argv[1], ios_base::in | ios_base::binary);
- char* locBuff = new char[BUFF_SIZE];
- OggDataBuffer::eFeedResult locResult;
- while (!testFile.eof()) {
- testFile.read(locBuff, BUFF_SIZE);
- unsigned long locBytesRead = testFile.gcount();
- locResult = testOggBuff.feed((const unsigned char*)locBuff, locBytesRead);
- switch(locResult) {
- case OggValidationState::OVE_OK:
- break;
-
- case OggValidationState::OVE_STRUCTURE_VERSION_NOT_ZERO:
- testValidator.error_write(OggValidationState::OVE_STRUCTURE_VERSION_NOT_ZERO, NULL , NULL);
- return OggValidationState::OVE_STRUCTURE_VERSION_NOT_ZERO;
-
- case OggValidationState::OVE_MORE_THAN_ONE_BOS:
- testValidator.error_write(OggValidationState::OVE_MORE_THAN_ONE_BOS, NULL, NULL);
- return OggValidationState::OVE_MORE_THAN_ONE_BOS;
-
- case OggValidationState::OVE_MORE_THAN_ONE_EOS:
- testValidator.error_write(OggValidationState::OVE_MORE_THAN_ONE_EOS, NULL, NULL);
- return OggValidationState::OVE_MORE_THAN_ONE_EOS;
-
- case OggValidationState::OVE_BOS_PAGE_NOT_AT_START:
- testValidator.error_write(OggValidationState::OVE_BOS_PAGE_NOT_AT_START, NULL, NULL);
- return OggValidationState::OVE_BOS_PAGE_NOT_AT_START;
-
- case OggValidationState::OVE_EOS_BEFORE_BOS:
- testValidator.error_write(OggValidationState::OVE_EOS_BEFORE_BOS, NULL, NULL);
- return OggValidationState::OVE_EOS_BEFORE_BOS;
- default:
- testValidator.error_write(locResult, NULL, NULL);
- return locResult;
-
- }
- }
-
- if (testValidator.isValid()) {
- cout<<"File was valid."<<endl;
- } else {
- cout<<"File is invalid."<<endl;
- }
- delete[] locBuff;
- }
-
-
- return 0;
-}
-
+// OOOggValidate.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+#include "OggValidationState.h"
+#include "libOOOgg.h"
+#include <fstream>
+using namespace std;
+
+
+
+
+#ifdef WIN32
+int __cdecl _tmain(int argc, _TCHAR* argv[])
+#else
+int main(int argc, char * argv[])
+#endif
+{
+ //This program just dumps the pages out of a file in ogg format.
+ // Currently does not error checking. Check your command line carefully !
+ // USAGE :: OOOggValidate <OggFile>
+ //
+ //bytePos = 0;
+
+
+
+ if (argc < 2) {
+ cout<<"Usage : OOOggValidate <filename>"<<endl;
+ } else {
+ OggValidationState testValidator;
+ OggDataBuffer testOggBuff;
+ testOggBuff.registerVirtualCallback(&testValidator);
+
+
+ const BUFF_SIZE = 8092;
+
+ fstream testFile;
+ testFile.open(argv[1], ios_base::in | ios_base::binary);
+ char* locBuff = new char[BUFF_SIZE];
+ OggDataBuffer::eFeedResult locResult;
+ while (!testFile.eof()) {
+ testFile.read(locBuff, BUFF_SIZE);
+ unsigned long locBytesRead = testFile.gcount();
+ locResult = testOggBuff.feed((const unsigned char*)locBuff, locBytesRead);
+ switch(locResult) {
+ case OggValidationState::OVE_OK:
+ break;
+
+ case OggValidationState::OVE_STRUCTURE_VERSION_NOT_ZERO:
+ testValidator.error_write(OggValidationState::OVE_STRUCTURE_VERSION_NOT_ZERO, NULL , NULL);
+ return OggValidationState::OVE_STRUCTURE_VERSION_NOT_ZERO;
+
+ case OggValidationState::OVE_MORE_THAN_ONE_BOS:
+ testValidator.error_write(OggValidationState::OVE_MORE_THAN_ONE_BOS, NULL, NULL);
+ return OggValidationState::OVE_MORE_THAN_ONE_BOS;
+
+ case OggValidationState::OVE_MORE_THAN_ONE_EOS:
+ testValidator.error_write(OggValidationState::OVE_MORE_THAN_ONE_EOS, NULL, NULL);
+ return OggValidationState::OVE_MORE_THAN_ONE_EOS;
+
+ case OggValidationState::OVE_BOS_PAGE_NOT_AT_START:
+ testValidator.error_write(OggValidationState::OVE_BOS_PAGE_NOT_AT_START, NULL, NULL);
+ return OggValidationState::OVE_BOS_PAGE_NOT_AT_START;
+
+ case OggValidationState::OVE_EOS_BEFORE_BOS:
+ testValidator.error_write(OggValidationState::OVE_EOS_BEFORE_BOS, NULL, NULL);
+ return OggValidationState::OVE_EOS_BEFORE_BOS;
+ default:
+ testValidator.error_write(locResult, NULL, NULL);
+ return locResult;
+
+ }
+ }
+
+ if (testValidator.isValid()) {
+ cout<<"File was valid."<<endl;
+ } else {
+ cout<<"File is invalid."<<endl;
+ }
+ delete[] locBuff;
+ }
+
+
+ return 0;
+}
+
Property changes on: trunk/oggdsf/src/tools/OOOggValidate/OOOggValidate.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggValidate/OggStreamValidationState.cpp
===================================================================
--- trunk/oggdsf/src/tools/OOOggValidate/OggStreamValidationState.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggValidate/OggStreamValidationState.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,19 +1,19 @@
-#include "StdAfx.h"
-#include "oggstreamvalidationstate.h"
-
-OggStreamValidationState::OggStreamValidationState(void)
- : mSerialNo(0)
- , mGranulePosUpto(0)
- , mSequenceNoUpto(0)
- , mSeenBOS(false)
- , mSeenEOS(false)
- , mSeenAnything(false)
- , mErrorCount(0)
- , mWarningCount(0)
- , mState(VS_SEEN_NOTHING)
-{
-}
-
-OggStreamValidationState::~OggStreamValidationState(void)
-{
-}
+#include "StdAfx.h"
+#include "oggstreamvalidationstate.h"
+
+OggStreamValidationState::OggStreamValidationState(void)
+ : mSerialNo(0)
+ , mGranulePosUpto(0)
+ , mSequenceNoUpto(0)
+ , mSeenBOS(false)
+ , mSeenEOS(false)
+ , mSeenAnything(false)
+ , mErrorCount(0)
+ , mWarningCount(0)
+ , mState(VS_SEEN_NOTHING)
+{
+}
+
+OggStreamValidationState::~OggStreamValidationState(void)
+{
+}
Property changes on: trunk/oggdsf/src/tools/OOOggValidate/OggStreamValidationState.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggValidate/OggStreamValidationState.h
===================================================================
--- trunk/oggdsf/src/tools/OOOggValidate/OggStreamValidationState.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggValidate/OggStreamValidationState.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,34 +1,34 @@
-#pragma once
-
-#include <libilliCore.h>
-
-class OggStreamValidationState
-{
-public:
- OggStreamValidationState(void);
- ~OggStreamValidationState(void);
-
- enum eOggStreamValidationState {
- VS_FULLY_VALID,
-
- VS_SEEN_NOTHING,
- VS_SEEN_BOS,
- VS_SEEN_EOS,
- VS_WAITING_FOR_CONTINUATION,
- VS_INVALID
-
- };
- unsigned long mSerialNo;
- LOOG_INT64 mGranulePosUpto;
- unsigned long mSequenceNoUpto;
-
- bool mSeenAnything;
- unsigned long mSeenBOS;
- unsigned long mSeenEOS;
-
- unsigned long mErrorCount;
- unsigned long mWarningCount;
-
- eOggStreamValidationState mState;
-
-};
+#pragma once
+
+#include <libilliCore.h>
+
+class OggStreamValidationState
+{
+public:
+ OggStreamValidationState(void);
+ ~OggStreamValidationState(void);
+
+ enum eOggStreamValidationState {
+ VS_FULLY_VALID,
+
+ VS_SEEN_NOTHING,
+ VS_SEEN_BOS,
+ VS_SEEN_EOS,
+ VS_WAITING_FOR_CONTINUATION,
+ VS_INVALID
+
+ };
+ unsigned long mSerialNo;
+ LOOG_INT64 mGranulePosUpto;
+ unsigned long mSequenceNoUpto;
+
+ bool mSeenAnything;
+ unsigned long mSeenBOS;
+ unsigned long mSeenEOS;
+
+ unsigned long mErrorCount;
+ unsigned long mWarningCount;
+
+ eOggStreamValidationState mState;
+
+};
Property changes on: trunk/oggdsf/src/tools/OOOggValidate/OggStreamValidationState.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggValidate/OggValidationState.cpp
===================================================================
--- trunk/oggdsf/src/tools/OOOggValidate/OggValidationState.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggValidate/OggValidationState.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,357 +1,357 @@
-#include "StdAfx.h"
-#include "oggvalidationstate.h"
-
-OggValidationState::OggValidationState(void)
- : mNumBOS(0)
- , mNumEOS(0)
- , mExpectingBOS(false)
- , mIsValid(false)
- , mState(FVS_SEEN_NOTHING)
-
-{
-}
-
-OggValidationState::~OggValidationState(void)
-{
-}
-
-
-OggStreamValidationState* OggValidationState::getStreamBySerialNo(unsigned long inSerialNo) {
- //Find this stream.... or make a new one.
-
- for (size_t i = 0; i < mStreams.size(); i++) {
- if (mStreams[i]->mSerialNo == inSerialNo) {
- return mStreams[i];
- }
- }
-
- OggStreamValidationState* retStream = new OggStreamValidationState;
-
- retStream->mSerialNo = inSerialNo;
- mStreams.push_back(retStream);
-
- return retStream;
-}
-unsigned long OggValidationState::numStreams() {
- return mStreams.size();
-}
-
-OggStreamValidationState* OggValidationState::getStream(unsigned long inIndex) {
- //gets the indexed string from the vector
-
- if (inIndex < mStreams.size()) {
- return mStreams[inIndex];
- } else {
- return NULL;
- }
-
-}
-
-bool OggValidationState::notify(bool isBOS, bool isEOS) {
- bool locOK = true;
- if (mState == FVS_SEEN_NOTHING) {
- mState = FVS_AWAITING_BOS;
- //throw 0;
- }
-
- mIsValid = false;
-
- if (isBOS) {
- mNumBOS++;
- if (mState == FVS_AWAITING_BOS) {
- //Valid case.
-
- } else {
- //Unexpected BOS page.
- mState = FVS_INVALID;
- locOK = false;
- }
-
- if (mNumBOS == mNumEOS) {
- //Start of chain
- }
- }
-
- if (isEOS) {
- mNumEOS++;
- if (mState == FVS_AWAITING_BOS || mState == FVS_AWAITING_EOS) {
-
- if (mNumBOS == mNumEOS) {
- //Valid case. Chain.
- //We are here because we've seen an equal number of EOS and BOS and at least 1 EOS(this one)
- // This happens whenever a complete chain of streams complete and/or the end of a complete physical bitstream.
- //
- //This is the only place it's possible for isValid to become true.
- // It is true when an equal number of eos and bos pages are seen,
- // and all streams are also considered fully valid.
-
- //If this EOS balanced the eos = bos then we can accept bos pages again.
- mState = FVS_AWAITING_BOS;
-
-
- if (mStreams.size() != 0) {
- mIsValid = true;
- for (int i = 0; i < mStreams.size(); i++) {
- mIsValid &= (mStreams[i]->mState == OggStreamValidationState::VS_FULLY_VALID);
- }
- }
- } else {
- mState = FVS_AWAITING_EOS;
- }
- } else {
- mState = FVS_INVALID;
- locOK = false;
- }
-
- //Check for entire stream validity
-
-
- }
-
- if (!isBOS && !isEOS) {
- //This is used because BOS pages must follow each other, after a non BOS page, no more BOS
- // pages can occur until all currently open streams have seen an EOS.
- if (mState == FVS_AWAITING_BOS || mState == FVS_AWAITING_EOS) {
- //Valid case.
- //This happens the first non-bos, non-eos page, when in awaiting BOS state.
-
- mState = FVS_AWAITING_EOS;
- } else {
-
- mState = FVS_INVALID;
- locOK = false;
- }
- }
-
- return mIsValid;
-
-}
-
-bool OggValidationState::isValid() {
- return mIsValid;
-}
-bool OggValidationState::acceptOggPage(OggPage* inOggPage) { //AOP:::Needs validation
- //Validate the page header
-
-
- OggStreamValidationState* locStreamState = getStreamBySerialNo(inOggPage->header()->StreamSerialNo());
-
- OggPageHeader* locHeader = inOggPage->header();
-
- //If this stream previously was valid, it should have no more data... so it's no longer valid.
- if (locStreamState->mState == OggStreamValidationState::VS_FULLY_VALID) {
- error_write(OVE_DATA_AFTER_VALID_STREAM,inOggPage, locStreamState);
- mIsValid = false;
- locStreamState->mState = OggStreamValidationState::VS_INVALID;
- //Should return ?
- }
-
- const int UNUSED_HEADER_MASK = 248; //11111000
- const int OGG_FLAG_CONTINUATION = 1;
- if ((locHeader->HeaderFlags() & UNUSED_HEADER_MASK) != 0) {
- //Unused header bits are set.
- error_write(OVE_UNUSED_HEADER_BITS_SET, inOggPage, locStreamState);
- mIsValid = false;
- locStreamState->mState = OggStreamValidationState::VS_INVALID;
- }
-
- if (locStreamState->mState == OggStreamValidationState::VS_WAITING_FOR_CONTINUATION) {
- //Last page had an incomplete packet, so expecting a continuation flag on this page
- if ((locHeader->HeaderFlags() & OGG_FLAG_CONTINUATION) != 0) {
- //Valid case.
-
- //Got the continuation we were expecting.
- locStreamState->mState = OggStreamValidationState::VS_SEEN_BOS;
- } else {
- //There should have been a continuation flag here.
- error_write(OVE_CONTINUATION_FLAG_EXPECTED, inOggPage, locStreamState);
- mIsValid = false;
- locStreamState->mState = OggStreamValidationState::VS_INVALID;
- }
- } else {
- if ((locHeader->HeaderFlags() & OGG_FLAG_CONTINUATION) != 0) {
- //We have a continuation flag we weren't expecting.
- error_write(OVE_UNEXPECTED_CONTINUATION_FLAG, inOggPage, locStreamState);
- mIsValid = false;
- locStreamState->mState = OggStreamValidationState::VS_INVALID;
-
- }
- }
-
-
- //----------------------------------------------------------------------
- //Verify structure version is 0 (RFC 3533 Sec. 6.1)
- if (locHeader->StructureVersion() != 0) {
- error_write(OVE_STRUCTURE_VERSION_NOT_ZERO, inOggPage, locStreamState);
- mIsValid = false;
- }
- //----------------------------------------------------------------------
- //Verify BOS integrity.
-
- if (locHeader->isBOS()) {
-
-
-
- if (locStreamState->mState == OggStreamValidationState::VS_SEEN_NOTHING) {
- //Valid case.
- locStreamState->mState = OggStreamValidationState::VS_SEEN_BOS;
- }
-
-
-
- //Check is BOS is first page in stream
- if (locStreamState->mSeenAnything == true) {
- error_write(OVE_BOS_PAGE_NOT_AT_START,inOggPage, locStreamState);
- mIsValid = false;
- }
- //Check if this is the second or more BOS page.
- if (locStreamState->mSeenBOS) {
- error_write(OVE_MORE_THAN_ONE_BOS,inOggPage, locStreamState);
- mIsValid = false;
- }
-
- locStreamState->mSeenBOS = true;
-
- }
-
- //----------------------------------------------------------------------
- //Verify EOS integrity
- if (locHeader->isEOS()) {
-
-
-
- if (locStreamState->mState == OggStreamValidationState::VS_SEEN_BOS) {
- //Valid case.
- locStreamState->mState = OggStreamValidationState::VS_FULLY_VALID;
- }
-
-
- //Check is BOS has been seen before this EOS
- if (locStreamState->mSeenBOS == false) {
- error_write(OVE_EOS_BEFORE_BOS,inOggPage, locStreamState);
- mIsValid = false;
- }
- //Check if this is the second or more BOS page.
- if (locStreamState->mSeenEOS) {
- error_write(OVE_MORE_THAN_ONE_EOS, inOggPage, locStreamState);
- mIsValid = false;
- }
-
- locStreamState->mSeenEOS = true;
- }
-
- //----------------------------------------------------------------------
- //Verify Granule pos
- if (locHeader->GranulePos() != -1) {
- //Check if the granule pos decreased.
- if (locHeader->GranulePos() < locStreamState->mGranulePosUpto) {
- error_write(OVE_GRANULE_POS_DECREASED, inOggPage, locStreamState);
- mIsValid = false;
- }
-
-
- locStreamState->mGranulePosUpto = locHeader->GranulePos();
-
- } else {
- //No packets end here
- }
-
-
- //----------------------------------------------------------------------
-
- //Verify sequence No
- if (locHeader->PageSequenceNo() == locStreamState->mSequenceNoUpto) {
- //error_write(OVE_SEQUENCE_NO_REPEATED, inOggPage, locStreamState);
- //mIsValid = false;
- } else if (locHeader->PageSequenceNo() < locStreamState->mSequenceNoUpto) {
- error_write(OVE_SEQUENCE_NO_DECREASED, inOggPage, locStreamState);
- mIsValid = false;
- } else {
- locStreamState->mSequenceNoUpto = locHeader->PageSequenceNo();
- }
- //----------------------------------------------------------------------
-
- //----------------------------------------------------------------------
-
- //Check for incomplete last packet
- if (inOggPage->numPackets() > 0) {
- if (inOggPage->getPacket(inOggPage->numPackets() - 1)->isTruncated() == true) {
- //Valid case
- //If the last packet is incomplete.
- if (OggStreamValidationState::VS_SEEN_BOS) {
- //...And we've seen a BOS page
-
- //Now we wait for the continuation
- locStreamState->mState = OggStreamValidationState::VS_WAITING_FOR_CONTINUATION;
- } else {
- //Does this mean anythign ?
- //Normal untruncated packet.
- }
- }
- }
- //----------------------------------------------------------------------
- //----------------------------------------------------------------------
-
-
- notify(inOggPage->header()->isBOS(), inOggPage->header()->isEOS());
- return true;
-}
-
-OggValidationState::eOggValidationState OggValidationState::validationState() {
- return mState;
-}
-void OggValidationState::error_write(short int inErrNo, OggPage* inOggPage, OggStreamValidationState* inStreamState) {
-
- string locErrorString = "";
- switch (inErrNo) {
- case OVE_OK:
- //Do nothing
- return;
- break;
- case OVE_STRUCTURE_VERSION_NOT_ZERO:
- locErrorString = (int)inOggPage->header()->StructureVersion();
- locErrorString = "Structure version(" + locErrorString +") is not 0, (RFC 3533 Sec. 6.1)";
- break;
- case OVE_MORE_THAN_ONE_BOS:
- locErrorString = "More than one BOS page in stream.";
- break;
- case OVE_MORE_THAN_ONE_EOS:
- locErrorString = "More than one EOS page in stream.";
- break;
- case OVE_BOS_PAGE_NOT_AT_START:
- locErrorString = "BOS found not as first page in stream.";
- break;
- case OVE_EOS_BEFORE_BOS:
- locErrorString = "EOS page found before BOS page";
- break;
- case OVE_DATA_AFTER_VALID_STREAM:
- locErrorString = "More data was received for a stream that was previously complete and valid.";
- break;
- case OVE_UNUSED_HEADER_BITS_SET:
- locErrorString = "One or more unused header flags (XXXXXebc) are set.";
- break;
- case OVE_CONTINUATION_FLAG_EXPECTED:
- locErrorString = "Page did not set continuation flag after incomplete packet.";
- break;
- case OVE_UNEXPECTED_CONTINUATION_FLAG:
- locErrorString = "Continuation flag with no previous incomplete packet.";
- break;
-
- //Process errors
- case OggDataBuffer::PROCESS_FAILED_TO_SET_HEADER:
- locErrorString = "Lost Sync.";
- break;
- default:
- locErrorString = "Unnamed Error";
- break;
- }
-
- if (inStreamState != NULL) {
- inStreamState->mErrorCount++;
- }
-
- cout << "ERROR "<<(int)inErrNo<<": "<<locErrorString<<endl;
-
-}
-
-
+#include "StdAfx.h"
+#include "oggvalidationstate.h"
+
+OggValidationState::OggValidationState(void)
+ : mNumBOS(0)
+ , mNumEOS(0)
+ , mExpectingBOS(false)
+ , mIsValid(false)
+ , mState(FVS_SEEN_NOTHING)
+
+{
+}
+
+OggValidationState::~OggValidationState(void)
+{
+}
+
+
+OggStreamValidationState* OggValidationState::getStreamBySerialNo(unsigned long inSerialNo) {
+ //Find this stream.... or make a new one.
+
+ for (size_t i = 0; i < mStreams.size(); i++) {
+ if (mStreams[i]->mSerialNo == inSerialNo) {
+ return mStreams[i];
+ }
+ }
+
+ OggStreamValidationState* retStream = new OggStreamValidationState;
+
+ retStream->mSerialNo = inSerialNo;
+ mStreams.push_back(retStream);
+
+ return retStream;
+}
+unsigned long OggValidationState::numStreams() {
+ return mStreams.size();
+}
+
+OggStreamValidationState* OggValidationState::getStream(unsigned long inIndex) {
+ //gets the indexed string from the vector
+
+ if (inIndex < mStreams.size()) {
+ return mStreams[inIndex];
+ } else {
+ return NULL;
+ }
+
+}
+
+bool OggValidationState::notify(bool isBOS, bool isEOS) {
+ bool locOK = true;
+ if (mState == FVS_SEEN_NOTHING) {
+ mState = FVS_AWAITING_BOS;
+ //throw 0;
+ }
+
+ mIsValid = false;
+
+ if (isBOS) {
+ mNumBOS++;
+ if (mState == FVS_AWAITING_BOS) {
+ //Valid case.
+
+ } else {
+ //Unexpected BOS page.
+ mState = FVS_INVALID;
+ locOK = false;
+ }
+
+ if (mNumBOS == mNumEOS) {
+ //Start of chain
+ }
+ }
+
+ if (isEOS) {
+ mNumEOS++;
+ if (mState == FVS_AWAITING_BOS || mState == FVS_AWAITING_EOS) {
+
+ if (mNumBOS == mNumEOS) {
+ //Valid case. Chain.
+ //We are here because we've seen an equal number of EOS and BOS and at least 1 EOS(this one)
+ // This happens whenever a complete chain of streams complete and/or the end of a complete physical bitstream.
+ //
+ //This is the only place it's possible for isValid to become true.
+ // It is true when an equal number of eos and bos pages are seen,
+ // and all streams are also considered fully valid.
+
+ //If this EOS balanced the eos = bos then we can accept bos pages again.
+ mState = FVS_AWAITING_BOS;
+
+
+ if (mStreams.size() != 0) {
+ mIsValid = true;
+ for (int i = 0; i < mStreams.size(); i++) {
+ mIsValid &= (mStreams[i]->mState == OggStreamValidationState::VS_FULLY_VALID);
+ }
+ }
+ } else {
+ mState = FVS_AWAITING_EOS;
+ }
+ } else {
+ mState = FVS_INVALID;
+ locOK = false;
+ }
+
+ //Check for entire stream validity
+
+
+ }
+
+ if (!isBOS && !isEOS) {
+ //This is used because BOS pages must follow each other, after a non BOS page, no more BOS
+ // pages can occur until all currently open streams have seen an EOS.
+ if (mState == FVS_AWAITING_BOS || mState == FVS_AWAITING_EOS) {
+ //Valid case.
+ //This happens the first non-bos, non-eos page, when in awaiting BOS state.
+
+ mState = FVS_AWAITING_EOS;
+ } else {
+
+ mState = FVS_INVALID;
+ locOK = false;
+ }
+ }
+
+ return mIsValid;
+
+}
+
+bool OggValidationState::isValid() {
+ return mIsValid;
+}
+bool OggValidationState::acceptOggPage(OggPage* inOggPage) { //AOP:::Needs validation
+ //Validate the page header
+
+
+ OggStreamValidationState* locStreamState = getStreamBySerialNo(inOggPage->header()->StreamSerialNo());
+
+ OggPageHeader* locHeader = inOggPage->header();
+
+ //If this stream previously was valid, it should have no more data... so it's no longer valid.
+ if (locStreamState->mState == OggStreamValidationState::VS_FULLY_VALID) {
+ error_write(OVE_DATA_AFTER_VALID_STREAM,inOggPage, locStreamState);
+ mIsValid = false;
+ locStreamState->mState = OggStreamValidationState::VS_INVALID;
+ //Should return ?
+ }
+
+ const int UNUSED_HEADER_MASK = 248; //11111000
+ const int OGG_FLAG_CONTINUATION = 1;
+ if ((locHeader->HeaderFlags() & UNUSED_HEADER_MASK) != 0) {
+ //Unused header bits are set.
+ error_write(OVE_UNUSED_HEADER_BITS_SET, inOggPage, locStreamState);
+ mIsValid = false;
+ locStreamState->mState = OggStreamValidationState::VS_INVALID;
+ }
+
+ if (locStreamState->mState == OggStreamValidationState::VS_WAITING_FOR_CONTINUATION) {
+ //Last page had an incomplete packet, so expecting a continuation flag on this page
+ if ((locHeader->HeaderFlags() & OGG_FLAG_CONTINUATION) != 0) {
+ //Valid case.
+
+ //Got the continuation we were expecting.
+ locStreamState->mState = OggStreamValidationState::VS_SEEN_BOS;
+ } else {
+ //There should have been a continuation flag here.
+ error_write(OVE_CONTINUATION_FLAG_EXPECTED, inOggPage, locStreamState);
+ mIsValid = false;
+ locStreamState->mState = OggStreamValidationState::VS_INVALID;
+ }
+ } else {
+ if ((locHeader->HeaderFlags() & OGG_FLAG_CONTINUATION) != 0) {
+ //We have a continuation flag we weren't expecting.
+ error_write(OVE_UNEXPECTED_CONTINUATION_FLAG, inOggPage, locStreamState);
+ mIsValid = false;
+ locStreamState->mState = OggStreamValidationState::VS_INVALID;
+
+ }
+ }
+
+
+ //----------------------------------------------------------------------
+ //Verify structure version is 0 (RFC 3533 Sec. 6.1)
+ if (locHeader->StructureVersion() != 0) {
+ error_write(OVE_STRUCTURE_VERSION_NOT_ZERO, inOggPage, locStreamState);
+ mIsValid = false;
+ }
+ //----------------------------------------------------------------------
+ //Verify BOS integrity.
+
+ if (locHeader->isBOS()) {
+
+
+
+ if (locStreamState->mState == OggStreamValidationState::VS_SEEN_NOTHING) {
+ //Valid case.
+ locStreamState->mState = OggStreamValidationState::VS_SEEN_BOS;
+ }
+
+
+
+ //Check is BOS is first page in stream
+ if (locStreamState->mSeenAnything == true) {
+ error_write(OVE_BOS_PAGE_NOT_AT_START,inOggPage, locStreamState);
+ mIsValid = false;
+ }
+ //Check if this is the second or more BOS page.
+ if (locStreamState->mSeenBOS) {
+ error_write(OVE_MORE_THAN_ONE_BOS,inOggPage, locStreamState);
+ mIsValid = false;
+ }
+
+ locStreamState->mSeenBOS = true;
+
+ }
+
+ //----------------------------------------------------------------------
+ //Verify EOS integrity
+ if (locHeader->isEOS()) {
+
+
+
+ if (locStreamState->mState == OggStreamValidationState::VS_SEEN_BOS) {
+ //Valid case.
+ locStreamState->mState = OggStreamValidationState::VS_FULLY_VALID;
+ }
+
+
+ //Check is BOS has been seen before this EOS
+ if (locStreamState->mSeenBOS == false) {
+ error_write(OVE_EOS_BEFORE_BOS,inOggPage, locStreamState);
+ mIsValid = false;
+ }
+ //Check if this is the second or more BOS page.
+ if (locStreamState->mSeenEOS) {
+ error_write(OVE_MORE_THAN_ONE_EOS, inOggPage, locStreamState);
+ mIsValid = false;
+ }
+
+ locStreamState->mSeenEOS = true;
+ }
+
+ //----------------------------------------------------------------------
+ //Verify Granule pos
+ if (locHeader->GranulePos() != -1) {
+ //Check if the granule pos decreased.
+ if (locHeader->GranulePos() < locStreamState->mGranulePosUpto) {
+ error_write(OVE_GRANULE_POS_DECREASED, inOggPage, locStreamState);
+ mIsValid = false;
+ }
+
+
+ locStreamState->mGranulePosUpto = locHeader->GranulePos();
+
+ } else {
+ //No packets end here
+ }
+
+
+ //----------------------------------------------------------------------
+
+ //Verify sequence No
+ if (locHeader->PageSequenceNo() == locStreamState->mSequenceNoUpto) {
+ //error_write(OVE_SEQUENCE_NO_REPEATED, inOggPage, locStreamState);
+ //mIsValid = false;
+ } else if (locHeader->PageSequenceNo() < locStreamState->mSequenceNoUpto) {
+ error_write(OVE_SEQUENCE_NO_DECREASED, inOggPage, locStreamState);
+ mIsValid = false;
+ } else {
+ locStreamState->mSequenceNoUpto = locHeader->PageSequenceNo();
+ }
+ //----------------------------------------------------------------------
+
+ //----------------------------------------------------------------------
+
+ //Check for incomplete last packet
+ if (inOggPage->numPackets() > 0) {
+ if (inOggPage->getPacket(inOggPage->numPackets() - 1)->isTruncated() == true) {
+ //Valid case
+ //If the last packet is incomplete.
+ if (OggStreamValidationState::VS_SEEN_BOS) {
+ //...And we've seen a BOS page
+
+ //Now we wait for the continuation
+ locStreamState->mState = OggStreamValidationState::VS_WAITING_FOR_CONTINUATION;
+ } else {
+ //Does this mean anythign ?
+ //Normal untruncated packet.
+ }
+ }
+ }
+ //----------------------------------------------------------------------
+ //----------------------------------------------------------------------
+
+
+ notify(inOggPage->header()->isBOS(), inOggPage->header()->isEOS());
+ return true;
+}
+
+OggValidationState::eOggValidationState OggValidationState::validationState() {
+ return mState;
+}
+void OggValidationState::error_write(short int inErrNo, OggPage* inOggPage, OggStreamValidationState* inStreamState) {
+
+ string locErrorString = "";
+ switch (inErrNo) {
+ case OVE_OK:
+ //Do nothing
+ return;
+ break;
+ case OVE_STRUCTURE_VERSION_NOT_ZERO:
+ locErrorString = (int)inOggPage->header()->StructureVersion();
+ locErrorString = "Structure version(" + locErrorString +") is not 0, (RFC 3533 Sec. 6.1)";
+ break;
+ case OVE_MORE_THAN_ONE_BOS:
+ locErrorString = "More than one BOS page in stream.";
+ break;
+ case OVE_MORE_THAN_ONE_EOS:
+ locErrorString = "More than one EOS page in stream.";
+ break;
+ case OVE_BOS_PAGE_NOT_AT_START:
+ locErrorString = "BOS found not as first page in stream.";
+ break;
+ case OVE_EOS_BEFORE_BOS:
+ locErrorString = "EOS page found before BOS page";
+ break;
+ case OVE_DATA_AFTER_VALID_STREAM:
+ locErrorString = "More data was received for a stream that was previously complete and valid.";
+ break;
+ case OVE_UNUSED_HEADER_BITS_SET:
+ locErrorString = "One or more unused header flags (XXXXXebc) are set.";
+ break;
+ case OVE_CONTINUATION_FLAG_EXPECTED:
+ locErrorString = "Page did not set continuation flag after incomplete packet.";
+ break;
+ case OVE_UNEXPECTED_CONTINUATION_FLAG:
+ locErrorString = "Continuation flag with no previous incomplete packet.";
+ break;
+
+ //Process errors
+ case OggDataBuffer::PROCESS_FAILED_TO_SET_HEADER:
+ locErrorString = "Lost Sync.";
+ break;
+ default:
+ locErrorString = "Unnamed Error";
+ break;
+ }
+
+ if (inStreamState != NULL) {
+ inStreamState->mErrorCount++;
+ }
+
+ cout << "ERROR "<<(int)inErrNo<<": "<<locErrorString<<endl;
+
+}
+
+
Property changes on: trunk/oggdsf/src/tools/OOOggValidate/OggValidationState.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggValidate/OggValidationState.h
===================================================================
--- trunk/oggdsf/src/tools/OOOggValidate/OggValidationState.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggValidate/OggValidationState.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,67 +1,67 @@
-#pragma once
-#include <vector>
-using namespace std;
-
-#include "libOOOgg.h"
-#include "OggStreamValidationState.h"
-class OggValidationState
- : public IOggCallback
-{
-public:
- OggValidationState(void);
- virtual ~OggValidationState(void);
- enum eOggValidationErrors {
- OVE_OK,
-
- OVE_STRUCTURE_VERSION_NOT_ZERO,
-
- OVE_GRANULE_POS_DECREASED,
-
- OVE_MORE_THAN_ONE_BOS,
- OVE_BOS_PAGE_NOT_AT_START,
-
- OVE_MORE_THAN_ONE_EOS,
- OVE_EOS_BEFORE_BOS,
-
- OVE_DATA_AFTER_VALID_STREAM,
-
- OVE_SEQUENCE_NO_REPEATED,
- OVE_SEQUENCE_NO_DECREASED,
-
- OVE_UNUSED_HEADER_BITS_SET,
- OVE_CONTINUATION_FLAG_EXPECTED,
- OVE_UNEXPECTED_CONTINUATION_FLAG,
-
- OVE_BOS_
- };
- enum eOggValidationState {
- FVS_OK,
- FVS_SEEN_NOTHING,
- FVS_AWAITING_BOS,
- FVS_AWAITING_EOS,
- FVS_INVALID
- };
-
-
-
- //IOggCallback
- virtual bool acceptOggPage(OggPage* inOggPage);
-
- OggStreamValidationState* getStream(unsigned long inIndex);
- OggStreamValidationState* getStreamBySerialNo(unsigned long inSerialNo);
- unsigned long numStreams();
- vector<OggStreamValidationState*> mStreams;
-
- bool notify(bool inIsBOS, bool inIsEOS);
- void error_write(short int inErrNo, OggPage* inOggPage, OggStreamValidationState* inStreamState);
-
- eOggValidationState validationState();
-
- bool isValid();
-protected:
- bool mExpectingBOS;
- unsigned long mNumBOS;
- unsigned long mNumEOS;
- bool mIsValid;
- eOggValidationState mState;
-};
+#pragma once
+#include <vector>
+using namespace std;
+
+#include "libOOOgg.h"
+#include "OggStreamValidationState.h"
+class OggValidationState
+ : public IOggCallback
+{
+public:
+ OggValidationState(void);
+ virtual ~OggValidationState(void);
+ enum eOggValidationErrors {
+ OVE_OK,
+
+ OVE_STRUCTURE_VERSION_NOT_ZERO,
+
+ OVE_GRANULE_POS_DECREASED,
+
+ OVE_MORE_THAN_ONE_BOS,
+ OVE_BOS_PAGE_NOT_AT_START,
+
+ OVE_MORE_THAN_ONE_EOS,
+ OVE_EOS_BEFORE_BOS,
+
+ OVE_DATA_AFTER_VALID_STREAM,
+
+ OVE_SEQUENCE_NO_REPEATED,
+ OVE_SEQUENCE_NO_DECREASED,
+
+ OVE_UNUSED_HEADER_BITS_SET,
+ OVE_CONTINUATION_FLAG_EXPECTED,
+ OVE_UNEXPECTED_CONTINUATION_FLAG,
+
+ OVE_BOS_
+ };
+ enum eOggValidationState {
+ FVS_OK,
+ FVS_SEEN_NOTHING,
+ FVS_AWAITING_BOS,
+ FVS_AWAITING_EOS,
+ FVS_INVALID
+ };
+
+
+
+ //IOggCallback
+ virtual bool acceptOggPage(OggPage* inOggPage);
+
+ OggStreamValidationState* getStream(unsigned long inIndex);
+ OggStreamValidationState* getStreamBySerialNo(unsigned long inSerialNo);
+ unsigned long numStreams();
+ vector<OggStreamValidationState*> mStreams;
+
+ bool notify(bool inIsBOS, bool inIsEOS);
+ void error_write(short int inErrNo, OggPage* inOggPage, OggStreamValidationState* inStreamState);
+
+ eOggValidationState validationState();
+
+ bool isValid();
+protected:
+ bool mExpectingBOS;
+ unsigned long mNumBOS;
+ unsigned long mNumEOS;
+ bool mIsValid;
+ eOggValidationState mState;
+};
Property changes on: trunk/oggdsf/src/tools/OOOggValidate/OggValidationState.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggValidate/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/tools/OOOggValidate/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggValidate/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// OOOggValidate.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// OOOggValidate.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/tools/OOOggValidate/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/OOOggValidate/stdafx.h
===================================================================
--- trunk/oggdsf/src/tools/OOOggValidate/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/OOOggValidate/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,15 +1,15 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-#include <iostream>
-
-#ifdef WIN32
-# include <tchar.h>
-#endif
-
-// TODO: reference additional headers your program requires here
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#include <iostream>
+
+#ifdef WIN32
+# include <tchar.h>
+#endif
+
+// TODO: reference additional headers your program requires here
Property changes on: trunk/oggdsf/src/tools/OOOggValidate/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/iTranscode/iTranscode.cpp
===================================================================
--- trunk/oggdsf/src/tools/iTranscode/iTranscode.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/iTranscode/iTranscode.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,179 +1,179 @@
-// iTranscode.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-#include <dshow.h>
-#include <iostream>
-#include <windows.h>
-using namespace std;
-
-
-
-bool transcodeToVorbis(string inFileName) {
- IGraphBuilder* locGraphBuilder = NULL;
- IMediaControl* locMediaControl = NULL;
- HRESULT locHR;
- CoInitialize(NULL);
- locHR = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&locGraphBuilder);
- locHR = locGraphBuilder->RenderFile(StringHelper::toWStr(inFileName).c_str(), NULL);
-
- if (locHR != S_OK) {
- //Release memory here !!
- if (locGraphBuilder != NULL) {
- locGraphBuilder->Release();
- }
- CoUninitialize();
- return false;
- }
-
- locHR = locGraphBuilder->QueryInterface(IID_IMediaControl, (void**)&locMediaControl);
-
- IMediaEvent* locMediaEvent = NULL;
- locHR = locGraphBuilder->QueryInterface(IID_IMediaEvent, (void**)&locMediaEvent);
-
- IEnumFilters* locFilterEnum = NULL;
- locHR = locGraphBuilder->EnumFilters(&locFilterEnum);
-
- bool locStillMore = true;
-
- IBaseFilter* locFilter = NULL;
-
- locHR = S_OK;
- ULONG locHowManyFilters = 0;
- ULONG locHowManyPins = 0;
- while (locHR == S_OK) {
- //Loop through all the filter.
- locHR = locFilterEnum->Next(1, &locFilter, &locHowMany);
- if (locHR == S_OK) {
- //When we find one... loop through it's pins.
- HRESULT locPinHR = S_OK;
- IEnumPins* locPinEnum = NULL;
- IPin* locPin = NULL;
- PIN_DIRECTION locPinDirn;
- bool locHasOutputs = false;
- locPinHR = locFilter->EnumPins(&locPinEnum);
- if (locPinHR == S_OK) {
- while (locPinHR == S_OK) {
- //Loop through the pins.
- locPinHR = locPinEnum->Next(1, &locPin, &locHowManyPins);
- if (locPinHR == S_OK) {
- locPin->QueryDirection(&locPinDirn);
- if (locPinDirn == PINDIR_OUTPUT) {
- //Has an output pin... can't be a renderer, break out of the pin loop.
- locHasOutputs = true;
- break;
- }
-
- }
- }
-
- if (!locHasOutputs) {
- //Renderer filter here. Remove it from the graph.
- locHR = locGraphBuilder->RemoveFilter(locFilter);
- //Break out of the filter loop.
- break;
- }
-
- }
-
- }
- }
-
-
- IBaseFilter* locVorbisEncoder = NULL;
- locHR = CoCreateInstance(CLSID_VorbisEncodeFilter, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void **)&locVorbisEncoder);
-
- if (locHR == S_OK) {
- //Created a vorbis filter...
- locGraphBuilder->AddFilter(locVorbisEncoder, L"Vorbis Encode Filter");
-
- ////UPTO HERE::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-
- }
-
-
- locHR = locMediaControl->Run();
-
- HANDLE hEvent;
- long evCode, param1, param2;
- BOOLEAN bDone = FALSE;
- HRESULT hr = S_OK;
- hr = locMediaEvent->GetEventHandle((OAEVENT*)&hEvent);
- if (FAILED(hr))
- {
- /* Insert failure-handling code here. */
- }
- while(!bDone)
- {
- if (WAIT_OBJECT_0 == WaitForSingleObject(hEvent, 100))
- {
- while (hr = locMediaEvent->GetEvent(&evCode, ¶m1, ¶m2, 0), SUCCEEDED(hr))
- {
- //printf("Event code: %#04x\n Params: %d, %d\n", evCode, param1, param2);
- //cout<<"Event : "<<evCode<<" Params : "<<param1<<", "<<param2<<endl;
- locMediaEvent->FreeEventParams(evCode, param1, param2);
- bDone = (EC_COMPLETE == evCode);
- }
- }
- }
-
- cout<<"Finished..."<<endl;
- int x;
- cin>>x;
- locMediaControl->Release();
- locGraphBuilder->Release();
- CoUninitialize();
-
- return 0;
-
- return true;
-}
-int _tmain(int argc, _TCHAR* argv[])
-{
- if (argc < 3) {
- cout<<"Usage : iTranscode <source path/file mask> <target directory>"<<endl;
- cout<<" target directory must end with a backslash"<<endl;
- cout<<"Description : This program will search the directory for any files you specify and"<<endl;
- cout<<" attempt to transcode them to ogg vorbis"<<endl;
- } else {
- unsigned long locNumFound = 0;
-
-
- WIN32_FIND_DATA locFindData;
- HANDLE locFindHandle;
-
-
- locFindHandle = FindFirstFile(argv[1], &locFindData); //, FindExSearchNameMatch, NULL, 0 );
-
- if (locFindHandle == INVALID_HANDLE_VALUE) {
- cout<<"Invalid file mask, or no matches."<<endl;
-
- } else {
-
- if ((locFindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) {
- locNumFound++;
- cout<<"Found "<<locNumFound << " : "<< locFindData.cFileName<<endl;
- string locFileName = locFindData.cFileName;
- bool locTransOK = transcodeToVorbis(locFileName);
- }
-
- BOOL locFindOK = TRUE;
- while (locFindOK == TRUE) {
- locFindOK = FindNextFile(locFindHandle, &locFindData);
- if (locFindOK == TRUE) {
- if ((locFindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) {
- locNumFound++;
- cout<<"Found "<<locNumFound << " : "<< locFindData.cFileName<<endl;;
- bool locTransOK = transcodeToVorbis(locFileName);
- }
- }
-
- }
- FindClose(locFindHandle);
- }
- }
-
-
- return 0;
-}
-
+// iTranscode.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+#include <dshow.h>
+#include <iostream>
+#include <windows.h>
+using namespace std;
+
+
+
+bool transcodeToVorbis(string inFileName) {
+ IGraphBuilder* locGraphBuilder = NULL;
+ IMediaControl* locMediaControl = NULL;
+ HRESULT locHR;
+ CoInitialize(NULL);
+ locHR = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, IID_IGraphBuilder, (void **)&locGraphBuilder);
+ locHR = locGraphBuilder->RenderFile(StringHelper::toWStr(inFileName).c_str(), NULL);
+
+ if (locHR != S_OK) {
+ //Release memory here !!
+ if (locGraphBuilder != NULL) {
+ locGraphBuilder->Release();
+ }
+ CoUninitialize();
+ return false;
+ }
+
+ locHR = locGraphBuilder->QueryInterface(IID_IMediaControl, (void**)&locMediaControl);
+
+ IMediaEvent* locMediaEvent = NULL;
+ locHR = locGraphBuilder->QueryInterface(IID_IMediaEvent, (void**)&locMediaEvent);
+
+ IEnumFilters* locFilterEnum = NULL;
+ locHR = locGraphBuilder->EnumFilters(&locFilterEnum);
+
+ bool locStillMore = true;
+
+ IBaseFilter* locFilter = NULL;
+
+ locHR = S_OK;
+ ULONG locHowManyFilters = 0;
+ ULONG locHowManyPins = 0;
+ while (locHR == S_OK) {
+ //Loop through all the filter.
+ locHR = locFilterEnum->Next(1, &locFilter, &locHowMany);
+ if (locHR == S_OK) {
+ //When we find one... loop through it's pins.
+ HRESULT locPinHR = S_OK;
+ IEnumPins* locPinEnum = NULL;
+ IPin* locPin = NULL;
+ PIN_DIRECTION locPinDirn;
+ bool locHasOutputs = false;
+ locPinHR = locFilter->EnumPins(&locPinEnum);
+ if (locPinHR == S_OK) {
+ while (locPinHR == S_OK) {
+ //Loop through the pins.
+ locPinHR = locPinEnum->Next(1, &locPin, &locHowManyPins);
+ if (locPinHR == S_OK) {
+ locPin->QueryDirection(&locPinDirn);
+ if (locPinDirn == PINDIR_OUTPUT) {
+ //Has an output pin... can't be a renderer, break out of the pin loop.
+ locHasOutputs = true;
+ break;
+ }
+
+ }
+ }
+
+ if (!locHasOutputs) {
+ //Renderer filter here. Remove it from the graph.
+ locHR = locGraphBuilder->RemoveFilter(locFilter);
+ //Break out of the filter loop.
+ break;
+ }
+
+ }
+
+ }
+ }
+
+
+ IBaseFilter* locVorbisEncoder = NULL;
+ locHR = CoCreateInstance(CLSID_VorbisEncodeFilter, NULL, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void **)&locVorbisEncoder);
+
+ if (locHR == S_OK) {
+ //Created a vorbis filter...
+ locGraphBuilder->AddFilter(locVorbisEncoder, L"Vorbis Encode Filter");
+
+ ////UPTO HERE::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+ }
+
+
+ locHR = locMediaControl->Run();
+
+ HANDLE hEvent;
+ long evCode, param1, param2;
+ BOOLEAN bDone = FALSE;
+ HRESULT hr = S_OK;
+ hr = locMediaEvent->GetEventHandle((OAEVENT*)&hEvent);
+ if (FAILED(hr))
+ {
+ /* Insert failure-handling code here. */
+ }
+ while(!bDone)
+ {
+ if (WAIT_OBJECT_0 == WaitForSingleObject(hEvent, 100))
+ {
+ while (hr = locMediaEvent->GetEvent(&evCode, ¶m1, ¶m2, 0), SUCCEEDED(hr))
+ {
+ //printf("Event code: %#04x\n Params: %d, %d\n", evCode, param1, param2);
+ //cout<<"Event : "<<evCode<<" Params : "<<param1<<", "<<param2<<endl;
+ locMediaEvent->FreeEventParams(evCode, param1, param2);
+ bDone = (EC_COMPLETE == evCode);
+ }
+ }
+ }
+
+ cout<<"Finished..."<<endl;
+ int x;
+ cin>>x;
+ locMediaControl->Release();
+ locGraphBuilder->Release();
+ CoUninitialize();
+
+ return 0;
+
+ return true;
+}
+int _tmain(int argc, _TCHAR* argv[])
+{
+ if (argc < 3) {
+ cout<<"Usage : iTranscode <source path/file mask> <target directory>"<<endl;
+ cout<<" target directory must end with a backslash"<<endl;
+ cout<<"Description : This program will search the directory for any files you specify and"<<endl;
+ cout<<" attempt to transcode them to ogg vorbis"<<endl;
+ } else {
+ unsigned long locNumFound = 0;
+
+
+ WIN32_FIND_DATA locFindData;
+ HANDLE locFindHandle;
+
+
+ locFindHandle = FindFirstFile(argv[1], &locFindData); //, FindExSearchNameMatch, NULL, 0 );
+
+ if (locFindHandle == INVALID_HANDLE_VALUE) {
+ cout<<"Invalid file mask, or no matches."<<endl;
+
+ } else {
+
+ if ((locFindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) {
+ locNumFound++;
+ cout<<"Found "<<locNumFound << " : "<< locFindData.cFileName<<endl;
+ string locFileName = locFindData.cFileName;
+ bool locTransOK = transcodeToVorbis(locFileName);
+ }
+
+ BOOL locFindOK = TRUE;
+ while (locFindOK == TRUE) {
+ locFindOK = FindNextFile(locFindHandle, &locFindData);
+ if (locFindOK == TRUE) {
+ if ((locFindData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0) {
+ locNumFound++;
+ cout<<"Found "<<locNumFound << " : "<< locFindData.cFileName<<endl;;
+ bool locTransOK = transcodeToVorbis(locFileName);
+ }
+ }
+
+ }
+ FindClose(locFindHandle);
+ }
+ }
+
+
+ return 0;
+}
+
Property changes on: trunk/oggdsf/src/tools/iTranscode/iTranscode.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/iTranscode/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/tools/iTranscode/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/iTranscode/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// iTranscode.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// iTranscode.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/tools/iTranscode/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/iTranscode/stdafx.h
===================================================================
--- trunk/oggdsf/src/tools/iTranscode/stdafx.h 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/iTranscode/stdafx.h 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,13 +1,13 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-
-#include <iostream>
-#include <tchar.h>
-
-// TODO: reference additional headers your program requires here
-#include <windows.h>
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+
+#include <iostream>
+#include <tchar.h>
+
+// TODO: reference additional headers your program requires here
+#include <windows.h>
Property changes on: trunk/oggdsf/src/tools/iTranscode/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/oggChainSplitter/oggChainSplitter.cpp
===================================================================
--- trunk/oggdsf/src/tools/oggChainSplitter/oggChainSplitter.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/oggChainSplitter/oggChainSplitter.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,194 +1,194 @@
-//===========================================================================
-//Copyright (C) 2003, 2004 Zentaro Kavanagh
-//
-//Redistribution and use in source and binary forms, with or without
-//modification, are permitted provided that the following conditions
-//are met:
-//
-//- Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//
-//- Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-//- Neither the name of Zentaro Kavanagh nor the names of contributors
-// may be used to endorse or promote products derived from this software
-// without specific prior written permission.
-//
-//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
-//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//===========================================================================
-
-// oggChainSplitter.cpp : Defines the entry point for the console application.
-//
-
-#include "stdafx.h"
-
-#include <libOOOgg.h>
-#include <dllstuff.h>
-#include "VorbisComments.h"
-#include <iostream>
-#include <fstream>
-#include <vector>
-
-unsigned long bytePos = 0;
-bool needComments = false;
-bool inStream = false;
-fstream outFile;
-string inFileName;
-string outFileName;
-VorbisComments currentComment;
-unsigned long chainCount = 0;
-bool isOK = true;
-
-bool renameCurrentFile() {
- cout<<"Renaming File..."<<endl;
- if ((currentComment.numUserComments() > 0)) {
- vector<SingleVorbisComment*> locArtists = currentComment.getCommentsByKey("artist");
- vector<SingleVorbisComment*> locTitles = currentComment.getCommentsByKey("title");
- string locArtist = "Unknown_Artist";
- string locTitle = "Unknown_Title";
-
- cout<<"Basics done..."<<endl;
- if (locArtists.size() > 0) {
- locArtist = locArtists[0]->value();
- }
-
- if (locTitles.size() > 0) {
- locTitle = locTitles[0]->value();
- }
-
- string locPartialName = locArtist+"_"+locTitle;
-
- size_t locSlashPos = outFileName.find_last_of('\\');
- if (locSlashPos == string::npos) {
- locSlashPos == -1;
- }
- size_t locDotPos = outFileName.find_last_of('.');
-
- cout<<"Before substitution..."<<endl;
- string locNewName = outFileName.substr(0,locSlashPos + 1) + locPartialName + outFileName.substr(locDotPos);
- cout<<"After subst."<<endl;
- cout<<"Renaming "<<outFileName<<" to "<<locNewName<<endl;
-#ifdef WIN32
- MoveFile(outFileName.c_str(), locNewName.c_str());
-#else /* assume POSIX */
- rename(outFileName.c_str(), locNewName.c_str());
-#endif
- }
-
- return true;
-
-}
-bool writePage(OggPage* inOggPage) {
- //cout << "Writing page "<<endl;
- unsigned char* pageBuff = inOggPage->createRawPageData();
- //cout <<pageBuff<<endl;
- outFile.write((char*)pageBuff, inOggPage->pageSize());
- //cout<<"Written..."<<endl;
- delete[] pageBuff;
- //cout<<"After delete"<<endl;
- return true;
-}
-//This will be called by the callback
-bool pageCB(OggPage* inOggPage) {
- bool retVal = false;
- if (inStream == false) {
- //Not in the middle of a stream
- if (inOggPage->header()->isBOS()) {
- //Case 1 : Not in the middle of a stream and we found a BOS... start a new file.
- char* locNum = new char[32];
- sprintf(locNum, "%d", chainCount);
- // ^ is the same as: itoa(chainCount, locNum, 10);
- outFileName = inFileName + "__" + locNum + ".ogg";
- cout<<"New output file "<<outFileName<<endl;
-
- delete locNum;
- locNum = NULL;
- outFile.open(outFileName.c_str(), ios_base::out | ios_base::binary);
- retVal = writePage(inOggPage);
- inStream = retVal;
- needComments = true;
-
- } else {
- //Case 2 : Not in middle of stream and not BOS - ERROR
- cout << "BOS Page expected at "<<bytePos<<endl;
- retVal = false;
- }
-
- } else {
- //In the middle of a stream
- if (inOggPage->header()->isEOS()) {
- //Case 3 : It's the last page of the current stream... write it out and switch state.
- retVal = writePage(inOggPage);
- outFile.close();
- renameCurrentFile();
- cout<<"Closing file number "<<chainCount<<endl;
- chainCount++;
- inStream = false;
-
- } else {
- //Case 4 : It's just a normal page write it out.
- if (needComments) {
- currentComment.parseOggPacket(inOggPage->getPacket(0), 7);
- }
- retVal = writePage(inOggPage);
- }
- }
-
- isOK = retVal;
- delete inOggPage;
- return retVal;
-
-}
-
-#ifdef WIN32
-int __cdecl _tmain(int argc, _TCHAR* argv[])
-#else
-int main(int argc, char * argv[])
-#endif
-{
- //This program just dumps the pages out of a file in ogg format.
- // Currently does not error checking. Check your command line carefully !
- // USAGE :: oggChainSplitter <OggFile>
- //
-
- bytePos = 0;
-
- if (argc < 2) {
- cout<<"Usage : oggChainSplitter <filename>"<<endl;
- cout<<"Only splits vorbis chained streams... careful with command line... no error checks"<<endl;
- } else {
- cout << "Starting..."<<endl;
- OggDataBuffer testOggBuff;
-
- testOggBuff.registerStaticCallback(&pageCB);
-
- fstream testFile;
- inFileName = argv[1];
- testFile.open(argv[1], ios_base::in | ios_base::binary);
-
- const unsigned short BUFF_SIZE = 8092;
- char* locBuff = new char[BUFF_SIZE];
- while ((!testFile.eof()) && (isOK)) {
- testFile.read(locBuff, BUFF_SIZE);
- unsigned long locBytesRead = testFile.gcount();
- testOggBuff.feed((const unsigned char*)locBuff, locBytesRead);
- }
-
- delete[] locBuff;
- }
-
- return 0;
-}
-
+//===========================================================================
+//Copyright (C) 2003, 2004 Zentaro Kavanagh
+//
+//Redistribution and use in source and binary forms, with or without
+//modification, are permitted provided that the following conditions
+//are met:
+//
+//- Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+//
+//- Redistributions in binary form must reproduce the above copyright
+// notice, this list of conditions and the following disclaimer in the
+// documentation and/or other materials provided with the distribution.
+//
+//- Neither the name of Zentaro Kavanagh nor the names of contributors
+// may be used to endorse or promote products derived from this software
+// without specific prior written permission.
+//
+//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+//``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+//LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+//PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ORGANISATION OR
+//CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+//EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+//PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+//PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+//LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+//NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//===========================================================================
+
+// oggChainSplitter.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+
+#include <libOOOgg.h>
+#include <dllstuff.h>
+#include "VorbisComments.h"
+#include <iostream>
+#include <fstream>
+#include <vector>
+
+unsigned long bytePos = 0;
+bool needComments = false;
+bool inStream = false;
+fstream outFile;
+string inFileName;
+string outFileName;
+VorbisComments currentComment;
+unsigned long chainCount = 0;
+bool isOK = true;
+
+bool renameCurrentFile() {
+ cout<<"Renaming File..."<<endl;
+ if ((currentComment.numUserComments() > 0)) {
+ vector<SingleVorbisComment*> locArtists = currentComment.getCommentsByKey("artist");
+ vector<SingleVorbisComment*> locTitles = currentComment.getCommentsByKey("title");
+ string locArtist = "Unknown_Artist";
+ string locTitle = "Unknown_Title";
+
+ cout<<"Basics done..."<<endl;
+ if (locArtists.size() > 0) {
+ locArtist = locArtists[0]->value();
+ }
+
+ if (locTitles.size() > 0) {
+ locTitle = locTitles[0]->value();
+ }
+
+ string locPartialName = locArtist+"_"+locTitle;
+
+ size_t locSlashPos = outFileName.find_last_of('\\');
+ if (locSlashPos == string::npos) {
+ locSlashPos == -1;
+ }
+ size_t locDotPos = outFileName.find_last_of('.');
+
+ cout<<"Before substitution..."<<endl;
+ string locNewName = outFileName.substr(0,locSlashPos + 1) + locPartialName + outFileName.substr(locDotPos);
+ cout<<"After subst."<<endl;
+ cout<<"Renaming "<<outFileName<<" to "<<locNewName<<endl;
+#ifdef WIN32
+ MoveFile(outFileName.c_str(), locNewName.c_str());
+#else /* assume POSIX */
+ rename(outFileName.c_str(), locNewName.c_str());
+#endif
+ }
+
+ return true;
+
+}
+bool writePage(OggPage* inOggPage) {
+ //cout << "Writing page "<<endl;
+ unsigned char* pageBuff = inOggPage->createRawPageData();
+ //cout <<pageBuff<<endl;
+ outFile.write((char*)pageBuff, inOggPage->pageSize());
+ //cout<<"Written..."<<endl;
+ delete[] pageBuff;
+ //cout<<"After delete"<<endl;
+ return true;
+}
+//This will be called by the callback
+bool pageCB(OggPage* inOggPage) {
+ bool retVal = false;
+ if (inStream == false) {
+ //Not in the middle of a stream
+ if (inOggPage->header()->isBOS()) {
+ //Case 1 : Not in the middle of a stream and we found a BOS... start a new file.
+ char* locNum = new char[32];
+ sprintf(locNum, "%d", chainCount);
+ // ^ is the same as: itoa(chainCount, locNum, 10);
+ outFileName = inFileName + "__" + locNum + ".ogg";
+ cout<<"New output file "<<outFileName<<endl;
+
+ delete locNum;
+ locNum = NULL;
+ outFile.open(outFileName.c_str(), ios_base::out | ios_base::binary);
+ retVal = writePage(inOggPage);
+ inStream = retVal;
+ needComments = true;
+
+ } else {
+ //Case 2 : Not in middle of stream and not BOS - ERROR
+ cout << "BOS Page expected at "<<bytePos<<endl;
+ retVal = false;
+ }
+
+ } else {
+ //In the middle of a stream
+ if (inOggPage->header()->isEOS()) {
+ //Case 3 : It's the last page of the current stream... write it out and switch state.
+ retVal = writePage(inOggPage);
+ outFile.close();
+ renameCurrentFile();
+ cout<<"Closing file number "<<chainCount<<endl;
+ chainCount++;
+ inStream = false;
+
+ } else {
+ //Case 4 : It's just a normal page write it out.
+ if (needComments) {
+ currentComment.parseOggPacket(inOggPage->getPacket(0), 7);
+ }
+ retVal = writePage(inOggPage);
+ }
+ }
+
+ isOK = retVal;
+ delete inOggPage;
+ return retVal;
+
+}
+
+#ifdef WIN32
+int __cdecl _tmain(int argc, _TCHAR* argv[])
+#else
+int main(int argc, char * argv[])
+#endif
+{
+ //This program just dumps the pages out of a file in ogg format.
+ // Currently does not error checking. Check your command line carefully !
+ // USAGE :: oggChainSplitter <OggFile>
+ //
+
+ bytePos = 0;
+
+ if (argc < 2) {
+ cout<<"Usage : oggChainSplitter <filename>"<<endl;
+ cout<<"Only splits vorbis chained streams... careful with command line... no error checks"<<endl;
+ } else {
+ cout << "Starting..."<<endl;
+ OggDataBuffer testOggBuff;
+
+ testOggBuff.registerStaticCallback(&pageCB);
+
+ fstream testFile;
+ inFileName = argv[1];
+ testFile.open(argv[1], ios_base::in | ios_base::binary);
+
+ const unsigned short BUFF_SIZE = 8092;
+ char* locBuff = new char[BUFF_SIZE];
+ while ((!testFile.eof()) && (isOK)) {
+ testFile.read(locBuff, BUFF_SIZE);
+ unsigned long locBytesRead = testFile.gcount();
+ testOggBuff.feed((const unsigned char*)locBuff, locBytesRead);
+ }
+
+ delete[] locBuff;
+ }
+
+ return 0;
+}
+
Property changes on: trunk/oggdsf/src/tools/oggChainSplitter/oggChainSplitter.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: trunk/oggdsf/src/tools/oggChainSplitter/stdafx.cpp
===================================================================
--- trunk/oggdsf/src/tools/oggChainSplitter/stdafx.cpp 2004-12-16 13:51:01 UTC (rev 8446)
+++ trunk/oggdsf/src/tools/oggChainSplitter/stdafx.cpp 2004-12-16 14:15:51 UTC (rev 8447)
@@ -1,8 +1,8 @@
-// stdafx.cpp : source file that includes just the standard includes
-// oggChainSplitter.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file
+// stdafx.cpp : source file that includes just the standard includes
+// oggChainSplitter.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
Property changes on: trunk/oggdsf/src/tools/oggChainSplitter/stdafx.cpp
___________________________________________________________________
Name: svn:eol-style
+ native
Property changes on: trunk/oggdsf/src/tools/oggChainSplitter/stdafx.h
___________________________________________________________________
Name: svn:eol-style
+ native
More information about the commits
mailing list