mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-12 10:25:33 +00:00
Fix build with newer FFmpeg versions.
This commit is contained in:
parent
f2906b7ad0
commit
a9a9d72e96
1 changed files with 11 additions and 4 deletions
|
@ -478,13 +478,18 @@ decode_frame(GstVaapiDecoderFfmpeg *ffdecoder, guchar *buf, guint buf_size)
|
||||||
GstVaapiDisplay * const display = GST_VAAPI_DECODER_DISPLAY(ffdecoder);
|
GstVaapiDisplay * const display = GST_VAAPI_DECODER_DISPLAY(ffdecoder);
|
||||||
GstVaapiSurface *surface;
|
GstVaapiSurface *surface;
|
||||||
int bytes_read, got_picture = 0;
|
int bytes_read, got_picture = 0;
|
||||||
|
AVPacket pkt;
|
||||||
|
|
||||||
|
av_init_packet(&pkt);
|
||||||
|
pkt.data = buf;
|
||||||
|
pkt.size = buf_size;
|
||||||
|
|
||||||
GST_VAAPI_DISPLAY_LOCK(display);
|
GST_VAAPI_DISPLAY_LOCK(display);
|
||||||
bytes_read = avcodec_decode_video(
|
bytes_read = avcodec_decode_video2(
|
||||||
priv->avctx,
|
priv->avctx,
|
||||||
priv->frame,
|
priv->frame,
|
||||||
&got_picture,
|
&got_picture,
|
||||||
buf, buf_size
|
&pkt
|
||||||
);
|
);
|
||||||
GST_VAAPI_DISPLAY_UNLOCK(display);
|
GST_VAAPI_DISPLAY_UNLOCK(display);
|
||||||
if (!got_picture)
|
if (!got_picture)
|
||||||
|
@ -530,12 +535,14 @@ gst_vaapi_decoder_ffmpeg_decode(GstVaapiDecoder *decoder, GstBuffer *buffer)
|
||||||
|
|
||||||
if (priv->pctx) {
|
if (priv->pctx) {
|
||||||
do {
|
do {
|
||||||
int parsed_size = av_parser_parse(
|
int parsed_size;
|
||||||
|
parsed_size = av_parser_parse2(
|
||||||
priv->pctx,
|
priv->pctx,
|
||||||
priv->avctx,
|
priv->avctx,
|
||||||
&outbuf, &outbuf_size,
|
&outbuf, &outbuf_size,
|
||||||
GST_BUFFER_DATA(buffer) + inbuf_ofs, inbuf_size,
|
GST_BUFFER_DATA(buffer) + inbuf_ofs, inbuf_size,
|
||||||
inbuf_ts, inbuf_ts
|
inbuf_ts, inbuf_ts,
|
||||||
|
AV_NOPTS_VALUE
|
||||||
);
|
);
|
||||||
got_frame = outbuf && outbuf_size > 0;
|
got_frame = outbuf && outbuf_size > 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue