diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-04-10 22:58:15 +0300 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-04-10 22:59:55 +0300 |
commit | 6f69f7a8bf6a0d013985578df2ef42ee6b1c7994 (patch) | |
tree | 0c2ec8349ff1763d5f48454b8b9f26374dbd80b0 /libavdevice/opengl_enc.c | |
parent | 60b75186b2c878b6257b43c8fcc0b1356ada218e (diff) | |
parent | 9200514ad8717c63f82101dc394f4378854325bf (diff) |
Merge commit '9200514ad8717c63f82101dc394f4378854325bf'
* commit '9200514ad8717c63f82101dc394f4378854325bf':
lavf: replace AVStream.codec with AVStream.codecpar
This has been a HUGE effort from:
- Derek Buitenhuis <derek.buitenhuis@gmail.com>
- Hendrik Leppkes <h.leppkes@gmail.com>
- wm4 <nfxjfg@googlemail.com>
- Clément Bœsch <clement@stupeflix.com>
- James Almer <jamrial@gmail.com>
- Michael Niedermayer <michael@niedermayer.cc>
- Rostislav Pehlivanov <atomnuker@gmail.com>
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavdevice/opengl_enc.c')
-rw-r--r-- | libavdevice/opengl_enc.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/libavdevice/opengl_enc.c b/libavdevice/opengl_enc.c index ba8d36abff..1dbbb80f44 100644 --- a/libavdevice/opengl_enc.c +++ b/libavdevice/opengl_enc.c @@ -678,11 +678,11 @@ static void opengl_compute_display_area(AVFormatContext *s) AVRational sar, dar; /* sample and display aspect ratios */ OpenGLContext *opengl = s->priv_data; AVStream *st = s->streams[0]; - AVCodecContext *encctx = st->codec; + AVCodecParameters *par = st->codecpar; /* compute overlay width and height from the codec context information */ sar = st->sample_aspect_ratio.num ? st->sample_aspect_ratio : (AVRational){ 1, 1 }; - dar = av_mul_q(sar, (AVRational){ encctx->width, encctx->height }); + dar = av_mul_q(sar, (AVRational){ par->width, par->height }); /* we suppose the screen has a 1/1 sample aspect ratio */ /* fit in the window */ @@ -1065,15 +1065,15 @@ static av_cold int opengl_write_header(AVFormatContext *h) int ret; if (h->nb_streams != 1 || - h->streams[0]->codec->codec_type != AVMEDIA_TYPE_VIDEO || - h->streams[0]->codec->codec_id != AV_CODEC_ID_RAWVIDEO) { + h->streams[0]->codecpar->codec_type != AVMEDIA_TYPE_VIDEO || + h->streams[0]->codecpar->codec_id != AV_CODEC_ID_RAWVIDEO) { av_log(opengl, AV_LOG_ERROR, "Only a single video stream is supported.\n"); return AVERROR(EINVAL); } st = h->streams[0]; - opengl->width = st->codec->width; - opengl->height = st->codec->height; - opengl->pix_fmt = st->codec->pix_fmt; + opengl->width = st->codecpar->width; + opengl->height = st->codecpar->height; + opengl->pix_fmt = st->codecpar->format; if (!opengl->window_width) opengl->window_width = opengl->width; if (!opengl->window_height) @@ -1200,7 +1200,7 @@ static uint8_t* opengl_get_plane_pointer(OpenGLContext *opengl, AVPacket *pkt, i static int opengl_draw(AVFormatContext *h, void *input, int repaint, int is_pkt) { OpenGLContext *opengl = h->priv_data; - enum AVPixelFormat pix_fmt = h->streams[0]->codec->pix_fmt; + enum AVPixelFormat pix_fmt = h->streams[0]->codecpar->format; const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); int ret; |