Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
b5096816
Commit
b5096816
authored
Dec 01, 2013
by
Marton Balint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libzvbi-teletextdec: cosmetics
Signed-off-by:
Marton Balint
<
cus@passwd.hu
>
parent
c65fe9e9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
25 deletions
+11
-25
libzvbi-teletextdec.c
libavcodec/libzvbi-teletextdec.c
+11
-25
No files found.
libavcodec/libzvbi-teletextdec.c
View file @
b5096816
...
...
@@ -43,7 +43,6 @@ typedef struct TeletextPage
int64_t
pts
;
}
TeletextPage
;
/* main data structure */
typedef
struct
TeletextContext
{
AVClass
*
class
;
...
...
@@ -67,14 +66,10 @@ typedef struct TeletextContext
#ifdef DEBUG
vbi_export
*
ex
;
#endif
/* Don't even _think_ about making sliced stack-local! */
vbi_sliced
sliced
[
64
];
}
TeletextContext
;
/************************************************************************/
static
int
chop_spaces_utf8
(
const
unsigned
char
*
t
,
int
len
)
static
int
chop_spaces_utf8
(
const
unsigned
char
*
t
,
int
len
)
{
t
+=
len
;
while
(
len
>
0
)
{
...
...
@@ -85,8 +80,7 @@ chop_spaces_utf8(const unsigned char* t, int len)
return
len
;
}
static
void
subtitle_rect_free
(
AVSubtitleRect
**
sub_rect
)
static
void
subtitle_rect_free
(
AVSubtitleRect
**
sub_rect
)
{
av_freep
(
&
(
*
sub_rect
)
->
pict
.
data
[
0
]);
av_freep
(
&
(
*
sub_rect
)
->
pict
.
data
[
1
]);
...
...
@@ -94,8 +88,7 @@ subtitle_rect_free(AVSubtitleRect **sub_rect)
av_freep
(
sub_rect
);
}
static
int
create_ass_text
(
TeletextContext
*
ctx
,
const
char
*
text
,
char
**
ass
)
static
int
create_ass_text
(
TeletextContext
*
ctx
,
const
char
*
text
,
char
**
ass
)
{
int
ret
;
AVBPrint
buf
,
buf2
;
...
...
@@ -127,9 +120,8 @@ create_ass_text(TeletextContext *ctx, const char *text, char **ass)
return
0
;
}
// draw a page as text
static
int
gen_sub_text
(
TeletextContext
*
ctx
,
AVSubtitleRect
*
sub_rect
,
vbi_page
*
page
,
int
chop_top
)
/* Draw a page as text */
static
int
gen_sub_text
(
TeletextContext
*
ctx
,
AVSubtitleRect
*
sub_rect
,
vbi_page
*
page
,
int
chop_top
)
{
const
char
*
in
;
AVBPrint
buf
;
...
...
@@ -195,8 +187,8 @@ gen_sub_text(TeletextContext *ctx, AVSubtitleRect *sub_rect, vbi_page *page, int
return
0
;
}
static
void
fix_transparency
(
TeletextContext
*
ctx
,
AVSubtitleRect
*
sub_rect
,
vbi_page
*
page
,
int
chop_top
,
uint8_t
transparent_color
,
int
resx
,
int
resy
)
static
void
fix_transparency
(
TeletextContext
*
ctx
,
AVSubtitleRect
*
sub_rect
,
vbi_page
*
page
,
int
chop_top
,
uint8_t
transparent_color
,
int
resx
,
int
resy
)
{
int
iy
;
...
...
@@ -226,9 +218,8 @@ fix_transparency(TeletextContext *ctx, AVSubtitleRect *sub_rect, vbi_page *page,
}
}
// draw a page as bitmap
static
int
gen_sub_bitmap
(
TeletextContext
*
ctx
,
AVSubtitleRect
*
sub_rect
,
vbi_page
*
page
,
int
chop_top
)
/* Draw a page as bitmap */
static
int
gen_sub_bitmap
(
TeletextContext
*
ctx
,
AVSubtitleRect
*
sub_rect
,
vbi_page
*
page
,
int
chop_top
)
{
int
resx
=
page
->
columns
*
12
;
int
resy
=
(
page
->
rows
-
chop_top
)
*
10
;
...
...
@@ -289,8 +280,7 @@ gen_sub_bitmap(TeletextContext *ctx, AVSubtitleRect *sub_rect, vbi_page *page, i
return
0
;
}
static
void
handler
(
vbi_event
*
ev
,
void
*
user_data
)
static
void
handler
(
vbi_event
*
ev
,
void
*
user_data
)
{
TeletextContext
*
ctx
=
user_data
;
TeletextPage
*
new_pages
;
...
...
@@ -311,7 +301,6 @@ handler(vbi_event *ev, void *user_data)
if
(
ctx
->
handler_ret
<
0
)
return
;
/* Fetch the page. */
res
=
vbi_fetch_vt_page
(
ctx
->
vbi
,
&
page
,
ev
->
ev
.
ttx_page
.
pgno
,
ev
->
ev
.
ttx_page
.
subno
,
...
...
@@ -369,10 +358,7 @@ handler(vbi_event *ev, void *user_data)
vbi_unref_page
(
&
page
);
}
static
int
teletext_decode_frame
(
AVCodecContext
*
avctx
,
void
*
data
,
int
*
data_size
,
AVPacket
*
pkt
)
static
int
teletext_decode_frame
(
AVCodecContext
*
avctx
,
void
*
data
,
int
*
data_size
,
AVPacket
*
pkt
)
{
TeletextContext
*
ctx
=
avctx
->
priv_data
;
AVSubtitle
*
sub
=
data
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment