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
4bb04098
Commit
4bb04098
authored
Dec 29, 2017
by
Marton Balint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avdevice: migrate to AVFormatContext->url
Signed-off-by:
Marton Balint
<
cus@passwd.hu
>
parent
25a2d269
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
59 additions
and
57 deletions
+59
-57
alsa.c
libavdevice/alsa.c
+2
-2
avfoundation.m
libavdevice/avfoundation.m
+1
-1
bktr.c
libavdevice/bktr.c
+1
-1
caca.c
libavdevice/caca.c
+1
-1
decklink_common.cpp
libavdevice/decklink_common.cpp
+1
-1
decklink_dec.cpp
libavdevice/decklink_dec.cpp
+2
-2
decklink_enc.cpp
libavdevice/decklink_enc.cpp
+2
-2
dshow.c
libavdevice/dshow.c
+1
-1
fbdev_dec.c
libavdevice/fbdev_dec.c
+2
-2
fbdev_enc.c
libavdevice/fbdev_enc.c
+2
-2
gdigrab.c
libavdevice/gdigrab.c
+1
-1
iec61883.c
libavdevice/iec61883.c
+4
-4
jack.c
libavdevice/jack.c
+3
-3
lavfi.c
libavdevice/lavfi.c
+1
-1
libcdio.c
libavdevice/libcdio.c
+3
-3
libndi_newtek_dec.c
libavdevice/libndi_newtek_dec.c
+1
-1
libndi_newtek_enc.c
libavdevice/libndi_newtek_enc.c
+2
-2
openal-dec.c
libavdevice/openal-dec.c
+1
-1
opengl_enc.c
libavdevice/opengl_enc.c
+1
-1
oss_dec.c
libavdevice/oss_dec.c
+1
-1
oss_enc.c
libavdevice/oss_enc.c
+1
-1
pulse_audio_dec.c
libavdevice/pulse_audio_dec.c
+2
-2
pulse_audio_enc.c
libavdevice/pulse_audio_enc.c
+2
-2
sdl2.c
libavdevice/sdl2.c
+1
-1
sndio_dec.c
libavdevice/sndio_dec.c
+1
-1
sndio_enc.c
libavdevice/sndio_enc.c
+1
-1
v4l2.c
libavdevice/v4l2.c
+9
-7
v4l2enc.c
libavdevice/v4l2enc.c
+2
-2
vfwcap.c
libavdevice/vfwcap.c
+2
-2
xcbgrab.c
libavdevice/xcbgrab.c
+4
-4
xv.c
libavdevice/xv.c
+1
-1
No files found.
libavdevice/alsa.c
View file @
4bb04098
...
...
@@ -177,8 +177,8 @@ av_cold int ff_alsa_open(AVFormatContext *ctx, snd_pcm_stream_t mode,
snd_pcm_uframes_t
buffer_size
,
period_size
;
uint64_t
layout
=
ctx
->
streams
[
0
]
->
codecpar
->
channel_layout
;
if
(
ctx
->
filename
[
0
]
==
0
)
audio_device
=
"default"
;
else
audio_device
=
ctx
->
filename
;
if
(
ctx
->
url
[
0
]
==
0
)
audio_device
=
"default"
;
else
audio_device
=
ctx
->
url
;
if
(
*
codec_id
==
AV_CODEC_ID_NONE
)
*
codec_id
=
DEFAULT_CODEC_ID
;
...
...
libavdevice/avfoundation.m
View file @
4bb04098
...
...
@@ -259,7 +259,7 @@ static void destroy_context(AVFContext* ctx)
static
void
parse_device_name
(
AVFormatContext
*
s
)
{
AVFContext
*
ctx
=
(
AVFContext
*
)
s
->
priv_data
;
char
*
tmp
=
av_strdup
(
s
->
filename
);
char
*
tmp
=
av_strdup
(
s
->
url
);
char
*
save
;
if
(
tmp
[
0
]
!=
':'
)
{
...
...
libavdevice/bktr.c
View file @
4bb04098
...
...
@@ -294,7 +294,7 @@ static int grab_read_header(AVFormatContext *s1)
st
->
codecpar
->
height
=
s
->
height
;
st
->
avg_frame_rate
=
framerate
;
if
(
bktr_init
(
s1
->
filename
,
s
->
width
,
s
->
height
,
s
->
standard
,
if
(
bktr_init
(
s1
->
url
,
s
->
width
,
s
->
height
,
s
->
standard
,
&
s
->
video_fd
,
&
s
->
tuner_fd
,
-
1
,
0
.
0
)
<
0
)
{
ret
=
AVERROR
(
EIO
);
goto
out
;
...
...
libavdevice/caca.c
View file @
4bb04098
...
...
@@ -178,7 +178,7 @@ static int caca_write_header(AVFormatContext *s)
}
if
(
!
c
->
window_title
)
c
->
window_title
=
av_strdup
(
s
->
filename
);
c
->
window_title
=
av_strdup
(
s
->
url
);
caca_set_display_title
(
c
->
display
,
c
->
window_title
);
caca_set_display_time
(
c
->
display
,
av_rescale_q
(
1
,
st
->
codec
->
time_base
,
AV_TIME_BASE_Q
));
...
...
libavdevice/decklink_common.cpp
View file @
4bb04098
...
...
@@ -404,7 +404,7 @@ int ff_decklink_list_formats(AVFormatContext *avctx, decklink_direction_t direct
}
av_log
(
avctx
,
AV_LOG_INFO
,
"Supported formats for '%s':
\n\t
format_code
\t
description"
,
avctx
->
filename
);
avctx
->
url
);
while
(
itermode
->
Next
(
&
mode
)
==
S_OK
)
{
BMDTimeValue
tb_num
,
tb_den
;
mode
->
GetFrameRate
(
&
tb_num
,
&
tb_den
);
...
...
libavdevice/decklink_dec.cpp
View file @
4bb04098
...
...
@@ -951,7 +951,7 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx)
cctx
->
raw_format
=
MKBETAG
(
'v'
,
'2'
,
'1'
,
'0'
);
}
strcpy
(
fname
,
avctx
->
filename
);
av_strlcpy
(
fname
,
avctx
->
url
,
sizeof
(
fname
)
);
tmp
=
strchr
(
fname
,
'@'
);
if
(
tmp
!=
NULL
)
{
av_log
(
avctx
,
AV_LOG_WARNING
,
"The @mode syntax is deprecated and will be removed. Please use the -format_code option.
\n
"
);
...
...
@@ -966,7 +966,7 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx)
/* Get input device. */
if
(
ctx
->
dl
->
QueryInterface
(
IID_IDeckLinkInput
,
(
void
**
)
&
ctx
->
dli
)
!=
S_OK
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Could not open input device from '%s'
\n
"
,
avctx
->
filename
);
avctx
->
url
);
ret
=
AVERROR
(
EIO
);
goto
error
;
}
...
...
libavdevice/decklink_enc.cpp
View file @
4bb04098
...
...
@@ -400,14 +400,14 @@ av_cold int ff_decklink_write_header(AVFormatContext *avctx)
return
AVERROR_EXIT
;
}
ret
=
ff_decklink_init_device
(
avctx
,
avctx
->
filename
);
ret
=
ff_decklink_init_device
(
avctx
,
avctx
->
url
);
if
(
ret
<
0
)
return
ret
;
/* Get output device. */
if
(
ctx
->
dl
->
QueryInterface
(
IID_IDeckLinkOutput
,
(
void
**
)
&
ctx
->
dlo
)
!=
S_OK
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Could not open output device from '%s'
\n
"
,
avctx
->
filename
);
avctx
->
url
);
ret
=
AVERROR
(
EIO
);
goto
error
;
}
...
...
libavdevice/dshow.c
View file @
4bb04098
...
...
@@ -1033,7 +1033,7 @@ static int parse_device_name(AVFormatContext *avctx)
{
struct
dshow_ctx
*
ctx
=
avctx
->
priv_data
;
char
**
device_name
=
ctx
->
device_name
;
char
*
name
=
av_strdup
(
avctx
->
filename
);
char
*
name
=
av_strdup
(
avctx
->
url
);
char
*
tmp
=
name
;
int
ret
=
1
;
char
*
type
;
...
...
libavdevice/fbdev_dec.c
View file @
4bb04098
...
...
@@ -78,8 +78,8 @@ static av_cold int fbdev_read_header(AVFormatContext *avctx)
if
(
avctx
->
flags
&
AVFMT_FLAG_NONBLOCK
)
flags
|=
O_NONBLOCK
;
if
(
avctx
->
filename
[
0
])
device
=
avctx
->
filename
;
if
(
avctx
->
url
[
0
])
device
=
avctx
->
url
;
else
device
=
ff_fbdev_default_device
();
...
...
libavdevice/fbdev_enc.c
View file @
4bb04098
...
...
@@ -53,8 +53,8 @@ static av_cold int fbdev_write_header(AVFormatContext *h)
return
AVERROR
(
EINVAL
);
}
if
(
h
->
filename
[
0
])
device
=
h
->
filename
;
if
(
h
->
url
[
0
])
device
=
h
->
url
;
else
device
=
ff_fbdev_default_device
();
...
...
libavdevice/gdigrab.c
View file @
4bb04098
...
...
@@ -230,7 +230,7 @@ gdigrab_read_header(AVFormatContext *s1)
HBITMAP
hbmp
=
NULL
;
void
*
buffer
=
NULL
;
const
char
*
filename
=
s1
->
filename
;
const
char
*
filename
=
s1
->
url
;
const
char
*
name
=
NULL
;
AVStream
*
st
=
NULL
;
...
...
libavdevice/iec61883.c
View file @
4bb04098
...
...
@@ -259,14 +259,14 @@ static int iec61883_read_header(AVFormatContext *context)
goto
fail
;
}
inport
=
strtol
(
context
->
filename
,
&
endptr
,
10
);
if
(
endptr
!=
context
->
filename
&&
*
endptr
==
'\0'
)
{
inport
=
strtol
(
context
->
url
,
&
endptr
,
10
);
if
(
endptr
!=
context
->
url
&&
*
endptr
==
'\0'
)
{
av_log
(
context
,
AV_LOG_INFO
,
"Selecting IEEE1394 port: %d
\n
"
,
inport
);
j
=
inport
;
nb_ports
=
inport
+
1
;
}
else
if
(
strcmp
(
context
->
filename
,
"auto"
))
{
}
else
if
(
strcmp
(
context
->
url
,
"auto"
))
{
av_log
(
context
,
AV_LOG_ERROR
,
"Invalid input
\"
%s
\"
, you should specify "
"
\"
auto
\"
for auto-detection, or the port number.
\n
"
,
context
->
filename
);
"
\"
auto
\"
for auto-detection, or the port number.
\n
"
,
context
->
url
);
goto
fail
;
}
...
...
libavdevice/jack.c
View file @
4bb04098
...
...
@@ -150,8 +150,8 @@ static int start_jack(AVFormatContext *context)
jack_status_t
status
;
int
i
,
test
;
/* Register as a JACK client, using the context
filename
as client name. */
self
->
client
=
jack_client_open
(
context
->
filename
,
JackNullOption
,
&
status
);
/* Register as a JACK client, using the context
url
as client name. */
self
->
client
=
jack_client_open
(
context
->
url
,
JackNullOption
,
&
status
);
if
(
!
self
->
client
)
{
av_log
(
context
,
AV_LOG_ERROR
,
"Unable to register as a JACK client
\n
"
);
return
AVERROR
(
EIO
);
...
...
@@ -174,7 +174,7 @@ static int start_jack(AVFormatContext *context)
JackPortIsInput
,
0
);
if
(
!
self
->
ports
[
i
])
{
av_log
(
context
,
AV_LOG_ERROR
,
"Unable to register port %s:%s
\n
"
,
context
->
filename
,
str
);
context
->
url
,
str
);
jack_client_close
(
self
->
client
);
return
AVERROR
(
EIO
);
}
...
...
libavdevice/lavfi.c
View file @
4bb04098
...
...
@@ -166,7 +166,7 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
}
if
(
!
lavfi
->
graph_str
)
lavfi
->
graph_str
=
av_strdup
(
avctx
->
filename
);
lavfi
->
graph_str
=
av_strdup
(
avctx
->
url
);
/* parse the graph, create a stream for each open output */
if
(
!
(
lavfi
->
graph
=
avfilter_graph_alloc
()))
...
...
libavdevice/libcdio.c
View file @
4bb04098
...
...
@@ -60,9 +60,9 @@ static av_cold int read_header(AVFormatContext *ctx)
if
(
!
(
st
=
avformat_new_stream
(
ctx
,
NULL
)))
return
AVERROR
(
ENOMEM
);
s
->
drive
=
cdio_cddap_identify
(
ctx
->
filename
,
CDDA_MESSAGE_LOGIT
,
&
err
);
s
->
drive
=
cdio_cddap_identify
(
ctx
->
url
,
CDDA_MESSAGE_LOGIT
,
&
err
);
if
(
!
s
->
drive
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Could not open drive %s.
\n
"
,
ctx
->
filename
);
av_log
(
ctx
,
AV_LOG_ERROR
,
"Could not open drive %s.
\n
"
,
ctx
->
url
);
return
AVERROR
(
EINVAL
);
}
if
(
err
)
{
...
...
@@ -70,7 +70,7 @@ static av_cold int read_header(AVFormatContext *ctx)
free
(
err
);
}
if
((
ret
=
cdio_cddap_open
(
s
->
drive
))
<
0
||
!
s
->
drive
->
opened
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Could not open disk in drive %s.
\n
"
,
ctx
->
filename
);
av_log
(
ctx
,
AV_LOG_ERROR
,
"Could not open disk in drive %s.
\n
"
,
ctx
->
url
);
return
AVERROR
(
EINVAL
);
}
...
...
libavdevice/libndi_newtek_dec.c
View file @
4bb04098
...
...
@@ -149,7 +149,7 @@ static int ndi_read_header(AVFormatContext *avctx)
}
/* Find available sources. */
ret
=
ndi_find_sources
(
avctx
,
avctx
->
filename
,
&
recv_create_desc
.
source_to_connect_to
);
ret
=
ndi_find_sources
(
avctx
,
avctx
->
url
,
&
recv_create_desc
.
source_to_connect_to
);
if
(
ctx
->
find_sources
)
{
return
AVERROR_EXIT
;
}
...
...
libavdevice/libndi_newtek_enc.c
View file @
4bb04098
...
...
@@ -233,7 +233,7 @@ static int ndi_write_header(AVFormatContext *avctx)
int
ret
=
0
;
unsigned
int
n
;
struct
NDIContext
*
ctx
=
avctx
->
priv_data
;
const
NDIlib_send_create_t
ndi_send_desc
=
{
.
p_ndi_name
=
avctx
->
filename
,
const
NDIlib_send_create_t
ndi_send_desc
=
{
.
p_ndi_name
=
avctx
->
url
,
.
p_groups
=
NULL
,
.
clock_video
=
ctx
->
clock_video
,
.
clock_audio
=
ctx
->
clock_audio
};
if
(
!
NDIlib_initialize
())
{
...
...
@@ -260,7 +260,7 @@ static int ndi_write_header(AVFormatContext *avctx)
ctx
->
ndi_send
=
NDIlib_send_create
(
&
ndi_send_desc
);
if
(
!
ctx
->
ndi_send
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to create NDI output %s
\n
"
,
avctx
->
filename
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Failed to create NDI output %s
\n
"
,
avctx
->
url
);
ret
=
AVERROR_EXTERNAL
;
}
...
...
libavdevice/openal-dec.c
View file @
4bb04098
...
...
@@ -139,7 +139,7 @@ static int read_header(AVFormatContext *ctx)
/* Open device for capture */
ad
->
device
=
alcCaptureOpenDevice
(
ctx
->
filename
[
0
]
?
ctx
->
filename
:
NULL
,
alcCaptureOpenDevice
(
ctx
->
url
[
0
]
?
ctx
->
url
:
NULL
,
ad
->
sample_rate
,
ad
->
sample_format
,
ad
->
sample_rate
);
/* Maximum 1 second of sample data to be read at once */
...
...
libavdevice/opengl_enc.c
View file @
4bb04098
...
...
@@ -1070,7 +1070,7 @@ static av_cold int opengl_write_header(AVFormatContext *h)
opengl
->
window_height
=
opengl
->
height
;
if
(
!
opengl
->
window_title
&&
!
opengl
->
no_window
)
opengl
->
window_title
=
av_strdup
(
h
->
filename
);
opengl
->
window_title
=
av_strdup
(
h
->
url
);
if
((
ret
=
opengl_create_window
(
h
)))
goto
fail
;
...
...
libavdevice/oss_dec.c
View file @
4bb04098
...
...
@@ -52,7 +52,7 @@ static int audio_read_header(AVFormatContext *s1)
return
AVERROR
(
ENOMEM
);
}
ret
=
ff_oss_audio_open
(
s1
,
0
,
s1
->
filename
);
ret
=
ff_oss_audio_open
(
s1
,
0
,
s1
->
url
);
if
(
ret
<
0
)
{
return
AVERROR
(
EIO
);
}
...
...
libavdevice/oss_enc.c
View file @
4bb04098
...
...
@@ -46,7 +46,7 @@ static int audio_write_header(AVFormatContext *s1)
st
=
s1
->
streams
[
0
];
s
->
sample_rate
=
st
->
codecpar
->
sample_rate
;
s
->
channels
=
st
->
codecpar
->
channels
;
ret
=
ff_oss_audio_open
(
s1
,
1
,
s1
->
filename
);
ret
=
ff_oss_audio_open
(
s1
,
1
,
s1
->
url
);
if
(
ret
<
0
)
{
return
AVERROR
(
EIO
);
}
else
{
...
...
libavdevice/pulse_audio_dec.c
View file @
4bb04098
...
...
@@ -158,8 +158,8 @@ static av_cold int pulse_read_header(AVFormatContext *s)
attr
.
fragsize
=
pd
->
fragment_size
;
if
(
s
->
filename
[
0
]
!=
'\0'
&&
strcmp
(
s
->
filename
,
"default"
))
device
=
s
->
filename
;
if
(
s
->
url
[
0
]
!=
'\0'
&&
strcmp
(
s
->
url
,
"default"
))
device
=
s
->
url
;
if
(
!
(
pd
->
mainloop
=
pa_threaded_mainloop_new
()))
{
pulse_close
(
s
);
...
...
libavdevice/pulse_audio_enc.c
View file @
4bb04098
...
...
@@ -459,8 +459,8 @@ static av_cold int pulse_write_header(AVFormatContext *h)
st
=
h
->
streams
[
0
];
if
(
!
stream_name
)
{
if
(
h
->
filename
[
0
])
stream_name
=
h
->
filename
;
if
(
h
->
url
[
0
])
stream_name
=
h
->
url
;
else
stream_name
=
"Playback"
;
}
...
...
libavdevice/sdl2.c
View file @
4bb04098
...
...
@@ -165,7 +165,7 @@ static int sdl2_write_header(AVFormatContext *s)
int
flags
=
0
;
if
(
!
sdl
->
window_title
)
sdl
->
window_title
=
av_strdup
(
s
->
filename
);
sdl
->
window_title
=
av_strdup
(
s
->
url
);
if
(
SDL_WasInit
(
SDL_INIT_VIDEO
))
{
av_log
(
s
,
AV_LOG_WARNING
,
...
...
libavdevice/sndio_dec.c
View file @
4bb04098
...
...
@@ -41,7 +41,7 @@ static av_cold int audio_read_header(AVFormatContext *s1)
if
(
!
st
)
return
AVERROR
(
ENOMEM
);
ret
=
ff_sndio_open
(
s1
,
0
,
s1
->
filename
);
ret
=
ff_sndio_open
(
s1
,
0
,
s1
->
url
);
if
(
ret
<
0
)
return
ret
;
...
...
libavdevice/sndio_enc.c
View file @
4bb04098
...
...
@@ -38,7 +38,7 @@ static av_cold int audio_write_header(AVFormatContext *s1)
s
->
sample_rate
=
st
->
codecpar
->
sample_rate
;
s
->
channels
=
st
->
codecpar
->
channels
;
ret
=
ff_sndio_open
(
s1
,
1
,
s1
->
filename
);
ret
=
ff_sndio_open
(
s1
,
1
,
s1
->
url
);
return
ret
;
}
...
...
libavdevice/v4l2.c
View file @
4bb04098
...
...
@@ -106,7 +106,7 @@ struct buff_data {
int
index
;
};
static
int
device_open
(
AVFormatContext
*
ctx
)
static
int
device_open
(
AVFormatContext
*
ctx
,
const
char
*
device_path
)
{
struct
video_data
*
s
=
ctx
->
priv_data
;
struct
v4l2_capability
cap
;
...
...
@@ -147,11 +147,11 @@ static int device_open(AVFormatContext *ctx)
flags
|=
O_NONBLOCK
;
}
fd
=
v4l2_open
(
ctx
->
filename
,
flags
,
0
);
fd
=
v4l2_open
(
device_path
,
flags
,
0
);
if
(
fd
<
0
)
{
err
=
AVERROR
(
errno
);
av_log
(
ctx
,
AV_LOG_ERROR
,
"Cannot open video device %s: %s
\n
"
,
ctx
->
filename
,
av_err2str
(
err
));
device_path
,
av_err2str
(
err
));
return
err
;
}
...
...
@@ -840,7 +840,7 @@ static int v4l2_read_header(AVFormatContext *ctx)
v4l2_log_file
=
fopen
(
"/dev/null"
,
"w"
);
#endif
s
->
fd
=
device_open
(
ctx
);
s
->
fd
=
device_open
(
ctx
,
ctx
->
url
);
if
(
s
->
fd
<
0
)
return
s
->
fd
;
...
...
@@ -1042,11 +1042,13 @@ static int v4l2_get_device_list(AVFormatContext *ctx, AVDeviceInfoList *device_l
return
ret
;
}
while
((
entry
=
readdir
(
dir
)))
{
char
device_name
[
256
];
if
(
!
v4l2_is_v4l_dev
(
entry
->
d_name
))
continue
;
snprintf
(
ctx
->
filename
,
sizeof
(
ctx
->
file
name
),
"/dev/%s"
,
entry
->
d_name
);
if
((
s
->
fd
=
device_open
(
ctx
))
<
0
)
snprintf
(
device_name
,
sizeof
(
device_
name
),
"/dev/%s"
,
entry
->
d_name
);
if
((
s
->
fd
=
device_open
(
ctx
,
device_name
))
<
0
)
continue
;
if
(
v4l2_ioctl
(
s
->
fd
,
VIDIOC_QUERYCAP
,
&
cap
)
<
0
)
{
...
...
@@ -1060,7 +1062,7 @@ static int v4l2_get_device_list(AVFormatContext *ctx, AVDeviceInfoList *device_l
ret
=
AVERROR
(
ENOMEM
);
goto
fail
;
}
device
->
device_name
=
av_strdup
(
ctx
->
file
name
);
device
->
device_name
=
av_strdup
(
device_
name
);
device
->
device_description
=
av_strdup
(
cap
.
card
);
if
(
!
device
->
device_name
||
!
device
->
device_description
)
{
ret
=
AVERROR
(
ENOMEM
);
...
...
libavdevice/v4l2enc.c
View file @
4bb04098
...
...
@@ -39,10 +39,10 @@ static av_cold int write_header(AVFormatContext *s1)
if
(
s1
->
flags
&
AVFMT_FLAG_NONBLOCK
)
flags
|=
O_NONBLOCK
;
s
->
fd
=
open
(
s1
->
filename
,
flags
);
s
->
fd
=
open
(
s1
->
url
,
flags
);
if
(
s
->
fd
<
0
)
{
res
=
AVERROR
(
errno
);
av_log
(
s1
,
AV_LOG_ERROR
,
"Unable to open V4L2 device '%s'
\n
"
,
s1
->
filename
);
av_log
(
s1
,
AV_LOG_ERROR
,
"Unable to open V4L2 device '%s'
\n
"
,
s1
->
url
);
return
res
;
}
...
...
libavdevice/vfwcap.c
View file @
4bb04098
...
...
@@ -256,7 +256,7 @@ static int vfw_read_header(AVFormatContext *s)
int
ret
;
AVRational
framerate_q
;
if
(
!
strcmp
(
s
->
filename
,
"list"
))
{
if
(
!
strcmp
(
s
->
url
,
"list"
))
{
for
(
devnum
=
0
;
devnum
<=
9
;
devnum
++
)
{
char
driver_name
[
256
];
char
driver_ver
[
256
];
...
...
@@ -279,7 +279,7 @@ static int vfw_read_header(AVFormatContext *s)
}
/* If atoi fails, devnum==0 and the default device is used */
devnum
=
atoi
(
s
->
filename
);
devnum
=
atoi
(
s
->
url
);
ret
=
SendMessage
(
ctx
->
hwnd
,
WM_CAP_DRIVER_CONNECT
,
devnum
,
0
);
if
(
!
ret
)
{
...
...
libavdevice/xcbgrab.c
View file @
4bb04098
...
...
@@ -629,14 +629,14 @@ static av_cold int xcbgrab_read_header(AVFormatContext *s)
XCBGrabContext
*
c
=
s
->
priv_data
;
int
screen_num
,
ret
;
const
xcb_setup_t
*
setup
;
char
*
display_name
=
av_strdup
(
s
->
filename
);
char
*
display_name
=
av_strdup
(
s
->
url
);
if
(
!
display_name
)
return
AVERROR
(
ENOMEM
);
if
(
!
sscanf
(
s
->
filename
,
"%[^+]+%d,%d"
,
display_name
,
&
c
->
x
,
&
c
->
y
))
{
if
(
!
sscanf
(
s
->
url
,
"%[^+]+%d,%d"
,
display_name
,
&
c
->
x
,
&
c
->
y
))
{
*
display_name
=
0
;
sscanf
(
s
->
filename
,
"+%d,%d"
,
&
c
->
x
,
&
c
->
y
);
sscanf
(
s
->
url
,
"+%d,%d"
,
&
c
->
x
,
&
c
->
y
);
}
c
->
conn
=
xcb_connect
(
display_name
[
0
]
?
display_name
:
NULL
,
&
screen_num
);
...
...
@@ -644,7 +644,7 @@ static av_cold int xcbgrab_read_header(AVFormatContext *s)
if
((
ret
=
xcb_connection_has_error
(
c
->
conn
)))
{
av_log
(
s
,
AV_LOG_ERROR
,
"Cannot open display %s, error %d.
\n
"
,
s
->
filename
[
0
]
?
s
->
filename
:
"default"
,
ret
);
s
->
url
[
0
]
?
s
->
url
:
"default"
,
ret
);
return
AVERROR
(
EIO
);
}
...
...
libavdevice/xv.c
View file @
4bb04098
...
...
@@ -151,7 +151,7 @@ static int xv_write_header(AVFormatContext *s)
xv
->
window_width
,
xv
->
window_height
,
0
,
0
,
0
);
if
(
!
xv
->
window_title
)
{
if
(
!
(
xv
->
window_title
=
av_strdup
(
s
->
filename
)))
{
if
(
!
(
xv
->
window_title
=
av_strdup
(
s
->
url
)))
{
ret
=
AVERROR
(
ENOMEM
);
goto
fail
;
}
...
...
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