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 "config.h"
22 #include "libavutil/thread.h"
23 #include "libavformat/internal.h"
24 #include "avdevice.h"
25 
26 /* devices */
58 
59 /* external libraries */
62 
63 #include "libavdevice/outdev_list.c"
64 #include "libavdevice/indev_list.c"
65 
67 {
69 }
70 
71 static void *next_input(const AVInputFormat *prev, AVClassCategory c2)
72 {
73  const AVClass *pc;
76  const AVInputFormat *fmt = NULL;
77  int i = 0;
78 
79  while (prev && (fmt = indev_list[i])) {
80  i++;
81  if (prev == fmt)
82  break;
83  }
84 
85  do {
86  fmt = indev_list[i++];
87  if (!fmt)
88  break;
89  pc = fmt->priv_class;
90  if (!pc)
91  continue;
92  category = pc->category;
93  } while (category != c1 && category != c2);
94  return (AVInputFormat *)fmt;
95 }
96 
97 static void *next_output(const AVOutputFormat *prev, AVClassCategory c2)
98 {
99  const AVClass *pc;
102  const AVOutputFormat *fmt = NULL;
103  int i = 0;
104 
105  while (prev && (fmt = outdev_list[i])) {
106  i++;
107  if (prev == fmt)
108  break;
109  }
110 
111  do {
112  fmt = outdev_list[i++];
113  if (!fmt)
114  break;
115  pc = fmt->priv_class;
116  if (!pc)
117  continue;
118  category = pc->category;
119  } while (category != c1 && category != c2);
120  return (AVOutputFormat *)fmt;
121 }
122 
124 {
126 }
127 
129 {
131 }
132 
134 {
136 }
137 
139 {
141 }
AVInputFormat ff_openal_demuxer
Definition: openal-dec.c:251
category
Definition: openal-dec.c:248
#define NULL
Definition: coverity.c:32
AVOutputFormat ff_sdl2_muxer
Definition: sdl2.c:358
AVOutputFormat * av_output_audio_device_next(AVOutputFormat *d)
Audio output devices iterator.
Definition: alldevices.c:133
AVOutputFormat ff_xv_muxer
Definition: xv.c:379
AVInputFormat ff_lavfi_demuxer
Definition: lavfi.c:497
static void * next_input(const AVInputFormat *prev, AVClassCategory c2)
Definition: alldevices.c:71
AVOutputFormat ff_decklink_muxer
AVOutputFormat ff_v4l2_muxer
Definition: v4l2enc.c:112
void avpriv_register_devices(const AVOutputFormat *const o[], const AVInputFormat *const i[])
Definition: allformats.c:663
static const AVOutputFormat *const * outdev_list
Definition: allformats.c:534
AVInputFormat ff_pulse_demuxer
AVInputFormat ff_iec61883_demuxer
Definition: iec61883.c:502
AVOutputFormat * av_output_video_device_next(AVOutputFormat *d)
Video output devices iterator.
Definition: alldevices.c:138
AVInputFormat ff_sndio_demuxer
Definition: sndio_dec.c:112
const AVClass * priv_class
AVClass for the private context.
Definition: avformat.h:677
static const AVInputFormat *const * indev_list
Definition: allformats.c:533
static const uint64_t c1
Definition: murmur3.c:51
AVInputFormat ff_libcdio_demuxer
Definition: libcdio.c:185
AVInputFormat ff_alsa_demuxer
Definition: alsa_dec.c:158
Main libavdevice API header.
AVInputFormat ff_xcbgrab_demuxer
Definition: xcbgrab.c:867
AVOutputFormat ff_alsa_muxer
Definition: alsa_enc.c:160
AVClassCategory category
Category used for visualization (like color) This is only set if the category is equal for all object...
Definition: log.h:133
AVInputFormat ff_vfwcap_demuxer
Definition: vfwcap.c:484
AVOutputFormat ff_caca_muxer
Definition: caca.c:230
AVOutputFormat ff_audiotoolbox_muxer
Definition: audiotoolbox.m:297
AVInputFormat ff_bktr_demuxer
Definition: bktr.c:351
AVInputFormat ff_gdigrab_demuxer
gdi grabber device demuxer declaration
Definition: gdigrab.c:654
AVInputFormat ff_jack_demuxer
Definition: jack.c:345
AVInputFormat ff_libdc1394_demuxer
Definition: libdc1394.c:291
AVInputFormat ff_fbdev_demuxer
Definition: fbdev_dec.c:235
const AVClass * priv_class
AVClass for the private context.
Definition: avformat.h:528
AVInputFormat ff_dshow_demuxer
Definition: dshow.c:1331
AVOutputFormat ff_sndio_muxer
Definition: sndio_enc.c:89
AVOutputFormat ff_pulse_muxer
AVInputFormat ff_oss_demuxer
Definition: oss_dec.c:135
AVInputFormat * av_input_video_device_next(AVInputFormat *d)
Video input devices iterator.
Definition: alldevices.c:128
AVInputFormat ff_avfoundation_demuxer
AVOutputFormat ff_opengl_muxer
Definition: opengl_enc.c:1295
Describe the class of an AVClass context structure.
Definition: log.h:67
AVInputFormat * av_input_audio_device_next(AVInputFormat *d)
Audio input devices iterator.
Definition: alldevices.c:123
void avdevice_register_all(void)
Initialize libavdevice and register all the input and output devices.
Definition: alldevices.c:66
AVInputFormat ff_kmsgrab_demuxer
Definition: kmsgrab.c:710
static const uint64_t c2
Definition: murmur3.c:52
AVClassCategory
Definition: log.h:29
AVInputFormat ff_decklink_demuxer
AVOutputFormat ff_oss_muxer
Definition: oss_enc.c:99
AVInputFormat ff_v4l2_demuxer
Definition: v4l2.c:1135
AVInputFormat ff_android_camera_demuxer
static void * next_output(const AVOutputFormat *prev, AVClassCategory c2)
Definition: alldevices.c:97
int i
Definition: input.c:407
AVOutputFormat ff_fbdev_muxer
Definition: fbdev_enc.c:208