Ticket #3479: zoom.diff
File zoom.diff, 26.7 KB (added by , 18 years ago) |
---|
-
libs/libmythtv/NuppelVideoPlayer.cpp
4602 4602 return retval; 4603 4603 } 4604 4604 4605 int NuppelVideoPlayer::Get Letterbox(void) const4605 int NuppelVideoPlayer::GetAspectOverride(void) const 4606 4606 { 4607 4607 if (videoOutput) 4608 return videoOutput->Get Letterbox();4608 return videoOutput->GetAspectOverride(); 4609 4609 return false; 4610 4610 } 4611 4611 4612 int NuppelVideoPlayer::GetAdjustFill(void) const 4613 { 4614 if (videoOutput) 4615 return videoOutput->GetAdjustFill(); 4616 return false; 4617 } 4618 4612 4619 void NuppelVideoPlayer::SetForcedAspectRatio(int mpeg2_aspect_value, int letterbox_permission) 4613 4620 { 4614 4621 (void)letterbox_permission; … … 4629 4636 } 4630 4637 } 4631 4638 4632 void NuppelVideoPlayer::Toggle Letterbox(int letterboxMode)4639 void NuppelVideoPlayer::ToggleAspectOverride(int aspectMode) 4633 4640 { 4634 4641 if (videoOutput) 4635 4642 { 4636 videoOutput->Toggle Letterbox(letterboxMode);4643 videoOutput->ToggleAspectOverride(aspectMode); 4637 4644 ReinitOSD(); 4638 4645 } 4639 4646 } 4640 4647 4648 void NuppelVideoPlayer::ToggleAdjustFill(int adjustfillMode) 4649 { 4650 if (videoOutput) 4651 { 4652 videoOutput->ToggleAdjustFill(adjustfillMode); 4653 ReinitOSD(); 4654 } 4655 } 4656 4641 4657 void NuppelVideoPlayer::Zoom(int direction) 4642 4658 { 4643 4659 if (videoOutput) -
libs/libmythtv/videoout_quartz.cpp
344 344 double hscale, vscale; 345 345 switch (parentData->srcMode) 346 346 { 347 case k Letterbox_4_3_Zoom:347 case kAdjustFill_Full: 348 348 // height only fills 3/4 of image, zoom up 349 hscale = vscale = h * 1.0 / (sh * 0.75); 350 break; 351 case kLetterbox_16_9_Zoom: 352 // width only fills 3/4 of image, zoom up 349 // (16:9 movie in 4:3 letterbox format on 16:9 screen) 353 350 hscale = vscale = w * 1.0 / (sw * 0.75); 354 351 break; 355 case kLetterbox_16_9_Stretch: 352 case kAdjustFill_Half: 353 // height only fills 3/4 of image, zoom up 354 // (4:3 movie on 16:9 screen - 14:9 zoom is a good compromise) 355 hscale = vscale = w * 7.0 / (sw * 6); 356 break; 357 case kAdjustFill_Stretch: 356 358 // like 16 x 9 standard, but with a horizontal stretch applied 357 359 hscale = vscale = fmin(h * 1.0 / sh, w * 1.0 / sw); 358 360 hscale *= 4.0 / 3.0; 359 361 break; 360 case kLetterbox_4_3:361 case kLetterbox_16_9:362 362 default: 363 363 // standard, fill viewport with scaled image 364 364 hscale = vscale = fmin(h * 1.0 / sh, w * 1.0 / sw); -
libs/libmythtv/tv_play.h
234 234 235 235 void ChangeVolume(bool up); 236 236 void ToggleMute(void); 237 void ToggleLetterbox(int letterboxMode = -1); 237 void ToggleAspectOverride(int aspectMode = -1); 238 void ToggleAdjustFill(int adjustfillMode = -1); 238 239 239 240 bool FillMenuTracks(OSDGenericTree*, uint type); 240 241 void ChangeTrack(uint type, int dir); -
libs/libmythtv/NuppelVideoPlayer.h
170 170 void SetVideoResize(const QRect &videoRect); 171 171 172 172 // Toggle Sets 173 void ToggleLetterbox(int letterboxMode = -1); 173 void ToggleAspectOverride(int aspectMode = -1); 174 void ToggleAdjustFill(int adjustfillMode = -1); 174 175 175 176 // Gets 176 177 int GetVideoWidth(void) const { return video_width; } … … 179 180 float GetFrameRate(void) const { return video_frame_rate; } 180 181 181 182 int GetSecondsBehind(void) const; 182 int GetLetterbox(void) const; 183 int GetAspectOverride(void) const; 184 int GetAdjustFill(void) const; 183 185 int GetFFRewSkip(void) const { return ffrew_skip; } 184 186 float GetAudioStretchFactor(void) const { return audio_stretchfactor; } 185 187 float GetNextPlaySpeed(void) const { return next_play_speed; } -
libs/libmythtv/tv_play.cpp
2295 2295 ToggleRecord(); 2296 2296 else if (action == "VOLUMEDOWN" || action == "VOLUMEUP" || 2297 2297 action == "STRETCHINC" || action == "STRETCHDEC" || 2298 action == "MUTE" || action == "TOGGLEASPECT" )2298 action == "MUTE" || action == "TOGGLEASPECT" || action == "TOGGLEFILL" ) 2299 2299 { 2300 2300 passThru = 1; 2301 2301 handled = false; … … 2890 2890 else if (action == "STRETCHDEC") 2891 2891 ChangeTimeStretch(-1); 2892 2892 else if (action == "TOGGLEASPECT") 2893 ToggleLetterbox(); 2893 ToggleAspectOverride(); 2894 else if (action == "TOGGLEFILL") 2895 ToggleAdjustFill(); 2894 2896 else if (action == "MENU") 2895 2897 ShowOSDTreeMenu(); 2896 2898 else … … 5434 5436 wantsToQuit = true; 5435 5437 } 5436 5438 5437 void TV::Toggle Letterbox(int letterboxMode)5439 void TV::ToggleAspectOverride(int aspectMode) 5438 5440 { 5439 nvp->Toggle Letterbox(letterboxMode);5440 int letterbox = nvp->GetLetterbox();5441 nvp->ToggleAspectOverride(aspectMode); 5442 int aspectoverride = nvp->GetAspectOverride(); 5441 5443 QString text; 5442 5444 5443 switch ( letterbox)5445 switch (aspectoverride) 5444 5446 { 5445 case kLetterbox_4_3: text = tr("4:3"); break; 5446 case kLetterbox_16_9: text = tr("16:9"); break; 5447 case kLetterbox_4_3_Zoom: text = tr("4:3 Zoom"); break; 5448 case kLetterbox_16_9_Zoom: text = tr("16:9 Zoom"); break; 5449 case kLetterbox_16_9_Stretch: text = tr("16:9 Stretch"); break; 5450 case kLetterbox_Fill: text = tr("Fill"); break; 5447 case kAspect_4_3: text = tr("4:3"); break; 5448 case kAspect_16_9: text = tr("16:9"); break; 5451 5449 default: text = tr("Off"); break; 5452 5450 } 5453 5451 … … 5455 5453 GetOSD()->SetSettingsText(text, 3); 5456 5454 } 5457 5455 5456 void TV::ToggleAdjustFill(int adjustfillMode) 5457 { 5458 nvp->ToggleAdjustFill(adjustfillMode); 5459 int adjustfill = nvp->GetAdjustFill(); 5460 QString text; 5461 5462 switch (adjustfill) 5463 { 5464 case kAdjustFill_Half: text = tr("Half Zoom"); break; 5465 case kAdjustFill_Full: text = tr("Full Zoom"); break; 5466 case kAdjustFill_Stretch: text = tr("Zoom & Stretch"); break; 5467 default: text = tr("Off"); break; 5468 } 5469 5470 if (GetOSD() && !browsemode && !GetOSD()->IsRunningTreeMenu()) 5471 GetOSD()->SetSettingsText(text, 3); 5472 } 5473 5458 5474 void TV::EPGChannelUpdate(uint chanid, QString channum) 5459 5475 { 5460 5476 if (chanid && !channum.isEmpty()) … … 6488 6504 } 6489 6505 else if (action.left(12) == "TOGGLEASPECT") 6490 6506 { 6491 Toggle Letterbox(action.right(1).toInt());6507 ToggleAspectOverride(action.right(1).toInt()); 6492 6508 } 6509 else if (action.left(10) == "TOGGLEFILL") 6510 { 6511 ToggleAdjustFill(action.right(1).toInt()); 6512 } 6493 6513 else if (action == "GUIDE") 6494 6514 EditSchedule(kScheduleProgramGuide); 6495 6515 else if (action == "FINDER") … … 6728 6748 FillMenuTracks(treeMenu, kTrackTypeTeletextCaptions); 6729 6749 } 6730 6750 6731 int letterbox = nvp->GetLetterbox();6751 int aspectoverride = nvp->GetAspectOverride(); 6732 6752 item = new OSDGenericTree(treeMenu, tr("Change Aspect Ratio")); 6733 6753 subitem = new OSDGenericTree(item, tr("Off"), "TOGGLEASPECT" + 6734 QString("%1").arg(k Letterbox_Off),6735 (( letterbox <= kLetterbox_Off) ||6736 ( letterbox >= kLetterbox_END)) ? 1 : 0,6754 QString("%1").arg(kAspect_Off), 6755 ((aspectoverride <= kAspect_Off) || 6756 (aspectoverride >= kAspect_END)) ? 1 : 0, 6737 6757 NULL, "ASPECTGROUP"); 6738 6758 subitem = new OSDGenericTree(item, tr("4:3"), "TOGGLEASPECT" + 6739 QString("%1").arg(k Letterbox_4_3),6740 ( letterbox == kLetterbox_4_3) ? 1 : 0,6759 QString("%1").arg(kAspect_4_3), 6760 (aspectoverride == kAspect_4_3) ? 1 : 0, 6741 6761 NULL, "ASPECTGROUP"); 6742 6762 subitem = new OSDGenericTree(item, tr("16:9"), "TOGGLEASPECT" + 6743 QString("%1").arg(k Letterbox_16_9),6744 ( letterbox == kLetterbox_16_9) ? 1 : 0,6763 QString("%1").arg(kAspect_16_9), 6764 (aspectoverride == kAspect_16_9) ? 1 : 0, 6745 6765 NULL, "ASPECTGROUP"); 6746 subitem = new OSDGenericTree(item, tr("4:3 Zoom"), "TOGGLEASPECT" +6747 QString("%1").arg(kLetterbox_4_3_Zoom),6748 (letterbox == kLetterbox_4_3_Zoom) ? 1 : 0,6749 NULL, "ASPECTGROUP");6750 subitem = new OSDGenericTree(item, tr("16:9 Zoom"), "TOGGLEASPECT" +6751 QString("%1").arg(kLetterbox_16_9_Zoom),6752 (letterbox == kLetterbox_16_9_Zoom) ? 1 : 0,6753 NULL, "ASPECTGROUP");6754 subitem = new OSDGenericTree(item, tr("16:9 Stretch"), "TOGGLEASPECT" +6755 QString("%1").arg(kLetterbox_16_9_Stretch),6756 (letterbox == kLetterbox_16_9_Stretch) ? 1 : 0,6757 NULL, "ASPECTGROUP");6758 subitem = new OSDGenericTree(item, tr("Fill"), "TOGGLEASPECT" +6759 QString("%1").arg(kLetterbox_Fill),6760 (letterbox == kLetterbox_Fill) ? 1 : 0,6761 NULL, "ASPECTGROUP");6762 6766 6767 int adjustfill = nvp->GetAdjustFill(); 6768 item = new OSDGenericTree(treeMenu, tr("Adjust Fill")); 6769 subitem = new OSDGenericTree(item, tr("Off"), "TOGGLEFILL" + 6770 QString("%1").arg(kAdjustFill_Off), 6771 ((adjustfill <= kAdjustFill_Off) || 6772 (adjustfill >= kAdjustFill_END)) ? 1 : 0, 6773 NULL, "ADJUSTFILLGROUP"); 6774 subitem = new OSDGenericTree(item, tr("Half"), "TOGGLEFILL" + 6775 QString("%1").arg(kAdjustFill_Half), 6776 (adjustfill == kAdjustFill_Half) ? 1 : 0, 6777 NULL, "ADJUSTFILLGROUP"); 6778 subitem = new OSDGenericTree(item, tr("Full"), "TOGGLEFILL" + 6779 QString("%1").arg(kAdjustFill_Full), 6780 (adjustfill == kAdjustFill_Full) ? 1 : 0, 6781 NULL, "ADJUSTFILLGROUP"); 6782 subitem = new OSDGenericTree(item, tr("Stretch"), "TOGGLEFILL" + 6783 QString("%1").arg(kAdjustFill_Stretch), 6784 (adjustfill == kAdjustFill_Stretch) ? 1 : 0, 6785 NULL, "ADJUSTFILLGROUP"); 6786 6763 6787 if (db_use_picture_attr) 6764 6788 { 6765 6789 item = new OSDGenericTree(treeMenu, tr("Adjust Picture")); -
libs/libmythtv/videooutbase.cpp
151 151 db_display_dim(0,0), db_move(0,0), 152 152 db_scale_horiz(0.0f), db_scale_vert(0.0f), 153 153 db_pip_location(0), db_pip_size(26), 154 db_letterbox(kLetterbox_Off), db_deint_filtername(QString::null), 154 db_aspectoverride(kAspect_Off), db_adjustfill(kAdjustFill_Off), 155 db_deint_filtername(QString::null), 155 156 156 157 // Manual Zoom 157 158 mz_scale(0), mz_move(0,0), … … 163 164 video_dim(640,480), video_aspect(1.3333f), 164 165 165 166 // Aspect override 166 letterboxed_video_aspect(1.3333f), letterbox(kLetterbox_Off),167 overriden_video_aspect(1.3333f), aspectoverride(kAspect_Off), 167 168 169 // Adjust Fill 170 adjustfill(kAdjustFill_Off), 171 168 172 // Screen settings 169 173 video_rect(0,0,0,0), display_video_rect(0,0,0,0), 170 174 display_visible_rect(0,0,0,0), tmp_display_visible_rect(0,0,0,0), … … 211 215 db_pict_attr[kPictureAttribute_Hue] = 212 216 gContext->GetNumSetting("PlaybackHue", 0); 213 217 214 db_letterbox = gContext->GetNumSetting("AspectOverride", 0); 218 db_aspectoverride = gContext->GetNumSetting("AspectOverride", 0); 219 db_adjustfill = gContext->GetNumSetting("AdjustFill", 0); 215 220 db_deint_filtername= gContext->GetSetting("DeinterlaceFilter", 216 221 "linearblend"); 217 222 } … … 255 260 video_dim = QSize(width, height); 256 261 video_rect = QRect(QPoint(winx, winy), fix_1080i(video_dim)); 257 262 258 letterbox = db_letterbox; 263 aspectoverride = db_aspectoverride; 264 adjustfill = db_adjustfill; 259 265 260 266 VideoAspectRatioChanged(aspect); // apply aspect ratio and letterbox mode 261 267 … … 376 382 /** 377 383 * \fn VideoOutput::SetVideoAspectRatio(float aspect) 378 384 * \brief Sets VideoOutput::video_aspect to aspect, and sets 379 * VideoOutput:: letterboxed_video_aspect the letterbox type, unless380 * the letterbox type is kLetterbox_Fill.385 * VideoOutput::overriden_video_aspect if aspectoverride 386 * is set to either 4:3 or 16:9. 381 387 * 382 388 * \param aspect video aspect ratio to use 383 389 */ 384 390 void VideoOutput::SetVideoAspectRatio(float aspect) 385 391 { 386 letterboxed_video_aspect = video_aspect = aspect;387 392 overriden_video_aspect = video_aspect = aspect; 393 388 394 // Override video's aspect if configured to do so 389 if ((kLetterbox_4_3 == letterbox) || 390 (kLetterbox_4_3_Zoom == letterbox)) 395 if (kAspect_4_3 == aspectoverride) 391 396 { 392 letterboxed_video_aspect = 4.0f / 3.0f;397 overriden_video_aspect = 4.0f / 3.0f; 393 398 } 394 else if ((kLetterbox_16_9 == letterbox) || 395 (kLetterbox_16_9_Zoom == letterbox)) 399 else if (kAspect_16_9 == aspectoverride) 396 400 { 397 letterboxed_video_aspect = 16.0f / 9.0f;401 overriden_video_aspect = 16.0f / 9.0f; 398 402 } 399 403 } 400 404 … … 548 552 float dispPixelAdj = (GetDisplayAspect() * display_visible_rect.height()) / display_visible_rect.width(); 549 553 // now adjust for scaling of the video on the aspect ratio 550 554 float vs = ((float)vb.width())/vb.height(); 551 visible_aspect = 1.3333f * (vs/ letterboxed_video_aspect) * dispPixelAdj;555 visible_aspect = 1.3333f * (vs/overriden_video_aspect) * dispPixelAdj; 552 556 553 557 // now adjust for scaling of the video on the size 554 558 font_scaling = 1.0f/sqrtf(2.0/(sq(visible_aspect / 1.3333f) + 1.0f)); 555 559 // now adjust for aspect ratio effect on font size (should be in osd.cpp?) 556 font_scaling *= sqrtf( letterboxed_video_aspect/1.3333f);560 font_scaling *= sqrtf(overriden_video_aspect/1.3333f); 557 561 return vb; 558 562 } 559 563 … … 717 721 void VideoOutput::ApplyLetterboxing(void) 718 722 { 719 723 float disp_aspect = fix_aspect(GetDisplayAspect()); 720 float aspect_diff = disp_aspect - letterboxed_video_aspect;724 float aspect_diff = disp_aspect - overriden_video_aspect; 721 725 bool aspects_match = abs(aspect_diff / disp_aspect) <= 0.1f; 722 bool nomatch_with_fill = !aspects_match && ( letterbox == kLetterbox_Fill);726 bool nomatch_with_fill = !aspects_match && (adjustfill == kAdjustFill_Stretch); 723 727 bool nomatch_without_fill = (!aspects_match) && !nomatch_with_fill; 724 728 725 729 // Adjust for video/display aspect ratio mismatch 726 if (nomatch_with_fill && (disp_aspect > letterboxed_video_aspect))730 if (nomatch_with_fill && (disp_aspect > overriden_video_aspect)) 727 731 { 728 732 float pixNeeded = 729 ((disp_aspect / letterboxed_video_aspect) *733 ((disp_aspect / overriden_video_aspect) * 730 734 (float)display_video_rect.height()) + 0.5f; 731 735 732 736 display_video_rect.moveTop( … … 737 741 else if (nomatch_with_fill) 738 742 { 739 743 float pixNeeded = 740 (( letterboxed_video_aspect / disp_aspect) *744 ((overriden_video_aspect / disp_aspect) * 741 745 (float)display_video_rect.width()) + 0.5f; 742 746 743 747 display_video_rect.moveLeft( … … 746 750 747 751 display_video_rect.setWidth((int)pixNeeded); 748 752 } 749 else if (nomatch_without_fill && (disp_aspect > letterboxed_video_aspect))753 else if (nomatch_without_fill && (disp_aspect > overriden_video_aspect)) 750 754 { 751 755 float pixNeeded = 752 (( letterboxed_video_aspect / disp_aspect) *756 ((overriden_video_aspect / disp_aspect) * 753 757 (float)display_video_rect.width()) + 0.5f; 754 758 755 759 display_video_rect.moveLeft( … … 761 765 else if (nomatch_without_fill) 762 766 { 763 767 float pixNeeded = 764 ((disp_aspect / letterboxed_video_aspect) *768 ((disp_aspect / overriden_video_aspect) * 765 769 (float)display_video_rect.height()) + 0.5f; 766 770 767 771 display_video_rect.moveTop( … … 772 776 } 773 777 774 778 // Process letterbox zoom modes 775 if ((letterbox == kLetterbox_4_3_Zoom) || 776 (letterbox == kLetterbox_16_9_Zoom)) 779 if (adjustfill == kAdjustFill_Full) 777 780 { 778 781 // Zoom mode -- Expand by 4/3 and overscan. 779 782 // 1/6 of original is 1/8 of new … … 783 786 display_video_rect.width() * 4 / 3, 784 787 display_video_rect.height() * 4 / 3); 785 788 } 786 else if ( letterbox == kLetterbox_16_9_Stretch)789 else if (adjustfill == kAdjustFill_Half) 787 790 { 791 // Zoom mode -- Expand by 7/6 and overscan. 792 // Intended for eliminating the top bars on 14:9 material. 793 // Also good compromise for 4:3 material on 16:9 screen. 794 // Expanding by 7/6, so remove 1/6 of original from overscan; 795 // take half from each side, so remove 1/12. 796 display_video_rect = QRect( 797 display_video_rect.left() - (display_video_rect.width() / 12), 798 display_video_rect.top() - (display_video_rect.height() / 12), 799 display_video_rect.width() * 7 / 6, 800 display_video_rect.height() * 7 / 6); 801 } 802 803 else if (adjustfill == kAdjustFill_Stretch) 804 { 788 805 // Stretch mode -- intended to be used to eliminate side 789 806 // bars on 4:3 material encoded to 16:9. 790 807 // 1/6 of original is 1/8 of new … … 852 869 printf("Vscan(%f, %f)\n", db_scale_vert, db_scale_vert); 853 870 printf("DisplayAspect: %f\n", GetDisplayAspect()); 854 871 printf("VideoAspect(%f)\n", video_aspect); 855 printf(" letterboxed_video_aspect(%f)\n", letterboxed_video_aspect);872 printf("overriden_video_aspect(%f)\n", overriden_video_aspect); 856 873 printf("CDisplayAspect: %f\n", fix_aspect(GetDisplayAspect())); 857 printf("Letterbox: %d\n", letterbox); 874 printf("AspectOverride: %d\n", aspectoverride); 875 printf("AdjustFill: %d\n", adjustfill); 858 876 #endif 859 877 860 878 VERBOSE(VB_PLAYBACK, … … 869 887 "height: %4, aspect: %5") 870 888 .arg(video_rect.left()).arg(video_rect.top()) 871 889 .arg(video_rect.width()).arg(video_rect.height()) 872 .arg( letterboxed_video_aspect));890 .arg(overriden_video_aspect)); 873 891 874 892 } 875 893 … … 881 899 * then we letterbox settings, and finally we apply manual 882 900 * scale & move properties for "Zoom Mode". 883 901 * 884 * \sa Zoom(int), Toggle Letterbox(int)902 * \sa Zoom(int), ToggleAdjustFill(int) 885 903 */ 886 904 void VideoOutput::MoveResize(void) 887 905 { … … 904 922 * \fn VideoOutput::Zoom(int) 905 923 * \brief Sets up zooming into to different parts of the video, the zoom 906 924 * is actually applied in MoveResize(). 907 * \sa Toggle Letterbox(int), GetLetterbox()925 * \sa ToggleAdjustFill(int) 908 926 */ 909 927 void VideoOutput::Zoom(int direction) 910 928 { … … 938 956 } 939 957 940 958 /** 941 * \fn VideoOutput::Toggle Letterbox(int)942 * \brief Sets up letterboxing for various standard video frame and943 * monitor dimensions,then calls VideoAspectRatioChanged(float)959 * \fn VideoOutput::ToggleAspectOverride(int) 960 * \brief Enforce different aspect ration than detected, 961 * then calls VideoAspectRatioChanged(float) 944 962 * to apply them. 945 * \sa Zoom(int), 963 * \sa Zoom(int), ToggleAdjustFill(int) 946 964 */ 947 void VideoOutput::Toggle Letterbox(int letterboxMode)965 void VideoOutput::ToggleAspectOverride(int aspectMode) 948 966 { 949 if ( letterboxMode == kLetterbox_Toggle)967 if (aspectMode == kAspect_Toggle) 950 968 { 951 if (++ letterbox >= kLetterbox_END)952 letterbox = kLetterbox_Off;969 if (++aspectoverride >= kAspect_END) 970 aspectoverride = kAspect_Off; 953 971 } 954 972 else 955 973 { 956 letterbox = letterboxMode;974 aspectoverride = aspectMode; 957 975 } 958 976 959 977 VideoAspectRatioChanged(video_aspect); 960 978 } 961 979 980 /** 981 * \fn VideoOutput::ToggleAdjustFill(int) 982 * \brief Sets up letterboxing for various standard video frame and 983 * monitor dimensions, then calls MoveResize() 984 * to apply them. 985 * \sa Zoom(int), ToggleAspectOverride(int) 986 */ 987 void VideoOutput::ToggleAdjustFill(int adjustfillMode) 988 { 989 if (adjustfillMode == kAdjustFill_Toggle) 990 { 991 if (++adjustfill >= kAdjustFill_END) 992 adjustfill = kAdjustFill_Off; 993 } 994 else 995 { 996 adjustfill = adjustfillMode; 997 } 998 999 MoveResize(); 1000 } 1001 962 1002 int VideoOutput::ChangePictureAttribute(int attributeType, bool direction) 963 1003 { 964 1004 int curVal = GetPictureAttribute(attributeType); … … 1109 1149 int letterXadj = 0; 1110 1150 int letterYadj = 0; 1111 1151 float letterAdj = 1.0f; 1112 if ( letterbox != kLetterbox_Off)1152 if (aspectoverride != kAspect_Off) 1113 1153 { 1114 1154 letterXadj = max(-display_video_rect.left(), 0); 1115 1155 float xadj = (float) video_rect.width() / display_visible_rect.width(); … … 1119 1159 letterYadj = max(-display_video_rect.top(), 0); 1120 1160 letterYadj = (int) (letterYadj * yadj); 1121 1161 1122 letterAdj = video_aspect / letterboxed_video_aspect;1162 letterAdj = video_aspect / overriden_video_aspect; 1123 1163 } 1124 1164 1125 1165 // adjust for non-square pixels on screen -
libs/libmythtv/videooutbase.h
89 89 kZoomRight 90 90 }; 91 91 92 enum LetterboxModes92 enum AdjustFillModes 93 93 { 94 kLetterbox_Toggle = -1, 95 kLetterbox_Off = 0, 96 kLetterbox_4_3, 97 kLetterbox_16_9, 98 kLetterbox_4_3_Zoom, 99 kLetterbox_16_9_Zoom, 100 kLetterbox_16_9_Stretch, 101 kLetterbox_Fill, 102 kLetterbox_END 94 kAdjustFill_Toggle = -1, 95 kAdjustFill_Off = 0, 96 kAdjustFill_Half, 97 kAdjustFill_Full, 98 kAdjustFill_Stretch, 99 kAdjustFill_END 103 100 }; 104 101 102 enum AspectOverrideModes 103 { 104 kAspect_Toggle = -1, 105 kAspect_Off = 0, 106 kAspect_4_3, 107 kAspect_16_9, 108 kAspect_END 109 }; 110 105 111 enum FrameScanType 106 112 { 107 113 kScan_Ignore = -1, … … 200 206 /// \brief Returns current display aspect ratio. 201 207 virtual float GetDisplayAspect(void) const { return display_aspect; } 202 208 203 /// \brief Returns current letterboxingmode204 /// \sa Toggle Letterbox(int)205 int Get Letterbox(void) { return letterbox; }206 void Toggle Letterbox(int letterboxMode = kLetterbox_Toggle);209 /// \brief Returns current aspect override mode 210 /// \sa ToggleAspectOverride(int) 211 int GetAspectOverride(void) { return aspectoverride; } 212 void ToggleAspectOverride(int aspectOverrideMode = kAspect_Toggle); 207 213 214 /// \brief Returns current adjust fill mode 215 /// \sa ToggleAdjustFill(int) 216 int GetAdjustFill(void) { return adjustfill; } 217 void ToggleAdjustFill(int adjustFillMode = kAdjustFill_Toggle); 218 208 219 // pass in null to use the pause frame, if it exists. 209 220 virtual void ProcessFrame(VideoFrame *frame, OSD *osd, 210 221 FilterChain *filterList, … … 343 354 int db_pip_location; 344 355 int db_pip_size; ///< percentage of full window to use for PiP 345 356 QMap<int,int> db_pict_attr; ///< Picture settings 346 int db_letterbox; 357 int db_aspectoverride; 358 int db_adjustfill; 347 359 QString db_deint_filtername; 348 360 349 361 // Manual Zoom … … 359 371 float video_aspect; ///< Physical aspect ratio of video 360 372 361 373 /// Normally this is the same as videoAspect, but may not be 362 /// if the user has toggled to a different "letterbox" mode. 363 float letterboxed_video_aspect; 364 /// LetterboxMode to use to modify letterboxed_video_aspect 365 int letterbox; 374 /// if the user has toggled the aspect override mode. 375 float overriden_video_aspect; 376 /// AspectOverrideMode to use to modify overriden_video_aspect 377 int aspectoverride; 378 /// Zoom mode 379 int adjustfill; 366 380 367 381 /// Pixel rectangle in video frame to display 368 382 QRect video_rect; -
programs/mythfrontend/globalsettings.cpp
1500 1500 gc->addSelection(QObject::tr("Off"), "0"); 1501 1501 gc->addSelection(QObject::tr("4/3"), "1"); 1502 1502 gc->addSelection(QObject::tr("16/9"), "2"); 1503 gc->addSelection(QObject::tr("4/3 Zoom"), "3");1504 gc->addSelection(QObject::tr("16/9 Zoom"), "4");1505 gc->addSelection(QObject::tr("16/9 Stretch"), "5");1506 gc->addSelection(QObject::tr("Fill"), "6");1507 1503 gc->setHelpText(QObject::tr("This will override any aspect ratio in the " 1508 1504 "recorded stream, the same as pressing the W Key during " 1509 "playback. Fill will \"fill\" the screen with the image " 1510 "clipping as required. Fill is useful when using 4:3 " 1511 "interlaced TV's for display.")); 1505 "playback.")); 1512 1506 return gc; 1513 1507 } 1514 1508 1509 static HostComboBox *AdjustFill() 1510 { 1511 HostComboBox *gc = new HostComboBox("AdjustFill"); 1512 gc->setLabel(QObject::tr("Zoom")); 1513 gc->addSelection(QObject::tr("Off"), "0"); 1514 gc->addSelection(QObject::tr("Half"), "1"); 1515 gc->addSelection(QObject::tr("Full"), "2"); 1516 gc->addSelection(QObject::tr("Stretch"), "3"); 1517 return gc; 1518 } 1519 1515 1520 // Theme settings 1516 1521 1517 1522 static HostSpinBox *GuiWidth() … … 3506 3511 general->addChild(UseVideoTimebase()); 3507 3512 general->addChild(DecodeExtraAudio()); 3508 3513 general->addChild(AspectOverride()); 3514 // general->addChild(AdjustFill()); 3509 3515 general->addChild(PIPLocation()); 3510 3516 addChild(general); 3511 3517