hvirtual/libmpeg3/mpeg3tocutil.c File Reference

#include "libmpeg3.h"
#include "mpeg3protos.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>

Include dependency graph for mpeg3tocutil.c:

Go to the source code of this file.

Defines

#define PUT_INT32(x)
#define PUT_INT64(x)

Functions

static uint32_t read_int32 (unsigned char *buffer, int *position)
static uint64_t read_int64 (unsigned char *buffer, int *position)
static int read_data (unsigned char *buffer, int *position, unsigned char *output, int bytes)
static void complete_path (char *result, char *toc_path, char *path)
int mpeg3_read_toc (mpeg3_t *file, int *atracks_return, int *vtracks_return)
mpeg3_tmpeg3_start_toc (char *path, char *toc_path, int64_t *total_bytes)
void mpeg3_set_index_bytes (mpeg3_t *file, int64_t bytes)
static void divide_index (mpeg3_t *file, int track_number)
int mpeg3_update_index (mpeg3_t *file, int track_number, int flush)
static int handle_audio (mpeg3_t *file, int track_number)
static int handle_video (mpeg3_t *file, mpeg3_vtrack_t *vtrack)
static void handle_subtitle (mpeg3_t *file)
int mpeg3_do_toc (mpeg3_t *file, int64_t *bytes_processed)
void mpeg3_stop_toc (mpeg3_t *file)
int mpeg3_index_tracks (mpeg3_t *file)
int mpeg3_index_channels (mpeg3_t *file, int track)
int mpeg3_index_zoom (mpeg3_t *file)
int mpeg3_index_size (mpeg3_t *file, int track)
float * mpeg3_index_data (mpeg3_t *file, int track, int channel)
int mpeg3_has_toc (mpeg3_t *file)
char * mpeg3_title_path (mpeg3_t *file, int number)
int64_t mpeg3_get_source_date (mpeg3_t *file)
int64_t mpeg3_calculate_source_date (char *path)


Define Documentation

#define PUT_INT32 (  ) 

Value:

{ \
        uint32_t temp = x; \
        if(MPEG3_LITTLE_ENDIAN) \
        { \
                fputc(((unsigned char*)&temp)[3], file->toc_fd); \
                fputc(((unsigned char*)&temp)[2], file->toc_fd); \
                fputc(((unsigned char*)&temp)[1], file->toc_fd); \
                fputc(((unsigned char*)&temp)[0], file->toc_fd); \
        } \
        else \
        { \
                fwrite(&temp, 1, 4, file->toc_fd); \
        } \
}

Definition at line 12 of file mpeg3tocutil.c.

Referenced by mpeg3_stop_toc().

#define PUT_INT64 (  ) 

Value:

{ \
        uint64_t temp = x; \
        if(MPEG3_LITTLE_ENDIAN) \
        { \
                fputc(((unsigned char*)&temp)[7], file->toc_fd); \
                fputc(((unsigned char*)&temp)[6], file->toc_fd); \
                fputc(((unsigned char*)&temp)[5], file->toc_fd); \
                fputc(((unsigned char*)&temp)[4], file->toc_fd); \
                fputc(((unsigned char*)&temp)[3], file->toc_fd); \
                fputc(((unsigned char*)&temp)[2], file->toc_fd); \
                fputc(((unsigned char*)&temp)[1], file->toc_fd); \
                fputc(((unsigned char*)&temp)[0], file->toc_fd); \
        } \
        else \
        { \
                fwrite(&temp, 1, 8, file->toc_fd); \
        } \
}

Definition at line 31 of file mpeg3tocutil.c.

Referenced by mpeg3_stop_toc().


Function Documentation

static void complete_path ( char *  result,
char *  toc_path,
char *  path 
) [static]

Definition at line 116 of file mpeg3tocutil.c.

References strrchr.

Referenced by get_ifo_playlist(), mpeg3_generate_toc(), and mpeg3_read_toc().

static void divide_index ( mpeg3_t file,
int  track_number 
) [static]

static int handle_audio ( mpeg3_t file,
int  track_number 
) [static]

static void handle_subtitle ( mpeg3_t file  )  [static]

static int handle_video ( mpeg3_t file,
mpeg3_vtrack_t vtrack 
) [static]

int64_t mpeg3_calculate_source_date ( char *  path  ) 

Definition at line 1416 of file mpeg3tocutil.c.

Referenced by mpeg3_read_toc(), and mpeg3_start_toc().

int mpeg3_do_toc ( mpeg3_t file,
int64_t *  bytes_processed 
)

int64_t mpeg3_get_source_date ( mpeg3_t file  ) 

Definition at line 1411 of file mpeg3tocutil.c.

References mpeg3_t::source_date.

int mpeg3_has_toc ( mpeg3_t file  ) 

Definition at line 1396 of file mpeg3tocutil.c.

References mpeg3_t::frame_offsets, and mpeg3_t::sample_offsets.

Referenced by FileMPEG::create_index().

int mpeg3_index_channels ( mpeg3_t file,
int  track 
)

float* mpeg3_index_data ( mpeg3_t file,
int  track,
int  channel 
)

Definition at line 1389 of file mpeg3tocutil.c.

References mpeg3_index_t::index_data, mpeg3_t::indexes, and mpeg3_t::total_indexes.

Referenced by FileMPEG::get_index().

int mpeg3_index_size ( mpeg3_t file,
int  track 
)

Definition at line 1383 of file mpeg3tocutil.c.

References mpeg3_index_t::index_size, mpeg3_t::indexes, and mpeg3_t::total_indexes.

Referenced by FileMPEG::get_index().

int mpeg3_index_tracks ( mpeg3_t file  ) 

Definition at line 1365 of file mpeg3tocutil.c.

References mpeg3_t::total_indexes.

Referenced by FileMPEG::get_index().

int mpeg3_index_zoom ( mpeg3_t file  ) 

Definition at line 1376 of file mpeg3tocutil.c.

References mpeg3_index_t::index_zoom, mpeg3_t::indexes, and mpeg3_t::total_indexes.

Referenced by FileMPEG::get_index().

int mpeg3_read_toc ( mpeg3_t file,
int *  atracks_return,
int *  vtracks_return 
)

Definition at line 134 of file mpeg3tocutil.c.

References mpeg3_strack_t::allocated_offsets, mpeg3_demuxer_t::astream_table, ATRACK_COUNT, mpeg3_t::audio_eof, mpeg3_title_t::cell_table, mpeg3_title_t::cell_table_allocation, mpeg3_title_t::cell_table_size, mpeg3_t::channel_counts, complete_path(), debug, mpeg3_t::demuxer, mpeg3_title_t::end_byte, fclose(), FILE_INFO, FILE_TYPE_AUDIO, FILE_TYPE_PROGRAM, FILE_TYPE_TRANSPORT, FILE_TYPE_VIDEO, fopen(), fprintf, mpeg3_t::frame_offsets, mpeg3_t::fs, mpeg3_t::have_palette, IFO_PALETTE, mpeg3_index_t::index_channels, mpeg3_index_t::index_data, mpeg3_index_t::index_size, mpeg3_index_t::index_zoom, mpeg3_t::indexes, mpeg3_t::is_audio_stream, mpeg3_t::is_bd, mpeg3_t::is_program_stream, mpeg3_t::is_transport_stream, mpeg3_t::is_video_stream, mpeg3_t::keyframe_numbers, memcpy, mpeg3_calculate_source_date(), MPEG3_INVALID_TOC_VERSION, mpeg3_new_index(), mpeg3_new_strack(), mpeg3_new_title(), MPEG3_STRLEN, MPEG3_TOC_DATE_MISMATCH, MPEG3_TOC_VERSION, mpeg3demux_open_title(), mpeg3io_read_data(), mpeg3io_seek(), mpeg3io_total_bytes, mpeg3_strack_t::offsets, mpeg3_t::palette, mpeg3_fs_t::path, mpeg3_cell_t::program, mpeg3_cell_t::program_end, mpeg3_cell_t::program_start, read_data(), read_int32(), read_int64(), RENDERFARM_FS_PREFIX, mpeg3_t::sample_offsets, mpeg3_t::source_date, mpeg3_title_t::start_byte, mpeg3_t::strack, STRACK_COUNT, STREAM_AUDIO, STREAM_VIDEO, strrchr, mpeg3_cell_t::title_end, TITLE_PATH, mpeg3_cell_t::title_start, mpeg3_demuxer_t::titles, mpeg3_title_t::total_bytes, mpeg3_t::total_frame_offsets, mpeg3_t::total_indexes, mpeg3_t::total_keyframe_numbers, mpeg3_strack_t::total_offsets, mpeg3_t::total_sample_offsets, mpeg3_t::total_samples, mpeg3_t::total_sstreams, mpeg3_demuxer_t::total_titles, mpeg3_t::video_eof, mpeg3_demuxer_t::vstream_table, and VTRACK_COUNT.

Referenced by mpeg3_get_file_type().

Here is the call graph for this function:

void mpeg3_set_index_bytes ( mpeg3_t file,
int64_t  bytes 
)

Definition at line 560 of file mpeg3tocutil.c.

References mpeg3_t::index_bytes.

mpeg3_t* mpeg3_start_toc ( char *  path,
char *  toc_path,
int64_t *  total_bytes 
)

void mpeg3_stop_toc ( mpeg3_t file  ) 

Definition at line 1094 of file mpeg3tocutil.c.

References mpeg3_demuxer_t::astream_table, mpeg3_t::atrack, ATRACK_COUNT, mpeg3_atrack_t::audio_eof, mpeg3_title_t::cell_table, mpeg3_title_t::cell_table_size, mpeg3_atrack_t::channels, mpeg3_atrack_t::current_position, mpeg3_t::demuxer, divide_index(), fclose(), FILE_INFO, FILE_TYPE_AUDIO, FILE_TYPE_PROGRAM, FILE_TYPE_TRANSPORT, FILE_TYPE_VIDEO, fprintf, fputc(), mpeg3_vtrack_t::frame_offsets, mpeg3_title_t::fs, mpeg3_t::fs, fwrite(), mpeg3_strack_t::id, IFO_PALETTE, mpeg3_index_t::index_data, mpeg3_index_t::index_size, mpeg3_index_t::index_zoom, mpeg3_t::indexes, mpeg3_t::is_audio_stream, mpeg3_t::is_program_stream, mpeg3_t::is_transport_stream, mpeg3_t::is_video_stream, mpeg3_vtrack_t::keyframe_numbers, mpeg3_append_samples(), mpeg3_delete(), MPEG3_MAX_STREAMS, MPEG3_STRLEN, MPEG3_TOC_VERSION, mpeg3_update_index(), mpeg3_strack_t::offsets, mpeg3_t::palette, mpeg3_fs_t::path, mpeg3_vtrack_t::pid, mpeg3_atrack_t::pid, mpeg3_atrack_t::prev_offset, mpeg3_cell_t::program, mpeg3_cell_t::program_end, mpeg3_cell_t::program_start, PUT_INT32, PUT_INT64, mpeg3_atrack_t::sample_offsets, mpeg3_t::source_date, mpeg3_t::strack, STRACK_COUNT, STREAM_AUDIO, STREAM_VIDEO, mpeg3_cell_t::title_end, TITLE_PATH, mpeg3_cell_t::title_start, mpeg3_demuxer_t::titles, mpeg3_t::toc_fd, mpeg3_t::total_astreams, mpeg3_title_t::total_bytes, mpeg3_vtrack_t::total_frame_offsets, mpeg3_vtrack_t::total_keyframe_numbers, mpeg3_strack_t::total_offsets, mpeg3_atrack_t::total_sample_offsets, mpeg3_t::total_sstreams, mpeg3_demuxer_t::total_titles, mpeg3_t::total_vstreams, mpeg3_vtrack_t::video_eof, mpeg3_demuxer_t::vstream_table, mpeg3_t::vtrack, and VTRACK_COUNT.

Referenced by FileMPEG::create_index(), and main().

Here is the call graph for this function:

char* mpeg3_title_path ( mpeg3_t file,
int  number 
)

int mpeg3_update_index ( mpeg3_t file,
int  track_number,
int  flush 
)

static int read_data ( unsigned char *  buffer,
int *  position,
unsigned char *  output,
int  bytes 
) [static]

Definition at line 105 of file mpeg3tocutil.c.

References memcpy.

Referenced by mpeg3_read_toc().

static uint32_t read_int32 ( unsigned char *  buffer,
int *  position 
) [static]

Definition at line 52 of file mpeg3tocutil.c.

References MPEG3_LITTLE_ENDIAN.

Referenced by mpeg3_read_toc(), read_avi_markers(), and read_quicktime_markers().

static uint64_t read_int64 ( unsigned char *  buffer,
int *  position 
) [static]

Definition at line 75 of file mpeg3tocutil.c.

References MPEG3_LITTLE_ENDIAN.

Referenced by mpeg3_read_toc().


Generated on Mon Apr 28 13:59:48 2008 for Cinelerra by  doxygen 1.5.5