aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/dc1394.c
diff options
context:
space:
mode:
authorDiego Biurrun <diego@biurrun.de>2005-12-17 18:14:38 +0000
committerDiego Biurrun <diego@biurrun.de>2005-12-17 18:14:38 +0000
commit115329f16062074e11ccf3b89ead6176606c9696 (patch)
treee98aa993905a702688bf821737ab9a443969fc28 /libavformat/dc1394.c
parentd76319b1ab716320f6e6a4d690b85fe4504ebd5b (diff)
downloadffmpeg-115329f16062074e11ccf3b89ead6176606c9696.tar.gz
COSMETICS: Remove all trailing whitespace.
Originally committed as revision 4749 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/dc1394.c')
-rw-r--r--libavformat/dc1394.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/libavformat/dc1394.c b/libavformat/dc1394.c
index bcc9bd9b04..1c8de2a3eb 100644
--- a/libavformat/dc1394.c
+++ b/libavformat/dc1394.c
@@ -70,11 +70,11 @@ static int dc1394_read_header(AVFormatContext *c, AVFormatParameters * ap)
for (fmt = dc1394_frame_formats; fmt->width; fmt++)
if (fmt->pix_fmt == ap->pix_fmt && fmt->width == ap->width && fmt->height == ap->height)
break;
-
+
for (fps = dc1394_frame_rates; fps->frame_rate; fps++)
if (fps->frame_rate == av_rescale(1000, ap->time_base.den, ap->time_base.num))
break;
-
+
/* create a video stream */
vst = av_new_stream(c, 0);
if (!vst)
@@ -93,12 +93,12 @@ static int dc1394_read_header(AVFormatContext *c, AVFormatParameters * ap)
dc1394->packet.size = avpicture_get_size(fmt->pix_fmt, fmt->width, fmt->height);
dc1394->packet.stream_index = vst->index;
dc1394->packet.flags |= PKT_FLAG_KEY;
-
+
dc1394->current_frame = 0;
dc1394->fps = fps->frame_rate;
vst->codec->bit_rate = av_rescale(dc1394->packet.size * 8, fps->frame_rate, 1000);
-
+
/* Now lets prep the hardware */
dc1394->handle = dc1394_create_handle(0); /* FIXME: gotta have ap->port */
if (!dc1394->handle) {
@@ -108,15 +108,15 @@ static int dc1394_read_header(AVFormatContext *c, AVFormatParameters * ap)
camera_nodes = dc1394_get_camera_nodes(dc1394->handle, &res, 1);
if (!camera_nodes || camera_nodes[ap->channel] == DC1394_NO_CAMERA) {
av_log(c, AV_LOG_ERROR, "There's no IIDC camera on the channel %d\n", ap->channel);
- goto out_handle;
+ goto out_handle;
}
- res = dc1394_dma_setup_capture(dc1394->handle, camera_nodes[ap->channel],
+ res = dc1394_dma_setup_capture(dc1394->handle, camera_nodes[ap->channel],
0,
FORMAT_VGA_NONCOMPRESSED,
fmt->frame_size_id,
SPEED_400,
- fps->frame_rate_id, 8, 1,
- ap->device,
+ fps->frame_rate_id, 8, 1,
+ ap->device,
&dc1394->camera);
dc1394_free_camera_nodes(camera_nodes);
if (res != DC1394_SUCCESS) {
@@ -129,7 +129,7 @@ static int dc1394_read_header(AVFormatContext *c, AVFormatParameters * ap)
av_log(c, AV_LOG_ERROR, "Can't start isochronous transmission\n");
goto out_handle_dma;
}
-
+
return 0;
out_handle_dma:
@@ -145,25 +145,25 @@ static int dc1394_read_packet(AVFormatContext *c, AVPacket *pkt)
{
struct dc1394_data *dc1394 = c->priv_data;
int res;
-
+
/* discard stale frame */
if (dc1394->current_frame++) {
if (dc1394_dma_done_with_buffer(&dc1394->camera) != DC1394_SUCCESS)
av_log(c, AV_LOG_ERROR, "failed to release %d frame\n", dc1394->current_frame);
}
-
+
res = dc1394_dma_single_capture(&dc1394->camera);
if (res == DC1394_SUCCESS) {
- dc1394->packet.data = (uint8_t *)(dc1394->camera.capture_buffer);
- dc1394->packet.pts = (dc1394->current_frame * 1000000) / dc1394->fps;
+ dc1394->packet.data = (uint8_t *)(dc1394->camera.capture_buffer);
+ dc1394->packet.pts = (dc1394->current_frame * 1000000) / dc1394->fps;
res = dc1394->packet.size;
} else {
av_log(c, AV_LOG_ERROR, "DMA capture failed\n");
dc1394->packet.data = NULL;
- res = -1;
+ res = -1;
}
-
+
*pkt = dc1394->packet;
return res;
}
@@ -176,7 +176,7 @@ static int dc1394_close(AVFormatContext * context)
dc1394_dma_unlisten(dc1394->handle, &dc1394->camera);
dc1394_dma_release_camera(dc1394->handle, &dc1394->camera);
dc1394_destroy_handle(dc1394->handle);
-
+
return 0;
}