Ticket #69: aspect.diff
File aspect.diff, 6.2 KB (added by , 19 years ago) |
---|
-
libs/libmythtv/NuppelVideoPlayer.h
101 101 OSD *GetOSD(void) { return osd; } 102 102 103 103 // don't use this on something you're playing 104 char *GetScreenGrab(int secondsin, int &buflen, int &vw, int &vh );104 char *GetScreenGrab(int secondsin, int &buflen, int &vw, int &vh, float &ar); 105 105 106 106 void SetLength(int len) { totalLength = len; } 107 107 int GetLength(void) { return totalLength; } -
libs/libmythtv/NuppelVideoPlayer.cpp
3357 3357 } 3358 3358 3359 3359 char *NuppelVideoPlayer::GetScreenGrab(int secondsin, int &bufflen, int &vw, 3360 int &vh )3360 int &vh, float &ar) 3361 3361 { 3362 3362 using_null_videoout = true; 3363 3363 … … 3423 3423 { 3424 3424 bufflen = 0; 3425 3425 vw = vh = 0; 3426 ar = 0; 3426 3427 return NULL; 3427 3428 } 3428 3429 … … 3432 3433 { 3433 3434 bufflen = 0; 3434 3435 vw = vh = 0; 3436 ar = 0; 3435 3437 return NULL; 3436 3438 } 3437 3439 … … 3452 3454 3453 3455 vw = video_width; 3454 3456 vh = video_height; 3457 ar = video_aspect; 3455 3458 3456 3459 return (char *)outputbuf; 3457 3460 } -
libs/libmythtv/tv_rec.cpp
967 967 */ 968 968 char *TVRec::GetScreenGrab(const ProgramInfo *pginfo, const QString &filename, 969 969 int secondsin, int &bufferlen, 970 int &video_width, int &video_height) 970 int &video_width, int &video_height, 971 float &video_aspect) 971 972 { 972 973 (void) pginfo; 973 974 (void) filename; … … 987 988 nupvidplay->SetAudioSampleRate(audioSampleRateDB); 988 989 989 990 char *retbuf = nupvidplay->GetScreenGrab(secondsin, bufferlen, video_width, 990 video_height );991 video_height, video_aspect); 991 992 992 993 delete nupvidplay; 993 994 delete tmprbuf; -
libs/libmythtv/tv_rec.h
75 75 76 76 char *GetScreenGrab(const ProgramInfo *pginfo, const QString &filename, 77 77 int secondsin, int &bufferlen, 78 int &video_width, int &video_height); 78 int &video_width, int &video_height, 79 float &video_aspect); 79 80 80 81 /// \brief Returns true if event loop has not been told to shut down 81 82 bool IsRunning(void) { return runMainLoop; } -
programs/mythbackend/encoderlink.h
109 109 110 110 char *GetScreenGrab(const ProgramInfo *pginfo, const QString &filename, 111 111 int secondsin, int &bufferlen, 112 int &video_width, int &video_height); 112 int &video_width, int &video_height, 113 float &video_aspect); 113 114 114 115 private: 115 116 int m_capturecardnum; -
programs/mythbackend/mainserver.cpp
10 10 11 11 #include <cstdlib> 12 12 #include <cerrno> 13 #include <math.h> 13 14 #include <unistd.h> 14 15 #include <fcntl.h> 15 16 #include "../../config.h" … … 3171 3172 3172 3173 int len = 0; 3173 3174 int width = 0, height = 0; 3175 float aspect = 0; 3174 3176 int secondsin = gContext->GetNumSetting("PreviewPixmapOffset", 64) + 3175 3177 gContext->GetNumSetting("RecordPreRoll",0); 3176 3178 … … 3178 3180 filename, 3179 3181 secondsin, 3180 3182 len, width, 3181 height );3183 height, aspect); 3182 3184 3183 3185 if (data) 3184 3186 { 3185 3187 QImage img(data, width, height, 32, NULL, 65536 * 65536, 3186 3188 QImage::LittleEndian); 3187 img = img.smoothScale(gContext->GetNumSetting("PreviewPixmapWidth", 160),3188 gContext->GetNumSetting("PreviewPixmapHeight", 120),3189 QImage::ScaleMin);3190 3189 3190 float ppw = gContext->GetNumSetting("PreviewPixmapWidth", 160); 3191 float pph = gContext->GetNumSetting("PreviewPixmapHeight", 120); 3192 3193 if (aspect <= 0) 3194 aspect = ((float) width) / height; 3195 3196 if (aspect > ppw / pph) 3197 pph = rint(ppw / aspect); 3198 else 3199 ppw = rint(pph * aspect); 3200 3201 img = img.smoothScale((int) ppw, (int) pph); 3202 3191 3203 filename += ".png"; 3192 3204 img.save(filename.ascii(), "PNG"); 3193 3205 -
programs/mythbackend/encoderlink.cpp
993 993 char *EncoderLink::GetScreenGrab(const ProgramInfo *pginfo, 994 994 const QString &filename, 995 995 int secondsin, int &bufferlen, 996 int &video_width, int &video_height) 996 int &video_width, int &video_height, 997 float &video_aspect) 997 998 { 998 999 if (local) 999 1000 return tv->GetScreenGrab(pginfo, filename, secondsin, bufferlen, 1000 video_width, video_height );1001 video_width, video_height, video_aspect); 1001 1002 1002 1003 VERBOSE(VB_IMPORTANT, "Should be local only query: GetScreenGrab"); 1003 1004 return NULL;