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; }
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()
// 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;
}
static Video* getInstance();
int init(UCHAR format);
+ int reinit(); // for aspect change
int shutdown();
// Video formats - AV_SET_VID_DISP_FMT
int attachFrameBuffer(); // What does this do?
- int write(char *buf, int len);
-
int getFD();
UCHAR getFormat();
UINT getScreenWidth();