michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim:set ts=2 sw=2 sts=2 et cindent: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this file, michael@0: * You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #if !defined(nsDirectShowSource_h___) michael@0: #define nsDirectShowSource_h___ michael@0: michael@0: #include "BaseFilter.h" michael@0: #include "BasePin.h" michael@0: #include "MediaType.h" michael@0: michael@0: #include "nsDeque.h" michael@0: #include "nsAutoPtr.h" michael@0: #include "DirectShowUtils.h" michael@0: #include "mozilla/RefPtr.h" michael@0: michael@0: namespace mozilla { michael@0: michael@0: class MediaResource; michael@0: class ReadRequest; michael@0: class OutputPin; michael@0: michael@0: michael@0: // SourceFilter is an asynchronous DirectShow source filter which michael@0: // reads from an MediaResource, and supplies data via a pull model downstream michael@0: // using OutputPin. It us used to supply a generic byte stream into michael@0: // DirectShow. michael@0: // michael@0: // Implements: michael@0: // * IBaseFilter michael@0: // * IMediaFilter michael@0: // * IPersist michael@0: // * IUnknown michael@0: // michael@0: class DECLSPEC_UUID("5c2a7ad0-ba82-4659-9178-c4719a2765d6") michael@0: SourceFilter : public media::BaseFilter michael@0: { michael@0: public: michael@0: michael@0: // Constructs source filter to deliver given media type. michael@0: SourceFilter(const GUID& aMajorType, const GUID& aSubType); michael@0: ~SourceFilter(); michael@0: michael@0: nsresult Init(MediaResource *aResource, int64_t aMP3Offset); michael@0: michael@0: // BaseFilter overrides. michael@0: // Only one output - the byte stream. michael@0: int GetPinCount() MOZ_OVERRIDE { return 1; } michael@0: michael@0: media::BasePin* GetPin(int n) MOZ_OVERRIDE; michael@0: michael@0: // Get's the media type we're supplying. michael@0: const media::MediaType* GetMediaType() const; michael@0: michael@0: uint32_t GetAndResetBytesConsumedCount(); michael@0: michael@0: protected: michael@0: michael@0: // Our async pull output pin. michael@0: nsAutoPtr mOutputPin; michael@0: michael@0: // Type of byte stream we output. michael@0: media::MediaType mMediaType; michael@0: michael@0: }; michael@0: michael@0: } // namespace mozilla michael@0: michael@0: // For mingw __uuidof support michael@0: #ifdef __CRT_UUID_DECL michael@0: __CRT_UUID_DECL(mozilla::SourceFilter, 0x5c2a7ad0,0xba82,0x4659,0x91,0x78,0xc4,0x71,0x9a,0x27,0x65,0xd6); michael@0: #endif michael@0: michael@0: #endif