spark: add {open,close}Device() to cVideo

Origin commit data
------------------
Branch: master
Commit: deeea70d0c
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2012-02-14 (Tue, 14 Feb 2012)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2012-02-14 22:38:26 +01:00
parent 3f05476439
commit fc4c7f9dc4
2 changed files with 19 additions and 5 deletions

View File

@@ -104,11 +104,8 @@ static unsigned int proc_get_hex(const char *path)
cVideo::cVideo(int, void *, void *) cVideo::cVideo(int, void *, void *)
{ {
lt_debug("%s\n", __FUNCTION__); lt_debug("%s\n", __FUNCTION__);
if ((fd = open(VIDEO_DEVICE, O_RDWR)) < 0)
lt_info("%s cannot open %s: %m\n", __FUNCTION__, VIDEO_DEVICE);
fcntl(fd, F_SETFD, FD_CLOEXEC);
playstate = VIDEO_STOPPED; openDevice();
//croppingMode = VID_DISPMODE_NORM; //croppingMode = VID_DISPMODE_NORM;
//outputformat = VID_OUTFMT_RGBC_SVIDEO; //outputformat = VID_OUTFMT_RGBC_SVIDEO;
scartvoltage = -1; scartvoltage = -1;
@@ -152,7 +149,6 @@ cVideo::cVideo(int, void *, void *)
cVideo::~cVideo(void) cVideo::~cVideo(void)
{ {
playstate = VIDEO_STOPPED;
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; i++)
{ {
if (blank_data[i]) if (blank_data[i])
@@ -161,8 +157,23 @@ cVideo::~cVideo(void)
} }
/* disable DACs and SCART voltage */ /* disable DACs and SCART voltage */
Standby(true); Standby(true);
closeDevice();
}
void cVideo::openDevice(void)
{
if ((fd = open(VIDEO_DEVICE, O_RDWR)) < 0)
lt_info("%s cannot open %s: %m\n", __FUNCTION__, VIDEO_DEVICE);
fcntl(fd, F_SETFD, FD_CLOEXEC);
playstate = VIDEO_STOPPED;
}
void cVideo::closeDevice(void)
{
if (fd >= 0) if (fd >= 0)
close(fd); close(fd);
fd = -1;
playstate = VIDEO_STOPPED;
} }
int cVideo::setAspectRatio(int aspect, int mode) int cVideo::setAspectRatio(int aspect, int mode)

View File

@@ -138,6 +138,9 @@ class cVideo
void routeVideo(int standby); void routeVideo(int standby);
int video_standby; int video_standby;
int64_t GetPTS(void); int64_t GetPTS(void);
void openDevice(void);
void closeDevice(void);
public: public:
/* constructor & destructor */ /* constructor & destructor */
cVideo(int mode, void *, void *); cVideo(int mode, void *, void *);