Rev 6298 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6298 | Rev 6438 | ||
---|---|---|---|
Line 396... | Line 396... | ||
396 | { |
396 | { |
397 | vst_t *vst = (vst_t*)avctx->opaque; |
397 | vst_t *vst = (vst_t*)avctx->opaque; |
398 | VAProfile profile = avctx->profile; |
398 | VAProfile profile = avctx->profile; |
399 | enum AVCodecID codec = avctx->codec_id; |
399 | enum AVCodecID codec = avctx->codec_id; |
Line 400... | Line -... | ||
400 | - | ||
401 | printf("%s codec %d profile %x\n", __FUNCTION__,avctx->codec_id, avctx->profile); |
- | |
402 | 400 | ||
403 | if (codec == AV_CODEC_ID_H264) |
401 | if (codec == AV_CODEC_ID_H264) |
404 | { |
402 | { |
405 | if(profile == FF_PROFILE_H264_BASELINE) |
403 | if(profile == FF_PROFILE_H264_BASELINE) |
406 | profile = FF_PROFILE_H264_CONSTRAINED_BASELINE; |
404 | profile = FF_PROFILE_H264_CONSTRAINED_BASELINE; |
Line -... | Line 405... | ||
- | 405 | }; |
|
- | 406 | ||
- | 407 | if(avctx->hwaccel_context != NULL && |
|
- | 408 | (vst->codec_id != codec || |
|
- | 409 | vst->codec_profile != profile)) |
|
- | 410 | { |
|
- | 411 | struct decoder* decoder = vst->decoder; |
|
- | 412 | ||
- | 413 | printf("\n%s codec changed!!!\n" |
|
- | 414 | "old id %d profile %x new id %d profile %x\n", |
|
- | 415 | __FUNCTION__, vst->codec_id, vst->codec_profile, |
|
- | 416 | codec, profile); |
|
- | 417 | ||
- | 418 | for(int i = 0; i < decoder->nframes; i++) |
|
- | 419 | { |
|
- | 420 | vframe_t *vframe = &decoder->vframes[i]; |
|
- | 421 | vframe->format = AV_PIX_FMT_NONE; |
|
- | 422 | }; |
|
- | 423 | } |
|
- | 424 | ||
407 | }; |
425 | printf("\n%s codec %d profile %x\n", __FUNCTION__,avctx->codec_id, avctx->profile); |
408 | 426 | ||
409 | for (int i = 0; fmt[i] != PIX_FMT_NONE; i++) |
427 | for (int i = 0; fmt[i] != PIX_FMT_NONE; i++) |
410 | { |
428 | { |
Line 418... | Line 436... | ||
418 | { |
436 | { |
419 | profile = hw_profiles[n].va_profile; |
437 | profile = hw_profiles[n].va_profile; |
420 | if (vaapi_init_decoder(vst, profile, VAEntrypointVLD, avctx->width, avctx->height) == 0) |
438 | if (vaapi_init_decoder(vst, profile, VAEntrypointVLD, avctx->width, avctx->height) == 0) |
421 | { |
439 | { |
422 | avctx->hwaccel_context = v_context; |
440 | avctx->hwaccel_context = v_context; |
- | 441 | vst->codec_id = codec; |
|
- | 442 | vst->codec_profile = profile; |
|
423 | printf("%s format: %x\n",__FUNCTION__, fmt[i]); |
443 | printf("%s format: %x\n",__FUNCTION__, fmt[i]); |
424 | return fmt[i]; |
444 | return fmt[i]; |
425 | } |
445 | } |
426 | } |
446 | } |
427 | } |
447 | } |
Line 456... | Line 476... | ||
456 | av_release_buffer, avctx, |
476 | av_release_buffer, avctx, |
457 | AV_BUFFER_FLAG_READONLY); |
477 | AV_BUFFER_FLAG_READONLY); |
458 | return 0; |
478 | return 0; |
459 | } |
479 | } |
Line 460... | Line -... | ||
460 | - | ||
461 | struct vaapi_context va_context_storage; |
- | |
462 | - | ||
Line 463... | Line 480... | ||
463 | 480 | ||
464 | 481 | ||
465 | #define EGL_TEXTURE_Y_U_V_WL 0x31D7 |
482 | #define EGL_TEXTURE_Y_U_V_WL 0x31D7 |