Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
71445ddd
Commit
71445ddd
authored
Jul 23, 2004
by
Damien Fouilleul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improved filter compatibility by favoring current connection media type in subsequent connections
parent
d1f89a0c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
11 deletions
+38
-11
modules/access/dshow/filter.cpp
modules/access/dshow/filter.cpp
+37
-11
modules/access/dshow/filter.h
modules/access/dshow/filter.h
+1
-0
No files found.
modules/access/dshow/filter.cpp
View file @
71445ddd
...
...
@@ -513,7 +513,8 @@ STDMETHODIMP CapturePin::Disconnect()
p_connected_pin
->
Release
();
p_connected_pin
=
NULL
;
FreeMediaType
(
cx_media_type
);
//FreeMediaType( cx_media_type );
//cx_media_type.subtype = GUID_NULL;
return
S_OK
;
}
...
...
@@ -1102,10 +1103,12 @@ CaptureEnumMediaTypes::CaptureEnumMediaTypes( access_t * _p_input,
/* Are we creating a new enumerator */
if
(
pEnumMediaTypes
==
NULL
)
{
CopyMediaType
(
&
cx_media_type
,
&
p_pin
->
cx_media_type
);
i_position
=
0
;
}
else
{
CopyMediaType
(
&
cx_media_type
,
&
pEnumMediaTypes
->
cx_media_type
);
i_position
=
pEnumMediaTypes
->
i_position
;
}
}
...
...
@@ -1115,6 +1118,7 @@ CaptureEnumMediaTypes::~CaptureEnumMediaTypes()
#ifdef DEBUG_DSHOW
msg_Dbg
(
p_input
,
"CaptureEnumMediaTypes::~CaptureEnumMediaTypes"
);
#endif
FreeMediaType
(
cx_media_type
);
p_pin
->
Release
();
}
...
...
@@ -1165,7 +1169,9 @@ STDMETHODIMP CaptureEnumMediaTypes::Next( ULONG cMediaTypes,
#ifdef DEBUG_DSHOW
msg_Dbg
(
p_input
,
"CaptureEnumMediaTypes::Next "
);
#endif
ULONG
count
;
ULONG
copied
=
0
;
ULONG
offset
=
0
;
ULONG
max
=
p_pin
->
media_type_count
;
if
(
!
ppMediaTypes
)
return
E_POINTER
;
...
...
@@ -1173,33 +1179,51 @@ STDMETHODIMP CaptureEnumMediaTypes::Next( ULONG cMediaTypes,
if
(
(
!
pcFetched
)
&&
(
cMediaTypes
>
1
)
)
return
E_POINTER
;
count
=
0
;
/*
** use connection media type as first entry in iterator if it exists
*/
copied
=
0
;
if
(
cx_media_type
.
subtype
!=
GUID_NULL
)
{
++
max
;
if
(
i_position
==
0
)
{
ppMediaTypes
[
copied
]
=
(
AM_MEDIA_TYPE
*
)
CoTaskMemAlloc
(
sizeof
(
AM_MEDIA_TYPE
));
if
(
CopyMediaType
(
ppMediaTypes
[
copied
],
&
cx_media_type
)
!=
S_OK
)
return
E_OUTOFMEMORY
;
++
i_position
;
++
copied
;
}
}
while
(
(
co
unt
<
cMediaTypes
)
&&
(
i_position
<
p_pin
->
media_type_count
)
)
while
(
(
co
pied
<
cMediaTypes
)
&&
(
i_position
<
max
)
)
{
ppMediaTypes
[
co
unt
]
=
(
AM_MEDIA_TYPE
*
)
CoTaskMemAlloc
(
sizeof
(
AM_MEDIA_TYPE
));
if
(
CopyMediaType
(
ppMediaTypes
[
co
unt
],
&
p_pin
->
media_types
[
i_position
])
!=
S_OK
)
ppMediaTypes
[
co
pied
]
=
(
AM_MEDIA_TYPE
*
)
CoTaskMemAlloc
(
sizeof
(
AM_MEDIA_TYPE
));
if
(
CopyMediaType
(
ppMediaTypes
[
co
pied
],
&
p_pin
->
media_types
[
i_position
-
offset
])
!=
S_OK
)
return
E_OUTOFMEMORY
;
count
++
;
i_position
++
;
++
copied
;
++
i_position
;
}
if
(
pcFetched
)
{
*
pcFetched
=
co
unt
;
*
pcFetched
=
co
pied
;
}
return
(
co
unt
==
cMediaTypes
)
?
S_OK
:
S_FALSE
;
return
(
co
pied
==
cMediaTypes
)
?
S_OK
:
S_FALSE
;
};
STDMETHODIMP
CaptureEnumMediaTypes
::
Skip
(
ULONG
cMediaTypes
)
{
ULONG
max
=
p_pin
->
media_type_count
;
if
(
cx_media_type
.
subtype
!=
GUID_NULL
)
{
max
=
1
;
}
#ifdef DEBUG_DSHOW
msg_Dbg
(
p_input
,
"CaptureEnumMediaTypes::Skip"
);
#endif
i_position
+=
cMediaTypes
;
return
(
i_position
<
p_pin
->
media_type_count
)
?
S_OK
:
S_FALSE
;
return
(
i_position
<
max
)
?
S_OK
:
S_FALSE
;
};
STDMETHODIMP
CaptureEnumMediaTypes
::
Reset
()
{
...
...
@@ -1207,6 +1231,8 @@ STDMETHODIMP CaptureEnumMediaTypes::Reset()
msg_Dbg
(
p_input
,
"CaptureEnumMediaTypes::Reset"
);
#endif
FreeMediaType
(
cx_media_type
);
CopyMediaType
(
&
cx_media_type
,
&
p_pin
->
cx_media_type
);
i_position
=
0
;
return
S_OK
;
};
...
...
modules/access/dshow/filter.h
View file @
71445ddd
...
...
@@ -208,6 +208,7 @@ class CaptureEnumMediaTypes : public IEnumMediaTypes
{
access_t
*
p_input
;
CapturePin
*
p_pin
;
AM_MEDIA_TYPE
cx_media_type
;
size_t
i_position
;
long
i_ref
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment