82 lines
2.7 KiB
Diff
82 lines
2.7 KiB
Diff
---
|
|
tools/mpg1394grab.c | 21 +++++++++++----------
|
|
1 file changed, 11 insertions(+), 10 deletions(-)
|
|
|
|
Index: libraw1394-1.2.1/tools/mpg1394grab.c
|
|
===================================================================
|
|
--- libraw1394-1.2.1.orig/tools/mpg1394grab.c
|
|
+++ libraw1394-1.2.1/tools/mpg1394grab.c
|
|
@@ -29,10 +29,11 @@
|
|
#include <unistd.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
+#include <string.h>
|
|
#include <netinet/in.h>
|
|
|
|
/* linux1394 includes */
|
|
-#include <libraw1394/raw1394.h>
|
|
+#include "../src/raw1394.h"
|
|
|
|
/* constant for the iso receive channel */
|
|
#define RX_CHANNEL 63
|
|
@@ -40,10 +41,10 @@
|
|
#define RAW_BUF_SIZE 4096
|
|
|
|
/* global vars */
|
|
-unsigned char g_rx_packet[RAW_BUF_SIZE]; /* the received packet data */
|
|
-int g_rx_length; /* the size of a received packet */
|
|
-int g_alldone = 0; /* flag to indicate when to quit */
|
|
-int g_rx_channel = RX_CHANNEL;
|
|
+static unsigned char g_rx_packet[RAW_BUF_SIZE]; /* the received packet data */
|
|
+static int g_rx_length; /* the size of a received packet */
|
|
+static int g_alldone; /* flag to indicate when to quit */
|
|
+static int g_rx_channel = RX_CHANNEL;
|
|
|
|
|
|
/*************************************************************************/
|
|
@@ -53,7 +54,7 @@ int g_rx_channel = RX_CHANNEL;
|
|
/* a callback function executed by libraw1394 when a packet is received. */
|
|
/* iso packet header is included */
|
|
/* libraw1394 has its own handle type */
|
|
-int raw_iso_handler(raw1394handle_t handle, int channel, size_t length,
|
|
+static int raw_iso_handler(raw1394handle_t handle, int channel, size_t length,
|
|
quadlet_t *data)
|
|
{
|
|
/* is this a packet for me? */
|
|
@@ -67,7 +68,7 @@ int raw_iso_handler(raw1394handle_t hand
|
|
|
|
/* libraw1394 executes this when there is a bus reset. We'll just keep it
|
|
simple and quit */
|
|
-int reset_handler(raw1394handle_t handle, unsigned int generation)
|
|
+static int reset_handler(raw1394handle_t handle, unsigned int generation)
|
|
{
|
|
raw1394_update_generation(handle, generation);
|
|
g_alldone = 1;
|
|
@@ -75,7 +76,7 @@ int reset_handler(raw1394handle_t handle
|
|
}
|
|
|
|
|
|
-raw1394handle_t open_raw1394(void)
|
|
+static raw1394handle_t open_raw1394(void)
|
|
{
|
|
int numcards;
|
|
struct raw1394_portinfo pinf[16];
|
|
@@ -121,7 +122,7 @@ raw1394handle_t open_raw1394(void)
|
|
}
|
|
|
|
|
|
-void close_raw1394(raw1394handle_t handle)
|
|
+static void close_raw1394(raw1394handle_t handle)
|
|
{
|
|
raw1394_stop_iso_rcv(handle, g_rx_channel);
|
|
raw1394_destroy_handle(handle);
|
|
@@ -130,7 +131,7 @@ void close_raw1394(raw1394handle_t handl
|
|
|
|
/* this is a common unix function that gets called when a process
|
|
receives a signal (e.g. ctrl-c) */
|
|
-void signal_handler(int sig)
|
|
+static void signal_handler(int sig)
|
|
{
|
|
/* replace this signal handler with the default (which aborts) */
|
|
signal(SIGINT, SIG_DFL);
|