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
fbb1fcd4
Commit
fbb1fcd4
authored
Sep 24, 2016
by
Josh de Kock
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavd/sdl2: remove unused code
parent
b98dafe0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
22 deletions
+5
-22
sdl2.c
libavdevice/sdl2.c
+5
-22
No files found.
libavdevice/sdl2.c
View file @
fbb1fcd4
...
...
@@ -48,10 +48,6 @@ typedef struct {
SDL_Rect
texture_rect
;
int
inited
;
SDL_Thread
*
event_thread
;
SDL_mutex
*
mutex
;
SDL_cond
*
init_cond
;
int
quit
;
}
SDLContext
;
static
const
struct
sdl_texture_format_entry
{
...
...
@@ -140,20 +136,9 @@ static int sdl2_write_trailer(AVFormatContext *s)
{
SDLContext
*
sdl
=
s
->
priv_data
;
sdl
->
quit
=
1
;
if
(
sdl
->
texture
)
SDL_DestroyTexture
(
sdl
->
texture
);
sdl
->
texture
=
NULL
;
if
(
sdl
->
event_thread
)
SDL_WaitThread
(
sdl
->
event_thread
,
NULL
);
sdl
->
event_thread
=
NULL
;
if
(
sdl
->
mutex
)
SDL_DestroyMutex
(
sdl
->
mutex
);
sdl
->
mutex
=
NULL
;
if
(
sdl
->
init_cond
)
SDL_DestroyCond
(
sdl
->
init_cond
);
sdl
->
init_cond
=
NULL
;
if
(
sdl
->
renderer
)
SDL_DestroyRenderer
(
sdl
->
renderer
);
...
...
@@ -204,7 +189,7 @@ static int sdl2_write_header(AVFormatContext *s)
if
(
!
sdl
->
texture_fmt
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Unsupported pixel format '%s'
, choose one of yuv420p, yuyv422, uyvy422, BGRA
\n
"
,
"Unsupported pixel format '%s'
.
\n
"
,
av_get_pix_fmt_name
(
codecpar
->
format
));
goto
fail
;
}
...
...
@@ -255,7 +240,7 @@ fail:
static
int
sdl2_write_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
{
int
ret
=
0
;
int
ret
,
quit
=
0
;
SDLContext
*
sdl
=
s
->
priv_data
;
AVCodecParameters
*
codecpar
=
s
->
streams
[
0
]
->
codecpar
;
uint8_t
*
data
[
4
];
...
...
@@ -268,14 +253,14 @@ static int sdl2_write_packet(AVFormatContext *s, AVPacket *pkt)
switch
(
event
.
key
.
keysym
.
sym
)
{
case
SDLK_ESCAPE
:
case
SDLK_q
:
sdl
->
quit
=
1
;
quit
=
1
;
break
;
default:
break
;
}
break
;
case
SDL_QUIT
:
sdl
->
quit
=
1
;
quit
=
1
;
break
;
case
SDL_WINDOWEVENT
:
switch
(
event
.
window
.
event
){
...
...
@@ -294,13 +279,12 @@ static int sdl2_write_packet(AVFormatContext *s, AVPacket *pkt)
}
}
if
(
sdl
->
quit
)
{
if
(
quit
)
{
sdl2_write_trailer
(
s
);
return
AVERROR
(
EIO
);
}
av_image_fill_arrays
(
data
,
linesize
,
pkt
->
data
,
codecpar
->
format
,
codecpar
->
width
,
codecpar
->
height
,
1
);
SDL_LockMutex
(
sdl
->
mutex
);
switch
(
sdl
->
texture_fmt
)
{
/* case SDL_PIXELFORMAT_ARGB4444:
* case SDL_PIXELFORMAT_RGBA4444:
...
...
@@ -346,7 +330,6 @@ static int sdl2_write_packet(AVFormatContext *s, AVPacket *pkt)
SDL_RenderClear
(
sdl
->
renderer
);
SDL_RenderCopy
(
sdl
->
renderer
,
sdl
->
texture
,
NULL
,
&
sdl
->
texture_rect
);
SDL_RenderPresent
(
sdl
->
renderer
);
SDL_UnlockMutex
(
sdl
->
mutex
);
return
ret
;
}
...
...
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