Subversion Repositories external

Compare Revisions

Ignore whitespace Rev 660 → Rev 661

/trunk/cinelerra/hvirtual/quicktime/udta.c
2,6 → 2,11
#include "quicktime.h"
 
#define DEFAULT_INFO "Made with Quicktime for Linux"
static unsigned char cpy_tag[] = {0xa9, 'c', 'p', 'y'};
static unsigned char nam_tag[] = {0xa9, 'n', 'a', 'm'};
static unsigned char inf_tag[] = {0xa9, 'i', 'n', 'f'};
static unsigned char req_tag[] = {0xa9, 'r', 'e', 'q'};
static unsigned char enc_tag[] = {0xa9, 'e', 'n', 'c'};
 
int quicktime_udta_init(quicktime_udta_t *udta)
{
9,6 → 14,10
udta->copyright_len = 0;
udta->name = 0;
udta->name_len = 0;
udta->require = 0;
udta->require_len = 0;
udta->encoder = 0;
udta->encoder_len = 0;
 
udta->info = malloc(strlen(DEFAULT_INFO) + 1);
udta->info_len = strlen(DEFAULT_INFO);
30,6 → 39,14
{
free(udta->info);
}
if(udta->require_len)
{
free(udta->require);
}
if(udta->encoder_len)
{
free(udta->encoder);
}
// quicktime_udta_init(udta);
return 0;
}
40,6 → 57,8
if(udta->copyright_len) printf(" copyright -> %s\n", udta->copyright);
if(udta->name_len) printf(" name -> %s\n", udta->name);
if(udta->info_len) printf(" info -> %s\n", udta->info);
if(udta->require_len) printf(" require -> %s\n", udta->require);
if(udta->encoder_len) printf(" encoder -> %s\n", udta->encoder);
}
 
int quicktime_read_udta(quicktime_t *file, quicktime_udta_t *udta, quicktime_atom_t *udta_atom)
50,25 → 69,39
do
{
quicktime_atom_read_header(file, &leaf_atom);
if(quicktime_atom_is(&leaf_atom, "©cpy"))
 
 
if(quicktime_atom_is(&leaf_atom, cpy_tag))
{
result += quicktime_read_udta_string(file, &(udta->copyright), &(udta->copyright_len));
}
else
if(quicktime_atom_is(&leaf_atom, "©nam"))
if(quicktime_atom_is(&leaf_atom, nam_tag))
{
result += quicktime_read_udta_string(file, &(udta->name), &(udta->name_len));
}
else
if(quicktime_atom_is(&leaf_atom, "©inf"))
if(quicktime_atom_is(&leaf_atom, inf_tag))
{
result += quicktime_read_udta_string(file, &(udta->info), &(udta->info_len));
}
else
quicktime_atom_skip(file, &leaf_atom);
if(quicktime_atom_is(&leaf_atom, req_tag))
{
result += quicktime_read_udta_string(file, &(udta->require), &(udta->require_len));
}
else
if(quicktime_atom_is(&leaf_atom, enc_tag))
{
result += quicktime_read_udta_string(file, &(udta->encoder), &(udta->encoder_len));
}
else
{
quicktime_atom_skip(file, &leaf_atom);
}
}while(quicktime_position(file) < udta_atom->end);
 
 
return result;
}
 
79,25 → 112,39
 
if(udta->copyright_len)
{
quicktime_atom_write_header(file, &subatom, "©cpy");
quicktime_atom_write_header(file, &subatom, cpy_tag);
quicktime_write_udta_string(file, udta->copyright, udta->copyright_len);
quicktime_atom_write_footer(file, &subatom);
}
 
if(udta->name_len)
{
quicktime_atom_write_header(file, &subatom, "©nam");
quicktime_atom_write_header(file, &subatom, nam_tag);
quicktime_write_udta_string(file, udta->name, udta->name_len);
quicktime_atom_write_footer(file, &subatom);
}
 
if(udta->info_len)
{
quicktime_atom_write_header(file, &subatom, "©inf");
quicktime_atom_write_header(file, &subatom, inf_tag);
quicktime_write_udta_string(file, udta->info, udta->info_len);
quicktime_atom_write_footer(file, &subatom);
}
 
if(udta->require_len)
{
quicktime_atom_write_header(file, &subatom, req_tag);
quicktime_write_udta_string(file, udta->require, udta->require_len);
quicktime_atom_write_footer(file, &subatom);
}
 
if(udta->encoder_len)
{
quicktime_atom_write_header(file, &subatom, enc_tag);
quicktime_write_udta_string(file, udta->encoder, udta->encoder_len);
quicktime_atom_write_footer(file, &subatom);
}
 
quicktime_atom_write_footer(file, &atom);
}
 
/trunk/cinelerra/hvirtual/quicktime/vbraudio.c
103,27 → 103,39
trak,
vbr->sample);
int size = quicktime_sample_size(trak, vbr->sample);
int new_allocation = vbr->input_size + size;
int result = 0;
 
if(vbr->input_buffer && vbr->input_allocation < size)
if(vbr->input_allocation < new_allocation)
{
free(vbr->input_buffer);
vbr->input_buffer = 0;
vbr->input_buffer = realloc(vbr->input_buffer, new_allocation);
vbr->input_allocation = new_allocation;
}
 
if(!vbr->input_buffer)
{
vbr->input_buffer = calloc(1, size);
vbr->input_allocation = size;
}
vbr->input_size = size;
 
quicktime_set_position(file, offset);
result = !quicktime_read_data(file, vbr->input_buffer, vbr->input_size);
result = !quicktime_read_data(file, vbr->input_buffer + vbr->input_size, size);
vbr->input_size += size;
vbr->sample++;
return result;
}
 
void quicktime_shift_vbr(quicktime_audio_map_t *atrack, int bytes)
{
quicktime_vbr_t *vbr = &atrack->vbr;
if(bytes >= vbr->input_size)
{
vbr->input_size = 0;
}
else
{
int i, j;
for(i = 0, j = bytes; j < vbr->input_size; i++, j++)
vbr->input_buffer[i] = vbr->input_buffer[j];
vbr->input_size -= bytes;
}
}
 
void quicktime_store_vbr_float(quicktime_audio_map_t *atrack,
float *samples,
int sample_count)
187,5 → 199,3
 
 
 
 
 
/trunk/cinelerra/hvirtual/quicktime/libmjpeg.c
652,7 → 652,6
pthread_mutex_unlock(&(mjpeg->decompress_init));
get_rows(mjpeg, engine);
 
//printf("decompress_field 3 %d\n", engine->jpeg_decompress.output_scanline);
 
while(engine->jpeg_decompress.output_scanline < engine->jpeg_decompress.output_height)
{
1087,7 → 1086,7
unsigned char *u_in = mjpeg->temp_rows[1][0];
unsigned char *v_in = mjpeg->temp_rows[2][0];
 
//printf("mjpeg_decompress %p\n", row_pointers);
//printf("mjpeg_decompress 7 %p\n", row_pointers);
cmodel_transfer(row_pointers,
0,
y_plane,
1109,6 → 1108,7
0,
mjpeg->coded_w,
mjpeg->rowspan ? mjpeg->rowspan : mjpeg->output_w);
//printf("mjpeg_decompress 8\n");
}
return 0;
}
/trunk/cinelerra/hvirtual/quicktime/atom.c
12,6 → 12,7
type[1] = data[5];
type[2] = data[6];
type[3] = data[7];
type[4] = 0;
 
/*printf("%c%c%c%c ", type[0], type[1], type[2], type[3]); */
/* need this for quicktime_check_sig */
68,7 → 69,7
static int reset(quicktime_atom_t *atom)
{
atom->end = 0;
atom->type[0] = atom->type[1] = atom->type[2] = atom->type[3] = 0;
atom->type[0] = atom->type[1] = atom->type[2] = atom->type[3] = atom->type[4] = 0;
return 0;
}
 
86,6 → 87,7
atom->type[1] = header[1];
atom->type[2] = header[2];
atom->type[3] = header[3];
atom->type[4] = 0;
atom->size =
(((unsigned char)header[4]) ) |
(((unsigned char)header[5]) << 8 ) |
212,7 → 214,7
quicktime_set_position(file, atom->end);
}
 
int quicktime_atom_is(quicktime_atom_t *atom, char *type)
int quicktime_atom_is(quicktime_atom_t *atom, unsigned char *type)
{
if(atom->type[0] == type[0] &&
atom->type[1] == type[1] &&
/trunk/cinelerra/hvirtual/quicktime/configure
1,3 → 1,5
#!/bin/sh
 
# configuration is being done in a script because starting with GCC-3.2
# the compiler flags are changing too much between minor releases to detect
# with Makefile scripts alone. For now it just tells you if you have the
6,19 → 8,24
ERROR=0
 
# test for nasm
 
if [ -x /usr/bin/nasm -o -x /usr/local/bin/nasm ]; then HAVE_NASM=y; else HAVE_NASM=n; fi
 
if [ $HAVE_NASM == n ];
then echo " *** Nasm is required. Download it from nasm.sourceforge.net";
# test for yasm
if [ -x /usr/bin/yasm -o -x /usr/local/bin/yasm ]; then HAVE_YASM=y; else HAVE_YASM=n; fi
 
if [ `arch` == i686 ];
then
if [ $HAVE_NASM == n ];
then echo " *** Nasm is required. Download it from nasm.sourceforge.net";
ERROR=1
fi
fi
 
if [ $HAVE_YASM == n ];
then echo " *** Yasm is required. Download it from www.tortall.net/projects/yasm/";
ERROR=1
fi
 
 
 
 
 
 
# test for -msse support
 
rm -f a.out
40,11 → 47,40
ERROR=1
fi
 
if [ $ERROR == 1 ];
then exit;
fi
 
# configure them all
 
# version 2.0 of faad2 produced defective Makefile
cd faad2* && ./configure && sed 's/ /\t/' Makefile > Makefile2 && mv -f Makefile2 Makefile && cd ..
 
cd faac* && ./configure && cd ..
 
cd ffmpeg* && ./configure && cd ..
 
cd x264* && ./configure --enable-pthread && cd ..
 
cd libdv* && ./configure --disable-gtk --enable-shared=no && cd ..
 
cd libogg* && ./configure && cd ..
 
LIBOGG_PATH=`expr libogg*` && \
cd libvorbis* && \
CFLAGS="-I../../$LIBOGG_PATH/include -L../../$LIBOGG_PATH/src/" ./configure --enable-shared=no&& \
cd ..
 
 
 
if [ `arch` == i686 ];
then
 
cd jpeg-mmx* && ./configure && cd ..
 
fi
 
 
# success
if [ $ERROR == 0 ];
then echo "Configured successfully. Type 'make' to build it.";