]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/dv1394.c
cosmetics: Group all external library decoders and encoders together.
[ffmpeg] / libavformat / dv1394.c
index 9d229fc957020e140226051b150430d3e496ffde..3a5f479c8e18fbb87029de439e99a7ce716afa25 100644 (file)
@@ -2,18 +2,20 @@
  * 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
  */
 
@@ -38,7 +40,7 @@ struct dv1394_data {
     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 */
@@ -81,7 +83,6 @@ static int dv1394_start(struct dv1394_data *dv)
 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)
@@ -98,10 +99,7 @@ static int dv1394_read_header(AVFormatContext * context, AVFormatParameters * ap
         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;
@@ -227,7 +225,7 @@ static int dv1394_close(AVFormatContext * context)
     return 0;
 }
 
-static AVInputFormat dv1394_demuxer = {
+AVInputFormat dv1394_demuxer = {
     .name           = "dv1394",
     .long_name      = "dv1394 A/V grab",
     .priv_data_size = sizeof(struct dv1394_data),
@@ -236,9 +234,3 @@ static AVInputFormat dv1394_demuxer = {
     .read_close     = dv1394_close,
     .flags          = AVFMT_NOFILE
 };
-
-int dv1394_init(void)
-{
-    av_register_input_format(&dv1394_demuxer);
-    return 0;
-}