Ticket #5324: openglvid_7.diff
File openglvid_7.diff, 4.7 KB (added by , 16 years ago) |
---|
-
libs/libmythtv/openglvideo.cpp
diff -ur -X excl mythtvopengl6/libs/libmythtv/openglvideo.cpp mythtvopengl7/libs/libmythtv/openglvideo.cpp
old new 36 36 37 37 OpenGLVideo::OpenGLVideo() : 38 38 gl_context(NULL), video_dim(0,0), 39 viewportSize(0,0), masterViewportSize(0,0),40 display_visible_rect(0,0,0,0), display_video_rect(0,0,0,0),41 video_rect(0,0,0,0), frameBufferRect(0,0,0,0),42 softwareDeinterlacer(QString::null),39 actual_video_dim(0,0), viewportSize(0,0), 40 masterViewportSize(0,0), display_visible_rect(0,0,0,0), 41 display_video_rect(0,0,0,0), video_rect(0,0,0,0), 42 frameBufferRect(0,0,0,0), softwareDeinterlacer(QString::null), 43 43 hardwareDeinterlacing(false), 44 44 useColourControl(false), viewportControl(false), 45 45 inputTextureSize(0,0), currentFrameNum(0), … … 94 94 bool viewport_control, bool osd) 95 95 { 96 96 gl_context = glcontext; 97 actual_video_dim = videoDim; 97 98 video_dim = videoDim; 99 if (video_dim.height() == 1088) 100 video_dim.setHeight(1080); 98 101 display_visible_rect = displayVisibleRect; 99 102 display_video_rect = displayVideoRect; 100 103 video_rect = videoRect; … … 140 143 } 141 144 else 142 145 { 143 QSize half_size(video_dim.width() >> 1, video_dim.height() >>1); 146 QSize half_size(actual_video_dim.width() >> 1, 147 actual_video_dim.height() >>1); 144 148 GLuint utex = CreateVideoTexture(half_size, inputTextureSize); 145 149 GLuint vtex = CreateVideoTexture(half_size, inputTextureSize); 146 GLuint ytex = CreateVideoTexture( video_dim, inputTextureSize);;150 GLuint ytex = CreateVideoTexture(actual_video_dim, inputTextureSize);; 147 151 148 152 if ((ytex && utex && vtex) && AddFilter(kGLFilterYUV2RGB)) 149 153 { … … 166 170 "Falling back to software conversion.\n\t\t\t" 167 171 "Any opengl filters will also be disabled."); 168 172 169 GLuint rgb24tex = CreateVideoTexture(video_dim, inputTextureSize); 173 GLuint rgb24tex = CreateVideoTexture(actual_video_dim, 174 inputTextureSize); 170 175 171 176 if (rgb24tex && AddFilter(kGLFilterResize)) 172 177 { … … 547 552 // locking ok 548 553 void OpenGLVideo::UpdateInputFrame(const VideoFrame *frame) 549 554 { 550 if (frame->width != video_dim.width() ||551 frame->height != video_dim.height() ||555 if (frame->width != actual_video_dim.width() || 556 frame->height != actual_video_dim.height() || 552 557 frame->width < 1 || 553 558 frame->height < 1) 554 559 { … … 558 563 559 564 if (filters.count(kGLFilterYUV2RGB) && (frame->codec == FMT_YV12)) 560 565 { 561 UpdateInput(frame->buf, frame->offsets, 0, FMT_YV12, video_dim);566 UpdateInput(frame->buf, frame->offsets, 0, FMT_YV12, actual_video_dim); 562 567 return; 563 568 } 564 569 565 570 // software yuv2rgb 566 if (convertSize != video_dim)571 if (convertSize != actual_video_dim) 567 572 { 568 573 ShutDownYUV2RGB(); 569 574 570 575 VERBOSE(VB_PLAYBACK, LOC + "Init software conversion."); 571 576 572 convertSize = video_dim;577 convertSize = actual_video_dim; 573 578 convertBuf = new unsigned char[ 574 ( video_dim.width() *video_dim.height() * 3) + 128];579 (actual_video_dim.width() * actual_video_dim.height() * 3) + 128]; 575 580 } 576 581 577 582 if (convertBuf) -
libs/libmythtv/openglvideo.h
diff -ur -X excl mythtvopengl6/libs/libmythtv/openglvideo.h mythtvopengl7/libs/libmythtv/openglvideo.h
old new 82 82 QSize GetViewPort(void) const { return viewportSize; } 83 83 void SetVideoRect(const QRect &dispvidrect, const QRect &vidrect) 84 84 { display_video_rect = dispvidrect; video_rect = vidrect;} 85 QSize GetVideoSize(void) const { return video_dim; }85 QSize GetVideoSize(void) const { return actual_video_dim; } 86 86 void SetVideoResize(const QRect &rect); 87 87 void DisableVideoResize(void); 88 88 int SetPictureAttribute(PictureAttribute attributeType, int newValue); … … 112 112 113 113 OpenGLContext *gl_context; 114 114 QSize video_dim; 115 QSize actual_video_dim; 115 116 QSize viewportSize; 116 117 QSize masterViewportSize; 117 118 QRect display_visible_rect;