Subversion Repositories Kolibri OS

Rev

Rev 6136 | Rev 6438 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6136 Rev 6144
Line 108... Line 108...
108
 
108
 
Line 109... Line 109...
109
int put_packet(queue_t *q, AVPacket *pkt);
109
int put_packet(queue_t *q, AVPacket *pkt);
110
int get_packet(queue_t *q, AVPacket *pkt);
110
int get_packet(queue_t *q, AVPacket *pkt);
Line -... Line 111...
-
 
111
 
-
 
112
struct decoder
-
 
113
{
-
 
114
    const char     *name;
-
 
115
    enum AVCodecID  codec_id;
-
 
116
    enum AVPixelFormat pix_fmt;
-
 
117
    int             width;
-
 
118
    int             height;
-
 
119
    AVFrame        *Frame;
-
 
120
    vframe_t       *active_frame;
-
 
121
    void           *hwctx;
-
 
122
    int             is_hw:1;
-
 
123
    int             frame_reorder:1;
-
 
124
    int             nframes;
-
 
125
    vframe_t        vframes[16];
-
 
126
};
111
 
127
 
112
struct vstate
128
struct vstate
113
{
129
{
114
    AVFormatContext *fCtx;              /* format context           */
130
    AVFormatContext *fCtx;              /* format context           */
115
    AVCodecContext  *vCtx;              /* video decoder context    */
131
    AVCodecContext  *vCtx;              /* video decoder context    */
Line 120... Line 136...
120
    char            *input_name;
136
    char            *input_name;
121
    int             vStream;            /* video stream index       */
137
    int             vStream;            /* video stream index       */
122
    int             aStream;            /* audio stream index       */
138
    int             aStream;            /* audio stream index       */
123
    AVRational      video_time_base;
139
    AVRational      video_time_base;
124
    AVRational      audio_time_base;
140
    double          audio_timer_base;
125
 
141
 
Line 126... Line 142...
126
    queue_t         q_video;            /* video packets queue      */
142
    queue_t         q_video;            /* video packets queue      */
127
    queue_t         q_audio;            /* audio packets queue      */
143
    queue_t         q_audio;            /* audio packets queue      */
Line 128... Line 144...
128
 
144
 
Line 133... Line 149...
133
    mutex_t         output_lock;
149
    mutex_t         output_lock;
134
    struct list_head input_list;
150
    struct list_head input_list;
135
    struct list_head output_list;
151
    struct list_head output_list;
136
 
152
 
Line 137... Line -...
137
    AVFrame        *Frame;
-
 
138
 
-
 
139
    vframe_t       *decoder_frame;
153
    struct decoder *decoder;
140
    volatile int    frames_count;
154
    volatile int    frames_count;
141
    void           *hwCtx;              /* hardware context         */
155
    int             has_sound:1;
142
    int             hwdec:1;            /* hardware decoder         */
156
    int             audio_timer_valid:1;
143
    int             blit_bitmap:1;      /* hardware RGBA blitter    */
157
    int             blit_bitmap:1;      /* hardware RGBA blitter    */
144
    int             blit_texture:1;     /* hardware RGBA blit and scale */
158
    int             blit_texture:1;     /* hardware RGBA blit and scale */
145
    int             blit_planar:1;      /* hardbare YUV blit and scale */
159
    int             blit_planar:1;      /* hardbare YUV blit and scale */
146
    int             frame_reorder:1;
-
 
147
    int             nframes;
-
 
148
    vframe_t        vframes[16];
-
 
149
};
160
};
Line 150... Line 161...
150
 
161
 
151
 
162
 
Line 171... Line 182...
171
 
182
 
Line 172... Line 183...
172
int video_thread(void *param);
183
int video_thread(void *param);
173
void flush_video(vst_t* vst);
184
void flush_video(vst_t* vst);
Line -... Line 185...
-
 
185
 
-
 
186
int init_video_decoder(vst_t *vst);
174
 
187
void fini_video_decoder(vst_t *vst);
175
void decoder(vst_t *vst);
188
void decoder(vst_t *vst);
176
int decode_video(vst_t* vst);
189
int decode_video(vst_t* vst);
Line 177... Line 190...
177
int decode_audio(AVCodecContext  *ctx, queue_t *qa);
190
int decode_audio(AVCodecContext  *ctx, queue_t *qa);
Line 189... Line 202...
189
{
202
{
190
    return (double)av_q2d(vst->fCtx->streams[vst->aStream]->time_base)*1000;
203
    return (double)av_q2d(vst->fCtx->streams[vst->aStream]->time_base)*1000;
191
};
204
};
192
 
205
 
Line -... Line 206...
-
 
206
struct decoder* va_init_decoder(vst_t *vst);
193
void va_create_planar(vst_t *vst, vframe_t *vframe);
207
void va_create_planar(vst_t *vst, vframe_t *vframe);
Line 194... Line 208...
194
 
208
 
195
int init_fontlib();
209
int init_fontlib();
Line -... Line 210...
-
 
210
char *get_moviefile();
-
 
211
 
-
 
212
#define ENTER()   printf("enter %s\n",__FUNCTION__)
-
 
213
#define LEAVE()   printf("leave %s\n",__FUNCTION__)