Don't do undesirable things if stop_and_execute is recursively entered.
[jpcrr.git] / streamtools / dumpframes.c
bloba910b7345ec9fac2de1bb698542d7cd9084da62c
1 /*
2 JPC-RR: A x86 PC Hardware Emulator
3 Release 1
5 Copyright (C) 2009 H. Ilari Liusvaara
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 2 as published by
9 the Free Software Foundation.
11 This program 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
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 Based on JPC x86 PC Hardware emulator,
21 A project from the Physics Dept, The University of Oxford
23 Details about original JPC can be found at:
25 www-jpc.physics.ox.ac.uk
29 #include "frame.h"
30 #include "stdio.h"
32 int main(int argc, char** argv)
34 if(argc < 2) {
35 fprintf(stderr, "usage: %s <filename>\n", argv[0]);
36 fprintf(stderr, "Dump header information about each frame in stream read from <filename>.\n");
37 return 1;
39 struct frame_input_stream* in = fis_open(argv[1]);
40 struct frame* frame;
41 int num = 1;
43 while((frame = fis_next_frame(in))) {
44 printf("Frame #%i: %u*%u, timeseq = %llu.\n",
45 num, (unsigned)frame->f_width, (unsigned)frame->f_height,
46 frame->f_timeseq);
47 num++;
48 frame_release(frame);
51 fis_close(in);