Lines 490-496
Link Here
|
490 |
lavc_venc_frame = avcodec_alloc_frame(); |
490 |
lavc_venc_frame = avcodec_alloc_frame(); |
491 |
|
491 |
|
492 |
lavc_convert_frame= avcodec_alloc_frame(); |
492 |
lavc_convert_frame= avcodec_alloc_frame(); |
493 |
size = avpicture_get_size(PIX_FMT_RGB24, vob->ex_v_width, vob->ex_v_height); |
493 |
size = avpicture_get_size(AV_PIX_FMT_RGB24, vob->ex_v_width, vob->ex_v_height); |
494 |
enc_buffer = tc_malloc(size); |
494 |
enc_buffer = tc_malloc(size); |
495 |
|
495 |
|
496 |
if (lavc_venc_context == NULL || !enc_buffer || !lavc_convert_frame) { |
496 |
if (lavc_venc_context == NULL || !enc_buffer || !lavc_convert_frame) { |
Lines 1118-1124
Link Here
|
1118 |
lavc_venc_context->prediction_method = lavc_param_prediction_method; |
1118 |
lavc_venc_context->prediction_method = lavc_param_prediction_method; |
1119 |
|
1119 |
|
1120 |
if(is_huffyuv) |
1120 |
if(is_huffyuv) |
1121 |
lavc_venc_context->pix_fmt = PIX_FMT_YUV422P; |
1121 |
lavc_venc_context->pix_fmt = AV_PIX_FMT_YUV422P; |
1122 |
else |
1122 |
else |
1123 |
{ |
1123 |
{ |
1124 |
switch(pix_fmt) |
1124 |
switch(pix_fmt) |
Lines 1127-1144
Link Here
|
1127 |
case CODEC_RGB: |
1127 |
case CODEC_RGB: |
1128 |
{ |
1128 |
{ |
1129 |
if(is_mjpeg) |
1129 |
if(is_mjpeg) |
1130 |
lavc_venc_context->pix_fmt = PIX_FMT_YUVJ420P; |
1130 |
lavc_venc_context->pix_fmt = AV_PIX_FMT_YUVJ420P; |
1131 |
else |
1131 |
else |
1132 |
lavc_venc_context->pix_fmt = PIX_FMT_YUV420P; |
1132 |
lavc_venc_context->pix_fmt = AV_PIX_FMT_YUV420P; |
1133 |
break; |
1133 |
break; |
1134 |
} |
1134 |
} |
1135 |
|
1135 |
|
1136 |
case CODEC_YUV422: |
1136 |
case CODEC_YUV422: |
1137 |
{ |
1137 |
{ |
1138 |
if(is_mjpeg) |
1138 |
if(is_mjpeg) |
1139 |
lavc_venc_context->pix_fmt = PIX_FMT_YUVJ422P; |
1139 |
lavc_venc_context->pix_fmt = AV_PIX_FMT_YUVJ422P; |
1140 |
else |
1140 |
else |
1141 |
lavc_venc_context->pix_fmt = PIX_FMT_YUV422P; |
1141 |
lavc_venc_context->pix_fmt = AV_PIX_FMT_YUV422P; |
1142 |
break; |
1142 |
break; |
1143 |
} |
1143 |
} |
1144 |
|
1144 |
|
Lines 1623-1629
Link Here
|
1623 |
YUV_INIT_PLANES(src, param->buffer, IMG_YUV_DEFAULT, |
1623 |
YUV_INIT_PLANES(src, param->buffer, IMG_YUV_DEFAULT, |
1624 |
lavc_venc_context->width, lavc_venc_context->height); |
1624 |
lavc_venc_context->width, lavc_venc_context->height); |
1625 |
avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer, |
1625 |
avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer, |
1626 |
PIX_FMT_YUV422P, lavc_venc_context->width, |
1626 |
AV_PIX_FMT_YUV422P, lavc_venc_context->width, |
1627 |
lavc_venc_context->height); |
1627 |
lavc_venc_context->height); |
1628 |
/* FIXME: can't use tcv_convert (see decode_lavc.c) */ |
1628 |
/* FIXME: can't use tcv_convert (see decode_lavc.c) */ |
1629 |
ac_imgconvert(src, IMG_YUV_DEFAULT, |
1629 |
ac_imgconvert(src, IMG_YUV_DEFAULT, |
Lines 1653-1659
Link Here
|
1653 |
lavc_venc_context->width, |
1653 |
lavc_venc_context->width, |
1654 |
lavc_venc_context->height); |
1654 |
lavc_venc_context->height); |
1655 |
avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer, |
1655 |
avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer, |
1656 |
PIX_FMT_YUV420P, lavc_venc_context->width, |
1656 |
AV_PIX_FMT_YUV420P, lavc_venc_context->width, |
1657 |
lavc_venc_context->height); |
1657 |
lavc_venc_context->height); |
1658 |
ac_imgconvert(src, IMG_YUV422P, |
1658 |
ac_imgconvert(src, IMG_YUV422P, |
1659 |
lavc_venc_frame->data, IMG_YUV420P, |
1659 |
lavc_venc_frame->data, IMG_YUV420P, |
Lines 1664-1670
Link Here
|
1664 |
|
1664 |
|
1665 |
case CODEC_RGB: |
1665 |
case CODEC_RGB: |
1666 |
avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer, |
1666 |
avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer, |
1667 |
PIX_FMT_YUV420P, lavc_venc_context->width, |
1667 |
AV_PIX_FMT_YUV420P, lavc_venc_context->width, |
1668 |
lavc_venc_context->height); |
1668 |
lavc_venc_context->height); |
1669 |
ac_imgconvert(¶m->buffer, IMG_RGB_DEFAULT, |
1669 |
ac_imgconvert(¶m->buffer, IMG_RGB_DEFAULT, |
1670 |
lavc_venc_frame->data, IMG_YUV420P, |
1670 |
lavc_venc_frame->data, IMG_YUV420P, |