FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
iec61883.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012 Georg Lippitsch <georg.lippitsch@gmx.at>
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 /**
22  * @file
23  * libiec61883 interface
24  */
25 
26 #include <sys/poll.h>
27 #include <libraw1394/raw1394.h>
28 #include <libavc1394/avc1394.h>
29 #include <libavc1394/rom1394.h>
30 #include <libiec61883/iec61883.h>
31 #include "libavformat/dv.h"
32 #include "libavformat/mpegts.h"
33 #include "libavutil/opt.h"
34 #include "avdevice.h"
35 
36 #define THREADS HAVE_PTHREADS
37 
38 #if THREADS
39 #include <pthread.h>
40 #endif
41 
42 #define MOTDCT_SPEC_ID 0x00005068
43 #define IEC61883_AUTO 0
44 #define IEC61883_DV 1
45 #define IEC61883_HDV 2
46 
47 /**
48  * For DV, one packet corresponds exactly to one frame.
49  * For HDV, these are MPEG2 transport stream packets.
50  * The queue is implemented as linked list.
51  */
52 typedef struct DVPacket {
53  uint8_t *buf; ///< actual buffer data
54  int len; ///< size of buffer allocated
55  struct DVPacket *next; ///< next DVPacket
56 } DVPacket;
57 
58 struct iec61883_data {
59  AVClass *class;
60  raw1394handle_t raw1394; ///< handle for libraw1394
61  iec61883_dv_fb_t iec61883_dv; ///< handle for libiec61883 when used with DV
62  iec61883_mpeg2_t iec61883_mpeg2; ///< handle for libiec61883 when used with HDV
63 
64  DVDemuxContext *dv_demux; ///< generic DV muxing/demuxing context
65  MpegTSContext *mpeg_demux; ///< generic HDV muxing/demuxing context
66 
67  DVPacket *queue_first; ///< first element of packet queue
68  DVPacket *queue_last; ///< last element of packet queue
69 
70  char *device_guid; ///< to select one of multiple DV devices
71 
72  int packets; ///< Number of packets queued
73  int max_packets; ///< Max. number of packets in queue
74 
75  int bandwidth; ///< returned by libiec61883
76  int channel; ///< returned by libiec61883
77  int input_port; ///< returned by libiec61883
78  int type; ///< Stream type, to distinguish DV/HDV
79  int node; ///< returned by libiec61883
80  int output_port; ///< returned by libiec61883
81  int thread_loop; ///< Condition for thread while-loop
82  int receiving; ///< True as soon data from device available
83  int receive_error; ///< Set in receive task in case of error
84  int eof; ///< True as soon as no more data available
85 
86  struct pollfd raw1394_poll; ///< to poll for new data from libraw1394
87 
88  /** Parse function for DV/HDV differs, so this is set before packets arrive */
89  int (*parse_queue)(struct iec61883_data *dv, AVPacket *pkt);
90 
91 #if THREADS
92  pthread_t receive_task_thread;
94  pthread_cond_t cond;
95 #endif
96 };
97 
98 static int iec61883_callback(unsigned char *data, int length,
99  int complete, void *callback_data)
100 {
101  struct iec61883_data *dv = callback_data;
102  DVPacket *packet;
103  int ret;
104 
105 #if THREADS
106  pthread_mutex_lock(&dv->mutex);
107 #endif
108 
109  if (dv->packets >= dv->max_packets) {
110  av_log(NULL, AV_LOG_ERROR, "DV packet queue overrun, dropping.\n");
111  ret = 0;
112  goto exit;
113  }
114 
115  packet = av_mallocz(sizeof(*packet));
116  if (!packet) {
117  ret = -1;
118  goto exit;
119  }
120 
121  packet->buf = av_malloc(length);
122  if (!packet->buf) {
123  ret = -1;
124  goto exit;
125  }
126  packet->len = length;
127 
128  memcpy(packet->buf, data, length);
129 
130  if (dv->queue_first) {
131  dv->queue_last->next = packet;
132  dv->queue_last = packet;
133  } else {
134  dv->queue_first = packet;
135  dv->queue_last = packet;
136  }
137  dv->packets++;
138 
139  ret = 0;
140 
141 exit:
142 #if THREADS
143  pthread_cond_broadcast(&dv->cond);
144  pthread_mutex_unlock(&dv->mutex);
145 #endif
146  return ret;
147 }
148 
149 static void *iec61883_receive_task(void *opaque)
150 {
151  struct iec61883_data *dv = (struct iec61883_data *)opaque;
152  int result;
153 
154 #if THREADS
155  while (dv->thread_loop)
156 #endif
157  {
158  while ((result = poll(&dv->raw1394_poll, 1, 200)) < 0) {
159  if (!(errno == EAGAIN || errno == EINTR)) {
160  av_log(NULL, AV_LOG_ERROR, "Raw1394 poll error occurred.\n");
161  dv->receive_error = AVERROR(EIO);
162  return NULL;
163  }
164  }
165  if (result > 0 && ((dv->raw1394_poll.revents & POLLIN)
166  || (dv->raw1394_poll.revents & POLLPRI))) {
167  dv->receiving = 1;
168  raw1394_loop_iterate(dv->raw1394);
169  } else if (dv->receiving) {
170  av_log(NULL, AV_LOG_ERROR, "No more input data available\n");
171 #if THREADS
172  pthread_mutex_lock(&dv->mutex);
173  dv->eof = 1;
174  pthread_cond_broadcast(&dv->cond);
175  pthread_mutex_unlock(&dv->mutex);
176 #else
177  dv->eof = 1;
178 #endif
179  return NULL;
180  }
181  }
182 
183  return NULL;
184 }
185 
187 {
188  DVPacket *packet;
189  int size;
190 
191  size = avpriv_dv_get_packet(dv->dv_demux, pkt);
192  if (size > 0)
193  return size;
194 
195  packet = dv->queue_first;
196  if (!packet)
197  return -1;
198 
199  size = avpriv_dv_produce_packet(dv->dv_demux, pkt,
200  packet->buf, packet->len, -1);
202  dv->queue_first = packet->next;
203  av_free(packet);
204  dv->packets--;
205 
206  if (size > 0)
207  return size;
208 
209  return -1;
210 }
211 
213 {
214  DVPacket *packet;
215  int size;
216 
217  while (dv->queue_first) {
218  packet = dv->queue_first;
219  size = avpriv_mpegts_parse_packet(dv->mpeg_demux, pkt, packet->buf,
220  packet->len);
221  dv->queue_first = packet->next;
222  av_freep(&packet->buf);
223  av_freep(&packet);
224  dv->packets--;
225 
226  if (size > 0)
227  return size;
228  }
229 
230  return -1;
231 }
232 
234 {
235  struct iec61883_data *dv = context->priv_data;
236  struct raw1394_portinfo pinf[16];
237  rom1394_directory rom_dir;
238  char *endptr;
239  int inport;
240  int nb_ports;
241  int port = -1;
242  int response;
243  int i, j = 0;
244  uint64_t guid = 0;
245 
246  dv->input_port = -1;
247  dv->output_port = -1;
248  dv->channel = -1;
249 
250  dv->raw1394 = raw1394_new_handle();
251 
252  if (!dv->raw1394) {
253  av_log(context, AV_LOG_ERROR, "Failed to open IEEE1394 interface.\n");
254  return AVERROR(EIO);
255  }
256 
257  if ((nb_ports = raw1394_get_port_info(dv->raw1394, pinf, 16)) < 0) {
258  av_log(context, AV_LOG_ERROR, "Failed to get number of IEEE1394 ports.\n");
259  goto fail;
260  }
261 
262  inport = strtol(context->filename, &endptr, 10);
263  if (endptr != context->filename && *endptr == '\0') {
264  av_log(context, AV_LOG_INFO, "Selecting IEEE1394 port: %d\n", inport);
265  j = inport;
266  nb_ports = inport + 1;
267  } else if (strcmp(context->filename, "auto")) {
268  av_log(context, AV_LOG_ERROR, "Invalid input \"%s\", you should specify "
269  "\"auto\" for auto-detection, or the port number.\n", context->filename);
270  goto fail;
271  }
272 
273  if (dv->device_guid) {
274  if (sscanf(dv->device_guid, "%llx", (long long unsigned int *)&guid) != 1) {
275  av_log(context, AV_LOG_INFO, "Invalid dvguid parameter: %s\n",
276  dv->device_guid);
277  goto fail;
278  }
279  }
280 
281  for (; j < nb_ports && port==-1; ++j) {
282  raw1394_destroy_handle(dv->raw1394);
283 
284  if (!(dv->raw1394 = raw1394_new_handle_on_port(j))) {
285  av_log(context, AV_LOG_ERROR, "Failed setting IEEE1394 port.\n");
286  goto fail;
287  }
288 
289  for (i=0; i<raw1394_get_nodecount(dv->raw1394); ++i) {
290 
291  /* Select device explicitly by GUID */
292 
293  if (guid > 1) {
294  if (guid == rom1394_get_guid(dv->raw1394, i)) {
295  dv->node = i;
296  port = j;
297  break;
298  }
299  } else {
300 
301  /* Select first AV/C tape recorder player node */
302 
303  if (rom1394_get_directory(dv->raw1394, i, &rom_dir) < 0)
304  continue;
305  if (((rom1394_get_node_type(&rom_dir) == ROM1394_NODE_TYPE_AVC) &&
306  avc1394_check_subunit_type(dv->raw1394, i, AVC1394_SUBUNIT_TYPE_VCR)) ||
307  (rom_dir.unit_spec_id == MOTDCT_SPEC_ID)) {
308  rom1394_free_directory(&rom_dir);
309  dv->node = i;
310  port = j;
311  break;
312  }
313  rom1394_free_directory(&rom_dir);
314  }
315  }
316  }
317 
318  if (port == -1) {
319  av_log(context, AV_LOG_ERROR, "No AV/C devices found.\n");
320  goto fail;
321  }
322 
323  /* Provide bus sanity for multiple connections */
324 
325  iec61883_cmp_normalize_output(dv->raw1394, 0xffc0 | dv->node);
326 
327  /* Find out if device is DV or HDV */
328 
329  if (dv->type == IEC61883_AUTO) {
330  response = avc1394_transaction(dv->raw1394, dv->node,
331  AVC1394_CTYPE_STATUS |
332  AVC1394_SUBUNIT_TYPE_TAPE_RECORDER |
333  AVC1394_SUBUNIT_ID_0 |
334  AVC1394_VCR_COMMAND_OUTPUT_SIGNAL_MODE |
335  0xFF, 2);
336  response = AVC1394_GET_OPERAND0(response);
337  dv->type = (response == 0x10 || response == 0x90 || response == 0x1A || response == 0x9A) ?
339  }
340 
341  /* Connect to device, and do initialization */
342 
343  dv->channel = iec61883_cmp_connect(dv->raw1394, dv->node, &dv->output_port,
344  raw1394_get_local_id(dv->raw1394),
345  &dv->input_port, &dv->bandwidth);
346 
347  if (dv->channel < 0)
348  dv->channel = 63;
349 
350  if (!dv->max_packets)
351  dv->max_packets = 100;
352 
353  if (CONFIG_MPEGTS_DEMUXER && dv->type == IEC61883_HDV) {
354 
355  /* Init HDV receive */
356 
357  avformat_new_stream(context, NULL);
358 
359  dv->mpeg_demux = avpriv_mpegts_parse_open(context);
360  if (!dv->mpeg_demux)
361  goto fail;
362 
364 
365  dv->iec61883_mpeg2 = iec61883_mpeg2_recv_init(dv->raw1394,
366  (iec61883_mpeg2_recv_t)iec61883_callback,
367  dv);
368 
369  dv->max_packets *= 766;
370  } else {
371 
372  /* Init DV receive */
373 
374  dv->dv_demux = avpriv_dv_init_demux(context);
375  if (!dv->dv_demux)
376  goto fail;
377 
379 
380  dv->iec61883_dv = iec61883_dv_fb_init(dv->raw1394, iec61883_callback, dv);
381  }
382 
383  dv->raw1394_poll.fd = raw1394_get_fd(dv->raw1394);
384  dv->raw1394_poll.events = POLLIN | POLLERR | POLLHUP | POLLPRI;
385 
386  /* Actually start receiving */
387 
388  if (dv->type == IEC61883_HDV)
389  iec61883_mpeg2_recv_start(dv->iec61883_mpeg2, dv->channel);
390  else
391  iec61883_dv_fb_start(dv->iec61883_dv, dv->channel);
392 
393 #if THREADS
394  dv->thread_loop = 1;
395  if (pthread_mutex_init(&dv->mutex, NULL))
396  goto fail;
397  if (pthread_cond_init(&dv->cond, NULL))
398  goto fail;
399  if (pthread_create(&dv->receive_task_thread, NULL, iec61883_receive_task, dv))
400  goto fail;
401 #endif
402 
403  return 0;
404 
405 fail:
406  raw1394_destroy_handle(dv->raw1394);
407  return AVERROR(EIO);
408 }
409 
411 {
412  struct iec61883_data *dv = context->priv_data;
413  int size;
414 
415  /**
416  * Try to parse frames from queue
417  */
418 
419 #if THREADS
420  pthread_mutex_lock(&dv->mutex);
421  while ((size = dv->parse_queue(dv, pkt)) == -1)
422  if (!dv->eof)
423  pthread_cond_wait(&dv->cond, &dv->mutex);
424  else
425  break;
426  pthread_mutex_unlock(&dv->mutex);
427 #else
428  int result;
429  while ((size = dv->parse_queue(dv, pkt)) == -1) {
430  iec61883_receive_task((void *)dv);
431  if (dv->receive_error)
432  return dv->receive_error;
433  }
434 #endif
435 
436  return size;
437 }
438 
439 static int iec61883_close(AVFormatContext *context)
440 {
441  struct iec61883_data *dv = context->priv_data;
442 
443 #if THREADS
444  dv->thread_loop = 0;
445  pthread_join(dv->receive_task_thread, NULL);
446  pthread_cond_destroy(&dv->cond);
447  pthread_mutex_destroy(&dv->mutex);
448 #endif
449 
450  if (CONFIG_MPEGTS_DEMUXER && dv->type == IEC61883_HDV) {
451  iec61883_mpeg2_recv_stop(dv->iec61883_mpeg2);
452  iec61883_mpeg2_close(dv->iec61883_mpeg2);
454  } else {
455  iec61883_dv_fb_stop(dv->iec61883_dv);
456  iec61883_dv_fb_close(dv->iec61883_dv);
457  }
458  while (dv->queue_first) {
459  DVPacket *packet = dv->queue_first;
460  dv->queue_first = packet->next;
461  av_freep(&packet->buf);
462  av_freep(&packet);
463  }
464 
465  iec61883_cmp_disconnect(dv->raw1394, dv->node, dv->output_port,
466  raw1394_get_local_id(dv->raw1394),
467  dv->input_port, dv->channel, dv->bandwidth);
468 
469  raw1394_destroy_handle(dv->raw1394);
470 
471  return 0;
472 }
473 
474 static const AVOption options[] = {
475  { "dvtype", "override autodetection of DV/HDV", offsetof(struct iec61883_data, type), AV_OPT_TYPE_INT, {.i64 = IEC61883_AUTO}, IEC61883_AUTO, IEC61883_HDV, AV_OPT_FLAG_DECODING_PARAM, "dvtype" },
476  { "auto", "auto detect DV/HDV", 0, AV_OPT_TYPE_CONST, {.i64 = IEC61883_AUTO}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "dvtype" },
477  { "dv", "force device being treated as DV device", 0, AV_OPT_TYPE_CONST, {.i64 = IEC61883_DV}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "dvtype" },
478  { "hdv" , "force device being treated as HDV device", 0, AV_OPT_TYPE_CONST, {.i64 = IEC61883_HDV}, 0, 0, AV_OPT_FLAG_DECODING_PARAM, "dvtype" },
479  { "dvbuffer", "set queue buffer size (in packets)", offsetof(struct iec61883_data, max_packets), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_DECODING_PARAM },
480  { "dvguid", "select one of multiple DV devices by its GUID", offsetof(struct iec61883_data, device_guid), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, AV_OPT_FLAG_DECODING_PARAM },
481  { NULL },
482 };
483 
484 static const AVClass iec61883_class = {
485  .class_name = "iec61883 indev",
486  .item_name = av_default_item_name,
487  .option = options,
488  .version = LIBAVUTIL_VERSION_INT,
490 };
491 
493  .name = "iec61883",
494  .long_name = NULL_IF_CONFIG_SMALL("libiec61883 (new DV1394) A/V input device"),
495  .priv_data_size = sizeof(struct iec61883_data),
496  .read_header = iec61883_read_header,
497  .read_packet = iec61883_read_packet,
498  .read_close = iec61883_close,
499  .flags = AVFMT_NOFILE,
500  .priv_class = &iec61883_class,
501 };
#define NULL
Definition: coverity.c:32
int bandwidth
returned by libiec61883
Definition: iec61883.c:75
static av_always_inline int pthread_mutex_destroy(pthread_mutex_t *mutex)
Definition: os2threads.h:94
int len
size of buffer allocated
Definition: iec61883.c:54
static av_always_inline int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
Definition: os2threads.h:153
AVOption.
Definition: opt.h:255
ptrdiff_t const GLvoid * data
Definition: opengl_enc.c:101
static int iec61883_parse_queue_hdv(struct iec61883_data *dv, AVPacket *pkt)
Definition: iec61883.c:212
#define LIBAVUTIL_VERSION_INT
Definition: version.h:62
MpegTSContext * avpriv_mpegts_parse_open(AVFormatContext *s)
Definition: mpegts.c:2756
static const AVOption options[]
Definition: iec61883.c:474
static int iec61883_read_packet(AVFormatContext *context, AVPacket *pkt)
Definition: iec61883.c:410
int(* parse_queue)(struct iec61883_data *dv, AVPacket *pkt)
Parse function for DV/HDV differs, so this is set before packets arrive.
Definition: iec61883.c:89
static AVPacket pkt
static const AVClass iec61883_class
Definition: iec61883.c:484
DVPacket * queue_first
first element of packet queue
Definition: iec61883.c:67
static av_always_inline int pthread_cond_destroy(pthread_cond_t *cond)
Definition: os2threads.h:124
For DV, one packet corresponds exactly to one frame.
Definition: iec61883.c:52
Format I/O context.
Definition: avformat.h:1272
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
Definition: log.h:72
int input_port
returned by libiec61883
Definition: iec61883.c:77
struct DVPacket * next
next DVPacket
Definition: iec61883.c:55
HMTX pthread_mutex_t
Definition: os2threads.h:40
raw1394handle_t raw1394
handle for libraw1394
Definition: iec61883.c:60
uint8_t
#define av_malloc(s)
AVInputFormat ff_iec61883_demuxer
Definition: iec61883.c:492
AVOptions.
attribute_deprecated void(* destruct)(struct AVPacket *)
Definition: avcodec.h:1183
MpegTSContext * mpeg_demux
generic HDV muxing/demuxing context
Definition: iec61883.c:65
struct pollfd raw1394_poll
to poll for new data from libraw1394
Definition: iec61883.c:86
AVStream * avformat_new_stream(AVFormatContext *s, const AVCodec *c)
Add a new stream to a media file.
Definition: utils.c:3672
int packets
Number of packets queued.
Definition: iec61883.c:72
int receive_error
Set in receive task in case of error.
Definition: iec61883.c:83
DVDemuxContext * avpriv_dv_init_demux(AVFormatContext *s)
Definition: dv.c:328
iec61883_dv_fb_t iec61883_dv
handle for libiec61883 when used with DV
Definition: iec61883.c:61
ptrdiff_t size
Definition: opengl_enc.c:101
#define av_log(a,...)
Main libavdevice API header.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:176
av_default_item_name
#define AVERROR(e)
Definition: error.h:43
static void * iec61883_receive_task(void *opaque)
Definition: iec61883.c:149
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
Definition: internal.h:175
GLsizei GLsizei * length
Definition: opengl_enc.c:115
static int iec61883_close(AVFormatContext *context)
Definition: iec61883.c:439
static int iec61883_callback(unsigned char *data, int length, int complete, void *callback_data)
Definition: iec61883.c:98
iec61883_mpeg2_t iec61883_mpeg2
handle for libiec61883 when used with HDV
Definition: iec61883.c:62
char filename[1024]
input or output filename
Definition: avformat.h:1348
char * device_guid
to select one of multiple DV devices
Definition: iec61883.c:70
ret
Definition: avfilter.c:974
uint8_t * buf
actual buffer data
Definition: iec61883.c:53
#define IEC61883_DV
Definition: iec61883.c:44
static av_always_inline int pthread_join(pthread_t thread, void **value_ptr)
Definition: os2threads.h:80
static av_always_inline int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr)
Definition: os2threads.h:87
static pthread_mutex_t * mutex
Definition: w32pthreads.h:166
static int iec61883_parse_queue_dv(struct iec61883_data *dv, AVPacket *pkt)
Definition: iec61883.c:186
DVDemuxContext * dv_demux
generic DV muxing/demuxing context
Definition: iec61883.c:64
static av_always_inline int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)(void *), void *arg)
Definition: os2threads.h:64
attribute_deprecated void av_destruct_packet(AVPacket *pkt)
Default packet destructor.
Definition: avpacket.c:35
#define AV_LOG_INFO
Standard information.
Definition: log.h:187
int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt, uint8_t *buf, int buf_size, int64_t pos)
Definition: dv.c:368
int node
returned by libiec61883
Definition: iec61883.c:79
GLint GLenum type
Definition: opengl_enc.c:105
DVPacket * queue_last
last element of packet queue
Definition: iec61883.c:68
Describe the class of an AVClass context structure.
Definition: log.h:67
int type
Stream type, to distinguish DV/HDV.
Definition: iec61883.c:78
int receiving
True as soon data from device available.
Definition: iec61883.c:82
#define AV_OPT_FLAG_DECODING_PARAM
a generic parameter which can be set by the user for demuxing or decoding
Definition: opt.h:286
#define IEC61883_AUTO
Definition: iec61883.c:43
int avpriv_mpegts_parse_packet(MpegTSContext *ts, AVPacket *pkt, const uint8_t *buf, int len)
Definition: mpegts.c:2775
#define IEC61883_HDV
Definition: iec61883.c:45
static int iec61883_read_header(AVFormatContext *context)
Definition: iec61883.c:233
int output_port
returned by libiec61883
Definition: iec61883.c:80
#define AVFMT_NOFILE
Demuxer will use avio_open, no opened file should be provided by the caller.
Definition: avformat.h:465
static av_always_inline int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr)
Definition: os2threads.h:115
int channel
returned by libiec61883
Definition: iec61883.c:76
int avpriv_dv_get_packet(DVDemuxContext *c, AVPacket *pkt)
Definition: dv.c:351
#define av_free(p)
static av_always_inline int pthread_cond_broadcast(pthread_cond_t *cond)
Definition: os2threads.h:142
static av_always_inline int pthread_mutex_unlock(pthread_mutex_t *mutex)
Definition: os2threads.h:108
void * priv_data
Format private data.
Definition: avformat.h:1300
#define av_freep(p)
const char * name
A comma separated list of short names for the format.
Definition: avformat.h:628
static av_always_inline int pthread_mutex_lock(pthread_mutex_t *mutex)
Definition: os2threads.h:101
#define MOTDCT_SPEC_ID
Definition: iec61883.c:42
int thread_loop
Condition for thread while-loop.
Definition: iec61883.c:81
int max_packets
Max. number of packets in queue.
Definition: iec61883.c:73
int eof
True as soon as no more data available.
Definition: iec61883.c:84
void avpriv_mpegts_parse_close(MpegTSContext *ts)
Definition: mpegts.c:2800
This structure stores compressed data.
Definition: avcodec.h:1139
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
Definition: mem.c:250