]> git.vomp.tv Git - vompclient.git/commitdiff
New aspect mode change code
authorChris Tallon <chris@vomp.tv>
Tue, 6 Sep 2005 17:47:12 +0000 (17:47 +0000)
committerChris Tallon <chris@vomp.tv>
Tue, 6 Sep 2005 17:47:12 +0000 (17:47 +0000)
video.cc
video.h

index 1a8ee98cd88fbecffc0700125bde700bf670d1ae..bd31e90fa3af1f7e98b4622540b2e4e88829bb48 100644 (file)
--- 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 6b0c80e4559fb7d6f2c88006944b835e51220f75..f5d822b144b699ea9dd95d88c89321359da4adcf 100644 (file)
--- 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();