Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
00788d2d
Commit
00788d2d
authored
Apr 04, 2006
by
Damien Fouilleul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- should fix audio capture for Hauppagge WinTV PVR and other cards
parent
52942a49
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
21 deletions
+29
-21
modules/access/dshow/dshow.cpp
modules/access/dshow/dshow.cpp
+29
-21
No files found.
modules/access/dshow/dshow.cpp
View file @
00788d2d
...
...
@@ -874,7 +874,7 @@ static int OpenDevice( vlc_object_t *p_this, access_sys_t *p_sys,
// Retreive acceptable media types supported by device
AM_MEDIA_TYPE
media_types
[
MAX_MEDIA_TYPES
];
size_t
media_count
=
EnumDeviceCaps
(
p_this
,
p_device_filter
,
p_sys
->
i_chroma
,
EnumDeviceCaps
(
p_this
,
p_device_filter
,
b_audio
?
0
:
p_sys
->
i_chroma
,
p_sys
->
i_width
,
p_sys
->
i_height
,
0
,
0
,
0
,
media_types
,
MAX_MEDIA_TYPES
);
...
...
@@ -1280,55 +1280,63 @@ static size_t EnumDeviceCaps( vlc_object_t *p_this, IBaseFilter *p_filter,
AUDIO_STREAM_CONFIG_CAPS
*
pASCC
=
reinterpret_cast
<
AUDIO_STREAM_CONFIG_CAPS
*>
(
pSCC
);
WAVEFORMATEX
*
pWfx
=
reinterpret_cast
<
WAVEFORMATEX
*>
(
p_mt
->
pbFormat
);
if
(
i_c
hannels
)
if
(
i_c
urrent_fourcc
&&
(
WAVE_FORMAT_PCM
==
pWfx
->
wFormatTag
)
)
{
if
(
!
i_channels
)
i_channels
=
2
;
if
(
i_channels
%
pASCC
->
ChannelsGranularity
||
(
unsigned
int
)
i_channels
<
pASCC
->
MinimumChannels
||
(
unsigned
int
)
i_channels
>
pASCC
->
MaximumChannels
)
{
// required number channels not
compati
ble, try next media type
// required number channels not
availa
ble, try next media type
FreeMediaType
(
*
p_mt
);
CoTaskMemFree
(
(
PVOID
)
p_mt
);
continue
;
}
pWfx
->
nChannels
=
i_channels
;
}
if
(
i_samplespersec
)
{
if
(
i_samplespersec
%
pASCC
->
BitsPerSampleGranularity
if
(
!
i_samplespersec
)
i_samplespersec
=
44100
;
if
(
i_samplespersec
%
pASCC
->
SampleFrequencyGranularity
||
(
unsigned
int
)
i_samplespersec
<
pASCC
->
MinimumSampleFrequency
||
(
unsigned
int
)
i_samplespersec
>
pASCC
->
MaximumSampleFrequency
)
{
// required sampling rate not
compati
ble, try next media type
// required sampling rate not
availa
ble, try next media type
FreeMediaType
(
*
p_mt
);
CoTaskMemFree
(
(
PVOID
)
p_mt
);
continue
;
}
pWfx
->
nSamplesPerSec
=
i_samplespersec
;
}
if
(
!
i_bitspersample
)
{
if
(
VLC_FOURCC
(
'f'
,
'l'
,
'3'
,
'2'
)
==
i_current_fourcc
)
i_bitspersample
=
32
;
else
i_bitspersample
=
16
;
}
if
(
i_bitspersample
)
{
if
(
i_bitspersample
%
pASCC
->
BitsPerSampleGranularity
||
(
unsigned
int
)
i_bitspersample
<
pASCC
->
MinimumBitsPerSample
||
(
unsigned
int
)
i_bitspersample
>
pASCC
->
MaximumBitsPerSample
)
{
// required sample size not
compati
ble, try next media type
// required sample size not
availa
ble, try next media type
FreeMediaType
(
*
p_mt
);
CoTaskMemFree
(
(
PVOID
)
p_mt
);
continue
;
}
pWfx
->
wBitsPerSample
=
i_bitspersample
;
}
pWfx
->
nBlockAlign
=
(
pWfx
->
wBitsPerSample
*
pWfx
->
nChannels
)
/
8
;
pWfx
->
nAvgBytesPerSec
=
pWfx
->
nSamplesPerSec
*
pWfx
->
nBlockAlign
;
// select this format as default
if
(
SUCCEEDED
(
pSC
->
SetFormat
(
p_mt
)
)
)
{
i_priority
=
i_current_priority
;
if
(
i_fourcc
)
// no need to check any more media types
i
=
piCount
;
// select this format as default
if
(
SUCCEEDED
(
pSC
->
SetFormat
(
p_mt
)
)
)
{
i_priority
=
i_current_priority
;
}
}
}
FreeMediaType
(
*
p_mt
);
...
...
@@ -1474,7 +1482,7 @@ static size_t EnumDeviceCaps( vlc_object_t *p_this, IBaseFilter *p_filter,
if
(
VLC_FOURCC
(
'H'
,
'C'
,
'W'
,
'2'
)
==
i_current_fourcc
&&
p_mt
->
majortype
==
MEDIATYPE_Video
)
{
// ouput format for 'Hauppauge WinTV PVR PCI II Capture'
// ou
t
put format for 'Hauppauge WinTV PVR PCI II Capture'
// try I420 as an input format
i_current_fourcc
=
VLC_FOURCC
(
'I'
,
'4'
,
'2'
,
'0'
);
if
(
!
i_fourcc
||
i_fourcc
==
i_current_fourcc
)
...
...
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