mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-27 07:22:44 +02:00
spark: fix getAspectRatio and getPictureInfo in MP mode
Origin commit data
------------------
Branch: master
Commit: 93bc0eec06
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2012-04-01 (Sun, 01 Apr 2012)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -221,6 +221,12 @@ int cVideo::setAspectRatio(int aspect, int mode)
|
|||||||
int cVideo::getAspectRatio(void)
|
int cVideo::getAspectRatio(void)
|
||||||
{
|
{
|
||||||
video_size_t s;
|
video_size_t s;
|
||||||
|
if (fd == -1)
|
||||||
|
{
|
||||||
|
/* in movieplayer mode, fd is not opened -> fall back to procfs */
|
||||||
|
int n = proc_get_hex("/proc/stb/vmpeg/0/aspect");
|
||||||
|
return n * 2 + 1;
|
||||||
|
}
|
||||||
if (fop(ioctl, VIDEO_GET_SIZE, &s) < 0)
|
if (fop(ioctl, VIDEO_GET_SIZE, &s) < 0)
|
||||||
{
|
{
|
||||||
lt_info("%s: VIDEO_GET_SIZE %m\n", __func__);
|
lt_info("%s: VIDEO_GET_SIZE %m\n", __func__);
|
||||||
@@ -526,6 +532,15 @@ void cVideo::Pig(int x, int y, int w, int h, int osd_w, int osd_h)
|
|||||||
void cVideo::getPictureInfo(int &width, int &height, int &rate)
|
void cVideo::getPictureInfo(int &width, int &height, int &rate)
|
||||||
{
|
{
|
||||||
video_size_t s;
|
video_size_t s;
|
||||||
|
if (fd == -1)
|
||||||
|
{
|
||||||
|
/* in movieplayer mode, fd is not opened -> fall back to procfs */
|
||||||
|
rate = proc_get_hex("/proc/stb/vmpeg/0/framerate");
|
||||||
|
width = proc_get_hex("/proc/stb/vmpeg/0/xres");
|
||||||
|
height = proc_get_hex("/proc/stb/vmpeg/0/yres");
|
||||||
|
rate /= 1000;
|
||||||
|
return;
|
||||||
|
}
|
||||||
ioctl(fd, VIDEO_GET_SIZE, &s);
|
ioctl(fd, VIDEO_GET_SIZE, &s);
|
||||||
ioctl(fd, VIDEO_GET_FRAME_RATE, &rate);
|
ioctl(fd, VIDEO_GET_FRAME_RATE, &rate);
|
||||||
rate /= 1000;
|
rate /= 1000;
|
||||||
|
Reference in New Issue
Block a user