From 6412eb79c4bf043c969f101dfbe5a3aefa8ddea8 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Thu, 23 Feb 2012 23:27:53 +0100 Subject: [PATCH] spark: use ioctl instead of /proc to get video format Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/3e37ee54a644ddb4abb61cdef1fc7509f5e42204 Author: Stefan Seyfried Date: 2012-02-23 (Thu, 23 Feb 2012) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libspark/video.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/libspark/video.cpp b/libspark/video.cpp index fa32ae4..f8e26ce 100644 --- a/libspark/video.cpp +++ b/libspark/video.cpp @@ -194,11 +194,14 @@ int cVideo::setAspectRatio(int aspect, int mode) int cVideo::getAspectRatio(void) { - int ratio = 0; /* proc: 0 = 4:3, 1 = 16:9 */ - ratio = proc_get_hex("/proc/stb/vmpeg/0/aspect"); - if (ratio >= 0) - return ratio * 2 + 1; /* return: 1 = 4:3, 3 = 16:9 */ - return ratio; + video_size_t s; + if (fop(ioctl, VIDEO_GET_SIZE, &s) < 0) + { + lt_info("%s: VIDEO_GET_SIZE %m\n", __func__); + return -1; + } + lt_debug("%s: %d\n", __func__, s.aspect_ratio); + return s.aspect_ratio * 2 + 1; } int cVideo::setCroppingMode(int /*vidDispMode_t format*/)