Mercurial > mplayer.hg
annotate libmpdemux/stheader.h @ 7783:29c059774519
exporting palette for 4/8bpp modes
author | arpi |
---|---|
date | Thu, 17 Oct 2002 21:53:30 +0000 |
parents | 32efb806436e |
children | 324b6e5387be |
rev | line source |
---|---|
4933 | 1 #ifndef __ST_HEADER_H |
2 #define __ST_HEADER_H 1 | |
3 | |
7471 | 4 // for AVIStreamHeader: |
2338 | 5 #include "wine/avifmt.h" |
7471 | 6 |
7 #ifndef _WAVEFORMATEX_ | |
8 #define _WAVEFORMATEX_ | |
9 typedef struct __attribute__((__packed__)) _WAVEFORMATEX { | |
10 WORD wFormatTag; | |
11 WORD nChannels; | |
12 DWORD nSamplesPerSec; | |
13 DWORD nAvgBytesPerSec; | |
14 WORD nBlockAlign; | |
15 WORD wBitsPerSample; | |
16 WORD cbSize; | |
17 } WAVEFORMATEX, *PWAVEFORMATEX, *NPWAVEFORMATEX, *LPWAVEFORMATEX; | |
18 #endif /* _WAVEFORMATEX_ */ | |
291 | 19 |
7471 | 20 #ifndef _BITMAPINFOHEADER_ |
21 #define _BITMAPINFOHEADER_ | |
22 typedef struct __attribute__((__packed__)) | |
23 { | |
24 int biSize; | |
25 int biWidth; | |
26 int biHeight; | |
27 short biPlanes; | |
28 short biBitCount; | |
29 int biCompression; | |
30 int biSizeImage; | |
31 int biXPelsPerMeter; | |
32 int biYPelsPerMeter; | |
33 int biClrUsed; | |
34 int biClrImportant; | |
35 } BITMAPINFOHEADER, *PBITMAPINFOHEADER, *LPBITMAPINFOHEADER; | |
36 typedef struct { | |
37 BITMAPINFOHEADER bmiHeader; | |
38 int bmiColors[1]; | |
39 } BITMAPINFO, *LPBITMAPINFO; | |
40 #endif | |
41 | |
42 // Stream headers: | |
4196 | 43 |
291 | 44 typedef struct { |
45 demux_stream_t *ds; | |
7467 | 46 struct codecs_st *codec; |
303 | 47 unsigned int format; |
1656 | 48 int inited; |
7467 | 49 float timer; // value of old a_frame |
291 | 50 // output format: |
7467 | 51 int sample_format; |
291 | 52 int samplerate; |
53 int samplesize; | |
54 int channels; | |
746 | 55 int o_bps; // == samplerate*samplesize*channels (uncompr. bytes/sec) |
56 int i_bps; // == bitrate (compressed bytes/sec) | |
296 | 57 // in buffers: |
7604
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
58 int audio_in_minsize; // max. compressed packet size (== min. in buffer size) |
291 | 59 char* a_in_buffer; |
60 int a_in_buffer_len; | |
61 int a_in_buffer_size; | |
7604
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
62 // decoder buffers: |
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
63 int audio_out_minsize; // max. uncompressed packet size (==min. out buffsize) |
296 | 64 char* a_buffer; |
65 int a_buffer_len; | |
66 int a_buffer_size; | |
7604
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
67 // output buffers: |
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
68 char* a_out_buffer; |
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
69 int a_out_buffer_len; |
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
70 int a_out_buffer_size; |
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
71 // void* audio_out; // the audio_out handle, used for this audio stream |
32efb806436e
aufio filter layer (libaf) integration to libmpcodecs, mplayer and mencoder
arpi
parents:
7471
diff
changeset
|
72 void* afilter; // the audio filter stream |
7467 | 73 // win32-compatible codec parameters: |
291 | 74 AVIStreamHeader audio; |
7467 | 75 WAVEFORMATEX* wf; |
76 // codec-specific: | |
3642
2cef9d562af0
void* context added - it should keep the codec-specific stuff (struct ptr or HANDLE)
arpi
parents:
2567
diff
changeset
|
77 void* context; // codec-specific stuff (usually HANDLE or struct pointer) |
7467 | 78 unsigned char* codecdata; // extra header data passed from demuxer to codec |
5301 | 79 int codecdata_len; |
291 | 80 } sh_audio_t; |
81 | |
82 typedef struct { | |
83 demux_stream_t *ds; | |
7467 | 84 struct codecs_st *codec; |
303 | 85 unsigned int format; |
1656 | 86 int inited; |
7467 | 87 float timer; // value of old v_frame |
88 // frame counters: | |
89 float num_frames; // number of frames played | |
90 int num_frames_decoded; // number of frames decoded | |
91 // output format: (set by demuxer) | |
92 float fps; // frames per second (set only if constant fps) | |
93 float frametime; // 1/fps | |
94 float aspect; // aspect ratio stored in the file (for prescaling) | |
95 int i_bps; // == bitrate (compressed bytes/sec) | |
96 int disp_w,disp_h; // display size (filled by fileformat parser) | |
97 // output driver/filters: (set by libmpcodecs core) | |
303 | 98 unsigned int outfmtidx; |
7467 | 99 void* video_out; // the video_out handle, used for this video stream |
100 void* vfilter; // the video filter chain, used for this video stream | |
101 int vf_inited; | |
102 // win32-compatible codec parameters: | |
291 | 103 AVIStreamHeader video; |
7467 | 104 BITMAPINFOHEADER* bih; |
105 // codec-specific: | |
106 void* context; // codec-specific stuff (usually HANDLE or struct pointer) | |
291 | 107 } sh_video_t; |
108 | |
7467 | 109 // demuxer.c: |
1289 | 110 sh_audio_t* new_sh_audio(demuxer_t *demuxer,int id); |
111 sh_video_t* new_sh_video(demuxer_t *demuxer,int id); | |
5084 | 112 void free_sh_audio(sh_audio_t *sh); |
113 void free_sh_video(sh_video_t *sh); | |
426 | 114 |
7467 | 115 // video.c: |
2567 | 116 int video_read_properties(sh_video_t *sh_video); |
117 int video_read_frame(sh_video_t* sh_video,float* frame_time_ptr,unsigned char** start,int force_fps); | |
4933 | 118 |
119 #endif |