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>
This commit is contained in:
Derek Buitenhuis
2016-04-10 20:58:15 +01:00
362 changed files with 6553 additions and 6077 deletions

View File

@ -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;