spark: use proc_tools

Origin commit data
------------------
Branch: master
Commit: 0d30ab013e
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2013-11-02 (Sat, 02 Nov 2013)


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

------------------
This commit was generated by Migit
This commit is contained in:
Stefan Seyfried
2013-11-02 20:24:56 +01:00
committed by max_10
parent 684bd44984
commit 8db26cdbf6
2 changed files with 9 additions and 58 deletions

View File

@@ -7,6 +7,8 @@
#include <unistd.h>
#include <linux/dvb/audio.h>
#include <proc_tools.h>
#include "audio_lib.h"
#include "audio_mixer.h"
#include "lt_debug.h"
@@ -19,19 +21,6 @@
cAudio * audioDecoder = NULL;
static int proc_put(const char *path, const char *value, const int len)
{
int ret, ret2;
int pfd = open(path, O_WRONLY);
if (pfd < 0)
return pfd;
ret = write(pfd, value, len);
ret2 = close(pfd);
if (ret2 < 0)
return ret2;
return ret;
}
cAudio::cAudio(void *, void *, void *)
{
fd = -1;
@@ -117,7 +106,6 @@ int map_volume(const int volume)
return vol;
}
int cAudio::setVolume(unsigned int left, unsigned int right)
{
lt_debug("%s(%d, %d)\n", __func__, left, right);

View File

@@ -38,6 +38,9 @@
#include <bpamem.h>
#include "video_lib.h"
#include "lt_debug.h"
#include <proc_tools.h>
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_VIDEO, this, args)
#define lt_info(args...) _lt_info(TRIPLE_DEBUG_VIDEO, this, args)
#define lt_debug_c(args...) _lt_debug(TRIPLE_DEBUG_VIDEO, NULL, args)
@@ -102,46 +105,6 @@ static const char *VMPEG_framerate[] = {
#define VIDEO_STREAMTYPE_H265_HEVC 7
#define VIDEO_STREAMTYPE_AVS 16
static int proc_put(const char *path, const char *value, const int len)
{
int ret, ret2;
int pfd = open(path, O_WRONLY);
if (pfd < 0)
return pfd;
ret = write(pfd, value, len);
ret2 = close(pfd);
if (ret2 < 0)
return ret2;
return ret;
}
static int proc_get(const char *path, char *value, const int len)
{
int ret, ret2;
int pfd = open(path, O_RDONLY);
if (pfd < 0)
return pfd;
ret = read(pfd, value, len);
value[len-1] = '\0'; /* make sure string is terminated */
while (ret > 0 && isspace(value[ret-1]))
value[--ret] = '\0'; /* remove trailing whitespace */
ret2 = close(pfd);
if (ret2 < 0)
return ret2;
return ret;
}
static unsigned int proc_get_hex(const char *path)
{
unsigned int n, ret = 0;
char buf[16];
n = proc_get(path, buf, 16);
if (n > 0)
sscanf(buf, "%x", &ret);
return ret;
}
static int hdmi_out(bool enable)
{
struct stmfbio_output_configuration out;