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 #define INPUT_BUFFER_SIZE 65536
32 class VDeviceLML : public VDeviceBase
35 VDeviceLML(VideoDevice *device);
41 int read_buffer(VFrame *frame);
42 int write_buffer(VFrame *frame, EDL *edl);
43 int reset_parameters();
44 ArrayList<int>* get_render_strategies();
49 inline unsigned char get_byte()
51 if(!input_buffer) input_buffer = new unsigned char[INPUT_BUFFER_SIZE];
52 if(input_position >= INPUT_BUFFER_SIZE) refill_input();
53 return input_buffer[input_position++];
56 inline unsigned long next_bytes(int total)
58 unsigned long result = 0;
61 if(!input_buffer) input_buffer = new unsigned char[INPUT_BUFFER_SIZE];
62 if(input_position + total > INPUT_BUFFER_SIZE) refill_input();
64 for(i = 0; i < total; i++)
67 result |= input_buffer[input_position + i];
73 inline int write_byte(unsigned char byte)
77 frame_buffer = new unsigned char[256000];
78 frame_allocated = 256000;
81 if(frame_size >= frame_allocated)
83 unsigned char *new_frame = new unsigned char[frame_allocated * 2];
84 memcpy(new_frame, frame_buffer, frame_size);
86 frame_buffer = new_frame;
90 frame_buffer[frame_size++] = byte;
94 int write_fake_marker();
97 unsigned char *input_buffer, *frame_buffer;
99 long frame_size, frame_allocated;
101 // quicktime_mjpeg_hdr jpeg_header;
103 ArrayList<int> render_strategies;