Revision 01f4895c libavformat/grab.c

View differences:

libavformat/grab.c
109 109
    }
110 110

  
111 111
    desired_palette = -1;
112
    if (st->codec.pix_fmt == PIX_FMT_YUV420P) {
112
    if (st->codec->pix_fmt == PIX_FMT_YUV420P) {
113 113
        desired_palette = VIDEO_PALETTE_YUV420P;
114
    } else if (st->codec.pix_fmt == PIX_FMT_YUV422) {
114
    } else if (st->codec->pix_fmt == PIX_FMT_YUV422) {
115 115
        desired_palette = VIDEO_PALETTE_YUV422;
116
    } else if (st->codec.pix_fmt == PIX_FMT_BGR24) {
116
    } else if (st->codec->pix_fmt == PIX_FMT_BGR24) {
117 117
        desired_palette = VIDEO_PALETTE_RGB24;
118 118
    }    
119 119

  
......
245 245
    switch(s->frame_format) {
246 246
    case VIDEO_PALETTE_YUV420P:
247 247
        frame_size = (width * height * 3) / 2;
248
        st->codec.pix_fmt = PIX_FMT_YUV420P;
248
        st->codec->pix_fmt = PIX_FMT_YUV420P;
249 249
        break;
250 250
    case VIDEO_PALETTE_YUV422:
251 251
        frame_size = width * height * 2;
252
        st->codec.pix_fmt = PIX_FMT_YUV422;
252
        st->codec->pix_fmt = PIX_FMT_YUV422;
253 253
        break;
254 254
    case VIDEO_PALETTE_RGB24:
255 255
        frame_size = width * height * 3;
256
        st->codec.pix_fmt = PIX_FMT_BGR24; /* NOTE: v4l uses BGR24, not RGB24 ! */
256
        st->codec->pix_fmt = PIX_FMT_BGR24; /* NOTE: v4l uses BGR24, not RGB24 ! */
257 257
        break;
258 258
    default:
259 259
        goto fail;
......
261 261
    s->fd = video_fd;
262 262
    s->frame_size = frame_size;
263 263
    
264
    st->codec.codec_type = CODEC_TYPE_VIDEO;
265
    st->codec.codec_id = CODEC_ID_RAWVIDEO;
266
    st->codec.width = width;
267
    st->codec.height = height;
268
    st->codec.time_base.den      = frame_rate;
269
    st->codec.time_base.num = frame_rate_base;
264
    st->codec->codec_type = CODEC_TYPE_VIDEO;
265
    st->codec->codec_id = CODEC_ID_RAWVIDEO;
266
    st->codec->width = width;
267
    st->codec->height = height;
268
    st->codec->time_base.den      = frame_rate;
269
    st->codec->time_base.num = frame_rate_base;
270 270

  
271 271
    return 0;
272 272
 fail:

Also available in: Unified diff