4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
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
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #include "vdevicebase.h"
30 #include "quicktime.h"
32 #define INPUT_BUFFER_SIZE 65536
34 class VDeviceLML : public VDeviceBase
37 VDeviceLML(VideoDevice *device);
43 int read_buffer(VFrame *frame);
44 int write_buffer(VFrame *frame, EDL *edl);
45 int reset_parameters();
46 ArrayList<int>* get_render_strategies();
51 inline unsigned char get_byte()
53 if(!input_buffer) input_buffer = new unsigned char[INPUT_BUFFER_SIZE];
54 if(input_position >= INPUT_BUFFER_SIZE) refill_input();
55 return input_buffer[input_position++];
58 inline unsigned long next_bytes(int total)
60 unsigned long result = 0;
63 if(!input_buffer) input_buffer = new unsigned char[INPUT_BUFFER_SIZE];
64 if(input_position + total > INPUT_BUFFER_SIZE) refill_input();
66 for(i = 0; i < total; i++)
69 result |= input_buffer[input_position + i];
75 inline int write_byte(unsigned char byte)
79 frame_buffer = new unsigned char[256000];
80 frame_allocated = 256000;
83 if(frame_size >= frame_allocated)
85 unsigned char *new_frame = new unsigned char[frame_allocated * 2];
86 memcpy(new_frame, frame_buffer, frame_size);
88 frame_buffer = new_frame;
92 frame_buffer[frame_size++] = byte;
96 int write_fake_marker();
99 unsigned char *input_buffer, *frame_buffer;
101 long frame_size, frame_allocated;
103 // quicktime_mjpeg_hdr jpeg_header;
105 ArrayList<int> render_strategies;