Exemplo n.º 1
0
int quicktime_read_esds(quicktime_t *file, quicktime_esds_t *esds)
{
    u_int8_t tag;
    u_int32_t length;

    esds->version = quicktime_read_char(file);
    esds->flags = quicktime_read_int24(file);

    /* get and verify ES_DescrTag */
    tag = quicktime_read_char(file);
    if (tag == 0x03) {
        /* read length */
        if (quicktime_read_mp4_descr_length(file) < 5 + 15) {
            return 1;
        }
        /* skip 3 bytes */
        quicktime_set_position(file, quicktime_position(file) + 3);
    } else {
        /* skip 2 bytes */
        quicktime_set_position(file, quicktime_position(file) + 2);
    }

    /* get and verify DecoderConfigDescrTab */
    if (quicktime_read_char(file) != 0x04) {
        return 1;
    }

    /* read length */
    if (quicktime_read_mp4_descr_length(file) < 15) {
        return 1;
    }

    /* skip 13 bytes */
    quicktime_set_position(file, quicktime_position(file) + 13);

    /* get and verify DecSpecificInfoTag */
    if (quicktime_read_char(file) != 0x05) {
        return 1;
    }

    /* read length */
    esds->decoderConfigLen = quicktime_read_mp4_descr_length(file);

    free(esds->decoderConfig);
    esds->decoderConfig = malloc(esds->decoderConfigLen);
    if (esds->decoderConfig) {
        quicktime_read_data(file, esds->decoderConfig, esds->decoderConfigLen);
    } else {
        esds->decoderConfigLen = 0;
    }

    /* will skip the remainder of the atom */
    return 0;
}
Exemplo n.º 2
0
int quicktime_read_smhd(quicktime_t *file, quicktime_smhd_t *smhd)
{
	smhd->version = quicktime_read_char(file);
	smhd->flags = quicktime_read_int24(file);
	smhd->balance = quicktime_read_int16(file);
	smhd->reserved = quicktime_read_int16(file);
}
Exemplo n.º 3
0
void quicktime_read_vmhd(quicktime_t *file, quicktime_vmhd_t *vmhd)
{
	int i;
	vmhd->version = quicktime_read_char(file);
	vmhd->flags = quicktime_read_int24(file);
	vmhd->graphics_mode = quicktime_read_int16(file);
	for(i = 0; i < 3; i++)
		vmhd->opcolor[i] = quicktime_read_int16(file);
}
Exemplo n.º 4
0
void quicktime_read_indx(quicktime_t *file, 
	quicktime_strl_t *strl, 
	quicktime_atom_t *parent_atom)
{
	quicktime_indx_t *indx = &strl->indx;
	quicktime_indxtable_t *indx_table;
	quicktime_ix_t *ix;
	int i;
	int64_t offset;

	indx->longs_per_entry = quicktime_read_int16_le(file);
	indx->index_subtype = quicktime_read_char(file);
	indx->index_type = quicktime_read_char(file);
	indx->table_size = quicktime_read_int32_le(file);
	quicktime_read_char32(file, indx->chunk_id);
	quicktime_read_int32_le(file);
	quicktime_read_int32_le(file);
	quicktime_read_int32_le(file);


//	file->is_odml = 1;

//printf("quicktime_read_indx 1\n");
/* Read indx entries */
	indx->table = calloc(indx->table_size, sizeof(quicktime_indxtable_t));
	for(i = 0; i < indx->table_size; i++)
	{
		indx_table = &indx->table[i];
		indx_table->index_offset = quicktime_read_int64_le(file);
		indx_table->index_size = quicktime_read_int32_le(file);
		indx_table->duration = quicktime_read_int32_le(file);
		offset = quicktime_position(file);

		indx_table->ix = calloc(indx->table_size, sizeof(quicktime_ix_t*));

/* Now read the partial index */
		ix = indx_table->ix = calloc(1, sizeof(quicktime_ix_t));
		quicktime_set_position(file, indx_table->index_offset);
		quicktime_read_ix(file, ix);
		quicktime_set_position(file, offset);
	}
//printf("quicktime_read_indx 100\n");

}
Exemplo n.º 5
0
int quicktime_read_guid(quicktime_t *file, quicktime_guid_t *guid)
{
	int i;
	guid->v1 = quicktime_read_int32_le(file);
    guid->v2 = quicktime_read_int16_le(file);
    guid->v3 = quicktime_read_int16_le(file);
    for(i = 0; i < 8; i++)
        guid->v4[i] = quicktime_read_char(file);
	return 0;
}
Exemplo n.º 6
0
void quicktime_read_hdlr(quicktime_t *file, quicktime_hdlr_t *hdlr)
{
	hdlr->version = quicktime_read_char(file);
	hdlr->flags = quicktime_read_int24(file);
	quicktime_read_char32(file, hdlr->component_type);
	quicktime_read_char32(file, hdlr->component_subtype);
	hdlr->component_manufacturer = quicktime_read_int32(file);
	hdlr->component_flags = quicktime_read_int32(file);
	hdlr->component_flag_mask = quicktime_read_int32(file);
	quicktime_read_pascal(file, hdlr->component_name);
}
Exemplo n.º 7
0
void quicktime_read_mdhd(quicktime_t *file, quicktime_mdhd_t *mdhd)
{
	mdhd->version = quicktime_read_char(file);
	mdhd->flags = quicktime_read_int24(file);
	mdhd->creation_time = quicktime_read_int32(file);
	mdhd->modification_time = quicktime_read_int32(file);
	mdhd->time_scale = quicktime_read_int32(file);
	mdhd->duration = quicktime_read_int32(file);
	mdhd->language = quicktime_read_int16(file);
	mdhd->quality = quicktime_read_int16(file);
}
Exemplo n.º 8
0
int quicktime_read_hmhd(quicktime_t *file, quicktime_hmhd_t *hmhd)
{
    hmhd->version = quicktime_read_char(file);
    hmhd->flags = quicktime_read_int24(file);
    hmhd->maxPDUsize = quicktime_read_int16(file);
    hmhd->avgPDUsize = quicktime_read_int16(file);
    hmhd->maxbitrate = quicktime_read_int32(file);
    hmhd->avgbitrate = quicktime_read_int32(file);
    hmhd->slidingavgbitrate = quicktime_read_int32(file);

    return 0;
}
Exemplo n.º 9
0
void quicktime_read_elst(quicktime_t *file, quicktime_elst_t *elst)
{
	int i;
	elst->version = quicktime_read_char(file);
	elst->flags = quicktime_read_int24(file);
	elst->total_entries = quicktime_read_int32(file);
	elst->table = (quicktime_elst_table_t*)calloc(1, sizeof(quicktime_elst_table_t) * elst->total_entries);
	for(i = 0; i < elst->total_entries; i++)
	{
		quicktime_elst_table_init(&(elst->table[i]));
		quicktime_read_elst_table(file, &(elst->table[i]));
	}
}
Exemplo n.º 10
0
void quicktime_read_dref_table(quicktime_t *file, quicktime_dref_table_t *table)
{
	table->size = quicktime_read_int32(file);
	quicktime_read_char32(file, table->type);
	table->version = quicktime_read_char(file);
	table->flags = quicktime_read_int24(file);
	if(table->data_reference) free(table->data_reference);

	table->data_reference = malloc(table->size);
	if(table->size > 12)
		quicktime_read_data(file, table->data_reference, table->size - 12);
	table->data_reference[table->size - 12] = 0;
}
Exemplo n.º 11
0
void quicktime_read_dref(quicktime_t *file, quicktime_dref_t *dref)
{
	int i;

	dref->version = quicktime_read_char(file);
	dref->flags = quicktime_read_int24(file);
	dref->total_entries = quicktime_read_int32(file);
	dref->table = (quicktime_dref_table_t*)malloc(sizeof(quicktime_dref_table_t) * dref->total_entries);
	for(i = 0; i < dref->total_entries; i++)
	{
		quicktime_dref_table_init(&(dref->table[i]));
		quicktime_read_dref_table(file, &(dref->table[i]));
	}
}
Exemplo n.º 12
0
void quicktime_read_stts(quicktime_t *file, quicktime_stts_t *stts)
{
	int i;
	stts->version = quicktime_read_char(file);
	stts->flags = quicktime_read_int24(file);
	stts->total_entries = quicktime_read_int32(file);

	stts->table = (quicktime_stts_table_t*)malloc(sizeof(quicktime_stts_table_t) * stts->total_entries);
	for(i = 0; i < stts->total_entries; i++)
	{
		stts->table[i].sample_count = quicktime_read_int32(file);
		stts->table[i].sample_duration = quicktime_read_int32(file);
	}
}
Exemplo n.º 13
0
int quicktime_read_hdlr(quicktime_t *file, quicktime_hdlr_t *hdlr)
{
	hdlr->version = quicktime_read_char(file);
	hdlr->flags = quicktime_read_int24(file);
	quicktime_read_char32(file, hdlr->component_type);
	quicktime_read_char32(file, hdlr->component_subtype);
	hdlr->component_manufacturer = quicktime_read_int32(file);
	hdlr->component_flags = quicktime_read_int32(file);
	hdlr->component_flag_mask = quicktime_read_int32(file);
	if (file->use_mp4) {
		// TBD read null terminated string
	} else {
		quicktime_read_pascal(file, hdlr->component_name);
	}
}
Exemplo n.º 14
0
int quicktime_read_stsd(quicktime_t *file, quicktime_minf_t *minf, quicktime_stsd_t *stsd)
{
    int i;

    stsd->version = quicktime_read_char(file);
    stsd->flags = quicktime_read_int24(file);
    stsd->total_entries = quicktime_read_int32(file);
    stsd->table = (quicktime_stsd_table_t*)malloc(sizeof(quicktime_stsd_table_t) * stsd->total_entries);
    for(i = 0; i < stsd->total_entries; i++)
    {
        quicktime_stsd_table_init(&(stsd->table[i]));
        quicktime_read_stsd_table(file, minf, &(stsd->table[i]));
    }

    return 0;
}
Exemplo n.º 15
0
int quicktime_read_stsc(quicktime_t *file, quicktime_stsc_t *stsc)
{
	int i;
	stsc->version = quicktime_read_char(file);
	stsc->flags = quicktime_read_int24(file);
	stsc->total_entries = quicktime_read_int32(file);
	
	stsc->entries_allocated = stsc->total_entries;
	stsc->table = (quicktime_stsc_table_t*)malloc(sizeof(quicktime_stsc_table_t) * stsc->total_entries);
	for(i = 0; i < stsc->total_entries; i++)
	{
		stsc->table[i].chunk = quicktime_read_int32(file);
		stsc->table[i].samples = quicktime_read_int32(file);
		stsc->table[i].id = quicktime_read_int32(file);
	}
}
Exemplo n.º 16
0
Arquivo: stsz.c Projeto: cmjonze/faad
int quicktime_read_stsz(quicktime_t *file, quicktime_stsz_t *stsz)
{
	int i;
	stsz->version = quicktime_read_char(file);
	stsz->flags = quicktime_read_int24(file);
	stsz->sample_size = quicktime_read_int32(file);
	stsz->total_entries = quicktime_read_int32(file);
	stsz->entries_allocated = stsz->total_entries;
	if(!stsz->sample_size)
	{
		stsz->table = (quicktime_stsz_table_t*)malloc(sizeof(quicktime_stsz_table_t) * stsz->entries_allocated);
		for(i = 0; i < stsz->total_entries; i++)
		{
			stsz->table[i].size = quicktime_read_int32(file);
		}
	}
}
Exemplo n.º 17
0
Arquivo: tkhd.c Projeto: cmjonze/faad
int quicktime_read_tkhd(quicktime_t *file, quicktime_tkhd_t *tkhd)
{
	tkhd->version = quicktime_read_char(file);
	tkhd->flags = quicktime_read_int24(file);
	tkhd->creation_time = quicktime_read_int32(file);
	tkhd->modification_time = quicktime_read_int32(file);
	tkhd->track_id = quicktime_read_int32(file);
	tkhd->reserved1 = quicktime_read_int32(file);
	tkhd->duration = quicktime_read_int32(file);
	quicktime_read_data(file, tkhd->reserved2, 8);
	tkhd->layer = quicktime_read_int16(file);
	tkhd->alternate_group = quicktime_read_int16(file);
	tkhd->volume = quicktime_read_fixed16(file);
	tkhd->reserved3 = quicktime_read_int16(file);
	quicktime_read_matrix(file, &(tkhd->matrix));
	tkhd->track_width = quicktime_read_fixed32(file);
	tkhd->track_height = quicktime_read_fixed32(file);
}
Exemplo n.º 18
0
int quicktime_read_mvhd(quicktime_t *file, quicktime_mvhd_t *mvhd)
{
    mvhd->version = quicktime_read_char(file);
    mvhd->flags = quicktime_read_int24(file);
    mvhd->creation_time = quicktime_read_int32(file);
    mvhd->modification_time = quicktime_read_int32(file);
    mvhd->time_scale = quicktime_read_int32(file);
    mvhd->duration = quicktime_read_int32(file);
    mvhd->preferred_rate = quicktime_read_fixed32(file);
    mvhd->preferred_volume = quicktime_read_fixed16(file);
    quicktime_read_data(file, mvhd->reserved, 10);
    quicktime_read_matrix(file, &(mvhd->matrix));
    mvhd->preview_time = quicktime_read_int32(file);
    mvhd->preview_duration = quicktime_read_int32(file);
    mvhd->poster_time = quicktime_read_int32(file);
    mvhd->selection_time = quicktime_read_int32(file);
    mvhd->selection_duration = quicktime_read_int32(file);
    mvhd->current_time = quicktime_read_int32(file);
    mvhd->next_track_id = quicktime_read_int32(file);

    return 0;
}
Exemplo n.º 19
0
int quicktime_read_asf(quicktime_t *file)
{
	quicktime_asf_t *asf = calloc(1, sizeof(quicktime_asf_t));
	int got_header = 0;
	int debug = 1;
	int i;

	file->asf = asf;
	quicktime_set_position(file, 16 + 14);
	
	while(1)
	{
		quicktime_guid_t guid;
		int64_t guid_size;
		int64_t guid_start = quicktime_position(file);

		bzero(&guid, sizeof(guid));
		quicktime_read_guid(file, &guid);
		guid_size = quicktime_read_int64_le(file);

		printf("quicktime_read_asf start=0x%llx size=0x%llx\n", guid_start, guid_size);

// Glitch
		if(guid_size < 24) return 1;
		
		
		if(!memcmp(&guid, &file_header, sizeof(guid)))
		{
			quicktime_guid_t leaf_guid;
			got_header = 1;
			quicktime_read_guid(file, &leaf_guid);
			asf->header.file_size = quicktime_read_int64_le(file);
			asf->header.create_time = quicktime_read_int64_le(file);
			asf->header.total_packets = quicktime_read_int64_le(file);
			asf->header.send_time = quicktime_read_int64_le(file);
			asf->header.play_time = quicktime_read_int64_le(file);
			asf->header.preroll = quicktime_read_int32_le(file);
			asf->header.ignore = quicktime_read_int32_le(file);
			asf->header.flags = quicktime_read_int32_le(file);
			asf->header.min_packet = quicktime_read_int32_le(file);
			asf->header.max_packet = quicktime_read_int32_le(file);
			asf->header.max_bitrate = quicktime_read_int32_le(file);
			asf->header.packet_size = asf->header.max_packet;
		}
		else
		if(!memcmp(&guid, &index_guid, sizeof(guid)))
		{
			quicktime_guid_t leaf_guid;
			int max;
			int count;
			int total_packets = 0;

// Leaf Guid
			quicktime_read_guid(file, &leaf_guid);
// indexed interval
			quicktime_read_int64_le(file);
// max
			max = quicktime_read_int32_le(file);
// count
			asf->index_size = quicktime_read_int32_le(file);
			asf->index = calloc(sizeof(quicktime_asfpacket_t), asf->index_size);

			for(i = 0; i < asf->index_size; i++)
			{
				asf->index[i].number = quicktime_read_int32_le(file);
				asf->index[i].count = quicktime_read_int16_le(file);
			}
		}
		else
		if(!memcmp(&guid, &stream_header, sizeof(guid)))
		{
			quicktime_asfstream_t *stream = 
				asf->streams[asf->total_streams++] = 
				new_asfstream();
			quicktime_guid_t leaf_guid;
			quicktime_read_guid(file, &leaf_guid);
			if(!memcmp(&leaf_guid, &audio_stream, sizeof(leaf_guid)))
				stream->is_audio = 1;
			else
			if(!memcmp(&leaf_guid, &video_stream, sizeof(leaf_guid)))
				stream->is_video = 1;
			else
			if(!memcmp(&leaf_guid, &ext_stream_embed_stream_header, sizeof(leaf_guid)))
				stream->is_ext_audio = 1;
			quicktime_read_guid(file, &leaf_guid);
			
			stream->total_size = quicktime_read_int64_le(file);
			stream->type_specific_size = quicktime_read_int32_le(file);
			quicktime_read_int32_le(file);
			stream->id = quicktime_read_int16_le(file) & 0x7f;
			quicktime_read_int32_le(file);
			if(stream->is_ext_audio)
			{
				quicktime_read_guid(file, &leaf_guid);
                if (!memcmp(&leaf_guid, &ext_stream_audio_stream, sizeof(leaf_guid)))
				{
                    stream->is_audio = 1;
					stream->is_ext_audio = 0;
                    quicktime_read_guid(file, &leaf_guid);
                    quicktime_read_int32_le(file);
                    quicktime_read_int32_le(file);
                    quicktime_read_int32_le(file);
                    quicktime_read_guid(file, &leaf_guid);
                    quicktime_read_int32_le(file);
                }
			}
			
			
			if(stream->is_audio)
			{
// Get WAV header
				stream->codec_tag = quicktime_read_int16_le(file);
				stream->channels = quicktime_read_int16_le(file);
				stream->samplerate = quicktime_read_int32_le(file);
				stream->bitrate = quicktime_read_int32_le(file);
				stream->block_align = quicktime_read_int16_le(file);
				if(stream->type_specific_size == 14)
					stream->bits_per_sample = 8;
				else
					stream->bits_per_sample = quicktime_read_int16_le(file);
				if(stream->type_specific_size > 16)
				{
					stream->extradata_size = quicktime_read_int16_le(file);
        			if (stream->extradata_size > 0) 
					{
            			if (stream->extradata_size > stream->type_specific_size - 18)
                			stream->extradata_size = stream->type_specific_size - 18;
            			stream->extradata = calloc(1, stream->extradata_size + 1024);
            			quicktime_read_data(file, stream->extradata, stream->extradata_size);
        			}
					else
            			stream->extradata_size = 0;
					
					if(stream->type_specific_size - stream->extradata_size - 18 > 0)
						quicktime_set_position(file,
							quicktime_position(file) + 
							stream->type_specific_size - 
							stream->extradata_size - 18);
				}

// Make fourcc from codec_tag and bits_per_sample
			}
			else
			if(stream->is_video)
			{
				int size1;
				int size2;
				quicktime_read_int32_le(file);
				quicktime_read_int32_le(file);
				quicktime_read_char(file);
				size1 = quicktime_read_int16_le(file);
				size2 = quicktime_read_int32_le(file);
				stream->width = quicktime_read_int32_le(file);
				stream->height = quicktime_read_int32_le(file);
				quicktime_read_int16_le(file);
				stream->bits_per_sample = quicktime_read_int16_le(file);
				stream->codec_tag = quicktime_read_int32_le(file);
				quicktime_set_position(file, quicktime_position(file) + 20);
				if(size1 > 40)
				{
					stream->extradata_size = size1 - 40;
					stream->extradata = calloc(1, stream->extradata_size + 1024);
					quicktime_read_data(file, stream->extradata, stream->extradata_size);
				}

// Make fourcc from codec_tag
				stream->fourcc[0] = (stream->codec_tag & 0xff);
				stream->fourcc[1] = (stream->codec_tag & 0xff00) >> 8;
				stream->fourcc[2] = (stream->codec_tag & 0xff0000) >> 16;
				stream->fourcc[3] = (stream->codec_tag & 0xff000000) >> 24;
			}
		}
Exemplo n.º 20
0
void quicktime_read_stsd_video(quicktime_t *file,
                               quicktime_stsd_table_t *table,
                               quicktime_atom_t *parent_atom)
{
    quicktime_atom_t leaf_atom;
    int len;

    table->version = quicktime_read_int16(file);
    table->revision = quicktime_read_int16(file);
    quicktime_read_data(file, table->vendor, 4);
    table->temporal_quality = quicktime_read_int32(file);
    table->spatial_quality = quicktime_read_int32(file);
    table->width = quicktime_read_int16(file);
    table->height = quicktime_read_int16(file);
    table->dpi_horizontal = quicktime_read_fixed32(file);
    table->dpi_vertical = quicktime_read_fixed32(file);
    table->data_size = quicktime_read_int32(file);
    table->frames_per_sample = quicktime_read_int16(file);
    len = quicktime_read_char(file);
    quicktime_read_data(file, table->compressor_name, 31);
    table->depth = quicktime_read_int16(file);
    table->ctab_id = quicktime_read_int16(file);

    while(quicktime_position(file) < parent_atom->end)
    {
        quicktime_atom_read_header(file, &leaf_atom);
        /*
         * printf("quicktime_read_stsd_video 1 %llx %llx %llx %s\n",
         * leaf_atom.start, leaf_atom.end, quicktime_position(file),
         * leaf_atom.type);
         */


        if(quicktime_atom_is(&leaf_atom, "esds"))
        {
            quicktime_read_esds(file, &leaf_atom, &table->esds);
        }
        else if(quicktime_atom_is(&leaf_atom, "avcC"))
        {
            quicktime_read_avcc(file, &leaf_atom, &table->avcc);
        }
        else if(quicktime_atom_is(&leaf_atom, "ctab"))
        {
            quicktime_read_ctab(file, &(table->ctab));
        }
        else if(quicktime_atom_is(&leaf_atom, "gama"))
        {
            table->gamma = quicktime_read_fixed32(file);
        }
        else if(quicktime_atom_is(&leaf_atom, "fiel"))
        {
            table->fields = quicktime_read_char(file);
            table->field_dominance = quicktime_read_char(file);
        }
        else
            quicktime_atom_skip(file, &leaf_atom);


        /* 		if(quicktime_atom_is(&leaf_atom, "mjqt")) */
        /* 		{ */
        /* 			quicktime_read_mjqt(file, &(table->mjqt)); */
        /* 		} */
        /* 		else */
        /* 		if(quicktime_atom_is(&leaf_atom, "mjht")) */
        /* 		{ */
        /* 			quicktime_read_mjht(file, &(table->mjht)); */
        /* 		} */
        /* 		else */
    }
//printf("quicktime_read_stsd_video 2\n");
}
Exemplo n.º 21
0
void quicktime_read_stsd_video(quicktime_t *file, 
	quicktime_stsd_table_t *table, 
	quicktime_atom_t *parent_atom)
{
	quicktime_atom_t leaf_atom;
	int len;
	
	table->version = quicktime_read_int16(file);
	table->revision = quicktime_read_int16(file);
	quicktime_read_data(file, table->vendor, 4);
	table->temporal_quality = quicktime_read_int32(file);
	table->spatial_quality = quicktime_read_int32(file);
	table->width = quicktime_read_int16(file);
	table->height = quicktime_read_int16(file);
	table->dpi_horizontal = quicktime_read_fixed32(file);
	table->dpi_vertical = quicktime_read_fixed32(file);
	table->data_size = quicktime_read_int32(file);
	table->frames_per_sample = quicktime_read_int16(file);
	len = quicktime_read_char(file);
	quicktime_read_data(file, table->compressor_name, 31);
	table->depth = quicktime_read_int16(file);
	table->ctab_id = quicktime_read_int16(file);


/* The data needed for SVQ3 codec and maybe some others ? */
	struct ImageDescription *id;
	int stsd_size,fourcc,c,d;
	stsd_size = parent_atom->end - parent_atom->start;
	table->extradata_size = stsd_size - 4;
	id = (struct ImageDescription *) malloc(table->extradata_size);     // we do not include size
	table->extradata = (char *) id;
	
	memcpy(id->cType, table->format, 4);         // Fourcc
	id->version = table->version;
	id->revisionLevel = table->revision;
	memcpy(id->vendor, table->vendor, 4);     // I think mplayer screws up on this one, it turns bytes around! :)
	id->temporalQuality = table->temporal_quality;
	id->spatialQuality = table->spatial_quality;
	id->width = table->width;
	id->height = table->height;
	id->hRes = table->dpi_horizontal;
	id->vRes = table->dpi_vertical;
	id->dataSize = table->data_size;
	id->frameCount = table->frames_per_sample;
	id->name[0] = len;
	memcpy(&(id->name[1]), table->compressor_name, 31);
	id->depth = table->depth;
	id->clutID = table->ctab_id;
	if (quicktime_position(file) < parent_atom->end)
	{
		int position = quicktime_position(file);     // remember position
		int datalen = parent_atom->end - position;
		quicktime_read_data(file, ((char*)&id->clutID)+2, datalen);
		quicktime_set_position(file, position);      // return to previous position so parsing can go on
	}
	

	while(quicktime_position(file) < parent_atom->end)
	{
		quicktime_atom_read_header(file, &leaf_atom);
/*
 * printf("quicktime_read_stsd_video 1 %llx %llx %llx %s\n", 
 * leaf_atom.start, leaf_atom.end, quicktime_position(file),
 * leaf_atom.type);
 */


		if(quicktime_atom_is(&leaf_atom, "esds"))
		{
			quicktime_read_esds(file, &leaf_atom, &table->esds);
		}
		else
		if(quicktime_atom_is(&leaf_atom, "avcC"))
		{
			quicktime_read_avcc(file, &leaf_atom, &table->avcc);
		}
		else
		if(quicktime_atom_is(&leaf_atom, "ctab"))
		{
			quicktime_read_ctab(file, &(table->ctab));
		}
		else
		if(quicktime_atom_is(&leaf_atom, "gama"))
		{
			table->gamma = quicktime_read_fixed32(file);
		}
		else
		if(quicktime_atom_is(&leaf_atom, "fiel"))
		{
			table->fields = quicktime_read_char(file);
			table->field_dominance = quicktime_read_char(file);
		}
		else
			quicktime_atom_skip(file, &leaf_atom);


/* 		if(quicktime_atom_is(&leaf_atom, "mjqt")) */
/* 		{ */
/* 			quicktime_read_mjqt(file, &(table->mjqt)); */
/* 		} */
/* 		else */
/* 		if(quicktime_atom_is(&leaf_atom, "mjht")) */
/* 		{ */
/* 			quicktime_read_mjht(file, &(table->mjht)); */
/* 		} */
/* 		else */
	}
//printf("quicktime_read_stsd_video 2\n");
}
Exemplo n.º 22
0
void quicktime_read_pascal(quicktime_t *file, char *data)
{
	char len = quicktime_read_char(file);
	quicktime_read_data(file, data, len);
	data[len] = 0;
}