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
45601854
Commit
45601854
authored
May 01, 2014
by
Lukasz Marek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavd/opengl_enc: add window size param
Signed-off-by:
Lukasz Marek
<
lukasz.m.luki2@gmail.com
>
parent
41e4c6d8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
3 deletions
+18
-3
outdevs.texi
doc/outdevs.texi
+4
-0
opengl_enc.c
libavdevice/opengl_enc.c
+13
-2
version.h
libavdevice/version.h
+1
-1
No files found.
doc/outdevs.texi
View file @
45601854
...
@@ -237,6 +237,10 @@ Application must provide OpenGL context and both @code{window_size_cb} and @code
...
@@ -237,6 +237,10 @@ Application must provide OpenGL context and both @code{window_size_cb} and @code
@item window_title
@item window_title
Set the SDL window title, if not specified default to the filename specified for the output device.
Set the SDL window title, if not specified default to the filename specified for the output device.
Ignored when @option{no_window} is set.
Ignored when @option{no_window} is set.
@item window_size
Set preferred window size, can be a string of the form widthxheight or a video size abbreviation.
If not specified it defaults to the size of the input video, downscaled according to the aspect ratio.
Mostly usable when @option{no_window} is not set.
@end table
@end table
...
...
libavdevice/opengl_enc.c
View file @
45601854
...
@@ -407,7 +407,8 @@ static int av_cold opengl_sdl_create_window(AVFormatContext *h)
...
@@ -407,7 +407,8 @@ static int av_cold opengl_sdl_create_window(AVFormatContext *h)
av_log
(
opengl
,
AV_LOG_ERROR
,
"Unable to initialize SDL: %s
\n
"
,
SDL_GetError
());
av_log
(
opengl
,
AV_LOG_ERROR
,
"Unable to initialize SDL: %s
\n
"
,
SDL_GetError
());
return
AVERROR_EXTERNAL
;
return
AVERROR_EXTERNAL
;
}
}
if
((
ret
=
opengl_sdl_recreate_window
(
opengl
,
opengl
->
width
,
opengl
->
height
))
<
0
)
if
((
ret
=
opengl_sdl_recreate_window
(
opengl
,
opengl
->
window_width
,
opengl
->
window_height
))
<
0
)
return
ret
;
return
ret
;
av_log
(
opengl
,
AV_LOG_INFO
,
"SDL driver: '%s'.
\n
"
,
SDL_VideoDriverName
(
buffer
,
sizeof
(
buffer
)));
av_log
(
opengl
,
AV_LOG_INFO
,
"SDL driver: '%s'.
\n
"
,
SDL_VideoDriverName
(
buffer
,
sizeof
(
buffer
)));
message
.
width
=
opengl
->
surface
->
w
;
message
.
width
=
opengl
->
surface
->
w
;
...
@@ -951,7 +952,12 @@ static int opengl_create_window(AVFormatContext *h)
...
@@ -951,7 +952,12 @@ static int opengl_create_window(AVFormatContext *h)
return
AVERROR
(
ENOSYS
);
return
AVERROR
(
ENOSYS
);
#endif
#endif
}
else
{
}
else
{
if
((
ret
=
avdevice_dev_to_app_control_message
(
h
,
AV_DEV_TO_APP_CREATE_WINDOW_BUFFER
,
NULL
,
0
))
<
0
)
{
AVDeviceRect
message
;
message
.
x
=
message
.
y
=
0
;
message
.
width
=
opengl
->
window_width
;
message
.
height
=
opengl
->
window_height
;
if
((
ret
=
avdevice_dev_to_app_control_message
(
h
,
AV_DEV_TO_APP_CREATE_WINDOW_BUFFER
,
&
message
,
sizeof
(
message
)))
<
0
)
{
av_log
(
opengl
,
AV_LOG_ERROR
,
"Application failed to create window buffer.
\n
"
);
av_log
(
opengl
,
AV_LOG_ERROR
,
"Application failed to create window buffer.
\n
"
);
return
ret
;
return
ret
;
}
}
...
@@ -1067,6 +1073,10 @@ static av_cold int opengl_write_header(AVFormatContext *h)
...
@@ -1067,6 +1073,10 @@ static av_cold int opengl_write_header(AVFormatContext *h)
opengl
->
width
=
st
->
codec
->
width
;
opengl
->
width
=
st
->
codec
->
width
;
opengl
->
height
=
st
->
codec
->
height
;
opengl
->
height
=
st
->
codec
->
height
;
opengl
->
pix_fmt
=
st
->
codec
->
pix_fmt
;
opengl
->
pix_fmt
=
st
->
codec
->
pix_fmt
;
if
(
!
opengl
->
window_width
)
opengl
->
window_width
=
opengl
->
width
;
if
(
!
opengl
->
window_height
)
opengl
->
window_height
=
opengl
->
height
;
if
(
!
opengl
->
window_title
&&
!
opengl
->
no_window
)
if
(
!
opengl
->
window_title
&&
!
opengl
->
no_window
)
opengl
->
window_title
=
av_strdup
(
h
->
filename
);
opengl
->
window_title
=
av_strdup
(
h
->
filename
);
...
@@ -1268,6 +1278,7 @@ static const AVOption options[] = {
...
@@ -1268,6 +1278,7 @@ static const AVOption options[] = {
{
"background"
,
"set background color"
,
OFFSET
(
background
),
AV_OPT_TYPE_COLOR
,
{.
str
=
"black"
},
CHAR_MIN
,
CHAR_MAX
,
ENC
},
{
"background"
,
"set background color"
,
OFFSET
(
background
),
AV_OPT_TYPE_COLOR
,
{.
str
=
"black"
},
CHAR_MIN
,
CHAR_MAX
,
ENC
},
{
"no_window"
,
"disable default window"
,
OFFSET
(
no_window
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
INT_MIN
,
INT_MAX
,
ENC
},
{
"no_window"
,
"disable default window"
,
OFFSET
(
no_window
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
INT_MIN
,
INT_MAX
,
ENC
},
{
"window_title"
,
"set window title"
,
OFFSET
(
window_title
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
ENC
},
{
"window_title"
,
"set window title"
,
OFFSET
(
window_title
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
ENC
},
{
"window_size"
,
"set window size"
,
OFFSET
(
window_width
),
AV_OPT_TYPE_IMAGE_SIZE
,
{.
str
=
NULL
},
0
,
0
,
ENC
},
{
NULL
}
{
NULL
}
};
};
...
...
libavdevice/version.h
View file @
45601854
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
#define LIBAVDEVICE_VERSION_MAJOR 55
#define LIBAVDEVICE_VERSION_MAJOR 55
#define LIBAVDEVICE_VERSION_MINOR 13
#define LIBAVDEVICE_VERSION_MINOR 13
#define LIBAVDEVICE_VERSION_MICRO 10
0
#define LIBAVDEVICE_VERSION_MICRO 10
1
#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
LIBAVDEVICE_VERSION_MINOR, \
LIBAVDEVICE_VERSION_MINOR, \
...
...
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