Commit graph

30 commits

Author SHA1 Message Date
Steveice10
28c542c2c2
build: Fix compiling citra-qt for iOS. (#6983)
* build: Fix compiling citra-qt for iOS.

* Update src/citra_qt/configuration/configure_general.cpp

Co-authored-by: Tobias <thm.frey@gmail.com>

---------

Co-authored-by: Tobias <thm.frey@gmail.com>
2023-09-17 16:07:56 -07:00
GPUCode
cf9bb90ae3
code: Use std::span where appropriate (#6658)
* code: Use std::span when possible

* code: Prefix memcpy and memcmp with std::
2023-07-07 01:52:40 +03:00
SachinVin
8eb89c260d core: fix warnings 2023-06-17 21:23:58 +05:30
Steveice10
38435e9b3e
Dynamically load FFmpeg and libfdk-aac if available. (#6570) 2023-06-17 02:06:18 +03:00
Steveice10
7d6c14e584
dumper: Fix pixel format for filters when passed in via encoder options. (#6553) 2023-05-19 10:58:05 -07:00
Steveice10
b89f5278ac
Revive: dumping/ffmpeg_backend: Various fixes (#6528)
* dumping/ffmpeg_backend: Add FPS filter

So that the recorded video can be at 60FPS (which is supported by most encoders) while still maintaining correct speed.

* dumping/ffmpeg_backend: Add HW context support

Required for some HW acceled encoders. Not tested as my devices don't seem to require this.

* CMake: Copy avfilter dll for MSVC

* CMakeLists: Require FFmpeg 4.0

* ffmpeg: Fix dumper compile error on MSVC.

* ffmpeg: Address review comments.

---------

Co-authored-by: zhupengfei <zhupf321@gmail.com>
2023-05-16 02:28:21 -07:00
Vitor K
34de77d429
Various miscelaneous changes (#6496) 2023-05-03 17:24:10 +02:00
SachinVin
41f13456c0
Chore: Enable warnings as errors on MSVC (#6456)
* tests: add Sanity test for SplitFilename83

fix test

fix test

* disable `C4715:not all control paths return a value` for nihstro includes

nihstro: no warn

* Chore: Enable warnings as errors on msvc + fix warnings

fixes

some more warnings

clang-format

* more fixes

* Externals: Add target_compile_options `/W0` nihstro-headers and ...

Revert "disable `C4715:not all control paths return a value` for nihstro includes"
This reverts commit 606d79b55d.

* src\citra\config.cpp: ReadSetting: simplify type casting

* settings.cpp: Get*Name: remove superflous logs
2023-05-01 22:38:58 +03:00
GPUCode
06f3c90cfb
Custom textures rewrite (#6452)
* common: Add thread pool from yuzu

* Is really useful for asynchronous operations like shader compilation and custom textures, will be used in following PRs

* core: Improve ImageInterface

* Provide a default implementation so frontends don't have to duplicate code registering the lodepng version

* Add a dds version too which we will use in the next commit

* rasterizer_cache: Rewrite custom textures

* There's just too much to talk about here, look at the PR description for more details

* rasterizer_cache: Implement basic pack configuration file

* custom_tex_manager: Flip dumped textures

* custom_tex_manager: Optimize custom texture hashing

* If no convertions are needed then we can hash the decoded data directly removing the needed for duplicate decode

* custom_tex_manager: Implement asynchronous texture loading

* The file loading and decoding is offloaded into worker threads, while the upload itself still occurs in the main thread to avoid having to manage shared contexts

* Address review comments

* custom_tex_manager: Introduce custom material support

* video_core: Move custom textures to separate directory

* Also split the files to make the code cleaner

* gl_texture_runtime: Generate mipmaps for material

* custom_tex_manager: Prevent memory overflow when preloading

* externals: Add dds-ktx as submodule

* string_util: Return vector from SplitString

* No code benefits from passing it as an argument

* custom_textures: Use json config file

* gl_rasterizer: Only bind material for unit 0

* Address review comments
2023-04-27 07:38:28 +03:00
GPUCode
48ee112ceb
Add per game configuration options (#6187)
* common: Move settings to common from core.

- Removes a dependency on core and input_common from common.

* code: Wrap settings values

* Port from yuzu to allow per game settings

* citra_qt: Initial per-game settings dialog

* citra_qt: Use new API for read/save of config values

* citra_qt: Per game audio settings

* citra_qt: Per game graphics settings

* citra_qt: Per game system settings

* citra_qt: Per game general settings

* citra_qt: Document and run clang format

* citra_qt: Make icon smaller and centered

* citra_qt: Remove version number

* Not sure how to extract that, can always add it back later

* citra_qt: Wrap UISettings

* citra_qt: Fix unthottled fps setting

* citra_qt: Remove margin in emulation tab

* citra_qt: Implement some suggestions

* Bring back speed switch hotkey

* Allow configuration when game is running

* Rename/adjust UI stuff

* citra_qt: Fix build with separate windows

* citra_qt: Address feedback

* citra_qt: Log per-game settings before launching games

* citra_qt: Add shader cache options

* Also fix android build

* citra_qt: Add DLC menu option

* citra_qt: Run clang-format

* citra_qt: Adjust for time offset

* citra_qt: Implement suggestions

* Run clang-format

Co-authored-by: bunnei <bunneidev@gmail.com>
2022-12-08 13:27:25 +02:00
Morph
3a43475149 core: Resolve C4267 warning on MSVC 2022-05-18 00:05:41 -04:00
feos
1382035d4d
explicitly set timebase for video stream (#6005)
fixes #5965
2022-04-23 21:53:53 +05:30
liushuyu
04f201ab34
dumping/ffmpeg_backend: add support for ffmpeg 5.0 2022-02-20 04:07:10 -07:00
xperia64
c873b38387 Update codec information 2020-06-11 22:05:29 -04:00
xperia64
c63797a096 Recomment the ffmpeg backend 2020-06-10 19:47:28 -04:00
xperia64
016d2b08e3 Fix ffmpeg time base 2020-06-10 19:42:23 -04:00
xperia64
5e95b35900 Update FPS to roughly match the actual 3DS rate 2020-04-26 03:22:11 -04:00
zhupengfei
22bfa7b5de
ffmpeg: Misc fixes
The most important one being adding a mutex to protect the format_context. Apparently it wasn't thread safe (as one'd expect) but I didn't think about that.

Should fix some of the strange issues happening with MP4 muxers, etc.
2020-03-21 12:02:21 +08:00
zhupengfei
a50ba7192b
citra_qt: Split options into 'Specific' and 'Generic'
For easier usage. Also made the option list sortable.
2020-02-28 18:26:20 +08:00
zhupengfei
f3e9780d10
ffmpeg: Avoid listing child classes for AVFormatContext and AVCodecContext
As they actually have every encoder/format as their child classes, this will result in a lot of extra options being added.
2020-02-28 16:40:13 +08:00
zhupengfei
a28eac08ae
ffmpeg: Properly handle non-planar formats
For non-planar formats, only the first data plane is used. Therefore,
they need to be handled differently in certain places.
2020-02-27 16:55:20 +08:00
zhupengfei
8c4bcf9f59
ffmpeg: Add ListFormats and ListEncoders
These two functions allow the frontend to get a list of encoders/formats and their specific options.

Retrieving the options is harder than it sounds due to FFmpeg's strange AVClass and AVOption system. For example, for integer and flags options, 'named constants' can be set. They are of type `AV_OPT_TYPE_CONST` and are categoried according to the `unit` field. An option can recognize all constants of the same `unit`.
2020-02-27 16:55:14 +08:00
zhupengfei
4161163d9c
ffmpeg: Correctly handle sample rates
Previously, we just used the native sample rate for encoding. However, some encoders like libmp3lame doesn't support it. Therefore, we now use a supported sample rate (preferring the native one if possible).

FFmpeg requires audio data to be sent in a sequence of frames, each containing the same specific number of samples. Previously, we buffered input samples in FFmpegBackend. However, as the source and destination sample rates can now be different, we should buffer resampled data instead. swresample have an internal input buffer, so we now just forward all data to it and 'gradually' receive resampled data, at most one frame_size at a time. When there is not enough resampled data to form a frame, we will record the current offset and request for less data on the next call.

Additionally, this commit also fixes a flaw. When an encoder supports variable frame sizes, its frame size is reported to be 0, which breaks our buffering system. Now we treat variable frame size encoders as having a frame size of 160 (the size of a HLE audio frame).
2020-02-27 16:55:13 +08:00
zhupengfei
8b9c01ded9
ffmpeg: Correctly handle sample format
We previously assumed that the first preferred sample format is planar, but that may not be true for all codecs. Instead we should find a supported sample format that is planar.
2020-02-27 16:55:12 +08:00
zhupengfei
17461b5d11
ffmpeg: Correctly set pixel format
While YUV420P is widely used, not all encoders accept it (e.g. Intel QSV only accepts NV12). We should use the codec's preferred pixel format instead as we need to rescale the frame anyway.
2020-02-27 16:55:11 +08:00
zhupengfei
016f8be0b8
core/dumping: Allow format/encoder selection+configuration
The ParamPackage got modified so that we can use range-based for on it
2020-02-27 16:55:10 +08:00
zhupengfei
3c6765e87c
core: Properly std::move things around 2020-02-27 16:55:09 +08:00
zhupengfei
06a0d86e9c
video_core, core: Move pixel download to its own thread
This uses the mailbox model to move pixel downloading to its own thread, eliminating Nvidia's warnings and (possibly) making use of GPU copy engine.

To achieve this, we created a new mailbox type that is different from the presentation mailbox in that it never discards a rendered frame.

Also, I tweaked the projection matrix thing so that it can just draw the frame upside down instead of having the CPU flip it.
2020-02-27 16:55:08 +08:00
zhupengfei
399a660faa
core/dumping: Add FFmpeg implementation
Sorry for the large diff, the implementation is quite long, and I can't really find a good way to split it into commits.
2019-08-14 09:27:04 +08:00
zhupengfei
3f64aaabbd
core: Add video dumper interface
The VideoFrame is rotated while copying, to put the pixels in their correct positions (OpenGL seems to return the image in reverted order by default)
2019-08-13 19:28:02 +08:00