FFmpeg
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
libavdevice
dshow_enumpins.c
Go to the documentation of this file.
1
/*
2
* DirectShow capture interface
3
* Copyright (c) 2010 Ramiro Polla
4
*
5
* This file is part of FFmpeg.
6
*
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.
11
*
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.
16
*
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
20
*/
21
22
#include "
dshow_capture.h
"
23
24
DECLARE_QUERYINTERFACE
(
libAVEnumPins
,
25
{ {&IID_IUnknown,0}, {&IID_IEnumPins,0} })
26
DECLARE_ADDREF
(
libAVEnumPins
)
27
DECLARE_RELEASE
(
libAVEnumPins
)
28
29
long
WINAPI
30
libAVEnumPins_Next
(
libAVEnumPins
*this,
unsigned
long
n
, IPin **pins,
31
unsigned
long
*fetched)
32
{
33
int
count
= 0;
34
dshowdebug
(
"libAVEnumPins_Next(%p)\n"
,
this
);
35
if
(!pins)
36
return
E_POINTER
;
37
if
(!this->pos && n == 1) {
38
libAVPin_AddRef
(this->pin);
39
*pins = (IPin *) this->pin;
40
count = 1;
41
this->pos = 1;
42
}
43
if
(fetched)
44
*fetched =
count
;
45
if
(!count)
46
return
S_FALSE
;
47
return
S_OK
;
48
}
49
long
WINAPI
50
libAVEnumPins_Skip
(
libAVEnumPins
*
this
,
unsigned
long
n)
51
{
52
dshowdebug
(
"libAVEnumPins_Skip(%p)\n"
,
this
);
53
if
(n)
/* Any skip will always fall outside of the only valid pin. */
54
return
S_FALSE
;
55
return
S_OK
;
56
}
57
long
WINAPI
58
libAVEnumPins_Reset
(
libAVEnumPins
*
this
)
59
{
60
dshowdebug
(
"libAVEnumPins_Reset(%p)\n"
,
this
);
61
this->pos = 0;
62
return
S_OK
;
63
}
64
long
WINAPI
65
libAVEnumPins_Clone
(
libAVEnumPins
*
this
,
libAVEnumPins
**pins)
66
{
67
libAVEnumPins
*
new
;
68
dshowdebug
(
"libAVEnumPins_Clone(%p)\n"
,
this
);
69
if
(!pins)
70
return
E_POINTER
;
71
new
=
libAVEnumPins_Create
(this->pin, this->
filter
);
72
if
(!
new
)
73
return
E_OUTOFMEMORY
;
74
new
->pos = this->pos;
75
*pins =
new
;
76
return
S_OK
;
77
}
78
79
static
int
80
libAVEnumPins_Setup
(
libAVEnumPins
*
this
,
libAVPin
*pin,
libAVFilter
*
filter
)
81
{
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);
90
91
this->pin = pin;
92
this->filter =
filter
;
93
libAVFilter_AddRef
(this->filter);
94
95
return
1;
96
}
97
static
int
98
libAVEnumPins_Cleanup
(
libAVEnumPins
*
this
)
99
{
100
libAVFilter_Release
(this->
filter
);
101
return
1;
102
}
103
DECLARE_CREATE
(
libAVEnumPins
,
libAVEnumPins_Setup
(
this
, pin,
filter
),
104
libAVPin
*pin,
libAVFilter
*
filter
)
105
DECLARE_DESTROY
(
libAVEnumPins
,
libAVEnumPins_Cleanup
)
Generated on Wed Jul 10 2013 23:48:08 for FFmpeg by
1.8.2