Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
10f17cde
Commit
10f17cde
authored
Mar 04, 2012
by
KO Myung-Hun
Committed by
Rémi Denis-Courmont
Mar 14, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add disc drives probing for services discovery on OS/2
Signed-off-by:
Rémi Denis-Courmont
<
remi@remlab.net
>
parent
cdf9d7ce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
111 additions
and
0 deletions
+111
-0
modules/services_discovery/Modules.am
modules/services_discovery/Modules.am
+8
-0
modules/services_discovery/os2drive.c
modules/services_discovery/os2drive.c
+103
-0
No files found.
modules/services_discovery/Modules.am
View file @
10f17cde
...
...
@@ -42,6 +42,14 @@ if HAVE_WIN32
libvlc_LTLIBRARIES += libwindrive_plugin.la
endif
libos2drive_plugin_la_SOURCES = os2drive.c
libos2drive_plugin_la_CFLAGS = $(AM_CFLAGS)
libos2drive_plugin_la_LIBADD = $(AM_LIBADD)
libos2drive_plugin_la_DEPENDENCIES =
if HAVE_OS2
libvlc_LTLIBRARIES += libos2drive_plugin.la
endif
EXTRA_LTLIBRARIES += \
libudev_plugin.la
libvlc_LTLIBRARIES += \
...
...
modules/services_discovery/os2drive.c
0 → 100644
View file @
10f17cde
/**
* @file os2drive.c
* @brief List of disc drives for VLC media player for OS/2
*/
/*****************************************************************************
* Copyright (C) 2012 KO Myung-Hun <komh@chollian.net>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <vlc_common.h>
#include <vlc_services_discovery.h>
#include <vlc_plugin.h>
#define IOCTL_CDROMDISK2 0x82
#define CDROMDISK2_DRIVELETTERS 0x60
static
int
Open
(
vlc_object_t
*
);
VLC_SD_PROBE_HELPER
(
"disc"
,
"Discs"
,
SD_CAT_DEVICES
)
/*
* Module descriptor
*/
vlc_module_begin
()
add_submodule
()
set_shortname
(
N_
(
"Discs"
))
set_description
(
N_
(
"Discs"
))
set_category
(
CAT_PLAYLIST
)
set_subcategory
(
SUBCAT_PLAYLIST_SD
)
set_capability
(
"services_discovery"
,
0
)
set_callbacks
(
Open
,
NULL
)
add_shortcut
(
"disc"
)
VLC_SD_PROBE_SUBMODULE
vlc_module_end
()
/**
* Probes and initializes.
*/
static
int
Open
(
vlc_object_t
*
obj
)
{
services_discovery_t
*
sd
=
(
services_discovery_t
*
)
obj
;
HFILE
hcd2
;
ULONG
ulAction
;
ULONG
ulParamLen
;
ULONG
ulData
;
ULONG
ulDataLen
;
ULONG
rc
;
if
(
DosOpen
((
PSZ
)
"CD-ROM2$"
,
(
PHFILE
)
&
hcd2
,
&
ulAction
,
0
,
FILE_NORMAL
,
OPEN_ACTION_OPEN_IF_EXISTS
|
OPEN_ACTION_FAIL_IF_NEW
,
OPEN_ACCESS_READONLY
|
OPEN_SHARE_DENYNONE
,
NULL
))
return
VLC_EGENERIC
;
rc
=
DosDevIOCtl
(
hcd2
,
IOCTL_CDROMDISK2
,
CDROMDISK2_DRIVELETTERS
,
NULL
,
0
,
&
ulParamLen
,
&
ulData
,
sizeof
(
ulData
),
&
ulDataLen
);
if
(
!
rc
)
{
char
mrl
[]
=
"file:///A:/"
,
name
[]
=
"A:"
;
int
count
=
LOUSHORT
(
ulData
);
int
drive
=
HIUSHORT
(
ulData
);
input_item_t
*
item
;
char
letter
;
for
(;
count
;
--
count
,
++
drive
)
{
letter
=
'A'
+
drive
;
mrl
[
8
]
=
name
[
0
]
=
letter
;
item
=
input_item_NewWithType
(
mrl
,
name
,
0
,
NULL
,
0
,
-
1
,
ITEM_TYPE_DISC
);
msg_Dbg
(
sd
,
"adding %s (%s)"
,
mrl
,
name
);
if
(
item
==
NULL
)
break
;
services_discovery_AddItem
(
sd
,
item
,
_
(
"Local drives"
));
}
}
DosClose
(
hcd2
);
return
rc
?
VLC_EGENERIC
:
VLC_SUCCESS
;
}
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