Rev 6135 | Rev 6144 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6135 | Rev 6136 | ||
---|---|---|---|
Line 25... | Line 25... | ||
25 | int is_hw_pic; |
25 | int is_hw_pic; |
26 | int index; |
26 | int index; |
27 | double pts; |
27 | double pts; |
28 | double pkt_pts; |
28 | double pkt_pts; |
29 | double pkt_dts; |
29 | volatile int ready; |
30 | volatile int ready; |
- | |
31 | }vframe_t; |
30 | }vframe_t; |
32 | 31 | ||
Line 33... | Line 32... | ||
33 | struct render |
32 | struct render |
34 | { |
33 | { |
Line 109... | Line 108... | ||
109 | 108 | ||
Line 110... | Line 109... | ||
110 | int put_packet(queue_t *q, AVPacket *pkt); |
109 | int put_packet(queue_t *q, AVPacket *pkt); |
111 | int get_packet(queue_t *q, AVPacket *pkt); |
110 | int get_packet(queue_t *q, AVPacket *pkt); |
Line 112... | Line -... | ||
112 | - | ||
113 | #define HWDEC_NUM_SURFACES 16 |
111 | |
114 | struct vstate |
112 | struct vstate |
115 | { |
113 | { |
116 | AVFormatContext *fCtx; /* format context */ |
114 | AVFormatContext *fCtx; /* format context */ |
117 | AVCodecContext *vCtx; /* video decoder context */ |
115 | AVCodecContext *vCtx; /* video decoder context */ |
118 | AVCodecContext *aCtx; /* audio decoder context */ |
116 | AVCodecContext *aCtx; /* audio decoder context */ |
119 | AVCodec *vCodec; /* video codec */ |
117 | AVCodec *vCodec; /* video codec */ |
- | 118 | AVCodec *aCodec; /* audio codec */ |
|
- | 119 | char *input_file; |
|
120 | AVCodec *aCodec; /* audio codec */ |
120 | char *input_name; |
121 | int vStream; /* video stream index */ |
121 | int vStream; /* video stream index */ |
- | 122 | int aStream; /* audio stream index */ |
|
- | 123 | AVRational video_time_base; |
|
Line 122... | Line 124... | ||
122 | int aStream; /* audio stream index */ |
124 | AVRational audio_time_base; |
123 | 125 | ||
Line 124... | Line 126... | ||
124 | queue_t q_video; /* video packets queue */ |
126 | queue_t q_video; /* video packets queue */ |
Line 131... | Line 133... | ||
131 | mutex_t output_lock; |
133 | mutex_t output_lock; |
132 | struct list_head input_list; |
134 | struct list_head input_list; |
133 | struct list_head output_list; |
135 | struct list_head output_list; |
134 | 136 | ||
Line -... | Line 137... | ||
- | 137 | AVFrame *Frame; |
|
- | 138 | ||
135 | vframe_t *decoder_frame; |
139 | vframe_t *decoder_frame; |
- | 140 | volatile int frames_count; |
|
136 | void *hwCtx; /* hardware context */ |
141 | void *hwCtx; /* hardware context */ |
137 | int hwdec:1; /* hardware decoder */ |
142 | int hwdec:1; /* hardware decoder */ |
138 | int blit_bitmap:1; /* hardware RGBA blitter */ |
143 | int blit_bitmap:1; /* hardware RGBA blitter */ |
139 | int blit_texture:1; /* hardware RGBA blit and scale */ |
144 | int blit_texture:1; /* hardware RGBA blit and scale */ |
140 | int blit_planar:1; /* hardbare YUV blit and scale */ |
145 | int blit_planar:1; /* hardbare YUV blit and scale */ |
141 | int frame_reorder:1; |
146 | int frame_reorder:1; |
- | 147 | int nframes; |
|
- | 148 | vframe_t vframes[16]; |
|
142 | }; |
149 | }; |
Line 143... | Line 150... | ||
143 | 150 | ||
144 | 151 | ||
145 | #define DECODER_THREAD 1 |
152 | #define DECODER_THREAD 1 |
Line 146... | Line 153... | ||
146 | #define AUDIO_THREAD 2 |
153 | #define AUDIO_THREAD 2 |
147 | #define VIDEO_THREAD 4 |
154 | #define VIDEO_THREAD 4 |
148 | - | ||
Line 149... | Line 155... | ||
149 | extern int threads_running; |
155 | |
150 | extern astream_t astream; |
156 | extern int threads_running; |
151 | extern AVRational video_time_base; |
157 | extern astream_t astream; |
152 | 158 | ||
Line 162... | Line 168... | ||
162 | int init_audio(int format); |
168 | int init_audio(int format); |
163 | int audio_thread(void *param); |
169 | int audio_thread(void *param); |
164 | void set_audio_volume(int left, int right); |
170 | void set_audio_volume(int left, int right); |
Line 165... | Line -... | ||
165 | - | ||
166 | int init_video(vst_t* vst); |
171 | |
- | 172 | int video_thread(void *param); |
|
Line 167... | Line 173... | ||
167 | int video_thread(void *param); |
173 | void flush_video(vst_t* vst); |
168 | 174 | ||
169 | void decoder(vst_t *vst); |
175 | void decoder(vst_t *vst); |
Line 178... | Line 184... | ||
178 | "int $0x40" |
184 | "int $0x40" |
179 | ::"a"(68),"b"(14),"c"(event)); |
185 | ::"a"(68),"b"(14),"c"(event)); |
180 | } |
186 | } |
181 | 187 | ||
Line -... | Line 188... | ||
- | 188 | static inline double get_audio_base(vst_t* vst) |
|
- | 189 | { |
|
- | 190 | return (double)av_q2d(vst->fCtx->streams[vst->aStream]->time_base)*1000; |
|
- | 191 | }; |
|
- | 192 | ||
182 | void va_create_planar(vst_t *vst, vframe_t *vframe); |
193 | void va_create_planar(vst_t *vst, vframe_t *vframe); |
Line 183... | Line 194... | ||
183 | 194 | ||
184 | int init_fontlib(); |
195 | int init_fontlib(); |