ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • DirectShow
    미디어/필터 2009. 2. 18. 15:09
    미디어 형
    MEDIASUBTYPE_MPEG1???    // for MPEG-1 Stream Splitter filter
    주 타입: MEDIATYPE_Stream
    부 타입: MEDIASUBTYPE_NULL
    MEDIASUBTYPE_Avi    // for AVI Splitter filter
    주 타입: MEDIATYPE_Stream
    부 타입: MEDIASUBTYPE_Avi
    MEDIASUBTYPE_WAVE/AIFF/AU    // for WAVE Parser filter
    주 타입: MEDIATYPE_Stream
    부 타입: MEDIASUBTYPE_WAVE // MEDIASUBTYPE_AIFF(?), MEDIASUBTYPE_AU(?)

    #include "streams.h"    // includes <windows.h> and <dshow.h>

    winmm.lib
    strmbase.lib
    // strmiids.lib  quartz.lib

    1. Win32 DLL 프로젝트를 생성한다.

    2. BaseClasses 프로젝트를 포함시킨다.

    3. [Project | Settings... | All Configurations | C/C++ | Code Generation | Calling convention] __stdcall
    [Project | Settings... | All Configurations | C/C++ | Code Generation | Use run-time library] 'Multithreaded DLL'
    [Project | Settings... | Debug | C/C++ | Preprocessor | Preprocessor  definitions] DEBUG
    [Project | Settings... | All Configurations | Link | Input | Object/library modules] winmm.lib strmbas[d|e].lib
    [Project | Settings... | All Configurations | Link | Output | Entry-point symbol] DllEntryPoint@12
    [Project | Settings... | All Configurations | Link | Output | Stack allocations] 0x200000

    4. DEF 파일을 포함한다.
    LIBRARY     <<Module Name>>
    DESCRIPTION 'DirectShow Filter'
    EXPORTS
                DllRegisterServer   PRIVATE
                DllUnregisterServer PRIVATE
                DllGetClassObject   PRIVATE
                DllCanUnloadNow     PRIVATE

    5.
    MERIT_PREFERRED
    MERIT_NORMAL
    MERIT_UNLIKELY
    MERIT_DO_NOT_USE
    MERIT_SW_COMPRESSOR
    MERIT_HW_COMPRESSOTR

    CBasePin -> IPin
    출력 핀
    IPin::Connect()
    call .AgreeMediaType()
    call pReceivePin->IPin::EnumMediaTypes()
    or call IPin::EnumMediaTypes()
    call TryMediaTypes()
    call pEnum->Next()
    call pReceivePin->GetMediaType()
    or call GetMediaType()
    call AttemptConnection()
    call CheckConnect()
    call CheckMediaType()
    call GetMediaType()
    call SetMediaType()
    call pReceivePin->ReceiveConnection()
    call CompleteConnect()
    .AgreeMediaType()
    .TryMediaTypes()
    .AttemptConnection()

    입력 핀
    IPin::ReceiveConnection()
    call CheckConnect()
    call CheckMediaType()
    call SetMediaType()
    call CompleteConnect()

    IPin::EnumMediaType()
    .GetMediaType()=0
    .CheckConnect()    // virtual
    핀의 방향을 확인
    IPin::QueryDirection()
    IPin::EnumMediaTypes()
    .CheckMediaType()=0
    .SetMediaType()
    IPin::ReceiveConnection()

    .CompleteConnect() // virtual
    on BreakConnect                        // Override to release puller
    on Active                           // pause state
    on Inactive                            // stop state

    .IsConnected()
    IPin::ConnectionMediaType()
    .EndOfStream()    // virtual

    미디어형 열거자
    IEnumMediaType
    .Reset()
    .Next()

    CBaseOutputPin -> CBasePin
    .CheckConnect()    // virtual
    아래쪽 핀의 IMemInputPin를 얻는다.
    버퍼 협상

    .CompleteConnect()    // virtual
    call DecideAllocator()
    call m_pInputPin->IMemInputPin::GetAllocatorRequirements()
    call m_pInputPin->IMemInputPin::GetAllocator()
    call DecideBufferSize()
    call m_pInputPin->IMemInputPin::NotifyAllocator()
    .DecideAllocator()

    .DecideBufferSize()=0

    .BreakConnect()    // virtual??                        // Override to release puller
    call IMemAllocator::Decommit()
    .Active()    // virtual??                           // pause state
    call IMemAllocator::Commit()
    .Inactive()    // virtual??                            // stop state
    call IMemAllocator::Decommit()

    .DeliverEndOfStream()

    // 미디어 검색
    1. DeliverBeginFlush()
    2. 데이터 전송을 중지한다.
    3. DeliverEndFlush()
    4. DeliverNewSegment()
    5. 데이터 전송을 개시한다.


    CBaseInputPin -> CBasePin
    .CompleteConnect()    // virtual??

    IMemInputPin::GetAllocatorRequirements()
    IMemInputPin::GetAllocator()
    IMemInputPin::NotifyAllocator()

    .BreakConnect()    // virtual??                        // Override to release puller
    call IMemAllocator::Decommit()
    .Active()    // virtual??                           // pause state
    .Inactive()    // virtual??                            // stop state
    call IMemAllocator::Decommit()

    IMemInputPin::Receive()

    .EndOfStream()    // virtual??
    스트림을 멈춘다.
    .BeginFlush()    // virtual??
    .EndFlush()    // virtual??

    IMemAllocator
    .SetProperties()
    .GetProperties()
    .Commit()
    .Decommit()
    .GetBuffer()

    IMediaSample
    .GetPointer()
    .GetSize()

    CBaseFilter -> IBaseFilter
    .EnumPins()    // virtual
    IEnumPins
    .Next()
    .FindPin()    // virtual

    핀을 생성한다.
    .GetPin()
    .GetPinCount()

    on EndFlush
    on Receive()
    on EndOfStream()

    on Stop()
    on Pause()
    on Run()

    .NotifyEvent()
    EC_ERRORABORT


    IMediaFilter
    CBaseMediaFilter

    IBaseFilter
    CBaseFilter

    IPin
    CBasePin

    IEnumPins
    CEnumPins

    IEnumMediaTypes
    CEnumMediaTypes

    IMediaSample2
    CMediaSample

    IMemAllocatorCallbackTemp
    CBaseAllocator

    INonDelegatingUnknown
    CUnknown

    IPropertyPage
    CBasePropertyPage

    IMediaControl
    CMediaControl

    IMediaEventEx
    CMediaEvent

    IMediaPosition
    CMediaPosition

    IBasicAudio
    CBasicAudio

    IBasicVideo2
    CBaseBasicVideo

    IVideoWindow
    CBasicVideoWindow

    IDeferredCommand
    CDeferredCommand

    IClassFactory
    CClassFactory

    IPersistStream
    CPersistStream

    IReferenceStream
    CBaseReferenceClock

    ISeekingPassThru
    CSeekingPassThru

    IMediaSeeking
    CSourceSeeking

    IAMStreamControl
    CBaseStreamControl

    IDirectDraw
    CAggDirectDraw

    IDirectDrawSurface
    CAggDrawSurface


    참조 사이트:













Designed by Tistory.