胡斌

fill background when student is portrait layout in one2one layout

adjust the layout of one to many layout
@@ -407,7 +407,7 @@ int CAVTranscoder::open_output_file(const char *filename) @@ -407,7 +407,7 @@ int CAVTranscoder::open_output_file(const char *filename)
407 continue; 407 continue;
408 } 408 }
409 _scaledFrame->pkt_dts = pFrame->pkt_dts;//pass rotation 409 _scaledFrame->pkt_dts = pFrame->pkt_dts;//pass rotation
410 - fillDestFrame(pDstFrame, _scaledFrame, SRC_W - (imageIdx % 4 + 1) * (SCALED_H + 5) + 4, SRC_H - SCALED_H + 3 - (SCALED_H + 4)*(imageIdx / 4), (SCALED_W - SCALED_H) / 2, 0, SCALED_H - 3, SCALED_H - 3); 410 + fillDestFrame(pDstFrame, _scaledFrame, SRC_W - (imageIdx % 4 + 1) * (SCALED_H + 5) + 4, SRC_H - SCALED_H + 3 - (SCALED_H + 1)*(imageIdx / 4), (SCALED_W - SCALED_H) / 2, 0, SCALED_H - 3, SCALED_H - 3);
411 } 411 }
412 else if (pFrame->width == SRC_H && pFrame->height == SRC_W) { 412 else if (pFrame->width == SRC_H && pFrame->height == SRC_W) {
413 h = sws_scale(_swsCtxPortrait, pFrame->data, pFrame->linesize, 0, pFrame->height, 413 h = sws_scale(_swsCtxPortrait, pFrame->data, pFrame->linesize, 0, pFrame->height,
@@ -417,7 +417,7 @@ int CAVTranscoder::open_output_file(const char *filename) @@ -417,7 +417,7 @@ int CAVTranscoder::open_output_file(const char *filename)
417 continue; 417 continue;
418 } 418 }
419 _scaledPortraitFrame->pkt_dts = pFrame->pkt_dts;//pass rotation 419 _scaledPortraitFrame->pkt_dts = pFrame->pkt_dts;//pass rotation
420 - fillDestFrame(pDstFrame, _scaledPortraitFrame, SRC_W - (imageIdx % 4 + 1) * (SCALED_H + 5) + 4, SRC_H - SCALED_H + 3 - (SCALED_H + 4)*(imageIdx / 4), 0, (SCALED_W - SCALED_H) / 2, SCALED_H - 3, SCALED_H - 3); 420 + fillDestFrame(pDstFrame, _scaledPortraitFrame, SRC_W - (imageIdx % 4 + 1) * (SCALED_H + 5) + 4, SRC_H - SCALED_H + 3 - (SCALED_H + 1)*(imageIdx / 4), 0, (SCALED_W - SCALED_H) / 2, SCALED_H - 3, SCALED_H - 3);
421 421
422 } 422 }
423 else { 423 else {
@@ -635,6 +635,9 @@ int CAVTranscoder::open_output_file(const char *filename) @@ -635,6 +635,9 @@ int CAVTranscoder::open_output_file(const char *filename)
635 fillDestFrame(pDstFrame, _studentFrame, 0, 240); 635 fillDestFrame(pDstFrame, _studentFrame, 0, 240);
636 } 636 }
637 else { 637 else {
  638 + memset(pDstFrame->data[0] + 240 * pDstFrame->linesize[0], _blank_y, _nOutputWidth * _nOutputHeight / 2);
  639 + memset(pDstFrame->data[1] + 120 * pDstFrame->linesize[1], _blank_u, _nOutputWidth * _nOutputHeight / 8);
  640 + memset(pDstFrame->data[2] + 120 * pDstFrame->linesize[2], _blank_v, _nOutputWidth * _nOutputHeight / 8);
638 fillDestFrame(pDstFrame, _studentFrame, (SRC_W - SRC_H) / 2, 240, (SRC_W - SRC_H) / 2, 0, SRC_H, SRC_H); 641 fillDestFrame(pDstFrame, _studentFrame, (SRC_W - SRC_H) / 2, 240, (SRC_W - SRC_H) / 2, 0, SRC_H, SRC_H);
639 } 642 }
640 } 643 }