Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
e620eee8
Commit
e620eee8
authored
Jan 23, 2015
by
rogerdpack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dshow: miscellaneous tweaks
Signed-off-by:
rogerdpack
<
rogerpack2005@gmail.com
>
parent
d0123441
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
dshow.c
libavdevice/dshow.c
+8
-5
dshow_capture.h
libavdevice/dshow_capture.h
+1
-1
No files found.
libavdevice/dshow.c
View file @
e620eee8
...
@@ -188,10 +188,12 @@ static int shall_we_drop(AVFormatContext *s, int index, enum dshowDeviceType dev
...
@@ -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
};
static
const
uint8_t
dropscore
[]
=
{
62
,
75
,
87
,
100
};
const
int
ndropscores
=
FF_ARRAY_ELEMS
(
dropscore
);
const
int
ndropscores
=
FF_ARRAY_ELEMS
(
dropscore
);
unsigned
int
buffer_fullness
=
(
ctx
->
curbufsize
[
index
]
*
100
)
/
s
->
max_picture_buffer
;
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
)
{
if
(
dropscore
[
++
ctx
->
video_frame_num
%
ndropscores
]
<=
buffer_fullness
)
{
av_log
(
s
,
AV_LOG_ERROR
,
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
;
return
1
;
}
}
...
@@ -366,7 +368,7 @@ dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype,
...
@@ -366,7 +368,7 @@ dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype,
AM_MEDIA_TYPE
*
type
=
NULL
;
AM_MEDIA_TYPE
*
type
=
NULL
;
int
format_set
=
0
;
int
format_set
=
0
;
void
*
caps
=
NULL
;
void
*
caps
=
NULL
;
int
i
,
n
,
size
;
int
i
,
n
,
size
,
r
;
if
(
IPin_QueryInterface
(
pin
,
&
IID_IAMStreamConfig
,
(
void
**
)
&
config
)
!=
S_OK
)
if
(
IPin_QueryInterface
(
pin
,
&
IID_IAMStreamConfig
,
(
void
**
)
&
config
)
!=
S_OK
)
return
;
return
;
...
@@ -378,8 +380,9 @@ dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype,
...
@@ -378,8 +380,9 @@ dshow_cycle_formats(AVFormatContext *avctx, enum dshowDeviceType devtype,
goto
end
;
goto
end
;
for
(
i
=
0
;
i
<
n
&&
!
format_set
;
i
++
)
{
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
#if DSHOWDEBUG
ff_print_AM_MEDIA_TYPE
(
type
);
ff_print_AM_MEDIA_TYPE
(
type
);
#endif
#endif
...
@@ -643,6 +646,7 @@ dshow_cycle_pins(AVFormatContext *avctx, enum dshowDeviceType devtype,
...
@@ -643,6 +646,7 @@ dshow_cycle_pins(AVFormatContext *avctx, enum dshowDeviceType devtype,
goto
next
;
goto
next
;
IEnumMediaTypes_Reset
(
types
);
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
)
{
while
(
!
device_pin
&&
IEnumMediaTypes_Next
(
types
,
1
,
&
type
,
NULL
)
==
S_OK
)
{
if
(
IsEqualGUID
(
&
type
->
majortype
,
mediatype
[
devtype
]))
{
if
(
IsEqualGUID
(
&
type
->
majortype
,
mediatype
[
devtype
]))
{
device_pin
=
pin
;
device_pin
=
pin
;
...
@@ -663,7 +667,6 @@ next:
...
@@ -663,7 +667,6 @@ next:
av_free
(
pin_buf
);
av_free
(
pin_buf
);
if
(
pin_id
)
if
(
pin_id
)
CoTaskMemFree
(
pin_id
);
CoTaskMemFree
(
pin_id
);
}
}
IEnumPins_Release
(
pins
);
IEnumPins_Release
(
pins
);
...
...
libavdevice/dshow_capture.h
View file @
e620eee8
...
@@ -223,7 +223,7 @@ libAVEnumPins *libAVEnumPins_Create (libAVPin *pin, libAVFilter *filter);
...
@@ -223,7 +223,7 @@ libAVEnumPins *libAVEnumPins_Create (libAVPin *pin, libAVFilter *filter);
* libAVEnumMediaTypes
* libAVEnumMediaTypes
****************************************************************************/
****************************************************************************/
struct
libAVEnumMediaTypes
{
struct
libAVEnumMediaTypes
{
IEnum
Pin
sVtbl
*
vtbl
;
IEnum
MediaType
sVtbl
*
vtbl
;
long
ref
;
long
ref
;
int
pos
;
int
pos
;
AM_MEDIA_TYPE
type
;
AM_MEDIA_TYPE
type
;
...
...
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