FFmpeg
alldevices.c
Go to the documentation of this file.
1 /*
2  * Register all the grabbing devices.
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #include "libavformat/internal.h"
22 #include "avdevice.h"
23 
24 /* devices */
25 extern const AVInputFormat ff_alsa_demuxer;
26 extern const AVOutputFormat ff_alsa_muxer;
30 extern const AVInputFormat ff_bktr_demuxer;
31 extern const AVOutputFormat ff_caca_muxer;
34 extern const AVInputFormat ff_dshow_demuxer;
35 extern const AVInputFormat ff_fbdev_demuxer;
36 extern const AVOutputFormat ff_fbdev_muxer;
39 extern const AVInputFormat ff_jack_demuxer;
41 extern const AVInputFormat ff_lavfi_demuxer;
42 extern const AVInputFormat ff_openal_demuxer;
43 extern const AVOutputFormat ff_opengl_muxer;
44 extern const AVInputFormat ff_oss_demuxer;
45 extern const AVOutputFormat ff_oss_muxer;
46 extern const AVInputFormat ff_pulse_demuxer;
47 extern const AVOutputFormat ff_pulse_muxer;
48 extern const AVOutputFormat ff_sdl2_muxer;
49 extern const AVInputFormat ff_sndio_demuxer;
50 extern const AVOutputFormat ff_sndio_muxer;
51 extern const AVInputFormat ff_v4l2_demuxer;
52 extern const AVOutputFormat ff_v4l2_muxer;
53 extern const AVInputFormat ff_vfwcap_demuxer;
55 extern const AVOutputFormat ff_xv_muxer;
56 
57 /* external libraries */
60 
61 #include "libavdevice/outdev_list.c"
62 #include "libavdevice/indev_list.c"
63 
65 {
66  avpriv_register_devices(outdev_list, indev_list);
67 }
68 
69 static const void *next_input(const AVInputFormat *prev, AVClassCategory c2)
70 {
71  const AVClass *pc;
74  const AVInputFormat *fmt = NULL;
75  int i = 0;
76 
77  while (prev && (fmt = indev_list[i])) {
78  i++;
79  if (prev == fmt)
80  break;
81  }
82 
83  do {
84  fmt = indev_list[i++];
85  if (!fmt)
86  break;
87  pc = fmt->priv_class;
88  if (!pc)
89  continue;
90  category = pc->category;
91  } while (category != c1 && category != c2);
92  return fmt;
93 }
94 
95 static const void *next_output(const AVOutputFormat *prev, AVClassCategory c2)
96 {
97  const AVClass *pc;
100  const AVOutputFormat *fmt = NULL;
101  int i = 0;
102 
103  while (prev && (fmt = outdev_list[i])) {
104  i++;
105  if (prev == fmt)
106  break;
107  }
108 
109  do {
110  fmt = outdev_list[i++];
111  if (!fmt)
112  break;
113  pc = fmt->priv_class;
114  if (!pc)
115  continue;
116  category = pc->category;
117  } while (category != c1 && category != c2);
118  return fmt;
119 }
120 
122 {
124 }
125 
127 {
129 }
130 
132 {
134 }
135 
137 {
139 }
ff_decklink_muxer
const AVOutputFormat ff_decklink_muxer
Definition: decklink_enc_c.c:74
ff_xcbgrab_demuxer
const AVInputFormat ff_xcbgrab_demuxer
Definition: xcbgrab.c:903
avpriv_register_devices
void avpriv_register_devices(const AVOutputFormat *const o[], const AVInputFormat *const i[])
Definition: allformats.c:595
ff_libdc1394_demuxer
const AVInputFormat ff_libdc1394_demuxer
Definition: libdc1394.c:291
ff_kmsgrab_demuxer
const AVInputFormat ff_kmsgrab_demuxer
Definition: kmsgrab.c:711
AV_CLASS_CATEGORY_NA
@ AV_CLASS_CATEGORY_NA
Definition: log.h:29
ff_bktr_demuxer
const AVInputFormat ff_bktr_demuxer
Definition: bktr.c:352
next_input
static const void * next_input(const AVInputFormat *prev, AVClassCategory c2)
Definition: alldevices.c:69
ff_decklink_demuxer
const AVInputFormat ff_decklink_demuxer
Definition: decklink_dec_c.c:114
category
category
Definition: openal-dec.c:248
ff_audiotoolbox_muxer
const AVOutputFormat ff_audiotoolbox_muxer
Definition: audiotoolbox.m:297
c1
static const uint64_t c1
Definition: murmur3.c:51
av_input_audio_device_next
const AVInputFormat * av_input_audio_device_next(const AVInputFormat *d)
Audio input devices iterator.
Definition: alldevices.c:121
ff_alsa_demuxer
const AVInputFormat ff_alsa_demuxer
Definition: alsa_dec.c:160
ff_xv_muxer
const AVOutputFormat ff_xv_muxer
Definition: xv.c:379
ff_iec61883_demuxer
const AVInputFormat ff_iec61883_demuxer
Definition: iec61883.c:505
ff_jack_demuxer
const AVInputFormat ff_jack_demuxer
Definition: jack.c:344
AV_CLASS_CATEGORY_DEVICE_INPUT
@ AV_CLASS_CATEGORY_DEVICE_INPUT
Definition: log.h:45
ff_v4l2_muxer
const AVOutputFormat ff_v4l2_muxer
Definition: v4l2enc.c:114
ff_v4l2_demuxer
const AVInputFormat ff_v4l2_demuxer
Definition: v4l2.c:1137
AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT
@ AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT
Definition: log.h:43
AVInputFormat
Definition: avformat.h:656
next_output
static const void * next_output(const AVOutputFormat *prev, AVClassCategory c2)
Definition: alldevices.c:95
ff_oss_muxer
const AVOutputFormat ff_oss_muxer
Definition: oss_enc.c:97
ff_avfoundation_demuxer
const AVInputFormat ff_avfoundation_demuxer
Definition: avfoundation.m:1240
internal.h
AVClass
Describe the class of an AVClass context structure.
Definition: log.h:66
NULL
#define NULL
Definition: coverity.c:32
ff_pulse_muxer
const AVOutputFormat ff_pulse_muxer
Definition: pulse_audio_enc.c:791
AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT
@ AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT
Definition: log.h:40
AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT
@ AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT
Definition: log.h:41
ff_vfwcap_demuxer
const AVInputFormat ff_vfwcap_demuxer
Definition: vfwcap.c:485
AVOutputFormat::priv_class
const AVClass * priv_class
AVClass for the private context.
Definition: avformat.h:538
ff_android_camera_demuxer
const AVInputFormat ff_android_camera_demuxer
Definition: android_camera.c:860
ff_pulse_demuxer
const AVInputFormat ff_pulse_demuxer
Definition: pulse_audio_dec.c:396
AVClass::category
AVClassCategory category
Category used for visualization (like color) This is only set if the category is equal for all object...
Definition: log.h:114
ff_fbdev_muxer
const AVOutputFormat ff_fbdev_muxer
Definition: fbdev_enc.c:209
av_output_video_device_next
const AVOutputFormat * av_output_video_device_next(const AVOutputFormat *d)
Video output devices iterator.
Definition: alldevices.c:136
ff_dshow_demuxer
const AVInputFormat ff_dshow_demuxer
Definition: dshow.c:1927
avdevice.h
ff_sndio_demuxer
const AVInputFormat ff_sndio_demuxer
Definition: sndio_dec.c:112
ff_sndio_muxer
const AVOutputFormat ff_sndio_muxer
Definition: sndio_enc.c:89
ff_gdigrab_demuxer
const AVInputFormat ff_gdigrab_demuxer
gdi grabber device demuxer declaration
Definition: gdigrab.c:667
AVClassCategory
AVClassCategory
Definition: log.h:28
AVOutputFormat
Definition: avformat.h:509
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:269
AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT
@ AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT
Definition: log.h:42
ff_openal_demuxer
const AVInputFormat ff_openal_demuxer
Definition: openal-dec.c:251
ff_caca_muxer
const AVOutputFormat ff_caca_muxer
Definition: caca.c:223
ff_lavfi_demuxer
const AVInputFormat ff_lavfi_demuxer
Definition: lavfi.c:484
c2
static const uint64_t c2
Definition: murmur3.c:52
AV_CLASS_CATEGORY_DEVICE_OUTPUT
@ AV_CLASS_CATEGORY_DEVICE_OUTPUT
Definition: log.h:44
av_output_audio_device_next
const AVOutputFormat * av_output_audio_device_next(const AVOutputFormat *d)
Audio output devices iterator.
Definition: alldevices.c:131
ff_fbdev_demuxer
const AVInputFormat ff_fbdev_demuxer
Definition: fbdev_dec.c:235
ff_libcdio_demuxer
const AVInputFormat ff_libcdio_demuxer
Definition: libcdio.c:183
ff_alsa_muxer
const AVOutputFormat ff_alsa_muxer
Definition: alsa_enc.c:168
d
d
Definition: ffmpeg_filter.c:156
ff_opengl_muxer
const AVOutputFormat ff_opengl_muxer
Definition: opengl_enc.c:1295
av_input_video_device_next
const AVInputFormat * av_input_video_device_next(const AVInputFormat *d)
Video input devices iterator.
Definition: alldevices.c:126
ff_sdl2_muxer
const AVOutputFormat ff_sdl2_muxer
Definition: sdl2.c:358
AVInputFormat::priv_class
const AVClass * priv_class
AVClass for the private context.
Definition: avformat.h:686
avdevice_register_all
void avdevice_register_all(void)
Initialize libavdevice and register all the input and output devices.
Definition: alldevices.c:64
ff_oss_demuxer
const AVInputFormat ff_oss_demuxer
Definition: oss_dec.c:133