Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2020
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.92 KB | None | 0 0
  1.  int avdevice_list_devices(AVFormatContext *s, AVDeviceInfoList **device_list)
  2.     {
  3.   189     int ret;
  4.   190     av_assert0(s);
  5.   191     av_assert0(device_list);
  6.   192     av_assert0(s->oformat || s->iformat);
  7.   193     if ((s->oformat && !s->oformat->get_device_list) ||
  8.   194         (s->iformat && !s->iformat->get_device_list)) {
  9.   195         *device_list = NULL;
  10.   196         return AVERROR(ENOSYS);
  11.   197     }
  12.   198     *device_list = av_mallocz(sizeof(AVDeviceInfoList));
  13.   199     if (!(*device_list))
  14.   200         return AVERROR(ENOMEM);
  15.   201     /* no default device by default */
  16.   202     (*device_list)->default_device = -1;
  17.   203     if (s->oformat)
  18.   204         ret = s->oformat->get_device_list(s, *device_list);
  19.   205     else
  20.   206         ret = s->iformat->get_device_list(s, *device_list);
  21.   207     if (ret < 0)
  22.   208         avdevice_free_list_devices(device_list);
  23.   209     return ret;
  24.   210 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement