02 directshow

Upload: mohamed-hefny

Post on 07-Apr-2018

232 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/6/2019 02 DirectShow

    1/18

    DirectShow

  • 8/6/2019 02 DirectShow

    2/18

    Introduction toDirectShow

    playback orcapturevideoandaudiostreams

    Support format AdvancedSystem Format (ASF)

    Motion Picture Experts Group (MPEG)

    Audio-Video Interleaved (AVI) MPEG Audio Layer-3 (MP3)

    WAV sound files

  • 8/6/2019 02 DirectShow

    3/18

    Introduction toDirectShow

    automaticallydetects videoandaudioacceleration hardware

    Simplifies Mediaplayback, formatconversion,

    capture task

    Provides access totheunderlyingstreamcontrolarchitecture

    youcan createyourown componenttosupport new format

  • 8/6/2019 02 DirectShow

    4/18

    Introduction toDirectShow

    Applications youcan write

    DVDplayer, videoediting APs,

    AVI toASF converter,MP3players

    Digital videocapture

    Techniques

    Component ObjectModel (COM)

    IfyouwanttoextendDirectShow,you

    needunderstandCOM

  • 8/6/2019 02 DirectShow

    5/18

    Supports Formats in

    DirectShowFileTypes

    Windows MediaAudio (WMA) Windows Media Video

    (WMV)*

    AdvancedSystems Format

    (ASF)*

    MPEG

    AVI QuickTime (version 2 and

    lower)

    WAV AIFF

    AU (Unix Audio) SND (Sound File)

    MIDI

    * NeedWindows Media FormatSDK

    ( WMA WMV)

  • 8/6/2019 02 DirectShow

    6/18

    Supports Formats in

    DirectShow

    Compression formats

    ISO MPEG-4 video version 1.0* WMA*,WMV*,MP3

    MicrosoftMPEG-4 version 3* Sipro Labs ACELP*

    DigitalVideo (DV) MPEG-1 (decompressiononly)

    MJPEG Cinepak

    MPEG2 decoderis not supportbyDirectShow

  • 8/6/2019 02 DirectShow

    7/18

    DirectShow FAQ

    WhatOSdoes DirectShow support?

    Win98,Win2000,WinME, WinXP

    Do I needtoknowCOMknowledge? Howtoinstantiatethem

    Access theinterfacetheyexpose

    Managereferencecount

    (Filterdesignerrequires more )

    Is thereaDirectShowHardwareCompatibility List (HCL) ?

    Using DirectDraw & DirectSoundhardware,iftheyavailable

    Orusing GDI video & waveOut* audio

  • 8/6/2019 02 DirectShow

    8/18

    DirectShow FAQ

    Whatlanguagecan I use? DirectShowis designed forC++

    VB access subsetoftheAPI

    ScriptbasedDVDorTVAP

    Willitaccessiblethroughmanaged code? nocurrentplans,theCLR is notrecommended

    forperformancereasons

    Howdoes DirectShowrelatetoMicrosoftActiveMovie?

    theoriginal name forDirectShow

  • 8/6/2019 02 DirectShow

    9/18

    DirectShow FAQ

    Information MSDNDirectX DeveloperCenter

    http://go.microsoft.com/fwlink/?LinkId=10138 MSDNAudio & Video node

    http://go.microsoft.com/fwlink/?LinkId=19380

    Maillist http://discuss.microsoft.com/archives/DIRECT

    XAV.htm UseNet

    microsoft.public.win32.programmer.directx.video

  • 8/6/2019 02 DirectShow

    10/18

    FAQ

    Books

    Programming Microsoft

    DirectShow forDigitalVideoandTelevision

    DirectShow:CoreMediaTechnologyin Windows XP

    Empowers YoutoCreateCustomAudio/Video ProcessingComponents

  • 8/6/2019 02 DirectShow

    11/18

    FAQ

    Howdo I buildmyapplication?

    Header file Required For

    Dshow.h All DirectShow

    APs

    HeaderFile

    Library Files

    Library file Description

    Strmiids.lib Exports the Class ID (CLSIDs)

    Interface ID (IIDs)

    Quartz.lib Exports the AMGetErrorTextfunction,, link

  • 8/6/2019 02 DirectShow

    12/18

    FAQ

    DetectwhetherDirectShowis

    installed?

    IGraphBuilder*pGraph;

    HRESULThr=CoCreateInstance (CLSID_FilterGraph,NULL,

    CLSCTX_INPROC_SERVER, IID_IGraphBuilder,

    (void **) &pGraph);

  • 8/6/2019 02 DirectShow

    13/18

    Introduction toDirectShow

    Application Programming

  • 8/6/2019 02 DirectShow

    14/18

    Filter& FilterGraphs

    Filteris acomponentand

    building block

    receiveinputandproduceoutput

    Filter

    DecodeMPEG-1MPEG-1 encoded

    stream Frame1Frame2

    Frame3

  • 8/6/2019 02 DirectShow

    15/18

    FilterGraph

    APs performs taskbyconnecting

    chains of filters together

    A setofconnected filters is

    calledafilter graph

    a filter graph forplaying an AVI file

  • 8/6/2019 02 DirectShow

    16/18

    Writing aDirectShow

    Application Threetasks mustbeperformed

    Filter GraphManager

    Filter GraphManager

    filter graph

    Filter GraphManager

    filter graph

    1 23

    When processing is completed,

    theapplication releases the FilterGraphManagerandallofthe filters

  • 8/6/2019 02 DirectShow

    17/18

  • 8/6/2019 02 DirectShow

    18/18

    Using COM

    COM

    COMobject

    COMinterface

    COM lifetime

    C COM

    Macros DirectX COMMethod

    DirectX SDK