MythTV  master
Macros | Typedefs | Functions | Variables
xine_demux_sputext.cpp File Reference
#include <array>
#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "libmythbase/mythlogging.h"
#include "captions/xine_demux_sputext.h"
#include <stdlib.h>
#include <ctype.h>
Include dependency graph for xine_demux_sputext.cpp:

Go to the source code of this file.

Macros

#define ERR   ((void *)-1)
 
#define LINE_LEN_QUOT   "1000"
 

Typedefs

using read_func_ptr = subtitle_t *(*)(demux_sputext_t *demuxstr, subtitle_t *dest)
 

Functions

char * strcasestr (const char *str, const char *pattern)
 
static bool isEol (char p)
 
static void trail_space (std::string &str)
 
static char * read_line_from_input (demux_sputext_t *demuxstr, std::string &line)
 
static subtitle_tsub_read_line_sami (demux_sputext_t *demuxstr, subtitle_t *current)
 
static char * sub_readtext (char *source, std::string &dest)
 Extract the next token from a string. More...
 
static subtitle_tsub_read_line_microdvd (demux_sputext_t *demuxstr, subtitle_t *current)
 
static subtitle_tsub_read_line_subviewer (demux_sputext_t *demuxstr, subtitle_t *current)
 
static subtitle_tsub_read_line_subrip (demux_sputext_t *demuxstr, subtitle_t *current)
 
static subtitle_tsub_read_line_vplayer (demux_sputext_t *demuxstr, subtitle_t *current)
 
static subtitle_tsub_read_line_rt (demux_sputext_t *demuxstr, subtitle_t *current)
 
static subtitle_tsub_read_line_ssa (demux_sputext_t *demuxstr, subtitle_t *current)
 
static subtitle_tsub_read_line_pjs (demux_sputext_t *demuxstr, subtitle_t *current)
 
static subtitle_tsub_read_line_mpsub (demux_sputext_t *demuxstr, subtitle_t *current)
 
static subtitle_tsub_read_line_aqt (demux_sputext_t *demuxstr, subtitle_t *current)
 
static subtitle_tsub_read_line_jacobsub (demux_sputext_t *demuxstr, subtitle_t *current)
 
static subtitle_tsub_read_line_subviewer2 (demux_sputext_t *demuxstr, subtitle_t *current)
 
static subtitle_tsub_read_line_subrip09 (demux_sputext_t *demuxstr, subtitle_t *current)
 
static subtitle_tsub_read_line_mpl2 (demux_sputext_t *demuxstr, subtitle_t *current)
 
static int sub_autodetect (demux_sputext_t *demuxstr)
 
bool sub_read_file (demux_sputext_t *demuxstr)
 

Variables

static constexpr ssize_t LINE_LEN { 1000 }
 
const std::array< read_func_ptr, 14 > read_func
 

Macro Definition Documentation

◆ ERR

#define ERR   ((void *)-1)

Definition at line 50 of file xine_demux_sputext.cpp.

◆ LINE_LEN_QUOT

#define LINE_LEN_QUOT   "1000"

Definition at line 52 of file xine_demux_sputext.cpp.

Typedef Documentation

◆ read_func_ptr

using read_func_ptr = subtitle_t* (*)(demux_sputext_t *demuxstr,subtitle_t *dest)

Definition at line 1022 of file xine_demux_sputext.cpp.

Function Documentation

◆ strcasestr()

char* strcasestr ( const char *  str,
const char *  pattern 
)

Definition at line 58 of file xine_demux_sputext.cpp.

Referenced by sub_read_line_sami().

◆ isEol()

static bool isEol ( char  p)
static

◆ trail_space()

static void trail_space ( std::string &  str)
inlinestatic

Definition at line 86 of file xine_demux_sputext.cpp.

Referenced by sub_read_line_jacobsub(), and sub_read_line_sami().

◆ read_line_from_input()

static char* read_line_from_input ( demux_sputext_t demuxstr,
std::string &  line 
)
static

◆ sub_read_line_sami()

static subtitle_t* sub_read_line_sami ( demux_sputext_t demuxstr,
subtitle_t current 
)
static

Definition at line 132 of file xine_demux_sputext.cpp.

◆ sub_readtext()

static char* sub_readtext ( char *  source,
std::string &  dest 
)
static

Extract the next token from a string.

Parameters
sourceThe character string to scan.
destA newly allocated string containing the text from the source string up to the next newline, carriage return, or vertical bar.
Returns
one of 1) a pointer to a newly allocated string, 2) nullptr ig the end of te string was reached, or "(char*)-1" on error.

Definition at line 218 of file xine_demux_sputext.cpp.

Referenced by sub_read_line_aqt(), sub_read_line_microdvd(), sub_read_line_mpl2(), sub_read_line_rt(), sub_read_line_subrip09(), and sub_read_line_vplayer().

◆ sub_read_line_microdvd()

static subtitle_t* sub_read_line_microdvd ( demux_sputext_t demuxstr,
subtitle_t current 
)
static

Definition at line 238 of file xine_demux_sputext.cpp.

◆ sub_read_line_subviewer()

static subtitle_t* sub_read_line_subviewer ( demux_sputext_t demuxstr,
subtitle_t current 
)
static

Definition at line 261 of file xine_demux_sputext.cpp.

◆ sub_read_line_subrip()

static subtitle_t* sub_read_line_subrip ( demux_sputext_t demuxstr,
subtitle_t current 
)
static

Definition at line 294 of file xine_demux_sputext.cpp.

◆ sub_read_line_vplayer()

static subtitle_t* sub_read_line_vplayer ( demux_sputext_t demuxstr,
subtitle_t current 
)
static

Definition at line 364 of file xine_demux_sputext.cpp.

◆ sub_read_line_rt()

static subtitle_t* sub_read_line_rt ( demux_sputext_t demuxstr,
subtitle_t current 
)
static

Definition at line 410 of file xine_demux_sputext.cpp.

◆ sub_read_line_ssa()

static subtitle_t* sub_read_line_ssa ( demux_sputext_t demuxstr,
subtitle_t current 
)
static

Definition at line 453 of file xine_demux_sputext.cpp.

◆ sub_read_line_pjs()

static subtitle_t* sub_read_line_pjs ( demux_sputext_t demuxstr,
subtitle_t current 
)
static

Definition at line 527 of file xine_demux_sputext.cpp.

◆ sub_read_line_mpsub()

static subtitle_t* sub_read_line_mpsub ( demux_sputext_t demuxstr,
subtitle_t current 
)
static

Definition at line 556 of file xine_demux_sputext.cpp.

◆ sub_read_line_aqt()

static subtitle_t* sub_read_line_aqt ( demux_sputext_t demuxstr,
subtitle_t current 
)
static

Definition at line 602 of file xine_demux_sputext.cpp.

◆ sub_read_line_jacobsub()

static subtitle_t* sub_read_line_jacobsub ( demux_sputext_t demuxstr,
subtitle_t current 
)
static

Definition at line 625 of file xine_demux_sputext.cpp.

◆ sub_read_line_subviewer2()

static subtitle_t* sub_read_line_subviewer2 ( demux_sputext_t demuxstr,
subtitle_t current 
)
static

Definition at line 840 of file xine_demux_sputext.cpp.

◆ sub_read_line_subrip09()

static subtitle_t* sub_read_line_subrip09 ( demux_sputext_t demuxstr,
subtitle_t current 
)
static

Definition at line 863 of file xine_demux_sputext.cpp.

◆ sub_read_line_mpl2()

static subtitle_t* sub_read_line_mpl2 ( demux_sputext_t demuxstr,
subtitle_t current 
)
static

Definition at line 893 of file xine_demux_sputext.cpp.

◆ sub_autodetect()

static int sub_autodetect ( demux_sputext_t demuxstr)
static

Definition at line 918 of file xine_demux_sputext.cpp.

Referenced by sub_read_file().

◆ sub_read_file()

bool sub_read_file ( demux_sputext_t demuxstr)

Definition at line 1041 of file xine_demux_sputext.cpp.

Referenced by TextSubtitleParser::LoadSubtitles().

Variable Documentation

◆ LINE_LEN

constexpr ssize_t LINE_LEN { 1000 }
staticconstexpr

◆ read_func

const std::array<read_func_ptr, 14> read_func
sub_read_line_jacobsub
static subtitle_t * sub_read_line_jacobsub(demux_sputext_t *demuxstr, subtitle_t *current)
Definition: xine_demux_sputext.cpp:625
sub_read_line_mpsub
static subtitle_t * sub_read_line_mpsub(demux_sputext_t *demuxstr, subtitle_t *current)
Definition: xine_demux_sputext.cpp:556
sub_read_line_aqt
static subtitle_t * sub_read_line_aqt(demux_sputext_t *demuxstr, subtitle_t *current)
Definition: xine_demux_sputext.cpp:602
sub_read_line_sami
static subtitle_t * sub_read_line_sami(demux_sputext_t *demuxstr, subtitle_t *current)
Definition: xine_demux_sputext.cpp:132
sub_read_line_ssa
static subtitle_t * sub_read_line_ssa(demux_sputext_t *demuxstr, subtitle_t *current)
Definition: xine_demux_sputext.cpp:453
sub_read_line_mpl2
static subtitle_t * sub_read_line_mpl2(demux_sputext_t *demuxstr, subtitle_t *current)
Definition: xine_demux_sputext.cpp:893
sub_read_line_microdvd
static subtitle_t * sub_read_line_microdvd(demux_sputext_t *demuxstr, subtitle_t *current)
Definition: xine_demux_sputext.cpp:238
sub_read_line_subrip
static subtitle_t * sub_read_line_subrip(demux_sputext_t *demuxstr, subtitle_t *current)
Definition: xine_demux_sputext.cpp:294
sub_read_line_subviewer2
static subtitle_t * sub_read_line_subviewer2(demux_sputext_t *demuxstr, subtitle_t *current)
Definition: xine_demux_sputext.cpp:840
sub_read_line_pjs
static subtitle_t * sub_read_line_pjs(demux_sputext_t *demuxstr, subtitle_t *current)
Definition: xine_demux_sputext.cpp:527
sub_read_line_subviewer
static subtitle_t * sub_read_line_subviewer(demux_sputext_t *demuxstr, subtitle_t *current)
Definition: xine_demux_sputext.cpp:261
sub_read_line_vplayer
static subtitle_t * sub_read_line_vplayer(demux_sputext_t *demuxstr, subtitle_t *current)
Definition: xine_demux_sputext.cpp:364
sub_read_line_rt
static subtitle_t * sub_read_line_rt(demux_sputext_t *demuxstr, subtitle_t *current)
Definition: xine_demux_sputext.cpp:410
sub_read_line_subrip09
static subtitle_t * sub_read_line_subrip09(demux_sputext_t *demuxstr, subtitle_t *current)
Definition: xine_demux_sputext.cpp:863