mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
add libeplayer3 from tdt git
This imports libeplayer3 as of commit 9160371ccc6 (2012-02-02) git://gitorious.org/open-duckbox-project-sh4/tdt.git It would be better to use the original repo, but I need too many changes for now :-(
This commit is contained in:
57
libeplayer3/include/aac.h
Normal file
57
libeplayer3/include/aac.h
Normal file
@@ -0,0 +1,57 @@
|
||||
/*
|
||||
* aac helper
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef acc_123
|
||||
#define acc_123
|
||||
|
||||
#define AAC_HEADER_LENGTH 7
|
||||
|
||||
static inline int aac_get_sample_rate_index (uint32_t sample_rate)
|
||||
{
|
||||
if (96000 <= sample_rate)
|
||||
return 0;
|
||||
else if (88200 <= sample_rate)
|
||||
return 1;
|
||||
else if (64000 <= sample_rate)
|
||||
return 2;
|
||||
else if (48000 <= sample_rate)
|
||||
return 3;
|
||||
else if (44100 <= sample_rate)
|
||||
return 4;
|
||||
else if (32000 <= sample_rate)
|
||||
return 5;
|
||||
else if (24000 <= sample_rate)
|
||||
return 6;
|
||||
else if (22050 <= sample_rate)
|
||||
return 7;
|
||||
else if (16000 <= sample_rate)
|
||||
return 8;
|
||||
else if (12000 <= sample_rate)
|
||||
return 9;
|
||||
else if (11025 <= sample_rate)
|
||||
return 10;
|
||||
else if (8000 <= sample_rate)
|
||||
return 11;
|
||||
else if (7350 <= sample_rate)
|
||||
return 12;
|
||||
else
|
||||
return 13;
|
||||
}
|
||||
|
||||
#endif
|
17
libeplayer3/include/common.h
Normal file
17
libeplayer3/include/common.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#ifndef COMMON_H_
|
||||
#define COMMON_H_
|
||||
|
||||
#include "container.h"
|
||||
#include "output.h"
|
||||
#include "manager.h"
|
||||
#include "playback.h"
|
||||
#include <pthread.h>
|
||||
|
||||
typedef struct Context_s {
|
||||
PlaybackHandler_t * playback;
|
||||
ContainerHandler_t * container;
|
||||
OutputHandler_t * output;
|
||||
ManagerHandler_t * manager;
|
||||
} Context_t;
|
||||
|
||||
#endif
|
48
libeplayer3/include/container.h
Normal file
48
libeplayer3/include/container.h
Normal file
@@ -0,0 +1,48 @@
|
||||
#ifndef CONTAINER_H_
|
||||
#define CONTAINER_H_
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
typedef enum {
|
||||
CONTAINER_INIT,
|
||||
CONTAINER_ADD,
|
||||
CONTAINER_CAPABILITIES,
|
||||
CONTAINER_PLAY,
|
||||
CONTAINER_STOP,
|
||||
CONTAINER_SEEK,
|
||||
CONTAINER_LENGTH,
|
||||
CONTAINER_DEL,
|
||||
CONTAINER_SWITCH_AUDIO,
|
||||
CONTAINER_SWITCH_SUBTITLE,
|
||||
CONTAINER_INFO,
|
||||
CONTAINER_STATUS,
|
||||
CONTAINER_LAST_PTS,
|
||||
CONTAINER_DATA
|
||||
} ContainerCmd_t;
|
||||
|
||||
typedef struct Container_s {
|
||||
char * Name;
|
||||
int (* Command) (/*Context_t*/void *, ContainerCmd_t, void *);
|
||||
char ** Capabilities;
|
||||
|
||||
} Container_t;
|
||||
|
||||
|
||||
extern Container_t FFMPEGContainer;
|
||||
|
||||
static Container_t * AvailableContainer[] = {
|
||||
&FFMPEGContainer,
|
||||
NULL
|
||||
};
|
||||
|
||||
typedef struct ContainerHandler_s {
|
||||
char * Name;
|
||||
Container_t * selectedContainer;
|
||||
Container_t * textSrtContainer;
|
||||
Container_t * textSsaContainer;
|
||||
Container_t * assContainer;
|
||||
|
||||
int (* Command) (/*Context_t*/void *, ContainerCmd_t, void *);
|
||||
} ContainerHandler_t;
|
||||
|
||||
#endif
|
21
libeplayer3/include/debug.h
Normal file
21
libeplayer3/include/debug.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#ifndef debug_123
|
||||
#define debug_123
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
static inline void Hexdump(unsigned char *Data, int length)
|
||||
{
|
||||
|
||||
int k;
|
||||
for (k = 0; k < length; k++)
|
||||
{
|
||||
printf("%02x ", Data[k]);
|
||||
if (((k+1)&31)==0)
|
||||
printf("\n");
|
||||
}
|
||||
printf("\n");
|
||||
|
||||
}
|
||||
|
||||
#endif
|
45
libeplayer3/include/ffmpeg_metadata.h
Normal file
45
libeplayer3/include/ffmpeg_metadata.h
Normal file
@@ -0,0 +1,45 @@
|
||||
#ifndef _ffmpeg_metadata_123
|
||||
#define _ffmpeg_metadata_123
|
||||
|
||||
/* these file contains a list of metadata tags which can be used by applications
|
||||
* to stream specific information. it maps the tags to ffmpeg specific tags.
|
||||
*
|
||||
* fixme: if we add other container for some resons later (maybe some other libs
|
||||
* support better demuxing or something like this), then we should think on a
|
||||
* more generic mechanism!
|
||||
*/
|
||||
|
||||
/* metatdata map list:
|
||||
*/
|
||||
char* metadata_map[] =
|
||||
{
|
||||
/* our tags ffmpeg tag / id3v2 */
|
||||
"Title", "TIT2",
|
||||
"Title", "TT2",
|
||||
"Artist", "TPE1",
|
||||
"Artist", "TP1",
|
||||
"AlbumArtist", "TPE2",
|
||||
"AlbumArtist", "TP2",
|
||||
"Album", "TALB",
|
||||
"Album", "TAL",
|
||||
"Year", "TDRL", /* fixme */
|
||||
"Year", "TDRC", /* fixme */
|
||||
"Comment", "unknown",
|
||||
"Track", "TRCK",
|
||||
"Track", "TRK",
|
||||
"Copyright", "TCOP",
|
||||
"Composer", "TCOM",
|
||||
"Genre", "TCON",
|
||||
"Genre", "TCO",
|
||||
"EncodedBy", "TENC",
|
||||
"EncodedBy", "TEN",
|
||||
"Language", "TLAN",
|
||||
"Performer", "TPE3",
|
||||
"Performer", "TP3",
|
||||
"Publisher", "TPUB",
|
||||
"Encoder", "TSSE",
|
||||
"Disc", "TPOS",
|
||||
NULL
|
||||
};
|
||||
|
||||
#endif
|
77
libeplayer3/include/manager.h
Normal file
77
libeplayer3/include/manager.h
Normal file
@@ -0,0 +1,77 @@
|
||||
#ifndef MANAGER_H_
|
||||
#define MANAGER_H_
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef enum {
|
||||
MANAGER_ADD,
|
||||
MANAGER_LIST,
|
||||
MANAGER_GET,
|
||||
MANAGER_GETNAME,
|
||||
MANAGER_SET,
|
||||
MANAGER_GETENCODING,
|
||||
MANAGER_DEL,
|
||||
MANAGER_GET_TRACK,
|
||||
} ManagerCmd_t;
|
||||
|
||||
typedef enum {
|
||||
eTypeES,
|
||||
eTypePES
|
||||
} eTrackTypeEplayer;
|
||||
|
||||
typedef struct Track_s {
|
||||
char * Name;
|
||||
char * Encoding;
|
||||
int Id;
|
||||
|
||||
/* new field for ffmpeg - add at the end so no problem
|
||||
* can occur with not changed srt saa container
|
||||
*/
|
||||
char* language;
|
||||
|
||||
/* length of track */
|
||||
long long int duration;
|
||||
unsigned int frame_rate;
|
||||
unsigned int TimeScale;
|
||||
int version;
|
||||
long long int pts;
|
||||
|
||||
/* for later use: */
|
||||
eTrackTypeEplayer type;
|
||||
int width;
|
||||
int height;
|
||||
|
||||
/* stream from ffmpeg */
|
||||
void * stream;
|
||||
/* codec extra data (header or some other stuff) */
|
||||
void * extraData;
|
||||
int extraSize;
|
||||
|
||||
uint8_t* aacbuf;
|
||||
unsigned int aacbuflen;
|
||||
int have_aacheader;
|
||||
|
||||
/* If player2 or the elf do not support decoding of audio codec set this.
|
||||
* AVCodec is than used for softdecoding and stream will be injected as PCM */
|
||||
int inject_as_pcm;
|
||||
} Track_t;
|
||||
|
||||
typedef struct Manager_s {
|
||||
char * Name;
|
||||
int (* Command) (/*Context_t*/void *, ManagerCmd_t, void *);
|
||||
char ** Capabilities;
|
||||
|
||||
} Manager_t;
|
||||
|
||||
typedef struct ManagerHandler_s {
|
||||
char * Name;
|
||||
Manager_t * audio;
|
||||
Manager_t * video;
|
||||
Manager_t * subtitle;
|
||||
} ManagerHandler_t;
|
||||
|
||||
void freeTrack(Track_t* track);
|
||||
void copyTrack(Track_t* to, Track_t* from);
|
||||
|
||||
#endif
|
136
libeplayer3/include/misc.h
Normal file
136
libeplayer3/include/misc.h
Normal file
@@ -0,0 +1,136 @@
|
||||
#ifndef misc_123
|
||||
#define misc_123
|
||||
|
||||
#include <dirent.h>
|
||||
|
||||
/* some useful things needed by many files ... */
|
||||
|
||||
/* ***************************** */
|
||||
/* Types */
|
||||
/* ***************************** */
|
||||
|
||||
typedef struct BitPacker_s
|
||||
{
|
||||
unsigned char* Ptr; /* write pointer */
|
||||
unsigned int BitBuffer; /* bitreader shifter */
|
||||
int Remaining; /* number of remaining in the shifter */
|
||||
} BitPacker_t;
|
||||
|
||||
/* ***************************** */
|
||||
/* Makros/Constants */
|
||||
/* ***************************** */
|
||||
|
||||
#define INVALID_PTS_VALUE 0x200000000ull
|
||||
|
||||
/*#define BIG_READS*/
|
||||
#if defined (BIG_READS)
|
||||
#define BLOCK_COUNT 8
|
||||
#else
|
||||
#define BLOCK_COUNT 1
|
||||
#endif
|
||||
#define TP_PACKET_SIZE 188
|
||||
#define BD_TP_PACKET_SIZE 192
|
||||
#define NUMBER_PACKETS (199*BLOCK_COUNT)
|
||||
#define BUFFER_SIZE (TP_PACKET_SIZE*NUMBER_PACKETS)
|
||||
#define PADDING_LENGTH (1024*BLOCK_COUNT)
|
||||
|
||||
/* subtitle hacks ->for file subtitles */
|
||||
#define TEXTSRTOFFSET 100
|
||||
#define TEXTSSAOFFSET 200
|
||||
|
||||
/* ***************************** */
|
||||
/* Prototypes */
|
||||
/* ***************************** */
|
||||
|
||||
void PutBits(BitPacker_t * ld, unsigned int code, unsigned int length);
|
||||
void FlushBits(BitPacker_t * ld);
|
||||
|
||||
/* ***************************** */
|
||||
/* MISC Functions */
|
||||
/* ***************************** */
|
||||
|
||||
static inline void getExtension(char * FILENAMEname, char ** extension) {
|
||||
|
||||
int i = 0;
|
||||
int stringlength;
|
||||
|
||||
if (extension == NULL)
|
||||
return;
|
||||
|
||||
*extension = NULL;
|
||||
|
||||
if (FILENAMEname == NULL)
|
||||
return;
|
||||
|
||||
stringlength = (int) strlen(FILENAMEname);
|
||||
|
||||
for (i = 0; stringlength - i > 0; i++) {
|
||||
if (FILENAMEname[stringlength - i - 1] == '.') {
|
||||
*extension = strdup(FILENAMEname+(stringlength - i));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline void getUPNPExtension(char * FILENAMEname, char ** extension) {
|
||||
char* str;
|
||||
|
||||
if (extension == NULL)
|
||||
return;
|
||||
|
||||
*extension = NULL;
|
||||
|
||||
if (FILENAMEname == NULL)
|
||||
return;
|
||||
|
||||
str = strstr(FILENAMEname, "ext=");
|
||||
|
||||
if (str != NULL)
|
||||
{
|
||||
*extension = strdup(str + strlen("ext=") + 1);
|
||||
return;
|
||||
}
|
||||
*extension = 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];
|
||||
int i = 0;
|
||||
int 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;
|
||||
}
|
||||
|
||||
#endif
|
79
libeplayer3/include/output.h
Normal file
79
libeplayer3/include/output.h
Normal file
@@ -0,0 +1,79 @@
|
||||
#ifndef OUTPUT_H_
|
||||
#define OUTPUT_H_
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
typedef enum {
|
||||
OUTPUT_INIT,
|
||||
OUTPUT_ADD,
|
||||
OUTPUT_DEL,
|
||||
OUTPUT_CAPABILITIES,
|
||||
OUTPUT_PLAY,
|
||||
OUTPUT_STOP,
|
||||
OUTPUT_PAUSE,
|
||||
OUTPUT_OPEN,
|
||||
OUTPUT_CLOSE,
|
||||
OUTPUT_FLUSH,
|
||||
OUTPUT_CONTINUE,
|
||||
OUTPUT_FASTFORWARD,
|
||||
OUTPUT_AVSYNC,
|
||||
OUTPUT_CLEAR,
|
||||
OUTPUT_PTS,
|
||||
OUTPUT_SWITCH,
|
||||
OUTPUT_SLOWMOTION,
|
||||
OUTPUT_AUDIOMUTE,
|
||||
OUTPUT_REVERSE,
|
||||
OUTPUT_DISCONTINUITY_REVERSE,
|
||||
OUTPUT_GET_FRAME_COUNT,
|
||||
/* fixme: e2 */
|
||||
OUTPUT_SUBTITLE_REGISTER_FUNCTION = 222,
|
||||
OUTPUT_SUBTITLE_REGISTER_BUFFER = 223,
|
||||
OUTPUT_GET_SUBTITLE_OUTPUT,
|
||||
OUTPUT_SET_SUBTITLE_OUTPUT,
|
||||
} OutputCmd_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char* data;
|
||||
unsigned int len;
|
||||
|
||||
unsigned char* extradata;
|
||||
unsigned int extralen;
|
||||
|
||||
unsigned long long int pts;
|
||||
|
||||
float frameRate;
|
||||
unsigned int timeScale;
|
||||
|
||||
unsigned int width;
|
||||
unsigned int height;
|
||||
|
||||
char* type;
|
||||
} AudioVideoOut_t;
|
||||
|
||||
typedef struct Output_s {
|
||||
char * Name;
|
||||
int (* Command) (/*Context_t*/void *, OutputCmd_t, void *);
|
||||
int (* Write) (/*Context_t*/void *, void* privateData);
|
||||
char ** Capabilities;
|
||||
|
||||
} Output_t;
|
||||
|
||||
extern Output_t LinuxDvbOutput;
|
||||
extern Output_t SubtitleOutput;
|
||||
|
||||
static Output_t * AvailableOutput[] = {
|
||||
&LinuxDvbOutput,
|
||||
&SubtitleOutput,
|
||||
NULL
|
||||
};
|
||||
|
||||
typedef struct OutputHandler_s {
|
||||
char * Name;
|
||||
Output_t * audio;
|
||||
Output_t * video;
|
||||
Output_t * subtitle;
|
||||
int (* Command) (/*Context_t*/void *, OutputCmd_t, void *);
|
||||
} OutputHandler_t;
|
||||
|
||||
#endif
|
30
libeplayer3/include/pcm.h
Normal file
30
libeplayer3/include/pcm.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* pcm helper
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef pcm_h_
|
||||
#define pcm_h_
|
||||
|
||||
typedef struct pcmPrivateData_s
|
||||
{
|
||||
int uNoOfChannels;
|
||||
int uSampleRate;
|
||||
int uBitsPerSample;
|
||||
int bLittleEndian;
|
||||
} pcmPrivateData_t;
|
||||
#endif
|
33
libeplayer3/include/pes.h
Normal file
33
libeplayer3/include/pes.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef pes_123
|
||||
#define pes_123
|
||||
|
||||
#define PES_MAX_HEADER_SIZE 64
|
||||
#define PES_PRIVATE_DATA_FLAG 0x80
|
||||
#define PES_PRIVATE_DATA_LENGTH 8
|
||||
#define PES_LENGTH_BYTE_0 5
|
||||
#define PES_LENGTH_BYTE_1 4
|
||||
#define PES_FLAGS_BYTE 7
|
||||
#define PES_EXTENSION_DATA_PRESENT 0x01
|
||||
#define PES_HEADER_DATA_LENGTH_BYTE 8
|
||||
#define PES_MIN_HEADER_SIZE 9
|
||||
#define PES_START_CODE_RESERVED_4 0xfd
|
||||
#define PES_VERSION_FAKE_START_CODE 0x31
|
||||
|
||||
|
||||
#define MAX_PES_PACKET_SIZE 65400
|
||||
|
||||
|
||||
/* start codes */
|
||||
#define PCM_PES_START_CODE 0xbd
|
||||
#define PRIVATE_STREAM_1_PES_START_CODE 0xbd
|
||||
#define H263_VIDEO_PES_START_CODE 0xfe
|
||||
#define H264_VIDEO_PES_START_CODE 0xe2
|
||||
#define MPEG_VIDEO_PES_START_CODE 0xe0
|
||||
#define MPEG_AUDIO_PES_START_CODE 0xc0
|
||||
#define VC1_VIDEO_PES_START_CODE 0xfd
|
||||
#define AAC_AUDIO_PES_START_CODE 0xcf
|
||||
|
||||
int InsertPesHeader (unsigned char *data, int size, unsigned char stream_id, unsigned long long int pts, int pic_start_code);
|
||||
int InsertVideoPrivateDataHeader(unsigned char *data, int payload_size);
|
||||
|
||||
#endif
|
36
libeplayer3/include/playback.h
Normal file
36
libeplayer3/include/playback.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef PLAYBACK_H_
|
||||
#define PLAYBACK_H_
|
||||
#include <sys/types.h>
|
||||
|
||||
typedef enum {PLAYBACK_OPEN, PLAYBACK_CLOSE, PLAYBACK_PLAY, PLAYBACK_STOP, PLAYBACK_PAUSE, PLAYBACK_CONTINUE, PLAYBACK_FLUSH, PLAYBACK_TERM, PLAYBACK_FASTFORWARD, PLAYBACK_SEEK, PLAYBACK_PTS, PLAYBACK_LENGTH, PLAYBACK_SWITCH_AUDIO, PLAYBACK_SWITCH_SUBTITLE, PLAYBACK_INFO, PLAYBACK_SLOWMOTION, PLAYBACK_FASTBACKWARD, PLAYBACK_GET_FRAME_COUNT} PlaybackCmd_t;
|
||||
|
||||
typedef struct PlaybackHandler_s {
|
||||
char * Name;
|
||||
|
||||
int fd;
|
||||
|
||||
unsigned char isFile;
|
||||
unsigned char isHttp;
|
||||
unsigned char isUPNP;
|
||||
|
||||
unsigned char isPlaying;
|
||||
unsigned char isPaused;
|
||||
unsigned char isForwarding;
|
||||
unsigned char isSeeking;
|
||||
unsigned char isCreationPhase;
|
||||
|
||||
float BackWard;
|
||||
int SlowMotion;
|
||||
int Speed;
|
||||
int AVSync;
|
||||
|
||||
unsigned char isVideo;
|
||||
unsigned char isAudio;
|
||||
unsigned char isSubtitle;
|
||||
|
||||
int (* Command) (/*Context_t*/void *, PlaybackCmd_t, void *);
|
||||
char * uri;
|
||||
off_t size;
|
||||
} PlaybackHandler_t;
|
||||
|
||||
#endif
|
325
libeplayer3/include/stm_ioctls.h
Normal file
325
libeplayer3/include/stm_ioctls.h
Normal file
@@ -0,0 +1,325 @@
|
||||
/*
|
||||
* stm_ioctls.h
|
||||
*
|
||||
* Copyright (C) STMicroelectronics Limited 2005. All rights reserved.
|
||||
*
|
||||
* Extensions to the LinuxDVB API (v3) implemented by the Havana implemenation.
|
||||
*/
|
||||
|
||||
#ifndef H_STM_IOCTLS
|
||||
#define H_STM_IOCTLS
|
||||
|
||||
/*
|
||||
* Whenever a sequence of values is extended (define or enum) always add the new values
|
||||
* So that old values are unchange to maintain binary compatibility.
|
||||
*/
|
||||
|
||||
#define DVB_SPEED_NORMAL_PLAY 1000
|
||||
#define DVB_SPEED_STOPPED 0
|
||||
#define DVB_SPEED_REVERSE_STOPPED 0x80000000
|
||||
#define DVB_FRAME_RATE_MULTIPLIER 1000
|
||||
|
||||
#define VIDEO_FULL_SCREEN (VIDEO_CENTER_CUT_OUT+1)
|
||||
|
||||
#define DMX_FILTER_BY_PRIORITY_LOW 0x00010000 /* These flags tell the transport pes filter whether to filter */
|
||||
#define DMX_FILTER_BY_PRIORITY_HIGH 0x00020000 /* using the ts priority bit and, if so, whether to filter on */
|
||||
#define DMX_FILTER_BY_PRIORITY_MASK 0x00030000 /* bit set or bit clear */
|
||||
|
||||
/*
|
||||
* Extra events
|
||||
*/
|
||||
|
||||
#define VIDEO_EVENT_FIRST_FRAME_ON_DISPLAY 5 /*(VIDEO_EVENT_VSYNC+1)*/
|
||||
#define VIDEO_EVENT_FRAME_DECODED_LATE (VIDEO_EVENT_FIRST_FRAME_ON_DISPLAY+1)
|
||||
#define VIDEO_EVENT_DATA_DELIVERED_LATE (VIDEO_EVENT_FRAME_DECODED_LATE+1)
|
||||
#define VIDEO_EVENT_STREAM_UNPLAYABLE (VIDEO_EVENT_DATA_DELIVERED_LATE+1)
|
||||
#define VIDEO_EVENT_TRICK_MODE_CHANGE (VIDEO_EVENT_STREAM_UNPLAYABLE+1)
|
||||
#define VIDEO_EVENT_VSYNC_OFFSET_MEASURED (VIDEO_EVENT_TRICK_MODE_CHANGE+1)
|
||||
#define VIDEO_EVENT_FATAL_ERROR (VIDEO_EVENT_VSYNC_OFFSET_MEASURED+1)
|
||||
#define VIDEO_EVENT_OUTPUT_SIZE_CHANGED (VIDEO_EVENT_FATAL_ERROR+1)
|
||||
#define VIDEO_EVENT_FATAL_HARDWARE_FAILURE (VIDEO_EVENT_OUTPUT_SIZE_CHANGED+1)
|
||||
|
||||
/*
|
||||
* List of possible container types - used to select demux.. If stream_source is VIDEO_SOURCE_DEMUX
|
||||
* then default is TRANSPORT, if stream_source is VIDEO_SOURCE_MEMORY then default is PES
|
||||
*/
|
||||
typedef enum {
|
||||
STREAM_TYPE_NONE, /* Deprecated */
|
||||
STREAM_TYPE_TRANSPORT,/* Use latest PTI driver so it can be Deprecated */
|
||||
STREAM_TYPE_PES,
|
||||
STREAM_TYPE_ES, /* Deprecated */
|
||||
STREAM_TYPE_PROGRAM, /* Deprecated */
|
||||
STREAM_TYPE_SYSTEM, /* Deprecated */
|
||||
STREAM_TYPE_SPU, /* Deprecated */
|
||||
STREAM_TYPE_NAVI, /* Deprecated */
|
||||
STREAM_TYPE_CSS, /* Deprecated */
|
||||
STREAM_TYPE_AVI, /* Deprecated */
|
||||
STREAM_TYPE_MP3, /* Deprecated */
|
||||
STREAM_TYPE_H264, /* Deprecated */
|
||||
STREAM_TYPE_ASF, /* Needs work so it can be deprecated */
|
||||
STREAM_TYPE_MP4, /* Deprecated */
|
||||
STREAM_TYPE_RAW, /* Deprecated */
|
||||
} stream_type_t;
|
||||
|
||||
/*
|
||||
* List of possible video encodings - used to select frame parser and codec.
|
||||
*/
|
||||
typedef enum {
|
||||
VIDEO_ENCODING_AUTO,
|
||||
VIDEO_ENCODING_MPEG1,
|
||||
VIDEO_ENCODING_MPEG2,
|
||||
VIDEO_ENCODING_MJPEG,
|
||||
VIDEO_ENCODING_DIVX3,
|
||||
VIDEO_ENCODING_DIVX4,
|
||||
VIDEO_ENCODING_DIVX5,
|
||||
VIDEO_ENCODING_MPEG4P2,
|
||||
VIDEO_ENCODING_H264,
|
||||
VIDEO_ENCODING_WMV,
|
||||
VIDEO_ENCODING_VC1,
|
||||
VIDEO_ENCODING_RAW,
|
||||
VIDEO_ENCODING_H263,
|
||||
VIDEO_ENCODING_FLV1,
|
||||
VIDEO_ENCODING_VP6,
|
||||
VIDEO_ENCODING_RMV,
|
||||
VIDEO_ENCODING_DIVXHD,
|
||||
VIDEO_ENCODING_AVS,
|
||||
VIDEO_ENCODING_VP3,
|
||||
VIDEO_ENCODING_THEORA,
|
||||
VIDEO_ENCODING_COMPOCAP,
|
||||
VIDEO_ENCODING_NONE,
|
||||
VIDEO_ENCODING_PRIVATE
|
||||
} video_encoding_t;
|
||||
|
||||
|
||||
/*
|
||||
* List of possible audio encodings - used to select frame parser and codec.
|
||||
*/
|
||||
typedef enum {
|
||||
AUDIO_ENCODING_AUTO,
|
||||
AUDIO_ENCODING_PCM,
|
||||
AUDIO_ENCODING_LPCM,
|
||||
AUDIO_ENCODING_MPEG1,
|
||||
AUDIO_ENCODING_MPEG2,
|
||||
AUDIO_ENCODING_MP3,
|
||||
AUDIO_ENCODING_AC3,
|
||||
AUDIO_ENCODING_DTS,
|
||||
AUDIO_ENCODING_AAC,
|
||||
AUDIO_ENCODING_WMA,
|
||||
AUDIO_ENCODING_RAW,
|
||||
AUDIO_ENCODING_LPCMA,
|
||||
AUDIO_ENCODING_LPCMH,
|
||||
AUDIO_ENCODING_LPCMB,
|
||||
AUDIO_ENCODING_SPDIF, /*<! Data coming through SPDIF link :: compressed or PCM data */
|
||||
AUDIO_ENCODING_DTS_LBR,
|
||||
AUDIO_ENCODING_MLP,
|
||||
AUDIO_ENCODING_RMA,
|
||||
AUDIO_ENCODING_AVS,
|
||||
AUDIO_ENCODING_VORBIS,
|
||||
AUDIO_ENCODING_NONE,
|
||||
AUDIO_ENCODING_PRIVATE
|
||||
} audio_encoding_t;
|
||||
|
||||
/*
|
||||
* List of possible sources for SP/DIF output.
|
||||
*/
|
||||
typedef enum audio_spdif_source {
|
||||
AUDIO_SPDIF_SOURCE_PP, /*<! normal decoder output */
|
||||
AUDIO_SPDIF_SOURCE_DEC, /*<! decoder output w/o post-proc */
|
||||
AUDIO_SPDIF_SOURCE_ES, /*<! raw elementary stream data */
|
||||
} audio_spdif_source_t;
|
||||
|
||||
typedef struct {
|
||||
int x;
|
||||
int y;
|
||||
int width;
|
||||
int height;
|
||||
} video_window_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
DVB_DISCONTINUITY_SKIP = 0x01,
|
||||
DVB_DISCONTINUITY_CONTINUOUS_REVERSE = 0x02,
|
||||
DVB_DISCONTINUITY_SURPLUS_DATA = 0x04
|
||||
} dvb_discontinuity_t;
|
||||
|
||||
/*
|
||||
* audio discontinuity
|
||||
*/
|
||||
typedef enum {
|
||||
AUDIO_DISCONTINUITY_SKIP = DVB_DISCONTINUITY_SKIP,
|
||||
AUDIO_DISCONTINUITY_CONTINUOUS_REVERSE = DVB_DISCONTINUITY_CONTINUOUS_REVERSE,
|
||||
AUDIO_DISCONTINUITY_SURPLUS_DATA = DVB_DISCONTINUITY_SURPLUS_DATA,
|
||||
} audio_discontinuity_t;
|
||||
|
||||
/*
|
||||
* video discontinuity
|
||||
*/
|
||||
typedef enum {
|
||||
VIDEO_DISCONTINUITY_SKIP = DVB_DISCONTINUITY_SKIP,
|
||||
VIDEO_DISCONTINUITY_CONTINUOUS_REVERSE = DVB_DISCONTINUITY_CONTINUOUS_REVERSE,
|
||||
VIDEO_DISCONTINUITY_SURPLUS_DATA = DVB_DISCONTINUITY_SURPLUS_DATA,
|
||||
} video_discontinuity_t;
|
||||
|
||||
#define DVB_TIME_NOT_BOUNDED 0xfedcba9876543210ULL
|
||||
|
||||
typedef struct dvb_play_interval_s {
|
||||
unsigned long long start;
|
||||
unsigned long long end;
|
||||
}dvb_play_interval_t;
|
||||
|
||||
typedef dvb_play_interval_t video_play_interval_t;
|
||||
typedef dvb_play_interval_t audio_play_interval_t;
|
||||
|
||||
typedef struct dvb_play_time_s {
|
||||
unsigned long long system_time;
|
||||
unsigned long long presentation_time;
|
||||
unsigned long long pts;
|
||||
}dvb_play_time_t;
|
||||
|
||||
typedef dvb_play_time_t video_play_time_t;
|
||||
typedef dvb_play_time_t audio_play_time_t;
|
||||
|
||||
typedef struct dvb_play_info_s {
|
||||
unsigned long long system_time;
|
||||
unsigned long long presentation_time;
|
||||
unsigned long long pts;
|
||||
unsigned long long frame_count;
|
||||
}dvb_play_info_t;
|
||||
|
||||
typedef dvb_play_info_t video_play_info_t;
|
||||
typedef dvb_play_info_t audio_play_info_t;
|
||||
|
||||
|
||||
typedef enum {
|
||||
#define DVB_OPTION_VALUE_DISABLE 0
|
||||
#define DVB_OPTION_VALUE_ENABLE 1
|
||||
|
||||
DVB_OPTION_TRICK_MODE_AUDIO = 0,
|
||||
DVB_OPTION_PLAY_24FPS_VIDEO_AT_25FPS = 1,
|
||||
|
||||
#define DVB_OPTION_VALUE_VIDEO_CLOCK_MASTER 0
|
||||
#define DVB_OPTION_VALUE_AUDIO_CLOCK_MASTER 1
|
||||
#define DVB_OPTION_VALUE_SYSTEM_CLOCK_MASTER 2
|
||||
DVB_OPTION_MASTER_CLOCK = 2,
|
||||
|
||||
DVB_OPTION_EXTERNAL_TIME_MAPPING = 3,
|
||||
DVB_OPTION_EXTERNAL_TIME_MAPPING_VSYNC_LOCKED = 31,
|
||||
DVB_OPTION_AV_SYNC = 4,
|
||||
DVB_OPTION_DISPLAY_FIRST_FRAME_EARLY = 5,
|
||||
DVB_OPTION_VIDEO_BLANK = 6,
|
||||
DVB_OPTION_STREAM_ONLY_KEY_FRAMES = 7,
|
||||
DVB_OPTION_STREAM_SINGLE_GROUP_BETWEEN_DISCONTINUITIES = 8,
|
||||
DVB_OPTION_CLAMP_PLAYBACK_INTERVAL_ON_PLAYBACK_DIRECTION_CHANGE = 9,
|
||||
|
||||
#define DVB_OPTION_VALUE_PLAYOUT 0
|
||||
#define DVB_OPTION_VALUE_DISCARD 1
|
||||
DVB_OPTION_PLAYOUT_ON_TERMINATE = 10,
|
||||
DVB_OPTION_PLAYOUT_ON_SWITCH = 11,
|
||||
DVB_OPTION_PLAYOUT_ON_DRAIN = 12,
|
||||
|
||||
DVB_OPTION_VIDEO_ASPECT_RATIO = 13,
|
||||
DVB_OPTION_VIDEO_DISPLAY_FORMAT = 14,
|
||||
|
||||
#define DVB_OPTION_VALUE_TRICK_MODE_AUTO 0
|
||||
#define DVB_OPTION_VALUE_TRICK_MODE_DECODE_ALL 1
|
||||
#define DVB_OPTION_VALUE_TRICK_MODE_DECODE_ALL_DEGRADE_NON_REFERENCE_FRAMES 2
|
||||
#define DVB_OPTION_VALUE_TRICK_MODE_START_DISCARDING_NON_REFERENCE_FRAMES 3
|
||||
#define DVB_OPTION_VALUE_TRICK_MODE_DECODE_REFERENCE_FRAMES_DEGRADE_NON_KEY_FRAMES 4
|
||||
#define DVB_OPTION_VALUE_TRICK_MODE_DECODE_KEY_FRAMES 5
|
||||
#define DVB_OPTION_VALUE_TRICK_MODE_DISCONTINUOUS_KEY_FRAMES 6
|
||||
DVB_OPTION_TRICK_MODE_DOMAIN = 15,
|
||||
|
||||
#define DVB_OPTION_VALUE_DISCARD_LATE_FRAMES_NEVER 0
|
||||
#define DVB_OPTION_VALUE_DISCARD_LATE_FRAMES_ALWAYS 1
|
||||
#define DVB_OPTION_VALUE_DISCARD_LATE_FRAMES_AFTER_SYNCHRONIZE 2
|
||||
DVB_OPTION_DISCARD_LATE_FRAMES = 16,
|
||||
DVB_OPTION_VIDEO_START_IMMEDIATE = 17,
|
||||
DVB_OPTION_REBASE_ON_DATA_DELIVERY_LATE = 18,
|
||||
DVB_OPTION_REBASE_ON_FRAME_DECODE_LATE = 19,
|
||||
DVB_OPTION_LOWER_CODEC_DECODE_LIMITS_ON_FRAME_DECODE_LATE = 20,
|
||||
DVB_OPTION_H264_ALLOW_NON_IDR_RESYNCHRONIZATION = 21,
|
||||
DVB_OPTION_MPEG2_IGNORE_PROGESSIVE_FRAME_FLAG = 22,
|
||||
DVB_OPTION_AUDIO_SPDIF_SOURCE = 23,
|
||||
|
||||
DVB_OPTION_H264_ALLOW_BAD_PREPROCESSED_FRAMES = 24,
|
||||
DVB_OPTION_CLOCK_RATE_ADJUSTMENT_LIMIT_2_TO_THE_N_PARTS_PER_MILLION = 25, /* Value = N */
|
||||
DVB_OPTION_LIMIT_INPUT_INJECT_AHEAD = 26,
|
||||
|
||||
#define DVB_OPTION_VALUE_MPEG2_APPLICATION_MPEG2 0
|
||||
#define DVB_OPTION_VALUE_MPEG2_APPLICATION_ATSC 1
|
||||
#define DVB_OPTION_VALUE_MPEG2_APPLICATION_DVB 2
|
||||
DVB_OPTION_MPEG2_APPLICATION_TYPE = 27,
|
||||
|
||||
#define DVB_OPTION_VALUE_DECIMATE_DECODER_OUTPUT_DISABLED 0
|
||||
#define DVB_OPTION_VALUE_DECIMATE_DECODER_OUTPUT_HALF 1
|
||||
#define DVB_OPTION_VALUE_DECIMATE_DECODER_OUTPUT_QUARTER 2
|
||||
DVB_OPTION_DECIMATE_DECODER_OUTPUT = 28,
|
||||
|
||||
DVB_OPTION_PTS_FORWARD_JUMP_DETECTION_THRESHOLD = 29,
|
||||
DVB_OPTION_H264_TREAT_DUPLICATE_DPB_AS_NON_REFERENCE_FRAME_FIRST = 30,
|
||||
|
||||
DVB_OPTION_PIXEL_ASPECT_RATIO_CORRECTION = 32,
|
||||
|
||||
DVB_OPTION_H264_FORCE_PIC_ORDER_CNT_IGNORE_DPB_DISPLAY_FRAME_ORDERING = 33,
|
||||
|
||||
DVB_OPTION_PTS_SYMMETRIC_JUMP_DETECTION = 34,
|
||||
|
||||
DVB_OPTION_ALLOW_FRAME_DISCARD_AT_NORMAL_SPEED = 35,
|
||||
|
||||
/* OPTION_MAX must always be one greater than largest option - currently DVB_OPTION_ALLOW_FRAME_DISCARD_AT_NORMAL_SPEED */
|
||||
|
||||
DVB_OPTION_MAX = 35
|
||||
} dvb_option_t;
|
||||
|
||||
// Legacy typo correction
|
||||
#define DVP_OPTION_H264_FORCE_PIC_ORDER_CNT_IGNORE_DPB_DISPLAY_FRAME_ORDERING DVB_OPTION_H264_FORCE_PIC_ORDER_CNT_IGNORE_DPB_DISPLAY_FRAME_ORDERING
|
||||
|
||||
|
||||
typedef dvb_option_t video_option_t;
|
||||
|
||||
/* Decoder commands */
|
||||
#define VIDEO_CMD_PLAY (0)
|
||||
#define VIDEO_CMD_STOP (1)
|
||||
#define VIDEO_CMD_FREEZE (2)
|
||||
#define VIDEO_CMD_CONTINUE (3)
|
||||
#define VIDEO_CMD_SET_OPTION (4)
|
||||
#define VIDEO_CMD_GET_OPTION (5)
|
||||
|
||||
|
||||
/* Flags for VIDEO_CMD_FREEZE */
|
||||
#define VIDEO_CMD_FREEZE_TO_BLACK (1 << 0)
|
||||
|
||||
/* Flags for VIDEO_CMD_STOP */
|
||||
#define VIDEO_CMD_STOP_TO_BLACK (1 << 0)
|
||||
#define VIDEO_CMD_STOP_IMMEDIATELY (1 << 1)
|
||||
|
||||
/* Play input formats: */
|
||||
/* The decoder has no special format requirements */
|
||||
#define VIDEO_PLAY_FMT_NONE (0)
|
||||
/* The decoder requires full GOPs */
|
||||
#define VIDEO_PLAY_FMT_GOP (1)
|
||||
|
||||
/* ST specific video ioctls */
|
||||
#define VIDEO_SET_ENCODING _IO('o', 81)
|
||||
#define VIDEO_FLUSH _IO('o', 82)
|
||||
#define VIDEO_SET_SPEED _IO('o', 83)
|
||||
#define VIDEO_DISCONTINUITY _IO('o', 84)
|
||||
#define VIDEO_STEP _IO('o', 85)
|
||||
#define VIDEO_SET_PLAY_INTERVAL _IOW('o', 86, video_play_interval_t)
|
||||
#define VIDEO_SET_SYNC_GROUP _IO('o', 87)
|
||||
#define VIDEO_GET_PLAY_TIME _IOR('o', 88, video_play_time_t)
|
||||
#define VIDEO_GET_PLAY_INFO _IOR('o', 89, video_play_info_t)
|
||||
|
||||
/* ST specific audio ioctls */
|
||||
#define AUDIO_SET_ENCODING _IO('o', 70)
|
||||
#define AUDIO_FLUSH _IO('o', 71)
|
||||
#define AUDIO_SET_SPDIF_SOURCE _IO('o', 72)
|
||||
#define AUDIO_SET_SPEED _IO('o', 73)
|
||||
#define AUDIO_DISCONTINUITY _IO('o', 74)
|
||||
#define AUDIO_SET_PLAY_INTERVAL _IOW('o', 75, audio_play_interval_t)
|
||||
#define AUDIO_SET_SYNC_GROUP _IO('o', 76)
|
||||
#define AUDIO_GET_PLAY_TIME _IOR('o', 77, audio_play_time_t)
|
||||
#define AUDIO_GET_PLAY_INFO _IOR('o', 78, audio_play_info_t)
|
||||
|
||||
#endif /* H_DVB_STM_H */
|
||||
|
126
libeplayer3/include/subtitle.h
Normal file
126
libeplayer3/include/subtitle.h
Normal file
@@ -0,0 +1,126 @@
|
||||
#ifndef _subtitle_123
|
||||
#define _subtitle_123
|
||||
|
||||
/*
|
||||
* Interface File for subtitle handling (container input and output).
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#define DEFAULT_ASS_HEAD "[Script Info]\n\
|
||||
Original Script: (c) 2008\n\
|
||||
ScriptType: v4.00\n\
|
||||
Synch Point: Side 1 0m00s\n\
|
||||
Collisions: Normal\n\
|
||||
Timer: 100.0000\n\n\
|
||||
[V4 Styles]\n\
|
||||
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding\n\
|
||||
Style: Default,Arial,26,16777215,0,16777215,0,0,0,2,2,2,2,20,20,10,0\n\n\
|
||||
[Events]\n\
|
||||
Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text\n\n\n"
|
||||
|
||||
static inline unsigned char* text_to_ass(char *text, long long int pts, double duration)
|
||||
{
|
||||
char buf[1024];
|
||||
int x,pos=0;
|
||||
for(x=0;x<strlen(text);x++){
|
||||
if(text[x]=='\n'){
|
||||
buf[pos++]='\\';
|
||||
buf[pos++]='N';
|
||||
}else if(text[x]!='\r')buf[pos++]=text[x];
|
||||
}
|
||||
buf[pos++]='\0';
|
||||
int len = 80 + strlen(buf);
|
||||
long long int end_pts = pts + (duration * 1000.0);
|
||||
char* line = (char*)malloc( sizeof(char) * len );
|
||||
int sc = pts / 10;
|
||||
int ec = end_pts / 10;
|
||||
int sh, sm, ss, eh, em, es;
|
||||
sh = sc/360000; sc -= 360000*sh;
|
||||
sm = sc/ 6000; sc -= 6000*sm;
|
||||
ss = sc/ 100; sc -= 100*ss;
|
||||
eh = ec/360000; ec -= 360000*eh;
|
||||
em = ec/ 6000; ec -= 6000*em;
|
||||
es = ec/ 100; ec -= 100*es;
|
||||
snprintf(line,len,"Dialogue: Marked=0,%d:%02d:%02d.%02d,%d:%02d:%02d.%02d,Default,NTP,0000,0000,0000,!Effect,%s\n",
|
||||
sh, sm, ss, sc, eh, em, es, ec, buf);
|
||||
|
||||
return (unsigned char*)line;
|
||||
|
||||
}
|
||||
|
||||
typedef enum
|
||||
{
|
||||
eSub_Gfx,
|
||||
eSub_Txt
|
||||
} SubType_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char* data;
|
||||
int len;
|
||||
} SubText_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char* data;
|
||||
unsigned int Width;
|
||||
unsigned int Height;
|
||||
unsigned int Stride;
|
||||
unsigned int x;
|
||||
unsigned int y;
|
||||
unsigned int color;
|
||||
} SubGfx_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
SubType_t type;
|
||||
long long int pts;
|
||||
float duration;
|
||||
|
||||
union
|
||||
{
|
||||
SubText_t text;
|
||||
SubGfx_t gfx;
|
||||
} u;
|
||||
} SubtitleOut_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char* data;
|
||||
int len;
|
||||
|
||||
unsigned char* extradata;
|
||||
int extralen;
|
||||
|
||||
long long int pts;
|
||||
float duration;
|
||||
} SubtitleData_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char* destination;
|
||||
unsigned int screen_width;
|
||||
unsigned int screen_height;
|
||||
unsigned int destStride;
|
||||
|
||||
int shareFramebuffer;
|
||||
int framebufferFD;
|
||||
} SubtitleOutputDef_t;
|
||||
|
||||
#endif
|
108
libeplayer3/include/writer.h
Normal file
108
libeplayer3/include/writer.h
Normal file
@@ -0,0 +1,108 @@
|
||||
#ifndef WRITER_H_
|
||||
#define WRITER_H_
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
typedef enum { eNone, eAudio, eVideo, eGfx} eWriterType_t;
|
||||
|
||||
typedef struct {
|
||||
int fd;
|
||||
unsigned char* data;
|
||||
unsigned int len;
|
||||
unsigned long long int Pts;
|
||||
unsigned char* private_data;
|
||||
unsigned int private_size;
|
||||
unsigned int FrameRate;
|
||||
unsigned int FrameScale;
|
||||
unsigned int Width;
|
||||
unsigned int Height;
|
||||
unsigned char Version;
|
||||
} WriterAVCallData_t;
|
||||
|
||||
typedef struct {
|
||||
unsigned char* data;
|
||||
unsigned int Width;
|
||||
unsigned int Height;
|
||||
unsigned int Stride;
|
||||
unsigned int color;
|
||||
|
||||
unsigned int x; /* dst x ->given by ass */
|
||||
unsigned int y; /* dst y ->given by ass */
|
||||
|
||||
/* destination values if we use a shared framebuffer */
|
||||
int fd;
|
||||
unsigned int Screen_Width;
|
||||
unsigned int Screen_Height;
|
||||
unsigned char* destination;
|
||||
unsigned int destStride;
|
||||
} WriterFBCallData_t;
|
||||
|
||||
typedef struct WriterCaps_s {
|
||||
char* name;
|
||||
eWriterType_t type;
|
||||
char* textEncoding;
|
||||
/* fixme: revise if this is an enum! */
|
||||
int dvbEncoding;
|
||||
} WriterCaps_t;
|
||||
|
||||
typedef struct Writer_s {
|
||||
int (* reset) ();
|
||||
int (* writeData) (void*);
|
||||
int (* writeReverseData) (void*);
|
||||
WriterCaps_t *caps;
|
||||
} Writer_t;
|
||||
|
||||
extern Writer_t WriterAudioIPCM;
|
||||
extern Writer_t WriterAudioMP3;
|
||||
extern Writer_t WriterAudioMPEGL3;
|
||||
extern Writer_t WriterAudioAC3;
|
||||
extern Writer_t WriterAudioAAC;
|
||||
extern Writer_t WriterAudioDTS;
|
||||
extern Writer_t WriterAudioWMA;
|
||||
extern Writer_t WriterAudioFLAC;
|
||||
extern Writer_t WriterAudioVORBIS;
|
||||
|
||||
extern Writer_t WriterVideoMPEG2;
|
||||
extern Writer_t WriterVideoMPEGH264;
|
||||
extern Writer_t WriterVideoH264;
|
||||
extern Writer_t WriterVideoWMV;
|
||||
extern Writer_t WriterVideoDIVX;
|
||||
extern Writer_t WriterVideoFOURCC;
|
||||
extern Writer_t WriterVideoMSCOMP;
|
||||
extern Writer_t WriterVideoH263;
|
||||
extern Writer_t WriterVideoFLV;
|
||||
extern Writer_t WriterVideoVC1;
|
||||
extern Writer_t WriterFramebuffer;
|
||||
|
||||
static Writer_t * AvailableWriter[] = {
|
||||
&WriterAudioIPCM,
|
||||
&WriterAudioMP3,
|
||||
&WriterAudioMPEGL3,
|
||||
&WriterAudioAC3,
|
||||
&WriterAudioAAC,
|
||||
&WriterAudioDTS,
|
||||
&WriterAudioWMA,
|
||||
&WriterAudioFLAC,
|
||||
&WriterAudioVORBIS,
|
||||
|
||||
&WriterVideoMPEG2,
|
||||
&WriterVideoMPEGH264,
|
||||
&WriterVideoH264,
|
||||
&WriterVideoDIVX,
|
||||
&WriterVideoFOURCC,
|
||||
&WriterVideoMSCOMP,
|
||||
&WriterVideoWMV,
|
||||
&WriterVideoH263,
|
||||
&WriterVideoFLV,
|
||||
&WriterVideoVC1,
|
||||
&WriterFramebuffer,
|
||||
NULL
|
||||
};
|
||||
|
||||
Writer_t* getWriter(char* encoding);
|
||||
|
||||
Writer_t* getDefaultVideoWriter();
|
||||
Writer_t* getDefaultAudioWriter();
|
||||
Writer_t* getDefaultFramebufferWriter();
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user