Commit Graph

47 Commits

Author SHA1 Message Date
Alexander Strasser
36aee69f0d libavdevice: Improve example in deprecation message for opengl and sdl
When piping ffmpeg into ffplay both programs write a status line in
the terminal. That causes flickering and invisibility of one or the
other status line.

As compromise set ffplay log level to warning, so it doesn't show
the status line.

The user is usually testing ffmpeg command lines and want's a
preview of the result. This way the user can see the ffmpeg output
and still see errors and warnings from ffplay, should they occur.

Additionally set PTS to zero in ffplay to lessen the delay until
the frames are displayed. Without it delay is quite observable
when e.g. live capturing with low frame rates.
2024-07-14 13:31:03 +02:00
Andreas Rheinhardt
790f793844 avutil/common: Don't auto-include mem.h
There are lots of files that don't need it: The number of object
files that actually need it went down from 2011 to 884 here.

Keep it for external users in order to not cause breakages.

Also improve the other headers a bit while just at it.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2024-03-31 00:08:43 +01:00
J. Dekker
e4c0cdf8df avdevice: deprecate opengl outdev
Signed-off-by: J. Dekker <jdek@itanimul.li>
2024-02-28 10:28:49 +01:00
Anton Khirnov
08bebeb1be Revert "all: Don't set AVClass.item_name to its default value"
Some callers assume that item_name is always set, so this may be
considered an API break.

This reverts commit 0c6203c97a.
2024-01-20 10:34:48 +01:00
Andreas Rheinhardt
0c6203c97a all: Don't set AVClass.item_name to its default value
Unnecessary since acf63d5350adeae551d412db699f8ca03f7e76b9;
also avoids relocations.

Reviewed-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-12-22 15:12:33 +01:00
Andreas Rheinhardt
e999a09f19 all: Replace __FUNCTION__ by __func__
Only the latter is valid ISO C.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-07 00:48:50 +02:00
Andreas Rheinhardt
0c6e5f321b avformat/avformat: Avoid including codec.h, frame.h
AVCodec is only ever used as an incomplete type (i.e. via a pointer
to an AVCodec) in avformat.h and it is not really part of the core
of avformat.h or libavformat; almost none of our internal users
make use of it (and none make use of hwcontext.h, which is implicitly
included). So switch to use struct AVCodec, but continue to include
codec.h for external users for compatibility.

Also, do the same for AVFrame and frame.h, which is implicitly included
by codec.h (via lavu/hwcontext.h).

Also, remove an unnecessary inclusion of <time.h>.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2023-09-07 00:30:08 +02:00
L. E. Segovia
ddc1cd5cdd configure: Set WIN32_LEAN_AND_MEAN at configure time
Including winsock2.h or windows.h without WIN32_LEAN_AND_MEAN cause
bzlib.h to parse as nonsense, due to an instance of #define char small
in rpcndr.h.

See:

https://stackoverflow.com/a/27794577

Signed-off-by: L. E. Segovia <amy@amyspark.me>
Signed-off-by: Martin Storsjö <martin@martin.st>
2023-08-14 22:57:28 +03:00
Haihao Xiang
5b11ee9429 lavd/opengl_enc: fix a compiler error
glcontext was added under CONFIG_SDL2

libavdevice/opengl_enc.c: In function ‘opengl_draw’:
libavdevice/opengl_enc.c:1204:15: error: ‘OpenGLContext’ has no member
named ‘glcontext’

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
2023-07-24 10:17:51 +08:00
Nicolas George
02aeacbb5e lavd/opengl: select the GL context before drawing
Since “2d924b3a63 fftools/ffmpeg: move each muxer to a separate thread”,
opengl_write_packet() is called from a different thread than
opengl_write_header() and would nothing for lack of a selected context.
2023-07-12 15:06:15 +02:00
Paul B Mahol
557686ac63 avdevice/opengl_enc: check sscanf return value 2023-05-22 20:08:55 +02:00
Andreas Rheinhardt
59c9dc82f4 avformat/avformat: Move AVOutputFormat internals out of public header
This commit does for AVOutputFormat what commit
20f9727018 did for AVCodec:
It adds a new type FFOutputFormat, moves all the internals
of AVOutputFormat to it and adds a now reduced AVOutputFormat
as first member.

This does not affect/improve extensibility of both public
or private fields for muxers (it is still a mess due to lavd).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2023-02-09 15:24:15 +01:00
Andreas Rheinhardt
f4a2d722aa avformat/internal: Move muxing-only functions to new mux.h header
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2022-05-10 07:27:01 +02:00
Andreas Rheinhardt
d92f38c179 avdevice: Constify all devices
This is possible now that the next-API is gone.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-04-27 11:48:05 -03:00
Marton Balint
2a118a71cf avdevice/opengl: add support of wrapped avframe codec
Also change the default to that.

Signed-off-by: Marton Balint <cus@passwd.hu>
2020-04-16 23:52:12 +02:00
Paul B Mahol
d64cbd4fda remove CHAR_MIN/CHAR_MAX usage
It is not needed at all.
2020-03-17 22:46:36 +01:00
Nicolas George
26ae9c9f8a lavd/opengl_enc: check strings before parsing them.
Fix a segfault if OpenGL was not initialized before calling
write_header().
2020-02-20 14:37:11 +01:00
Nicolas George
fbb36d74ac lavd/opengl_enc: use proper context for logging.
Log as [opengl @ 0xaddress] instead of [opengl outdev @ 0xaddress].
2020-02-20 14:27:11 +01:00
Don C. Bigler
2be7c388db avdevice/opengl_enc: fix build error using msvc compiler 2019-04-10 12:41:58 +02:00
Marton Balint
4bb0409820 avdevice: migrate to AVFormatContext->url
Signed-off-by: Marton Balint <cus@passwd.hu>
2018-01-28 23:06:43 +01:00
Clément Bœsch
353c2e384c build: replace use of HAVE_SDL2 with existing CONFIG_SDL2
There is no need for duplication.
2017-09-02 16:14:15 +02:00
Carl Eugen Hoyos
6a22d2459d lavd/opengl_enc: Fix a typo. 2017-02-23 00:11:43 +01:00
Carl Eugen Hoyos
2ac381088d lavd/opengl_enc: Support BGR48. 2017-02-22 00:10:25 +01:00
Lukasz Marek
645353829f lavd/opengl: use SDL2
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Signed-off-by: Josh de Kock <josh@itanimul.li>
2016-09-24 16:50:40 +01:00
Derek Buitenhuis
6f69f7a8bf Merge commit '9200514ad8717c63f82101dc394f4378854325bf'
* commit '9200514ad8717c63f82101dc394f4378854325bf':
  lavf: replace AVStream.codec with AVStream.codecpar

This has been a HUGE effort from:
    - Derek Buitenhuis <derek.buitenhuis@gmail.com>
    - Hendrik Leppkes <h.leppkes@gmail.com>
    - wm4 <nfxjfg@googlemail.com>
    - Clément Bœsch <clement@stupeflix.com>
    - James Almer <jamrial@gmail.com>
    - Michael Niedermayer <michael@niedermayer.cc>
    - Rostislav Pehlivanov <atomnuker@gmail.com>

Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-04-10 20:59:55 +01:00
Derek Buitenhuis
21f9468402 avutil: Rename FF_CEIL_COMPAT to AV_CEIL_COMPAT
Libav, for some reason, merged this as a public API function. This will
aid in future merges.

A define is left for backwards compat, just in case some person
used it, since it is in a public header.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2016-01-27 16:36:46 +00:00
Hendrik Leppkes
5d8e836d0e Replace all remaining occurances of step/depth_minus1 and offset_plus1 2015-09-08 17:10:48 +02:00
Matthew Oliver
0167fa0060 msvc: Fix compilation errors due to header include order.
Ensures that the header include order is such that winsock2.h is always
included before windows.h or that windows.h does not include winsock.h.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-11-27 12:40:18 +01:00
Reimar Döffinger
d9e2aceb7f Add missing "const" all over the place.
Only "./configure --enable-gpl" on x86 was tested.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
2014-08-29 18:57:25 +02:00
Lou Logan
88f2586adb fix various typos
Signed-off-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-06-03 10:58:19 -08:00
Lukasz Marek
db4b03146c lavd/opengl_enc: fix window size correction code
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2014-05-02 18:04:05 +02:00
Lukasz Marek
45601854b1 lavd/opengl_enc: add window size param
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2014-05-02 18:03:52 +02:00
Lukasz Marek
41e4c6d8c5 lavd/opengl_enc: use flag to mark inited context
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
2014-05-02 17:46:37 +02:00
Lukasz Marek
8ff72924cf lavd/opengl_enc: fix pixel data alignment
Signed-off-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-30 22:03:32 +02:00
Matt Oliver
27f184ef40 Fix OpenGL device compilation with msvc gl.h
Reveiwed-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-04-16 18:05:40 +02:00
Lukasz Marek
f607767d93 lavd: add categories to device implementations
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-03-03 23:34:46 +01:00
Lukasz Marek
db4a704482 lavd/opengl_enc: implement uncoded frame callback
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-02-13 23:33:05 +01:00
Lukasz Marek
db403023c0 lavd/opengl_enc: add gray8/16 formats
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-02-13 23:33:05 +01:00
Lukasz Marek
c81a9d13f4 lavd/opengl_enc: fix parentheses in if condition
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-02-02 22:14:34 +01:00
Lukasz Marek
5059d8dfe3 lavd/opengl_enc: remove inlines
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-02-02 02:26:02 +01:00
Lukasz Marek
69b19f2642 lavd/opengl_enc: fix window caption
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-02-02 02:23:25 +01:00
Lukasz Marek
1fb1ddf647 lavd/opengl_enc: simplify opengl_load_procedures usage
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-02-02 02:23:25 +01:00
Lukasz Marek
c8275331ba lavd/opengl_enc: factorize deinit_context function
This commit also fixes opengl deinitialization.
Program and shaders where not deleted.
Could impact MacOS implementation based on SDL window.

Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-02-02 02:23:25 +01:00
Lukasz Marek
4afe1c1178 lavd/opengl_enc: factorize create/release window functions
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-02-02 02:23:25 +01:00
Lukasz Marek
c9074b992e lavd/opengl_enc: rename GL_RED_COMPONENT define
Rename GL_RED_COMPONENT into FF_GL_RED_COMPONENT
to explicity mark it is internal define, not OpenGL API.

Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-02-02 02:23:08 +01:00
Lukasz Marek
c72f916c15 lavd/opengl_enc: create format description table
Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-02-02 01:03:45 +01:00
Lukasz Marek
ded6b3af41 lavd: add opengl device
It can render to OpenGL context provided by application or into SDL window

Signed-off-by: Lukasz Marek <lukasz.m.luki@gmail.com>
2014-01-27 15:18:18 +01:00