Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
5d096c30
Commit
5d096c30
authored
Sep 02, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
access: add ACCESS_IS_DIRECTORY as STREAM_IS_DIRECTORY
parent
83687443
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
91 additions
and
27 deletions
+91
-27
include/vlc_access.h
include/vlc_access.h
+1
-7
modules/access/dsm/access.c
modules/access/dsm/access.c
+17
-4
modules/access/ftp.c
modules/access/ftp.c
+17
-2
modules/access/sftp.c
modules/access/sftp.c
+17
-2
modules/access/smb.c
modules/access/smb.c
+17
-2
modules/services_discovery/upnp.cpp
modules/services_discovery/upnp.cpp
+16
-3
src/input/access.c
src/input/access.c
+6
-7
No files found.
include/vlc_access.h
View file @
5d096c30
...
...
@@ -43,6 +43,7 @@ enum access_query_e
ACCESS_CAN_PAUSE
,
/* arg1= bool* cannot fail */
ACCESS_CAN_CONTROL_PACE
,
/* arg1= bool* cannot fail */
ACCESS_GET_SIZE
=
6
,
/* arg1= uin64_t* */
ACCESS_IS_DIRECTORY
,
/* arg1= bool *, arg2= bool *, res=can fail */
/* */
ACCESS_GET_PTS_DELAY
=
0x101
,
/* arg1= int64_t* cannot fail */
...
...
@@ -104,13 +105,6 @@ struct access_t
struct
{
bool
b_eof
;
/* idem */
bool
b_dir_sorted
;
/* Set it to true if items returned by
* pf_readdir are already sorted. */
bool
b_dir_can_loop
;
/* Set it to true if the access can't know
* if children can loop into their parents.
* It's the case for most network accesses. */
}
info
;
access_sys_t
*
p_sys
;
...
...
modules/access/dsm/access.c
View file @
5d096c30
...
...
@@ -693,6 +693,22 @@ static input_item_t* BrowseDirectory( access_t *p_access )
return
p_item
;
}
static
int
DirControl
(
access_t
*
p_access
,
int
i_query
,
va_list
args
)
{
switch
(
i_query
)
{
case
ACCESS_IS_DIRECTORY
:
*
va_arg
(
args
,
bool
*
)
=
false
;
/* is not sorted */
*
va_arg
(
args
,
bool
*
)
=
p_access
->
pf_readdir
==
BrowseDirectory
;
/* might loop */
break
;
default:
return
access_vaDirectoryControlHelper
(
p_access
,
i_query
,
args
);
}
return
VLC_SUCCESS
;
}
static
int
BrowserInit
(
access_t
*
p_access
)
{
access_sys_t
*
p_sys
=
p_access
->
p_sys
;
...
...
@@ -700,11 +716,8 @@ static int BrowserInit( access_t *p_access )
if
(
p_sys
->
psz_share
==
NULL
)
p_access
->
pf_readdir
=
BrowseShare
;
else
{
p_access
->
pf_readdir
=
BrowseDirectory
;
p_access
->
info
.
b_dir_can_loop
=
true
;
}
p_access
->
pf_control
=
access_vaDirectoryControlHelper
;
p_access
->
pf_control
=
DirControl
;
return
VLC_SUCCESS
;
}
modules/access/ftp.c
View file @
5d096c30
...
...
@@ -108,6 +108,7 @@ static ssize_t Read( access_t *, uint8_t *, size_t );
static
int
Seek
(
access_t
*
,
uint64_t
);
static
int
Control
(
access_t
*
,
int
,
va_list
);
static
input_item_t
*
DirRead
(
access_t
*
);
static
int
DirControl
(
access_t
*
,
int
,
va_list
);
#ifdef ENABLE_SOUT
static
int
OutSeek
(
sout_access_out_t
*
,
off_t
);
static
ssize_t
Write
(
sout_access_out_t
*
,
block_t
*
);
...
...
@@ -671,8 +672,7 @@ static int InOpen( vlc_object_t *p_this )
if
(
b_directory
)
{
p_access
->
pf_readdir
=
DirRead
;
p_access
->
pf_control
=
access_vaDirectoryControlHelper
;
p_access
->
info
.
b_dir_can_loop
=
true
;
p_access
->
pf_control
=
DirControl
;
}
else
ACCESS_SET_CALLBACKS
(
Read
,
NULL
,
Control
,
Seek
);
\
...
...
@@ -887,6 +887,21 @@ static input_item_t* DirRead( access_t *p_access )
return
p_item
;
}
static
int
DirControl
(
access_t
*
p_access
,
int
i_query
,
va_list
args
)
{
switch
(
i_query
)
{
case
ACCESS_IS_DIRECTORY
:
*
va_arg
(
args
,
bool
*
)
=
false
;
/* is not sorted */
*
va_arg
(
args
,
bool
*
)
=
true
;
/* might loop */
break
;
default:
return
access_vaDirectoryControlHelper
(
p_access
,
i_query
,
args
);
}
return
VLC_SUCCESS
;
}
/*****************************************************************************
* Write:
*****************************************************************************/
...
...
modules/access/sftp.c
View file @
5d096c30
...
...
@@ -84,6 +84,7 @@ static int Seek( access_t *, uint64_t );
static
int
Control
(
access_t
*
,
int
,
va_list
);
static
input_item_t
*
DirRead
(
access_t
*
p_access
);
static
int
DirControl
(
access_t
*
,
int
,
va_list
);
struct
access_sys_t
{
...
...
@@ -296,8 +297,7 @@ static int Open( vlc_object_t* p_this )
p_sys
->
file
=
libssh2_sftp_opendir
(
p_sys
->
sftp_session
,
psz_path
);
p_access
->
pf_readdir
=
DirRead
;
p_access
->
pf_control
=
access_vaDirectoryControlHelper
;
p_access
->
info
.
b_dir_can_loop
=
true
;
p_access
->
pf_control
=
DirControl
;
if
(
p_sys
->
file
)
{
...
...
@@ -515,3 +515,18 @@ static input_item_t* DirRead( access_t *p_access )
free
(
psz_file
);
return
p_item
;
}
static
int
DirControl
(
access_t
*
p_access
,
int
i_query
,
va_list
args
)
{
switch
(
i_query
)
{
case
ACCESS_IS_DIRECTORY
:
*
va_arg
(
args
,
bool
*
)
=
false
;
/* is not sorted */
*
va_arg
(
args
,
bool
*
)
=
true
;
/* might loop */
break
;
default:
return
access_vaDirectoryControlHelper
(
p_access
,
i_query
,
args
);
}
return
VLC_SUCCESS
;
}
modules/access/smb.c
View file @
5d096c30
...
...
@@ -90,6 +90,7 @@ static int Seek( access_t *, uint64_t );
static
int
Control
(
access_t
*
,
int
,
va_list
);
#ifndef _WIN32
static
input_item_t
*
DirRead
(
access_t
*
);
static
int
DirControl
(
access_t
*
,
int
,
va_list
);
#endif
struct
access_sys_t
...
...
@@ -253,8 +254,7 @@ static int Open( vlc_object_t *p_this )
return
VLC_EGENERIC
;
#else
p_access
->
pf_readdir
=
DirRead
;
p_access
->
pf_control
=
access_vaDirectoryControlHelper
;
p_access
->
info
.
b_dir_can_loop
=
true
;
p_access
->
pf_control
=
DirControl
;
i_smb
=
smbc_opendir
(
psz_uri
);
i_size
=
0
;
#endif
...
...
@@ -395,6 +395,21 @@ static input_item_t* DirRead (access_t *p_access )
}
return
p_item
;
}
static
int
DirControl
(
access_t
*
p_access
,
int
i_query
,
va_list
args
)
{
switch
(
i_query
)
{
case
ACCESS_IS_DIRECTORY
:
*
va_arg
(
args
,
bool
*
)
=
false
;
/* is not sorted */
*
va_arg
(
args
,
bool
*
)
=
true
;
/* might loop */
break
;
default:
return
access_vaDirectoryControlHelper
(
p_access
,
i_query
,
args
);
}
return
VLC_SUCCESS
;
}
#endif
/*****************************************************************************
...
...
modules/services_discovery/upnp.cpp
View file @
5d096c30
...
...
@@ -813,6 +813,21 @@ static input_item_t* ReadDirectory( access_t *p_access )
return
p_access
->
p_sys
->
p_server
->
getNextItem
();
}
static
int
ControlDirectory
(
access_t
*
p_access
,
int
i_query
,
va_list
args
)
{
switch
(
i_query
)
{
case
ACCESS_IS_DIRECTORY
:
*
va_arg
(
args
,
bool
*
)
=
true
;
/* is sorted */
*
va_arg
(
args
,
bool
*
)
=
true
;
/* might loop */
break
;
default:
return
access_vaDirectoryControlHelper
(
p_access
,
i_query
,
args
);
}
return
VLC_SUCCESS
;
}
static
int
Open
(
vlc_object_t
*
p_this
)
{
access_t
*
p_access
=
(
access_t
*
)
p_this
;
...
...
@@ -837,9 +852,7 @@ static int Open( vlc_object_t *p_this )
}
p_access
->
pf_readdir
=
ReadDirectory
;
p_access
->
pf_control
=
access_vaDirectoryControlHelper
;
p_access
->
info
.
b_dir_sorted
=
true
;
p_access
->
info
.
b_dir_can_loop
=
true
;
p_access
->
pf_control
=
ControlDirectory
;
return
VLC_SUCCESS
;
}
...
...
src/input/access.c
View file @
5d096c30
...
...
@@ -137,6 +137,10 @@ int access_vaDirectoryControlHelper( access_t *p_access, int i_query, va_list ar
case
ACCESS_GET_PTS_DELAY
:
*
va_arg
(
args
,
int64_t
*
)
=
0
;
break
;
case
ACCESS_IS_DIRECTORY
:
*
va_arg
(
args
,
bool
*
)
=
false
;
*
va_arg
(
args
,
bool
*
)
=
false
;
break
;
default:
return
VLC_EGENERIC
;
}
...
...
@@ -274,6 +278,7 @@ static int AStreamControl(stream_t *s, int cmd, va_list args)
static_control_match
(
CAN_PAUSE
);
static_control_match
(
CAN_CONTROL_PACE
);
static_control_match
(
GET_SIZE
);
static_control_match
(
IS_DIRECTORY
);
static_control_match
(
GET_PTS_DELAY
);
static_control_match
(
GET_TITLE_INFO
);
static_control_match
(
GET_TITLE
);
...
...
@@ -295,6 +300,7 @@ static int AStreamControl(stream_t *s, int cmd, va_list args)
case
STREAM_CAN_PAUSE
:
case
STREAM_CAN_CONTROL_PACE
:
case
STREAM_GET_SIZE
:
case
STREAM_IS_DIRECTORY
:
case
STREAM_GET_PTS_DELAY
:
case
STREAM_GET_TITLE_INFO
:
case
STREAM_GET_TITLE
:
...
...
@@ -310,13 +316,6 @@ static int AStreamControl(stream_t *s, int cmd, va_list args)
case
STREAM_GET_PRIVATE_ID_STATE
:
return
access_vaControl
(
access
,
cmd
,
args
);
case
STREAM_IS_DIRECTORY
:
if
(
access
->
pf_readdir
==
NULL
)
return
VLC_EGENERIC
;
*
va_arg
(
args
,
bool
*
)
=
access
->
info
.
b_dir_sorted
;
*
va_arg
(
args
,
bool
*
)
=
access
->
info
.
b_dir_can_loop
;
break
;
case
STREAM_GET_PRIVATE_BLOCK
:
{
block_t
**
b
=
va_arg
(
args
,
block_t
**
);
...
...
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