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
61974c7d
Commit
61974c7d
authored
Jan 26, 2015
by
rogerdpack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dshow: tweak logging
Signed-off-by:
rogerdpack
<
rogerpack2005@gmail.com
>
parent
7c2e2627
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
dshow.c
libavdevice/dshow.c
+2
-2
dshow_pin.c
libavdevice/dshow_pin.c
+9
-3
No files found.
libavdevice/dshow.c
View file @
61974c7d
...
@@ -1044,7 +1044,7 @@ static int dshow_read_header(AVFormatContext *avctx)
...
@@ -1044,7 +1044,7 @@ static int dshow_read_header(AVFormatContext *avctx)
if
(
ctx
->
device_name
[
AudioDevice
])
{
if
(
ctx
->
device_name
[
AudioDevice
])
{
if
((
r
=
dshow_open_device
(
avctx
,
devenum
,
AudioDevice
,
AudioSourceDevice
))
<
0
||
if
((
r
=
dshow_open_device
(
avctx
,
devenum
,
AudioDevice
,
AudioSourceDevice
))
<
0
||
(
r
=
dshow_add_device
(
avctx
,
AudioDevice
))
<
0
)
{
(
r
=
dshow_add_device
(
avctx
,
AudioDevice
))
<
0
)
{
av_log
(
avctx
,
AV_LOG_INFO
,
"Searching for audio device within video devices %s
\n
"
,
ctx
->
device_name
[
AudioDevice
]);
av_log
(
avctx
,
AV_LOG_INFO
,
"Searching for audio device within video devices
for
%s
\n
"
,
ctx
->
device_name
[
AudioDevice
]);
/* see if there's a video source with an audio pin with the given audio name */
/* see if there's a video source with an audio pin with the given audio name */
if
((
r
=
dshow_open_device
(
avctx
,
devenum
,
AudioDevice
,
VideoSourceDevice
))
<
0
||
if
((
r
=
dshow_open_device
(
avctx
,
devenum
,
AudioDevice
,
VideoSourceDevice
))
<
0
||
(
r
=
dshow_add_device
(
avctx
,
AudioDevice
))
<
0
)
{
(
r
=
dshow_add_device
(
avctx
,
AudioDevice
))
<
0
)
{
...
@@ -1104,7 +1104,7 @@ static int dshow_read_header(AVFormatContext *avctx)
...
@@ -1104,7 +1104,7 @@ static int dshow_read_header(AVFormatContext *avctx)
r
=
IMediaControl_GetState
(
control
,
0
,
&
pfs
);
r
=
IMediaControl_GetState
(
control
,
0
,
&
pfs
);
}
}
if
(
r
!=
S_OK
)
{
if
(
r
!=
S_OK
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Could not run
filter
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Could not run
graph (sometimes caused by a device already in use by other application)
\n
"
);
goto
error
;
goto
error
;
}
}
...
...
libavdevice/dshow_pin.c
View file @
61974c7d
...
@@ -304,21 +304,25 @@ libAVMemInputPin_Receive(libAVMemInputPin *this, IMediaSample *sample)
...
@@ -304,21 +304,25 @@ libAVMemInputPin_Receive(libAVMemInputPin *this, IMediaSample *sample)
enum
dshowDeviceType
devtype
=
pin
->
filter
->
type
;
enum
dshowDeviceType
devtype
=
pin
->
filter
->
type
;
void
*
priv_data
;
void
*
priv_data
;
uint8_t
*
buf
;
uint8_t
*
buf
;
int
buf_size
;
int
buf_size
;
/* todo should be a long? */
int
index
;
int
index
;
int64_t
curtime
;
int64_t
curtime
;
int64_t
orig_curtime
;
const
char
*
devtypename
=
(
devtype
==
VideoDevice
)
?
"video"
:
"audio"
;
IReferenceClock
*
clock
=
pin
->
filter
->
clock
;
int64_t
dummy
;
dshowdebug
(
"libAVMemInputPin_Receive(%p)
\n
"
,
this
);
dshowdebug
(
"libAVMemInputPin_Receive(%p)
\n
"
,
this
);
if
(
!
sample
)
if
(
!
sample
)
return
E_POINTER
;
return
E_POINTER
;
IMediaSample_GetTime
(
sample
,
&
orig_curtime
,
&
dummy
);
orig_curtime
+=
pin
->
filter
->
start_time
;
if
(
devtype
==
VideoDevice
)
{
if
(
devtype
==
VideoDevice
)
{
/* PTS from video devices is unreliable. */
/* PTS from video devices is unreliable. */
IReferenceClock
*
clock
=
pin
->
filter
->
clock
;
IReferenceClock_GetTime
(
clock
,
&
curtime
);
IReferenceClock_GetTime
(
clock
,
&
curtime
);
}
else
{
}
else
{
int64_t
dummy
;
IMediaSample_GetTime
(
sample
,
&
curtime
,
&
dummy
);
IMediaSample_GetTime
(
sample
,
&
curtime
,
&
dummy
);
if
(
curtime
>
400000000000000000LL
)
{
if
(
curtime
>
400000000000000000LL
)
{
/* initial frames sometimes start < 0 (shown as a very large number here,
/* initial frames sometimes start < 0 (shown as a very large number here,
...
@@ -336,6 +340,8 @@ libAVMemInputPin_Receive(libAVMemInputPin *this, IMediaSample *sample)
...
@@ -336,6 +340,8 @@ libAVMemInputPin_Receive(libAVMemInputPin *this, IMediaSample *sample)
priv_data
=
pin
->
filter
->
priv_data
;
priv_data
=
pin
->
filter
->
priv_data
;
index
=
pin
->
filter
->
stream_index
;
index
=
pin
->
filter
->
stream_index
;
av_log
(
NULL
,
AV_LOG_VERBOSE
,
"dshow passing through packet of type %s size %6d timestamp %"
PRId64
" orig timestamp %"
PRId64
"
\n
"
,
devtypename
,
buf_size
,
curtime
,
orig_curtime
);
pin
->
filter
->
callback
(
priv_data
,
index
,
buf
,
buf_size
,
curtime
,
devtype
);
pin
->
filter
->
callback
(
priv_data
,
index
,
buf
,
buf_size
,
curtime
,
devtype
);
return
S_OK
;
return
S_OK
;
...
...
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