Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
e620eee8
Commit
e620eee8
authored
10 years ago
by
rogerdpack
Browse files
Options
Downloads
Patches
Plain Diff
dshow: miscellaneous tweaks
Signed-off-by:
rogerdpack
<
rogerpack2005@gmail.com
>
parent
d0123441
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libavdevice/dshow.c
+8
-5
8 additions, 5 deletions
libavdevice/dshow.c
libavdevice/dshow_capture.h
+1
-1
1 addition, 1 deletion
libavdevice/dshow_capture.h
with
9 additions
and
6 deletions
libavdevice/dshow.c
+
8
−
5
View file @
e620eee8
...
...
@@ -188,10 +188,12 @@ static int shall_we_drop(AVFormatContext *s, int index, enum dshowDeviceType dev
static
const
uint8_t
dropscore
[]
=
{
62
,
75
,
87
,
100
};
const
int
ndropscores
=
FF_ARRAY_ELEMS
(
dropscore
);
unsigned
int
buffer_fullness
=
(
ctx
->
curbufsize
[
index
]
*
100
)
/
s
->
max_picture_buffer
;
const
char
*
devtypename
=
(
devtype
==
VideoDevice
)
?
"video"
:
"audio"
;
if
(
dropscore
[
++
ctx
->
video_frame_num
%
ndropscores
]
<=
buffer_fullness
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"real-time buffer[%s] too full (%d%% of size: %d)! frame dropped!
\n
"
,
ctx
->
device_name
[
devtype
],
buffer_fullness
,
s
->
max_picture_buffer
);
"real-time buffer [%s] [%s input] too full or near too full (%d%% of size: %d [rtbufsize parameter])! frame dropped!
\n
"
,
ctx
->
device_name
[
devtype
],
devtypename
,
buffer_fullness
,
s
->
max_picture_buffer
);
return
1
;
}
...
...
@@ -366,7 +368,7 @@ dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype,
AM_MEDIA_TYPE
*
type
=
NULL
;
int
format_set
=
0
;
void
*
caps
=
NULL
;
int
i
,
n
,
size
;
int
i
,
n
,
size
,
r
;
if
(
IPin_QueryInterface
(
pin
,
&
IID_IAMStreamConfig
,
(
void
**
)
&
config
)
!=
S_OK
)
return
;
...
...
@@ -378,8 +380,9 @@ dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype,
goto
end
;
for
(
i
=
0
;
i
<
n
&&
!
format_set
;
i
++
)
{
IAMStreamConfig_GetStreamCaps
(
config
,
i
,
&
type
,
(
void
*
)
caps
);
r
=
IAMStreamConfig_GetStreamCaps
(
config
,
i
,
&
type
,
(
void
*
)
caps
);
if
(
r
!=
S_OK
)
goto
next
;
#if DSHOWDEBUG
ff_print_AM_MEDIA_TYPE
(
type
);
#endif
...
...
@@ -643,6 +646,7 @@ dshow_cycle_pins(AVFormatContext *avctx, enum dshowDeviceType devtype,
goto
next
;
IEnumMediaTypes_Reset
(
types
);
/* in case format_set was not called, just verify the majortype */
while
(
!
device_pin
&&
IEnumMediaTypes_Next
(
types
,
1
,
&
type
,
NULL
)
==
S_OK
)
{
if
(
IsEqualGUID
(
&
type
->
majortype
,
mediatype
[
devtype
]))
{
device_pin
=
pin
;
...
...
@@ -663,7 +667,6 @@ next:
av_free
(
pin_buf
);
if
(
pin_id
)
CoTaskMemFree
(
pin_id
);
}
IEnumPins_Release
(
pins
);
...
...
This diff is collapsed.
Click to expand it.
libavdevice/dshow_capture.h
+
1
−
1
View file @
e620eee8
...
...
@@ -223,7 +223,7 @@ libAVEnumPins *libAVEnumPins_Create (libAVPin *pin, libAVFilter *filter);
* libAVEnumMediaTypes
****************************************************************************/
struct
libAVEnumMediaTypes
{
IEnum
Pin
sVtbl
*
vtbl
;
IEnum
MediaType
sVtbl
*
vtbl
;
long
ref
;
int
pos
;
AM_MEDIA_TYPE
type
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment