Improve playback of VP9 codec

This commit is contained in:
samsamsam
2019-02-02 18:41:46 +01:00
committed by Thilo Graf
parent 0435571728
commit c298f20a69
18 changed files with 306 additions and 111 deletions

View File

@@ -1,5 +1,5 @@
#ifndef misc_123
#define misc_123
#ifndef _exteplayer3_misc_
#define _exteplayer3_misc_
#include <dirent.h>
#include <sys/types.h>
@@ -20,6 +20,15 @@ typedef struct BitPacker_s
int32_t Remaining; /* number of remaining in the shifter */
} BitPacker_t;
typedef enum
{
STB_UNKNOWN,
STB_DREAMBOX,
STB_VUPLUS,
STB_HISILICON,
STB_OTHER = 999,
} stb_type_t;
/* ***************************** */
/* Makros/Constants */
/* ***************************** */
@@ -33,6 +42,7 @@ typedef struct BitPacker_s
void PutBits(BitPacker_t *ld, uint32_t code, uint32_t length);
void FlushBits(BitPacker_t *ld);
int8_t PlaybackDieNow(int8_t val);
stb_type_t GetSTBType();
/* ***************************** */
/* MISC Functions */
@@ -51,54 +61,6 @@ static inline char *getExtension(char *name)
return NULL;
}
/* the function returns the base name */
static inline char *basename(char *name)
{
int i = 0;
int pos = 0;
while (name[i] != 0)
{
if (name[i] == '/')
pos = i;
i++;
}
if (name[pos] == '/')
pos++;
return name + pos;
}
/* the function returns the directry name */
static inline char *dirname(char *name)
{
static char path[100];
uint32_t i = 0;
int32_t pos = 0;
while ((name[i] != 0) && (i < sizeof(path)))
{
if (name[i] == '/')
{
pos = i;
}
path[i] = name[i];
i++;
}
path[i] = 0;
path[pos] = 0;
return path;
}
static inline int32_t IsDreambox()
{
struct stat buffer;
return (stat("/proc/stb/tpm/0/serial", &buffer) == 0);
}
static inline uint32_t ReadUint32(uint8_t *buffer)
{
uint32_t num = (uint32_t)buffer[0] << 24 |
@@ -115,4 +77,4 @@ static inline uint16_t ReadUInt16(uint8_t *buffer)
return num;
}
#endif
#endif // _exteplayer3_misc_

View File

@@ -28,5 +28,6 @@
int32_t InsertPesHeader(uint8_t *data, int32_t size, uint8_t stream_id, uint64_t pts, int32_t pic_start_code);
int32_t InsertVideoPrivateDataHeader(uint8_t *data, int32_t payload_size);
void UpdatePesHeaderPayloadSize(uint8_t *data, int32_t size);
#endif

View File

@@ -7,6 +7,7 @@
#include "common.h"
typedef enum { eNone, eAudio, eVideo} eWriterType_t;
typedef ssize_t (* WriteV_t)(int, const struct iovec *, int);
typedef struct
{
@@ -23,7 +24,7 @@ typedef struct
unsigned int Height;
unsigned char Version;
unsigned int InfoFlags;
ssize_t (* WriteV) (int, const struct iovec *, int);
WriteV_t WriteV;
} WriterAVCallData_t;
@@ -91,6 +92,8 @@ Writer_t *getDefaultAudioWriter();
ssize_t write_with_retry(int fd, const void *buf, int size);
ssize_t writev_with_retry(int fd, const struct iovec *iov, int ic);
ssize_t WriteWithRetry(Context_t *context, int pipefd, int fd, const void *buf, int size);
ssize_t WriteWithRetry(Context_t *context, int pipefd, int fd, void *pDVBMtx, const void *buf, int size);
void FlushPipe(int pipefd);
ssize_t WriteExt(WriteV_t _call, int fd, void *data, size_t size);
#endif