type stringclasses 5
values | content stringlengths 9 163k |
|---|---|
functions | void
dump_pmu_state(const char *from)
{
struct task_struct *task;
struct pt_regs *regs;
pfm_context_t *ctx;
unsigned long psr, dcr, info, flags;
int i, this_cpu;
local_irq_save(flags);
this_cpu = smp_processor_id();
regs = task_pt_regs(current);
info = PFM_CPUINFO_GET();
dcr = ia64_getreg(_IA64... |
functions | void
pfm_inherit(struct task_struct *task, struct pt_regs *regs)
{
struct thread_struct *thread;
DPRINT(("perfmon: pfm_inherit clearing state for [%d]\n", task_pid_nr(task)));
thread = &task->thread;
/*
* cut links inherited from parent (current)
*/
thread->pfm_context = NULL;
PFM_SET_WORK_PENDING(task, 0... |
functions | long
sys_perfmonctl (int fd, int cmd, void *arg, int count)
{
return -ENOSYS;
} |
includes | #include <iconv.h> |
includes | #include <string.h> |
defines | #define AV_NOPTS_VALUE ((signed)INT64_C(0x8000000000000000)) |
defines |
#define ISDBSUB_DATA_ID 0x80 |
defines | #define ISDBSUB_DU_TYPE_TXT 0x20 |
defines | #define ISDBSUB_UNIT_SEP 0x1F |
defines | #define ISDBSUB_MGMNT_TIMEOUT (180 * 1000) |
defines | #define ISDBSUB_NO_DGID -1 |
defines | #define ISDBSUB_MAX_LANG 2 /* ARIB TR-B14/B15 */ |
defines |
#define IS_HORIZONTAL_LAYOUT(format) \ |
defines | #define LAYOUT_GET_WIDTH(format) \ |
defines | #define LAYOUT_GET_HEIGHT(format) \ |
defines |
#define MPEGTS_MAX_PTS (((2LL<<33) + 45)/90) |
defines |
#define RGBA(r,g,b,a) (((unsigned)(255 - (a)) << 24) | ((b) << 16) | ((g) << 8) | (r)) |
defines | #define CODE_ASCII ('\x40') |
defines | #define CODE_ASCII2 ('\x4A') |
defines | #define CODE_JISX0208 ('\x42') |
defines | #define CODE_JISX0213_1 ('\x51') |
defines | #define CODE_JISX0213_2 ('\x50') |
defines | #define CODE_JISX0201_KATA ('\x49') |
defines | #define CODE_MOSAIC_C ('\x34') |
defines | #define CODE_MOSAIC_D ('\x35') |
defines | #define CODE_EXT ('\x3B') |
defines | #define CODE_X_HIRA ('\x30') |
defines | #define CODE_X_HIRA_P ('\x37') |
defines | #define CODE_X_KATA ('\x31') |
defines | #define CODE_X_KATA_P ('\x38') |
defines | #define CODE_X_DRCS_MB ('\x40') |
defines | #define CODE_X_DRCS_MIN ('\x41') |
defines | #define CODE_X_DRCS_MAX ('\x4F') |
defines | #define CODE_X_MACRO ('\x70') |
defines | #define STYLE_PARAMS_FONT \ |
defines | #define STYLE_PARAMS_COMMON \ |
structs | struct margins {
int l, r, v;
}; |
functions | void memdump(int level, const char *buf, int buf_size)
{
int i;
for (i=0; i < buf_size; i++) {
mp_msg(MSGT_DECSUB, level, "%02hhx ", buf[i]);
if (i % 16 == 15)
mp_msg(MSGT_DECSUB, level, "\n");
} |
functions | void init_layout(struct isdbsub_layout *l)
{
l->font_size = 36;
l->display_area.x = 0;
l->display_area.y = 0;
switch (l->format) {
case ISDBSUB_FMT_960H:
l->display_area.w = 960;
l->display_area.h = 540;
l->cell_spacing.col = 4;
l->cell_spacing.row = 24;
break... |
functions | void reset_state(ISDBSubState *state)
{
struct isdbsub_layout *l = &state->layout_state;
struct b24str_state *s = &state->text_state;
state->need_init = 1;
state->clut_high_idx = 0;
state->fg_color = Default_clut[7]; // white
state->bg_color = Default_clut[8]; // translucent
state->mat_co... |
functions | void get_margins(ISDBSubContext *ctx, struct margins *m)
{
struct isdbsub_layout *lstate = &ctx->current_state.layout_state;
if (IS_HORIZONTAL_LAYOUT(lstate->format)) {
m->l = lstate->display_area.x + lstate->block_offset_h;
m->r = LAYOUT_GET_WIDTH(lstate->format)
- (lstate->dis... |
functions | void clear_text(ISDBSubContext *ctx)
{
ctx->text.used = 0;
ctx->text.txt_tail = 0;
} |
functions | void append_event(ISDBSubContext *ctx)
{
ISDBSubState *state = &ctx->current_state;
struct isdbsub_layout *l = &state->layout_state;
char start[16], end[16];
struct margins m;
char effect[36], clipping[64];
char *dialog;
char c0 = 0;
if (ctx->pts == AV_NOPTS_VALUE || ctx->text.buf == NU... |
functions | void reserve_buf(ISDBSubContext *ctx, size_t len)
{
size_t blen;
if (ctx->text.len >= ctx->text.used + len)
return;
blen = ((ctx->text.used + len + 127) >> 7) << 7;
ctx->text.buf = av_realloc(ctx->text.buf, blen);
if (!ctx->text.buf) {
mp_msg(MSGT_DECSUB, MSGL_WARN, "out of memory ... |
functions | int append_str(ISDBSubContext *ctx, const char *str)
{
size_t tlen = strlen(str);
reserve_buf(ctx, tlen + 1); // +1 for terminating '\0'
memcpy(ctx->text.buf + ctx->text.used, str, tlen);
ctx->text.used += tlen;
ctx->text.buf[ctx->text.used] = '\0';
return 0;
} |
functions | int prepend_str(ISDBSubContext *ctx, const char *str)
{
struct isdbsub_layout *ls = &ctx->current_state.layout_state;
size_t tlen = strlen(str);
reserve_buf(ctx, tlen + 1); // +1 for terminating '\0'
memmove(ctx->text.buf + tlen, ctx->text.buf, ctx->text.used);
memcpy(ctx->text.buf, str, tlen);
... |
functions | void do_output(ISDBSubContext *ctx, uint8_t **outbufp, int *osize)
{
int header = 0;
if (!ctx->script_info && !ctx->events)
return;
mp_msg(MSGT_DECSUB, MSGL_DBG2, "making output.\n");
if (ctx->script_info) {
*outbufp = my_astrconcat(*outbufp, ctx->script_info);
free(ctx->script... |
functions | void set_format(ISDBSubContext *ctx)
{
struct isdbsub_layout *ls = &ctx->current_state.layout_state;
clear_text(ctx);
reset_state(&ctx->current_state);
free(ctx->script_info);
ctx->script_info = av_asprintf("[Script Info]\nScript Type: v4.00+\n"
"PlayDepth: 24\nPlayResX: %d\nPlayResY: %d\n... |
functions | void set_color(ISDBSubContext *ctx, int whatcolor, uint32_t color)
{
char fmt[32];
if (whatcolor < 1 || whatcolor > 5)
return;
fmt[0] = '\0';
av_strlcatf(fmt, sizeof(fmt), "{\\%dc&H%06X&\\%da&H%02X&} |
functions | void set_font_scale(ISDBSubContext *ctx)
{
struct isdbsub_layout *ls = &ctx->current_state.layout_state;
char fmt[24];
fmt[0] = '\0';
av_strlcatf(fmt, sizeof(fmt), "{\\fscx%d\\fscy%d} |
functions | void setup_line_head(ISDBSubContext *ctx)
{
ISDBSubState *state = &ctx->current_state;
struct isdbsub_layout *ls = &state->layout_state;
char item[256];
int cscale;
if (IS_HORIZONTAL_LAYOUT(ls->format))
cscale = ls->font_scale.fscx;
else
cscale = ls->font_scale.fscy;
item[0... |
functions | void advance_by_pixels(ISDBSubContext *ctx, int csp)
{
struct isdbsub_layout *ls = &ctx->current_state.layout_state;
int cscale;
int csep_orig;
char tmp[32];
if (IS_HORIZONTAL_LAYOUT(ls->format))
cscale = ls->font_scale.fscx;
else
cscale = ls->font_scale.fscy;
csep_orig = ls... |
functions | void move_penpos(ISDBSubContext *ctx, int col, int row)
{
struct isdbsub_layout *ls = &ctx->current_state.layout_state;
int csp_l, col_ofs;
int cur_bottom;
int cell_height;
int cell_desc;
mp_msg(MSGT_DECSUB, MSGL_DBG2, "move pen pos. to (%d, %d).\n", col, row);
if (IS_HORIZONTAL_LAYOUT(ls->... |
functions | else if (row + cell_height * 3 / 2 > cur_bottom &&
col + csp_l > col_ofs + ls->line_width) {
// append to the current line...
advance_by_pixels(ctx, col + csp_l - (col_ofs + ls->line_width));
} |
functions | void set_position(ISDBSubContext *ctx, unsigned int p1, unsigned int p2)
{
struct isdbsub_layout *ls = &ctx->current_state.layout_state;
int cw, ch;
int col, row;
if (IS_HORIZONTAL_LAYOUT(ls->format)) {
cw = (ls->font_size + ls->cell_spacing.col) * ls->font_scale.fscx / 100;
ch = (ls->... |
functions | CS
if (!state->rollup_mode) {
init_layout(ls);
reset_state(state);
clear_text(ctx);
mp_msg(MSGT_DECSUB, MSGL_DBG2, "screen cleared.\n");
} |
functions | else if (p1 == 1 && *q == 0x20) { // outline
int idx = (p2 / 100) << 4 | (p2 % 100);
if (idx < 0 || idx > 127)
break;
append_str(ctx, "{\\bord1} |
functions | char append_arib_char (ISDBSubContext *ctx, uint8_t c1, uint8_t c2)
{
struct isdbsub_layout *ls = &ctx->current_state.layout_state;
struct b24str_state *ts = &ctx->current_state.text_state;
int gidx;
uint8_t code;
size_t ilen, olen, ret;
char indata[3], *obuf, *ibuf;
const uint8_t *p;
ui... |
functions | void insert_str(ISDBSubContext *ctx, const char *txt, int begin)
{
int end = ctx->text.used;
size_t len = strlen(txt);
if (len == 0 || len > 128)
return;
reserve_buf(ctx, len + 1); // +1 for terminating '\0'
memmove(ctx->text.buf + begin + len, ctx->text.buf + begin, end - begin);
memc... |
functions | void fixup_linesep(ISDBSubContext *ctx)
{
struct isdbsub_layout *ls = &ctx->current_state.layout_state;
char tmp[16];
int lsp;
if (ls->prev_break_idx <= 0)
return;
// adjust baseline if all chars in the line are 50% tall of one font size.
if (ls->shift_baseline && IS_HORIZONTAL_LAYOUT(l... |
functions | void do_line_break(ISDBSubContext *ctx)
{
struct isdbsub_layout *ls = &ctx->current_state.layout_state;
int csp;
char tmp[32];
if (IS_HORIZONTAL_LAYOUT(ls->format))
csp = ls->cell_spacing.col * ls->font_scale.fscx / 100;
else
csp = ls->cell_spacing.col * ls->font_scale.fscy / 100;
... |
functions | void pre_advance(ISDBSubContext *ctx)
{
struct isdbsub_layout *ls = &ctx->current_state.layout_state;
int csp, cscale;
int w;
int blocklen;
int delta;
if (IS_HORIZONTAL_LAYOUT(ls->format)) {
cscale = ls->font_scale.fscx;
w = ls->font_size * cscale / 100;
csp = ls->cell_s... |
functions | else if (ls->line_width != 0 && delta != 0) {
char tmp[32];
// need to compensate the wrong charsep of the previously added char.
// hack: insert zero-width space with the compensating \fsp. (can be <0)
// note that \fsp is scaled by \fscx in ASS.
tmp[0] = '\0';
av_strl... |
functions | void advance(ISDBSubContext *ctx)
{
struct isdbsub_layout *ls = &ctx->current_state.layout_state;
int cscale;
int h;
int asc, desc;
int csp;
if (IS_HORIZONTAL_LAYOUT(ls->format)) {
cscale = ls->font_scale.fscx;
h = ls->font_size * ls->font_scale.fscy / 100;
if (ls->font_... |
functions | else if (h > ls->line_height) {
ls->linesep_upper = ls->line_height + ls->linesep_upper - h;
ls->line_height = h;
} |
functions | else if (h - h / 2 > ls->line_height) {
ls->linesep_upper = ls->line_height + ls->linesep_upper - h + h / 2;
ls->line_height = h - h / 2;
} |
functions | void forward_position(ISDBSubContext *ctx, int rows, int cols)
{
int i;
for (i = 0; i < rows; i++)
do_line_break(ctx);
for (i = 0; i < cols; i++) {
pre_advance(ctx);
append_str(ctx, "\xe3\x80\x80");
advance(ctx);
} |
functions | repeat
if (ls->repeat_count >= 0) {
// save the repeating char first.
ch = calloc(1, end - begin + 1);
if (ch)
memcpy(ch, ctx->text.buf + begin, end - begin);
else {
mp_msg(MSGT_DECSUB, MSGL_WARN,
"out of mem... |
functions | else if (ls->repeat_count > 0) {
while (--ls->repeat_count > 0) {
pre_advance(ctx);
append_str(ctx, ch);
advance(ctx);
} |
functions | void process_txt_du(ISDBSubContext *ctx, const uint8_t *buf,
int buf_size)
{
const char *p, *q;
ctx->current_state = ctx->default_states[ctx->lang_tag];
reset_state(&ctx->current_state);
iconv(ctx->iconv, NULL, NULL, NULL, NULL);
p = buf;
while (buf_size > 0) {
... |
functions | void process_mngmnt_dg(ISDBSubContext *ctx, const uint8_t *buf,
int buf_size)
{
const uint8_t *p = buf;
int lang_num;
int du_loop_len;
int i;
ctx->timing_mode = *(p++) >> 6;
if (ctx->timing_mode == ISDBSUB_TMD_OFFSET) {
ctx->offset.hour = (p[0] >> 4) * 10... |
functions | code
if (lang_tag < ISDBSUB_MAX_LANG) {
ISDBSubState *state = &ctx->default_states[lang_tag];
int format;
state->auto_display = disp_mode >> 3;
state->rollup_mode = (*p & 0x03);
format = *p >> 4;
state->layout_state.is_profile_c = (format =... |
functions | void process_sub_dg(ISDBSubContext *ctx, const uint8_t *buf,
int buf_size)
{
const uint8_t *p = buf;
int du_loop_len;
if (ctx->pts == AV_NOPTS_VALUE) {
mp_msg(MSGT_DECSUB, MSGL_INFO, "no timestamp on subtitle text data.");
return;
} |
functions | int do_init(ISDBSubContext *ctx)
{
int i;
for (i = 65; i < 73; i++)
Default_clut[i] = Default_clut[i - 65] & ~RGBA(0,0,0,128);
for (i = 73; i < 128; i++)
Default_clut[i] = Default_clut[i - 64] & ~RGBA(0,0,0,128);
Crc_table = av_crc_get_table(AV_CRC_16_CCITT);
ctx->last_mngmnt_id =... |
functions | void isdbsub_reset(struct sh_sub *sh)
{
ISDBSubContext *ctx = sh->context;
if (!ctx)
return;
if (ctx->iconv != (iconv_t) -1)
iconv_close(ctx->iconv);
free(ctx->text.buf);
free(ctx->script_info);
free(ctx->events);
free(ctx);
sh->context = NULL;
} |
functions | int isdbsub_decode(struct sh_sub *sh, uint8_t **data, int *size,
double *pts, double *endpts)
{
ISDBSubContext *ctx = sh->context;
const uint8_t *buf = *data;
int buf_size = *size;
int64_t orig_pts;
const uint8_t *p, *p_end;
mp_msg(MSGT_DECSUB, MSGL_V, "ISDB sub packet:\n");
... |
includes |
#include <linux/module.h> |
includes | #include <linux/init.h> |
includes | #include <linux/kernel.h> |
includes | #include <linux/types.h> |
includes | #include <linux/fcntl.h> |
includes | #include <linux/interrupt.h> |
includes | #include <linux/ptrace.h> |
includes | #include <linux/ioport.h> |
includes | #include <linux/in.h> |
includes | #include <linux/slab.h> |
includes | #include <linux/tty.h> |
includes | #include <linux/errno.h> |
includes | #include <linux/string.h> |
includes | #include <linux/signal.h> |
includes | #include <linux/bitops.h> |
includes |
#include <asm/byteorder.h> |
includes | #include <asm/types.h> |
includes |
#include <linux/if.h> |
includes |
#include <linux/if_ether.h> |
includes | #include <linux/netdevice.h> |
includes | #include <linux/skbuff.h> |
includes | #include <linux/inet.h> |
includes | #include <linux/ioctl.h> |
includes | #include <linux/vmalloc.h> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.