Rev 6118 | Rev 6133 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6118 | Rev 6121 | ||
---|---|---|---|
Line 78... | Line 78... | ||
78 | avcodec_register_all(); |
78 | avcodec_register_all(); |
79 | avdevice_register_all(); |
79 | avdevice_register_all(); |
80 | av_register_all(); |
80 | av_register_all(); |
Line 81... | Line -... | ||
81 | - | ||
82 | #ifdef HAVE_VAAPI |
- | |
83 | fplay_vaapi_init(); |
- | |
84 | #endif |
- | |
85 | 81 | ||
86 | if( avformat_open_input(&vst.fCtx, movie_file, NULL, NULL) < 0) |
82 | if( avformat_open_input(&vst.fCtx, movie_file, NULL, NULL) < 0) |
87 | { |
83 | { |
88 | printf("Cannot open file %s\n\r", movie_file); |
84 | printf("Cannot open file %s\n\r", movie_file); |
89 | return -1; // Couldn't open file |
85 | return -1; // Couldn't open file |
Line 156... | Line 152... | ||
156 | vst.vCtx->codec_id, vst.vStream); |
152 | vst.vCtx->codec_id, vst.vStream); |
157 | return -1; // Codec not found |
153 | return -1; // Codec not found |
158 | } |
154 | } |
159 | 155 | ||
Line 160... | Line -... | ||
160 | #ifdef HAVE_VAAPI |
- | |
161 | int hwdec = va_check_codec_support(vst.vCtx->codec_id); |
- | |
162 | - | ||
163 | if(hwdec) |
- | |
164 | { |
- | |
165 | printf("hardware decode supported\n"); |
- | |
166 | - | ||
167 | if (fplay_init_context(&vst) < 0) |
156 | if(fplay_init_context(&vst)) |
168 | { |
- | |
169 | printf("context initialization failed\n"); |
- | |
170 | return -1; |
157 | return -1; |
171 | }; |
- | |
172 | }; |
- | |
173 | #endif |
- | |
Line 174... | Line 158... | ||
174 | 158 | ||
175 | if(avcodec_open2(vst.vCtx, vst.vCodec, NULL) < 0) |
159 | if(avcodec_open2(vst.vCtx, vst.vCodec, NULL) < 0) |
176 | { |
160 | { |
177 | printf("Error while opening codec for input stream %d\n", |
161 | printf("Error while opening codec for input stream %d\n", |
178 | vst.vStream); |
162 | vst.vStream); |
179 | return -1; // Could not open codec |
163 | return -1; // Could not open codec |
Line -... | Line 164... | ||
- | 164 | }; |
|
Line 180... | Line 165... | ||
180 | }; |
165 | |
181 | 166 | printf("ctx->pix_fmt %d\n", vst.vCtx->pix_fmt); |
|
182 | 167 |