* Linux DV1394 interface
* Copyright (c) 2003 Max Krasnyansky <maxk@qualcomm.com>
*
- * This library is free software; you can redistribute it and/or
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
+ * version 2.1 of the License, or (at your option) any later version.
*
- * This library is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
int channel;
int format;
- void *ring; /* Ring buffer */
+ uint8_t *ring; /* Ring buffer */
int index; /* Current frame index */
int avail; /* Number of frames available for reading */
int done; /* Number of completed frames */
static int dv1394_read_header(AVFormatContext * context, AVFormatParameters * ap)
{
struct dv1394_data *dv = context->priv_data;
- const char *video_device;
dv->dv_demux = dv_init_demux(context);
if (!dv->dv_demux)
dv->channel = DV1394_DEFAULT_CHANNEL;
/* Open and initialize DV1394 device */
- video_device = ap->device;
- if (!video_device)
- video_device = "/dev/dv1394/0";
- dv->fd = open(video_device, O_RDONLY);
+ dv->fd = open(context->filename, O_RDONLY);
if (dv->fd < 0) {
perror("Failed to open DV interface");
goto failed;
return 0;
}
-static AVInputFormat dv1394_demuxer = {
+AVInputFormat dv1394_demuxer = {
.name = "dv1394",
.long_name = "dv1394 A/V grab",
.priv_data_size = sizeof(struct dv1394_data),
.read_close = dv1394_close,
.flags = AVFMT_NOFILE
};
-
-int dv1394_init(void)
-{
- av_register_input_format(&dv1394_demuxer);
- return 0;
-}