Most of our Readers place 1:1 as pixel aspect ratio for undistorted video,
which doesn't seem to be correct from how I read the BeBook. Ignore it for now which is pretty unlikely to be a problem. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31511 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -359,8 +359,8 @@ Controller::PlayerActivated(bool active)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Controller::GetSize(int *width, int *height, int* widthAspect,
|
Controller::GetSize(int *width, int *height, int* _widthAspect,
|
||||||
int* heightAspect)
|
int* _heightAspect)
|
||||||
{
|
{
|
||||||
BAutolock _(this);
|
BAutolock _(this);
|
||||||
|
|
||||||
@@ -368,17 +368,29 @@ Controller::GetSize(int *width, int *height, int* widthAspect,
|
|||||||
media_format format = fVideoTrackSupplier->Format();
|
media_format format = fVideoTrackSupplier->Format();
|
||||||
*height = format.u.raw_video.display.line_count;
|
*height = format.u.raw_video.display.line_count;
|
||||||
*width = format.u.raw_video.display.line_width;
|
*width = format.u.raw_video.display.line_width;
|
||||||
if (widthAspect != NULL)
|
int widthAspect = 0;
|
||||||
*widthAspect = format.u.raw_video.pixel_width_aspect;
|
int heightAspect = 0;
|
||||||
if (heightAspect != NULL)
|
// Inore format aspect when both values are 1. If they have been
|
||||||
*heightAspect = format.u.raw_video.pixel_height_aspect;
|
// intentionally at 1:1 then no harm is done for quadratic videos,
|
||||||
|
// only if the video is indeed encoded anamorphotic, but supposed
|
||||||
|
// to be displayed quadratic... extremely unlikely.
|
||||||
|
if (format.u.raw_video.pixel_width_aspect
|
||||||
|
!= format.u.raw_video.pixel_height_aspect
|
||||||
|
&& format.u.raw_video.pixel_width_aspect != 1) {
|
||||||
|
widthAspect = format.u.raw_video.pixel_width_aspect;
|
||||||
|
heightAspect = format.u.raw_video.pixel_height_aspect;
|
||||||
|
}
|
||||||
|
if (_widthAspect != NULL)
|
||||||
|
*_widthAspect = widthAspect;
|
||||||
|
if (_heightAspect != NULL)
|
||||||
|
*_heightAspect = heightAspect;
|
||||||
} else {
|
} else {
|
||||||
*height = 0;
|
*height = 0;
|
||||||
*width = 0;
|
*width = 0;
|
||||||
if (widthAspect != NULL)
|
if (_widthAspect != NULL)
|
||||||
*widthAspect = 1;
|
*_widthAspect = 1;
|
||||||
if (heightAspect != NULL)
|
if (_heightAspect != NULL)
|
||||||
*heightAspect = 1;
|
*_heightAspect = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user