Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
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 {
...
@@ -48,10 +48,6 @@ typedef struct {
SDL_Rect
texture_rect
;
SDL_Rect
texture_rect
;
int
inited
;
int
inited
;
SDL_Thread
*
event_thread
;
SDL_mutex
*
mutex
;
SDL_cond
*
init_cond
;
int
quit
;
}
SDLContext
;
}
SDLContext
;
static
const
struct
sdl_texture_format_entry
{
static
const
struct
sdl_texture_format_entry
{
...
@@ -140,20 +136,9 @@ static int sdl2_write_trailer(AVFormatContext *s)
...
@@ -140,20 +136,9 @@ static int sdl2_write_trailer(AVFormatContext *s)
{
{
SDLContext
*
sdl
=
s
->
priv_data
;
SDLContext
*
sdl
=
s
->
priv_data
;
sdl
->
quit
=
1
;
if
(
sdl
->
texture
)
if
(
sdl
->
texture
)
SDL_DestroyTexture
(
sdl
->
texture
);
SDL_DestroyTexture
(
sdl
->
texture
);
sdl
->
texture
=
NULL
;
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
)
if
(
sdl
->
renderer
)
SDL_DestroyRenderer
(
sdl
->
renderer
);
SDL_DestroyRenderer
(
sdl
->
renderer
);
...
@@ -204,7 +189,7 @@ static int sdl2_write_header(AVFormatContext *s)
...
@@ -204,7 +189,7 @@ static int sdl2_write_header(AVFormatContext *s)
if
(
!
sdl
->
texture_fmt
)
{
if
(
!
sdl
->
texture_fmt
)
{
av_log
(
s
,
AV_LOG_ERROR
,
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
));
av_get_pix_fmt_name
(
codecpar
->
format
));
goto
fail
;
goto
fail
;
}
}
...
@@ -255,7 +240,7 @@ fail:
...
@@ -255,7 +240,7 @@ fail:
static
int
sdl2_write_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
static
int
sdl2_write_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
{
{
int
ret
=
0
;
int
ret
,
quit
=
0
;
SDLContext
*
sdl
=
s
->
priv_data
;
SDLContext
*
sdl
=
s
->
priv_data
;
AVCodecParameters
*
codecpar
=
s
->
streams
[
0
]
->
codecpar
;
AVCodecParameters
*
codecpar
=
s
->
streams
[
0
]
->
codecpar
;
uint8_t
*
data
[
4
];
uint8_t
*
data
[
4
];
...
@@ -268,14 +253,14 @@ static int sdl2_write_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -268,14 +253,14 @@ static int sdl2_write_packet(AVFormatContext *s, AVPacket *pkt)
switch
(
event
.
key
.
keysym
.
sym
)
{
switch
(
event
.
key
.
keysym
.
sym
)
{
case
SDLK_ESCAPE
:
case
SDLK_ESCAPE
:
case
SDLK_q
:
case
SDLK_q
:
sdl
->
quit
=
1
;
quit
=
1
;
break
;
break
;
default:
default:
break
;
break
;
}
}
break
;
break
;
case
SDL_QUIT
:
case
SDL_QUIT
:
sdl
->
quit
=
1
;
quit
=
1
;
break
;
break
;
case
SDL_WINDOWEVENT
:
case
SDL_WINDOWEVENT
:
switch
(
event
.
window
.
event
){
switch
(
event
.
window
.
event
){
...
@@ -294,13 +279,12 @@ static int sdl2_write_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -294,13 +279,12 @@ static int sdl2_write_packet(AVFormatContext *s, AVPacket *pkt)
}
}
}
}
if
(
sdl
->
quit
)
{
if
(
quit
)
{
sdl2_write_trailer
(
s
);
sdl2_write_trailer
(
s
);
return
AVERROR
(
EIO
);
return
AVERROR
(
EIO
);
}
}
av_image_fill_arrays
(
data
,
linesize
,
pkt
->
data
,
codecpar
->
format
,
codecpar
->
width
,
codecpar
->
height
,
1
);
av_image_fill_arrays
(
data
,
linesize
,
pkt
->
data
,
codecpar
->
format
,
codecpar
->
width
,
codecpar
->
height
,
1
);
SDL_LockMutex
(
sdl
->
mutex
);
switch
(
sdl
->
texture_fmt
)
{
switch
(
sdl
->
texture_fmt
)
{
/* case SDL_PIXELFORMAT_ARGB4444:
/* case SDL_PIXELFORMAT_ARGB4444:
* case SDL_PIXELFORMAT_RGBA4444:
* case SDL_PIXELFORMAT_RGBA4444:
...
@@ -346,7 +330,6 @@ static int sdl2_write_packet(AVFormatContext *s, AVPacket *pkt)
...
@@ -346,7 +330,6 @@ static int sdl2_write_packet(AVFormatContext *s, AVPacket *pkt)
SDL_RenderClear
(
sdl
->
renderer
);
SDL_RenderClear
(
sdl
->
renderer
);
SDL_RenderCopy
(
sdl
->
renderer
,
sdl
->
texture
,
NULL
,
&
sdl
->
texture_rect
);
SDL_RenderCopy
(
sdl
->
renderer
,
sdl
->
texture
,
NULL
,
&
sdl
->
texture_rect
);
SDL_RenderPresent
(
sdl
->
renderer
);
SDL_RenderPresent
(
sdl
->
renderer
);
SDL_UnlockMutex
(
sdl
->
mutex
);
return
ret
;
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