From c1e45b3e88cd584fcb667fc103b9e6a0d748ea20 Mon Sep 17 00:00:00 2001 From: Chris Tallon Date: Tue, 6 Sep 2005 17:47:12 +0000 Subject: [PATCH] New aspect mode change code --- video.cc | 23 ++++++++++++++++------- video.h | 3 +-- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/video.cc b/video.cc index 1a8ee98..bd31e90 100644 --- a/video.cc +++ b/video.cc @@ -58,8 +58,8 @@ int Video::init(UCHAR tformat) if (!setFormat(tformat)) { shutdown(); return 0; } if (!setConnection(COMPOSITERGB)) { shutdown(); return 0; } - if (!setAspectRatio(ASPECT4X3)) { shutdown(); return 0; } if (!setMode(NORMAL)) { shutdown(); return 0; } + if (!setAspectRatio(ASPECT4X3)) { shutdown(); return 0; } if (!setSource()) { shutdown(); return 0; } if (!attachFrameBuffer()) { shutdown(); return 0; } @@ -68,17 +68,22 @@ int Video::init(UCHAR tformat) return 1; } -int Video::shutdown() +int Video::reinit() { - if (!initted) return 0; - initted = 0; close(fdVideo); + if ((fdVideo = open("/dev/vdec_dev", O_WRONLY)) < 0) return 0; + if (!setSource()) { shutdown(); return 0; } + if (!attachFrameBuffer()) { shutdown(); return 0; } + return 1; } -int Video::write(char *buf, int len) +int Video::shutdown() { - return 1;//write(fdVideo, buf, len); + if (!initted) return 0; + initted = 0; + close(fdVideo); + return 1; } int Video::checkSCART() @@ -149,7 +154,11 @@ int Video::setMode(UCHAR tmode) // mode = LETTERBOX; - if (ioctl(fdVideo, AV_SET_VID_MODE, mode) != 0) return 0; +// if (ioctl(fdVideo, AV_SET_VID_MODE, mode) != 0) return 0; + + int a = ioctl(fdVideo, AV_SET_VID_MODE, mode); + printf("Mode requested: %i, result: %i\n", mode, a); + return 1; } diff --git a/video.h b/video.h index 6b0c80e..f5d822b 100644 --- a/video.h +++ b/video.h @@ -42,6 +42,7 @@ class Video static Video* getInstance(); int init(UCHAR format); + int reinit(); // for aspect change int shutdown(); // Video formats - AV_SET_VID_DISP_FMT @@ -98,8 +99,6 @@ class Video int attachFrameBuffer(); // What does this do? - int write(char *buf, int len); - int getFD(); UCHAR getFormat(); UINT getScreenWidth(); -- 2.39.5