2 * DirectShow capture interface
3 * Copyright (c) 2010 Ramiro Polla
5 * This file is part of FFmpeg.
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 #include "dshow_capture.h"
24 DECLARE_QUERYINTERFACE(libAVEnumPins
,
25 { {&IID_IUnknown
,0}, {&IID_IEnumPins
,0} })
26 DECLARE_ADDREF(libAVEnumPins
)
27 DECLARE_RELEASE(libAVEnumPins
)
30 libAVEnumPins_Next(libAVEnumPins
*this, unsigned long n
, IPin
**pins
,
31 unsigned long *fetched
)
34 dshowdebug("libAVEnumPins_Next(%p)\n", this);
37 if (!this->pos
&& n
== 1) {
38 libAVPin_AddRef(this->pin
);
39 *pins
= (IPin
*) this->pin
;
50 libAVEnumPins_Skip(libAVEnumPins
*this, unsigned long n
)
52 dshowdebug("libAVEnumPins_Skip(%p)\n", this);
53 if (n
) /* Any skip will always fall outside of the only valid pin. */
58 libAVEnumPins_Reset(libAVEnumPins
*this)
60 dshowdebug("libAVEnumPins_Reset(%p)\n", this);
65 libAVEnumPins_Clone(libAVEnumPins
*this, libAVEnumPins
**pins
)
68 dshowdebug("libAVEnumPins_Clone(%p)\n", this);
71 new = libAVEnumPins_Create(this->pin
, this->filter
);
80 libAVEnumPins_Setup(libAVEnumPins
*this, libAVPin
*pin
, libAVFilter
*filter
)
82 IEnumPinsVtbl
*vtbl
= this->vtbl
;
83 SETVTBL(vtbl
, libAVEnumPins
, QueryInterface
);
84 SETVTBL(vtbl
, libAVEnumPins
, AddRef
);
85 SETVTBL(vtbl
, libAVEnumPins
, Release
);
86 SETVTBL(vtbl
, libAVEnumPins
, Next
);
87 SETVTBL(vtbl
, libAVEnumPins
, Skip
);
88 SETVTBL(vtbl
, libAVEnumPins
, Reset
);
89 SETVTBL(vtbl
, libAVEnumPins
, Clone
);
92 this->filter
= filter
;
93 libAVFilter_AddRef(this->filter
);
98 libAVEnumPins_Cleanup(libAVEnumPins
*this)
100 libAVFilter_Release(this->filter
);
103 DECLARE_CREATE(libAVEnumPins
, libAVEnumPins_Setup(this, pin
, filter
),
104 libAVPin
*pin
, libAVFilter
*filter
)
105 DECLARE_DESTROY(libAVEnumPins
, libAVEnumPins_Cleanup
)