comparison libmpdemux/stheader.h @ 7467:3a22c16fea46

- cosmetics, reorder - removed sh_video->image, get_sh_video()/get_sh_audio() - they are unused and confusing
author arpi
date Sat, 21 Sep 2002 23:23:03 +0000
parents f83050f59e23
children 5e56ce70b551
comparison
equal deleted inserted replaced
7466:02db452ea5c8 7467:3a22c16fea46
9 9
10 #include "../libmpcodecs/mp_image.h" 10 #include "../libmpcodecs/mp_image.h"
11 11
12 typedef struct { 12 typedef struct {
13 demux_stream_t *ds; 13 demux_stream_t *ds;
14 struct codecs_st *codec;
14 unsigned int format; 15 unsigned int format;
15 struct codecs_st *codec;
16 int inited; 16 int inited;
17 float timer; // value of old a_frame
17 // output format: 18 // output format:
18 float timer; // value of old a_frame 19 int sample_format;
19 int samplerate; 20 int samplerate;
20 int samplesize; 21 int samplesize;
21 int channels; 22 int channels;
22 int o_bps; // == samplerate*samplesize*channels (uncompr. bytes/sec) 23 int o_bps; // == samplerate*samplesize*channels (uncompr. bytes/sec)
23 int i_bps; // == bitrate (compressed bytes/sec) 24 int i_bps; // == bitrate (compressed bytes/sec)
24 // in buffers: 25 // in buffers:
26 int audio_in_minsize;
25 char* a_in_buffer; 27 char* a_in_buffer;
26 int a_in_buffer_len; 28 int a_in_buffer_len;
27 int a_in_buffer_size; 29 int a_in_buffer_size;
28 // out buffers: 30 // out buffers:
31 int audio_out_minsize;
29 char* a_buffer; 32 char* a_buffer;
30 int a_buffer_len; 33 int a_buffer_len;
31 int a_buffer_size; 34 int a_buffer_size;
32 int sample_format; 35 // win32-compatible codec parameters:
33 // win32 codec stuff:
34 AVIStreamHeader audio; 36 AVIStreamHeader audio;
35 WAVEFORMATEX *wf; 37 WAVEFORMATEX* wf;
36 int audio_in_minsize; 38 // codec-specific:
37 int audio_out_minsize;
38 // other codecs:
39 void* context; // codec-specific stuff (usually HANDLE or struct pointer) 39 void* context; // codec-specific stuff (usually HANDLE or struct pointer)
40 unsigned char *codecdata; 40 unsigned char* codecdata; // extra header data passed from demuxer to codec
41 int codecdata_len; 41 int codecdata_len;
42 } sh_audio_t; 42 } sh_audio_t;
43 43
44 typedef struct { 44 typedef struct {
45 demux_stream_t *ds; 45 demux_stream_t *ds;
46 struct codecs_st *codec;
46 unsigned int format; 47 unsigned int format;
47 struct codecs_st *codec;
48 int inited; 48 int inited;
49 // output format: 49 float timer; // value of old v_frame
50 float timer; // value of old v_frame 50 // frame counters:
51 float fps; 51 float num_frames; // number of frames played
52 float frametime; // 1/fps 52 int num_frames_decoded; // number of frames decoded
53 int i_bps; // == bitrate (compressed bytes/sec) 53 // output format: (set by demuxer)
54 int disp_w,disp_h; // display size (filled by fileformat parser) 54 float fps; // frames per second (set only if constant fps)
55 // int coded_w,coded_h; // coded size (filled by video codec) 55 float frametime; // 1/fps
56 float aspect; 56 float aspect; // aspect ratio stored in the file (for prescaling)
57 int i_bps; // == bitrate (compressed bytes/sec)
58 int disp_w,disp_h; // display size (filled by fileformat parser)
59 // output driver/filters: (set by libmpcodecs core)
57 unsigned int outfmtidx; 60 unsigned int outfmtidx;
58 // unsigned int bitrate; 61 void* video_out; // the video_out handle, used for this video stream
59 // buffers: 62 void* vfilter; // the video filter chain, used for this video stream
60 float num_frames; // number of frames played 63 int vf_inited;
61 int num_frames_decoded; // number of frames decoded 64 // win32-compatible codec parameters:
62 mp_image_t *image;
63 // win32 codec stuff:
64 AVIStreamHeader video; 65 AVIStreamHeader video;
65 BITMAPINFOHEADER *bih; // in format 66 BITMAPINFOHEADER* bih;
66 void* context; // codec-specific stuff (usually HANDLE or struct pointer) 67 // codec-specific:
67 void* video_out; 68 void* context; // codec-specific stuff (usually HANDLE or struct pointer)
68 void* vfilter;
69 int vf_inited;
70 } sh_video_t; 69 } sh_video_t;
71 70
72 sh_audio_t* get_sh_audio(demuxer_t *demuxer,int id); 71 // demuxer.c:
73 sh_video_t* get_sh_video(demuxer_t *demuxer,int id);
74 sh_audio_t* new_sh_audio(demuxer_t *demuxer,int id); 72 sh_audio_t* new_sh_audio(demuxer_t *demuxer,int id);
75 sh_video_t* new_sh_video(demuxer_t *demuxer,int id); 73 sh_video_t* new_sh_video(demuxer_t *demuxer,int id);
76 void free_sh_audio(sh_audio_t *sh); 74 void free_sh_audio(sh_audio_t *sh);
77 void free_sh_video(sh_video_t *sh); 75 void free_sh_video(sh_video_t *sh);
78 76
77 // video.c:
79 int video_read_properties(sh_video_t *sh_video); 78 int video_read_properties(sh_video_t *sh_video);
80 int video_read_frame(sh_video_t* sh_video,float* frame_time_ptr,unsigned char** start,int force_fps); 79 int video_read_frame(sh_video_t* sh_video,float* frame_time_ptr,unsigned char** start,int force_fps);
81 80
82 #endif 81 #endif