赞
踩
float sv_posx,sv_posy;
int background_color[3];
struct ms_SwsContext *sws1;
MSScalerContext *sws1;
struct ms_SwsContext *sws2;
MSScalerContext *sws2;
MSDisplay *display;
bool_t own_display;
bool_t ready;
if (obj->display!=NULL && obj->own_display)
ms_display_destroy(obj->display);
if (obj->sws1!=NULL){
ms_sws_freeContext(obj->sws1);
ms_scaler_context_free(obj->sws1);
obj->sws1=NULL;
}
if (obj->sws2!=NULL){
ms_sws_freeContext(obj->sws2);
ms_scaler_context_free(obj->sws2);
obj->sws2=NULL;
if (obj->local_msg!=NULL) {
obj->display=NULL;
if (ms_yuv_buf_init_from_mblk(&src,inm)==0){
if (obj->sws2==NULL){
obj->sws2=ms_sws_getContext(src.w,src.h,PIX_FMT_YUV420P,
obj->sws2=ms_scaler_create_context(src.w,src.h,MS_YUV420P,
obj->fbuf_selfview.w,obj->fbuf_selfview.h,PIX_FMT_YUV420P,
obj->fbuf_selfview.w,obj->fbuf_selfview.h,MS_YUV420P,
SWS_FAST_BILINEAR, NULL, NULL, NULL);
MS_SCALER_METHOD_BILINEAR);
ms_display_lock(obj->display);
if (ms_sws_scale(obj->sws2,src.planes,src.strides, 0,
if (ms_scaler_process(obj->sws2,src.planes,src.strides,
src.h, obj->fbuf_selfview.planes, obj->fbuf_selfview.strides)<0){
obj->fbuf_selfview.planes, obj->fbuf_selfview.strides)<0){
ms_error("Error in ms_sws_scale().");
ms_error("Error in ms_scaler_process().");
if (!mblk_get_precious_flag(inm)) ms_yuv_buf_mirror(&obj->fbuf_selfview);
ms_display_unlock(obj->display);
obj->local_pic.w,obj->local_pic.h,PIX_FMT_YUV420P,
obj->local_pic.w,obj->local_pic.h,MS_YUV420P,
if (obj->local_msg==NULL){
obj->local_msg=ms_yuv_buf_alloc(&obj->local_pic,
if (obj->local_pic.planes[0]!=NULL)
{
src.h, obj->local_pic.planes, obj->local_pic.strides)<0){
obj->local_pic.planes, obj->local_pic.strides)<0){
if (!mblk_get_precious_flag(inm)) ms_yuv_buf_mirror(&obj->local_pic);
update=1;
if (obj->sws1==NULL){
obj->sws1=ms_sws_getContext(src.w,src.h,PIX_FMT_YUV420P,
obj->sws1=ms_scaler_create_context(src.w,src.h,MS_YUV420P,
obj->fbuf.w,obj->fbuf.h,PIX_FMT_YUV420P,
obj->fbuf.w,obj->fbuf.h,MS_YUV420P,
if (ms_sws_scale(obj->sws1,src.planes,src.strides, 0,
if (ms_scaler_process(obj->sws1,src.planes,src.strides,
src.h, obj->fbuf.planes, obj->fbuf.strides)<0){
obj->fbuf.planes, obj->fbuf.strides)<0){
if (obj->mirror && !mblk_get_precious_flag(inm)) ms_yuv_buf_mirror(&obj->fbuf);
if (ms_scaler_process(obj->sws1,src.planes,src.strides, mainpic.planes, mainpic.strides)<0){
if (obj->mirror && !precious) ms_yuv_buf_mirror(&mainpic);