Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
81c3f81d
Commit
81c3f81d
authored
Feb 16, 2014
by
Lukasz Marek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavd: add list devices API
Signed-off-by:
Lukasz Marek
<
lukasz.m.luki@gmail.com
>
parent
d3cf9b24
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
99 additions
and
4 deletions
+99
-4
APIchanges
doc/APIchanges
+3
-0
avdevice.c
libavdevice/avdevice.c
+41
-0
avdevice.h
libavdevice/avdevice.h
+39
-0
version.h
libavdevice/version.h
+2
-2
avformat.h
libavformat/avformat.h
+12
-0
version.h
libavformat/version.h
+2
-2
No files found.
doc/APIchanges
View file @
81c3f81d
...
...
@@ -15,6 +15,9 @@ libavutil: 2012-10-22
API changes, most recent first:
2014-02-xx - xxxxxxx - lavd 55.10.100 - avdevice.h
Add avdevice_list_devices() and avdevice_free_list_devices()
2014-02-xx - xxxxxxx - lavu 53.3.0 - frame.h
Add AV_FRAME_DATA_DOWNMIX_INFO value to the AVFrameSideDataType enum and
downmix_info.h API, which identify downmix-related metadata.
...
...
libavdevice/avdevice.c
View file @
81c3f81d
...
...
@@ -52,3 +52,44 @@ int avdevice_dev_to_app_control_message(struct AVFormatContext *s, enum AVDevToA
return
AVERROR
(
ENOSYS
);
return
s
->
control_message_cb
(
s
,
type
,
data
,
data_size
);
}
int
avdevice_list_devices
(
AVFormatContext
*
s
,
AVDeviceInfoList
**
device_list
)
{
av_assert0
(
s
);
av_assert0
(
device_list
);
av_assert0
(
s
->
oformat
||
s
->
iformat
);
if
((
s
->
oformat
&&
!
s
->
oformat
->
get_device_list
)
||
(
s
->
iformat
&&
!
s
->
iformat
->
get_device_list
))
{
*
device_list
=
NULL
;
return
AVERROR
(
ENOSYS
);
}
*
device_list
=
av_mallocz
(
sizeof
(
AVDeviceInfoList
));
if
(
!
(
*
device_list
))
return
AVERROR
(
ENOMEM
);
if
(
s
->
oformat
)
return
s
->
oformat
->
get_device_list
(
s
,
*
device_list
);
return
s
->
iformat
->
get_device_list
(
s
,
*
device_list
);
}
void
avdevice_free_list_devices
(
AVDeviceInfoList
**
device_list
)
{
AVDeviceInfoList
*
list
;
AVDeviceInfo
*
dev
;
int
i
;
av_assert0
(
device_list
);
list
=
*
device_list
;
if
(
!
list
)
return
;
for
(
i
=
0
;
i
<
list
->
nb_devices
;
i
++
)
{
dev
=
list
->
devices
[
i
];
if
(
dev
)
{
av_free
(
dev
->
device_name
);
av_free
(
dev
->
device_description
);
av_free
(
dev
);
}
}
av_free
(
list
->
devices
);
av_freep
(
device_list
);
}
libavdevice/avdevice.h
View file @
81c3f81d
...
...
@@ -191,4 +191,43 @@ int avdevice_dev_to_app_control_message(struct AVFormatContext *s,
enum
AVDevToAppMessageType
type
,
void
*
data
,
size_t
data_size
);
/**
* Structure describes basic parameters of the device.
*/
typedef
struct
AVDeviceInfo
{
char
*
device_name
;
/**< device name, format depends on device */
char
*
device_description
;
/**< human friendly name */
}
AVDeviceInfo
;
/**
* List of devices.
*/
typedef
struct
AVDeviceInfoList
{
AVDeviceInfo
**
devices
;
/**< list of autodetected devices */
int
nb_devices
;
/**< number of autodetected devices */
int
default_device
;
/**< index of default device or -1 if no default */
}
AVDeviceInfoList
;
/**
* List devices.
*
* Returns available device names and their parameters.
*
* @note: Some devices may accept system-dependent device names that cannot be
* autodetected. The list returned by this function cannot be assumed to
* be always completed.
*
* @param s device context.
* @param[out] device_list list of autodetected devices.
* @return count of autodetected devices, negative on error.
*/
int
avdevice_list_devices
(
struct
AVFormatContext
*
s
,
AVDeviceInfoList
**
device_list
);
/**
* Convinient function to free result of avdevice_list_devices().
*
* @param devices device list to be freed.
*/
void
avdevice_free_list_devices
(
AVDeviceInfoList
**
device_list
);
#endif
/* AVDEVICE_AVDEVICE_H */
libavdevice/version.h
View file @
81c3f81d
...
...
@@ -28,8 +28,8 @@
#include "libavutil/version.h"
#define LIBAVDEVICE_VERSION_MAJOR 55
#define LIBAVDEVICE_VERSION_MINOR
9
#define LIBAVDEVICE_VERSION_MICRO 10
1
#define LIBAVDEVICE_VERSION_MINOR
10
#define LIBAVDEVICE_VERSION_MICRO 10
0
#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
LIBAVDEVICE_VERSION_MINOR, \
...
...
libavformat/avformat.h
View file @
81c3f81d
...
...
@@ -261,6 +261,7 @@
struct
AVFormatContext
;
struct
AVDeviceInfoList
;
/**
* @defgroup metadata_api Public Metadata API
...
...
@@ -523,6 +524,11 @@ typedef struct AVOutputFormat {
*/
int
(
*
write_uncoded_frame
)(
struct
AVFormatContext
*
,
int
stream_index
,
AVFrame
**
frame
,
unsigned
flags
);
/**
* Returns device list with it properties.
* @see avdevice_list_devices() for more details.
*/
int
(
*
get_device_list
)(
struct
AVFormatContext
*
s
,
struct
AVDeviceInfoList
*
device_list
);
}
AVOutputFormat
;
/**
* @}
...
...
@@ -651,6 +657,12 @@ typedef struct AVInputFormat {
* Active streams are all streams that have AVStream.discard < AVDISCARD_ALL.
*/
int
(
*
read_seek2
)(
struct
AVFormatContext
*
s
,
int
stream_index
,
int64_t
min_ts
,
int64_t
ts
,
int64_t
max_ts
,
int
flags
);
/**
* Returns device list with it properties.
* @see avdevice_list_devices() for more details.
*/
int
(
*
get_device_list
)(
struct
AVFormatContext
*
s
,
struct
AVDeviceInfoList
*
device_list
);
}
AVInputFormat
;
/**
* @}
...
...
libavformat/version.h
View file @
81c3f81d
...
...
@@ -30,8 +30,8 @@
#include "libavutil/version.h"
#define LIBAVFORMAT_VERSION_MAJOR 55
#define LIBAVFORMAT_VERSION_MINOR 3
2
#define LIBAVFORMAT_VERSION_MICRO 10
1
#define LIBAVFORMAT_VERSION_MINOR 3
3
#define LIBAVFORMAT_VERSION_MICRO 10
0
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
LIBAVFORMAT_VERSION_MINOR, \
...
...
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