hvirtual/libmpeg3/libmpeg3.c File Reference

#include "libmpeg3.h"
#include "mpeg3private.h"
#include "mpeg3protos.h"
#include <errno.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>

Include dependency graph for libmpeg3.c:

Go to the source code of this file.

Functions

int mpeg3_major ()
int mpeg3_minor ()
int mpeg3_release ()
mpeg3_tmpeg3_new (char *path)
mpeg3_index_tmpeg3_new_index ()
void mpeg3_delete_index (mpeg3_index_t *index)
int mpeg3_delete (mpeg3_t *file)
int mpeg3_check_sig (char *path)
static int is_toc (uint32_t bits)
static int is_ifo (uint32_t bits)
static int is_transport (uint32_t bits)
static int is_bd (uint32_t bits1, uint32_t bits2)
static int is_program (uint32_t bits)
static int is_mpeg_audio (uint32_t bits)
static int is_mpeg_video (uint32_t bits)
static int is_ac3 (uint32_t bits)
static int calculate_packet_size (int is_transport, int is_program, int is_audio, int is_video, int is_bd)
int mpeg3_get_file_type (mpeg3_t *file, mpeg3_t *old_file, int *toc_atracks, int *toc_vtracks)
static void copy_subtitles (mpeg3_t *file, mpeg3_t *old_file)
mpeg3_tmpeg3_open_copy (char *path, mpeg3_t *old_file, int *error_return)
mpeg3_tmpeg3_open (char *path, int *error_return)
int mpeg3_close (mpeg3_t *file)
int mpeg3_set_cpus (mpeg3_t *file, int cpus)
int mpeg3_has_audio (mpeg3_t *file)
int mpeg3_total_astreams (mpeg3_t *file)
int mpeg3_audio_channels (mpeg3_t *file, int stream)
int mpeg3_sample_rate (mpeg3_t *file, int stream)
long mpeg3_get_sample (mpeg3_t *file, int stream)
int mpeg3_set_sample (mpeg3_t *file, long sample, int stream)
long mpeg3_audio_samples (mpeg3_t *file, int stream)
char * mpeg3_audio_format (mpeg3_t *file, int stream)
int mpeg3_has_video (mpeg3_t *file)
int mpeg3_total_vstreams (mpeg3_t *file)
int mpeg3_video_width (mpeg3_t *file, int stream)
int mpeg3_video_height (mpeg3_t *file, int stream)
float mpeg3_aspect_ratio (mpeg3_t *file, int stream)
double mpeg3_frame_rate (mpeg3_t *file, int stream)
long mpeg3_video_frames (mpeg3_t *file, int stream)
long mpeg3_get_frame (mpeg3_t *file, int stream)
int mpeg3_set_frame (mpeg3_t *file, long frame, int stream)
int mpeg3_seek_byte (mpeg3_t *file, int64_t byte)
int mpeg3_previous_frame (mpeg3_t *file, int stream)
int64_t mpeg3_tell_byte (mpeg3_t *file)
int64_t mpeg3_get_bytes (mpeg3_t *file)
double mpeg3_get_time (mpeg3_t *file)
int mpeg3_end_of_audio (mpeg3_t *file, int stream)
int mpeg3_end_of_video (mpeg3_t *file, int stream)
int mpeg3_drop_frames (mpeg3_t *file, long frames, int stream)
int mpeg3_colormodel (mpeg3_t *file, int stream)
int mpeg3_set_rowspan (mpeg3_t *file, int bytes, int stream)
int mpeg3_read_frame (mpeg3_t *file, unsigned char **output_rows, int in_x, int in_y, int in_w, int in_h, int out_w, int out_h, int color_model, int stream)
int mpeg3_read_yuvframe (mpeg3_t *file, char *y_output, char *u_output, char *v_output, int in_x, int in_y, int in_w, int in_h, int stream)
int mpeg3_read_yuvframe_ptr (mpeg3_t *file, char **y_output, char **u_output, char **v_output, int stream)
int mpeg3_read_audio (mpeg3_t *file, float *output_f, short *output_i, int channel, long samples, int stream)
int mpeg3_reread_audio (mpeg3_t *file, float *output_f, short *output_i, int channel, long samples, int stream)
int mpeg3_read_audio_chunk (mpeg3_t *file, unsigned char *output, long *size, long max_size, int stream)
int mpeg3_read_video_chunk (mpeg3_t *file, unsigned char *output, long *size, long max_size, int stream)
int64_t mpeg3_memory_usage (mpeg3_t *file)


Function Documentation

static int calculate_packet_size ( int  is_transport,
int  is_program,
int  is_audio,
int  is_video,
int  is_bd 
) [static]

Definition at line 249 of file libmpeg3.c.

References MPEG3_BD_PACKET_SIZE, MPEG3_DVD_PACKET_SIZE, and MPEG3_TS_PACKET_SIZE.

Referenced by mpeg3_get_file_type().

static void copy_subtitles ( mpeg3_t file,
mpeg3_t old_file 
) [static]

Definition at line 387 of file libmpeg3.c.

References mpeg3_t::have_palette, mpeg3_strack_t::id, memcpy, mpeg3_copy_strack(), mpeg3_new_strack(), mpeg3_t::palette, mpeg3_t::strack, and mpeg3_t::total_sstreams.

Referenced by mpeg3_open_copy().

Here is the call graph for this function:

static int is_ac3 ( uint32_t  bits  )  [static]

Definition at line 244 of file libmpeg3.c.

References MPEG3_AC3_START_CODE.

Referenced by mpeg3_get_file_type().

static int is_bd ( uint32_t  bits1,
uint32_t  bits2 
) [static]

Definition at line 220 of file libmpeg3.c.

References MPEG3_SYNC_BYTE.

Referenced by mpeg3_get_file_type().

static int is_ifo ( uint32_t  bits  )  [static]

Definition at line 210 of file libmpeg3.c.

References MPEG3_IFO_PREFIX.

Referenced by mpeg3_get_file_type().

static int is_mpeg_audio ( uint32_t  bits  )  [static]

Definition at line 230 of file libmpeg3.c.

References MPEG3_ID3_PREFIX, and MPEG3_RIFF_CODE.

Referenced by mpeg3_get_file_type().

static int is_mpeg_video ( uint32_t  bits  )  [static]

Definition at line 238 of file libmpeg3.c.

References MPEG3_PICTURE_START_CODE, and MPEG3_SEQUENCE_START_CODE.

Referenced by mpeg3_get_file_type().

static int is_program ( uint32_t  bits  )  [static]

Definition at line 225 of file libmpeg3.c.

References MPEG3_PACK_START_CODE.

Referenced by mpeg3_get_file_type().

static int is_toc ( uint32_t  bits  )  [static]

Definition at line 204 of file libmpeg3.c.

References MPEG3_TOC_PREFIX.

Referenced by mpeg3_get_file_type().

static int is_transport ( uint32_t  bits  )  [static]

Definition at line 215 of file libmpeg3.c.

References MPEG3_SYNC_BYTE.

Referenced by mpeg3_get_file_type().

float mpeg3_aspect_ratio ( mpeg3_t file,
int  stream 
)

int mpeg3_audio_channels ( mpeg3_t file,
int  stream 
)

char* mpeg3_audio_format ( mpeg3_t file,
int  stream 
)

Definition at line 623 of file libmpeg3.c.

References mpeg3_t::atrack, AUDIO_AAC, AUDIO_AC3, AUDIO_JESUS, AUDIO_MPEG, AUDIO_PCM, AUDIO_UNKNOWN, and mpeg3_atrack_t::format.

Referenced by main().

long mpeg3_audio_samples ( mpeg3_t file,
int  stream 
)

int mpeg3_check_sig ( char *  path  ) 

int mpeg3_close ( mpeg3_t file  ) 

Definition at line 551 of file libmpeg3.c.

References mpeg3_delete().

Referenced by FileMPEG::close_file(), FileMPEG::create_index(), FileMPEG::get_info(), main(), mpeg2enc(), and mpeg3_generate_toc().

Here is the call graph for this function:

int mpeg3_colormodel ( mpeg3_t file,
int  stream 
)

Definition at line 845 of file libmpeg3.c.

References mpeg3video_colormodel(), mpeg3_t::total_vstreams, mpeg3_vtrack_t::video, and mpeg3_t::vtrack.

Referenced by main(), FileMPEG::open_file(), and FileMPEG::read_frame().

Here is the call graph for this function:

int mpeg3_delete ( mpeg3_t file  ) 

void mpeg3_delete_index ( mpeg3_index_t index  ) 

Definition at line 49 of file libmpeg3.c.

References mpeg3_index_t::index_channels, and mpeg3_index_t::index_data.

Referenced by mpeg3_delete().

int mpeg3_drop_frames ( mpeg3_t file,
long  frames,
int  stream 
)

int mpeg3_end_of_audio ( mpeg3_t file,
int  stream 
)

Definition at line 813 of file libmpeg3.c.

References mpeg3_t::atrack, mpeg3_atrack_t::channels, mpeg3_atrack_t::demuxer, and mpeg3demux_eof().

Referenced by main().

Here is the call graph for this function:

int mpeg3_end_of_video ( mpeg3_t file,
int  stream 
)

Definition at line 821 of file libmpeg3.c.

References mpeg3_vtrack_t::demuxer, mpeg3demux_eof(), and mpeg3_t::vtrack.

Referenced by main(), and read_mpeg().

Here is the call graph for this function:

double mpeg3_frame_rate ( mpeg3_t file,
int  stream 
)

int64_t mpeg3_get_bytes ( mpeg3_t file  ) 

Definition at line 768 of file libmpeg3.c.

References mpeg3_t::demuxer, and mpeg3demux_movie_size().

Referenced by FileMPEG::get_info(), and mpeg3_get_time().

Here is the call graph for this function:

int mpeg3_get_file_type ( mpeg3_t file,
mpeg3_t old_file,
int *  toc_atracks,
int *  toc_vtracks 
)

long mpeg3_get_frame ( mpeg3_t file,
int  stream 
)

Definition at line 689 of file libmpeg3.c.

References mpeg3_vtrack_t::current_position, mpeg3_t::total_vstreams, and mpeg3_t::vtrack.

Referenced by read_mpeg().

long mpeg3_get_sample ( mpeg3_t file,
int  stream 
)

double mpeg3_get_time ( mpeg3_t file  ) 

int mpeg3_has_audio ( mpeg3_t file  ) 

Definition at line 567 of file libmpeg3.c.

References mpeg3_t::total_astreams.

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

int mpeg3_has_video ( mpeg3_t file  ) 

Definition at line 640 of file libmpeg3.c.

References mpeg3_t::total_vstreams.

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

int mpeg3_major (  ) 

Definition at line 11 of file libmpeg3.c.

References MPEG3_MAJOR.

Referenced by AboutPrefs::create_objects(), and main().

int64_t mpeg3_memory_usage ( mpeg3_t file  ) 

Definition at line 1039 of file libmpeg3.c.

References mpeg3_vtrack_t::frame_cache, mpeg3_cache_usage(), mpeg3_t::total_vstreams, and mpeg3_t::vtrack.

Referenced by FileMPEG::get_memory_usage().

Here is the call graph for this function:

int mpeg3_minor (  ) 

Definition at line 16 of file libmpeg3.c.

References MPEG3_MINOR.

Referenced by AboutPrefs::create_objects(), and main().

mpeg3_t* mpeg3_new ( char *  path  ) 

Definition at line 28 of file libmpeg3.c.

References mpeg3_t::cpus, mpeg3_t::demuxer, mpeg3_t::fs, mpeg3_t::index_bytes, mpeg3_new_demuxer(), mpeg3_new_fs(), mpeg3_t::seekable, and mpeg3_t::subtitle_track.

Referenced by mpeg3_open_copy(), and mpeg3_start_toc().

Here is the call graph for this function:

mpeg3_index_t* mpeg3_new_index (  ) 

Definition at line 42 of file libmpeg3.c.

References mpeg3_index_t::index_zoom.

Referenced by mpeg3_do_toc(), and mpeg3_read_toc().

mpeg3_t* mpeg3_open ( char *  path,
int *  error_return 
)

Definition at line 546 of file libmpeg3.c.

References mpeg3_open_copy().

Referenced by FileMPEG::create_index(), FileMPEG::get_info(), main(), mpeg3_generate_toc(), FileMPEG::open_file(), and readcmdline().

Here is the call graph for this function:

mpeg3_t* mpeg3_open_copy ( char *  path,
mpeg3_t old_file,
int *  error_return 
)

int mpeg3_previous_frame ( mpeg3_t file,
int  stream 
)

Definition at line 742 of file libmpeg3.c.

References mpeg3_t::last_stream_read, mpeg3_t::last_type_read, mpeg3video_previous_frame(), mpeg3_t::total_vstreams, mpeg3_vtrack_t::video, and mpeg3_t::vtrack.

Here is the call graph for this function:

int mpeg3_read_audio ( mpeg3_t file,
float *  output_f,
short *  output_i,
int  channel,
long  samples,
int  stream 
)

int mpeg3_read_audio_chunk ( mpeg3_t file,
unsigned char *  output,
long *  size,
long  max_size,
int  stream 
)

Definition at line 999 of file libmpeg3.c.

References mpeg3_t::atrack, mpeg3_atrack_t::audio, mpeg3_t::last_stream_read, mpeg3_t::last_type_read, mpeg3audio_read_raw(), and mpeg3_t::total_astreams.

Referenced by main().

Here is the call graph for this function:

int mpeg3_read_frame ( mpeg3_t file,
unsigned char **  output_rows,
int  in_x,
int  in_y,
int  in_w,
int  in_h,
int  out_w,
int  out_h,
int  color_model,
int  stream 
)

int mpeg3_read_video_chunk ( mpeg3_t file,
unsigned char *  output,
long *  size,
long  max_size,
int  stream 
)

Definition at line 1018 of file libmpeg3.c.

References mpeg3_t::last_stream_read, mpeg3_t::last_type_read, mpeg3video_read_raw(), mpeg3_t::total_vstreams, mpeg3_vtrack_t::video, and mpeg3_t::vtrack.

Referenced by main().

Here is the call graph for this function:

int mpeg3_read_yuvframe ( mpeg3_t file,
char *  y_output,
char *  u_output,
char *  v_output,
int  in_x,
int  in_y,
int  in_w,
int  in_h,
int  stream 
)

int mpeg3_read_yuvframe_ptr ( mpeg3_t file,
char **  y_output,
char **  u_output,
char **  v_output,
int  stream 
)

int mpeg3_release (  ) 

Definition at line 21 of file libmpeg3.c.

References MPEG3_RELEASE.

Referenced by AboutPrefs::create_objects(), and main().

int mpeg3_reread_audio ( mpeg3_t file,
float *  output_f,
short *  output_i,
int  channel,
long  samples,
int  stream 
)

Definition at line 975 of file libmpeg3.c.

References mpeg3_t::atrack, mpeg3_atrack_t::current_position, mpeg3_t::last_stream_read, mpeg3_t::last_type_read, mpeg3_read_audio(), mpeg3_set_sample(), and mpeg3_t::total_astreams.

Referenced by main().

Here is the call graph for this function:

int mpeg3_sample_rate ( mpeg3_t file,
int  stream 
)

int mpeg3_seek_byte ( mpeg3_t file,
int64_t  byte 
)

int mpeg3_set_cpus ( mpeg3_t file,
int  cpus 
)

Definition at line 558 of file libmpeg3.c.

References mpeg3_t::cpus, mpeg3video_set_cpus(), mpeg3_t::total_vstreams, mpeg3_vtrack_t::video, and mpeg3_t::vtrack.

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

Here is the call graph for this function:

int mpeg3_set_frame ( mpeg3_t file,
long  frame,
int  stream 
)

Definition at line 697 of file libmpeg3.c.

References mpeg3_vtrack_t::current_position, mpeg3video_seek_frame(), mpeg3_t::total_vstreams, mpeg3_vtrack_t::video, and mpeg3_t::vtrack.

Referenced by FileMPEG::set_video_position().

Here is the call graph for this function:

int mpeg3_set_rowspan ( mpeg3_t file,
int  bytes,
int  stream 
)

int mpeg3_set_sample ( mpeg3_t file,
long  sample,
int  stream 
)

int64_t mpeg3_tell_byte ( mpeg3_t file  ) 

int mpeg3_total_astreams ( mpeg3_t file  ) 

Definition at line 572 of file libmpeg3.c.

References mpeg3_t::total_astreams.

Referenced by main(), FileMPEG::open_file(), and FileMPEG::to_streamchannel().

int mpeg3_total_vstreams ( mpeg3_t file  ) 

Definition at line 645 of file libmpeg3.c.

References mpeg3_t::total_vstreams.

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

long mpeg3_video_frames ( mpeg3_t file,
int  stream 
)

int mpeg3_video_height ( mpeg3_t file,
int  stream 
)

Definition at line 658 of file libmpeg3.c.

References mpeg3_vtrack_t::height, mpeg3_t::total_vstreams, and mpeg3_t::vtrack.

Referenced by main(), FileMPEG::open_file(), and readcmdline().

int mpeg3_video_width ( mpeg3_t file,
int  stream 
)

Definition at line 650 of file libmpeg3.c.

References mpeg3_t::total_vstreams, mpeg3_t::vtrack, and mpeg3_vtrack_t::width.

Referenced by main(), FileMPEG::open_file(), and readcmdline().


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