mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-06 23:48:53 +00:00
ffmpeg: add support for interlaced streams.
Evaluate interlaced stream properties. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
This commit is contained in:
parent
0d0cff695f
commit
2ebfa66ade
1 changed files with 6 additions and 2 deletions
|
@ -166,7 +166,7 @@ get_profile(AVCodecContext *avctx, GstVaapiEntrypoint entrypoint)
|
||||||
|
|
||||||
/** Ensures VA context is correctly set up for the current FFmpeg context */
|
/** Ensures VA context is correctly set up for the current FFmpeg context */
|
||||||
static GstVaapiContext *
|
static GstVaapiContext *
|
||||||
get_context(AVCodecContext *avctx)
|
get_context(AVCodecContext *avctx, AVFrame *pic)
|
||||||
{
|
{
|
||||||
GstVaapiContextFfmpeg * const vactx = avctx->hwaccel_context;
|
GstVaapiContextFfmpeg * const vactx = avctx->hwaccel_context;
|
||||||
GstVaapiDecoder * const decoder = GST_VAAPI_DECODER(vactx->decoder);
|
GstVaapiDecoder * const decoder = GST_VAAPI_DECODER(vactx->decoder);
|
||||||
|
@ -189,6 +189,8 @@ get_context(AVCodecContext *avctx)
|
||||||
avctx->sample_aspect_ratio.den
|
avctx->sample_aspect_ratio.den
|
||||||
);
|
);
|
||||||
|
|
||||||
|
gst_vaapi_decoder_set_interlaced(decoder, !!pic->interlaced_frame);
|
||||||
|
|
||||||
success = gst_vaapi_decoder_ensure_context(
|
success = gst_vaapi_decoder_ensure_context(
|
||||||
decoder,
|
decoder,
|
||||||
vactx->profile,
|
vactx->profile,
|
||||||
|
@ -263,7 +265,7 @@ gst_vaapi_decoder_ffmpeg_get_buffer(AVCodecContext *avctx, AVFrame *pic)
|
||||||
GstVaapiSurfaceProxy *proxy;
|
GstVaapiSurfaceProxy *proxy;
|
||||||
GstVaapiID surface_id;
|
GstVaapiID surface_id;
|
||||||
|
|
||||||
context = get_context(avctx);
|
context = get_context(avctx, pic);
|
||||||
if (!context)
|
if (!context)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
@ -494,6 +496,8 @@ render_frame(GstVaapiDecoderFfmpeg *decoder, AVFrame *frame)
|
||||||
return GST_VAAPI_DECODER_STATUS_ERROR_INVALID_SURFACE;
|
return GST_VAAPI_DECODER_STATUS_ERROR_INVALID_SURFACE;
|
||||||
|
|
||||||
gst_vaapi_surface_proxy_set_timestamp(proxy, frame->pts);
|
gst_vaapi_surface_proxy_set_timestamp(proxy, frame->pts);
|
||||||
|
if (frame->interlaced_frame)
|
||||||
|
gst_vaapi_surface_proxy_set_tff(proxy, frame->top_field_first);
|
||||||
gst_vaapi_decoder_push_surface_proxy(base_decoder, g_object_ref(proxy));
|
gst_vaapi_decoder_push_surface_proxy(base_decoder, g_object_ref(proxy));
|
||||||
return GST_VAAPI_DECODER_STATUS_SUCCESS;
|
return GST_VAAPI_DECODER_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue