mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
spark: use proc_tools
This commit is contained in:
@@ -6,6 +6,8 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <linux/dvb/audio.h>
|
#include <linux/dvb/audio.h>
|
||||||
|
|
||||||
|
#include <proc_tools.h>
|
||||||
#include "audio_hal.h"
|
#include "audio_hal.h"
|
||||||
#include "audio_priv.h"
|
#include "audio_priv.h"
|
||||||
#include "lt_debug.h"
|
#include "lt_debug.h"
|
||||||
@@ -19,19 +21,6 @@
|
|||||||
cAudio * audioDecoder = NULL;
|
cAudio * audioDecoder = NULL;
|
||||||
ADec *adec = NULL;
|
ADec *adec = 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 *)
|
cAudio::cAudio(void *, void *, void *)
|
||||||
{
|
{
|
||||||
adec = new ADec();
|
adec = new ADec();
|
||||||
|
@@ -36,6 +36,9 @@
|
|||||||
#include "video_hal.h"
|
#include "video_hal.h"
|
||||||
#include "video_priv.h"
|
#include "video_priv.h"
|
||||||
#include "lt_debug.h"
|
#include "lt_debug.h"
|
||||||
|
|
||||||
|
#include <proc_tools.h>
|
||||||
|
|
||||||
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_VIDEO, this, args)
|
#define lt_debug(args...) _lt_debug(TRIPLE_DEBUG_VIDEO, this, args)
|
||||||
#define lt_info(args...) _lt_info(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)
|
#define lt_debug_c(args...) _lt_debug(TRIPLE_DEBUG_VIDEO, NULL, args)
|
||||||
@@ -97,46 +100,6 @@ static const char *VMPEG_framerate[] = {
|
|||||||
#define VIDEO_STREAMTYPE_VC1_SM 5
|
#define VIDEO_STREAMTYPE_VC1_SM 5
|
||||||
#define VIDEO_STREAMTYPE_MPEG1 6
|
#define VIDEO_STREAMTYPE_MPEG1 6
|
||||||
|
|
||||||
|
|
||||||
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)
|
static int hdmi_out(bool enable)
|
||||||
{
|
{
|
||||||
struct stmfbio_output_configuration out;
|
struct stmfbio_output_configuration out;
|
||||||
|
Reference in New Issue
Block a user