xv: Remove AVPicture usage
This commit is contained in:
parent
228eb6708b
commit
13b8ba8c9d
@ -291,7 +291,8 @@ static int xv_repaint(AVFormatContext *s)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int write_picture(AVFormatContext *s, AVPicture *pict)
|
static int write_picture(AVFormatContext *s, uint8_t *input_data[4],
|
||||||
|
int linesize[4])
|
||||||
{
|
{
|
||||||
XVContext *xv = s->priv_data;
|
XVContext *xv = s->priv_data;
|
||||||
XvImage *img = xv->yuv_image;
|
XvImage *img = xv->yuv_image;
|
||||||
@ -313,18 +314,20 @@ static int write_picture(AVFormatContext *s, AVPicture *pict)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
av_image_copy(data, img->pitches, (const uint8_t **)pict->data, pict->linesize,
|
av_image_copy(data, img->pitches, (const uint8_t **)input_data, linesize,
|
||||||
xv->image_format, img->width, img->height);
|
xv->image_format, img->width, img->height);
|
||||||
return xv_repaint(s);
|
return xv_repaint(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int xv_write_packet(AVFormatContext *s, AVPacket *pkt)
|
static int xv_write_packet(AVFormatContext *s, AVPacket *pkt)
|
||||||
{
|
{
|
||||||
AVPicture pict;
|
|
||||||
AVCodecContext *ctx = s->streams[0]->codec;
|
AVCodecContext *ctx = s->streams[0]->codec;
|
||||||
|
uint8_t *data[4];
|
||||||
|
int linesize[4];
|
||||||
|
|
||||||
avpicture_fill(&pict, pkt->data, ctx->pix_fmt, ctx->width, ctx->height);
|
av_image_fill_arrays(data, linesize, pkt->data, ctx->pix_fmt,
|
||||||
return write_picture(s, &pict);
|
ctx->width, ctx->height, 1);
|
||||||
|
return write_picture(s, data, linesize);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int xv_write_frame(AVFormatContext *s, int stream_index, AVFrame **frame,
|
static int xv_write_frame(AVFormatContext *s, int stream_index, AVFrame **frame,
|
||||||
@ -333,7 +336,7 @@ static int xv_write_frame(AVFormatContext *s, int stream_index, AVFrame **frame,
|
|||||||
/* xv_write_header() should have accepted only supported formats */
|
/* xv_write_header() should have accepted only supported formats */
|
||||||
if ((flags & AV_WRITE_UNCODED_FRAME_QUERY))
|
if ((flags & AV_WRITE_UNCODED_FRAME_QUERY))
|
||||||
return 0;
|
return 0;
|
||||||
return write_picture(s, (AVPicture *)*frame);
|
return write_picture(s, (*frame)->data, (*frame)->linesize);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int xv_control_message(AVFormatContext *s, int type, void *data, size_t data_size)
|
static int xv_control_message(AVFormatContext *s, int type, void *data, size_t data_size)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user