include/avcap/windows/Crossbar.h

Go to the documentation of this file.
00001 /*
00002  * (c) 2005, 2008 Nico Pranke <Nico.Pranke@googlemail.com>, Robin Luedtke <RobinLu@gmx.de> 
00003  *
00004  * This file is part of avcap.
00005  *
00006  * avcap is free software: you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation, either version 3 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * avcap is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with avcap.  If not, see <http://www.gnu.org/licenses/>.
00018  */
00019 
00020 /* avcap is free for non-commercial use.
00021  * To use it in commercial endeavors, please contact Nico Pranke <Nico.Pranke@googlemail.com>.
00022  */
00023 
00024 
00025 #ifndef CROSSBAR_H_
00026 #define CROSSBAR_H_
00027 
00028 #include <DShow.h>
00029 
00030 #include "avcap-export.h"
00031 
00032 namespace avcap
00033 {
00034         struct AVCAP_Export STConnector
00035         {
00036                 std::string NameOfConnector;
00037                 LONG PhysicalType;
00038                 bool IsAudioConnector;
00039                 bool IsVideoConnector;
00040                 bool IsRouted;
00041         
00042                 IAMCrossbar *Crossbar;
00043                 long PinIndexOfCrossbar;
00044                 int AudioSet; 
00045                 
00046                 /* Video inputs correspond to zero or max. one audio input. 
00047                  The pins are numbered from 0 to N-1, N <= 32.
00048                  Each bit set is the index of a audio pin on the 
00049                  same crossbar corresponding to the selected video pin.
00050                  AudioSet only used for video input pins. */
00051         
00052                 int PinIndex; // Independent PinIndex
00053         };
00054         
00055         struct AVCAP_Export STRouting
00056         {
00057                 long OutputPinIndex;
00058                 IPin *OutputPin;
00059                 long RelatedInPinIndex;
00060                 IPin *RelatedInputPin;
00061                 IAMCrossbar *Crossbar;
00062                 int CrossbarIndex; // Zero based index
00063                 bool HasConnector;
00064         };
00065         
00067         
00085         class AVCAP_Export CCrossbar
00086         {
00087         public:
00088                 CCrossbar(ICaptureGraphBuilder2 *CaptureGraphBuilder);
00089                 ~CCrossbar(void);
00090         
00095                 int FindAllCrossbarsAndConnectors(IBaseFilter *StartFilter);
00096                 std::list<STConnector*>& GetInputConnectorList();
00097         
00100                 bool GetCurrentVideoInput(STConnector *Connector);
00101         
00104                 bool GetCurrentAudioInput(STConnector *Connector);
00105         
00108                 bool SetInput(int PinIndex);
00109         
00110         private:
00111                 QzCComPtr<ICaptureGraphBuilder2> m_CaptureBuilder;
00112                 std::list<IAMCrossbar*> m_CrossbarList;
00113                 std::list<STRouting*> m_RoutingList;
00114                 std::list<STConnector*> m_InputConnectorList;
00115         
00116                 HRESULT GetCrossbarIPinAtIndex(IAMCrossbar *pXbar, LONG PinIndex,
00117                                 BOOL IsInputPin, IPin ** ppPin);
00118                 void StringFromPinType(std::string &PinName, long lType);
00119                 void DeleteAllLists();
00120         };
00121 }
00122 
00123 #endif // CROSSBAR_H_

Generated on Mon Nov 30 11:10:30 2009 for avcap-0.1 by  doxygen 1.5.1